]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
b43: N-PHY: store info about current channel's type
authorRafał Miłecki <zajec5@gmail.com>
Mon, 11 Oct 2010 01:11:02 +0000 (03:11 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 11 Oct 2010 19:04:24 +0000 (15:04 -0400)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/b43/phy_common.h
drivers/net/wireless/b43/phy_n.c
drivers/net/wireless/b43/phy_n.h

index bd480b481bfc387da47d8744e2174e3f5da7111f..6dcd0334ed025ad7adeee0ef08974335f0b23ad0 100644 (file)
@@ -2,6 +2,7 @@
 #define LINUX_B43_PHY_COMMON_H_
 
 #include <linux/types.h>
+#include <linux/nl80211.h>
 
 struct b43_wldev;
 
@@ -250,8 +251,9 @@ struct b43_phy {
         * check is needed. */
        unsigned long next_txpwr_check_time;
 
-       /* current channel */
+       /* Current channel */
        unsigned int channel;
+       enum nl80211_channel_type channel_type;
 
        /* PHY TX errors counter. */
        atomic_t txerr_cnt;
index 6ca41a09fec461cd397cebcee17b1ae625dead59..789d21c5413913e939d947fe303c601ae0dc3d68 100644 (file)
@@ -74,6 +74,13 @@ static void b43_nphy_rf_control_override(struct b43_wldev *dev, u16 field,
 static void b43_nphy_rf_control_intc_override(struct b43_wldev *dev, u8 field,
                                                u16 value, u8 core);
 
+static inline bool b43_channel_type_is_40mhz(
+                                       enum nl80211_channel_type channel_type)
+{
+       return (channel_type == NL80211_CHAN_HT40MINUS ||
+               channel_type == NL80211_CHAN_HT40PLUS);
+}
+
 static inline bool b43_empty_chanspec(struct b43_chanspec *chanspec)
 {
        return !chanspec->channel && !chanspec->sideband &&
@@ -3404,10 +3411,9 @@ static int b43_nphy_set_channel(struct b43_wldev *dev,
 
        nphy->radio_chanspec.channel = channel->hw_value;
 
-       /*
-       if (chanspec.b_width != nphy->b_width)
-               ; TODO: BMAC BW Set (chanspec.b_width)
-       */
+       if (b43_channel_type_is_40mhz(phy->channel_type) !=
+               b43_channel_type_is_40mhz(channel_type))
+               ; /* TODO: BMAC BW Set (channel_type) */
 
        if (channel_type == NL80211_CHAN_HT40PLUS)
                b43_phy_set(dev, B43_NPHY_RXCTL,
index 8b6d570dd0aa963878b31e8b76fda75e9ea92d1b..e7acae278be06c38c2e235d5701d38954d019814 100644 (file)
@@ -984,7 +984,6 @@ struct b43_phy_n {
        u16 papd_epsilon_offset[2];
        s32 preamble_override;
        u32 bb_mult_save;
-       u8 b_width;
        struct b43_chanspec radio_chanspec;
 
        bool gain_boost;