svn commit: r198932 - projects/mips/sys/mips/atheros

Oleksandr Tymoshenko gonzo at FreeBSD.org
Wed Nov 4 23:33:37 UTC 2009


Author: gonzo
Date: Wed Nov  4 23:33:36 2009
New Revision: 198932
URL: http://svn.freebsd.org/changeset/base/198932

Log:
  - Remove noisy "Implement me" stubs
  - Handle SIOCSIFFLAGS ioctl

Modified:
  projects/mips/sys/mips/atheros/if_arge.c
  projects/mips/sys/mips/atheros/if_argevar.h

Modified: projects/mips/sys/mips/atheros/if_arge.c
==============================================================================
--- projects/mips/sys/mips/atheros/if_arge.c	Wed Nov  4 22:39:18 2009	(r198931)
+++ projects/mips/sys/mips/atheros/if_arge.c	Wed Nov  4 23:33:36 2009	(r198932)
@@ -272,6 +272,7 @@ arge_attach(device_t dev)
 	ifp->if_ioctl = arge_ioctl;
 	ifp->if_start = arge_start;
 	ifp->if_init = arge_init;
+	sc->arge_if_flags = ifp->if_flags;
 
 	/* XXX: add real size */
 	IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
@@ -900,25 +901,38 @@ arge_ioctl(struct ifnet *ifp, u_long com
 
 	switch (command) {
 	case SIOCSIFFLAGS:
-		printf("Implement me: SIOCSIFFLAGS\n");
+		ARGE_LOCK(sc);
+		if ((ifp->if_flags & IFF_UP) != 0) {
+			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
+				if (((ifp->if_flags ^ sc->arge_if_flags)
+				    & (IFF_PROMISC | IFF_ALLMULTI)) != 0)
+					arge_rx_locked(sc);
+			} else {
+				if (!sc->arge_detach)
+					arge_init_locked(sc);
+			}
+		} else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
+			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+			arge_stop(sc);
+		}
+		sc->arge_if_flags = ifp->if_flags;
+		ARGE_UNLOCK(sc);
 		error = 0;
 		break;
 	case SIOCADDMULTI:
 	case SIOCDELMULTI:
-		printf("Implement me: SIOCDELMULTI\n");
+		/* XXX: implement SIOCDELMULTI */
 		error = 0;
 		break;
 	case SIOCGIFMEDIA:
 	case SIOCSIFMEDIA:
-		printf("Implement me: SIOCSIFMEDIA\n");
 		mii = device_get_softc(sc->arge_miibus);
 		error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
 		break;
         case SIOCSIFCAP:
-		printf("Implement me: SIOCSIFCAP\n");
+		/* XXX: Check other capabilities */
 #ifdef DEVICE_POLLING
                 mask = ifp->if_capenable ^ ifr->ifr_reqcap;
-		error  = 0;
                 if (mask & IFCAP_POLLING) {
                         if (ifr->ifr_reqcap & IFCAP_POLLING) {
 				ARGE_WRITE(sc, AR71XX_DMA_INTR, 0);
@@ -936,6 +950,7 @@ arge_ioctl(struct ifnet *ifp, u_long com
                                 ARGE_UNLOCK(sc);
                         }
                 }
+		error = 0;
                 break;
 #endif
 	default:

Modified: projects/mips/sys/mips/atheros/if_argevar.h
==============================================================================
--- projects/mips/sys/mips/atheros/if_argevar.h	Wed Nov  4 22:39:18 2009	(r198931)
+++ projects/mips/sys/mips/atheros/if_argevar.h	Wed Nov  4 23:33:36 2009	(r198932)
@@ -133,6 +133,7 @@ struct arge_softc {
 	int			arge_phy_num;
 	uint32_t		arge_ddr_flush_reg;
 	uint32_t		arge_pll_reg;
+	int			arge_if_flags;
 };
 
 #endif /* __IF_ARGEVAR_H__ */


More information about the svn-src-projects mailing list