diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-03-15 16:38:07 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-25 16:41:58 -0400 |
commit | 19d30e02998ef1eb9f82a7d3ce9b4a97dba5aa13 (patch) | |
tree | 66972ff817b2d6b8641a04d4f6e122e8fdc710ba | |
parent | e2839d8f509451acf6b1f22787f25ce98383d94c (diff) |
rt2x00: Add dev_flags to rx descriptor
The rxdone_entry_desc structure contains 3 fields
which are always 1 or 0. We can safe 8 bytes by
replacing them with a single dev_flags fields which
contain the flags for those settings.
Additionally we can remove the OFDM flag since it
is no longer used since the introduction of the
SIGNAL_PLCP flag.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.h | 22 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 9 |
7 files changed, 48 insertions, 25 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 1f49561d3ddc..c58b1c0abc3c 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1076,12 +1076,13 @@ static void rt2400pci_fill_rxdone(struct queue_entry *entry, | |||
1076 | * of the preamble bit (0x08). | 1076 | * of the preamble bit (0x08). |
1077 | */ | 1077 | */ |
1078 | rxdesc->signal = rt2x00_get_field32(word2, RXD_W2_SIGNAL) & ~0x08; | 1078 | rxdesc->signal = rt2x00_get_field32(word2, RXD_W2_SIGNAL) & ~0x08; |
1079 | rxdesc->signal_plcp = 1; | ||
1080 | rxdesc->rssi = rt2x00_get_field32(word2, RXD_W3_RSSI) - | 1079 | rxdesc->rssi = rt2x00_get_field32(word2, RXD_W3_RSSI) - |
1081 | entry->queue->rt2x00dev->rssi_offset; | 1080 | entry->queue->rt2x00dev->rssi_offset; |
1082 | rxdesc->ofdm = 0; | ||
1083 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); | 1081 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); |
1084 | rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS); | 1082 | |
1083 | rxdesc->dev_flags = RXDONE_SIGNAL_PLCP; | ||
1084 | if (rt2x00_get_field32(word0, RXD_W0_MY_BSS)) | ||
1085 | rxdesc->dev_flags |= RXDONE_MY_BSS; | ||
1085 | } | 1086 | } |
1086 | 1087 | ||
1087 | /* | 1088 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index 0f5139a2f238..9468dde3c95e 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -1225,13 +1225,16 @@ static void rt2500pci_fill_rxdone(struct queue_entry *entry, | |||
1225 | * the signal is the PLCP value. If it was received with | 1225 | * the signal is the PLCP value. If it was received with |
1226 | * a CCK bitrate the signal is the rate in 100kbit/s. | 1226 | * a CCK bitrate the signal is the rate in 100kbit/s. |
1227 | */ | 1227 | */ |
1228 | rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM); | ||
1229 | rxdesc->signal = rt2x00_get_field32(word2, RXD_W2_SIGNAL); | 1228 | rxdesc->signal = rt2x00_get_field32(word2, RXD_W2_SIGNAL); |
1230 | rxdesc->signal_plcp = rxdesc->ofdm; | ||
1231 | rxdesc->rssi = rt2x00_get_field32(word2, RXD_W2_RSSI) - | 1229 | rxdesc->rssi = rt2x00_get_field32(word2, RXD_W2_RSSI) - |
1232 | entry->queue->rt2x00dev->rssi_offset; | 1230 | entry->queue->rt2x00dev->rssi_offset; |
1233 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); | 1231 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); |
1234 | rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS); | 1232 | |
1233 | rxdesc->dev_flags = 0; | ||
1234 | if (rt2x00_get_field32(word0, RXD_W0_OFDM)) | ||
1235 | rxdesc->dev_flags |= RXDONE_SIGNAL_PLCP; | ||
1236 | if (rt2x00_get_field32(word0, RXD_W0_MY_BSS)) | ||
1237 | rxdesc->dev_flags |= RXDONE_MY_BSS; | ||
1235 | } | 1238 | } |
1236 | 1239 | ||
1237 | /* | 1240 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index c8216d755835..8959a684f40b 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1139,13 +1139,16 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry, | |||
1139 | * the signal is the PLCP value. If it was received with | 1139 | * the signal is the PLCP value. If it was received with |
1140 | * a CCK bitrate the signal is the rate in 100kbit/s. | 1140 | * a CCK bitrate the signal is the rate in 100kbit/s. |
1141 | */ | 1141 | */ |
1142 | rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM); | ||
1143 | rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL); | 1142 | rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL); |
1144 | rxdesc->signal_plcp = rxdesc->ofdm; | ||
1145 | rxdesc->rssi = rt2x00_get_field32(word1, RXD_W1_RSSI) - | 1143 | rxdesc->rssi = rt2x00_get_field32(word1, RXD_W1_RSSI) - |
1146 | entry->queue->rt2x00dev->rssi_offset; | 1144 | entry->queue->rt2x00dev->rssi_offset; |
1147 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); | 1145 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); |
1148 | rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS); | 1146 | |
1147 | rxdesc->dev_flags = 0; | ||
1148 | if (rt2x00_get_field32(word0, RXD_W0_OFDM)) | ||
1149 | rxdesc->dev_flags |= RXDONE_SIGNAL_PLCP; | ||
1150 | if (rt2x00_get_field32(word0, RXD_W0_MY_BSS)) | ||
1151 | rxdesc->dev_flags |= RXDONE_MY_BSS; | ||
1149 | 1152 | ||
1150 | /* | 1153 | /* |
1151 | * Adjust the skb memory window to the frame boundaries. | 1154 | * Adjust the skb memory window to the frame boundaries. |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index acf4d67ba43d..4fd0c25aebf3 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -580,8 +580,10 @@ void rt2x00lib_rxdone(struct queue_entry *entry, | |||
580 | for (i = 0; i < sband->n_bitrates; i++) { | 580 | for (i = 0; i < sband->n_bitrates; i++) { |
581 | rate = rt2x00_get_rate(sband->bitrates[i].hw_value); | 581 | rate = rt2x00_get_rate(sband->bitrates[i].hw_value); |
582 | 582 | ||
583 | if ((rxdesc->signal_plcp && rate->plcp == rxdesc->signal) || | 583 | if (((rxdesc->dev_flags & RXDONE_SIGNAL_PLCP) && |
584 | (!rxdesc->signal_plcp && rate->bitrate == rxdesc->signal)) { | 584 | (rate->plcp == rxdesc->signal)) || |
585 | (!(rxdesc->dev_flags & RXDONE_SIGNAL_PLCP) && | ||
586 | (rate->bitrate == rxdesc->signal))) { | ||
585 | idx = i; | 587 | idx = i; |
586 | break; | 588 | break; |
587 | } | 589 | } |
@@ -592,7 +594,7 @@ void rt2x00lib_rxdone(struct queue_entry *entry, | |||
592 | */ | 594 | */ |
593 | hdr = (struct ieee80211_hdr *)entry->skb->data; | 595 | hdr = (struct ieee80211_hdr *)entry->skb->data; |
594 | fc = le16_to_cpu(hdr->frame_control); | 596 | fc = le16_to_cpu(hdr->frame_control); |
595 | if (is_beacon(fc) && rxdesc->my_bss) | 597 | if (is_beacon(fc) && (rxdesc->dev_flags & RXDONE_MY_BSS)) |
596 | rt2x00lib_update_link_stats(&rt2x00dev->link, rxdesc->rssi); | 598 | rt2x00lib_update_link_stats(&rt2x00dev->link, rxdesc->rssi); |
597 | 599 | ||
598 | rt2x00dev->link.qual.rx_success++; | 600 | rt2x00dev->link.qual.rx_success++; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h index c5f46f234083..7027c9f47d3f 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.h +++ b/drivers/net/wireless/rt2x00/rt2x00queue.h | |||
@@ -129,27 +129,35 @@ static inline struct skb_frame_desc* get_skb_frame_desc(struct sk_buff *skb) | |||
129 | } | 129 | } |
130 | 130 | ||
131 | /** | 131 | /** |
132 | * enum rxdone_entry_desc_flags: Flags for &struct rxdone_entry_desc | ||
133 | * | ||
134 | * @RXDONE_SIGNAL_PLCP: Does the signal field contain the plcp value, | ||
135 | * or does it contain the bitrate itself. | ||
136 | * @RXDONE_MY_BSS: Does this frame originate from device's BSS. | ||
137 | */ | ||
138 | enum rxdone_entry_desc_flags { | ||
139 | RXDONE_SIGNAL_PLCP = 1 << 0, | ||
140 | RXDONE_MY_BSS = 1 << 1, | ||
141 | }; | ||
142 | |||
143 | /** | ||
132 | * struct rxdone_entry_desc: RX Entry descriptor | 144 | * struct rxdone_entry_desc: RX Entry descriptor |
133 | * | 145 | * |
134 | * Summary of information that has been read from the RX frame descriptor. | 146 | * Summary of information that has been read from the RX frame descriptor. |
135 | * | 147 | * |
136 | * @signal: Signal of the received frame. | 148 | * @signal: Signal of the received frame. |
137 | * @signal_plcp: Does the signal field contain the plcp value, | ||
138 | * or does it contain the bitrate itself. | ||
139 | * @rssi: RSSI of the received frame. | 149 | * @rssi: RSSI of the received frame. |
140 | * @ofdm: Was frame send with an OFDM rate. | ||
141 | * @size: Data size of the received frame. | 150 | * @size: Data size of the received frame. |
142 | * @flags: MAC80211 receive flags (See &enum mac80211_rx_flags). | 151 | * @flags: MAC80211 receive flags (See &enum mac80211_rx_flags). |
143 | * @my_bss: Does this frame originate from device's BSS. | 152 | * @dev_flags: Ralink receive flags (See &enum rxdone_entry_desc_flags). |
153 | |||
144 | */ | 154 | */ |
145 | struct rxdone_entry_desc { | 155 | struct rxdone_entry_desc { |
146 | int signal; | 156 | int signal; |
147 | int signal_plcp; | ||
148 | int rssi; | 157 | int rssi; |
149 | int ofdm; | ||
150 | int size; | 158 | int size; |
151 | int flags; | 159 | int flags; |
152 | int my_bss; | 160 | int dev_flags; |
153 | }; | 161 | }; |
154 | 162 | ||
155 | /** | 163 | /** |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index babb240cef3d..6e643c8db42e 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -1649,12 +1649,15 @@ static void rt61pci_fill_rxdone(struct queue_entry *entry, | |||
1649 | * the signal is the PLCP value. If it was received with | 1649 | * the signal is the PLCP value. If it was received with |
1650 | * a CCK bitrate the signal is the rate in 100kbit/s. | 1650 | * a CCK bitrate the signal is the rate in 100kbit/s. |
1651 | */ | 1651 | */ |
1652 | rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM); | ||
1653 | rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL); | 1652 | rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL); |
1654 | rxdesc->signal_plcp = rxdesc->ofdm; | ||
1655 | rxdesc->rssi = rt61pci_agc_to_rssi(entry->queue->rt2x00dev, word1); | 1653 | rxdesc->rssi = rt61pci_agc_to_rssi(entry->queue->rt2x00dev, word1); |
1656 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); | 1654 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); |
1657 | rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS); | 1655 | |
1656 | rxdesc->dev_flags = 0; | ||
1657 | if (rt2x00_get_field32(word0, RXD_W0_OFDM)) | ||
1658 | rxdesc->dev_flags |= RXDONE_SIGNAL_PLCP; | ||
1659 | if (rt2x00_get_field32(word0, RXD_W0_MY_BSS)) | ||
1660 | rxdesc->dev_flags |= RXDONE_MY_BSS; | ||
1658 | } | 1661 | } |
1659 | 1662 | ||
1660 | /* | 1663 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 46b040bf62de..b50f476e4bd1 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1409,12 +1409,15 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry, | |||
1409 | * the signal is the PLCP value. If it was received with | 1409 | * the signal is the PLCP value. If it was received with |
1410 | * a CCK bitrate the signal is the rate in 100kbit/s. | 1410 | * a CCK bitrate the signal is the rate in 100kbit/s. |
1411 | */ | 1411 | */ |
1412 | rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM); | ||
1413 | rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL); | 1412 | rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL); |
1414 | rxdesc->signal_plcp = rxdesc->ofdm; | ||
1415 | rxdesc->rssi = rt73usb_agc_to_rssi(entry->queue->rt2x00dev, word1); | 1413 | rxdesc->rssi = rt73usb_agc_to_rssi(entry->queue->rt2x00dev, word1); |
1416 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); | 1414 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); |
1417 | rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS); | 1415 | |
1416 | rxdesc->dev_flags = 0; | ||
1417 | if (rt2x00_get_field32(word0, RXD_W0_OFDM)) | ||
1418 | rxdesc->dev_flags |= RXDONE_SIGNAL_PLCP; | ||
1419 | if (rt2x00_get_field32(word0, RXD_W0_MY_BSS)) | ||
1420 | rxdesc->dev_flags |= RXDONE_MY_BSS; | ||
1418 | 1421 | ||
1419 | /* | 1422 | /* |
1420 | * Adjust the skb memory window to the frame boundaries. | 1423 | * Adjust the skb memory window to the frame boundaries. |