Commit 566875db authored by Pradeep Nemavat's avatar Pradeep Nemavat Committed by John W. Linville

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: default avatarPradeep Nemavat <pnemavat@marvell.com>
Signed-off-by: default avatarNishant Sarmukadam <nishants@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 3a7dbc3b
...@@ -74,6 +74,14 @@ MODULE_PARM_DESC(ap_mode_default, ...@@ -74,6 +74,14 @@ MODULE_PARM_DESC(ap_mode_default,
#define MWL8K_A2H_INT_RX_READY (1 << 1) #define MWL8K_A2H_INT_RX_READY (1 << 1)
#define MWL8K_A2H_INT_TX_DONE (1 << 0) #define MWL8K_A2H_INT_TX_DONE (1 << 0)
/* HW micro second timer register
* located at offset 0xA600. This
* will be used to timestamp tx
* packets.
*/
#define MWL8K_HW_TIMER_REGISTER 0x0000a600
#define MWL8K_A2H_EVENTS (MWL8K_A2H_INT_DUMMY | \ #define MWL8K_A2H_EVENTS (MWL8K_A2H_INT_DUMMY | \
MWL8K_A2H_INT_CHNL_SWITCHED | \ MWL8K_A2H_INT_CHNL_SWITCHED | \
MWL8K_A2H_INT_QUEUE_EMPTY | \ MWL8K_A2H_INT_QUEUE_EMPTY | \
...@@ -1972,6 +1980,11 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb) ...@@ -1972,6 +1980,11 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb)
tx->peer_id = MWL8K_STA(tx_info->control.sta)->peer_id; tx->peer_id = MWL8K_STA(tx_info->control.sta)->peer_id;
else else
tx->peer_id = 0; tx->peer_id = 0;
if (priv->ap_fw)
tx->timestamp = cpu_to_le32(ioread32(priv->regs +
MWL8K_HW_TIMER_REGISTER));
wmb(); wmb();
tx->status = cpu_to_le32(MWL8K_TXD_STATUS_FW_OWNED | txstatus); tx->status = cpu_to_le32(MWL8K_TXD_STATUS_FW_OWNED | txstatus);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment