aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@web.de>2009-01-09 15:06:06 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:00:19 -0500
commit3cd08b383b2efe163272045afc415c75afc9e9c5 (patch)
treed3877f19282efb5257ca1876687dcda9c31f0144
parent63f2dc9f2fd63c8b66f49c53cd26236f3f0785fd (diff)
p54: upgrade memrecord to p54_tx_info
mac80211 reserves 24 bytes in skb->cb for the driver. So far, we only used them to keep track of used and free device memory. But p54spi will need a slice of it, as well as the stuck frame detection. Signed-off-by: Christian Lamparter <chunkeey@web.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/p54/p54.h10
-rw-r--r--drivers/net/wireless/p54/p54common.c22
-rw-r--r--drivers/net/wireless/p54/p54common.h6
3 files changed, 21 insertions, 17 deletions
diff --git a/drivers/net/wireless/p54/p54.h b/drivers/net/wireless/p54/p54.h
index ce9333877926..a06c2a676dfe 100644
--- a/drivers/net/wireless/p54/p54.h
+++ b/drivers/net/wireless/p54/p54.h
@@ -44,6 +44,16 @@ enum p54_control_frame_types {
44 P54_CONTROL_TYPE_BT_OPTIONS = 35 44 P54_CONTROL_TYPE_BT_OPTIONS = 35
45}; 45};
46 46
47/* provide 16 bytes for the transport back-end */
48#define P54_TX_INFO_DATA_SIZE 16
49
50/* stored in ieee80211_tx_info's rate_driver_data */
51struct p54_tx_info {
52 u32 start_addr;
53 u32 end_addr;
54 void *data[P54_TX_INFO_DATA_SIZE / sizeof(void *)];
55};
56
47#define P54_MAX_CTRL_FRAME_LEN 0x1000 57#define P54_MAX_CTRL_FRAME_LEN 0x1000
48 58
49#define P54_HDR_FLAG_CONTROL BIT(15) 59#define P54_HDR_FLAG_CONTROL BIT(15)
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index c6dcf98aad3e..85aff1685a10 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -700,7 +700,7 @@ void p54_free_skb(struct ieee80211_hw *dev, struct sk_buff *skb)
700{ 700{
701 struct p54_common *priv = dev->priv; 701 struct p54_common *priv = dev->priv;
702 struct ieee80211_tx_info *info; 702 struct ieee80211_tx_info *info;
703 struct memrecord *range; 703 struct p54_tx_info *range;
704 unsigned long flags; 704 unsigned long flags;
705 u32 freed = 0, last_addr = priv->rx_start; 705 u32 freed = 0, last_addr = priv->rx_start;
706 706
@@ -718,18 +718,18 @@ void p54_free_skb(struct ieee80211_hw *dev, struct sk_buff *skb)
718 range = (void *)info->rate_driver_data; 718 range = (void *)info->rate_driver_data;
719 if (skb->prev != (struct sk_buff *)&priv->tx_queue) { 719 if (skb->prev != (struct sk_buff *)&priv->tx_queue) {
720 struct ieee80211_tx_info *ni; 720 struct ieee80211_tx_info *ni;
721 struct memrecord *mr; 721 struct p54_tx_info *mr;
722 722
723 ni = IEEE80211_SKB_CB(skb->prev); 723 ni = IEEE80211_SKB_CB(skb->prev);
724 mr = (struct memrecord *)ni->rate_driver_data; 724 mr = (struct p54_tx_info *)ni->rate_driver_data;
725 last_addr = mr->end_addr; 725 last_addr = mr->end_addr;
726 } 726 }
727 if (skb->next != (struct sk_buff *)&priv->tx_queue) { 727 if (skb->next != (struct sk_buff *)&priv->tx_queue) {
728 struct ieee80211_tx_info *ni; 728 struct ieee80211_tx_info *ni;
729 struct memrecord *mr; 729 struct p54_tx_info *mr;
730 730
731 ni = IEEE80211_SKB_CB(skb->next); 731 ni = IEEE80211_SKB_CB(skb->next);
732 mr = (struct memrecord *)ni->rate_driver_data; 732 mr = (struct p54_tx_info *)ni->rate_driver_data;
733 freed = mr->start_addr - last_addr; 733 freed = mr->start_addr - last_addr;
734 } else 734 } else
735 freed = priv->rx_end - last_addr; 735 freed = priv->rx_end - last_addr;
@@ -771,7 +771,7 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
771 struct p54_frame_sent *payload = (struct p54_frame_sent *) hdr->data; 771 struct p54_frame_sent *payload = (struct p54_frame_sent *) hdr->data;
772 struct sk_buff *entry = (struct sk_buff *) priv->tx_queue.next; 772 struct sk_buff *entry = (struct sk_buff *) priv->tx_queue.next;
773 u32 addr = le32_to_cpu(hdr->req_id) - priv->headroom; 773 u32 addr = le32_to_cpu(hdr->req_id) - priv->headroom;
774 struct memrecord *range = NULL; 774 struct p54_tx_info *range = NULL;
775 u32 freed = 0; 775 u32 freed = 0;
776 u32 last_addr = priv->rx_start; 776 u32 last_addr = priv->rx_start;
777 unsigned long flags; 777 unsigned long flags;
@@ -793,10 +793,10 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
793 793
794 if (entry->next != (struct sk_buff *)&priv->tx_queue) { 794 if (entry->next != (struct sk_buff *)&priv->tx_queue) {
795 struct ieee80211_tx_info *ni; 795 struct ieee80211_tx_info *ni;
796 struct memrecord *mr; 796 struct p54_tx_info *mr;
797 797
798 ni = IEEE80211_SKB_CB(entry->next); 798 ni = IEEE80211_SKB_CB(entry->next);
799 mr = (struct memrecord *)ni->rate_driver_data; 799 mr = (struct p54_tx_info *)ni->rate_driver_data;
800 freed = mr->start_addr - last_addr; 800 freed = mr->start_addr - last_addr;
801 } else 801 } else
802 freed = priv->rx_end - last_addr; 802 freed = priv->rx_end - last_addr;
@@ -1013,8 +1013,8 @@ EXPORT_SYMBOL_GPL(p54_rx);
1013 * can find some unused memory to upload our packets to. However, data that we 1013 * can find some unused memory to upload our packets to. However, data that we
1014 * want the card to TX needs to stay intact until the card has told us that 1014 * want the card to TX needs to stay intact until the card has told us that
1015 * it is done with it. This function finds empty places we can upload to and 1015 * it is done with it. This function finds empty places we can upload to and
1016 * marks allocated areas as reserved if necessary. p54_rx_frame_sent frees 1016 * marks allocated areas as reserved if necessary. p54_rx_frame_sent or
1017 * allocated areas. 1017 * p54_free_skb frees allocated areas.
1018 */ 1018 */
1019static int p54_assign_address(struct ieee80211_hw *dev, struct sk_buff *skb, 1019static int p54_assign_address(struct ieee80211_hw *dev, struct sk_buff *skb,
1020 struct p54_hdr *data, u32 len) 1020 struct p54_hdr *data, u32 len)
@@ -1023,7 +1023,7 @@ static int p54_assign_address(struct ieee80211_hw *dev, struct sk_buff *skb,
1023 struct sk_buff *entry = priv->tx_queue.next; 1023 struct sk_buff *entry = priv->tx_queue.next;
1024 struct sk_buff *target_skb = NULL; 1024 struct sk_buff *target_skb = NULL;
1025 struct ieee80211_tx_info *info; 1025 struct ieee80211_tx_info *info;
1026 struct memrecord *range; 1026 struct p54_tx_info *range;
1027 u32 last_addr = priv->rx_start; 1027 u32 last_addr = priv->rx_start;
1028 u32 largest_hole = 0; 1028 u32 largest_hole = 0;
1029 u32 target_addr = priv->rx_start; 1029 u32 target_addr = priv->rx_start;
diff --git a/drivers/net/wireless/p54/p54common.h b/drivers/net/wireless/p54/p54common.h
index 6207323848bd..bcfb75a4d6bf 100644
--- a/drivers/net/wireless/p54/p54common.h
+++ b/drivers/net/wireless/p54/p54common.h
@@ -247,12 +247,6 @@ struct pda_country {
247#define PDR_COUNTRY_CERT_IODOOR_OUTDOOR 0x30 247#define PDR_COUNTRY_CERT_IODOOR_OUTDOOR 0x30
248#define PDR_COUNTRY_CERT_INDEX 0x0F 248#define PDR_COUNTRY_CERT_INDEX 0x0F
249 249
250/* stored in skb->cb */
251struct memrecord {
252 u32 start_addr;
253 u32 end_addr;
254};
255
256struct p54_eeprom_lm86 { 250struct p54_eeprom_lm86 {
257 union { 251 union {
258 struct { 252 struct {