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

Function emac_ioctl

freebsd/arm/allwinner/if_emac.c:739–785  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737}
738
739static int
740emac_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
741{
742 struct emac_softc *sc;
743 struct mii_data *mii;
744 struct ifreq *ifr;
745 int error = 0;
746
747 sc = ifp->if_softc;
748 ifr = (struct ifreq *)data;
749
750 switch (command) {
751 case SIOCSIFFLAGS:
752 EMAC_LOCK(sc);
753 if (ifp->if_flags & IFF_UP) {
754 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
755 if ((ifp->if_flags ^ sc->emac_if_flags) &
756 (IFF_PROMISC | IFF_ALLMULTI))
757 emac_set_rx_mode(sc);
758 } else
759 emac_init_locked(sc);
760 } else {
761 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
762 emac_stop_locked(sc);
763 }
764 sc->emac_if_flags = ifp->if_flags;
765 EMAC_UNLOCK(sc);
766 break;
767 case SIOCADDMULTI:
768 case SIOCDELMULTI:
769 EMAC_LOCK(sc);
770 if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
771 emac_set_rx_mode(sc);
772 }
773 EMAC_UNLOCK(sc);
774 break;
775 case SIOCGIFMEDIA:
776 case SIOCSIFMEDIA:
777 mii = device_get_softc(sc->emac_miibus);
778 error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
779 break;
780 default:
781 error = ether_ioctl(ifp, command, data);
782 break;
783 }
784 return (error);
785}
786
787static int
788emac_probe(device_t dev)

Callers

nothing calls this directly

Calls 6

emac_set_rx_modeFunction · 0.85
emac_init_lockedFunction · 0.85
emac_stop_lockedFunction · 0.85
device_get_softcFunction · 0.85
ifmedia_ioctlFunction · 0.85
ether_ioctlFunction · 0.85

Tested by

no test coverage detected