aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2009-05-05 17:47:02 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-06 15:15:05 -0400
commit7c5a189dc6a43def594fedc7cd8f6886596b65de (patch)
tree5852075d8085d5ef313636cc4e137a291fff71e5
parentaec6795210db6ba3f4592056d41ac5b1ab41e980 (diff)
p54: call p54_wake_free_queues on every p54_free_skb and p54_rx_frame_sent
Currently queues are stopped when their length reaches their length limit, but are restarted only when the size of freed range of packet buffer is not less than the size of the largest possible packet. This causes permanent queue stop on radio visibility loss in the middle of ping series: there is plenty of room in the packet buffer, but it is never freed more than 3 (size of 'best effort' queue) * 288 (ping packet plus headers) bytes at once. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/p54/p54common.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index b85785291803..48d81d98e12d 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -822,7 +822,6 @@ void p54_free_skb(struct ieee80211_hw *dev, struct sk_buff *skb)
822 struct ieee80211_tx_info *info; 822 struct ieee80211_tx_info *info;
823 struct p54_tx_info *range; 823 struct p54_tx_info *range;
824 unsigned long flags; 824 unsigned long flags;
825 u32 freed = 0, last_addr = priv->rx_start;
826 825
827 if (unlikely(!skb || !dev || !skb_queue_len(&priv->tx_queue))) 826 if (unlikely(!skb || !dev || !skb_queue_len(&priv->tx_queue)))
828 return; 827 return;
@@ -842,7 +841,6 @@ void p54_free_skb(struct ieee80211_hw *dev, struct sk_buff *skb)
842 841
843 ni = IEEE80211_SKB_CB(skb->prev); 842 ni = IEEE80211_SKB_CB(skb->prev);
844 mr = (struct p54_tx_info *)ni->rate_driver_data; 843 mr = (struct p54_tx_info *)ni->rate_driver_data;
845 last_addr = mr->end_addr;
846 } 844 }
847 if (skb->next != (struct sk_buff *)&priv->tx_queue) { 845 if (skb->next != (struct sk_buff *)&priv->tx_queue) {
848 struct ieee80211_tx_info *ni; 846 struct ieee80211_tx_info *ni;
@@ -850,16 +848,11 @@ void p54_free_skb(struct ieee80211_hw *dev, struct sk_buff *skb)
850 848
851 ni = IEEE80211_SKB_CB(skb->next); 849 ni = IEEE80211_SKB_CB(skb->next);
852 mr = (struct p54_tx_info *)ni->rate_driver_data; 850 mr = (struct p54_tx_info *)ni->rate_driver_data;
853 freed = mr->start_addr - last_addr; 851 }
854 } else
855 freed = priv->rx_end - last_addr;
856 __skb_unlink(skb, &priv->tx_queue); 852 __skb_unlink(skb, &priv->tx_queue);
857 spin_unlock_irqrestore(&priv->tx_queue.lock, flags); 853 spin_unlock_irqrestore(&priv->tx_queue.lock, flags);
858 dev_kfree_skb_any(skb); 854 dev_kfree_skb_any(skb);
859 855 p54_wake_free_queues(dev);
860 if (freed >= priv->headroom + sizeof(struct p54_hdr) + 48 +
861 IEEE80211_MAX_RTS_THRESHOLD + priv->tailroom)
862 p54_wake_free_queues(dev);
863} 856}
864EXPORT_SYMBOL_GPL(p54_free_skb); 857EXPORT_SYMBOL_GPL(p54_free_skb);
865 858
@@ -893,8 +886,6 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
893 struct sk_buff *entry; 886 struct sk_buff *entry;
894 u32 addr = le32_to_cpu(hdr->req_id) - priv->headroom; 887 u32 addr = le32_to_cpu(hdr->req_id) - priv->headroom;
895 struct p54_tx_info *range = NULL; 888 struct p54_tx_info *range = NULL;
896 u32 freed = 0;
897 u32 last_addr = priv->rx_start;
898 unsigned long flags; 889 unsigned long flags;
899 int count, idx; 890 int count, idx;
900 891
@@ -908,7 +899,6 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
908 899
909 range = (void *)info->rate_driver_data; 900 range = (void *)info->rate_driver_data;
910 if (range->start_addr != addr) { 901 if (range->start_addr != addr) {
911 last_addr = range->end_addr;
912 entry = entry->next; 902 entry = entry->next;
913 continue; 903 continue;
914 } 904 }
@@ -919,11 +909,8 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
919 909
920 ni = IEEE80211_SKB_CB(entry->next); 910 ni = IEEE80211_SKB_CB(entry->next);
921 mr = (struct p54_tx_info *)ni->rate_driver_data; 911 mr = (struct p54_tx_info *)ni->rate_driver_data;
922 freed = mr->start_addr - last_addr; 912 }
923 } else
924 freed = priv->rx_end - last_addr;
925 913
926 last_addr = range->end_addr;
927 __skb_unlink(entry, &priv->tx_queue); 914 __skb_unlink(entry, &priv->tx_queue);
928 spin_unlock_irqrestore(&priv->tx_queue.lock, flags); 915 spin_unlock_irqrestore(&priv->tx_queue.lock, flags);
929 916
@@ -1010,9 +997,7 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
1010 spin_unlock_irqrestore(&priv->tx_queue.lock, flags); 997 spin_unlock_irqrestore(&priv->tx_queue.lock, flags);
1011 998
1012out: 999out:
1013 if (freed >= priv->headroom + sizeof(struct p54_hdr) + 48 + 1000 p54_wake_free_queues(dev);
1014 IEEE80211_MAX_RTS_THRESHOLD + priv->tailroom)
1015 p54_wake_free_queues(dev);
1016} 1001}
1017 1002
1018static void p54_rx_eeprom_readback(struct ieee80211_hw *dev, 1003static void p54_rx_eeprom_readback(struct ieee80211_hw *dev,