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_reset {
158 struct cmd_ds_802_11_subscribe_event {
159 struct cmd_header hdr;
164 /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a
165 * number of TLVs. From the v5.1 manual, those TLVs would add up to
166 * 40 bytes. However, future firmware might add additional TLVs, so I
167 * bump this up a bit.
173 * This scan handle Country Information IE(802.11d compliant)
174 * Define data structure for CMD_802_11_SCAN
176 struct cmd_ds_802_11_scan {
177 struct cmd_header hdr;
180 uint8_t bssid[ETH_ALEN];
181 uint8_t tlvbuffer[0];
183 mrvlietypes_ssidparamset_t ssidParamSet;
184 mrvlietypes_chanlistparamset_t ChanListParamSet;
185 mrvlietypes_ratesparamset_t OpRateSet;
189 struct cmd_ds_802_11_scan_rsp {
190 struct cmd_header hdr;
192 __le16 bssdescriptsize;
194 uint8_t bssdesc_and_tlvbuffer[0];
197 struct cmd_ds_802_11_get_log {
198 struct cmd_header hdr;
212 __le32 wepundecryptable;
215 struct cmd_ds_mac_control {
216 struct cmd_header hdr;
221 struct cmd_ds_mac_multicast_adr {
224 u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
227 struct cmd_ds_802_11_authenticate {
228 u8 macaddr[ETH_ALEN];
233 struct cmd_ds_802_11_deauthenticate {
238 struct cmd_ds_802_11_associate {
241 __le16 listeninterval;
246 mrvlietypes_ssidparamset_t ssidParamSet;
247 mrvlietypes_phyparamset_t phyparamset;
248 mrvlietypes_ssparamset_t ssparamset;
249 mrvlietypes_ratesparamset_t ratesParamSet;
251 } __attribute__ ((packed));
253 struct cmd_ds_802_11_disassociate {
258 struct cmd_ds_802_11_associate_rsp {
259 struct ieeetypes_assocrsp assocRsp;
262 struct cmd_ds_802_11_ad_hoc_result {
267 struct cmd_ds_802_11_set_wep {
268 struct cmd_header hdr;
270 /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
273 /* key Index selected for Tx */
276 /* 40, 128bit or TXWEP */
278 uint8_t keymaterial[4][16];
281 struct cmd_ds_802_3_get_stat {
290 struct cmd_ds_802_11_get_stat {
291 __le32 txfragmentcnt;
292 __le32 mcasttxframecnt;
295 __le32 Multipleretrycnt;
296 __le32 rtssuccesscnt;
297 __le32 rtsfailurecnt;
298 __le32 ackfailurecnt;
299 __le32 frameduplicatecnt;
300 __le32 rxfragmentcnt;
301 __le32 mcastrxframecnt;
303 __le32 bcasttxframecnt;
304 __le32 bcastrxframecnt;
307 __le32 wepundecryptable;
310 struct cmd_ds_802_11_snmp_mib {
317 struct cmd_ds_mac_reg_map {
323 struct cmd_ds_bbp_reg_map {
329 struct cmd_ds_rf_reg_map {
335 struct cmd_ds_mac_reg_access {
341 struct cmd_ds_bbp_reg_access {
348 struct cmd_ds_rf_reg_access {
355 struct cmd_ds_802_11_radio_control {
356 struct cmd_header hdr;
362 struct cmd_ds_802_11_beacon_control {
364 __le16 beacon_enable;
365 __le16 beacon_period;
368 struct cmd_ds_802_11_sleep_params {
369 struct cmd_header hdr;
371 /* ACT_GET/ACT_SET */
374 /* Sleep clock error in ppm */
377 /* Wakeup offset in usec */
380 /* Clock stabilization time in usec */
383 /* control periodic calibration */
386 /* control the use of external sleep clock */
387 uint8_t externalsleepclk;
389 /* reserved field, should be set to zero */
393 struct cmd_ds_802_11_inactivity_timeout {
394 struct cmd_header hdr;
396 /* ACT_GET/ACT_SET */
399 /* Inactivity timeout in msec */
403 struct cmd_ds_802_11_rf_channel {
404 struct cmd_header hdr;
408 __le16 rftype; /* unused */
409 __le16 reserved; /* unused */
410 u8 channellist[32]; /* unused */
413 struct cmd_ds_802_11_rssi {
414 /* weighting factor */
422 struct cmd_ds_802_11_rssi_rsp {
426 __le16 avgnoisefloor;
429 struct cmd_ds_802_11_mac_address {
434 struct cmd_ds_802_11_rf_tx_power {
439 struct cmd_ds_802_11_rf_antenna {
442 /* Number of antennas or 0xffff(diversity) */
447 struct cmd_ds_802_11_monitor_mode {
452 struct cmd_ds_set_boot2_ver {
453 struct cmd_header hdr;
459 struct cmd_ds_802_11_fw_wake_method {
460 struct cmd_header hdr;
466 struct cmd_ds_802_11_sleep_period {
467 struct cmd_header hdr;
473 struct cmd_ds_802_11_ps_mode {
475 __le16 nullpktinterval;
478 __le16 locallisteninterval;
481 struct PS_CMD_ConfirmSleep {
491 __le16 locallisteninterval;
494 struct cmd_ds_802_11_data_rate {
495 struct cmd_header hdr;
502 struct cmd_ds_802_11_rate_adapt_rateset {
508 struct cmd_ds_802_11_ad_hoc_start {
509 u8 ssid[IW_ESSID_MAX_SIZE];
513 union IEEEtypes_ssparamset ssparamset;
514 union ieeetypes_phyparamset phyparamset;
518 u8 tlv_memory_size_pad[100];
519 } __attribute__ ((packed));
521 struct adhoc_bssdesc {
529 union ieeetypes_phyparamset phyparamset;
530 union IEEEtypes_ssparamset ssparamset;
534 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
535 * Adhoc join command and will cause a binary layout mismatch with
538 } __attribute__ ((packed));
540 struct cmd_ds_802_11_ad_hoc_join {
541 struct adhoc_bssdesc bss;
545 } __attribute__ ((packed));
547 struct cmd_ds_802_11_enable_rsn {
548 struct cmd_header hdr;
552 } __attribute__ ((packed));
554 struct MrvlIEtype_keyParamSet {
558 /* length of Payload */
561 /* type of key: WEP=0, TKIP=1, AES=2 */
564 /* key control Info specific to a keytypeid */
570 /* key material of size keylen */
574 struct cmd_ds_host_sleep {
575 struct cmd_header hdr;
579 } __attribute__ ((packed));
581 struct cmd_ds_802_11_key_material {
582 struct cmd_header hdr;
585 struct MrvlIEtype_keyParamSet keyParamSet[2];
586 } __attribute__ ((packed));
588 struct cmd_ds_802_11_eeprom_access {
595 } __attribute__ ((packed));
597 struct cmd_ds_802_11_tpc_cfg {
604 } __attribute__ ((packed));
606 struct cmd_ds_802_11_led_ctrl {
610 } __attribute__ ((packed));
612 struct cmd_ds_802_11_pwr_cfg {
618 } __attribute__ ((packed));
620 struct cmd_ds_802_11_afc {
628 __le16 timing_offset; /* signed */
629 __le16 carrier_offset; /* signed */
632 } __attribute__ ((packed));
634 struct cmd_tx_rate_query {
636 } __attribute__ ((packed));
638 struct cmd_ds_get_tsf {
640 } __attribute__ ((packed));
642 struct cmd_ds_bt_access {
647 } __attribute__ ((packed));
649 struct cmd_ds_fwt_access {
667 } __attribute__ ((packed));
670 struct cmd_ds_mesh_config {
671 struct cmd_header hdr;
677 u8 data[128]; /* last position reserved */
678 } __attribute__ ((packed));
681 struct cmd_ds_mesh_access {
682 struct cmd_header hdr;
685 __le32 data[32]; /* last position reserved */
686 } __attribute__ ((packed));
688 /* Number of stats counters returned by the firmware */
689 #define MESH_STATS_NUM 8
691 struct cmd_ds_command {
700 struct cmd_ds_802_11_ps_mode psmode;
701 struct cmd_ds_802_11_associate associate;
702 struct cmd_ds_802_11_deauthenticate deauth;
703 struct cmd_ds_802_11_ad_hoc_start ads;
704 struct cmd_ds_802_11_reset reset;
705 struct cmd_ds_802_11_ad_hoc_result result;
706 struct cmd_ds_802_11_authenticate auth;
707 struct cmd_ds_802_11_get_stat gstat;
708 struct cmd_ds_802_3_get_stat gstat_8023;
709 struct cmd_ds_802_11_snmp_mib smib;
710 struct cmd_ds_802_11_rf_tx_power txp;
711 struct cmd_ds_802_11_rf_antenna rant;
712 struct cmd_ds_802_11_monitor_mode monitor;
713 struct cmd_ds_802_11_rate_adapt_rateset rateset;
714 struct cmd_ds_mac_multicast_adr madr;
715 struct cmd_ds_802_11_ad_hoc_join adj;
716 struct cmd_ds_802_11_rssi rssi;
717 struct cmd_ds_802_11_rssi_rsp rssirsp;
718 struct cmd_ds_802_11_disassociate dassociate;
719 struct cmd_ds_802_11_mac_address macadd;
720 struct cmd_ds_mac_reg_access macreg;
721 struct cmd_ds_bbp_reg_access bbpreg;
722 struct cmd_ds_rf_reg_access rfreg;
723 struct cmd_ds_802_11_eeprom_access rdeeprom;
725 struct cmd_ds_802_11d_domain_info domaininfo;
726 struct cmd_ds_802_11d_domain_info domaininforesp;
728 struct cmd_ds_802_11_tpc_cfg tpccfg;
729 struct cmd_ds_802_11_pwr_cfg pwrcfg;
730 struct cmd_ds_802_11_afc afc;
731 struct cmd_ds_802_11_led_ctrl ledgpio;
733 struct cmd_tx_rate_query txrate;
734 struct cmd_ds_bt_access bt;
735 struct cmd_ds_fwt_access fwt;
736 struct cmd_ds_get_tsf gettsf;
737 struct cmd_ds_802_11_beacon_control bcn_ctrl;
739 } __attribute__ ((packed));