UbixOS V2 2.0

Data Structures | Macros | Functions | Variables
lnc.h File Reference
`#include <sys/types.h>`
Include dependency graph for lnc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | arpcom
struct | hostRingEntry
struct | hostRingEntry_old
struct | initBlock16
struct | initBlock32
struct | lncInfo
struct | mds
struct | nicInfo

## Macros
#define | Am79C960 0x0003
#define | Am79C961 0x2260
#define | Am79C961A 0x2261
#define | Am79C965 0x2430
#define | Am79C970 0x0242
#define | Am79C970A 0x2621
#define | Am79C971 0x2623
#define | Am79C972 0x2624
#define | Am79C973 0x2625
#define | Am79C978 0x2626
#define | AMD_MASK 0x003
#define | BABL 0x4000
#define | BCR18 18
#define | BCR18_DWIO 0x0080
#define | BCR20 0x0014
#define | BDP 0x16
#define | BDP32 0x1C
#define | C_LANCE 2 /* Am79C90 */
#define | CERR 0x2000
#define | CSR0 0x0000
#define | CSR0_STOP 0x0004
#define | CSR1 1
#define | CSR15 15
#define | CSR15_DRTY 0x0020
#define | CSR15_DXMTFCS 0x0008
#define | CSR15_PROM 0x8000
#define | CSR2 2
#define | CSR3 3
#define | CSR58 0x003A
#define | CSR88 88
#define | CSR89 89
#define | DMA_FIXED 1
#define | DMA_MBUF 2
#define | ERR 0x8000
#define | ETHER_ADDR_LEN 6
#define | IDON 0x0100
#define | INEA 0x0040
#define | INIT 0x0001
#define | INTR 0x0080
#define | LANCE 1 /* Am7990 */
#define | MEM_SLEW 8
#define | MERR 0x0800
#define | MISS 0x1000
#define | MODE_16 0
#define | MODE_32 1
#define | MODE_INVALID 3
#define | NDESC(len2) (1 << len2)
#define | NE2100 2
#define | NE2100_IOSIZE 24
#define | NORMAL 0
#define | NRDRE 3
#define | NTDRE 3
#define | PART_MASK 0xffff
#define | PCnet_32 6 /* Am79C965 */
#define | PCnet_FAST 9 /* Am79C971 */
#define | PCnet_FASTplus 10 /* Am79C972 */
#define | PCnet_Home 11 /* Am79C978 */
#define | PCnet_ISA 3 /* Am79C960 */
#define | PCnet_ISA_II 5 /* Am79C961A */
#define | PCnet_ISAplus 4 /* Am79C961 */
#define | PCnet_PCI 7 /* Am79C970 */
#define | PCnet_PCI_II 8 /* Am79C970A */
#define | PCNET_VSW 0x18
#define | RAP 0x12
#define | RAP32 0x14
#define | RDP 0x10
#define | RDP32 0x10
#define | RECVBUFSIZE 1518
#define | RESET 0x14
#define | RESET32 0x18
#define | RINT 0x0400
#define | RXON 0x0020
#define | SHMEM 4
#define | STRT 0x0002
#define | TDMD 0x0008
#define | TINT 0x0200
#define | TRANSBUFSIZE 1518
#define | TXON 0x0010
#define | UNKNOWN 0 /* Unknown */

