cfg80211 API for channels/bitrates, mac80211 and driver conversion
[GitHub/LineageOS/android_kernel_samsung_universal7580.git] / drivers / net / wireless / iwlwifi / iwl-4965.h
index 9cb82be0ff80a19b0e5b7fa179625bcb2f21c086..cb8f7f2a8d488815c00db2a2e5a73bafafdaa9ff 100644 (file)
@@ -206,7 +206,7 @@ struct iwl4965_channel_info {
 
        u8 group_index;   /* 0-4, maps channel to group1/2/3/4/5 */
        u8 band_index;    /* 0-4, maps channel to band1/2/3/4/5 */
-       u8 phymode;       /* MODE_IEEE80211{A,B,G} */
+       enum ieee80211_band band;
 
        /* Radio/DSP gain settings for each "normal" data Tx rate.
         * These include, in addition to RF and DSP gain, a few fields for
@@ -433,7 +433,6 @@ struct iwl4965_rx_queue {
 #define IWL_INVALID_VALUE    -1
 
 #ifdef CONFIG_IWL4965_HT
-#ifdef CONFIG_IWL4965_HT_AGG
 /**
  * struct iwl4965_ht_agg -- aggregation status while waiting for block-ack
  * @txq_id: Tx queue used for Tx attempt
@@ -453,19 +452,22 @@ struct iwl4965_ht_agg {
        u16 frame_count;
        u16 wait_for_ba;
        u16 start_idx;
-       u32 bitmap0;
-       u32 bitmap1;
+       u64 bitmap;
        u32 rate_n_flags;
+#define IWL_AGG_OFF 0
+#define IWL_AGG_ON 1
+#define IWL_EMPTYING_HW_QUEUE_ADDBA 2
+#define IWL_EMPTYING_HW_QUEUE_DELBA 3
+       u8 state;
 };
-#endif /* CONFIG_IWL4965_HT_AGG */
+
 #endif /* CONFIG_IWL4965_HT */
 
 struct iwl4965_tid_data {
        u16 seq_number;
+       u16 tfds_in_queue;
 #ifdef CONFIG_IWL4965_HT
-#ifdef CONFIG_IWL4965_HT_AGG
        struct iwl4965_ht_agg agg;
-#endif /* CONFIG_IWL4965_HT_AGG */
 #endif /* CONFIG_IWL4965_HT */
 };
 
@@ -743,7 +745,7 @@ extern u8 iwl4965_hw_find_station(struct iwl4965_priv *priv, const u8 *bssid);
 
 extern int iwl4965_hw_channel_switch(struct iwl4965_priv *priv, u16 channel);
 extern int iwl4965_tx_queue_reclaim(struct iwl4965_priv *priv, int txq_id, int index);
-
+extern int iwl4965_queue_space(const struct iwl4965_queue *q);
 struct iwl4965_priv;
 
 /*
@@ -762,7 +764,8 @@ extern void iwl4965_update_rate_scaling(struct iwl4965_priv *priv, u8 mode);
 extern void iwl4965_chain_noise_reset(struct iwl4965_priv *priv);
 extern void iwl4965_init_sensitivity(struct iwl4965_priv *priv, u8 flags,
                                     u8 force);
-extern int iwl4965_set_fat_chan_info(struct iwl4965_priv *priv, int phymode,
+extern int iwl4965_set_fat_chan_info(struct iwl4965_priv *priv,
+                               enum ieee80211_band band,
                                u16 channel,
                                const struct iwl4965_eeprom_channel *eeprom_ch,
                                u8 fat_extension_channel);
@@ -777,16 +780,9 @@ extern void iwl4965_set_ht_add_station(struct iwl4965_priv *priv, u8 index,
                                struct ieee80211_ht_info *sta_ht_inf);
 extern int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw,
                                    enum ieee80211_ampdu_mlme_action action,
-                                   const u8 *addr, u16 tid, u16 ssn);
-#ifdef CONFIG_IWL4965_HT_AGG
-extern int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da,
-                                  u16 tid, u16 *start_seq_num);
-extern int iwl4965_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, u8 *da,
-                                 u16 tid, int generator);
-extern void iwl4965_turn_off_agg(struct iwl4965_priv *priv, u8 tid);
-extern void iwl4965_tl_get_stats(struct iwl4965_priv *priv,
-                               struct ieee80211_hdr *hdr);
-#endif /* CONFIG_IWL4965_HT_AGG */
+                                   const u8 *addr, u16 tid, u16 *ssn);
+extern int iwl4965_check_empty_hw_queue(struct iwl4965_priv *priv, int sta_id,
+                                       u8 tid, int txq_id);
 #endif /*CONFIG_IWL4965_HT */
 /* Structures, enum, and defines specific to the 4965 */
 
@@ -798,18 +794,6 @@ struct iwl4965_kw {
        size_t size;
 };
 
