Commit 0fe96975 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: mt7615: fix ssid configuration in mt7615_mcu_hw_scan

Fix SSID configuration performing hw frequency scanning
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent fb602b30
...@@ -2719,9 +2719,9 @@ int mt7615_mcu_hw_scan(struct mt7615_phy *phy, struct ieee80211_vif *vif, ...@@ -2719,9 +2719,9 @@ int mt7615_mcu_hw_scan(struct mt7615_phy *phy, struct ieee80211_vif *vif,
{ {
struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv; struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
struct cfg80211_scan_request *sreq = &scan_req->req; struct cfg80211_scan_request *sreq = &scan_req->req;
int n_ssids = 0, err, i, duration = MT7615_SCAN_CHANNEL_TIME;
int ext_channels_num = max_t(int, sreq->n_channels - 32, 0); int ext_channels_num = max_t(int, sreq->n_channels - 32, 0);
struct ieee80211_channel **scan_list = sreq->channels; struct ieee80211_channel **scan_list = sreq->channels;
int err, i, duration = MT7615_SCAN_CHANNEL_TIME;
struct mt7615_dev *dev = phy->dev; struct mt7615_dev *dev = phy->dev;
bool ext_phy = phy != &dev->phy; bool ext_phy = phy != &dev->phy;
struct mt7615_mcu_scan_channel *chan; struct mt7615_mcu_scan_channel *chan;
...@@ -2744,16 +2744,21 @@ int mt7615_mcu_hw_scan(struct mt7615_phy *phy, struct ieee80211_vif *vif, ...@@ -2744,16 +2744,21 @@ int mt7615_mcu_hw_scan(struct mt7615_phy *phy, struct ieee80211_vif *vif,
req->seq_num = mvif->scan_seq_num | ext_phy << 7; req->seq_num = mvif->scan_seq_num | ext_phy << 7;
req->bss_idx = mvif->idx; req->bss_idx = mvif->idx;
req->scan_type = 1; req->scan_type = 1;
req->ssid_type = 1;
req->probe_req_num = 2; req->probe_req_num = 2;
req->version = 1; req->version = 1;
req->channel_type = 4; req->channel_type = 4;
for (i = 0; i < sreq->n_ssids; i++) { for (i = 0; i < sreq->n_ssids; i++) {
if (!sreq->ssids[i].ssid_len)
continue;
req->ssids[i].ssid_len = cpu_to_le32(sreq->ssids[i].ssid_len); req->ssids[i].ssid_len = cpu_to_le32(sreq->ssids[i].ssid_len);
memcpy(req->ssids[i].ssid, sreq->ssids[i].ssid, memcpy(req->ssids[i].ssid, sreq->ssids[i].ssid,
sreq->ssids[i].ssid_len); sreq->ssids[i].ssid_len);
n_ssids++;
} }
req->ssid_type = n_ssids ? BIT(2) : BIT(0);
req->ssids_num = n_ssids;
req->timeout_value = cpu_to_le16(sreq->n_channels * duration); req->timeout_value = cpu_to_le16(sreq->n_channels * duration);
req->channel_min_dwell_time = cpu_to_le16(duration); req->channel_min_dwell_time = cpu_to_le16(duration);
......
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