cfg80211/nl80211: Send AssocReq IEs to user space in AP mode
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 8 Aug 2011 09:11:52 +0000 (12:11 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 10 Aug 2011 18:07:42 +0000 (14:07 -0400)
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>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
include/net/cfg80211.h
net/wireless/nl80211.c

index 44e72cc13055497d289992053bb84aede2bb39e0..779e3008df4dc668ef50bf8249c161bc873ebfd3 100644 (file)
@@ -531,6 +531,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;
@@ -553,6 +558,9 @@ struct station_info {
        struct sta_bss_parameters bss_param;
 
        int generation;
+
+       const u8 *assoc_req_ies;
+       size_t assoc_req_ies_len;
 };
 
 /**
index 3b5dc9186071830d9498b46cc3e760a74666255c..ca76977010768a4bd61e53cd710c668cf6992572 100644 (file)
@@ -2236,6 +2236,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:
This page took 0.035646 seconds and 5 git commands to generate.