Skip to content

Commit

Permalink
Merge tag 'mac80211-next-for-john-2014-08-29' of git://git.kernel.org…
Browse files Browse the repository at this point in the history
…/pub/scm/linux/kernel/git/jberg/mac80211-next

Johannes Berg <johannes@sipsolutions.net> says:

"Not that much content this time. Some RCU cleanups, crypto
performance improvements, and various patches all over,
rather than listing them one might as well look into the
git log instead."

Signed-off-by: John W. Linville <linville@tuxdriver.com>

Conflicts:
	drivers/net/wireless/ath/wil6210/wmi.c
  • Loading branch information
John W. Linville committed Sep 4, 2014
2 parents 6a5d088 + d061661 commit ef4ead3
Show file tree
Hide file tree
Showing 39 changed files with 344 additions and 246 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath6kl/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ ath6kl_add_bss_if_needed(struct ath6kl_vif *vif,
memcpy(ie + 2, vif->ssid, vif->ssid_len);
memcpy(ie + 2 + vif->ssid_len, beacon_ie, beacon_ie_len);
bss = cfg80211_inform_bss(ar->wiphy, chan,
CFG80211_BSS_FTYPE_UNKNOWN,
bssid, 0, cap_val, 100,
ie, 2 + vif->ssid_len + beacon_ie_len,
0, GFP_KERNEL);
Expand Down
48 changes: 11 additions & 37 deletions drivers/net/wireless/ath/ath6kl/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,7 @@ static int ath6kl_wmi_rx_probe_req_event_rx(struct wmi *wmi, u8 *datap, int len,
dlen, freq, vif->probe_req_report);

if (vif->probe_req_report || vif->nw_type == AP_NETWORK)
cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0,
GFP_ATOMIC);
cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0);

return 0;
}
Expand Down Expand Up @@ -659,7 +658,7 @@ static int ath6kl_wmi_rx_action_event_rx(struct wmi *wmi, u8 *datap, int len,
return -EINVAL;
}
ath6kl_dbg(ATH6KL_DBG_WMI, "rx_action: len=%u freq=%u\n", dlen, freq);
cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0, GFP_ATOMIC);
cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0);

return 0;
}
Expand Down Expand Up @@ -1093,7 +1092,6 @@ static int ath6kl_wmi_bssinfo_event_rx(struct wmi *wmi, u8 *datap, int len,
u8 *buf;
struct ieee80211_channel *channel;
struct ath6kl *ar = wmi->parent_dev;
struct ieee80211_mgmt *mgmt;
struct cfg80211_bss *bss;

if (len <= sizeof(struct wmi_bss_info_hdr2))
Expand Down Expand Up @@ -1139,39 +1137,15 @@ static int ath6kl_wmi_bssinfo_event_rx(struct wmi *wmi, u8 *datap, int len,
}
}

/*
* In theory, use of cfg80211_inform_bss() would be more natural here
* since we do not have the full frame. However, at least for now,
* cfg80211 can only distinguish Beacon and Probe Response frames from
* each other when using cfg80211_inform_bss_frame(), so let's build a
* fake IEEE 802.11 header to be able to take benefit of this.
*/
mgmt = kmalloc(24 + len, GFP_ATOMIC);
if (mgmt == NULL)
return -EINVAL;

if (bih->frame_type == BEACON_FTYPE) {
mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_BEACON);
memset(mgmt->da, 0xff, ETH_ALEN);
} else {
struct net_device *dev = vif->ndev;

mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_PROBE_RESP);
memcpy(mgmt->da, dev->dev_addr, ETH_ALEN);
}
mgmt->duration = cpu_to_le16(0);
memcpy(mgmt->sa, bih->bssid, ETH_ALEN);
memcpy(mgmt->bssid, bih->bssid, ETH_ALEN);
mgmt->seq_ctrl = cpu_to_le16(0);

memcpy(&mgmt->u.beacon, buf, len);

bss = cfg80211_inform_bss_frame(ar->wiphy, channel, mgmt,
24 + len, (bih->snr - 95) * 100,
GFP_ATOMIC);
kfree(mgmt);
bss = cfg80211_inform_bss(ar->wiphy, channel,
bih->frame_type == BEACON_FTYPE ?
CFG80211_BSS_FTYPE_BEACON :
CFG80211_BSS_FTYPE_PRESP,
bih->bssid, get_unaligned_le64((__le64 *)buf),
get_unaligned_le16(((__le16 *)buf) + 5),
get_unaligned_le16(((__le16 *)buf) + 4),
buf + 8 + 2 + 2, len - 8 - 2 - 2,
(bih->snr - 95) * 100, GFP_ATOMIC);
if (bss == NULL)
return -ENOMEM;
cfg80211_put_bss(ar->wiphy, bss);
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/wil6210/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,11 @@ static void wmi_evt_rx_mgmt(struct wil6210_priv *wil, int id, void *d, int len)
rx_mgmt_frame->bssid);
cfg80211_put_bss(wiphy, bss);
} else {
wil_err(wil, "cfg80211_inform_bss() failed\n");
wil_err(wil, "cfg80211_inform_bss_frame() failed\n");
}
} else {
cfg80211_rx_mgmt(wil->wdev, freq, signal,
(void *)rx_mgmt_frame, d_len, 0, GFP_ATOMIC);
(void *)rx_mgmt_frame, d_len, 0);
}
}

