Commit eabb03b4 authored by Lior David's avatar Lior David Committed by Kalle Valo

wil6210: basic PBSS/PCP support

PBSS (Personal Basic Service Set) is a new BSS type for DMG
networks. It is similar to infrastructure BSS, having an AP-like
entity called PCP (PBSS Control Point), but it has few differences.
For example, stations inside a PBSS can communicate directly, and
the PCP role can be transferred between stations.

This change adds PBSS support, and has 2 main parts:
1. When starting an AP, add an option to start as a PCP instead.
This is implemented by a new PBSS flag which is passed as part of
the cfg80211_ap_settings structure.
2. When connecting to a BSS, add an option to connect to a PCP
instead of an AP. This is again implemented by a new PBSS flag,
added to the cfg80211_connect_params structure.
Signed-off-by: default avatarLior David <qca_liord@qca.qualcomm.com>
Signed-off-by: default avatarMaya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent b874ddec
...@@ -402,6 +402,7 @@ static void wil_print_connect_params(struct wil6210_priv *wil, ...@@ -402,6 +402,7 @@ static void wil_print_connect_params(struct wil6210_priv *wil,
print_hex_dump(KERN_INFO, " SSID: ", DUMP_PREFIX_OFFSET, print_hex_dump(KERN_INFO, " SSID: ", DUMP_PREFIX_OFFSET,
16, 1, sme->ssid, sme->ssid_len, true); 16, 1, sme->ssid, sme->ssid_len, true);
wil_info(wil, " Privacy: %s\n", sme->privacy ? "secure" : "open"); wil_info(wil, " Privacy: %s\n", sme->privacy ? "secure" : "open");
wil_info(wil, " PBSS: %d\n", sme->pbss);
wil_print_crypto(wil, &sme->crypto); wil_print_crypto(wil, &sme->crypto);
} }
...@@ -416,6 +417,7 @@ static int wil_cfg80211_connect(struct wiphy *wiphy, ...@@ -416,6 +417,7 @@ static int wil_cfg80211_connect(struct wiphy *wiphy,
const u8 *rsn_eid; const u8 *rsn_eid;
int ch; int ch;
int rc = 0; int rc = 0;
enum ieee80211_bss_type bss_type = IEEE80211_BSS_TYPE_ESS;
wil_print_connect_params(wil, sme); wil_print_connect_params(wil, sme);
...@@ -434,14 +436,12 @@ static int wil_cfg80211_connect(struct wiphy *wiphy, ...@@ -434,14 +436,12 @@ static int wil_cfg80211_connect(struct wiphy *wiphy,
if (sme->privacy && !rsn_eid) if (sme->privacy && !rsn_eid)
wil_info(wil, "WSC connection\n"); wil_info(wil, "WSC connection\n");
if (sme->pbss) { if (sme->pbss)
wil_err(wil, "connect - PBSS not yet supported\n"); bss_type = IEEE80211_BSS_TYPE_PBSS;
return -EOPNOTSUPP;
}
bss = cfg80211_get_bss(wiphy, sme->channel, sme->bssid, bss = cfg80211_get_bss(wiphy, sme->channel, sme->bssid,
sme->ssid, sme->ssid_len, sme->ssid, sme->ssid_len,
IEEE80211_BSS_TYPE_ESS, IEEE80211_PRIVACY_ANY); bss_type, IEEE80211_PRIVACY_ANY);
if (!bss) { if (!bss) {
wil_err(wil, "Unable to find BSS\n"); wil_err(wil, "Unable to find BSS\n");
return -ENOENT; return -ENOENT;
...@@ -936,13 +936,16 @@ static int _wil_cfg80211_start_ap(struct wiphy *wiphy, ...@@ -936,13 +936,16 @@ static int _wil_cfg80211_start_ap(struct wiphy *wiphy,
const u8 *ssid, size_t ssid_len, u32 privacy, const u8 *ssid, size_t ssid_len, u32 privacy,
int bi, u8 chan, int bi, u8 chan,
struct cfg80211_beacon_data *bcon, struct cfg80211_beacon_data *bcon,
u8 hidden_ssid) u8 hidden_ssid, u32 pbss)
{ {
struct wil6210_priv *wil = wiphy_to_wil(wiphy); struct wil6210_priv *wil = wiphy_to_wil(wiphy);
int rc; int rc;
struct wireless_dev *wdev = ndev->ieee80211_ptr; struct wireless_dev *wdev = ndev->ieee80211_ptr;
u8 wmi_nettype = wil_iftype_nl2wmi(wdev->iftype); u8 wmi_nettype = wil_iftype_nl2wmi(wdev->iftype);
if (pbss)
wmi_nettype = WMI_NETTYPE_P2P;
wil_set_recovery_state(wil, fw_recovery_idle); wil_set_recovery_state(wil, fw_recovery_idle);
mutex_lock(&wil->mutex); mutex_lock(&wil->mutex);
...@@ -963,6 +966,7 @@ static int _wil_cfg80211_start_ap(struct wiphy *wiphy, ...@@ -963,6 +966,7 @@ static int _wil_cfg80211_start_ap(struct wiphy *wiphy,
wil->privacy = privacy; wil->privacy = privacy;
wil->channel = chan; wil->channel = chan;
wil->hidden_ssid = hidden_ssid; wil->hidden_ssid = hidden_ssid;
wil->pbss = pbss;
netif_carrier_on(ndev); netif_carrier_on(ndev);
...@@ -1012,7 +1016,8 @@ static int wil_cfg80211_change_beacon(struct wiphy *wiphy, ...@@ -1012,7 +1016,8 @@ static int wil_cfg80211_change_beacon(struct wiphy *wiphy,
wdev->ssid_len, privacy, wdev->ssid_len, privacy,
wdev->beacon_interval, wdev->beacon_interval,
wil->channel, bcon, wil->channel, bcon,
wil->hidden_ssid); wil->hidden_ssid,
wil->pbss);
} else { } else {
rc = _wil_cfg80211_set_ies(wiphy, bcon); rc = _wil_cfg80211_set_ies(wiphy, bcon);
} }
...@@ -1038,11 +1043,6 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy, ...@@ -1038,11 +1043,6 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy,
return -EINVAL; return -EINVAL;
} }
if (info->pbss) {
wil_err(wil, "AP: PBSS not yet supported\n");
return -EOPNOTSUPP;
}
switch (info->hidden_ssid) { switch (info->hidden_ssid) {
case NL80211_HIDDEN_SSID_NOT_IN_USE: case NL80211_HIDDEN_SSID_NOT_IN_USE:
hidden_ssid = WMI_HIDDEN_SSID_DISABLED; hidden_ssid = WMI_HIDDEN_SSID_DISABLED;
...@@ -1068,6 +1068,7 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy, ...@@ -1068,6 +1068,7 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy,
info->hidden_ssid); info->hidden_ssid);
wil_dbg_misc(wil, "BI %d DTIM %d\n", info->beacon_interval, wil_dbg_misc(wil, "BI %d DTIM %d\n", info->beacon_interval,
info->dtim_period); info->dtim_period);
wil_dbg_misc(wil, "PBSS %d\n", info->pbss);
print_hex_dump_bytes("SSID ", DUMP_PREFIX_OFFSET, print_hex_dump_bytes("SSID ", DUMP_PREFIX_OFFSET,
info->ssid, info->ssid_len); info->ssid, info->ssid_len);
wil_print_bcon_data(bcon); wil_print_bcon_data(bcon);
...@@ -1076,7 +1077,7 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy, ...@@ -1076,7 +1077,7 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy,
rc = _wil_cfg80211_start_ap(wiphy, ndev, rc = _wil_cfg80211_start_ap(wiphy, ndev,
info->ssid, info->ssid_len, info->privacy, info->ssid, info->ssid_len, info->privacy,
info->beacon_interval, channel->hw_value, info->beacon_interval, channel->hw_value,
bcon, hidden_ssid); bcon, hidden_ssid, info->pbss);
return rc; return rc;
} }
......
...@@ -604,6 +604,8 @@ struct wil6210_priv { ...@@ -604,6 +604,8 @@ struct wil6210_priv {
struct wil_platform_ops platform_ops; struct wil_platform_ops platform_ops;
struct pmc_ctx pmc; struct pmc_ctx pmc;
bool pbss;
}; };
#define wil_to_wiphy(i) (i->wdev->wiphy) #define wil_to_wiphy(i) (i->wdev->wiphy)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment