| 326 | } |
| 327 | |
| 328 | static void |
| 329 | domediaopt(const char *val, int clear, int s) |
| 330 | { |
| 331 | struct ifmediareq *ifmr; |
| 332 | int options; |
| 333 | |
| 334 | ifmr = ifmedia_getstate(s); |
| 335 | |
| 336 | options = get_media_options(IFM_TYPE(ifmr->ifm_ulist[0]), val); |
| 337 | |
| 338 | strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); |
| 339 | ifr.ifr_media = ifmr->ifm_current; |
| 340 | if (clear) |
| 341 | ifr.ifr_media &= ~options; |
| 342 | else { |
| 343 | if (options & IFM_HDX) { |
| 344 | ifr.ifr_media &= ~IFM_FDX; |
| 345 | options &= ~IFM_HDX; |
| 346 | } |
| 347 | ifr.ifr_media |= options; |
| 348 | } |
| 349 | ifmr->ifm_current = ifr.ifr_media; |
| 350 | callback_register(setifmediacallback, (void *)ifmr); |
| 351 | } |
| 352 | |
| 353 | static void |
| 354 | setmediainst(const char *val, int d, int s, const struct afswtch *afp) |
no test coverage detected