Date: Sun, 28 Sep 2014 14:05:18 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272257 - in head/sys: dev/bge dev/e1000 dev/fxp dev/nfe kern net Message-ID: <201409281405.s8SE5IlR059799@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Sun Sep 28 14:05:18 2014 New Revision: 272257 URL: http://svnweb.freebsd.org/changeset/base/272257 Log: - Remove empty wrappers ether_poll_[de]register_drv(). [1] - Move polling(9) declarations out of ifq.h back to if_var.h they are absolutely unrelated to queues. Submitted by: Mikhail <mp lenta.ru> [1] Modified: head/sys/dev/bge/if_bge.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_lem.c head/sys/dev/fxp/if_fxp.c head/sys/dev/nfe/if_nfe.c head/sys/kern/kern_poll.c head/sys/net/if_var.h head/sys/net/ifq.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/dev/bge/if_bge.c Sun Sep 28 14:05:18 2014 (r272257) @@ -5828,7 +5828,7 @@ bge_ioctl(if_t ifp, u_long command, cadd #ifdef DEVICE_POLLING if (mask & IFCAP_POLLING) { if (ifr->ifr_reqcap & IFCAP_POLLING) { - error = ether_poll_register_drv(bge_poll, ifp); + error = ether_poll_register(bge_poll, ifp); if (error) return (error); BGE_LOCK(sc); Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/dev/e1000/if_em.c Sun Sep 28 14:05:18 2014 (r272257) @@ -307,7 +307,7 @@ static int em_sysctl_eee(SYSCTL_HANDLER_ static __inline void em_rx_discard(struct rx_ring *, int); #ifdef DEVICE_POLLING -static poll_handler_drv_t em_poll; +static poll_handler_t em_poll; #endif /* POLLING */ /********************************************************************* @@ -787,7 +787,7 @@ em_detach(device_t dev) #ifdef DEVICE_POLLING if (if_getcapenable(ifp) & IFCAP_POLLING) - ether_poll_deregister_drv(ifp); + ether_poll_deregister(ifp); #endif if (adapter->led_dev != NULL) @@ -1208,7 +1208,7 @@ em_ioctl(if_t ifp, u_long command, caddr #ifdef DEVICE_POLLING if (mask & IFCAP_POLLING) { if (ifr->ifr_reqcap & IFCAP_POLLING) { - error = ether_poll_register_drv(em_poll, ifp); + error = ether_poll_register(em_poll, ifp); if (error) return (error); EM_CORE_LOCK(adapter); @@ -1216,7 +1216,7 @@ em_ioctl(if_t ifp, u_long command, caddr if_setcapenablebit(ifp, IFCAP_POLLING, 0); EM_CORE_UNLOCK(adapter); } else { - error = ether_poll_deregister_drv(ifp); + error = ether_poll_deregister(ifp); /* Enable interrupt even in error case */ EM_CORE_LOCK(adapter); em_enable_intr(adapter); Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/dev/e1000/if_lem.c Sun Sep 28 14:05:18 2014 (r272257) @@ -260,7 +260,7 @@ static void lem_add_rx_process_limit(str const char *, int *, int); #ifdef DEVICE_POLLING -static poll_handler_drv_t lem_poll; +static poll_handler_t lem_poll; #endif /* POLLING */ /********************************************************************* @@ -789,7 +789,7 @@ lem_detach(device_t dev) #ifdef DEVICE_POLLING if (if_getcapenable(ifp) & IFCAP_POLLING) - ether_poll_deregister_drv(ifp); + ether_poll_deregister(ifp); #endif if (adapter->led_dev != NULL) @@ -1119,7 +1119,7 @@ lem_ioctl(if_t ifp, u_long command, cadd #ifdef DEVICE_POLLING if (mask & IFCAP_POLLING) { if (ifr->ifr_reqcap & IFCAP_POLLING) { - error = ether_poll_register_drv(lem_poll, ifp); + error = ether_poll_register(lem_poll, ifp); if (error) return (error); EM_CORE_LOCK(adapter); @@ -1127,7 +1127,7 @@ lem_ioctl(if_t ifp, u_long command, cadd if_setcapenablebit(ifp, IFCAP_POLLING, 0); EM_CORE_UNLOCK(adapter); } else { - error = ether_poll_deregister_drv(ifp); + error = ether_poll_deregister(ifp); /* Enable interrupt even in error case */ EM_CORE_LOCK(adapter); lem_enable_intr(adapter); Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/dev/fxp/if_fxp.c Sun Sep 28 14:05:18 2014 (r272257) @@ -1008,7 +1008,7 @@ fxp_detach(device_t dev) #ifdef DEVICE_POLLING if (if_getcapenable(sc->ifp) & IFCAP_POLLING) - ether_poll_deregister_drv(sc->ifp); + ether_poll_deregister(sc->ifp); #endif FXP_LOCK(sc); @@ -1670,7 +1670,7 @@ fxp_encap(struct fxp_softc *sc, struct m } #ifdef DEVICE_POLLING -static poll_handler_drv_t fxp_poll; +static poll_handler_t fxp_poll; static int fxp_poll(if_t ifp, enum poll_cmd cmd, int count) @@ -2890,7 +2890,7 @@ fxp_ioctl(if_t ifp, u_long command, cadd #ifdef DEVICE_POLLING if (mask & IFCAP_POLLING) { if (ifr->ifr_reqcap & IFCAP_POLLING) { - error = ether_poll_register_drv(fxp_poll, ifp); + error = ether_poll_register(fxp_poll, ifp); if (error) return(error); FXP_LOCK(sc); @@ -2899,7 +2899,7 @@ fxp_ioctl(if_t ifp, u_long command, cadd if_setcapenablebit(ifp, IFCAP_POLLING, 0); FXP_UNLOCK(sc); } else { - error = ether_poll_deregister_drv(ifp); + error = ether_poll_deregister(ifp); /* Enable interrupts in any case */ FXP_LOCK(sc); CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, 0); Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/dev/nfe/if_nfe.c Sun Sep 28 14:05:18 2014 (r272257) @@ -1630,7 +1630,7 @@ nfe_free_tx_ring(struct nfe_softc *sc, s } #ifdef DEVICE_POLLING -static poll_handler_drv_t nfe_poll; +static poll_handler_t nfe_poll; static int @@ -1782,7 +1782,7 @@ nfe_ioctl(if_t ifp, u_long cmd, caddr_t #ifdef DEVICE_POLLING if ((mask & IFCAP_POLLING) != 0) { if ((ifr->ifr_reqcap & IFCAP_POLLING) != 0) { - error = ether_poll_register_drv(nfe_poll, ifp); + error = ether_poll_register(nfe_poll, ifp); if (error) break; NFE_LOCK(sc); Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/kern/kern_poll.c Sun Sep 28 14:05:18 2014 (r272257) @@ -451,19 +451,6 @@ netisr_poll(void) mtx_unlock(&poll_mtx); } -/* The following should be temporary, till all drivers use the driver API */ -int -ether_poll_register_drv(poll_handler_drv_t *h, if_t ifh) -{ - return (ether_poll_register((poll_handler_t *)h, (struct ifnet *)ifh)); -} - -int -ether_poll_deregister_drv(if_t ifh) -{ - return (ether_poll_deregister((struct ifnet *)ifh)); -} - /* * Try to register routine for polling. Returns 0 if successful * (and polling should be enabled), error code otherwise. @@ -472,7 +459,7 @@ ether_poll_deregister_drv(if_t ifh) * This is called from within the *_ioctl() functions. */ int -ether_poll_register(poll_handler_t *h, struct ifnet *ifp) +ether_poll_register(poll_handler_t *h, if_t ifp) { int i; @@ -519,7 +506,7 @@ ether_poll_register(poll_handler_t *h, s * Remove interface from the polling list. Called from *_ioctl(), too. */ int -ether_poll_deregister(struct ifnet *ifp) +ether_poll_deregister(if_t ifp) { int i; Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/net/if_var.h Sun Sep 28 14:05:18 2014 (r272257) @@ -599,5 +599,13 @@ int drbr_enqueue_drv(if_t ifp, struct bu void if_hw_tsomax_common(if_t ifp, struct ifnet_hw_tsomax *); int if_hw_tsomax_update(if_t ifp, struct ifnet_hw_tsomax *); +#ifdef DEVICE_POLLING +enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS }; + +typedef int poll_handler_t(if_t ifp, enum poll_cmd cmd, int count); +int ether_poll_register(poll_handler_t *h, if_t ifp); +int ether_poll_deregister(if_t ifp); +#endif /* DEVICE_POLLING */ + #endif /* _KERNEL */ #endif /* !_NET_IF_VAR_H_ */ Modified: head/sys/net/ifq.h ============================================================================== --- head/sys/net/ifq.h Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/net/ifq.h Sun Sep 28 14:05:18 2014 (r272257) @@ -481,17 +481,5 @@ void if_qflush(struct ifnet *); void ifq_init(struct ifaltq *, struct ifnet *ifp); void ifq_delete(struct ifaltq *); -#ifdef DEVICE_POLLING -enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS }; - -typedef int poll_handler_t(struct ifnet *ifp, enum poll_cmd cmd, int count); -int ether_poll_register(poll_handler_t *h, struct ifnet *ifp); -int ether_poll_deregister(struct ifnet *ifp); -/* The following should be temporary, till all drivers use the driver API */ -typedef int poll_handler_drv_t(if_t ifh, enum poll_cmd cmd, int count); -int ether_poll_register_drv(poll_handler_drv_t *h, if_t ifh); -int ether_poll_deregister_drv(if_t ifh); -#endif /* DEVICE_POLLING */ - #endif /* _KERNEL */ #endif /* !_NET_IFQ_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409281405.s8SE5IlR059799>