## Functions
void | _lncInt ()
int | initLNC ()
int | lanceProbe (struct lncInfo *lnc)
int | lnc_driverOwnsRX (struct lncInfo *)
int | lnc_getMode (struct lncInfo *)
void | lnc_INT ()
void | lnc_isr ()
int | lnc_probe (struct lncInfo *)
uint16_t | lnc_readBCR (struct lncInfo *, uint16_t)
uint32_t | lnc_readBCR32 (struct lncInfo *, uint32_t)
uint16_t | lnc_readCSR (struct lncInfo *, uint16_t)
uint32_t | lnc_readCSR32 (struct lncInfo *, uint32_t)
void | lnc_reset (struct lncInfo *)
void | lnc_reset32 (struct lncInfo *)
void | lnc_rxINT ()
int | lnc_sendPacket (struct lncInfo *lnc, void *packet, size_t len, uInt8 *dest)
int | lnc_switchDWord (struct lncInfo *)
void | lnc_txINT ()
void | lnc_writeBCR (struct lncInfo *, uint16_t, uint16_t)
void | lnc_writeBCR32 (struct lncInfo *, uint32_t, uint32_t)
void | lnc_writeCSR (struct lncInfo *, uint16_t, uint16_t)
void | lnc_writeCSR32 (struct lncInfo *, uint32_t, uint32_t)
int | lncAttach (struct lncInfo *lnc, int unit)
void | lncInt ()
int | probe (struct lncInfo *lnc)

## Variables
struct lncInfo * | lnc

## Macro Definition Documentation

## ◆ Am79C960

#define Am79C960 0x0003

Definition at line 234 of file lnc.h.

## ◆ Am79C961

#define Am79C961 0x2260

Definition at line 235 of file lnc.h.

## ◆ Am79C961A

#define Am79C961A 0x2261

Definition at line 236 of file lnc.h.

## ◆ Am79C965

#define Am79C965 0x2430

Definition at line 237 of file lnc.h.

## ◆ Am79C970

#define Am79C970 0x0242

Definition at line 238 of file lnc.h.

## ◆ Am79C970A

#define Am79C970A 0x2621

Definition at line 239 of file lnc.h.

## ◆ Am79C971

#define Am79C971 0x2623

Definition at line 240 of file lnc.h.

## ◆ Am79C972

#define Am79C972 0x2624

Definition at line 241 of file lnc.h.

## ◆ Am79C973

#define Am79C973 0x2625

Definition at line 242 of file lnc.h.

## ◆ Am79C978

#define Am79C978 0x2626

Definition at line 243 of file lnc.h.

## ◆ AMD_MASK

#define AMD_MASK 0x003

Definition at line 232 of file lnc.h.

## ◆ BABL

#define BABL 0x4000

Definition at line 215 of file lnc.h.

## ◆ BCR18

#define BCR18 18

Definition at line 45 of file lnc.h.

## ◆ BCR18_DWIO

#define BCR18_DWIO 0x0080

Definition at line 46 of file lnc.h.

## ◆ BCR20

#define BCR20 0x0014

Definition at line 49 of file lnc.h.

## ◆ BDP

#define BDP 0x16

Definition at line 41 of file lnc.h.

## ◆ BDP32

#define BDP32 0x1C

Definition at line 42 of file lnc.h.

## ◆ C_LANCE

#define C_LANCE 2 /* Am79C90 */

Definition at line 196 of file lnc.h.

## ◆ CERR

#define CERR 0x2000

Definition at line 216 of file lnc.h.

## ◆ CSR0

#define CSR0 0x0000

Definition at line 57 of file lnc.h.

## ◆ CSR0_STOP

#define CSR0_STOP 0x0004

Definition at line 58 of file lnc.h.

## ◆ CSR1

#define CSR1 1

Definition at line 208 of file lnc.h.

## ◆ CSR15

#define CSR15 15

Definition at line 61 of file lnc.h.

## ◆ CSR15_DRTY

#define CSR15_DRTY 0x0020

Definition at line 63 of file lnc.h.

## ◆ CSR15_DXMTFCS

#define CSR15_DXMTFCS 0x0008

Definition at line 62 of file lnc.h.

## ◆ CSR15_PROM

#define CSR15_PROM 0x8000

Definition at line 64 of file lnc.h.

## ◆ CSR2

#define CSR2 2

Definition at line 209 of file lnc.h.

## ◆ CSR3

#define CSR3 3

Definition at line 210 of file lnc.h.

## ◆ CSR58

#define CSR58 0x003A

Definition at line 67 of file lnc.h.

## ◆ CSR88

#define CSR88 88

Definition at line 211 of file lnc.h.

## ◆ CSR89

#define CSR89 89

Definition at line 212 of file lnc.h.

