linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211/nl80211: Send AssocReq IEs to user space in AP mode
@ 2011-08-08  9:11 Jouni Malinen
  2011-08-08  9:22 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Jouni Malinen @ 2011-08-08  9:11 UTC (permalink / raw)
  To: John W. Linville, Johannes Berg; +Cc: linux-wireless

When user space SME/MLME (e.g., hostapd) is not used in AP mode, the
IEs from the (Re)Association Request frame that was processed in
firmware need to be made available for user space (e.g., RSN IE for
hostapd). Allow this to be done with cfg80211_new_sta().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
---
 include/net/cfg80211.h |    8 ++++++++
 net/wireless/nl80211.c |    4 ++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d17f47f..51ba1af 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -536,6 +536,11 @@ struct sta_bss_parameters {
  *	This number should increase every time the list of stations
  *	changes, i.e. when a station is added or removed, so that
  *	userspace can tell whether it got a consistent snapshot.
+ * @assoc_req_ies: IEs from (Re)Association Request.
+ *	This is used only when in AP mode with drivers that do not use
+ *	user space MLME/SME implementation. The information is provided for
+ *	the cfg80211_new_sta() calls to notify user space of the IEs.
+ * @assoc_req_ies_len: Length of assoc_req_ies buffer in octets.
  */
 struct station_info {
 	u32 filled;
@@ -558,6 +563,9 @@ struct station_info {
 	struct sta_bss_parameters bss_param;
 
 	int generation;
+
+	const u8 *assoc_req_ies;
+	size_t assoc_req_ies_len;
 };
 
 /**
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index e83e7fe..ec8444e 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2237,6 +2237,10 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
 	}
 	nla_nest_end(msg, sinfoattr);
 
+	if (sinfo->assoc_req_ies)
+		NLA_PUT(msg, NL80211_ATTR_IE, sinfo->assoc_req_ies_len,
+			sinfo->assoc_req_ies);
+
 	return genlmsg_end(msg, hdr);
 
  nla_put_failure:
-- 
1.7.4.1


-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cfg80211/nl80211: Send AssocReq IEs to user space in AP mode
  2011-08-08  9:11 [PATCH] cfg80211/nl80211: Send AssocReq IEs to user space in AP mode Jouni Malinen
@ 2011-08-08  9:22 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2011-08-08  9:22 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: John W. Linville, linux-wireless

On Mon, 2011-08-08 at 12:11 +0300, Jouni Malinen wrote:
> When user space SME/MLME (e.g., hostapd) is not used in AP mode, the
> IEs from the (Re)Association Request frame that was processed in
> firmware need to be made available for user space (e.g., RSN IE for
> hostapd). Allow this to be done with cfg80211_new_sta().

Acked-by: Johannes Berg <johannes@sipsolutions.net>

> Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
> ---
>  include/net/cfg80211.h |    8 ++++++++
>  net/wireless/nl80211.c |    4 ++++
>  2 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index d17f47f..51ba1af 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -536,6 +536,11 @@ struct sta_bss_parameters {
>   *	This number should increase every time the list of stations
>   *	changes, i.e. when a station is added or removed, so that
>   *	userspace can tell whether it got a consistent snapshot.
> + * @assoc_req_ies: IEs from (Re)Association Request.
> + *	This is used only when in AP mode with drivers that do not use
> + *	user space MLME/SME implementation. The information is provided for
> + *	the cfg80211_new_sta() calls to notify user space of the IEs.
> + * @assoc_req_ies_len: Length of assoc_req_ies buffer in octets.
>   */
>  struct station_info {
>  	u32 filled;
> @@ -558,6 +563,9 @@ struct station_info {
>  	struct sta_bss_parameters bss_param;
>  
>  	int generation;
> +
> +	const u8 *assoc_req_ies;
> +	size_t assoc_req_ies_len;
>  };
>  
>  /**
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index e83e7fe..ec8444e 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -2237,6 +2237,10 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
>  	}
>  	nla_nest_end(msg, sinfoattr);
>  
> +	if (sinfo->assoc_req_ies)
> +		NLA_PUT(msg, NL80211_ATTR_IE, sinfo->assoc_req_ies_len,
> +			sinfo->assoc_req_ies);
> +
>  	return genlmsg_end(msg, hdr);
>  
>   nla_put_failure:
> -- 
> 1.7.4.1
> 
> 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-08  9:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-08  9:11 [PATCH] cfg80211/nl80211: Send AssocReq IEs to user space in AP mode Jouni Malinen
2011-08-08  9:22 ` Johannes Berg

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).