- 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]
This commit is contained in:
Gleb Smirnoff 2014-09-28 14:05:18 +00:00
parent 4ac1175e89
commit bd071d4d19
8 changed files with 25 additions and 42 deletions

View File

@ -5828,7 +5828,7 @@ bge_ioctl(if_t ifp, u_long command, caddr_t data)
#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);

View File

@ -307,7 +307,7 @@ static int em_sysctl_eee(SYSCTL_HANDLER_ARGS);
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_t data)
#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_t data)
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);

View File

@ -260,7 +260,7 @@ static void lem_add_rx_process_limit(struct adapter *, const char *,
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, caddr_t data)
#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, caddr_t data)
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);

View File

@ -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 mbuf **m_head)
}
#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, caddr_t data)
#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, caddr_t data)
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);

View File

@ -1630,7 +1630,7 @@ nfe_free_tx_ring(struct nfe_softc *sc, struct nfe_tx_ring *ring)
}
#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 data)
#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);

View File

@ -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, struct ifnet *ifp)
* 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;

View File

@ -599,5 +599,13 @@ int drbr_enqueue_drv(if_t ifp, struct buf_ring *br, struct mbuf *m);
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_ */

View File

@ -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_ */