Commit a4e02f33 authored by Eliad Peller's avatar Eliad Peller Committed by Luciano Coelho

wl12xx: update scan cmd api

Update the scan command to use the new fw api
(fw 6/7.3.0.0.75).
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 04e8079c
...@@ -156,6 +156,11 @@ static int wl1271_scan_send(struct wl1271 *wl, enum ieee80211_band band, ...@@ -156,6 +156,11 @@ static int wl1271_scan_send(struct wl1271 *wl, enum ieee80211_band band,
if (passive || wl->scan.req->n_ssids == 0) if (passive || wl->scan.req->n_ssids == 0)
scan_options |= WL1271_SCAN_OPT_PASSIVE; scan_options |= WL1271_SCAN_OPT_PASSIVE;
if (WARN_ON(wl->role_id == WL12XX_INVALID_ROLE_ID)) {
ret = -EINVAL;
goto out;
}
cmd->params.role_id = wl->role_id;
cmd->params.scan_options = cpu_to_le16(scan_options); cmd->params.scan_options = cpu_to_le16(scan_options);
cmd->params.n_ch = wl1271_get_scan_channels(wl, wl->scan.req, cmd->params.n_ch = wl1271_get_scan_channels(wl, wl->scan.req,
...@@ -167,7 +172,6 @@ static int wl1271_scan_send(struct wl1271 *wl, enum ieee80211_band band, ...@@ -167,7 +172,6 @@ static int wl1271_scan_send(struct wl1271 *wl, enum ieee80211_band band,
} }
cmd->params.tx_rate = cpu_to_le32(basic_rate); cmd->params.tx_rate = cpu_to_le32(basic_rate);
cmd->params.n_probe_reqs = wl->conf.scan.num_probe_reqs; cmd->params.n_probe_reqs = wl->conf.scan.num_probe_reqs;
cmd->params.tx_rate = cpu_to_le32(basic_rate); cmd->params.tx_rate = cpu_to_le32(basic_rate);
cmd->params.tid_trigger = 0; cmd->params.tid_trigger = 0;
...@@ -183,6 +187,8 @@ static int wl1271_scan_send(struct wl1271 *wl, enum ieee80211_band band, ...@@ -183,6 +187,8 @@ static int wl1271_scan_send(struct wl1271 *wl, enum ieee80211_band band,
memcpy(cmd->params.ssid, wl->scan.ssid, wl->scan.ssid_len); memcpy(cmd->params.ssid, wl->scan.ssid, wl->scan.ssid_len);
} }
memcpy(cmd->addr, wl->mac_addr, ETH_ALEN);
ret = wl1271_cmd_build_probe_req(wl, wl->scan.ssid, wl->scan.ssid_len, ret = wl1271_cmd_build_probe_req(wl, wl->scan.ssid, wl->scan.ssid_len,
wl->scan.req->ie, wl->scan.req->ie_len, wl->scan.req->ie, wl->scan.req->ie_len,
band); band);
......
...@@ -46,7 +46,10 @@ void wl1271_scan_sched_scan_results(struct wl1271 *wl); ...@@ -46,7 +46,10 @@ void wl1271_scan_sched_scan_results(struct wl1271 *wl);
#define WL1271_SCAN_CURRENT_TX_PWR 0 #define WL1271_SCAN_CURRENT_TX_PWR 0
#define WL1271_SCAN_OPT_ACTIVE 0 #define WL1271_SCAN_OPT_ACTIVE 0
#define WL1271_SCAN_OPT_PASSIVE 1 #define WL1271_SCAN_OPT_PASSIVE 1
#define WL1271_SCAN_OPT_TRIGGERED_SCAN 2
#define WL1271_SCAN_OPT_PRIORITY_HIGH 4 #define WL1271_SCAN_OPT_PRIORITY_HIGH 4
/* scan even if we fail to enter psm */
#define WL1271_SCAN_OPT_FORCE 8
#define WL1271_SCAN_BAND_2_4_GHZ 0 #define WL1271_SCAN_BAND_2_4_GHZ 0
#define WL1271_SCAN_BAND_5_GHZ 1 #define WL1271_SCAN_BAND_5_GHZ 1
...@@ -62,27 +65,27 @@ enum { ...@@ -62,27 +65,27 @@ enum {
}; };
struct basic_scan_params { struct basic_scan_params {
__le32 rx_config_options;
__le32 rx_filter_options;
/* Scan option flags (WL1271_SCAN_OPT_*) */ /* Scan option flags (WL1271_SCAN_OPT_*) */
__le16 scan_options; __le16 scan_options;
u8 role_id;
/* Number of scan channels in the list (maximum 30) */ /* Number of scan channels in the list (maximum 30) */
u8 n_ch; u8 n_ch;
/* This field indicates the number of probe requests to send /* This field indicates the number of probe requests to send
per channel for an active scan */ per channel for an active scan */
u8 n_probe_reqs; u8 n_probe_reqs;
/* Rate bit field for sending the probes */
__le32 tx_rate;
u8 tid_trigger; u8 tid_trigger;
u8 ssid_len; u8 ssid_len;
/* in order to align */ u8 use_ssid_list;
u8 padding1[2];
/* Rate bit field for sending the probes */
__le32 tx_rate;
u8 ssid[IEEE80211_MAX_SSID_LEN]; u8 ssid[IEEE80211_MAX_SSID_LEN];
/* Band to scan */ /* Band to scan */
u8 band; u8 band;
u8 use_ssid_list;
u8 scan_tag; u8 scan_tag;
u8 padding2; u8 padding2[2];
} __packed; } __packed;
struct basic_scan_channel_params { struct basic_scan_channel_params {
...@@ -105,6 +108,10 @@ struct wl1271_cmd_scan { ...@@ -105,6 +108,10 @@ struct wl1271_cmd_scan {
struct basic_scan_params params; struct basic_scan_params params;
struct basic_scan_channel_params channels[WL1271_SCAN_MAX_CHANNELS]; struct basic_scan_channel_params channels[WL1271_SCAN_MAX_CHANNELS];
/* src mac address */
u8 addr[ETH_ALEN];
u8 padding[2];
} __packed; } __packed;
struct wl1271_cmd_trigger_scan_to { struct wl1271_cmd_trigger_scan_to {
...@@ -184,7 +191,7 @@ struct wl1271_cmd_sched_scan_config { ...@@ -184,7 +191,7 @@ struct wl1271_cmd_sched_scan_config {
} __packed; } __packed;
#define SCHED_SCAN_MAX_SSIDS 8 #define SCHED_SCAN_MAX_SSIDS 16
enum { enum {
SCAN_SSID_TYPE_PUBLIC = 0, SCAN_SSID_TYPE_PUBLIC = 0,
......
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