Dokumentacja pliku src/net/3c556.cpp

3c556 ethernet driver port from lightsys, etherboot Więcej...

#include "src/common/shared.hpp"
#include "src/memory/memset.hpp"
#include "src/memory/align.hpp"
#include "src/memory/heap.hpp"
#include "src/memory/pager.hpp"
#include "src/arch/x86/pcibios.hpp"
#include "src/arch/x86/interr.hpp"
#include "src/arch/x86/rtc.hpp"
#include "src/common/io.hpp"
#include "src/net/net.hpp"
#include "src/net/3c556.hpp"
#include "src/thread/timer.hpp"

Idź do kodu źródłowego tego pliku.

Przestrzenie nazw

namespace  Arch
namespace  Arch::x86
namespace  Arch::x86::RTC

Komponenty

struct  TXD
struct  RXD
struct  INF_3C556_Type

Definicje

#define INT_INTERRUPTLATCH   (1<<0)
#define INT_HOSTERROR   (1<<1)
#define INT_TXCOMPLETE   (1<<2)
#define INT_RXCOMPLETE   (1<<4)
#define INT_RXEARLY   (1<<5)
#define INT_INTREQUESTED   (1<<6)
#define INT_UPDATESTATS   (1<<7)
#define INT_LINKEVENT   (1<<8)
#define INT_DNCOMPLETE   (1<<9)
#define INT_UPCOMPLETE   (1<<10)
#define INT_CMDINPROGRESS   (1<<12)
#define INT_WINDOWNUMBER   (7<<13)
#define ETH_ALEN   6
#define XMIT_RETRIES   250

Wyliczenia

enum  Registers {
  regCommandIntStatus_w = 0xe, regUpListPtr_l = 0x38, regDnListPtr_l = 0x24, regTxStatus_b = 0x1b,
  regPowerMgmtCtrl_w = 0x7c, regUpMaxBurst_w = 0x7a, regDnMaxBurst_w = 0x78, regDebugControl_w = 0x74,
  regDebugData_l = 0x70, regRealTimeCnt_l = 0x40, regUpBurstThresh_b = 0x3e, regUpPoll_b = 0x3d,
  regUpPriorityThresh_b = 0x3c, regUpListPtr_l = 0x38, regCountdown_w = 0x36, regFreeTimer_w = 0x34,
  regUpPktStatus_l = 0x30, regTxFreeThresh_b = 0x2f, regDnPoll_b = 0x2d, regDnPriorityThresh_b = 0x2c,
  regDnBurstThresh_b = 0x2a, regDnListPtr_l = 0x24, regDmaCtrl_l = 0x20, regIntStatusAuto_w = 0x1e,
  regTxStatus_b = 0x1b, regTimer_b = 0x1a, regTxPktId_b = 0x18, regCommandIntStatus_w = 0x0e
}
enum  Registers0 {
  regEepromData_0_w = 0x0c, regEepromCommand_0_w = 0x0a, regBiosRomData_0_b = 0x08, regBiosRomAddr_0_l = 0x04,
  regEepromData_0_w = 0x0c, regEepromCommand_0_w = 0x0a, regBiosRomData_0_b = 0x08, regBiosRomAddr_0_l = 0x04
}
enum  Registers2 {
  regResetOptions_2_w = 0x0c, regStationMask_2_3w = 0x06, regStationAddress_2_3w = 0x00, regResetOptions_2_w = 0x0c,
  regStationMask_2_3w = 0x06, regStationAddress_2_3w = 0x00
}
enum  Registers3 {
  regTxFree_3_w = 0x0c, regRxFree_3_w = 0x0a, regResetMediaOptions_3_w = 0x08, regMacControl_3_w = 0x06,
  regMaxPktSize_3_w = 0x04, regInternalConfig_3_l = 0x00, regTxFree_3_w = 0x0c, regRxFree_3_w = 0x0a,
  regResetMediaOptions_3_w = 0x08, regMacControl_3_w = 0x06, regMaxPktSize_3_w = 0x04, regInternalConfig_3_l = 0x00
}
enum  Windows {
  winPowerVlan7 = 0x07, winStatistics6 = 0x06, winTxRxControl5 = 0x05, winDiagnostics4 = 0x04,
  winTxRxOptions3 = 0x03, winAddressing2 = 0x02, winUnused1 = 0x01, winEepromBios0 = 0x00,
  winPowerVlan7 = 0x07, winStatistics6 = 0x06, winTxRxControl5 = 0x05, winDiagnostics4 = 0x04,
  winTxRxOptions3 = 0x03, winAddressing2 = 0x02, winUnused1 = 0x01, winEepromBios0 = 0x00
}
enum  Commands {
  cmdGlobalReset = 0x00, cmdSelectRegisterWindow = 0x01, cmdEnableDcConverter = 0x02, cmdRxDisable = 0x03,
  cmdRxEnable = 0x04, cmdRxReset = 0x05, cmdStallCtl = 0x06, cmdTxEnable = 0x09,
  cmdTxDisable = 0x0A, cmdTxReset = 0x0B, cmdRequestInterrupt = 0x0C, cmdAcknowledgeInterrupt = 0x0D,
  cmdSetInterruptEnable = 0x0E, cmdSetIndicationEnable = 0x0F, cmdSetRxFilter = 0x10, cmdSetRxEarlyThresh = 0x11,
  cmdSetTxStartThresh = 0x13, cmdStatisticsEnable = 0x15, cmdStatisticsDisable = 0x16, cmdDisableDcConverter = 0x17,
  cmdSetTxReclaimThresh = 0x18, cmdSetHashFilterBit = 0x19, cmdGlobalReset = 0x00, cmdSelectRegisterWindow = 0x01,
  cmdEnableDcConverter = 0x02, cmdRxDisable = 0x03, cmdRxEnable = 0x04, cmdRxReset = 0x05,
  cmdStallCtl = 0x06, cmdTxEnable = 0x09, cmdTxDisable = 0x0A, cmdTxReset = 0x0B,
  cmdRequestInterrupt = 0x0C, cmdAcknowledgeInterrupt = 0x0D, cmdSetInterruptEnable = 0x0E, cmdSetIndicationEnable = 0x0F,
  cmdSetRxFilter = 0x10, cmdSetRxEarlyThresh = 0x11, cmdSetTxStartThresh = 0x13, cmdStatisticsEnable = 0x15,
  cmdStatisticsDisable = 0x16, cmdDisableDcConverter = 0x17, cmdSetTxReclaimThresh = 0x18, cmdSetHashFilterBit = 0x19
}

