diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2011-09-21 09:57:29 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2011-09-22 03:40:40 -0400 |
commit | 865121361f0be55555c540c3df444ed06e090b33 (patch) | |
tree | 20335007b645313e41b11fb4743e5672d33363bd | |
parent | 011a36e1193c02abcdc4853be09275a0fe9d1a32 (diff) |
ath6kl: Report PMKSA candidate events through cfg80211
This allows RSN pre-authentication to be used when roaming decisions are
done in the target.
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/wmi.c | 30 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/wmi.h | 10 |
2 files changed, 40 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index b90d116c018c..47fbb8e7686b 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c | |||
@@ -1097,6 +1097,35 @@ static int ath6kl_wmi_scan_complete_rx(struct wmi *wmi, u8 *datap, int len) | |||
1097 | return 0; | 1097 | return 0; |
1098 | } | 1098 | } |
1099 | 1099 | ||
1100 | static int ath6kl_wmi_neighbor_report_event_rx(struct wmi *wmi, u8 *datap, | ||
1101 | int len) | ||
1102 | { | ||
1103 | struct wmi_neighbor_report_event *ev; | ||
1104 | u8 i; | ||
1105 | |||
1106 | if (len < sizeof(*ev)) | ||
1107 | return -EINVAL; | ||
1108 | ev = (struct wmi_neighbor_report_event *) datap; | ||
1109 | if (sizeof(*ev) + ev->num_neighbors * sizeof(struct wmi_neighbor_info) | ||
1110 | > len) { | ||
1111 | ath6kl_dbg(ATH6KL_DBG_WMI, "truncated neighbor event " | ||
1112 | "(num=%d len=%d)\n", ev->num_neighbors, len); | ||
1113 | return -EINVAL; | ||
1114 | } | ||
1115 | for (i = 0; i < ev->num_neighbors; i++) { | ||
1116 | ath6kl_dbg(ATH6KL_DBG_WMI, "neighbor %d/%d - %pM 0x%x\n", | ||
1117 | i + 1, ev->num_neighbors, ev->neighbor[i].bssid, | ||
1118 | ev->neighbor[i].bss_flags); | ||
1119 | cfg80211_pmksa_candidate_notify(wmi->parent_dev->net_dev, i, | ||
1120 | ev->neighbor[i].bssid, | ||
1121 | !!(ev->neighbor[i].bss_flags & | ||
1122 | WMI_PREAUTH_CAPABLE_BSS), | ||
1123 | GFP_ATOMIC); | ||
1124 | } | ||
1125 | |||
1126 | return 0; | ||
1127 | } | ||
1128 | |||
1100 | /* | 1129 | /* |
1101 | * Target is reporting a programming error. This is for | 1130 | * Target is reporting a programming error. This is for |
1102 | * developer aid only. Target only checks a few common violations | 1131 | * developer aid only. Target only checks a few common violations |
@@ -2870,6 +2899,7 @@ int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb) | |||
2870 | break; | 2899 | break; |
2871 | case WMI_NEIGHBOR_REPORT_EVENTID: | 2900 | case WMI_NEIGHBOR_REPORT_EVENTID: |
2872 | ath6kl_dbg(ATH6KL_DBG_WMI, "WMI_NEIGHBOR_REPORT_EVENTID\n"); | 2901 | ath6kl_dbg(ATH6KL_DBG_WMI, "WMI_NEIGHBOR_REPORT_EVENTID\n"); |
2902 | ret = ath6kl_wmi_neighbor_report_event_rx(wmi, datap, len); | ||
2873 | break; | 2903 | break; |
2874 | case WMI_SCAN_COMPLETE_EVENTID: | 2904 | case WMI_SCAN_COMPLETE_EVENTID: |
2875 | ath6kl_dbg(ATH6KL_DBG_WMI, "WMI_SCAN_COMPLETE_EVENTID\n"); | 2905 | ath6kl_dbg(ATH6KL_DBG_WMI, "WMI_SCAN_COMPLETE_EVENTID\n"); |
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h index d458d6d3a27f..f8e644d54aa7 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.h +++ b/drivers/net/wireless/ath/ath6kl/wmi.h | |||
@@ -1439,6 +1439,16 @@ enum wmi_bss_flags { | |||
1439 | WMI_PMKID_VALID_BSS = 0x02, | 1439 | WMI_PMKID_VALID_BSS = 0x02, |
1440 | }; | 1440 | }; |
1441 | 1441 | ||
1442 | struct wmi_neighbor_info { | ||
1443 | u8 bssid[ETH_ALEN]; | ||
1444 | u8 bss_flags; /* enum wmi_bss_flags */ | ||
1445 | } __packed; | ||
1446 | |||
1447 | struct wmi_neighbor_report_event { | ||
1448 | u8 num_neighbors; | ||
1449 | struct wmi_neighbor_info neighbor[0]; | ||
1450 | } __packed; | ||
1451 | |||
1442 | /* TKIP MIC Error Event */ | 1452 | /* TKIP MIC Error Event */ |
1443 | struct wmi_tkip_micerr_event { | 1453 | struct wmi_tkip_micerr_event { |
1444 | u8 key_id; | 1454 | u8 key_id; |