Commit 86d79d34 authored by Rajkumar Manoharan's avatar Rajkumar Manoharan Committed by Greg Kroah-Hartman

mac80211: add option for setting control flags

[ Upstream commit 06016772 ]

Allows setting of control flags of skb cb - if needed -
when calling ieee80211_subif_start_xmit().
Tested-by: default avatarPradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Signed-off-by: default avatarRajkumar Manoharan <rmanohar@codeaurora.org>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent e8113b2f
...@@ -1729,7 +1729,8 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, ...@@ -1729,7 +1729,8 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
struct net_device *dev); struct net_device *dev);
void __ieee80211_subif_start_xmit(struct sk_buff *skb, void __ieee80211_subif_start_xmit(struct sk_buff *skb,
struct net_device *dev, struct net_device *dev,
u32 info_flags); u32 info_flags,
u32 ctrl_flags);
void ieee80211_purge_tx_queue(struct ieee80211_hw *hw, void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
struct sk_buff_head *skbs); struct sk_buff_head *skbs);
struct sk_buff * struct sk_buff *
......
...@@ -1055,7 +1055,7 @@ ieee80211_tdls_prep_mgmt_packet(struct wiphy *wiphy, struct net_device *dev, ...@@ -1055,7 +1055,7 @@ ieee80211_tdls_prep_mgmt_packet(struct wiphy *wiphy, struct net_device *dev,
/* disable bottom halves when entering the Tx path */ /* disable bottom halves when entering the Tx path */
local_bh_disable(); local_bh_disable();
__ieee80211_subif_start_xmit(skb, dev, flags); __ieee80211_subif_start_xmit(skb, dev, flags, 0);
local_bh_enable(); local_bh_enable();
return ret; return ret;
......
...@@ -2399,6 +2399,7 @@ static int ieee80211_lookup_ra_sta(struct ieee80211_sub_if_data *sdata, ...@@ -2399,6 +2399,7 @@ static int ieee80211_lookup_ra_sta(struct ieee80211_sub_if_data *sdata,
* @sdata: virtual interface to build the header for * @sdata: virtual interface to build the header for
* @skb: the skb to build the header in * @skb: the skb to build the header in
* @info_flags: skb flags to set * @info_flags: skb flags to set
* @ctrl_flags: info control flags to set
* *
* This function takes the skb with 802.3 header and reformats the header to * This function takes the skb with 802.3 header and reformats the header to
* the appropriate IEEE 802.11 header based on which interface the packet is * the appropriate IEEE 802.11 header based on which interface the packet is
...@@ -2414,7 +2415,7 @@ static int ieee80211_lookup_ra_sta(struct ieee80211_sub_if_data *sdata, ...@@ -2414,7 +2415,7 @@ static int ieee80211_lookup_ra_sta(struct ieee80211_sub_if_data *sdata,
*/ */
static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata, static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb, u32 info_flags, struct sk_buff *skb, u32 info_flags,
struct sta_info *sta) struct sta_info *sta, u32 ctrl_flags)
{ {
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
struct ieee80211_tx_info *info; struct ieee80211_tx_info *info;
...@@ -2786,6 +2787,7 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata, ...@@ -2786,6 +2787,7 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
info->flags = info_flags; info->flags = info_flags;
info->ack_frame_id = info_id; info->ack_frame_id = info_id;
info->band = band; info->band = band;
info->control.flags = ctrl_flags;
return skb; return skb;
free: free:
...@@ -3595,7 +3597,8 @@ EXPORT_SYMBOL(ieee80211_tx_dequeue); ...@@ -3595,7 +3597,8 @@ EXPORT_SYMBOL(ieee80211_tx_dequeue);
void __ieee80211_subif_start_xmit(struct sk_buff *skb, void __ieee80211_subif_start_xmit(struct sk_buff *skb,
struct net_device *dev, struct net_device *dev,
u32 info_flags) u32 info_flags,
u32 ctrl_flags)
{ {
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct sta_info *sta; struct sta_info *sta;
...@@ -3666,7 +3669,8 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb, ...@@ -3666,7 +3669,8 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
skb->prev = NULL; skb->prev = NULL;
skb->next = NULL; skb->next = NULL;
skb = ieee80211_build_hdr(sdata, skb, info_flags, sta); skb = ieee80211_build_hdr(sdata, skb, info_flags,
sta, ctrl_flags);
if (IS_ERR(skb)) if (IS_ERR(skb))
goto out; goto out;
...@@ -3806,9 +3810,9 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, ...@@ -3806,9 +3810,9 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
__skb_queue_head_init(&queue); __skb_queue_head_init(&queue);
ieee80211_convert_to_unicast(skb, dev, &queue); ieee80211_convert_to_unicast(skb, dev, &queue);
while ((skb = __skb_dequeue(&queue))) while ((skb = __skb_dequeue(&queue)))
__ieee80211_subif_start_xmit(skb, dev, 0); __ieee80211_subif_start_xmit(skb, dev, 0, 0);
} else { } else {
__ieee80211_subif_start_xmit(skb, dev, 0); __ieee80211_subif_start_xmit(skb, dev, 0, 0);
} }
return NETDEV_TX_OK; return NETDEV_TX_OK;
...@@ -3833,7 +3837,7 @@ ieee80211_build_data_template(struct ieee80211_sub_if_data *sdata, ...@@ -3833,7 +3837,7 @@ ieee80211_build_data_template(struct ieee80211_sub_if_data *sdata,
goto out; goto out;
} }
skb = ieee80211_build_hdr(sdata, skb, info_flags, sta); skb = ieee80211_build_hdr(sdata, skb, info_flags, sta, 0);
if (IS_ERR(skb)) if (IS_ERR(skb))
goto out; goto out;
...@@ -4870,7 +4874,7 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, ...@@ -4870,7 +4874,7 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
local_bh_disable(); local_bh_disable();
__ieee80211_subif_start_xmit(skb, skb->dev, flags); __ieee80211_subif_start_xmit(skb, skb->dev, flags, 0);
local_bh_enable(); local_bh_enable();
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment