diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-11-09 11:50:09 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-11-19 12:44:35 -0500 |
commit | 73c4e195e6396eea04e11f88dc0336e1bc3c8e66 (patch) | |
tree | 3e66d96368ba197c30139f07e8b7964e176a4b8c /net/mac80211/tx.c | |
parent | 1277b4a9f531e84e26f9e0210c1801b0c0bf81ca (diff) |
mac80211: move skb info band assignment out
Instead of passing the band as a parameter to ieee80211_xmit()
and ieee80211_tx(), move it outside of the two functions while
making sure info->band is set up before calling them.
This removes the parameter and simplifies the follow commit.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r-- | net/mac80211/tx.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 66af35f56a33..c4a5494c2ac6 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1426,8 +1426,7 @@ EXPORT_SYMBOL(ieee80211_tx_prepare_skb); | |||
1426 | * Returns false if the frame couldn't be transmitted but was queued instead. | 1426 | * Returns false if the frame couldn't be transmitted but was queued instead. |
1427 | */ | 1427 | */ |
1428 | static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata, | 1428 | static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata, |
1429 | struct sk_buff *skb, bool txpending, | 1429 | struct sk_buff *skb, bool txpending) |
1430 | enum ieee80211_band band) | ||
1431 | { | 1430 | { |
1432 | struct ieee80211_local *local = sdata->local; | 1431 | struct ieee80211_local *local = sdata->local; |
1433 | struct ieee80211_tx_data tx; | 1432 | struct ieee80211_tx_data tx; |
@@ -1452,8 +1451,6 @@ static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata, | |||
1452 | return true; | 1451 | return true; |
1453 | } | 1452 | } |
1454 | 1453 | ||
1455 | info->band = band; | ||
1456 | |||
1457 | /* set up hw_queue value early */ | 1454 | /* set up hw_queue value early */ |
1458 | if (!(info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) || | 1455 | if (!(info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) || |
1459 | !(local->hw.flags & IEEE80211_HW_QUEUE_CONTROL)) | 1456 | !(local->hw.flags & IEEE80211_HW_QUEUE_CONTROL)) |
@@ -1501,8 +1498,7 @@ static int ieee80211_skb_resize(struct ieee80211_sub_if_data *sdata, | |||
1501 | return 0; | 1498 | return 0; |
1502 | } | 1499 | } |
1503 | 1500 | ||
1504 | void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, | 1501 | void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) |
1505 | enum ieee80211_band band) | ||
1506 | { | 1502 | { |
1507 | struct ieee80211_local *local = sdata->local; | 1503 | struct ieee80211_local *local = sdata->local; |
1508 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 1504 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
@@ -1537,7 +1533,7 @@ void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, | |||
1537 | } | 1533 | } |
1538 | 1534 | ||
1539 | ieee80211_set_qos_hdr(sdata, skb); | 1535 | ieee80211_set_qos_hdr(sdata, skb); |
1540 | ieee80211_tx(sdata, skb, false, band); | 1536 | ieee80211_tx(sdata, skb, false); |
1541 | } | 1537 | } |
1542 | 1538 | ||
1543 | static bool ieee80211_parse_tx_radiotap(struct sk_buff *skb) | 1539 | static bool ieee80211_parse_tx_radiotap(struct sk_buff *skb) |
@@ -1757,7 +1753,8 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, | |||
1757 | sdata->vif.type)) | 1753 | sdata->vif.type)) |
1758 | goto fail_rcu; | 1754 | goto fail_rcu; |
1759 | 1755 | ||
1760 | ieee80211_xmit(sdata, skb, chandef->chan->band); | 1756 | info->band = chandef->chan->band; |
1757 | ieee80211_xmit(sdata, skb); | ||
1761 | rcu_read_unlock(); | 1758 | rcu_read_unlock(); |
1762 | 1759 | ||
1763 | return NETDEV_TX_OK; | 1760 | return NETDEV_TX_OK; |
@@ -2220,8 +2217,9 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
2220 | 2217 | ||
2221 | info->flags = info_flags; | 2218 | info->flags = info_flags; |
2222 | info->ack_frame_id = info_id; | 2219 | info->ack_frame_id = info_id; |
2220 | info->band = band; | ||
2223 | 2221 | ||
2224 | ieee80211_xmit(sdata, skb, band); | 2222 | ieee80211_xmit(sdata, skb); |
2225 | rcu_read_unlock(); | 2223 | rcu_read_unlock(); |
2226 | 2224 | ||
2227 | return; | 2225 | return; |
@@ -2277,8 +2275,8 @@ static bool ieee80211_tx_pending_skb(struct ieee80211_local *local, | |||
2277 | dev_kfree_skb(skb); | 2275 | dev_kfree_skb(skb); |
2278 | return true; | 2276 | return true; |
2279 | } | 2277 | } |
2280 | result = ieee80211_tx(sdata, skb, true, | 2278 | info->band = chanctx_conf->def.chan->band; |
2281 | chanctx_conf->def.chan->band); | 2279 | result = ieee80211_tx(sdata, skb, true); |
2282 | } else { | 2280 | } else { |
2283 | struct sk_buff_head skbs; | 2281 | struct sk_buff_head skbs; |
2284 | 2282 | ||
@@ -3059,6 +3057,7 @@ void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata, | |||
3059 | * requirements are that we do not come into tx with bhs on. | 3057 | * requirements are that we do not come into tx with bhs on. |
3060 | */ | 3058 | */ |
3061 | local_bh_disable(); | 3059 | local_bh_disable(); |
3062 | ieee80211_xmit(sdata, skb, band); | 3060 | IEEE80211_SKB_CB(skb)->band = band; |
3061 | ieee80211_xmit(sdata, skb); | ||
3063 | local_bh_enable(); | 3062 | local_bh_enable(); |
3064 | } | 3063 | } |