* Collect channel info from the kernel. We use this (mostly) * to handle mapping between frequency and IEEE channel number. */
| 229 | * to handle mapping between frequency and IEEE channel number. |
| 230 | */ |
| 231 | static void |
| 232 | getchaninfo(int s) |
| 233 | { |
| 234 | if (chaninfo != NULL) |
| 235 | return; |
| 236 | chaninfo = malloc(IEEE80211_CHANINFO_SIZE(MAXCHAN)); |
| 237 | if (chaninfo == NULL) |
| 238 | errx(1, "no space for channel list"); |
| 239 | if (get80211(s, IEEE80211_IOC_CHANINFO, chaninfo, |
| 240 | IEEE80211_CHANINFO_SIZE(MAXCHAN)) < 0) |
| 241 | err(1, "unable to get channel information"); |
| 242 | ifmr = ifmedia_getstate(s); |
| 243 | gethtconf(s); |
| 244 | getvhtconf(s); |
| 245 | } |
| 246 | |
| 247 | static struct regdata * |
| 248 | getregdata(void) |
no test coverage detected