diff options
author | Liad Kaufman <liad.kaufman@intel.com> | 2014-11-09 11:50:07 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-11-19 12:44:19 -0500 |
commit | 24d342c514827d52d008736bf02c9f145651ca8e (patch) | |
tree | 7741ab43ecd4fb5d4c3ffe6e4fb84769fbdca9ce /net/mac80211 | |
parent | 760a52e80fdf018a9f83a499427923e18e3bd582 (diff) |
mac80211: add option for setting skb flags before xmit
Allows setting of an skb's flags - if needed - when calling
ieee80211_subif_start_xmit().
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 3 | ||||
-rw-r--r-- | net/mac80211/tx.c | 21 |
2 files changed, 16 insertions, 8 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index a51c993ece73..208953d1d028 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -1625,6 +1625,9 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, | |||
1625 | struct net_device *dev); | 1625 | struct net_device *dev); |
1626 | netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | 1626 | netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, |
1627 | struct net_device *dev); | 1627 | struct net_device *dev); |
1628 | void __ieee80211_subif_start_xmit(struct sk_buff *skb, | ||
1629 | struct net_device *dev, | ||
1630 | u32 info_flags); | ||
1628 | void ieee80211_purge_tx_queue(struct ieee80211_hw *hw, | 1631 | void ieee80211_purge_tx_queue(struct ieee80211_hw *hw, |
1629 | struct sk_buff_head *skbs); | 1632 | struct sk_buff_head *skbs); |
1630 | 1633 | ||
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 3ffd91f295a6..66af35f56a33 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1787,21 +1787,22 @@ static void ieee80211_tx_latency_start_msrmnt(struct ieee80211_local *local, | |||
1787 | } | 1787 | } |
1788 | 1788 | ||
1789 | /** | 1789 | /** |
1790 | * ieee80211_subif_start_xmit - netif start_xmit function for Ethernet-type | 1790 | * __ieee80211_subif_start_xmit - netif start_xmit function for Ethernet-type |
1791 | * subinterfaces (wlan#, WDS, and VLAN interfaces) | 1791 | * subinterfaces (wlan#, WDS, and VLAN interfaces) |
1792 | * @skb: packet to be sent | 1792 | * @skb: packet to be sent |
1793 | * @dev: incoming interface | 1793 | * @dev: incoming interface |
1794 | * @info_flags: skb flags to set | ||
1794 | * | 1795 | * |
1795 | * Returns: NETDEV_TX_OK both on success and on failure. On failure skb will | 1796 | * On failure skb will be freed. |
1796 | * be freed. | ||
1797 | * | 1797 | * |
1798 | * This function takes in an Ethernet header and encapsulates it with suitable | 1798 | * This function takes in an Ethernet header and encapsulates it with suitable |
1799 | * IEEE 802.11 header based on which interface the packet is coming in. The | 1799 | * IEEE 802.11 header based on which interface the packet is coming in. The |
1800 | * encapsulated packet will then be passed to master interface, wlan#.11, for | 1800 | * encapsulated packet will then be passed to master interface, wlan#.11, for |
1801 | * transmission (through low-level driver). | 1801 | * transmission (through low-level driver). |
1802 | */ | 1802 | */ |
1803 | netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | 1803 | void __ieee80211_subif_start_xmit(struct sk_buff *skb, |
1804 | struct net_device *dev) | 1804 | struct net_device *dev, |
1805 | u32 info_flags) | ||
1805 | { | 1806 | { |
1806 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1807 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1807 | struct ieee80211_local *local = sdata->local; | 1808 | struct ieee80211_local *local = sdata->local; |
@@ -1819,7 +1820,6 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1819 | bool wme_sta = false, authorized = false, tdls_auth = false; | 1820 | bool wme_sta = false, authorized = false, tdls_auth = false; |
1820 | bool tdls_peer = false, tdls_setup_frame = false; | 1821 | bool tdls_peer = false, tdls_setup_frame = false; |
1821 | bool multicast; | 1822 | bool multicast; |
1822 | u32 info_flags = 0; | ||
1823 | u16 info_id = 0; | 1823 | u16 info_id = 0; |
1824 | struct ieee80211_chanctx_conf *chanctx_conf; | 1824 | struct ieee80211_chanctx_conf *chanctx_conf; |
1825 | struct ieee80211_sub_if_data *ap_sdata; | 1825 | struct ieee80211_sub_if_data *ap_sdata; |
@@ -2224,15 +2224,20 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
2224 | ieee80211_xmit(sdata, skb, band); | 2224 | ieee80211_xmit(sdata, skb, band); |
2225 | rcu_read_unlock(); | 2225 | rcu_read_unlock(); |
2226 | 2226 | ||
2227 | return NETDEV_TX_OK; | 2227 | return; |
2228 | 2228 | ||
2229 | fail_rcu: | 2229 | fail_rcu: |
2230 | rcu_read_unlock(); | 2230 | rcu_read_unlock(); |
2231 | fail: | 2231 | fail: |
2232 | dev_kfree_skb(skb); | 2232 | dev_kfree_skb(skb); |
2233 | return NETDEV_TX_OK; | ||
2234 | } | 2233 | } |
2235 | 2234 | ||
2235 | netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | ||
2236 | struct net_device *dev) | ||
2237 | { | ||
2238 | __ieee80211_subif_start_xmit(skb, dev, 0); | ||
2239 | return NETDEV_TX_OK; | ||
2240 | } | ||
2236 | 2241 | ||
2237 | /* | 2242 | /* |
2238 | * ieee80211_clear_tx_pending may not be called in a context where | 2243 | * ieee80211_clear_tx_pending may not be called in a context where |