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/pc/ether8390.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  * Ctlr for the boards using the National Semiconductor DP8390
    3  * and SMC 83C90 Network Interface Controller.
    4  * Common code is in ether8390.c.
    5  */
    6 typedef struct {
    7         Lock;
    8 
    9         ulong   port;                   /* I/O address of 8390 */
   10         ulong   data;                   /* I/O data port if no shared memory */
   11 
   12         uchar   width;                  /* data transfer width in bytes */
   13         uchar   ram;                    /* true if card has shared memory */
   14         uchar   dummyrr;                /* do dummy remote read */
   15 
   16         uchar   nxtpkt;                 /* receive: software bndry */
   17         uchar   pstart;
   18         uchar   pstop;
   19 
   20         int     txbusy;                 /* transmit */
   21         uchar   tstart;                 /* 8390 ring addresses */
   22 
   23         uchar   mar[8];                 /* shadow multicast address registers */
   24         int     mref[64];               /* reference counts for multicast groups */
   25 } Dp8390;
   26 
   27 #define Dp8390BufSz     256
   28 
   29 extern int dp8390reset(Ether*);
   30 extern void *dp8390read(Dp8390*, void*, ulong, ulong);
   31 extern void dp8390getea(Ether*, uchar*);
   32 extern void dp8390setea(Ether*);
   33 
   34 /*
   35  * x86-specific code.
   36  */
   37 #define regr(c, r)      inb((c)->port+(r))
   38 #define regw(c, r, v)   outb((c)->port+(r), (v))
   39 
   40 static void
   41 rdread(Dp8390* ctlr, void* to, int len)
   42 {
   43         switch(ctlr->width){
   44         default:
   45                 panic("dp8390 rdread: width %d\n", ctlr->width);
   46                 break;
   47 
   48         case 2:
   49                 inss(ctlr->data, to, len/2);
   50                 break;
   51 
   52         case 1:
   53                 insb(ctlr->data, to, len);
   54                 break;
   55         }
   56 }
   57 
   58 static void
   59 rdwrite(Dp8390* ctlr, void* from, int len)
   60 {
   61         switch(ctlr->width){
   62         default:
   63                 panic("dp8390 rdwrite: width %d\n", ctlr->width);
   64                 break;
   65 
   66         case 2:
   67                 outss(ctlr->data, from, len/2);
   68                 break;
   69 
   70         case 1:
   71                 outsb(ctlr->data, from, len);
   72                 break;
   73         }
   74 }

Cache object: 2e54f582c7a3945bb656ce5cb736372d


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