Expand Down
6 changes: 2 additions & 4 deletions drivers/net/wireless/brcm80211/brcmfmac/p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -1431,8 +1431,7 @@ int brcmf_p2p_notify_action_frame_rx(struct brcmf_if *ifp,
IEEE80211_BAND_5GHZ);

wdev = &ifp->vif->wdev;
cfg80211_rx_mgmt(wdev, freq, 0, (u8 *)mgmt_frame, mgmt_frame_len, 0,
GFP_ATOMIC);
cfg80211_rx_mgmt(wdev, freq, 0, (u8 *)mgmt_frame, mgmt_frame_len, 0);

kfree(mgmt_frame);
return 0;
Expand Down Expand Up @@ -1896,8 +1895,7 @@ s32 brcmf_p2p_notify_rx_mgmt_p2p_probereq(struct brcmf_if *ifp,
IEEE80211_BAND_2GHZ :
IEEE80211_BAND_5GHZ);

cfg80211_rx_mgmt(&vif->wdev, freq, 0, mgmt_frame, mgmt_frame_len, 0,
GFP_ATOMIC);
cfg80211_rx_mgmt(&vif->wdev, freq, 0, mgmt_frame, mgmt_frame_len, 0);

brcmf_dbg(INFO, "mgmt_frame_len (%d) , e->datalen (%d), chanspec (%04x), freq (%d)\n",
mgmt_frame_len, e->datalen, chanspec, freq);
Expand Down
18 changes: 12 additions & 6 deletions drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -2394,9 +2394,13 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg,
brcmf_dbg(CONN, "Beacon interval: %d\n", notify_interval);
brcmf_dbg(CONN, "Signal: %d\n", notify_signal);

bss = cfg80211_inform_bss(wiphy, notify_channel, (const u8 *)bi->BSSID,
0, notify_capability, notify_interval, notify_ie,
notify_ielen, notify_signal, GFP_KERNEL);
bss = cfg80211_inform_bss(wiphy, notify_channel,
CFG80211_BSS_FTYPE_UNKNOWN,
(const u8 *)bi->BSSID,
0, notify_capability,
notify_interval, notify_ie,
notify_ielen, notify_signal,
GFP_KERNEL);

