libertas: convert CMD_802_11_MAC_ADDRESS to a direct command
[safe/jmp/linux-2.6] / drivers / net / wireless / libertas / hostcmd.h
index efdb720..e56d004 100644 (file)
@@ -65,16 +65,21 @@ struct rxpd {
        u8 reserved[3];
 };
 
+struct cmd_header {
+       __le16 command;
+       __le16 size;
+       __le16 seqnum;
+       __le16 result;
+} __attribute__ ((packed));
+
 struct cmd_ctrl_node {
        struct list_head list;
-       /* wait for finish or not */
-       u16 wait_option;
+       int result;
        /* command response */
-       void *pdata_buf;
-       int *pdata_size;
-       int (*callback)(uint16_t respcmd, struct cmd_ds_command *resp, struct lbs_private *priv);
+       int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *);
+       unsigned long callback_arg;
        /* command data */
-       u8 *bufvirtualaddr;
+       struct cmd_header *cmdbuf;
        /* wait queue */
        u16 cmdwaitqwoken;
        wait_queue_head_t cmdwait_q;
@@ -112,6 +117,8 @@ struct cmd_ds_gen {
  * 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 */
@@ -129,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;
@@ -149,6 +156,8 @@ struct cmd_ds_802_11_reset {
 };
 
 struct cmd_ds_802_11_subscribe_event {
+       struct cmd_header hdr;
+
        __le16 action;
        __le16 events;
 
@@ -157,7 +166,7 @@ struct cmd_ds_802_11_subscribe_event {
         * 40 bytes. However, future firmware might add additional TLVs, so I
         * bump this up a bit.
         */
-       u8 tlv[128];
+       uint8_t tlv[128];
 };
 
 /*
@@ -165,9 +174,11 @@ struct cmd_ds_802_11_subscribe_event {
  * 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;
@@ -176,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;
@@ -198,8 +213,9 @@ 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 {
@@ -249,6 +265,8 @@ struct cmd_ds_802_11_ad_hoc_result {
 };
 
 struct cmd_ds_802_11_set_wep {
+       struct cmd_header hdr;
+
        /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
        __le16 action;
 
@@ -256,8 +274,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 {
@@ -335,6 +353,8 @@ struct cmd_ds_rf_reg_access {
 };
 
 struct cmd_ds_802_11_radio_control {
+       struct cmd_header hdr;
+
        __le16 action;
        __le16 control;
 };
@@ -346,6 +366,8 @@ struct cmd_ds_802_11_beacon_control {
 };
 
 struct cmd_ds_802_11_sleep_params {
+       struct cmd_header hdr;
+
        /* ACT_GET/ACT_SET */
        __le16 action;
 
@@ -359,16 +381,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;
 
@@ -377,11 +401,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 {
@@ -401,6 +427,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];
 };
@@ -424,10 +452,26 @@ struct cmd_ds_802_11_monitor_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;
@@ -450,6 +494,8 @@ struct PS_CMD_ConfirmSleep {
 };
 
 struct cmd_ds_802_11_data_rate {
+       struct cmd_header hdr;
+
        __le16 action;
        __le16 reserved;
        u8 rates[MAX_RATES];
@@ -501,6 +547,8 @@ struct cmd_ds_802_11_ad_hoc_join {
 } __attribute__ ((packed));
 
 struct cmd_ds_802_11_enable_rsn {
+       struct cmd_header hdr;
+
        __le16 action;
        __le16 enable;
 } __attribute__ ((packed));
@@ -525,7 +573,16 @@ 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));
@@ -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,18 +691,12 @@ 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;
@@ -647,18 +704,12 @@ struct cmd_ds_command {
                struct cmd_ds_802_11_rf_tx_power txp;
                struct cmd_ds_802_11_rf_antenna rant;
                struct cmd_ds_802_11_monitor_mode monitor;
-               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_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;
@@ -667,20 +718,14 @@ struct cmd_ds_command {
                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_set_boot2_ver boot2_ver;
                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));