static int wpas_p2p_num_unused_channels(struct wpa_supplicant *wpa_s)
{
int *freqs;
- int num;
+ int num, unused;
freqs = os_calloc(wpa_s->num_multichan_concurrent, sizeof(int));
if (!freqs)
wpa_s->num_multichan_concurrent);
os_free(freqs);
- return wpa_s->num_multichan_concurrent - num;
+ unused = wpa_s->num_multichan_concurrent - num;
+ wpa_dbg(wpa_s, MSG_DEBUG, "P2P: num_unused_channels: %d", unused);
+ return unused;
}
os_free(freqs);
+ dump_freq_array(wpa_s, "valid for P2P", p2p_freqs, j);
+
return j;
}
}
+void dump_freq_array(struct wpa_supplicant *wpa_s, const char *title,
+ int *freq_array, unsigned int len)
+{
+ unsigned int i;
+
+ wpa_dbg(wpa_s, MSG_DEBUG, "Shared frequencies (len=%u): %s",
+ len, title);
+ for (i = 0; i < len; i++)
+ wpa_dbg(wpa_s, MSG_DEBUG, "freq[%u]: %d", i, freq_array[i]);
+}
+
+
/*
* Find the operating frequencies of any of the virtual interfaces that
* are using the same radio as the current interface.
int freq;
unsigned int idx = 0, i;
+ wpa_dbg(wpa_s, MSG_DEBUG,
+ "Determining shared radio frequencies (max len %u)", len);
os_memset(freq_array, 0, sizeof(int) * len);
/* First add the frequency of the local interface */
if (freq > 0 && idx < len &&
(idx == 0 || freq_array[0] != freq))
freq_array[idx++] = freq;
+ dump_freq_array(wpa_s, "No get_radio_name", freq_array, idx);
return idx;
}
rn = wpa_s->driver->get_radio_name(wpa_s->drv_priv);
- if (rn == NULL || rn[0] == '\0')
+ if (rn == NULL || rn[0] == '\0') {
+ dump_freq_array(wpa_s, "get_radio_name failed",
+ freq_array, idx);
return idx;
+ }
for (ifs = wpa_s->global->ifaces; ifs && idx < len;
ifs = ifs->next) {
if (i == idx)
freq_array[idx++] = freq;
}
+
+ dump_freq_array(wpa_s, "completed iteration", freq_array, idx);
return idx;
}
int wpas_init_ext_pw(struct wpa_supplicant *wpa_s);
+void dump_freq_array(struct wpa_supplicant *wpa_s, const char *title,
+ int *freq_array, unsigned int len);
int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
int *freq_array, unsigned int len);