diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2013-08-15 07:51:28 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-08-23 10:06:03 -0400 |
commit | 19504cf5f35fbe85db811fce9f4392a0cbdada2f (patch) | |
tree | 29e8eaeb1a062cb3e843781c7dc4add821fd592b | |
parent | c4c205f3cd17b567b8e20098522416eac2e73960 (diff) |
cfg80211: add flags to cfg80211_rx_mgmt()
Add flags intended to report various auxiliary information
and introduce the NL80211_RXMGMT_FLAG_ANSWERED flag to report
that the frame was already answered by the device.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
[REPLIED->ANSWERED, reword commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/wmi.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wmi.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/p2p.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/util.c | 4 | ||||
-rw-r--r-- | include/net/cfg80211.h | 3 | ||||
-rw-r--r-- | include/uapi/linux/nl80211.h | 16 | ||||
-rw-r--r-- | net/mac80211/rx.c | 3 | ||||
-rw-r--r-- | net/wireless/mlme.c | 4 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 6 | ||||
-rw-r--r-- | net/wireless/nl80211.h | 2 |
10 files changed, 34 insertions, 17 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index 87aefb4c4c23..546d5da0b894 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c | |||
@@ -568,8 +568,8 @@ static int ath6kl_wmi_rx_probe_req_event_rx(struct wmi *wmi, u8 *datap, int len, | |||
568 | dlen, freq, vif->probe_req_report); | 568 | dlen, freq, vif->probe_req_report); |
569 | 569 | ||
570 | if (vif->probe_req_report || vif->nw_type == AP_NETWORK) | 570 | if (vif->probe_req_report || vif->nw_type == AP_NETWORK) |
571 | cfg80211_rx_mgmt(&vif->wdev, freq, 0, | 571 | cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0, |
572 | ev->data, dlen, GFP_ATOMIC); | 572 | GFP_ATOMIC); |
573 | 573 | ||
574 | return 0; | 574 | return 0; |
575 | } | 575 | } |
@@ -608,8 +608,7 @@ static int ath6kl_wmi_rx_action_event_rx(struct wmi *wmi, u8 *datap, int len, | |||
608 | return -EINVAL; | 608 | return -EINVAL; |
609 | } | 609 | } |
610 | ath6kl_dbg(ATH6KL_DBG_WMI, "rx_action: len=%u freq=%u\n", dlen, freq); | 610 | ath6kl_dbg(ATH6KL_DBG_WMI, "rx_action: len=%u freq=%u\n", dlen, freq); |
611 | cfg80211_rx_mgmt(&vif->wdev, freq, 0, | 611 | cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0, GFP_ATOMIC); |
612 | ev->data, dlen, GFP_ATOMIC); | ||
613 | 612 | ||
614 | return 0; | 613 | return 0; |
615 | } | 614 | } |
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index dc8059ad4bab..21c791ee8178 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c | |||
@@ -339,7 +339,7 @@ static void wmi_evt_rx_mgmt(struct wil6210_priv *wil, int id, void *d, int len) | |||
339 | } | 339 | } |
340 | } else { | 340 | } else { |
341 | cfg80211_rx_mgmt(wil->wdev, freq, signal, | 341 | cfg80211_rx_mgmt(wil->wdev, freq, signal, |
342 | (void *)rx_mgmt_frame, d_len, GFP_KERNEL); | 342 | (void *)rx_mgmt_frame, d_len, 0, GFP_KERNEL); |
343 | } | 343 | } |
344 | } | 344 | } |
345 | 345 | ||
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c index 79555f006d53..d7a974532909 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c | |||
@@ -1430,7 +1430,7 @@ int brcmf_p2p_notify_action_frame_rx(struct brcmf_if *ifp, | |||
1430 | IEEE80211_BAND_5GHZ); | 1430 | IEEE80211_BAND_5GHZ); |
1431 | 1431 | ||
1432 | wdev = &ifp->vif->wdev; | 1432 | wdev = &ifp->vif->wdev; |
1433 | cfg80211_rx_mgmt(wdev, freq, 0, (u8 *)mgmt_frame, mgmt_frame_len, | 1433 | cfg80211_rx_mgmt(wdev, freq, 0, (u8 *)mgmt_frame, mgmt_frame_len, 0, |
1434 | GFP_ATOMIC); | 1434 | GFP_ATOMIC); |
1435 | 1435 | ||
1436 | kfree(mgmt_frame); | 1436 | kfree(mgmt_frame); |
@@ -1895,7 +1895,7 @@ s32 brcmf_p2p_notify_rx_mgmt_p2p_probereq(struct brcmf_if *ifp, | |||
1895 | IEEE80211_BAND_2GHZ : | 1895 | IEEE80211_BAND_2GHZ : |
1896 | IEEE80211_BAND_5GHZ); | 1896 | IEEE80211_BAND_5GHZ); |
1897 | 1897 | ||
1898 | cfg80211_rx_mgmt(&vif->wdev, freq, 0, mgmt_frame, mgmt_frame_len, | 1898 | cfg80211_rx_mgmt(&vif->wdev, freq, 0, mgmt_frame, mgmt_frame_len, 0, |
1899 | GFP_ATOMIC); | 1899 | GFP_ATOMIC); |
1900 | 1900 | ||
1901 | brcmf_dbg(INFO, "mgmt_frame_len (%d) , e->datalen (%d), chanspec (%04x), freq (%d)\n", | 1901 | brcmf_dbg(INFO, "mgmt_frame_len (%d) , e->datalen (%d), chanspec (%04x), freq (%d)\n", |
diff --git a/drivers/net/wireless/mwifiex/util.c b/drivers/net/wireless/mwifiex/util.c index e57ac0dd3ab5..5d9e150f4111 100644 --- a/drivers/net/wireless/mwifiex/util.c +++ b/drivers/net/wireless/mwifiex/util.c | |||
@@ -171,8 +171,8 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv, | |||
171 | rx_pd->rx_pkt_length = cpu_to_le16(pkt_len); | 171 | rx_pd->rx_pkt_length = cpu_to_le16(pkt_len); |
172 | 172 | ||
173 | cfg80211_rx_mgmt(priv->wdev, priv->roc_cfg.chan.center_freq, | 173 | cfg80211_rx_mgmt(priv->wdev, priv->roc_cfg.chan.center_freq, |
174 | CAL_RSSI(rx_pd->snr, rx_pd->nf), | 174 | CAL_RSSI(rx_pd->snr, rx_pd->nf), skb->data, pkt_len, |
175 | skb->data, pkt_len, GFP_ATOMIC); | 175 | 0, GFP_ATOMIC); |
176 | 176 | ||
177 | return 0; | 177 | return 0; |
178 | } | 178 | } |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 9ab7a0690d93..d530c54a3662 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -4056,6 +4056,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr, | |||
4056 | * @sig_dbm: signal strength in mBm, or 0 if unknown | 4056 | * @sig_dbm: signal strength in mBm, or 0 if unknown |
4057 | * @buf: Management frame (header + body) | 4057 | * @buf: Management frame (header + body) |
4058 | * @len: length of the frame data | 4058 | * @len: length of the frame data |
4059 | * @flags: flags, as defined in enum nl80211_rxmgmt_flags | ||
4059 | * @gfp: context flags | 4060 | * @gfp: context flags |
4060 | * | 4061 | * |
4061 | * This function is called whenever an Action frame is received for a station | 4062 | * This function is called whenever an Action frame is received for a station |
@@ -4067,7 +4068,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr, | |||
4067 | * driver is responsible for rejecting the frame. | 4068 | * driver is responsible for rejecting the frame. |
4068 | */ | 4069 | */ |
4069 | bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm, | 4070 | bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm, |
4070 | const u8 *buf, size_t len, gfp_t gfp); | 4071 | const u8 *buf, size_t len, u32 flags, gfp_t gfp); |
4071 | 4072 | ||
4072 | /** | 4073 | /** |
4073 | * cfg80211_mgmt_tx_status - notification of TX status for management frame | 4074 | * cfg80211_mgmt_tx_status - notification of TX status for management frame |
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 1f42bc3dcb9c..fde2c021b26d 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h | |||
@@ -1493,6 +1493,9 @@ enum nl80211_commands { | |||
1493 | * @NL80211_ATTR_CSA_C_OFF_PRESP: Offset of the channel switch counter | 1493 | * @NL80211_ATTR_CSA_C_OFF_PRESP: Offset of the channel switch counter |
1494 | * field in the probe response (%NL80211_ATTR_PROBE_RESP). | 1494 | * field in the probe response (%NL80211_ATTR_PROBE_RESP). |
1495 | * | 1495 | * |
1496 | * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32. | ||
1497 | * As specified in the &enum nl80211_rxmgmt_flags. | ||
1498 | * | ||
1496 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1499 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
1497 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1500 | * @__NL80211_ATTR_AFTER_LAST: internal use |
1498 | */ | 1501 | */ |
@@ -1801,6 +1804,8 @@ enum nl80211_attrs { | |||
1801 | NL80211_ATTR_CSA_C_OFF_BEACON, | 1804 | NL80211_ATTR_CSA_C_OFF_BEACON, |
1802 | NL80211_ATTR_CSA_C_OFF_PRESP, | 1805 | NL80211_ATTR_CSA_C_OFF_PRESP, |
1803 | 1806 | ||
1807 | NL80211_ATTR_RXMGMT_FLAGS, | ||
1808 | |||
1804 | /* add attributes here, update the policy in nl80211.c */ | 1809 | /* add attributes here, update the policy in nl80211.c */ |
1805 | 1810 | ||
1806 | __NL80211_ATTR_AFTER_LAST, | 1811 | __NL80211_ATTR_AFTER_LAST, |
@@ -3901,4 +3906,15 @@ enum nl80211_crit_proto_id { | |||
3901 | /* maximum duration for critical protocol measures */ | 3906 | /* maximum duration for critical protocol measures */ |
3902 | #define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */ | 3907 | #define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */ |
3903 | 3908 | ||
3909 | /** | ||
3910 | * enum nl80211_rxmgmt_flags - flags for received management frame. | ||
3911 | * | ||
3912 | * Used by cfg80211_rx_mgmt() | ||
3913 | * | ||
3914 | * @NL80211_RXMGMT_FLAG_ANSWERED: frame was answered by device/driver. | ||
3915 | */ | ||
3916 | enum nl80211_rxmgmt_flags { | ||
3917 | NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0, | ||
3918 | }; | ||
3919 | |||
3904 | #endif /* __LINUX_NL80211_H */ | 3920 | #endif /* __LINUX_NL80211_H */ |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index ffad155316a9..07901050812f 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -2678,8 +2678,7 @@ ieee80211_rx_h_userspace_mgmt(struct ieee80211_rx_data *rx) | |||
2678 | sig = status->signal; | 2678 | sig = status->signal; |
2679 | 2679 | ||
2680 | if (cfg80211_rx_mgmt(&rx->sdata->wdev, status->freq, sig, | 2680 | if (cfg80211_rx_mgmt(&rx->sdata->wdev, status->freq, sig, |
2681 | rx->skb->data, rx->skb->len, | 2681 | rx->skb->data, rx->skb->len, 0, GFP_ATOMIC)) { |
2682 | GFP_ATOMIC)) { | ||
2683 | if (rx->sta) | 2682 | if (rx->sta) |
2684 | rx->sta->rx_packets++; | 2683 | rx->sta->rx_packets++; |
2685 | dev_kfree_skb(rx->skb); | 2684 | dev_kfree_skb(rx->skb); |
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index bfac5e186f57..8d49c1ce3dea 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c | |||
@@ -621,7 +621,7 @@ int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev, | |||
621 | } | 621 | } |
622 | 622 | ||
623 | bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm, | 623 | bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm, |
624 | const u8 *buf, size_t len, gfp_t gfp) | 624 | const u8 *buf, size_t len, u32 flags, gfp_t gfp) |
625 | { | 625 | { |
626 | struct wiphy *wiphy = wdev->wiphy; | 626 | struct wiphy *wiphy = wdev->wiphy; |
627 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 627 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
@@ -664,7 +664,7 @@ bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm, | |||
664 | /* Indicate the received Action frame to user space */ | 664 | /* Indicate the received Action frame to user space */ |
665 | if (nl80211_send_mgmt(rdev, wdev, reg->nlportid, | 665 | if (nl80211_send_mgmt(rdev, wdev, reg->nlportid, |
666 | freq, sig_mbm, | 666 | freq, sig_mbm, |
667 | buf, len, gfp)) | 667 | buf, len, flags, gfp)) |
668 | continue; | 668 | continue; |
669 | 669 | ||
670 | result = true; | 670 | result = true; |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 334697de5cc0..a51269d2d488 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -10446,7 +10446,7 @@ EXPORT_SYMBOL(cfg80211_rx_unexpected_4addr_frame); | |||
10446 | int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, | 10446 | int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, |
10447 | struct wireless_dev *wdev, u32 nlportid, | 10447 | struct wireless_dev *wdev, u32 nlportid, |
10448 | int freq, int sig_dbm, | 10448 | int freq, int sig_dbm, |
10449 | const u8 *buf, size_t len, gfp_t gfp) | 10449 | const u8 *buf, size_t len, u32 flags, gfp_t gfp) |
10450 | { | 10450 | { |
10451 | struct net_device *netdev = wdev->netdev; | 10451 | struct net_device *netdev = wdev->netdev; |
10452 | struct sk_buff *msg; | 10452 | struct sk_buff *msg; |
@@ -10469,7 +10469,9 @@ int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, | |||
10469 | nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq) || | 10469 | nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq) || |
10470 | (sig_dbm && | 10470 | (sig_dbm && |
10471 | nla_put_u32(msg, NL80211_ATTR_RX_SIGNAL_DBM, sig_dbm)) || | 10471 | nla_put_u32(msg, NL80211_ATTR_RX_SIGNAL_DBM, sig_dbm)) || |
10472 | nla_put(msg, NL80211_ATTR_FRAME, len, buf)) | 10472 | nla_put(msg, NL80211_ATTR_FRAME, len, buf) || |
10473 | (flags && | ||
10474 | nla_put_u32(msg, NL80211_ATTR_RXMGMT_FLAGS, flags))) | ||
10473 | goto nla_put_failure; | 10475 | goto nla_put_failure; |
10474 | 10476 | ||
10475 | genlmsg_end(msg, hdr); | 10477 | genlmsg_end(msg, hdr); |
diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h index 44341bf53cfc..2c0f2b3c07cb 100644 --- a/net/wireless/nl80211.h +++ b/net/wireless/nl80211.h | |||
@@ -66,7 +66,7 @@ void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev, | |||
66 | int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, | 66 | int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, |
67 | struct wireless_dev *wdev, u32 nlpid, | 67 | struct wireless_dev *wdev, u32 nlpid, |
68 | int freq, int sig_dbm, | 68 | int freq, int sig_dbm, |
69 | const u8 *buf, size_t len, gfp_t gfp); | 69 | const u8 *buf, size_t len, u32 flags, gfp_t gfp); |
70 | 70 | ||
71 | void | 71 | void |
72 | nl80211_radar_notify(struct cfg80211_registered_device *rdev, | 72 | nl80211_radar_notify(struct cfg80211_registered_device *rdev, |