* [PATCH] ath6kl: Report PMKSA candidate events through cfg80211
@ 2011-09-21 13:57 Jouni Malinen
2011-09-22 7:45 ` Kalle Valo
2011-09-22 8:05 ` Kalle Valo
0 siblings, 2 replies; 3+ messages in thread
From: Jouni Malinen @ 2011-09-21 13:57 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless
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>
---
drivers/net/wireless/ath/ath6kl/wmi.c | 30 ++++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath6kl/wmi.h | 10 ++++++++++
2 files changed, 40 insertions(+), 0 deletions(-)
Please note that this depends on a recent change in wireless-testing.git
for cfg80211_pmksa_candidate_notify(). This commit
c9df56b48e4ff003eaebd680ec7a45342dcd03ea is not yet in ath6kl.git.
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index dbddb91..c3d91ba 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -1342,6 +1342,35 @@ static int ath6kl_wmi_scan_complete_rx(struct wmi *wmi, u8 *datap, int len)
return 0;
}
+static int ath6kl_wmi_neighbor_report_event_rx(struct wmi *wmi, u8 *datap,
+ int len)
+{
+ struct wmi_neighbor_report_event *ev;
+ u8 i;
+
+ if (len < sizeof(*ev))
+ return -EINVAL;
+ ev = (struct wmi_neighbor_report_event *) datap;
+ if (sizeof(*ev) + ev->num_neighbors * sizeof(struct wmi_neighbor_info)
+ > len) {
+ ath6kl_dbg(ATH6KL_DBG_WMI, "truncated neighbor event "
+ "(num=%d len=%d)\n", ev->num_neighbors, len);
+ return -EINVAL;
+ }
+ for (i = 0; i < ev->num_neighbors; i++) {
+ ath6kl_dbg(ATH6KL_DBG_WMI, "neighbor %d/%d - %pM 0x%x\n",
+ i + 1, ev->num_neighbors, ev->neighbor[i].bssid,
+ ev->neighbor[i].bss_flags);
+ cfg80211_pmksa_candidate_notify(wmi->parent_dev->net_dev, i,
+ ev->neighbor[i].bssid,
+ !!(ev->neighbor[i].bss_flags &
+ WMI_PREAUTH_CAPABLE_BSS),
+ GFP_ATOMIC);
+ }
+
+ return 0;
+}
+
/*
* Target is reporting a programming error. This is for
* developer aid only. Target only checks a few common violations
@@ -3153,6 +3182,7 @@ int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb)
break;
case WMI_NEIGHBOR_REPORT_EVENTID:
ath6kl_dbg(ATH6KL_DBG_WMI, "WMI_NEIGHBOR_REPORT_EVENTID\n");
+ ret = ath6kl_wmi_neighbor_report_event_rx(wmi, datap, len);
break;
case WMI_SCAN_COMPLETE_EVENTID:
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 f036e78..4c99a2e 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.h
+++ b/drivers/net/wireless/ath/ath6kl/wmi.h
@@ -1458,6 +1458,16 @@ enum wmi_bss_flags {
WMI_PMKID_VALID_BSS = 0x02,
};
+struct wmi_neighbor_info {
+ u8 bssid[ETH_ALEN];
+ u8 bss_flags; /* enum wmi_bss_flags */
+} __packed;
+
+struct wmi_neighbor_report_event {
+ u8 num_neighbors;
+ struct wmi_neighbor_info neighbor[0];
+} __packed;
+
/* TKIP MIC Error Event */
struct wmi_tkip_micerr_event {
u8 key_id;
--
1.7.4.1
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ath6kl: Report PMKSA candidate events through cfg80211
2011-09-21 13:57 [PATCH] ath6kl: Report PMKSA candidate events through cfg80211 Jouni Malinen
@ 2011-09-22 7:45 ` Kalle Valo
2011-09-22 8:05 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2011-09-22 7:45 UTC (permalink / raw)
To: Jouni Malinen; +Cc: linux-wireless
On 09/21/2011 04:57 PM, Jouni Malinen wrote:
> This allows RSN pre-authentication to be used when roaming decisions are
> done in the target.
Thanks, applied.
A cosmetic comment:
> + ath6kl_dbg(ATH6KL_DBG_WMI, "truncated neighbor event "
> + "(num=%d len=%d)\n", ev->num_neighbors, len);
It's preferred that the format string is all in one line like this
(sorry for thunderbird's formatting):
ath6kl_dbg(ATH6KL_DBG_WMI,
"truncated neighbor event (num=%d len=%d)\n",
ev->num_neighbors, len);
Latest checkpatch will allow lines over 80 chars when it's like this.
Kalle
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ath6kl: Report PMKSA candidate events through cfg80211
2011-09-21 13:57 [PATCH] ath6kl: Report PMKSA candidate events through cfg80211 Jouni Malinen
2011-09-22 7:45 ` Kalle Valo
@ 2011-09-22 8:05 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2011-09-22 8:05 UTC (permalink / raw)
To: Jouni Malinen; +Cc: linux-wireless, John W. Linville
On 09/21/2011 04:57 PM, Jouni Malinen wrote:
> 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>
> ---
> drivers/net/wireless/ath/ath6kl/wmi.c | 30 ++++++++++++++++++++++++++++++
> drivers/net/wireless/ath/ath6kl/wmi.h | 10 ++++++++++
> 2 files changed, 40 insertions(+), 0 deletions(-)
>
> Please note that this depends on a recent change in wireless-testing.git
> for cfg80211_pmksa_candidate_notify(). This commit
> c9df56b48e4ff003eaebd680ec7a45342dcd03ea is not yet in ath6kl.git.
Thanks for the warning, this is always good to know.
John, I merged latest wireless-next to ath6kl-next branch in ath6kl.git
to get the latest cfg80211 changes, I hope that's ok. Let's keep this in
mind when I send the next pull request and double check that I didn't
break anything.
Kalle
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-09-22 8:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-21 13:57 [PATCH] ath6kl: Report PMKSA candidate events through cfg80211 Jouni Malinen
2011-09-22 7:45 ` Kalle Valo
2011-09-22 8:05 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).