Commit 7b0a0e3c authored by Johannes Berg's avatar Johannes Berg
Browse files

wifi: cfg80211: do some rework towards MLO link APIs



In order to support multi-link operation with multiple links,
start adding some APIs. The notable addition here is to have
the link ID in a new nl80211 attribute, that will be used to
differentiate the links in many nl80211 operations.

So far, this patch adds the netlink NL80211_ATTR_MLO_LINK_ID
attribute (as well as the NL80211_ATTR_MLO_LINKS attribute)
and plugs it through the system in some places, checking the
validity etc. along with other infrastructure needed for it.

For now, I've decided to include only the over-the-air link
ID in the API. I know we discussed that we eventually need to
have to have other ways of identifying a link, but for local
AP mode and auth/assoc commands as well as set_key etc. we'll
use the OTA ID.

Also included in this patch is some refactoring of the data
structures in struct wireless_dev, splitting for the first
time the data into type dependent pieces, to make reasoning
about these things easier.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 92ea8df1
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1119,7 +1119,7 @@ void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq,
					NL80211_CHAN_HT20 : NL80211_CHAN_NO_HT);

	mutex_lock(&vif->wdev.mtx);
	cfg80211_ch_switch_notify(vif->ndev, &chandef);
	cfg80211_ch_switch_notify(vif->ndev, &chandef, 0);
	mutex_unlock(&vif->wdev.mtx);
}

@@ -2967,7 +2967,8 @@ static int ath6kl_change_beacon(struct wiphy *wiphy, struct net_device *dev,
	return ath6kl_set_ies(vif, beacon);
}

static int ath6kl_stop_ap(struct wiphy *wiphy, struct net_device *dev)
static int ath6kl_stop_ap(struct wiphy *wiphy, struct net_device *dev,
			  unsigned int link_id)
{
	struct ath6kl *ar = ath6kl_priv(dev);
	struct ath6kl_vif *vif = netdev_priv(dev);
@@ -3368,6 +3369,7 @@ static int ath6kl_cfg80211_sscan_stop(struct wiphy *wiphy,

static int ath6kl_cfg80211_set_bitrate(struct wiphy *wiphy,
				       struct net_device *dev,
				       unsigned int link_id,
				       const u8 *addr,
				       const struct cfg80211_bitrate_mask *mask)
{
+5 −4
Original line number Diff line number Diff line
@@ -2098,8 +2098,8 @@ static int wil_cfg80211_change_beacon(struct wiphy *wiphy,
			     bcon->tail_len))
		privacy = 1;

	memcpy(vif->ssid, wdev->ssid, wdev->ssid_len);
	vif->ssid_len = wdev->ssid_len;
	memcpy(vif->ssid, wdev->u.ap.ssid, wdev->u.ap.ssid_len);
	vif->ssid_len = wdev->u.ap.ssid_len;

	/* in case privacy has changed, need to restart the AP */
	if (vif->privacy != privacy) {
@@ -2108,7 +2108,7 @@ static int wil_cfg80211_change_beacon(struct wiphy *wiphy,

		rc = _wil_cfg80211_start_ap(wiphy, ndev, vif->ssid,
					    vif->ssid_len, privacy,
					    wdev->beacon_interval,
					    wdev->links[0].ap.beacon_interval,
					    vif->channel,
					    vif->wmi_edmg_channel, bcon,
					    vif->hidden_ssid,
@@ -2186,7 +2186,8 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy,
}

static int wil_cfg80211_stop_ap(struct wiphy *wiphy,
				struct net_device *ndev)
				struct net_device *ndev,
				unsigned int link_id)
{
	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
	struct wil6210_vif *vif = ndev_to_vif(ndev);
+3 −1
Original line number Diff line number Diff line
@@ -4965,7 +4965,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
	return err;
}

static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev,
				  unsigned int link_id)
{
	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
	struct brcmf_if *ifp = netdev_priv(ndev);
@@ -5302,6 +5303,7 @@ brcmf_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,

static int brcmf_cfg80211_get_channel(struct wiphy *wiphy,
				      struct wireless_dev *wdev,
				      unsigned int link_id,
				      struct cfg80211_chan_def *chandef)
{
	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
+5 −5
Original line number Diff line number Diff line
@@ -109,9 +109,9 @@ static int lbs_mesh_config(struct lbs_private *priv, uint16_t action,

		if (priv->mesh_dev) {
			mesh_wdev = priv->mesh_dev->ieee80211_ptr;
			ie->val.mesh_id_len = mesh_wdev->mesh_id_up_len;
			memcpy(ie->val.mesh_id, mesh_wdev->ssid,
						mesh_wdev->mesh_id_up_len);
			ie->val.mesh_id_len = mesh_wdev->u.mesh.id_up_len;
			memcpy(ie->val.mesh_id, mesh_wdev->u.mesh.id,
						mesh_wdev->u.mesh.id_up_len);
		}

		ie->len = sizeof(struct mrvl_meshie_val) -
@@ -986,8 +986,8 @@ static int lbs_add_mesh(struct lbs_private *priv)
	mesh_wdev->wiphy = priv->wdev->wiphy;

	if (priv->mesh_tlv) {
		sprintf(mesh_wdev->ssid, "mesh");
		mesh_wdev->mesh_id_up_len = 4;
		sprintf(mesh_wdev->u.mesh.id, "mesh");
		mesh_wdev->u.mesh.id_up_len = 4;
	}

	mesh_wdev->netdev = mesh_dev;
+1 −1
Original line number Diff line number Diff line
@@ -304,6 +304,6 @@ void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work)
	mwifiex_dbg(priv->adapter, MSG,
		    "indicating channel switch completion to kernel\n");
	mutex_lock(&priv->wdev.mtx);
	cfg80211_ch_switch_notify(priv->netdev, &priv->dfs_chandef);
	cfg80211_ch_switch_notify(priv->netdev, &priv->dfs_chandef, 0);
	mutex_unlock(&priv->wdev.mtx);
}
Loading