diff options
author | Pradeep Nemavat <pnemavat@marvell.com> | 2011-04-21 07:04:57 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-25 14:50:16 -0400 |
commit | 566875db5058f582ea56da891f9c3cabc01efff5 (patch) | |
tree | 2475029977001bed0d4e21abb9483dc76336ed1a | |
parent | 3a7dbc3b2ac545efac75d4145839eaa7b59d9741 (diff) |
mwl8k: Add timestamp information for tx packets
Timestamp tx packets using a HW micro-second timer.
This timestamp will be compared to the current timestamp
in the hardware and if the difference is greater than 500ms,
the packet will be dropped.
Signed-off-by: Pradeep Nemavat <pnemavat@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 33da25a349b7..93fe1bd91c36 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -74,6 +74,14 @@ MODULE_PARM_DESC(ap_mode_default, | |||
74 | #define MWL8K_A2H_INT_RX_READY (1 << 1) | 74 | #define MWL8K_A2H_INT_RX_READY (1 << 1) |
75 | #define MWL8K_A2H_INT_TX_DONE (1 << 0) | 75 | #define MWL8K_A2H_INT_TX_DONE (1 << 0) |
76 | 76 | ||
77 | /* HW micro second timer register | ||
78 | * located at offset 0xA600. This | ||
79 | * will be used to timestamp tx | ||
80 | * packets. | ||
81 | */ | ||
82 | |||
83 | #define MWL8K_HW_TIMER_REGISTER 0x0000a600 | ||
84 | |||
77 | #define MWL8K_A2H_EVENTS (MWL8K_A2H_INT_DUMMY | \ | 85 | #define MWL8K_A2H_EVENTS (MWL8K_A2H_INT_DUMMY | \ |
78 | MWL8K_A2H_INT_CHNL_SWITCHED | \ | 86 | MWL8K_A2H_INT_CHNL_SWITCHED | \ |
79 | MWL8K_A2H_INT_QUEUE_EMPTY | \ | 87 | MWL8K_A2H_INT_QUEUE_EMPTY | \ |
@@ -1972,6 +1980,11 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb) | |||
1972 | tx->peer_id = MWL8K_STA(tx_info->control.sta)->peer_id; | 1980 | tx->peer_id = MWL8K_STA(tx_info->control.sta)->peer_id; |
1973 | else | 1981 | else |
1974 | tx->peer_id = 0; | 1982 | tx->peer_id = 0; |
1983 | |||
1984 | if (priv->ap_fw) | ||
1985 | tx->timestamp = cpu_to_le32(ioread32(priv->regs + | ||
1986 | MWL8K_HW_TIMER_REGISTER)); | ||
1987 | |||
1975 | wmb(); | 1988 | wmb(); |
1976 | tx->status = cpu_to_le32(MWL8K_TXD_STATUS_FW_OWNED | txstatus); | 1989 | tx->status = cpu_to_le32(MWL8K_TXD_STATUS_FW_OWNED | txstatus); |
1977 | 1990 | ||