aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 20d683641b42..00d798cc9e04 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -165,11 +165,10 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx, int group_addr,
165 return cpu_to_le16(dur); 165 return cpu_to_le16(dur);
166} 166}
167 167
168static int inline is_ieee80211_device(struct net_device *dev, 168static int inline is_ieee80211_device(struct ieee80211_local *local,
169 struct net_device *master) 169 struct net_device *dev)
170{ 170{
171 return (wdev_priv(dev->ieee80211_ptr) == 171 return local == wdev_priv(dev->ieee80211_ptr);
172 wdev_priv(master->ieee80211_ptr));
173} 172}
174 173
175/* tx handlers */ 174/* tx handlers */
@@ -1001,14 +1000,14 @@ __ieee80211_tx_prepare(struct ieee80211_tx_data *tx,
1001/* 1000/*
1002 * NB: @tx is uninitialised when passed in here 1001 * NB: @tx is uninitialised when passed in here
1003 */ 1002 */
1004static int ieee80211_tx_prepare(struct ieee80211_tx_data *tx, 1003static int ieee80211_tx_prepare(struct ieee80211_local *local,
1005 struct sk_buff *skb, 1004 struct ieee80211_tx_data *tx,
1006 struct net_device *mdev) 1005 struct sk_buff *skb)
1007{ 1006{
1008 struct net_device *dev; 1007 struct net_device *dev;
1009 1008
1010 dev = dev_get_by_index(&init_net, skb->iif); 1009 dev = dev_get_by_index(&init_net, skb->iif);
1011 if (unlikely(dev && !is_ieee80211_device(dev, mdev))) { 1010 if (unlikely(dev && !is_ieee80211_device(local, dev))) {
1012 dev_put(dev); 1011 dev_put(dev);
1013 dev = NULL; 1012 dev = NULL;
1014 } 1013 }
@@ -1258,6 +1257,8 @@ static int ieee80211_skb_resize(struct ieee80211_local *local,
1258int ieee80211_master_start_xmit(struct sk_buff *skb, 1257int ieee80211_master_start_xmit(struct sk_buff *skb,
1259 struct net_device *dev) 1258 struct net_device *dev)
1260{ 1259{
1260 struct ieee80211_master_priv *mpriv = netdev_priv(dev);
1261 struct ieee80211_local *local = mpriv->local;
1261 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1262 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1262 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 1263 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
1263 struct net_device *odev = NULL; 1264 struct net_device *odev = NULL;
@@ -1273,7 +1274,7 @@ int ieee80211_master_start_xmit(struct sk_buff *skb,
1273 1274
1274 if (skb->iif) 1275 if (skb->iif)
1275 odev = dev_get_by_index(&init_net, skb->iif); 1276 odev = dev_get_by_index(&init_net, skb->iif);
1276 if (unlikely(odev && !is_ieee80211_device(odev, dev))) { 1277 if (unlikely(odev && !is_ieee80211_device(local, odev))) {
1277 dev_put(odev); 1278 dev_put(odev);
1278 odev = NULL; 1279 odev = NULL;
1279 } 1280 }
@@ -1449,8 +1450,8 @@ fail:
1449int ieee80211_subif_start_xmit(struct sk_buff *skb, 1450int ieee80211_subif_start_xmit(struct sk_buff *skb,
1450 struct net_device *dev) 1451 struct net_device *dev)
1451{ 1452{
1452 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 1453 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1453 struct ieee80211_sub_if_data *sdata; 1454 struct ieee80211_local *local = sdata->local;
1454 int ret = 1, head_need; 1455 int ret = 1, head_need;
1455 u16 ethertype, hdrlen, meshhdrlen = 0; 1456 u16 ethertype, hdrlen, meshhdrlen = 0;
1456 __le16 fc; 1457 __le16 fc;
@@ -1462,7 +1463,6 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
1462 struct sta_info *sta; 1463 struct sta_info *sta;
1463 u32 sta_flags = 0; 1464 u32 sta_flags = 0;
1464 1465
1465 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1466 if (unlikely(skb->len < ETH_HLEN)) { 1466 if (unlikely(skb->len < ETH_HLEN)) {
1467 ret = 0; 1467 ret = 0;
1468 goto fail; 1468 goto fail;
@@ -2032,7 +2032,7 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw,
2032 cpu_to_le16(IEEE80211_FCTL_MOREDATA); 2032 cpu_to_le16(IEEE80211_FCTL_MOREDATA);
2033 } 2033 }
2034 2034
2035 if (!ieee80211_tx_prepare(&tx, skb, local->mdev)) 2035 if (!ieee80211_tx_prepare(local, &tx, skb))
2036 break; 2036 break;
2037 dev_kfree_skb_any(skb); 2037 dev_kfree_skb_any(skb);
2038 } 2038 }