- patches.suse/slab-handle-memoryless-nodes-v2a.patch: Refresh.
[linux-flexiantxendom0-3.2.10.git] / drivers / net / wireless / wl12xx / wl1271_cmd.h
index 951a844..b4fa4ac 100644 (file)
 
 struct acx_header;
 
-int wl1271_cmd_send(struct wl1271 *wl, u16 type, void *buf, size_t buf_len);
-int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type, u8 dtim_interval,
-                   u16 beacon_interval, u8 wait);
+int wl1271_cmd_send(struct wl1271 *wl, u16 id, void *buf, size_t len,
+                   size_t res_len);
+int wl1271_cmd_general_parms(struct wl1271 *wl);
+int wl1271_cmd_radio_parms(struct wl1271 *wl);
+int wl1271_cmd_join(struct wl1271 *wl);
 int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer);
 int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len);
 int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len);
@@ -40,16 +42,19 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode);
 int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
                           size_t len);
 int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len,
-                   u8 active_scan, u8 high_prio, u8 num_channels,
+                   u8 active_scan, u8 high_prio, u8 band,
                    u8 probe_requests);
 int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
                            void *buf, size_t buf_len);
 int wl1271_cmd_build_null_data(struct wl1271 *wl);
 int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid);
-int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len);
+int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len,
+                              u8 band);
 int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id);
 int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
