mesh: Use WPA_DRIVER_MESH_CONF_FLAG_* as modification flag
[mech_eap.git] / src / drivers / driver.h
index a9dbdef..ffe6f75 100644 (file)
@@ -1118,13 +1118,17 @@ struct wpa_driver_ap_params {
 };
 
 struct wpa_driver_mesh_bss_params {
-#define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS  0x00000001
+#define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS          0x00000001
+#define WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT    0x00000002
+#define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS       0x00000004
        /*
         * TODO: Other mesh configuration parameters would go here.
         * See NL80211_MESHCONF_* for all the mesh config parameters.
         */
        unsigned int flags;
+       int auto_plinks;
        int peer_link_timeout;
+       int max_peer_links;
 };
 
 struct wpa_driver_mesh_join_params {
@@ -1135,7 +1139,7 @@ struct wpa_driver_mesh_join_params {
        int ie_len;
        struct hostapd_freq_params freq;
        int beacon_int;
-       int max_peer_links;
+       int dtim_period;
        struct wpa_driver_mesh_bss_params conf;
 #define WPA_DRIVER_MESH_FLAG_USER_MPM  0x00000001
 #define WPA_DRIVER_MESH_FLAG_DRIVER_MPM        0x00000002
@@ -1278,6 +1282,8 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS       0x0000008000000000ULL
 /** Driver supports full AP client state */
 #define WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE  0x0000010000000000ULL
+/** Driver supports P2P Listen offload */
+#define WPA_DRIVER_FLAGS_P2P_LISTEN_OFFLOAD     0x0000020000000000ULL
        u64 flags;
 
 #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
@@ -1423,6 +1429,7 @@ struct hostapd_sta_add_params {
        u32 flags_mask; /* unset bits in flags */
 #ifdef CONFIG_MESH
        enum mesh_plink_state plink_state;
+       u16 peer_aid;
 #endif /* CONFIG_MESH */
        int set; /* Set STA parameters instead of add */
        u8 qosinfo;
@@ -3573,6 +3580,49 @@ struct wpa_driver_ops {
        int (*get_ext_capab)(void *priv, enum wpa_driver_if_type type,
                             const u8 **ext_capab, const u8 **ext_capab_mask,
                             unsigned int *ext_capab_len);
+
+       /**
+        * p2p_lo_start - Start offloading P2P listen to device
+        * @priv: Private driver interface data
+        * @freq: Listening frequency (MHz) for P2P listen
+        * @period: Length of the listen operation in milliseconds
+        * @interval: Interval for running the listen operation in milliseconds
+        * @count: Number of times to run the listen operation
+        * @device_types: Device primary and secondary types
+        * @dev_types_len: Number of bytes for device_types
+        * @ies: P2P IE and WSC IE for Probe Response frames
+        * @ies_len: Length of ies in bytes
+        * Returns: 0 on success or -1 on failure
+        */
+       int (*p2p_lo_start)(void *priv, unsigned int freq,
+                           unsigned int period, unsigned int interval,
+                           unsigned int count,
+                           const u8 *device_types, size_t dev_types_len,
+                           const u8 *ies, size_t ies_len);
+
+       /**
+        * p2p_lo_stop - Stop P2P listen offload
+        * @priv: Private driver interface data
+        * Returns: 0 on success or -1 on failure
+        */
+       int (*p2p_lo_stop)(void *priv);
+
+       /**
+        * set_default_scan_ies - Set default scan IEs
+        * @priv: Private driver interface data
+        * @ies: Scan default IEs buffer
+        * @ies_len: Length of IEs in bytes
+        * Returns: 0 on success or -1 on failure
+        *
+        * The driver can use these by default when there are no scan IEs coming
+        * in the subsequent scan requests. Also in case of one or more of IEs
+        * given in set_default_scan_ies() are missing in the subsequent scan
+        * request, the driver should merge the missing scan IEs in the scan
+        * request from the IEs set by set_default_scan_ies() in the Probe
+        * Request frames sent.
+        */
+       int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len);
+
 };
 
 
@@ -4057,6 +4107,11 @@ enum wpa_event_type {
         * on a DFS frequency by a driver that supports DFS Offload.
         */
        EVENT_DFS_CAC_STARTED,
+
+       /**
+        * EVENT_P2P_LO_STOP - Notify that P2P listen offload is stopped
+        */
+       EVENT_P2P_LO_STOP,
 };
 
 
@@ -4782,6 +4837,27 @@ union wpa_event_data {
                u16 ch_width;
                enum hostapd_hw_mode hw_mode;
        } acs_selected_channels;
+
+       /**
+        * struct p2p_lo_stop - Reason code for P2P Listen offload stop event
+        * @reason_code: Reason for stopping offload
+        *      P2P_LO_STOPPED_REASON_COMPLETE: Listen offload finished as
+        *      scheduled.
+        *      P2P_LO_STOPPED_REASON_RECV_STOP_CMD: Host requested offload to
+        *      be stopped.
+        *      P2P_LO_STOPPED_REASON_INVALID_PARAM: Invalid listen offload
+        *      parameters.
+        *      P2P_LO_STOPPED_REASON_NOT_SUPPORTED: Listen offload not
+        *      supported by device.
+        */
+       struct p2p_lo_stop {
+               enum {
+                       P2P_LO_STOPPED_REASON_COMPLETE = 0,
+                       P2P_LO_STOPPED_REASON_RECV_STOP_CMD,
+                       P2P_LO_STOPPED_REASON_INVALID_PARAM,
+                       P2P_LO_STOPPED_REASON_NOT_SUPPORTED,
+               } reason_code;
+       } p2p_lo_stop;
 };
 
 /**
@@ -4861,6 +4937,8 @@ int vht_supported(const struct hostapd_hw_modes *mode);
 struct wowlan_triggers *
 wpa_get_wowlan_triggers(const char *wowlan_triggers,
                        const struct wpa_driver_capa *capa);
+/* Convert driver flag to string */
+const char * driver_flag_to_string(u64 flag);
 
 /* NULL terminated array of linked in driver wrappers */
 extern const struct wpa_driver_ops *const wpa_drivers[];