UbixOS  2.0
ne2k.c
Go to the documentation of this file.
1 /*-
2  * Copyright (c) 2002-2018 The UbixOS Project.
3  * All rights reserved.
4  *
5  * This was developed by Christopher W. Olsen for the UbixOS Project.
6  *
7  * Redistribution and use in source and binary forms, with or without modification, are permitted
8  * provided that the following conditions are met:
9  *
10  * 1) Redistributions of source code must retain the above copyright notice, this list of
11  * conditions, the following disclaimer and the list of authors.
12  * 2) Redistributions in binary form must reproduce the above copyright notice, this list of
13  * conditions, the following disclaimer and the list of authors in the documentation and/or
14  * other materials provided with the distribution.
15  * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to
16  * endorse or promote products derived from this software without specific prior written
17  * permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
20  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #include <isa/ne2k.h>
30 #include <net/netif.h>
31 #include <isa/8259.h>
32 #include <sys/device.old.h>
33 #include <sys/io.h>
34 #include <sys/idt.h>
35 #include <lib/kmalloc.h>
36 #include <lib/kprintf.h>
37 #include <string.h>
38 #include <ubixos/kpanic.h>
39 #include <ubixos/vitals.h>
40 #include <ubixos/spinlock.h>
41 #include <assert.h>
42 
43 static struct spinLock ne2k_spinLock = SPIN_LOCK_INITIALIZER;
44 
45 static int dp_pkt2user(struct device *dev, int page, int length);
46 static void getblock(struct device *dev, int page, size_t offset, size_t size, void *dst);
47 static int dp_recv(struct device *);
48 
49 static struct nicBuffer *ne2kBuffer = 0x0;
50 static struct device *mDev = 0x0;
51 
52 asm(
53  ".globl ne2kISR \n"
54  "ne2kISR: \n"
55  " pusha \n" /* Save all registers */
56  " call ne2kHandler \n"
57  " popa \n"
58  " iret \n" /* Exit interrupt */
59 );
60 
61 /************************************************************************
62 
63  Function: int ne2kInit(uInt32 ioAddr)
64  Description: This Function Will Initialize The Programmable Timer
65 
66  Notes:
67 
68  ************************************************************************/
69 int ne2k_init() {
70  mDev = (struct device *) kmalloc(sizeof(struct device));
71  mDev->ioAddr = 0x280;
72  mDev->irq = 10;
73  setVector(&ne2kISR, mVec + 10, dPresent + dInt + dDpl0);
74  irqEnable(10);
75 // kprintf("ne0 - irq: %i, ioAddr: 0x%X MAC: %X:%X:%X:%X:%X:%X\n",dev->irq,dev->ioAddr,dev->net->mac[0] & 0xFF,dev->net->mac[1] & 0xFF,dev->net->mac[2] & 0xFF,dev->net->mac[3] & 0xFF,dev->net->mac[4] & 0xFF,dev->net->mac[5] & 0xFF);
76 
77  outportByte(mDev->ioAddr + NE_CMD, 0x21); // stop mode
78  outportByte(mDev->ioAddr + NE_DCR, 0x29); // 0x29 data config reg
79  outportByte(mDev->ioAddr + NE_RBCR0, 0x00); // LOW byte count (remote)
80  outportByte(mDev->ioAddr + NE_RBCR1, 0x00); // HIGH byte count (remote)
81  outportByte(mDev->ioAddr + NE_RCR, 0x3C); // receive config reg
82  outportByte(mDev->ioAddr + NE_TCR, 0x02); // LOOP mode (temp)
83  outportByte(mDev->ioAddr + NE_PSTART, startPage); // 0x26 PAGE start
84  outportByte(mDev->ioAddr + NE_BNRY, startPage); // 0x26 BOUNDARY
85  outportByte(mDev->ioAddr + NE_PSTOP, stopPage); // 0x40 PAGE stop
86  outportByte(mDev->ioAddr + NE_ISR, 0xFF); // interrupt status reg
87  outportByte(mDev->ioAddr + NE_IMR, 0x0B);
88  outportByte(mDev->ioAddr + NE_CMD, 0x61); // PAGE 1 regs
89 
90  outportByte(mDev->ioAddr + DP_MAR0, 0xFF);
91  outportByte(mDev->ioAddr + DP_MAR1, 0xFF);
92  outportByte(mDev->ioAddr + DP_MAR2, 0xFF);
93  outportByte(mDev->ioAddr + DP_MAR3, 0xFF);
94  outportByte(mDev->ioAddr + DP_MAR4, 0xFF);
95  outportByte(mDev->ioAddr + DP_MAR5, 0xFF);
96  outportByte(mDev->ioAddr + DP_MAR6, 0xFF);
97  outportByte(mDev->ioAddr + DP_MAR7, 0xFF);
98  outportByte(mDev->ioAddr + DP_CURR, startPage + 1);
99  outportByte(mDev->ioAddr + NE_CMD, 0x20);
100  inportByte(mDev->ioAddr + DP_CNTR0); /* reset counters by reading */
101  inportByte(mDev->ioAddr + DP_CNTR1);
102  inportByte(mDev->ioAddr + DP_CNTR2);
103 
104  outportByte(mDev->ioAddr + NE_TCR, 0x00);
105 
106  outportByte(mDev->ioAddr + NE_CMD, 0x0);
107  outportByte(mDev->ioAddr + NE_DCR, 0x29);
108 
109  kprintf("Initialized");
110  /* Return so we know everything went well */
111  return (0x0);
112 }
113 
114 int PCtoNIC(struct device *dev, void *packet, int length) {
115  int i = 0x0;
116  uInt16 *packet16 = (uInt16 *) packet;
117  uInt8 *packet8 = (uInt8 *) packet;
118  uInt8 word16 = 0x1;
119 
120  if ((inportByte(dev->ioAddr) & 0x04) == 0x04) {
121  kpanic("Device Not Ready\n");
122  }
123 
124  assert(length);
125  if ((word16 == 1) && (length & 0x01)) {
126  length++;
127  }
128 
129  outportByte(dev->ioAddr + EN0_RCNTLO, (length & 0xFF));
130  outportByte(dev->ioAddr + EN0_RCNTHI, (length >> 8));
131 
132  outportByte(dev->ioAddr + EN0_RSARLO, 0x0);
133  outportByte(dev->ioAddr + EN0_RSARHI, 0x41);
134 
136 
137  if (word16 != 0x0) {
138  for (i = 0; i < length / 2; i++) {
139  outportWord(dev->ioAddr + NE_DATAPORT, packet16[i]);
140  }
141  }
142  else {
143  for (i = 0; i < length; i++) {
144  outportByte(dev->ioAddr + NE_DATAPORT, packet8[i]);
145  }
146  }
147 
148  for (i = 0; i <= 100; i++) {
149  if ((inportByte(dev->ioAddr + EN0_ISR) & 0x40) == 0x40) {
150  break;
151  }
152  }
153 
154  outportByte(dev->ioAddr + EN0_ISR, 0x40);
155  outportByte(dev->ioAddr + EN0_TPSR, 0x41); //ei_local->txStartPage);
156  outportByte(dev->ioAddr + 0x05, (length & 0xFF));
157  outportByte(dev->ioAddr + 0x06, (length >> 8));
158  outportByteP(dev->ioAddr, 0x26);
159  //kprintf("SENT\n");
160  return (length);
161 }
162 
163 int NICtoPC(struct device *dev, void *packet, int length, int nic_addr) {
164  int i = 0x0;
165  uInt16 *packet16 = (uInt16 *) packet;
166 
167  assert(length);
168 
169  if (length & 0x01)
170  length++;
171 
172  outportByte(dev->ioAddr + EN0_RCNTLO, (length & 0xFF));
173  outportByte(dev->ioAddr + EN0_RCNTHI, (length >> 8));
174 
175  outportByte(dev->ioAddr + EN0_RSARLO, nic_addr & 0xFF);
176  outportByte(dev->ioAddr + EN0_RSARHI, nic_addr >> 8);
177 
178  outportByte(dev->ioAddr, 0x0A);
179 
180  for (i = 0; i < length / 2; i++) {
181  packet16[i] = inportWord(dev->ioAddr + NE_DATAPORT);
182  }
183 
184  outportByte(dev->ioAddr + EN0_ISR, 0x40);
185  return (length);
186 }
187 
188 void ne2kHandler() {
189  uInt16 isr = 0x0;
190  uInt16 status = 0x0;
191 
192  irqDisable(10);
193  outportByte(mPic, eoi);
194  outportByte(sPic, eoi);
195 
196  asm("sti");
197 
198  isr = inportByte(mDev->ioAddr + NE_ISR);
199 
200  if ((isr & 0x02) == 0x02) {
201  outportByte(mDev->ioAddr + NE_ISR, 0x0A);
202  status = inportByte(0x280 + NE_TPSR);
203  }
204  if ((isr & 0x01) == 0x01) {
205  if (dp_recv(mDev)) {
206  kprintf("Error Getting Packet\n");
207  }
208  outportByte(mDev->ioAddr + NE_ISR, 0x05);
209  }
210 
211  outportByte(mDev->ioAddr + NE_IMR, 0x0);
212  outportByte(mDev->ioAddr + NE_IMR, 0x0B);
213 
214  asm("cli");
215  irqEnable(10);
216 
217  return;
218 }
219 
220 static int dp_recv(struct device *dev) {
221  dp_rcvhdr_t header;
222  unsigned int pageno = 0x0, curr = 0x0, next = 0x0;
223  int packet_processed = 0x0, r = 0x0;
224  uInt16 eth_type = 0x0;
225 
226  uInt32 length = 0x0;
227 
228  pageno = inportByte(dev->ioAddr + NE_BNRY) + 1;
229  if (pageno == stopPage)
230  pageno = startPage;
231 
232  do {
233  outportByte(dev->ioAddr + NE_CMD, 0x40);
234  curr = inportByte(dev->ioAddr + NE_CURRENT);
235  outportByte(dev->ioAddr, 0x0);
236  if (curr == pageno)
237  break;
238  getblock(dev, pageno, (size_t) 0, sizeof(header), &header);
239  getblock(dev, pageno, sizeof(header) + 2 * sizeof(ether_addr_t), sizeof(eth_type), &eth_type);
240 
241  length = (header.dr_rbcl | (header.dr_rbch << 8)) - sizeof(dp_rcvhdr_t);
242  next = header.dr_next;
243 
244  //kprintf("length: [0x%X:0x%X:0x%X]\n",header.dr_next,header.dr_status,length);
245 
246  if (length < 60 || length > 1514) {
247  kprintf("dp8390: packet with strange length arrived: %d\n", length);
248  next = curr;
249  }
250  else if (next < startPage || next >= stopPage) {
251  kprintf("dp8390: strange next page\n");
252  next = curr;
253  }
254  else if (header.dr_status & RSR_FO) {
255  kpanic("dp8390: fifo overrun, resetting receive buffer\n");
256  next = curr;
257  }
258  else if (header.dr_status & RSR_PRX) {
259  r = dp_pkt2user(dev, pageno, length);
260  if (r != OK) {
261  kprintf("FRUIT");
262  return (0x0);
263  }
264 
265  packet_processed = 0x1;
266  }
267  if (next == startPage)
268  outportByte(dev->ioAddr + NE_BNRY, stopPage - 1);
269  else
270  outportByte(dev->ioAddr + NE_BNRY, next - 1);
271 
272  pageno = next;
273 
274  } while (packet_processed == 0x0);
275  return (0x0);
276 }
277 
278 static void getblock(struct device *dev, int page, size_t offset, size_t size, void *dst) {
279  uInt16 *ha = 0x0;
280  int i = 0x0;
281 
282  ha = (uInt16 *) dst;
283  offset = page * DP_PAGESIZE + offset;
284  outportByte(dev->ioAddr + NE_RBCR0, size & 0xFF);
285  outportByte(dev->ioAddr + NE_RBCR1, size >> 8);
286  outportByte(dev->ioAddr + EN0_RSARLO, offset & 0xFF);
287  outportByte(dev->ioAddr + EN0_RSARHI, offset >> 8);
289 
290  size /= 2;
291  for (i = 0; i < size; i++)
292  ha[i] = inportWord(dev->ioAddr + NE_DATAPORT);
293  outportByte(dev->ioAddr + EN0_ISR, 0x40);
294 }
295 
296 static int dp_pkt2user(struct device *dev, int page, int length) {
297  int last = 0x0;
298 
299  struct nicBuffer *tBuf = 0x0;
300 
301  last = page + (length - 1) / DP_PAGESIZE;
302 
303  if (last >= stopPage) {
304  kprintf("FOOK STOP PAGE!!!");
305  }
306  else {
307  tBuf = ne2kAllocBuffer(length);
308  NICtoPC(dev, tBuf->buffer, length, page * DP_PAGESIZE + sizeof(dp_rcvhdr_t));
309  }
310  return (OK);
311 }
312 
313 struct nicBuffer *ne2kAllocBuffer(int length) {
314  struct nicBuffer *tmpBuf = 0x0;
315 
316  spinLock(&ne2k_spinLock);
317 
318  if (ne2kBuffer == 0x0) {
319  ne2kBuffer = (struct nicBuffer *) kmalloc(sizeof(struct nicBuffer));
320  ne2kBuffer->next = 0x0;
321  ne2kBuffer->length = length;
322  ne2kBuffer->buffer = (char *) kmalloc(length);
323  spinUnlock(&ne2k_spinLock);
324  return (ne2kBuffer);
325  }
326  else {
327  for (tmpBuf = ne2kBuffer; tmpBuf->next != 0x0; tmpBuf = tmpBuf->next)
328  ;
329 
330  tmpBuf->next = (struct nicBuffer *) kmalloc(sizeof(struct nicBuffer));
331  tmpBuf = tmpBuf->next;
332  tmpBuf->next = 0x0;
333  tmpBuf->length = length;
334  tmpBuf->buffer = (char *) kmalloc(length);
335  spinUnlock(&ne2k_spinLock);
336  return (tmpBuf);
337  }
338  spinUnlock(&ne2k_spinLock);
339  return (0x0);
340 }
341 
342 struct nicBuffer *ne2kGetBuffer() {
343  struct nicBuffer *tmpBuf = 0x0;
344 
345  if (ne2k_spinLock == 0x1)
346  return (0x0);
347 
348  tmpBuf = ne2kBuffer;
349  if (ne2kBuffer != 0x0)
350  ne2kBuffer = ne2kBuffer->next;
351  return (tmpBuf);
352 }
353 
354 void ne2kFreeBuffer(struct nicBuffer *buf) {
355  kfree(buf->buffer);
356  kfree(buf);
357  return;
358 }
359 
360 /***
361 
362  $Log: ne2k.c,v $
363  Revision 1.1.1.1 2006/06/01 12:46:12 reddawg
364  ubix2
365 
366  Revision 1.2 2005/10/12 00:13:37 reddawg
367  Removed
368 
369  Revision 1.1.1.1 2005/09/26 17:24:02 reddawg
370  no message
371 
372  Revision 1.24 2004/09/28 21:47:56 reddawg
373  Fixed deadlock now safe to use in bochs
374 
375  Revision 1.23 2004/09/16 22:35:28 reddawg
376  Demo Release
377 
378  Revision 1.22 2004/09/15 21:25:33 reddawg
379  Fixens
380 
381  Revision 1.21 2004/09/11 19:15:37 reddawg
382  here you go irq 10 io 240 for your ne2k nic
383 
384  Revision 1.20 2004/09/07 22:26:04 reddawg
385  synced in
386 
387  Revision 1.19 2004/09/07 21:54:38 reddawg
388  ok reverted back to old scheduling for now....
389 
390  Revision 1.18 2004/09/06 15:13:25 reddawg
391  Last commit before FreeBSD 6.0
392 
393  Revision 1.17 2004/08/01 20:40:45 reddawg
394  Net related fixes
395 
396  Revision 1.16 2004/07/28 22:23:02 reddawg
397  make sure it still works before I goto bed
398 
399  Revision 1.15 2004/07/17 17:04:47 reddawg
400  ne2k: added assert hopefully it will help me solve this dma size 0 random error
401 
402  Revision 1.14 2004/07/14 12:03:50 reddawg
403  ne2k: ne2kInit to ne2k_init
404  Changed Startup Routines
405 
406  Revision 1.13 2004/06/04 10:19:42 reddawg
407  notes: we compile again, thank g-d anyways i was about to cry
408 
409  Revision 1.12 2004/05/21 12:48:22 reddawg
410  Cleaned up
411 
412  Revision 1.11 2004/05/19 04:07:42 reddawg
413  kmalloc(size,pid) no more it is no kmalloc(size); the way it should of been
414 
415  Revision 1.10 2004/05/10 02:23:24 reddawg
416  Minor Changes To Source Code To Prepare It For Open Source Release
417 
418  END
419  ***/
420 
ne2kAllocBuffer
struct nicBuffer * ne2kAllocBuffer(int length)
Definition: ne2k.c:312
8259.h
dp_rcvhdr::dr_next
uInt8 dr_next
Definition: ne2k.h:39
ne2k.h
DP_MAR0
#define DP_MAR0
Definition: ne2k.h:133
spinlock.h
E8390_RREAD
#define E8390_RREAD
Definition: ne2k.h:90
NE_BNRY
#define NE_BNRY
Definition: ne2k.h:64
outportByteP
void outportByteP(unsigned int port, unsigned char value)
outputut one byte to specified port with a delay
Definition: io.c:87
nicBuffer::next
struct nicBuffer * next
Definition: netif.h:53
uInt32
unsigned long int uInt32
Definition: objgfx30.h:49
etheraddr
Definition: ne2k.h:44
ne2kFreeBuffer
void ne2kFreeBuffer(struct nicBuffer *buf)
Definition: ne2k.c:353
E8390_RWRITE
#define E8390_RWRITE
Definition: ne2k.h:91
nicBuffer::buffer
char * buffer
Definition: netif.h:55
dPresent
#define dPresent
Definition: gdt.h:54
EN0_RCNTHI
#define EN0_RCNTHI
Definition: ne2k.h:100
string.h
idt.h
uInt16
unsigned short int uInt16
Definition: objgfx30.h:48
outportWord
void outportWord(unsigned int, unsigned short)
outputut one word to specified port
Definition: io.c:103
irqDisable
void irqDisable(uInt16 irqNo)
NE_RBCR1
#define NE_RBCR1
Definition: ne2k.h:69
DP_MAR6
#define DP_MAR6
Definition: ne2k.h:139
outportByte
void outportByte(unsigned int, unsigned char)
outputut one byte to specified port
Definition: io.c:72
DP_MAR7
#define DP_MAR7
Definition: ne2k.h:140
kfree
void kfree(void *baseAddr)
Definition: kmalloc.c:342
EN0_TPSR
#define EN0_TPSR
Definition: ne2k.h:105
assert
#define assert(e)
Definition: assert.h:64
assert.h
EN0_ISR
#define EN0_ISR
Definition: ne2k.h:101
spinUnlock
void spinUnlock(spinLock_t *lock)
Definition: spinlock.c:36
device
Definition: device.old.h:34
NE_PSTOP
#define NE_PSTOP
Definition: ne2k.h:63
SPIN_LOCK_INITIALIZER
#define SPIN_LOCK_INITIALIZER
Definition: spinlock.h:36
kpanic
void kpanic(const char *fmt,...)
print panic message and halt system
Definition: kpanic.c:41
device::ioAddr
uInt16 ioAddr
Definition: device.old.h:36
NE_IMR
#define NE_IMR
Definition: ne2k.h:73
ne2kGetBuffer
struct nicBuffer * ne2kGetBuffer()
Definition: ne2k.c:341
NE_RBCR0
#define NE_RBCR0
Definition: ne2k.h:68
RSR_FO
#define RSR_FO
Definition: ne2k.h:50
spinLock
void spinLock(spinLock_t *lock)
Definition: spinlock.c:55
DP_CNTR0
#define DP_CNTR0
Definition: ne2k.h:142
inportByte
unsigned char inportByte(unsigned int)
input one byte from specified port
Definition: io.c:38
DP_CURR
#define DP_CURR
Definition: ne2k.h:132
kpanic.h
netif.h
PCtoNIC
int PCtoNIC(struct device *dev, void *packet, int length)
Definition: ne2k.c:113
dp_rcvhdr_t
struct dp_rcvhdr dp_rcvhdr_t
kprintf.h
eth_type
eth_type
Definition: ethernet.h:108
dp_rcvhdr::dr_rbch
uInt8 dr_rbch
Definition: ne2k.h:41
NE_RCR
#define NE_RCR
Definition: ne2k.h:70
DP_CNTR1
#define DP_CNTR1
Definition: ne2k.h:143
device.old.h
buf
Definition: buf.h:35
nicBuffer
Definition: netif.h:52
vitals.h
uInt8
unsigned char uInt8
Definition: objgfx30.h:47
dp_rcvhdr::dr_status
uInt8 dr_status
Definition: ne2k.h:38
eoi
#define eoi
Definition: 8259.h:38
NE_TPSR
#define NE_TPSR
Definition: ne2k.h:65
DP_PAGESIZE
#define DP_PAGESIZE
Definition: ne2k.h:147
NE_TCR
#define NE_TCR
Definition: ne2k.h:71
NE_CMD
#define NE_CMD
Definition: ne2k.h:61
ne2kISR
void ne2kISR()
sPic
#define sPic
Definition: 8259.h:36
DP_CNTR2
#define DP_CNTR2
Definition: ne2k.h:144
device::irq
uInt32 irq
Definition: device.old.h:37
inportWord
unsigned short inportWord(unsigned int)
input one word from specified port
Definition: io.c:55
DP_MAR3
#define DP_MAR3
Definition: ne2k.h:136
dp_rcvhdr::dr_rbcl
uInt8 dr_rbcl
Definition: ne2k.h:40
RSR_PRX
#define RSR_PRX
Definition: ne2k.h:51
nicBuffer::length
int length
Definition: netif.h:54
dInt
#define dInt
Definition: gdt.h:43
DP_MAR4
#define DP_MAR4
Definition: ne2k.h:137
NE_DCR
#define NE_DCR
Definition: ne2k.h:72
EN0_RSARHI
#define EN0_RSARHI
Definition: ne2k.h:104
DP_MAR5
#define DP_MAR5
Definition: ne2k.h:138
mVec
#define mVec
Definition: 8259.h:41
NE_CURRENT
#define NE_CURRENT
Definition: ne2k.h:67
EN0_RSARLO
#define EN0_RSARLO
Definition: ne2k.h:103
kmalloc
void * kmalloc(uInt32 len)
Definition: kmalloc.c:241
spinLock
Definition: spinlock.h:41
setVector
void setVector(void *handler, unsigned char interrupt, unsigned short controlMajor)
Definition: idt.c:208
NE_ISR
#define NE_ISR
Definition: ne2k.h:66
io.h
ne2kHandler
void ne2kHandler()
Definition: ne2k.c:187
irqEnable
void irqEnable(uInt16 irqNo)
ne2k_init
int ne2k_init()
Definition: ne2k.c:68
OK
#define OK
Definition: ne2k.h:54
DP_MAR2
#define DP_MAR2
Definition: ne2k.h:135
NE_DATAPORT
#define NE_DATAPORT
Definition: ne2k.h:125
kprintf
int kprintf(const char *,...)
Definition: kprintf.c:259
NE_PSTART
#define NE_PSTART
Definition: ne2k.h:62
EN0_RCNTLO
#define EN0_RCNTLO
Definition: ne2k.h:99
tmpBuf
struct nicBuffer * tmpBuf
Definition: ethernetif.c:63
dDpl0
#define dDpl0
Definition: gdt.h:53
NICtoPC
int NICtoPC(struct device *dev, void *packet, int length, int nic_addr)
Definition: ne2k.c:162
kmalloc.h
startPage
#define startPage
Definition: ne2k.h:57
stopPage
#define stopPage
Definition: ne2k.h:58
DP_MAR1
#define DP_MAR1
Definition: ne2k.h:134
mPic
#define mPic
Definition: 8259.h:34
E8390_START
#define E8390_START
Definition: ne2k.h:89
dp_rcvhdr
Definition: ne2k.h:36