[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>
This commit is contained in:
committed by
John W. Linville
parent
4ebe2eb0b3
commit
30c2d3b481
@@ -201,41 +201,12 @@ static struct {
|
|||||||
/* Data types */
|
/* Data types */
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
|
|
||||||
/* Used in Event handling.
|
/* Beginning of the Tx descriptor, used in TxExc handling */
|
||||||
* We avoid nested structures as they break on ARM -- Moustafa */
|
struct hermes_txexc_data {
|
||||||
struct hermes_tx_descriptor_802_11 {
|
struct hermes_tx_descriptor desc;
|
||||||
/* hermes_tx_descriptor */
|
|
||||||
__le16 status;
|
|
||||||
__le16 reserved1;
|
|
||||||
__le16 reserved2;
|
|
||||||
__le32 sw_support;
|
|
||||||
u8 retry_count;
|
|
||||||
u8 tx_rate;
|
|
||||||
__le16 tx_control;
|
|
||||||
|
|
||||||
/* ieee80211_hdr */
|
|
||||||
__le16 frame_ctl;
|
__le16 frame_ctl;
|
||||||
__le16 duration_id;
|
__le16 duration_id;
|
||||||
u8 addr1[ETH_ALEN];
|
u8 addr1[ETH_ALEN];
|
||||||
u8 addr2[ETH_ALEN];
|
|
||||||
u8 addr3[ETH_ALEN];
|
|
||||||
__le16 seq_ctl;
|
|
||||||
u8 addr4[ETH_ALEN];
|
|
||||||
|
|
||||||
__le16 data_len;
|
|
||||||
|
|
||||||
/* ethhdr */
|
|
||||||
u8 h_dest[ETH_ALEN]; /* destination eth addr */
|
|
||||||
u8 h_source[ETH_ALEN]; /* source ether addr */
|
|
||||||
__be16 h_proto; /* packet type ID field */
|
|
||||||
|
|
||||||
/* p8022_hdr */
|
|
||||||
u8 dsap;
|
|
||||||
u8 ssap;
|
|
||||||
u8 ctrl;
|
|
||||||
u8 oui[3];
|
|
||||||
|
|
||||||
__be16 ethertype;
|
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
/* Rx frame header except compatibility 802.3 header */
|
/* Rx frame header except compatibility 802.3 header */
|
||||||
@@ -620,7 +591,7 @@ static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw)
|
|||||||
struct net_device_stats *stats = &priv->stats;
|
struct net_device_stats *stats = &priv->stats;
|
||||||
u16 fid = hermes_read_regn(hw, TXCOMPLFID);
|
u16 fid = hermes_read_regn(hw, TXCOMPLFID);
|
||||||
u16 status;
|
u16 status;
|
||||||
struct hermes_tx_descriptor_802_11 hdr;
|
struct hermes_txexc_data hdr;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
if (fid == DUMMY_FID)
|
if (fid == DUMMY_FID)
|
||||||
@@ -628,8 +599,7 @@ static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw)
|
|||||||
|
|
||||||
/* Read part of the frame header - we need status and addr1 */
|
/* Read part of the frame header - we need status and addr1 */
|
||||||
err = hermes_bap_pread(hw, IRQ_BAP, &hdr,
|
err = hermes_bap_pread(hw, IRQ_BAP, &hdr,
|
||||||
offsetof(struct hermes_tx_descriptor_802_11,
|
sizeof(struct hermes_txexc_data),
|
||||||
addr2),
|
|
||||||
fid, 0);
|
fid, 0);
|
||||||
|
|
||||||
hermes_write_regn(hw, TXCOMPLFID, DUMMY_FID);
|
hermes_write_regn(hw, TXCOMPLFID, DUMMY_FID);
|
||||||
@@ -649,7 +619,7 @@ static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw)
|
|||||||
* exceeded, because that's the only status that really mean
|
* exceeded, because that's the only status that really mean
|
||||||
* that this particular node went away.
|
* that this particular node went away.
|
||||||
* Other errors means that *we* screwed up. - Jean II */
|
* Other errors means that *we* screwed up. - Jean II */
|
||||||
status = le16_to_cpu(hdr.status);
|
status = le16_to_cpu(hdr.desc.status);
|
||||||
if (status & (HERMES_TXSTAT_RETRYERR | HERMES_TXSTAT_AGEDERR)) {
|
if (status & (HERMES_TXSTAT_RETRYERR | HERMES_TXSTAT_AGEDERR)) {
|
||||||
union iwreq_data wrqu;
|
union iwreq_data wrqu;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user