# ne2k.h File Reference

`#include <ubixos/types.h>`
`#include <sys/device.old.h>`

Go to the source code of this file.

## Data Structures
struct | dp_rcvhdr
union | etheraddr
struct | nicBuffer
## Defines
#define | ether_addr ether_addr_t
#define | RSR_FO 0x08
#define | RSR_PRX 0x01
#define | DEF_ENABLED 0x200
#define | OK 0
#define | startPage 0x4C
#define | stopPage 0x80
#define | NE_CMD 0x00
#define | NE_PSTART 0x01
#define | NE_PSTOP 0x02
#define | NE_BNRY 0x03
#define | NE_TPSR 0x04
#define | NE_ISR 0x07
#define | NE_CURRENT 0x07
#define | NE_RBCR0 0x0A
#define | NE_RBCR1 0x0B
#define | NE_RCR 0x0C
#define | NE_TCR 0x0D
#define | NE_DCR 0x0E
#define | NE_IMR 0x0F
#define | NE_DCR_WTS 0x01
#define | NE_DCR_LS 0x08
#define | NE_DCR_AR 0x10
#define | NE_DCR_FT1 0x40
#define | NE_DCR_FT0 0x20
#define | E8390_STOP 0x01
#define | E8390_NODMA 0x20
#define | E8390_PAGE0 0x00
#define | E8390_PAGE1 0x40
#define | E8390_CMD 0x00
#define | E8390_START 0x02
#define | E8390_RREAD 0x08
#define | E8390_RWRITE 0x10
#define | E8390_RXOFF 0x20
#define | E8390_TXOFF 0x00
#define | E8390_RXCONFIG 0x04
#define | E8390_TXCONFIG 0x00
#define | EN0_COUNTER0 0x0d
#define | EN0_DCFG 0x0e
#define | EN0_RCNTLO 0x0a
#define | EN0_RCNTHI 0x0b
#define | EN0_ISR 0x07
#define | EN0_IMR 0x0f
#define | EN0_RSARLO 0x08
#define | EN0_RSARHI 0x09
#define | EN0_TPSR 0x04
#define | EN0_RXCR 0x0c
#define | EN0_TXCR 0x0D
#define | EN0_STARTPG 0x01
#define | EN0_STOPPG 0x02
#define | EN0_BOUNDARY 0x03
#define | EN1_PHYS 0x01
#define | EN1_CURPAG 0x07
#define | EN1_MULT 0x08
#define | NE1SM_START_PG 0x20
#define | NE1SM_STOP_PG 0x40
#define | NESM_START_PG 0x40
#define | NESM_STOP_PG 0x80
#define | ENISR_ALL 0x3f
#define | ENDCFG_WTS 0x01
#define | NE_DATAPORT 0x10
#define | TX_2X_PAGES 12
#define | TX_1X_PAGES 6
#define | TX_PAGES (dev->priv->pingPong ? TX_2X_PAGES : TX_1X_PAGES)
#define | DP_CURR 0x7
#define | DP_MAR0 0x8
#define | DP_MAR1 0x9
#define | DP_MAR2 0xA
#define | DP_MAR3 0xB
#define | DP_MAR4 0xC
#define | DP_MAR5 0xD
#define | DP_MAR6 0xE
#define | DP_MAR7 0xF
#define | DP_CNTR0 0xD
#define | DP_CNTR1 0xE
#define | DP_CNTR2 0xF
#define | DP_PAGESIZE 256
## Typedefs
typedef dp_rcvhdr | dp_rcvhdr_t
typedef etheraddr | ether_addr
## Functions
int | ne2kInit (uInt32)
int | ne2kProbe (int, struct device *)
int | ne2kDevInit (struct device *)
void | NS8390_init (struct device *dev, int startp)
void | ne2kISR ()
void | ne2kHandler ()
int | NICtoPC (struct device *dev, void *packet, int length, int nic_addr)
int | PCtoNIC (struct device *dev, void *packet, int length)
nicBuffer * | ne2kAllocBuffer (int)
nicBuffer * | ne2kGetBuffer ()
void | ne2kFreeBuffer (struct nicBuffer *)
## Variables
char * | nicPacket
uInt32 | packetLength

