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