aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtl818x
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2010-05-06 16:26:23 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-05-07 14:55:56 -0400
commit51e080deba57437459571f26a3c6f3db03324c4c (patch)
treecf53132db864233342ff92ae10cc390d0c077da8 /drivers/net/wireless/rtl818x
parenta472e71b3c71619087d2485282955c3b62ebfde9 (diff)
rtl8180: assign sequence numbers in the driver
This is a step towards support for beaconing modes of operation. Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtl818x')
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180.h3
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180_dev.c10
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8180.h b/drivers/net/wireless/rtl818x/rtl8180.h
index de3844fe06d8..b92d678abc0c 100644
--- a/drivers/net/wireless/rtl818x/rtl8180.h
+++ b/drivers/net/wireless/rtl818x/rtl8180.h
@@ -78,6 +78,9 @@ struct rtl8180_priv {
78 u32 anaparam; 78 u32 anaparam;
79 u16 rfparam; 79 u16 rfparam;
80 u8 csthreshold; 80 u8 csthreshold;
81
82 /* sequence # */
83 u16 seqno;
81}; 84};
82 85
83void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data); 86void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data);
diff --git a/drivers/net/wireless/rtl818x/rtl8180_dev.c b/drivers/net/wireless/rtl818x/rtl8180_dev.c
index 093b93d62cc2..3a214d7507a5 100644
--- a/drivers/net/wireless/rtl818x/rtl8180_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c
@@ -233,6 +233,7 @@ static irqreturn_t rtl8180_interrupt(int irq, void *dev_id)
233static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb) 233static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
234{ 234{
235 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 235 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
236 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
236 struct rtl8180_priv *priv = dev->priv; 237 struct rtl8180_priv *priv = dev->priv;
237 struct rtl8180_tx_ring *ring; 238 struct rtl8180_tx_ring *ring;
238 struct rtl8180_tx_desc *entry; 239 struct rtl8180_tx_desc *entry;
@@ -284,6 +285,14 @@ static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
284 } 285 }
285 286
286 spin_lock_irqsave(&priv->lock, flags); 287 spin_lock_irqsave(&priv->lock, flags);
288
289 if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
290 if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
291 priv->seqno += 0x10;
292 hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
293 hdr->seq_ctrl |= cpu_to_le16(priv->seqno);
294 }
295
287 idx = (ring->idx + skb_queue_len(&ring->queue)) % ring->entries; 296 idx = (ring->idx + skb_queue_len(&ring->queue)) % ring->entries;
288 entry = &ring->desc[idx]; 297 entry = &ring->desc[idx];
289 298
@@ -298,6 +307,7 @@ static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
298 __skb_queue_tail(&ring->queue, skb); 307 __skb_queue_tail(&ring->queue, skb);
299 if (ring->entries - skb_queue_len(&ring->queue) < 2) 308 if (ring->entries - skb_queue_len(&ring->queue) < 2)
300 ieee80211_stop_queue(dev, prio); 309 ieee80211_stop_queue(dev, prio);
310
301 spin_unlock_irqrestore(&priv->lock, flags); 311 spin_unlock_irqrestore(&priv->lock, flags);
302 312
303 rtl818x_iowrite8(priv, &priv->map->TX_DMA_POLLING, (1 << (prio + 4))); 313 rtl818x_iowrite8(priv, &priv->map->TX_DMA_POLLING, (1 << (prio + 4)));