Home | History | Annotate | Line # | Download | only in ic
hmevar.h revision 1.17.14.1
      1  1.17.14.1       jym /*	$NetBSD: hmevar.h,v 1.17.14.1 2009/05/13 17:19:23 jym 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.1        pk #include "rnd.h"
     33        1.1        pk 
     34        1.3   thorpej #include <sys/callout.h>
     35        1.1        pk #if NRND > 0
     36        1.1        pk #include <sys/rnd.h>
     37        1.1        pk #endif
     38        1.1        pk 
     39        1.1        pk 
     40        1.1        pk struct hme_ring {
     41        1.1        pk 	/* Ring Descriptors */
     42       1.15  christos 	void *		rb_membase;	/* Packet buffer: CPU address */
     43        1.1        pk 	bus_addr_t	rb_dmabase;	/* Packet buffer: DMA address */
     44       1.15  christos 	void *		rb_txd;		/* Transmit descriptors */
     45        1.1        pk 	bus_addr_t	rb_txddma;	/* DMA address of same */
     46       1.15  christos 	void *		rb_rxd;		/* Receive descriptors */
     47        1.1        pk 	bus_addr_t	rb_rxddma;	/* DMA address of same */
     48       1.15  christos 	void *		rb_txbuf;	/* Transmit buffers */
     49       1.15  christos 	void *		rb_rxbuf;	/* Receive buffers */
     50        1.8      tron 	int		rb_ntbuf;	/* # of transmit buffers */
     51        1.8      tron 	int		rb_nrbuf;	/* # of receive buffers */
     52        1.8      tron 
     53        1.8      tron 	/* Ring Descriptor state */
     54        1.8      tron 	int	rb_tdhead, rb_tdtail;
     55        1.8      tron 	int	rb_rdtail;
     56        1.8      tron 	int	rb_td_nbusy;
     57        1.1        pk };
     58        1.1        pk 
     59        1.1        pk struct hme_softc {
     60        1.1        pk 	struct device	sc_dev;		/* boilerplate device view */
     61        1.1        pk 	struct ethercom	sc_ethercom;	/* Ethernet common part */
     62        1.1        pk 	struct mii_data	sc_mii;		/* MII media control */
     63        1.3   thorpej 	struct callout	sc_tick_ch;	/* tick callout */
     64        1.1        pk 
     65        1.1        pk 	/* The following bus handles are to be provided by the bus front-end */
     66        1.1        pk 	bus_space_tag_t	sc_bustag;	/* bus tag */
     67        1.1        pk 	bus_dma_tag_t	sc_dmatag;	/* bus dma tag */
     68        1.4        pk 	bus_dmamap_t	sc_dmamap;	/* bus dma handle */
     69        1.1        pk 	bus_space_handle_t sc_seb;	/* HME Global registers */
     70        1.1        pk 	bus_space_handle_t sc_erx;	/* HME ERX registers */
     71        1.1        pk 	bus_space_handle_t sc_etx;	/* HME ETX registers */
     72        1.1        pk 	bus_space_handle_t sc_mac;	/* HME MAC registers */
     73        1.1        pk 	bus_space_handle_t sc_mif;	/* HME MIF registers */
     74        1.1        pk 	int		sc_burst;	/* DVMA burst size in effect */
     75        1.2        pk 	int		sc_phys[2];	/* MII instance -> PHY map */
     76        1.5       eeh 
     77        1.5       eeh 	int		sc_pci;		/* XXXXX -- PCI buses are LE. */
     78        1.1        pk 
     79        1.1        pk 	/* Ring descriptor */
     80        1.1        pk 	struct hme_ring		sc_rb;
     81        1.8      tron #if notused
     82       1.12     perry 	void		(*sc_copytobuf)(struct hme_softc *,
     83       1.12     perry 					     void *, void *, size_t);
     84       1.12     perry 	void		(*sc_copyfrombuf)(struct hme_softc *,
     85       1.12     perry 					      void *, void *, size_t);
     86        1.8      tron #endif
     87        1.1        pk 
     88        1.1        pk 	int			sc_debug;
     89        1.1        pk 	void			*sc_sh;		/* shutdownhook cookie */
     90       1.13      heas 	int			sc_ec_capenable;
     91       1.11      heas 	short			sc_if_flags;
     92  1.17.14.1       jym 	uint8_t			sc_enaddr[ETHER_ADDR_LEN]; /* MAC address */
     93        1.1        pk 
     94        1.1        pk 	/* Special hardware hooks */
     95       1.12     perry 	void	(*sc_hwreset)(struct hme_softc *);
     96       1.12     perry 	void	(*sc_hwinit)(struct hme_softc *);
     97        1.1        pk 
     98        1.1        pk #if NRND > 0
     99        1.1        pk 	rndsource_element_t	rnd_source;
    100        1.1        pk #endif
    101        1.1        pk };
    102        1.1        pk 
    103        1.1        pk 
    104       1.12     perry void	hme_config(struct hme_softc *);
    105       1.12     perry void	hme_reset(struct hme_softc *);
    106       1.12     perry int	hme_intr(void *);
    107