Commit 83d08d3f authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Luciano Coelho

wlcore: track current channel type per vif

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: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 23ee9bf8
...@@ -1767,6 +1767,7 @@ static void wl1271_op_stop(struct ieee80211_hw *hw) ...@@ -1767,6 +1767,7 @@ static void wl1271_op_stop(struct ieee80211_hw *hw)
wl->rx_counter = 0; wl->rx_counter = 0;
wl->power_level = WL1271_DEFAULT_POWER_LEVEL; wl->power_level = WL1271_DEFAULT_POWER_LEVEL;
wl->channel_type = NL80211_CHAN_NO_HT;
wl->tx_blocks_available = 0; wl->tx_blocks_available = 0;
wl->tx_allocated_blocks = 0; wl->tx_allocated_blocks = 0;
wl->tx_results_count = 0; wl->tx_results_count = 0;
...@@ -1919,6 +1920,7 @@ static int wl12xx_init_vif_data(struct wl1271 *wl, struct ieee80211_vif *vif) ...@@ -1919,6 +1920,7 @@ static int wl12xx_init_vif_data(struct wl1271 *wl, struct ieee80211_vif *vif)
wlvif->band = wl->band; wlvif->band = wl->band;
wlvif->channel = wl->channel; wlvif->channel = wl->channel;
wlvif->power_level = wl->power_level; wlvif->power_level = wl->power_level;
wlvif->channel_type = wl->channel_type;
INIT_WORK(&wlvif->rx_streaming_enable_work, INIT_WORK(&wlvif->rx_streaming_enable_work,
wl1271_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, ...@@ -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 the channel changes while joined, join again */
if (changed & IEEE80211_CONF_CHANGE_CHANNEL && if (changed & IEEE80211_CONF_CHANGE_CHANNEL &&
((wlvif->band != conf->channel->band) || ((wlvif->band != conf->channel->band) ||
(wlvif->channel != channel))) { (wlvif->channel != channel) ||
(wlvif->channel_type != conf->channel_type))) {
/* send all pending packets */ /* send all pending packets */
wl1271_tx_work_locked(wl); wl1271_tx_work_locked(wl);
wlvif->band = conf->channel->band; wlvif->band = conf->channel->band;
wlvif->channel = channel; wlvif->channel = channel;
wlvif->channel_type = conf->channel_type;
if (!is_ap) { if (!is_ap) {
/* /*
...@@ -2593,6 +2597,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed) ...@@ -2593,6 +2597,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
wl->band = conf->channel->band; wl->band = conf->channel->band;
wl->channel = channel; wl->channel = channel;
wl->channel_type = conf->channel_type;
} }
if (changed & IEEE80211_CONF_CHANGE_POWER) if (changed & IEEE80211_CONF_CHANGE_POWER)
...@@ -3704,6 +3709,7 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl, ...@@ -3704,6 +3709,7 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
u32 rates; u32 rates;
int ieoffset; int ieoffset;
wlvif->aid = bss_conf->aid; wlvif->aid = bss_conf->aid;
wlvif->channel_type = bss_conf->channel_type;
wlvif->beacon_int = bss_conf->beacon_int; wlvif->beacon_int = bss_conf->beacon_int;
do_join = true; do_join = true;
set_assoc = true; set_assoc = true;
...@@ -5117,6 +5123,7 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size) ...@@ -5117,6 +5123,7 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size)
wl->rx_counter = 0; wl->rx_counter = 0;
wl->power_level = WL1271_DEFAULT_POWER_LEVEL; wl->power_level = WL1271_DEFAULT_POWER_LEVEL;
wl->band = IEEE80211_BAND_2GHZ; wl->band = IEEE80211_BAND_2GHZ;
wl->channel_type = NL80211_CHAN_NO_HT;
wl->flags = 0; wl->flags = 0;
wl->sg_enabled = true; wl->sg_enabled = true;
wl->hw_pg_ver = -1; wl->hw_pg_ver = -1;
......
...@@ -367,6 +367,7 @@ struct wl12xx_vif { ...@@ -367,6 +367,7 @@ struct wl12xx_vif {
/* The current band */ /* The current band */
enum ieee80211_band band; enum ieee80211_band band;
int channel; int channel;
enum nl80211_channel_type channel_type;
u32 bitrate_masks[IEEE80211_NUM_BANDS]; u32 bitrate_masks[IEEE80211_NUM_BANDS];
u32 basic_rate_set; u32 basic_rate_set;
......
...@@ -362,6 +362,9 @@ struct wl1271 { ...@@ -362,6 +362,9 @@ struct wl1271 {
/* RX Data filter rule state - enabled/disabled */ /* RX Data filter rule state - enabled/disabled */
bool rx_filter_enabled[WL1271_MAX_RX_FILTERS]; 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); int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment