aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorIvo van Doorn <IvDoorn@gmail.com>2011-04-18 09:27:06 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-19 15:39:11 -0400
commit7dab73b37f5e8885cb73efd25e73861f9b4f0246 (patch)
tree3c09412e1ec0b02eaf193879aed12db0f9874f7c /drivers/net/wireless/rt2x00
parent62fe778412b36791b7897cfa139342906fbbf07b (diff)
rt2x00: Split rt2x00dev->flags
The number of flags defined for the rt2x00dev->flags field, has been growing over the years. Currently we are approaching the maximum number of bits which are available in the field. A secondary problem, is that one part of the field are initialized only during boot, because the driver requirements are initialized or device requirements are loaded from the EEPROM. In both cases, the flags are fixed and will not change during device operation. The other flags are the device state, and will change frequently. So far this resulted in the fact that for some flags, the atomic bit accessors are used, while for the others the non-atomic variants are used. By splitting the flags up into a "flags" and "cap_flags" we can put all flags which are fixed inside "cap_flags". This field can then be read non-atomically. In the "flags" field we keep the device state, which is going to be read atomically. This adds more room for more flags in the future, and sanitizes the field access methods. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c10
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c10
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c12
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c20
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c22
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c14
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h84
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00config.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00crypto.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00debug.c42
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c14
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00firmware.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00lib.h4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00link.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c12
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c20
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c42
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c32
19 files changed, 203 insertions, 153 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 137a24e520da..5d1654a8bda8 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1536,13 +1536,13 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
1536 * Detect if this device has an hardware controlled radio. 1536 * Detect if this device has an hardware controlled radio.
1537 */ 1537 */
1538 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) 1538 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO))
1539 __set_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags); 1539 __set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags);
1540 1540
1541 /* 1541 /*
1542 * Check if the BBP tuning should be enabled. 1542 * Check if the BBP tuning should be enabled.
1543 */ 1543 */
1544 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RX_AGCVGC_TUNING)) 1544 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RX_AGCVGC_TUNING))
1545 __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags); 1545 __set_bit(CAPABILITY_LINK_TUNING, &rt2x00dev->cap_flags);
1546 1546
1547 return 0; 1547 return 0;
1548} 1548}
@@ -1640,9 +1640,9 @@ static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev)
1640 /* 1640 /*
1641 * This device requires the atim queue and DMA-mapped skbs. 1641 * This device requires the atim queue and DMA-mapped skbs.
1642 */ 1642 */
1643 __set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags); 1643 __set_bit(REQUIRE_ATIM_QUEUE, &rt2x00dev->cap_flags);
1644 __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags); 1644 __set_bit(REQUIRE_DMA, &rt2x00dev->cap_flags);
1645 __set_bit(DRIVER_REQUIRE_SW_SEQNO, &rt2x00dev->flags); 1645 __set_bit(REQUIRE_SW_SEQNO, &rt2x00dev->cap_flags);
1646 1646
1647 /* 1647 /*
1648 * Set the rssi offset. 1648 * Set the rssi offset.
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 198fc0a0d77c..3da954e1b4ab 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1687,14 +1687,14 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
1687 * Detect if this device has an hardware controlled radio. 1687 * Detect if this device has an hardware controlled radio.
1688 */ 1688 */
1689 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) 1689 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO))
1690 __set_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags); 1690 __set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags);
1691 1691
1692 /* 1692 /*
1693 * Check if the BBP tuning should be enabled. 1693 * Check if the BBP tuning should be enabled.
1694 */ 1694 */
1695 rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom); 1695 rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom);
1696 if (!rt2x00_get_field16(eeprom, EEPROM_NIC_DYN_BBP_TUNE)) 1696 if (!rt2x00_get_field16(eeprom, EEPROM_NIC_DYN_BBP_TUNE))
1697 __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags); 1697 __set_bit(CAPABILITY_LINK_TUNING, &rt2x00dev->cap_flags);
1698 1698
1699 /* 1699 /*
1700 * Read the RSSI <-> dBm offset information. 1700 * Read the RSSI <-> dBm offset information.
@@ -1958,9 +1958,9 @@ static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev)
1958 /* 1958 /*
1959 * This device requires the atim queue and DMA-mapped skbs. 1959 * This device requires the atim queue and DMA-mapped skbs.
1960 */ 1960 */
1961 __set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags); 1961 __set_bit(REQUIRE_ATIM_QUEUE, &rt2x00dev->cap_flags);
1962 __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags); 1962 __set_bit(REQUIRE_DMA, &rt2x00dev->cap_flags);
1963 __set_bit(DRIVER_REQUIRE_SW_SEQNO, &rt2x00dev->flags); 1963 __set_bit(REQUIRE_SW_SEQNO, &rt2x00dev->cap_flags);
1964 1964
1965 /* 1965 /*
1966 * Set the rssi offset. 1966 * Set the rssi offset.
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index eac788160f55..dbbd8bc851f1 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1519,7 +1519,7 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
1519 * Detect if this device has an hardware controlled radio. 1519 * Detect if this device has an hardware controlled radio.
1520 */ 1520 */
1521 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) 1521 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO))
1522 __set_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags); 1522 __set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags);
1523 1523
1524 /* 1524 /*
1525 * Read the RSSI <-> dBm offset information. 1525 * Read the RSSI <-> dBm offset information.
@@ -1790,13 +1790,13 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev)
1790 /* 1790 /*
1791 * This device requires the atim queue 1791 * This device requires the atim queue
1792 */ 1792 */
1793 __set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags); 1793 __set_bit(REQUIRE_ATIM_QUEUE, &rt2x00dev->cap_flags);
1794 __set_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags); 1794 __set_bit(REQUIRE_BEACON_GUARD, &rt2x00dev->cap_flags);
1795 if (!modparam_nohwcrypt) { 1795 if (!modparam_nohwcrypt) {
1796 __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); 1796 __set_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags);
1797 __set_bit(DRIVER_REQUIRE_COPY_IV, &rt2x00dev->flags); 1797 __set_bit(REQUIRE_COPY_IV, &rt2x00dev->cap_flags);
1798 } 1798 }
1799 __set_bit(DRIVER_REQUIRE_SW_SEQNO, &rt2x00dev->flags); 1799 __set_bit(REQUIRE_SW_SEQNO, &rt2x00dev->cap_flags);
1800 1800
1801 /* 1801 /*
1802 * Set the rssi offset. 1802 * Set the rssi offset.
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 13ccc1bbeb4b..c6f5584128e9 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -1763,8 +1763,8 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
1763 1763
1764 if (rf->channel <= 14) { 1764 if (rf->channel <= 14) {
1765 if (!rt2x00_rt(rt2x00dev, RT5390)) { 1765 if (!rt2x00_rt(rt2x00dev, RT5390)) {
1766 if (test_bit(CONFIG_EXTERNAL_LNA_BG, 1766 if (test_bit(CAPABILITY_EXTERNAL_LNA_BG,
1767 &rt2x00dev->flags)) { 1767 &rt2x00dev->cap_flags)) {
1768 rt2800_bbp_write(rt2x00dev, 82, 0x62); 1768 rt2800_bbp_write(rt2x00dev, 82, 0x62);
1769 rt2800_bbp_write(rt2x00dev, 75, 0x46); 1769 rt2800_bbp_write(rt2x00dev, 75, 0x46);
1770 } else { 1770 } else {
@@ -1775,7 +1775,7 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
1775 } else { 1775 } else {
1776 rt2800_bbp_write(rt2x00dev, 82, 0xf2); 1776 rt2800_bbp_write(rt2x00dev, 82, 0xf2);
1777 1777
1778 if (test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags)) 1778 if (test_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags))
1779 rt2800_bbp_write(rt2x00dev, 75, 0x46); 1779 rt2800_bbp_write(rt2x00dev, 75, 0x46);
1780 else 1780 else
1781 rt2800_bbp_write(rt2x00dev, 75, 0x50); 1781 rt2800_bbp_write(rt2x00dev, 75, 0x50);
@@ -2008,7 +2008,7 @@ static u8 rt2800_compensate_txpower(struct rt2x00_dev *rt2x00dev, int is_rate_b,
2008 if (!((band == IEEE80211_BAND_5GHZ) && is_rate_b)) 2008 if (!((band == IEEE80211_BAND_5GHZ) && is_rate_b))
2009 return txpower; 2009 return txpower;
2010 2010
2011 if (test_bit(CONFIG_SUPPORT_POWER_LIMIT, &rt2x00dev->flags)) { 2011 if (test_bit(CAPABILITY_POWER_LIMIT, &rt2x00dev->cap_flags)) {
2012 /* 2012 /*
2013 * Check if eirp txpower exceed txpower_limit. 2013 * Check if eirp txpower exceed txpower_limit.
2014 * We use OFDM 6M as criterion and its eirp txpower 2014 * We use OFDM 6M as criterion and its eirp txpower
@@ -3309,8 +3309,8 @@ static int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)
3309 rt2x00_rt_rev_lt(rt2x00dev, RT3071, REV_RT3071E) || 3309 rt2x00_rt_rev_lt(rt2x00dev, RT3071, REV_RT3071E) ||
3310 rt2x00_rt_rev_lt(rt2x00dev, RT3090, REV_RT3090E) || 3310 rt2x00_rt_rev_lt(rt2x00dev, RT3090, REV_RT3090E) ||
3311 rt2x00_rt_rev_lt(rt2x00dev, RT3390, REV_RT3390E)) { 3311 rt2x00_rt_rev_lt(rt2x00dev, RT3390, REV_RT3390E)) {
3312 if (!test_bit(CONFIG_EXTERNAL_LNA_BG, 3312 if (!test_bit(CAPABILITY_EXTERNAL_LNA_BG,
3313 &rt2x00dev->flags)) 3313 &rt2x00dev->cap_flags))
3314 rt2x00_set_field8(&rfcsr, RFCSR17_R, 1); 3314 rt2x00_set_field8(&rfcsr, RFCSR17_R, 1);
3315 } 3315 }
3316 rt2x00_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_BG, &eeprom); 3316 rt2x00_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_BG, &eeprom);
@@ -3733,15 +3733,15 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
3733 rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom); 3733 rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom);
3734 3734
3735 if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_LNA_5G)) 3735 if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_LNA_5G))
3736 __set_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags); 3736 __set_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags);
3737 if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_LNA_2G)) 3737 if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_LNA_2G))
3738 __set_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags); 3738 __set_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags);
3739 3739
3740 /* 3740 /*
3741 * Detect if this device has an hardware controlled radio. 3741 * Detect if this device has an hardware controlled radio.
3742 */ 3742 */
3743 if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_HW_RADIO)) 3743 if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_HW_RADIO))
3744 __set_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags); 3744 __set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags);
3745 3745
3746 /* 3746 /*
3747 * Store led settings, for correct led behaviour. 3747 * Store led settings, for correct led behaviour.
@@ -3761,7 +3761,7 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
3761 3761
3762 if (rt2x00_get_field16(eeprom, EEPROM_EIRP_MAX_TX_POWER_2GHZ) < 3762 if (rt2x00_get_field16(eeprom, EEPROM_EIRP_MAX_TX_POWER_2GHZ) <
3763 EIRP_MAX_TX_POWER_LIMIT) 3763 EIRP_MAX_TX_POWER_LIMIT)
3764 __set_bit(CONFIG_SUPPORT_POWER_LIMIT, &rt2x00dev->flags); 3764 __set_bit(CAPABILITY_POWER_LIMIT, &rt2x00dev->cap_flags);
3765 3765
3766 return 0; 3766 return 0;
3767} 3767}
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index adc3534254df..4241f1943842 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -966,28 +966,28 @@ static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev)
966 * This device has multiple filters for control frames 966 * This device has multiple filters for control frames
967 * and has a separate filter for PS Poll frames. 967 * and has a separate filter for PS Poll frames.
968 */ 968 */
969 __set_bit(DRIVER_SUPPORT_CONTROL_FILTERS, &rt2x00dev->flags); 969 __set_bit(CAPABILITY_CONTROL_FILTERS, &rt2x00dev->cap_flags);
970 __set_bit(DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, &rt2x00dev->flags); 970 __set_bit(CAPABILITY_CONTROL_FILTER_PSPOLL, &rt2x00dev->cap_flags);
971 971
972 /* 972 /*
973 * This device has a pre tbtt interrupt and thus fetches 973 * This device has a pre tbtt interrupt and thus fetches
974 * a new beacon directly prior to transmission. 974 * a new beacon directly prior to transmission.
975 */ 975 */
976 __set_bit(DRIVER_SUPPORT_PRE_TBTT_INTERRUPT, &rt2x00dev->flags); 976 __set_bit(CAPABILITY_PRE_TBTT_INTERRUPT, &rt2x00dev->cap_flags);
977 977
978 /* 978 /*
979 * This device requires firmware. 979 * This device requires firmware.
980 */ 980 */
981 if (!rt2x00_is_soc(rt2x00dev)) 981 if (!rt2x00_is_soc(rt2x00dev))
982 __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags); 982 __set_bit(REQUIRE_FIRMWARE, &rt2x00dev->cap_flags);
983 __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags); 983 __set_bit(REQUIRE_DMA, &rt2x00dev->cap_flags);
984 __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags); 984 __set_bit(REQUIRE_L2PAD, &rt2x00dev->cap_flags);
985 __set_bit(DRIVER_REQUIRE_TXSTATUS_FIFO, &rt2x00dev->flags); 985 __set_bit(REQUIRE_TXSTATUS_FIFO, &rt2x00dev->cap_flags);
986 __set_bit(DRIVER_REQUIRE_TASKLET_CONTEXT, &rt2x00dev->flags); 986 __set_bit(REQUIRE_TASKLET_CONTEXT, &rt2x00dev->cap_flags);
987 if (!modparam_nohwcrypt) 987 if (!modparam_nohwcrypt)
988 __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); 988 __set_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags);
989 __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags); 989 __set_bit(CAPABILITY_LINK_TUNING, &rt2x00dev->cap_flags);
990 __set_bit(DRIVER_REQUIRE_HT_TX_DESC, &rt2x00dev->flags); 990 __set_bit(REQUIRE_HT_TX_DESC, &rt2x00dev->cap_flags);
991 991
992 /* 992 /*
993 * Set the rssi offset. 993 * Set the rssi offset.
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index d2f5c87305a4..f3ce5e854be6 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -553,18 +553,18 @@ static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev)
553 * This device has multiple filters for control frames 553 * This device has multiple filters for control frames
554 * and has a separate filter for PS Poll frames. 554 * and has a separate filter for PS Poll frames.
555 */ 555 */
556 __set_bit(DRIVER_SUPPORT_CONTROL_FILTERS, &rt2x00dev->flags); 556 __set_bit(CAPABILITY_CONTROL_FILTERS, &rt2x00dev->cap_flags);
557 __set_bit(DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, &rt2x00dev->flags); 557 __set_bit(CAPABILITY_CONTROL_FILTER_PSPOLL, &rt2x00dev->cap_flags);
558 558
559 /* 559 /*
560 * This device requires firmware. 560 * This device requires firmware.
561 */ 561 */
562 __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags); 562 __set_bit(REQUIRE_FIRMWARE, &rt2x00dev->cap_flags);
563 __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags); 563 __set_bit(REQUIRE_L2PAD, &rt2x00dev->cap_flags);
564 if (!modparam_nohwcrypt) 564 if (!modparam_nohwcrypt)
565 __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); 565 __set_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags);
566 __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags); 566 __set_bit(CAPABILITY_LINK_TUNING, &rt2x00dev->cap_flags);
567 __set_bit(DRIVER_REQUIRE_HT_TX_DESC, &rt2x00dev->flags); 567 __set_bit(REQUIRE_HT_TX_DESC, &rt2x00dev->cap_flags);
568 568
569 /* 569 /*
570 * Set the rssi offset. 570 * Set the rssi offset.
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index dd0f66ade6e8..79c385accfac 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -643,11 +643,11 @@ struct rt2x00_ops {
643}; 643};
644 644
645/* 645/*
646 * rt2x00 device flags 646 * rt2x00 state flags
647 */ 647 */
648enum rt2x00_flags { 648enum rt2x00_state_flags {
649 /* 649 /*
650 * Device state flags 650 * Device flags
651 */ 651 */
652 DEVICE_STATE_PRESENT, 652 DEVICE_STATE_PRESENT,
653 DEVICE_STATE_REGISTERED_HW, 653 DEVICE_STATE_REGISTERED_HW,
@@ -657,42 +657,47 @@ enum rt2x00_flags {
657 DEVICE_STATE_SCANNING, 657 DEVICE_STATE_SCANNING,
658 658
659 /* 659 /*
660 * Driver requirements
661 */
662 DRIVER_REQUIRE_FIRMWARE,
663 DRIVER_REQUIRE_BEACON_GUARD,
664 DRIVER_REQUIRE_ATIM_QUEUE,
665 DRIVER_REQUIRE_DMA,
666 DRIVER_REQUIRE_COPY_IV,
667 DRIVER_REQUIRE_L2PAD,
668 DRIVER_REQUIRE_TXSTATUS_FIFO,
669 DRIVER_REQUIRE_TASKLET_CONTEXT,
670 DRIVER_REQUIRE_SW_SEQNO,
671 DRIVER_REQUIRE_HT_TX_DESC,
672
673 /*
674 * Driver features
675 */
676 CONFIG_SUPPORT_HW_BUTTON,
677 CONFIG_SUPPORT_HW_CRYPTO,
678 CONFIG_SUPPORT_POWER_LIMIT,
679 DRIVER_SUPPORT_CONTROL_FILTERS,
680 DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL,
681 DRIVER_SUPPORT_PRE_TBTT_INTERRUPT,
682 DRIVER_SUPPORT_LINK_TUNING,
683
684 /*
685 * Driver configuration 660 * Driver configuration
686 */ 661 */
687 CONFIG_FRAME_TYPE,
688 CONFIG_RF_SEQUENCE,
689 CONFIG_EXTERNAL_LNA_A,
690 CONFIG_EXTERNAL_LNA_BG,
691 CONFIG_DOUBLE_ANTENNA,
692 CONFIG_CHANNEL_HT40, 662 CONFIG_CHANNEL_HT40,
693}; 663};
694 664
695/* 665/*
666 * rt2x00 capability flags
667 */
668enum rt2x00_capability_flags {
669 /*
670 * Requirements
671 */
672 REQUIRE_FIRMWARE,
673 REQUIRE_BEACON_GUARD,
674 REQUIRE_ATIM_QUEUE,
675 REQUIRE_DMA,
676 REQUIRE_COPY_IV,
677 REQUIRE_L2PAD,
678 REQUIRE_TXSTATUS_FIFO,
679 REQUIRE_TASKLET_CONTEXT,
680 REQUIRE_SW_SEQNO,
681 REQUIRE_HT_TX_DESC,
682
683 /*
684 * Capabilities
685 */
686 CAPABILITY_HW_BUTTON,
687 CAPABILITY_HW_CRYPTO,
688 CAPABILITY_POWER_LIMIT,
689 CAPABILITY_CONTROL_FILTERS,
690 CAPABILITY_CONTROL_FILTER_PSPOLL,
691 CAPABILITY_PRE_TBTT_INTERRUPT,
692 CAPABILITY_LINK_TUNING,
693 CAPABILITY_FRAME_TYPE,
694 CAPABILITY_RF_SEQUENCE,
695 CAPABILITY_EXTERNAL_LNA_A,
696 CAPABILITY_EXTERNAL_LNA_BG,
697 CAPABILITY_DOUBLE_ANTENNA,
698};
699
700/*
696 * rt2x00 device structure. 701 * rt2x00 device structure.
697 */ 702 */
698struct rt2x00_dev { 703struct rt2x00_dev {
@@ -738,13 +743,20 @@ struct rt2x00_dev {
738#endif /* CONFIG_RT2X00_LIB_LEDS */ 743#endif /* CONFIG_RT2X00_LIB_LEDS */
739 744
740 /* 745 /*
741 * Device flags. 746 * Device state flags.
742 * In these flags the current status and some 747 * In these flags the current status is stored.
743 * of the device capabilities are stored. 748 * Access to these flags should occur atomically.
744 */ 749 */
745 unsigned long flags; 750 unsigned long flags;
746 751
747 /* 752 /*
753 * Device capabiltiy flags.
754 * In these flags the device/driver capabilities are stored.
755 * Access to these flags should occur non-atomically.
756 */
757 unsigned long cap_flags;
758
759 /*
748 * Device information, Bus IRQ and name (PCI, SoC) 760 * Device information, Bus IRQ and name (PCI, SoC)
749 */ 761 */
750 int irq; 762 int irq;
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index e7f67d5eda52..e225a66f59a0 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -176,10 +176,10 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
176 176
177 if (ieee80211_flags & IEEE80211_CONF_CHANGE_CHANNEL) { 177 if (ieee80211_flags & IEEE80211_CONF_CHANGE_CHANNEL) {
178 if (conf_is_ht40(conf)) { 178 if (conf_is_ht40(conf)) {
179 __set_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags); 179 set_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags);
180 hw_value = rt2x00ht_center_channel(rt2x00dev, conf); 180 hw_value = rt2x00ht_center_channel(rt2x00dev, conf);
181 } else { 181 } else {
182 __clear_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags); 182 clear_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags);
183 hw_value = conf->channel->hw_value; 183 hw_value = conf->channel->hw_value;
184 } 184 }
185 185
diff --git a/drivers/net/wireless/rt2x00/rt2x00crypto.c b/drivers/net/wireless/rt2x00/rt2x00crypto.c
index 5e9074bf2b8e..e1e0c51fcde8 100644
--- a/drivers/net/wireless/rt2x00/rt2x00crypto.c
+++ b/drivers/net/wireless/rt2x00/rt2x00crypto.c
@@ -52,7 +52,7 @@ void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry,
52 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); 52 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
53 struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; 53 struct ieee80211_key_conf *hw_key = tx_info->control.hw_key;
54 54
55 if (!test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags) || !hw_key) 55 if (!test_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags) || !hw_key)
56 return; 56 return;
57 57
58 __set_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags); 58 __set_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags);
@@ -80,7 +80,7 @@ unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev,
80 struct ieee80211_key_conf *key = tx_info->control.hw_key; 80 struct ieee80211_key_conf *key = tx_info->control.hw_key;
81 unsigned int overhead = 0; 81 unsigned int overhead = 0;
82 82
83 if (!test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags) || !key) 83 if (!test_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags) || !key)
84 return overhead; 84 return overhead;
85 85
86 /* 86 /*
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index 66166ef037f5..78787fcc919e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -63,7 +63,8 @@ struct rt2x00debug_intf {
63 * - driver folder 63 * - driver folder
64 * - driver file 64 * - driver file
65 * - chipset file 65 * - chipset file
66 * - device flags file 66 * - device state flags file
67 * - device capability flags file
67 * - register folder 68 * - register folder
68 * - csr offset/value files 69 * - csr offset/value files
69 * - eeprom offset/value files 70 * - eeprom offset/value files
@@ -78,6 +79,7 @@ struct rt2x00debug_intf {
78 struct dentry *driver_entry; 79 struct dentry *driver_entry;
79 struct dentry *chipset_entry; 80 struct dentry *chipset_entry;
80 struct dentry *dev_flags; 81 struct dentry *dev_flags;
82 struct dentry *cap_flags;
81 struct dentry *register_folder; 83 struct dentry *register_folder;
82 struct dentry *csr_off_entry; 84 struct dentry *csr_off_entry;
83 struct dentry *csr_val_entry; 85 struct dentry *csr_val_entry;
@@ -553,6 +555,35 @@ static const struct file_operations rt2x00debug_fop_dev_flags = {
553 .llseek = default_llseek, 555 .llseek = default_llseek,
554}; 556};
555 557
558static ssize_t rt2x00debug_read_cap_flags(struct file *file,
559 char __user *buf,
560 size_t length,
561 loff_t *offset)
562{
563 struct rt2x00debug_intf *intf = file->private_data;
564 char line[16];
565 size_t size;
566
567 if (*offset)
568 return 0;
569
570 size = sprintf(line, "0x%.8x\n", (unsigned int)intf->rt2x00dev->cap_flags);
571
572 if (copy_to_user(buf, line, size))
573 return -EFAULT;
574
575 *offset += size;
576 return size;
577}
578
579static const struct file_operations rt2x00debug_fop_cap_flags = {
580 .owner = THIS_MODULE,
581 .read = rt2x00debug_read_cap_flags,
582 .open = rt2x00debug_file_open,
583 .release = rt2x00debug_file_release,
584 .llseek = default_llseek,
585};
586
556static struct dentry *rt2x00debug_create_file_driver(const char *name, 587static struct dentry *rt2x00debug_create_file_driver(const char *name,
557 struct rt2x00debug_intf 588 struct rt2x00debug_intf
558 *intf, 589 *intf,
@@ -652,6 +683,12 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
652 if (IS_ERR(intf->dev_flags) || !intf->dev_flags) 683 if (IS_ERR(intf->dev_flags) || !intf->dev_flags)
653 goto exit; 684 goto exit;
654 685
686 intf->cap_flags = debugfs_create_file("cap_flags", S_IRUSR,
687 intf->driver_folder, intf,
688 &rt2x00debug_fop_cap_flags);
689 if (IS_ERR(intf->cap_flags) || !intf->cap_flags)
690 goto exit;
691
655 intf->register_folder = 692 intf->register_folder =
656 debugfs_create_dir("register", intf->driver_folder); 693 debugfs_create_dir("register", intf->driver_folder);
657 if (IS_ERR(intf->register_folder) || !intf->register_folder) 694 if (IS_ERR(intf->register_folder) || !intf->register_folder)
@@ -705,7 +742,7 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
705 intf, &rt2x00debug_fop_queue_stats); 742 intf, &rt2x00debug_fop_queue_stats);
706 743
707#ifdef CONFIG_RT2X00_LIB_CRYPTO 744#ifdef CONFIG_RT2X00_LIB_CRYPTO
708 if (test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags)) 745 if (test_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags))
709 intf->crypto_stats_entry = 746 intf->crypto_stats_entry =
710 debugfs_create_file("crypto", S_IRUGO, intf->queue_folder, 747 debugfs_create_file("crypto", S_IRUGO, intf->queue_folder,
711 intf, &rt2x00debug_fop_crypto_stats); 748 intf, &rt2x00debug_fop_crypto_stats);
@@ -743,6 +780,7 @@ void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev)
743 debugfs_remove(intf->csr_off_entry); 780 debugfs_remove(intf->csr_off_entry);
744 debugfs_remove(intf->register_folder); 781 debugfs_remove(intf->register_folder);
745 debugfs_remove(intf->dev_flags); 782 debugfs_remove(intf->dev_flags);
783 debugfs_remove(intf->cap_flags);
746 debugfs_remove(intf->chipset_entry); 784 debugfs_remove(intf->chipset_entry);
747 debugfs_remove(intf->driver_entry); 785 debugfs_remove(intf->driver_entry);
748 debugfs_remove(intf->driver_folder); 786 debugfs_remove(intf->driver_folder);
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 9bffe8438d1f..af25b0152cbc 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -200,7 +200,7 @@ void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev)
200 * here as they will fetch the next beacon directly prior to 200 * here as they will fetch the next beacon directly prior to
201 * transmission. 201 * transmission.
202 */ 202 */
203 if (test_bit(DRIVER_SUPPORT_PRE_TBTT_INTERRUPT, &rt2x00dev->flags)) 203 if (test_bit(CAPABILITY_PRE_TBTT_INTERRUPT, &rt2x00dev->cap_flags))
204 return; 204 return;
205 205
206 /* fetch next beacon */ 206 /* fetch next beacon */
@@ -271,7 +271,7 @@ void rt2x00lib_txdone(struct queue_entry *entry,
271 /* 271 /*
272 * Remove L2 padding which was added during 272 * Remove L2 padding which was added during
273 */ 273 */
274 if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags)) 274 if (test_bit(REQUIRE_L2PAD, &rt2x00dev->cap_flags))
275 rt2x00queue_remove_l2pad(entry->skb, header_length); 275 rt2x00queue_remove_l2pad(entry->skb, header_length);
276 276
277 /* 277 /*
@@ -280,7 +280,7 @@ void rt2x00lib_txdone(struct queue_entry *entry,
280 * mac80211 will expect the same data to be present it the 280 * mac80211 will expect the same data to be present it the
281 * frame as it was passed to us. 281 * frame as it was passed to us.
282 */ 282 */
283 if (test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags)) 283 if (test_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags))
284 rt2x00crypto_tx_insert_iv(entry->skb, header_length); 284 rt2x00crypto_tx_insert_iv(entry->skb, header_length);
285 285
286 /* 286 /*
@@ -377,7 +377,7 @@ void rt2x00lib_txdone(struct queue_entry *entry,
377 * send the status report back. 377 * send the status report back.
378 */ 378 */
379 if (!(skbdesc_flags & SKBDESC_NOT_MAC80211)) { 379 if (!(skbdesc_flags & SKBDESC_NOT_MAC80211)) {
380 if (test_bit(DRIVER_REQUIRE_TASKLET_CONTEXT, &rt2x00dev->flags)) 380 if (test_bit(REQUIRE_TASKLET_CONTEXT, &rt2x00dev->cap_flags))
381 ieee80211_tx_status(rt2x00dev->hw, entry->skb); 381 ieee80211_tx_status(rt2x00dev->hw, entry->skb);
382 else 382 else
383 ieee80211_tx_status_ni(rt2x00dev->hw, entry->skb); 383 ieee80211_tx_status_ni(rt2x00dev->hw, entry->skb);
@@ -806,15 +806,15 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
806 /* 806 /*
807 * Take TX headroom required for alignment into account. 807 * Take TX headroom required for alignment into account.
808 */ 808 */
809 if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags)) 809 if (test_bit(REQUIRE_L2PAD, &rt2x00dev->cap_flags))
810 rt2x00dev->hw->extra_tx_headroom += RT2X00_L2PAD_SIZE; 810 rt2x00dev->hw->extra_tx_headroom += RT2X00_L2PAD_SIZE;
811 else if (test_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags)) 811 else if (test_bit(REQUIRE_DMA, &rt2x00dev->cap_flags))
812 rt2x00dev->hw->extra_tx_headroom += RT2X00_ALIGN_SIZE; 812 rt2x00dev->hw->extra_tx_headroom += RT2X00_ALIGN_SIZE;
813 813
814 /* 814 /*
815 * Allocate tx status FIFO for driver use. 815 * Allocate tx status FIFO for driver use.
816 */ 816 */
817 if (test_bit(DRIVER_REQUIRE_TXSTATUS_FIFO, &rt2x00dev->flags)) { 817 if (test_bit(REQUIRE_TXSTATUS_FIFO, &rt2x00dev->cap_flags)) {
818 /* 818 /*
819 * Allocate the txstatus fifo. In the worst case the tx 819 * Allocate the txstatus fifo. In the worst case the tx
820 * status fifo has to hold the tx status of all entries 820 * status fifo has to hold the tx status of all entries
diff --git a/drivers/net/wireless/rt2x00/rt2x00firmware.c b/drivers/net/wireless/rt2x00/rt2x00firmware.c
index be0ff78c1b16..f316aad30612 100644
--- a/drivers/net/wireless/rt2x00/rt2x00firmware.c
+++ b/drivers/net/wireless/rt2x00/rt2x00firmware.c
@@ -99,7 +99,7 @@ int rt2x00lib_load_firmware(struct rt2x00_dev *rt2x00dev)
99{ 99{
100 int retval; 100 int retval;
101 101
102 if (!test_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags)) 102 if (!test_bit(REQUIRE_FIRMWARE, &rt2x00dev->cap_flags))
103 return 0; 103 return 0;
104 104
105 if (!rt2x00dev->fw) { 105 if (!rt2x00dev->fw) {
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h
index 88f2f9275528..bbee2cd40993 100644
--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
@@ -416,13 +416,13 @@ static inline u16 rt2x00ht_center_channel(struct rt2x00_dev *rt2x00dev,
416 */ 416 */
417static inline void rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev) 417static inline void rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev)
418{ 418{
419 if (test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags)) 419 if (test_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags))
420 wiphy_rfkill_start_polling(rt2x00dev->hw->wiphy); 420 wiphy_rfkill_start_polling(rt2x00dev->hw->wiphy);
421} 421}
422 422
423static inline void rt2x00rfkill_unregister(struct rt2x00_dev *rt2x00dev) 423static inline void rt2x00rfkill_unregister(struct rt2x00_dev *rt2x00dev)
424{ 424{
425 if (test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags)) 425 if (test_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags))
426 wiphy_rfkill_stop_polling(rt2x00dev->hw->wiphy); 426 wiphy_rfkill_stop_polling(rt2x00dev->hw->wiphy);
427} 427}
428 428
diff --git a/drivers/net/wireless/rt2x00/rt2x00link.c b/drivers/net/wireless/rt2x00/rt2x00link.c
index 128b3615c08c..ba0bb766e59e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00link.c
+++ b/drivers/net/wireless/rt2x00/rt2x00link.c
@@ -383,7 +383,7 @@ static void rt2x00link_tuner(struct work_struct *work)
383 * do not support link tuning at all, while other devices can disable 383 * do not support link tuning at all, while other devices can disable
384 * the feature from the EEPROM. 384 * the feature from the EEPROM.
385 */ 385 */
386 if (test_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags)) 386 if (test_bit(CAPABILITY_LINK_TUNING, &rt2x00dev->cap_flags))
387 rt2x00dev->ops->lib->link_tuner(rt2x00dev, qual, link->count); 387 rt2x00dev->ops->lib->link_tuner(rt2x00dev, qual, link->count);
388 388
389 /* 389 /*
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 4a1c41b59fea..4770156df1a8 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -119,7 +119,7 @@ void rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
119 * Use the ATIM queue if appropriate and present. 119 * Use the ATIM queue if appropriate and present.
120 */ 120 */
121 if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM && 121 if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM &&
122 test_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags)) 122 test_bit(REQUIRE_ATIM_QUEUE, &rt2x00dev->cap_flags))
123 qid = QID_ATIM; 123 qid = QID_ATIM;
124 124
125 queue = rt2x00queue_get_tx_queue(rt2x00dev, qid); 125 queue = rt2x00queue_get_tx_queue(rt2x00dev, qid);
@@ -411,11 +411,11 @@ void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
411 * of different types, but has no a separate filter for PS Poll frames, 411 * of different types, but has no a separate filter for PS Poll frames,
412 * FIF_CONTROL flag implies FIF_PSPOLL. 412 * FIF_CONTROL flag implies FIF_PSPOLL.
413 */ 413 */
414 if (!test_bit(DRIVER_SUPPORT_CONTROL_FILTERS, &rt2x00dev->flags)) { 414 if (!test_bit(CAPABILITY_CONTROL_FILTERS, &rt2x00dev->cap_flags)) {
415 if (*total_flags & FIF_CONTROL || *total_flags & FIF_PSPOLL) 415 if (*total_flags & FIF_CONTROL || *total_flags & FIF_PSPOLL)
416 *total_flags |= FIF_CONTROL | FIF_PSPOLL; 416 *total_flags |= FIF_CONTROL | FIF_PSPOLL;
417 } 417 }
418 if (!test_bit(DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, &rt2x00dev->flags)) { 418 if (!test_bit(CAPABILITY_CONTROL_FILTER_PSPOLL, &rt2x00dev->cap_flags)) {
419 if (*total_flags & FIF_CONTROL) 419 if (*total_flags & FIF_CONTROL)
420 *total_flags |= FIF_PSPOLL; 420 *total_flags |= FIF_PSPOLL;
421 } 421 }
@@ -496,7 +496,7 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
496 496
497 if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) 497 if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
498 return 0; 498 return 0;
499 else if (!test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags)) 499 else if (!test_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags))
500 return -EOPNOTSUPP; 500 return -EOPNOTSUPP;
501 else if (key->keylen > 32) 501 else if (key->keylen > 32)
502 return -ENOSPC; 502 return -ENOSPC;
@@ -562,7 +562,7 @@ EXPORT_SYMBOL_GPL(rt2x00mac_set_key);
562void rt2x00mac_sw_scan_start(struct ieee80211_hw *hw) 562void rt2x00mac_sw_scan_start(struct ieee80211_hw *hw)
563{ 563{
564 struct rt2x00_dev *rt2x00dev = hw->priv; 564 struct rt2x00_dev *rt2x00dev = hw->priv;
565 __set_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags); 565 set_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags);
566 rt2x00link_stop_tuner(rt2x00dev); 566 rt2x00link_stop_tuner(rt2x00dev);
567} 567}
568EXPORT_SYMBOL_GPL(rt2x00mac_sw_scan_start); 568EXPORT_SYMBOL_GPL(rt2x00mac_sw_scan_start);
@@ -570,7 +570,7 @@ EXPORT_SYMBOL_GPL(rt2x00mac_sw_scan_start);
570void rt2x00mac_sw_scan_complete(struct ieee80211_hw *hw) 570void rt2x00mac_sw_scan_complete(struct ieee80211_hw *hw)
571{ 571{
572 struct rt2x00_dev *rt2x00dev = hw->priv; 572 struct rt2x00_dev *rt2x00dev = hw->priv;
573 __clear_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags); 573 clear_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags);
574 rt2x00link_start_tuner(rt2x00dev); 574 rt2x00link_start_tuner(rt2x00dev);
575} 575}
576EXPORT_SYMBOL_GPL(rt2x00mac_sw_scan_complete); 576EXPORT_SYMBOL_GPL(rt2x00mac_sw_scan_complete);
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 9fc4a1ec4b43..d03eef28f036 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -60,7 +60,7 @@ struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry)
60 * at least 8 bytes bytes available in headroom for IV/EIV 60 * at least 8 bytes bytes available in headroom for IV/EIV
61 * and 8 bytes for ICV data as tailroon. 61 * and 8 bytes for ICV data as tailroon.
62 */ 62 */
63 if (test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags)) { 63 if (test_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags)) {
64 head_size += 8; 64 head_size += 8;
65 tail_size += 8; 65 tail_size += 8;
66 } 66 }
@@ -86,7 +86,7 @@ struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry)
86 memset(skbdesc, 0, sizeof(*skbdesc)); 86 memset(skbdesc, 0, sizeof(*skbdesc));
87 skbdesc->entry = entry; 87 skbdesc->entry = entry;
88 88
89 if (test_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags)) { 89 if (test_bit(REQUIRE_DMA, &rt2x00dev->cap_flags)) {
90 skbdesc->skb_dma = dma_map_single(rt2x00dev->dev, 90 skbdesc->skb_dma = dma_map_single(rt2x00dev->dev,
91 skb->data, 91 skb->data,
92 skb->len, 92 skb->len,
@@ -213,7 +213,7 @@ static void rt2x00queue_create_tx_descriptor_seq(struct queue_entry *entry,
213 213
214 __set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags); 214 __set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);
215 215
216 if (!test_bit(DRIVER_REQUIRE_SW_SEQNO, &entry->queue->rt2x00dev->flags)) 216 if (!test_bit(REQUIRE_SW_SEQNO, &entry->queue->rt2x00dev->cap_flags))
217 return; 217 return;
218 218
219 /* 219 /*
@@ -396,7 +396,7 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
396 rt2x00crypto_create_tx_descriptor(entry, txdesc); 396 rt2x00crypto_create_tx_descriptor(entry, txdesc);
397 rt2x00queue_create_tx_descriptor_seq(entry, txdesc); 397 rt2x00queue_create_tx_descriptor_seq(entry, txdesc);
398 398
399 if (test_bit(DRIVER_REQUIRE_HT_TX_DESC, &rt2x00dev->flags)) 399 if (test_bit(REQUIRE_HT_TX_DESC, &rt2x00dev->cap_flags))
400 rt2x00ht_create_tx_descriptor(entry, txdesc, hwrate); 400 rt2x00ht_create_tx_descriptor(entry, txdesc, hwrate);
401 else 401 else
402 rt2x00queue_create_tx_descriptor_plcp(entry, txdesc, hwrate); 402 rt2x00queue_create_tx_descriptor_plcp(entry, txdesc, hwrate);
@@ -436,7 +436,7 @@ static int rt2x00queue_write_tx_data(struct queue_entry *entry,
436 /* 436 /*
437 * Map the skb to DMA. 437 * Map the skb to DMA.
438 */ 438 */
439 if (test_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags)) 439 if (test_bit(REQUIRE_DMA, &rt2x00dev->cap_flags))
440 rt2x00queue_map_txskb(entry); 440 rt2x00queue_map_txskb(entry);
441 441
442 return 0; 442 return 0;
@@ -529,7 +529,7 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
529 */ 529 */
530 if (test_bit(ENTRY_TXD_ENCRYPT, &txdesc.flags) && 530 if (test_bit(ENTRY_TXD_ENCRYPT, &txdesc.flags) &&
531 !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc.flags)) { 531 !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc.flags)) {
532 if (test_bit(DRIVER_REQUIRE_COPY_IV, &queue->rt2x00dev->flags)) 532 if (test_bit(REQUIRE_COPY_IV, &queue->rt2x00dev->cap_flags))
533 rt2x00crypto_tx_copy_iv(skb, &txdesc); 533 rt2x00crypto_tx_copy_iv(skb, &txdesc);
534 else 534 else
535 rt2x00crypto_tx_remove_iv(skb, &txdesc); 535 rt2x00crypto_tx_remove_iv(skb, &txdesc);
@@ -543,9 +543,9 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
543 * PCI and USB devices, while header alignment only is valid 543 * PCI and USB devices, while header alignment only is valid
544 * for PCI devices. 544 * for PCI devices.
545 */ 545 */
546 if (test_bit(DRIVER_REQUIRE_L2PAD, &queue->rt2x00dev->flags)) 546 if (test_bit(REQUIRE_L2PAD, &queue->rt2x00dev->cap_flags))
547 rt2x00queue_insert_l2pad(entry->skb, txdesc.header_length); 547 rt2x00queue_insert_l2pad(entry->skb, txdesc.header_length);
548 else if (test_bit(DRIVER_REQUIRE_DMA, &queue->rt2x00dev->flags)) 548 else if (test_bit(REQUIRE_DMA, &queue->rt2x00dev->cap_flags))
549 rt2x00queue_align_frame(entry->skb); 549 rt2x00queue_align_frame(entry->skb);
550 550
551 /* 551 /*
@@ -1069,7 +1069,7 @@ int rt2x00queue_initialize(struct rt2x00_dev *rt2x00dev)
1069 if (status) 1069 if (status)
1070 goto exit; 1070 goto exit;
1071 1071
1072 if (test_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags)) { 1072 if (test_bit(REQUIRE_ATIM_QUEUE, &rt2x00dev->cap_flags)) {
1073 status = rt2x00queue_alloc_entries(rt2x00dev->atim, 1073 status = rt2x00queue_alloc_entries(rt2x00dev->atim,
1074 rt2x00dev->ops->atim); 1074 rt2x00dev->ops->atim);
1075 if (status) 1075 if (status)
@@ -1121,7 +1121,7 @@ int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev)
1121 struct data_queue *queue; 1121 struct data_queue *queue;
1122 enum data_queue_qid qid; 1122 enum data_queue_qid qid;
1123 unsigned int req_atim = 1123 unsigned int req_atim =
1124 !!test_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags); 1124 !!test_bit(REQUIRE_ATIM_QUEUE, &rt2x00dev->cap_flags);
1125 1125
1126 /* 1126 /*
1127 * We need the following queues: 1127 * We need the following queues:
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index fbe735f5b352..94047e9b2ec6 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -387,7 +387,7 @@ static void rt2x00usb_flush_entry(struct queue_entry *entry)
387 * Kill guardian urb (if required by driver). 387 * Kill guardian urb (if required by driver).
388 */ 388 */
389 if ((entry->queue->qid == QID_BEACON) && 389 if ((entry->queue->qid == QID_BEACON) &&
390 (test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags))) 390 (test_bit(REQUIRE_BEACON_GUARD, &rt2x00dev->cap_flags)))
391 usb_kill_urb(bcn_priv->guardian_urb); 391 usb_kill_urb(bcn_priv->guardian_urb);
392} 392}
393 393
@@ -583,7 +583,7 @@ static int rt2x00usb_alloc_entries(struct data_queue *queue)
583 * then we are done. 583 * then we are done.
584 */ 584 */
585 if (queue->qid != QID_BEACON || 585 if (queue->qid != QID_BEACON ||
586 !test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags)) 586 !test_bit(REQUIRE_BEACON_GUARD, &rt2x00dev->cap_flags))
587 return 0; 587 return 0;
588 588
589 for (i = 0; i < queue->limit; i++) { 589 for (i = 0; i < queue->limit; i++) {
@@ -618,7 +618,7 @@ static void rt2x00usb_free_entries(struct data_queue *queue)
618 * then we are done. 618 * then we are done.
619 */ 619 */
620 if (queue->qid != QID_BEACON || 620 if (queue->qid != QID_BEACON ||
621 !test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags)) 621 !test_bit(REQUIRE_BEACON_GUARD, &rt2x00dev->cap_flags))
622 return; 622 return;
623 623
624 for (i = 0; i < queue->limit; i++) { 624 for (i = 0; i < queue->limit; i++) {
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 8ee1514a7943..c16c1501df18 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -683,7 +683,7 @@ static void rt61pci_config_antenna_2x(struct rt2x00_dev *rt2x00dev,
683 683
684 rt2x00_set_field8(&r3, BBP_R3_SMART_MODE, rt2x00_rf(rt2x00dev, RF2529)); 684 rt2x00_set_field8(&r3, BBP_R3_SMART_MODE, rt2x00_rf(rt2x00dev, RF2529));
685 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, 685 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END,
686 !test_bit(CONFIG_FRAME_TYPE, &rt2x00dev->flags)); 686 !test_bit(CAPABILITY_FRAME_TYPE, &rt2x00dev->cap_flags));
687 687
688 /* 688 /*
689 * Configure the RX antenna. 689 * Configure the RX antenna.
@@ -811,10 +811,10 @@ static void rt61pci_config_ant(struct rt2x00_dev *rt2x00dev,
811 811
812 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) { 812 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) {
813 sel = antenna_sel_a; 813 sel = antenna_sel_a;
814 lna = test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags); 814 lna = test_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags);
815 } else { 815 } else {
816 sel = antenna_sel_bg; 816 sel = antenna_sel_bg;
817 lna = test_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags); 817 lna = test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags);
818 } 818 }
819 819
820 for (i = 0; i < ARRAY_SIZE(antenna_sel_a); i++) 820 for (i = 0; i < ARRAY_SIZE(antenna_sel_a); i++)
@@ -834,7 +834,7 @@ static void rt61pci_config_ant(struct rt2x00_dev *rt2x00dev,
834 else if (rt2x00_rf(rt2x00dev, RF2527)) 834 else if (rt2x00_rf(rt2x00dev, RF2527))
835 rt61pci_config_antenna_2x(rt2x00dev, ant); 835 rt61pci_config_antenna_2x(rt2x00dev, ant);
836 else if (rt2x00_rf(rt2x00dev, RF2529)) { 836 else if (rt2x00_rf(rt2x00dev, RF2529)) {
837 if (test_bit(CONFIG_DOUBLE_ANTENNA, &rt2x00dev->flags)) 837 if (test_bit(CAPABILITY_DOUBLE_ANTENNA, &rt2x00dev->cap_flags))
838 rt61pci_config_antenna_2x(rt2x00dev, ant); 838 rt61pci_config_antenna_2x(rt2x00dev, ant);
839 else 839 else
840 rt61pci_config_antenna_2529(rt2x00dev, ant); 840 rt61pci_config_antenna_2529(rt2x00dev, ant);
@@ -848,13 +848,13 @@ static void rt61pci_config_lna_gain(struct rt2x00_dev *rt2x00dev,
848 short lna_gain = 0; 848 short lna_gain = 0;
849 849
850 if (libconf->conf->channel->band == IEEE80211_BAND_2GHZ) { 850 if (libconf->conf->channel->band == IEEE80211_BAND_2GHZ) {
851 if (test_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags)) 851 if (test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags))
852 lna_gain += 14; 852 lna_gain += 14;
853 853
854 rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG, &eeprom); 854 rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG, &eeprom);
855 lna_gain -= rt2x00_get_field16(eeprom, EEPROM_RSSI_OFFSET_BG_1); 855 lna_gain -= rt2x00_get_field16(eeprom, EEPROM_RSSI_OFFSET_BG_1);
856 } else { 856 } else {
857 if (test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags)) 857 if (test_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags))
858 lna_gain += 14; 858 lna_gain += 14;
859 859
860 rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_A, &eeprom); 860 rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_A, &eeprom);
@@ -1050,14 +1050,14 @@ static void rt61pci_link_tuner(struct rt2x00_dev *rt2x00dev,
1050 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) { 1050 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) {
1051 low_bound = 0x28; 1051 low_bound = 0x28;
1052 up_bound = 0x48; 1052 up_bound = 0x48;
1053 if (test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags)) { 1053 if (test_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags)) {
1054 low_bound += 0x10; 1054 low_bound += 0x10;
1055 up_bound += 0x10; 1055 up_bound += 0x10;
1056 } 1056 }
1057 } else { 1057 } else {
1058 low_bound = 0x20; 1058 low_bound = 0x20;
1059 up_bound = 0x40; 1059 up_bound = 0x40;
1060 if (test_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags)) { 1060 if (test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags)) {
1061 low_bound += 0x10; 1061 low_bound += 0x10;
1062 up_bound += 0x10; 1062 up_bound += 0x10;
1063 } 1063 }
@@ -2537,7 +2537,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
2537 * Determine number of antennas. 2537 * Determine number of antennas.
2538 */ 2538 */
2539 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_NUM) == 2) 2539 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_NUM) == 2)
2540 __set_bit(CONFIG_DOUBLE_ANTENNA, &rt2x00dev->flags); 2540 __set_bit(CAPABILITY_DOUBLE_ANTENNA, &rt2x00dev->cap_flags);
2541 2541
2542 /* 2542 /*
2543 * Identify default antenna configuration. 2543 * Identify default antenna configuration.
@@ -2551,20 +2551,20 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
2551 * Read the Frame type. 2551 * Read the Frame type.
2552 */ 2552 */
2553 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_FRAME_TYPE)) 2553 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_FRAME_TYPE))
2554 __set_bit(CONFIG_FRAME_TYPE, &rt2x00dev->flags); 2554 __set_bit(CAPABILITY_FRAME_TYPE, &rt2x00dev->cap_flags);
2555 2555
2556 /* 2556 /*
2557 * Detect if this device has a hardware controlled radio. 2557 * Detect if this device has a hardware controlled radio.
2558 */ 2558 */
2559 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) 2559 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO))
2560 __set_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags); 2560 __set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags);
2561 2561
2562 /* 2562 /*
2563 * Read frequency offset and RF programming sequence. 2563 * Read frequency offset and RF programming sequence.
2564 */ 2564 */
2565 rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ, &eeprom); 2565 rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ, &eeprom);
2566 if (rt2x00_get_field16(eeprom, EEPROM_FREQ_SEQ)) 2566 if (rt2x00_get_field16(eeprom, EEPROM_FREQ_SEQ))
2567 __set_bit(CONFIG_RF_SEQUENCE, &rt2x00dev->flags); 2567 __set_bit(CAPABILITY_RF_SEQUENCE, &rt2x00dev->cap_flags);
2568 2568
2569 rt2x00dev->freq_offset = rt2x00_get_field16(eeprom, EEPROM_FREQ_OFFSET); 2569 rt2x00dev->freq_offset = rt2x00_get_field16(eeprom, EEPROM_FREQ_OFFSET);
2570 2570
@@ -2574,9 +2574,9 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
2574 rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom); 2574 rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom);
2575 2575
2576 if (rt2x00_get_field16(eeprom, EEPROM_NIC_EXTERNAL_LNA_A)) 2576 if (rt2x00_get_field16(eeprom, EEPROM_NIC_EXTERNAL_LNA_A))
2577 __set_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags); 2577 __set_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags);
2578 if (rt2x00_get_field16(eeprom, EEPROM_NIC_EXTERNAL_LNA_BG)) 2578 if (rt2x00_get_field16(eeprom, EEPROM_NIC_EXTERNAL_LNA_BG))
2579 __set_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags); 2579 __set_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags);
2580 2580
2581 /* 2581 /*
2582 * When working with a RF2529 chip without double antenna, 2582 * When working with a RF2529 chip without double antenna,
@@ -2584,7 +2584,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
2584 * eeprom word. 2584 * eeprom word.
2585 */ 2585 */
2586 if (rt2x00_rf(rt2x00dev, RF2529) && 2586 if (rt2x00_rf(rt2x00dev, RF2529) &&
2587 !test_bit(CONFIG_DOUBLE_ANTENNA, &rt2x00dev->flags)) { 2587 !test_bit(CAPABILITY_DOUBLE_ANTENNA, &rt2x00dev->cap_flags)) {
2588 rt2x00dev->default_ant.rx = 2588 rt2x00dev->default_ant.rx =
2589 ANTENNA_A + rt2x00_get_field16(eeprom, EEPROM_NIC_RX_FIXED); 2589 ANTENNA_A + rt2x00_get_field16(eeprom, EEPROM_NIC_RX_FIXED);
2590 rt2x00dev->default_ant.tx = 2590 rt2x00dev->default_ant.tx =
@@ -2799,7 +2799,7 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
2799 spec->supported_bands = SUPPORT_BAND_2GHZ; 2799 spec->supported_bands = SUPPORT_BAND_2GHZ;
2800 spec->supported_rates = SUPPORT_RATE_CCK | SUPPORT_RATE_OFDM; 2800 spec->supported_rates = SUPPORT_RATE_CCK | SUPPORT_RATE_OFDM;
2801 2801
2802 if (!test_bit(CONFIG_RF_SEQUENCE, &rt2x00dev->flags)) { 2802 if (!test_bit(CAPABILITY_RF_SEQUENCE, &rt2x00dev->cap_flags)) {
2803 spec->num_channels = 14; 2803 spec->num_channels = 14;
2804 spec->channels = rf_vals_noseq; 2804 spec->channels = rf_vals_noseq;
2805 } else { 2805 } else {
@@ -2869,16 +2869,16 @@ static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev)
2869 * This device has multiple filters for control frames, 2869 * This device has multiple filters for control frames,
2870 * but has no a separate filter for PS Poll frames. 2870 * but has no a separate filter for PS Poll frames.
2871 */ 2871 */
2872 __set_bit(DRIVER_SUPPORT_CONTROL_FILTERS, &rt2x00dev->flags); 2872 __set_bit(CAPABILITY_CONTROL_FILTERS, &rt2x00dev->cap_flags);
2873 2873
2874 /* 2874 /*
2875 * This device requires firmware and DMA mapped skbs. 2875 * This device requires firmware and DMA mapped skbs.
2876 */ 2876 */
2877 __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags); 2877 __set_bit(REQUIRE_FIRMWARE, &rt2x00dev->cap_flags);
2878 __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags); 2878 __set_bit(REQUIRE_DMA, &rt2x00dev->cap_flags);
2879 if (!modparam_nohwcrypt) 2879 if (!modparam_nohwcrypt)
2880 __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); 2880 __set_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags);
2881 __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags); 2881 __set_bit(CAPABILITY_LINK_TUNING, &rt2x00dev->cap_flags);
2882 2882
2883 /* 2883 /*
2884 * Set the rssi offset. 2884 * Set the rssi offset.
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 6593059f9c7e..cdb026d076db 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -595,7 +595,7 @@ static void rt73usb_config_antenna_5x(struct rt2x00_dev *rt2x00dev,
595 switch (ant->rx) { 595 switch (ant->rx) {
596 case ANTENNA_HW_DIVERSITY: 596 case ANTENNA_HW_DIVERSITY:
597 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 2); 597 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 2);
598 temp = !test_bit(CONFIG_FRAME_TYPE, &rt2x00dev->flags) 598 temp = !test_bit(CAPABILITY_FRAME_TYPE, &rt2x00dev->cap_flags)
599 && (rt2x00dev->curr_band != IEEE80211_BAND_5GHZ); 599 && (rt2x00dev->curr_band != IEEE80211_BAND_5GHZ);
600 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, temp); 600 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, temp);
601 break; 601 break;
@@ -636,7 +636,7 @@ static void rt73usb_config_antenna_2x(struct rt2x00_dev *rt2x00dev,
636 636
637 rt2x00_set_field8(&r3, BBP_R3_SMART_MODE, 0); 637 rt2x00_set_field8(&r3, BBP_R3_SMART_MODE, 0);
638 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, 638 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END,
639 !test_bit(CONFIG_FRAME_TYPE, &rt2x00dev->flags)); 639 !test_bit(CAPABILITY_FRAME_TYPE, &rt2x00dev->cap_flags));
640 640
641 /* 641 /*
642 * Configure the RX antenna. 642 * Configure the RX antenna.
@@ -709,10 +709,10 @@ static void rt73usb_config_ant(struct rt2x00_dev *rt2x00dev,
709 709
710 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) { 710 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) {
711 sel = antenna_sel_a; 711 sel = antenna_sel_a;
712 lna = test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags); 712 lna = test_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags);
713 } else { 713 } else {
714 sel = antenna_sel_bg; 714 sel = antenna_sel_bg;
715 lna = test_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags); 715 lna = test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags);
716 } 716 }
717 717
718 for (i = 0; i < ARRAY_SIZE(antenna_sel_a); i++) 718 for (i = 0; i < ARRAY_SIZE(antenna_sel_a); i++)
@@ -740,7 +740,7 @@ static void rt73usb_config_lna_gain(struct rt2x00_dev *rt2x00dev,
740 short lna_gain = 0; 740 short lna_gain = 0;
741 741
742 if (libconf->conf->channel->band == IEEE80211_BAND_2GHZ) { 742 if (libconf->conf->channel->band == IEEE80211_BAND_2GHZ) {
743 if (test_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags)) 743 if (test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags))
744 lna_gain += 14; 744 lna_gain += 14;
745 745
746 rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG, &eeprom); 746 rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG, &eeprom);
@@ -930,7 +930,7 @@ static void rt73usb_link_tuner(struct rt2x00_dev *rt2x00dev,
930 low_bound = 0x28; 930 low_bound = 0x28;
931 up_bound = 0x48; 931 up_bound = 0x48;
932 932
933 if (test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags)) { 933 if (test_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags)) {
934 low_bound += 0x10; 934 low_bound += 0x10;
935 up_bound += 0x10; 935 up_bound += 0x10;
936 } 936 }
@@ -946,7 +946,7 @@ static void rt73usb_link_tuner(struct rt2x00_dev *rt2x00dev,
946 up_bound = 0x1c; 946 up_bound = 0x1c;
947 } 947 }
948 948
949 if (test_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags)) { 949 if (test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags)) {
950 low_bound += 0x14; 950 low_bound += 0x14;
951 up_bound += 0x10; 951 up_bound += 0x10;
952 } 952 }
@@ -1661,7 +1661,7 @@ static int rt73usb_agc_to_rssi(struct rt2x00_dev *rt2x00dev, int rxd_w1)
1661 } 1661 }
1662 1662
1663 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) { 1663 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) {
1664 if (test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags)) { 1664 if (test_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags)) {
1665 if (lna == 3 || lna == 2) 1665 if (lna == 3 || lna == 2)
1666 offset += 10; 1666 offset += 10;
1667 } else { 1667 } else {
@@ -1899,13 +1899,13 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
1899 * Read the Frame type. 1899 * Read the Frame type.
1900 */ 1900 */
1901 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_FRAME_TYPE)) 1901 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_FRAME_TYPE))
1902 __set_bit(CONFIG_FRAME_TYPE, &rt2x00dev->flags); 1902 __set_bit(CAPABILITY_FRAME_TYPE, &rt2x00dev->cap_flags);
1903 1903
1904 /* 1904 /*
1905 * Detect if this device has an hardware controlled radio. 1905 * Detect if this device has an hardware controlled radio.
1906 */ 1906 */
1907 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) 1907 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO))
1908 __set_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags); 1908 __set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags);
1909 1909
1910 /* 1910 /*
1911 * Read frequency offset. 1911 * Read frequency offset.
@@ -1919,8 +1919,8 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
1919 rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom); 1919 rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom);
1920 1920
1921 if (rt2x00_get_field16(eeprom, EEPROM_NIC_EXTERNAL_LNA)) { 1921 if (rt2x00_get_field16(eeprom, EEPROM_NIC_EXTERNAL_LNA)) {
1922 __set_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags); 1922 __set_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags);
1923 __set_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags); 1923 __set_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags);
1924 } 1924 }
1925 1925
1926 /* 1926 /*
@@ -2200,15 +2200,15 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev)
2200 * This device has multiple filters for control frames, 2200 * This device has multiple filters for control frames,
2201 * but has no a separate filter for PS Poll frames. 2201 * but has no a separate filter for PS Poll frames.
2202 */ 2202 */
2203 __set_bit(DRIVER_SUPPORT_CONTROL_FILTERS, &rt2x00dev->flags); 2203 __set_bit(CAPABILITY_CONTROL_FILTERS, &rt2x00dev->cap_flags);
2204 2204
2205 /* 2205 /*
2206 * This device requires firmware. 2206 * This device requires firmware.
2207 */ 2207 */
2208 __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags); 2208 __set_bit(REQUIRE_FIRMWARE, &rt2x00dev->cap_flags);
2209 if (!modparam_nohwcrypt) 2209 if (!modparam_nohwcrypt)
2210 __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); 2210 __set_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags);
2211 __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags); 2211 __set_bit(CAPABILITY_LINK_TUNING, &rt2x00dev->cap_flags);
2212 2212
2213 /* 2213 /*
2214 * Set the rssi offset. 2214 * Set the rssi offset.