25 #include <linux/slab.h>
37 static void b43_radio_2059_channel_setup(
struct b43_wldev *
dev,
65 for (i = 0; i < 2; i++) {
88 static void b43_radio_2059_init(
struct b43_wldev *dev)
91 const u16 radio_values[3][2] = {
92 { 0x61, 0xE9 }, { 0x69, 0xD5 }, { 0x73, 0x99 },
118 for (i = 0; i < 10000; i++) {
126 b43err(dev->
wl,
"radio 0x945 timeout\n");
131 for (i = 0; i < 3; i++) {
137 for (j = 0; j < 10000; j++) {
145 b43err(dev->
wl,
"radio 0x140 timeout\n");
160 static void b43_phy_ht_zero_extg(
struct b43_wldev *dev)
163 u16 base[] = { 0x40, 0x60, 0x80 };
166 for (j = 0; j < 4; j++)
175 static void b43_phy_ht_afe_unk1(
struct b43_wldev *dev)
179 const u16 ctl_regs[3][2] = {
185 for (i = 0; i < 3; i++) {
196 static void b43_phy_ht_force_rf_sequence(
struct b43_wldev *dev,
u16 rf_seq)
204 for (i = 0; i < 200; i++) {
212 b43err(dev->
wl,
"Forcing RF sequence timeout\n");
217 static void b43_phy_ht_read_clip_detection(
struct b43_wldev *dev,
u16 *clip_st)
224 static void b43_phy_ht_bphy_init(
struct b43_wldev *dev)
230 for (i = 0; i < 16; i++) {
235 for (i = 0; i < 16; i++) {
246 static void b43_phy_ht_channel_setup(
struct b43_wldev *dev,
270 for (i = 0; i < 3; i++) {
275 mask = 0x2 << (i * 4);
290 static int b43_phy_ht_set_channel(
struct b43_wldev *dev,
310 b43_radio_2059_channel_setup(dev, chent_r2059);
311 b43_phy_ht_channel_setup(dev, &(chent_r2059->
phy_regs),
324 static int b43_phy_ht_op_allocate(
struct b43_wldev *dev)
328 phy_ht = kzalloc(
sizeof(*phy_ht),
GFP_KERNEL);
331 dev->
phy.ht = phy_ht;
336 static void b43_phy_ht_op_prepare_structs(
struct b43_wldev *dev)
341 memset(phy_ht, 0,
sizeof(*phy_ht));
344 static int b43_phy_ht_op_init(
struct b43_wldev *dev)
356 b43_phy_ht_zero_extg(dev);
389 b43_phy_ht_afe_unk1(dev);
392 0x777, 0x111, 0x111, 0x777, 0x111, 0x111);
402 0x8e, 0x96, 0x96, 0x96);
404 0x8f, 0x9f, 0x9f, 0x9f);
406 0x8f, 0x9f, 0x9f, 0x9f);
418 0x09, 0x0e, 0x13, 0x18);
420 0x09, 0x0e, 0x13, 0x18);
423 0x09, 0x0e, 0x13, 0x18);
457 b43_phy_ht_read_clip_detection(dev, clip_state);
460 b43_phy_ht_bphy_init(dev);
468 static void b43_phy_ht_op_free(
struct b43_wldev *dev)
478 static void b43_phy_ht_op_software_rfkill(
struct b43_wldev *dev,
482 b43err(dev->
wl,
"MAC not suspended\n");
497 if (dev->
phy.radio_ver == 0x2059)
498 b43_radio_2059_init(dev);
506 static void b43_phy_ht_op_switch_analog(
struct b43_wldev *dev,
bool on)
525 static int b43_phy_ht_op_switch_channel(
struct b43_wldev *dev,
526 unsigned int new_channel)
532 if ((new_channel < 1) || (new_channel > 14))
538 return b43_phy_ht_set_channel(dev, channel, channel_type);
541 static unsigned int b43_phy_ht_op_get_default_chan(
struct b43_wldev *dev)
581 static void b43_phy_ht_op_radio_write(
struct b43_wldev *dev,
u16 reg,
589 b43_phy_ht_op_recalc_txpower(
struct b43_wldev *dev,
bool ignore_tssi)
594 static void b43_phy_ht_op_adjust_txpower(
struct b43_wldev *dev)
603 .allocate = b43_phy_ht_op_allocate,
604 .free = b43_phy_ht_op_free,
605 .prepare_structs = b43_phy_ht_op_prepare_structs,
606 .init = b43_phy_ht_op_init,
607 .phy_read = b43_phy_ht_op_read,
608 .phy_write = b43_phy_ht_op_write,
609 .phy_maskset = b43_phy_ht_op_maskset,
610 .radio_read = b43_phy_ht_op_radio_read,
611 .radio_write = b43_phy_ht_op_radio_write,
612 .software_rfkill = b43_phy_ht_op_software_rfkill,
613 .switch_analog = b43_phy_ht_op_switch_analog,
614 .switch_channel = b43_phy_ht_op_switch_channel,
615 .get_default_chan = b43_phy_ht_op_get_default_chan,
616 .recalc_txpower = b43_phy_ht_op_recalc_txpower,
617 .adjust_txpower = b43_phy_ht_op_adjust_txpower,