Commit a13d985f authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Kalle Valo

rt2800: identify station based on status WCID

Add framework to identify sta based on tx status WCID. This is currently
not used, will start be utilized in the future patch.
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 96609f36
...@@ -855,11 +855,13 @@ EXPORT_SYMBOL_GPL(rt2800_process_rxwi); ...@@ -855,11 +855,13 @@ EXPORT_SYMBOL_GPL(rt2800_process_rxwi);
void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi) void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi)
{ {
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
struct txdone_entry_desc txdesc; struct txdone_entry_desc txdesc;
u32 word; u32 word;
u16 mcs, real_mcs; u16 mcs, real_mcs;
int aggr, ampdu; int aggr, ampdu;
int wcid;
/* /*
* Obtain the status about this packet. * Obtain the status about this packet.
...@@ -872,6 +874,7 @@ void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi) ...@@ -872,6 +874,7 @@ void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi)
real_mcs = rt2x00_get_field32(status, TX_STA_FIFO_MCS); real_mcs = rt2x00_get_field32(status, TX_STA_FIFO_MCS);
aggr = rt2x00_get_field32(status, TX_STA_FIFO_TX_AGGRE); aggr = rt2x00_get_field32(status, TX_STA_FIFO_TX_AGGRE);
wcid = rt2x00_get_field32(status, TX_STA_FIFO_WCID);
/* /*
* If a frame was meant to be sent as a single non-aggregated MPDU * If a frame was meant to be sent as a single non-aggregated MPDU
...@@ -1468,6 +1471,7 @@ int rt2800_sta_add(struct rt2x00_dev *rt2x00dev, struct ieee80211_vif *vif, ...@@ -1468,6 +1471,7 @@ int rt2800_sta_add(struct rt2x00_dev *rt2x00dev, struct ieee80211_vif *vif,
return 0; return 0;
__set_bit(wcid - WCID_START, drv_data->sta_ids); __set_bit(wcid - WCID_START, drv_data->sta_ids);
drv_data->wcid_to_sta[wcid - WCID_START] = sta;
/* /*
* Clean up WCID attributes and write STA address to the device. * Clean up WCID attributes and write STA address to the device.
...@@ -1498,6 +1502,7 @@ int rt2800_sta_remove(struct rt2x00_dev *rt2x00dev, struct ieee80211_sta *sta) ...@@ -1498,6 +1502,7 @@ int rt2800_sta_remove(struct rt2x00_dev *rt2x00dev, struct ieee80211_sta *sta)
* get renewed when the WCID is reused. * get renewed when the WCID is reused.
*/ */
rt2800_config_wcid(rt2x00dev, NULL, wcid); rt2800_config_wcid(rt2x00dev, NULL, wcid);
drv_data->wcid_to_sta[wcid - WCID_START] = NULL;
__clear_bit(wcid - WCID_START, drv_data->sta_ids); __clear_bit(wcid - WCID_START, drv_data->sta_ids);
return 0; return 0;
......
...@@ -41,6 +41,7 @@ struct rt2800_drv_data { ...@@ -41,6 +41,7 @@ struct rt2800_drv_data {
unsigned int tbtt_tick; unsigned int tbtt_tick;
unsigned int ampdu_factor_cnt[4]; unsigned int ampdu_factor_cnt[4];
DECLARE_BITMAP(sta_ids, STA_IDS_SIZE); DECLARE_BITMAP(sta_ids, STA_IDS_SIZE);
struct ieee80211_sta *wcid_to_sta[STA_IDS_SIZE];
}; };
struct rt2800_ops { struct rt2800_ops {
......
...@@ -102,7 +102,7 @@ enum skb_frame_desc_flags { ...@@ -102,7 +102,7 @@ enum skb_frame_desc_flags {
* of the scope of the skb->data pointer. * of the scope of the skb->data pointer.
* @iv: IV/EIV data used during encryption/decryption. * @iv: IV/EIV data used during encryption/decryption.
* @skb_dma: (PCI-only) the DMA address associated with the sk buffer. * @skb_dma: (PCI-only) the DMA address associated with the sk buffer.
* @entry: The entry to which this sk buffer belongs. * @sta: The station where sk buffer was sent.
*/ */
struct skb_frame_desc { struct skb_frame_desc {
u8 flags; u8 flags;
...@@ -116,6 +116,7 @@ struct skb_frame_desc { ...@@ -116,6 +116,7 @@ struct skb_frame_desc {
__le32 iv[2]; __le32 iv[2];
dma_addr_t skb_dma; dma_addr_t skb_dma;
struct ieee80211_sta *sta;
}; };
/** /**
......
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