File nut/arch/avr/dev/lanc111.c

References Functions: LancInit() nut/arch/avr/dev/lanc111.c
  LancOutput() nut/arch/avr/dev/lanc111.c
  NutEtherInput() nut/net/ethin.c
  NutEtherOutput() nut/net/ethout.c
References Variables: dcb_eth0 nut/arch/avr/dev/lanc111.c
  ifn_eth0 nut/arch/avr/dev/lanc111.c

Included Files


Preprocessor definitions

#define LANC111_BASE_ADDR 0xC000

#define LANC111_SIGNAL_IRQ INT5

#define LANC111_SIGNAL sig_INTERRUPT5

#define LANC111_SIGNAL_MODE

#define NIC_BSR

#define NIC_TCR

#define TCR_SWFDUP 0x8000

#define TCR_EPH_LOOP 0x2000

#define TCR_STP_SQET 0x1000

#define TCR_FDUPLX 0x0800

#define TCR_MON_CSN 0x0400

#define TCR_NOCRC 0x0100

#define TCR_PAD_EN 0x0080

#define TCR_FORCOL 0x0004

#define TCR_LOOP 0x0002

#define TCR_TXENA 0x0001

#define NIC_EPHSR

#define NIC_RCR

#define RCR_SOFT_RST 0x8000

#define RCR_FILT_CAR 0x4000

#define RCR_ABORT_ENB 0x2000

#define RCR_STRIP_CRC 0x0200

#define RCR_RXEN 0x0100

#define RCR_ALMUL 0x0004

#define RCR_PRMS 0x0002

#define RCR_RX_ABORT 0x0001

#define NIC_ECR

#define NIC_MIR

#define NIC_RPCR

#define RPCR_SPEED 0x2000

#define RPCR_DPLX 0x1000

#define RPCR_ANEG 0x0800

#define RPCR_LEDA_PAT 0x0000

#define RPCR_LEDB_PAT 0x0010

#define NIC_CR

#define CR_EPH_EN 0x8000

#define NIC_BAR

#define NIC_IAR

#define NIC_GPR

#define NIC_CTR

#define CTR_RCV_BAD 0x4000

#define CTR_AUTO_RELEASE 0x0800

#define NIC_MMUCR

#define MMUCR_BUSY 0x0001

#define MMU_NOP 0

#define MMU_ALO

#define MMU_RST

#define MMU_REM

#define MMU_TOP

#define MMU_PKT

#define MMU_ENQ

#define MMU_RTX

#define NIC_PNR

#define NIC_ARR

#define ARR_FAILED 0x80

#define NIC_FIFO

#define NIC_PTR

#define PTR_RCV 0x8000

#define PTR_AUTO_INCR 0x4000

#define PTR_READ 0x2000

#define PTR_ETEN 0x1000

#define PTR_NOT_EMPTY 0x0800

#define NIC_DATA

#define NIC_IST

#define NIC_ACK

#define NIC_MSK

#define INT_MD 0x80

#define INT_ERCV 0x40

#define INT_EPH 0x20

#define INT_RX_OVRN 0x10

#define INT_ALLOC 0x08

#define INT_TX_EMPTY 0x04

#define INT_TX 0x02

#define INT_RCV 0x01

#define NIC_MT

#define NIC_MGMT

#define MGMT_MDOE 0x08

#define MGMT_MCLK 0x04

#define MGMT_MDI 0x02

#define MGMT_MDO 0x01

#define NIC_REV

#define NIC_ERCV

#define NIC_PHYCR 0

#define PHYCR_RST 0x8000

#define PHYCR_LPBK 0x4000

#define PHYCR_SPEED 0x2000

#define PHYCR_ANEG_EN 0x1000

#define PHYCR_PDN 0x0800

#define PHYCR_MII_DIS 0x0400

#define PHYCR_ANEG_RST 0x0200

#define PHYCR_DPLX 0x0100

#define PHYCR_COLST 0x0080

#define NIC_PHYSR 1

#define PHYSR_CAP_T4 0x8000

#define PHYSR_CAP_TXF 0x4000

#define PHYSR_CAP_TXH 0x2000

