aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-08-14 06:17:06 -0400
committerLuciano Coelho <coelho@ti.com>2011-08-22 05:35:24 -0400
commit7f097988f1bff42177b99cb4c8ec62e818d0b1a6 (patch)
treef91aee4e7928ed9dec97822ab62d0eb409e461c8 /drivers/net/wireless/wl12xx
parent4d56ad9cae9e8553176427adc2335f8a7f4556b2 (diff)
wl12xx: update acx commands
Update the acx commands according to the new fw api (fw >= 6/7.3.0.0.75). The main change in most of the ACXs is the addition of a new role_id/link_id field, which is required for multi-role operation. Currently, we don't really support multi-role, as most of our data (inside wl) is global. As the current fw doesn't support concurrent roles yet, keep it this way and add wl->role_id and wl->sta_hlid to save the active role/link. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx')
-rw-r--r--drivers/net/wireless/wl12xx/acx.c113
-rw-r--r--drivers/net/wireless/wl12xx/acx.h142
-rw-r--r--drivers/net/wireless/wl12xx/init.c4
-rw-r--r--drivers/net/wireless/wl12xx/main.c5
-rw-r--r--drivers/net/wireless/wl12xx/wl12xx.h4
5 files changed, 138 insertions, 130 deletions
diff --git a/drivers/net/wireless/wl12xx/acx.c b/drivers/net/wireless/wl12xx/acx.c
index 6447a0969ffe..dfb1cbb35acd 100644
--- a/drivers/net/wireless/wl12xx/acx.c
+++ b/drivers/net/wireless/wl12xx/acx.c
@@ -46,6 +46,7 @@ int wl1271_acx_wake_up_conditions(struct wl1271 *wl)
46 goto out; 46 goto out;
47 } 47 }
48 48
49 wake_up->role_id = wl->role_id;
49 wake_up->wake_up_event = wl->conf.conn.wake_up_event; 50 wake_up->wake_up_event = wl->conf.conn.wake_up_event;
50 wake_up->listen_interval = wl->conf.conn.listen_interval; 51 wake_up->listen_interval = wl->conf.conn.listen_interval;
51 52
@@ -101,6 +102,7 @@ int wl1271_acx_tx_power(struct wl1271 *wl, int power)
101 goto out; 102 goto out;
102 } 103 }
103 104
105 acx->role_id = wl->role_id;
104 acx->current_tx_power = power * 10; 106 acx->current_tx_power = power * 10;
105 107
106 ret = wl1271_cmd_configure(wl, DOT11_CUR_TX_PWR, acx, sizeof(*acx)); 108 ret = wl1271_cmd_configure(wl, DOT11_CUR_TX_PWR, acx, sizeof(*acx));
@@ -128,6 +130,7 @@ int wl1271_acx_feature_cfg(struct wl1271 *wl)
128 } 130 }
129 131
130 /* DF_ENCRYPTION_DISABLE and DF_SNIFF_MODE_ENABLE are disabled */ 132 /* DF_ENCRYPTION_DISABLE and DF_SNIFF_MODE_ENABLE are disabled */
133 feature->role_id = wl->role_id;
131 feature->data_flow_options = 0; 134 feature->data_flow_options = 0;
132 feature->options = 0; 135 feature->options = 0;
133 136
@@ -222,6 +225,7 @@ int wl1271_acx_slot(struct wl1271 *wl, enum acx_slot_type slot_time)
222 goto out; 225 goto out;
223 } 226 }
224 227
228 slot->role_id = wl->role_id;
225 slot->wone_index = STATION_WONE_INDEX; 229 slot->wone_index = STATION_WONE_INDEX;
226 slot->slot_time = slot_time; 230 slot->slot_time = slot_time;
227 231
@@ -251,6 +255,7 @@ int wl1271_acx_group_address_tbl(struct wl1271 *wl, bool enable,
251 } 255 }
252 256
253 /* MAC filtering */ 257 /* MAC filtering */
258 acx->role_id = wl->role_id;
254 acx->enabled = enable; 259 acx->enabled = enable;
255 acx->num_groups = mc_list_len; 260 acx->num_groups = mc_list_len;
256 memcpy(acx->mac_table, mc_list, mc_list_len * ETH_ALEN); 261 memcpy(acx->mac_table, mc_list, mc_list_len * ETH_ALEN);
@@ -280,6 +285,7 @@ int wl1271_acx_service_period_timeout(struct wl1271 *wl)
280 285
281 wl1271_debug(DEBUG_ACX, "acx service period timeout"); 286 wl1271_debug(DEBUG_ACX, "acx service period timeout");
282 287
288 rx_timeout->role_id = wl->role_id;
283 rx_timeout->ps_poll_timeout = cpu_to_le16(wl->conf.rx.ps_poll_timeout); 289 rx_timeout->ps_poll_timeout = cpu_to_le16(wl->conf.rx.ps_poll_timeout);
284 rx_timeout->upsd_timeout = cpu_to_le16(wl->conf.rx.upsd_timeout); 290 rx_timeout->upsd_timeout = cpu_to_le16(wl->conf.rx.upsd_timeout);
285 291
@@ -316,6 +322,7 @@ int wl1271_acx_rts_threshold(struct wl1271 *wl, u32 rts_threshold)
316 goto out; 322 goto out;
317 } 323 }
318 324
325 rts->role_id = wl->role_id;
319 rts->threshold = cpu_to_le16((u16)rts_threshold); 326 rts->threshold = cpu_to_le16((u16)rts_threshold);
320 327
321 ret = wl1271_cmd_configure(wl, DOT11_RTS_THRESHOLD, rts, sizeof(*rts)); 328 ret = wl1271_cmd_configure(wl, DOT11_RTS_THRESHOLD, rts, sizeof(*rts));
@@ -375,6 +382,7 @@ int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter)
375 goto out; 382 goto out;
376 } 383 }
377 384
385 beacon_filter->role_id = wl->role_id;
378 beacon_filter->enable = enable_filter; 386 beacon_filter->enable = enable_filter;
379 387
380 /* 388 /*
@@ -411,6 +419,7 @@ int wl1271_acx_beacon_filter_table(struct wl1271 *wl)
411 } 419 }
412 420
413 /* configure default beacon pass-through rules */ 421 /* configure default beacon pass-through rules */
422 ie_table->role_id = wl->role_id;
414 ie_table->num_ie = 0; 423 ie_table->num_ie = 0;
415 for (i = 0; i < wl->conf.conn.bcn_filt_ie_count; i++) { 424 for (i = 0; i < wl->conf.conn.bcn_filt_ie_count; i++) {
416 struct conf_bcn_filt_rule *r = &(wl->conf.conn.bcn_filt_ie[i]); 425 struct conf_bcn_filt_rule *r = &(wl->conf.conn.bcn_filt_ie[i]);
@@ -472,6 +481,7 @@ int wl1271_acx_conn_monit_params(struct wl1271 *wl, bool enable)
472 timeout = wl->conf.conn.bss_lose_timeout; 481 timeout = wl->conf.conn.bss_lose_timeout;
473 } 482 }
474 483
484 acx->role_id = wl->role_id;
475 acx->synch_fail_thold = cpu_to_le32(threshold); 485 acx->synch_fail_thold = cpu_to_le32(threshold);
476 acx->bss_lose_timeout = cpu_to_le32(timeout); 486 acx->bss_lose_timeout = cpu_to_le32(timeout);
477 487
@@ -619,6 +629,7 @@ int wl1271_acx_bcn_dtim_options(struct wl1271 *wl)
619 goto out; 629 goto out;
620 } 630 }
621 631
632 bb->role_id = wl->role_id;
622 bb->beacon_rx_timeout = cpu_to_le16(wl->conf.conn.beacon_rx_timeout); 633 bb->beacon_rx_timeout = cpu_to_le16(wl->conf.conn.beacon_rx_timeout);
623 bb->broadcast_timeout = cpu_to_le16(wl->conf.conn.broadcast_timeout); 634 bb->broadcast_timeout = cpu_to_le16(wl->conf.conn.broadcast_timeout);
624 bb->rx_broadcast_in_ps = wl->conf.conn.rx_broadcast_in_ps; 635 bb->rx_broadcast_in_ps = wl->conf.conn.rx_broadcast_in_ps;
@@ -648,6 +659,7 @@ int wl1271_acx_aid(struct wl1271 *wl, u16 aid)
648 goto out; 659 goto out;
649 } 660 }
650 661
662 acx_aid->role_id = wl->role_id;
651 acx_aid->aid = cpu_to_le16(aid); 663 acx_aid->aid = cpu_to_le16(aid);
652 664
653 ret = wl1271_cmd_configure(wl, ACX_AID, acx_aid, sizeof(*acx_aid)); 665 ret = wl1271_cmd_configure(wl, ACX_AID, acx_aid, sizeof(*acx_aid));
@@ -703,6 +715,7 @@ int wl1271_acx_set_preamble(struct wl1271 *wl, enum acx_preamble_type preamble)
703 goto out; 715 goto out;
704 } 716 }
705 717
718 acx->role_id = wl->role_id;
706 acx->preamble = preamble; 719 acx->preamble = preamble;
707 720
708 ret = wl1271_cmd_configure(wl, ACX_PREAMBLE_TYPE, acx, sizeof(*acx)); 721 ret = wl1271_cmd_configure(wl, ACX_PREAMBLE_TYPE, acx, sizeof(*acx));
@@ -730,6 +743,7 @@ int wl1271_acx_cts_protect(struct wl1271 *wl,
730 goto out; 743 goto out;
731 } 744 }
732 745
746 acx->role_id = wl->role_id;
733 acx->ctsprotect = ctsprotect; 747 acx->ctsprotect = ctsprotect;
734 748
735 ret = wl1271_cmd_configure(wl, ACX_CTS_PROTECTION, acx, sizeof(*acx)); 749 ret = wl1271_cmd_configure(wl, ACX_CTS_PROTECTION, acx, sizeof(*acx));
@@ -761,9 +775,8 @@ int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats)
761 775
762int wl1271_acx_sta_rate_policies(struct wl1271 *wl) 776int wl1271_acx_sta_rate_policies(struct wl1271 *wl)
763{ 777{
764 struct acx_sta_rate_policy *acx; 778 struct acx_rate_policy *acx;
765 struct conf_tx_rate_class *c = &wl->conf.tx.sta_rc_conf; 779 struct conf_tx_rate_class *c = &wl->conf.tx.sta_rc_conf;
766 int idx = 0;
767 int ret = 0; 780 int ret = 0;
768 781
769 wl1271_debug(DEBUG_ACX, "acx rate policies"); 782 wl1271_debug(DEBUG_ACX, "acx rate policies");
@@ -775,25 +788,30 @@ int wl1271_acx_sta_rate_policies(struct wl1271 *wl)
775 goto out; 788 goto out;
776 } 789 }
777 790
791 wl1271_debug(DEBUG_ACX, "basic_rate: 0x%x, full_rate: 0x%x",
792 wl->basic_rate, wl->rate_set);
793
778 /* configure one basic rate class */ 794 /* configure one basic rate class */
779 idx = ACX_TX_BASIC_RATE; 795 acx->rate_policy_idx = cpu_to_le32(ACX_TX_BASIC_RATE);
780 acx->rate_class[idx].enabled_rates = cpu_to_le32(wl->basic_rate); 796 acx->rate_policy.enabled_rates = cpu_to_le32(wl->basic_rate);
781 acx->rate_class[idx].short_retry_limit = c->short_retry_limit; 797 acx->rate_policy.short_retry_limit = c->short_retry_limit;
782 acx->rate_class[idx].long_retry_limit = c->long_retry_limit; 798 acx->rate_policy.long_retry_limit = c->long_retry_limit;
783 acx->rate_class[idx].aflags = c->aflags; 799 acx->rate_policy.aflags = c->aflags;
800
801 ret = wl1271_cmd_configure(wl, ACX_RATE_POLICY, acx, sizeof(*acx));
802 if (ret < 0) {
803 wl1271_warning("Setting of rate policies failed: %d", ret);
804 goto out;
805 }
784 806
785 /* configure one AP supported rate class */ 807 /* configure one AP supported rate class */
786 idx = ACX_TX_AP_FULL_RATE; 808 acx->rate_policy_idx = cpu_to_le32(ACX_TX_AP_FULL_RATE);
787 acx->rate_class[idx].enabled_rates = cpu_to_le32(wl->rate_set); 809 acx->rate_policy.enabled_rates = cpu_to_le32(wl->rate_set);
788 acx->rate_class[idx].short_retry_limit = c->short_retry_limit; 810 acx->rate_policy.short_retry_limit = c->short_retry_limit;
789 acx->rate_class[idx].long_retry_limit = c->long_retry_limit; 811 acx->rate_policy.long_retry_limit = c->long_retry_limit;
790 acx->rate_class[idx].aflags = c->aflags; 812 acx->rate_policy.aflags = c->aflags;
791 813
792 acx->rate_class_cnt = cpu_to_le32(ACX_TX_RATE_POLICY_CNT);
793 814
794 wl1271_debug(DEBUG_ACX, "basic_rate: 0x%x, full_rate: 0x%x",
795 acx->rate_class[ACX_TX_BASIC_RATE].enabled_rates,
796 acx->rate_class[ACX_TX_AP_FULL_RATE].enabled_rates);
797 815
798 ret = wl1271_cmd_configure(wl, ACX_RATE_POLICY, acx, sizeof(*acx)); 816 ret = wl1271_cmd_configure(wl, ACX_RATE_POLICY, acx, sizeof(*acx));
799 if (ret < 0) { 817 if (ret < 0) {
@@ -809,7 +827,7 @@ out:
809int wl1271_acx_ap_rate_policy(struct wl1271 *wl, struct conf_tx_rate_class *c, 827int wl1271_acx_ap_rate_policy(struct wl1271 *wl, struct conf_tx_rate_class *c,
810 u8 idx) 828 u8 idx)
811{ 829{
812 struct acx_ap_rate_policy *acx; 830 struct acx_rate_policy *acx;
813 int ret = 0; 831 int ret = 0;
814 832
815 wl1271_debug(DEBUG_ACX, "acx ap rate policy %d rates 0x%x", 833 wl1271_debug(DEBUG_ACX, "acx ap rate policy %d rates 0x%x",
@@ -855,6 +873,7 @@ int wl1271_acx_ac_cfg(struct wl1271 *wl, u8 ac, u8 cw_min, u16 cw_max,
855 goto out; 873 goto out;
856 } 874 }
857 875
876 acx->role_id = wl->role_id;
858 acx->ac = ac; 877 acx->ac = ac;
859 acx->cw_min = cw_min; 878 acx->cw_min = cw_min;
860 acx->cw_max = cpu_to_le16(cw_max); 879 acx->cw_max = cpu_to_le16(cw_max);
@@ -888,6 +907,7 @@ int wl1271_acx_tid_cfg(struct wl1271 *wl, u8 queue_id, u8 channel_type,
888 goto out; 907 goto out;
889 } 908 }
890 909
910 acx->role_id = wl->role_id;
891 acx->queue_id = queue_id; 911 acx->queue_id = queue_id;
892 acx->channel_type = channel_type; 912 acx->channel_type = channel_type;
893 acx->tsid = tsid; 913 acx->tsid = tsid;
@@ -967,52 +987,9 @@ out:
967 return ret; 987 return ret;
968} 988}
969 989
970int wl1271_acx_ap_mem_cfg(struct wl1271 *wl) 990int wl12xx_acx_mem_cfg(struct wl1271 *wl)
971{
972 struct wl1271_acx_ap_config_memory *mem_conf;
973 struct conf_memory_settings *mem;
974 int ret;
975
976 wl1271_debug(DEBUG_ACX, "wl1271 mem cfg");
977
978 mem_conf = kzalloc(sizeof(*mem_conf), GFP_KERNEL);
979 if (!mem_conf) {
980 ret = -ENOMEM;
981 goto out;
982 }
983
984 if (wl->chip.id == CHIP_ID_1283_PG20)
985 /*
986 * FIXME: The 128x AP FW does not yet support dynamic memory.
987 * Use the base memory configuration for 128x for now. This
988 * should be fine tuned in the future.
989 */
990 mem = &wl->conf.mem_wl128x;
991 else
992 mem = &wl->conf.mem_wl127x;
993
994 /* memory config */
995 mem_conf->num_stations = mem->num_stations;
996 mem_conf->rx_mem_block_num = mem->rx_block_num;
997 mem_conf->tx_min_mem_block_num = mem->tx_min_block_num;
998 mem_conf->num_ssid_profiles = mem->ssid_profiles;
999 mem_conf->total_tx_descriptors = cpu_to_le32(ACX_TX_DESCRIPTORS);
1000
1001 ret = wl1271_cmd_configure(wl, ACX_MEM_CFG, mem_conf,
1002 sizeof(*mem_conf));
1003 if (ret < 0) {
1004 wl1271_warning("wl1271 mem config failed: %d", ret);
1005 goto out;
1006 }
1007
1008out:
1009 kfree(mem_conf);
1010 return ret;
1011}
1012
1013int wl1271_acx_sta_mem_cfg(struct wl1271 *wl)
1014{ 991{
1015 struct wl1271_acx_sta_config_memory *mem_conf; 992 struct wl12xx_acx_config_memory *mem_conf;
1016 struct conf_memory_settings *mem; 993 struct conf_memory_settings *mem;
1017 int ret; 994 int ret;
1018 995
@@ -1155,6 +1132,7 @@ int wl1271_acx_bet_enable(struct wl1271 *wl, bool enable)
1155 goto out; 1132 goto out;
1156 } 1133 }
1157 1134
1135 acx->role_id = wl->role_id;
1158 acx->enable = enable ? CONF_BET_MODE_ENABLE : CONF_BET_MODE_DISABLE; 1136 acx->enable = enable ? CONF_BET_MODE_ENABLE : CONF_BET_MODE_DISABLE;
1159 acx->max_consecutive = wl->conf.conn.bet_max_consecutive; 1137 acx->max_consecutive = wl->conf.conn.bet_max_consecutive;
1160 1138
@@ -1182,6 +1160,7 @@ int wl1271_acx_arp_ip_filter(struct wl1271 *wl, u8 enable, __be32 address)
1182 goto out; 1160 goto out;
1183 } 1161 }
1184 1162
1163 acx->role_id = wl->role_id;
1185 acx->version = ACX_IPV4_VERSION; 1164 acx->version = ACX_IPV4_VERSION;
1186 acx->enable = enable; 1165 acx->enable = enable;
1187 1166
@@ -1241,6 +1220,7 @@ int wl1271_acx_keep_alive_mode(struct wl1271 *wl, bool enable)
1241 goto out; 1220 goto out;
1242 } 1221 }
1243 1222
1223 acx->role_id = wl->role_id;
1244 acx->enabled = enable; 1224 acx->enabled = enable;
1245 1225
1246 ret = wl1271_cmd_configure(wl, ACX_KEEP_ALIVE_MODE, acx, sizeof(*acx)); 1226 ret = wl1271_cmd_configure(wl, ACX_KEEP_ALIVE_MODE, acx, sizeof(*acx));
@@ -1267,6 +1247,7 @@ int wl1271_acx_keep_alive_config(struct wl1271 *wl, u8 index, u8 tpl_valid)
1267 goto out; 1247 goto out;
1268 } 1248 }
1269 1249
1250 acx->role_id = wl->role_id;
1270 acx->period = cpu_to_le32(wl->conf.conn.keep_alive_interval); 1251 acx->period = cpu_to_le32(wl->conf.conn.keep_alive_interval);
1271 acx->index = index; 1252 acx->index = index;
1272 acx->tpl_validation = tpl_valid; 1253 acx->tpl_validation = tpl_valid;
@@ -1300,6 +1281,7 @@ int wl1271_acx_rssi_snr_trigger(struct wl1271 *wl, bool enable,
1300 1281
1301 wl->last_rssi_event = -1; 1282 wl->last_rssi_event = -1;
1302 1283
1284 acx->role_id = wl->role_id;
1303 acx->pacing = cpu_to_le16(wl->conf.roam_trigger.trigger_pacing); 1285 acx->pacing = cpu_to_le16(wl->conf.roam_trigger.trigger_pacing);
1304 acx->metric = WL1271_ACX_TRIG_METRIC_RSSI_BEACON; 1286 acx->metric = WL1271_ACX_TRIG_METRIC_RSSI_BEACON;
1305 acx->type = WL1271_ACX_TRIG_TYPE_EDGE; 1287 acx->type = WL1271_ACX_TRIG_TYPE_EDGE;
@@ -1338,6 +1320,7 @@ int wl1271_acx_rssi_snr_avg_weights(struct wl1271 *wl)
1338 goto out; 1320 goto out;
1339 } 1321 }
1340 1322
1323 acx->role_id = wl->role_id;
1341 acx->rssi_beacon = c->avg_weight_rssi_beacon; 1324 acx->rssi_beacon = c->avg_weight_rssi_beacon;
1342 acx->rssi_data = c->avg_weight_rssi_data; 1325 acx->rssi_data = c->avg_weight_rssi_data;
1343 acx->snr_beacon = c->avg_weight_snr_beacon; 1326 acx->snr_beacon = c->avg_weight_snr_beacon;
@@ -1359,7 +1342,6 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
1359 bool allow_ht_operation) 1342 bool allow_ht_operation)
1360{ 1343{
1361 struct wl1271_acx_ht_capabilities *acx; 1344 struct wl1271_acx_ht_capabilities *acx;
1362 u8 mac_address[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
1363 int ret = 0; 1345 int ret = 0;
1364 u32 ht_capabilites = 0; 1346 u32 ht_capabilites = 0;
1365 1347
@@ -1390,7 +1372,7 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
1390 acx->ampdu_min_spacing = ht_cap->ampdu_density; 1372 acx->ampdu_min_spacing = ht_cap->ampdu_density;
1391 } 1373 }
1392 1374
1393 memcpy(acx->mac_address, mac_address, ETH_ALEN); 1375 acx->hlid = wl->sta_hlid;
1394 acx->ht_capabilites = cpu_to_le32(ht_capabilites); 1376 acx->ht_capabilites = cpu_to_le32(ht_capabilites);
1395 1377
1396 ret = wl1271_cmd_configure(wl, ACX_PEER_HT_CAP, acx, sizeof(*acx)); 1378 ret = wl1271_cmd_configure(wl, ACX_PEER_HT_CAP, acx, sizeof(*acx));
@@ -1418,6 +1400,7 @@ int wl1271_acx_set_ht_information(struct wl1271 *wl,
1418 goto out; 1400 goto out;
1419 } 1401 }
1420 1402
1403 acx->role_id = wl->role_id;
1421 acx->ht_protection = 1404 acx->ht_protection =
1422 (u8)(ht_operation_mode & IEEE80211_HT_OP_MODE_PROTECTION); 1405 (u8)(ht_operation_mode & IEEE80211_HT_OP_MODE_PROTECTION);
1423 acx->rifs_mode = 0; 1406 acx->rifs_mode = 0;
@@ -1578,6 +1561,7 @@ int wl1271_acx_ps_rx_streaming(struct wl1271 *wl, bool enable)
1578 if (!(conf_queues & BIT(i))) 1561 if (!(conf_queues & BIT(i)))
1579 continue; 1562 continue;
1580 1563
1564 rx_streaming->role_id = wl->role_id;
1581 rx_streaming->tid = i; 1565 rx_streaming->tid = i;
1582 rx_streaming->enable = enable_queues & BIT(i); 1566 rx_streaming->enable = enable_queues & BIT(i);
1583 rx_streaming->period = wl->conf.rx_streaming.interval; 1567 rx_streaming->period = wl->conf.rx_streaming.interval;
@@ -1607,6 +1591,7 @@ int wl1271_acx_ap_max_tx_retry(struct wl1271 *wl)
1607 if (!acx) 1591 if (!acx)
1608 return -ENOMEM; 1592 return -ENOMEM;
1609 1593
1594 acx->role_id = wl->role_id;
1610 acx->max_tx_retry = cpu_to_le16(wl->conf.tx.max_tx_retries); 1595 acx->max_tx_retry = cpu_to_le16(wl->conf.tx.max_tx_retries);
1611 1596
1612 ret = wl1271_cmd_configure(wl, ACX_MAX_TX_FAILURE, acx, sizeof(*acx)); 1597 ret = wl1271_cmd_configure(wl, ACX_MAX_TX_FAILURE, acx, sizeof(*acx));
diff --git a/drivers/net/wireless/wl12xx/acx.h b/drivers/net/wireless/wl12xx/acx.h
index 4ae0085c58ea..67258a15de21 100644
--- a/drivers/net/wireless/wl12xx/acx.h
+++ b/drivers/net/wireless/wl12xx/acx.h
@@ -101,6 +101,17 @@ struct acx_error_counter {
101 __le32 seq_num_miss; 101 __le32 seq_num_miss;
102} __packed; 102} __packed;
103 103
104enum wl12xx_role {
105 WL1271_ROLE_STA = 0,
106 WL1271_ROLE_IBSS,
107 WL1271_ROLE_AP,
108 WL1271_ROLE_DEVICE,
109 WL1271_ROLE_P2P_CL,
110 WL1271_ROLE_P2P_GO,
111
112 WL12XX_INVALID_ROLE_TYPE = 0xff
113};
114
104enum wl1271_psm_mode { 115enum wl1271_psm_mode {
105 /* Active mode */ 116 /* Active mode */
106 WL1271_PSM_CAM = 0, 117 WL1271_PSM_CAM = 0,
@@ -179,9 +190,10 @@ enum acx_slot_type {
179struct acx_slot { 190struct acx_slot {
180 struct acx_header header; 191 struct acx_header header;
181 192
193 u8 role_id;
182 u8 wone_index; /* Reserved */ 194 u8 wone_index; /* Reserved */
183 u8 slot_time; 195 u8 slot_time;
184 u8 reserved[6]; 196 u8 reserved[5];
185} __packed; 197} __packed;
186 198
187 199
@@ -191,29 +203,35 @@ struct acx_slot {
191struct acx_dot11_grp_addr_tbl { 203struct acx_dot11_grp_addr_tbl {
192 struct acx_header header; 204 struct acx_header header;
193 205
206 u8 role_id;
194 u8 enabled; 207 u8 enabled;
195 u8 num_groups; 208 u8 num_groups;
196 u8 pad[2]; 209 u8 pad[1];
197 u8 mac_table[ADDRESS_GROUP_MAX_LEN]; 210 u8 mac_table[ADDRESS_GROUP_MAX_LEN];
198} __packed; 211} __packed;
199 212
200struct acx_rx_timeout { 213struct acx_rx_timeout {
201 struct acx_header header; 214 struct acx_header header;
202 215
216 u8 role_id;
217 u8 reserved;
203 __le16 ps_poll_timeout; 218 __le16 ps_poll_timeout;
204 __le16 upsd_timeout; 219 __le16 upsd_timeout;
220 u8 padding[2];
205} __packed; 221} __packed;
206 222
207struct acx_rts_threshold { 223struct acx_rts_threshold {
208 struct acx_header header; 224 struct acx_header header;
209 225
226 u8 role_id;
227 u8 reserved;
210 __le16 threshold; 228 __le16 threshold;
211 u8 pad[2];
212} __packed; 229} __packed;
213 230
214struct acx_beacon_filter_option { 231struct acx_beacon_filter_option {
215 struct acx_header header; 232 struct acx_header header;
216 233
234 u8 role_id;
217 u8 enable; 235 u8 enable;
218 /* 236 /*
219 * The number of beacons without the unicast TIM 237 * The number of beacons without the unicast TIM
@@ -223,7 +241,7 @@ struct acx_beacon_filter_option {
223 * without the unicast TIM bit set are dropped. 241 * without the unicast TIM bit set are dropped.
224 */ 242 */
225 u8 max_num_beacons; 243 u8 max_num_beacons;
226 u8 pad[2]; 244 u8 pad[1];
227} __packed; 245} __packed;
228 246
229/* 247/*
@@ -262,14 +280,17 @@ struct acx_beacon_filter_option {
262struct acx_beacon_filter_ie_table { 280struct acx_beacon_filter_ie_table {
263 struct acx_header header; 281 struct acx_header header;
264 282
283 u8 role_id;
265 u8 num_ie; 284 u8 num_ie;
266 u8 pad[3]; 285 u8 pad[2];
267 u8 table[BEACON_FILTER_TABLE_MAX_SIZE]; 286 u8 table[BEACON_FILTER_TABLE_MAX_SIZE];
268} __packed; 287} __packed;
269 288
270struct acx_conn_monit_params { 289struct acx_conn_monit_params {
271 struct acx_header header; 290 struct acx_header header;
272 291
292 u8 role_id;
293 u8 padding[3];
273 __le32 synch_fail_thold; /* number of beacons missed */ 294 __le32 synch_fail_thold; /* number of beacons missed */
274 __le32 bss_lose_timeout; /* number of TU's from synch fail */ 295 __le32 bss_lose_timeout; /* number of TU's from synch fail */
275} __packed; 296} __packed;
@@ -318,15 +339,16 @@ struct acx_energy_detection {
318struct acx_beacon_broadcast { 339struct acx_beacon_broadcast {
319 struct acx_header header; 340 struct acx_header header;
320 341
321 __le16 beacon_rx_timeout; 342 u8 role_id;
322 __le16 broadcast_timeout;
323
324 /* Enables receiving of broadcast packets in PS mode */ 343 /* Enables receiving of broadcast packets in PS mode */
325 u8 rx_broadcast_in_ps; 344 u8 rx_broadcast_in_ps;
326 345
346 __le16 beacon_rx_timeout;
347 __le16 broadcast_timeout;
348
327 /* Consecutive PS Poll failures before updating the host */ 349 /* Consecutive PS Poll failures before updating the host */
328 u8 ps_poll_threshold; 350 u8 ps_poll_threshold;
329 u8 pad[2]; 351 u8 pad[1];
330} __packed; 352} __packed;
331 353
332struct acx_event_mask { 354struct acx_event_mask {
@@ -348,6 +370,8 @@ struct acx_event_mask {
348struct acx_feature_config { 370struct acx_feature_config {
349 struct acx_header header; 371 struct acx_header header;
350 372
373 u8 role_id;
374 u8 padding[3];
351 __le32 options; 375 __le32 options;
352 __le32 data_flow_options; 376 __le32 data_flow_options;
353} __packed; 377} __packed;
@@ -355,16 +379,18 @@ struct acx_feature_config {
355struct acx_current_tx_power { 379struct acx_current_tx_power {
356 struct acx_header header; 380 struct acx_header header;
357 381
382 u8 role_id;
358 u8 current_tx_power; 383 u8 current_tx_power;
359 u8 padding[3]; 384 u8 padding[2];
360} __packed; 385} __packed;
361 386
362struct acx_wake_up_condition { 387struct acx_wake_up_condition {
363 struct acx_header header; 388 struct acx_header header;
364 389
390 u8 role_id;
365 u8 wake_up_event; /* Only one bit can be set */ 391 u8 wake_up_event; /* Only one bit can be set */
366 u8 listen_interval; 392 u8 listen_interval;
367 u8 pad[2]; 393 u8 pad[1];
368} __packed; 394} __packed;
369 395
370struct acx_aid { 396struct acx_aid {
@@ -373,8 +399,9 @@ struct acx_aid {
373 /* 399 /*
374 * To be set when associated with an AP. 400 * To be set when associated with an AP.
375 */ 401 */
402 u8 role_id;
403 u8 reserved;
376 __le16 aid; 404 __le16 aid;
377 u8 pad[2];
378} __packed; 405} __packed;
379 406
380enum acx_preamble_type { 407enum acx_preamble_type {
@@ -389,8 +416,9 @@ struct acx_preamble {
389 * When set, the WiLink transmits the frames with a short preamble and 416 * When set, the WiLink transmits the frames with a short preamble and
390 * when cleared, the WiLink transmits the frames with a long preamble. 417 * when cleared, the WiLink transmits the frames with a long preamble.
391 */ 418 */
419 u8 role_id;
392 u8 preamble; 420 u8 preamble;
393 u8 padding[3]; 421 u8 padding[2];
394} __packed; 422} __packed;
395 423
396enum acx_ctsprotect_type { 424enum acx_ctsprotect_type {
@@ -400,8 +428,9 @@ enum acx_ctsprotect_type {
400 428
401struct acx_ctsprotect { 429struct acx_ctsprotect {
402 struct acx_header header; 430 struct acx_header header;
431 u8 role_id;
403 u8 ctsprotect; 432 u8 ctsprotect;
404 u8 padding[3]; 433 u8 padding[2];
405} __packed; 434} __packed;
406 435
407struct acx_tx_statistics { 436struct acx_tx_statistics {
@@ -636,18 +665,9 @@ struct acx_rate_class {
636 665
637#define ACX_TX_BASIC_RATE 0 666#define ACX_TX_BASIC_RATE 0
638#define ACX_TX_AP_FULL_RATE 1 667#define ACX_TX_AP_FULL_RATE 1
639#define ACX_TX_RATE_POLICY_CNT 2
640struct acx_sta_rate_policy {
641 struct acx_header header;
642
643 __le32 rate_class_cnt;
644 struct acx_rate_class rate_class[CONF_TX_MAX_RATE_CLASSES];
645} __packed;
646
647
648#define ACX_TX_AP_MODE_MGMT_RATE 4 668#define ACX_TX_AP_MODE_MGMT_RATE 4
649#define ACX_TX_AP_MODE_BCST_RATE 5 669#define ACX_TX_AP_MODE_BCST_RATE 5
650struct acx_ap_rate_policy { 670struct acx_rate_policy {
651 struct acx_header header; 671 struct acx_header header;
652 672
653 __le32 rate_policy_idx; 673 __le32 rate_policy_idx;
@@ -656,22 +676,23 @@ struct acx_ap_rate_policy {
656 676
657struct acx_ac_cfg { 677struct acx_ac_cfg {
658 struct acx_header header; 678 struct acx_header header;
679 u8 role_id;
659 u8 ac; 680 u8 ac;
681 u8 aifsn;
660 u8 cw_min; 682 u8 cw_min;
661 __le16 cw_max; 683 __le16 cw_max;
662 u8 aifsn;
663 u8 reserved;
664 __le16 tx_op_limit; 684 __le16 tx_op_limit;
665} __packed; 685} __packed;
666 686
667struct acx_tid_config { 687struct acx_tid_config {
668 struct acx_header header; 688 struct acx_header header;
689 u8 role_id;
669 u8 queue_id; 690 u8 queue_id;
670 u8 channel_type; 691 u8 channel_type;
671 u8 tsid; 692 u8 tsid;
672 u8 ps_scheme; 693 u8 ps_scheme;
673 u8 ack_policy; 694 u8 ack_policy;
674 u8 padding[3]; 695 u8 padding[2];
675 __le32 apsd_conf[2]; 696 __le32 apsd_conf[2];
676} __packed; 697} __packed;
677 698
@@ -687,19 +708,7 @@ struct acx_tx_config_options {
687 __le16 tx_compl_threshold; /* number of packets */ 708 __le16 tx_compl_threshold; /* number of packets */
688} __packed; 709} __packed;
689 710
690#define ACX_TX_DESCRIPTORS 32 711struct wl12xx_acx_config_memory {
691
692struct wl1271_acx_ap_config_memory {
693 struct acx_header header;
694
695 u8 rx_mem_block_num;
696 u8 tx_min_mem_block_num;
697 u8 num_stations;
698 u8 num_ssid_profiles;
699 __le32 total_tx_descriptors;
700} __packed;
701
702struct wl1271_acx_sta_config_memory {
703 struct acx_header header; 712 struct acx_header header;
704 713
705 u8 rx_mem_block_num; 714 u8 rx_mem_block_num;
@@ -773,9 +782,10 @@ struct wl1271_acx_rx_config_opt {
773struct wl1271_acx_bet_enable { 782struct wl1271_acx_bet_enable {
774 struct acx_header header; 783 struct acx_header header;
775 784
785 u8 role_id;
776 u8 enable; 786 u8 enable;
777 u8 max_consecutive; 787 u8 max_consecutive;
778 u8 padding[2]; 788 u8 padding[1];
779} __packed; 789} __packed;
780 790
781#define ACX_IPV4_VERSION 4 791#define ACX_IPV4_VERSION 4
@@ -788,9 +798,10 @@ struct wl1271_acx_bet_enable {
788 798
789struct wl1271_acx_arp_filter { 799struct wl1271_acx_arp_filter {
790 struct acx_header header; 800 struct acx_header header;
801 u8 role_id;
791 u8 version; /* ACX_IPV4_VERSION, ACX_IPV6_VERSION */ 802 u8 version; /* ACX_IPV4_VERSION, ACX_IPV6_VERSION */
792 u8 enable; /* bitmap of enabled ARP filtering features */ 803 u8 enable; /* bitmap of enabled ARP filtering features */
793 u8 padding[2]; 804 u8 padding[1];
794 u8 address[16]; /* The configured device IP address - all ARP 805 u8 address[16]; /* The configured device IP address - all ARP
795 requests directed to this IP address will pass 806 requests directed to this IP address will pass
796 through. For IPv4, the first four bytes are 807 through. For IPv4, the first four bytes are
@@ -808,8 +819,9 @@ struct wl1271_acx_pm_config {
808struct wl1271_acx_keep_alive_mode { 819struct wl1271_acx_keep_alive_mode {
809 struct acx_header header; 820 struct acx_header header;
810 821
822 u8 role_id;
811 u8 enabled; 823 u8 enabled;
812 u8 padding[3]; 824 u8 padding[2];
813} __packed; 825} __packed;
814 826
815enum { 827enum {
@@ -825,11 +837,11 @@ enum {
825struct wl1271_acx_keep_alive_config { 837struct wl1271_acx_keep_alive_config {
826 struct acx_header header; 838 struct acx_header header;
827 839
828 __le32 period; 840 u8 role_id;
829 u8 index; 841 u8 index;
830 u8 tpl_validation; 842 u8 tpl_validation;
831 u8 trigger; 843 u8 trigger;
832 u8 padding; 844 __le32 period;
833} __packed; 845} __packed;
834 846
835#define HOST_IF_CFG_RX_FIFO_ENABLE BIT(0) 847#define HOST_IF_CFG_RX_FIFO_ENABLE BIT(0)
@@ -873,20 +885,23 @@ enum {
873struct wl1271_acx_rssi_snr_trigger { 885struct wl1271_acx_rssi_snr_trigger {
874 struct acx_header header; 886 struct acx_header header;
875 887
876 __le16 threshold; 888 u8 role_id;
877 __le16 pacing; /* 0 - 60000 ms */
878 u8 metric; 889 u8 metric;
879 u8 type; 890 u8 type;
880 u8 dir; 891 u8 dir;
892 __le16 threshold;
893 __le16 pacing; /* 0 - 60000 ms */
881 u8 hysteresis; 894 u8 hysteresis;
882 u8 index; 895 u8 index;
883 u8 enable; 896 u8 enable;
884 u8 padding[2]; 897 u8 padding[1];
885}; 898};
886 899
887struct wl1271_acx_rssi_snr_avg_weights { 900struct wl1271_acx_rssi_snr_avg_weights {
888 struct acx_header header; 901 struct acx_header header;
889 902
903 u8 role_id;
904 u8 padding[3];
890 u8 rssi_beacon; 905 u8 rssi_beacon;
891 u8 rssi_data; 906 u8 rssi_data;
892 u8 snr_beacon; 907 u8 snr_beacon;
@@ -916,13 +931,8 @@ struct wl1271_acx_ht_capabilities {
916 */ 931 */
917 __le32 ht_capabilites; 932 __le32 ht_capabilites;
918 933
919 /* 934 /* Indicates to which link these capabilities apply. */
920 * Indicates to which peer these capabilities apply. 935 u8 hlid;
921 * For infrastructure use ff:ff:ff:ff:ff:ff that indicates relevance
922 * for all peers.
923 * Only valid for IBSS/DLS operation.
924 */
925 u8 mac_address[ETH_ALEN];
926 936
927 /* 937 /*
928 * This the maximum A-MPDU length supported by the AP. The FW may not 938 * This the maximum A-MPDU length supported by the AP. The FW may not
@@ -932,6 +942,8 @@ struct wl1271_acx_ht_capabilities {
932 942
933 /* This is the minimal spacing required when sending A-MPDUs to the AP*/ 943 /* This is the minimal spacing required when sending A-MPDUs to the AP*/
934 u8 ampdu_min_spacing; 944 u8 ampdu_min_spacing;
945
946 u8 padding;
935} __packed; 947} __packed;
936 948
937/* HT Capabilites Fw Bit Mask Mapping */ 949/* HT Capabilites Fw Bit Mask Mapping */
@@ -950,6 +962,8 @@ struct wl1271_acx_ht_capabilities {
950struct wl1271_acx_ht_information { 962struct wl1271_acx_ht_information {
951 struct acx_header header; 963 struct acx_header header;
952 964
965 u8 role_id;
966
953 /* Values: 0 - RIFS not allowed, 1 - RIFS allowed */ 967 /* Values: 0 - RIFS not allowed, 1 - RIFS allowed */
954 u8 rifs_mode; 968 u8 rifs_mode;
955 969
@@ -971,7 +985,7 @@ struct wl1271_acx_ht_information {
971 */ 985 */
972 u8 dual_cts_protection; 986 u8 dual_cts_protection;
973 987
974 u8 padding[3]; 988 u8 padding[2];
975} __packed; 989} __packed;
976 990
977#define RX_BA_WIN_SIZE 8 991#define RX_BA_WIN_SIZE 8
@@ -1041,6 +1055,7 @@ struct wl1271_acx_fw_tsf_information {
1041struct wl1271_acx_ps_rx_streaming { 1055struct wl1271_acx_ps_rx_streaming {
1042 struct acx_header header; 1056 struct acx_header header;
1043 1057
1058 u8 role_id;
1044 u8 tid; 1059 u8 tid;
1045 u8 enable; 1060 u8 enable;
1046 1061
@@ -1049,17 +1064,20 @@ struct wl1271_acx_ps_rx_streaming {
1049 1064
1050 /* timeout before first trigger (0-200 msec) */ 1065 /* timeout before first trigger (0-200 msec) */
1051 u8 timeout; 1066 u8 timeout;
1067 u8 padding[3];
1052} __packed; 1068} __packed;
1053 1069
1054struct wl1271_acx_ap_max_tx_retry { 1070struct wl1271_acx_ap_max_tx_retry {
1055 struct acx_header header; 1071 struct acx_header header;
1056 1072
1073 u8 role_id;
1074 u8 padding_1;
1075
1057 /* 1076 /*
1058 * the number of frames transmission failures before 1077 * the number of frames transmission failures before
1059 * issuing the aging event. 1078 * issuing the aging event.
1060 */ 1079 */
1061 __le16 max_tx_retry; 1080 __le16 max_tx_retry;
1062 u8 padding_1[2];
1063} __packed; 1081} __packed;
1064 1082
1065struct wl1271_acx_config_ps { 1083struct wl1271_acx_config_ps {
@@ -1151,10 +1169,7 @@ enum {
1151 ACX_AC_CFG = 0x0007, 1169 ACX_AC_CFG = 0x0007,
1152 ACX_MEM_MAP = 0x0008, 1170 ACX_MEM_MAP = 0x0008,
1153 ACX_AID = 0x000A, 1171 ACX_AID = 0x000A,
1154 /* ACX_FW_REV is missing in the ref driver, but seems to work */
1155 ACX_FW_REV = 0x000D,
1156 ACX_MEDIUM_USAGE = 0x000F, 1172 ACX_MEDIUM_USAGE = 0x000F,
1157 ACX_RX_CFG = 0x0010,
1158 ACX_TX_QUEUE_CFG = 0x0011, /* FIXME: only used by wl1251 */ 1173 ACX_TX_QUEUE_CFG = 0x0011, /* FIXME: only used by wl1251 */
1159 ACX_STATISTICS = 0x0013, /* Debug API */ 1174 ACX_STATISTICS = 0x0013, /* Debug API */
1160 ACX_PWR_CONSUMPTION_STATISTICS = 0x0014, 1175 ACX_PWR_CONSUMPTION_STATISTICS = 0x0014,
@@ -1170,7 +1185,6 @@ enum {
1170 ACX_CCA_THRESHOLD = 0x0025, 1185 ACX_CCA_THRESHOLD = 0x0025,
1171 ACX_EVENT_MBOX_MASK = 0x0026, 1186 ACX_EVENT_MBOX_MASK = 0x0026,
1172 ACX_CONN_MONIT_PARAMS = 0x002D, 1187 ACX_CONN_MONIT_PARAMS = 0x002D,
1173 ACX_CONS_TX_FAILURE = 0x002F,
1174 ACX_BCN_DTIM_OPTIONS = 0x0031, 1188 ACX_BCN_DTIM_OPTIONS = 0x0031,
1175 ACX_SG_ENABLE = 0x0032, 1189 ACX_SG_ENABLE = 0x0032,
1176 ACX_SG_CFG = 0x0033, 1190 ACX_SG_CFG = 0x0033,
@@ -1202,6 +1216,9 @@ enum {
1202 ACX_PEER_HT_CAP = 0x0057, 1216 ACX_PEER_HT_CAP = 0x0057,
1203 ACX_HT_BSS_OPERATION = 0x0058, 1217 ACX_HT_BSS_OPERATION = 0x0058,
1204 ACX_COEX_ACTIVITY = 0x0059, 1218 ACX_COEX_ACTIVITY = 0x0059,
1219 ACX_BURST_MODE = 0x005C,
1220 ACX_SET_RATE_MGMT_PARAMS = 0x005D,
1221 ACX_SET_RATE_ADAPT_PARAMS = 0x0060,
1205 ACX_SET_DCO_ITRIM_PARAMS = 0x0061, 1222 ACX_SET_DCO_ITRIM_PARAMS = 0x0061,
1206 ACX_GEN_FW_CMD = 0x0070, 1223 ACX_GEN_FW_CMD = 0x0070,
1207 ACX_HOST_IF_CFG_BITMAP = 0x0071, 1224 ACX_HOST_IF_CFG_BITMAP = 0x0071,
@@ -1256,8 +1273,7 @@ int wl1271_acx_tid_cfg(struct wl1271 *wl, u8 queue_id, u8 channel_type,
1256 u32 apsd_conf0, u32 apsd_conf1); 1273 u32 apsd_conf0, u32 apsd_conf1);
1257int wl1271_acx_frag_threshold(struct wl1271 *wl, u32 frag_threshold); 1274int wl1271_acx_frag_threshold(struct wl1271 *wl, u32 frag_threshold);
1258int wl1271_acx_tx_config_options(struct wl1271 *wl); 1275int wl1271_acx_tx_config_options(struct wl1271 *wl);
1259int wl1271_acx_ap_mem_cfg(struct wl1271 *wl); 1276int wl12xx_acx_mem_cfg(struct wl1271 *wl);
1260int wl1271_acx_sta_mem_cfg(struct wl1271 *wl);
1261int wl1271_acx_init_mem_config(struct wl1271 *wl); 1277int wl1271_acx_init_mem_config(struct wl1271 *wl);
1262int wl1271_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap); 1278int wl1271_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap);
1263int wl1271_acx_init_rx_interrupt(struct wl1271 *wl); 1279int wl1271_acx_init_rx_interrupt(struct wl1271 *wl);
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c
index 44cd515a057e..5a3325761d04 100644
--- a/drivers/net/wireless/wl12xx/init.c
+++ b/drivers/net/wireless/wl12xx/init.c
@@ -388,7 +388,7 @@ static int wl1271_sta_hw_init(struct wl1271 *wl)
388 if (ret < 0) 388 if (ret < 0)
389 return ret; 389 return ret;
390 390
391 ret = wl1271_acx_sta_mem_cfg(wl); 391 ret = wl12xx_acx_mem_cfg(wl);
392 if (ret < 0) 392 if (ret < 0)
393 return ret; 393 return ret;
394 394
@@ -447,7 +447,7 @@ static int wl1271_ap_hw_init(struct wl1271 *wl)
447 if (ret < 0) 447 if (ret < 0)
448 return ret; 448 return ret;
449 449
450 ret = wl1271_acx_ap_mem_cfg(wl); 450 ret = wl12xx_acx_mem_cfg(wl);
451 if (ret < 0) 451 if (ret < 0)
452 return ret; 452 return ret;
453 453
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 96f76b104e75..07d50b761610 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -718,7 +718,7 @@ static int wl1271_plt_init(struct wl1271 *wl)
718 if (ret < 0) 718 if (ret < 0)
719 goto out_free_memmap; 719 goto out_free_memmap;
720 720
721 ret = wl1271_acx_sta_mem_cfg(wl); 721 ret = wl12xx_acx_mem_cfg(wl);
722 if (ret < 0) 722 if (ret < 0)
723 goto out_free_memmap; 723 goto out_free_memmap;
724 724
@@ -1981,6 +1981,7 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl,
1981 wl->ap_fw_ps_map = 0; 1981 wl->ap_fw_ps_map = 0;
1982 wl->ap_ps_map = 0; 1982 wl->ap_ps_map = 0;
1983 wl->sched_scanning = false; 1983 wl->sched_scanning = false;
1984 wl->role_id = WL12XX_INVALID_ROLE_ID;
1984 1985
1985 /* 1986 /*
1986 * this is performed after the cancel_work calls and the associated 1987 * this is performed after the cancel_work calls and the associated
@@ -4317,6 +4318,8 @@ struct ieee80211_hw *wl1271_alloc_hw(void)
4317 wl->sched_scanning = false; 4318 wl->sched_scanning = false;
4318 wl->tx_security_seq = 0; 4319 wl->tx_security_seq = 0;
4319 wl->tx_security_last_seq_lsb = 0; 4320 wl->tx_security_last_seq_lsb = 0;
4321 wl->role_id = WL12XX_INVALID_ROLE_ID;
4322 wl->sta_hlid = WL12XX_INVALID_LINK_ID;
4320 4323
4321 setup_timer(&wl->rx_streaming_timer, wl1271_rx_streaming_timer, 4324 setup_timer(&wl->rx_streaming_timer, wl1271_rx_streaming_timer,
4322 (unsigned long) wl); 4325 (unsigned long) wl);
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index f708cd70185a..9f71dc75a01b 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -138,6 +138,8 @@ extern u32 wl12xx_debug_level;
138#define WL1271_DEFAULT_DTIM_PERIOD 1 138#define WL1271_DEFAULT_DTIM_PERIOD 1
139 139
140#define WL12XX_MAX_LINKS 8 140#define WL12XX_MAX_LINKS 8
141#define WL12XX_INVALID_ROLE_ID 0xff
142#define WL12XX_INVALID_LINK_ID 0xff
141#define WL1271_AP_GLOBAL_HLID 0 143#define WL1271_AP_GLOBAL_HLID 0
142#define WL1271_AP_BROADCAST_HLID 1 144#define WL1271_AP_BROADCAST_HLID 1
143#define WL1271_AP_STA_HLID_START 2 145#define WL1271_AP_STA_HLID_START 2
@@ -390,6 +392,8 @@ struct wl1271 {
390 u8 ssid[IEEE80211_MAX_SSID_LEN + 1]; 392 u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
391 u8 ssid_len; 393 u8 ssid_len;
392 int channel; 394 int channel;
395 u8 role_id;
396 u8 sta_hlid;
393 397
394 struct wl1271_acx_mem_map *target_mem_map; 398 struct wl1271_acx_mem_map *target_mem_map;
395 399