diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2011-06-19 06:17:20 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-06-22 16:09:42 -0400 |
commit | 39ca554c96d25436b7c9acdd8f3b5fb9702049c6 (patch) | |
tree | d0b470c98c0315a5f584d73b085c6e66fd92fcfe | |
parent | 5192bf56b9bb0d90c9aa08e5593ea4897309fc07 (diff) |
b43: HT-PHY: add place for implementing channel switching
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/b43/phy_ht.c | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c index 763dbb0f4179..12ad47f38dff 100644 --- a/drivers/net/wireless/b43/phy_ht.c +++ b/drivers/net/wireless/b43/phy_ht.c | |||
@@ -27,6 +27,49 @@ | |||
27 | #include "radio_2059.h" | 27 | #include "radio_2059.h" |
28 | #include "main.h" | 28 | #include "main.h" |
29 | 29 | ||
30 | static void b43_radio_2059_channel_setup(struct b43_wldev *dev, | ||
31 | const struct b43_phy_ht_channeltab_e_radio2059 *e) | ||
32 | { | ||
33 | /* TODO */ | ||
34 | } | ||
35 | |||
36 | static void b43_phy_ht_channel_setup(struct b43_wldev *dev, | ||
37 | const struct b43_phy_ht_channeltab_e_phy *e, | ||
38 | struct ieee80211_channel *new_channel) | ||
39 | { | ||
40 | /* TODO */ | ||
41 | } | ||
42 | |||
43 | static int b43_phy_ht_set_channel(struct b43_wldev *dev, | ||
44 | struct ieee80211_channel *channel, | ||
45 | enum nl80211_channel_type channel_type) | ||
46 | { | ||
47 | struct b43_phy *phy = &dev->phy; | ||
48 | |||
49 | const struct b43_phy_ht_channeltab_e_radio2059 *chent_r2059 = NULL; | ||
50 | |||
51 | if (phy->radio_ver == 0x2059) { | ||
52 | chent_r2059 = b43_phy_ht_get_channeltab_e_r2059(dev, | ||
53 | channel->center_freq); | ||
54 | if (!chent_r2059) | ||
55 | return -ESRCH; | ||
56 | } else { | ||
57 | return -ESRCH; | ||
58 | } | ||
59 | |||
60 | /* TODO: In case of N-PHY some bandwidth switching goes here */ | ||
61 | |||
62 | if (phy->radio_ver == 0x2059) { | ||
63 | b43_radio_2059_channel_setup(dev, chent_r2059); | ||
64 | b43_phy_ht_channel_setup(dev, &(chent_r2059->phy_regs), | ||
65 | channel); | ||
66 | } else { | ||
67 | return -ESRCH; | ||
68 | } | ||
69 | |||
70 | return 0; | ||
71 | } | ||
72 | |||
30 | /************************************************** | 73 | /************************************************** |
31 | * Basic PHY ops. | 74 | * Basic PHY ops. |
32 | **************************************************/ | 75 | **************************************************/ |
@@ -96,6 +139,22 @@ static void b43_phy_ht_op_switch_analog(struct b43_wldev *dev, bool on) | |||
96 | } | 139 | } |
97 | } | 140 | } |
98 | 141 | ||
142 | static int b43_phy_ht_op_switch_channel(struct b43_wldev *dev, | ||
143 | unsigned int new_channel) | ||
144 | { | ||
145 | struct ieee80211_channel *channel = dev->wl->hw->conf.channel; | ||
146 | enum nl80211_channel_type channel_type = dev->wl->hw->conf.channel_type; | ||
147 | |||
148 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) { | ||
149 | if ((new_channel < 1) || (new_channel > 14)) | ||
150 | return -EINVAL; | ||
151 | } else { | ||
152 | return -EINVAL; | ||
153 | } | ||
154 | |||
155 | return b43_phy_ht_set_channel(dev, channel, channel_type); | ||
156 | } | ||
157 | |||
99 | static unsigned int b43_phy_ht_op_get_default_chan(struct b43_wldev *dev) | 158 | static unsigned int b43_phy_ht_op_get_default_chan(struct b43_wldev *dev) |
100 | { | 159 | { |
101 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) | 160 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) |
@@ -161,9 +220,7 @@ const struct b43_phy_operations b43_phyops_ht = { | |||
161 | .radio_write = b43_phy_ht_op_radio_write, | 220 | .radio_write = b43_phy_ht_op_radio_write, |
162 | .software_rfkill = b43_phy_ht_op_software_rfkill, | 221 | .software_rfkill = b43_phy_ht_op_software_rfkill, |
163 | .switch_analog = b43_phy_ht_op_switch_analog, | 222 | .switch_analog = b43_phy_ht_op_switch_analog, |
164 | /* | ||
165 | .switch_channel = b43_phy_ht_op_switch_channel, | 223 | .switch_channel = b43_phy_ht_op_switch_channel, |
166 | */ | ||
167 | .get_default_chan = b43_phy_ht_op_get_default_chan, | 224 | .get_default_chan = b43_phy_ht_op_get_default_chan, |
168 | /* | 225 | /* |
169 | .recalc_txpower = b43_phy_ht_op_recalc_txpower, | 226 | .recalc_txpower = b43_phy_ht_op_recalc_txpower, |