iwlwifi: configure uCode to use open loop tx power algorithm
[pandora-kernel.git] / drivers / net / wireless / iwlwifi / iwl-commands.h
index bad0e94..6957b22 100644 (file)
@@ -126,6 +126,7 @@ enum {
        /* Miscellaneous commands */
        QUIET_NOTIFICATION = 0x96,              /* not used */
        REPLY_TX_PWR_TABLE_CMD = 0x97,
+       REPLY_TX_POWER_DBM_CMD = 0x98,
        MEASURE_ABORT_NOTIFICATION = 0x99,      /* not used */
 
        /* Bluetooth device coexistance config command */
@@ -280,16 +281,7 @@ struct iwl_cmd_header {
 #define RATE_MCS_ANT_C_MSK    0x10000
 #define RATE_MCS_ANT_ABC_MSK  0x1C000
 
-
-/**
- * struct iwl4965_tx_power - txpower format used in REPLY_SCAN_CMD
- *
- * Scan uses only one transmitter, so only one analog/dsp gain pair is needed.
- */
-struct iwl4965_tx_power {
-       u8 tx_gain;             /* gain for analog radio */
-       u8 dsp_atten;           /* gain for DSP */
-} __attribute__ ((packed));
+#define RATE_MCS_ANT_INIT_IND   1
 
 #define POWER_TABLE_NUM_ENTRIES                        33
 #define POWER_TABLE_NUM_HT_OFDM_ENTRIES                32
@@ -339,6 +331,19 @@ struct iwl4965_tx_power_db {
        struct tx_power_dual_stream power_tbl[POWER_TABLE_NUM_ENTRIES];
 } __attribute__ ((packed));
 
+/**
+ * Commad REPLY_TX_POWER_DBM_CMD = 0x98
+ * struct iwl5000_tx_power_dbm_cmd
+ */
+#define IWL50_TX_POWER_AUTO 0x7f
+#define IWL50_TX_POWER_NO_CLOSED (0x1 << 6)
+
+struct iwl5000_tx_power_dbm_cmd {
+       s8 global_lmt; /*in half-dBm (e.g. 30 = 15 dBm) */
+       u8 flags;
+       s8 srv_chan_lmt; /*in half-dBm (e.g. 30 = 15 dBm) */
+       u8 reserved;
+} __attribute__ ((packed));
 
 /******************************************************************************
  * (0a)
@@ -630,6 +635,20 @@ struct iwl_rxon_cmd {
        __le16 reserved6;
 } __attribute__ ((packed));
 
+struct iwl5000_rxon_assoc_cmd {
+       __le32 flags;
+       __le32 filter_flags;
+       u8 ofdm_basic_rates;
+       u8 cck_basic_rates;
+       __le16 reserved1;
+       u8 ofdm_ht_single_stream_basic_rates;
+       u8 ofdm_ht_dual_stream_basic_rates;
+       u8 ofdm_ht_triple_stream_basic_rates;
+       u8 reserved2;
+       __le16 rx_chain_select_flags;
+       __le16 acquisition_data;
+       __le32 reserved3;
+} __attribute__ ((packed));
 
 /*
  * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response)
@@ -645,6 +664,9 @@ struct iwl4965_rxon_assoc_cmd {
        __le16 reserved;
 } __attribute__ ((packed));
 
+
+
+
 /*
  * REPLY_RXON_TIMING = 0x14 (command, has simple generic response)
  */
@@ -973,6 +995,7 @@ struct iwl_wep_cmd {
 #define WEP_KEY_WEP_TYPE 1
 #define WEP_KEYS_MAX 4
 #define WEP_INVALID_OFFSET 0xff
+#define WEP_KEY_LEN_64 5
 #define WEP_KEY_LEN_128 13
 
 /******************************************************************************
@@ -1365,6 +1388,15 @@ enum {
        TX_ABORT_REQUIRED_MSK = 0x80000000,     /* bits 31:31 */
 };
 
+static inline int iwl_is_tx_success(u32 status)
+{
+       status &= TX_STATUS_MSK;
+       return (status == TX_STATUS_SUCCESS)
+           || (status == TX_STATUS_DIRECT_DONE);
+}
+
+
+
 /* *******************************
  * TX aggregation status
  ******************************* */
@@ -1455,21 +1487,10 @@ struct iwl4965_tx_resp {
         *                   table entry used for all frames in the new agg.
         *           31-16:  Sequence # for this frame's Tx cmd (not SSN!)
         */
-       __le32 status;  /* TX status (for aggregation status of 1st frame) */
-} __attribute__ ((packed));
-
-struct iwl4965_tx_resp_agg {
-       u8 frame_count;         /* 1 no aggregation, >1 aggregation */
-       u8 reserved1;
-       u8 failure_rts;
-       u8 failure_frame;
-       __le32 rate_n_flags;
-       __le16 wireless_media_time;
-       __le16 reserved3;
-       __le32 pa_power1;
-       __le32 pa_power2;
-       struct agg_tx_status status;    /* TX status (for aggregation status */
-                                       /* of 1st frame) */
+       union {
+               __le32 status;
+               struct agg_tx_status agg_status[0]; /* for each agg frame */
+       } u;
 } __attribute__ ((packed));
 
 struct iwl5000_tx_resp {
@@ -2059,7 +2080,7 @@ struct iwl4965_card_state_notif {
 #define RF_CARD_DISABLED   0x04
 #define RXON_CARD_DISABLED 0x10
 
-struct iwl4965_ct_kill_config {
+struct iwl_ct_kill_config {
        __le32   reserved;
        __le32   critical_temperature_M;
        __le32   critical_temperature_R;
@@ -2072,7 +2093,7 @@ struct iwl4965_ct_kill_config {
  *****************************************************************************/
 
 /**
- * struct iwl4965_scan_channel - entry in REPLY_SCAN_CMD channel table
+ * struct iwl_scan_channel - entry in REPLY_SCAN_CMD channel table
  *
  * One for each channel in the scan list.
  * Each channel can independently select:
@@ -2082,7 +2103,7 @@ struct iwl4965_ct_kill_config {
  *     quiet_plcp_th, good_CRC_th)
  *
  * To avoid uCode errors, make sure the following are true (see comments
- * under struct iwl4965_scan_cmd about max_out_time and quiet_time):
+ * under struct iwl_scan_cmd about max_out_time and quiet_time):
  * 1)  If using passive_dwell (i.e. passive_dwell != 0):
  *     active_dwell <= passive_dwell (< max_out_time if max_out_time != 0)
  * 2)  quiet_time <= active_dwell
@@ -2090,7 +2111,7 @@ struct iwl4965_ct_kill_config {
  *     passive_dwell < max_out_time
  *     active_dwell < max_out_time
  */
-struct iwl4965_scan_channel {
+struct iwl_scan_channel {
        /*
         * type is defined as:
         * 0:0 1 = active, 0 = passive
@@ -2100,19 +2121,20 @@ struct iwl4965_scan_channel {
         */
        u8 type;
        u8 channel;     /* band is selected by iwl4965_scan_cmd "flags" field */
-       struct iwl4965_tx_power tpc;
+       u8 tx_gain;             /* gain for analog radio */
+       u8 dsp_atten;           /* gain for DSP */
        __le16 active_dwell;    /* in 1024-uSec TU (time units), typ 5-50 */
        __le16 passive_dwell;   /* in 1024-uSec TU (time units), typ 20-500 */
 } __attribute__ ((packed));
 
 /**
- * struct iwl4965_ssid_ie - directed scan network information element
+ * struct iwl_ssid_ie - directed scan network information element
  *
  * Up to 4 of these may appear in REPLY_SCAN_CMD, selected by "type" field
  * in struct iwl4965_scan_channel; each channel may select different ssids from
  * among the 4 entries.  SSID IEs get transmitted in reverse order of entry.
  */
-struct iwl4965_ssid_ie {
+struct iwl_ssid_ie {
        u8 id;
        u8 len;
        u8 ssid[32];
@@ -2173,9 +2195,9 @@ struct iwl4965_ssid_ie {
  * Driver must use separate scan commands for 2.4 vs. 5 GHz bands.
  *
  * To avoid uCode errors, see timing restrictions described under
- * struct iwl4965_scan_channel.
+ * struct iwl_scan_channel.
  */
-struct iwl4965_scan_cmd {
+struct iwl_scan_cmd {
        __le16 len;
        u8 reserved0;
        u8 channel_count;       /* # channels in channel list */
@@ -2199,7 +2221,7 @@ struct iwl4965_scan_cmd {
        struct iwl_tx_cmd tx_cmd;
 
        /* For directed active scans (set to all-0s otherwise) */
-       struct iwl4965_ssid_ie direct_scan[PROBE_OPTION_MAX];
+       struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
 
        /*
         * Probe request frame, followed by channel list.
@@ -2227,14 +2249,14 @@ struct iwl4965_scan_cmd {
 /*
  * REPLY_SCAN_CMD = 0x80 (response)
  */
-struct iwl4965_scanreq_notification {
+struct iwl_scanreq_notification {
        __le32 status;          /* 1: okay, 2: cannot fulfill request */
 } __attribute__ ((packed));
 
 /*
  * SCAN_START_NOTIFICATION = 0x82 (notification only, not a command)
  */
-struct iwl4965_scanstart_notification {
+struct iwl_scanstart_notification {
        __le32 tsf_low;
        __le32 tsf_high;
        __le32 beacon_timer;
@@ -2251,7 +2273,7 @@ struct iwl4965_scanstart_notification {
 /*
  * SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command)
  */
-struct iwl4965_scanresults_notification {
+struct iwl_scanresults_notification {
        u8 channel;
        u8 band;
        u8 reserved[2];
@@ -2263,7 +2285,7 @@ struct iwl4965_scanresults_notification {
 /*
  * SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command)
  */
-struct iwl4965_scancomplete_notification {
+struct iwl_scancomplete_notification {
        u8 scanned_channels;
        u8 status;
        u8 reserved;