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/arm/at91/if_macbvar.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * $FreeBSD$
    3  */
    4 
    5 #ifndef _IF_MACB_H
    6 #define _IF_MACB_H
    7 
    8 #define MACB_MAX_TX_BUFFERS     64
    9 #define MACB_MAX_RX_BUFFERS     256
   10 
   11 #define MAX_FRAGMENT            20
   12 #define DATA_SIZE               128
   13 
   14 #define MACB_DESC_INC(x, y)     ((x) = ((x) + 1) % (y))
   15 
   16 #define MACB_TIMEOUT            1000
   17 
   18 struct eth_tx_desc {
   19         uint32_t                addr;
   20         uint32_t                flags;
   21 #define TD_OWN          (1 << 31)
   22 #define TD_LAST         (1 << 15)
   23 #define TD_WRAP_MASK            (1 << 30)
   24 };
   25 
   26 struct eth_rx_desc {
   27         uint32_t                addr;
   28 #define RD_LEN_MASK             0x7ff
   29 #define RD_WRAP_MASK            0x00000002
   30 #define RD_OWN                  0x00000001
   31 
   32         uint32_t                flags;
   33 #define RD_BROADCAST            (1 << 31)
   34 #define RD_MULTICAST            (1 << 30)
   35 #define RD_UNICAST              (1 << 29)
   36 #define RD_EXTERNAL             (1 << 28)
   37 #define RD_TYPE_ID              (1 << 22)
   38 #define RD_PRIORITY             (1 << 20)
   39 #define RD_VLAN         (1 << 21)
   40 #define RD_CONCAT               (1 << 16)
   41 #define RD_EOF          (1 << 15)
   42 #define RD_SOF          (1 << 14)
   43 #define RD_OFFSET_MASK          (1 << 13)|(1 << 12)
   44 #define RD_LENGTH_MASK          (0x00000FFF)
   45 
   46 };
   47 
   48 
   49 struct rx_desc_info {
   50         struct mbuf *buff;
   51         bus_dmamap_t dmamap;
   52 };
   53 
   54 struct tx_desc_info {
   55         struct mbuf *buff;
   56         bus_dmamap_t dmamap;
   57 };
   58 
   59 
   60 struct macb_chain_data{ 
   61         struct mbuf             *rxhead;
   62         struct mbuf             *rxtail;
   63 };
   64 
   65 struct macb_softc
   66 {
   67         struct ifnet *ifp;              /* ifnet pointer */
   68         struct mtx sc_mtx;              /* global mutex */
   69 
   70         bus_dma_tag_t   sc_parent_tag;  /* parent bus DMA tag */
   71 
   72         device_t dev;                   /* Myself */
   73         device_t miibus;                /* My child miibus */
   74         void *intrhand;                 /* Interrupt handle */
   75         void *intrhand_qf;              /* queue full */
   76         void *intrhand_tx;              /* tx complete */
   77         void *intrhand_status;          /* error status */
   78 
   79         struct resource *irq_res;       /* transmit */
   80         struct resource *irq_res_rec;   /* receive */
   81         struct resource *irq_res_qf;    /* queue full */
   82         struct resource *irq_res_status; /* status */
   83 
   84         struct resource *mem_res;       /* Memory resource */
   85 
   86         struct callout tick_ch;         /* Tick callout */
   87 
   88         struct taskqueue *sc_tq;
   89         struct task     sc_intr_task;
   90         struct task     sc_tx_task;
   91         struct task     sc_link_task;
   92 
   93         bus_dmamap_t    dmamap_ring_tx;
   94         bus_dmamap_t    dmamap_ring_rx;
   95 
   96         /*dma tag for ring*/
   97         bus_dma_tag_t   dmatag_ring_tx;
   98         bus_dma_tag_t   dmatag_ring_rx;
   99 
  100         /*dma tag for data*/
  101         bus_dma_tag_t   dmatag_data_tx;
  102         bus_dma_tag_t   dmatag_data_rx;
  103 
  104         /*the ring*/
  105         struct eth_tx_desc      *desc_tx;
  106         struct eth_rx_desc      *desc_rx;
  107 
  108         /*ring physical address*/
  109         bus_addr_t      ring_paddr_tx;
  110         bus_addr_t      ring_paddr_rx;
  111 
  112         /*index of last received descriptor*/
  113         int             rx_cons;
  114         struct rx_desc_info rx_desc[MACB_MAX_RX_BUFFERS];
  115 
  116         /* tx producer index */
  117         uint32_t tx_prod;
  118         /* tx consumer index */
  119         uint32_t tx_cons;
  120         int     tx_cnt;
  121 
  122         struct tx_desc_info tx_desc[MACB_MAX_TX_BUFFERS];
  123 
  124         int macb_watchdog_timer;
  125 
  126 #define MACB_FLAG_LINK          0x0001
  127 
  128         int flags;
  129         int if_flags;
  130         struct at91_pmc_clock *clk;
  131 
  132         struct macb_chain_data  macb_cdata;
  133         int clock;
  134 };
  135 
  136 
  137 
  138 #endif

Cache object: 24205a7d65c75fdbe59f3d53c3d80dd4


[ 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.