Funkcje

void Arch::x86::RTC::tdelay (uint32 ticks)
uint16 htons (uint16 hostshort)
uint16 ntohs (uint16 netshort)
uint32 virt_to_bus (void *ptr)
void e3c556_transmit (uint8 *d, unsigned int t, unsigned int s, uint8 *p)
 exported function that transmits a packet.
int e3c556_poll (uint8 *packet, uint32 *packetlen)
 should be:exported routine that waits for a certain length of time for a packet actually only used by irq
int e3c556_irq (struct Arch::x86::Interr::except2_t *code)
void e3c556_mac (uint8 d[6])
int e3c556_probe (uint8 bus_no, uint8 dev_no, struct Net::netif *nif)

Zmienne

struct INF_3C556_Type INF_3C556
struct Net::netife3c556_nif


Opis szczegółowy

3c556 ethernet driver port from lightsys, etherboot

Definicja w pliku 3c556.cpp.


Dokumentacja definicji

#define ETH_ALEN   6

Definicja w linii 290 pliku 3c556.cpp.

Odwołania w a3c90x_probe(), e3c556_mac() i e3c556_transmit().

#define INT_CMDINPROGRESS   (1<<12)

Definicja w linii 62 pliku 3c556.cpp.

#define INT_DNCOMPLETE   (1<<9)

Definicja w linii 60 pliku 3c556.cpp.

#define INT_HOSTERROR   (1<<1)

Definicja w linii 53 pliku 3c556.cpp.

#define INT_INTERRUPTLATCH   (1<<0)

Values for int status register bitmask

Definicja w linii 52 pliku 3c556.cpp.

#define INT_INTREQUESTED   (1<<6)

Definicja w linii 57 pliku 3c556.cpp.

#define INT_LINKEVENT   (1<<8)

Definicja w linii 59 pliku 3c556.cpp.

#define INT_RXCOMPLETE   (1<<4)

Definicja w linii 55 pliku 3c556.cpp.

#define INT_RXEARLY   (1<<5)

Definicja w linii 56 pliku 3c556.cpp.

#define INT_TXCOMPLETE   (1<<2)

Definicja w linii 54 pliku 3c556.cpp.

#define INT_UPCOMPLETE   (1<<10)

Definicja w linii 61 pliku 3c556.cpp.

#define INT_UPDATESTATS   (1<<7)

Definicja w linii 58 pliku 3c556.cpp.

#define INT_WINDOWNUMBER   (7<<13)

