aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2800pci.c
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/rt2800pci.c
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/rt2800pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c22
1 files changed, 11 insertions, 11 deletions
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.