@@ -3418,6 +3418,20 @@ static int p2p_ctrl_set(struct wpa_supplicant
*wpa_s, char *cmd)
return 0;
}
+ if (os_strcmp(cmd, "conc_priority") == 0) {
+ if(os_strncmp(cmd+strlen("conc_priority")+1, "sta", 3) == 0)
+ os_strncpy(wpa_s->global->conc_priority, "sta", 3);
+ else if(os_strncmp(cmd+strlen("conc_priority")+1, "p2p", 3) == 0)
+ os_strncpy(wpa_s->global->conc_priority, "p2p", 3);
+ else {
+ wpa_printf(MSG_ERROR, " conc_priority arg should be either sta or p2p");
+ return -1;
+ }
+ wpa_printf(MSG_DEBUG, "Single Channel Concurrency: Prioritize %s",
+ wpa_s->global->conc_priority);
+ return 0;
+ }
+
if (os_strcmp(cmd, "force_long_sd") == 0) {
wpa_s->force_long_sd = atoi(param);
return 0;
b/wpa_supplicant/wpa_supplicant.c
@@ -3152,9 +3152,19 @@ void wpas_connection_failed(struct wpa_supplicant
*wpa_s, const u8 *bssid)
1000 * (timeout % 1000));
}
-
int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s)
{
return wpa_s->conf->ap_scan == 2 ||
(wpa_s->drv_flags & WPA_DRIVER_FLAGS_BSS_SELECTION);
}
+
+int wpas_is_p2p_prioritized(struct wpa_supplicant *wpa_s)
+{
+ if(os_strncmp(wpa_s->global->conc_priority, "p2p", 3) == 0)
+ return 1;
+ else if(os_strncmp(wpa_s->global->conc_priority, "sta", 3) == 0)
+ return 0;
+
+ /* IF conc_priority is not set, return -1 */
+ return -1;
+}
b/wpa_supplicant/wpa_supplicant_i.h
@@ -228,6 +228,7 @@ struct wpa_global {
int cross_connection;
struct wpa_freq_range *p2p_disallow_freq;
unsigned int num_p2p_disallow_freq;
+ char conc_priority[5]; /* "sta" or "p2p" */
};
@@ -612,6 +613,7 @@ void wpa_supplicant_update_config(struct wpa_supplicant
*wpa_s);
void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s);
void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid);
int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s);
+int wpas_is_p2p_prioritized(struct wpa_supplicant *wpa_s);
/* events.c */