- Main Page
- Data Structures
- Files
- Directories

- Search for |

- File List
- Globals

# lnc.c File Reference

`#include <pci/lnc.h>`
`#include <sys/io.h>`
`#include <ubixos/types.h>`
`#include <sys/idt.h>`
`#include <sys/gdt.h>`
`#include <lib/kmalloc.h>`
`#include <lib/kprintf.h>`
`#include <sys/video.h>`
`#include <isa/8259.h>`

Include dependency graph for lnc.c:

Go to the source code of this file.

## Functions
| asm (".global _lncInt \n""_lncInt : \n"" pusha \n"" pushw %ds \n"" pushw %es \n"" pushw %ss \n"" pushw %ss \n"" popw %ds \n"" popw %es \n"" call lncInt \n"" popw %es \n"" popw %ds \n"" popa \n"" iret \n")
void | initLNC ()
int | lanceProbe (struct lncInfo *lnc)
int | lncAttach (struct lncInfo *lnc, int unit)
void | lncInt ()
int | probe (struct lncInfo *lnc)
uInt16 | readBcr (struct lncInfo *sc, uInt16 port)
uInt16 | readCsr (struct lncInfo *lnc, uInt16 port)
void | writeBcr (struct lncInfo *lnc, uInt16 port, uInt16 val)
void | writeCsr (struct lncInfo *lnc, uInt16 port, uInt16 val)
## Variables
static char const *const | icIdent []
lncInfo * | lnc = 0x0
static char const *const | nicIdent []

## Function Documentation

asm | ( | ".global _lncInt \n""_lncInt : \n"" pusha \n"" pushw %ds \n"" pushw %es \n"" pushw %ss \n"" pushw %ss \n"" popw %ds \n"" popw %es \n"" call lncInt \n"" popw %es \n"" popw %ds \n"" popa \n"" iret \n" |  | ) |

void initLNC | ( |  | ) |

Definition at line 104 of file lnc.c.

References _lncInt(), arpcom::ac_enaddr, lncInfo::arpcom, lncInfo::bdp, CSR0, CSR3, dDpl3, dInt, DMA_FIXED, dPresent, ETHER_ADDR_LEN, nicInfo::ic, nicInfo::ident, IDON, INEA, INIT, inportByte(), kmalloc(), kprintf(), lnc, lncAttach(), nicInfo::memMode, mVec, NE2100, lncInfo::nic, NRDRE, lncInfo::nrdre, NTDRE, lncInfo::ntdre, PCnet_32, PCNET_BDP, PCNET_RAP, PCNET_RDP, probe(), lncInfo::rap, lncInfo::rdp, readCsr(), setVector(), STRT, writeCsr(), and x1000.

Here is the call graph for this function:

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

Definition at line 192 of file lnc.c.

References C_LANCE, CSR0, CSR3, INEA, inportWord(), LANCE, lnc, lncInfo::rdp, readCsr(), STOP, UNKNOWN, and writeCsr().

Referenced by probe().

Here is the call graph for this function:

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

Definition at line 246 of file lnc.c.

References arpcom::ac_enaddr, lncInfo::arpcom, C_LANCE, DMA_FIXED, nicInfo::ic, icIdent, nicInfo::ident, kmalloc(), kprintf(), LANCE, lnc, MEM_SLEW, nicInfo::memMode, nicInfo::mode, NDESC, lncInfo::nic, nicIdent, NORMAL, lncInfo::nrdre, lncInfo::ntdre, PCnet_32, RECVBUFSIZE, lncInfo::recvRing, SHMEM, and TRANSBUFSIZE.

Referenced by initLNC().

Here is the call graph for this function:

void lncInt | ( |  | ) |

Definition at line 208 of file lnc.c.

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

Here is the call graph for this function:

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

Definition at line 154 of file lnc.c.

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

Referenced by initLNC().

Here is the call graph for this function:

uInt16 readBcr | ( | struct lncInfo * | sc,
|  | uInt16 | port |
| ) |  |  |

Definition at line 98 of file lnc.c.

References lncInfo::bdp, inportWord(), outportWord(), and lncInfo::rap.

Here is the call graph for this function:

uInt16 readCsr | ( | struct lncInfo * | lnc,
|  | uInt16 | port |
| ) |  |  |

Definition at line 88 of file lnc.c.

References inportWord(), lnc, outportWord(), lncInfo::rap, and lncInfo::rdp.

Referenced by initLNC(), lanceProbe(), and probe().

Here is the call graph for this function:

void writeBcr | ( | struct lncInfo * | lnc,
|  | uInt16 | port,
|  | uInt16 | val |
| ) |  |  |

Definition at line 93 of file lnc.c.

References lncInfo::bdp, lnc, outportWord(), and lncInfo::rap.

Here is the call graph for this function:

void writeCsr | ( | struct lncInfo * | lnc,
|  | uInt16 | port,
|  | uInt16 | val |
| ) |  |  |

Definition at line 83 of file lnc.c.

References lnc, outportWord(), lncInfo::rap, and lncInfo::rdp.

Referenced by initLNC(), and lanceProbe().

Here is the call graph for this function:

## Variable Documentation

char const* const icIdent[]`[static]`

Initial value:

     {
      "Unknown",
      "LANCE",
      "C-LANCE",
      "PCnet-ISA",
      "PCnet-ISA+",
      "PCnet-ISA II",
      "PCnet-32 VL-Bus",
      "PCnet-PCI",
      "PCnet-PCI II",
      "PCnet-FAST",
      "PCnet-FAST+",
      "PCnet-Home",
      }

Definition at line 68 of file lnc.c.

Referenced by lncAttach().

struct lncInfo* lnc = 0x0

Definition at line 58 of file lnc.c.

Referenced by initLNC(), lanceProbe(), lncAttach(), lncInt(), probe(), readCsr(), writeBcr(), and writeCsr().

char const* const nicIdent[]`[static]`

Initial value:

     {
      "Unknown",
      "BICC",
      "NE2100",
      "DEPCA",
      "CNET98S",
      }

Definition at line 60 of file lnc.c.

Referenced by lncAttach().