Home | History | Annotate | Line # | Download | only in ic
hmevar.h revision 1.23.6.1
      1  1.23.6.1  jdolecek /*	$NetBSD: hmevar.h,v 1.23.6.1 2017/12/03 11:37:03 jdolecek Exp $	*/
      2       1.1        pk 
      3       1.1        pk /*-
      4       1.1        pk  * Copyright (c) 1999 The NetBSD Foundation, Inc.
      5       1.1        pk  * All rights reserved.
      6       1.1        pk  *
      7       1.1        pk  * This code is derived from software contributed to The NetBSD Foundation
      8       1.1        pk  * by Paul Kranenburg.
      9       1.1        pk  *
     10       1.1        pk  * Redistribution and use in source and binary forms, with or without
     11       1.1        pk  * modification, are permitted provided that the following conditions
     12       1.1        pk  * are met:
     13       1.1        pk  * 1. Redistributions of source code must retain the above copyright
     14       1.1        pk  *    notice, this list of conditions and the following disclaimer.
     15       1.1        pk  * 2. Redistributions in binary form must reproduce the above copyright
     16       1.1        pk  *    notice, this list of conditions and the following disclaimer in the
     17       1.1        pk  *    documentation and/or other materials provided with the distribution.
     18       1.1        pk  *
     19       1.1        pk  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20       1.1        pk  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21       1.1        pk  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22       1.1        pk  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23       1.1        pk  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24       1.1        pk  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25       1.1        pk  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26       1.1        pk  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27       1.1        pk  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28       1.1        pk  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29       1.1        pk  * POSSIBILITY OF SUCH DAMAGE.
     30       1.1        pk  */
     31       1.1        pk 
     32       1.3   thorpej #include <sys/callout.h>
     33  1.23.6.1  jdolecek #include <sys/rndsource.h>
     34       1.1        pk 
     35       1.1        pk struct hme_ring {
     36       1.1        pk 	/* Ring Descriptors */
     37      1.15  christos 	void *		rb_membase;	/* Packet buffer: CPU address */
     38       1.1        pk 	bus_addr_t	rb_dmabase;	/* Packet buffer: DMA address */
     39      1.15  christos 	void *		rb_txd;		/* Transmit descriptors */
     40       1.1        pk 	bus_addr_t	rb_txddma;	/* DMA address of same */
     41      1.15  christos 	void *		rb_rxd;		/* Receive descriptors */
     42       1.1        pk 	bus_addr_t	rb_rxddma;	/* DMA address of same */
     43      1.15  christos 	void *		rb_txbuf;	/* Transmit buffers */
     44      1.15  christos 	void *		rb_rxbuf;	/* Receive buffers */
     45       1.8      tron 	int		rb_ntbuf;	/* # of transmit buffers */
     46       1.8      tron 	int		rb_nrbuf;	/* # of receive buffers */
     47       1.8      tron 
     48       1.8      tron 	/* Ring Descriptor state */
     49       1.8      tron 	int	rb_tdhead, rb_tdtail;
     50       1.8      tron 	int	rb_rdtail;
     51       1.8      tron 	int	rb_td_nbusy;
     52       1.1        pk };
     53       1.1        pk 
     54       1.1        pk struct hme_softc {
     55      1.19   tsutsui 	device_t	sc_dev;		/* boilerplate device view */
     56       1.1        pk 	struct ethercom	sc_ethercom;	/* Ethernet common part */
     57       1.1        pk 	struct mii_data	sc_mii;		/* MII media control */
     58       1.3   thorpej 	struct callout	sc_tick_ch;	/* tick callout */
     59       1.1        pk 
     60       1.1        pk 	/* The following bus handles are to be provided by the bus front-end */
     61       1.1        pk 	bus_space_tag_t	sc_bustag;	/* bus tag */
     62       1.1        pk 	bus_dma_tag_t	sc_dmatag;	/* bus dma tag */
     63       1.4        pk 	bus_dmamap_t	sc_dmamap;	/* bus dma handle */
     64       1.1        pk 	bus_space_handle_t sc_seb;	/* HME Global registers */
     65       1.1        pk 	bus_space_handle_t sc_erx;	/* HME ERX registers */
     66       1.1        pk 	bus_space_handle_t sc_etx;	/* HME ETX registers */
     67       1.1        pk 	bus_space_handle_t sc_mac;	/* HME MAC registers */
     68       1.1        pk 	bus_space_handle_t sc_mif;	/* HME MIF registers */
     69       1.1        pk 	int		sc_burst;	/* DVMA burst size in effect */
     70       1.2        pk 	int		sc_phys[2];	/* MII instance -> PHY map */
     71       1.5       eeh 
     72       1.5       eeh 	int		sc_pci;		/* XXXXX -- PCI buses are LE. */
     73       1.1        pk 
     74       1.1        pk 	/* Ring descriptor */
     75       1.1        pk 	struct hme_ring		sc_rb;
     76       1.8      tron #if notused
     77      1.12     perry 	void		(*sc_copytobuf)(struct hme_softc *,
     78      1.12     perry 					     void *, void *, size_t);
     79      1.12     perry 	void		(*sc_copyfrombuf)(struct hme_softc *,
     80      1.12     perry 					      void *, void *, size_t);
     81       1.8      tron #endif
     82       1.1        pk 
     83       1.1        pk 	int			sc_debug;
     84      1.13      heas 	int			sc_ec_capenable;
     85      1.11      heas 	short			sc_if_flags;
     86      1.18   tsutsui 	uint8_t			sc_enaddr[ETHER_ADDR_LEN]; /* MAC address */
     87       1.1        pk 
     88       1.1        pk 	/* Special hardware hooks */
     89      1.12     perry 	void	(*sc_hwreset)(struct hme_softc *);
     90      1.12     perry 	void	(*sc_hwinit)(struct hme_softc *);
     91       1.1        pk 
     92      1.22       tls 	krndsource_t	rnd_source;
     93       1.1        pk };
     94       1.1        pk 
     95       1.1        pk 
     96      1.12     perry void	hme_config(struct hme_softc *);
     97      1.12     perry int	hme_intr(void *);
     98