| 233 | } |
| 234 | |
| 235 | static void |
| 236 | dfs_timeout(void *arg) |
| 237 | { |
| 238 | struct ieee80211com *ic = arg; |
| 239 | struct ieee80211_dfs_state *dfs = &ic->ic_dfs; |
| 240 | struct ieee80211_channel *c; |
| 241 | int i, oldest, now; |
| 242 | |
| 243 | IEEE80211_LOCK_ASSERT(ic); |
| 244 | |
| 245 | now = oldest = ticks; |
| 246 | for (i = 0; i < ic->ic_nchans; i++) { |
| 247 | c = &ic->ic_channels[i]; |
| 248 | if (IEEE80211_IS_CHAN_RADAR(c)) { |
| 249 | if (ieee80211_time_after_eq(now, dfs->nol_event[i]+NOL_TIMEOUT)) { |
| 250 | c->ic_state &= ~IEEE80211_CHANSTATE_RADAR; |
| 251 | if (c->ic_state & IEEE80211_CHANSTATE_NORADAR) { |
| 252 | /* |
| 253 | * NB: do this here so we get only one |
| 254 | * msg instead of one for every channel |
| 255 | * table entry. |
| 256 | */ |
| 257 | ic_printf(ic, "radar on channel %u " |
| 258 | "(%u MHz) cleared after timeout\n", |
| 259 | c->ic_ieee, c->ic_freq); |
| 260 | /* notify user space */ |
| 261 | c->ic_state &= |
| 262 | ~IEEE80211_CHANSTATE_NORADAR; |
| 263 | ieee80211_notify_radar(ic, c); |
| 264 | } |
| 265 | } else if (dfs->nol_event[i] < oldest) |
| 266 | oldest = dfs->nol_event[i]; |
| 267 | } |
| 268 | } |
| 269 | if (oldest != now) { |
| 270 | /* arrange to process next channel up for a status change */ |
| 271 | callout_schedule(&dfs->nol_timer, oldest + NOL_TIMEOUT - now); |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | static void |
| 276 | announce_radar(struct ieee80211com *ic, const struct ieee80211_channel *curchan, |
nothing calls this directly
no test coverage detected