if (!bss)
return -ENOMEM;
Expand Down Expand Up @@ -2498,9 +2502,11 @@ static s32 wl_inform_ibss(struct brcmf_cfg80211_info *cfg,
brcmf_dbg(CONN, "beacon interval: %d\n", notify_interval);
brcmf_dbg(CONN, "signal: %d\n", notify_signal);

bss = cfg80211_inform_bss(wiphy, notify_channel, bssid,
0, notify_capability, notify_interval,
notify_ie, notify_ielen, notify_signal, GFP_KERNEL);
bss = cfg80211_inform_bss(wiphy, notify_channel,
CFG80211_BSS_FTYPE_UNKNOWN, bssid, 0,
notify_capability, notify_interval,
notify_ie, notify_ielen, notify_signal,
GFP_KERNEL);

if (!bss) {
err = -ENOMEM;
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/libertas/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,
if (channel &&
!(channel->flags & IEEE80211_CHAN_DISABLED)) {
bss = cfg80211_inform_bss(wiphy, channel,
CFG80211_BSS_FTYPE_UNKNOWN,
bssid, get_unaligned_le64(tsfdesc),
capa, intvl, ie, ielen,
LBS_SCAN_RSSI_TO_MBM(rssi),
Expand Down Expand Up @@ -1754,6 +1755,7 @@ static void lbs_join_post(struct lbs_private *priv,

bss = cfg80211_inform_bss(priv->wdev->wiphy,
params->chandef.chan,
CFG80211_BSS_FTYPE_UNKNOWN,
bssid,
0,
capability,
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/mwifiex/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,7 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
band));

bss = cfg80211_inform_bss(priv->wdev->wiphy, chan,
CFG80211_BSS_FTYPE_UNKNOWN,
bss_info.bssid, 0, WLAN_CAPABILITY_IBSS,
0, ie_buf, ie_len, 0, GFP_KERNEL);
cfg80211_put_bss(priv->wdev->wiphy, bss);
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/mwifiex/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,8 @@ mwifiex_parse_single_response_buf(struct mwifiex_private *priv, u8 **bss_info,

if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
bss = cfg80211_inform_bss(priv->wdev->wiphy,
chan, bssid, timestamp,
chan, CFG80211_BSS_FTYPE_UNKNOWN,
bssid, timestamp,
cap_info_bitmap, beacon_period,
ie_buf, ie_len, rssi, GFP_KERNEL);
bss_priv = (struct mwifiex_bss_priv *)bss->priv;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mwifiex/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv,

cfg80211_rx_mgmt(priv->wdev, priv->roc_cfg.chan.center_freq,
CAL_RSSI(rx_pd->snr, rx_pd->nf), skb->data, pkt_len,
0, GFP_ATOMIC);
0);

return 0;
}
Expand Down
14 changes: 8 additions & 6 deletions drivers/net/wireless/orinoco/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,10 @@ static void orinoco_add_hostscan_result(struct orinoco_private *priv,
beacon_interval = le16_to_cpu(bss->a.beacon_interv);
signal = SIGNAL_TO_MBM(le16_to_cpu(bss->a.level));

cbss = cfg80211_inform_bss(wiphy, channel, bss->a.bssid, timestamp,
capability, beacon_interval, ie_buf, ie_len,
signal, GFP_KERNEL);
cbss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN,
bss->a.bssid, timestamp, capability,
beacon_interval, ie_buf, ie_len, signal,
GFP_KERNEL);
cfg80211_put_bss(wiphy, cbss);
}

Expand Down Expand Up @@ -156,9 +157,10 @@ void orinoco_add_extscan_result(struct orinoco_private *priv,
ie = bss->data;
signal = SIGNAL_TO_MBM(bss->level);

cbss = cfg80211_inform_bss(wiphy, channel, bss->bssid, timestamp,
capability, beacon_interval, ie, ie_len,
signal, GFP_KERNEL);
cbss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN,
bss->bssid, timestamp, capability,
beacon_interval, ie, ie_len, signal,
GFP_KERNEL);
cfg80211_put_bss(wiphy, cbss);
}

Expand Down
14 changes: 8 additions & 6 deletions drivers/net/wireless/rndis_wlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2022,9 +2022,10 @@ static bool rndis_bss_info_update(struct usbnet *usbdev,
capability = le16_to_cpu(fixed->capabilities);
beacon_interval = le16_to_cpu(fixed->beacon_interval);

bss = cfg80211_inform_bss(priv->wdev.wiphy, channel, bssid->mac,
timestamp, capability, beacon_interval, ie, ie_len, signal,
GFP_KERNEL);
bss = cfg80211_inform_bss(priv->wdev.wiphy, channel,
CFG80211_BSS_FTYPE_UNKNOWN, bssid->mac,
timestamp, capability, beacon_interval,
ie, ie_len, signal, GFP_KERNEL);
cfg80211_put_bss(priv->wdev.wiphy, bss);

return (bss != NULL);
Expand Down Expand Up @@ -2711,9 +2712,10 @@ static void rndis_wlan_craft_connected_bss(struct usbnet *usbdev, u8 *bssid,
bssid, (u32)timestamp, capability, beacon_period, ie_len,
ssid.essid, signal);

bss = cfg80211_inform_bss(priv->wdev.wiphy, channel, bssid,
timestamp, capability, beacon_period, ie_buf, ie_len,
signal, GFP_KERNEL);
bss = cfg80211_inform_bss(priv->wdev.wiphy, channel,
CFG80211_BSS_FTYPE_UNKNOWN, bssid,
timestamp, capability, beacon_period,
ie_buf, ie_len, signal, GFP_KERNEL);
cfg80211_put_bss(priv->wdev.wiphy, bss);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/rtl8723au/core/rtw_mlme_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -2128,7 +2128,7 @@ static int on_action_public23a(struct rtw_adapter *padapter,
IEEE80211_BAND_5GHZ);

if (cfg80211_rx_mgmt(padapter->rtw_wdev, freq, 0, pframe,
skb->len, 0, GFP_ATOMIC))
skb->len, 0))
return _SUCCESS;

return _FAIL;
Expand Down
5 changes: 3 additions & 2 deletions drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ static int rtw_cfg80211_inform_bss(struct rtw_adapter *padapter,
}

bss = cfg80211_inform_bss(wiphy, notify_channel,
CFG80211_BSS_FTYPE_UNKNOWN,
pnetwork->network.MacAddress,
pnetwork->network.tsf,
pnetwork->network.capability,
Expand Down Expand Up @@ -2379,7 +2380,7 @@ void rtw_cfg80211_indicate_sta_assoc(struct rtw_adapter *padapter,
IEEE80211_BAND_5GHZ);

cfg80211_rx_mgmt(padapter->rtw_wdev, freq, 0, pmgmt_frame, frame_len,
0, GFP_ATOMIC);
0);
#endif /* defined(RTW_USE_CFG80211_STA_EVENT) */
}

