aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2014-07-10 17:00:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-07-10 17:00:24 -0400
commit5c4d5e816c2cc86e17d09677b649be47fbc30e51 (patch)
treeb13327e59b6ea29095b9b33b4cdd5dffab9a66d3 /drivers/net/wireless/mwifiex
parentf473832fece16611520bf54ad52b16c3f6db0a94 (diff)
parent2c4db12ec469b9fcdad9f6bfd6fa20e65a563ac5 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r--drivers/net/wireless/mwifiex/11n_aggr.c1
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c1
-rw-r--r--drivers/net/wireless/mwifiex/cmdevt.c1
-rw-r--r--drivers/net/wireless/mwifiex/main.c1
-rw-r--r--drivers/net/wireless/mwifiex/pcie.c4
-rw-r--r--drivers/net/wireless/mwifiex/sta_tx.c1
-rw-r--r--drivers/net/wireless/mwifiex/tdls.c2
-rw-r--r--drivers/net/wireless/mwifiex/txrx.c1
-rw-r--r--drivers/net/wireless/mwifiex/uap_txrx.c1
-rw-r--r--drivers/net/wireless/mwifiex/util.h43
10 files changed, 44 insertions, 12 deletions
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c b/drivers/net/wireless/mwifiex/11n_aggr.c
index b4c14b0fd3cb..8720a3d3c755 100644
--- a/drivers/net/wireless/mwifiex/11n_aggr.c
+++ b/drivers/net/wireless/mwifiex/11n_aggr.c
@@ -185,6 +185,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
185 skb_reserve(skb_aggr, headroom + sizeof(struct txpd)); 185 skb_reserve(skb_aggr, headroom + sizeof(struct txpd));
186 tx_info_aggr = MWIFIEX_SKB_TXCB(skb_aggr); 186 tx_info_aggr = MWIFIEX_SKB_TXCB(skb_aggr);
187 187
188 memset(tx_info_aggr, 0, sizeof(*tx_info_aggr));
188 tx_info_aggr->bss_type = tx_info_src->bss_type; 189 tx_info_aggr->bss_type = tx_info_src->bss_type;
189 tx_info_aggr->bss_num = tx_info_src->bss_num; 190 tx_info_aggr->bss_num = tx_info_src->bss_num;
190 191
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 15fa7b453372..6af135fa99f7 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -188,6 +188,7 @@ mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
188 } 188 }
189 189
190 tx_info = MWIFIEX_SKB_TXCB(skb); 190 tx_info = MWIFIEX_SKB_TXCB(skb);
191 memset(tx_info, 0, sizeof(*tx_info));
191 tx_info->bss_num = priv->bss_num; 192 tx_info->bss_num = priv->bss_num;
192 tx_info->bss_type = priv->bss_type; 193 tx_info->bss_type = priv->bss_type;
193 tx_info->pkt_len = pkt_len; 194 tx_info->pkt_len = pkt_len;
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index df42f066d70c..5899eee87fb1 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -462,6 +462,7 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter)
462 462
463 if (skb) { 463 if (skb) {
464 rx_info = MWIFIEX_SKB_RXCB(skb); 464 rx_info = MWIFIEX_SKB_RXCB(skb);
465 memset(rx_info, 0, sizeof(*rx_info));
465 rx_info->bss_num = priv->bss_num; 466 rx_info->bss_num = priv->bss_num;
466 rx_info->bss_type = priv->bss_type; 467 rx_info->bss_type = priv->bss_type;
467 } 468 }
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 657504c3c79d..3e5194fb0b0f 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -644,6 +644,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
644 } 644 }
645 645
646 tx_info = MWIFIEX_SKB_TXCB(skb); 646 tx_info = MWIFIEX_SKB_TXCB(skb);
647 memset(tx_info, 0, sizeof(*tx_info));
647 tx_info->bss_num = priv->bss_num; 648 tx_info->bss_num = priv->bss_num;
648 tx_info->bss_type = priv->bss_type; 649 tx_info->bss_type = priv->bss_type;
649 tx_info->pkt_len = skb->len; 650 tx_info->pkt_len = skb->len;
diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index 3c224a793b82..5f7afffdd34e 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -57,7 +57,7 @@ mwifiex_map_pci_memory(struct mwifiex_adapter *adapter, struct sk_buff *skb,
57 return -1; 57 return -1;
58 } 58 }
59 mapping.len = size; 59 mapping.len = size;
60 memcpy(skb->cb, &mapping, sizeof(mapping)); 60 mwifiex_store_mapping(skb, &mapping);
61 return 0; 61 return 0;
62} 62}
63 63
@@ -67,7 +67,7 @@ static void mwifiex_unmap_pci_memory(struct mwifiex_adapter *adapter,
67 struct pcie_service_card *card = adapter->card; 67 struct pcie_service_card *card = adapter->card;
68 struct mwifiex_dma_mapping mapping; 68 struct mwifiex_dma_mapping mapping;
69 69
70 MWIFIEX_SKB_PACB(skb, &mapping); 70 mwifiex_get_mapping(skb, &mapping);
71 pci_unmap_single(card->dev, mapping.addr, mapping.len, flags); 71 pci_unmap_single(card->dev, mapping.addr, mapping.len, flags);
72} 72}
73 73
diff --git a/drivers/net/wireless/mwifiex/sta_tx.c b/drivers/net/wireless/mwifiex/sta_tx.c
index cf330ba951cd..dab7b33c54be 100644
--- a/drivers/net/wireless/mwifiex/sta_tx.c
+++ b/drivers/net/wireless/mwifiex/sta_tx.c
@@ -150,6 +150,7 @@ int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags)
150 return -1; 150 return -1;
151 151
152 tx_info = MWIFIEX_SKB_TXCB(skb); 152 tx_info = MWIFIEX_SKB_TXCB(skb);
153 memset(tx_info, 0, sizeof(*tx_info));
153 tx_info->bss_num = priv->bss_num; 154 tx_info->bss_num = priv->bss_num;
154 tx_info->bss_type = priv->bss_type; 155 tx_info->bss_type = priv->bss_type;
155 tx_info->pkt_len = data_len - (sizeof(struct txpd) + INTF_HEADER_LEN); 156 tx_info->pkt_len = data_len - (sizeof(struct txpd) + INTF_HEADER_LEN);
diff --git a/drivers/net/wireless/mwifiex/tdls.c b/drivers/net/wireless/mwifiex/tdls.c
index 3efbcbe7e891..a414161c6064 100644
--- a/drivers/net/wireless/mwifiex/tdls.c
+++ b/drivers/net/wireless/mwifiex/tdls.c
@@ -604,6 +604,7 @@ int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer,
604 } 604 }
605 605
606 tx_info = MWIFIEX_SKB_TXCB(skb); 606 tx_info = MWIFIEX_SKB_TXCB(skb);
607 memset(tx_info, 0, sizeof(*tx_info));
607 tx_info->bss_num = priv->bss_num; 608 tx_info->bss_num = priv->bss_num;
608 tx_info->bss_type = priv->bss_type; 609 tx_info->bss_type = priv->bss_type;
609 610
@@ -757,6 +758,7 @@ int mwifiex_send_tdls_action_frame(struct mwifiex_private *priv, const u8 *peer,
757 skb->priority = MWIFIEX_PRIO_VI; 758 skb->priority = MWIFIEX_PRIO_VI;
758 759
759 tx_info = MWIFIEX_SKB_TXCB(skb); 760 tx_info = MWIFIEX_SKB_TXCB(skb);
761 memset(tx_info, 0, sizeof(*tx_info));
760 tx_info->bss_num = priv->bss_num; 762 tx_info->bss_num = priv->bss_num;
761 tx_info->bss_type = priv->bss_type; 763 tx_info->bss_type = priv->bss_type;
762 tx_info->flags |= MWIFIEX_BUF_FLAG_TDLS_PKT; 764 tx_info->flags |= MWIFIEX_BUF_FLAG_TDLS_PKT;
diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c
index 08205683f877..96a2126cc44b 100644
--- a/drivers/net/wireless/mwifiex/txrx.c
+++ b/drivers/net/wireless/mwifiex/txrx.c
@@ -55,6 +55,7 @@ int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter,
55 return -1; 55 return -1;
56 } 56 }
57 57
58 memset(rx_info, 0, sizeof(*rx_info));
58 rx_info->bss_num = priv->bss_num; 59 rx_info->bss_num = priv->bss_num;
59 rx_info->bss_type = priv->bss_type; 60 rx_info->bss_type = priv->bss_type;
60 61
diff --git a/drivers/net/wireless/mwifiex/uap_txrx.c b/drivers/net/wireless/mwifiex/uap_txrx.c
index ddfc3c6c1e78..ec7309d096ab 100644
--- a/drivers/net/wireless/mwifiex/uap_txrx.c
+++ b/drivers/net/wireless/mwifiex/uap_txrx.c
@@ -174,6 +174,7 @@ static void mwifiex_uap_queue_bridged_pkt(struct mwifiex_private *priv,
174 } 174 }
175 175
176 tx_info = MWIFIEX_SKB_TXCB(skb); 176 tx_info = MWIFIEX_SKB_TXCB(skb);
177 memset(tx_info, 0, sizeof(*tx_info));
177 tx_info->bss_num = priv->bss_num; 178 tx_info->bss_num = priv->bss_num;
178 tx_info->bss_type = priv->bss_type; 179 tx_info->bss_type = priv->bss_type;
179 tx_info->flags |= MWIFIEX_BUF_FLAG_BRIDGED_PKT; 180 tx_info->flags |= MWIFIEX_BUF_FLAG_BRIDGED_PKT;
diff --git a/drivers/net/wireless/mwifiex/util.h b/drivers/net/wireless/mwifiex/util.h
index 9a31215487dd..40296cb4a3f1 100644
--- a/drivers/net/wireless/mwifiex/util.h
+++ b/drivers/net/wireless/mwifiex/util.h
@@ -20,32 +20,55 @@
20#ifndef _MWIFIEX_UTIL_H_ 20#ifndef _MWIFIEX_UTIL_H_
21#define _MWIFIEX_UTIL_H_ 21#define _MWIFIEX_UTIL_H_
22 22
23struct mwifiex_dma_mapping {
24 dma_addr_t addr;
25 size_t len;
26};
27
28struct mwifiex_cb {
29 struct mwifiex_dma_mapping dma_mapping;
30 union {
31 struct mwifiex_rxinfo rx_info;
32 struct mwifiex_txinfo tx_info;
33 };
34};
35
23static inline struct mwifiex_rxinfo *MWIFIEX_SKB_RXCB(struct sk_buff *skb) 36static inline struct mwifiex_rxinfo *MWIFIEX_SKB_RXCB(struct sk_buff *skb)
24{ 37{
25 return (struct mwifiex_rxinfo *)(skb->cb + sizeof(dma_addr_t)); 38 struct mwifiex_cb *cb = (struct mwifiex_cb *)skb->cb;
39
40 BUILD_BUG_ON(sizeof(struct mwifiex_cb) > sizeof(skb->cb));
41 return &cb->rx_info;
26} 42}
27 43
28static inline struct mwifiex_txinfo *MWIFIEX_SKB_TXCB(struct sk_buff *skb) 44static inline struct mwifiex_txinfo *MWIFIEX_SKB_TXCB(struct sk_buff *skb)
29{ 45{
30 return (struct mwifiex_txinfo *)(skb->cb + sizeof(dma_addr_t)); 46 struct mwifiex_cb *cb = (struct mwifiex_cb *)skb->cb;
47
48 return &cb->tx_info;
31} 49}
32 50
33struct mwifiex_dma_mapping { 51static inline void mwifiex_store_mapping(struct sk_buff *skb,
34 dma_addr_t addr; 52 struct mwifiex_dma_mapping *mapping)
35 size_t len; 53{
36}; 54 struct mwifiex_cb *cb = (struct mwifiex_cb *)skb->cb;
55
56 memcpy(&cb->dma_mapping, mapping, sizeof(*mapping));
57}
37 58
38static inline void MWIFIEX_SKB_PACB(struct sk_buff *skb, 59static inline void mwifiex_get_mapping(struct sk_buff *skb,
39 struct mwifiex_dma_mapping *mapping) 60 struct mwifiex_dma_mapping *mapping)
40{ 61{
41 memcpy(mapping, skb->cb, sizeof(*mapping)); 62 struct mwifiex_cb *cb = (struct mwifiex_cb *)skb->cb;
63
64 memcpy(mapping, &cb->dma_mapping, sizeof(*mapping));
42} 65}
43 66
44static inline dma_addr_t MWIFIEX_SKB_DMA_ADDR(struct sk_buff *skb) 67static inline dma_addr_t MWIFIEX_SKB_DMA_ADDR(struct sk_buff *skb)
45{ 68{
46 struct mwifiex_dma_mapping mapping; 69 struct mwifiex_dma_mapping mapping;
47 70
48 MWIFIEX_SKB_PACB(skb, &mapping); 71 mwifiex_get_mapping(skb, &mapping);
49 72
50 return mapping.addr; 73 return mapping.addr;
51} 74}