## ◆ DMA_FIXED

#define DMA_FIXED 1

Definition at line 189 of file lnc.h.

## ◆ DMA_MBUF

#define DMA_MBUF 2

Definition at line 190 of file lnc.h.

## ◆ ERR

#define ERR 0x8000

Definition at line 214 of file lnc.h.

## ◆ ETHER_ADDR_LEN

#define ETHER_ADDR_LEN 6

Definition at line 182 of file lnc.h.

## ◆ IDON

#define IDON 0x0100

Definition at line 221 of file lnc.h.

## ◆ INEA

#define INEA 0x0040

Definition at line 223 of file lnc.h.

## ◆ INIT

#define INIT 0x0001

Definition at line 229 of file lnc.h.

## ◆ INTR

#define INTR 0x0080

Definition at line 222 of file lnc.h.

## ◆ LANCE

#define LANCE 1 /* Am7990 */

Definition at line 195 of file lnc.h.

## ◆ MEM_SLEW

#define MEM_SLEW 8

Definition at line 177 of file lnc.h.

## ◆ MERR

#define MERR 0x0800

Definition at line 218 of file lnc.h.

## ◆ MISS

#define MISS 0x1000

Definition at line 217 of file lnc.h.

## ◆ MODE_16

#define MODE_16 0

Definition at line 52 of file lnc.h.

## ◆ MODE_32

#define MODE_32 1

Definition at line 53 of file lnc.h.

## ◆ MODE_INVALID

#define MODE_INVALID 3

Definition at line 54 of file lnc.h.

## ◆ NDESC

#define NDESC | ( |  | len2 | ) | (1 << len2)

Definition at line 175 of file lnc.h.

## ◆ NE2100

#define NE2100 2

Definition at line 186 of file lnc.h.

## ◆ NE2100_IOSIZE

#define NE2100_IOSIZE 24

Definition at line 183 of file lnc.h.

## ◆ NORMAL

#define NORMAL 0

Definition at line 176 of file lnc.h.

## ◆ NRDRE

#define NRDRE 3

Definition at line 180 of file lnc.h.

## ◆ NTDRE

#define NTDRE 3

Definition at line 181 of file lnc.h.

## ◆ PART_MASK

#define PART_MASK 0xffff

Definition at line 233 of file lnc.h.

## ◆ PCnet_32

#define PCnet_32 6 /* Am79C965 */

Definition at line 200 of file lnc.h.

## ◆ PCnet_FAST

#define PCnet_FAST 9 /* Am79C971 */

Definition at line 203 of file lnc.h.

## ◆ PCnet_FASTplus

#define PCnet_FASTplus 10 /* Am79C972 */

Definition at line 204 of file lnc.h.

## ◆ PCnet_Home

#define PCnet_Home 11 /* Am79C978 */

Definition at line 205 of file lnc.h.

## ◆ PCnet_ISA

#define PCnet_ISA 3 /* Am79C960 */

Definition at line 197 of file lnc.h.

## ◆ PCnet_ISA_II

#define PCnet_ISA_II 5 /* Am79C961A */

Definition at line 199 of file lnc.h.

## ◆ PCnet_ISAplus

#define PCnet_ISAplus 4 /* Am79C961 */

Definition at line 198 of file lnc.h.

## ◆ PCnet_PCI

#define PCnet_PCI 7 /* Am79C970 */

Definition at line 201 of file lnc.h.

## ◆ PCnet_PCI_II

#define PCnet_PCI_II 8 /* Am79C970A */

Definition at line 202 of file lnc.h.

## ◆ PCNET_VSW

#define PCNET_VSW 0x18

Definition at line 185 of file lnc.h.

## ◆ RAP

#define RAP 0x12

Definition at line 37 of file lnc.h.

## ◆ RAP32

#define RAP32 0x14

Definition at line 38 of file lnc.h.

## ◆ RDP

#define RDP 0x10

Definition at line 35 of file lnc.h.

## ◆ RDP32

#define RDP32 0x10

Definition at line 36 of file lnc.h.

