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
838838 * not running. The driver indicates the status of the scan through
839839 * cfg80211_scan_done().
840840 *
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+ *
841851 * @NL80211_CMD_MAX: highest used command number
842852 * @__NL80211_CMD_AFTER_LAST: internal use
843853 */
@@ -1026,6 +1036,9 @@ enum nl80211_commands { · 182 unmodified lines
10261036
10271037 NL80211_CMD_ABORT_SCAN,
10281038
1039+ NL80211_CMD_START_NAN,
1040+ NL80211_CMD_STOP_NAN,
1041+
10291042 /* add new commands above here */
10301043
10311044 /* used to define NL80211_CMD_MAX below */
@@ -1739,6 +1752,12 @@ enum nl80211_commands { · 707 unmodified lines
17391752 * regulatory indoor configuration would be owned by the netlink socket
17401753 * that configured the indoor setting, and the indoor operation would be
17411754 * 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.
17421761 *
17431762 * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is
17441763 * the TDLS link initiator.
@@ -1873,6 +1892,14 @@ enum nl80211_commands { · 128 unmodified lines
18731892 * @NL80211_ATTR_MESH_PEER_AID: Association ID for the mesh peer (u16). This is
18741893 * used to pull the stored data for mesh peer in power save state.
18751894 *
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+ *
18761903 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
18771904 * @NL80211_ATTR_MAX: highest attribute number currently defined
18781905 * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2267,6 +2294,9 @@ enum nl80211_attrs { · 388 unmodified lines
22672294
22682295 NL80211_ATTR_MESH_PEER_AID,
22692296
2297+ NL80211_ATTR_NAN_MASTER_PREF,
2298+ NL80211_ATTR_NAN_DUAL,
2299+
22702300 /* add attributes here, update the policy in nl80211.c */
22712301
22722302 __NL80211_ATTR_AFTER_LAST,
@@ -2345,6 +2375,7 @@ enum nl80211_attrs { · 72 unmodified lines
23452375 * commands to create and destroy one
23462376 * @NL80211_IF_TYPE_OCB: Outside Context of a BSS
23472377 * This mode corresponds to the MIB variable dot11OCBActivated=true
2378+ * @NL80211_IFTYPE_NAN: NAN device interface type (not a netdev)
23482379 * @NL80211_IFTYPE_MAX: highest interface type number currently defined
23492380 * @NUM_NL80211_IFTYPES: number of defined interface types
23502381 *
@@ -2365,6 +2396,7 @@ enum nl80211_iftype { · 14 unmodified lines
23652396 NL80211_IFTYPE_P2P_GO,
23662397 NL80211_IFTYPE_P2P_DEVICE,
23672398 NL80211_IFTYPE_OCB,
2399+ NL80211_IFTYPE_NAN,
23682400
23692401 /* keep last */
23702402 NUM_NL80211_IFTYPES,
@@ -4870,4 +4902,19 @@ enum nl80211_bss_select_attr { · 2499 unmodified lines
48704902 NL80211_BSS_SELECT_ATTR_MAX = __NL80211_BSS_SELECT_ATTR_AFTER_LAST - 1
48714903 };
48724904
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+ */
4914+enum 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+
48734920 #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