b43: store current channel using struct cfg80211_chan_def
authorRafał Miłecki <zajec5@gmail.com>
Sat, 31 May 2014 18:49:38 +0000 (20:49 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 19 Jun 2014 19:49:13 +0000 (15:49 -0400)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/b43/main.c
drivers/net/wireless/b43/phy_common.c
drivers/net/wireless/b43/phy_common.h

index 5e4eed37e3ce2faea6dfaf38c49941b79372727b..2b99ed31ab08e75a183a3217e4928d84706d7bb1 100644 (file)
@@ -3808,6 +3808,7 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
        b43_mac_suspend(dev);
 
        if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
+               phy->chandef = &conf->chandef;
                phy->channel = conf->chandef.chan->hw_value;
                if (conf_is_ht(conf))
                        phy->is_40mhz = conf_is_ht40_minus(conf) ||
index b465011c14ea9c4cb813628788ba55cfab3d5d73..9aa6c9c5739395106d3cd48f0e5ee98abfb94499 100644 (file)
@@ -94,8 +94,13 @@ int b43_phy_init(struct b43_wldev *dev)
        const struct b43_phy_operations *ops = phy->ops;
        int err;
 
-       if (!phy->channel)
-               phy->channel = ops->get_default_chan(dev);
+       /* During PHY init we need to use some channel. On the first init this
+        * 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);
        b43_software_rfkill(dev, false);
index 9a92df46ae844981fa4c30d8a3c8107273c58f9f..56dfe7aa50a7d3277d8459a2633bfbf59a7b43b8 100644 (file)
@@ -267,6 +267,7 @@ struct b43_phy {
        unsigned long next_txpwr_check_time;
 
        /* Current channel */
+       struct cfg80211_chan_def *chandef;
        unsigned int channel;
        u16 channel_freq;
        enum nl80211_channel_type channel_type;