From 56b1a39e1017c32de33016cc4e750c193eec9da2 Mon Sep 17 00:00:00 2001 From: bouyer Date: Sun, 8 Jan 2006 14:45:41 +0000 Subject: [PATCH] Move if_xennet private functions and structures from if_xennetvar.h to if_xennet.c --- sys/arch/xen/include/if_xennetvar.h | 58 +--------------------------- sys/arch/xen/xen/if_xennet.c | 60 ++++++++++++++++++++++++++++- 2 files changed, 59 insertions(+), 59 deletions(-) diff --git a/sys/arch/xen/include/if_xennetvar.h b/sys/arch/xen/include/if_xennetvar.h index 7c32f23597e4..fc3929ca8a92 100644 --- a/sys/arch/xen/include/if_xennetvar.h +++ b/sys/arch/xen/include/if_xennetvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: if_xennetvar.h,v 1.10 2005/12/11 12:19:48 christos Exp $ */ +/* $NetBSD: if_xennetvar.h,v 1.11 2006/01/08 14:45:41 bouyer Exp $ */ /* * @@ -37,59 +37,6 @@ #include -union xennet_bufarray { - struct { - struct mbuf *xbtx_m; - } xb_tx; - struct { - vaddr_t xbrx_va; - paddr_t xbrx_pa; - struct xennet_softc *xbrx_sc; - } xb_rx; - int xb_next; -}; - -struct xennet_softc { - struct device sc_dev; /* base device glue */ - struct ethercom sc_ethercom; /* Ethernet common part */ - - int sc_ifno; - - uint8_t sc_enaddr[6]; - -#ifdef mediacode - struct ifmedia sc_media; -#endif - - /* What is the status of our connection to the remote backend? */ -#define BEST_CLOSED 0 -#define BEST_DISCONNECTED 1 -#define BEST_CONNECTED 2 - unsigned int sc_backend_state; - - unsigned int sc_evtchn; - - void *sc_softintr; - - netif_tx_interface_t *sc_tx; - netif_rx_interface_t *sc_rx; - struct vm_page *sc_pg_tx; - struct vm_page *sc_pg_rx; - - uint32_t sc_tx_entries; - uint32_t sc_tx_resp_cons; - - uint32_t sc_rx_resp_cons; - uint32_t sc_rx_bufs_to_notify; - - union xennet_bufarray sc_tx_bufa[NETIF_TX_RING_SIZE]; - union xennet_bufarray sc_rx_bufa[NETIF_RX_RING_SIZE]; - -#if NRND > 0 - rndsource_element_t sc_rnd_source; -#endif -}; - struct xennet_attach_args { const char *xa_device; int xa_handle; @@ -98,9 +45,6 @@ struct xennet_attach_args { struct nfs_diskless; int xennet_scan(struct device *, struct xennet_attach_args *, cfprint_t); -void xennet_start(struct ifnet *); -int xennet_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); -void xennet_watchdog(struct ifnet *ifp); int xennet_bootstatic_callback(struct nfs_diskless *); #endif /* _XEN_IF_XENNETVAR_H_ */ diff --git a/sys/arch/xen/xen/if_xennet.c b/sys/arch/xen/xen/if_xennet.c index ddbcd64a923a..e720c215b465 100644 --- a/sys/arch/xen/xen/if_xennet.c +++ b/sys/arch/xen/xen/if_xennet.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_xennet.c,v 1.39 2005/12/15 13:45:32 yamt Exp $ */ +/* $NetBSD: if_xennet.c,v 1.40 2006/01/08 14:45:41 bouyer Exp $ */ /* * @@ -33,7 +33,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.39 2005/12/15 13:45:32 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.40 2006/01/08 14:45:41 bouyer Exp $"); #include "opt_inet.h" #include "opt_nfs_boot.h" @@ -122,6 +122,59 @@ int xennet_debug = 0x0; static void xennet_hex_dump(unsigned char *, size_t, char *, int); #endif +union xennet_bufarray { + struct { + struct mbuf *xbtx_m; + } xb_tx; + struct { + vaddr_t xbrx_va; + paddr_t xbrx_pa; + struct xennet_softc *xbrx_sc; + } xb_rx; + int xb_next; +}; + +struct xennet_softc { + struct device sc_dev; /* base device glue */ + struct ethercom sc_ethercom; /* Ethernet common part */ + + int sc_ifno; + + uint8_t sc_enaddr[6]; + +#ifdef mediacode + struct ifmedia sc_media; +#endif + + /* What is the status of our connection to the remote backend? */ +#define BEST_CLOSED 0 +#define BEST_DISCONNECTED 1 +#define BEST_CONNECTED 2 + unsigned int sc_backend_state; + + unsigned int sc_evtchn; + + void *sc_softintr; + + netif_tx_interface_t *sc_tx; + netif_rx_interface_t *sc_rx; + struct vm_page *sc_pg_tx; + struct vm_page *sc_pg_rx; + + uint32_t sc_tx_entries; + uint32_t sc_tx_resp_cons; + + uint32_t sc_rx_resp_cons; + uint32_t sc_rx_bufs_to_notify; + + union xennet_bufarray sc_tx_bufa[NETIF_TX_RING_SIZE]; + union xennet_bufarray sc_rx_bufa[NETIF_RX_RING_SIZE]; + +#if NRND > 0 + rndsource_element_t sc_rnd_source; +#endif +}; + int xennet_match (struct device *, struct cfdata *, void *); void xennet_attach (struct device *, struct device *, void *); static void xennet_ctrlif_rx(ctrl_msg_t *, unsigned long); @@ -140,6 +193,9 @@ void xennet_softstart(void *); static int xennet_mediachange (struct ifnet *); static void xennet_mediastatus(struct ifnet *, struct ifmediareq *); #endif +void xennet_start(struct ifnet *); +int xennet_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); +void xennet_watchdog(struct ifnet *ifp); CFATTACH_DECL(xennet, sizeof(struct xennet_softc), xennet_match, xennet_attach, NULL, NULL);