Definicja w linii 63 pliku 3c556.cpp.

#define XMIT_RETRIES   250

any single transmission fails after 16 collisions or other errors this is the number of times to retry the transmission -- this should be plenty

Definicja w linii 296 pliku 3c556.cpp.


Dokumentacja typów wyliczanych

enum Commands

Wartości wyliczeń:
cmdGlobalReset 
cmdSelectRegisterWindow  Universal with Exceptions, pg 151
cmdEnableDcConverter  Universal
cmdRxDisable 
cmdRxEnable 
cmdRxReset  Universal
cmdStallCtl  Universal
cmdTxEnable  Universal
cmdTxDisable  Universal
cmdTxReset 
cmdRequestInterrupt  Universal
cmdAcknowledgeInterrupt 
cmdSetInterruptEnable  Universal
cmdSetIndicationEnable  Universal
cmdSetRxFilter  Universal
cmdSetRxEarlyThresh  Universal
cmdSetTxStartThresh 
cmdStatisticsEnable 
cmdStatisticsDisable 
cmdDisableDcConverter 
cmdSetTxReclaimThresh 
cmdSetHashFilterBit 
cmdGlobalReset 
cmdSelectRegisterWindow  Universal with Exceptions, pg 151
cmdEnableDcConverter  Universal
cmdRxDisable 
cmdRxEnable 
cmdRxReset  Universal
cmdStallCtl  Universal
cmdTxEnable  Universal
cmdTxDisable  Universal
cmdTxReset 
cmdRequestInterrupt  Universal
cmdAcknowledgeInterrupt 
cmdSetInterruptEnable  Universal
cmdSetIndicationEnable  Universal
cmdSetRxFilter  Universal
cmdSetRxEarlyThresh  Universal
cmdSetTxStartThresh 
cmdStatisticsEnable 
cmdStatisticsDisable 
cmdDisableDcConverter 
cmdSetTxReclaimThresh 
cmdSetHashFilterBit 

Definicja w linii 150 pliku 3c556.cpp.

enum Registers

Wartości wyliczeń:
regCommandIntStatus_w 
regUpListPtr_l 
regDnListPtr_l  Universal
regTxStatus_b  Universal with Exception, pg 107
regPowerMgmtCtrl_w 
regUpMaxBurst_w  905B Revision Only
regDnMaxBurst_w  905B Revision Only
regDebugControl_w  905B Revision Only
regDebugData_l  905B Revision Only
regRealTimeCnt_l  905B Revision Only
regUpBurstThresh_b  Universal
regUpPoll_b  905B Revision Only
regUpPriorityThresh_b  905B Revision Only
regUpListPtr_l  905B Revision Only
regCountdown_w  Universal
regFreeTimer_w  Universal
regUpPktStatus_l  Universal
regTxFreeThresh_b  Universal with Exception, pg 130
regDnPoll_b  90X Revision Only
regDnPriorityThresh_b  905B Revision Only
regDnBurstThresh_b  905B Revision Only
regDnListPtr_l  905B Revision Only
regDmaCtrl_l  Universal with Exception, pg 107
regIntStatusAuto_w  Universal with Exception, pg 106
regTxStatus_b  905B Revision Only
regTimer_b  Universal with Exception, pg 113
regTxPktId_b  Universal
regCommandIntStatus_w  905B Revision Only

Definicja w linii 100 pliku 3c556.cpp.

enum Registers0

following are windowed registers

Wartości wyliczeń:
regEepromData_0_w 
regEepromCommand_0_w  Universal
regBiosRomData_0_b  Universal
regBiosRomAddr_0_l  905B Revision Only
regEepromData_0_w 
regEepromCommand_0_w  Universal
regBiosRomData_0_b  Universal
regBiosRomAddr_0_l  905B Revision Only

Definicja w linii 109 pliku 3c556.cpp.

enum Registers2

Wartości wyliczeń:
regResetOptions_2_w 
regStationMask_2_3w  905B Revision Only
regStationAddress_2_3w  Universal with Exceptions, pg 127
regResetOptions_2_w 
regStationMask_2_3w  905B Revision Only
regStationAddress_2_3w  Universal with Exceptions, pg 127

Definicja w linii 117 pliku 3c556.cpp.

enum Registers3

