Skip to content

Commit

Permalink
mt76: mt7615: fix ssid configuration in mt7615_mcu_hw_scan
Browse files Browse the repository at this point in the history
Fix SSID configuration performing hw frequency scanning

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed May 5, 2020
1 parent 04798aa commit 9636177
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mt7615/mcu.c
Expand Up @@ -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 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);
struct ieee80211_channel **scan_list = sreq->channels;
int err, i, duration = MT7615_SCAN_CHANNEL_TIME;
struct mt7615_dev *dev = phy->dev;
bool ext_phy = phy != &dev->phy;
struct mt7615_mcu_scan_channel *chan;
Expand All @@ -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->bss_idx = mvif->idx;
req->scan_type = 1;
req->ssid_type = 1;
req->probe_req_num = 2;
req->version = 1;
req->channel_type = 4;

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);
memcpy(req->ssids[i].ssid, sreq->ssids[i].ssid,
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->channel_min_dwell_time = cpu_to_le16(duration);
Expand Down

0 comments on commit 9636177

Please sign in to comment.