Commit ea42e71c authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville

b43: store current channel using struct cfg80211_chan_def

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f9471e99
...@@ -3808,6 +3808,7 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed) ...@@ -3808,6 +3808,7 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
b43_mac_suspend(dev); b43_mac_suspend(dev);
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
phy->chandef = &conf->chandef;
phy->channel = conf->chandef.chan->hw_value; phy->channel = conf->chandef.chan->hw_value;
if (conf_is_ht(conf)) if (conf_is_ht(conf))
phy->is_40mhz = conf_is_ht40_minus(conf) || phy->is_40mhz = conf_is_ht40_minus(conf) ||
......
...@@ -94,8 +94,13 @@ int b43_phy_init(struct b43_wldev *dev) ...@@ -94,8 +94,13 @@ int b43_phy_init(struct b43_wldev *dev)
const struct b43_phy_operations *ops = phy->ops; const struct b43_phy_operations *ops = phy->ops;
int err; int err;
if (!phy->channel) /* During PHY init we need to use some channel. On the first init this
phy->channel = ops->get_default_chan(dev); * function is called *before* b43_op_config, so our pointer is NULL.
*/
if (!phy->chandef) {
phy->chandef = &dev->wl->hw->conf.chandef;
phy->channel = phy->chandef->chan->hw_value;
}
phy->ops->switch_analog(dev, true); phy->ops->switch_analog(dev, true);
b43_software_rfkill(dev, false); b43_software_rfkill(dev, false);
......
...@@ -267,6 +267,7 @@ struct b43_phy { ...@@ -267,6 +267,7 @@ struct b43_phy {
unsigned long next_txpwr_check_time; unsigned long next_txpwr_check_time;
/* Current channel */ /* Current channel */
struct cfg80211_chan_def *chandef;
unsigned int channel; unsigned int channel;
u16 channel_freq; u16 channel_freq;
enum nl80211_channel_type channel_type; enum nl80211_channel_type channel_type;
......
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