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
1381 * %NL80211_CMD_NAN_SET_LOCAL_SCHED and %NL80211_ATTR_NAN_SCHED_DEFERRED)1381 * %NL80211_CMD_NAN_SET_LOCAL_SCHED and %NL80211_ATTR_NAN_SCHED_DEFERRED)
1382 * has been completed. The presence of %NL80211_ATTR_NAN_SCHED_UPDATE_SUCCESS1382 * has been completed. The presence of %NL80211_ATTR_NAN_SCHED_UPDATE_SUCCESS
1383 * indicates that the update was successful.1383 * 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.
1384 * @NL80211_CMD_MAX: highest used command number1404 * @NL80211_CMD_MAX: highest used command number
1385 * @__NL80211_CMD_AFTER_LAST: internal use1405 * @__NL80211_CMD_AFTER_LAST: internal use
1386 */1406 */
@@ -1650,6 +1670,8 @@ enum nl80211_commands { · 263 unmodified lines
1650 1670
1651 NL80211_CMD_NAN_SCHED_UPDATE_DONE,1671 NL80211_CMD_NAN_SCHED_UPDATE_DONE,
1652 1672
1673 NL80211_CMD_NAN_SET_PEER_SCHED,
1674
1653 /* add new commands above here */1675 /* add new commands above here */
1654 1676
1655 /* used to define NL80211_CMD_MAX below */1677 /* used to define NL80211_CMD_MAX below */
@@ -3018,8 +3040,12 @@ enum nl80211_commands { · 1362 unmodified lines
3018 * This attribute is used with %NL80211_CMD_NAN_SET_LOCAL_SCHED to specify3040 * This attribute is used with %NL80211_CMD_NAN_SET_LOCAL_SCHED to specify
3019 * the channel definitions on which the radio needs to operate during3041 * the channel definitions on which the radio needs to operate during
3020 * specific time slots. All of the channel definitions should be mutually3042 * specific time slots. All of the channel definitions should be mutually
3021 * incompatible. The number of channels should fit the current3043 * incompatible.
3022 * configuration of channels and the possible interface combinations.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.
3023 * If an existing NAN channel is changed but the chandef isn't, the3049 * If an existing NAN channel is changed but the chandef isn't, the
3024 * channel entry must also remain unchanged.3050 * channel entry must also remain unchanged.
3025 * @NL80211_ATTR_NAN_CHANNEL_ENTRY: a byte array of 6 bytes. contains the3051 * @NL80211_ATTR_NAN_CHANNEL_ENTRY: a byte array of 6 bytes. contains the
@@ -3027,7 +3053,7 @@ enum nl80211_commands { · 1 unmodified line
3027 * 100 (Channel Entry format for the NAN Availability attribute).3053 * 100 (Channel Entry format for the NAN Availability attribute).
3028 * @NL80211_ATTR_NAN_RX_NSS: (u8) RX NSS used for a NAN channel. This is3054 * @NL80211_ATTR_NAN_RX_NSS: (u8) RX NSS used for a NAN channel. This is
3029 * used with %NL80211_ATTR_NAN_CHANNEL when configuring NAN channels with3055 * 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.
3031 * @NL80211_ATTR_NAN_TIME_SLOTS: an array of u8 values and 32 cells. each value3057 * @NL80211_ATTR_NAN_TIME_SLOTS: an array of u8 values and 32 cells. each value
3032 * maps a time slot to the chandef on which the radio should operate on in3058 * maps a time slot to the chandef on which the radio should operate on in
3033 * that time. %NL80211_NAN_SCHED_NOT_AVAIL_SLOT indicates unscheduled.3059 * that time. %NL80211_NAN_SCHED_NOT_AVAIL_SLOT indicates unscheduled.
@@ -3061,6 +3087,24 @@ enum nl80211_commands { · 27 unmodified lines
3061 * @NL80211_ATTR_NAN_NMI_MAC: The address of the NMI station to which this NDI3087 * @NL80211_ATTR_NAN_NMI_MAC: The address of the NMI station to which this NDI
3062 * station belongs. Used with %NL80211_CMD_NEW_STATION when adding an NDI3088 * station belongs. Used with %NL80211_CMD_NEW_STATION when adding an NDI
3063 * station.3089 * 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.
3064 *3108 *
3065 * @NL80211_ATTR_INCUMBENT_SIGNAL_INTERFERENCE_BITMAP: u32 attribute specifying3109 * @NL80211_ATTR_INCUMBENT_SIGNAL_INTERFERENCE_BITMAP: u32 attribute specifying
3066 * the signal interference bitmap detected on the operating bandwidth for3110 * the signal interference bitmap detected on the operating bandwidth for
@@ -3662,6 +3706,12 @@ enum nl80211_attrs { · 595 unmodified lines
3662 3706
3663 NL80211_ATTR_NAN_NMI_MAC,3707 NL80211_ATTR_NAN_NMI_MAC,
3664 3708
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
3665 /* add attributes here, update the policy in nl80211.c */3715 /* add attributes here, update the policy in nl80211.c */
3666 3716
3667 __NL80211_ATTR_AFTER_LAST,3717 __NL80211_ATTR_AFTER_LAST,
@@ -8701,6 +8751,32 @@ enum nl80211_nan_capabilities { · 5033 unmodified lines
8701 NL80211_NAN_CAPABILITIES_MAX = __NL80211_NAN_CAPABILITIES_LAST - 1,8751 NL80211_NAN_CAPABILITIES_MAX = __NL80211_NAN_CAPABILITIES_LAST - 1,
8702};8752};
8703 8753
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 */
8769enum 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
8704#define NL80211_NAN_SCHED_NOT_AVAIL_SLOT 0xff8780#define NL80211_NAN_SCHED_NOT_AVAIL_SLOT 0xff
8705 8781
8706#endif /* __LINUX_NL80211_H */8782#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