P2P: Add p2p_unauthorize command
[mech_eap.git] / src / p2p / p2p.h
index 108af5d..bab4939 100644 (file)
@@ -171,6 +171,11 @@ struct p2p_config {
        u8 op_channel;
 
        /**
+        * cfg_op_channel - Whether op_channel is hardcoded in configuration
+        */
+       u8 cfg_op_channel;
+
+       /**
         * channels - Own supported regulatory classes and channels
         *
         * List of supposerted channels per regulatory class. The regulatory
@@ -612,6 +617,19 @@ void p2p_deinit(struct p2p_data *p2p);
 void p2p_flush(struct p2p_data *p2p);
 
 /**
+ * p2p_unauthorize - Unauthorize the specified peer device
+ * @p2p: P2P module context from p2p_init()
+ * @addr: P2P peer entry to be unauthorized
+ * Returns: 0 on success, -1 on failure
+ *
+ * This command removes any connection authorization from the specified P2P
+ * peer device address. This can be used, e.g., to cancel effect of a previous
+ * p2p_authorize() or p2p_connect() call that has not yet resulted in completed
+ * GO Negotiation.
+ */
+int p2p_unauthorize(struct p2p_data *p2p, const u8 *addr);
+
+/**
  * p2p_set_dev_name - Set device name
  * @p2p: P2P module context from p2p_init()
  * Returns: 0 on success, -1 on failure
@@ -670,6 +688,16 @@ int p2p_find(struct p2p_data *p2p, unsigned int timeout,
 void p2p_stop_find(struct p2p_data *p2p);
 
 /**
+ * p2p_stop_find_for_freq - Stop P2P Find for next oper on specific freq
+ * @p2p: P2P module context from p2p_init()
+ * @freq: Frequency in MHz for next operation
+ *
+ * This is like p2p_stop_find(), but Listen state is not stopped if we are
+ * already on the same frequency.
+ */
+void p2p_stop_find_for_freq(struct p2p_data *p2p, int freq);
+
+/**
  * p2p_listen - Start P2P Listen state for specified duration
  * @p2p: P2P module context from p2p_init()
  * @timeout: Listen state duration in milliseconds
@@ -1039,6 +1067,13 @@ struct p2p_group_config {
         */
        void (*ie_update)(void *ctx, struct wpabuf *beacon_ies,
                          struct wpabuf *proberesp_ies);
+
+       /**
+        * idle_update - Notification of changes in group idle state
+        * @ctx: Callback context from cb_ctx
+        * @idle: Whether the group is idle (no associated stations)
+        */
+       void (*idle_update)(void *ctx, int idle);
 };
 
 /**
@@ -1277,4 +1312,14 @@ int p2p_supported_freq(struct p2p_data *p2p, unsigned int freq);
 
 void p2p_update_channel_list(struct p2p_data *p2p, struct p2p_channels *chan);
 
+/**
+ * p2p_set_best_channels - Update best channel information
+ * @p2p: P2P module context from p2p_init()
+ * @freq_24: Frequency (MHz) of best channel in 2.4 GHz band
+ * @freq_5: Frequency (MHz) of best channel in 5 GHz band
+ * @freq_overall: Frequency (MHz) of best channel overall
+ */
+void p2p_set_best_channels(struct p2p_data *p2p, int freq_24, int freq_5,
+                          int freq_overall);
+
 #endif /* P2P_H */