2 * This file contains the function prototypes, data structure
3 * and defines for all the host/station commands
8 #include <linux/wireless.h>
12 /* 802.11-related definitions */
16 /* Current Tx packet status */
20 __le32 tx_packet_location;
21 /* Tx packet length */
22 __le16 tx_packet_length;
23 /* First 2 byte of destination MAC address */
24 u8 tx_dest_addr_high[2];
25 /* Last 4 byte of destination MAC address */
26 u8 tx_dest_addr_low[4];
29 /* Pkt Trasnit Power control */
31 /* Amount of time the packet has been queued in the driver (units = 2ms) */
39 /* Current Rx packet status */
60 /* Next Rx RxPD addr */
73 } __attribute__ ((packed));
75 struct cmd_ctrl_node {
76 struct list_head list;
78 /* command response */
79 int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *);
80 unsigned long callback_arg;
82 struct cmd_header *cmdbuf;
85 wait_queue_head_t cmdwait_q;
88 /* Generic structure to hold all key types. */
91 u16 flags; /* KEY_INFO_* from defs.h */
92 u16 type; /* KEY_TYPE_* from defs.h */
96 /* lbs_offset_value */
97 struct lbs_offset_value {
102 /* Define general data structure */
112 #define S_DS_GEN sizeof(struct cmd_ds_gen)
116 * Define data structure for CMD_GET_HW_SPEC
117 * This structure defines the response for the GET_HW_SPEC command
119 struct cmd_ds_get_hw_spec {
120 struct cmd_header hdr;
122 /* HW Interface version number */
124 /* HW version number */
126 /* Max number of TxPD FW can handle */
128 /* Max no of Multicast address */
136 /* Number of antenna used */
139 /* FW release number, example 0x01030304 = 2.3.4p1 */
142 /* Base Address of TxPD queue */
144 /* Read Pointer of RxPd queue */
147 /* Write Pointer of RxPd queue */
150 /*FW/HW capability */
152 } __attribute__ ((packed));
154 struct cmd_ds_802_11_subscribe_event {
155 struct cmd_header hdr;
160 /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a
161 * number of TLVs. From the v5.1 manual, those TLVs would add up to
162 * 40 bytes. However, future firmware might add additional TLVs, so I
163 * bump this up a bit.
169 * This scan handle Country Information IE(802.11d compliant)
170 * Define data structure for CMD_802_11_SCAN
172 struct cmd_ds_802_11_scan {
173 struct cmd_header hdr;
176 uint8_t bssid[ETH_ALEN];
177 uint8_t tlvbuffer[0];
179 mrvlietypes_ssidparamset_t ssidParamSet;
180 mrvlietypes_chanlistparamset_t ChanListParamSet;
181 mrvlietypes_ratesparamset_t OpRateSet;
185 struct cmd_ds_802_11_scan_rsp {
186 struct cmd_header hdr;
188 __le16 bssdescriptsize;
190 uint8_t bssdesc_and_tlvbuffer[0];
193 struct cmd_ds_802_11_get_log {
194 struct cmd_header hdr;
208 __le32 wepundecryptable;
211 struct cmd_ds_mac_control {
212 struct cmd_header hdr;
217 struct cmd_ds_mac_multicast_adr {
218 struct cmd_header hdr;
221 u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
224 struct cmd_ds_802_11_authenticate {
225 u8 macaddr[ETH_ALEN];
230 struct cmd_ds_802_11_deauthenticate {
231 struct cmd_header hdr;
233 u8 macaddr[ETH_ALEN];
237 struct cmd_ds_802_11_associate {
240 __le16 listeninterval;
245 mrvlietypes_ssidparamset_t ssidParamSet;
246 mrvlietypes_phyparamset_t phyparamset;
247 mrvlietypes_ssparamset_t ssparamset;
248 mrvlietypes_ratesparamset_t ratesParamSet;
250 } __attribute__ ((packed));
252 struct cmd_ds_802_11_associate_rsp {
253 struct ieeetypes_assocrsp assocRsp;
256 struct cmd_ds_802_11_set_wep {
257 struct cmd_header hdr;
259 /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
262 /* key Index selected for Tx */
265 /* 40, 128bit or TXWEP */
267 uint8_t keymaterial[4][16];
270 struct cmd_ds_802_3_get_stat {
279 struct cmd_ds_802_11_get_stat {
280 __le32 txfragmentcnt;
281 __le32 mcasttxframecnt;
284 __le32 Multipleretrycnt;
285 __le32 rtssuccesscnt;
286 __le32 rtsfailurecnt;
287 __le32 ackfailurecnt;
288 __le32 frameduplicatecnt;
289 __le32 rxfragmentcnt;
290 __le32 mcastrxframecnt;
292 __le32 bcasttxframecnt;
293 __le32 bcastrxframecnt;
296 __le32 wepundecryptable;
299 struct cmd_ds_802_11_snmp_mib {
300 struct cmd_header hdr;
308 struct cmd_ds_mac_reg_map {
314 struct cmd_ds_bbp_reg_map {
320 struct cmd_ds_rf_reg_map {
326 struct cmd_ds_mac_reg_access {
332 struct cmd_ds_bbp_reg_access {
339 struct cmd_ds_rf_reg_access {
346 struct cmd_ds_802_11_radio_control {
347 struct cmd_header hdr;
353 struct cmd_ds_802_11_beacon_control {
355 __le16 beacon_enable;
356 __le16 beacon_period;
359 struct cmd_ds_802_11_sleep_params {
360 struct cmd_header hdr;
362 /* ACT_GET/ACT_SET */
365 /* Sleep clock error in ppm */
368 /* Wakeup offset in usec */
371 /* Clock stabilization time in usec */
374 /* control periodic calibration */
377 /* control the use of external sleep clock */
378 uint8_t externalsleepclk;
380 /* reserved field, should be set to zero */
384 struct cmd_ds_802_11_inactivity_timeout {
385 struct cmd_header hdr;
387 /* ACT_GET/ACT_SET */
390 /* Inactivity timeout in msec */
394 struct cmd_ds_802_11_rf_channel {
395 struct cmd_header hdr;
399 __le16 rftype; /* unused */
400 __le16 reserved; /* unused */
401 u8 channellist[32]; /* unused */
404 struct cmd_ds_802_11_rssi {
405 /* weighting factor */
413 struct cmd_ds_802_11_rssi_rsp {
417 __le16 avgnoisefloor;
420 struct cmd_ds_802_11_mac_address {
421 struct cmd_header hdr;
427 struct cmd_ds_802_11_rf_tx_power {
428 struct cmd_header hdr;
436 struct cmd_ds_802_11_rf_antenna {
439 /* Number of antennas or 0xffff(diversity) */
444 struct cmd_ds_802_11_monitor_mode {
449 struct cmd_ds_set_boot2_ver {
450 struct cmd_header hdr;
456 struct cmd_ds_802_11_fw_wake_method {
457 struct cmd_header hdr;
463 struct cmd_ds_802_11_sleep_period {
464 struct cmd_header hdr;
470 struct cmd_ds_802_11_ps_mode {
472 __le16 nullpktinterval;
475 __le16 locallisteninterval;
478 struct cmd_confirm_sleep {
479 struct cmd_header hdr;
482 __le16 nullpktinterval;
485 __le16 locallisteninterval;
488 struct cmd_ds_802_11_data_rate {
489 struct cmd_header hdr;
496 struct cmd_ds_802_11_rate_adapt_rateset {
497 struct cmd_header hdr;
503 struct cmd_ds_802_11_ad_hoc_start {
504 struct cmd_header hdr;
506 u8 ssid[IW_ESSID_MAX_SIZE];
509 u8 dtimperiod; /* Reserved on v9 and later */
510 union IEEEtypes_ssparamset ssparamset;
511 union ieeetypes_phyparamset phyparamset;
515 u8 tlv_memory_size_pad[100];
516 } __attribute__ ((packed));
518 struct cmd_ds_802_11_ad_hoc_result {
519 struct cmd_header hdr;
525 struct adhoc_bssdesc {
527 u8 ssid[IW_ESSID_MAX_SIZE];
533 union ieeetypes_phyparamset phyparamset;
534 union IEEEtypes_ssparamset ssparamset;
538 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
539 * Adhoc join command and will cause a binary layout mismatch with
542 } __attribute__ ((packed));
544 struct cmd_ds_802_11_ad_hoc_join {
545 struct cmd_header hdr;
547 struct adhoc_bssdesc bss;
548 __le16 failtimeout; /* Reserved on v9 and later */
549 __le16 probedelay; /* Reserved on v9 and later */
550 } __attribute__ ((packed));
552 struct cmd_ds_802_11_ad_hoc_stop {
553 struct cmd_header hdr;
554 } __attribute__ ((packed));
556 struct cmd_ds_802_11_enable_rsn {
557 struct cmd_header hdr;
561 } __attribute__ ((packed));
563 struct MrvlIEtype_keyParamSet {
567 /* length of Payload */
570 /* type of key: WEP=0, TKIP=1, AES=2 */
573 /* key control Info specific to a keytypeid */
579 /* key material of size keylen */
583 struct cmd_ds_host_sleep {
584 struct cmd_header hdr;
588 } __attribute__ ((packed));
590 struct cmd_ds_802_11_key_material {
591 struct cmd_header hdr;
594 struct MrvlIEtype_keyParamSet keyParamSet[2];
595 } __attribute__ ((packed));
597 struct cmd_ds_802_11_eeprom_access {
598 struct cmd_header hdr;
602 /* firmware says it returns a maximum of 20 bytes */
603 #define LBS_EEPROM_READ_LEN 20
604 u8 value[LBS_EEPROM_READ_LEN];
605 } __attribute__ ((packed));
607 struct cmd_ds_802_11_tpc_cfg {
608 struct cmd_header hdr;
616 } __attribute__ ((packed));
619 struct cmd_ds_802_11_pa_cfg {
620 struct cmd_header hdr;
627 } __attribute__ ((packed));
630 struct cmd_ds_802_11_led_ctrl {
634 } __attribute__ ((packed));
636 struct cmd_ds_802_11_afc {
644 __le16 timing_offset; /* signed */
645 __le16 carrier_offset; /* signed */
648 } __attribute__ ((packed));
650 struct cmd_tx_rate_query {
652 } __attribute__ ((packed));
654 struct cmd_ds_get_tsf {
656 } __attribute__ ((packed));
658 struct cmd_ds_bt_access {
663 } __attribute__ ((packed));
665 struct cmd_ds_fwt_access {
683 } __attribute__ ((packed));
686 struct cmd_ds_mesh_config {
687 struct cmd_header hdr;
693 u8 data[128]; /* last position reserved */
694 } __attribute__ ((packed));
697 struct cmd_ds_mesh_access {
698 struct cmd_header hdr;
701 __le32 data[32]; /* last position reserved */
702 } __attribute__ ((packed));
704 /* Number of stats counters returned by the firmware */
705 #define MESH_STATS_NUM 8
707 struct cmd_ds_command {
716 struct cmd_ds_802_11_ps_mode psmode;
717 struct cmd_ds_802_11_associate associate;
718 struct cmd_ds_802_11_authenticate auth;
719 struct cmd_ds_802_11_get_stat gstat;
720 struct cmd_ds_802_3_get_stat gstat_8023;
721 struct cmd_ds_802_11_rf_antenna rant;
722 struct cmd_ds_802_11_monitor_mode monitor;
723 struct cmd_ds_802_11_rssi rssi;
724 struct cmd_ds_802_11_rssi_rsp rssirsp;
725 struct cmd_ds_mac_reg_access macreg;
726 struct cmd_ds_bbp_reg_access bbpreg;
727 struct cmd_ds_rf_reg_access rfreg;
729 struct cmd_ds_802_11d_domain_info domaininfo;
730 struct cmd_ds_802_11d_domain_info domaininforesp;
732 struct cmd_ds_802_11_tpc_cfg tpccfg;
733 struct cmd_ds_802_11_afc afc;
734 struct cmd_ds_802_11_led_ctrl ledgpio;
736 struct cmd_tx_rate_query txrate;
737 struct cmd_ds_bt_access bt;
738 struct cmd_ds_fwt_access fwt;
739 struct cmd_ds_get_tsf gettsf;
740 struct cmd_ds_802_11_beacon_control bcn_ctrl;
742 } __attribute__ ((packed));