Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Rafał Miłecki and committed by
John W. Linville
39ca554c 5192bf56

+59 -2
+59 -2
drivers/net/wireless/b43/phy_ht.c
··· 27 27 #include "radio_2059.h" 28 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 74 * Basic PHY ops. 32 75 **************************************************/ ··· 139 96 } 140 97 } 141 98 99 + static int b43_phy_ht_op_switch_channel(struct b43_wldev *dev, 100 + unsigned int new_channel) 101 + { 102 + struct ieee80211_channel *channel = dev->wl->hw->conf.channel; 103 + enum nl80211_channel_type channel_type = dev->wl->hw->conf.channel_type; 104 + 105 + if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) { 106 + if ((new_channel < 1) || (new_channel > 14)) 107 + return -EINVAL; 108 + } else { 109 + return -EINVAL; 110 + } 111 + 112 + return b43_phy_ht_set_channel(dev, channel, channel_type); 113 + } 114 + 142 115 static unsigned int b43_phy_ht_op_get_default_chan(struct b43_wldev *dev) 143 116 { 144 117 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) ··· 220 161 .radio_write = b43_phy_ht_op_radio_write, 221 162 .software_rfkill = b43_phy_ht_op_software_rfkill, 222 163 .switch_analog = b43_phy_ht_op_switch_analog, 223 - /* 224 164 .switch_channel = b43_phy_ht_op_switch_channel, 225 - */ 226 165 .get_default_chan = b43_phy_ht_op_get_default_chan, 227 166 /* 228 167 .recalc_txpower = b43_phy_ht_op_recalc_txpower,