Expand Down Expand Up @@ -2425,7 +2426,7 @@ void rtw_cfg80211_indicate_sta_disassoc(struct rtw_adapter *padapter,
frame_len = sizeof(struct ieee80211_hdr_3addr) + 2;

cfg80211_rx_mgmt(padapter->rtw_wdev, freq, 0, (u8 *)&mgmt, frame_len,
0, GFP_ATOMIC);
0);
#endif /* defined(RTW_USE_CFG80211_STA_EVENT) */
}

Expand Down
1 change: 1 addition & 0 deletions drivers/staging/wlan-ng/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ static int prism2_scan(struct wiphy *wiphy,
IEEE80211_BAND_2GHZ);
bss = cfg80211_inform_bss(wiphy,
ieee80211_get_channel(wiphy, freq),
CFG80211_BSS_FTYPE_UNKNOWN,
(const u8 *) &(msg2.bssid.data.data),
msg2.timestamp.data, msg2.capinfo.data,
msg2.beaconperiod.data,
Expand Down
65 changes: 65 additions & 0 deletions include/linux/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,16 @@ enum ieee80211_vht_opmode_bits {

#define WLAN_SA_QUERY_TR_ID_LEN 2

/**
* struct ieee80211_tpc_report_ie
*
* This structure refers to "TPC Report element"
*/
struct ieee80211_tpc_report_ie {
u8 tx_power;
u8 link_margin;
} __packed;

struct ieee80211_mgmt {
__le16 frame_control;
__le16 duration;
Expand Down Expand Up @@ -973,6 +983,13 @@ struct ieee80211_mgmt {
u8 action_code;
u8 operating_mode;
} __packed vht_opmode_notif;
struct {
u8 action_code;
u8 dialog_token;
u8 tpc_elem_id;
u8 tpc_elem_length;
struct ieee80211_tpc_report_ie tpc;
} __packed tpc_report;
} u;
} __packed action;
} u;
Expand Down Expand Up @@ -1865,6 +1882,7 @@ enum ieee80211_category {
WLAN_CATEGORY_DLS = 2,
WLAN_CATEGORY_BACK = 3,
WLAN_CATEGORY_PUBLIC = 4,
WLAN_CATEGORY_RADIO_MEASUREMENT = 5,
WLAN_CATEGORY_HT = 7,
WLAN_CATEGORY_SA_QUERY = 8,
WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9,
Expand Down Expand Up @@ -2378,4 +2396,51 @@ static inline bool ieee80211_check_tim(const struct ieee80211_tim_ie *tim,
#define TU_TO_JIFFIES(x) (usecs_to_jiffies((x) * 1024))
#define TU_TO_EXP_TIME(x) (jiffies + TU_TO_JIFFIES(x))

/**
* ieee80211_action_contains_tpc - checks if the frame contains TPC element
* @skb: the skb containing the frame, length will be checked
*
* This function checks if it's either TPC report action frame or Link
* Measurement report action frame as defined in IEEE Std. 802.11-2012 8.5.2.5
* and 8.5.7.5 accordingly.
*/
static inline bool ieee80211_action_contains_tpc(struct sk_buff *skb)
{
struct ieee80211_mgmt *mgmt = (void *)skb->data;

if (!ieee80211_is_action(mgmt->frame_control))
return false;

if (skb->len < IEEE80211_MIN_ACTION_SIZE +
sizeof(mgmt->u.action.u.tpc_report))
return false;

/*
* TPC report - check that:
* category = 0 (Spectrum Management) or 5 (Radio Measurement)
* spectrum management action = 3 (TPC/Link Measurement report)
* TPC report EID = 35
* TPC report element length = 2
*
* The spectrum management's tpc_report struct is used here both for
* parsing tpc_report and radio measurement's link measurement report
* frame, since the relevant part is identical in both frames.
*/
if (mgmt->u.action.category != WLAN_CATEGORY_SPECTRUM_MGMT &&
mgmt->u.action.category != WLAN_CATEGORY_RADIO_MEASUREMENT)
return false;

/* both spectrum mgmt and link measurement have same action code */
if (mgmt->u.action.u.tpc_report.action_code !=
WLAN_ACTION_SPCT_TPC_RPRT)
return false;

if (mgmt->u.action.u.tpc_report.tpc_elem_id != WLAN_EID_TPC_REPORT ||
mgmt->u.action.u.tpc_report.tpc_elem_length !=
sizeof(struct ieee80211_tpc_report_ie))
return false;

return true;
}

#endif /* LINUX_IEEE80211_H */
Loading

0 comments on commit ef4ead3

Please sign in to comment.