]> err.no Git - linux-2.6/blobdiff - drivers/net/wireless/libertas/hostcmd.h
iwlwifi: rename 4965 to AGN
[linux-2.6] / drivers / net / wireless / libertas / hostcmd.h
index 09b898f6719c2193d8d9dfe14d9b124b94154911..913b480211a9a19d30946d0eff0f1055307fddb3 100644 (file)
@@ -2,8 +2,8 @@
  * This file contains the function prototypes, data structure
  * and defines for all the host/station commands
  */
-#ifndef __HOSTCMD__H
-#define __HOSTCMD__H
+#ifndef _LBS_HOSTCMD_H
+#define _LBS_HOSTCMD_H
 
 #include <linux/wireless.h>
 #include "11d.h"
@@ -65,61 +65,40 @@ struct rxpd {
        u8 reserved[3];
 };
 
+struct cmd_header {
+       __le16 command;
+       __le16 size;
+       __le16 seqnum;
+       __le16 result;
+} __attribute__ ((packed));
+
 struct cmd_ctrl_node {
-       /* CMD link list */
        struct list_head list;
-       u32 status;
-       /* CMD ID */
-       u32 cmd_oid;
-       /*CMD wait option: wait for finish or no wait */
-       u16 wait_option;
-       /* command parameter */
-       void *pdata_buf;
-       /*command data */
-       u8 *bufvirtualaddr;
-       u16 cmdflags;
+       int result;
+       /* command response */
+       int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *);
+       unsigned long callback_arg;
+       /* command data */
+       struct cmd_header *cmdbuf;
        /* wait queue */
        u16 cmdwaitqwoken;
        wait_queue_head_t cmdwait_q;
 };
 