## ◆ RECVBUFSIZE

#define RECVBUFSIZE 1518

Definition at line 179 of file lnc.h.

## ◆ RESET

#define RESET 0x14

Definition at line 39 of file lnc.h.

## ◆ RESET32

#define RESET32 0x18

Definition at line 40 of file lnc.h.

## ◆ RINT

#define RINT 0x0400

Definition at line 219 of file lnc.h.

## ◆ RXON

#define RXON 0x0020

Definition at line 224 of file lnc.h.

## ◆ SHMEM

#define SHMEM 4

Definition at line 191 of file lnc.h.

## ◆ STRT

#define STRT 0x0002

Definition at line 228 of file lnc.h.

## ◆ TDMD

#define TDMD 0x0008

Definition at line 226 of file lnc.h.

## ◆ TINT

#define TINT 0x0200

Definition at line 220 of file lnc.h.

## ◆ TRANSBUFSIZE

#define TRANSBUFSIZE 1518

Definition at line 178 of file lnc.h.

## ◆ TXON

#define TXON 0x0010

Definition at line 225 of file lnc.h.

## ◆ UNKNOWN

#define UNKNOWN 0 /* Unknown */

Definition at line 194 of file lnc.h.

## Function Documentation

## ◆ _lncInt()

void _lncInt | ( |  | ) |

## ◆ initLNC()

int initLNC | ( |  | ) |

Definition at line 94 of file lnc.c.

References arpcom::ac_enaddr, lncInfo::arpcom, lncInfo::bufferSize, CSR0, CSR1, CSR2, CSR3, dDpl3, dInt, DMA_FIXED, dPresent, ETHER_ADDR_LEN, nicInfo::ic, nicInfo::ident, IDON, INEA, lncInfo::init, INIT, inportByte(), lncInfo::ioAddr, irqEnable(), kmalloc(), kprintf(), lnc, lnc_getMode(), lnc_isr(), lnc_probe(), lnc_readBCR32(), lnc_readCSR32(), lnc_switchDWord(), lnc_writeBCR32(), lnc_writeCSR32(), lncAttach(), nicInfo::memMode, memset(), initBlock32::mode, MODE_16, MODE_32, NE2100, lncInfo::nic, lncInfo::nrdre, NRDRE, lncInfo::ntdre, NTDRE, initBlock32::padr, PCnet_32, initBlock32::rdra, initBlock32::rlen, lncInfo::rxRing, setVector(), STRT, sVec, initBlock32::tdra, initBlock32::tlen, lncInfo::txRing, and vmm_getRealAddr().

Here is the call graph for this function:

## ◆ lanceProbe()

int lanceProbe | ( | struct lncInfo * | lnc | ) |

Definition at line 231 of file lnc.c.

References C_LANCE, CSR0, CSR0_STOP, CSR3, INEA, inportWord(), lncInfo::ioAddr, LANCE, lnc, lnc_readCSR(), lnc_writeCSR(), RDP, and UNKNOWN.

Referenced by lnc_probe().

Here is the call graph for this function:

## ◆ lnc_driverOwnsRX()

int lnc_driverOwnsRX | ( | struct lncInfo * |  | ) |

Definition at line 518 of file lnc.c.

References lnc, hostRingEntry::md, lncInfo::rxPtr, and lncInfo::rxRing.

Referenced by lnc_rxINT(), and lnc_thread().

## ◆ lnc_getMode()

int lnc_getMode | ( | struct lncInfo * |  | ) |

Definition at line 573 of file lnc.c.

References CSR0, CSR0_STOP, lnc, lnc_readCSR(), lnc_readCSR32(), lnc_reset(), lnc_reset32(), MODE_16, MODE_32, and MODE_INVALID.

Referenced by initLNC().

Here is the call graph for this function:

## ◆ lnc_INT()

void lnc_INT | ( |  | ) |

Definition at line 254 of file lnc.c.

References CSR0, ERR, kprintf(), lnc, lnc_writeCSR32(), RINT, and TINT.

Here is the call graph for this function:

