aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/acx.h
diff options
context:
space:
mode:
authorKalle Valo <kalle.valo@nokia.com>2009-06-12 07:14:19 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 14:57:41 -0400
commitff25839bf0c99e828c26864a24417a36a6b6a31e (patch)
treee5891ed357f4285f788056e270df7664b4d5aa13 /drivers/net/wireless/wl12xx/acx.h
parentc4f9f16b309b65f9f578ec4ba78b3efa106cf65d (diff)
wl12xx: cmd and acx interface rework
Rework cmd and acx interfaces, it was just too confusing earlier. Now all commands need to contain all the needed headers, either just cmd headers or both cmd and acx headers. This accomplish to remove the extra copy done for each command. The interfaces are now properly documented as well. Also try to make all commands safe for DMA transfers. I might have missed some, but most of them should be fixed now. And this is not all! As a free bonus you will also get some cosmetic cleanups and code reorganisation. Order today! Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/acx.h')
-rw-r--r--drivers/net/wireless/wl12xx/acx.h126
1 files changed, 13 insertions, 113 deletions
diff --git a/drivers/net/wireless/wl12xx/acx.h b/drivers/net/wireless/wl12xx/acx.h
index fb2d2340993c..549e537d2e6e 100644
--- a/drivers/net/wireless/wl12xx/acx.h
+++ b/drivers/net/wireless/wl12xx/acx.h
@@ -26,10 +26,16 @@
26#define __WL12XX_ACX_H__ 26#define __WL12XX_ACX_H__
27 27
28#include "wl12xx.h" 28#include "wl12xx.h"
29#include "cmd.h"
29 30
30/* Target's information element */ 31/* Target's information element */
31struct acx_header { 32struct acx_header {
33 struct wl12xx_cmd_header cmd;
34
35 /* acx (or information element) header */
32 u16 id; 36 u16 id;
37
38 /* payload length (not including headers */
33 u16 len; 39 u16 len;
34}; 40};
35 41
@@ -107,25 +113,6 @@ struct acx_sleep_auth {
107 u8 padding[3]; 113 u8 padding[3];
108} __attribute__ ((packed)); 114} __attribute__ ((packed));
109 115
110#define TIM_ELE_ID 5
111#define PARTIAL_VBM_MAX 251
112
113struct tim {
114 u8 identity;
115 u8 length;
116 u8 dtim_count;
117 u8 dtim_period;
118 u8 bitmap_ctrl;
119 u8 pvb_field[PARTIAL_VBM_MAX]; /* Partial Virtual Bitmap */
120} __attribute__ ((packed));
121
122/* Virtual Bit Map update */
123struct vbm_update_request {
124 __le16 len;
125 u8 padding[2];
126 struct tim tim;
127} __attribute__ ((packed));
128
129enum { 116enum {
130 HOSTIF_PCI_MASTER_HOST_INDIRECT, 117 HOSTIF_PCI_MASTER_HOST_INDIRECT,
131 HOSTIF_PCI_MASTER_HOST_DIRECT, 118 HOSTIF_PCI_MASTER_HOST_DIRECT,
@@ -202,7 +189,7 @@ struct acx_data_path_params_resp {
202#define RX_MSDU_LIFETIME_MAX 0xFFFFFFFF 189#define RX_MSDU_LIFETIME_MAX 0xFFFFFFFF
203#define RX_MSDU_LIFETIME_DEF 512000 190#define RX_MSDU_LIFETIME_DEF 512000
204 191
205struct rx_msdu_lifetime { 192struct acx_rx_msdu_lifetime {
206 struct acx_header header; 193 struct acx_header header;
207 194
208 /* 195 /*
@@ -368,7 +355,7 @@ struct acx_slot {
368#define ADDRESS_GROUP_MAX (8) 355#define ADDRESS_GROUP_MAX (8)
369#define ADDRESS_GROUP_MAX_LEN (ETH_ALEN * ADDRESS_GROUP_MAX) 356#define ADDRESS_GROUP_MAX_LEN (ETH_ALEN * ADDRESS_GROUP_MAX)
370 357
371struct multicast_grp_addr_start { 358struct acx_dot11_grp_addr_tbl {
372 struct acx_header header; 359 struct acx_header header;
373 360
374 u8 enabled; 361 u8 enabled;
@@ -730,22 +717,13 @@ struct acx_fw_gen_frame_rates {
730} __attribute__ ((packed)); 717} __attribute__ ((packed));
731 718
732/* STA MAC */ 719/* STA MAC */
733struct dot11_station_id { 720struct acx_dot11_station_id {
734 struct acx_header header; 721 struct acx_header header;
735 722
736 u8 mac[ETH_ALEN]; 723 u8 mac[ETH_ALEN];
737 u8 pad[2]; 724 u8 pad[2];
738} __attribute__ ((packed)); 725} __attribute__ ((packed));
739 726
740/* HW encryption keys */
741#define NUM_ACCESS_CATEGORIES_COPY 4
742#define MAX_KEY_SIZE 32
743
744/* When set, disable HW encryption */
745#define DF_ENCRYPTION_DISABLE 0x01
746/* When set, disable HW decryption */
747#define DF_SNIFF_MODE_ENABLE 0x80
748
749struct acx_feature_config { 727struct acx_feature_config {
750 struct acx_header header; 728 struct acx_header header;
751 729
@@ -753,67 +731,6 @@ struct acx_feature_config {
753 u32 data_flow_options; 731 u32 data_flow_options;
754} __attribute__ ((packed)); 732} __attribute__ ((packed));
755 733
756enum acx_key_action {
757 KEY_ADD_OR_REPLACE = 1,
758 KEY_REMOVE = 2,
759 KEY_SET_ID = 3,
760 MAX_KEY_ACTION = 0xffff,
761};
762
763enum acx_key_type {
764 KEY_WEP_DEFAULT = 0,
765 KEY_WEP_ADDR = 1,
766 KEY_AES_GROUP = 4,
767 KEY_AES_PAIRWISE = 5,
768 KEY_WEP_GROUP = 6,
769 KEY_TKIP_MIC_GROUP = 10,
770 KEY_TKIP_MIC_PAIRWISE = 11,
771};
772
773/*
774 *
775 * key_type_e key size key format
776 * ---------- --------- ----------
777 * 0x00 5, 13, 29 Key data
778 * 0x01 5, 13, 29 Key data
779 * 0x04 16 16 bytes of key data
780 * 0x05 16 16 bytes of key data
781 * 0x0a 32 16 bytes of TKIP key data
782 * 8 bytes of RX MIC key data
783 * 8 bytes of TX MIC key data
784 * 0x0b 32 16 bytes of TKIP key data
785 * 8 bytes of RX MIC key data
786 * 8 bytes of TX MIC key data
787 *
788 */
789
790struct acx_set_key {
791 /* Ignored for default WEP key */
792 u8 addr[ETH_ALEN];
793
794 /* key_action_e */
795 u16 key_action;
796
797 u16 reserved_1;
798
799 /* key size in bytes */
800 u8 key_size;
801
802 /* key_type_e */
803 u8 key_type;
804 u8 ssid_profile;
805
806 /*
807 * TKIP, AES: frame's key id field.
808 * For WEP default key: key id;
809 */
810 u8 id;
811 u8 reserved_2[6];
812 u8 key[MAX_KEY_SIZE];
813 u16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
814 u32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
815} __attribute__ ((packed));
816
817struct acx_current_tx_power { 734struct acx_current_tx_power {
818 struct acx_header header; 735 struct acx_header header;
819 736
@@ -839,26 +756,6 @@ struct acx_tsf_info {
839 u8 pad[3]; 756 u8 pad[3];
840} __attribute__ ((packed)); 757} __attribute__ ((packed));
841 758
842/* 802.11 PS */
843enum acx_ps_mode {
844 STATION_ACTIVE_MODE,
845 STATION_POWER_SAVE_MODE
846};
847
848struct acx_ps_params {
849 u8 ps_mode; /* STATION_* */
850 u8 send_null_data; /* Do we have to send NULL data packet ? */
851 u8 retries; /* Number of retires for the initial NULL data packet */
852
853 /*
854 * TUs during which the target stays awake after switching
855 * to power save mode.
856 */
857 u8 hang_over_period;
858 u16 null_data_rate;
859 u8 pad[2];
860} __attribute__ ((packed));
861
862enum acx_wake_up_event { 759enum acx_wake_up_event {
863 WAKE_UP_EVENT_BEACON_BITMAP = 0x01, /* Wake on every Beacon*/ 760 WAKE_UP_EVENT_BEACON_BITMAP = 0x01, /* Wake on every Beacon*/
864 WAKE_UP_EVENT_DTIM_BITMAP = 0x02, /* Wake on every DTIM*/ 761 WAKE_UP_EVENT_DTIM_BITMAP = 0x02, /* Wake on every DTIM*/
@@ -892,6 +789,7 @@ enum acx_preamble_type {
892 789
893struct acx_preamble { 790struct acx_preamble {
894 struct acx_header header; 791 struct acx_header header;
792
895 /* 793 /*
896 * When set, the WiLink transmits the frames with a short preamble and 794 * When set, the WiLink transmits the frames with a short preamble and
897 * when cleared, the WiLink transmits the frames with a long preamble. 795 * when cleared, the WiLink transmits the frames with a long preamble.
@@ -1219,7 +1117,8 @@ int wl12xx_acx_sleep_auth(struct wl12xx *wl, u8 sleep_auth);
1219int wl12xx_acx_fw_version(struct wl12xx *wl, char *buf, size_t len); 1117int wl12xx_acx_fw_version(struct wl12xx *wl, char *buf, size_t len);
1220int wl12xx_acx_tx_power(struct wl12xx *wl, int power); 1118int wl12xx_acx_tx_power(struct wl12xx *wl, int power);
1221int wl12xx_acx_feature_cfg(struct wl12xx *wl); 1119int wl12xx_acx_feature_cfg(struct wl12xx *wl);
1222int wl12xx_acx_mem_map(struct wl12xx *wl, void *mem_map, size_t len); 1120int wl12xx_acx_mem_map(struct wl12xx *wl,
1121 struct acx_header *mem_map, size_t len);
1223int wl12xx_acx_data_path_params(struct wl12xx *wl, 1122int wl12xx_acx_data_path_params(struct wl12xx *wl,
1224 struct acx_data_path_params_resp *data_path); 1123 struct acx_data_path_params_resp *data_path);
1225int wl12xx_acx_rx_msdu_life_time(struct wl12xx *wl, u32 life_time); 1124int wl12xx_acx_rx_msdu_life_time(struct wl12xx *wl, u32 life_time);
@@ -1241,5 +1140,6 @@ int wl12xx_acx_set_preamble(struct wl12xx *wl, enum acx_preamble_type preamble);
1241int wl12xx_acx_cts_protect(struct wl12xx *wl, 1140int wl12xx_acx_cts_protect(struct wl12xx *wl,
1242 enum acx_ctsprotect_type ctsprotect); 1141 enum acx_ctsprotect_type ctsprotect);
1243int wl12xx_acx_statistics(struct wl12xx *wl, struct acx_statistics *stats); 1142int wl12xx_acx_statistics(struct wl12xx *wl, struct acx_statistics *stats);
1143int wl12xx_acx_tsf_info(struct wl12xx *wl, u64 *mactime);
1244 1144
1245#endif /* __WL12XX_ACX_H__ */ 1145#endif /* __WL12XX_ACX_H__ */