aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2012-01-31 04:57:16 -0500
committerLuciano Coelho <coelho@ti.com>2012-02-15 01:38:30 -0500
commitcdaac6281170ee2934ad443cb60fbdd6cf318b64 (patch)
treef40cfc6fc8c4c01e5c07493eedaf7af32493b39b /drivers
parent1ebaa2d041746949c291fff17be9880820f70e55 (diff)
wl12xx: fw api change - add role_id to set_template
The set_template commands now takes the role_id as parameter. Usually, we'll use the vif's main role_id. However, sometimes we'll want to use wlvif->dev_role_id instead of wlvif->role_id, so pass the wanted role_id as param. Update WL127X_FW_NAME/WL128X_FW_NAME. (This commit starts a series of fw update patches, and changes the start() callback to return an error in order to prevent the use of the driver during the transition. This change will be reverted in the last patch of series) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/wl12xx/cmd.c37
-rw-r--r--drivers/net/wireless/wl12xx/cmd.h18
-rw-r--r--drivers/net/wireless/wl12xx/init.c45
-rw-r--r--drivers/net/wireless/wl12xx/main.c15
-rw-r--r--drivers/net/wireless/wl12xx/scan.c28
-rw-r--r--drivers/net/wireless/wl12xx/wl12xx.h4
6 files changed, 94 insertions, 53 deletions
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index 25990bd38be6..28e0a56d794f 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -1022,8 +1022,9 @@ out:
1022 return ret; 1022 return ret;
1023} 1023}
1024 1024
1025int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id, 1025int wl1271_cmd_template_set(struct wl1271 *wl, u8 role_id,
1026 void *buf, size_t buf_len, int index, u32 rates) 1026 u16 template_id, void *buf, size_t buf_len,
1027 int index, u32 rates)
1027{ 1028{
1028 struct wl1271_cmd_template_set *cmd; 1029 struct wl1271_cmd_template_set *cmd;
1029 int ret = 0; 1030 int ret = 0;
@@ -1039,6 +1040,8 @@ int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
1039 goto out; 1040 goto out;
1040 } 1041 }
1041 1042
1043 /* during initialization wlvif is NULL */
1044 cmd->role_id = role_id;
1042 cmd->len = cpu_to_le16(buf_len); 1045 cmd->len = cpu_to_le16(buf_len);
1043 cmd->template_type = template_id; 1046 cmd->template_type = template_id;
1044 cmd->enabled_rates = cpu_to_le32(rates); 1047 cmd->enabled_rates = cpu_to_le32(rates);
@@ -1082,7 +1085,8 @@ int wl12xx_cmd_build_null_data(struct wl1271 *wl, struct wl12xx_vif *wlvif)
1082 ptr = skb->data; 1085 ptr = skb->data;
1083 } 1086 }
1084 1087
1085 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, ptr, size, 0, 1088 ret = wl1271_cmd_template_set(wl, wlvif->role_id,
1089 CMD_TEMPL_NULL_DATA, ptr, size, 0,
1086 wlvif->basic_rate); 1090 wlvif->basic_rate);
1087 1091
1088out: 1092out:
@@ -1105,7 +1109,7 @@ int wl12xx_cmd_build_klv_null_data(struct wl1271 *wl,
1105 if (!skb) 1109 if (!skb)
1106 goto out; 1110 goto out;
1107 1111
1108 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_KLV, 1112 ret = wl1271_cmd_template_set(wl, wlvif->role_id, CMD_TEMPL_KLV,
1109 skb->data, skb->len, 1113 skb->data, skb->len,
1110 CMD_TEMPL_KLV_IDX_NULL_DATA, 1114 CMD_TEMPL_KLV_IDX_NULL_DATA,
1111 wlvif->basic_rate); 1115 wlvif->basic_rate);
@@ -1130,7 +1134,8 @@ int wl1271_cmd_build_ps_poll(struct wl1271 *wl, struct wl12xx_vif *wlvif,
1130 if (!skb) 1134 if (!skb)
1131 goto out; 1135 goto out;
1132 1136
1133 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, skb->data, 1137 ret = wl1271_cmd_template_set(wl, wlvif->role_id,
1138 CMD_TEMPL_PS_POLL, skb->data,
1134 skb->len, 0, wlvif->basic_rate_set); 1139 skb->len, 0, wlvif->basic_rate_set);
1135 1140
1136out: 1141out:
@@ -1138,9 +1143,10 @@ out:
1138 return ret; 1143 return ret;
1139} 1144}
1140 1145
1141int wl1271_cmd_build_probe_req(struct wl1271 *wl, struct wl12xx_vif *wlvif, 1146int wl12xx_cmd_build_probe_req(struct wl1271 *wl, struct wl12xx_vif *wlvif,
1147 u8 role_id, u8 band,
1142 const u8 *ssid, size_t ssid_len, 1148 const u8 *ssid, size_t ssid_len,
1143 const u8 *ie, size_t ie_len, u8 band) 1149 const u8 *ie, size_t ie_len)
1144{ 1150{
1145 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif); 1151 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
1146 struct sk_buff *skb; 1152 struct sk_buff *skb;
@@ -1158,10 +1164,12 @@ int wl1271_cmd_build_probe_req(struct wl1271 *wl, struct wl12xx_vif *wlvif,
1158 1164
1159 rate = wl1271_tx_min_rate_get(wl, wlvif->bitrate_masks[band]); 1165 rate = wl1271_tx_min_rate_get(wl, wlvif->bitrate_masks[band]);
1160 if (band == IEEE80211_BAND_2GHZ) 1166 if (band == IEEE80211_BAND_2GHZ)
1161 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, 1167 ret = wl1271_cmd_template_set(wl, role_id,
1168 CMD_TEMPL_CFG_PROBE_REQ_2_4,
1162 skb->data, skb->len, 0, rate); 1169 skb->data, skb->len, 0, rate);
1163 else 1170 else
1164 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5, 1171 ret = wl1271_cmd_template_set(wl, role_id,
1172 CMD_TEMPL_CFG_PROBE_REQ_5,
1165 skb->data, skb->len, 0, rate); 1173 skb->data, skb->len, 0, rate);
1166 1174
1167out: 1175out:
@@ -1186,10 +1194,12 @@ struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,
1186 1194
1187 rate = wl1271_tx_min_rate_get(wl, wlvif->bitrate_masks[wlvif->band]); 1195 rate = wl1271_tx_min_rate_get(wl, wlvif->bitrate_masks[wlvif->band]);
1188 if (wlvif->band == IEEE80211_BAND_2GHZ) 1196 if (wlvif->band == IEEE80211_BAND_2GHZ)
1189 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, 1197 ret = wl1271_cmd_template_set(wl, wlvif->role_id,
1198 CMD_TEMPL_CFG_PROBE_REQ_2_4,
1190 skb->data, skb->len, 0, rate); 1199 skb->data, skb->len, 0, rate);
1191 else 1200 else
1192 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5, 1201 ret = wl1271_cmd_template_set(wl, wlvif->role_id,
1202 CMD_TEMPL_CFG_PROBE_REQ_5,
1193 skb->data, skb->len, 0, rate); 1203 skb->data, skb->len, 0, rate);
1194 1204
1195 if (ret < 0) 1205 if (ret < 0)
@@ -1235,7 +1245,7 @@ int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, struct wl12xx_vif *wlvif,
1235 memcpy(tmpl.sender_hw, vif->addr, ETH_ALEN); 1245 memcpy(tmpl.sender_hw, vif->addr, ETH_ALEN);
1236 tmpl.sender_ip = ip_addr; 1246 tmpl.sender_ip = ip_addr;
1237 1247
1238 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_ARP_RSP, 1248 ret = wl1271_cmd_template_set(wl, wlvif->role_id, CMD_TEMPL_ARP_RSP,
1239 &tmpl, sizeof(tmpl), 0, 1249 &tmpl, sizeof(tmpl), 0,
1240 wlvif->basic_rate); 1250 wlvif->basic_rate);
1241 1251
@@ -1260,7 +1270,8 @@ int wl1271_build_qos_null_data(struct wl1271 *wl, struct ieee80211_vif *vif)
1260 /* FIXME: not sure what priority to use here */ 1270 /* FIXME: not sure what priority to use here */
1261 template.qos_ctrl = cpu_to_le16(0); 1271 template.qos_ctrl = cpu_to_le16(0);
1262 1272
1263 return wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, &template, 1273 return wl1271_cmd_template_set(wl, wlvif->role_id,
1274 CMD_TEMPL_QOS_NULL_DATA, &template,
1264 sizeof(template), 0, 1275 sizeof(template), 0,
1265 wlvif->basic_rate); 1276 wlvif->basic_rate);
1266} 1277}
diff --git a/drivers/net/wireless/wl12xx/cmd.h b/drivers/net/wireless/wl12xx/cmd.h
index 3f7d0b93c24d..8e8035d33068 100644
--- a/drivers/net/wireless/wl12xx/cmd.h
+++ b/drivers/net/wireless/wl12xx/cmd.h
@@ -54,14 +54,16 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif,
54 u8 ps_mode); 54 u8 ps_mode);
55int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer, 55int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
56 size_t len); 56 size_t len);
57int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id, 57int wl1271_cmd_template_set(struct wl1271 *wl, u8 role_id,
58 void *buf, size_t buf_len, int index, u32 rates); 58 u16 template_id, void *buf, size_t buf_len,
59 int index, u32 rates);
59int wl12xx_cmd_build_null_data(struct wl1271 *wl, struct wl12xx_vif *wlvif); 60int wl12xx_cmd_build_null_data(struct wl1271 *wl, struct wl12xx_vif *wlvif);
60int wl1271_cmd_build_ps_poll(struct wl1271 *wl, struct wl12xx_vif *wlvif, 61int wl1271_cmd_build_ps_poll(struct wl1271 *wl, struct wl12xx_vif *wlvif,
61 u16 aid); 62 u16 aid);
62int wl1271_cmd_build_probe_req(struct wl1271 *wl, struct wl12xx_vif *wlvif, 63int wl12xx_cmd_build_probe_req(struct wl1271 *wl, struct wl12xx_vif *wlvif,
64 u8 role_id, u8 band,
63 const u8 *ssid, size_t ssid_len, 65 const u8 *ssid, size_t ssid_len,
64 const u8 *ie, size_t ie_len, u8 band); 66 const u8 *ie, size_t ie_len);
65struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl, 67struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,
66 struct wl12xx_vif *wlvif, 68 struct wl12xx_vif *wlvif,
67 struct sk_buff *skb); 69 struct sk_buff *skb);
@@ -191,7 +193,7 @@ enum cmd_templ {
191/* unit ms */ 193/* unit ms */
192#define WL1271_COMMAND_TIMEOUT 2000 194#define WL1271_COMMAND_TIMEOUT 2000
193#define WL1271_CMD_TEMPL_DFLT_SIZE 252 195#define WL1271_CMD_TEMPL_DFLT_SIZE 252
194#define WL1271_CMD_TEMPL_MAX_SIZE 548 196#define WL1271_CMD_TEMPL_MAX_SIZE 512
195#define WL1271_EVENT_TIMEOUT 750 197#define WL1271_EVENT_TIMEOUT 750
196 198
197struct wl1271_cmd_header { 199struct wl1271_cmd_header {
@@ -364,14 +366,18 @@ struct cmd_enabledisable_path {
364struct wl1271_cmd_template_set { 366struct wl1271_cmd_template_set {
365 struct wl1271_cmd_header header; 367 struct wl1271_cmd_header header;
366 368
367 __le16 len; 369 u8 role_id;
368 u8 template_type; 370 u8 template_type;
371 __le16 len;
369 u8 index; /* relevant only for KLV_TEMPLATE type */ 372 u8 index; /* relevant only for KLV_TEMPLATE type */
373 u8 padding[3];
374
370 __le32 enabled_rates; 375 __le32 enabled_rates;
371 u8 short_retry_limit; 376 u8 short_retry_limit;
372 u8 long_retry_limit; 377 u8 long_retry_limit;
373 u8 aflags; 378 u8 aflags;
374 u8 reserved; 379 u8 reserved;
380
375 u8 template_data[WL1271_CMD_TEMPL_MAX_SIZE]; 381 u8 template_data[WL1271_CMD_TEMPL_MAX_SIZE];
376} __packed; 382} __packed;
377 383
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c
index ca7ee59e4505..fcf2b128f9a4 100644
--- a/drivers/net/wireless/wl12xx/init.c
+++ b/drivers/net/wireless/wl12xx/init.c
@@ -39,50 +39,58 @@ int wl1271_init_templates_config(struct wl1271 *wl)
39 int ret, i; 39 int ret, i;
40 40
41 /* send empty templates for fw memory reservation */ 41 /* send empty templates for fw memory reservation */
42 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, NULL, 42 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
43 CMD_TEMPL_CFG_PROBE_REQ_2_4, NULL,
43 WL1271_CMD_TEMPL_DFLT_SIZE, 44 WL1271_CMD_TEMPL_DFLT_SIZE,
44 0, WL1271_RATE_AUTOMATIC); 45 0, WL1271_RATE_AUTOMATIC);
45 if (ret < 0) 46 if (ret < 0)
46 return ret; 47 return ret;
47 48
48 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5, 49 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
50 CMD_TEMPL_CFG_PROBE_REQ_5,
49 NULL, WL1271_CMD_TEMPL_DFLT_SIZE, 0, 51 NULL, WL1271_CMD_TEMPL_DFLT_SIZE, 0,
50 WL1271_RATE_AUTOMATIC); 52 WL1271_RATE_AUTOMATIC);
51 if (ret < 0) 53 if (ret < 0)
52 return ret; 54 return ret;
53 55
54 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, NULL, 56 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
57 CMD_TEMPL_NULL_DATA, NULL,
55 sizeof(struct wl12xx_null_data_template), 58 sizeof(struct wl12xx_null_data_template),
56 0, WL1271_RATE_AUTOMATIC); 59 0, WL1271_RATE_AUTOMATIC);
57 if (ret < 0) 60 if (ret < 0)
58 return ret; 61 return ret;
59 62
60 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, NULL, 63 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
64 CMD_TEMPL_PS_POLL, NULL,
61 sizeof(struct wl12xx_ps_poll_template), 65 sizeof(struct wl12xx_ps_poll_template),
62 0, WL1271_RATE_AUTOMATIC); 66 0, WL1271_RATE_AUTOMATIC);
63 if (ret < 0) 67 if (ret < 0)
64 return ret; 68 return ret;
65 69
66 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, NULL, 70 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
71 CMD_TEMPL_QOS_NULL_DATA, NULL,
67 sizeof 72 sizeof
68 (struct ieee80211_qos_hdr), 73 (struct ieee80211_qos_hdr),
69 0, WL1271_RATE_AUTOMATIC); 74 0, WL1271_RATE_AUTOMATIC);
70 if (ret < 0) 75 if (ret < 0)
71 return ret; 76 return ret;
72 77
73 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PROBE_RESPONSE, NULL, 78 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
79 CMD_TEMPL_PROBE_RESPONSE, NULL,
74 WL1271_CMD_TEMPL_DFLT_SIZE, 80 WL1271_CMD_TEMPL_DFLT_SIZE,
75 0, WL1271_RATE_AUTOMATIC); 81 0, WL1271_RATE_AUTOMATIC);
76 if (ret < 0) 82 if (ret < 0)
77 return ret; 83 return ret;
78 84
79 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON, NULL, 85 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
86 CMD_TEMPL_BEACON, NULL,
80 WL1271_CMD_TEMPL_DFLT_SIZE, 87 WL1271_CMD_TEMPL_DFLT_SIZE,
81 0, WL1271_RATE_AUTOMATIC); 88 0, WL1271_RATE_AUTOMATIC);
82 if (ret < 0) 89 if (ret < 0)
83 return ret; 90 return ret;
84 91
85 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_ARP_RSP, NULL, 92 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
93 CMD_TEMPL_ARP_RSP, NULL,
86 sizeof 94 sizeof
87 (struct wl12xx_arp_rsp_template), 95 (struct wl12xx_arp_rsp_template),
88 0, WL1271_RATE_AUTOMATIC); 96 0, WL1271_RATE_AUTOMATIC);
@@ -93,19 +101,22 @@ int wl1271_init_templates_config(struct wl1271 *wl)
93 * Put very large empty placeholders for all templates. These 101 * Put very large empty placeholders for all templates. These
94 * reserve memory for later. 102 * reserve memory for later.
95 */ 103 */
96 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_AP_PROBE_RESPONSE, NULL, 104 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
105 CMD_TEMPL_AP_PROBE_RESPONSE, NULL,
97 WL1271_CMD_TEMPL_MAX_SIZE, 106 WL1271_CMD_TEMPL_MAX_SIZE,
98 0, WL1271_RATE_AUTOMATIC); 107 0, WL1271_RATE_AUTOMATIC);
99 if (ret < 0) 108 if (ret < 0)
100 return ret; 109 return ret;
101 110
102 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_AP_BEACON, NULL, 111 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
112 CMD_TEMPL_AP_BEACON, NULL,
103 WL1271_CMD_TEMPL_MAX_SIZE, 113 WL1271_CMD_TEMPL_MAX_SIZE,
104 0, WL1271_RATE_AUTOMATIC); 114 0, WL1271_RATE_AUTOMATIC);
105 if (ret < 0) 115 if (ret < 0)
106 return ret; 116 return ret;
107 117
108 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_DEAUTH_AP, NULL, 118 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
119 CMD_TEMPL_DEAUTH_AP, NULL,
109 sizeof 120 sizeof
110 (struct wl12xx_disconn_template), 121 (struct wl12xx_disconn_template),
111 0, WL1271_RATE_AUTOMATIC); 122 0, WL1271_RATE_AUTOMATIC);
@@ -113,7 +124,8 @@ int wl1271_init_templates_config(struct wl1271 *wl)
113 return ret; 124 return ret;
114 125
115 for (i = 0; i < CMD_TEMPL_KLV_IDX_MAX; i++) { 126 for (i = 0; i < CMD_TEMPL_KLV_IDX_MAX; i++) {
116 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_KLV, NULL, 127 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
128 CMD_TEMPL_KLV, NULL,
117 sizeof(struct ieee80211_qos_hdr), 129 sizeof(struct ieee80211_qos_hdr),
118 i, WL1271_RATE_AUTOMATIC); 130 i, WL1271_RATE_AUTOMATIC);
119 if (ret < 0) 131 if (ret < 0)
@@ -140,7 +152,8 @@ static int wl1271_ap_init_deauth_template(struct wl1271 *wl,
140 IEEE80211_STYPE_DEAUTH); 152 IEEE80211_STYPE_DEAUTH);
141 153
142 rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set); 154 rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set);
143 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_DEAUTH_AP, 155 ret = wl1271_cmd_template_set(wl, wlvif->role_id,
156 CMD_TEMPL_DEAUTH_AP,
144 tmpl, sizeof(*tmpl), 0, rate); 157 tmpl, sizeof(*tmpl), 0, rate);
145 158
146out: 159out:
@@ -172,7 +185,8 @@ static int wl1271_ap_init_null_template(struct wl1271 *wl,
172 memcpy(nullfunc->addr3, vif->addr, ETH_ALEN); 185 memcpy(nullfunc->addr3, vif->addr, ETH_ALEN);
173 186
174 rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set); 187 rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set);
175 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, nullfunc, 188 ret = wl1271_cmd_template_set(wl, wlvif->role_id,
189 CMD_TEMPL_NULL_DATA, nullfunc,
176 sizeof(*nullfunc), 0, rate); 190 sizeof(*nullfunc), 0, rate);
177 191
178out: 192out:
@@ -204,7 +218,8 @@ static int wl1271_ap_init_qos_null_template(struct wl1271 *wl,
204 memcpy(qosnull->addr3, vif->addr, ETH_ALEN); 218 memcpy(qosnull->addr3, vif->addr, ETH_ALEN);
205 219
206 rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set); 220 rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set);
207 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, qosnull, 221 ret = wl1271_cmd_template_set(wl, wlvif->role_id,
222 CMD_TEMPL_QOS_NULL_DATA, qosnull,
208 sizeof(*qosnull), 0, rate); 223 sizeof(*qosnull), 0, rate);
209 224
210out: 225out:
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index bba2a52256b6..e4549dfb70d4 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1778,7 +1778,9 @@ static int wl1271_op_start(struct ieee80211_hw *hw)
1778 * is added. That is where we will initialize the hardware. 1778 * is added. That is where we will initialize the hardware.
1779 */ 1779 */
1780 1780
1781 return 0; 1781 wl1271_error("wl12xx is in an ustable state (fw api update is "
1782 "taking place). skip this commit when bisecting");
1783 return -EBUSY;
1782} 1784}
1783 1785
1784static void wl1271_op_stop(struct ieee80211_hw *hw) 1786static void wl1271_op_stop(struct ieee80211_hw *hw)
@@ -3297,6 +3299,7 @@ static void wl12xx_remove_vendor_ie(struct sk_buff *skb,
3297static int wl1271_ap_set_probe_resp_tmpl(struct wl1271 *wl, u32 rates, 3299static int wl1271_ap_set_probe_resp_tmpl(struct wl1271 *wl, u32 rates,
3298 struct ieee80211_vif *vif) 3300 struct ieee80211_vif *vif)
3299{ 3301{
3302 struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
3300 struct sk_buff *skb; 3303 struct sk_buff *skb;
3301 int ret; 3304 int ret;
3302 3305
@@ -3304,7 +3307,7 @@ static int wl1271_ap_set_probe_resp_tmpl(struct wl1271 *wl, u32 rates,
3304 if (!skb) 3307 if (!skb)
3305 return -EOPNOTSUPP; 3308 return -EOPNOTSUPP;
3306 3309
3307 ret = wl1271_cmd_template_set(wl, 3310 ret = wl1271_cmd_template_set(wl, wlvif->role_id,
3308 CMD_TEMPL_AP_PROBE_RESPONSE, 3311 CMD_TEMPL_AP_PROBE_RESPONSE,
3309 skb->data, 3312 skb->data,
3310 skb->len, 0, 3313 skb->len, 0,
@@ -3328,7 +3331,7 @@ static int wl1271_ap_set_probe_resp_tmpl_legacy(struct wl1271 *wl,
3328 3331
3329 /* no need to change probe response if the SSID is set correctly */ 3332 /* no need to change probe response if the SSID is set correctly */
3330 if (wlvif->ssid_len > 0) 3333 if (wlvif->ssid_len > 0)
3331 return wl1271_cmd_template_set(wl, 3334 return wl1271_cmd_template_set(wl, wlvif->role_id,
3332 CMD_TEMPL_AP_PROBE_RESPONSE, 3335 CMD_TEMPL_AP_PROBE_RESPONSE,
3333 probe_rsp_data, 3336 probe_rsp_data,
3334 probe_rsp_len, 0, 3337 probe_rsp_len, 0,
@@ -3365,7 +3368,7 @@ static int wl1271_ap_set_probe_resp_tmpl_legacy(struct wl1271 *wl,
3365 ptr, probe_rsp_len - (ptr - probe_rsp_data)); 3368 ptr, probe_rsp_len - (ptr - probe_rsp_data));
3366 templ_len += probe_rsp_len - (ptr - probe_rsp_data); 3369 templ_len += probe_rsp_len - (ptr - probe_rsp_data);
3367 3370
3368 return wl1271_cmd_template_set(wl, 3371 return wl1271_cmd_template_set(wl, wlvif->role_id,
3369 CMD_TEMPL_AP_PROBE_RESPONSE, 3372 CMD_TEMPL_AP_PROBE_RESPONSE,
3370 probe_rsp_templ, 3373 probe_rsp_templ,
3371 templ_len, 0, 3374 templ_len, 0,
@@ -3462,7 +3465,7 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl,
3462 min_rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set); 3465 min_rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set);
3463 tmpl_id = is_ap ? CMD_TEMPL_AP_BEACON : 3466 tmpl_id = is_ap ? CMD_TEMPL_AP_BEACON :
3464 CMD_TEMPL_BEACON; 3467 CMD_TEMPL_BEACON;
3465 ret = wl1271_cmd_template_set(wl, tmpl_id, 3468 ret = wl1271_cmd_template_set(wl, wlvif->role_id, tmpl_id,
3466 beacon->data, 3469 beacon->data,
3467 beacon->len, 0, 3470 beacon->len, 0,
3468 min_rate); 3471 min_rate);
@@ -3501,7 +3504,7 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl,
3501 beacon->len, 3504 beacon->len,
3502 min_rate); 3505 min_rate);
3503 else 3506 else
3504 ret = wl1271_cmd_template_set(wl, 3507 ret = wl1271_cmd_template_set(wl, wlvif->role_id,
3505 CMD_TEMPL_PROBE_RESPONSE, 3508 CMD_TEMPL_PROBE_RESPONSE,
3506 beacon->data, 3509 beacon->data,
3507 beacon->len, 0, 3510 beacon->len, 0,
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c
index e24111ececc5..416ae9145d61 100644
--- a/drivers/net/wireless/wl12xx/scan.c
+++ b/drivers/net/wireless/wl12xx/scan.c
@@ -217,9 +217,11 @@ static int wl1271_scan_send(struct wl1271 *wl, struct ieee80211_vif *vif,
217 217
218 memcpy(cmd->addr, vif->addr, ETH_ALEN); 218 memcpy(cmd->addr, vif->addr, ETH_ALEN);
219 219
220 ret = wl1271_cmd_build_probe_req(wl, wlvif, wl->scan.ssid, 220 ret = wl12xx_cmd_build_probe_req(wl, wlvif,
221 wl->scan.ssid_len, wl->scan.req->ie, 221 wlvif->role_id, band,
222 wl->scan.req->ie_len, band); 222 wl->scan.ssid, wl->scan.ssid_len,
223 wl->scan.req->ie,
224 wl->scan.req->ie_len);
223 if (ret < 0) { 225 if (ret < 0) {
224 wl1271_error("PROBE request template failed"); 226 wl1271_error("PROBE request template failed");
225 goto out; 227 goto out;
@@ -658,11 +660,13 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
658 } 660 }
659 661
660 if (!force_passive && cfg->active[0]) { 662 if (!force_passive && cfg->active[0]) {
661 ret = wl1271_cmd_build_probe_req(wl, wlvif, req->ssids[0].ssid, 663 u8 band = IEEE80211_BAND_2GHZ;
664 ret = wl12xx_cmd_build_probe_req(wl, wlvif,
665 wlvif->role_id, band,
666 req->ssids[0].ssid,
662 req->ssids[0].ssid_len, 667 req->ssids[0].ssid_len,
663 ies->ie[IEEE80211_BAND_2GHZ], 668 ies->ie[band],
664 ies->len[IEEE80211_BAND_2GHZ], 669 ies->len[band]);
665 IEEE80211_BAND_2GHZ);
666 if (ret < 0) { 670 if (ret < 0) {
667 wl1271_error("2.4GHz PROBE request template failed"); 671 wl1271_error("2.4GHz PROBE request template failed");
668 goto out; 672 goto out;
@@ -670,11 +674,13 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
670 } 674 }
671 675
672 if (!force_passive && cfg->active[1]) { 676 if (!force_passive && cfg->active[1]) {
673 ret = wl1271_cmd_build_probe_req(wl, wlvif, req->ssids[0].ssid, 677 u8 band = IEEE80211_BAND_5GHZ;
678 ret = wl12xx_cmd_build_probe_req(wl, wlvif,
679 wlvif->role_id, band,
680 req->ssids[0].ssid,
674 req->ssids[0].ssid_len, 681 req->ssids[0].ssid_len,
675 ies->ie[IEEE80211_BAND_5GHZ], 682 ies->ie[band],
676 ies->len[IEEE80211_BAND_5GHZ], 683 ies->len[band]);
677 IEEE80211_BAND_5GHZ);
678 if (ret < 0) { 684 if (ret < 0) {
679 wl1271_error("5GHz PROBE request template failed"); 685 wl1271_error("5GHz PROBE request template failed");
680 goto out; 686 goto out;
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index 1f629fac02e4..b9bfbfffc5c0 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -35,8 +35,8 @@
35#include "conf.h" 35#include "conf.h"
36#include "ini.h" 36#include "ini.h"
37 37
38#define WL127X_FW_NAME "ti-connectivity/wl127x-fw-3.bin" 38#define WL127X_FW_NAME "ti-connectivity/wl127x-fw-4-sr.bin"
39#define WL128X_FW_NAME "ti-connectivity/wl128x-fw-3.bin" 39#define WL128X_FW_NAME "ti-connectivity/wl128x-fw-4-sr.bin"
40 40
41/* 41/*
42 * wl127x and wl128x are using the same NVS file name. However, the 42 * wl127x and wl128x are using the same NVS file name. However, the