diff options
author | Pavel Roskin <proski@gnu.org> | 2006-04-07 04:10:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-04-24 16:15:50 -0400 |
commit | 30c2d3b48176279b1381b00ae86f3d01147d0915 (patch) | |
tree | db25219cc9fc44a2e5590b1fb01c2923a20078a3 /drivers/net/wireless/orinoco.c | |
parent | 4ebe2eb0b388445d18dae34849cc6a9e7c55315f (diff) |
[PATCH] orinoco: optimize Tx exception handling in orinoco
When processing Tx exception, only read data until addr1. Rename
hermes_tx_descriptor_802_11 to hermes_txexc_data since it's only used to
Tx exceptions. Reuse existing hermes_tx_descriptor structure. Remove
fields after addr1 - they are not read from the card.
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco.c')
-rw-r--r-- | drivers/net/wireless/orinoco.c | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 9550bf308b1a..ceea494ff5d0 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -201,41 +201,12 @@ static struct { | |||
201 | /* Data types */ | 201 | /* Data types */ |
202 | /********************************************************************/ | 202 | /********************************************************************/ |
203 | 203 | ||
204 | /* Used in Event handling. | 204 | /* Beginning of the Tx descriptor, used in TxExc handling */ |
205 | * We avoid nested structures as they break on ARM -- Moustafa */ | 205 | struct hermes_txexc_data { |
206 | struct hermes_tx_descriptor_802_11 { | 206 | struct hermes_tx_descriptor desc; |
207 | /* hermes_tx_descriptor */ | ||
208 | __le16 status; | ||
209 | __le16 reserved1; | ||
210 | __le16 reserved2; | ||
211 | __le32 sw_support; | ||
212 | u8 retry_count; | ||
213 | u8 tx_rate; | ||
214 | __le16 tx_control; | ||
215 | |||
216 | /* ieee80211_hdr */ | ||
217 | __le16 frame_ctl; | 207 | __le16 frame_ctl; |
218 | __le16 duration_id; | 208 | __le16 duration_id; |
219 | u8 addr1[ETH_ALEN]; | 209 | u8 addr1[ETH_ALEN]; |
220 | u8 addr2[ETH_ALEN]; | ||
221 | u8 addr3[ETH_ALEN]; | ||
222 | __le16 seq_ctl; | ||
223 | u8 addr4[ETH_ALEN]; | ||
224 | |||
225 | __le16 data_len; | ||
226 | |||
227 | /* ethhdr */ | ||
228 | u8 h_dest[ETH_ALEN]; /* destination eth addr */ | ||
229 | u8 h_source[ETH_ALEN]; /* source ether addr */ | ||
230 | __be16 h_proto; /* packet type ID field */ | ||
231 | |||
232 | /* p8022_hdr */ | ||
233 | u8 dsap; | ||
234 | u8 ssap; | ||
235 | u8 ctrl; | ||
236 | u8 oui[3]; | ||
237 | |||
238 | __be16 ethertype; | ||
239 | } __attribute__ ((packed)); | 210 | } __attribute__ ((packed)); |
240 | 211 | ||
241 | /* Rx frame header except compatibility 802.3 header */ | 212 | /* Rx frame header except compatibility 802.3 header */ |
@@ -620,7 +591,7 @@ static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw) | |||
620 | struct net_device_stats *stats = &priv->stats; | 591 | struct net_device_stats *stats = &priv->stats; |
621 | u16 fid = hermes_read_regn(hw, TXCOMPLFID); | 592 | u16 fid = hermes_read_regn(hw, TXCOMPLFID); |
622 | u16 status; | 593 | u16 status; |
623 | struct hermes_tx_descriptor_802_11 hdr; | 594 | struct hermes_txexc_data hdr; |
624 | int err = 0; | 595 | int err = 0; |
625 | 596 | ||
626 | if (fid == DUMMY_FID) | 597 | if (fid == DUMMY_FID) |
@@ -628,8 +599,7 @@ static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw) | |||
628 | 599 | ||
629 | /* Read part of the frame header - we need status and addr1 */ | 600 | /* Read part of the frame header - we need status and addr1 */ |
630 | err = hermes_bap_pread(hw, IRQ_BAP, &hdr, | 601 | err = hermes_bap_pread(hw, IRQ_BAP, &hdr, |
631 | offsetof(struct hermes_tx_descriptor_802_11, | 602 | sizeof(struct hermes_txexc_data), |
632 | addr2), | ||
633 | fid, 0); | 603 | fid, 0); |
634 | 604 | ||
635 | hermes_write_regn(hw, TXCOMPLFID, DUMMY_FID); | 605 | hermes_write_regn(hw, TXCOMPLFID, DUMMY_FID); |
@@ -649,7 +619,7 @@ static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw) | |||
649 | * exceeded, because that's the only status that really mean | 619 | * exceeded, because that's the only status that really mean |
650 | * that this particular node went away. | 620 | * that this particular node went away. |
651 | * Other errors means that *we* screwed up. - Jean II */ | 621 | * Other errors means that *we* screwed up. - Jean II */ |
652 | status = le16_to_cpu(hdr.status); | 622 | status = le16_to_cpu(hdr.desc.status); |
653 | if (status & (HERMES_TXSTAT_RETRYERR | HERMES_TXSTAT_AGEDERR)) { | 623 | if (status & (HERMES_TXSTAT_RETRYERR | HERMES_TXSTAT_AGEDERR)) { |
654 | union iwreq_data wrqu; | 624 | union iwreq_data wrqu; |
655 | 625 | ||