wlcore: add role_id to all the sched_scan commands

Due to a need by the firmware when working in multirole
the role id needs to be added to the structs of the
following commands:
CMD_CONNECTION_SCAN_CFG, CMD_CONNECTION_SCAN_SSID_CFG,
CMD_START_PERIODIC_SCAN, CMD_STOP_PERIODIC_SCAN

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
This commit is contained in:
Yoni Divinsky 2012-05-16 11:34:17 +03:00 committed by Luciano Coelho
parent 186b5a7c93
commit 78f85f5066
3 changed files with 19 additions and 9 deletions

View File

@ -2421,7 +2421,7 @@ static int wl1271_sta_handle_idle(struct wl1271 *wl, struct wl12xx_vif *wlvif,
} else { } else {
/* The current firmware only supports sched_scan in idle */ /* The current firmware only supports sched_scan in idle */
if (wl->sched_scanning) { if (wl->sched_scanning) {
wl1271_scan_sched_scan_stop(wl); wl1271_scan_sched_scan_stop(wl, wlvif);
ieee80211_sched_scan_stopped(wl->hw); ieee80211_sched_scan_stopped(wl->hw);
} }
@ -3152,6 +3152,7 @@ static void wl1271_op_sched_scan_stop(struct ieee80211_hw *hw,
struct ieee80211_vif *vif) struct ieee80211_vif *vif)
{ {
struct wl1271 *wl = hw->priv; struct wl1271 *wl = hw->priv;
struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
int ret; int ret;
wl1271_debug(DEBUG_MAC80211, "wl1271_op_sched_scan_stop"); wl1271_debug(DEBUG_MAC80211, "wl1271_op_sched_scan_stop");
@ -3165,7 +3166,7 @@ static void wl1271_op_sched_scan_stop(struct ieee80211_hw *hw,
if (ret < 0) if (ret < 0)
goto out; goto out;
wl1271_scan_sched_scan_stop(wl); wl1271_scan_sched_scan_stop(wl, wlvif);
wl1271_ps_elp_sleep(wl); wl1271_ps_elp_sleep(wl);
out: out:

View File

@ -537,6 +537,7 @@ wl1271_scan_sched_scan_channels(struct wl1271 *wl,
/* Returns the scan type to be used or a negative value on error */ /* Returns the scan type to be used or a negative value on error */
static int static int
wl12xx_scan_sched_scan_ssid_list(struct wl1271 *wl, wl12xx_scan_sched_scan_ssid_list(struct wl1271 *wl,
struct wl12xx_vif *wlvif,
struct cfg80211_sched_scan_request *req) struct cfg80211_sched_scan_request *req)
{ {
struct wl1271_cmd_sched_scan_ssid_list *cmd = NULL; struct wl1271_cmd_sched_scan_ssid_list *cmd = NULL;
@ -565,6 +566,7 @@ wl12xx_scan_sched_scan_ssid_list(struct wl1271 *wl,
goto out; goto out;
} }
cmd->role_id = wlvif->dev_role_id;
if (!n_match_ssids) { if (!n_match_ssids) {
/* No filter, with ssids */ /* No filter, with ssids */
type = SCAN_SSID_FILTER_DISABLED; type = SCAN_SSID_FILTER_DISABLED;
@ -652,6 +654,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
if (!cfg) if (!cfg)
return -ENOMEM; return -ENOMEM;
cfg->role_id = wlvif->dev_role_id;
cfg->rssi_threshold = c->rssi_threshold; cfg->rssi_threshold = c->rssi_threshold;
cfg->snr_threshold = c->snr_threshold; cfg->snr_threshold = c->snr_threshold;
cfg->n_probe_reqs = c->num_probe_reqs; cfg->n_probe_reqs = c->num_probe_reqs;
@ -669,7 +672,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
cfg->intervals[i] = cpu_to_le32(req->interval); cfg->intervals[i] = cpu_to_le32(req->interval);
cfg->ssid_len = 0; cfg->ssid_len = 0;
ret = wl12xx_scan_sched_scan_ssid_list(wl, req); ret = wl12xx_scan_sched_scan_ssid_list(wl, wlvif, req);
if (ret < 0) if (ret < 0)
goto out; goto out;
@ -741,6 +744,7 @@ int wl1271_scan_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif)
if (!start) if (!start)
return -ENOMEM; return -ENOMEM;
start->role_id = wlvif->dev_role_id;
start->tag = WL1271_SCAN_DEFAULT_TAG; start->tag = WL1271_SCAN_DEFAULT_TAG;
ret = wl1271_cmd_send(wl, CMD_START_PERIODIC_SCAN, start, ret = wl1271_cmd_send(wl, CMD_START_PERIODIC_SCAN, start,
@ -762,7 +766,7 @@ void wl1271_scan_sched_scan_results(struct wl1271 *wl)
ieee80211_sched_scan_results(wl->hw); ieee80211_sched_scan_results(wl->hw);
} }
void wl1271_scan_sched_scan_stop(struct wl1271 *wl) void wl1271_scan_sched_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif)
{ {
struct wl1271_cmd_sched_scan_stop *stop; struct wl1271_cmd_sched_scan_stop *stop;
int ret = 0; int ret = 0;
@ -776,6 +780,7 @@ void wl1271_scan_sched_scan_stop(struct wl1271 *wl)
return; return;
} }
stop->role_id = wlvif->dev_role_id;
stop->tag = WL1271_SCAN_DEFAULT_TAG; stop->tag = WL1271_SCAN_DEFAULT_TAG;
ret = wl1271_cmd_send(wl, CMD_STOP_PERIODIC_SCAN, stop, ret = wl1271_cmd_send(wl, CMD_STOP_PERIODIC_SCAN, stop,

View File

@ -40,7 +40,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
struct cfg80211_sched_scan_request *req, struct cfg80211_sched_scan_request *req,
struct ieee80211_sched_scan_ies *ies); struct ieee80211_sched_scan_ies *ies);
int wl1271_scan_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif); int wl1271_scan_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif);
void wl1271_scan_sched_scan_stop(struct wl1271 *wl); void wl1271_scan_sched_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif);
void wl1271_scan_sched_scan_results(struct wl1271 *wl); void wl1271_scan_sched_scan_results(struct wl1271 *wl);
#define WL1271_SCAN_MAX_CHANNELS 24 #define WL1271_SCAN_MAX_CHANNELS 24
@ -185,7 +185,8 @@ struct wl1271_cmd_sched_scan_config {
u8 dfs; u8 dfs;
u8 padding[3]; u8 role_id;
u8 padding[2];
struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ]; struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ];
struct conn_scan_ch_params channels_5[MAX_CHANNELS_5GHZ]; struct conn_scan_ch_params channels_5[MAX_CHANNELS_5GHZ];
@ -212,21 +213,24 @@ struct wl1271_cmd_sched_scan_ssid_list {
u8 n_ssids; u8 n_ssids;
struct wl1271_ssid ssids[SCHED_SCAN_MAX_SSIDS]; struct wl1271_ssid ssids[SCHED_SCAN_MAX_SSIDS];
u8 padding[3]; u8 role_id;
u8 padding[2];
} __packed; } __packed;
struct wl1271_cmd_sched_scan_start { struct wl1271_cmd_sched_scan_start {
struct wl1271_cmd_header header; struct wl1271_cmd_header header;
u8 tag; u8 tag;
u8 padding[3]; u8 role_id;
u8 padding[2];
} __packed; } __packed;
struct wl1271_cmd_sched_scan_stop { struct wl1271_cmd_sched_scan_stop {
struct wl1271_cmd_header header; struct wl1271_cmd_header header;
u8 tag; u8 tag;
u8 padding[3]; u8 role_id;
u8 padding[2];
} __packed; } __packed;