## ◆ lnc_isr()

void lnc_isr | ( |  | ) |

Referenced by initLNC().

## ◆ lnc_probe()

int lnc_probe | ( | struct lncInfo * |  | ) |

Definition at line 191 of file lnc.c.

References Am79C960, Am79C961, Am79C961A, Am79C965, Am79C970, Am79C970A, Am79C971, Am79C972, Am79C973, Am79C978, AMD_MASK, CSR88, CSR89, lanceProbe(), lnc, lnc_readCSR(), PART_MASK, PCnet_32, PCnet_FAST, PCnet_FASTplus, PCnet_Home, PCnet_ISA, PCnet_ISA_II, PCnet_ISAplus, PCnet_PCI, and PCnet_PCI_II.

Referenced by initLNC().

Here is the call graph for this function:

## ◆ lnc_readBCR()

uint16_t lnc_readBCR | ( | struct lncInfo * | ,
|  | uint16_t |
| ) |  |

Definition at line 84 of file lnc.c.

References BDP, inportWord(), lncInfo::ioAddr, lnc, outportWord(), and RAP.

Here is the call graph for this function:

## ◆ lnc_readBCR32()

uint32_t lnc_readBCR32 | ( | struct lncInfo * | ,
|  | uint32_t |
| ) |  |

Definition at line 89 of file lnc.c.

References BDP32, inportDWord(), lncInfo::ioAddr, lnc, outportDWord(), and RAP32.

Referenced by initLNC(), and lnc_switchDWord().

Here is the call graph for this function:

## ◆ lnc_readCSR()

uint16_t lnc_readCSR | ( | struct lncInfo * | ,
|  | uint16_t |
| ) |  |

Definition at line 64 of file lnc.c.

References inportWord(), lncInfo::ioAddr, lnc, outportWord(), RAP, and RDP.

Referenced by lanceProbe(), lnc_getMode(), and lnc_probe().

Here is the call graph for this function:

## ◆ lnc_readCSR32()

uint32_t lnc_readCSR32 | ( | struct lncInfo * | ,
|  | uint32_t |
| ) |  |

Definition at line 69 of file lnc.c.

References inportDWord(), lncInfo::ioAddr, lnc, outportDWord(), RAP32, and RDP32.

Referenced by initLNC(), lnc_getMode(), and lnc_switchDWord().

Here is the call graph for this function:

## ◆ lnc_reset()

void lnc_reset | ( | struct lncInfo * |  | ) |

Definition at line 585 of file lnc.c.

References inportWord(), lncInfo::ioAddr, lnc, and RESET.

Referenced by lnc_getMode().

Here is the call graph for this function:

## ◆ lnc_reset32()

void lnc_reset32 | ( | struct lncInfo * |  | ) |

Definition at line 589 of file lnc.c.

References inportDWord(), lncInfo::ioAddr, lnc, and RESET32.

Referenced by lnc_getMode().

Here is the call graph for this function:

## ◆ lnc_rxINT()

void lnc_rxINT | ( |  | ) |

Definition at line 316 of file lnc.c.

References nicBuffer::buffer, lncInfo::bufferSize, kmalloc(), nicBuffer::length, lnc, lnc_driverOwnsRX(), lnc_nextRxPtr(), hostRingEntry::md, memset(), lncInfo::rxBuffer, lncInfo::rxPtr, lncInfo::rxRing, and tmpBuf.

Here is the call graph for this function:

## ◆ lnc_sendPacket()

int lnc_sendPacket | ( | struct lncInfo * | lnc,
|  | void * | packet,
|  | size_t | len,
|  | uInt8 * | dest
| ) |  |

Definition at line 546 of file lnc.c.

References hostRingEntry::bcnt, lncInfo::bufferSize, kpanic(), lnc, lnc_driverOwnsTX(), lnc_nextTxPtr(), hostRingEntry::md, memcpy(), lncInfo::txBuffer, lncInfo::txPtr, and lncInfo::txRing.

Here is the call graph for this function:

## ◆ lnc_switchDWord()

