diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-06-16 13:54:57 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-06-26 16:49:15 -0400 |
commit | ac1044628d477d655f5f70420c3493119abeb6d3 (patch) | |
tree | 121ec41415259d41c497f55f94386762050eb8ca /drivers/net/wireless/rt2x00 | |
parent | e800f17c6ffe8b0410d8cf060ab204b93e9c73ab (diff) |
rt2x00: Use ieee80211 fc handlers
With the introduction of the ieee80211 fc handlers
we can now remove the rt2x00.h versions to use the
global versions.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Reviewed-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 27 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.c | 14 |
3 files changed, 7 insertions, 39 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 0da8f972a1b..21fd9b40be8 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -111,33 +111,6 @@ | |||
111 | #define EIFS ( SIFS + (8 * (IEEE80211_HEADER + ACK_SIZE)) ) | 111 | #define EIFS ( SIFS + (8 * (IEEE80211_HEADER + ACK_SIZE)) ) |
112 | 112 | ||
113 | /* | 113 | /* |
114 | * IEEE802.11 header defines | ||
115 | */ | ||
116 | static inline int is_rts_frame(u16 fc) | ||
117 | { | ||
118 | return (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) && | ||
119 | ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_RTS)); | ||
120 | } | ||
121 | |||
122 | static inline int is_cts_frame(u16 fc) | ||
123 | { | ||
124 | return (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) && | ||
125 | ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_CTS)); | ||
126 | } | ||
127 | |||
128 | static inline int is_probe_resp(u16 fc) | ||
129 | { | ||
130 | return (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) && | ||
131 | ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP)); | ||
132 | } | ||
133 | |||
134 | static inline int is_beacon(u16 fc) | ||
135 | { | ||
136 | return (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) && | ||
137 | ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON)); | ||
138 | } | ||
139 | |||
140 | /* | ||
141 | * Chipset identification | 114 | * Chipset identification |
142 | * The chipset on the device is composed of a RT and RF chip. | 115 | * The chipset on the device is composed of a RT and RF chip. |
143 | * The chipset combination is important for determining device capabilities. | 116 | * The chipset combination is important for determining device capabilities. |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 9ea677320da..f9e75319770 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -561,7 +561,6 @@ void rt2x00lib_rxdone(struct queue_entry *entry, | |||
561 | unsigned int align; | 561 | unsigned int align; |
562 | unsigned int i; | 562 | unsigned int i; |
563 | int idx = -1; | 563 | int idx = -1; |
564 | u16 fc; | ||
565 | 564 | ||
566 | /* | 565 | /* |
567 | * The data behind the ieee80211 header must be | 566 | * The data behind the ieee80211 header must be |
@@ -606,8 +605,8 @@ void rt2x00lib_rxdone(struct queue_entry *entry, | |||
606 | * Only update link status if this is a beacon frame carrying our bssid. | 605 | * Only update link status if this is a beacon frame carrying our bssid. |
607 | */ | 606 | */ |
608 | hdr = (struct ieee80211_hdr *)entry->skb->data; | 607 | hdr = (struct ieee80211_hdr *)entry->skb->data; |
609 | fc = le16_to_cpu(hdr->frame_control); | 608 | if (ieee80211_is_beacon(hdr->frame_control) && |
610 | if (is_beacon(fc) && (rxdesc->dev_flags & RXDONE_MY_BSS)) | 609 | (rxdesc->dev_flags & RXDONE_MY_BSS)) |
611 | rt2x00lib_update_link_stats(&rt2x00dev->link, rxdesc->rssi); | 610 | rt2x00lib_update_link_stats(&rt2x00dev->link, rxdesc->rssi); |
612 | 611 | ||
613 | rt2x00dev->link.qual.rx_success++; | 612 | rt2x00dev->link.qual.rx_success++; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 7b52039b01a..15660b588a1 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -80,7 +80,6 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
80 | unsigned int data_length; | 80 | unsigned int data_length; |
81 | unsigned int duration; | 81 | unsigned int duration; |
82 | unsigned int residual; | 82 | unsigned int residual; |
83 | u16 frame_control; | ||
84 | 83 | ||
85 | memset(txdesc, 0, sizeof(*txdesc)); | 84 | memset(txdesc, 0, sizeof(*txdesc)); |
86 | 85 | ||
@@ -96,11 +95,6 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
96 | data_length = entry->skb->len + 4; | 95 | data_length = entry->skb->len + 4; |
97 | 96 | ||
98 | /* | 97 | /* |
99 | * Read required fields from ieee80211 header. | ||
100 | */ | ||
101 | frame_control = le16_to_cpu(hdr->frame_control); | ||
102 | |||
103 | /* | ||
104 | * Check whether this frame is to be acked. | 98 | * Check whether this frame is to be acked. |
105 | */ | 99 | */ |
106 | if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) | 100 | if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) |
@@ -109,9 +103,10 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
109 | /* | 103 | /* |
110 | * Check if this is a RTS/CTS frame | 104 | * Check if this is a RTS/CTS frame |
111 | */ | 105 | */ |
112 | if (is_rts_frame(frame_control) || is_cts_frame(frame_control)) { | 106 | if (ieee80211_is_rts(hdr->frame_control) || |
107 | ieee80211_is_cts(hdr->frame_control)) { | ||
113 | __set_bit(ENTRY_TXD_BURST, &txdesc->flags); | 108 | __set_bit(ENTRY_TXD_BURST, &txdesc->flags); |
114 | if (is_rts_frame(frame_control)) | 109 | if (ieee80211_is_rts(hdr->frame_control)) |
115 | __set_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags); | 110 | __set_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags); |
116 | else | 111 | else |
117 | __set_bit(ENTRY_TXD_CTS_FRAME, &txdesc->flags); | 112 | __set_bit(ENTRY_TXD_CTS_FRAME, &txdesc->flags); |
@@ -139,7 +134,8 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
139 | * Beacons and probe responses require the tsf timestamp | 134 | * Beacons and probe responses require the tsf timestamp |
140 | * to be inserted into the frame. | 135 | * to be inserted into the frame. |
141 | */ | 136 | */ |
142 | if (txdesc->queue == QID_BEACON || is_probe_resp(frame_control)) | 137 | if (ieee80211_is_beacon(hdr->frame_control) || |
138 | ieee80211_is_probe_resp(hdr->frame_control)) | ||
143 | __set_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags); | 139 | __set_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags); |
144 | 140 | ||
145 | /* | 141 | /* |