| 370 | } |
| 371 | |
| 372 | static void |
| 373 | setmediamode(const char *val, int d, int s, const struct afswtch *afp) |
| 374 | { |
| 375 | struct ifmediareq *ifmr; |
| 376 | int mode; |
| 377 | |
| 378 | ifmr = ifmedia_getstate(s); |
| 379 | |
| 380 | mode = get_media_mode(IFM_TYPE(ifmr->ifm_ulist[0]), val); |
| 381 | |
| 382 | strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); |
| 383 | ifr.ifr_media = (ifmr->ifm_current & ~IFM_MMASK) | mode; |
| 384 | |
| 385 | ifmr->ifm_current = ifr.ifr_media; |
| 386 | callback_register(setifmediacallback, (void *)ifmr); |
| 387 | } |
| 388 | |
| 389 | /********************************************************************** |
| 390 | * A good chunk of this is duplicated from sys/net/if_media.c |
nothing calls this directly
no test coverage detected