• Home
  • Raw
  • Download

Lines Matching refs:iface

21 static int dfs_get_used_n_chans(struct hostapd_iface *iface, int *seg1)  in dfs_get_used_n_chans()  argument
27 if (iface->conf->ieee80211n && iface->conf->secondary_channel) in dfs_get_used_n_chans()
30 if (iface->conf->ieee80211ac) { in dfs_get_used_n_chans()
31 switch (iface->conf->vht_oper_chwidth) { in dfs_get_used_n_chans()
150 static int is_in_chanlist(struct hostapd_iface *iface, in is_in_chanlist() argument
155 if (!iface->conf->chanlist) in is_in_chanlist()
158 for (entry = iface->conf->chanlist; *entry != -1; entry++) { in is_in_chanlist()
173 static int dfs_find_channel(struct hostapd_iface *iface, in dfs_find_channel() argument
181 mode = iface->current_mode; in dfs_find_channel()
182 n_chans = dfs_get_used_n_chans(iface, &n_chans1); in dfs_find_channel()
189 if (iface->conf->ieee80211n && in dfs_find_channel()
190 iface->conf->secondary_channel && in dfs_find_channel()
198 if (!is_in_chanlist(iface, chan)) in dfs_find_channel()
213 static void dfs_adjust_vht_center_freq(struct hostapd_iface *iface, in dfs_adjust_vht_center_freq() argument
219 if (!iface->conf->ieee80211ac) in dfs_adjust_vht_center_freq()
227 switch (iface->conf->vht_oper_chwidth) { in dfs_adjust_vht_center_freq()
255 static int dfs_get_start_chan_idx(struct hostapd_iface *iface, int *seg1_start) in dfs_get_start_chan_idx() argument
259 int channel_no = iface->conf->channel; in dfs_get_start_chan_idx()
266 if (iface->conf->ieee80211n && iface->conf->secondary_channel == -1) in dfs_get_start_chan_idx()
270 if (iface->conf->ieee80211ac) { in dfs_get_start_chan_idx()
271 switch (iface->conf->vht_oper_chwidth) { in dfs_get_start_chan_idx()
276 iface->conf->vht_oper_centr_freq_seg0_idx - 6; in dfs_get_start_chan_idx()
280 iface->conf->vht_oper_centr_freq_seg0_idx - 14; in dfs_get_start_chan_idx()
284 iface->conf->vht_oper_centr_freq_seg0_idx - 6; in dfs_get_start_chan_idx()
286 iface->conf->vht_oper_centr_freq_seg1_idx - 6; in dfs_get_start_chan_idx()
297 mode = iface->current_mode; in dfs_get_start_chan_idx()
310 mode = iface->current_mode; in dfs_get_start_chan_idx()
326 mode->num_channels, channel_no, iface->conf->channel, in dfs_get_start_chan_idx()
327 iface->conf->ieee80211n, in dfs_get_start_chan_idx()
328 iface->conf->secondary_channel, in dfs_get_start_chan_idx()
329 iface->conf->vht_oper_chwidth); in dfs_get_start_chan_idx()
342 static int dfs_check_chans_radar(struct hostapd_iface *iface, in dfs_check_chans_radar() argument
349 mode = iface->current_mode; in dfs_check_chans_radar()
362 static int dfs_check_chans_available(struct hostapd_iface *iface, in dfs_check_chans_available() argument
369 mode = iface->current_mode; in dfs_check_chans_available()
390 static int dfs_check_chans_unavailable(struct hostapd_iface *iface, in dfs_check_chans_unavailable() argument
398 mode = iface->current_mode; in dfs_check_chans_unavailable()
414 dfs_get_valid_channel(struct hostapd_iface *iface, in dfs_get_valid_channel() argument
431 if (iface->current_mode == NULL) in dfs_get_valid_channel()
434 mode = iface->current_mode; in dfs_get_valid_channel()
439 num_available_chandefs = dfs_find_channel(iface, NULL, 0, skip_radar); in dfs_get_valid_channel()
445 dfs_find_channel(iface, &chan, chan_idx, skip_radar); in dfs_get_valid_channel()
448 if (iface->conf->secondary_channel) in dfs_get_valid_channel()
453 dfs_adjust_vht_center_freq(iface, chan, in dfs_get_valid_channel()
462 static int set_dfs_state_freq(struct hostapd_iface *iface, int freq, u32 state) in set_dfs_state_freq() argument
468 mode = iface->current_mode; in set_dfs_state_freq()
473 for (i = 0; i < iface->current_mode->num_channels; i++) { in set_dfs_state_freq()
474 chan = &iface->current_mode->channels[i]; in set_dfs_state_freq()
488 static int set_dfs_state(struct hostapd_iface *iface, int freq, int ht_enabled, in set_dfs_state() argument
497 mode = iface->current_mode; in set_dfs_state()
535 ret += set_dfs_state_freq(iface, frequency, state); in set_dfs_state()
543 static int dfs_are_channels_overlapped(struct hostapd_iface *iface, int freq, in dfs_are_channels_overlapped() argument
554 mode = iface->current_mode; in dfs_are_channels_overlapped()
555 start_chan_idx = dfs_get_start_chan_idx(iface, &start_chan_idx1); in dfs_are_channels_overlapped()
556 n_chans = dfs_get_used_n_chans(iface, &n_chans1); in dfs_are_channels_overlapped()
559 if (!dfs_check_chans_radar(iface, start_chan_idx, n_chans)) in dfs_are_channels_overlapped()
608 static unsigned int dfs_get_cac_time(struct hostapd_iface *iface, in dfs_get_cac_time() argument
616 mode = iface->current_mode; in dfs_get_cac_time()
636 int hostapd_handle_dfs(struct hostapd_iface *iface) in hostapd_handle_dfs() argument
642 iface->cac_started = 0; in hostapd_handle_dfs()
646 start_chan_idx = dfs_get_start_chan_idx(iface, in hostapd_handle_dfs()
652 n_chans = dfs_get_used_n_chans(iface, &n_chans1); in hostapd_handle_dfs()
655 iface->dfs_cac_ms = dfs_get_cac_time(iface, start_chan_idx, in hostapd_handle_dfs()
659 res = dfs_check_chans_radar(iface, start_chan_idx, n_chans); in hostapd_handle_dfs()
667 res = dfs_check_chans_available(iface, start_chan_idx, n_chans); in hostapd_handle_dfs()
675 res = dfs_check_chans_unavailable(iface, start_chan_idx, in hostapd_handle_dfs()
683 channel = dfs_get_valid_channel(iface, &sec, &cf1, &cf2, in hostapd_handle_dfs()
690 iface->freq = channel->freq; in hostapd_handle_dfs()
691 iface->conf->channel = channel->chan; in hostapd_handle_dfs()
692 iface->conf->secondary_channel = sec; in hostapd_handle_dfs()
693 iface->conf->vht_oper_centr_freq_seg0_idx = cf1; in hostapd_handle_dfs()
694 iface->conf->vht_oper_centr_freq_seg1_idx = cf2; in hostapd_handle_dfs()
699 hostapd_set_state(iface, HAPD_IFACE_DFS); in hostapd_handle_dfs()
700 wpa_printf(MSG_DEBUG, "DFS start CAC on %d MHz", iface->freq); in hostapd_handle_dfs()
701 wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_CAC_START in hostapd_handle_dfs()
703 iface->freq, in hostapd_handle_dfs()
704 iface->conf->channel, iface->conf->secondary_channel, in hostapd_handle_dfs()
705 iface->conf->vht_oper_chwidth, in hostapd_handle_dfs()
706 iface->conf->vht_oper_centr_freq_seg0_idx, in hostapd_handle_dfs()
707 iface->conf->vht_oper_centr_freq_seg1_idx, in hostapd_handle_dfs()
708 iface->dfs_cac_ms / 1000); in hostapd_handle_dfs()
710 res = hostapd_start_dfs_cac(iface, iface->conf->hw_mode, in hostapd_handle_dfs()
711 iface->freq, in hostapd_handle_dfs()
712 iface->conf->channel, in hostapd_handle_dfs()
713 iface->conf->ieee80211n, in hostapd_handle_dfs()
714 iface->conf->ieee80211ac, in hostapd_handle_dfs()
715 iface->conf->secondary_channel, in hostapd_handle_dfs()
716 iface->conf->vht_oper_chwidth, in hostapd_handle_dfs()
717 iface->conf->vht_oper_centr_freq_seg0_idx, in hostapd_handle_dfs()
718 iface->conf->vht_oper_centr_freq_seg1_idx); in hostapd_handle_dfs()
729 int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq, in hostapd_dfs_complete_cac() argument
733 wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_CAC_COMPLETED in hostapd_dfs_complete_cac()
739 set_dfs_state(iface, freq, ht_enabled, chan_offset, in hostapd_dfs_complete_cac()
742 iface->cac_started = 0; in hostapd_dfs_complete_cac()
743 hostapd_setup_interface_complete(iface, 0); in hostapd_dfs_complete_cac()
750 static int hostapd_dfs_start_channel_switch_cac(struct hostapd_iface *iface) in hostapd_dfs_start_channel_switch_cac() argument
760 iface->cac_started = 0; in hostapd_dfs_start_channel_switch_cac()
761 channel = dfs_get_valid_channel(iface, &secondary_channel, in hostapd_dfs_start_channel_switch_cac()
768 hostapd_setup_interface_complete(iface, err); in hostapd_dfs_start_channel_switch_cac()
774 wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_NEW_CHANNEL in hostapd_dfs_start_channel_switch_cac()
778 iface->freq = channel->freq; in hostapd_dfs_start_channel_switch_cac()
779 iface->conf->channel = channel->chan; in hostapd_dfs_start_channel_switch_cac()
780 iface->conf->secondary_channel = secondary_channel; in hostapd_dfs_start_channel_switch_cac()
781 iface->conf->vht_oper_centr_freq_seg0_idx = in hostapd_dfs_start_channel_switch_cac()
783 iface->conf->vht_oper_centr_freq_seg1_idx = in hostapd_dfs_start_channel_switch_cac()
787 hostapd_setup_interface_complete(iface, err); in hostapd_dfs_start_channel_switch_cac()
792 static int hostapd_csa_in_progress(struct hostapd_iface *iface) in hostapd_csa_in_progress() argument
795 for (i = 0; i < iface->num_bss; i++) in hostapd_csa_in_progress()
796 if (iface->bss[i]->csa_in_progress) in hostapd_csa_in_progress()
802 static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) in hostapd_dfs_start_channel_switch() argument
814 __func__, iface->cac_started ? "yes" : "no", in hostapd_dfs_start_channel_switch()
815 hostapd_csa_in_progress(iface) ? "yes" : "no"); in hostapd_dfs_start_channel_switch()
818 if (hostapd_csa_in_progress(iface)) in hostapd_dfs_start_channel_switch()
822 if (iface->cac_started) in hostapd_dfs_start_channel_switch()
823 return hostapd_dfs_start_channel_switch_cac(iface); in hostapd_dfs_start_channel_switch()
826 channel = dfs_get_valid_channel(iface, &secondary_channel, in hostapd_dfs_start_channel_switch()
838 channel = dfs_get_valid_channel(iface, &secondary_channel, in hostapd_dfs_start_channel_switch()
844 hostapd_disable_iface(iface); in hostapd_dfs_start_channel_switch()
848 iface->freq = channel->freq; in hostapd_dfs_start_channel_switch()
849 iface->conf->channel = channel->chan; in hostapd_dfs_start_channel_switch()
850 iface->conf->secondary_channel = secondary_channel; in hostapd_dfs_start_channel_switch()
851 iface->conf->vht_oper_centr_freq_seg0_idx = in hostapd_dfs_start_channel_switch()
853 iface->conf->vht_oper_centr_freq_seg1_idx = in hostapd_dfs_start_channel_switch()
856 hostapd_disable_iface(iface); in hostapd_dfs_start_channel_switch()
857 hostapd_enable_iface(iface); in hostapd_dfs_start_channel_switch()
863 wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_NEW_CHANNEL in hostapd_dfs_start_channel_switch()
872 iface->conf->hw_mode, in hostapd_dfs_start_channel_switch()
875 iface->conf->ieee80211n, in hostapd_dfs_start_channel_switch()
876 iface->conf->ieee80211ac, in hostapd_dfs_start_channel_switch()
878 iface->conf->vht_oper_chwidth, in hostapd_dfs_start_channel_switch()
881 iface->current_mode->vht_capab); in hostapd_dfs_start_channel_switch()
885 hostapd_disable_iface(iface); in hostapd_dfs_start_channel_switch()
889 for (i = 0; i < iface->num_bss; i++) { in hostapd_dfs_start_channel_switch()
890 err = hostapd_switch_channel(iface->bss[i], &csa_settings); in hostapd_dfs_start_channel_switch()
898 iface->freq = channel->freq; in hostapd_dfs_start_channel_switch()
899 iface->conf->channel = channel->chan; in hostapd_dfs_start_channel_switch()
900 iface->conf->secondary_channel = secondary_channel; in hostapd_dfs_start_channel_switch()
901 iface->conf->vht_oper_centr_freq_seg0_idx = in hostapd_dfs_start_channel_switch()
903 iface->conf->vht_oper_centr_freq_seg1_idx = in hostapd_dfs_start_channel_switch()
906 hostapd_disable_iface(iface); in hostapd_dfs_start_channel_switch()
907 hostapd_enable_iface(iface); in hostapd_dfs_start_channel_switch()
919 int hostapd_dfs_radar_detected(struct hostapd_iface *iface, int freq, in hostapd_dfs_radar_detected() argument
925 if (!iface->conf->ieee80211h) in hostapd_dfs_radar_detected()
928 wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_RADAR_DETECTED in hostapd_dfs_radar_detected()
933 set_dfs_state(iface, freq, ht_enabled, chan_offset, chan_width, in hostapd_dfs_radar_detected()
937 res = dfs_are_channels_overlapped(iface, freq, chan_width, cf1, cf2); in hostapd_dfs_radar_detected()
942 res = hostapd_dfs_start_channel_switch(iface); in hostapd_dfs_radar_detected()
948 int hostapd_dfs_nop_finished(struct hostapd_iface *iface, int freq, in hostapd_dfs_nop_finished() argument
952 wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_NOP_FINISHED in hostapd_dfs_nop_finished()
956 set_dfs_state(iface, freq, ht_enabled, chan_offset, chan_width, in hostapd_dfs_nop_finished()
962 int hostapd_is_dfs_required(struct hostapd_iface *iface) in hostapd_is_dfs_required() argument
966 if (!iface->conf->ieee80211h || !iface->current_mode || in hostapd_is_dfs_required()
967 iface->current_mode->mode != HOSTAPD_MODE_IEEE80211A) in hostapd_is_dfs_required()
971 start_chan_idx = dfs_get_start_chan_idx(iface, &start_chan_idx1); in hostapd_is_dfs_required()
976 n_chans = dfs_get_used_n_chans(iface, &n_chans1); in hostapd_is_dfs_required()
979 res = dfs_check_chans_radar(iface, start_chan_idx, n_chans); in hostapd_is_dfs_required()
983 res = dfs_check_chans_radar(iface, start_chan_idx1, n_chans1); in hostapd_is_dfs_required()