## Define Documentation

#define DEF_ENABLED 0x200

#define DP_CNTR0 0xD

#define DP_CNTR1 0xE

#define DP_CNTR2 0xF

#define DP_CURR 0x7

#define DP_MAR0 0x8

#define DP_MAR1 0x9

#define DP_MAR2 0xA

#define DP_MAR3 0xB

#define DP_MAR4 0xC

#define DP_MAR5 0xD

#define DP_MAR6 0xE

#define DP_MAR7 0xF

#define DP_PAGESIZE 256

#define E8390_CMD 0x00

#define E8390_NODMA 0x20

#define E8390_PAGE0 0x00

#define E8390_PAGE1 0x40

#define E8390_RREAD 0x08

#define E8390_RWRITE 0x10

#define E8390_RXCONFIG 0x04

#define E8390_RXOFF 0x20

#define E8390_START 0x02

#define E8390_STOP 0x01

#define E8390_TXCONFIG 0x00

#define E8390_TXOFF 0x00

#define EN0_BOUNDARY 0x03

#define EN0_COUNTER0 0x0d

#define EN0_DCFG 0x0e

#define EN0_IMR 0x0f

#define EN0_ISR 0x07

#define EN0_RCNTHI 0x0b

#define EN0_RCNTLO 0x0a

#define EN0_RSARHI 0x09

#define EN0_RSARLO 0x08

#define EN0_RXCR 0x0c

#define EN0_STARTPG 0x01

#define EN0_STOPPG 0x02

#define EN0_TPSR 0x04

#define EN0_TXCR 0x0D

#define EN1_CURPAG 0x07

#define EN1_MULT 0x08

#define EN1_PHYS 0x01

#define ENDCFG_WTS 0x01

#define ENISR_ALL 0x3f

#define ether_addr ether_addr_t

#define NE1SM_START_PG 0x20

#define NE1SM_STOP_PG 0x40

#define NE_BNRY 0x03

#define NE_CMD 0x00

#define NE_CURRENT 0x07

#define NE_DATAPORT 0x10

#define NE_DCR 0x0E

#define NE_DCR_AR 0x10

#define NE_DCR_FT0 0x20

#define NE_DCR_FT1 0x40

#define NE_DCR_LS 0x08

#define NE_DCR_WTS 0x01

#define NE_IMR 0x0F

#define NE_ISR 0x07

#define NE_PSTART 0x01

#define NE_PSTOP 0x02

#define NE_RBCR0 0x0A

#define NE_RBCR1 0x0B

#define NE_RCR 0x0C

#define NE_TCR 0x0D

#define NE_TPSR 0x04

#define NESM_START_PG 0x40

#define NESM_STOP_PG 0x80

#define OK 0

#define RSR_FO 0x08

#define RSR_PRX 0x01

#define startPage 0x4C

#define stopPage 0x80

#define TX_1X_PAGES 6

#define TX_2X_PAGES 12

#define TX_PAGES (dev->priv->pingPong ? TX_2X_PAGES : TX_1X_PAGES)

## Typedef Documentation

typedef struct dp_rcvhdr dp_rcvhdr_t

typedef union etheraddr ether_addr

## Function Documentation

struct nicBuffer* ne2kAllocBuffer | ( | int |  | ) |

int ne2kDevInit | ( | struct device * |  | ) |

void ne2kFreeBuffer | ( | struct nicBuffer * |  | ) |

struct nicBuffer* ne2kGetBuffer | ( |  | ) |

void ne2kHandler | ( |  | ) |

int ne2kInit | ( | uInt32 |  | ) |

void ne2kISR | ( |  | ) |

int ne2kProbe | ( | int | ,
|  | struct device * |
| ) |

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

void NS8390_init | ( | struct device * | dev,
|  | int | startp
| ) |

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

## Variable Documentation

char* nicPacket

uInt32 packetLength