wpa_s->p2p_group_common_freqs = NULL;
wpa_s->p2p_group_common_freqs_num = 0;
wpa_s->p2p_go_do_acs = 0;
+ wpa_s->p2p_go_allow_dfs = 0;
wpa_s->waiting_presence_resp = 0;
if ((unsigned int) mode->channels[i].freq == freq) {
if (flags)
*flags = mode->channels[i].flag;
- if (mode->channels[i].flag &
- (HOSTAPD_CHAN_DISABLED |
- HOSTAPD_CHAN_RADAR))
+ if (mode->channels[i].flag & HOSTAPD_CHAN_DISABLED)
return NOT_ALLOWED;
if (mode->channels[i].flag & HOSTAPD_CHAN_NO_IR)
return NO_IR;
+ if (mode->channels[i].flag & HOSTAPD_CHAN_RADAR)
+ return RADAR;
return ALLOWED;
}
}
chans, num_chans);
if (!center_chan)
return NOT_ALLOWED;
- if (!is_6ghz && center_chan >= 58 && center_chan <= 138)
+ if (!wpa_s->p2p_go_allow_dfs &&
+ !is_6ghz && center_chan >= 58 && center_chan <= 138)
return NOT_ALLOWED; /* Do not allow DFS channels for P2P */
/* check all the channels are available */
&flags);
if (res == NOT_ALLOWED)
return NOT_ALLOWED;
+ if (res == RADAR)
+ ret = RADAR;
if (res == NO_IR)
ret = NO_IR;
if (!is_6ghz) {
if (res == NOT_ALLOWED)
return NOT_ALLOWED;
+ if (res == RADAR)
+ ret = RADAR;
if (res == NO_IR)
ret = NO_IR;
return NOT_ALLOWED;
if (res == NO_IR || res2 == NO_IR)
return NO_IR;
+ if (res == RADAR || res2 == RADAR)
+ return RADAR;
return res;
}
u16 ch;
int chan = channel;
- if (o->p2p == NO_P2P_SUPP ||
+ /* Allow DFS channels marked as NO_P2P_SUPP to be used with
+ * driver offloaded DFS. */
+ if ((o->p2p == NO_P2P_SUPP &&
+ (!is_dfs_global_op_class(o->op_class) ||
+ !wpa_s->p2p_go_allow_dfs)) ||
(is_6ghz_op_class(o->op_class) &&
wpa_s->conf->p2p_6ghz_disable))
continue;
return get_6ghz_sec_channel(channel);
return (o->bw == BW40MINUS) ? -1 : 1;
}
+ if (ret == RADAR && wpa_s->p2p_go_allow_dfs) {
+ /* Allow RADAR channels used for driver
+ * offloaded DFS */
+ return (o->bw == BW40MINUS) ? -1 : 1;
+ }
}
}
return 0;
{
const u8 *chans;
size_t num_chans;
+ enum chan_allowed ret;
- if (!wpas_p2p_verify_channel(wpa_s, mode, op_class, channel, BW80))
+ ret = wpas_p2p_verify_channel(wpa_s, mode, op_class, channel, BW80);
+ if (!(ret == ALLOWED || (ret == RADAR && wpa_s->p2p_go_allow_dfs)))
return 0;
if (is_6ghz_op_class(op_class)) {
{
const u8 *chans;
size_t num_chans;
+ enum chan_allowed ret;
- if (!wpas_p2p_verify_channel(wpa_s, mode, op_class, channel, BW160))
+ ret = wpas_p2p_verify_channel(wpa_s, mode, op_class, channel, BW160);
+ if (!(ret == ALLOWED || (ret == RADAR && wpa_s->p2p_go_allow_dfs)))
return 0;
if (is_6ghz_op_class(op_class)) {
chans = center_channels_6ghz_160mhz;
wpa_s->p2p_go_do_acs = 0;
}
+ if (go && wpa_s->p2p_go_allow_dfs) {
+ group_wpa_s->p2p_go_allow_dfs = wpa_s->p2p_go_allow_dfs;
+ wpa_s->p2p_go_allow_dfs = 0;
+ }
+
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Use separate group interface %s",
group_wpa_s->ifname);
group_wpa_s->p2p_first_connection_timeout = 0;
unsigned int p2p_disable_ip_addr_req:1;
unsigned int p2ps_method_config_any:1;
unsigned int p2p_cli_probe:1;
+ unsigned int p2p_go_allow_dfs:1;
enum hostapd_hw_mode p2p_go_acs_band;
int p2p_persistent_go_freq;
int p2p_persistent_id;
/* op_classes.c */
enum chan_allowed {
- NOT_ALLOWED, NO_IR, ALLOWED
+ NOT_ALLOWED, NO_IR, RADAR, ALLOWED
};
enum chan_allowed verify_channel(struct hostapd_hw_modes *mode, u8 op_class,