aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-11-13 07:37:47 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-12-03 10:27:17 -0500
commitad7e718c9b4f717823fd920a0103f7b0fb06183f (patch)
treecb87f5792da6330705586e232f8e39b46e188e26 /include/uapi/linux
parent7869303b17a3cc78c9e9f26544be98b5734ac97c (diff)
nl80211: vendor command support
Add support for vendor-specific commands to nl80211. This is intended to be used for really vendor-specific functionality that can't be implemented in a generic fashion for any reason. It's *NOT* intended to be used for any normal/generic feature or any optimisations that could be implemented across drivers. Currently, only vendor commands (with replies) are supported, no dump operations or vendor-specific notifications. Also add a function wdev_to_ieee80211_vif() to mac80211 which is needed for mac80211-based drivers wanting to implement any vendor commands. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/nl80211.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 9a4d0e18251c..72ba3584c90d 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -693,6 +693,15 @@
693 * other station that transmission must be blocked until the channel 693 * other station that transmission must be blocked until the channel
694 * switch is complete. 694 * switch is complete.
695 * 695 *
696 * @NL80211_CMD_VENDOR: Vendor-specified command/event. The command is specified
697 * by the %NL80211_ATTR_VENDOR_ID attribute and a sub-command in
698 * %NL80211_ATTR_VENDOR_SUBCMD. Parameter(s) can be transported in
699 * %NL80211_ATTR_VENDOR_DATA.
700 * For feature advertisement, the %NL80211_ATTR_VENDOR_DATA attribute is
701 * used in the wiphy data as a nested attribute containing descriptions
702 * (&struct nl80211_vendor_cmd_info) of the supported vendor commands.
703 * This may also be sent as an event with the same attributes.
704 *
696 * @NL80211_CMD_MAX: highest used command number 705 * @NL80211_CMD_MAX: highest used command number
697 * @__NL80211_CMD_AFTER_LAST: internal use 706 * @__NL80211_CMD_AFTER_LAST: internal use
698 */ 707 */
@@ -860,6 +869,8 @@ enum nl80211_commands {
860 869
861 NL80211_CMD_CHANNEL_SWITCH, 870 NL80211_CMD_CHANNEL_SWITCH,
862 871
872 NL80211_CMD_VENDOR,
873
863 /* add new commands above here */ 874 /* add new commands above here */
864 875
865 /* used to define NL80211_CMD_MAX below */ 876 /* used to define NL80211_CMD_MAX below */
@@ -1524,6 +1535,12 @@ enum nl80211_commands {
1524 * Notification Element based on association request when used with 1535 * Notification Element based on association request when used with
1525 * %NL80211_CMD_NEW_STATION; u8 attribute. 1536 * %NL80211_CMD_NEW_STATION; u8 attribute.
1526 * 1537 *
1538 * @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if
1539 * %NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet)
1540 * @NL80211_ATTR_VENDOR_SUBCMD: vendor sub-command
1541 * @NL80211_ATTR_VENDOR_DATA: data for the vendor command, if any; this
1542 * attribute is also used for vendor command feature advertisement
1543 *
1527 * @NL80211_ATTR_MAX: highest attribute number currently defined 1544 * @NL80211_ATTR_MAX: highest attribute number currently defined
1528 * @__NL80211_ATTR_AFTER_LAST: internal use 1545 * @__NL80211_ATTR_AFTER_LAST: internal use
1529 */ 1546 */
@@ -1845,6 +1862,10 @@ enum nl80211_attrs {
1845 1862
1846 NL80211_ATTR_OPMODE_NOTIF, 1863 NL80211_ATTR_OPMODE_NOTIF,
1847 1864
1865 NL80211_ATTR_VENDOR_ID,
1866 NL80211_ATTR_VENDOR_SUBCMD,
1867 NL80211_ATTR_VENDOR_DATA,
1868
1848 /* add attributes here, update the policy in nl80211.c */ 1869 /* add attributes here, update the policy in nl80211.c */
1849 1870
1850 __NL80211_ATTR_AFTER_LAST, 1871 __NL80211_ATTR_AFTER_LAST,
@@ -3965,4 +3986,24 @@ enum nl80211_rxmgmt_flags {
3965 NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0, 3986 NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0,
3966}; 3987};
3967 3988
3989/*
3990 * If this flag is unset, the lower 24 bits are an OUI, if set
3991 * a Linux nl80211 vendor ID is used (no such IDs are allocated
3992 * yet, so that's not valid so far)
3993 */
3994#define NL80211_VENDOR_ID_IS_LINUX 0x80000000
3995
3996/**
3997 * struct nl80211_vendor_cmd_info - vendor command data
3998 * @vendor_id: If the %NL80211_VENDOR_ID_IS_LINUX flag is clear, then the
3999 * value is a 24-bit OUI; if it is set then a separately allocated ID
4000 * may be used, but no such IDs are allocated yet. New IDs should be
4001 * added to this file when needed.
4002 * @subcmd: sub-command ID for the command
4003 */
4004struct nl80211_vendor_cmd_info {
4005 __u32 vendor_id;
4006 __u32 subcmd;
4007};
4008
3968#endif /* __LINUX_NL80211_H */ 4009#endif /* __LINUX_NL80211_H */