MCPcopy Create free account
hub / github.com/F-Stack/f-stack / setmediamode

Function setmediamode

tools/ifconfig/ifmedia.c:372–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372static void
373setmediamode(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

Callers

nothing calls this directly

Calls 4

ifmedia_getstateFunction · 0.85
get_media_modeFunction · 0.85
callback_registerFunction · 0.85
strlcpyFunction · 0.50

Tested by

no test coverage detected