#define PHYSR_CAP_TF 0x1000

#define PHYSR_CAP_TH 0x0800

#define PHYSR_CAP_SUPR 0x0040

#define PHYSR_ANEG_ACK 0x0020

#define PHYSR_REM_FLT 0x0010

#define PHYSR_CAP_ANEG 0x0008

#define PHYSR_LINK 0x0004

#define PHYSR_JAB 0x0002

#define PHYSR_EXREG 0x0001

#define NIC_PHYID1 2

#define NIC_PHYID2 3

#define NIC_PHYANAD 4

#define PHYANAD_NP 0x8000

#define PHYANAD_ACK 0x4000

#define PHYANAD_RF 0x2000

#define PHYANAD_T4 0x0200

#define PHYANAD_TX_FDX 0x0100

#define PHYANAD_TX_HDX 0x0080

#define PHYANAD_10FDX 0x0040

#define PHYANAD_10_HDX 0x0020

#define PHYANAD_CSMA 0x0001

#define NIC_PHYANRC 5

#define NIC_PHYCFR1 16

#define NIC_PHYCFR2 17

#define NIC_PHYSOR 18

#define PHYSOR_INT 0x8000

#define PHYSOR_LNKFAIL 0x4000

#define PHYSOR_LOSSSYNC 0x2000

#define PHYSOR_CWRD 0x1000

#define PHYSOR_SSD 0x0800

#define PHYSOR_ESD 0x0400

#define PHYSOR_RPOL 0x0200

#define PHYSOR_JAB 0x0100

#define PHYSOR_SPDDET 0x0080

#define PHYSOR_DPLXDET 0x0040

#define NIC_PHYMSK 19

#define PHYMSK_MINT 0x8000

#define PHYMSK_MLNKFAIL 0x4000

#define PHYMSK_MLOSSSYN 0x2000

#define PHYMSK_MCWRD 0x1000

#define PHYMSK_MSSD 0x0800

#define PHYMSK_MESD 0x0400

#define PHYMSK_MRPOL 0x0200

#define PHYMSK_MJAB 0x0100

#define PHYMSK_MSPDDT 0x0080

#define PHYMSK_MDPLDT 0x0040

#define MSBV( bit )

#define nic_outlb( addr, val )

#define nic_outhb( addr, val )

#define nic_outwx( addr, val )

#define nic_outw( addr, val )

#define nic_inlb( addr )

#define nic_inhb( addr )

#define nic_inw( addr )

#define nic_bs( bank )


Type struct _NICINFO

struct _NICINFO
struct _NICINFO  
   {  
      HANDLE volatile ni_rx_rdy;  
      u_short ni_tx_cnt;  
      u_long ni_rx_packets;  
      u_long ni_tx_packets;  
      u_long ni_interrupts;  
      u_long ni_overruns;  
      u_long ni_rx_frame_errors;  
      u_long ni_rx_crc_errors;  
      u_long ni_rx_missed_errors;  
   }  

Typedef NICINFO

typedef struct _NICINFO NICINFO
See: Type struct _NICINFO

Global Variable devSmsc111

NUTDEVICE devSmsc111
Visible in:   nut/arch/avr/dev/lanc111.c

Local Variables

mutex
static HANDLE mutex
Used in: LancOutput()  
  NicRxLanc()  

maq
static HANDLE maq

Used in: NicInterrupt()  
  NicPutPacket()  

dcb_eth0
static NICINFO dcb_eth0

Used in:   nut/arch/avr/dev/lanc111.c

ifn_eth0
static IFNET ifn_eth0

Used in:   nut/arch/avr/dev/lanc111.c

Global Function LancInit()

int LancInit ( NUTDEVICE* dev )
Prototyped in: nut/include/dev/lanc111.h
Calls: NutRegisterIrqHandler() nut/dev/ihndlr.c
  NutThreadCreate() nut/arch/avr/os/context_gcc.c
  memset()
Used in:   nut/arch/avr/dev/lanc111.c
References Functions: NicInterrupt() nut/arch/avr/dev/lanc111.c
  NicRxLanc() nut/arch/avr/dev/lanc111.c

Global Function LancOutput()

