| 351 | } |
| 352 | |
| 353 | static void |
| 354 | setmediainst(const char *val, int d, int s, const struct afswtch *afp) |
| 355 | { |
| 356 | struct ifmediareq *ifmr; |
| 357 | int inst; |
| 358 | |
| 359 | ifmr = ifmedia_getstate(s); |
| 360 | |
| 361 | inst = atoi(val); |
| 362 | if (inst < 0 || inst > (int)IFM_INST_MAX) |
| 363 | errx(1, "invalid media instance: %s", val); |
| 364 | |
| 365 | strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); |
| 366 | ifr.ifr_media = (ifmr->ifm_current & ~IFM_IMASK) | inst << IFM_ISHIFT; |
| 367 | |
| 368 | ifmr->ifm_current = ifr.ifr_media; |
| 369 | callback_register(setifmediacallback, (void *)ifmr); |
| 370 | } |
| 371 | |
| 372 | static void |
| 373 | setmediamode(const char *val, int d, int s, const struct afswtch *afp) |
nothing calls this directly
no test coverage detected