Skip to content

Commit

Permalink
qtnfmac: support WPA3 SAE in AP mode
Browse files Browse the repository at this point in the history
Enable WPA3 SAE support in AP mode. Driver currently supports cards
that offload SAE authentication to userspace. So allow userspace
software to subscribe and to send AUTH frames. Besides, enable
AP mode support in external_auth cfg80211 callback.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Sergey Matyukevich authored and Kalle Valo committed Mar 12, 2020
1 parent e6e0f09 commit b3860e7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
9 changes: 4 additions & 5 deletions drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ qtnf_mgmt_stypes[NUM_NL80211_IFTYPES] = {
BIT(IEEE80211_STYPE_AUTH >> 4),
},
[NL80211_IFTYPE_AP] = {
.tx = BIT(IEEE80211_STYPE_ACTION >> 4),
.tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
BIT(IEEE80211_STYPE_AUTH >> 4),
.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
Expand Down Expand Up @@ -679,10 +680,8 @@ qtnf_external_auth(struct wiphy *wiphy, struct net_device *dev,
struct qtnf_vif *vif = qtnf_netdev_get_priv(dev);
int ret;

if (vif->wdev.iftype != NL80211_IFTYPE_STATION)
return -EOPNOTSUPP;

if (!ether_addr_equal(vif->bssid, auth->bssid))
if (vif->wdev.iftype == NL80211_IFTYPE_STATION &&
!ether_addr_equal(vif->bssid, auth->bssid))
pr_warn("unexpected bssid: %pM", auth->bssid);

ret = qtnf_cmd_send_external_auth(vif, auth);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/quantenna/qtnfmac/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -2211,7 +2211,7 @@ int qtnf_cmd_send_external_auth(struct qtnf_vif *vif,

cmd = (struct qlink_cmd_external_auth *)cmd_skb->data;

ether_addr_copy(cmd->bssid, auth->bssid);
ether_addr_copy(cmd->peer, auth->bssid);
cmd->status = cpu_to_le16(auth->status);

qtnf_bus_lock(vif->mac->bus);
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/wireless/quantenna/qtnfmac/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,9 @@ qtnf_event_handle_external_auth(struct qtnf_vif *vif,
ether_addr_copy(auth.bssid, ev->bssid);
auth.action = ev->action;

pr_info("%s: external auth bss=%pM action=%u akm=%u\n",
vif->netdev->name, auth.bssid, auth.action,
auth.key_mgmt_suite);
pr_debug("%s: external SAE processing: bss=%pM action=%u akm=%u\n",
vif->netdev->name, auth.bssid, auth.action,
auth.key_mgmt_suite);

ret = cfg80211_external_auth_request(vif->netdev, &auth, GFP_KERNEL);
if (ret)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/quantenna/qtnfmac/qlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ struct qlink_cmd_connect {
*/
struct qlink_cmd_external_auth {
struct qlink_cmd chdr;
u8 bssid[ETH_ALEN];
u8 peer[ETH_ALEN];
__le16 status;
u8 payload[0];
} __packed;
Expand Down

0 comments on commit b3860e7

Please sign in to comment.