The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/ic/hmevar.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*      $OpenBSD: hmevar.h,v 1.11 2008/11/26 13:30:29 kettenis Exp $    */
    2 /*      $NetBSD: hmevar.h,v 1.6 2000/09/28 10:56:57 tsutsui Exp $       */
    3 
    4 /*-
    5  * Copyright (c) 1999 The NetBSD Foundation, Inc.
    6  * All rights reserved.
    7  *
    8  * This code is derived from software contributed to The NetBSD Foundation
    9  * by Paul Kranenburg.
   10  *
   11  * Redistribution and use in source and binary forms, with or without
   12  * modification, are permitted provided that the following conditions
   13  * are met:
   14  * 1. Redistributions of source code must retain the above copyright
   15  *    notice, this list of conditions and the following disclaimer.
   16  * 2. Redistributions in binary form must reproduce the above copyright
   17  *    notice, this list of conditions and the following disclaimer in the
   18  *    documentation and/or other materials provided with the distribution.
   19  *
   20  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   21  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   22  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   23  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   24  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   30  * POSSIBILITY OF SUCH DAMAGE.
   31  */
   32 
   33 #include <sys/timeout.h>
   34 
   35 #define HME_TX_RING_SIZE        64
   36 #define HME_RX_RING_SIZE        64
   37 #define HME_RX_RING_MAX         256
   38 #define HME_TX_RING_MAX         256
   39 #define HME_RX_PKTSIZE          1600
   40 #define HME_TX_NSEGS            16
   41 
   42 struct hme_sxd {
   43         struct mbuf *sd_mbuf;           /* descriptor mbuf */
   44         bus_dmamap_t sd_map;            /* descriptor dmamap */
   45 };
   46 
   47 struct hme_ring {
   48         /* Ring Descriptors */
   49         caddr_t         rb_membase;     /* Packet buffer: CPU address */
   50         bus_addr_t      rb_dmabase;     /* Packet buffer: DMA address */
   51         caddr_t         rb_txd;         /* Transmit descriptors */
   52         bus_addr_t      rb_txddma;      /* DMA address of same */
   53         caddr_t         rb_rxd;         /* Receive descriptors */
   54         bus_addr_t      rb_rxddma;      /* DMA address of same */
   55 };
   56 
   57 struct hme_softc {
   58         struct device   sc_dev;         /* boilerplate device view */
   59         struct arpcom   sc_arpcom;      /* Ethernet common part */
   60         struct mii_data sc_mii;         /* MII media control */
   61 #define sc_media        sc_mii.mii_media/* shorthand */
   62         struct timeout  sc_tick_ch;     /* tick callout */
   63 
   64         /* The following bus handles are to be provided by the bus front-end */
   65         bus_space_tag_t sc_bustag;      /* bus tag */
   66         bus_dma_tag_t   sc_dmatag;      /* bus dma tag */
   67         bus_dmamap_t    sc_dmamap;      /* bus dma handle */
   68         bus_space_handle_t sc_seb;      /* HME Global registers */
   69         bus_space_handle_t sc_erx;      /* HME ERX registers */
   70         bus_space_handle_t sc_etx;      /* HME ETX registers */
   71         bus_space_handle_t sc_mac;      /* HME MAC registers */
   72         bus_space_handle_t sc_mif;      /* HME MIF registers */
   73         int             sc_burst;       /* DVMA burst size in effect */
   74         int             sc_phys[2];     /* MII instance -> PHY map */
   75 
   76         int             sc_pci;         /* XXXXX -- PCI buses are LE. */
   77 
   78         /* Ring descriptor */
   79         struct hme_ring         sc_rb;
   80 
   81         int                     sc_debug;
   82         void                    *sc_sh;         /* shutdownhook cookie */
   83         short                   sc_if_flags;
   84 
   85         /* Special hardware hooks */
   86         void    (*sc_hwreset)(struct hme_softc *);
   87         void    (*sc_hwinit)(struct hme_softc *);
   88 
   89         struct hme_sxd sc_txd[HME_TX_RING_MAX], sc_rxd[HME_RX_RING_MAX];
   90         bus_dmamap_t    sc_rxmap_spare;
   91         int     sc_tx_cnt, sc_tx_prod, sc_tx_cons;
   92         int     sc_last_rd;
   93         u_int32_t sc_tcvr;
   94 };
   95 
   96 
   97 void    hme_config(struct hme_softc *);
   98 void    hme_reset(struct hme_softc *);
   99 int     hme_intr(void *);

Cache object: 93e9f5e2bbd802555ae863712d07b35e


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.