wlcore: track current channel type per vif
authorArik Nemtsov <arik@wizery.com>
Thu, 10 May 2012 09:13:30 +0000 (12:13 +0300)
committerLuciano Coelho <coelho@ti.com>
Tue, 5 Jun 2012 12:55:31 +0000 (15:55 +0300)
Track the current 802.11 channel type, defaulting to a NO_HT channel.
Update the channel type element when changed by mac80211.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/ti/wlcore/main.c
drivers/net/wireless/ti/wlcore/wl12xx.h
drivers/net/wireless/ti/wlcore/wlcore.h

index acef933..6f0361b 100644 (file)
@@ -1767,6 +1767,7 @@ static void wl1271_op_stop(struct ieee80211_hw *hw)
 
        wl->rx_counter = 0;
        wl->power_level = WL1271_DEFAULT_POWER_LEVEL;
+       wl->channel_type = NL80211_CHAN_NO_HT;
        wl->tx_blocks_available = 0;
        wl->tx_allocated_blocks = 0;
        wl->tx_results_count = 0;
@@ -1919,6 +1920,7 @@ static int wl12xx_init_vif_data(struct wl1271 *wl, struct ieee80211_vif *vif)
        wlvif->band = wl->band;
        wlvif->channel = wl->channel;
        wlvif->power_level = wl->power_level;
+       wlvif->channel_type = wl->channel_type;
 
        INIT_WORK(&wlvif->rx_streaming_enable_work,
                  wl1271_rx_streaming_enable_work);
@@ -2469,11 +2471,13 @@ static int wl12xx_config_vif(struct wl1271 *wl, struct wl12xx_vif *wlvif,
        /* if the channel changes while joined, join again */
        if (changed & IEEE80211_CONF_CHANGE_CHANNEL &&
            ((wlvif->band != conf->channel->band) ||
-            (wlvif->channel != channel))) {
+            (wlvif->channel != channel) ||
+            (wlvif->channel_type != conf->channel_type))) {
                /* send all pending packets */
                wl1271_tx_work_locked(wl);
                wlvif->band = conf->channel->band;
                wlvif->channel = channel;
+               wlvif->channel_type = conf->channel_type;
 
                if (!is_ap) {
                        /*
@@ -2593,6 +2597,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
        if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
                wl->band = conf->channel->band;
                wl->channel = channel;
+               wl->channel_type = conf->channel_type;
        }
 
        if (changed & IEEE80211_CONF_CHANGE_POWER)
@@ -3704,6 +3709,7 @@ sta_not_found:
                        u32 rates;
                        int ieoffset;
                        wlvif->aid = bss_conf->aid;
+                       wlvif->channel_type = bss_conf->channel_type;
                        wlvif->beacon_int = bss_conf->beacon_int;
                        do_join = true;
                        set_assoc = true;
@@ -5117,6 +5123,7 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size)
        wl->rx_counter = 0;
        wl->power_level = WL1271_DEFAULT_POWER_LEVEL;
        wl->band = IEEE80211_BAND_2GHZ;
+       wl->channel_type = NL80211_CHAN_NO_HT;
        wl->flags = 0;
        wl->sg_enabled = true;
        wl->hw_pg_ver = -1;
index f12bdf7..05e6f74 100644 (file)
@@ -367,6 +367,7 @@ struct wl12xx_vif {
        /* The current band */
        enum ieee80211_band band;
        int channel;
+       enum nl80211_channel_type channel_type;
 
        u32 bitrate_masks[IEEE80211_NUM_BANDS];
        u32 basic_rate_set;
index 2922d8a..83c43c9 100644 (file)
@@ -362,6 +362,9 @@ struct wl1271 {
 
        /* RX Data filter rule state - enabled/disabled */
        bool rx_filter_enabled[WL1271_MAX_RX_FILTERS];
+
+       /* the current channel type */
+       enum nl80211_channel_type channel_type;
 };
 
 int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);