diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2011-08-30 14:58:01 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2011-08-31 03:13:01 -0400 |
commit | ae32c30a6ec991088e5346036015be1a9f9cf14b (patch) | |
tree | bea48ec3c2185b99732b7316e094f75805dc95ad | |
parent | 1276c9ef6db2bc856579bc7f02e4cc710b089f0d (diff) |
ath6kl: Report received Probe Request frames to cfg80211
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.c | 19 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/init.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/wmi.c | 20 |
4 files changed, 43 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 78b178892ede..60339598ad25 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c | |||
@@ -1740,6 +1740,24 @@ static int ath6kl_mgmt_tx(struct wiphy *wiphy, struct net_device *dev, | |||
1740 | buf, len); | 1740 | buf, len); |
1741 | } | 1741 | } |
1742 | 1742 | ||
1743 | static void ath6kl_mgmt_frame_register(struct wiphy *wiphy, | ||
1744 | struct net_device *dev, | ||
1745 | u16 frame_type, bool reg) | ||
1746 | { | ||
1747 | struct ath6kl *ar = ath6kl_priv(dev); | ||
1748 | |||
1749 | ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: frame_type=0x%x reg=%d\n", | ||
1750 | __func__, frame_type, reg); | ||
1751 | if (frame_type == IEEE80211_STYPE_PROBE_REQ) { | ||
1752 | /* | ||
1753 | * Note: This notification callback is not allowed to sleep, so | ||
1754 | * we cannot send WMI_PROBE_REQ_REPORT_CMD here. Instead, we | ||
1755 | * hardcode target to report Probe Request frames all the time. | ||
1756 | */ | ||
1757 | ar->probe_req_report = reg; | ||
1758 | } | ||
1759 | } | ||
1760 | |||
1743 | static struct cfg80211_ops ath6kl_cfg80211_ops = { | 1761 | static struct cfg80211_ops ath6kl_cfg80211_ops = { |
1744 | .change_virtual_intf = ath6kl_cfg80211_change_iface, | 1762 | .change_virtual_intf = ath6kl_cfg80211_change_iface, |
1745 | .scan = ath6kl_cfg80211_scan, | 1763 | .scan = ath6kl_cfg80211_scan, |
@@ -1770,6 +1788,7 @@ static struct cfg80211_ops ath6kl_cfg80211_ops = { | |||
1770 | .remain_on_channel = ath6kl_remain_on_channel, | 1788 | .remain_on_channel = ath6kl_remain_on_channel, |
1771 | .cancel_remain_on_channel = ath6kl_cancel_remain_on_channel, | 1789 | .cancel_remain_on_channel = ath6kl_cancel_remain_on_channel, |
1772 | .mgmt_tx = ath6kl_mgmt_tx, | 1790 | .mgmt_tx = ath6kl_mgmt_tx, |
1791 | .mgmt_frame_register = ath6kl_mgmt_frame_register, | ||
1773 | }; | 1792 | }; |
1774 | 1793 | ||
1775 | struct wireless_dev *ath6kl_cfg80211_init(struct device *dev) | 1794 | struct wireless_dev *ath6kl_cfg80211_init(struct device *dev) |
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h index 3872edbe0597..99cabd251caf 100644 --- a/drivers/net/wireless/ath/ath6kl/core.h +++ b/drivers/net/wireless/ath/ath6kl/core.h | |||
@@ -457,6 +457,7 @@ struct ath6kl { | |||
457 | struct dentry *debugfs_phy; | 457 | struct dentry *debugfs_phy; |
458 | 458 | ||
459 | u32 send_action_id; | 459 | u32 send_action_id; |
460 | bool probe_req_report; | ||
460 | u16 next_chan; | 461 | u16 next_chan; |
461 | }; | 462 | }; |
462 | 463 | ||
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index 48c82e9561bf..3b99ae2dfb18 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c | |||
@@ -471,6 +471,13 @@ static int ath6kl_target_config_wlan_params(struct ath6kl *ar) | |||
471 | ret); | 471 | ret); |
472 | } | 472 | } |
473 | 473 | ||
474 | /* Enable Probe Request reporting for P2P */ | ||
475 | ret = ath6kl_wmi_probe_report_req_cmd(ar->wmi, true); | ||
476 | if (ret) { | ||
477 | ath6kl_dbg(ATH6KL_DBG_TRC, "failed to enable Probe Request " | ||
478 | "reporting (%d)\n", ret); | ||
479 | } | ||
480 | |||
474 | return status; | 481 | return status; |
475 | } | 482 | } |
476 | 483 | ||
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index bbe3e8d214c8..9b2a1829776e 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c | |||
@@ -499,18 +499,30 @@ static int ath6kl_wmi_tx_status_event_rx(u8 *datap, int len) | |||
499 | return 0; | 499 | return 0; |
500 | } | 500 | } |
501 | 501 | ||
502 | static int ath6kl_wmi_rx_probe_req_event_rx(u8 *datap, int len) | 502 | static int ath6kl_wmi_rx_probe_req_event_rx(struct wmi *wmi, u8 *datap, int len) |
503 | { | 503 | { |
504 | struct wmi_p2p_rx_probe_req_event *ev; | 504 | struct wmi_p2p_rx_probe_req_event *ev; |
505 | u32 freq; | ||
505 | u16 dlen; | 506 | u16 dlen; |
507 | struct ath6kl *ar = wmi->parent_dev; | ||
506 | 508 | ||
507 | if (len < sizeof(*ev)) | 509 | if (len < sizeof(*ev)) |
508 | return -EINVAL; | 510 | return -EINVAL; |
509 | 511 | ||
510 | ev = (struct wmi_p2p_rx_probe_req_event *) datap; | 512 | ev = (struct wmi_p2p_rx_probe_req_event *) datap; |
513 | freq = le32_to_cpu(ev->freq); | ||
511 | dlen = le16_to_cpu(ev->len); | 514 | dlen = le16_to_cpu(ev->len); |
512 | ath6kl_dbg(ATH6KL_DBG_WMI, "rx_probe_req: len=%u\n", | 515 | if (datap + len < ev->data + dlen) { |
513 | dlen); | 516 | ath6kl_err("invalid wmi_p2p_rx_probe_req_event: " |
517 | "len=%d dlen=%u\n", len, dlen); | ||
518 | return -EINVAL; | ||
519 | } | ||
520 | ath6kl_dbg(ATH6KL_DBG_WMI, "rx_probe_req: len=%u freq=%u " | ||
521 | "probe_req_report=%d\n", | ||
522 | dlen, freq, ar->probe_req_report); | ||
523 | |||
524 | if (ar->probe_req_report || ar->nw_type == AP_NETWORK) | ||
525 | cfg80211_rx_mgmt(ar->net_dev, freq, ev->data, dlen, GFP_ATOMIC); | ||
514 | 526 | ||
515 | return 0; | 527 | return 0; |
516 | } | 528 | } |
@@ -3045,7 +3057,7 @@ int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb) | |||
3045 | break; | 3057 | break; |
3046 | case WMI_RX_PROBE_REQ_EVENTID: | 3058 | case WMI_RX_PROBE_REQ_EVENTID: |
3047 | ath6kl_dbg(ATH6KL_DBG_WMI, "WMI_RX_PROBE_REQ_EVENTID\n"); | 3059 | ath6kl_dbg(ATH6KL_DBG_WMI, "WMI_RX_PROBE_REQ_EVENTID\n"); |
3048 | ret = ath6kl_wmi_rx_probe_req_event_rx(datap, len); | 3060 | ret = ath6kl_wmi_rx_probe_req_event_rx(wmi, datap, len); |
3049 | break; | 3061 | break; |
3050 | case WMI_P2P_CAPABILITIES_EVENTID: | 3062 | case WMI_P2P_CAPABILITIES_EVENTID: |
3051 | ath6kl_dbg(ATH6KL_DBG_WMI, "WMI_P2P_CAPABILITIES_EVENTID\n"); | 3063 | ath6kl_dbg(ATH6KL_DBG_WMI, "WMI_P2P_CAPABILITIES_EVENTID\n"); |