| 285 | } |
| 286 | |
| 287 | static void |
| 288 | setmedia(const char *val, int d, int s, const struct afswtch *afp) |
| 289 | { |
| 290 | struct ifmediareq *ifmr; |
| 291 | int subtype; |
| 292 | |
| 293 | ifmr = ifmedia_getstate(s); |
| 294 | |
| 295 | /* |
| 296 | * We are primarily concerned with the top-level type. |
| 297 | * However, "current" may be only IFM_NONE, so we just look |
| 298 | * for the top-level type in the first "supported type" |
| 299 | * entry. |
| 300 | * |
| 301 | * (I'm assuming that all supported media types for a given |
| 302 | * interface will be the same top-level type..) |
| 303 | */ |
| 304 | subtype = get_media_subtype(IFM_TYPE(ifmr->ifm_ulist[0]), val); |
| 305 | |
| 306 | strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); |
| 307 | ifr.ifr_media = (ifmr->ifm_current & IFM_IMASK) | |
| 308 | IFM_TYPE(ifmr->ifm_ulist[0]) | subtype; |
| 309 | |
| 310 | ifmr->ifm_current = ifr.ifr_media; |
| 311 | callback_register(setifmediacallback, (void *)ifmr); |
| 312 | } |
| 313 | |
| 314 | static void |
| 315 | setmediaopt(const char *val, int d, int s, const struct afswtch *afp) |
nothing calls this directly
no test coverage detected