aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYoni Divinsky <yoni.divinsky@ti.com>2012-06-27 06:01:44 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-07-10 12:10:13 -0400
commit3df74f46d88e39a032eb2cc3f2a571b66082acba (patch)
treed560ff361fe7b009ebfdcc24d34cbe3378869ac2 /drivers
parentb034fd6f4fa272569324bb3f29af5ca7cf1e23c3 (diff)
wlcore: add probe request templates for sched and one-shot scans
The driver configures the firmware template for probe requests during the scan process. If the same template is used for one-shot and sched scans they will override each other when running scans simultaneously. This fix works only on firmwares later than X.3.9.2.112 for single role and X.3.9.2.23 for multi-role. [Some cleaning-up and renaming of the quirk to something smaller -- Luca.] Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ti/wl12xx/main.c3
-rw-r--r--drivers/net/wireless/ti/wlcore/cmd.c14
-rw-r--r--drivers/net/wireless/ti/wlcore/cmd.h6
-rw-r--r--drivers/net/wireless/ti/wlcore/init.c16
-rw-r--r--drivers/net/wireless/ti/wlcore/scan.c6
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore.h3
6 files changed, 39 insertions, 9 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index 1c56d1db0712..b11c4b3e5b8c 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -637,6 +637,7 @@ static int wl12xx_identify_chip(struct wl1271 *wl)
637 wl->chip.id); 637 wl->chip.id);
638 638
639 wl->quirks |= WLCORE_QUIRK_LEGACY_NVS | 639 wl->quirks |= WLCORE_QUIRK_LEGACY_NVS |
640 WLCORE_QUIRK_DUAL_PROBE_TMPL |
640 WLCORE_QUIRK_TKIP_HEADER_SPACE; 641 WLCORE_QUIRK_TKIP_HEADER_SPACE;
641 wl->sr_fw_name = WL127X_FW_NAME_SINGLE; 642 wl->sr_fw_name = WL127X_FW_NAME_SINGLE;
642 wl->mr_fw_name = WL127X_FW_NAME_MULTI; 643 wl->mr_fw_name = WL127X_FW_NAME_MULTI;
@@ -656,6 +657,7 @@ static int wl12xx_identify_chip(struct wl1271 *wl)
656 wl->chip.id); 657 wl->chip.id);
657 658
658 wl->quirks |= WLCORE_QUIRK_LEGACY_NVS | 659 wl->quirks |= WLCORE_QUIRK_LEGACY_NVS |
660 WLCORE_QUIRK_DUAL_PROBE_TMPL |
659 WLCORE_QUIRK_TKIP_HEADER_SPACE; 661 WLCORE_QUIRK_TKIP_HEADER_SPACE;
660 wl->plt_fw_name = WL127X_PLT_FW_NAME; 662 wl->plt_fw_name = WL127X_PLT_FW_NAME;
661 wl->sr_fw_name = WL127X_FW_NAME_SINGLE; 663 wl->sr_fw_name = WL127X_FW_NAME_SINGLE;
@@ -680,6 +682,7 @@ static int wl12xx_identify_chip(struct wl1271 *wl)
680 682
681 /* wl128x requires TX blocksize alignment */ 683 /* wl128x requires TX blocksize alignment */
682 wl->quirks |= WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN | 684 wl->quirks |= WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN |
685 WLCORE_QUIRK_DUAL_PROBE_TMPL |
683 WLCORE_QUIRK_TKIP_HEADER_SPACE; 686 WLCORE_QUIRK_TKIP_HEADER_SPACE;
684 687
685 wlcore_set_min_fw_ver(wl, WL128X_CHIP_VER, WL128X_IFTYPE_VER, 688 wlcore_set_min_fw_ver(wl, WL128X_CHIP_VER, WL128X_IFTYPE_VER,
diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
index 56c7a2342fdf..087cb01958a7 100644
--- a/drivers/net/wireless/ti/wlcore/cmd.c
+++ b/drivers/net/wireless/ti/wlcore/cmd.c
@@ -1007,12 +1007,14 @@ out:
1007int wl12xx_cmd_build_probe_req(struct wl1271 *wl, struct wl12xx_vif *wlvif, 1007int wl12xx_cmd_build_probe_req(struct wl1271 *wl, struct wl12xx_vif *wlvif,
1008 u8 role_id, u8 band, 1008 u8 role_id, u8 band,
1009 const u8 *ssid, size_t ssid_len, 1009 const u8 *ssid, size_t ssid_len,
1010 const u8 *ie, size_t ie_len) 1010 const u8 *ie, size_t ie_len, bool sched_scan)
1011{ 1011{
1012 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif); 1012 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
1013 struct sk_buff *skb; 1013 struct sk_buff *skb;
1014 int ret; 1014 int ret;
1015 u32 rate; 1015 u32 rate;
1016 u16 template_id_2_4 = CMD_TEMPL_CFG_PROBE_REQ_2_4;
1017 u16 template_id_5 = CMD_TEMPL_CFG_PROBE_REQ_5;
1016 1018
1017 skb = ieee80211_probereq_get(wl->hw, vif, ssid, ssid_len, 1019 skb = ieee80211_probereq_get(wl->hw, vif, ssid, ssid_len,
1018 ie, ie_len); 1020 ie, ie_len);
@@ -1023,14 +1025,20 @@ int wl12xx_cmd_build_probe_req(struct wl1271 *wl, struct wl12xx_vif *wlvif,
1023 1025
1024 wl1271_dump(DEBUG_SCAN, "PROBE REQ: ", skb->data, skb->len); 1026 wl1271_dump(DEBUG_SCAN, "PROBE REQ: ", skb->data, skb->len);
1025 1027
1028 if (!sched_scan &&
1029 (wl->quirks & WLCORE_QUIRK_DUAL_PROBE_TMPL)) {
1030 template_id_2_4 = CMD_TEMPL_APP_PROBE_REQ_2_4;
1031 template_id_5 = CMD_TEMPL_APP_PROBE_REQ_5;
1032 }
1033
1026 rate = wl1271_tx_min_rate_get(wl, wlvif->bitrate_masks[band]); 1034 rate = wl1271_tx_min_rate_get(wl, wlvif->bitrate_masks[band]);
1027 if (band == IEEE80211_BAND_2GHZ) 1035 if (band == IEEE80211_BAND_2GHZ)
1028 ret = wl1271_cmd_template_set(wl, role_id, 1036 ret = wl1271_cmd_template_set(wl, role_id,
1029 CMD_TEMPL_CFG_PROBE_REQ_2_4, 1037 template_id_2_4,
1030 skb->data, skb->len, 0, rate); 1038 skb->data, skb->len, 0, rate);
1031 else 1039 else
1032 ret = wl1271_cmd_template_set(wl, role_id, 1040 ret = wl1271_cmd_template_set(wl, role_id,
1033 CMD_TEMPL_CFG_PROBE_REQ_5, 1041 template_id_5,
1034 skb->data, skb->len, 0, rate); 1042 skb->data, skb->len, 0, rate);
1035 1043
1036out: 1044out:
diff --git a/drivers/net/wireless/ti/wlcore/cmd.h b/drivers/net/wireless/ti/wlcore/cmd.h
index c8a6510c72cb..d7d9f801e506 100644
--- a/drivers/net/wireless/ti/wlcore/cmd.h
+++ b/drivers/net/wireless/ti/wlcore/cmd.h
@@ -58,7 +58,7 @@ int wl1271_cmd_build_ps_poll(struct wl1271 *wl, struct wl12xx_vif *wlvif,
58int wl12xx_cmd_build_probe_req(struct wl1271 *wl, struct wl12xx_vif *wlvif, 58int wl12xx_cmd_build_probe_req(struct wl1271 *wl, struct wl12xx_vif *wlvif,
59 u8 role_id, u8 band, 59 u8 role_id, u8 band,
60 const u8 *ssid, size_t ssid_len, 60 const u8 *ssid, size_t ssid_len,
61 const u8 *ie, size_t ie_len); 61 const u8 *ie, size_t ie_len, bool sched_scan);
62struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl, 62struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,
63 struct wl12xx_vif *wlvif, 63 struct wl12xx_vif *wlvif,
64 struct sk_buff *skb); 64 struct sk_buff *skb);
@@ -172,8 +172,8 @@ enum cmd_templ {
172 CMD_TEMPL_PS_POLL, 172 CMD_TEMPL_PS_POLL,
173 CMD_TEMPL_KLV, 173 CMD_TEMPL_KLV,
174 CMD_TEMPL_DISCONNECT, 174 CMD_TEMPL_DISCONNECT,
175 CMD_TEMPL_PROBE_REQ_2_4, /* for firmware internal use only */ 175 CMD_TEMPL_APP_PROBE_REQ_2_4,
176 CMD_TEMPL_PROBE_REQ_5, /* for firmware internal use only */ 176 CMD_TEMPL_APP_PROBE_REQ_5,
177 CMD_TEMPL_BAR, /* for firmware internal use only */ 177 CMD_TEMPL_BAR, /* for firmware internal use only */
178 CMD_TEMPL_CTS, /* 178 CMD_TEMPL_CTS, /*
179 * For CTS-to-self (FastCTS) mechanism 179 * For CTS-to-self (FastCTS) mechanism
diff --git a/drivers/net/wireless/ti/wlcore/init.c b/drivers/net/wireless/ti/wlcore/init.c
index 8a8a8971befa..a3c867786df8 100644
--- a/drivers/net/wireless/ti/wlcore/init.c
+++ b/drivers/net/wireless/ti/wlcore/init.c
@@ -54,6 +54,22 @@ int wl1271_init_templates_config(struct wl1271 *wl)
54 if (ret < 0) 54 if (ret < 0)
55 return ret; 55 return ret;
56 56
57 if (wl->quirks & WLCORE_QUIRK_DUAL_PROBE_TMPL) {
58 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
59 CMD_TEMPL_APP_PROBE_REQ_2_4, NULL,
60 WL1271_CMD_TEMPL_MAX_SIZE,
61 0, WL1271_RATE_AUTOMATIC);
62 if (ret < 0)
63 return ret;
64
65 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
66 CMD_TEMPL_APP_PROBE_REQ_5, NULL,
67 WL1271_CMD_TEMPL_MAX_SIZE,
68 0, WL1271_RATE_AUTOMATIC);
69 if (ret < 0)
70 return ret;
71 }
72
57 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID, 73 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
58 CMD_TEMPL_NULL_DATA, NULL, 74 CMD_TEMPL_NULL_DATA, NULL,
59 sizeof(struct wl12xx_null_data_template), 75 sizeof(struct wl12xx_null_data_template),
diff --git a/drivers/net/wireless/ti/wlcore/scan.c b/drivers/net/wireless/ti/wlcore/scan.c
index 5702d99d8c97..b03eb9ae8ebe 100644
--- a/drivers/net/wireless/ti/wlcore/scan.c
+++ b/drivers/net/wireless/ti/wlcore/scan.c
@@ -226,7 +226,7 @@ static int wl1271_scan_send(struct wl1271 *wl, struct ieee80211_vif *vif,
226 cmd->params.role_id, band, 226 cmd->params.role_id, band,
227 wl->scan.ssid, wl->scan.ssid_len, 227 wl->scan.ssid, wl->scan.ssid_len,
228 wl->scan.req->ie, 228 wl->scan.req->ie,
229 wl->scan.req->ie_len); 229 wl->scan.req->ie_len, false);
230 if (ret < 0) { 230 if (ret < 0) {
231 wl1271_error("PROBE request template failed"); 231 wl1271_error("PROBE request template failed");
232 goto out; 232 goto out;
@@ -722,7 +722,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
722 req->ssids[0].ssid, 722 req->ssids[0].ssid,
723 req->ssids[0].ssid_len, 723 req->ssids[0].ssid_len,
724 ies->ie[band], 724 ies->ie[band],
725 ies->len[band]); 725 ies->len[band], true);
726 if (ret < 0) { 726 if (ret < 0) {
727 wl1271_error("2.4GHz PROBE request template failed"); 727 wl1271_error("2.4GHz PROBE request template failed");
728 goto out; 728 goto out;
@@ -736,7 +736,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
736 req->ssids[0].ssid, 736 req->ssids[0].ssid,
737 req->ssids[0].ssid_len, 737 req->ssids[0].ssid_len,
738 ies->ie[band], 738 ies->ie[band],
739 ies->len[band]); 739 ies->len[band], true);
740 if (ret < 0) { 740 if (ret < 0) {
741 wl1271_error("5GHz PROBE request template failed"); 741 wl1271_error("5GHz PROBE request template failed");
742 goto out; 742 goto out;
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index 942cef13d8f4..0df731ac0359 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -455,6 +455,9 @@ wlcore_set_min_fw_ver(struct wl1271 *wl, unsigned int chip,
455/* Some firmwares not support sched scans while connected */ 455/* Some firmwares not support sched scans while connected */
456#define WLCORE_QUIRK_NO_SCHED_SCAN_WHILE_CONN BIT(9) 456#define WLCORE_QUIRK_NO_SCHED_SCAN_WHILE_CONN BIT(9)
457 457
458/* separate probe response templates for one-shot and sched scans */
459#define WLCORE_QUIRK_DUAL_PROBE_TMPL BIT(10)
460
458/* TODO: move to the lower drivers when all usages are abstracted */ 461/* TODO: move to the lower drivers when all usages are abstracted */
459#define CHIP_ID_1271_PG10 (0x4030101) 462#define CHIP_ID_1271_PG10 (0x4030101)
460#define CHIP_ID_1271_PG20 (0x4030111) 463#define CHIP_ID_1271_PG20 (0x4030111)