Add QCA vendor interface to support Unsynchronized Service Discovery

Add a new QCA command QCA_NL80211_VENDOR_SUBCMD_USD and related
attributes to support Unsynchronized Service Discovery (USD).

Device in active subscriber role sends SDF frames with service
information to find devices that advertise or publish the required
services. Device address, operation type, instance id, service_id,
channel info, service specific info, element container attribute, and
timeout are sent to the driver to initiate USD publish or USD subscribe
operation. The driver sends QCA_NL80211_VENDOR_SUBCMD_USD event with
instance_id and the USD operation status. QCA_NL80211_VENDOR_SUBCMD_USD
is also used to update publish operation and to cancel the publish or
subscribe operation for a service. It also allows all the operations to
be terminated using the USD flush command.

Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
This commit is contained in:
Vinay Gannevaram 2023-12-12 13:08:40 +05:30 committed by Jouni Malinen
parent 8d54863550
commit 4417b5ba86

View file

@ -1227,6 +1227,16 @@ enum qca_radiotap_vendor_ids {
* collection of these statistics has been enabled by the command
* @QCA_NL80211_VENDOR_SUBCMD_ASYNC_STATS_POLICY. The attributes for this
* event are defined in enum qca_wlan_vendor_attr_flow_stats.
*
* @QCA_NL80211_VENDOR_SUBCMD_USD: Vendor subcommand to implement unsynchronized
* service discovery (USD). Based on the type of the USD subcommand the USD
* operation to publish, subscribe, update publish, cancel publish, or
* cancel subscribe is triggered.
*
* When used as an event, the driver notifies the status of an USD command.
*
* The attributes used with this command are defined in
* enum qca_wlan_vendor_attr_usd.
*/
enum qca_nl80211_vendor_subcmds {
QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0,
@ -1459,6 +1469,7 @@ enum qca_nl80211_vendor_subcmds {
QCA_NL80211_VENDOR_SUBCMD_FLOW_CLASSIFY_RESULT = 246,
QCA_NL80211_VENDOR_SUBCMD_ASYNC_STATS_POLICY = 247,
QCA_NL80211_VENDOR_SUBCMD_CLASSIFIED_FLOW_REPORT = 248,
QCA_NL80211_VENDOR_SUBCMD_USD = 249,
};
/* Compatibility defines for previously used subcmd names.
@ -17878,4 +17889,162 @@ enum qca_wlan_intf_offload_type {
QCA_WLAN_INTF_OFFLOAD_TYPE_PPE_DS = 3,
};
/**
* enum qca_wlan_vendor_attr_usd_op_type: Attribute values for
* %QCA_WLAN_VENDOR_ATTR_USD_OP_TYPE to the vendor subcmd
* %QCA_NL80211_VENDOR_SUBCMD_USD. This is a mandatory u8 attribute which
* represents the USD command type.
*
* @QCA_WLAN_VENDOR_USD_OP_TYPE_FLUSH: Indicates USD tear down of all active
* publish and subscribe sessions.
*
* @QCA_WLAN_VENDOR_USD_OP_TYPE_PUBLISH: Indicates USD solicited publish
* operation that enables to offer a service for other devices based on
* given parameters.
*
* @QCA_WLAN_VENDOR_USD_OP_TYPE_SUBSCRIBE: Indicates USD active subscribe
* operation that requests for a given service with given parameters from
* other devices that offer the service.
*
* @QCA_WLAN_VENDOR_USD_OP_TYPE_UPDATE_PUBLISH: Indicates update of an instance
* of the publish function of given publish id.
*
* @QCA_WLAN_VENDOR_USD_OP_TYPE_CANCEL_PUBLISH: Indicates cancellation of an
* instance of the publish function.
*
* @QCA_WLAN_VENDOR_USD_OP_TYPE_CANCEL_SUBSCRIBE: Indicates cancellation of an
* instance of the subscribe function.
*/
enum qca_wlan_vendor_attr_an_usd_op_type {
QCA_WLAN_VENDOR_USD_OP_TYPE_FLUSH = 0,
QCA_WLAN_VENDOR_USD_OP_TYPE_PUBLISH = 1,
QCA_WLAN_VENDOR_USD_OP_TYPE_SUBSCRIBE = 2,
QCA_WLAN_VENDOR_USD_OP_TYPE_UPDATE_PUBLISH = 3,
QCA_WLAN_VENDOR_USD_OP_TYPE_CANCEL_PUBLISH = 4,
QCA_WLAN_VENDOR_USD_OP_TYPE_CANCEL_SUBSCRIBE = 5,
};
/**
* enum qca_wlan_vendor_attr_usd_service_protocol_type: Attribute values for
* %QCA_WLAN_VENDOR_ATTR_USD_SERVICE_PROTOCOL_TYPE to the vendor subcmd
* %QCA_NL80211_VENDOR_SUBCMD_USD. This is a u8 attribute which represents the
* USD service protocol type for service specific information.
*
* @QCA_WLAN_VENDOR_USD_SERVICE_PROTOCOL_TYPE_BONJOUR: Indicates SSI info is
* of type Bonjour
* @QCA_WLAN_VENDOR_USD_SERVICE_PROTOCOL_TYPE_GENERIC: Indicates SSI info is
* of type generic
* @QCA_WLAN_VENDOR_USD_SERVICE_PROTOCOL_TYPE_CSA_MATTER: Indicates SSI info
* is of type CSA/Matter
*/
enum qca_wlan_vendor_attr_usd_service_protocol_type {
QCA_WLAN_VENDOR_USD_SERVICE_PROTOCOL_TYPE_BONJOUR = 1,
QCA_WLAN_VENDOR_USD_SERVICE_PROTOCOL_TYPE_GENERIC = 2,
QCA_WLAN_VENDOR_USD_SERVICE_PROTOCOL_TYPE_CSA_MATTER = 3,
};
/**
* enum qca_wlan_vendor_attr_usd_chan_config - Attributes used inside nested
* attribute %QCA_WLAN_VENDOR_ATTR_USD_CHAN_CONFIG.
*
* @QCA_WLAN_VENDOR_ATTR_USD_CHAN_CONFIG_DEFAULT_FREQ: Required
* u32 attribute containing the default channel frequency (MHz).
*
* @QCA_WLAN_VENDOR_ATTR_USD_CHAN_CONFIG_FREQ_LIST: Optional array of channel
* frequencies in MHz (u32) to publish or subscribe.
*/
enum qca_wlan_vendor_attr_usd_chan_config {
QCA_WLAN_VENDOR_ATTR_USD_CHAN_CONFIG_INVALID = 0,
QCA_WLAN_VENDOR_ATTR_USD_CHAN_CONFIG_DEFAULT_FREQ = 1,
QCA_WLAN_VENDOR_ATTR_USD_CHAN_CONFIG_FREQ_LIST = 2,
QCA_WLAN_VENDOR_ATTR_USD_CHAN_CONFIG_AFTER_LAST,
QCA_WLAN_VENDOR_ATTR_USD_CHAN_CONFIG_MAX =
QCA_WLAN_VENDOR_ATTR_USD_CHAN_CONFIG_AFTER_LAST - 1,
};
/**
* enum qca_wlan_vendor_attr_usd_status
*
* @QCA_WLAN_VENDOR_ATTR_USD_STATUS_SUCCESS: USD request success status.
* @QCA_WLAN_VENDOR_ATTR_USD_STATUS_FAILED: USD request failed status.
*/
enum qca_wlan_vendor_attr_usd_status {
QCA_WLAN_VENDOR_ATTR_USD_STATUS_SUCCESS,
QCA_WLAN_VENDOR_ATTR_USD_STATUS_FAILED,
};
/* enum qca_wlan_vendor_attr_usd: Attributes used by vendor command
* %QCA_NL80211_VENDOR_SUBCMD_USD.
*
* @QCA_WLAN_VENDOR_ATTR_USD_SRC_ADDR: 6-byte source MAC address
* Mandatory attribute used with type
* %QCA_WLAN_VENDOR_USD_OP_TYPE_PUBLISH and
* %QCA_WLAN_VENDOR_USD_OP_TYPE_SUBSCRIBE.
*
* @QCA_WLAN_VENDOR_ATTR_USD_OP_TYPE: Required u8 attribute.
* It indicates the type of the USD command. It uses values defined in enum
* qca_wlan_vendor_attr_usd_op_type.
*
* @QCA_WLAN_VENDOR_ATTR_USD_INSTANCE_ID: Required u8 attribute.
* It contains the publisher/subscribe id that is specific to the
* publish/subscribe instance.
*
* @QCA_WLAN_VENDOR_ATTR_USD_SERVICE_ID: Required 6-byte attribute.
* It contains the service id that is specific to the service being
* published/subscribed.
*
* @QCA_WLAN_VENDOR_ATTR_USD_SERVICE_PROTOCOL_TYPE: u8 attribute that indicates
* the service protocol type of service specific info. It uses values
* defined in enum qca_wlan_vendor_attr_usd_service_protocol_type. It is
* applicable when %QCA_WLAN_VENDOR_ATTR_USD_SSI is present.
*
* @QCA_WLAN_VENDOR_ATTR_USD_SSI: u8 array containing service specific
* information that has to be conveyed in publish/subscribe message.
* Optional attribute used with type
* %QCA_WLAN_VENDOR_USD_OP_TYPE_PUBLISH,
* %QCA_WLAN_VENDOR_USD_OP_TYPE_SUBSCRIBE, and
* %QCA_WLAN_VENDOR_USD_OP_TYPE_UPDATE_PUBLISH.
*
* @QCA_WLAN_VENDOR_ATTR_USD_CHAN_CONFIG: Nested attribute containing USD
* channel configuration parameters.
* Required for type %QCA_WLAN_VENDOR_USD_OP_TYPE_PUBLISH and
* %QCA_WLAN_VENDOR_USD_OP_TYPE_SUBSCRIBE.
* See enum qca_wlan_vendor_attr_usd_chan_config for nested attributes.
*
* @QCA_WLAN_VENDOR_ATTR_USD_ELEMENT_CONTAINER: u8 array containing a USD
* element container buffer that has to be conveyed in publish/subscribe
* message.
* Required for type %QCA_WLAN_VENDOR_USD_OP_TYPE_PUBLISH and
* %QCA_WLAN_VENDOR_USD_OP_TYPE_SUBSCRIBE.
*
* @QCA_WLAN_VENDOR_ATTR_USD_TTL: u16 attribute. Indicates the timeout
* for each request in seconds. Timeout value 0 represents single time
* operation.
*
* @QCA_WLAN_VENDOR_ATTR_USD_STATUS: u8 attribute. Status received in event
* indicating whether the underlying driver/firmware has started the USD
* operation as indicated by attributes
* %QCA_WLAN_VENDOR_ATTR_USD_OP_TYPE and
* %QCA_WLAN_VENDOR_ATTR_USD_INSTANCE_ID.
* enum qca_wlan_vendor_attr_usd_status indicates status values.
*/
enum qca_wlan_vendor_attr_usd {
QCA_WLAN_VENDOR_ATTR_USD_INVALID = 0,
QCA_WLAN_VENDOR_ATTR_USD_SRC_ADDR = 1,
QCA_WLAN_VENDOR_ATTR_USD_OP_TYPE = 2,
QCA_WLAN_VENDOR_ATTR_USD_INSTANCE_ID = 3,
QCA_WLAN_VENDOR_ATTR_USD_SERVICE_ID = 4,
QCA_WLAN_VENDOR_ATTR_USD_SERVICE_PROTOCOL_TYPE = 5,
QCA_WLAN_VENDOR_ATTR_USD_SSI = 6,
QCA_WLAN_VENDOR_ATTR_USD_CHAN_CONFIG = 7,
QCA_WLAN_VENDOR_ATTR_USD_ELEMENT_CONTAINER = 8,
QCA_WLAN_VENDOR_ATTR_USD_TTL = 9,
QCA_WLAN_VENDOR_ATTR_USD_STATUS = 10,
QCA_WLAN_VENDOR_ATTR_USD_AFTER_LAST,
QCA_WLAN_VENDOR_ATTR_USD_MAX =
QCA_WLAN_VENDOR_ATTR_USD_AFTER_LAST - 1,
};
#endif /* QCA_VENDOR_H */