-#define TID_QUEUE_CELL_SPACING 50      /*mS */
-#define TID_QUEUE_MAX_SIZE     20
-#define TID_ROUND_VALUE        5       /* mS */
-#define TID_MAX_LOAD_COUNT     8
-
-#define TID_MAX_TIME_DIFF ((TID_QUEUE_MAX_SIZE - 1) * TID_QUEUE_CELL_SPACING)
-#define TIME_WRAP_AROUND(x, y) (((y) > (x)) ? (y) - (x) : (0-(x)) + (y))
-
-#define TID_ALL_ENABLED                0x7f
-#define TID_ALL_SPECIFIED       0xff
-#define TID_AGG_TPT_THREHOLD    0x0
-
 #define IWL_CHANNEL_WIDTH_20MHZ   0
 #define IWL_CHANNEL_WIDTH_40MHZ   1
 
@@ -834,37 +818,7 @@ struct iwl4965_kw {
 
 #define TX_POWER_IWL_ILLEGAL_VOLTAGE -10000
 
-struct iwl4965_traffic_load {
-       unsigned long time_stamp;
-       u32 packet_count[TID_QUEUE_MAX_SIZE];
-       u8 queue_count;
-       u8 head;
-       u32 total;
-};
-
-#ifdef CONFIG_IWL4965_HT_AGG
-/**
- * struct iwl4965_agg_control
- * @requested_ba: bit map of tids requesting aggregation/block-ack
- * @granted_ba: bit map of tids granted aggregation/block-ack
- */
-struct iwl4965_agg_control {
-       unsigned long next_retry;
-       u32 wait_for_agg_status;
-       u32 tid_retry;
-       u32 requested_ba;
-       u32 granted_ba;
-       u8 auto_agg;
-       u32 tid_traffic_load_threshold;
-       u32 ba_timeout;
-       struct iwl4965_traffic_load traffic_load[TID_MAX_LOAD_COUNT];
-};
-#endif                         /*CONFIG_IWL4965_HT_AGG */
-
 struct iwl4965_lq_mngr {
-#ifdef CONFIG_IWL4965_HT_AGG
-       struct iwl4965_agg_control agg_ctrl;
-#endif
        spinlock_t lock;
        s32 max_window_size;
        s32 *expected_tpt;
@@ -877,7 +831,6 @@ struct iwl4965_lq_mngr {
        u8 lq_ready;
 };
 
-
 /* Sensitivity and chain noise calibration */
 #define INTERFERENCE_DATA_AVAILABLE    __constant_cpu_to_le32(1)
 #define INITIALIZATION_VALUE           0xFFFF
@@ -1025,14 +978,14 @@ struct iwl4965_priv {
        struct list_head free_frames;
        int frames_count;
 
-       u8 phymode;
+       enum ieee80211_band band;
        int alloc_rxb_skb;
        bool add_radiotap;
 
        void (*rx_handlers[REPLY_MAX])(struct iwl4965_priv *priv,
                                       struct iwl4965_rx_mem_buffer *rxb);
 
-       const struct ieee80211_hw_mode *modes;
+       struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS];
 
 #ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT
        /* spectrum measurement report caching */
@@ -1265,11 +1218,7 @@ struct iwl4965_priv {
 #endif
        struct work_struct statistics_work;
        struct timer_list statistics_periodic;
-
-#ifdef CONFIG_IWL4965_HT_AGG
-       struct work_struct agg_work;
-#endif
-};                             /*iwl4965_priv */
+}; /*iwl4965_priv */
 
 static inline int iwl4965_is_associated(struct iwl4965_priv *priv)
 {
@@ -1295,13 +1244,12 @@ static inline int is_channel_radar(const struct iwl4965_channel_info *ch_info)
 
 static inline u8 is_channel_a_band(const struct iwl4965_channel_info *ch_info)
 {
-       return ch_info->phymode == MODE_IEEE80211A;
+       return ch_info->band == IEEE80211_BAND_5GHZ;
 }
 
 static inline u8 is_channel_bg_band(const struct iwl4965_channel_info *ch_info)
 {
-       return ((ch_info->phymode == MODE_IEEE80211B) ||
-               (ch_info->phymode == MODE_IEEE80211G));
+       return ch_info->band == IEEE80211_BAND_2GHZ;
 }
 
 static inline int is_channel_passive(const struct iwl4965_channel_info *ch)
@@ -1315,7 +1263,7 @@ static inline int is_channel_ibss(const struct iwl4965_channel_info *ch)
 }
 
 extern const struct iwl4965_channel_info *iwl4965_get_channel_info(
-       const struct iwl4965_priv *priv, int phymode, u16 channel);
+       const struct iwl4965_priv *priv, enum ieee80211_band band, u16 channel);
 
 /* Requires full declaration of iwl4965_priv before including */
 #include "iwl-4965-io.h"