diff options
author | Luciano Coelho <luciano.coelho@nokia.com> | 2009-10-15 03:33:29 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:48:19 -0400 |
commit | d0f63b202146f3281800ee44823740c8bbf38f11 (patch) | |
tree | e6cfd9e31039674135c5727cc192b3d4270a457d /drivers/net/wireless | |
parent | 0b5b72da1b21fe61926318dd842f6dd7c8862e9f (diff) |
wl1271: fix endianess issues
We were not handling endianess correctly. The wl1271 chip runs on
little-endian values. This patch makes sure that all the communication with
the wl1271 firmware is done in little-endian by using cpu_to_le* and
le*_to_cpu where appropriate.
Also, all the struct definitions for data exchanged with the firmware has
been changed to use __le16/32 types instead of u16/32.
This fixes a few sparse warnings, such as these:
drivers/net/wireless/wl12xx/wl1271_cmd.c:554:42: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:555:42: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:577:58: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:579:58: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:676:18: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:787:22: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:789:21: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_tx.c:98:47: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/wl12xx/wl1271_acx.c:932:32: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_boot.c:191:32: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/wl12xx/wl1271_boot.c:197:38: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/wl12xx/wl1271_boot.c:199:37: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/wl12xx/wl1271_init.c:255:40: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_init.c:275:53: warning: incorrect type in assignment (different base types)
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_acx.c | 72 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_acx.h | 286 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_boot.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_cmd.c | 74 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_cmd.h | 68 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_event.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_event.h | 28 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_init.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_rx.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_rx.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_tx.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_tx.h | 18 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl12xx_80211.h | 4 |
15 files changed, 318 insertions, 304 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h index 1309b20e4d5b..566f1521ec22 100644 --- a/drivers/net/wireless/wl12xx/wl1271.h +++ b/drivers/net/wireless/wl12xx/wl1271.h | |||
@@ -283,15 +283,15 @@ struct wl1271_debugfs { | |||
283 | 283 | ||
284 | /* FW status registers */ | 284 | /* FW status registers */ |
285 | struct wl1271_fw_status { | 285 | struct wl1271_fw_status { |
286 | u32 intr; | 286 | __le32 intr; |
287 | u8 fw_rx_counter; | 287 | u8 fw_rx_counter; |
288 | u8 drv_rx_counter; | 288 | u8 drv_rx_counter; |
289 | u8 reserved; | 289 | u8 reserved; |
290 | u8 tx_results_counter; | 290 | u8 tx_results_counter; |
291 | u32 rx_pkt_descs[NUM_RX_PKT_DESC]; | 291 | __le32 rx_pkt_descs[NUM_RX_PKT_DESC]; |
292 | u32 tx_released_blks[NUM_TX_QUEUES]; | 292 | __le32 tx_released_blks[NUM_TX_QUEUES]; |
293 | u32 fw_localtime; | 293 | __le32 fw_localtime; |
294 | u32 padding[2]; | 294 | __le32 padding[2]; |
295 | } __attribute__ ((packed)); | 295 | } __attribute__ ((packed)); |
296 | 296 | ||
297 | struct wl1271_rx_mem_pool_addr { | 297 | struct wl1271_rx_mem_pool_addr { |
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c index e891cd5bd25c..bf5a8680a462 100644 --- a/drivers/net/wireless/wl12xx/wl1271_acx.c +++ b/drivers/net/wireless/wl12xx/wl1271_acx.c | |||
@@ -210,7 +210,7 @@ int wl1271_acx_rx_msdu_life_time(struct wl1271 *wl) | |||
210 | goto out; | 210 | goto out; |
211 | } | 211 | } |
212 | 212 | ||
213 | acx->lifetime = wl->conf.rx.rx_msdu_life_time; | 213 | acx->lifetime = cpu_to_le32(wl->conf.rx.rx_msdu_life_time); |
214 | ret = wl1271_cmd_configure(wl, DOT11_RX_MSDU_LIFE_TIME, | 214 | ret = wl1271_cmd_configure(wl, DOT11_RX_MSDU_LIFE_TIME, |
215 | acx, sizeof(*acx)); | 215 | acx, sizeof(*acx)); |
216 | if (ret < 0) { | 216 | if (ret < 0) { |
@@ -236,8 +236,8 @@ int wl1271_acx_rx_config(struct wl1271 *wl, u32 config, u32 filter) | |||
236 | goto out; | 236 | goto out; |
237 | } | 237 | } |
238 | 238 | ||
239 | rx_config->config_options = config; | 239 | rx_config->config_options = cpu_to_le32(config); |
240 | rx_config->filter_options = filter; | 240 | rx_config->filter_options = cpu_to_le32(filter); |
241 | 241 | ||
242 | ret = wl1271_cmd_configure(wl, ACX_RX_CFG, | 242 | ret = wl1271_cmd_configure(wl, ACX_RX_CFG, |
243 | rx_config, sizeof(*rx_config)); | 243 | rx_config, sizeof(*rx_config)); |
@@ -264,7 +264,7 @@ int wl1271_acx_pd_threshold(struct wl1271 *wl) | |||
264 | goto out; | 264 | goto out; |
265 | } | 265 | } |
266 | 266 | ||
267 | pd->threshold = wl->conf.rx.packet_detection_threshold; | 267 | pd->threshold = cpu_to_le32(wl->conf.rx.packet_detection_threshold); |
268 | 268 | ||
269 | ret = wl1271_cmd_configure(wl, ACX_PD_THRESHOLD, pd, sizeof(*pd)); | 269 | ret = wl1271_cmd_configure(wl, ACX_PD_THRESHOLD, pd, sizeof(*pd)); |
270 | if (ret < 0) { | 270 | if (ret < 0) { |
@@ -348,8 +348,8 @@ int wl1271_acx_service_period_timeout(struct wl1271 *wl) | |||
348 | 348 | ||
349 | wl1271_debug(DEBUG_ACX, "acx service period timeout"); | 349 | wl1271_debug(DEBUG_ACX, "acx service period timeout"); |
350 | 350 | ||
351 | rx_timeout->ps_poll_timeout = wl->conf.rx.ps_poll_timeout; | 351 | rx_timeout->ps_poll_timeout = cpu_to_le16(wl->conf.rx.ps_poll_timeout); |
352 | rx_timeout->upsd_timeout = wl->conf.rx.upsd_timeout; | 352 | rx_timeout->upsd_timeout = cpu_to_le16(wl->conf.rx.upsd_timeout); |
353 | 353 | ||
354 | ret = wl1271_cmd_configure(wl, ACX_SERVICE_PERIOD_TIMEOUT, | 354 | ret = wl1271_cmd_configure(wl, ACX_SERVICE_PERIOD_TIMEOUT, |
355 | rx_timeout, sizeof(*rx_timeout)); | 355 | rx_timeout, sizeof(*rx_timeout)); |
@@ -377,7 +377,7 @@ int wl1271_acx_rts_threshold(struct wl1271 *wl, u16 rts_threshold) | |||
377 | goto out; | 377 | goto out; |
378 | } | 378 | } |
379 | 379 | ||
380 | rts->threshold = rts_threshold; | 380 | rts->threshold = cpu_to_le16(rts_threshold); |
381 | 381 | ||
382 | ret = wl1271_cmd_configure(wl, DOT11_RTS_THRESHOLD, rts, sizeof(*rts)); | 382 | ret = wl1271_cmd_configure(wl, DOT11_RTS_THRESHOLD, rts, sizeof(*rts)); |
383 | if (ret < 0) { | 383 | if (ret < 0) { |
@@ -494,8 +494,8 @@ int wl1271_acx_conn_monit_params(struct wl1271 *wl) | |||
494 | goto out; | 494 | goto out; |
495 | } | 495 | } |
496 | 496 | ||
497 | acx->synch_fail_thold = wl->conf.conn.synch_fail_thold; | 497 | acx->synch_fail_thold = cpu_to_le32(wl->conf.conn.synch_fail_thold); |
498 | acx->bss_lose_timeout = wl->conf.conn.bss_lose_timeout; | 498 | acx->bss_lose_timeout = cpu_to_le32(wl->conf.conn.bss_lose_timeout); |
499 | 499 | ||
500 | ret = wl1271_cmd_configure(wl, ACX_CONN_MONIT_PARAMS, | 500 | ret = wl1271_cmd_configure(wl, ACX_CONN_MONIT_PARAMS, |
501 | acx, sizeof(*acx)); | 501 | acx, sizeof(*acx)); |
@@ -552,16 +552,18 @@ int wl1271_acx_sg_cfg(struct wl1271 *wl) | |||
552 | } | 552 | } |
553 | 553 | ||
554 | /* BT-WLAN coext parameters */ | 554 | /* BT-WLAN coext parameters */ |
555 | param->per_threshold = c->per_threshold; | 555 | param->per_threshold = cpu_to_le32(c->per_threshold); |
556 | param->max_scan_compensation_time = c->max_scan_compensation_time; | 556 | param->max_scan_compensation_time = |
557 | param->nfs_sample_interval = c->nfs_sample_interval; | 557 | cpu_to_le32(c->max_scan_compensation_time); |
558 | param->nfs_sample_interval = cpu_to_le16(c->nfs_sample_interval); | ||
558 | param->load_ratio = c->load_ratio; | 559 | param->load_ratio = c->load_ratio; |
559 | param->auto_ps_mode = c->auto_ps_mode; | 560 | param->auto_ps_mode = c->auto_ps_mode; |
560 | param->probe_req_compensation = c->probe_req_compensation; | 561 | param->probe_req_compensation = c->probe_req_compensation; |
561 | param->scan_window_compensation = c->scan_window_compensation; | 562 | param->scan_window_compensation = c->scan_window_compensation; |
562 | param->antenna_config = c->antenna_config; | 563 | param->antenna_config = c->antenna_config; |
563 | param->beacon_miss_threshold = c->beacon_miss_threshold; | 564 | param->beacon_miss_threshold = c->beacon_miss_threshold; |
564 | param->rate_adaptation_threshold = c->rate_adaptation_threshold; | 565 | param->rate_adaptation_threshold = |
566 | cpu_to_le32(c->rate_adaptation_threshold); | ||
565 | param->rate_adaptation_snr = c->rate_adaptation_snr; | 567 | param->rate_adaptation_snr = c->rate_adaptation_snr; |
566 | 568 | ||
567 | ret = wl1271_cmd_configure(wl, ACX_SG_CFG, param, sizeof(*param)); | 569 | ret = wl1271_cmd_configure(wl, ACX_SG_CFG, param, sizeof(*param)); |
@@ -588,7 +590,7 @@ int wl1271_acx_cca_threshold(struct wl1271 *wl) | |||
588 | goto out; | 590 | goto out; |
589 | } | 591 | } |
590 | 592 | ||
591 | detection->rx_cca_threshold = wl->conf.rx.rx_cca_threshold; | 593 | detection->rx_cca_threshold = cpu_to_le16(wl->conf.rx.rx_cca_threshold); |
592 | detection->tx_energy_detection = wl->conf.tx.tx_energy_detection; | 594 | detection->tx_energy_detection = wl->conf.tx.tx_energy_detection; |
593 | 595 | ||
594 | ret = wl1271_cmd_configure(wl, ACX_CCA_THRESHOLD, | 596 | ret = wl1271_cmd_configure(wl, ACX_CCA_THRESHOLD, |
@@ -616,8 +618,8 @@ int wl1271_acx_bcn_dtim_options(struct wl1271 *wl) | |||
616 | goto out; | 618 | goto out; |
617 | } | 619 | } |
618 | 620 | ||
619 | bb->beacon_rx_timeout = wl->conf.conn.beacon_rx_timeout; | 621 | bb->beacon_rx_timeout = cpu_to_le16(wl->conf.conn.beacon_rx_timeout); |
620 | bb->broadcast_timeout = wl->conf.conn.broadcast_timeout; | 622 | bb->broadcast_timeout = cpu_to_le16(wl->conf.conn.broadcast_timeout); |
621 | bb->rx_broadcast_in_ps = wl->conf.conn.rx_broadcast_in_ps; | 623 | bb->rx_broadcast_in_ps = wl->conf.conn.rx_broadcast_in_ps; |
622 | bb->ps_poll_threshold = wl->conf.conn.ps_poll_threshold; | 624 | bb->ps_poll_threshold = wl->conf.conn.ps_poll_threshold; |
623 | 625 | ||
@@ -645,7 +647,7 @@ int wl1271_acx_aid(struct wl1271 *wl, u16 aid) | |||
645 | goto out; | 647 | goto out; |
646 | } | 648 | } |
647 | 649 | ||
648 | acx_aid->aid = aid; | 650 | acx_aid->aid = cpu_to_le16(aid); |
649 | 651 | ||
650 | ret = wl1271_cmd_configure(wl, ACX_AID, acx_aid, sizeof(*acx_aid)); | 652 | ret = wl1271_cmd_configure(wl, ACX_AID, acx_aid, sizeof(*acx_aid)); |
651 | if (ret < 0) { | 653 | if (ret < 0) { |
@@ -672,9 +674,8 @@ int wl1271_acx_event_mbox_mask(struct wl1271 *wl, u32 event_mask) | |||
672 | } | 674 | } |
673 | 675 | ||
674 | /* high event mask is unused */ | 676 | /* high event mask is unused */ |
675 | mask->high_event_mask = 0xffffffff; | 677 | mask->high_event_mask = cpu_to_le32(0xffffffff); |
676 | 678 | mask->event_mask = cpu_to_le32(event_mask); | |
677 | mask->event_mask = event_mask; | ||
678 | 679 | ||
679 | ret = wl1271_cmd_configure(wl, ACX_EVENT_MBOX_MASK, | 680 | ret = wl1271_cmd_configure(wl, ACX_EVENT_MBOX_MASK, |
680 | mask, sizeof(*mask)); | 681 | mask, sizeof(*mask)); |
@@ -773,8 +774,8 @@ int wl1271_acx_rate_policies(struct wl1271 *wl, u32 enabled_rates) | |||
773 | } | 774 | } |
774 | 775 | ||
775 | /* configure one default (one-size-fits-all) rate class */ | 776 | /* configure one default (one-size-fits-all) rate class */ |
776 | acx->rate_class_cnt = 1; | 777 | acx->rate_class_cnt = cpu_to_le32(1); |
777 | acx->rate_class[0].enabled_rates = enabled_rates; | 778 | acx->rate_class[0].enabled_rates = cpu_to_le32(enabled_rates); |
778 | acx->rate_class[0].short_retry_limit = c->short_retry_limit; | 779 | acx->rate_class[0].short_retry_limit = c->short_retry_limit; |
779 | acx->rate_class[0].long_retry_limit = c->long_retry_limit; | 780 | acx->rate_class[0].long_retry_limit = c->long_retry_limit; |
780 | acx->rate_class[0].aflags = c->aflags; | 781 | acx->rate_class[0].aflags = c->aflags; |
@@ -808,10 +809,10 @@ int wl1271_acx_ac_cfg(struct wl1271 *wl) | |||
808 | struct conf_tx_ac_category *c = &(wl->conf.tx.ac_conf[i]); | 809 | struct conf_tx_ac_category *c = &(wl->conf.tx.ac_conf[i]); |
809 | acx->ac = c->ac; | 810 | acx->ac = c->ac; |
810 | acx->cw_min = c->cw_min; | 811 | acx->cw_min = c->cw_min; |
811 | acx->cw_max = c->cw_max; | 812 | acx->cw_max = cpu_to_le16(c->cw_max); |
812 | acx->aifsn = c->aifsn; | 813 | acx->aifsn = c->aifsn; |
813 | acx->reserved = 0; | 814 | acx->reserved = 0; |
814 | acx->tx_op_limit = c->tx_op_limit; | 815 | acx->tx_op_limit = cpu_to_le16(c->tx_op_limit); |
815 | 816 | ||
816 | ret = wl1271_cmd_configure(wl, ACX_AC_CFG, acx, sizeof(*acx)); | 817 | ret = wl1271_cmd_configure(wl, ACX_AC_CFG, acx, sizeof(*acx)); |
817 | if (ret < 0) { | 818 | if (ret < 0) { |
@@ -847,8 +848,8 @@ int wl1271_acx_tid_cfg(struct wl1271 *wl) | |||
847 | acx->tsid = c->tsid; | 848 | acx->tsid = c->tsid; |
848 | acx->ps_scheme = c->ps_scheme; | 849 | acx->ps_scheme = c->ps_scheme; |
849 | acx->ack_policy = c->ack_policy; | 850 | acx->ack_policy = c->ack_policy; |
850 | acx->apsd_conf[0] = c->apsd_conf[0]; | 851 | acx->apsd_conf[0] = cpu_to_le32(c->apsd_conf[0]); |
851 | acx->apsd_conf[1] = c->apsd_conf[1]; | 852 | acx->apsd_conf[1] = cpu_to_le32(c->apsd_conf[1]); |
852 | 853 | ||
853 | ret = wl1271_cmd_configure(wl, ACX_TID_CFG, acx, sizeof(*acx)); | 854 | ret = wl1271_cmd_configure(wl, ACX_TID_CFG, acx, sizeof(*acx)); |
854 | if (ret < 0) { | 855 | if (ret < 0) { |
@@ -876,7 +877,7 @@ int wl1271_acx_frag_threshold(struct wl1271 *wl) | |||
876 | goto out; | 877 | goto out; |
877 | } | 878 | } |
878 | 879 | ||
879 | acx->frag_threshold = wl->conf.tx.frag_threshold; | 880 | acx->frag_threshold = cpu_to_le16(wl->conf.tx.frag_threshold); |
880 | ret = wl1271_cmd_configure(wl, ACX_FRAG_CFG, acx, sizeof(*acx)); | 881 | ret = wl1271_cmd_configure(wl, ACX_FRAG_CFG, acx, sizeof(*acx)); |
881 | if (ret < 0) { | 882 | if (ret < 0) { |
882 | wl1271_warning("Setting of frag threshold failed: %d", ret); | 883 | wl1271_warning("Setting of frag threshold failed: %d", ret); |
@@ -902,8 +903,8 @@ int wl1271_acx_tx_config_options(struct wl1271 *wl) | |||
902 | goto out; | 903 | goto out; |
903 | } | 904 | } |
904 | 905 | ||
905 | acx->tx_compl_timeout = wl->conf.tx.tx_compl_timeout; | 906 | acx->tx_compl_timeout = cpu_to_le16(wl->conf.tx.tx_compl_timeout); |
906 | acx->tx_compl_threshold = wl->conf.tx.tx_compl_threshold; | 907 | acx->tx_compl_threshold = cpu_to_le16(wl->conf.tx.tx_compl_threshold); |
907 | ret = wl1271_cmd_configure(wl, ACX_TX_CONFIG_OPT, acx, sizeof(*acx)); | 908 | ret = wl1271_cmd_configure(wl, ACX_TX_CONFIG_OPT, acx, sizeof(*acx)); |
908 | if (ret < 0) { | 909 | if (ret < 0) { |
909 | wl1271_warning("Setting of tx options failed: %d", ret); | 910 | wl1271_warning("Setting of tx options failed: %d", ret); |
@@ -929,11 +930,11 @@ int wl1271_acx_mem_cfg(struct wl1271 *wl) | |||
929 | } | 930 | } |
930 | 931 | ||
931 | /* memory config */ | 932 | /* memory config */ |
932 | mem_conf->num_stations = cpu_to_le16(DEFAULT_NUM_STATIONS); | 933 | mem_conf->num_stations = DEFAULT_NUM_STATIONS; |
933 | mem_conf->rx_mem_block_num = ACX_RX_MEM_BLOCKS; | 934 | mem_conf->rx_mem_block_num = ACX_RX_MEM_BLOCKS; |
934 | mem_conf->tx_min_mem_block_num = ACX_TX_MIN_MEM_BLOCKS; | 935 | mem_conf->tx_min_mem_block_num = ACX_TX_MIN_MEM_BLOCKS; |
935 | mem_conf->num_ssid_profiles = ACX_NUM_SSID_PROFILES; | 936 | mem_conf->num_ssid_profiles = ACX_NUM_SSID_PROFILES; |
936 | mem_conf->total_tx_descriptors = ACX_TX_DESCRIPTORS; | 937 | mem_conf->total_tx_descriptors = cpu_to_le32(ACX_TX_DESCRIPTORS); |
937 | 938 | ||
938 | ret = wl1271_cmd_configure(wl, ACX_MEM_CFG, mem_conf, | 939 | ret = wl1271_cmd_configure(wl, ACX_MEM_CFG, mem_conf, |
939 | sizeof(*mem_conf)); | 940 | sizeof(*mem_conf)); |
@@ -973,7 +974,8 @@ int wl1271_acx_init_mem_config(struct wl1271 *wl) | |||
973 | } | 974 | } |
974 | 975 | ||
975 | /* initialize TX block book keeping */ | 976 | /* initialize TX block book keeping */ |
976 | wl->tx_blocks_available = wl->target_mem_map->num_tx_mem_blocks; | 977 | wl->tx_blocks_available = |
978 | le32_to_cpu(wl->target_mem_map->num_tx_mem_blocks); | ||
977 | wl1271_debug(DEBUG_TX, "available tx blocks: %d", | 979 | wl1271_debug(DEBUG_TX, "available tx blocks: %d", |
978 | wl->tx_blocks_available); | 980 | wl->tx_blocks_available); |
979 | 981 | ||
@@ -993,9 +995,9 @@ int wl1271_acx_init_rx_interrupt(struct wl1271 *wl) | |||
993 | goto out; | 995 | goto out; |
994 | } | 996 | } |
995 | 997 | ||
996 | rx_conf->threshold = wl->conf.rx.irq_pkt_threshold; | 998 | rx_conf->threshold = cpu_to_le16(wl->conf.rx.irq_pkt_threshold); |
997 | rx_conf->timeout = wl->conf.rx.irq_timeout; | 999 | rx_conf->timeout = cpu_to_le16(wl->conf.rx.irq_timeout); |
998 | rx_conf->mblk_threshold = wl->conf.rx.irq_blk_threshold; | 1000 | rx_conf->mblk_threshold = cpu_to_le16(wl->conf.rx.irq_blk_threshold); |
999 | rx_conf->queue_type = wl->conf.rx.queue_type; | 1001 | rx_conf->queue_type = wl->conf.rx.queue_type; |
1000 | 1002 | ||
1001 | ret = wl1271_cmd_configure(wl, ACX_RX_CONFIG_OPT, rx_conf, | 1003 | ret = wl1271_cmd_configure(wl, ACX_RX_CONFIG_OPT, rx_conf, |
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.h b/drivers/net/wireless/wl12xx/wl1271_acx.h index 5085497d1339..2ce0a8128542 100644 --- a/drivers/net/wireless/wl12xx/wl1271_acx.h +++ b/drivers/net/wireless/wl12xx/wl1271_acx.h | |||
@@ -71,10 +71,10 @@ struct acx_header { | |||
71 | struct wl1271_cmd_header cmd; | 71 | struct wl1271_cmd_header cmd; |
72 | 72 | ||
73 | /* acx (or information element) header */ | 73 | /* acx (or information element) header */ |
74 | u16 id; | 74 | __le16 id; |
75 | 75 | ||
76 | /* payload length (not including headers */ | 76 | /* payload length (not including headers */ |
77 | u16 len; | 77 | __le16 len; |
78 | } __attribute__ ((packed)); | 78 | } __attribute__ ((packed)); |
79 | 79 | ||
80 | struct acx_error_counter { | 80 | struct acx_error_counter { |
@@ -83,21 +83,21 @@ struct acx_error_counter { | |||
83 | /* The number of PLCP errors since the last time this */ | 83 | /* The number of PLCP errors since the last time this */ |
84 | /* information element was interrogated. This field is */ | 84 | /* information element was interrogated. This field is */ |
85 | /* automatically cleared when it is interrogated.*/ | 85 | /* automatically cleared when it is interrogated.*/ |
86 | u32 PLCP_error; | 86 | __le32 PLCP_error; |
87 | 87 | ||
88 | /* The number of FCS errors since the last time this */ | 88 | /* The number of FCS errors since the last time this */ |
89 | /* information element was interrogated. This field is */ | 89 | /* information element was interrogated. This field is */ |
90 | /* automatically cleared when it is interrogated.*/ | 90 | /* automatically cleared when it is interrogated.*/ |
91 | u32 FCS_error; | 91 | __le32 FCS_error; |
92 | 92 | ||
93 | /* The number of MPDUs without PLCP header errors received*/ | 93 | /* The number of MPDUs without PLCP header errors received*/ |
94 | /* since the last time this information element was interrogated. */ | 94 | /* since the last time this information element was interrogated. */ |
95 | /* This field is automatically cleared when it is interrogated.*/ | 95 | /* This field is automatically cleared when it is interrogated.*/ |
96 | u32 valid_frame; | 96 | __le32 valid_frame; |
97 | 97 | ||
98 | /* the number of missed sequence numbers in the squentially */ | 98 | /* the number of missed sequence numbers in the squentially */ |
99 | /* values of frames seq numbers */ | 99 | /* values of frames seq numbers */ |
100 | u32 seq_num_miss; | 100 | __le32 seq_num_miss; |
101 | } __attribute__ ((packed)); | 101 | } __attribute__ ((packed)); |
102 | 102 | ||
103 | struct acx_revision { | 103 | struct acx_revision { |
@@ -126,7 +126,7 @@ struct acx_revision { | |||
126 | * (1 = first spin, 2 = second spin, and so on). | 126 | * (1 = first spin, 2 = second spin, and so on). |
127 | * bits 24 - 31: Chip ID - The WiLink chip ID. | 127 | * bits 24 - 31: Chip ID - The WiLink chip ID. |
128 | */ | 128 | */ |
129 | u32 hw_version; | 129 | __le32 hw_version; |
130 | } __attribute__ ((packed)); | 130 | } __attribute__ ((packed)); |
131 | 131 | ||
132 | enum wl1271_psm_mode { | 132 | enum wl1271_psm_mode { |
@@ -186,7 +186,7 @@ struct acx_rx_msdu_lifetime { | |||
186 | * The maximum amount of time, in TU, before the | 186 | * The maximum amount of time, in TU, before the |
187 | * firmware discards the MSDU. | 187 | * firmware discards the MSDU. |
188 | */ | 188 | */ |
189 | u32 lifetime; | 189 | __le32 lifetime; |
190 | } __attribute__ ((packed)); | 190 | } __attribute__ ((packed)); |
191 | 191 | ||
192 | /* | 192 | /* |
@@ -273,14 +273,14 @@ struct acx_rx_msdu_lifetime { | |||
273 | struct acx_rx_config { | 273 | struct acx_rx_config { |
274 | struct acx_header header; | 274 | struct acx_header header; |
275 | 275 | ||
276 | u32 config_options; | 276 | __le32 config_options; |
277 | u32 filter_options; | 277 | __le32 filter_options; |
278 | } __attribute__ ((packed)); | 278 | } __attribute__ ((packed)); |
279 | 279 | ||
280 | struct acx_packet_detection { | 280 | struct acx_packet_detection { |
281 | struct acx_header header; | 281 | struct acx_header header; |
282 | 282 | ||
283 | u32 threshold; | 283 | __le32 threshold; |
284 | } __attribute__ ((packed)); | 284 | } __attribute__ ((packed)); |
285 | 285 | ||
286 | 286 | ||
@@ -317,14 +317,14 @@ struct acx_dot11_grp_addr_tbl { | |||
317 | struct acx_rx_timeout { | 317 | struct acx_rx_timeout { |
318 | struct acx_header header; | 318 | struct acx_header header; |
319 | 319 | ||
320 | u16 ps_poll_timeout; | 320 | __le16 ps_poll_timeout; |
321 | u16 upsd_timeout; | 321 | __le16 upsd_timeout; |
322 | } __attribute__ ((packed)); | 322 | } __attribute__ ((packed)); |
323 | 323 | ||
324 | struct acx_rts_threshold { | 324 | struct acx_rts_threshold { |
325 | struct acx_header header; | 325 | struct acx_header header; |
326 | 326 | ||
327 | u16 threshold; | 327 | __le16 threshold; |
328 | u8 pad[2]; | 328 | u8 pad[2]; |
329 | } __attribute__ ((packed)); | 329 | } __attribute__ ((packed)); |
330 | 330 | ||
@@ -388,8 +388,8 @@ struct acx_beacon_filter_ie_table { | |||
388 | struct acx_conn_monit_params { | 388 | struct acx_conn_monit_params { |
389 | struct acx_header header; | 389 | struct acx_header header; |
390 | 390 | ||
391 | u32 synch_fail_thold; /* number of beacons missed */ | 391 | __le32 synch_fail_thold; /* number of beacons missed */ |
392 | u32 bss_lose_timeout; /* number of TU's from synch fail */ | 392 | __le32 bss_lose_timeout; /* number of TU's from synch fail */ |
393 | } __attribute__ ((packed)); | 393 | } __attribute__ ((packed)); |
394 | 394 | ||
395 | enum { | 395 | enum { |
@@ -466,16 +466,16 @@ struct acx_smart_reflex_config_params { | |||
466 | struct acx_bt_wlan_coex_param { | 466 | struct acx_bt_wlan_coex_param { |
467 | struct acx_header header; | 467 | struct acx_header header; |
468 | 468 | ||
469 | u32 per_threshold; | 469 | __le32 per_threshold; |
470 | u32 max_scan_compensation_time; | 470 | __le32 max_scan_compensation_time; |
471 | u16 nfs_sample_interval; | 471 | __le16 nfs_sample_interval; |
472 | u8 load_ratio; | 472 | u8 load_ratio; |
473 | u8 auto_ps_mode; | 473 | u8 auto_ps_mode; |
474 | u8 probe_req_compensation; | 474 | u8 probe_req_compensation; |
475 | u8 scan_window_compensation; | 475 | u8 scan_window_compensation; |
476 | u8 antenna_config; | 476 | u8 antenna_config; |
477 | u8 beacon_miss_threshold; | 477 | u8 beacon_miss_threshold; |
478 | u32 rate_adaptation_threshold; | 478 | __le32 rate_adaptation_threshold; |
479 | s8 rate_adaptation_snr; | 479 | s8 rate_adaptation_snr; |
480 | u8 padding[3]; | 480 | u8 padding[3]; |
481 | } __attribute__ ((packed)); | 481 | } __attribute__ ((packed)); |
@@ -484,7 +484,7 @@ struct acx_energy_detection { | |||
484 | struct acx_header header; | 484 | struct acx_header header; |
485 | 485 | ||
486 | /* The RX Clear Channel Assessment threshold in the PHY */ | 486 | /* The RX Clear Channel Assessment threshold in the PHY */ |
487 | u16 rx_cca_threshold; | 487 | __le16 rx_cca_threshold; |
488 | u8 tx_energy_detection; | 488 | u8 tx_energy_detection; |
489 | u8 pad; | 489 | u8 pad; |
490 | } __attribute__ ((packed)); | 490 | } __attribute__ ((packed)); |
@@ -492,8 +492,8 @@ struct acx_energy_detection { | |||
492 | struct acx_beacon_broadcast { | 492 | struct acx_beacon_broadcast { |
493 | struct acx_header header; | 493 | struct acx_header header; |
494 | 494 | ||
495 | u16 beacon_rx_timeout; | 495 | __le16 beacon_rx_timeout; |
496 | u16 broadcast_timeout; | 496 | __le16 broadcast_timeout; |
497 | 497 | ||
498 | /* Enables receiving of broadcast packets in PS mode */ | 498 | /* Enables receiving of broadcast packets in PS mode */ |
499 | u8 rx_broadcast_in_ps; | 499 | u8 rx_broadcast_in_ps; |
@@ -506,8 +506,8 @@ struct acx_beacon_broadcast { | |||
506 | struct acx_event_mask { | 506 | struct acx_event_mask { |
507 | struct acx_header header; | 507 | struct acx_header header; |
508 | 508 | ||
509 | u32 event_mask; | 509 | __le32 event_mask; |
510 | u32 high_event_mask; /* Unused */ | 510 | __le32 high_event_mask; /* Unused */ |
511 | } __attribute__ ((packed)); | 511 | } __attribute__ ((packed)); |
512 | 512 | ||
513 | #define CFG_RX_FCS BIT(2) | 513 | #define CFG_RX_FCS BIT(2) |
@@ -551,8 +551,8 @@ struct acx_event_mask { | |||
551 | struct acx_feature_config { | 551 | struct acx_feature_config { |
552 | struct acx_header header; | 552 | struct acx_header header; |
553 | 553 | ||
554 | u32 options; | 554 | __le32 options; |
555 | u32 data_flow_options; | 555 | __le32 data_flow_options; |
556 | } __attribute__ ((packed)); | 556 | } __attribute__ ((packed)); |
557 | 557 | ||
558 | struct acx_current_tx_power { | 558 | struct acx_current_tx_power { |
@@ -576,7 +576,7 @@ struct acx_aid { | |||
576 | /* | 576 | /* |
577 | * To be set when associated with an AP. | 577 | * To be set when associated with an AP. |
578 | */ | 578 | */ |
579 | u16 aid; | 579 | __le16 aid; |
580 | u8 pad[2]; | 580 | u8 pad[2]; |
581 | } __attribute__ ((packed)); | 581 | } __attribute__ ((packed)); |
582 | 582 | ||
@@ -608,152 +608,152 @@ struct acx_ctsprotect { | |||
608 | } __attribute__ ((packed)); | 608 | } __attribute__ ((packed)); |
609 | 609 | ||
610 | struct acx_tx_statistics { | 610 | struct acx_tx_statistics { |
611 | u32 internal_desc_overflow; | 611 | __le32 internal_desc_overflow; |
612 | } __attribute__ ((packed)); | 612 | } __attribute__ ((packed)); |
613 | 613 | ||
614 | struct acx_rx_statistics { | 614 | struct acx_rx_statistics { |
615 | u32 out_of_mem; | 615 | __le32 out_of_mem; |
616 | u32 hdr_overflow; | 616 | __le32 hdr_overflow; |
617 | u32 hw_stuck; | 617 | __le32 hw_stuck; |
618 | u32 dropped; | 618 | __le32 dropped; |
619 | u32 fcs_err; | 619 | __le32 fcs_err; |
620 | u32 xfr_hint_trig; | 620 | __le32 xfr_hint_trig; |
621 | u32 path_reset; | 621 | __le32 path_reset; |
622 | u32 reset_counter; | 622 | __le32 reset_counter; |
623 | } __attribute__ ((packed)); | 623 | } __attribute__ ((packed)); |
624 | 624 | ||
625 | struct acx_dma_statistics { | 625 | struct acx_dma_statistics { |
626 | u32 rx_requested; | 626 | __le32 rx_requested; |
627 | u32 rx_errors; | 627 | __le32 rx_errors; |
628 | u32 tx_requested; | 628 | __le32 tx_requested; |
629 | u32 tx_errors; | 629 | __le32 tx_errors; |
630 | } __attribute__ ((packed)); | 630 | } __attribute__ ((packed)); |
631 | 631 | ||
632 | struct acx_isr_statistics { | 632 | struct acx_isr_statistics { |
633 | /* host command complete */ | 633 | /* host command complete */ |
634 | u32 cmd_cmplt; | 634 | __le32 cmd_cmplt; |
635 | 635 | ||
636 | /* fiqisr() */ | 636 | /* fiqisr() */ |
637 | u32 fiqs; | 637 | __le32 fiqs; |
638 | 638 | ||
639 | /* (INT_STS_ND & INT_TRIG_RX_HEADER) */ | 639 | /* (INT_STS_ND & INT_TRIG_RX_HEADER) */ |
640 | u32 rx_headers; | 640 | __le32 rx_headers; |
641 | 641 | ||
642 | /* (INT_STS_ND & INT_TRIG_RX_CMPLT) */ | 642 | /* (INT_STS_ND & INT_TRIG_RX_CMPLT) */ |
643 | u32 rx_completes; | 643 | __le32 rx_completes; |
644 | 644 | ||
645 | /* (INT_STS_ND & INT_TRIG_NO_RX_BUF) */ | 645 | /* (INT_STS_ND & INT_TRIG_NO_RX_BUF) */ |
646 | u32 rx_mem_overflow; | 646 | __le32 rx_mem_overflow; |
647 | 647 | ||
648 | /* (INT_STS_ND & INT_TRIG_S_RX_RDY) */ | 648 | /* (INT_STS_ND & INT_TRIG_S_RX_RDY) */ |
649 | u32 rx_rdys; | 649 | __le32 rx_rdys; |
650 | 650 | ||
651 | /* irqisr() */ | 651 | /* irqisr() */ |
652 | u32 irqs; | 652 | __le32 irqs; |
653 | 653 | ||
654 | /* (INT_STS_ND & INT_TRIG_TX_PROC) */ | 654 | /* (INT_STS_ND & INT_TRIG_TX_PROC) */ |
655 | u32 tx_procs; | 655 | __le32 tx_procs; |
656 | 656 | ||
657 | /* (INT_STS_ND & INT_TRIG_DECRYPT_DONE) */ | 657 | /* (INT_STS_ND & INT_TRIG_DECRYPT_DONE) */ |
658 | u32 decrypt_done; | 658 | __le32 decrypt_done; |
659 | 659 | ||
660 | /* (INT_STS_ND & INT_TRIG_DMA0) */ | 660 | /* (INT_STS_ND & INT_TRIG_DMA0) */ |
661 | u32 dma0_done; | 661 | __le32 dma0_done; |
662 | 662 | ||
663 | /* (INT_STS_ND & INT_TRIG_DMA1) */ | 663 | /* (INT_STS_ND & INT_TRIG_DMA1) */ |
664 | u32 dma1_done; | 664 | __le32 dma1_done; |
665 | 665 | ||
666 | /* (INT_STS_ND & INT_TRIG_TX_EXC_CMPLT) */ | 666 | /* (INT_STS_ND & INT_TRIG_TX_EXC_CMPLT) */ |
667 | u32 tx_exch_complete; | 667 | __le32 tx_exch_complete; |
668 | 668 | ||
669 | /* (INT_STS_ND & INT_TRIG_COMMAND) */ | 669 | /* (INT_STS_ND & INT_TRIG_COMMAND) */ |
670 | u32 commands; | 670 | __le32 commands; |
671 | 671 | ||
672 | /* (INT_STS_ND & INT_TRIG_RX_PROC) */ | 672 | /* (INT_STS_ND & INT_TRIG_RX_PROC) */ |
673 | u32 rx_procs; | 673 | __le32 rx_procs; |
674 | 674 | ||
675 | /* (INT_STS_ND & INT_TRIG_PM_802) */ | 675 | /* (INT_STS_ND & INT_TRIG_PM_802) */ |
676 | u32 hw_pm_mode_changes; | 676 | __le32 hw_pm_mode_changes; |
677 | 677 | ||
678 | /* (INT_STS_ND & INT_TRIG_ACKNOWLEDGE) */ | 678 | /* (INT_STS_ND & INT_TRIG_ACKNOWLEDGE) */ |
679 | u32 host_acknowledges; | 679 | __le32 host_acknowledges; |
680 | 680 | ||
681 | /* (INT_STS_ND & INT_TRIG_PM_PCI) */ | 681 | /* (INT_STS_ND & INT_TRIG_PM_PCI) */ |
682 | u32 pci_pm; | 682 | __le32 pci_pm; |
683 | 683 | ||
684 | /* (INT_STS_ND & INT_TRIG_ACM_WAKEUP) */ | 684 | /* (INT_STS_ND & INT_TRIG_ACM_WAKEUP) */ |
685 | u32 wakeups; | 685 | __le32 wakeups; |
686 | 686 | ||
687 | /* (INT_STS_ND & INT_TRIG_LOW_RSSI) */ | 687 | /* (INT_STS_ND & INT_TRIG_LOW_RSSI) */ |
688 | u32 low_rssi; | 688 | __le32 low_rssi; |
689 | } __attribute__ ((packed)); | 689 | } __attribute__ ((packed)); |
690 | 690 | ||
691 | struct acx_wep_statistics { | 691 | struct acx_wep_statistics { |
692 | /* WEP address keys configured */ | 692 | /* WEP address keys configured */ |
693 | u32 addr_key_count; | 693 | __le32 addr_key_count; |
694 | 694 | ||
695 | /* default keys configured */ | 695 | /* default keys configured */ |
696 | u32 default_key_count; | 696 | __le32 default_key_count; |
697 | 697 | ||
698 | u32 reserved; | 698 | __le32 reserved; |
699 | 699 | ||
700 | /* number of times that WEP key not found on lookup */ | 700 | /* number of times that WEP key not found on lookup */ |
701 | u32 key_not_found; | 701 | __le32 key_not_found; |
702 | 702 | ||
703 | /* number of times that WEP key decryption failed */ | 703 | /* number of times that WEP key decryption failed */ |
704 | u32 decrypt_fail; | 704 | __le32 decrypt_fail; |
705 | 705 | ||
706 | /* WEP packets decrypted */ | 706 | /* WEP packets decrypted */ |
707 | u32 packets; | 707 | __le32 packets; |
708 | 708 | ||
709 | /* WEP decrypt interrupts */ | 709 | /* WEP decrypt interrupts */ |
710 | u32 interrupt; | 710 | __le32 interrupt; |
711 | } __attribute__ ((packed)); | 711 | } __attribute__ ((packed)); |
712 | 712 | ||
713 | #define ACX_MISSED_BEACONS_SPREAD 10 | 713 | #define ACX_MISSED_BEACONS_SPREAD 10 |
714 | 714 | ||
715 | struct acx_pwr_statistics { | 715 | struct acx_pwr_statistics { |
716 | /* the amount of enters into power save mode (both PD & ELP) */ | 716 | /* the amount of enters into power save mode (both PD & ELP) */ |
717 | u32 ps_enter; | 717 | __le32 ps_enter; |
718 | 718 | ||
719 | /* the amount of enters into ELP mode */ | 719 | /* the amount of enters into ELP mode */ |
720 | u32 elp_enter; | 720 | __le32 elp_enter; |
721 | 721 | ||
722 | /* the amount of missing beacon interrupts to the host */ | 722 | /* the amount of missing beacon interrupts to the host */ |
723 | u32 missing_bcns; | 723 | __le32 missing_bcns; |
724 | 724 | ||
725 | /* the amount of wake on host-access times */ | 725 | /* the amount of wake on host-access times */ |
726 | u32 wake_on_host; | 726 | __le32 wake_on_host; |
727 | 727 | ||
728 | /* the amount of wake on timer-expire */ | 728 | /* the amount of wake on timer-expire */ |
729 | u32 wake_on_timer_exp; | 729 | __le32 wake_on_timer_exp; |
730 | 730 | ||
731 | /* the number of packets that were transmitted with PS bit set */ | 731 | /* the number of packets that were transmitted with PS bit set */ |
732 | u32 tx_with_ps; | 732 | __le32 tx_with_ps; |
733 | 733 | ||
734 | /* the number of packets that were transmitted with PS bit clear */ | 734 | /* the number of packets that were transmitted with PS bit clear */ |
735 | u32 tx_without_ps; | 735 | __le32 tx_without_ps; |
736 | 736 | ||
737 | /* the number of received beacons */ | 737 | /* the number of received beacons */ |
738 | u32 rcvd_beacons; | 738 | __le32 rcvd_beacons; |
739 | 739 | ||
740 | /* the number of entering into PowerOn (power save off) */ | 740 | /* the number of entering into PowerOn (power save off) */ |
741 | u32 power_save_off; | 741 | __le32 power_save_off; |
742 | 742 | ||
743 | /* the number of entries into power save mode */ | 743 | /* the number of entries into power save mode */ |
744 | u16 enable_ps; | 744 | __le16 enable_ps; |
745 | 745 | ||
746 | /* | 746 | /* |
747 | * the number of exits from power save, not including failed PS | 747 | * the number of exits from power save, not including failed PS |
748 | * transitions | 748 | * transitions |
749 | */ | 749 | */ |
750 | u16 disable_ps; | 750 | __le16 disable_ps; |
751 | 751 | ||
752 | /* | 752 | /* |
753 | * the number of times the TSF counter was adjusted because | 753 | * the number of times the TSF counter was adjusted because |
754 | * of drift | 754 | * of drift |
755 | */ | 755 | */ |
756 | u32 fix_tsf_ps; | 756 | __le32 fix_tsf_ps; |
757 | 757 | ||
758 | /* Gives statistics about the spread continuous missed beacons. | 758 | /* Gives statistics about the spread continuous missed beacons. |
759 | * The 16 LSB are dedicated for the PS mode. | 759 | * The 16 LSB are dedicated for the PS mode. |
@@ -764,53 +764,53 @@ struct acx_pwr_statistics { | |||
764 | * ... | 764 | * ... |
765 | * cont_miss_bcns_spread[9] - ten and more continuous missed beacons. | 765 | * cont_miss_bcns_spread[9] - ten and more continuous missed beacons. |
766 | */ | 766 | */ |
767 | u32 cont_miss_bcns_spread[ACX_MISSED_BEACONS_SPREAD]; | 767 | __le32 cont_miss_bcns_spread[ACX_MISSED_BEACONS_SPREAD]; |
768 | 768 | ||
769 | /* the number of beacons in awake mode */ | 769 | /* the number of beacons in awake mode */ |
770 | u32 rcvd_awake_beacons; | 770 | __le32 rcvd_awake_beacons; |
771 | } __attribute__ ((packed)); | 771 | } __attribute__ ((packed)); |
772 | 772 | ||
773 | struct acx_mic_statistics { | 773 | struct acx_mic_statistics { |
774 | u32 rx_pkts; | 774 | __le32 rx_pkts; |
775 | u32 calc_failure; | 775 | __le32 calc_failure; |
776 | } __attribute__ ((packed)); | 776 | } __attribute__ ((packed)); |
777 | 777 | ||
778 | struct acx_aes_statistics { | 778 | struct acx_aes_statistics { |
779 | u32 encrypt_fail; | 779 | __le32 encrypt_fail; |
780 | u32 decrypt_fail; | 780 | __le32 decrypt_fail; |
781 | u32 encrypt_packets; | 781 | __le32 encrypt_packets; |
782 | u32 decrypt_packets; | 782 | __le32 decrypt_packets; |
783 | u32 encrypt_interrupt; | 783 | __le32 encrypt_interrupt; |
784 | u32 decrypt_interrupt; | 784 | __le32 decrypt_interrupt; |
785 | } __attribute__ ((packed)); | 785 | } __attribute__ ((packed)); |
786 | 786 | ||
787 | struct acx_event_statistics { | 787 | struct acx_event_statistics { |
788 | u32 heart_beat; | 788 | __le32 heart_beat; |
789 | u32 calibration; | 789 | __le32 calibration; |
790 | u32 rx_mismatch; | 790 | __le32 rx_mismatch; |
791 | u32 rx_mem_empty; | 791 | __le32 rx_mem_empty; |
792 | u32 rx_pool; | 792 | __le32 rx_pool; |
793 | u32 oom_late; | 793 | __le32 oom_late; |
794 | u32 phy_transmit_error; | 794 | __le32 phy_transmit_error; |
795 | u32 tx_stuck; | 795 | __le32 tx_stuck; |
796 | } __attribute__ ((packed)); | 796 | } __attribute__ ((packed)); |
797 | 797 | ||
798 | struct acx_ps_statistics { | 798 | struct acx_ps_statistics { |
799 | u32 pspoll_timeouts; | 799 | __le32 pspoll_timeouts; |
800 | u32 upsd_timeouts; | 800 | __le32 upsd_timeouts; |
801 | u32 upsd_max_sptime; | 801 | __le32 upsd_max_sptime; |
802 | u32 upsd_max_apturn; | 802 | __le32 upsd_max_apturn; |
803 | u32 pspoll_max_apturn; | 803 | __le32 pspoll_max_apturn; |
804 | u32 pspoll_utilization; | 804 | __le32 pspoll_utilization; |
805 | u32 upsd_utilization; | 805 | __le32 upsd_utilization; |
806 | } __attribute__ ((packed)); | 806 | } __attribute__ ((packed)); |
807 | 807 | ||
808 | struct acx_rxpipe_statistics { | 808 | struct acx_rxpipe_statistics { |
809 | u32 rx_prep_beacon_drop; | 809 | __le32 rx_prep_beacon_drop; |
810 | u32 descr_host_int_trig_rx_data; | 810 | __le32 descr_host_int_trig_rx_data; |
811 | u32 beacon_buffer_thres_host_int_trig_rx_data; | 811 | __le32 beacon_buffer_thres_host_int_trig_rx_data; |
812 | u32 missed_beacon_host_int_trig_rx_data; | 812 | __le32 missed_beacon_host_int_trig_rx_data; |
813 | u32 tx_xfr_host_int_trig_rx_data; | 813 | __le32 tx_xfr_host_int_trig_rx_data; |
814 | } __attribute__ ((packed)); | 814 | } __attribute__ ((packed)); |
815 | 815 | ||
816 | struct acx_statistics { | 816 | struct acx_statistics { |
@@ -830,7 +830,7 @@ struct acx_statistics { | |||
830 | } __attribute__ ((packed)); | 830 | } __attribute__ ((packed)); |
831 | 831 | ||
832 | struct acx_rate_class { | 832 | struct acx_rate_class { |
833 | u32 enabled_rates; | 833 | __le32 enabled_rates; |
834 | u8 short_retry_limit; | 834 | u8 short_retry_limit; |
835 | u8 long_retry_limit; | 835 | u8 long_retry_limit; |
836 | u8 aflags; | 836 | u8 aflags; |
@@ -840,7 +840,7 @@ struct acx_rate_class { | |||
840 | struct acx_rate_policy { | 840 | struct acx_rate_policy { |
841 | struct acx_header header; | 841 | struct acx_header header; |
842 | 842 | ||
843 | u32 rate_class_cnt; | 843 | __le32 rate_class_cnt; |
844 | struct acx_rate_class rate_class[CONF_TX_MAX_RATE_CLASSES]; | 844 | struct acx_rate_class rate_class[CONF_TX_MAX_RATE_CLASSES]; |
845 | } __attribute__ ((packed)); | 845 | } __attribute__ ((packed)); |
846 | 846 | ||
@@ -848,10 +848,10 @@ struct acx_ac_cfg { | |||
848 | struct acx_header header; | 848 | struct acx_header header; |
849 | u8 ac; | 849 | u8 ac; |
850 | u8 cw_min; | 850 | u8 cw_min; |
851 | u16 cw_max; | 851 | __le16 cw_max; |
852 | u8 aifsn; | 852 | u8 aifsn; |
853 | u8 reserved; | 853 | u8 reserved; |
854 | u16 tx_op_limit; | 854 | __le16 tx_op_limit; |
855 | } __attribute__ ((packed)); | 855 | } __attribute__ ((packed)); |
856 | 856 | ||
857 | struct acx_tid_config { | 857 | struct acx_tid_config { |
@@ -862,19 +862,19 @@ struct acx_tid_config { | |||
862 | u8 ps_scheme; | 862 | u8 ps_scheme; |
863 | u8 ack_policy; | 863 | u8 ack_policy; |
864 | u8 padding[3]; | 864 | u8 padding[3]; |
865 | u32 apsd_conf[2]; | 865 | __le32 apsd_conf[2]; |
866 | } __attribute__ ((packed)); | 866 | } __attribute__ ((packed)); |
867 | 867 | ||
868 | struct acx_frag_threshold { | 868 | struct acx_frag_threshold { |
869 | struct acx_header header; | 869 | struct acx_header header; |
870 | u16 frag_threshold; | 870 | __le16 frag_threshold; |
871 | u8 padding[2]; | 871 | u8 padding[2]; |
872 | } __attribute__ ((packed)); | 872 | } __attribute__ ((packed)); |
873 | 873 | ||
874 | struct acx_tx_config_options { | 874 | struct acx_tx_config_options { |
875 | struct acx_header header; | 875 | struct acx_header header; |
876 | u16 tx_compl_timeout; /* msec */ | 876 | __le16 tx_compl_timeout; /* msec */ |
877 | u16 tx_compl_threshold; /* number of packets */ | 877 | __le16 tx_compl_threshold; /* number of packets */ |
878 | } __attribute__ ((packed)); | 878 | } __attribute__ ((packed)); |
879 | 879 | ||
880 | #define ACX_RX_MEM_BLOCKS 64 | 880 | #define ACX_RX_MEM_BLOCKS 64 |
@@ -889,59 +889,59 @@ struct wl1271_acx_config_memory { | |||
889 | u8 tx_min_mem_block_num; | 889 | u8 tx_min_mem_block_num; |
890 | u8 num_stations; | 890 | u8 num_stations; |
891 | u8 num_ssid_profiles; | 891 | u8 num_ssid_profiles; |
892 | u32 total_tx_descriptors; | 892 | __le32 total_tx_descriptors; |
893 | } __attribute__ ((packed)); | 893 | } __attribute__ ((packed)); |
894 | 894 | ||
895 | struct wl1271_acx_mem_map { | 895 | struct wl1271_acx_mem_map { |
896 | struct acx_header header; | 896 | struct acx_header header; |
897 | 897 | ||
898 | void *code_start; | 898 | __le32 code_start; |
899 | void *code_end; | 899 | __le32 code_end; |
900 | 900 | ||
901 | void *wep_defkey_start; | 901 | __le32 wep_defkey_start; |
902 | void *wep_defkey_end; | 902 | __le32 wep_defkey_end; |
903 | 903 | ||
904 | void *sta_table_start; | 904 | __le32 sta_table_start; |
905 | void *sta_table_end; | 905 | __le32 sta_table_end; |
906 | 906 | ||
907 | void *packet_template_start; | 907 | __le32 packet_template_start; |
908 | void *packet_template_end; | 908 | __le32 packet_template_end; |
909 | 909 | ||
910 | /* Address of the TX result interface (control block) */ | 910 | /* Address of the TX result interface (control block) */ |
911 | u32 tx_result; | 911 | __le32 tx_result; |
912 | u32 tx_result_queue_start; | 912 | __le32 tx_result_queue_start; |
913 | 913 | ||
914 | void *queue_memory_start; | 914 | __le32 queue_memory_start; |
915 | void *queue_memory_end; | 915 | __le32 queue_memory_end; |
916 | 916 | ||
917 | u32 packet_memory_pool_start; | 917 | __le32 packet_memory_pool_start; |
918 | u32 packet_memory_pool_end; | 918 | __le32 packet_memory_pool_end; |
919 | 919 | ||
920 | void *debug_buffer1_start; | 920 | __le32 debug_buffer1_start; |
921 | void *debug_buffer1_end; | 921 | __le32 debug_buffer1_end; |
922 | 922 | ||
923 | void *debug_buffer2_start; | 923 | __le32 debug_buffer2_start; |
924 | void *debug_buffer2_end; | 924 | __le32 debug_buffer2_end; |
925 | 925 | ||
926 | /* Number of blocks FW allocated for TX packets */ | 926 | /* Number of blocks FW allocated for TX packets */ |
927 | u32 num_tx_mem_blocks; | 927 | __le32 num_tx_mem_blocks; |
928 | 928 | ||
929 | /* Number of blocks FW allocated for RX packets */ | 929 | /* Number of blocks FW allocated for RX packets */ |
930 | u32 num_rx_mem_blocks; | 930 | __le32 num_rx_mem_blocks; |
931 | 931 | ||
932 | /* the following 4 fields are valid in SLAVE mode only */ | 932 | /* the following 4 fields are valid in SLAVE mode only */ |
933 | u8 *tx_cbuf; | 933 | u8 *tx_cbuf; |
934 | u8 *rx_cbuf; | 934 | u8 *rx_cbuf; |
935 | void *rx_ctrl; | 935 | __le32 rx_ctrl; |
936 | void *tx_ctrl; | 936 | __le32 tx_ctrl; |
937 | } __attribute__ ((packed)); | 937 | } __attribute__ ((packed)); |
938 | 938 | ||
939 | struct wl1271_acx_rx_config_opt { | 939 | struct wl1271_acx_rx_config_opt { |
940 | struct acx_header header; | 940 | struct acx_header header; |
941 | 941 | ||
942 | u16 mblk_threshold; | 942 | __le16 mblk_threshold; |
943 | u16 threshold; | 943 | __le16 threshold; |
944 | u16 timeout; | 944 | __le16 timeout; |
945 | u8 queue_type; | 945 | u8 queue_type; |
946 | u8 reserved; | 946 | u8 reserved; |
947 | } __attribute__ ((packed)); | 947 | } __attribute__ ((packed)); |
diff --git a/drivers/net/wireless/wl12xx/wl1271_boot.c b/drivers/net/wireless/wl12xx/wl1271_boot.c index 41a3050afae1..ba4a2b4f0f56 100644 --- a/drivers/net/wireless/wl12xx/wl1271_boot.c +++ b/drivers/net/wireless/wl12xx/wl1271_boot.c | |||
@@ -188,15 +188,15 @@ static int wl1271_boot_upload_firmware(struct wl1271 *wl) | |||
188 | u8 *fw; | 188 | u8 *fw; |
189 | 189 | ||
190 | fw = wl->fw; | 190 | fw = wl->fw; |
191 | chunks = be32_to_cpup((u32 *) fw); | 191 | chunks = be32_to_cpup((__be32 *) fw); |
192 | fw += sizeof(u32); | 192 | fw += sizeof(u32); |
193 | 193 | ||
194 | wl1271_debug(DEBUG_BOOT, "firmware chunks to be uploaded: %u", chunks); | 194 | wl1271_debug(DEBUG_BOOT, "firmware chunks to be uploaded: %u", chunks); |
195 | 195 | ||
196 | while (chunks--) { | 196 | while (chunks--) { |
197 | addr = be32_to_cpup((u32 *) fw); | 197 | addr = be32_to_cpup((__be32 *) fw); |
198 | fw += sizeof(u32); | 198 | fw += sizeof(u32); |
199 | len = be32_to_cpup((u32 *) fw); | 199 | len = be32_to_cpup((__be32 *) fw); |
200 | fw += sizeof(u32); | 200 | fw += sizeof(u32); |
201 | 201 | ||
202 | if (len > 300000) { | 202 | if (len > 300000) { |
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c index 195eee70e36e..0666328ce9ab 100644 --- a/drivers/net/wireless/wl12xx/wl1271_cmd.c +++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c | |||
@@ -50,7 +50,7 @@ int wl1271_cmd_send(struct wl1271 *wl, u16 id, void *buf, size_t len) | |||
50 | int ret = 0; | 50 | int ret = 0; |
51 | 51 | ||
52 | cmd = buf; | 52 | cmd = buf; |
53 | cmd->id = id; | 53 | cmd->id = cpu_to_le16(id); |
54 | cmd->status = 0; | 54 | cmd->status = 0; |
55 | 55 | ||
56 | WARN_ON(len % 4 != 0); | 56 | WARN_ON(len % 4 != 0); |
@@ -217,8 +217,8 @@ int wl1271_cmd_join(struct wl1271 *wl) | |||
217 | for (i = 0; i < ETH_ALEN; i++) | 217 | for (i = 0; i < ETH_ALEN; i++) |
218 | bssid[i] = wl->bssid[ETH_ALEN - i - 1]; | 218 | bssid[i] = wl->bssid[ETH_ALEN - i - 1]; |
219 | 219 | ||
220 | join->rx_config_options = wl->rx_config; | 220 | join->rx_config_options = cpu_to_le32(wl->rx_config); |
221 | join->rx_filter_options = wl->rx_filter; | 221 | join->rx_filter_options = cpu_to_le32(wl->rx_filter); |
222 | join->bss_type = wl->bss_type; | 222 | join->bss_type = wl->bss_type; |
223 | 223 | ||
224 | /* | 224 | /* |
@@ -227,21 +227,22 @@ int wl1271_cmd_join(struct wl1271 *wl) | |||
227 | * association. The filter logic needs to be implemented properly | 227 | * association. The filter logic needs to be implemented properly |
228 | * and once that is done, this hack can be removed. | 228 | * and once that is done, this hack can be removed. |
229 | */ | 229 | */ |
230 | join->rx_config_options = 0; | 230 | join->rx_config_options = cpu_to_le32(0); |
231 | join->rx_filter_options = WL1271_DEFAULT_RX_FILTER; | 231 | join->rx_filter_options = cpu_to_le32(WL1271_DEFAULT_RX_FILTER); |
232 | 232 | ||
233 | if (wl->band == IEEE80211_BAND_2GHZ) | 233 | if (wl->band == IEEE80211_BAND_2GHZ) |
234 | join->basic_rate_set = | 234 | join->basic_rate_set = cpu_to_le32(CONF_HW_BIT_RATE_1MBPS | |
235 | CONF_HW_BIT_RATE_1MBPS | CONF_HW_BIT_RATE_2MBPS | | 235 | CONF_HW_BIT_RATE_2MBPS | |
236 | CONF_HW_BIT_RATE_5_5MBPS | CONF_HW_BIT_RATE_11MBPS; | 236 | CONF_HW_BIT_RATE_5_5MBPS | |
237 | CONF_HW_BIT_RATE_11MBPS); | ||
237 | else { | 238 | else { |
238 | join->bss_type |= WL1271_JOIN_CMD_BSS_TYPE_5GHZ; | 239 | join->bss_type |= WL1271_JOIN_CMD_BSS_TYPE_5GHZ; |
239 | join->basic_rate_set = | 240 | join->basic_rate_set = cpu_to_le32(CONF_HW_BIT_RATE_6MBPS | |
240 | CONF_HW_BIT_RATE_6MBPS | CONF_HW_BIT_RATE_12MBPS | | 241 | CONF_HW_BIT_RATE_12MBPS | |
241 | CONF_HW_BIT_RATE_24MBPS; | 242 | CONF_HW_BIT_RATE_24MBPS); |
242 | } | 243 | } |
243 | 244 | ||
244 | join->beacon_interval = WL1271_DEFAULT_BEACON_INT; | 245 | join->beacon_interval = cpu_to_le16(WL1271_DEFAULT_BEACON_INT); |
245 | join->dtim_interval = WL1271_DEFAULT_DTIM_PERIOD; | 246 | join->dtim_interval = WL1271_DEFAULT_DTIM_PERIOD; |
246 | 247 | ||
247 | join->channel = wl->channel; | 248 | join->channel = wl->channel; |
@@ -305,6 +306,7 @@ int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer) | |||
305 | 306 | ||
306 | if (answer) { | 307 | if (answer) { |
307 | struct wl1271_command *cmd_answer; | 308 | struct wl1271_command *cmd_answer; |
309 | u16 status; | ||
308 | 310 | ||
309 | /* | 311 | /* |
310 | * The test command got in, we can read the answer. | 312 | * The test command got in, we can read the answer. |
@@ -314,10 +316,10 @@ int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer) | |||
314 | wl1271_spi_read(wl, wl->cmd_box_addr, buf, buf_len, false); | 316 | wl1271_spi_read(wl, wl->cmd_box_addr, buf, buf_len, false); |
315 | 317 | ||
316 | cmd_answer = buf; | 318 | cmd_answer = buf; |
319 | status = le16_to_cpu(cmd_answer->header.status); | ||
317 | 320 | ||
318 | if (cmd_answer->header.status != CMD_STATUS_SUCCESS) | 321 | if (status != CMD_STATUS_SUCCESS) |
319 | wl1271_error("TEST command answer error: %d", | 322 | wl1271_error("TEST command answer error: %d", status); |
320 | cmd_answer->header.status); | ||
321 | } | 323 | } |
322 | 324 | ||
323 | return 0; | 325 | return 0; |
@@ -338,10 +340,10 @@ int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len) | |||
338 | 340 | ||
339 | wl1271_debug(DEBUG_CMD, "cmd interrogate"); | 341 | wl1271_debug(DEBUG_CMD, "cmd interrogate"); |
340 | 342 | ||
341 | acx->id = id; | 343 | acx->id = cpu_to_le16(id); |
342 | 344 | ||
343 | /* payload length, does not include any headers */ | 345 | /* payload length, does not include any headers */ |
344 | acx->len = len - sizeof(*acx); | 346 | acx->len = cpu_to_le16(len - sizeof(*acx)); |
345 | 347 | ||
346 | ret = wl1271_cmd_send(wl, CMD_INTERROGATE, acx, sizeof(*acx)); | 348 | ret = wl1271_cmd_send(wl, CMD_INTERROGATE, acx, sizeof(*acx)); |
347 | if (ret < 0) { | 349 | if (ret < 0) { |
@@ -353,9 +355,9 @@ int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len) | |||
353 | wl1271_spi_read(wl, wl->cmd_box_addr, buf, len, false); | 355 | wl1271_spi_read(wl, wl->cmd_box_addr, buf, len, false); |
354 | 356 | ||
355 | acx = buf; | 357 | acx = buf; |
356 | if (acx->cmd.status != CMD_STATUS_SUCCESS) | 358 | if (le16_to_cpu(acx->cmd.status) != CMD_STATUS_SUCCESS) |
357 | wl1271_error("INTERROGATE command error: %d", | 359 | wl1271_error("INTERROGATE command error: %d", |
358 | acx->cmd.status); | 360 | le16_to_cpu(acx->cmd.status)); |
359 | 361 | ||
360 | out: | 362 | out: |
361 | return ret; | 363 | return ret; |
@@ -376,10 +378,10 @@ int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len) | |||
376 | 378 | ||
377 | wl1271_debug(DEBUG_CMD, "cmd configure"); | 379 | wl1271_debug(DEBUG_CMD, "cmd configure"); |
378 | 380 | ||
379 | acx->id = id; | 381 | acx->id = cpu_to_le16(id); |
380 | 382 | ||
381 | /* payload length, does not include any headers */ | 383 | /* payload length, does not include any headers */ |
382 | acx->len = len - sizeof(*acx); | 384 | acx->len = cpu_to_le16(len - sizeof(*acx)); |
383 | 385 | ||
384 | ret = wl1271_cmd_send(wl, CMD_CONFIGURE, acx, len); | 386 | ret = wl1271_cmd_send(wl, CMD_CONFIGURE, acx, len); |
385 | if (ret < 0) { | 387 | if (ret < 0) { |
@@ -463,7 +465,7 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode) | |||
463 | ps_params->send_null_data = 1; | 465 | ps_params->send_null_data = 1; |
464 | ps_params->retries = 5; | 466 | ps_params->retries = 5; |
465 | ps_params->hang_over_period = 128; | 467 | ps_params->hang_over_period = 128; |
466 | ps_params->null_data_rate = 1; /* 1 Mbps */ | 468 | ps_params->null_data_rate = cpu_to_le32(1); /* 1 Mbps */ |
467 | 469 | ||
468 | ret = wl1271_cmd_send(wl, CMD_SET_PS_MODE, ps_params, | 470 | ret = wl1271_cmd_send(wl, CMD_SET_PS_MODE, ps_params, |
469 | sizeof(*ps_params)); | 471 | sizeof(*ps_params)); |
@@ -494,8 +496,8 @@ int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer, | |||
494 | WARN_ON(len > MAX_READ_SIZE); | 496 | WARN_ON(len > MAX_READ_SIZE); |
495 | len = min_t(size_t, len, MAX_READ_SIZE); | 497 | len = min_t(size_t, len, MAX_READ_SIZE); |
496 | 498 | ||
497 | cmd->addr = addr; | 499 | cmd->addr = cpu_to_le32(addr); |
498 | cmd->size = len; | 500 | cmd->size = cpu_to_le32(len); |
499 | 501 | ||
500 | ret = wl1271_cmd_send(wl, CMD_READ_MEMORY, cmd, sizeof(*cmd)); | 502 | ret = wl1271_cmd_send(wl, CMD_READ_MEMORY, cmd, sizeof(*cmd)); |
501 | if (ret < 0) { | 503 | if (ret < 0) { |
@@ -506,9 +508,9 @@ int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer, | |||
506 | /* the read command got in, we can now read the answer */ | 508 | /* the read command got in, we can now read the answer */ |
507 | wl1271_spi_read(wl, wl->cmd_box_addr, cmd, sizeof(*cmd), false); | 509 | wl1271_spi_read(wl, wl->cmd_box_addr, cmd, sizeof(*cmd), false); |
508 | 510 | ||
509 | if (cmd->header.status != CMD_STATUS_SUCCESS) | 511 | if (le16_to_cpu(cmd->header.status) != CMD_STATUS_SUCCESS) |
510 | wl1271_error("error in read command result: %d", | 512 | wl1271_error("error in read command result: %d", |
511 | cmd->header.status); | 513 | le16_to_cpu(cmd->header.status)); |
512 | 514 | ||
513 | memcpy(answer, cmd->value, len); | 515 | memcpy(answer, cmd->value, len); |
514 | 516 | ||
@@ -559,7 +561,7 @@ int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len, | |||
559 | scan_options |= WL1271_SCAN_OPT_PASSIVE; | 561 | scan_options |= WL1271_SCAN_OPT_PASSIVE; |
560 | if (high_prio) | 562 | if (high_prio) |
561 | scan_options |= WL1271_SCAN_OPT_PRIORITY_HIGH; | 563 | scan_options |= WL1271_SCAN_OPT_PRIORITY_HIGH; |
562 | params->params.scan_options = scan_options; | 564 | params->params.scan_options = cpu_to_le16(scan_options); |
563 | 565 | ||
564 | params->params.num_probe_requests = probe_requests; | 566 | params->params.num_probe_requests = probe_requests; |
565 | /* Let the fw autodetect suitable tx_rate for probes */ | 567 | /* Let the fw autodetect suitable tx_rate for probes */ |
@@ -643,9 +645,9 @@ int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len, | |||
643 | wl1271_spi_read(wl, wl->cmd_box_addr, params, sizeof(*params), | 645 | wl1271_spi_read(wl, wl->cmd_box_addr, params, sizeof(*params), |
644 | false); | 646 | false); |
645 | 647 | ||
646 | if (params->header.status != CMD_STATUS_SUCCESS) { | 648 | if (le16_to_cpu(params->header.status) != CMD_STATUS_SUCCESS) { |
647 | wl1271_error("Scan command error: %d", | 649 | wl1271_error("Scan command error: %d", |
648 | params->header.status); | 650 | le16_to_cpu(params->header.status)); |
649 | wl->scanning = false; | 651 | wl->scanning = false; |
650 | ret = -EIO; | 652 | ret = -EIO; |
651 | goto out; | 653 | goto out; |
@@ -675,7 +677,7 @@ int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id, | |||
675 | 677 | ||
676 | cmd->len = cpu_to_le16(buf_len); | 678 | cmd->len = cpu_to_le16(buf_len); |
677 | cmd->template_type = template_id; | 679 | cmd->template_type = template_id; |
678 | cmd->enabled_rates = wl->conf.tx.rc_conf.enabled_rates; | 680 | cmd->enabled_rates = cpu_to_le32(wl->conf.tx.rc_conf.enabled_rates); |
679 | cmd->short_retry_limit = wl->conf.tx.rc_conf.short_retry_limit; | 681 | cmd->short_retry_limit = wl->conf.tx.rc_conf.short_retry_limit; |
680 | cmd->long_retry_limit = wl->conf.tx.rc_conf.long_retry_limit; | 682 | cmd->long_retry_limit = wl->conf.tx.rc_conf.long_retry_limit; |
681 | 683 | ||
@@ -858,7 +860,7 @@ int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id) | |||
858 | } | 860 | } |
859 | 861 | ||
860 | cmd->id = id; | 862 | cmd->id = id; |
861 | cmd->key_action = KEY_SET_ID; | 863 | cmd->key_action = cpu_to_le16(KEY_SET_ID); |
862 | cmd->key_type = KEY_WEP; | 864 | cmd->key_type = KEY_WEP; |
863 | 865 | ||
864 | ret = wl1271_cmd_send(wl, CMD_SET_KEYS, cmd, sizeof(*cmd)); | 866 | ret = wl1271_cmd_send(wl, CMD_SET_KEYS, cmd, sizeof(*cmd)); |
@@ -889,12 +891,12 @@ int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, | |||
889 | if (key_type != KEY_WEP) | 891 | if (key_type != KEY_WEP) |
890 | memcpy(cmd->addr, addr, ETH_ALEN); | 892 | memcpy(cmd->addr, addr, ETH_ALEN); |
891 | 893 | ||
892 | cmd->key_action = action; | 894 | cmd->key_action = cpu_to_le16(action); |
893 | cmd->key_size = key_size; | 895 | cmd->key_size = key_size; |
894 | cmd->key_type = key_type; | 896 | cmd->key_type = key_type; |
895 | 897 | ||
896 | cmd->ac_seq_num16[0] = tx_seq_16; | 898 | cmd->ac_seq_num16[0] = cpu_to_le16(tx_seq_16); |
897 | cmd->ac_seq_num32[0] = tx_seq_32; | 899 | cmd->ac_seq_num32[0] = cpu_to_le32(tx_seq_32); |
898 | 900 | ||
899 | /* we have only one SSID profile */ | 901 | /* we have only one SSID profile */ |
900 | cmd->ssid_profile = 0; | 902 | cmd->ssid_profile = 0; |
@@ -943,8 +945,8 @@ int wl1271_cmd_disconnect(struct wl1271 *wl) | |||
943 | goto out; | 945 | goto out; |
944 | } | 946 | } |
945 | 947 | ||
946 | cmd->rx_config_options = wl->rx_config; | 948 | cmd->rx_config_options = cpu_to_le32(wl->rx_config); |
947 | cmd->rx_filter_options = wl->rx_filter; | 949 | cmd->rx_filter_options = cpu_to_le32(wl->rx_filter); |
948 | /* disconnect reason is not used in immediate disconnections */ | 950 | /* disconnect reason is not used in immediate disconnections */ |
949 | cmd->type = DISCONNECT_IMMEDIATE; | 951 | cmd->type = DISCONNECT_IMMEDIATE; |
950 | 952 | ||
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.h b/drivers/net/wireless/wl12xx/wl1271_cmd.h index 15254fa82f6a..57d69057b4fa 100644 --- a/drivers/net/wireless/wl12xx/wl1271_cmd.h +++ b/drivers/net/wireless/wl12xx/wl1271_cmd.h | |||
@@ -120,8 +120,8 @@ enum cmd_templ { | |||
120 | #define WL1271_CMD_TEMPL_MAX_SIZE 252 | 120 | #define WL1271_CMD_TEMPL_MAX_SIZE 252 |
121 | 121 | ||
122 | struct wl1271_cmd_header { | 122 | struct wl1271_cmd_header { |
123 | u16 id; | 123 | __le16 id; |
124 | u16 status; | 124 | __le16 status; |
125 | /* payload */ | 125 | /* payload */ |
126 | u8 data[0]; | 126 | u8 data[0]; |
127 | } __attribute__ ((packed)); | 127 | } __attribute__ ((packed)); |
@@ -174,11 +174,11 @@ struct cmd_read_write_memory { | |||
174 | struct wl1271_cmd_header header; | 174 | struct wl1271_cmd_header header; |
175 | 175 | ||
176 | /* The address of the memory to read from or write to.*/ | 176 | /* The address of the memory to read from or write to.*/ |
177 | u32 addr; | 177 | __le32 addr; |
178 | 178 | ||
179 | /* The amount of data in bytes to read from or write to the WiLink | 179 | /* The amount of data in bytes to read from or write to the WiLink |
180 | * device.*/ | 180 | * device.*/ |
181 | u32 size; | 181 | __le32 size; |
182 | 182 | ||
183 | /* The actual value read from or written to the Wilink. The source | 183 | /* The actual value read from or written to the Wilink. The source |
184 | of this field is the Host in WRITE command or the Wilink in READ | 184 | of this field is the Host in WRITE command or the Wilink in READ |
@@ -203,18 +203,18 @@ enum { | |||
203 | struct wl1271_cmd_join { | 203 | struct wl1271_cmd_join { |
204 | struct wl1271_cmd_header header; | 204 | struct wl1271_cmd_header header; |
205 | 205 | ||
206 | u32 bssid_lsb; | 206 | __le32 bssid_lsb; |
207 | u16 bssid_msb; | 207 | __le16 bssid_msb; |
208 | u16 beacon_interval; /* in TBTTs */ | 208 | __le16 beacon_interval; /* in TBTTs */ |
209 | u32 rx_config_options; | 209 | __le32 rx_config_options; |
210 | u32 rx_filter_options; | 210 | __le32 rx_filter_options; |
211 | 211 | ||
212 | /* | 212 | /* |
213 | * The target uses this field to determine the rate at | 213 | * The target uses this field to determine the rate at |
214 | * which to transmit control frame responses (such as | 214 | * which to transmit control frame responses (such as |
215 | * ACK or CTS frames). | 215 | * ACK or CTS frames). |
216 | */ | 216 | */ |
217 | u32 basic_rate_set; | 217 | __le32 basic_rate_set; |
218 | u8 dtim_interval; | 218 | u8 dtim_interval; |
219 | /* | 219 | /* |
220 | * bits 0-2: This bitwise field specifies the type | 220 | * bits 0-2: This bitwise field specifies the type |
@@ -243,10 +243,10 @@ struct cmd_enabledisable_path { | |||
243 | struct wl1271_cmd_template_set { | 243 | struct wl1271_cmd_template_set { |
244 | struct wl1271_cmd_header header; | 244 | struct wl1271_cmd_header header; |
245 | 245 | ||
246 | u16 len; | 246 | __le16 len; |
247 | u8 template_type; | 247 | u8 template_type; |
248 | u8 index; /* relevant only for KLV_TEMPLATE type */ | 248 | u8 index; /* relevant only for KLV_TEMPLATE type */ |
249 | u32 enabled_rates; | 249 | __le32 enabled_rates; |
250 | u8 short_retry_limit; | 250 | u8 short_retry_limit; |
251 | u8 long_retry_limit; | 251 | u8 long_retry_limit; |
252 | u8 aflags; | 252 | u8 aflags; |
@@ -283,7 +283,7 @@ struct wl1271_cmd_ps_params { | |||
283 | * to power save mode. | 283 | * to power save mode. |
284 | */ | 284 | */ |
285 | u8 hang_over_period; | 285 | u8 hang_over_period; |
286 | u32 null_data_rate; | 286 | __le32 null_data_rate; |
287 | } __attribute__ ((packed)); | 287 | } __attribute__ ((packed)); |
288 | 288 | ||
289 | /* HW encryption keys */ | 289 | /* HW encryption keys */ |
@@ -314,9 +314,9 @@ struct wl1271_cmd_set_keys { | |||
314 | u8 addr[ETH_ALEN]; | 314 | u8 addr[ETH_ALEN]; |
315 | 315 | ||
316 | /* key_action_e */ | 316 | /* key_action_e */ |
317 | u16 key_action; | 317 | __le16 key_action; |
318 | 318 | ||
319 | u16 reserved_1; | 319 | __le16 reserved_1; |
320 | 320 | ||
321 | /* key size in bytes */ | 321 | /* key size in bytes */ |
322 | u8 key_size; | 322 | u8 key_size; |
@@ -332,8 +332,8 @@ struct wl1271_cmd_set_keys { | |||
332 | u8 id; | 332 | u8 id; |
333 | u8 reserved_2[6]; | 333 | u8 reserved_2[6]; |
334 | u8 key[MAX_KEY_SIZE]; | 334 | u8 key[MAX_KEY_SIZE]; |
335 | u16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY]; | 335 | __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY]; |
336 | u32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY]; | 336 | __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY]; |
337 | } __attribute__ ((packed)); | 337 | } __attribute__ ((packed)); |
338 | 338 | ||
339 | 339 | ||
@@ -350,17 +350,17 @@ struct wl1271_cmd_set_keys { | |||
350 | #define WL1271_SCAN_BAND_DUAL 2 | 350 | #define WL1271_SCAN_BAND_DUAL 2 |
351 | 351 | ||
352 | struct basic_scan_params { | 352 | struct basic_scan_params { |
353 | u32 rx_config_options; | 353 | __le32 rx_config_options; |
354 | u32 rx_filter_options; | 354 | __le32 rx_filter_options; |
355 | /* Scan option flags (WL1271_SCAN_OPT_*) */ | 355 | /* Scan option flags (WL1271_SCAN_OPT_*) */ |
356 | u16 scan_options; | 356 | __le16 scan_options; |
357 | /* Number of scan channels in the list (maximum 30) */ | 357 | /* Number of scan channels in the list (maximum 30) */ |
358 | u8 num_channels; | 358 | u8 num_channels; |
359 | /* This field indicates the number of probe requests to send | 359 | /* This field indicates the number of probe requests to send |
360 | per channel for an active scan */ | 360 | per channel for an active scan */ |
361 | u8 num_probe_requests; | 361 | u8 num_probe_requests; |
362 | /* Rate bit field for sending the probes */ | 362 | /* Rate bit field for sending the probes */ |
363 | u32 tx_rate; | 363 | __le32 tx_rate; |
364 | u8 tid_trigger; | 364 | u8 tid_trigger; |
365 | u8 ssid_len; | 365 | u8 ssid_len; |
366 | /* in order to align */ | 366 | /* in order to align */ |
@@ -375,10 +375,10 @@ struct basic_scan_params { | |||
375 | 375 | ||
376 | struct basic_scan_channel_params { | 376 | struct basic_scan_channel_params { |
377 | /* Duration in TU to wait for frames on a channel for active scan */ | 377 | /* Duration in TU to wait for frames on a channel for active scan */ |
378 | u32 min_duration; | 378 | __le32 min_duration; |
379 | u32 max_duration; | 379 | __le32 max_duration; |
380 | u32 bssid_lsb; | 380 | __le32 bssid_lsb; |
381 | u16 bssid_msb; | 381 | __le16 bssid_msb; |
382 | u8 early_termination; | 382 | u8 early_termination; |
383 | u8 tx_power_att; | 383 | u8 tx_power_att; |
384 | u8 channel; | 384 | u8 channel; |
@@ -398,7 +398,7 @@ struct wl1271_cmd_scan { | |||
398 | struct wl1271_cmd_trigger_scan_to { | 398 | struct wl1271_cmd_trigger_scan_to { |
399 | struct wl1271_cmd_header header; | 399 | struct wl1271_cmd_header header; |
400 | 400 | ||
401 | u32 timeout; | 401 | __le32 timeout; |
402 | }; | 402 | }; |
403 | 403 | ||
404 | struct wl1271_cmd_test_header { | 404 | struct wl1271_cmd_test_header { |
@@ -426,7 +426,7 @@ struct wl1271_cmd_cal_channel_tune { | |||
426 | u8 band; | 426 | u8 band; |
427 | u8 channel; | 427 | u8 channel; |
428 | 428 | ||
429 | u16 radio_status; | 429 | __le16 radio_status; |
430 | } __attribute__ ((packed)); | 430 | } __attribute__ ((packed)); |
431 | 431 | ||
432 | struct wl1271_cmd_cal_update_ref_point { | 432 | struct wl1271_cmd_cal_update_ref_point { |
@@ -434,8 +434,8 @@ struct wl1271_cmd_cal_update_ref_point { | |||
434 | 434 | ||
435 | struct wl1271_cmd_test_header test; | 435 | struct wl1271_cmd_test_header test; |
436 | 436 | ||
437 | s32 ref_power; | 437 | __le32 ref_power; |
438 | s32 ref_detector; | 438 | __le32 ref_detector; |
439 | u8 sub_band; | 439 | u8 sub_band; |
440 | u8 padding[3]; | 440 | u8 padding[3]; |
441 | } __attribute__ ((packed)); | 441 | } __attribute__ ((packed)); |
@@ -450,12 +450,12 @@ struct wl1271_cmd_cal_p2g { | |||
450 | 450 | ||
451 | struct wl1271_cmd_test_header test; | 451 | struct wl1271_cmd_test_header test; |
452 | 452 | ||
453 | u16 len; | 453 | __le16 len; |
454 | u8 buf[MAX_TLV_LENGTH]; | 454 | u8 buf[MAX_TLV_LENGTH]; |
455 | u8 type; | 455 | u8 type; |
456 | u8 padding; | 456 | u8 padding; |
457 | 457 | ||
458 | s16 radio_status; | 458 | __le16 radio_status; |
459 | u8 nvs_version[MAX_NVS_VERSION_LENGTH]; | 459 | u8 nvs_version[MAX_NVS_VERSION_LENGTH]; |
460 | 460 | ||
461 | u8 sub_band_mask; | 461 | u8 sub_band_mask; |
@@ -479,10 +479,10 @@ enum wl1271_disconnect_type { | |||
479 | }; | 479 | }; |
480 | 480 | ||
481 | struct wl1271_cmd_disconnect { | 481 | struct wl1271_cmd_disconnect { |
482 | u32 rx_config_options; | 482 | __le32 rx_config_options; |
483 | u32 rx_filter_options; | 483 | __le32 rx_filter_options; |
484 | 484 | ||
485 | u16 reason; | 485 | __le16 reason; |
486 | u8 type; | 486 | u8 type; |
487 | 487 | ||
488 | u8 padding; | 488 | u8 padding; |
diff --git a/drivers/net/wireless/wl12xx/wl1271_event.c b/drivers/net/wireless/wl12xx/wl1271_event.c index a4b11e43f0db..31d396ba9188 100644 --- a/drivers/net/wireless/wl12xx/wl1271_event.c +++ b/drivers/net/wireless/wl12xx/wl1271_event.c | |||
@@ -82,7 +82,8 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox) | |||
82 | 82 | ||
83 | wl1271_event_mbox_dump(mbox); | 83 | wl1271_event_mbox_dump(mbox); |
84 | 84 | ||
85 | vector = mbox->events_vector & ~(mbox->events_mask); | 85 | vector = le32_to_cpu(mbox->events_vector); |
86 | vector &= ~(le32_to_cpu(mbox->events_mask)); | ||
86 | wl1271_debug(DEBUG_EVENT, "vector: 0x%x", vector); | 87 | wl1271_debug(DEBUG_EVENT, "vector: 0x%x", vector); |
87 | 88 | ||
88 | if (vector & SCAN_COMPLETE_EVENT_ID) { | 89 | if (vector & SCAN_COMPLETE_EVENT_ID) { |
diff --git a/drivers/net/wireless/wl12xx/wl1271_event.h b/drivers/net/wireless/wl12xx/wl1271_event.h index adc4653b2616..3ab53d331f15 100644 --- a/drivers/net/wireless/wl12xx/wl1271_event.h +++ b/drivers/net/wireless/wl12xx/wl1271_event.h | |||
@@ -66,33 +66,33 @@ enum { | |||
66 | struct event_debug_report { | 66 | struct event_debug_report { |
67 | u8 debug_event_id; | 67 | u8 debug_event_id; |
68 | u8 num_params; | 68 | u8 num_params; |
69 | u16 pad; | 69 | __le16 pad; |
70 | u32 report_1; | 70 | __le32 report_1; |
71 | u32 report_2; | 71 | __le32 report_2; |
72 | u32 report_3; | 72 | __le32 report_3; |
73 | } __attribute__ ((packed)); | 73 | } __attribute__ ((packed)); |
74 | 74 | ||
75 | #define NUM_OF_RSSI_SNR_TRIGGERS 8 | 75 | #define NUM_OF_RSSI_SNR_TRIGGERS 8 |
76 | 76 | ||
77 | struct event_mailbox { | 77 | struct event_mailbox { |
78 | u32 events_vector; | 78 | __le32 events_vector; |
79 | u32 events_mask; | 79 | __le32 events_mask; |
80 | u32 reserved_1; | 80 | __le32 reserved_1; |
81 | u32 reserved_2; | 81 | __le32 reserved_2; |
82 | 82 | ||
83 | u8 dbg_event_id; | 83 | u8 dbg_event_id; |
84 | u8 num_relevant_params; | 84 | u8 num_relevant_params; |
85 | u16 reserved_3; | 85 | __le16 reserved_3; |
86 | u32 event_report_p1; | 86 | __le32 event_report_p1; |
87 | u32 event_report_p2; | 87 | __le32 event_report_p2; |
88 | u32 event_report_p3; | 88 | __le32 event_report_p3; |
89 | 89 | ||
90 | u8 number_of_scan_results; | 90 | u8 number_of_scan_results; |
91 | u8 scan_tag; | 91 | u8 scan_tag; |
92 | u8 reserved_4[2]; | 92 | u8 reserved_4[2]; |
93 | u32 compl_scheduled_scan_status; | 93 | __le32 compl_scheduled_scan_status; |
94 | 94 | ||
95 | u16 scheduled_scan_attended_channels; | 95 | __le16 scheduled_scan_attended_channels; |
96 | u8 soft_gemini_sense_info; | 96 | u8 soft_gemini_sense_info; |
97 | u8 soft_gemini_protective_info; | 97 | u8 soft_gemini_protective_info; |
98 | s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS]; | 98 | s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS]; |
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.h b/drivers/net/wireless/wl12xx/wl1271_init.h index 513d0cb1866b..6e21ceee76a6 100644 --- a/drivers/net/wireless/wl12xx/wl1271_init.h +++ b/drivers/net/wireless/wl12xx/wl1271_init.h | |||
@@ -65,7 +65,7 @@ struct wl1271_radio_parms { | |||
65 | 65 | ||
66 | /* Dynamic radio parameters */ | 66 | /* Dynamic radio parameters */ |
67 | /* 2.4GHz */ | 67 | /* 2.4GHz */ |
68 | s16 tx_ref_pd_voltage; | 68 | __le16 tx_ref_pd_voltage; |
69 | s8 tx_ref_power; | 69 | s8 tx_ref_power; |
70 | s8 tx_offset_db; | 70 | s8 tx_offset_db; |
71 | 71 | ||
@@ -82,7 +82,7 @@ struct wl1271_radio_parms { | |||
82 | u8 padding2; | 82 | u8 padding2; |
83 | 83 | ||
84 | /* 5GHz */ | 84 | /* 5GHz */ |
85 | s16 tx_ref_pd_voltage_5[CONF_NUMBER_OF_SUB_BANDS_5]; | 85 | __le16 tx_ref_pd_voltage_5[CONF_NUMBER_OF_SUB_BANDS_5]; |
86 | s8 tx_ref_power_5[CONF_NUMBER_OF_SUB_BANDS_5]; | 86 | s8 tx_ref_power_5[CONF_NUMBER_OF_SUB_BANDS_5]; |
87 | s8 tx_offset_db_5[CONF_NUMBER_OF_SUB_BANDS_5]; | 87 | s8 tx_offset_db_5[CONF_NUMBER_OF_SUB_BANDS_5]; |
88 | 88 | ||
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index ee7ffafaa274..86132bb00787 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -397,8 +397,11 @@ static void wl1271_fw_status(struct wl1271 *wl, | |||
397 | 397 | ||
398 | /* update number of available TX blocks */ | 398 | /* update number of available TX blocks */ |
399 | for (i = 0; i < NUM_TX_QUEUES; i++) { | 399 | for (i = 0; i < NUM_TX_QUEUES; i++) { |
400 | u32 cnt = status->tx_released_blks[i] - wl->tx_blocks_freed[i]; | 400 | u32 cnt = le32_to_cpu(status->tx_released_blks[i]) - |
401 | wl->tx_blocks_freed[i] = status->tx_released_blks[i]; | 401 | wl->tx_blocks_freed[i]; |
402 | |||
403 | wl->tx_blocks_freed[i] = | ||
404 | le32_to_cpu(status->tx_released_blks[i]); | ||
402 | wl->tx_blocks_available += cnt; | 405 | wl->tx_blocks_available += cnt; |
403 | total += cnt; | 406 | total += cnt; |
404 | } | 407 | } |
@@ -408,7 +411,8 @@ static void wl1271_fw_status(struct wl1271 *wl, | |||
408 | ieee80211_queue_work(wl->hw, &wl->tx_work); | 411 | ieee80211_queue_work(wl->hw, &wl->tx_work); |
409 | 412 | ||
410 | /* update the host-chipset time offset */ | 413 | /* update the host-chipset time offset */ |
411 | wl->time_offset = jiffies_to_usecs(jiffies) - status->fw_localtime; | 414 | wl->time_offset = jiffies_to_usecs(jiffies) - |
415 | le32_to_cpu(status->fw_localtime); | ||
412 | } | 416 | } |
413 | 417 | ||
414 | static void wl1271_irq_work(struct work_struct *work) | 418 | static void wl1271_irq_work(struct work_struct *work) |
@@ -432,7 +436,7 @@ static void wl1271_irq_work(struct work_struct *work) | |||
432 | wl1271_spi_write32(wl, ACX_REG_INTERRUPT_MASK, WL1271_ACX_INTR_ALL); | 436 | wl1271_spi_write32(wl, ACX_REG_INTERRUPT_MASK, WL1271_ACX_INTR_ALL); |
433 | 437 | ||
434 | wl1271_fw_status(wl, wl->fw_status); | 438 | wl1271_fw_status(wl, wl->fw_status); |
435 | intr = wl->fw_status->intr; | 439 | intr = le32_to_cpu(wl->fw_status->intr); |
436 | if (!intr) { | 440 | if (!intr) { |
437 | wl1271_debug(DEBUG_IRQ, "Zero interrupt received."); | 441 | wl1271_debug(DEBUG_IRQ, "Zero interrupt received."); |
438 | goto out_sleep; | 442 | goto out_sleep; |
diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.c b/drivers/net/wireless/wl12xx/wl1271_rx.c index 1ea3f41912a6..dbf07bea87c0 100644 --- a/drivers/net/wireless/wl12xx/wl1271_rx.c +++ b/drivers/net/wireless/wl12xx/wl1271_rx.c | |||
@@ -30,14 +30,15 @@ | |||
30 | static u8 wl1271_rx_get_mem_block(struct wl1271_fw_status *status, | 30 | static u8 wl1271_rx_get_mem_block(struct wl1271_fw_status *status, |
31 | u32 drv_rx_counter) | 31 | u32 drv_rx_counter) |
32 | { | 32 | { |
33 | return status->rx_pkt_descs[drv_rx_counter] & RX_MEM_BLOCK_MASK; | 33 | return le32_to_cpu(status->rx_pkt_descs[drv_rx_counter]) & |
34 | RX_MEM_BLOCK_MASK; | ||
34 | } | 35 | } |
35 | 36 | ||
36 | static u32 wl1271_rx_get_buf_size(struct wl1271_fw_status *status, | 37 | static u32 wl1271_rx_get_buf_size(struct wl1271_fw_status *status, |
37 | u32 drv_rx_counter) | 38 | u32 drv_rx_counter) |
38 | { | 39 | { |
39 | return (status->rx_pkt_descs[drv_rx_counter] & RX_BUF_SIZE_MASK) >> | 40 | return (le32_to_cpu(status->rx_pkt_descs[drv_rx_counter]) & |
40 | RX_BUF_SIZE_SHIFT_DIV; | 41 | RX_BUF_SIZE_MASK) >> RX_BUF_SIZE_SHIFT_DIV; |
41 | } | 42 | } |
42 | 43 | ||
43 | /* The values of this table must match the wl1271_rates[] array */ | 44 | /* The values of this table must match the wl1271_rates[] array */ |
@@ -203,8 +204,8 @@ void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_status *status) | |||
203 | break; | 204 | break; |
204 | } | 205 | } |
205 | 206 | ||
206 | wl->rx_mem_pool_addr.addr = | 207 | wl->rx_mem_pool_addr.addr = (mem_block << 8) + |
207 | (mem_block << 8) + wl_mem_map->packet_memory_pool_start; | 208 | le32_to_cpu(wl_mem_map->packet_memory_pool_start); |
208 | wl->rx_mem_pool_addr.addr_extra = | 209 | wl->rx_mem_pool_addr.addr_extra = |
209 | wl->rx_mem_pool_addr.addr + 4; | 210 | wl->rx_mem_pool_addr.addr + 4; |
210 | 211 | ||
diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.h b/drivers/net/wireless/wl12xx/wl1271_rx.h index d1ca60e43a25..1ae6d1783ed4 100644 --- a/drivers/net/wireless/wl12xx/wl1271_rx.h +++ b/drivers/net/wireless/wl12xx/wl1271_rx.h | |||
@@ -102,14 +102,14 @@ | |||
102 | #define RX_BUF_SIZE_SHIFT_DIV 6 | 102 | #define RX_BUF_SIZE_SHIFT_DIV 6 |
103 | 103 | ||
104 | struct wl1271_rx_descriptor { | 104 | struct wl1271_rx_descriptor { |
105 | u16 length; | 105 | __le16 length; |
106 | u8 status; | 106 | u8 status; |
107 | u8 flags; | 107 | u8 flags; |
108 | u8 rate; | 108 | u8 rate; |
109 | u8 channel; | 109 | u8 channel; |
110 | s8 rssi; | 110 | s8 rssi; |
111 | u8 snr; | 111 | u8 snr; |
112 | u32 timestamp; | 112 | __le32 timestamp; |
113 | u8 packet_class; | 113 | u8 packet_class; |
114 | u8 process_id; | 114 | u8 process_id; |
115 | u8 pad_len; | 115 | u8 pad_len; |
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.c b/drivers/net/wireless/wl12xx/wl1271_tx.c index 4560458a6d60..00af065c77c2 100644 --- a/drivers/net/wireless/wl12xx/wl1271_tx.c +++ b/drivers/net/wireless/wl12xx/wl1271_tx.c | |||
@@ -88,6 +88,7 @@ static int wl1271_tx_fill_hdr(struct wl1271 *wl, struct sk_buff *skb, | |||
88 | { | 88 | { |
89 | struct wl1271_tx_hw_descr *desc; | 89 | struct wl1271_tx_hw_descr *desc; |
90 | int pad; | 90 | int pad; |
91 | u16 tx_attr; | ||
91 | 92 | ||
92 | desc = (struct wl1271_tx_hw_descr *) skb->data; | 93 | desc = (struct wl1271_tx_hw_descr *) skb->data; |
93 | 94 | ||
@@ -95,16 +96,17 @@ static int wl1271_tx_fill_hdr(struct wl1271 *wl, struct sk_buff *skb, | |||
95 | if (extra) { | 96 | if (extra) { |
96 | void *framestart = skb->data + sizeof(*desc); | 97 | void *framestart = skb->data + sizeof(*desc); |
97 | u16 fc = *(u16 *)(framestart + extra); | 98 | u16 fc = *(u16 *)(framestart + extra); |
98 | int hdrlen = ieee80211_hdrlen(fc); | 99 | int hdrlen = ieee80211_hdrlen(cpu_to_le16(fc)); |
99 | memmove(framestart, framestart + extra, hdrlen); | 100 | memmove(framestart, framestart + extra, hdrlen); |
100 | } | 101 | } |
101 | 102 | ||
102 | /* configure packet life time */ | 103 | /* configure packet life time */ |
103 | desc->start_time = jiffies_to_usecs(jiffies) - wl->time_offset; | 104 | desc->start_time = cpu_to_le32(jiffies_to_usecs(jiffies) - |
104 | desc->life_time = TX_HW_MGMT_PKT_LIFETIME_TU; | 105 | wl->time_offset); |
106 | desc->life_time = cpu_to_le16(TX_HW_MGMT_PKT_LIFETIME_TU); | ||
105 | 107 | ||
106 | /* configure the tx attributes */ | 108 | /* configure the tx attributes */ |
107 | desc->tx_attr = wl->session_counter << TX_HW_ATTR_OFST_SESSION_COUNTER; | 109 | tx_attr = wl->session_counter << TX_HW_ATTR_OFST_SESSION_COUNTER; |
108 | /* FIXME: do we know the packet priority? can we identify mgmt | 110 | /* FIXME: do we know the packet priority? can we identify mgmt |
109 | packets, and use max prio for them at least? */ | 111 | packets, and use max prio for them at least? */ |
110 | desc->tid = 0; | 112 | desc->tid = 0; |
@@ -113,11 +115,13 @@ static int wl1271_tx_fill_hdr(struct wl1271 *wl, struct sk_buff *skb, | |||
113 | 115 | ||
114 | /* align the length (and store in terms of words) */ | 116 | /* align the length (and store in terms of words) */ |
115 | pad = WL1271_TX_ALIGN(skb->len); | 117 | pad = WL1271_TX_ALIGN(skb->len); |
116 | desc->length = pad >> 2; | 118 | desc->length = cpu_to_le16(pad >> 2); |
117 | 119 | ||
118 | /* calculate number of padding bytes */ | 120 | /* calculate number of padding bytes */ |
119 | pad = pad - skb->len; | 121 | pad = pad - skb->len; |
120 | desc->tx_attr |= pad << TX_HW_ATTR_OFST_LAST_WORD_PAD; | 122 | tx_attr |= pad << TX_HW_ATTR_OFST_LAST_WORD_PAD; |
123 | |||
124 | desc->tx_attr = cpu_to_le16(tx_attr); | ||
121 | 125 | ||
122 | wl1271_debug(DEBUG_TX, "tx_fill_hdr: pad: %d", pad); | 126 | wl1271_debug(DEBUG_TX, "tx_fill_hdr: pad: %d", pad); |
123 | return 0; | 127 | return 0; |
@@ -331,7 +335,7 @@ void wl1271_tx_complete(struct wl1271 *wl, u32 count) | |||
331 | wl1271_debug(DEBUG_TX, "tx_complete received, packets: %d", count); | 335 | wl1271_debug(DEBUG_TX, "tx_complete received, packets: %d", count); |
332 | 336 | ||
333 | /* read the tx results from the chipset */ | 337 | /* read the tx results from the chipset */ |
334 | wl1271_spi_read(wl, memmap->tx_result, | 338 | wl1271_spi_read(wl, le32_to_cpu(memmap->tx_result), |
335 | wl->tx_res_if, sizeof(*wl->tx_res_if), false); | 339 | wl->tx_res_if, sizeof(*wl->tx_res_if), false); |
336 | 340 | ||
337 | /* verify that the result buffer is not getting overrun */ | 341 | /* verify that the result buffer is not getting overrun */ |
@@ -353,10 +357,10 @@ void wl1271_tx_complete(struct wl1271 *wl, u32 count) | |||
353 | } | 357 | } |
354 | 358 | ||
355 | /* write host counter to chipset (to ack) */ | 359 | /* write host counter to chipset (to ack) */ |
356 | wl1271_spi_write32(wl, memmap->tx_result + | 360 | wl1271_spi_write32(wl, le32_to_cpu(memmap->tx_result) + |
357 | offsetof(struct wl1271_tx_hw_res_if, | 361 | offsetof(struct wl1271_tx_hw_res_if, |
358 | tx_result_host_counter), | 362 | tx_result_host_counter), |
359 | wl->tx_res_if->tx_result_fw_counter); | 363 | le32_to_cpu(wl->tx_res_if->tx_result_fw_counter)); |
360 | } | 364 | } |
361 | 365 | ||
362 | /* caller must hold wl->mutex */ | 366 | /* caller must hold wl->mutex */ |
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.h b/drivers/net/wireless/wl12xx/wl1271_tx.h index 4a614067ddba..416396caf0a0 100644 --- a/drivers/net/wireless/wl12xx/wl1271_tx.h +++ b/drivers/net/wireless/wl12xx/wl1271_tx.h | |||
@@ -58,7 +58,7 @@ | |||
58 | 58 | ||
59 | struct wl1271_tx_hw_descr { | 59 | struct wl1271_tx_hw_descr { |
60 | /* Length of packet in words, including descriptor+header+data */ | 60 | /* Length of packet in words, including descriptor+header+data */ |
61 | u16 length; | 61 | __le16 length; |
62 | /* Number of extra memory blocks to allocate for this packet in | 62 | /* Number of extra memory blocks to allocate for this packet in |
63 | addition to the number of blocks derived from the packet length */ | 63 | addition to the number of blocks derived from the packet length */ |
64 | u8 extra_mem_blocks; | 64 | u8 extra_mem_blocks; |
@@ -67,12 +67,12 @@ struct wl1271_tx_hw_descr { | |||
67 | HW!! */ | 67 | HW!! */ |
68 | u8 total_mem_blocks; | 68 | u8 total_mem_blocks; |
69 | /* Device time (in us) when the packet arrived to the driver */ | 69 | /* Device time (in us) when the packet arrived to the driver */ |
70 | u32 start_time; | 70 | __le32 start_time; |
71 | /* Max delay in TUs until transmission. The last device time the | 71 | /* Max delay in TUs until transmission. The last device time the |
72 | packet can be transmitted is: startTime+(1024*LifeTime) */ | 72 | packet can be transmitted is: startTime+(1024*LifeTime) */ |
73 | u16 life_time; | 73 | __le16 life_time; |
74 | /* Bitwise fields - see TX_ATTR... definitions above. */ | 74 | /* Bitwise fields - see TX_ATTR... definitions above. */ |
75 | u16 tx_attr; | 75 | __le16 tx_attr; |
76 | /* Packet identifier used also in the Tx-Result. */ | 76 | /* Packet identifier used also in the Tx-Result. */ |
77 | u8 id; | 77 | u8 id; |
78 | /* The packet TID value (as User-Priority) */ | 78 | /* The packet TID value (as User-Priority) */ |
@@ -100,12 +100,12 @@ struct wl1271_tx_hw_res_descr { | |||
100 | several possible reasons for failure. */ | 100 | several possible reasons for failure. */ |
101 | u8 status; | 101 | u8 status; |
102 | /* Total air access duration including all retrys and overheads.*/ | 102 | /* Total air access duration including all retrys and overheads.*/ |
103 | u16 medium_usage; | 103 | __le16 medium_usage; |
104 | /* The time passed from host xfer to Tx-complete.*/ | 104 | /* The time passed from host xfer to Tx-complete.*/ |
105 | u32 fw_handling_time; | 105 | __le32 fw_handling_time; |
106 | /* Total media delay | 106 | /* Total media delay |
107 | (from 1st EDCA AIFS counter until TX Complete). */ | 107 | (from 1st EDCA AIFS counter until TX Complete). */ |
108 | u32 medium_delay; | 108 | __le32 medium_delay; |
109 | /* LS-byte of last TKIP seq-num (saved per AC for recovery). */ | 109 | /* LS-byte of last TKIP seq-num (saved per AC for recovery). */ |
110 | u8 lsb_security_sequence_number; | 110 | u8 lsb_security_sequence_number; |
111 | /* Retry count - number of transmissions without successful ACK.*/ | 111 | /* Retry count - number of transmissions without successful ACK.*/ |
@@ -118,8 +118,8 @@ struct wl1271_tx_hw_res_descr { | |||
118 | } __attribute__ ((packed)); | 118 | } __attribute__ ((packed)); |
119 | 119 | ||
120 | struct wl1271_tx_hw_res_if { | 120 | struct wl1271_tx_hw_res_if { |
121 | u32 tx_result_fw_counter; | 121 | __le32 tx_result_fw_counter; |
122 | u32 tx_result_host_counter; | 122 | __le32 tx_result_host_counter; |
123 | struct wl1271_tx_hw_res_descr tx_results_queue[TX_HW_RESULT_QUEUE_LEN]; | 123 | struct wl1271_tx_hw_res_descr tx_results_queue[TX_HW_RESULT_QUEUE_LEN]; |
124 | } __attribute__ ((packed)); | 124 | } __attribute__ ((packed)); |
125 | 125 | ||
diff --git a/drivers/net/wireless/wl12xx/wl12xx_80211.h b/drivers/net/wireless/wl12xx/wl12xx_80211.h index 657c2dbcb7d3..055d7bc6f592 100644 --- a/drivers/net/wireless/wl12xx/wl12xx_80211.h +++ b/drivers/net/wireless/wl12xx/wl12xx_80211.h | |||
@@ -122,8 +122,8 @@ struct wl12xx_null_data_template { | |||
122 | } __attribute__ ((packed)); | 122 | } __attribute__ ((packed)); |
123 | 123 | ||
124 | struct wl12xx_ps_poll_template { | 124 | struct wl12xx_ps_poll_template { |
125 | u16 fc; | 125 | __le16 fc; |
126 | u16 aid; | 126 | __le16 aid; |
127 | u8 bssid[ETH_ALEN]; | 127 | u8 bssid[ETH_ALEN]; |
128 | u8 ta[ETH_ALEN]; | 128 | u8 ta[ETH_ALEN]; |
129 | } __attribute__ ((packed)); | 129 | } __attribute__ ((packed)); |