From nobody Fri Jan 13 02:32:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NtQSQ6bgZz2pCt5; Fri, 13 Jan 2023 02:32:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NtQSQ6Q8Gz3sCb; Fri, 13 Jan 2023 02:32:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673577174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=awdPabQi7ltdofM0PGGYQXlWaTB0U0xtM2CUL8bh6fE=; b=j3sBCjnkaAe2g7f4VK+M5n8Tmioiy5YKlChEH+3oRhu9LQBPa3j3iEKhRww77hOoITxLIC M1HSyDtTlDQTdZ9nJlcSh5NLmRmmfDHChKX7ue9DcQmpD/jTi3Evqj5riy6x7U2iErJjpt 6+Ra/fmi0muuLPDIcFNUdpH+M6I6YKpxJigFsQEMREh71Js+fTyggGEyT99yD8Tufinjdz cl3VGyLQyMw0LSKCrSiuvmLptnqQJcYJrWzpmeK/2m5qn+moK5IREjA4j+0NY9tz7z8ICT rpdd+Ns7xpq4peNl9YOh40zmWZw9BEjYYmTfWeqT/Axds4GeGCB47CeVzV0yLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673577174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=awdPabQi7ltdofM0PGGYQXlWaTB0U0xtM2CUL8bh6fE=; b=CxHjCypB6edbdQdfW4exVfrFy/n/NXUAMaJ9cuppTKLHla9pcUSTHY1vGpFhBkASliIPvZ Hh2QbfyE4HdPabcuW/SUft99ikHMSCMRAdYabv4Wr19otBg0tAKk+Q/LF+AEnNyfwbEgew /tCGzHpteh/i/aUbq3ISXvIkcaj4qOEwwvuOXiRT/pYjM/LcME0j4ClPJKVBLvMVj15yH1 Z80kAuyTpo6TrCi9n4X8wAJt17iIikRi6VNkh4csq0LHiNleFkYi7hbW3/VfPfvtXHiOKg WiPFiVYP1xOsT3TzsTdoybPiHFk+uzo+JgHLqi8dLQMo2JJtJ2VNJrOX+l6EkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673577174; a=rsa-sha256; cv=none; b=aR2juRvGszPJldP8NtiEXH20u/IketcFCplI8TObAT0vAEsWB7QZvl7/AW5GvYJdxXf2BP 91WOdqxdbvNNiCaTofNbQ+Bw+pKSWz42wusWMEkPfcAdT1lqFwbrBbrA1SxToW7NG8eJWO Sdh3ZgEC7/ci1wX01kBcoidyedgt3dbWg89vO2H+Vhw4GlhrdlZjrLoHlNEdHUOtZisVrg cPK+bEkBadlQr394x542XInsL3WmUKeY6mkTzeRNuWeFk7UfClauuxy0kw30CRVi7MRK1I FpsPwU8+HS56oKn9OgWSj/9/mlBrtBsuQLGAl7guMJKzifm9/JOGYP9JyIrZug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NtQSQ5SYlzrGR; Fri, 13 Jan 2023 02:32:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30D2WsgZ022767; Fri, 13 Jan 2023 02:32:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30D2Ws2K022765; Fri, 13 Jan 2023 02:32:54 GMT (envelope-from git) Date: Fri, 13 Jan 2023 02:32:54 GMT Message-Id: <202301130232.30D2Ws2K022765@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: ae3301084da1 - main - Revert "ifnet/API: Move the IfAPI from if_var.h to if.h" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae3301084da1a0e643a7589930186d67f0910b65 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=ae3301084da1a0e643a7589930186d67f0910b65 commit ae3301084da1a0e643a7589930186d67f0910b65 Author: Justin Hibbits AuthorDate: 2023-01-13 00:18:40 +0000 Commit: Justin Hibbits CommitDate: 2023-01-13 02:29:19 +0000 Revert "ifnet/API: Move the IfAPI from if_var.h to if.h" should be a fully user-facing header, so these APIs don't belong there. Revert and will find another approach. This reverts commit fe33e0ab83d1fbc3c5cd4a2591ba0036e47b1fec. Fixes: fe33e0ab83d1 Sponsored by: Juniper Networks, Inc. --- sys/net/if.h | 157 ------------------------------------------------------- sys/net/if_var.h | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 145 insertions(+), 157 deletions(-) diff --git a/sys/net/if.h b/sys/net/if.h index b46cc0fa4747..888e7d5d7320 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -657,169 +657,12 @@ struct ifdownreason { typedef struct ifnet * if_t; -union if_snd_tag_alloc_params; -union if_snd_tag_query_params; -union if_snd_tag_modify_params; - -typedef enum { - IFCOUNTER_IPACKETS = 0, - IFCOUNTER_IERRORS, - IFCOUNTER_OPACKETS, - IFCOUNTER_OERRORS, - IFCOUNTER_COLLISIONS, - IFCOUNTER_IBYTES, - IFCOUNTER_OBYTES, - IFCOUNTER_IMCASTS, - IFCOUNTER_OMCASTS, - IFCOUNTER_IQDROPS, - IFCOUNTER_OQDROPS, - IFCOUNTER_NOPROTO, - IFCOUNTERS /* Array size. */ -} ift_counter; - - -struct mbuf; -struct route; -struct m_snd_tag; - -typedef void (*if_start_fn_t)(if_t); -typedef int (*if_ioctl_fn_t)(if_t, u_long, caddr_t); -typedef void (*if_init_fn_t)(void *); -typedef void (*if_input_fn_t)(if_t, struct mbuf *); -typedef int (*if_output_fn_t) - (if_t, struct mbuf *, const struct sockaddr *, struct route *); -typedef void (*if_qflush_fn_t)(if_t); -typedef int (*if_transmit_fn_t)(if_t, struct mbuf *); -typedef uint64_t (*if_get_counter_t)(if_t, ift_counter); - -typedef int (if_snd_tag_alloc_t)(if_t, union if_snd_tag_alloc_params *, - struct m_snd_tag **); -typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union if_snd_tag_modify_params *); -typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union if_snd_tag_query_params *); -typedef void (if_snd_tag_free_t)(struct m_snd_tag *); -typedef struct m_snd_tag *(if_next_send_tag_t)(struct m_snd_tag *); - #ifdef _KERNEL - #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_IFADDR); MALLOC_DECLARE(M_IFMADDR); #endif -struct ifnet* if_alloc(u_char); -struct ifnet* if_alloc_dev(u_char, device_t dev); -void if_attach(if_t); -void if_free(if_t); -void if_initname(if_t, const char *, int); -void if_down(if_t); -void if_link_state_change(if_t, int); -int if_printf(if_t, const char *, ...) __printflike(2, 3); - -uint64_t if_get_counter_default(if_t, ift_counter); -void if_inc_counter(if_t, ift_counter, int64_t); - -uint64_t if_setbaudrate(if_t ifp, uint64_t baudrate); -uint64_t if_getbaudrate(const if_t ifp); -int if_setcapabilities(if_t ifp, int capabilities); -int if_setcapabilitiesbit(if_t ifp, int setbit, int clearbit); -int if_getcapabilities(const if_t ifp); -int if_togglecapenable(if_t ifp, int togglecap); -int if_setcapenable(if_t ifp, int capenable); -int if_setcapenablebit(if_t ifp, int setcap, int clearcap); -int if_getcapenable(const if_t ifp); -int if_getdunit(const if_t ifp); -int if_getindex(const if_t ifp); -const char *if_getdname(const if_t ifp); -void if_setdname(if_t ifp, const char *name); -const char *if_name(if_t ifp); -int if_setname(if_t ifp, const char *name); -void if_setdescr(if_t ifp, char *descrbuf); -char *if_allocdescr(size_t sz, int malloc_flag); -void if_freedescr(char *descrbuf); -int if_getalloctype(const if_t ifp); -int if_setdev(if_t ifp, void *dev); -int if_setdrvflagbits(if_t ifp, int if_setflags, int clear_flags); -int if_getdrvflags(const if_t ifp); -int if_setdrvflags(if_t ifp, int flags); -int if_clearhwassist(if_t ifp); -int if_sethwassistbits(if_t ifp, int toset, int toclear); -int if_sethwassist(if_t ifp, int hwassist_bit); -int if_gethwassist(const if_t ifp); -int if_togglehwassist(if_t ifp, int toggle_bits); -int if_setsoftc(if_t ifp, void *softc); -void *if_getsoftc(if_t ifp); -int if_setflags(if_t ifp, int flags); -int if_gethwaddr(const if_t ifp, struct ifreq *); -int if_setmtu(if_t ifp, int mtu); -int if_getmtu(const if_t ifp); -int if_getmtu_family(const if_t ifp, int family); -int if_setflagbits(if_t ifp, int set, int clear); -int if_getflags(const if_t ifp); -int if_sendq_empty(if_t ifp); -int if_setsendqready(if_t ifp); -int if_setsendqlen(if_t ifp, int tx_desc_count); -int if_sethwtsomax(if_t ifp, u_int if_hw_tsomax); -int if_sethwtsomaxsegcount(if_t ifp, u_int if_hw_tsomaxsegcount); -int if_sethwtsomaxsegsize(if_t ifp, u_int if_hw_tsomaxsegsize); -u_int if_gethwtsomax(const if_t ifp); -u_int if_gethwtsomaxsegcount(const if_t ifp); -u_int if_gethwtsomaxsegsize(const if_t ifp); -int if_input(if_t ifp, struct mbuf* sendmp); -int if_sendq_prepend(if_t ifp, struct mbuf *m); -struct mbuf *if_dequeue(if_t ifp); -int if_setifheaderlen(if_t ifp, int len); -void if_setrcvif(struct mbuf *m, if_t ifp); -void if_setvtag(struct mbuf *m, u_int16_t tag); -u_int16_t if_getvtag(struct mbuf *m); -int if_vlantrunkinuse(if_t ifp); -caddr_t if_getlladdr(const if_t ifp); -void *if_gethandle(u_char); -void if_bpfmtap(if_t ifp, struct mbuf *m); -void if_etherbpfmtap(if_t ifp, struct mbuf *m); -void if_vlancap(if_t ifp); -int if_transmit(if_t ifp, struct mbuf *m); -int if_init(if_t ifp); - -/* - * Traversing through interface address lists. - */ -struct sockaddr_dl; -typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int); -u_int if_foreach_lladdr(if_t, iflladdr_cb_t, void *); -u_int if_foreach_llmaddr(if_t, iflladdr_cb_t, void *); -u_int if_lladdr_count(if_t); -u_int if_llmaddr_count(if_t); - -int if_getamcount(const if_t ifp); -struct ifaddr * if_getifaddr(const if_t ifp); -typedef u_int if_addr_cb_t(void *, struct ifaddr *, u_int); -u_int if_foreach_addr_type(if_t ifp, int type, if_addr_cb_t cb, void *cb_arg); - -/* Functions */ -void if_setinitfn(if_t ifp, if_init_fn_t); -void if_setinputfn(if_t ifp, if_input_fn_t); -void if_setioctlfn(if_t ifp, if_ioctl_fn_t); -void if_setoutputfn(if_t ifp, int(*) - (if_t, struct mbuf *, const struct sockaddr *, struct route *)); -void if_setstartfn(if_t ifp, void (*)(if_t)); -void if_settransmitfn(if_t ifp, if_transmit_fn_t); -void if_setqflushfn(if_t ifp, if_qflush_fn_t); -void if_setgetcounterfn(if_t ifp, if_get_counter_t); -void if_setsndtagallocfn(if_t ifp, if_snd_tag_alloc_t); - -/* accessors for struct ifreq */ -void *ifr_data_get_ptr(void *ifrp); -void *ifr_buffer_get_buffer(void *data); -size_t ifr_buffer_get_length(void *data); - -#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 */ - extern struct sx ifnet_detach_sxlock; struct nvlist; diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 1aaabc8e3124..2712ac74a09d 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -108,6 +108,32 @@ VNET_DECLARE(struct hhook_head *, ipsec_hhh_out[HHOOK_IPSEC_COUNT]); #define V_ipsec_hhh_out VNET(ipsec_hhh_out) #endif /* _KERNEL */ +typedef enum { + IFCOUNTER_IPACKETS = 0, + IFCOUNTER_IERRORS, + IFCOUNTER_OPACKETS, + IFCOUNTER_OERRORS, + IFCOUNTER_COLLISIONS, + IFCOUNTER_IBYTES, + IFCOUNTER_OBYTES, + IFCOUNTER_IMCASTS, + IFCOUNTER_OMCASTS, + IFCOUNTER_IQDROPS, + IFCOUNTER_OQDROPS, + IFCOUNTER_NOPROTO, + IFCOUNTERS /* Array size. */ +} ift_counter; + +typedef void (*if_start_fn_t)(if_t); +typedef int (*if_ioctl_fn_t)(if_t, u_long, caddr_t); +typedef void (*if_init_fn_t)(void *); +typedef void (*if_input_fn_t)(struct ifnet *, struct mbuf *); +typedef int (*if_output_fn_t) + (struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); +typedef void (*if_qflush_fn_t)(if_t); +typedef int (*if_transmit_fn_t)(if_t, struct mbuf *); +typedef uint64_t (*if_get_counter_t)(if_t, ift_counter); + struct ifnet_hw_tsomax { u_int tsomaxbytes; /* TSO total burst length limit in bytes */ u_int tsomaxsegcount; /* TSO maximum segment count */ @@ -248,6 +274,13 @@ union if_snd_tag_query_params { struct if_snd_tag_rate_limit_params tls_rate_limit; }; +typedef int (if_snd_tag_alloc_t)(struct ifnet *, union if_snd_tag_alloc_params *, + struct m_snd_tag **); +typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union if_snd_tag_modify_params *); +typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union if_snd_tag_query_params *); +typedef void (if_snd_tag_free_t)(struct m_snd_tag *); +typedef struct m_snd_tag *(if_next_send_tag_t)(struct m_snd_tag *); + struct if_snd_tag_sw { if_snd_tag_modify_t *snd_tag_modify; if_snd_tag_query_t *snd_tag_query; @@ -634,6 +667,9 @@ int if_addgroup(struct ifnet *, const char *); int if_delgroup(struct ifnet *, const char *); int if_addmulti(struct ifnet *, struct sockaddr *, struct ifmultiaddr **); int if_allmulti(struct ifnet *, int); +struct ifnet* if_alloc(u_char); +struct ifnet* if_alloc_dev(u_char, device_t dev); +void if_attach(struct ifnet *); void if_dead(struct ifnet *); int if_delmulti(struct ifnet *, struct sockaddr *); void if_delmulti_ifma(struct ifmultiaddr *); @@ -641,9 +677,14 @@ void if_delmulti_ifma_flags(struct ifmultiaddr *, int flags); void if_detach(struct ifnet *); void if_purgeaddrs(struct ifnet *); void if_delallmulti(struct ifnet *); +void if_down(struct ifnet *); struct ifmultiaddr * if_findmulti(struct ifnet *, const struct sockaddr *); void if_freemulti(struct ifmultiaddr *ifma); +void if_free(struct ifnet *); +void if_initname(struct ifnet *, const char *, int); +void if_link_state_change(struct ifnet *, int); +int if_printf(struct ifnet *, const char *, ...) __printflike(2, 3); int if_log(struct ifnet *, int, const char *, ...) __printflike(3, 4); void if_ref(struct ifnet *); void if_rele(struct ifnet *); @@ -677,16 +718,120 @@ typedef void if_com_free_t(void *com, u_char type); void if_register_com_alloc(u_char type, if_com_alloc_t *a, if_com_free_t *f); void if_deregister_com_alloc(u_char type); void if_data_copy(struct ifnet *, struct if_data *); +uint64_t if_get_counter_default(struct ifnet *, ift_counter); +void if_inc_counter(struct ifnet *, ift_counter, int64_t); #define IF_LLADDR(ifp) \ LLADDR((struct sockaddr_dl *)((ifp)->if_addr->ifa_addr)) +uint64_t if_setbaudrate(if_t ifp, uint64_t baudrate); +uint64_t if_getbaudrate(const if_t ifp); +int if_setcapabilities(if_t ifp, int capabilities); +int if_setcapabilitiesbit(if_t ifp, int setbit, int clearbit); +int if_getcapabilities(const if_t ifp); +int if_togglecapenable(if_t ifp, int togglecap); +int if_setcapenable(if_t ifp, int capenable); +int if_setcapenablebit(if_t ifp, int setcap, int clearcap); +int if_getcapenable(const if_t ifp); +int if_getdunit(const if_t ifp); +int if_getindex(const if_t ifp); +const char *if_getdname(const if_t ifp); +void if_setdname(if_t ifp, const char *name); +const char *if_name(if_t ifp); +int if_setname(if_t ifp, const char *name); +void if_setdescr(if_t ifp, char *descrbuf); +char *if_allocdescr(size_t sz, int malloc_flag); +void if_freedescr(char *descrbuf); +int if_getalloctype(const if_t ifp); +int if_setdev(if_t ifp, void *dev); +int if_setdrvflagbits(if_t ifp, int if_setflags, int clear_flags); +int if_getdrvflags(const if_t ifp); +int if_setdrvflags(if_t ifp, int flags); +int if_clearhwassist(if_t ifp); +int if_sethwassistbits(if_t ifp, int toset, int toclear); +int if_sethwassist(if_t ifp, int hwassist_bit); +int if_gethwassist(const if_t ifp); +int if_togglehwassist(if_t ifp, int toggle_bits); +int if_setsoftc(if_t ifp, void *softc); +void *if_getsoftc(if_t ifp); +int if_setflags(if_t ifp, int flags); +int if_gethwaddr(const if_t ifp, struct ifreq *); +int if_setmtu(if_t ifp, int mtu); +int if_getmtu(const if_t ifp); +int if_getmtu_family(const if_t ifp, int family); +int if_setflagbits(if_t ifp, int set, int clear); +int if_getflags(const if_t ifp); +int if_sendq_empty(if_t ifp); +int if_setsendqready(if_t ifp); +int if_setsendqlen(if_t ifp, int tx_desc_count); +int if_sethwtsomax(if_t ifp, u_int if_hw_tsomax); +int if_sethwtsomaxsegcount(if_t ifp, u_int if_hw_tsomaxsegcount); +int if_sethwtsomaxsegsize(if_t ifp, u_int if_hw_tsomaxsegsize); +u_int if_gethwtsomax(const if_t ifp); +u_int if_gethwtsomaxsegcount(const if_t ifp); +u_int if_gethwtsomaxsegsize(const if_t ifp); +int if_input(if_t ifp, struct mbuf* sendmp); +int if_sendq_prepend(if_t ifp, struct mbuf *m); +struct mbuf *if_dequeue(if_t ifp); +int if_setifheaderlen(if_t ifp, int len); +void if_setrcvif(struct mbuf *m, if_t ifp); +void if_setvtag(struct mbuf *m, u_int16_t tag); +u_int16_t if_getvtag(struct mbuf *m); +int if_vlantrunkinuse(if_t ifp); +caddr_t if_getlladdr(const if_t ifp); +void *if_gethandle(u_char); +void if_bpfmtap(if_t ifp, struct mbuf *m); +void if_etherbpfmtap(if_t ifp, struct mbuf *m); +void if_vlancap(if_t ifp); +int if_transmit(if_t ifp, struct mbuf *m); +int if_init(if_t ifp); + +/* + * Traversing through interface address lists. + */ +struct sockaddr_dl; +typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int); +u_int if_foreach_lladdr(if_t, iflladdr_cb_t, void *); +u_int if_foreach_llmaddr(if_t, iflladdr_cb_t, void *); +u_int if_lladdr_count(if_t); +u_int if_llmaddr_count(if_t); + +int if_getamcount(const if_t ifp); +struct ifaddr * if_getifaddr(const if_t ifp); +typedef u_int if_addr_cb_t(void *, struct ifaddr *, u_int); +u_int if_foreach_addr_type(if_t ifp, int type, if_addr_cb_t cb, void *cb_arg); + +/* Functions */ +void if_setinitfn(if_t ifp, if_init_fn_t); +void if_setinputfn(if_t ifp, if_input_fn_t); +void if_setioctlfn(if_t ifp, if_ioctl_fn_t); +void if_setoutputfn(if_t ifp, int(*) + (if_t, struct mbuf *, const struct sockaddr *, struct route *)); +void if_setstartfn(if_t ifp, void (*)(if_t)); +void if_settransmitfn(if_t ifp, if_transmit_fn_t); +void if_setqflushfn(if_t ifp, if_qflush_fn_t); +void if_setgetcounterfn(if_t ifp, if_get_counter_t); +void if_setsndtagallocfn(if_t ifp, if_snd_tag_alloc_t); + /* TSO */ void if_hw_tsomax_common(if_t ifp, struct ifnet_hw_tsomax *); int if_hw_tsomax_update(if_t ifp, struct ifnet_hw_tsomax *); +/* accessors for struct ifreq */ +void *ifr_data_get_ptr(void *ifrp); +void *ifr_buffer_get_buffer(void *data); +size_t ifr_buffer_get_length(void *data); + int ifhwioctl(u_long, struct ifnet *, caddr_t, struct thread *); +#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 */ #include /* XXXAO: temporary unconditional include */