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 u8 macaddr[ETH_ALEN];
256 } __attribute__ ((packed));
258 struct cmd_ds_802_11_deauthenticate {
259 struct cmd_header hdr;
261 u8 macaddr[ETH_ALEN];
263 } __attribute__ ((packed));
265 struct cmd_ds_802_11_associate {
268 __le16 listeninterval;
273 mrvlietypes_ssidparamset_t ssidParamSet;
274 mrvlietypes_phyparamset_t phyparamset;
275 mrvlietypes_ssparamset_t ssparamset;
276 mrvlietypes_ratesparamset_t ratesParamSet;
278 } __attribute__ ((packed));
280 struct cmd_ds_802_11_associate_rsp {
281 struct ieee_assoc_response response;
282 } __attribute__ ((packed));
284 struct cmd_ds_802_11_set_wep {
285 struct cmd_header hdr;
287 /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
290 /* key Index selected for Tx */
293 /* 40, 128bit or TXWEP */
295 uint8_t keymaterial[4][16];
296 } __attribute__ ((packed));
298 struct cmd_ds_802_3_get_stat {
305 } __attribute__ ((packed));
307 struct cmd_ds_802_11_get_stat {
308 __le32 txfragmentcnt;
309 __le32 mcasttxframecnt;
312 __le32 Multipleretrycnt;
313 __le32 rtssuccesscnt;
314 __le32 rtsfailurecnt;
315 __le32 ackfailurecnt;
316 __le32 frameduplicatecnt;
317 __le32 rxfragmentcnt;
318 __le32 mcastrxframecnt;
320 __le32 bcasttxframecnt;
321 __le32 bcastrxframecnt;
324 __le32 wepundecryptable;
325 } __attribute__ ((packed));
327 struct cmd_ds_802_11_snmp_mib {
328 struct cmd_header hdr;
334 } __attribute__ ((packed));
336 struct cmd_ds_mac_reg_map {
340 } __attribute__ ((packed));
342 struct cmd_ds_bbp_reg_map {
346 } __attribute__ ((packed));
348 struct cmd_ds_rf_reg_map {
352 } __attribute__ ((packed));
354 struct cmd_ds_mac_reg_access {
358 } __attribute__ ((packed));
360 struct cmd_ds_bbp_reg_access {
365 } __attribute__ ((packed));
367 struct cmd_ds_rf_reg_access {
372 } __attribute__ ((packed));
374 struct cmd_ds_802_11_radio_control {
375 struct cmd_header hdr;
379 } __attribute__ ((packed));
381 struct cmd_ds_802_11_beacon_control {
383 __le16 beacon_enable;
384 __le16 beacon_period;
385 } __attribute__ ((packed));
387 struct cmd_ds_802_11_sleep_params {
388 struct cmd_header hdr;
390 /* ACT_GET/ACT_SET */
393 /* Sleep clock error in ppm */
396 /* Wakeup offset in usec */
399 /* Clock stabilization time in usec */
402 /* control periodic calibration */
405 /* control the use of external sleep clock */
406 uint8_t externalsleepclk;
408 /* reserved field, should be set to zero */
410 } __attribute__ ((packed));
412 struct cmd_ds_802_11_inactivity_timeout {
413 struct cmd_header hdr;
415 /* ACT_GET/ACT_SET */
418 /* Inactivity timeout in msec */
420 } __attribute__ ((packed));
422 struct cmd_ds_802_11_rf_channel {
423 struct cmd_header hdr;
427 __le16 rftype; /* unused */
428 __le16 reserved; /* unused */
429 u8 channellist[32]; /* unused */
430 } __attribute__ ((packed));
432 struct cmd_ds_802_11_rssi {
433 /* weighting factor */
439 } __attribute__ ((packed));
441 struct cmd_ds_802_11_rssi_rsp {
445 __le16 avgnoisefloor;
446 } __attribute__ ((packed));
448 struct cmd_ds_802_11_mac_address {
449 struct cmd_header hdr;
453 } __attribute__ ((packed));
455 struct cmd_ds_802_11_rf_tx_power {
456 struct cmd_header hdr;
462 } __attribute__ ((packed));
464 struct cmd_ds_802_11_rf_antenna {
467 /* Number of antennas or 0xffff(diversity) */
470 } __attribute__ ((packed));
472 struct cmd_ds_802_11_monitor_mode {
475 } __attribute__ ((packed));
477 struct cmd_ds_set_boot2_ver {
478 struct cmd_header hdr;
482 } __attribute__ ((packed));
484 struct cmd_ds_802_11_fw_wake_method {
485 struct cmd_header hdr;
489 } __attribute__ ((packed));
491 struct cmd_ds_802_11_sleep_period {
492 struct cmd_header hdr;
496 } __attribute__ ((packed));
498 struct cmd_ds_802_11_ps_mode {
500 __le16 nullpktinterval;
503 __le16 locallisteninterval;
504 } __attribute__ ((packed));
506 struct cmd_confirm_sleep {
507 struct cmd_header hdr;
510 __le16 nullpktinterval;
513 __le16 locallisteninterval;
514 } __attribute__ ((packed));
516 struct cmd_ds_802_11_data_rate {
517 struct cmd_header hdr;
522 } __attribute__ ((packed));
524 struct cmd_ds_802_11_rate_adapt_rateset {
525 struct cmd_header hdr;
529 } __attribute__ ((packed));
531 struct cmd_ds_802_11_ad_hoc_start {
532 struct cmd_header hdr;
534 u8 ssid[IW_ESSID_MAX_SIZE];
537 u8 dtimperiod; /* Reserved on v9 and later */
538 struct ieee_ie_ibss_param_set ibss;
540 struct ieee_ie_ds_param_set ds;
542 __le16 probedelay; /* Reserved on v9 and later */
545 u8 tlv_memory_size_pad[100];
546 } __attribute__ ((packed));
548 struct cmd_ds_802_11_ad_hoc_result {
549 struct cmd_header hdr;
553 } __attribute__ ((packed));
555 struct adhoc_bssdesc {
557 u8 ssid[IW_ESSID_MAX_SIZE];
563 struct ieee_ie_ds_param_set ds;
565 struct ieee_ie_ibss_param_set ibss;
570 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
571 * Adhoc join command and will cause a binary layout mismatch with
574 } __attribute__ ((packed));
576 struct cmd_ds_802_11_ad_hoc_join {
577 struct cmd_header hdr;
579 struct adhoc_bssdesc bss;
580 __le16 failtimeout; /* Reserved on v9 and later */
581 __le16 probedelay; /* Reserved on v9 and later */
582 } __attribute__ ((packed));
584 struct cmd_ds_802_11_ad_hoc_stop {
585 struct cmd_header hdr;
586 } __attribute__ ((packed));
588 struct cmd_ds_802_11_enable_rsn {
589 struct cmd_header hdr;
593 } __attribute__ ((packed));
595 struct MrvlIEtype_keyParamSet {
599 /* length of Payload */
602 /* type of key: WEP=0, TKIP=1, AES=2 */
605 /* key control Info specific to a keytypeid */
611 /* key material of size keylen */
613 } __attribute__ ((packed));
615 #define MAX_WOL_RULES 16
617 struct host_wol_rule {
625 } __attribute__ ((packed));
630 uint8_t no_rules_in_cmd;
632 struct host_wol_rule rule[MAX_WOL_RULES];
633 } __attribute__ ((packed));
635 struct cmd_ds_host_sleep {
636 struct cmd_header hdr;
640 struct wol_config wol_conf;
641 } __attribute__ ((packed));
645 struct cmd_ds_802_11_key_material {
646 struct cmd_header hdr;
649 struct MrvlIEtype_keyParamSet keyParamSet[2];
650 } __attribute__ ((packed));
652 struct cmd_ds_802_11_eeprom_access {
653 struct cmd_header hdr;
657 /* firmware says it returns a maximum of 20 bytes */
658 #define LBS_EEPROM_READ_LEN 20
659 u8 value[LBS_EEPROM_READ_LEN];
660 } __attribute__ ((packed));
662 struct cmd_ds_802_11_tpc_cfg {
663 struct cmd_header hdr;
671 } __attribute__ ((packed));
674 struct cmd_ds_802_11_pa_cfg {
675 struct cmd_header hdr;
682 } __attribute__ ((packed));
685 struct cmd_ds_802_11_led_ctrl {
689 } __attribute__ ((packed));
691 struct cmd_ds_802_11_afc {
699 __le16 timing_offset; /* signed */
700 __le16 carrier_offset; /* signed */
703 } __attribute__ ((packed));
705 struct cmd_tx_rate_query {
707 } __attribute__ ((packed));
709 struct cmd_ds_get_tsf {
711 } __attribute__ ((packed));
713 struct cmd_ds_bt_access {
718 } __attribute__ ((packed));
720 struct cmd_ds_fwt_access {
738 } __attribute__ ((packed));
741 struct cmd_ds_mesh_config {
742 struct cmd_header hdr;
748 u8 data[128]; /* last position reserved */
749 } __attribute__ ((packed));
752 struct cmd_ds_mesh_access {
753 struct cmd_header hdr;
756 __le32 data[32]; /* last position reserved */
757 } __attribute__ ((packed));
759 /* Number of stats counters returned by the firmware */
760 #define MESH_STATS_NUM 8
762 struct cmd_ds_command {
771 struct cmd_ds_802_11_ps_mode psmode;
772 struct cmd_ds_802_11_associate associate;
773 struct cmd_ds_802_11_authenticate auth;
774 struct cmd_ds_802_11_get_stat gstat;
775 struct cmd_ds_802_3_get_stat gstat_8023;
776 struct cmd_ds_802_11_rf_antenna rant;
777 struct cmd_ds_802_11_monitor_mode monitor;
778 struct cmd_ds_802_11_rssi rssi;
779 struct cmd_ds_802_11_rssi_rsp rssirsp;
780 struct cmd_ds_mac_reg_access macreg;
781 struct cmd_ds_bbp_reg_access bbpreg;
782 struct cmd_ds_rf_reg_access rfreg;
784 struct cmd_ds_802_11d_domain_info domaininfo;
785 struct cmd_ds_802_11d_domain_info domaininforesp;
787 struct cmd_ds_802_11_tpc_cfg tpccfg;
788 struct cmd_ds_802_11_afc afc;
789 struct cmd_ds_802_11_led_ctrl ledgpio;
791 struct cmd_tx_rate_query txrate;
792 struct cmd_ds_bt_access bt;
793 struct cmd_ds_fwt_access fwt;
794 struct cmd_ds_get_tsf gettsf;
795 struct cmd_ds_802_11_beacon_control bcn_ctrl;
797 } __attribute__ ((packed));