diff options
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index bfc4a5070013..41812a15eea0 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -2084,3 +2084,38 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata, | |||
2084 | 2084 | ||
2085 | return 0; | 2085 | return 0; |
2086 | } | 2086 | } |
2087 | |||
2088 | int ieee80211_mgd_action(struct ieee80211_sub_if_data *sdata, | ||
2089 | struct ieee80211_channel *chan, | ||
2090 | enum nl80211_channel_type channel_type, | ||
2091 | const u8 *buf, size_t len, u64 *cookie) | ||
2092 | { | ||
2093 | struct ieee80211_local *local = sdata->local; | ||
2094 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | ||
2095 | struct sk_buff *skb; | ||
2096 | |||
2097 | /* Check that we are on the requested channel for transmission */ | ||
2098 | if ((chan != local->tmp_channel || | ||
2099 | channel_type != local->tmp_channel_type) && | ||
2100 | (chan != local->oper_channel || | ||
2101 | channel_type != local->oper_channel_type)) | ||
2102 | return -EBUSY; | ||
2103 | |||
2104 | skb = dev_alloc_skb(local->hw.extra_tx_headroom + len); | ||
2105 | if (!skb) | ||
2106 | return -ENOMEM; | ||
2107 | skb_reserve(skb, local->hw.extra_tx_headroom); | ||
2108 | |||
2109 | memcpy(skb_put(skb, len), buf, len); | ||
2110 | |||
2111 | if (!(ifmgd->flags & IEEE80211_STA_MFP_ENABLED)) | ||
2112 | IEEE80211_SKB_CB(skb)->flags |= | ||
2113 | IEEE80211_TX_INTFL_DONT_ENCRYPT; | ||
2114 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_NL80211_FRAME_TX | | ||
2115 | IEEE80211_TX_CTL_REQ_TX_STATUS; | ||
2116 | skb->dev = sdata->dev; | ||
2117 | ieee80211_tx_skb(sdata, skb); | ||
2118 | |||
2119 | *cookie = (unsigned long) skb; | ||
2120 | return 0; | ||
2121 | } | ||