History

wifi: nl80211: define an API for configuring the NAN peer's schedule

Add an NL80211 command to configure the NAN schedule of a NAN peer. Such a schedule contains a list of NAN channels, and a mapping from each time slots to the corresponding channel (or unscheduled). Also contains more information about the schedule, such as sequence ID and map ID. Not all of the restrictions are validated in this patch. In particular, comparison of two maps of the same peer requires storing/retrieving each map of each peer, only for validation. Therefore, it is the responsibilty of the driver to check that.

Miri Korenblit committed 8 months ago

Commit c4aa2731 parent 1f1101c5 files · +546 −33Browse files

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

Unified · Split

include/uapi/linux/nl80211.h+79−3
@@ -1381,6 +1381,26 @@ · 1380 unmodified lines
13811381 * %NL80211_CMD_NAN_SET_LOCAL_SCHED and %NL80211_ATTR_NAN_SCHED_DEFERRED)
13821382 * has been completed. The presence of %NL80211_ATTR_NAN_SCHED_UPDATE_SUCCESS
13831383 * indicates that the update was successful.
1384+ * @NL80211_CMD_NAN_SET_PEER_SCHED: Set the peer NAN schedule. NAN
1385+ * must be operational (%NL80211_CMD_START_NAN was executed).
1386+ * Required attributes: %NL80211_ATTR_MAC (peer NMI address) and
1387+ * %NL80211_ATTR_NAN_COMMITTED_DW.
1388+ * Optionally, the full schedule can be provided by including all of:
1389+ * %NL80211_ATTR_NAN_SEQ_ID, %NL80211_ATTR_NAN_CHANNEL (one or more), and
1390+ * %NL80211_ATTR_NAN_PEER_MAPS (see &enum nl80211_nan_peer_map_attrs).
1391+ * If any of these three optional attributes is provided, all three must
1392+ * be provided.
1393+ * Each peer channel must be compatible with at least one local channel
1394+ * set by %NL80211_CMD_SET_LOCAL_NAN_SCHED. Different maps must not
1395+ * contain compatible channels.
1396+ * For single-radio devices (n_radio <= 1), different maps must not
1397+ * schedule the same time slot, as the device cannot operate on multiple
1398+ * channels simultaneously.
1399+ * When updating an existing peer schedule, the full new schedule must be
1400+ * provided - partial updates are not supported. The new schedule will
1401+ * completely replace the previous one.
1402+ * The peer schedule is automatically removed when the NMI station is
1403+ * removed.
13841404 * @NL80211_CMD_MAX: highest used command number
13851405 * @__NL80211_CMD_AFTER_LAST: internal use
13861406 */
@@ -1650,6 +1670,8 @@ enum nl80211_commands { · 263 unmodified lines
16501670
16511671 NL80211_CMD_NAN_SCHED_UPDATE_DONE,
16521672
1673+ NL80211_CMD_NAN_SET_PEER_SCHED,
1674+
16531675 /* add new commands above here */
16541676
16551677 /* used to define NL80211_CMD_MAX below */
@@ -3018,8 +3040,12 @@ enum nl80211_commands { · 1362 unmodified lines
30183040 * This attribute is used with %NL80211_CMD_NAN_SET_LOCAL_SCHED to specify
30193041 * the channel definitions on which the radio needs to operate during
30203042 * specific time slots. All of the channel definitions should be mutually
3021− * incompatible. The number of channels should fit the current
3022− * configuration of channels and the possible interface combinations.
3043+ * incompatible.
3044+ * This is also used with %NL80211_CMD_NAN_SET_PEER_SCHED to configure the
3045+ * peer NAN channels. In that case, the channel definitions can be
3046+ * compatible to each other, or even identical just with different RX NSS.
3047+ * The number of channels should fit the current configuration of channels
3048+ * and the possible interface combinations.
30233049 * If an existing NAN channel is changed but the chandef isn't, the
30243050 * channel entry must also remain unchanged.
30253051 * @NL80211_ATTR_NAN_CHANNEL_ENTRY: a byte array of 6 bytes. contains the
@@ -3027,7 +3053,7 @@ enum nl80211_commands { · 1 unmodified line
30273053 * 100 (Channel Entry format for the NAN Availability attribute).
30283054 * @NL80211_ATTR_NAN_RX_NSS: (u8) RX NSS used for a NAN channel. This is
30293055 * used with %NL80211_ATTR_NAN_CHANNEL when configuring NAN channels with
3030− * %NL80211_CMD_NAN_SET_LOCAL_SCHED.
3056+ * %NL80211_CMD_NAN_SET_LOCAL_SCHED or %NL80211_CMD_NAN_SET_PEER_SCHED.
30313057 * @NL80211_ATTR_NAN_TIME_SLOTS: an array of u8 values and 32 cells. each value
30323058 * maps a time slot to the chandef on which the radio should operate on in
30333059 * that time. %NL80211_NAN_SCHED_NOT_AVAIL_SLOT indicates unscheduled.
@@ -3061,6 +3087,24 @@ enum nl80211_commands { · 27 unmodified lines
30613087 * @NL80211_ATTR_NAN_NMI_MAC: The address of the NMI station to which this NDI
30623088 * station belongs. Used with %NL80211_CMD_NEW_STATION when adding an NDI
30633089 * station.
3090+ * @NL80211_ATTR_NAN_ULW: (Binary) The initial ULW(s) as published by the
3091+ * peer, as defined in the Wi-Fi Aware (TM) 4.0 specification Table 109
3092+ * (Unaligned Schedule attribute format). Used to configure the device
3093+ * with the initial ULW(s) of a peer, before the device starts tracking it.
3094+ * @NL80211_ATTR_NAN_COMMITTED_DW: (u16) The committed DW as published by the
3095+ * peer, as defined in the Wi-Fi Aware (TM) 4.0 specification Table 80
3096+ * (Committed DW Information field format).
3097+ * @NL80211_ATTR_NAN_SEQ_ID: (u8) The sequence ID of the peer schedule that
3098+ * %NL80211_CMD_NAN_SET_PEER_SCHED defines. The device follows the
3099+ * sequence ID in the frames to identify newer schedules. Once a schedule
3100+ * with a higher sequence ID is received, the device may stop communicating
3101+ * with that peer until a new peer schedule with a matching sequence ID is
3102+ * received.
3103+ * @NL80211_ATTR_NAN_MAX_CHAN_SWITCH_TIME: (u16) The maximum channel switch
3104+ * time, in microseconds.
3105+ * @NL80211_ATTR_NAN_PEER_MAPS: Nested array of peer schedule maps.
3106+ * Used with %NL80211_CMD_NAN_SET_PEER_SCHED. Contains up to 2 entries,
3107+ * each containing nested attributes from &enum nl80211_nan_peer_map_attrs.
30643108 *
30653109 * @NL80211_ATTR_INCUMBENT_SIGNAL_INTERFERENCE_BITMAP: u32 attribute specifying
30663110 * the signal interference bitmap detected on the operating bandwidth for
@@ -3662,6 +3706,12 @@ enum nl80211_attrs { · 595 unmodified lines
36623706
36633707 NL80211_ATTR_NAN_NMI_MAC,
36643708
3709+ NL80211_ATTR_NAN_ULW,
3710+ NL80211_ATTR_NAN_COMMITTED_DW,
3711+ NL80211_ATTR_NAN_SEQ_ID,
3712+ NL80211_ATTR_NAN_MAX_CHAN_SWITCH_TIME,
3713+ NL80211_ATTR_NAN_PEER_MAPS,
3714+
36653715 /* add attributes here, update the policy in nl80211.c */
36663716
36673717 __NL80211_ATTR_AFTER_LAST,
@@ -8701,6 +8751,32 @@ enum nl80211_nan_capabilities { · 5033 unmodified lines
87018751 NL80211_NAN_CAPABILITIES_MAX = __NL80211_NAN_CAPABILITIES_LAST - 1,
87028752 };
87038753
8754+/**
8755+ * enum nl80211_nan_peer_map_attrs - NAN peer schedule map attributes
8756+ *
8757+ * Nested attributes used within %NL80211_ATTR_NAN_PEER_MAPS to define
8758+ * individual peer schedule maps.
8759+ *
8760+ * @__NL80211_NAN_PEER_MAP_ATTR_INVALID: Invalid
8761+ * @NL80211_NAN_PEER_MAP_ATTR_MAP_ID: (u8) The map ID for this schedule map.
8762+ * @NL80211_NAN_PEER_MAP_ATTR_TIME_SLOTS: An array of u8 values with 32 cells.
8763+ * Each value maps a time slot to a channel index within the schedule's
8764+ * channel list (%NL80211_ATTR_NAN_CHANNEL attributes).
8765+ * %NL80211_NAN_SCHED_NOT_AVAIL_SLOT indicates unscheduled.
8766+ * @__NL80211_NAN_PEER_MAP_ATTR_LAST: Internal
8767+ * @NL80211_NAN_PEER_MAP_ATTR_MAX: Highest peer map attribute
8768+ */
8769+enum nl80211_nan_peer_map_attrs {
8770+ __NL80211_NAN_PEER_MAP_ATTR_INVALID,
8771+
8772+ NL80211_NAN_PEER_MAP_ATTR_MAP_ID,
8773+ NL80211_NAN_PEER_MAP_ATTR_TIME_SLOTS,
8774+
8775+ /* keep last */
8776+ __NL80211_NAN_PEER_MAP_ATTR_LAST,
8777+ NL80211_NAN_PEER_MAP_ATTR_MAX = __NL80211_NAN_PEER_MAP_ATTR_LAST - 1,
8778+};
8779+
87048780 #define NL80211_NAN_SCHED_NOT_AVAIL_SLOT 0xff
87058781
87068782 #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