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

b43: HT-PHY: implement killing radio

Closed drivers kill radio right after reading radio version and MACCTL,
so it was easy to find related PHY ops:
phy_read(0x0810) -> 0x0000
phy_write(0x0810) <- 0x0000
To find out the mask of above OP, MMIO hack was used to fake read val:
phy_read(0x0810) -> 0xffff
phy_write(0x0810) <- 0x0000

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
e7c62552 1c1236e3

+15 -2
+13 -2
drivers/net/wireless/b43/phy_ht.c
··· 59 59 phy->ht = NULL; 60 60 } 61 61 62 + /* http://bcm-v4.sipsolutions.net/802.11/Radio/Switch%20Radio */ 63 + static void b43_phy_ht_op_software_rfkill(struct b43_wldev *dev, 64 + bool blocked) 65 + { 66 + if (b43_read32(dev, B43_MMIO_MACCTL) & B43_MACCTL_ENABLED) 67 + b43err(dev->wl, "MAC not suspended\n"); 68 + 69 + if (blocked) { 70 + b43_phy_mask(dev, B43_PHY_HT_RF_CTL1, ~0); 71 + } else { 72 + } 73 + } 74 + 62 75 static void b43_phy_ht_op_switch_analog(struct b43_wldev *dev, bool on) 63 76 { 64 77 if (on) { ··· 154 141 .phy_maskset = b43_phy_ht_op_maskset, 155 142 .radio_read = b43_phy_ht_op_radio_read, 156 143 .radio_write = b43_phy_ht_op_radio_write, 157 - /* 158 144 .software_rfkill = b43_phy_ht_op_software_rfkill, 159 - */ 160 145 .switch_analog = b43_phy_ht_op_switch_analog, 161 146 /* 162 147 .switch_channel = b43_phy_ht_op_switch_channel,
+2
drivers/net/wireless/b43/phy_ht.h
··· 8 8 #define B43_PHY_HT_TABLE_DATALO 0x073 /* Table data low */ 9 9 #define B43_PHY_HT_TABLE_DATAHI 0x074 /* Table data high */ 10 10 11 + #define B43_PHY_HT_RF_CTL1 B43_PHY_EXTG(0x010) 12 + 11 13 #define B43_PHY_HT_AFE_CTL1 B43_PHY_EXTG(0x110) 12 14 #define B43_PHY_HT_AFE_CTL2 B43_PHY_EXTG(0x111) 13 15 #define B43_PHY_HT_AFE_CTL3 B43_PHY_EXTG(0x114)