aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt73usb.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-01-24 13:38:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:19:32 -0500
commit8318d78a44d49ac1edf2bdec7299de3617c4232e (patch)
treed434634418edd7399737801615d247be06616fdd /drivers/net/wireless/rt2x00/rt73usb.c
parent10b6b80145cc93887dd8aab99bfffa375e9add31 (diff)
cfg80211 API for channels/bitrates, mac80211 and driver conversion
This patch creates new cfg80211 wiphy API for channel and bitrate registration and converts mac80211 and drivers to the new API. The old mac80211 API is completely ripped out. All drivers (except ath5k) are updated to the new API, in many cases I expect that optimisations can be done. Along with the regulatory code I've also ripped out the IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED flag, I believe it to be unnecessary if the hardware simply gives us whatever channels it wants to support and we then enable/disable them as required, which is pretty much required for travelling. Additionally, the patch adds proper "basic" rate handling for STA mode interface, AP mode interface will have to have new API added to allow userspace to set the basic rate set, currently it'll be empty... However, the basic rate handling will need to be moved to the BSS conf stuff. I do expect there to be bugs in this, especially wrt. transmit power handling where I'm basically clueless about how it should work. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt73usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 4b5bde8b53de..9cbc879da037 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -439,13 +439,13 @@ static void rt73usb_config_antenna_5x(struct rt2x00_dev *rt2x00dev,
439 case ANTENNA_HW_DIVERSITY: 439 case ANTENNA_HW_DIVERSITY:
440 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 2); 440 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 2);
441 temp = !test_bit(CONFIG_FRAME_TYPE, &rt2x00dev->flags) 441 temp = !test_bit(CONFIG_FRAME_TYPE, &rt2x00dev->flags)
442 && (rt2x00dev->curr_hwmode != HWMODE_A); 442 && (rt2x00dev->curr_band != IEEE80211_BAND_5GHZ);
443 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, temp); 443 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, temp);
444 break; 444 break;
445 case ANTENNA_A: 445 case ANTENNA_A:
446 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 1); 446 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 1);
447 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, 0); 447 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, 0);
448 if (rt2x00dev->curr_hwmode == HWMODE_A) 448 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ)
449 rt2x00_set_field8(&r77, BBP_R77_RX_ANTENNA, 0); 449 rt2x00_set_field8(&r77, BBP_R77_RX_ANTENNA, 0);
450 else 450 else
451 rt2x00_set_field8(&r77, BBP_R77_RX_ANTENNA, 3); 451 rt2x00_set_field8(&r77, BBP_R77_RX_ANTENNA, 3);
@@ -460,7 +460,7 @@ static void rt73usb_config_antenna_5x(struct rt2x00_dev *rt2x00dev,
460 case ANTENNA_B: 460 case ANTENNA_B:
461 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 1); 461 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 1);
462 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, 0); 462 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, 0);
463 if (rt2x00dev->curr_hwmode == HWMODE_A) 463 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ)
464 rt2x00_set_field8(&r77, BBP_R77_RX_ANTENNA, 3); 464 rt2x00_set_field8(&r77, BBP_R77_RX_ANTENNA, 3);
465 else 465 else
466 rt2x00_set_field8(&r77, BBP_R77_RX_ANTENNA, 0); 466 rt2x00_set_field8(&r77, BBP_R77_RX_ANTENNA, 0);
@@ -555,7 +555,7 @@ static void rt73usb_config_antenna(struct rt2x00_dev *rt2x00dev,
555 unsigned int i; 555 unsigned int i;
556 u32 reg; 556 u32 reg;
557 557
558 if (rt2x00dev->curr_hwmode == HWMODE_A) { 558 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) {
559 sel = antenna_sel_a; 559 sel = antenna_sel_a;
560 lna = test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags); 560 lna = test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags);
561 } else { 561 } else {
@@ -569,10 +569,9 @@ static void rt73usb_config_antenna(struct rt2x00_dev *rt2x00dev,
569 rt73usb_register_read(rt2x00dev, PHY_CSR0, &reg); 569 rt73usb_register_read(rt2x00dev, PHY_CSR0, &reg);
570 570
571 rt2x00_set_field32(&reg, PHY_CSR0_PA_PE_BG, 571 rt2x00_set_field32(&reg, PHY_CSR0_PA_PE_BG,
572 (rt2x00dev->curr_hwmode == HWMODE_B || 572 (rt2x00dev->curr_band == IEEE80211_BAND_2GHZ));
573 rt2x00dev->curr_hwmode == HWMODE_G));
574 rt2x00_set_field32(&reg, PHY_CSR0_PA_PE_A, 573 rt2x00_set_field32(&reg, PHY_CSR0_PA_PE_A,
575 (rt2x00dev->curr_hwmode == HWMODE_A)); 574 (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ));
576 575
577 rt73usb_register_write(rt2x00dev, PHY_CSR0, reg); 576 rt73usb_register_write(rt2x00dev, PHY_CSR0, reg);
578 577
@@ -644,9 +643,9 @@ static void rt73usb_enable_led(struct rt2x00_dev *rt2x00dev)
644 643
645 rt2x00_set_field16(&rt2x00dev->led_reg, MCU_LEDCS_RADIO_STATUS, 1); 644 rt2x00_set_field16(&rt2x00dev->led_reg, MCU_LEDCS_RADIO_STATUS, 1);
646 rt2x00_set_field16(&rt2x00dev->led_reg, MCU_LEDCS_LINK_A_STATUS, 645 rt2x00_set_field16(&rt2x00dev->led_reg, MCU_LEDCS_LINK_A_STATUS,
647 (rt2x00dev->rx_status.phymode == MODE_IEEE80211A)); 646 (rt2x00dev->rx_status.band == IEEE80211_BAND_5GHZ));
648 rt2x00_set_field16(&rt2x00dev->led_reg, MCU_LEDCS_LINK_BG_STATUS, 647 rt2x00_set_field16(&rt2x00dev->led_reg, MCU_LEDCS_LINK_BG_STATUS,
649 (rt2x00dev->rx_status.phymode != MODE_IEEE80211A)); 648 (rt2x00dev->rx_status.band != IEEE80211_BAND_5GHZ));
650 649
651 rt2x00usb_vendor_request_sw(rt2x00dev, USB_LED_CONTROL, 0x0000, 650 rt2x00usb_vendor_request_sw(rt2x00dev, USB_LED_CONTROL, 0x0000,
652 rt2x00dev->led_reg, REGISTER_TIMEOUT); 651 rt2x00dev->led_reg, REGISTER_TIMEOUT);
@@ -736,7 +735,7 @@ static void rt73usb_link_tuner(struct rt2x00_dev *rt2x00dev)
736 /* 735 /*
737 * Determine r17 bounds. 736 * Determine r17 bounds.
738 */ 737 */
739 if (rt2x00dev->rx_status.phymode == MODE_IEEE80211A) { 738 if (rt2x00dev->rx_status.band == IEEE80211_BAND_5GHZ) {
740 low_bound = 0x28; 739 low_bound = 0x28;
741 up_bound = 0x48; 740 up_bound = 0x48;
742 741
@@ -1278,8 +1277,10 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1278 rt2x00_desc_write(txd, 2, word); 1277 rt2x00_desc_write(txd, 2, word);
1279 1278
1280 rt2x00_desc_read(txd, 5, &word); 1279 rt2x00_desc_read(txd, 5, &word);
1280/* XXX: removed for now
1281 rt2x00_set_field32(&word, TXD_W5_TX_POWER, 1281 rt2x00_set_field32(&word, TXD_W5_TX_POWER,
1282 TXPOWER_TO_DEV(control->power_level)); 1282 TXPOWER_TO_DEV(control->power_level));
1283 */
1283 rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); 1284 rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1);
1284 rt2x00_desc_write(txd, 5, word); 1285 rt2x00_desc_write(txd, 5, word);
1285 1286
@@ -1370,7 +1371,7 @@ static int rt73usb_agc_to_rssi(struct rt2x00_dev *rt2x00dev, int rxd_w1)
1370 return 0; 1371 return 0;
1371 } 1372 }
1372 1373
1373 if (rt2x00dev->rx_status.phymode == MODE_IEEE80211A) { 1374 if (rt2x00dev->rx_status.band == IEEE80211_BAND_5GHZ) {
1374 if (test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags)) { 1375 if (test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags)) {
1375 if (lna == 3 || lna == 2) 1376 if (lna == 3 || lna == 2)
1376 offset += 10; 1377 offset += 10;