aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/wl12xx/acx.c44
-rw-r--r--drivers/net/wireless/wl12xx/acx.h26
-rw-r--r--drivers/net/wireless/wl12xx/cmd.c13
-rw-r--r--drivers/net/wireless/wl12xx/cmd.h14
-rw-r--r--drivers/net/wireless/wl12xx/conf.h29
-rw-r--r--drivers/net/wireless/wl12xx/event.c14
-rw-r--r--drivers/net/wireless/wl12xx/event.h2
-rw-r--r--drivers/net/wireless/wl12xx/init.c13
-rw-r--r--drivers/net/wireless/wl12xx/main.c22
-rw-r--r--drivers/net/wireless/wl12xx/ps.c6
-rw-r--r--drivers/net/wireless/wl12xx/rx.c6
-rw-r--r--drivers/net/wireless/wl12xx/rx.h2
-rw-r--r--drivers/net/wireless/wl12xx/wl12xx.h31
13 files changed, 162 insertions, 60 deletions
diff --git a/drivers/net/wireless/wl12xx/acx.c b/drivers/net/wireless/wl12xx/acx.c
index 84d94b25990..f2fbda06a12 100644
--- a/drivers/net/wireless/wl12xx/acx.c
+++ b/drivers/net/wireless/wl12xx/acx.c
@@ -947,9 +947,9 @@ out:
947 return ret; 947 return ret;
948} 948}
949 949
950int wl1271_acx_mem_cfg(struct wl1271 *wl) 950int wl1271_acx_ap_mem_cfg(struct wl1271 *wl)
951{ 951{
952 struct wl1271_acx_config_memory *mem_conf; 952 struct wl1271_acx_ap_config_memory *mem_conf;
953 int ret; 953 int ret;
954 954
955 wl1271_debug(DEBUG_ACX, "wl1271 mem cfg"); 955 wl1271_debug(DEBUG_ACX, "wl1271 mem cfg");
@@ -979,13 +979,45 @@ out:
979 return ret; 979 return ret;
980} 980}
981 981
982int wl1271_acx_init_mem_config(struct wl1271 *wl) 982int wl1271_acx_sta_mem_cfg(struct wl1271 *wl)
983{ 983{
984 struct wl1271_acx_sta_config_memory *mem_conf;
984 int ret; 985 int ret;
985 986
986 ret = wl1271_acx_mem_cfg(wl); 987 wl1271_debug(DEBUG_ACX, "wl1271 mem cfg");
987 if (ret < 0) 988
988 return ret; 989 mem_conf = kzalloc(sizeof(*mem_conf), GFP_KERNEL);
990 if (!mem_conf) {
991 ret = -ENOMEM;
992 goto out;
993 }
994
995 /* memory config */
996 mem_conf->num_stations = DEFAULT_NUM_STATIONS;
997 mem_conf->rx_mem_block_num = ACX_RX_MEM_BLOCKS;
998 mem_conf->tx_min_mem_block_num = ACX_TX_MIN_MEM_BLOCKS;
999 mem_conf->num_ssid_profiles = ACX_NUM_SSID_PROFILES;
1000 mem_conf->total_tx_descriptors = cpu_to_le32(ACX_TX_DESCRIPTORS);
1001 mem_conf->dyn_mem_enable = wl->conf.mem.dynamic_memory;
1002 mem_conf->tx_free_req = wl->conf.mem.min_req_tx_blocks;
1003 mem_conf->rx_free_req = wl->conf.mem.min_req_rx_blocks;
1004 mem_conf->tx_min = wl->conf.mem.tx_min;
1005
1006 ret = wl1271_cmd_configure(wl, ACX_MEM_CFG, mem_conf,
1007 sizeof(*mem_conf));
1008 if (ret < 0) {
1009 wl1271_warning("wl1271 mem config failed: %d", ret);
1010 goto out;
1011 }
1012
1013out:
1014 kfree(mem_conf);
1015 return ret;
1016}
1017
1018int wl1271_acx_init_mem_config(struct wl1271 *wl)
1019{
1020 int ret;
989 1021
990 wl->target_mem_map = kzalloc(sizeof(struct wl1271_acx_mem_map), 1022 wl->target_mem_map = kzalloc(sizeof(struct wl1271_acx_mem_map),
991 GFP_KERNEL); 1023 GFP_KERNEL);
diff --git a/drivers/net/wireless/wl12xx/acx.h b/drivers/net/wireless/wl12xx/acx.h
index 5bc0ca97bec..537fab40ed1 100644
--- a/drivers/net/wireless/wl12xx/acx.h
+++ b/drivers/net/wireless/wl12xx/acx.h
@@ -802,7 +802,7 @@ struct acx_tx_config_options {
802#define ACX_TX_DESCRIPTORS 32 802#define ACX_TX_DESCRIPTORS 32
803#define ACX_NUM_SSID_PROFILES 1 803#define ACX_NUM_SSID_PROFILES 1
804 804
805struct wl1271_acx_config_memory { 805struct wl1271_acx_ap_config_memory {
806 struct acx_header header; 806 struct acx_header header;
807 807
808 u8 rx_mem_block_num; 808 u8 rx_mem_block_num;
@@ -812,6 +812,20 @@ struct wl1271_acx_config_memory {
812 __le32 total_tx_descriptors; 812 __le32 total_tx_descriptors;
813} __packed; 813} __packed;
814 814
815struct wl1271_acx_sta_config_memory {
816 struct acx_header header;
817
818 u8 rx_mem_block_num;
819 u8 tx_min_mem_block_num;
820 u8 num_stations;
821 u8 num_ssid_profiles;
822 __le32 total_tx_descriptors;
823 u8 dyn_mem_enable;
824 u8 tx_free_req;
825 u8 rx_free_req;
826 u8 tx_min;
827} __packed;
828
815struct wl1271_acx_mem_map { 829struct wl1271_acx_mem_map {
816 struct acx_header header; 830 struct acx_header header;
817 831
@@ -1202,6 +1216,8 @@ enum {
1202 ACX_HT_BSS_OPERATION = 0x0058, 1216 ACX_HT_BSS_OPERATION = 0x0058,
1203 ACX_COEX_ACTIVITY = 0x0059, 1217 ACX_COEX_ACTIVITY = 0x0059,
1204 ACX_SET_DCO_ITRIM_PARAMS = 0x0061, 1218 ACX_SET_DCO_ITRIM_PARAMS = 0x0061,
1219 ACX_GEN_FW_CMD = 0x0070,
1220 ACX_HOST_IF_CFG_BITMAP = 0x0071,
1205 ACX_MAX_TX_FAILURE = 0x0072, 1221 ACX_MAX_TX_FAILURE = 0x0072,
1206 DOT11_RX_MSDU_LIFE_TIME = 0x1004, 1222 DOT11_RX_MSDU_LIFE_TIME = 0x1004,
1207 DOT11_CUR_TX_PWR = 0x100D, 1223 DOT11_CUR_TX_PWR = 0x100D,
@@ -1210,10 +1226,7 @@ enum {
1210 DOT11_GROUP_ADDRESS_TBL = 0x1014, 1226 DOT11_GROUP_ADDRESS_TBL = 0x1014,
1211 ACX_PM_CONFIG = 0x1016, 1227 ACX_PM_CONFIG = 0x1016,
1212 ACX_CONFIG_PS = 0x1017, 1228 ACX_CONFIG_PS = 0x1017,
1213 1229 ACX_CONFIG_HANGOVER = 0x1018,
1214 MAX_DOT11_IE = DOT11_GROUP_ADDRESS_TBL,
1215
1216 MAX_IE = 0xFFFF
1217}; 1230};
1218 1231
1219 1232
@@ -1255,7 +1268,8 @@ int wl1271_acx_tid_cfg(struct wl1271 *wl, u8 queue_id, u8 channel_type,
1255 u32 apsd_conf0, u32 apsd_conf1); 1268 u32 apsd_conf0, u32 apsd_conf1);
1256int wl1271_acx_frag_threshold(struct wl1271 *wl, u16 frag_threshold); 1269int wl1271_acx_frag_threshold(struct wl1271 *wl, u16 frag_threshold);
1257int wl1271_acx_tx_config_options(struct wl1271 *wl); 1270int wl1271_acx_tx_config_options(struct wl1271 *wl);
1258int wl1271_acx_mem_cfg(struct wl1271 *wl); 1271int wl1271_acx_ap_mem_cfg(struct wl1271 *wl);
1272int wl1271_acx_sta_mem_cfg(struct wl1271 *wl);
1259int wl1271_acx_init_mem_config(struct wl1271 *wl); 1273int wl1271_acx_init_mem_config(struct wl1271 *wl);
1260int wl1271_acx_init_rx_interrupt(struct wl1271 *wl); 1274int wl1271_acx_init_rx_interrupt(struct wl1271 *wl);
1261int wl1271_acx_smart_reflex(struct wl1271 *wl); 1275int wl1271_acx_smart_reflex(struct wl1271 *wl);
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index 1bb8be5e805..66d15e77da3 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -286,6 +286,13 @@ int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type)
286 join->rx_filter_options = cpu_to_le32(wl->rx_filter); 286 join->rx_filter_options = cpu_to_le32(wl->rx_filter);
287 join->bss_type = bss_type; 287 join->bss_type = bss_type;
288 join->basic_rate_set = cpu_to_le32(wl->basic_rate_set); 288 join->basic_rate_set = cpu_to_le32(wl->basic_rate_set);
289 /*
290 * for supported_rate_set, we should use wl->rate_set. however,
291 * it seems that acx_rate_policies doesn't affect full_rate, and
292 * since we want to avoid additional join, we'll use a 0xffffffff value,
293 * and let the fw find the actual supported rates
294 */
295 join->supported_rate_set = cpu_to_le32(0xffffffff);
289 296
290 if (wl->band == IEEE80211_BAND_5GHZ) 297 if (wl->band == IEEE80211_BAND_5GHZ)
291 join->bss_type |= WL1271_JOIN_CMD_BSS_TYPE_5GHZ; 298 join->bss_type |= WL1271_JOIN_CMD_BSS_TYPE_5GHZ;
@@ -454,7 +461,7 @@ out:
454 return ret; 461 return ret;
455} 462}
456 463
457int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, u32 rates, bool send) 464int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode)
458{ 465{
459 struct wl1271_cmd_ps_params *ps_params = NULL; 466 struct wl1271_cmd_ps_params *ps_params = NULL;
460 int ret = 0; 467 int ret = 0;
@@ -468,10 +475,6 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, u32 rates, bool send)
468 } 475 }
469 476
470 ps_params->ps_mode = ps_mode; 477 ps_params->ps_mode = ps_mode;
471 ps_params->send_null_data = send;
472 ps_params->retries = wl->conf.conn.psm_entry_nullfunc_retries;
473 ps_params->hang_over_period = wl->conf.conn.psm_entry_hangover_period;
474 ps_params->null_data_rate = cpu_to_le32(rates);
475 478
476 ret = wl1271_cmd_send(wl, CMD_SET_PS_MODE, ps_params, 479 ret = wl1271_cmd_send(wl, CMD_SET_PS_MODE, ps_params,
477 sizeof(*ps_params), 0); 480 sizeof(*ps_params), 0);
diff --git a/drivers/net/wireless/wl12xx/cmd.h b/drivers/net/wireless/wl12xx/cmd.h
index 75128141400..54c12e71417 100644
--- a/drivers/net/wireless/wl12xx/cmd.h
+++ b/drivers/net/wireless/wl12xx/cmd.h
@@ -39,7 +39,7 @@ int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer);
39int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len); 39int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len);
40int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len); 40int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len);
41int wl1271_cmd_data_path(struct wl1271 *wl, bool enable); 41int wl1271_cmd_data_path(struct wl1271 *wl, bool enable);
42int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, u32 rates, bool send); 42int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode);
43int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer, 43int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
44 size_t len); 44 size_t len);
45int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id, 45int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
@@ -140,6 +140,7 @@ enum cmd_templ {
140 * For CTS-to-self (FastCTS) mechanism 140 * For CTS-to-self (FastCTS) mechanism
141 * for BT/WLAN coexistence (SoftGemini). */ 141 * for BT/WLAN coexistence (SoftGemini). */
142 CMD_TEMPL_ARP_RSP, 142 CMD_TEMPL_ARP_RSP,
143 CMD_TEMPL_LINK_MEASUREMENT_REPORT,
143 144
144 /* AP-mode specific */ 145 /* AP-mode specific */
145 CMD_TEMPL_AP_BEACON = 13, 146 CMD_TEMPL_AP_BEACON = 13,
@@ -216,6 +217,7 @@ struct wl1271_cmd_join {
216 * ACK or CTS frames). 217 * ACK or CTS frames).
217 */ 218 */
218 __le32 basic_rate_set; 219 __le32 basic_rate_set;
220 __le32 supported_rate_set;
219 u8 dtim_interval; 221 u8 dtim_interval;
220 /* 222 /*
221 * bits 0-2: This bitwise field specifies the type 223 * bits 0-2: This bitwise field specifies the type
@@ -278,15 +280,7 @@ struct wl1271_cmd_ps_params {
278 struct wl1271_cmd_header header; 280 struct wl1271_cmd_header header;
279 281
280 u8 ps_mode; /* STATION_* */ 282 u8 ps_mode; /* STATION_* */
281 u8 send_null_data; /* Do we have to send NULL data packet ? */ 283 u8 padding[3];
282 u8 retries; /* Number of retires for the initial NULL data packet */
283
284 /*
285 * TUs during which the target stays awake after switching
286 * to power save mode.
287 */
288 u8 hang_over_period;
289 __le32 null_data_rate;
290} __packed; 284} __packed;
291 285
292/* HW encryption keys */ 286/* HW encryption keys */
diff --git a/drivers/net/wireless/wl12xx/conf.h b/drivers/net/wireless/wl12xx/conf.h
index c81aecd755e..d8c12491938 100644
--- a/drivers/net/wireless/wl12xx/conf.h
+++ b/drivers/net/wireless/wl12xx/conf.h
@@ -1151,6 +1151,34 @@ struct conf_ht_setting {
1151 u16 inactivity_timeout; 1151 u16 inactivity_timeout;
1152}; 1152};
1153 1153
1154struct conf_memory_settings {
1155 /* Disable/Enable dynamic memory */
1156 u8 dynamic_memory;
1157
1158 /*
1159 * Minimum required free tx memory blocks in order to assure optimum
1160 * performence
1161 *
1162 * Range: 0-120
1163 */
1164 u8 min_req_tx_blocks;
1165
1166 /*
1167 * Minimum required free rx memory blocks in order to assure optimum
1168 * performence
1169 *
1170 * Range: 0-120
1171 */
1172 u8 min_req_rx_blocks;
1173
1174 /*
1175 * Minimum number of mem blocks (free+used) guaranteed for TX
1176 *
1177 * Range: 0-120
1178 */
1179 u8 tx_min;
1180};
1181
1154struct conf_drv_settings { 1182struct conf_drv_settings {
1155 struct conf_sg_settings sg; 1183 struct conf_sg_settings sg;
1156 struct conf_rx_settings rx; 1184 struct conf_rx_settings rx;
@@ -1162,6 +1190,7 @@ struct conf_drv_settings {
1162 struct conf_scan_settings scan; 1190 struct conf_scan_settings scan;
1163 struct conf_rf_settings rf; 1191 struct conf_rf_settings rf;
1164 struct conf_ht_setting ht; 1192 struct conf_ht_setting ht;
1193 struct conf_memory_settings mem;
1165}; 1194};
1166 1195
1167#endif 1196#endif
diff --git a/drivers/net/wireless/wl12xx/event.c b/drivers/net/wireless/wl12xx/event.c
index 3376a5de09d..1b170c5cc59 100644
--- a/drivers/net/wireless/wl12xx/event.c
+++ b/drivers/net/wireless/wl12xx/event.c
@@ -135,20 +135,6 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
135 /* go to extremely low power mode */ 135 /* go to extremely low power mode */
136 wl1271_ps_elp_sleep(wl); 136 wl1271_ps_elp_sleep(wl);
137 break; 137 break;
138 case EVENT_EXIT_POWER_SAVE_FAIL:
139 wl1271_debug(DEBUG_PSM, "PSM exit failed");
140
141 if (test_bit(WL1271_FLAG_PSM, &wl->flags)) {
142 wl->psm_entry_retry = 0;
143 break;
144 }
145
146 /* make sure the firmware goes to active mode - the frame to
147 be sent next will indicate to the AP, that we are active. */
148 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE,
149 wl->basic_rate, false);
150 break;
151 case EVENT_EXIT_POWER_SAVE_SUCCESS:
152 default: 138 default:
153 break; 139 break;
154 } 140 }
diff --git a/drivers/net/wireless/wl12xx/event.h b/drivers/net/wireless/wl12xx/event.h
index 1d5ef670d48..0e80886f303 100644
--- a/drivers/net/wireless/wl12xx/event.h
+++ b/drivers/net/wireless/wl12xx/event.h
@@ -75,8 +75,6 @@ enum {
75enum { 75enum {
76 EVENT_ENTER_POWER_SAVE_FAIL = 0, 76 EVENT_ENTER_POWER_SAVE_FAIL = 0,
77 EVENT_ENTER_POWER_SAVE_SUCCESS, 77 EVENT_ENTER_POWER_SAVE_SUCCESS,
78 EVENT_EXIT_POWER_SAVE_FAIL,
79 EVENT_EXIT_POWER_SAVE_SUCCESS,
80}; 78};
81 79
82struct event_debug_report { 80struct event_debug_report {
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c
index 70b3dc88a21..62dc9839dd3 100644
--- a/drivers/net/wireless/wl12xx/init.c
+++ b/drivers/net/wireless/wl12xx/init.c
@@ -325,6 +325,11 @@ static int wl1271_sta_hw_init(struct wl1271 *wl)
325 if (ret < 0) 325 if (ret < 0)
326 return ret; 326 return ret;
327 327
328 /* PS config */
329 ret = wl1271_acx_config_ps(wl);
330 if (ret < 0)
331 return ret;
332
328 ret = wl1271_sta_init_templates_config(wl); 333 ret = wl1271_sta_init_templates_config(wl);
329 if (ret < 0) 334 if (ret < 0)
330 return ret; 335 return ret;
@@ -367,6 +372,10 @@ static int wl1271_sta_hw_init(struct wl1271 *wl)
367 if (ret < 0) 372 if (ret < 0)
368 return ret; 373 return ret;
369 374
375 ret = wl1271_acx_sta_mem_cfg(wl);
376 if (ret < 0)
377 return ret;
378
370 return 0; 379 return 0;
371} 380}
372 381
@@ -433,6 +442,10 @@ static int wl1271_ap_hw_init(struct wl1271 *wl)
433 if (ret < 0) 442 if (ret < 0)
434 return ret; 443 return ret;
435 444
445 ret = wl1271_acx_ap_mem_cfg(wl);
446 if (ret < 0)
447 return ret;
448
436 return 0; 449 return 0;
437} 450}
438 451
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 522bb09c953..91d68122128 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -298,6 +298,12 @@ static struct conf_drv_settings default_conf = {
298 .tx_ba_win_size = 64, 298 .tx_ba_win_size = 64,
299 .inactivity_timeout = 10000, 299 .inactivity_timeout = 10000,
300 }, 300 },
301 .mem = {
302 .dynamic_memory = 0,
303 .min_req_tx_blocks = 104,
304 .min_req_rx_blocks = 22,
305 .tx_min = 27,
306 }
301}; 307};
302 308
303static void __wl1271_op_remove_interface(struct wl1271 *wl); 309static void __wl1271_op_remove_interface(struct wl1271 *wl);
@@ -524,13 +530,19 @@ static int wl1271_plt_init(struct wl1271 *wl)
524} 530}
525 531
526static void wl1271_fw_status(struct wl1271 *wl, 532static void wl1271_fw_status(struct wl1271 *wl,
527 struct wl1271_fw_status *status) 533 struct wl1271_fw_full_status *full_status)
528{ 534{
535 struct wl1271_fw_common_status *status = &full_status->common;
529 struct timespec ts; 536 struct timespec ts;
530 u32 total = 0; 537 u32 total = 0;
531 int i; 538 int i;
532 539
533 wl1271_raw_read(wl, FW_STATUS_ADDR, status, sizeof(*status), false); 540 if (wl->bss_type == BSS_TYPE_AP_BSS)
541 wl1271_raw_read(wl, FW_STATUS_ADDR, status,
542 sizeof(struct wl1271_fw_ap_status), false);
543 else
544 wl1271_raw_read(wl, FW_STATUS_ADDR, status,
545 sizeof(struct wl1271_fw_sta_status), false);
534 546
535 wl1271_debug(DEBUG_IRQ, "intr: 0x%x (fw_rx_counter = %d, " 547 wl1271_debug(DEBUG_IRQ, "intr: 0x%x (fw_rx_counter = %d, "
536 "drv_rx_counter = %d, tx_results_counter = %d)", 548 "drv_rx_counter = %d, tx_results_counter = %d)",
@@ -589,7 +601,7 @@ static void wl1271_irq_work(struct work_struct *work)
589 loopcount--; 601 loopcount--;
590 602
591 wl1271_fw_status(wl, wl->fw_status); 603 wl1271_fw_status(wl, wl->fw_status);
592 intr = le32_to_cpu(wl->fw_status->intr); 604 intr = le32_to_cpu(wl->fw_status->common.intr);
593 if (!intr) { 605 if (!intr) {
594 wl1271_debug(DEBUG_IRQ, "Zero interrupt received."); 606 wl1271_debug(DEBUG_IRQ, "Zero interrupt received.");
595 spin_lock_irqsave(&wl->wl_lock, flags); 607 spin_lock_irqsave(&wl->wl_lock, flags);
@@ -611,7 +623,7 @@ static void wl1271_irq_work(struct work_struct *work)
611 wl1271_debug(DEBUG_IRQ, "WL1271_ACX_INTR_DATA"); 623 wl1271_debug(DEBUG_IRQ, "WL1271_ACX_INTR_DATA");
612 624
613 /* check for tx results */ 625 /* check for tx results */
614 if (wl->fw_status->tx_results_counter != 626 if (wl->fw_status->common.tx_results_counter !=
615 (wl->tx_results_count & 0xff)) 627 (wl->tx_results_count & 0xff))
616 wl1271_tx_complete(wl); 628 wl1271_tx_complete(wl);
617 629
@@ -625,7 +637,7 @@ static void wl1271_irq_work(struct work_struct *work)
625 wl1271_tx_work_locked(wl); 637 wl1271_tx_work_locked(wl);
626 } 638 }
627 639
628 wl1271_rx(wl, wl->fw_status); 640 wl1271_rx(wl, &wl->fw_status->common);
629 } 641 }
630 642
631 if (intr & WL1271_ACX_INTR_EVENT_A) { 643 if (intr & WL1271_ACX_INTR_EVENT_A) {
diff --git a/drivers/net/wireless/wl12xx/ps.c b/drivers/net/wireless/wl12xx/ps.c
index 60a3738eadb..2d3086ae633 100644
--- a/drivers/net/wireless/wl12xx/ps.c
+++ b/drivers/net/wireless/wl12xx/ps.c
@@ -139,8 +139,7 @@ int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode,
139 return ret; 139 return ret;
140 } 140 }
141 141
142 ret = wl1271_cmd_ps_mode(wl, STATION_POWER_SAVE_MODE, 142 ret = wl1271_cmd_ps_mode(wl, STATION_POWER_SAVE_MODE);
143 rates, send);
144 if (ret < 0) 143 if (ret < 0)
145 return ret; 144 return ret;
146 145
@@ -163,8 +162,7 @@ int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode,
163 if (ret < 0) 162 if (ret < 0)
164 return ret; 163 return ret;
165 164
166 ret = wl1271_cmd_ps_mode(wl, STATION_ACTIVE_MODE, 165 ret = wl1271_cmd_ps_mode(wl, STATION_ACTIVE_MODE);
167 rates, send);
168 if (ret < 0) 166 if (ret < 0)
169 return ret; 167 return ret;
170 168
diff --git a/drivers/net/wireless/wl12xx/rx.c b/drivers/net/wireless/wl12xx/rx.c
index b0c6ddc2a94..00d250d8da1 100644
--- a/drivers/net/wireless/wl12xx/rx.c
+++ b/drivers/net/wireless/wl12xx/rx.c
@@ -29,14 +29,14 @@
29#include "rx.h" 29#include "rx.h"
30#include "io.h" 30#include "io.h"
31 31
32static u8 wl1271_rx_get_mem_block(struct wl1271_fw_status *status, 32static u8 wl1271_rx_get_mem_block(struct wl1271_fw_common_status *status,
33 u32 drv_rx_counter) 33 u32 drv_rx_counter)
34{ 34{
35 return le32_to_cpu(status->rx_pkt_descs[drv_rx_counter]) & 35 return le32_to_cpu(status->rx_pkt_descs[drv_rx_counter]) &
36 RX_MEM_BLOCK_MASK; 36 RX_MEM_BLOCK_MASK;
37} 37}
38 38
39static u32 wl1271_rx_get_buf_size(struct wl1271_fw_status *status, 39static u32 wl1271_rx_get_buf_size(struct wl1271_fw_common_status *status,
40 u32 drv_rx_counter) 40 u32 drv_rx_counter)
41{ 41{
42 return (le32_to_cpu(status->rx_pkt_descs[drv_rx_counter]) & 42 return (le32_to_cpu(status->rx_pkt_descs[drv_rx_counter]) &
@@ -134,7 +134,7 @@ static int wl1271_rx_handle_data(struct wl1271 *wl, u8 *data, u32 length)
134 return 0; 134 return 0;
135} 135}
136 136
137void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_status *status) 137void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_common_status *status)
138{ 138{
139 struct wl1271_acx_mem_map *wl_mem_map = wl->target_mem_map; 139 struct wl1271_acx_mem_map *wl_mem_map = wl->target_mem_map;
140 u32 buf_size; 140 u32 buf_size;
diff --git a/drivers/net/wireless/wl12xx/rx.h b/drivers/net/wireless/wl12xx/rx.h
index 8d048b36bbb..4cef8fa3dee 100644
--- a/drivers/net/wireless/wl12xx/rx.h
+++ b/drivers/net/wireless/wl12xx/rx.h
@@ -119,7 +119,7 @@ struct wl1271_rx_descriptor {
119 u8 reserved; 119 u8 reserved;
120} __packed; 120} __packed;
121 121
122void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_status *status); 122void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_common_status *status);
123u8 wl1271_rate_to_idx(int rate, enum ieee80211_band band); 123u8 wl1271_rate_to_idx(int rate, enum ieee80211_band band);
124void wl1271_set_default_filters(struct wl1271 *wl); 124void wl1271_set_default_filters(struct wl1271 *wl);
125 125
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index d1de13fe7d9..140e26f3bae 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -130,7 +130,7 @@ extern u32 wl12xx_debug_level;
130 130
131 131
132 132
133#define WL1271_FW_NAME "wl1271-fw.bin" 133#define WL1271_FW_NAME "wl1271-fw-2.bin"
134#define WL1271_AP_FW_NAME "wl1271-fw-ap.bin" 134#define WL1271_AP_FW_NAME "wl1271-fw-ap.bin"
135 135
136#define WL1271_NVS_NAME "wl1271-nvs.bin" 136#define WL1271_NVS_NAME "wl1271-nvs.bin"
@@ -214,8 +214,8 @@ struct wl1271_stats {
214/* Broadcast and Global links + links to stations */ 214/* Broadcast and Global links + links to stations */
215#define AP_MAX_LINKS (AP_MAX_STATIONS + 2) 215#define AP_MAX_LINKS (AP_MAX_STATIONS + 2)
216 216
217/* FW status registers */ 217/* FW status registers common for AP/STA */
218struct wl1271_fw_status { 218struct wl1271_fw_common_status {
219 __le32 intr; 219 __le32 intr;
220 u8 fw_rx_counter; 220 u8 fw_rx_counter;
221 u8 drv_rx_counter; 221 u8 drv_rx_counter;
@@ -224,6 +224,11 @@ struct wl1271_fw_status {
224 __le32 rx_pkt_descs[NUM_RX_PKT_DESC]; 224 __le32 rx_pkt_descs[NUM_RX_PKT_DESC];
225 __le32 tx_released_blks[NUM_TX_QUEUES]; 225 __le32 tx_released_blks[NUM_TX_QUEUES];
226 __le32 fw_localtime; 226 __le32 fw_localtime;
227} __packed;
228
229/* FW status registers for AP */
230struct wl1271_fw_ap_status {
231 struct wl1271_fw_common_status common;
227 232
228 /* Next fields valid only in AP FW */ 233 /* Next fields valid only in AP FW */
229 234
@@ -238,6 +243,24 @@ struct wl1271_fw_status {
238 u8 padding_1[1]; 243 u8 padding_1[1];
239} __packed; 244} __packed;
240 245
246/* FW status registers for STA */
247struct wl1271_fw_sta_status {
248 struct wl1271_fw_common_status common;
249
250 u8 tx_total;
251 u8 reserved1;
252 __le16 reserved2;
253} __packed;
254
255struct wl1271_fw_full_status {
256 union {
257 struct wl1271_fw_common_status common;
258 struct wl1271_fw_sta_status sta;
259 struct wl1271_fw_ap_status ap;
260 };
261} __packed;
262
263
241struct wl1271_rx_mem_pool_addr { 264struct wl1271_rx_mem_pool_addr {
242 u32 addr; 265 u32 addr;
243 u32 addr_extra; 266 u32 addr_extra;
@@ -445,7 +468,7 @@ struct wl1271 {
445 u32 buffer_cmd; 468 u32 buffer_cmd;
446 u32 buffer_busyword[WL1271_BUSY_WORD_CNT]; 469 u32 buffer_busyword[WL1271_BUSY_WORD_CNT];
447 470
448 struct wl1271_fw_status *fw_status; 471 struct wl1271_fw_full_status *fw_status;
449 struct wl1271_tx_hw_res_if *tx_res_if; 472 struct wl1271_tx_hw_res_if *tx_res_if;
450 473
451 struct ieee80211_vif *vif; 474 struct ieee80211_vif *vif;