-                      u8 key_size, const u8 *key, const u8 *addr);
+                      u8 key_size, const u8 *key, const u8 *addr,
+                      u32 tx_seq_32, u16 tx_seq_16);
+int wl1271_cmd_disconnect(struct wl1271 *wl);
 
 enum wl1271_commands {
        CMD_INTERROGATE     = 1,    /*use this to read information elements*/
@@ -118,8 +123,8 @@ enum cmd_templ {
 #define WL1271_CMD_TEMPL_MAX_SIZE  252
 
 struct wl1271_cmd_header {
-       u16 id;
-       u16 status;
+       __le16 id;
+       __le16 status;
        /* payload */
        u8 data[0];
 } __attribute__ ((packed));
@@ -172,17 +177,17 @@ struct cmd_read_write_memory {
        struct wl1271_cmd_header header;
 
        /* The address of the memory to read from or write to.*/
-       u32 addr;
+       __le32 addr;
 
        /* The amount of data in bytes to read from or write to the WiLink
         * device.*/
-       u32 size;
+       __le32 size;
 
        /* The actual value read from or written to the Wilink. The source
           of this field is the Host in WRITE command or the Wilink in READ
           command. */
        u8 value[MAX_READ_SIZE];
-};
+} __attribute__ ((packed));
 
 #define CMDMBOX_HEADER_LEN 4
 #define CMDMBOX_INFO_ELEM_HEADER_LEN 4
@@ -196,22 +201,23 @@ enum {
 
 #define WL1271_JOIN_CMD_CTRL_TX_FLUSH     0x80 /* Firmware flushes all Tx */
 #define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1
+#define WL1271_JOIN_CMD_BSS_TYPE_5GHZ 0x10
 
 struct wl1271_cmd_join {
        struct wl1271_cmd_header header;
 
-       u32 bssid_lsb;
-       u16 bssid_msb;
-       u16 beacon_interval; /* in TBTTs */
-       u32 rx_config_options;
-       u32 rx_filter_options;
+       __le32 bssid_lsb;
+       __le16 bssid_msb;
+       __le16 beacon_interval; /* in TBTTs */
+       __le32 rx_config_options;
+       __le32 rx_filter_options;
 
        /*
         * The target uses this field to determine the rate at
         * which to transmit control frame responses (such as
         * ACK or CTS frames).
         */
-       u32 basic_rate_set;
+       __le32 basic_rate_set;
        u8 dtim_interval;
        /*
         * bits 0-2: This bitwise field specifies the type
@@ -240,10 +246,10 @@ struct cmd_enabledisable_path {
 struct wl1271_cmd_template_set {
        struct wl1271_cmd_header header;
 
-       u16 len;
+       __le16 len;
        u8 template_type;
        u8 index;  /* relevant only for KLV_TEMPLATE type */
-       u32 enabled_rates;
+       __le32 enabled_rates;
        u8 short_retry_limit;
        u8 long_retry_limit;
        u8 aflags;
@@ -280,18 +286,13 @@ struct wl1271_cmd_ps_params {
          * to power save mode.
          */
        u8 hang_over_period;
-       u32 null_data_rate;
+       __le32 null_data_rate;
 } __attribute__ ((packed));
 
 /* HW encryption keys */
 #define NUM_ACCESS_CATEGORIES_COPY 4
 #define MAX_KEY_SIZE 32
 
-/* When set, disable HW encryption */
-#define DF_ENCRYPTION_DISABLE      0x01
-/* When set, disable HW decryption */
-#define DF_SNIFF_MODE_ENABLE       0x80
-
 enum wl1271_cmd_key_action {
        KEY_ADD_OR_REPLACE = 1,
        KEY_REMOVE         = 2,
@@ -316,9 +317,9 @@ struct wl1271_cmd_set_keys {
        u8 addr[ETH_ALEN];
 
        /* key_action_e */
-       u16 key_action;
+       __le16 key_action;
 
-       u16 reserved_1;
+       __le16 reserved_1;
 
        /* key size in bytes */
        u8 key_size;
@@ -334,8 +335,8 @@ struct wl1271_cmd_set_keys {
        u8 id;
        u8 reserved_2[6];
        u8 key[MAX_KEY_SIZE];
-       u16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
-       u32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
+       __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
+       __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
 } __attribute__ ((packed));
 
 
@@ -347,19 +348,22 @@ struct wl1271_cmd_set_keys {
 #define WL1271_SCAN_OPT_PRIORITY_HIGH  4
 #define WL1271_SCAN_CHAN_MIN_DURATION  30000  /* TU */
 #define WL1271_SCAN_CHAN_MAX_DURATION  60000  /* TU */
+#define WL1271_SCAN_BAND_2_4_GHZ 0
+#define WL1271_SCAN_BAND_5_GHZ 1
+#define WL1271_SCAN_BAND_DUAL 2
 
 struct basic_scan_params {
-       u32 rx_config_options;
-       u32 rx_filter_options;
+       __le32 rx_config_options;
+       __le32 rx_filter_options;
        /* Scan option flags (WL1271_SCAN_OPT_*) */
-       u16 scan_options;
+       __le16 scan_options;
        /* Number of scan channels in the list (maximum 30) */
        u8 num_channels;
        /* This field indicates the number of probe requests to send
           per channel for an active scan */
        u8 num_probe_requests;
        /* Rate bit field for sending the probes */
-       u32 tx_rate;
+       __le32 tx_rate;
        u8 tid_trigger;
        u8 ssid_len;
        /* in order to align */
@@ -374,10 +378,10 @@ struct basic_scan_params {
 
 struct basic_scan_channel_params {
        /* Duration in TU to wait for frames on a channel for active scan */
-       u32 min_duration;
-       u32 max_duration;
-       u32 bssid_lsb;
-       u16 bssid_msb;
+       __le32 min_duration;
+       __le32 max_duration;
+       __le32 bssid_lsb;
+       __le16 bssid_msb;
        u8 early_termination;
        u8 tx_power_att;
        u8 channel;
@@ -397,13 +401,13 @@ struct wl1271_cmd_scan {
 struct wl1271_cmd_trigger_scan_to {
        struct wl1271_cmd_header header;
 
-       u32 timeout;
-};
+       __le32 timeout;
+} __attribute__ ((packed));
 
 struct wl1271_cmd_test_header {
        u8 id;
        u8 padding[3];
-};
+} __attribute__ ((packed));
 
 enum wl1271_channel_tune_bands {
        WL1271_CHANNEL_TUNE_BAND_2_4,
@@ -416,6 +420,76 @@ enum wl1271_channel_tune_bands {
 #define TEST_CMD_P2G_CAL                   0x02
 #define TEST_CMD_CHANNEL_TUNE              0x0d
 #define TEST_CMD_UPDATE_PD_REFERENCE_POINT 0x1d
+#define TEST_CMD_INI_FILE_RADIO_PARAM      0x19
+#define TEST_CMD_INI_FILE_GENERAL_PARAM    0x1E
+
+struct wl1271_general_parms_cmd {
+       struct wl1271_cmd_header header;
+
+       struct wl1271_cmd_test_header test;
+
+       u8 ref_clk;
+       u8 settling_time;
+       u8 clk_valid_on_wakeup;
+       u8 dc2dcmode;
+       u8 single_dual_band;
+
+       u8 tx_bip_fem_autodetect;
+       u8 tx_bip_fem_manufacturer;
+       u8 settings;
+} __attribute__ ((packed));
+
+struct wl1271_radio_parms_cmd {
+       struct wl1271_cmd_header header;
+
+       struct wl1271_cmd_test_header test;
+
+       /* Static radio parameters */
+       /* 2.4GHz */
+       u8 rx_trace_loss;
+       u8 tx_trace_loss;
+       s8 rx_rssi_and_proc_compens[CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE];
+
+       /* 5GHz */
+       u8 rx_trace_loss_5[CONF_NUMBER_OF_SUB_BANDS_5];
+       u8 tx_trace_loss_5[CONF_NUMBER_OF_SUB_BANDS_5];
+       s8 rx_rssi_and_proc_compens_5[CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE];
+
+       /* Dynamic radio parameters */
+       /* 2.4GHz */
+       __le16 tx_ref_pd_voltage;
+       s8  tx_ref_power;
+       s8  tx_offset_db;
+
+       s8  tx_rate_limits_normal[CONF_NUMBER_OF_RATE_GROUPS];
+       s8  tx_rate_limits_degraded[CONF_NUMBER_OF_RATE_GROUPS];
+
+       s8  tx_channel_limits_11b[CONF_NUMBER_OF_CHANNELS_2_4];
+       s8  tx_channel_limits_ofdm[CONF_NUMBER_OF_CHANNELS_2_4];
+       s8  tx_pdv_rate_offsets[CONF_NUMBER_OF_RATE_GROUPS];
+
+       u8  tx_ibias[CONF_NUMBER_OF_RATE_GROUPS];
+       u8  rx_fem_insertion_loss;
+
+       u8 padding2;
+
+       /* 5GHz */
+       __le16 tx_ref_pd_voltage_5[CONF_NUMBER_OF_SUB_BANDS_5];
+       s8  tx_ref_power_5[CONF_NUMBER_OF_SUB_BANDS_5];
+       s8  tx_offset_db_5[CONF_NUMBER_OF_SUB_BANDS_5];
+
+       s8  tx_rate_limits_normal_5[CONF_NUMBER_OF_RATE_GROUPS];
+       s8  tx_rate_limits_degraded_5[CONF_NUMBER_OF_RATE_GROUPS];
+
+       s8  tx_channel_limits_ofdm_5[CONF_NUMBER_OF_CHANNELS_5];
+       s8  tx_pdv_rate_offsets_5[CONF_NUMBER_OF_RATE_GROUPS];
+
+       /* FIXME: this is inconsistent with the types for 2.4GHz */
+       s8  tx_ibias_5[CONF_NUMBER_OF_RATE_GROUPS];
+       s8  rx_fem_insertion_loss_5[CONF_NUMBER_OF_SUB_BANDS_5];
+
+       u8 padding3[2];
+} __attribute__ ((packed));
 
 struct wl1271_cmd_cal_channel_tune {
        struct wl1271_cmd_header header;
@@ -425,7 +499,7 @@ struct wl1271_cmd_cal_channel_tune {
        u8 band;
        u8 channel;
 
-       u16 radio_status;
+       __le16 radio_status;
 } __attribute__ ((packed));
 
 struct wl1271_cmd_cal_update_ref_point {
@@ -433,8 +507,8 @@ struct wl1271_cmd_cal_update_ref_point {
 
        struct wl1271_cmd_test_header test;
 
-       s32 ref_power;
-       s32 ref_detector;
+       __le32 ref_power;
+       __le32 ref_detector;
        u8  sub_band;
        u8  padding[3];
 } __attribute__ ((packed));
@@ -449,16 +523,42 @@ struct wl1271_cmd_cal_p2g {
 
        struct wl1271_cmd_test_header test;
 
-       u16 len;
+       __le16 len;
        u8  buf[MAX_TLV_LENGTH];
        u8  type;
        u8  padding;
 
-       s16 radio_status;
+       __le16 radio_status;
        u8  nvs_version[MAX_NVS_VERSION_LENGTH];
 
        u8  sub_band_mask;
        u8  padding2;
 } __attribute__ ((packed));
 
+
+/*
+ * There are three types of disconnections:
+ *
+ * DISCONNECT_IMMEDIATE: the fw doesn't send any frames
+ * DISCONNECT_DEAUTH:    the fw generates a DEAUTH request with the reason
+ *                       we have passed
+ * DISCONNECT_DISASSOC:  the fw generates a DESASSOC request with the reason
+ *                       we have passed
+ */
+enum wl1271_disconnect_type {
+       DISCONNECT_IMMEDIATE,
+       DISCONNECT_DEAUTH,
+       DISCONNECT_DISASSOC
+};
+
+struct wl1271_cmd_disconnect {
+       __le32 rx_config_options;
+       __le32 rx_filter_options;
+
+       __le16 reason;
+       u8  type;
+
+       u8  padding;
+} __attribute__ ((packed));
+
 #endif /* __WL1271_CMD_H__ */