]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add new QCA vendor command and attributes to enhance NAN
authorNachiket Kukade <nkukade@codeaurora.org>
Fri, 3 Aug 2018 10:28:07 +0000 (15:58 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 30 Aug 2018 19:55:19 +0000 (22:55 +0300)
The payload used for the existing NAN vendor command,
QCA_NL80211_VENDOR_SUBCMD_NAN is a binary blob of data. This
command is not extendable to send additional information. Hence
define a new vendor command QCA_NL80211_VENDOR_SUBCMD_NAN_EXT,
that can carry the binary blob encapsulated within an attribute
and can carry additional attributes to enhance the NAN command
interface. Define additional 3 new attributes for conveying
type of NAN subcmd and channel information.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/common/qca-vendor.h

index 4f247863d02fc88e0983ef0fcbec044d2c020587..75a7cc0a56e277c6ad7b50674908a9db403b0c26 100644 (file)
@@ -456,6 +456,13 @@ enum qca_radiotap_vendor_ids {
  *     and STA MAC addresses added by the user. This command is also used to
  *     fetch the statistics of unassociated stations. The attributes used with
  *     this command are defined in enum qca_wlan_vendor_attr_bss_filter.
+ *
+ * @QCA_NL80211_VENDOR_SUBCMD_NAN_EXT: An extendable version of NAN vendor
+ *     command. The earlier command for NAN, QCA_NL80211_VENDOR_SUBCMD_NAN,
+ *     carried a payload which was a binary blob of data. The command was not
+ *     extendable to send more information. The newer version carries the
+ *     legacy blob encapsulated within an attribute and can be extended with
+ *     additional vendor attributes that can enhance the NAN command interface.
  */
 enum qca_nl80211_vendor_subcmds {
        QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0,
@@ -615,6 +622,7 @@ enum qca_nl80211_vendor_subcmds {
        QCA_NL80211_VENDOR_SUBCMD_WIFI_TEST_CONFIGURATION = 169,
        /* Frame filter operations for other BSSs/unassociated STAs */
        QCA_NL80211_VENDOR_SUBCMD_BSS_FILTER = 170,
+       QCA_NL80211_VENDOR_SUBCMD_NAN_EXT = 171,
 };
 
 enum qca_wlan_vendor_attr {
@@ -5650,4 +5658,52 @@ enum qca_wlan_vendor_bss_filter_sta_stats {
        QCA_WLAN_VENDOR_BSS_FILTER_STA_STATS_AFTER_LAST - 1
 };
 
+/* enum qca_wlan_nan_subcmd_type - Type of NAN command used by attribute
+ * QCA_WLAN_VENDOR_ATTR_NAN_SUBCMD_TYPE as a part of vendor command
+ * QCA_NL80211_VENDOR_SUBCMD_NAN_EXT.
+ */
+enum qca_wlan_nan_ext_subcmd_type {
+       /* Subcmd of type NAN Enable Request */
+       QCA_WLAN_NAN_EXT_SUBCMD_TYPE_ENABLE_REQ = 1,
+       /* Subcmd of type NAN Disable Request */
+       QCA_WLAN_NAN_EXT_SUBCMD_TYPE_DISABLE_REQ = 2,
+};
+
+/**
+ * enum qca_wlan_vendor_attr_nan_params - Used by the vendor command
+ * QCA_NL80211_VENDOR_SUBCMD_NAN_EXT.
+ */
+enum qca_wlan_vendor_attr_nan_params {
+       QCA_WLAN_VENDOR_ATTR_NAN_INVALID = 0,
+       /* Carries NAN command for firmware component. Every vendor command
+        * QCA_NL80211_VENDOR_SUBCMD_NAN_EXT must contain this attribute with a
+        * payload containing the NAN command. NLA_BINARY attribute.
+        */
+       QCA_WLAN_VENDOR_ATTR_NAN_CMD_DATA = 1,
+       /* Indicates the type of NAN command sent with
+        * QCA_NL80211_VENDOR_SUBCMD_NAN_EXT. enum qca_wlan_nan_ext_subcmd_type
+        * describes the possible range of values. This attribute is mandatory
+        * if the command being issued is either
+        * QCA_WLAN_NAN_EXT_SUBCMD_TYPE_ENABLE_REQ or
+        * QCA_WLAN_NAN_EXT_SUBCMD_TYPE_DISABLE_REQ. NLA_U32 attribute.
+        */
+       QCA_WLAN_VENDOR_ATTR_NAN_SUBCMD_TYPE = 2,
+       /* Frequency (in MHz) of primary NAN discovery social channel in 2.4 GHz
+        * band. This attribute is mandatory when command type is
+        * QCA_WLAN_NAN_EXT_SUBCMD_TYPE_ENABLE_REQ. NLA_U32 attribute.
+        */
+       QCA_WLAN_VENDOR_ATTR_NAN_DISC_24GHZ_BAND_FREQ = 3,
+       /* Frequency (in MHz) of secondary NAN discovery social channel in 5 GHz
+        * band. This attribute is optional and should be included when command
+        * type is QCA_WLAN_NAN_EXT_SUBCMD_TYPE_ENABLE_REQ and NAN discovery
+        * has to be started on 5GHz along with 2.4GHz. NLA_U32 attribute.
+        */
+       QCA_WLAN_VENDOR_ATTR_NAN_DISC_5GHZ_BAND_FREQ = 4,
+
+       /* keep last */
+       QCA_WLAN_VENDOR_ATTR_NAN_PARAMS_AFTER_LAST,
+       QCA_WLAN_VENDOR_ATTR_NAN_PARAMS_MAX =
+               QCA_WLAN_VENDOR_ATTR_NAN_PARAMS_AFTER_LAST - 1
+};
+
 #endif /* QCA_VENDOR_H */