aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-08-12 09:38:38 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-24 16:27:56 -0400
commit2e161f78e5f63a7f9fd25a766bb7f816a01eb14a (patch)
treebefd44feeb1f47da1f41e6fc310a223ad67030ff /include/linux
parentac4c977d16d843f12901595c91773dddb65768a9 (diff)
cfg80211/mac80211: extensible frame processing
Allow userspace to register for more than just action frames by giving the frame subtype, and make it possible to use this in various modes as well. With some tweaks and some added functionality this will, in the future, also be usable in AP mode and be able to replace the cooked monitor interface currently used in that case. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nl80211.h93
1 files changed, 74 insertions, 19 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 2c8701687336..8af1e66c3cf9 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -40,6 +40,43 @@
40 */ 40 */
41 41
42/** 42/**
43 * DOC: Frame transmission/registration support
44 *
45 * Frame transmission and registration support exists to allow userspace
46 * management entities such as wpa_supplicant react to management frames
47 * that are not being handled by the kernel. This includes, for example,
48 * certain classes of action frames that cannot be handled in the kernel
49 * for various reasons.
50 *
51 * Frame registration is done on a per-interface basis and registrations
52 * cannot be removed other than by closing the socket. It is possible to
53 * specify a registration filter to register, for example, only for a
54 * certain type of action frame. In particular with action frames, those
55 * that userspace registers for will not be returned as unhandled by the
56 * driver, so that the registered application has to take responsibility
57 * for doing that.
58 *
59 * The type of frame that can be registered for is also dependent on the
60 * driver and interface type. The frame types are advertised in wiphy
61 * attributes so applications know what to expect.
62 *
63 * NOTE: When an interface changes type while registrations are active,
64 * these registrations are ignored until the interface type is
65 * changed again. This means that changing the interface type can
66 * lead to a situation that couldn't otherwise be produced, but
67 * any such registrations will be dormant in the sense that they
68 * will not be serviced, i.e. they will not receive any frames.
69 *
70 * Frame transmission allows userspace to send for example the required
71 * responses to action frames. It is subject to some sanity checking,
72 * but many frames can be transmitted. When a frame was transmitted, its
73 * status is indicated to the sending socket.
74 *
75 * For more technical details, see the corresponding command descriptions
76 * below.
77 */
78
79/**
43 * enum nl80211_commands - supported nl80211 commands 80 * enum nl80211_commands - supported nl80211 commands
44 * 81 *
45 * @NL80211_CMD_UNSPEC: unspecified command to catch errors 82 * @NL80211_CMD_UNSPEC: unspecified command to catch errors
@@ -301,16 +338,18 @@
301 * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface 338 * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface
302 * and @NL80211_ATTR_TX_RATES the set of allowed rates. 339 * and @NL80211_ATTR_TX_RATES the set of allowed rates.
303 * 340 *
304 * @NL80211_CMD_REGISTER_ACTION: Register for receiving certain action frames 341 * @NL80211_CMD_REGISTER_FRAME: Register for receiving certain mgmt frames
305 * (via @NL80211_CMD_ACTION) for processing in userspace. This command 342 * (via @NL80211_CMD_FRAME) for processing in userspace. This command
306 * requires an interface index and a match attribute containing the first 343 * requires an interface index, a frame type attribute (optional for
307 * few bytes of the frame that should match, e.g. a single byte for only 344 * backward compatibility reasons, if not given assumes action frames)
308 * a category match or four bytes for vendor frames including the OUI. 345 * and a match attribute containing the first few bytes of the frame
309 * The registration cannot be dropped, but is removed automatically 346 * that should match, e.g. a single byte for only a category match or
310 * when the netlink socket is closed. Multiple registrations can be made. 347 * four bytes for vendor frames including the OUI. The registration
311 * @NL80211_CMD_ACTION: Action frame TX request and RX notification. This 348 * cannot be dropped, but is removed automatically when the netlink
312 * command is used both as a request to transmit an Action frame and as an 349 * socket is closed. Multiple registrations can be made.
313 * event indicating reception of an Action frame that was not processed in 350 * @NL80211_CMD_FRAME: Management frame TX request and RX notification. This
351 * command is used both as a request to transmit a management frame and
352 * as an event indicating reception of a frame that was not processed in
314 * kernel code, but is for us (i.e., which may need to be processed in a 353 * kernel code, but is for us (i.e., which may need to be processed in a
315 * user space application). %NL80211_ATTR_FRAME is used to specify the 354 * user space application). %NL80211_ATTR_FRAME is used to specify the
316 * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and 355 * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and
@@ -320,8 +359,8 @@
320 * operational channel). When called, this operation returns a cookie 359 * operational channel). When called, this operation returns a cookie
321 * (%NL80211_ATTR_COOKIE) that will be included with the TX status event 360 * (%NL80211_ATTR_COOKIE) that will be included with the TX status event
322 * pertaining to the TX request. 361 * pertaining to the TX request.
323 * @NL80211_CMD_ACTION_TX_STATUS: Report TX status of an Action frame 362 * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame
324 * transmitted with %NL80211_CMD_ACTION. %NL80211_ATTR_COOKIE identifies 363 * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
325 * the TX command and %NL80211_ATTR_FRAME includes the contents of the 364 * the TX command and %NL80211_ATTR_FRAME includes the contents of the
326 * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged 365 * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
327 * the frame. 366 * the frame.
@@ -429,9 +468,12 @@ enum nl80211_commands {
429 468
430 NL80211_CMD_SET_TX_BITRATE_MASK, 469 NL80211_CMD_SET_TX_BITRATE_MASK,
431 470
432 NL80211_CMD_REGISTER_ACTION, 471 NL80211_CMD_REGISTER_FRAME,
433 NL80211_CMD_ACTION, 472 NL80211_CMD_REGISTER_ACTION = NL80211_CMD_REGISTER_FRAME,
434 NL80211_CMD_ACTION_TX_STATUS, 473 NL80211_CMD_FRAME,
474 NL80211_CMD_ACTION = NL80211_CMD_FRAME,
475 NL80211_CMD_FRAME_TX_STATUS,
476 NL80211_CMD_ACTION_TX_STATUS = NL80211_CMD_FRAME_TX_STATUS,
435 477
436 NL80211_CMD_SET_POWER_SAVE, 478 NL80211_CMD_SET_POWER_SAVE,
437 NL80211_CMD_GET_POWER_SAVE, 479 NL80211_CMD_GET_POWER_SAVE,
@@ -708,7 +750,16 @@ enum nl80211_commands {
708 * is used with %NL80211_CMD_SET_TX_BITRATE_MASK. 750 * is used with %NL80211_CMD_SET_TX_BITRATE_MASK.
709 * 751 *
710 * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain 752 * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
711 * at least one byte, currently used with @NL80211_CMD_REGISTER_ACTION. 753 * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
754 * @NL80211_ATTR_FRAME_TYPE: A u16 indicating the frame type/subtype for the
755 * @NL80211_CMD_REGISTER_FRAME command.
756 * @NL80211_ATTR_TX_FRAME_TYPES: wiphy capability attribute, which is a
757 * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
758 * information about which frame types can be transmitted with
759 * %NL80211_CMD_FRAME.
760 * @NL80211_ATTR_RX_FRAME_TYPES: wiphy capability attribute, which is a
761 * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
762 * information about which frame types can be registered for RX.
712 * 763 *
713 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was 764 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
714 * acknowledged by the recipient. 765 * acknowledged by the recipient.
@@ -891,6 +942,10 @@ enum nl80211_attrs {
891 NL80211_ATTR_WIPHY_TX_POWER_SETTING, 942 NL80211_ATTR_WIPHY_TX_POWER_SETTING,
892 NL80211_ATTR_WIPHY_TX_POWER_LEVEL, 943 NL80211_ATTR_WIPHY_TX_POWER_LEVEL,
893 944
945 NL80211_ATTR_TX_FRAME_TYPES,
946 NL80211_ATTR_RX_FRAME_TYPES,
947 NL80211_ATTR_FRAME_TYPE,
948
894 /* add attributes here, update the policy in nl80211.c */ 949 /* add attributes here, update the policy in nl80211.c */
895 950
896 __NL80211_ATTR_AFTER_LAST, 951 __NL80211_ATTR_AFTER_LAST,
@@ -947,7 +1002,7 @@ enum nl80211_attrs {
947 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames 1002 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
948 * @NL80211_IFTYPE_MESH_POINT: mesh point 1003 * @NL80211_IFTYPE_MESH_POINT: mesh point
949 * @NL80211_IFTYPE_MAX: highest interface type number currently defined 1004 * @NL80211_IFTYPE_MAX: highest interface type number currently defined
950 * @__NL80211_IFTYPE_AFTER_LAST: internal use 1005 * @NUM_NL80211_IFTYPES: number of defined interface types
951 * 1006 *
952 * These values are used with the %NL80211_ATTR_IFTYPE 1007 * These values are used with the %NL80211_ATTR_IFTYPE
953 * to set the type of an interface. 1008 * to set the type of an interface.
@@ -964,8 +1019,8 @@ enum nl80211_iftype {
964 NL80211_IFTYPE_MESH_POINT, 1019 NL80211_IFTYPE_MESH_POINT,
965 1020
966 /* keep last */ 1021 /* keep last */
967 __NL80211_IFTYPE_AFTER_LAST, 1022 NUM_NL80211_IFTYPES,
968 NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1 1023 NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1
969}; 1024};
970 1025
971/** 1026/**