diff options
author | sanfran <sanfran.shen@broadcom.corp-partner.google.com> | 2020-06-24 07:54:30 +0800 |
---|---|---|
committer | Ahmed ElArabawy <arabawy@google.com> | 2020-07-06 11:19:59 -0700 |
commit | da6ca6c328d788bd45a9049b4c4e7dfd5e662b7e (patch) | |
tree | f4a0fa07a8e3d14ca70d48761a9d3e4c4be0b57b | |
parent | 9e0fabc8607d33cc008d4c6443ea8a80b49519d9 (diff) | |
download | bcm43752-da6ca6c328d788bd45a9049b4c4e7dfd5e662b7e.tar.gz |
ANQP Random Source Address
Support ANQP random SA from wpa_supplicant
Bug: 155491082
Test: Check if anqp sa address is from wpa_supplicant
Signed-off-by: sanfran <sanfran.shen@broadcom.corp-partner.google.com>
Change-Id: Ibc550d330f262a945a68ab042161a6a0b073d9f0
Signed-off-by: sanfran <sanfran.shen@broadcom.corp-partner.google.com>
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
-rwxr-xr-x | Kbuild | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | dhd.h | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | dhd_linux.h | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | wl_cfg80211.c | 9 | ||||
-rwxr-xr-x[-rw-r--r--] | wl_cfgp2p.c | 15 |
5 files changed, 33 insertions, 0 deletions
@@ -131,6 +131,9 @@ DHDCFLAGS += -DDEBUGABILITY # Notify the MAC changed to wpa_supplicant DHDCFLAGS += -DDHD_NOTIFY_MAC_CHANGED +# Random ANQP source address +DHDCFLAGS += -DANQP_RANDOM_SA + # Enable wakelock debug function DHDCFLAGS += -DDHD_TRACE_WAKE_LOCK @@ -1483,6 +1483,9 @@ typedef struct dhd_pub { #ifdef WL_CFGVENDOR_SEND_ALERT_EVENT uint32 alert_reason; /* reason codes for alert event */ #endif +#ifdef ANQP_RANDOM_SA + struct ether_addr anqp_sa; /* ANQP SA Random */ +#endif /* ANQP_RANDOM_SA */ } dhd_pub_t; #if defined(__linux__) diff --git a/dhd_linux.h b/dhd_linux.h index 62c8fc8..bfaf63d 100644..100755 --- a/dhd_linux.h +++ b/dhd_linux.h @@ -424,4 +424,7 @@ extern void dhd_reset_tcpsync_info_by_dev(struct net_device *dev); #ifdef PCIE_FULL_DONGLE extern void dhd_net_del_flowrings_sta(dhd_pub_t * dhd, struct net_device * ndev); #endif /* PCIE_FULL_DONGLE */ +#ifdef ANQP_RANDOM_SA +int _dhd_set_mac_address(struct dhd_info *dhdinfo, int ifidx, uint8 *addr); +#endif /* ANQP_RANDOM_SA */ #endif /* __DHD_LINUX_H__ */ diff --git a/wl_cfg80211.c b/wl_cfg80211.c index bf6d211..e19c706 100644..100755 --- a/wl_cfg80211.c +++ b/wl_cfg80211.c @@ -9657,6 +9657,9 @@ wl_cfg80211_mgmt_tx(struct wiphy *wiphy, bcm_struct_cfgdev *cfgdev, u32 id; bool ack = false; s8 eabuf[ETHER_ADDR_STR_LEN]; +#ifdef ANQP_RANDOM_SA + dhd_pub_t *dhd = cfg->pub; +#endif /* ANQP_RANDOM_SA */ WL_DBG(("Enter \n")); @@ -9769,6 +9772,9 @@ wl_cfg80211_mgmt_tx(struct wiphy *wiphy, bcm_struct_cfgdev *cfgdev, goto exit; } else if (ieee80211_is_action(mgmt->frame_control)) { +#ifdef ANQP_RANDOM_SA + memcpy(dhd->anqp_sa.octet, mgmt->sa, ETH_ALEN); +#endif /* ANQP_RANDOM_SA */ /* Abort the dwell time of any previous off-channel * action frame that may be still in effect. Sending * off-channel action frames relies on the driver's @@ -13474,6 +13480,9 @@ static s32 wl_setup_wiphy(struct wireless_dev *wdev, struct device *sdiofunc_dev wiphy_ext_feature_set(wdev->wiphy, NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE); wiphy_ext_feature_set(wdev->wiphy, NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION); #endif /* WL_OCE */ +#ifdef ANQP_RANDOM_SA + wiphy_ext_feature_set(wdev->wiphy, NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA); +#endif /* ANQP_RANDOM_SA */ return err; } diff --git a/wl_cfgp2p.c b/wl_cfgp2p.c index 1b36053..a4cd14d 100644..100755 --- a/wl_cfgp2p.c +++ b/wl_cfgp2p.c @@ -57,6 +57,9 @@ #include <dhd_bus.h> static s8 scanparambuf[WLC_IOCTL_MEDLEN]; +#ifdef ANQP_RANDOM_SA +static bool tx_gas_init_reg = FALSE; +#endif /* ANQP_RANDOM_SA */ static bool wl_cfgp2p_has_ie(const bcm_tlv_t *ie, const u8 **tlvs, u32 *tlvs_len, const u8 *oui, u32 oui_len, u8 type); @@ -294,6 +297,7 @@ void wl_cfgp2p_print_actframe(bool tx, void *frame, u32 frame_len, u32 channel) sd_act_frm = (wifi_p2psd_gas_pub_act_frame_t *)frame; switch (sd_act_frm->action) { case P2PSD_ACTION_ID_GAS_IREQ: + tx_gas_init_reg = TRUE; CFGP2P_ACTION(("%s GAS Initial Request," " channel=%d\n", (tx)? "TX" : "RX", channel)); break; @@ -1698,6 +1702,9 @@ wl_cfgp2p_tx_action_frame(struct bcm_cfg80211 *cfg, struct net_device *dev, s32 evt_ret = BCME_OK; s32 timeout = 0; wl_eventmsg_buf_t buf; +#ifdef ANQP_RANDOM_SA + dhd_pub_t *dhdp = wl_cfg80211_get_dhdp(dev); +#endif /* ANQP_RANDOM_SA */ CFGP2P_DBG(("\n")); CFGP2P_ACTION(("channel : %u , dwell time : %u wait_afrx:%d\n", @@ -1721,6 +1728,14 @@ wl_cfgp2p_tx_action_frame(struct bcm_cfg80211 *cfg, struct net_device *dev, cfg->af_tx_sent_jiffies = jiffies; #endif /* WL_CFG80211_SYNC_GON */ +#ifdef ANQP_RANDOM_SA + if((tx_gas_init_reg == TRUE) && memcmp(dhdp->anqp_sa.octet, dhdp->mac.octet, ETH_ALEN)){ + _dhd_set_mac_address(dhdp->info, 0, dhdp->anqp_sa.octet); + CFGP2P_ACTION(("actframe SA " MACDBG "\n", MAC2STRDBG(dhdp->mac.octet))); + } + tx_gas_init_reg = FALSE; +#endif /* ANQP_RANDOM_SA */ + ret = wldev_iovar_setbuf_bsscfg(dev, "actframe", af_params, sizeof(*af_params), cfg->ioctl_buf, WLC_IOCTL_MAXLEN, bssidx, &cfg->ioctl_buf_sync); |