diff options
author | Gertjan van Wingerde <gwingerde@gmail.com> | 2010-06-29 15:41:40 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-06-30 15:00:50 -0400 |
commit | e513a0b6f1bf8e1b59b0e1382d4e7ef3d344d535 (patch) | |
tree | 6cc2ff94dd486eb4b5eb7b6d2aabc0bff4b033c5 /drivers/net | |
parent | 78eea11b0e6ae5771bc19cc46984f1cdcbbb6ba1 (diff) |
rt2x00: Move common txdone handling to rt2x00lib_txdone.
Now that the write_tx_data functions are merged, also merge the relevant
parts of the txdone handling into common code, rather than {usb,pci}
specific code.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00pci.c | 31 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00pci.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 4 |
8 files changed, 20 insertions, 55 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 1ad3596cb41e..3bedf566c8ee 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1229,7 +1229,7 @@ static void rt2400pci_txdone(struct rt2x00_dev *rt2x00dev, | |||
1229 | } | 1229 | } |
1230 | txdesc.retry = rt2x00_get_field32(word, TXD_W0_RETRY_COUNT); | 1230 | txdesc.retry = rt2x00_get_field32(word, TXD_W0_RETRY_COUNT); |
1231 | 1231 | ||
1232 | rt2x00pci_txdone(entry, &txdesc); | 1232 | rt2x00lib_txdone(entry, &txdesc); |
1233 | } | 1233 | } |
1234 | } | 1234 | } |
1235 | 1235 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index 2771ae707a34..69d231d83952 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -1365,7 +1365,7 @@ static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev, | |||
1365 | } | 1365 | } |
1366 | txdesc.retry = rt2x00_get_field32(word, TXD_W0_RETRY_COUNT); | 1366 | txdesc.retry = rt2x00_get_field32(word, TXD_W0_RETRY_COUNT); |
1367 | 1367 | ||
1368 | rt2x00pci_txdone(entry, &txdesc); | 1368 | rt2x00lib_txdone(entry, &txdesc); |
1369 | } | 1369 | } |
1370 | } | 1370 | } |
1371 | 1371 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 615a865351a2..894a43a8909e 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -905,7 +905,7 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev) | |||
905 | if (txdesc.retry) | 905 | if (txdesc.retry) |
906 | __set_bit(TXDONE_FALLBACK, &txdesc.flags); | 906 | __set_bit(TXDONE_FALLBACK, &txdesc.flags); |
907 | 907 | ||
908 | rt2x00pci_txdone(entry, &txdesc); | 908 | rt2x00lib_txdone(entry, &txdesc); |
909 | } | 909 | } |
910 | } | 910 | } |
911 | 911 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index a914855099b7..12ee7bdedd02 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -211,6 +211,21 @@ void rt2x00lib_txdone(struct queue_entry *entry, | |||
211 | bool success; | 211 | bool success; |
212 | 212 | ||
213 | /* | 213 | /* |
214 | * Unmap the skb. | ||
215 | */ | ||
216 | rt2x00queue_unmap_skb(rt2x00dev, entry->skb); | ||
217 | |||
218 | /* | ||
219 | * Remove the extra tx headroom from the skb. | ||
220 | */ | ||
221 | skb_pull(entry->skb, rt2x00dev->ops->extra_tx_headroom); | ||
222 | |||
223 | /* | ||
224 | * Signal that the TX descriptor is no longer in the skb. | ||
225 | */ | ||
226 | skbdesc->flags &= ~SKBDESC_DESC_IN_SKB; | ||
227 | |||
228 | /* | ||
214 | * Remove L2 padding which was added during | 229 | * Remove L2 padding which was added during |
215 | */ | 230 | */ |
216 | if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags)) | 231 | if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags)) |
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index 1c9ccc30b6a4..fc9da8358784 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c | |||
@@ -60,37 +60,6 @@ int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev, | |||
60 | } | 60 | } |
61 | EXPORT_SYMBOL_GPL(rt2x00pci_regbusy_read); | 61 | EXPORT_SYMBOL_GPL(rt2x00pci_regbusy_read); |
62 | 62 | ||
63 | /* | ||
64 | * TX/RX data handlers. | ||
65 | */ | ||
66 | void rt2x00pci_txdone(struct queue_entry *entry, | ||
67 | struct txdone_entry_desc *txdesc) | ||
68 | { | ||
69 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | ||
70 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | ||
71 | |||
72 | /* | ||
73 | * Unmap the skb. | ||
74 | */ | ||
75 | rt2x00queue_unmap_skb(rt2x00dev, entry->skb); | ||
76 | |||
77 | /* | ||
78 | * Remove the extra tx headroom from the skb. | ||
79 | */ | ||
80 | skb_pull(entry->skb, rt2x00dev->ops->extra_tx_headroom); | ||
81 | |||
82 | /* | ||
83 | * Signal that the TX descriptor is no longer in the skb. | ||
84 | */ | ||
85 | skbdesc->flags &= ~SKBDESC_DESC_IN_SKB; | ||
86 | |||
87 | /* | ||
88 | * Pass on to rt2x00lib. | ||
89 | */ | ||
90 | rt2x00lib_txdone(entry, txdesc); | ||
91 | } | ||
92 | EXPORT_SYMBOL_GPL(rt2x00pci_txdone); | ||
93 | |||
94 | void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev) | 63 | void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev) |
95 | { | 64 | { |
96 | struct data_queue *queue = rt2x00dev->rx; | 65 | struct data_queue *queue = rt2x00dev->rx; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.h b/drivers/net/wireless/rt2x00/rt2x00pci.h index 2dca18532f2e..b854d62ff99b 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.h +++ b/drivers/net/wireless/rt2x00/rt2x00pci.h | |||
@@ -99,14 +99,6 @@ struct queue_entry_priv_pci { | |||
99 | }; | 99 | }; |
100 | 100 | ||
101 | /** | 101 | /** |
102 | * rt2x00pci_txdone - Handle TX done events. | ||
103 | * @entry: The queue entry for which a TX done event was received. | ||
104 | * @txdesc: The TX done descriptor for the entry. | ||
105 | */ | ||
106 | void rt2x00pci_txdone(struct queue_entry *entry, | ||
107 | struct txdone_entry_desc *txdesc); | ||
108 | |||
109 | /** | ||
110 | * rt2x00pci_rxdone - Handle RX done events | 102 | * rt2x00pci_rxdone - Handle RX done events |
111 | * @rt2x00dev: Device pointer, see &struct rt2x00_dev. | 103 | * @rt2x00dev: Device pointer, see &struct rt2x00_dev. |
112 | */ | 104 | */ |
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index f78ebb4d8cf1..a22837c560fd 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -171,7 +171,6 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb) | |||
171 | { | 171 | { |
172 | struct queue_entry *entry = (struct queue_entry *)urb->context; | 172 | struct queue_entry *entry = (struct queue_entry *)urb->context; |
173 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 173 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
174 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | ||
175 | struct txdone_entry_desc txdesc; | 174 | struct txdone_entry_desc txdesc; |
176 | 175 | ||
177 | if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags) || | 176 | if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags) || |
@@ -179,16 +178,6 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb) | |||
179 | return; | 178 | return; |
180 | 179 | ||
181 | /* | 180 | /* |
182 | * Remove the descriptor from the front of the skb. | ||
183 | */ | ||
184 | skb_pull(entry->skb, entry->queue->desc_size); | ||
185 | |||
186 | /* | ||
187 | * Signal that the TX descriptor is no longer in the skb. | ||
188 | */ | ||
189 | skbdesc->flags &= ~SKBDESC_DESC_IN_SKB; | ||
190 | |||
191 | /* | ||
192 | * Obtain the status about this packet. | 181 | * Obtain the status about this packet. |
193 | * Note that when the status is 0 it does not mean the | 182 | * Note that when the status is 0 it does not mean the |
194 | * frame was send out correctly. It only means the frame | 183 | * frame was send out correctly. It only means the frame |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index cb6e20a1046e..1e74f8c1b9c5 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -2108,7 +2108,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev) | |||
2108 | __set_bit(TXDONE_UNKNOWN, &txdesc.flags); | 2108 | __set_bit(TXDONE_UNKNOWN, &txdesc.flags); |
2109 | txdesc.retry = 0; | 2109 | txdesc.retry = 0; |
2110 | 2110 | ||
2111 | rt2x00pci_txdone(entry_done, &txdesc); | 2111 | rt2x00lib_txdone(entry_done, &txdesc); |
2112 | entry_done = rt2x00queue_get_entry(queue, Q_INDEX_DONE); | 2112 | entry_done = rt2x00queue_get_entry(queue, Q_INDEX_DONE); |
2113 | } | 2113 | } |
2114 | 2114 | ||
@@ -2135,7 +2135,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev) | |||
2135 | if (txdesc.retry) | 2135 | if (txdesc.retry) |
2136 | __set_bit(TXDONE_FALLBACK, &txdesc.flags); | 2136 | __set_bit(TXDONE_FALLBACK, &txdesc.flags); |
2137 | 2137 | ||
2138 | rt2x00pci_txdone(entry, &txdesc); | 2138 | rt2x00lib_txdone(entry, &txdesc); |
2139 | } | 2139 | } |
2140 | } | 2140 | } |
2141 | 2141 | ||