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) */
35 } __attribute__ ((packed));
39 /* Current Rx packet status */
60 /* Next Rx RxPD addr */
66 } __attribute__ ((packed));
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 {
100 } __attribute__ ((packed));
102 /* Define general data structure */
110 } __attribute__ ((packed));
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.
166 } __attribute__ ((packed));
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;
183 } __attribute__ ((packed));
185 struct cmd_ds_802_11_scan_rsp {
186 struct cmd_header hdr;
188 __le16 bssdescriptsize;
190 uint8_t bssdesc_and_tlvbuffer[0];
191 } __attribute__ ((packed));
193 struct cmd_ds_802_11_get_log {
194 struct cmd_header hdr;
208 __le32 wepundecryptable;
209 } __attribute__ ((packed));
211 struct cmd_ds_mac_control {
212 struct cmd_header hdr;
215 } __attribute__ ((packed));
217 struct cmd_ds_mac_multicast_adr {
218 struct cmd_header hdr;
221 u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
222 } __attribute__ ((packed));
224 struct cmd_ds_gspi_bus_config {
225 struct cmd_header hdr;
227 __le16 bus_delay_mode;
228 __le16 host_time_delay_to_read_port;
229 __le16 host_time_delay_to_read_register;
230 } __attribute__ ((packed));
232 struct cmd_ds_802_11_authenticate {
233 u8 macaddr[ETH_ALEN];
236 } __attribute__ ((packed));
238 struct cmd_ds_802_11_deauthenticate {
239 struct cmd_header hdr;
241 u8 macaddr[ETH_ALEN];
243 } __attribute__ ((packed));
245 struct cmd_ds_802_11_associate {
248 __le16 listeninterval;
253 mrvlietypes_ssidparamset_t ssidParamSet;
254 mrvlietypes_phyparamset_t phyparamset;
255 mrvlietypes_ssparamset_t ssparamset;
256 mrvlietypes_ratesparamset_t ratesParamSet;
258 } __attribute__ ((packed));
260 struct cmd_ds_802_11_associate_rsp {
261 struct ieeetypes_assocrsp assocRsp;
262 } __attribute__ ((packed));
264 struct cmd_ds_802_11_set_wep {
265 struct cmd_header hdr;
267 /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
270 /* key Index selected for Tx */
273 /* 40, 128bit or TXWEP */
275 uint8_t keymaterial[4][16];
276 } __attribute__ ((packed));
278 struct cmd_ds_802_3_get_stat {
285 } __attribute__ ((packed));
287 struct cmd_ds_802_11_get_stat {
288 __le32 txfragmentcnt;
289 __le32 mcasttxframecnt;
292 __le32 Multipleretrycnt;
293 __le32 rtssuccesscnt;
294 __le32 rtsfailurecnt;
295 __le32 ackfailurecnt;
296 __le32 frameduplicatecnt;
297 __le32 rxfragmentcnt;
298 __le32 mcastrxframecnt;
300 __le32 bcasttxframecnt;
301 __le32 bcastrxframecnt;
304 __le32 wepundecryptable;
305 } __attribute__ ((packed));
307 struct cmd_ds_802_11_snmp_mib {
308 struct cmd_header hdr;
314 } __attribute__ ((packed));
316 struct cmd_ds_mac_reg_map {
320 } __attribute__ ((packed));
322 struct cmd_ds_bbp_reg_map {
326 } __attribute__ ((packed));
328 struct cmd_ds_rf_reg_map {
332 } __attribute__ ((packed));
334 struct cmd_ds_mac_reg_access {
338 } __attribute__ ((packed));
340 struct cmd_ds_bbp_reg_access {
345 } __attribute__ ((packed));
347 struct cmd_ds_rf_reg_access {
352 } __attribute__ ((packed));
354 struct cmd_ds_802_11_radio_control {
355 struct cmd_header hdr;
359 } __attribute__ ((packed));
361 struct cmd_ds_802_11_beacon_control {
363 __le16 beacon_enable;
364 __le16 beacon_period;
365 } __attribute__ ((packed));
367 struct cmd_ds_802_11_sleep_params {
368 struct cmd_header hdr;
370 /* ACT_GET/ACT_SET */
373 /* Sleep clock error in ppm */
376 /* Wakeup offset in usec */
379 /* Clock stabilization time in usec */
382 /* control periodic calibration */
385 /* control the use of external sleep clock */
386 uint8_t externalsleepclk;
388 /* reserved field, should be set to zero */
390 } __attribute__ ((packed));
392 struct cmd_ds_802_11_inactivity_timeout {
393 struct cmd_header hdr;
395 /* ACT_GET/ACT_SET */
398 /* Inactivity timeout in msec */
400 } __attribute__ ((packed));
402 struct cmd_ds_802_11_rf_channel {
403 struct cmd_header hdr;
407 __le16 rftype; /* unused */
408 __le16 reserved; /* unused */
409 u8 channellist[32]; /* unused */
410 } __attribute__ ((packed));
412 struct cmd_ds_802_11_rssi {
413 /* weighting factor */
419 } __attribute__ ((packed));
421 struct cmd_ds_802_11_rssi_rsp {
425 __le16 avgnoisefloor;
426 } __attribute__ ((packed));
428 struct cmd_ds_802_11_mac_address {
429 struct cmd_header hdr;
433 } __attribute__ ((packed));
435 struct cmd_ds_802_11_rf_tx_power {
436 struct cmd_header hdr;
442 } __attribute__ ((packed));
444 struct cmd_ds_802_11_rf_antenna {
447 /* Number of antennas or 0xffff(diversity) */
450 } __attribute__ ((packed));
452 struct cmd_ds_802_11_monitor_mode {
455 } __attribute__ ((packed));
457 struct cmd_ds_set_boot2_ver {
458 struct cmd_header hdr;
462 } __attribute__ ((packed));
464 struct cmd_ds_802_11_fw_wake_method {
465 struct cmd_header hdr;
469 } __attribute__ ((packed));
471 struct cmd_ds_802_11_sleep_period {
472 struct cmd_header hdr;
476 } __attribute__ ((packed));
478 struct cmd_ds_802_11_ps_mode {
480 __le16 nullpktinterval;
483 __le16 locallisteninterval;
484 } __attribute__ ((packed));
486 struct cmd_confirm_sleep {
487 struct cmd_header hdr;
490 __le16 nullpktinterval;
493 __le16 locallisteninterval;
494 } __attribute__ ((packed));
496 struct cmd_ds_802_11_data_rate {
497 struct cmd_header hdr;
502 } __attribute__ ((packed));
504 struct cmd_ds_802_11_rate_adapt_rateset {
505 struct cmd_header hdr;
509 } __attribute__ ((packed));
511 struct cmd_ds_802_11_ad_hoc_start {
512 struct cmd_header hdr;
514 u8 ssid[IW_ESSID_MAX_SIZE];
517 u8 dtimperiod; /* Reserved on v9 and later */
518 union IEEEtypes_ssparamset ssparamset;
519 union ieeetypes_phyparamset phyparamset;
523 u8 tlv_memory_size_pad[100];
524 } __attribute__ ((packed));
526 struct cmd_ds_802_11_ad_hoc_result {
527 struct cmd_header hdr;
531 } __attribute__ ((packed));
533 struct adhoc_bssdesc {
535 u8 ssid[IW_ESSID_MAX_SIZE];
541 union ieeetypes_phyparamset phyparamset;
542 union IEEEtypes_ssparamset ssparamset;
546 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
547 * Adhoc join command and will cause a binary layout mismatch with
550 } __attribute__ ((packed));
552 struct cmd_ds_802_11_ad_hoc_join {
553 struct cmd_header hdr;
555 struct adhoc_bssdesc bss;
556 __le16 failtimeout; /* Reserved on v9 and later */
557 __le16 probedelay; /* Reserved on v9 and later */
558 } __attribute__ ((packed));
560 struct cmd_ds_802_11_ad_hoc_stop {
561 struct cmd_header hdr;
562 } __attribute__ ((packed));
564 struct cmd_ds_802_11_enable_rsn {
565 struct cmd_header hdr;
569 } __attribute__ ((packed));
571 struct MrvlIEtype_keyParamSet {
575 /* length of Payload */
578 /* type of key: WEP=0, TKIP=1, AES=2 */
581 /* key control Info specific to a keytypeid */
587 /* key material of size keylen */
589 } __attribute__ ((packed));
591 #define MAX_WOL_RULES 16
593 struct host_wol_rule {
601 } __attribute__ ((packed));
606 uint8_t no_rules_in_cmd;
608 struct host_wol_rule rule[MAX_WOL_RULES];
609 } __attribute__ ((packed));
611 struct cmd_ds_host_sleep {
612 struct cmd_header hdr;
616 struct wol_config wol_conf;
617 } __attribute__ ((packed));
621 struct cmd_ds_802_11_key_material {
622 struct cmd_header hdr;
625 struct MrvlIEtype_keyParamSet keyParamSet[2];
626 } __attribute__ ((packed));
628 struct cmd_ds_802_11_eeprom_access {
629 struct cmd_header hdr;
633 /* firmware says it returns a maximum of 20 bytes */
634 #define LBS_EEPROM_READ_LEN 20
635 u8 value[LBS_EEPROM_READ_LEN];
636 } __attribute__ ((packed));
638 struct cmd_ds_802_11_tpc_cfg {
639 struct cmd_header hdr;
647 } __attribute__ ((packed));
650 struct cmd_ds_802_11_pa_cfg {
651 struct cmd_header hdr;
658 } __attribute__ ((packed));
661 struct cmd_ds_802_11_led_ctrl {
665 } __attribute__ ((packed));
667 struct cmd_ds_802_11_afc {
675 __le16 timing_offset; /* signed */
676 __le16 carrier_offset; /* signed */
679 } __attribute__ ((packed));
681 struct cmd_tx_rate_query {
683 } __attribute__ ((packed));
685 struct cmd_ds_get_tsf {
687 } __attribute__ ((packed));
689 struct cmd_ds_bt_access {
694 } __attribute__ ((packed));
696 struct cmd_ds_fwt_access {
714 } __attribute__ ((packed));
717 struct cmd_ds_mesh_config {
718 struct cmd_header hdr;
724 u8 data[128]; /* last position reserved */
725 } __attribute__ ((packed));
728 struct cmd_ds_mesh_access {
729 struct cmd_header hdr;
732 __le32 data[32]; /* last position reserved */
733 } __attribute__ ((packed));
735 /* Number of stats counters returned by the firmware */
736 #define MESH_STATS_NUM 8
738 struct cmd_ds_command {
747 struct cmd_ds_802_11_ps_mode psmode;
748 struct cmd_ds_802_11_associate associate;
749 struct cmd_ds_802_11_authenticate auth;
750 struct cmd_ds_802_11_get_stat gstat;
751 struct cmd_ds_802_3_get_stat gstat_8023;
752 struct cmd_ds_802_11_rf_antenna rant;
753 struct cmd_ds_802_11_monitor_mode monitor;
754 struct cmd_ds_802_11_rssi rssi;
755 struct cmd_ds_802_11_rssi_rsp rssirsp;
756 struct cmd_ds_mac_reg_access macreg;
757 struct cmd_ds_bbp_reg_access bbpreg;
758 struct cmd_ds_rf_reg_access rfreg;
760 struct cmd_ds_802_11d_domain_info domaininfo;
761 struct cmd_ds_802_11d_domain_info domaininforesp;
763 struct cmd_ds_802_11_tpc_cfg tpccfg;
764 struct cmd_ds_802_11_afc afc;
765 struct cmd_ds_802_11_led_ctrl ledgpio;
767 struct cmd_tx_rate_query txrate;
768 struct cmd_ds_bt_access bt;
769 struct cmd_ds_fwt_access fwt;
770 struct cmd_ds_get_tsf gettsf;
771 struct cmd_ds_802_11_beacon_control bcn_ctrl;
773 } __attribute__ ((packed));