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 {
210 __le32 wepundecryptable;
213 struct cmd_ds_mac_control {
214 struct cmd_header hdr;
219 struct cmd_ds_mac_multicast_adr {
222 u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
225 struct cmd_ds_802_11_authenticate {
226 u8 macaddr[ETH_ALEN];
231 struct cmd_ds_802_11_deauthenticate {
236 struct cmd_ds_802_11_associate {
239 __le16 listeninterval;
244 mrvlietypes_ssidparamset_t ssidParamSet;
245 mrvlietypes_phyparamset_t phyparamset;
246 mrvlietypes_ssparamset_t ssparamset;
247 mrvlietypes_ratesparamset_t ratesParamSet;
249 } __attribute__ ((packed));
251 struct cmd_ds_802_11_disassociate {
256 struct cmd_ds_802_11_associate_rsp {
257 struct ieeetypes_assocrsp assocRsp;
260 struct cmd_ds_802_11_ad_hoc_result {
265 struct cmd_ds_802_11_set_wep {
266 struct cmd_header hdr;
268 /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
271 /* key Index selected for Tx */
274 /* 40, 128bit or TXWEP */
276 uint8_t keymaterial[4][16];
279 struct cmd_ds_802_3_get_stat {
288 struct cmd_ds_802_11_get_stat {
289 __le32 txfragmentcnt;
290 __le32 mcasttxframecnt;
293 __le32 Multipleretrycnt;
294 __le32 rtssuccesscnt;
295 __le32 rtsfailurecnt;
296 __le32 ackfailurecnt;
297 __le32 frameduplicatecnt;
298 __le32 rxfragmentcnt;
299 __le32 mcastrxframecnt;
301 __le32 bcasttxframecnt;
302 __le32 bcastrxframecnt;
305 __le32 wepundecryptable;
308 struct cmd_ds_802_11_snmp_mib {
315 struct cmd_ds_mac_reg_map {
321 struct cmd_ds_bbp_reg_map {
327 struct cmd_ds_rf_reg_map {
333 struct cmd_ds_mac_reg_access {
339 struct cmd_ds_bbp_reg_access {
346 struct cmd_ds_rf_reg_access {
353 struct cmd_ds_802_11_radio_control {
354 struct cmd_header hdr;
360 struct cmd_ds_802_11_beacon_control {
362 __le16 beacon_enable;
363 __le16 beacon_period;
366 struct cmd_ds_802_11_sleep_params {
367 struct cmd_header hdr;
369 /* ACT_GET/ACT_SET */
372 /* Sleep clock error in ppm */
375 /* Wakeup offset in usec */
378 /* Clock stabilization time in usec */
381 /* control periodic calibration */
384 /* control the use of external sleep clock */
385 uint8_t externalsleepclk;
387 /* reserved field, should be set to zero */
391 struct cmd_ds_802_11_inactivity_timeout {
392 struct cmd_header hdr;
394 /* ACT_GET/ACT_SET */
397 /* Inactivity timeout in msec */
401 struct cmd_ds_802_11_rf_channel {
402 struct cmd_header hdr;
406 __le16 rftype; /* unused */
407 __le16 reserved; /* unused */
408 u8 channellist[32]; /* unused */
411 struct cmd_ds_802_11_rssi {
412 /* weighting factor */
420 struct cmd_ds_802_11_rssi_rsp {
424 __le16 avgnoisefloor;
427 struct cmd_ds_802_11_mac_address {
432 struct cmd_ds_802_11_rf_tx_power {
437 struct cmd_ds_802_11_rf_antenna {
440 /* Number of antennas or 0xffff(diversity) */
445 struct cmd_ds_802_11_monitor_mode {
450 struct cmd_ds_set_boot2_ver {
451 struct cmd_header hdr;
457 struct cmd_ds_802_11_fw_wake_method {
458 struct cmd_header hdr;
464 struct cmd_ds_802_11_sleep_period {
465 struct cmd_header hdr;
471 struct cmd_ds_802_11_ps_mode {
473 __le16 nullpktinterval;
476 __le16 locallisteninterval;
479 struct PS_CMD_ConfirmSleep {
489 __le16 locallisteninterval;
492 struct cmd_ds_802_11_data_rate {
493 struct cmd_header hdr;
500 struct cmd_ds_802_11_rate_adapt_rateset {
506 struct cmd_ds_802_11_ad_hoc_start {
507 u8 ssid[IW_ESSID_MAX_SIZE];
511 union IEEEtypes_ssparamset ssparamset;
512 union ieeetypes_phyparamset phyparamset;
516 u8 tlv_memory_size_pad[100];
517 } __attribute__ ((packed));
519 struct adhoc_bssdesc {
527 union ieeetypes_phyparamset phyparamset;
528 union IEEEtypes_ssparamset ssparamset;
532 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
533 * Adhoc join command and will cause a binary layout mismatch with
536 } __attribute__ ((packed));
538 struct cmd_ds_802_11_ad_hoc_join {
539 struct adhoc_bssdesc bss;
543 } __attribute__ ((packed));
545 struct cmd_ds_802_11_enable_rsn {
546 struct cmd_header hdr;
550 } __attribute__ ((packed));
552 struct MrvlIEtype_keyParamSet {
556 /* length of Payload */
559 /* type of key: WEP=0, TKIP=1, AES=2 */
562 /* key control Info specific to a keytypeid */
568 /* key material of size keylen */
572 struct cmd_ds_host_sleep {
573 struct cmd_header hdr;
577 } __attribute__ ((packed));
579 struct cmd_ds_802_11_key_material {
580 struct cmd_header hdr;
583 struct MrvlIEtype_keyParamSet keyParamSet[2];
584 } __attribute__ ((packed));
586 struct cmd_ds_802_11_eeprom_access {
593 } __attribute__ ((packed));
595 struct cmd_ds_802_11_tpc_cfg {
602 } __attribute__ ((packed));
604 struct cmd_ds_802_11_led_ctrl {
608 } __attribute__ ((packed));
610 struct cmd_ds_802_11_pwr_cfg {
616 } __attribute__ ((packed));
618 struct cmd_ds_802_11_afc {
626 __le16 timing_offset; /* signed */
627 __le16 carrier_offset; /* signed */
630 } __attribute__ ((packed));
632 struct cmd_tx_rate_query {
634 } __attribute__ ((packed));
636 struct cmd_ds_get_tsf {
638 } __attribute__ ((packed));
640 struct cmd_ds_bt_access {
645 } __attribute__ ((packed));
647 struct cmd_ds_fwt_access {
665 } __attribute__ ((packed));
668 struct cmd_ds_mesh_config {
669 struct cmd_header hdr;
675 u8 data[128]; /* last position reserved */
676 } __attribute__ ((packed));
679 struct cmd_ds_mesh_access {
680 struct cmd_header hdr;
683 __le32 data[32]; /* last position reserved */
684 } __attribute__ ((packed));
686 /* Number of stats counters returned by the firmware */
687 #define MESH_STATS_NUM 8
689 struct cmd_ds_command {
698 struct cmd_ds_802_11_ps_mode psmode;
699 struct cmd_ds_802_11_associate associate;
700 struct cmd_ds_802_11_deauthenticate deauth;
701 struct cmd_ds_802_11_ad_hoc_start ads;
702 struct cmd_ds_802_11_reset reset;
703 struct cmd_ds_802_11_ad_hoc_result result;
704 struct cmd_ds_802_11_get_log glog;
705 struct cmd_ds_802_11_authenticate auth;
706 struct cmd_ds_802_11_get_stat gstat;
707 struct cmd_ds_802_3_get_stat gstat_8023;
708 struct cmd_ds_802_11_snmp_mib smib;
709 struct cmd_ds_802_11_rf_tx_power txp;
710 struct cmd_ds_802_11_rf_antenna rant;
711 struct cmd_ds_802_11_monitor_mode monitor;
712 struct cmd_ds_802_11_rate_adapt_rateset rateset;
713 struct cmd_ds_mac_multicast_adr madr;
714 struct cmd_ds_802_11_ad_hoc_join adj;
715 struct cmd_ds_802_11_rssi rssi;
716 struct cmd_ds_802_11_rssi_rsp rssirsp;
717 struct cmd_ds_802_11_disassociate dassociate;
718 struct cmd_ds_802_11_mac_address macadd;
719 struct cmd_ds_mac_reg_access macreg;
720 struct cmd_ds_bbp_reg_access bbpreg;
721 struct cmd_ds_rf_reg_access rfreg;
722 struct cmd_ds_802_11_eeprom_access rdeeprom;
724 struct cmd_ds_802_11d_domain_info domaininfo;
725 struct cmd_ds_802_11d_domain_info domaininforesp;
727 struct cmd_ds_802_11_tpc_cfg tpccfg;
728 struct cmd_ds_802_11_pwr_cfg pwrcfg;
729 struct cmd_ds_802_11_afc afc;
730 struct cmd_ds_802_11_led_ctrl ledgpio;
732 struct cmd_tx_rate_query txrate;
733 struct cmd_ds_bt_access bt;
734 struct cmd_ds_fwt_access fwt;
735 struct cmd_ds_get_tsf gettsf;
736 struct cmd_ds_802_11_beacon_control bcn_ctrl;
738 } __attribute__ ((packed));