int LancOutput ( NUTDEVICE* dev, NETBUF* nb )
Prototyped in: nut/include/dev/lanc111.h
Calls: NicPutPacket() nut/arch/avr/dev/lanc111.c
  NutEventPost() nut/os/event.c
  NutEventWait() nut/os/event.c
Used in:   nut/arch/avr/dev/lanc111.c
References Variables: mutex nut/arch/avr/dev/lanc111.c

Global Function NicRxLanc()

void NicRxLanc ( void* arg )
Prototyped in: nut/arch/avr/dev/lanc111.c
Calls: NicGetPacket() nut/arch/avr/dev/lanc111.c
  NicStart() nut/arch/avr/dev/lanc111.c
  NutEventPost() nut/os/event.c
  NutEventWait() nut/os/event.c
  NutSleep() nut/os/timer.c
  NutThreadSetPriority() nut/os/thread.c
Used in: LancInit() nut/arch/avr/dev/lanc111.c
References Variables: mutex nut/arch/avr/dev/lanc111.c

Local Function NicGetPacket()

static NETBUF* NicGetPacket ( void )
Calls: NicRead() nut/arch/avr/dev/lanc111.c
  NutNetBufAlloc() nut/dev/netbuf.c
Called by: NicRxLanc() nut/arch/avr/dev/lanc111.c

Local Function NicInterrupt()

static void NicInterrupt ( void* arg )
Used in: LancInit() nut/arch/avr/dev/lanc111.c
References Variables: maq nut/arch/avr/dev/lanc111.c

Local Function NicMmuWait()

static inline int NicMmuWait ( u_short tmo )
Calls: NutDelay()
Called by: NicPutPacket() nut/arch/avr/dev/lanc111.c
  NicReset() nut/arch/avr/dev/lanc111.c

Local Function NicPhyConfig()

static int NicPhyConfig ( void )
Calls: NicPhyRead() nut/arch/avr/dev/lanc111.c
  NicPhyWrite() nut/arch/avr/dev/lanc111.c
  NutSleep() nut/os/timer.c
Called by: NicStart() nut/arch/avr/dev/lanc111.c

Local Function NicPhyRead()

static u_short NicPhyRead ( u_char reg )
Calls: NicPhyRegSelect() nut/arch/avr/dev/lanc111.c
Called by: NicPhyConfig() nut/arch/avr/dev/lanc111.c

Local Function NicPhyRegSelect()

static u_char NicPhyRegSelect ( u_char reg, u_char we )
Called by: NicPhyRead() nut/arch/avr/dev/lanc111.c
  NicPhyWrite() nut/arch/avr/dev/lanc111.c

Local Function NicPhyWrite()

static void NicPhyWrite ( u_char reg, u_short val )
Calls: NicPhyRegSelect() nut/arch/avr/dev/lanc111.c
Called by: NicPhyConfig() nut/arch/avr/dev/lanc111.c

Local Function NicPutPacket()

static int NicPutPacket ( NETBUF* nb )
Calls: NicMmuWait() nut/arch/avr/dev/lanc111.c
  NicWrite() nut/arch/avr/dev/lanc111.c
  NutEventWait() nut/os/event.c
Called by: LancOutput() nut/arch/avr/dev/lanc111.c
References Variables: maq nut/arch/avr/dev/lanc111.c

Local Function NicRead()

static void NicRead ( u_char* buf, u_short len )
Called by: NicGetPacket() nut/arch/avr/dev/lanc111.c

Local Function NicReset()

static int NicReset ( void )
Calls: NicMmuWait() nut/arch/avr/dev/lanc111.c
  NutDelay()
Called by: NicStart() nut/arch/avr/dev/lanc111.c

Local Function NicStart()

static int NicStart ( const u_char* mac )
Calls: NicPhyConfig() nut/arch/avr/dev/lanc111.c
  NicReset() nut/arch/avr/dev/lanc111.c
Called by: NicRxLanc() nut/arch/avr/dev/lanc111.c

Local Function NicWrite()

static void NicWrite ( u_char* buf, u_short len )
Called by: NicPutPacket() nut/arch/avr/dev/lanc111.c