int lnc_switchDWord | ( | struct lncInfo * |  | ) |

Definition at line 593 of file lnc.c.

References BCR18, BCR18_DWIO, CSR58, inportDWord(), inportWord(), lncInfo::ioAddr, kprintf(), lnc, lnc_readBCR32(), lnc_readCSR32(), lnc_writeCSR32(), outportDWord(), RDP, RESET, and RESET32.

Referenced by initLNC().

Here is the call graph for this function:

## ◆ lnc_txINT()

void lnc_txINT | ( |  | ) |

Definition at line 352 of file lnc.c.

## ◆ lnc_writeBCR()

void lnc_writeBCR | ( | struct lncInfo * | ,
|  | uint16_t | ,
|  | uint16_t |
| ) |  |

Definition at line 74 of file lnc.c.

References BDP, lncInfo::ioAddr, lnc, outportWord(), and RAP.

Here is the call graph for this function:

## ◆ lnc_writeBCR32()

void lnc_writeBCR32 | ( | struct lncInfo * | ,
|  | uint32_t | ,
|  | uint32_t |
| ) |  |

Definition at line 79 of file lnc.c.

References BDP32, lncInfo::ioAddr, lnc, outportDWord(), and RAP32.

Referenced by initLNC().

Here is the call graph for this function:

## ◆ lnc_writeCSR()

void lnc_writeCSR | ( | struct lncInfo * | ,
|  | uint16_t | ,
|  | uint16_t |
| ) |  |

Definition at line 54 of file lnc.c.

References lncInfo::ioAddr, lnc, outportWord(), RAP, and RDP.

Referenced by lanceProbe().

Here is the call graph for this function:

## ◆ lnc_writeCSR32()

void lnc_writeCSR32 | ( | struct lncInfo * | ,
|  | uint32_t | ,
|  | uint32_t |
| ) |  |

Definition at line 59 of file lnc.c.

References lncInfo::ioAddr, lnc, outportDWord(), RAP32, and RDP32.

Referenced by initLNC(), lnc_INT(), and lnc_switchDWord().

Here is the call graph for this function:

## ◆ lncAttach()

int lncAttach | ( | struct lncInfo * | lnc,
|  | int | unit
| ) |  |

Definition at line 419 of file lnc.c.

References hostRingEntry::addr, hostRingEntry::bcnt, lncInfo::bufferSize, C_LANCE, nicInfo::ic, kmalloc(), kprintf(), LANCE, lnc, hostRingEntry::md, nicInfo::memMode, memset(), nicInfo::mode, NDESC, lncInfo::nic, NORMAL, lncInfo::nrdre, lncInfo::ntdre, PCnet_32, lncInfo::rxBuffer, lncInfo::rxRing, SHMEM, lncInfo::txBuffer, lncInfo::txRing, and vmm_getRealAddr().

Referenced by initLNC().

Here is the call graph for this function:

## ◆ lncInt()

void lncInt | ( |  | ) |

Definition at line 368 of file lnc.c.

References ERR, inportWord(), INTR, lncInfo::ioAddr, kprintf(), lnc, outportByte(), outportWord(), RDP, RINT, and TINT.

Here is the call graph for this function:

## ◆ probe()

int probe | ( | struct lncInfo * | lnc | ) |

## Variable Documentation

## ◆ lnc

struct lncInfo* lnc

Definition at line 44 of file lnc.c.

Referenced by initLNC(), lanceProbe(), lnc_driverOwnsRX(), lnc_driverOwnsTX(), lnc_getMode(), lnc_INT(), lnc_nextRxPtr(), lnc_nextTxPtr(), lnc_probe(), lnc_readBCR(), lnc_readBCR32(), lnc_readCSR(), lnc_readCSR32(), lnc_reset(), lnc_reset32(), lnc_rxINT(), lnc_sendPacket(), lnc_switchDWord(), lnc_thread(), lnc_writeBCR(), lnc_writeBCR32(), lnc_writeCSR(), lnc_writeCSR32(), lncAttach(), and lncInt().