iwlwifi: unify tx antenna toggling
[cascardo/linux.git] / drivers / net / wireless / iwlwifi / iwl-commands.h
index 8d04e96..67680a7 100644 (file)
@@ -98,6 +98,11 @@ enum {
        COEX_MEDIUM_NOTIFICATION = 0x5b,
        COEX_EVENT_CMD = 0x5c,
 
+       /* Calibration */
+       CALIBRATION_CFG_CMD = 0x65,
+       CALIBRATION_RES_NOTIFICATION = 0x66,
+       CALIBRATION_COMPLETE_NOTIFICATION = 0x67,
+
        /* 802.11h related */
        RADAR_NOTIFICATION = 0x70,      /* not used */
        REPLY_QUIET_CMD = 0x71,         /* not used */
@@ -278,18 +283,20 @@ struct iwl_cmd_header {
 #define RATE_MCS_SGI_MSK 0x2000
 
 /**
- * rate_n_flags Tx antenna masks (4965 has 2 transmitters):
- * bit14:15 01 B inactive, A active
- *          10 B active, A inactive
- *          11 Both active
+ * rate_n_flags Tx antenna masks
+ * 4965 has 2 transmitters
+ * 5100 has 1 transmitter B
+ * 5150 has 1 transmitter A
+ * 5300 has 3 transmitters
+ * 5350 has 3 transmitters
+ * bit14:16
  */
 #define RATE_MCS_ANT_POS      14
 #define RATE_MCS_ANT_A_MSK    0x04000
 #define RATE_MCS_ANT_B_MSK    0x08000
 #define RATE_MCS_ANT_C_MSK    0x10000
 #define RATE_MCS_ANT_ABC_MSK  0x1C000
-
-#define RATE_MCS_ANT_INIT_IND   1
+#define RATE_ANT_NUM 3
 
 #define POWER_TABLE_NUM_ENTRIES                        33
 #define POWER_TABLE_NUM_HT_OFDM_ENTRIES                32
@@ -477,11 +484,6 @@ struct iwl_alive_resp {
 } __attribute__ ((packed));
 
 
-union tsf {
-       u8 byte[8];
-       __le16 word[4];
-       __le32 dw[2];
-};
 
 /*
  * REPLY_ERROR = 0x2 (response only, not a command)
@@ -492,7 +494,7 @@ struct iwl_error_resp {
        u8 reserved1;
        __le16 bad_cmd_seq_num;
        __le32 error_info;
-       union tsf timestamp;
+       __le64 timestamp;
 } __attribute__ ((packed));
 
 /******************************************************************************
@@ -679,8 +681,8 @@ struct iwl4965_rxon_assoc_cmd {
 /*
  * REPLY_RXON_TIMING = 0x14 (command, has simple generic response)
  */
-struct iwl4965_rxon_time_cmd {
-       union tsf timestamp;
+struct iwl_rxon_time_cmd {
+       __le64 timestamp;
        __le16 beacon_interval;
        __le16 atim_window;
        __le32 beacon_init_val;
@@ -2879,25 +2881,11 @@ enum {
        IWL5000_PHY_CALIBRATE_CHAIN_NOISE_GAIN_CMD = 19,
 };
 
-enum {
-       CALIBRATION_CFG_CMD = 0x65,
-       CALIBRATION_RES_NOTIFICATION = 0x66,
-       CALIBRATION_COMPLETE_NOTIFICATION = 0x67
-};
-
-struct iwl_cal_crystal_freq_cmd {
+struct iwl_cal_xtal_freq {
        u8 cap_pin1;
        u8 cap_pin2;
 } __attribute__ ((packed));
 
-struct iwl5000_calibration {
-       u8 op_code;
-       u8 first_group;
-       u8 num_groups;
-       u8 all_data_valid;
-       struct iwl_cal_crystal_freq_cmd data;
-} __attribute__ ((packed));
-
 #define IWL_CALIB_INIT_CFG_ALL __constant_cpu_to_le32(0xffffffff)
 
 struct iwl_calib_cfg_elmnt_s {
@@ -2927,6 +2915,11 @@ struct iwl5000_calib_hdr {
        u8 data_valid;
 } __attribute__ ((packed));
 
+struct iwl5000_calib_cmd {
+       struct iwl5000_calib_hdr hdr;
+       u8 data[0];
+} __attribute__ ((packed));
+
 struct iwl5000_calibration_chain_noise_reset_cmd {
        u8 op_code;     /* IWL5000_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD */
        u8 flags;       /* not used */
@@ -3039,7 +3032,6 @@ struct iwl_rx_packet {
                struct iwl_notif_statistics stats;
                struct iwl_compressed_ba_resp compressed_ba;
                struct iwl4965_missed_beacon_notif missed_beacon;
-               struct iwl5000_calibration calib;
                __le32 status;
                u8 raw[0];
        } u;