Wartości wyliczeń:
regTxFree_3_w 
regRxFree_3_w  Universal
regResetMediaOptions_3_w  Universal with Exceptions, pg 125
regMacControl_3_w  Media Options on B Revision, Reset Options on Non-B Revision
regMaxPktSize_3_w  Universal with Exceptions, pg 199
regInternalConfig_3_l  905B Revision Only
regTxFree_3_w 
regRxFree_3_w  Universal
regResetMediaOptions_3_w  Universal with Exceptions, pg 125
regMacControl_3_w  Media Options on B Revision, Reset Options on Non-B Revision
regMaxPktSize_3_w  Universal with Exceptions, pg 199
regInternalConfig_3_l  905B Revision Only

Definicja w linii 124 pliku 3c556.cpp.

enum Windows

Wartości wyliczeń:
winPowerVlan7 
winStatistics6 
winTxRxControl5 
winDiagnostics4 
winTxRxOptions3 
winAddressing2 
winUnused1 
winEepromBios0 
winPowerVlan7 
winStatistics6 
winTxRxControl5 
winDiagnostics4 
winTxRxOptions3 
winAddressing2 
winUnused1 
winEepromBios0 

Definicja w linii 137 pliku 3c556.cpp.


Dokumentacja funkcji

int e3c556_irq ( struct Arch::x86::Interr::except2_t code  ) 

void e3c556_mac ( uint8  d[6]  ) 

Side Effects:
wypelnia d adresem MAC

Definicja w linii 607 pliku 3c556.cpp.

Odwołuje się do ETH_ALEN, INF_3C556_Type::HWAddr, INF_3C556 i memmove().

Odwołania w e3c556_probe().

int e3c556_poll ( uint8 packet,
uint32 packetlen 
)

should be:exported routine that waits for a certain length of time for a packet actually only used by irq

Zwraca:
should be:if it sees none, returns 0. This routine should copy the packet to nic->packet if it gets a packet and set the size in nic->packetlen. Return 1 if a packet was found. chyba jest wywolywane przez irq handler i nie powinno byc wywolywane dodatkowo

we don't need to acknowledge rxComplete -- the upload engine does it for us.

Build the up-load descriptor

Submit the upload descriptor to the NIC

Wait for upload completion (upComplete(15) or upError (14))

Check for Error (else we have good packet)

Ok, got packet. Set length in nic->packetlen.

Definicja w linii 392 pliku 3c556.cpp.

Odwołuje się do RXD::DataAddr, RXD::DataLength, Thread::i, INF_3C556, IOPorts::inw(), INF_3C556_Type::IOAddr, kprintf(), IOPorts::outl(), INF_3C556_Type::ReceiveDPD, regCommandIntStatus_w, regUpListPtr_l, RXD::UpNextPtr, RXD::UpPktStatus i virt_to_bus.

Odwołania w Net::EthernetFrameReceptionThread() i Net::init_3c556().

int e3c556_probe ( uint8  bus_no,
uint8  dev_no,
struct Net::netif nif 
)

void e3c556_transmit ( uint8 d,
unsigned int  t,
unsigned int  s,
uint8 p 
)

exported function that transmits a packet.

Zwraca:
Does not return any particular status.
Parametry:
d[6] destination address, ethernet;
t protocol type (ARP, IP, etc);
s size of the non-header part of the packet that needs to be transmitted;
p the pointer to the packet data itself.

Do zrobienia:
memmove(&a, &b, 5) przy char *a, *b nie kopiuje wcale dobrze a taki kod moze sie w kodzie pojawiac !

Definicja w linii 310 pliku 3c556.cpp.

Odwołuje się do cmdStallCtl, TXD::DataAddr, TXD::DataLength, TXD::DnNextPtr, ETH_ALEN, TXD::FrameStartHeader, TXD::HdrAddr, TXD::HdrLength, htons, INF_3C556_Type::HWAddr, INF_3C556, IOPorts::inl(), IOPorts::inw(), INF_3C556_Type::IOAddr, memmove(), IOPorts::outl(), regCommandIntStatus_w, regDnListPtr_l, INF_3C556_Type::TransmitDPD i virt_to_bus.

Odwołania w Net::init_3c556().

uint16 htons ( uint16  hostshort  )  [inline]

uint16 ntohs ( uint16  netshort  )  [inline]

Definicja w linii 186 pliku 3c556.cpp.

Odwołania w Net::IP::onIpReception(), print() i Net::ICMP::processDatagram().

uint32 virt_to_bus ( void *  ptr  )  [inline]

Definicja w linii 297 pliku 3c556.cpp.

Odwołuje się do Memory::Pager::kmem.


Dokumentacja zmiennych


Wygenerowano Sat Jul 19 02:21:25 2008 dla panaLiX programem  doxygen 1.5.6