- if (local->scan_channel_idx >=
- local->hw.modes[local->scan_hw_mode_idx].num_channels) {
- local->scan_hw_mode_idx++;
- local->scan_channel_idx = 0;
+ if (local->scan_channel_idx >= local->scan_hw_mode->num_channels) {
+ if (local->scan_hw_mode->list.next != &local->modes_list) {
+ local->scan_hw_mode = list_entry(local->scan_hw_mode->list.next,
+ struct ieee80211_hw_mode,
+ list);
+ local->scan_channel_idx = 0;
+ }