UbixOS  2.0
ne2k.c File Reference
#include <isa/ne2k.h>
#include <net/netif.h>
#include <isa/8259.h>
#include <sys/device.old.h>
#include <sys/io.h>
#include <sys/idt.h>
#include <lib/kmalloc.h>
#include <lib/kprintf.h>
#include <string.h>
#include <ubixos/kpanic.h>
#include <ubixos/vitals.h>
#include <ubixos/spinlock.h>
#include <assert.h>
Include dependency graph for ne2k.c:

Go to the source code of this file.

Functions

 asm (".globl ne2kISR \n" "ne2kISR: \n" " pusha \n" " call ne2kHandler \n" " popa \n" " iret \n")
 
int ne2k_init ()
 
struct nicBufferne2kAllocBuffer (int length)
 
void ne2kFreeBuffer (struct nicBuffer *buf)
 
struct nicBufferne2kGetBuffer ()
 
void ne2kHandler ()
 
int NICtoPC (struct device *dev, void *packet, int length, int nic_addr)
 
int PCtoNIC (struct device *dev, void *packet, int length)
 

Function Documentation

◆ asm()

asm ( ".globl ne2kISR \n" "ne2kISR: \n" " pusha \n" " call ne2kHandler \n" " popa \n" " iret \n"  )

◆ ne2k_init()

int ne2k_init ( )

Definition at line 68 of file ne2k.c.

◆ ne2kAllocBuffer()

struct nicBuffer* ne2kAllocBuffer ( int  length)

Definition at line 312 of file ne2k.c.

References spinLock(), and tmpBuf.

Here is the call graph for this function:

◆ ne2kFreeBuffer()

void ne2kFreeBuffer ( struct nicBuffer buf)

Definition at line 353 of file ne2k.c.

References kfree().

Here is the call graph for this function:

◆ ne2kGetBuffer()

struct nicBuffer* ne2kGetBuffer ( )

Definition at line 341 of file ne2k.c.

References tmpBuf.

◆ ne2kHandler()

void ne2kHandler ( )

Definition at line 187 of file ne2k.c.

◆ NICtoPC()

int NICtoPC ( struct device dev,
void *  packet,
int  length,
int  nic_addr 
)

Definition at line 162 of file ne2k.c.

References assert, EN0_ISR, EN0_RCNTHI, EN0_RCNTLO, EN0_RSARHI, EN0_RSARLO, inportWord(), device::ioAddr, NE_DATAPORT, and outportByte().

Here is the call graph for this function:

◆ PCtoNIC()

int PCtoNIC ( struct device dev,
void *  packet,
int  length 
)

Definition at line 113 of file ne2k.c.

References assert, E8390_RWRITE, E8390_START, EN0_ISR, EN0_RCNTHI, EN0_RCNTLO, EN0_RSARHI, EN0_RSARLO, EN0_TPSR, inportByte(), device::ioAddr, kpanic(), NE_DATAPORT, outportByte(), outportByteP(), and outportWord().

Here is the call graph for this function: