Commit 5fdba8a7 authored by Sean Wang's avatar Sean Wang Committed by Felix Fietkau

mt76: mt7663: add support to sched scan with randomise addr

Add support to sched scan with randomise addr
Co-developed-by: default avatarWan-Feng Jiang <Wan-Feng.Jiang@mediatek.com>
Signed-off-by: default avatarWan-Feng Jiang <Wan-Feng.Jiang@mediatek.com>
Co-developed-by: default avatarSoul Huang <Soul.Huang@mediatek.com>
Signed-off-by: default avatarSoul Huang <Soul.Huang@mediatek.com>
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Co-developed-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent a72ad451
......@@ -139,7 +139,8 @@ void mt7615_check_offload_capability(struct mt7615_dev *dev)
ieee80211_hw_set(hw, SUPPORTS_PS);
ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS);
wiphy->features |= NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR;
wiphy->features |= NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR |
NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR;
} else {
dev->ops->hw_scan = NULL;
dev->ops->cancel_hw_scan = NULL;
......
......@@ -2907,7 +2907,12 @@ int mt7615_mcu_sched_scan_req(struct mt7615_phy *phy,
req = (struct mt7615_sched_scan_req *)skb_put(skb, sizeof(*req));
req->version = 1;
req->seq_num = mvif->scan_seq_num | ext_phy << 7;
req->scan_func = !!(sreq->flags & NL80211_SCAN_FLAG_RANDOM_ADDR);
if (sreq->flags & NL80211_SCAN_FLAG_RANDOM_ADDR) {
get_random_mask_addr(req->random_mac, sreq->mac_addr,
sreq->mac_addr_mask);
req->scan_func = 1;
}
req->ssids_num = sreq->n_ssids;
for (i = 0; i < req->ssids_num; i++) {
......
......@@ -405,10 +405,11 @@ struct mt7615_sched_scan_req {
u8 channel_type;
u8 channels_num;
u8 intervals_num;
u8 scan_func;
u8 scan_func; /* BIT(0) eable random mac address */
struct mt7615_mcu_scan_channel channels[64];
__le16 intervals[MT7615_MAX_SCHED_SCAN_INTERVAL];
u8 pad2[64];
u8 random_mac[ETH_ALEN]; /* valid when BIT(0) in scan_func is set */
u8 pad2[58];
} __packed;
struct nt7615_sched_scan_done {
......
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