diff options
author | Jouni Malinen <jouni.malinen@atheros.com> | 2009-03-19 07:39:21 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-03-27 20:13:02 -0400 |
commit | 6039f6d23fe792d615da5449e9fa1c6b43caacf6 (patch) | |
tree | af94d1ad78ce1e82d76328ea9a67b351f0a9174b /include | |
parent | a299542e97ec1939fdca7db6d3d82c0aa9bf8b9a (diff) |
nl80211: Event notifications for MLME events
Add new nl80211 event notifications (and a new multicast group, "mlme")
for informing user space about received and processed Authentication,
(Re)Association Response, Deauthentication, and Disassociation frames in
station and IBSS modes (i.e., MLME SAP interface primitives
MLME-AUTHENTICATE.confirm, MLME-ASSOCIATE.confirm,
MLME-REASSOCIATE.confirm, MLME-DEAUTHENTICATE.indicate, and
MLME-DISASSOCIATE.indication). The event data is encapsulated as the 802.11
management frame since we already have the frame in that format and it
includes all the needed information.
This is the initial step in providing MLME SAP interface for
authentication and association with nl80211. In other words, kernel code
will act as the MLME and a user space application can control it as the
SME.
Signed-off-by: Jouni Malinen <j@w1.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nl80211.h | 36 | ||||
-rw-r--r-- | include/net/cfg80211.h | 46 |
2 files changed, 81 insertions, 1 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 3700d927e245..5ce68ae8314e 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -161,6 +161,25 @@ | |||
161 | * %NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on | 161 | * %NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on |
162 | * to (%NL80211_ATTR_REG_ALPHA2). | 162 | * to (%NL80211_ATTR_REG_ALPHA2). |
163 | * | 163 | * |
164 | * @NL80211_CMD_AUTHENTICATE: authentication notification (on the "mlme" | ||
165 | * multicast group). This event reports reception of an Authentication | ||
166 | * frame in station and IBSS modes when the local MLME processed the | ||
167 | * frame, i.e., it was for the local STA and was received in correct | ||
168 | * state. This is similar to MLME-AUTHENTICATE.confirm primitive in the | ||
169 | * MLME SAP interface (kernel providing MLME, userspace SME). The | ||
170 | * included NL80211_ATTR_FRAME attribute contains the management frame | ||
171 | * (including both the header and frame body, but not FCS). | ||
172 | * @NL80211_CMD_ASSOCIATE: association notification; like | ||
173 | * NL80211_CMD_AUTHENTICATE but for Association Response and Reassociation | ||
174 | * Response frames (similar to MLME-ASSOCIATE.confirm or | ||
175 | * MLME-REASSOCIATE.confirm primitives). | ||
176 | * @NL80211_CMD_DEAUTHENTICATE: deauthentication notification; like | ||
177 | * NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to | ||
178 | * MLME-DEAUTHENTICATE.indication primitive). | ||
179 | * @NL80211_CMD_DISASSOCIATE: disassociation notification; like | ||
180 | * NL80211_CMD_AUTHENTICATE but for Disassociation frames (similar to | ||
181 | * MLME-DISASSOCIATE.indication primitive). | ||
182 | * | ||
164 | * @NL80211_CMD_MAX: highest used command number | 183 | * @NL80211_CMD_MAX: highest used command number |
165 | * @__NL80211_CMD_AFTER_LAST: internal use | 184 | * @__NL80211_CMD_AFTER_LAST: internal use |
166 | */ | 185 | */ |
@@ -217,6 +236,11 @@ enum nl80211_commands { | |||
217 | 236 | ||
218 | NL80211_CMD_REG_CHANGE, | 237 | NL80211_CMD_REG_CHANGE, |
219 | 238 | ||
239 | NL80211_CMD_AUTHENTICATE, | ||
240 | NL80211_CMD_ASSOCIATE, | ||
241 | NL80211_CMD_DEAUTHENTICATE, | ||
242 | NL80211_CMD_DISASSOCIATE, | ||
243 | |||
220 | /* add new commands above here */ | 244 | /* add new commands above here */ |
221 | 245 | ||
222 | /* used to define NL80211_CMD_MAX below */ | 246 | /* used to define NL80211_CMD_MAX below */ |
@@ -230,8 +254,11 @@ enum nl80211_commands { | |||
230 | */ | 254 | */ |
231 | #define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS | 255 | #define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS |
232 | #define NL80211_CMD_SET_MGMT_EXTRA_IE NL80211_CMD_SET_MGMT_EXTRA_IE | 256 | #define NL80211_CMD_SET_MGMT_EXTRA_IE NL80211_CMD_SET_MGMT_EXTRA_IE |
233 | |||
234 | #define NL80211_CMD_REG_CHANGE NL80211_CMD_REG_CHANGE | 257 | #define NL80211_CMD_REG_CHANGE NL80211_CMD_REG_CHANGE |
258 | #define NL80211_CMD_AUTHENTICATE NL80211_CMD_AUTHENTICATE | ||
259 | #define NL80211_CMD_ASSOCIATE NL80211_CMD_ASSOCIATE | ||
260 | #define NL80211_CMD_DEAUTHENTICATE NL80211_CMD_DEAUTHENTICATE | ||
261 | #define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE | ||
235 | 262 | ||
236 | /** | 263 | /** |
237 | * enum nl80211_attrs - nl80211 netlink attributes | 264 | * enum nl80211_attrs - nl80211 netlink attributes |
@@ -353,6 +380,10 @@ enum nl80211_commands { | |||
353 | * an array of command numbers (i.e. a mapping index to command number) | 380 | * an array of command numbers (i.e. a mapping index to command number) |
354 | * that the driver for the given wiphy supports. | 381 | * that the driver for the given wiphy supports. |
355 | * | 382 | * |
383 | * @NL80211_ATTR_FRAME: frame data (binary attribute), including frame header | ||
384 | * and body, but not FCS; used, e.g., with NL80211_CMD_AUTHENTICATE and | ||
385 | * NL80211_CMD_ASSOCIATE events | ||
386 | * | ||
356 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 387 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
357 | * @__NL80211_ATTR_AFTER_LAST: internal use | 388 | * @__NL80211_ATTR_AFTER_LAST: internal use |
358 | */ | 389 | */ |
@@ -432,6 +463,8 @@ enum nl80211_attrs { | |||
432 | 463 | ||
433 | NL80211_ATTR_SUPPORTED_COMMANDS, | 464 | NL80211_ATTR_SUPPORTED_COMMANDS, |
434 | 465 | ||
466 | NL80211_ATTR_FRAME, | ||
467 | |||
435 | /* add attributes here, update the policy in nl80211.c */ | 468 | /* add attributes here, update the policy in nl80211.c */ |
436 | 469 | ||
437 | __NL80211_ATTR_AFTER_LAST, | 470 | __NL80211_ATTR_AFTER_LAST, |
@@ -451,6 +484,7 @@ enum nl80211_attrs { | |||
451 | #define NL80211_ATTR_IE NL80211_ATTR_IE | 484 | #define NL80211_ATTR_IE NL80211_ATTR_IE |
452 | #define NL80211_ATTR_REG_INITIATOR NL80211_ATTR_REG_INITIATOR | 485 | #define NL80211_ATTR_REG_INITIATOR NL80211_ATTR_REG_INITIATOR |
453 | #define NL80211_ATTR_REG_TYPE NL80211_ATTR_REG_TYPE | 486 | #define NL80211_ATTR_REG_TYPE NL80211_ATTR_REG_TYPE |
487 | #define NL80211_ATTR_FRAME NL80211_ATTR_FRAME | ||
454 | 488 | ||
455 | #define NL80211_MAX_SUPP_RATES 32 | 489 | #define NL80211_MAX_SUPP_RATES 32 |
456 | #define NL80211_MAX_SUPP_REG_RULES 32 | 490 | #define NL80211_MAX_SUPP_REG_RULES 32 |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 50f3fd9ff524..ad44016021b1 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -807,4 +807,50 @@ void cfg80211_put_bss(struct cfg80211_bss *bss); | |||
807 | */ | 807 | */ |
808 | void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); | 808 | void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); |
809 | 809 | ||
810 | /** | ||
811 | * cfg80211_send_rx_auth - notification of processed authentication | ||
812 | * @dev: network device | ||
813 | * @buf: authentication frame (header + body) | ||
814 | * @len: length of the frame data | ||
815 | * | ||
816 | * This function is called whenever an authentication has been processed in | ||
817 | * station mode. | ||
818 | */ | ||
819 | void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len); | ||
820 | |||
821 | /** | ||
822 | * cfg80211_send_rx_assoc - notification of processed association | ||
823 | * @dev: network device | ||
824 | * @buf: (re)association response frame (header + body) | ||
825 | * @len: length of the frame data | ||
826 | * | ||
827 | * This function is called whenever a (re)association response has been | ||
828 | * processed in station mode. | ||
829 | */ | ||
830 | void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len); | ||
831 | |||
832 | /** | ||
833 | * cfg80211_send_rx_deauth - notification of processed deauthentication | ||
834 | * @dev: network device | ||
835 | * @buf: deauthentication frame (header + body) | ||
836 | * @len: length of the frame data | ||
837 | * | ||
838 | * This function is called whenever deauthentication has been processed in | ||
839 | * station mode. | ||
840 | */ | ||
841 | void cfg80211_send_rx_deauth(struct net_device *dev, const u8 *buf, | ||
842 | size_t len); | ||
843 | |||
844 | /** | ||
845 | * cfg80211_send_rx_disassoc - notification of processed disassociation | ||
846 | * @dev: network device | ||
847 | * @buf: disassociation response frame (header + body) | ||
848 | * @len: length of the frame data | ||
849 | * | ||
850 | * This function is called whenever disassociation has been processed in | ||
851 | * station mode. | ||
852 | */ | ||
853 | void cfg80211_send_rx_disassoc(struct net_device *dev, const u8 *buf, | ||
854 | size_t len); | ||
855 | |||
810 | #endif /* __NET_CFG80211_H */ | 856 | #endif /* __NET_CFG80211_H */ |