History

cfg80211: add start / stop NAN commands

This allows user space to start/stop NAN interface. A NAN interface is like P2P device in a few aspects: it doesn't have a netdev associated to it. Add the new interface type and prevent operations that can't be executed on NAN interface like scan. Define several attributes that may be configured by user space when starting NAN functionality (master preference and dual band operation)

Ayala Beker committed 10 years ago

Commit cb3b7d81 parent b86762216 files · +260 −6Browse files

Showing the changes to include/uapi/linux (1 of 16 files). Show all

Unified · Split

include/uapi/linux/nl80211.h+47−0
@@ -838,6 +838,16 @@ · 837 unmodified lines
838 * not running. The driver indicates the status of the scan through838 * not running. The driver indicates the status of the scan through
839 * cfg80211_scan_done().839 * cfg80211_scan_done().
840 *840 *
841 * @NL80211_CMD_START_NAN: Start NAN operation, identified by its
842 * %NL80211_ATTR_WDEV interface. This interface must have been previously
843 * created with %NL80211_CMD_NEW_INTERFACE. After it has been started, the
844 * NAN interface will create or join a cluster. This command must have a
845 * valid %NL80211_ATTR_NAN_MASTER_PREF attribute and optional
846 * %NL80211_ATTR_NAN_DUAL attributes.
847 * After this command NAN functions can be added.
848 * @NL80211_CMD_STOP_NAN: Stop the NAN operation, identified by
849 * its %NL80211_ATTR_WDEV interface.
850 *
841 * @NL80211_CMD_MAX: highest used command number851 * @NL80211_CMD_MAX: highest used command number
842 * @__NL80211_CMD_AFTER_LAST: internal use852 * @__NL80211_CMD_AFTER_LAST: internal use
843 */853 */
@@ -1026,6 +1036,9 @@ enum nl80211_commands { · 182 unmodified lines
1026 1036
1027 NL80211_CMD_ABORT_SCAN,1037 NL80211_CMD_ABORT_SCAN,
1028 1038
1039 NL80211_CMD_START_NAN,
1040 NL80211_CMD_STOP_NAN,
1041
1029 /* add new commands above here */1042 /* add new commands above here */
1030 1043
1031 /* used to define NL80211_CMD_MAX below */1044 /* used to define NL80211_CMD_MAX below */
@@ -1739,6 +1752,12 @@ enum nl80211_commands { · 707 unmodified lines
1739 * regulatory indoor configuration would be owned by the netlink socket1752 * regulatory indoor configuration would be owned by the netlink socket
1740 * that configured the indoor setting, and the indoor operation would be1753 * that configured the indoor setting, and the indoor operation would be
1741 * cleared when the socket is closed.1754 * cleared when the socket is closed.
1755 * If set during NAN interface creation, the interface will be destroyed
1756 * if the socket is closed just like any other interface. Moreover, only
1757 * the netlink socket that created the interface will be allowed to add
1758 * and remove functions. NAN notifications will be sent in unicast to that
1759 * socket. Without this attribute, any socket can add functions and the
1760 * notifications will be sent to the %NL80211_MCGRP_NAN multicast group.
1742 *1761 *
1743 * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is1762 * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is
1744 * the TDLS link initiator.1763 * the TDLS link initiator.
@@ -1873,6 +1892,14 @@ enum nl80211_commands { · 128 unmodified lines
1873 * @NL80211_ATTR_MESH_PEER_AID: Association ID for the mesh peer (u16). This is1892 * @NL80211_ATTR_MESH_PEER_AID: Association ID for the mesh peer (u16). This is
1874 * used to pull the stored data for mesh peer in power save state.1893 * used to pull the stored data for mesh peer in power save state.
1875 *1894 *
1895 * @NL80211_ATTR_NAN_MASTER_PREF: the master preference to be used by
1896 * %NL80211_CMD_START_NAN. Its type is u8 and it can't be 0.
1897 * Also, values 1 and 255 are reserved for certification purposes and
1898 * should not be used during a normal device operation.
1899 * @NL80211_ATTR_NAN_DUAL: NAN dual band operation config (see
1900 * &enum nl80211_nan_dual_band_conf). This attribute is used with
1901 * %NL80211_CMD_START_NAN.
1902 *
1876 * @NUM_NL80211_ATTR: total number of nl80211_attrs available1903 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
1877 * @NL80211_ATTR_MAX: highest attribute number currently defined1904 * @NL80211_ATTR_MAX: highest attribute number currently defined
1878 * @__NL80211_ATTR_AFTER_LAST: internal use1905 * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2267,6 +2294,9 @@ enum nl80211_attrs { · 388 unmodified lines
2267 2294
2268 NL80211_ATTR_MESH_PEER_AID,2295 NL80211_ATTR_MESH_PEER_AID,
2269 2296
2297 NL80211_ATTR_NAN_MASTER_PREF,
2298 NL80211_ATTR_NAN_DUAL,
2299
2270 /* add attributes here, update the policy in nl80211.c */2300 /* add attributes here, update the policy in nl80211.c */
2271 2301
2272 __NL80211_ATTR_AFTER_LAST,2302 __NL80211_ATTR_AFTER_LAST,
@@ -2345,6 +2375,7 @@ enum nl80211_attrs { · 72 unmodified lines
2345 * commands to create and destroy one2375 * commands to create and destroy one
2346 * @NL80211_IF_TYPE_OCB: Outside Context of a BSS2376 * @NL80211_IF_TYPE_OCB: Outside Context of a BSS
2347 * This mode corresponds to the MIB variable dot11OCBActivated=true2377 * This mode corresponds to the MIB variable dot11OCBActivated=true
2378 * @NL80211_IFTYPE_NAN: NAN device interface type (not a netdev)
2348 * @NL80211_IFTYPE_MAX: highest interface type number currently defined2379 * @NL80211_IFTYPE_MAX: highest interface type number currently defined
2349 * @NUM_NL80211_IFTYPES: number of defined interface types2380 * @NUM_NL80211_IFTYPES: number of defined interface types
2350 *2381 *
@@ -2365,6 +2396,7 @@ enum nl80211_iftype { · 14 unmodified lines
2365 NL80211_IFTYPE_P2P_GO,2396 NL80211_IFTYPE_P2P_GO,
2366 NL80211_IFTYPE_P2P_DEVICE,2397 NL80211_IFTYPE_P2P_DEVICE,
2367 NL80211_IFTYPE_OCB,2398 NL80211_IFTYPE_OCB,
2399 NL80211_IFTYPE_NAN,
2368 2400
2369 /* keep last */2401 /* keep last */
2370 NUM_NL80211_IFTYPES,2402 NUM_NL80211_IFTYPES,
@@ -4870,4 +4902,19 @@ enum nl80211_bss_select_attr { · 2499 unmodified lines
4870 NL80211_BSS_SELECT_ATTR_MAX = __NL80211_BSS_SELECT_ATTR_AFTER_LAST - 14902 NL80211_BSS_SELECT_ATTR_MAX = __NL80211_BSS_SELECT_ATTR_AFTER_LAST - 1
4871};4903};
4872 4904
4905/**
4906 * enum nl80211_nan_dual_band_conf - NAN dual band configuration
4907 *
4908 * Defines the NAN dual band mode of operation
4909 *
4910 * @NL80211_NAN_BAND_DEFAULT: device default mode
4911 * @NL80211_NAN_BAND_2GHZ: 2.4GHz mode
4912 * @NL80211_NAN_BAND_5GHZ: 5GHz mode
4913 */
4914enum nl80211_nan_dual_band_conf {
4915 NL80211_NAN_BAND_DEFAULT = 1 << 0,
4916 NL80211_NAN_BAND_2GHZ = 1 << 1,
4917 NL80211_NAN_BAND_5GHZ = 1 << 2,
4918};
4919
4873#endif /* __LINUX_NL80211_H */4920#endif /* __LINUX_NL80211_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t