#include "opt_compat.h"
#include "opt_inet6.h"
#include "opt_inet.h"
-#include "opt_polling.h"
#include "opt_ifpoll.h"
#include <sys/param.h>
return ifp->if_cpuid;
}
-#ifdef DEVICE_POLLING
-static int
-if_start_cpuid_poll(struct ifnet *ifp)
-{
- int poll_cpuid = ifp->if_poll_cpuid;
-
- if (poll_cpuid >= 0)
- return poll_cpuid;
- else
- return ifp->if_cpuid;
-}
-#endif
-
#ifdef IFPOLL_ENABLE
static int
if_start_cpuid_npoll(struct ifnet *ifp)
ifp->if_start_cpuid = if_start_cpuid;
ifp->if_cpuid = 0;
-#ifdef DEVICE_POLLING
- /* Device is not in polling mode by default */
- ifp->if_poll_cpuid = -1;
- if (ifp->if_poll != NULL)
- ifp->if_start_cpuid = if_start_cpuid_poll;
-#endif
#ifdef IFPOLL_ENABLE
/* Device is not in polling mode by default */
ifp->if_npoll_cpuid = -1;
* Remove routes and flush queues.
*/
crit_enter();
-#ifdef DEVICE_POLLING
- if (ifp->if_flags & IFF_POLLING)
- ether_poll_deregister(ifp);
-#endif
#ifdef IFPOLL_ENABLE
if (ifp->if_flags & IFF_NPOLLING)
ifpoll_deregister(ifp);
break;
case SIOCGIFPOLLCPU:
-#ifdef DEVICE_POLLING
- ifr->ifr_pollcpu = ifp->if_poll_cpuid;
-#else
ifr->ifr_pollcpu = -1;
-#endif
break;
case SIOCSIFPOLLCPU:
-#ifdef DEVICE_POLLING
- if ((ifp->if_flags & IFF_POLLING) == 0)
- ether_pollcpu_register(ifp, ifr->ifr_pollcpu);
-#endif
break;
case SIOCSIFFLAGS:
crit_exit();
}
-#ifdef DEVICE_POLLING
- if ((new_flags ^ ifp->if_flags) & IFF_POLLING) {
- if (new_flags & IFF_POLLING) {
- ether_poll_register(ifp);
- } else {
- ether_poll_deregister(ifp);
- }
- }
-#endif
#ifdef IFPOLL_ENABLE
if ((new_flags ^ ifp->if_flags) & IFF_NPOLLING) {
if (new_flags & IFF_NPOLLING)
};
/*
- * Note of DEVICE_POLLING
- * 1) Any file(*.c) that depends on DEVICE_POLLING supports in this
- * file should include opt_polling.h at its beginning.
- * 2) When struct changes, which are conditioned by DEVICE_POLLING,
+ * Note of IFPOLL_ENABLE
+ * 1) Any file(*.c) that depends on IFPOLL_ENABLE supports in this
+ * file should include opt_ifpoll.h at its beginning.
+ * 2) When struct changes, which are conditioned by IFPOLL_ENABLE,
* are to be introduced, please keep the struct's size and layout
- * same, no matter whether DEVICE_POLLING is defined or not.
- * See ifnet.if_poll and ifnet.if_poll_unused for example.
+ * same, no matter whether IFPOLL_ENABLE is defined or not.
+ * See ifnet.if_npoll and ifnet.if_npoll_unused for example.
*/
-#ifdef DEVICE_POLLING
-enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS, POLL_DEREGISTER,
- POLL_REGISTER };
-#endif
-
enum ifnet_serialize {
IFNET_SERIALIZE_ALL,
IFNET_SERIALIZE_MAIN,
int (*if_start_cpuid) /* cpuid to run if_start */
(struct ifnet *);
TAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if */
-#ifdef DEVICE_POLLING
- void (*if_poll) /* IFF_POLLING support */
- (struct ifnet *, enum poll_cmd, int);
- int if_poll_cpuid;
-#else
- /* Place holders */
- void (*if_poll_unused)(void);
- int if_poll_cpuid_used;
-#endif
+ void (*if_unused1)(void);
+ int if_unused2;
void (*if_serialize)
(struct ifnet *, enum ifnet_serialize);
void (*if_deserialize)
((struct sockaddr_dl *)(ifp)->if_lladdr->ifa_addr)
#define IF_LLADDR(ifp) LLADDR(IF_LLSOCKADDR(ifp))
-#ifdef DEVICE_POLLING
-typedef void poll_handler_t (struct ifnet *ifp, enum poll_cmd cmd, int count);
-int ether_poll_register(struct ifnet *);
-int ether_poll_deregister(struct ifnet *);
-int ether_pollcpu_register(struct ifnet *, int);
-#endif /* DEVICE_POLLING */
-
#ifdef IFPOLL_ENABLE
int ifpoll_register(struct ifnet *);
int ifpoll_deregister(struct ifnet *);