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 /* union to cope up with later FW revisions */
18 /* Current Tx packet status */
21 /* BSS type: client, AP, etc. */
31 __le32 tx_packet_location;
32 /* Tx packet length */
33 __le16 tx_packet_length;
34 /* First 2 byte of destination MAC address */
35 u8 tx_dest_addr_high[2];
36 /* Last 4 byte of destination MAC address */
37 u8 tx_dest_addr_low[4];
40 /* Pkt Trasnit Power control */
42 /* Amount of time the packet has been queued in the driver (units = 2ms) */
46 } __attribute__ ((packed));
50 /* union to cope up with later FW revisions */
52 /* Current Rx packet status */
55 /* BSS type: client, AP, etc. */
80 /* Next Rx RxPD addr */
86 } __attribute__ ((packed));
93 } __attribute__ ((packed));
95 struct cmd_ctrl_node {
96 struct list_head list;
98 /* command response */
99 int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *);
100 unsigned long callback_arg;
102 struct cmd_header *cmdbuf;
105 wait_queue_head_t cmdwait_q;
108 /* Generic structure to hold all key types. */
111 u16 flags; /* KEY_INFO_* from defs.h */
112 u16 type; /* KEY_TYPE_* from defs.h */
116 /* lbs_offset_value */
117 struct lbs_offset_value {
120 } __attribute__ ((packed));
122 /* Define general data structure */
130 } __attribute__ ((packed));
132 #define S_DS_GEN sizeof(struct cmd_ds_gen)
136 * Define data structure for CMD_GET_HW_SPEC
137 * This structure defines the response for the GET_HW_SPEC command
139 struct cmd_ds_get_hw_spec {
140 struct cmd_header hdr;
142 /* HW Interface version number */
144 /* HW version number */
146 /* Max number of TxPD FW can handle */
148 /* Max no of Multicast address */
156 /* Number of antenna used */
159 /* FW release number, example 0x01030304 = 2.3.4p1 */
162 /* Base Address of TxPD queue */
164 /* Read Pointer of RxPd queue */
167 /* Write Pointer of RxPd queue */
170 /*FW/HW capability */
172 } __attribute__ ((packed));
174 struct cmd_ds_802_11_subscribe_event {
175 struct cmd_header hdr;
180 /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a
181 * number of TLVs. From the v5.1 manual, those TLVs would add up to
182 * 40 bytes. However, future firmware might add additional TLVs, so I
183 * bump this up a bit.
186 } __attribute__ ((packed));
189 * This scan handle Country Information IE(802.11d compliant)
190 * Define data structure for CMD_802_11_SCAN
192 struct cmd_ds_802_11_scan {
193 struct cmd_header hdr;
196 uint8_t bssid[ETH_ALEN];
197 uint8_t tlvbuffer[0];
199 mrvlietypes_ssidparamset_t ssidParamSet;
200 mrvlietypes_chanlistparamset_t ChanListParamSet;
201 mrvlietypes_ratesparamset_t OpRateSet;
203 } __attribute__ ((packed));
205 struct cmd_ds_802_11_scan_rsp {
206 struct cmd_header hdr;
208 __le16 bssdescriptsize;
210 uint8_t bssdesc_and_tlvbuffer[0];
211 } __attribute__ ((packed));
213 struct cmd_ds_802_11_get_log {
214 struct cmd_header hdr;
228 __le32 wepundecryptable;
229 } __attribute__ ((packed));
231 struct cmd_ds_mac_control {
232 struct cmd_header hdr;
235 } __attribute__ ((packed));
237 struct cmd_ds_mac_multicast_adr {
238 struct cmd_header hdr;
241 u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
242 } __attribute__ ((packed));
244 struct cmd_ds_gspi_bus_config {
245 struct cmd_header hdr;
247 __le16 bus_delay_mode;
248 __le16 host_time_delay_to_read_port;
249 __le16 host_time_delay_to_read_register;
250 } __attribute__ ((packed));
252 struct cmd_ds_802_11_authenticate {
253 struct cmd_header hdr;
258 } __attribute__ ((packed));
260 struct cmd_ds_802_11_deauthenticate {
261 struct cmd_header hdr;
263 u8 macaddr[ETH_ALEN];
265 } __attribute__ ((packed));
267 struct cmd_ds_802_11_associate {
268 struct cmd_header hdr;
272 __le16 listeninterval;
275 u8 iebuf[512]; /* Enough for required and most optional IEs */
276 } __attribute__ ((packed));
278 struct cmd_ds_802_11_associate_response {
279 struct cmd_header hdr;
285 } __attribute__ ((packed));
287 struct cmd_ds_802_11_set_wep {
288 struct cmd_header hdr;
290 /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
293 /* key Index selected for Tx */
296 /* 40, 128bit or TXWEP */
298 uint8_t keymaterial[4][16];
299 } __attribute__ ((packed));
301 struct cmd_ds_802_3_get_stat {
308 } __attribute__ ((packed));
310 struct cmd_ds_802_11_get_stat {
311 __le32 txfragmentcnt;
312 __le32 mcasttxframecnt;
315 __le32 Multipleretrycnt;
316 __le32 rtssuccesscnt;
317 __le32 rtsfailurecnt;
318 __le32 ackfailurecnt;
319 __le32 frameduplicatecnt;
320 __le32 rxfragmentcnt;
321 __le32 mcastrxframecnt;
323 __le32 bcasttxframecnt;
324 __le32 bcastrxframecnt;
327 __le32 wepundecryptable;
328 } __attribute__ ((packed));
330 struct cmd_ds_802_11_snmp_mib {
331 struct cmd_header hdr;
337 } __attribute__ ((packed));
339 struct cmd_ds_mac_reg_map {
343 } __attribute__ ((packed));
345 struct cmd_ds_bbp_reg_map {
349 } __attribute__ ((packed));
351 struct cmd_ds_rf_reg_map {
355 } __attribute__ ((packed));
357 struct cmd_ds_mac_reg_access {
361 } __attribute__ ((packed));
363 struct cmd_ds_bbp_reg_access {
368 } __attribute__ ((packed));
370 struct cmd_ds_rf_reg_access {
375 } __attribute__ ((packed));
377 struct cmd_ds_802_11_radio_control {
378 struct cmd_header hdr;
382 } __attribute__ ((packed));
384 struct cmd_ds_802_11_beacon_control {
386 __le16 beacon_enable;
387 __le16 beacon_period;
388 } __attribute__ ((packed));
390 struct cmd_ds_802_11_sleep_params {
391 struct cmd_header hdr;
393 /* ACT_GET/ACT_SET */
396 /* Sleep clock error in ppm */
399 /* Wakeup offset in usec */
402 /* Clock stabilization time in usec */
405 /* control periodic calibration */
408 /* control the use of external sleep clock */
409 uint8_t externalsleepclk;
411 /* reserved field, should be set to zero */
413 } __attribute__ ((packed));
415 struct cmd_ds_802_11_inactivity_timeout {
416 struct cmd_header hdr;
418 /* ACT_GET/ACT_SET */
421 /* Inactivity timeout in msec */
423 } __attribute__ ((packed));
425 struct cmd_ds_802_11_rf_channel {
426 struct cmd_header hdr;
430 __le16 rftype; /* unused */
431 __le16 reserved; /* unused */
432 u8 channellist[32]; /* unused */
433 } __attribute__ ((packed));
435 struct cmd_ds_802_11_rssi {
436 /* weighting factor */
442 } __attribute__ ((packed));
444 struct cmd_ds_802_11_rssi_rsp {
448 __le16 avgnoisefloor;
449 } __attribute__ ((packed));
451 struct cmd_ds_802_11_mac_address {
452 struct cmd_header hdr;
456 } __attribute__ ((packed));
458 struct cmd_ds_802_11_rf_tx_power {
459 struct cmd_header hdr;
465 } __attribute__ ((packed));
467 struct cmd_ds_802_11_rf_antenna {
470 /* Number of antennas or 0xffff(diversity) */
473 } __attribute__ ((packed));
475 struct cmd_ds_802_11_monitor_mode {
478 } __attribute__ ((packed));
480 struct cmd_ds_set_boot2_ver {
481 struct cmd_header hdr;
485 } __attribute__ ((packed));
487 struct cmd_ds_802_11_fw_wake_method {
488 struct cmd_header hdr;
492 } __attribute__ ((packed));
494 struct cmd_ds_802_11_sleep_period {
495 struct cmd_header hdr;
499 } __attribute__ ((packed));
501 struct cmd_ds_802_11_ps_mode {
503 __le16 nullpktinterval;
506 __le16 locallisteninterval;
507 } __attribute__ ((packed));
509 struct cmd_confirm_sleep {
510 struct cmd_header hdr;
513 __le16 nullpktinterval;
516 __le16 locallisteninterval;
517 } __attribute__ ((packed));
519 struct cmd_ds_802_11_data_rate {
520 struct cmd_header hdr;
525 } __attribute__ ((packed));
527 struct cmd_ds_802_11_rate_adapt_rateset {
528 struct cmd_header hdr;
532 } __attribute__ ((packed));
534 struct cmd_ds_802_11_ad_hoc_start {
535 struct cmd_header hdr;
537 u8 ssid[IW_ESSID_MAX_SIZE];
540 u8 dtimperiod; /* Reserved on v9 and later */
541 struct ieee_ie_ibss_param_set ibss;
543 struct ieee_ie_ds_param_set ds;
545 __le16 probedelay; /* Reserved on v9 and later */
548 u8 tlv_memory_size_pad[100];
549 } __attribute__ ((packed));
551 struct cmd_ds_802_11_ad_hoc_result {
552 struct cmd_header hdr;
556 } __attribute__ ((packed));
558 struct adhoc_bssdesc {
560 u8 ssid[IW_ESSID_MAX_SIZE];
566 struct ieee_ie_ds_param_set ds;
568 struct ieee_ie_ibss_param_set ibss;
573 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
574 * Adhoc join command and will cause a binary layout mismatch with
577 } __attribute__ ((packed));
579 struct cmd_ds_802_11_ad_hoc_join {
580 struct cmd_header hdr;
582 struct adhoc_bssdesc bss;
583 __le16 failtimeout; /* Reserved on v9 and later */
584 __le16 probedelay; /* Reserved on v9 and later */
585 } __attribute__ ((packed));
587 struct cmd_ds_802_11_ad_hoc_stop {
588 struct cmd_header hdr;
589 } __attribute__ ((packed));
591 struct cmd_ds_802_11_enable_rsn {
592 struct cmd_header hdr;
596 } __attribute__ ((packed));
598 struct MrvlIEtype_keyParamSet {
602 /* length of Payload */
605 /* type of key: WEP=0, TKIP=1, AES=2 */
608 /* key control Info specific to a keytypeid */
614 /* key material of size keylen */
616 } __attribute__ ((packed));
618 #define MAX_WOL_RULES 16
620 struct host_wol_rule {
628 } __attribute__ ((packed));
633 uint8_t no_rules_in_cmd;
635 struct host_wol_rule rule[MAX_WOL_RULES];
636 } __attribute__ ((packed));
638 struct cmd_ds_host_sleep {
639 struct cmd_header hdr;
643 struct wol_config wol_conf;
644 } __attribute__ ((packed));
648 struct cmd_ds_802_11_key_material {
649 struct cmd_header hdr;
652 struct MrvlIEtype_keyParamSet keyParamSet[2];
653 } __attribute__ ((packed));
655 struct cmd_ds_802_11_eeprom_access {
656 struct cmd_header hdr;
660 /* firmware says it returns a maximum of 20 bytes */
661 #define LBS_EEPROM_READ_LEN 20
662 u8 value[LBS_EEPROM_READ_LEN];
663 } __attribute__ ((packed));
665 struct cmd_ds_802_11_tpc_cfg {
666 struct cmd_header hdr;
674 } __attribute__ ((packed));
677 struct cmd_ds_802_11_pa_cfg {
678 struct cmd_header hdr;
685 } __attribute__ ((packed));
688 struct cmd_ds_802_11_led_ctrl {
692 } __attribute__ ((packed));
694 struct cmd_ds_802_11_afc {
702 __le16 timing_offset; /* signed */
703 __le16 carrier_offset; /* signed */
706 } __attribute__ ((packed));
708 struct cmd_tx_rate_query {
710 } __attribute__ ((packed));
712 struct cmd_ds_get_tsf {
714 } __attribute__ ((packed));
716 struct cmd_ds_bt_access {
721 } __attribute__ ((packed));
723 struct cmd_ds_fwt_access {
741 } __attribute__ ((packed));
744 struct cmd_ds_mesh_config {
745 struct cmd_header hdr;
751 u8 data[128]; /* last position reserved */
752 } __attribute__ ((packed));
755 struct cmd_ds_mesh_access {
756 struct cmd_header hdr;
759 __le32 data[32]; /* last position reserved */
760 } __attribute__ ((packed));
762 /* Number of stats counters returned by the firmware */
763 #define MESH_STATS_NUM 8
765 struct cmd_ds_command {
774 struct cmd_ds_802_11_ps_mode psmode;
775 struct cmd_ds_802_11_get_stat gstat;
776 struct cmd_ds_802_3_get_stat gstat_8023;
777 struct cmd_ds_802_11_rf_antenna rant;
778 struct cmd_ds_802_11_monitor_mode monitor;
779 struct cmd_ds_802_11_rssi rssi;
780 struct cmd_ds_802_11_rssi_rsp rssirsp;
781 struct cmd_ds_mac_reg_access macreg;
782 struct cmd_ds_bbp_reg_access bbpreg;
783 struct cmd_ds_rf_reg_access rfreg;
785 struct cmd_ds_802_11d_domain_info domaininfo;
786 struct cmd_ds_802_11d_domain_info domaininforesp;
788 struct cmd_ds_802_11_tpc_cfg tpccfg;
789 struct cmd_ds_802_11_afc afc;
790 struct cmd_ds_802_11_led_ctrl ledgpio;
792 struct cmd_tx_rate_query txrate;
793 struct cmd_ds_bt_access bt;
794 struct cmd_ds_fwt_access fwt;
795 struct cmd_ds_get_tsf gettsf;
796 struct cmd_ds_802_11_beacon_control bcn_ctrl;
798 } __attribute__ ((packed));