Skip to content

Commit 0601677

Browse files
Rajkumar Manoharanjmberg-intel
authored andcommitted
mac80211: add option for setting control flags
Allows setting of control flags of skb cb - if needed - when calling ieee80211_subif_start_xmit(). Tested-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org> Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 5ab92e7 commit 0601677

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

net/mac80211/ieee80211_i.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,8 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
17611761
struct net_device *dev);
17621762
void __ieee80211_subif_start_xmit(struct sk_buff *skb,
17631763
struct net_device *dev,
1764-
u32 info_flags);
1764+
u32 info_flags,
1765+
u32 ctrl_flags);
17651766
void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
17661767
struct sk_buff_head *skbs);
17671768
struct sk_buff *

net/mac80211/tdls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ ieee80211_tdls_prep_mgmt_packet(struct wiphy *wiphy, struct net_device *dev,
10561056

10571057
/* disable bottom halves when entering the Tx path */
10581058
local_bh_disable();
1059-
__ieee80211_subif_start_xmit(skb, dev, flags);
1059+
__ieee80211_subif_start_xmit(skb, dev, flags, 0);
10601060
local_bh_enable();
10611061

10621062
return ret;

net/mac80211/tx.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,6 +2432,7 @@ static int ieee80211_lookup_ra_sta(struct ieee80211_sub_if_data *sdata,
24322432
* @sdata: virtual interface to build the header for
24332433
* @skb: the skb to build the header in
24342434
* @info_flags: skb flags to set
2435+
* @ctrl_flags: info control flags to set
24352436
*
24362437
* This function takes the skb with 802.3 header and reformats the header to
24372438
* the appropriate IEEE 802.11 header based on which interface the packet is
@@ -2447,7 +2448,7 @@ static int ieee80211_lookup_ra_sta(struct ieee80211_sub_if_data *sdata,
24472448
*/
24482449
static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
24492450
struct sk_buff *skb, u32 info_flags,
2450-
struct sta_info *sta)
2451+
struct sta_info *sta, u32 ctrl_flags)
24512452
{
24522453
struct ieee80211_local *local = sdata->local;
24532454
struct ieee80211_tx_info *info;
@@ -2824,6 +2825,7 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
28242825
info->flags = info_flags;
28252826
info->ack_frame_id = info_id;
28262827
info->band = band;
2828+
info->control.flags = ctrl_flags;
28272829

28282830
return skb;
28292831
free:
@@ -3804,7 +3806,8 @@ EXPORT_SYMBOL(ieee80211_txq_schedule_end);
38043806

38053807
void __ieee80211_subif_start_xmit(struct sk_buff *skb,
38063808
struct net_device *dev,
3807-
u32 info_flags)
3809+
u32 info_flags,
3810+
u32 ctrl_flags)
38083811
{
38093812
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
38103813
struct ieee80211_local *local = sdata->local;
@@ -3878,7 +3881,8 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
38783881
skb->prev = NULL;
38793882
skb->next = NULL;
38803883

3881-
skb = ieee80211_build_hdr(sdata, skb, info_flags, sta);
3884+
skb = ieee80211_build_hdr(sdata, skb, info_flags,
3885+
sta, ctrl_flags);
38823886
if (IS_ERR(skb))
38833887
goto out;
38843888

@@ -4018,9 +4022,9 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
40184022
__skb_queue_head_init(&queue);
40194023
ieee80211_convert_to_unicast(skb, dev, &queue);
40204024
while ((skb = __skb_dequeue(&queue)))
4021-
__ieee80211_subif_start_xmit(skb, dev, 0);
4025+
__ieee80211_subif_start_xmit(skb, dev, 0, 0);
40224026
} else {
4023-
__ieee80211_subif_start_xmit(skb, dev, 0);
4027+
__ieee80211_subif_start_xmit(skb, dev, 0, 0);
40244028
}
40254029

40264030
return NETDEV_TX_OK;
@@ -4045,7 +4049,7 @@ ieee80211_build_data_template(struct ieee80211_sub_if_data *sdata,
40454049
goto out;
40464050
}
40474051

4048-
skb = ieee80211_build_hdr(sdata, skb, info_flags, sta);
4052+
skb = ieee80211_build_hdr(sdata, skb, info_flags, sta, 0);
40494053
if (IS_ERR(skb))
40504054
goto out;
40514055

@@ -5082,7 +5086,7 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
50825086
skb_reset_mac_header(skb);
50835087

50845088
local_bh_disable();
5085-
__ieee80211_subif_start_xmit(skb, skb->dev, flags);
5089+
__ieee80211_subif_start_xmit(skb, skb->dev, flags, 0);
50865090
local_bh_enable();
50875091

50885092
return 0;

0 commit comments

Comments
 (0)