-/* WLAN_802_11_KEY
- *
- * Generic structure to hold all key types.  key type (WEP40, WEP104, TKIP, AES)
- * is determined from the keylength field.
- */
-struct WLAN_802_11_KEY {
-       __le32 len;
-       __le32 flags;  /* KEY_INFO_* from wlan_defs.h */
-       u8 key[MRVL_MAX_KEY_WPA_KEY_LENGTH];
-       __le16 type; /* KEY_TYPE_* from wlan_defs.h */
-};
-
-struct IE_WPA {
-       u8 elementid;
-       u8 len;
-       u8 oui[4];
-       __le16 version;
+/* Generic structure to hold all key types. */
+struct enc_key {
+       u16 len;
+       u16 flags;  /* KEY_INFO_* from defs.h */
+       u16 type; /* KEY_TYPE_* from defs.h */
+       u8 key[32];
 };
 
-/* wlan_offset_value */
-struct wlan_offset_value {
+/* lbs_offset_value */
+struct lbs_offset_value {
        u32 offset;
        u32 value;
 };
 
-struct WLAN_802_11_FIXED_IEs {
-       __le64 timestamp;
-       __le16 beaconinterval;
-       u16 capabilities; /* Actually struct ieeetypes_capinfo */
-};
-
-struct WLAN_802_11_VARIABLE_IEs {
-       u8 elementid;
-       u8 length;
-       u8 data[1];
-};
-
 /* Define general data structure */
 /* cmd_DS_GEN */
 struct cmd_ds_gen {
@@ -127,14 +106,19 @@ struct cmd_ds_gen {
        __le16 size;
        __le16 seqnum;
        __le16 result;
+       void *cmdresp[0];
 };
 
 #define S_DS_GEN sizeof(struct cmd_ds_gen)
+
+
 /*
- * Define data structure for cmd_get_hw_spec
+ * Define data structure for CMD_GET_HW_SPEC
  * This structure defines the response for the GET_HW_SPEC command
  */
 struct cmd_ds_get_hw_spec {
+       struct cmd_header hdr;
+
        /* HW Interface version number */
        __le16 hwifversion;
        /* HW version number */
@@ -152,8 +136,8 @@ struct cmd_ds_get_hw_spec {
        /* Number of antenna used */
        __le16 nr_antenna;
 
-       /* FW release number, example 1,2,3,4 = 3.2.1p4 */
-       u8 fwreleasenumber[4];
+       /* FW release number, example 0x01030304 = 2.3.4p1 */
+       __le32 fwrelease;
 
        /* Base Address of TxPD queue */
        __le32 wcb_base;
@@ -172,18 +156,29 @@ struct cmd_ds_802_11_reset {
 };
 
 struct cmd_ds_802_11_subscribe_event {
+       struct cmd_header hdr;
+
        __le16 action;
        __le16 events;
+
+       /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a
+        * number of TLVs. From the v5.1 manual, those TLVs would add up to
+        * 40 bytes. However, future firmware might add additional TLVs, so I
+        * bump this up a bit.
+        */
+       uint8_t tlv[128];
 };
 
 /*
  * This scan handle Country Information IE(802.11d compliant)
- * Define data structure for cmd_802_11_scan
+ * Define data structure for CMD_802_11_SCAN
  */
 struct cmd_ds_802_11_scan {
-       u8 bsstype;
-       u8 BSSID[ETH_ALEN];
-       u8 tlvbuffer[1];
+       struct cmd_header hdr;
+
+       uint8_t bsstype;
+       uint8_t bssid[ETH_ALEN];
+       uint8_t tlvbuffer[0];
 #if 0
        mrvlietypes_ssidparamset_t ssidParamSet;
        mrvlietypes_chanlistparamset_t ChanListParamSet;
@@ -192,12 +187,16 @@ struct cmd_ds_802_11_scan {
 };
 
 struct cmd_ds_802_11_scan_rsp {
+       struct cmd_header hdr;
+
        __le16 bssdescriptsize;
-       u8 nr_sets;
-       u8 bssdesc_and_tlvbuffer[1];
+       uint8_t nr_sets;
+       uint8_t bssdesc_and_tlvbuffer[0];
 };
 
 struct cmd_ds_802_11_get_log {
+       struct cmd_header hdr;
+
        __le32 mcasttxframe;
        __le32 failed;
        __le32 retry;
@@ -214,11 +213,13 @@ struct cmd_ds_802_11_get_log {
 };
 
 struct cmd_ds_mac_control {
+       struct cmd_header hdr;
        __le16 action;
-       __le16 reserved;
+       u16 reserved;
 };
 
 struct cmd_ds_mac_multicast_adr {
+       struct cmd_header hdr;
        __le16 action;
        __le16 nr_of_adrs;
        u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
@@ -237,7 +238,7 @@ struct cmd_ds_802_11_deauthenticate {
 
 struct cmd_ds_802_11_associate {
        u8 peerstaaddr[6];
-       struct ieeetypes_capinfo capinfo;
+       __le16 capability;
        __le16 listeninterval;
        __le16 bcnperiod;
        u8 dtimperiod;
@@ -260,11 +261,13 @@ struct cmd_ds_802_11_associate_rsp {
 };
 
 struct cmd_ds_802_11_ad_hoc_result {
-       u8 PAD[3];
-       u8 BSSID[ETH_ALEN];
+       u8 pad[3];
+       u8 bssid[ETH_ALEN];
 };
 
 struct cmd_ds_802_11_set_wep {
+       struct cmd_header hdr;
+
        /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
        __le16 action;
 
@@ -272,8 +275,8 @@ struct cmd_ds_802_11_set_wep {
        __le16 keyindex;
 
        /* 40, 128bit or TXWEP */
-       u8 keytype[4];
-       u8 keymaterial[4][16];
+       uint8_t keytype[4];
+       uint8_t keymaterial[4][16];
 };
 
 struct cmd_ds_802_3_get_stat {
@@ -351,11 +354,21 @@ struct cmd_ds_rf_reg_access {
 };
 
 struct cmd_ds_802_11_radio_control {
+       struct cmd_header hdr;
+
        __le16 action;
        __le16 control;
 };
 
+struct cmd_ds_802_11_beacon_control {
+       __le16 action;
+       __le16 beacon_enable;
+       __le16 beacon_period;
+};
+
 struct cmd_ds_802_11_sleep_params {
+       struct cmd_header hdr;
+
        /* ACT_GET/ACT_SET */
        __le16 action;
 
@@ -369,16 +382,18 @@ struct cmd_ds_802_11_sleep_params {
        __le16 stabletime;
 
        /* control periodic calibration */
-       u8 calcontrol;
+       uint8_t calcontrol;
 
        /* control the use of external sleep clock */
-       u8 externalsleepclk;
+       uint8_t externalsleepclk;
 
        /* reserved field, should be set to zero */
        __le16 reserved;
 };
 
 struct cmd_ds_802_11_inactivity_timeout {
+       struct cmd_header hdr;
+
        /* ACT_GET/ACT_SET */
        __le16 action;
 
@@ -387,11 +402,13 @@ struct cmd_ds_802_11_inactivity_timeout {
 };
 
 struct cmd_ds_802_11_rf_channel {
+       struct cmd_header hdr;
+
        __le16 action;
-       __le16 currentchannel;
-       __le16 rftype;
-       __le16 reserved;
-       u8 channellist[32];
+       __le16 channel;
+       __le16 rftype;      /* unused */
+       __le16 reserved;    /* unused */
+       u8 channellist[32]; /* unused */
 };
 
 struct cmd_ds_802_11_rssi {
@@ -411,6 +428,8 @@ struct cmd_ds_802_11_rssi_rsp {
 };
 
 struct cmd_ds_802_11_mac_address {
+       struct cmd_header hdr;
+
        __le16 action;
        u8 macadd[ETH_ALEN];
 };
@@ -428,6 +447,32 @@ struct cmd_ds_802_11_rf_antenna {
 
 };
 
+struct cmd_ds_802_11_monitor_mode {
+       __le16 action;
+       __le16 mode;
+};
+
+struct cmd_ds_set_boot2_ver {
+       struct cmd_header hdr;
+
+       __le16 action;
+       __le16 version;
+};
+
+struct cmd_ds_802_11_fw_wake_method {
+       struct cmd_header hdr;
+
+       __le16 action;
+       __le16 method;
+};
+
+struct cmd_ds_802_11_sleep_period {
+       struct cmd_header hdr;
+
+       __le16 action;
+       __le16 period;
+};
+
 struct cmd_ds_802_11_ps_mode {
        __le16 action;
        __le16 nullpktinterval;
@@ -436,56 +481,56 @@ struct cmd_ds_802_11_ps_mode {
        __le16 locallisteninterval;
 };
 
-struct PS_CMD_ConfirmSleep {
-       __le16 command;
-       __le16 size;
-       __le16 seqnum;
-       __le16 result;
+struct cmd_confirm_sleep {
+       struct cmd_header hdr;
 
        __le16 action;
-       __le16 reserved1;
+       __le16 nullpktinterval;
        __le16 multipledtim;
        __le16 reserved;
        __le16 locallisteninterval;
 };
 
 struct cmd_ds_802_11_data_rate {
+       struct cmd_header hdr;
+
        __le16 action;
-       __le16 reserverd;
-       u8 datarate[G_SUPPORTED_RATES];
+       __le16 reserved;
+       u8 rates[MAX_RATES];
 };
 
 struct cmd_ds_802_11_rate_adapt_rateset {
+       struct cmd_header hdr;
        __le16 action;
        __le16 enablehwauto;
        __le16 bitmap;
 };
 
 struct cmd_ds_802_11_ad_hoc_start {
-       u8 SSID[IW_ESSID_MAX_SIZE];
+       u8 ssid[IW_ESSID_MAX_SIZE];
        u8 bsstype;
        __le16 beaconperiod;
        u8 dtimperiod;
        union IEEEtypes_ssparamset ssparamset;
        union ieeetypes_phyparamset phyparamset;
        __le16 probedelay;
-       struct ieeetypes_capinfo cap;
-       u8 datarate[G_SUPPORTED_RATES];
+       __le16 capability;
+       u8 rates[MAX_RATES];
        u8 tlv_memory_size_pad[100];
 } __attribute__ ((packed));
 
 struct adhoc_bssdesc {
-       u8 BSSID[6];
-       u8 SSID[32];
-       u8 bsstype;
+       u8 bssid[6];
+       u8 ssid[32];
+       u8 type;
        __le16 beaconperiod;
        u8 dtimperiod;
        __le64 timestamp;
        __le64 localtime;
        union ieeetypes_phyparamset phyparamset;
        union IEEEtypes_ssparamset ssparamset;
-       struct ieeetypes_capinfo cap;
-       u8 datarates[G_SUPPORTED_RATES];
+       __le16 capability;
+       u8 rates[MAX_RATES];
 
        /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
         * Adhoc join command and will cause a binary layout mismatch with
@@ -494,13 +539,15 @@ struct adhoc_bssdesc {
 } __attribute__ ((packed));
 
 struct cmd_ds_802_11_ad_hoc_join {
-       struct adhoc_bssdesc bssdescriptor;
+       struct adhoc_bssdesc bss;
        __le16 failtimeout;
        __le16 probedelay;
 
 } __attribute__ ((packed));
 
 struct cmd_ds_802_11_enable_rsn {
+       struct cmd_header hdr;
+
        __le16 action;
        __le16 enable;
 } __attribute__ ((packed));
@@ -525,18 +572,28 @@ struct MrvlIEtype_keyParamSet {
        u8 key[32];
 };
 
+struct cmd_ds_host_sleep {
+       struct cmd_header hdr;
+       __le32 criteria;
+       uint8_t gpio;
+       uint8_t gap;
+} __attribute__ ((packed));
+
 struct cmd_ds_802_11_key_material {
+       struct cmd_header hdr;
+
        __le16 action;
        struct MrvlIEtype_keyParamSet keyParamSet[2];
 } __attribute__ ((packed));
 
 struct cmd_ds_802_11_eeprom_access {
+       struct cmd_header hdr;
        __le16 action;
-
-       /* multiple 4 */
        __le16 offset;
-       __le16 bytecount;
-       u8 value;
+       __le16 len;
+       /* firmware says it returns a maximum of 20 bytes */
+#define LBS_EEPROM_READ_LEN 20
+       u8 value[LBS_EEPROM_READ_LEN];
 } __attribute__ ((packed));
 
 struct cmd_ds_802_11_tpc_cfg {
@@ -554,14 +611,6 @@ struct cmd_ds_802_11_led_ctrl {
        u8 data[256];
 } __attribute__ ((packed));
 
-struct cmd_ds_802_11_pwr_cfg {
-       __le16 action;
-       u8 enable;
-       s8 PA_P0;
-       s8 PA_P1;
-       s8 PA_P2;
-} __attribute__ ((packed));
-
 struct cmd_ds_802_11_afc {
        __le16 afc_auto;
        union {
@@ -611,7 +660,21 @@ struct cmd_ds_fwt_access {
        u8 prec[ETH_ALEN];
 } __attribute__ ((packed));
 
+
+struct cmd_ds_mesh_config {
+       struct cmd_header hdr;
+
+        __le16 action;
+        __le16 channel;
+        __le16 type;
+        __le16 length;
+        u8 data[128];   /* last position reserved */
+} __attribute__ ((packed));
+
+
 struct cmd_ds_mesh_access {
+       struct cmd_header hdr;
+
        __le16 action;
        __le32 data[32];        /* last position reserved */
 } __attribute__ ((packed));
@@ -628,57 +691,39 @@ struct cmd_ds_command {
 
        /* command Body */
        union {
-               struct cmd_ds_get_hw_spec hwspec;
                struct cmd_ds_802_11_ps_mode psmode;
-               struct cmd_ds_802_11_scan scan;
-               struct cmd_ds_802_11_scan_rsp scanresp;
-               struct cmd_ds_mac_control macctrl;
                struct cmd_ds_802_11_associate associate;
                struct cmd_ds_802_11_deauthenticate deauth;
-               struct cmd_ds_802_11_set_wep wep;
                struct cmd_ds_802_11_ad_hoc_start ads;
                struct cmd_ds_802_11_reset reset;
                struct cmd_ds_802_11_ad_hoc_result result;
-               struct cmd_ds_802_11_get_log glog;
                struct cmd_ds_802_11_authenticate auth;
                struct cmd_ds_802_11_get_stat gstat;
                struct cmd_ds_802_3_get_stat gstat_8023;
                struct cmd_ds_802_11_snmp_mib smib;
                struct cmd_ds_802_11_rf_tx_power txp;
                struct cmd_ds_802_11_rf_antenna rant;
-               struct cmd_ds_802_11_data_rate drate;
-               struct cmd_ds_802_11_rate_adapt_rateset rateset;
-               struct cmd_ds_mac_multicast_adr madr;
+               struct cmd_ds_802_11_monitor_mode monitor;
                struct cmd_ds_802_11_ad_hoc_join adj;
-               struct cmd_ds_802_11_radio_control radio;
-               struct cmd_ds_802_11_rf_channel rfchannel;
                struct cmd_ds_802_11_rssi rssi;
                struct cmd_ds_802_11_rssi_rsp rssirsp;
                struct cmd_ds_802_11_disassociate dassociate;
-               struct cmd_ds_802_11_mac_address macadd;
-               struct cmd_ds_802_11_enable_rsn enbrsn;
-               struct cmd_ds_802_11_key_material keymaterial;
                struct cmd_ds_mac_reg_access macreg;
                struct cmd_ds_bbp_reg_access bbpreg;
                struct cmd_ds_rf_reg_access rfreg;
-               struct cmd_ds_802_11_eeprom_access rdeeprom;
 
                struct cmd_ds_802_11d_domain_info domaininfo;
                struct cmd_ds_802_11d_domain_info domaininforesp;
 
-               struct cmd_ds_802_11_sleep_params sleep_params;
-               struct cmd_ds_802_11_inactivity_timeout inactivity_timeout;
                struct cmd_ds_802_11_tpc_cfg tpccfg;
-               struct cmd_ds_802_11_pwr_cfg pwrcfg;
                struct cmd_ds_802_11_afc afc;
                struct cmd_ds_802_11_led_ctrl ledgpio;
 
                struct cmd_tx_rate_query txrate;
                struct cmd_ds_bt_access bt;
                struct cmd_ds_fwt_access fwt;
-               struct cmd_ds_mesh_access mesh;
                struct cmd_ds_get_tsf gettsf;
-               struct cmd_ds_802_11_subscribe_event subscribe_event;
+               struct cmd_ds_802_11_beacon_control bcn_ctrl;
        } params;
 } __attribute__ ((packed));