Dokumentacja pliku src/sbox.cpp

#include "etherboot.h"
#include "pci.h"

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

Komponenty

struct  TXD
struct  RXD

Definicje

#define XCVR_MAGIC   (0x5A00)
#define XMIT_RETRIES   250
#define virt_to_bus(x)   ((unsigned long)x)
#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 DEBUG   0

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  Registers7 { regPowerMgmtEvent_7_w = 0x0c, regVlanEtherType_7_w = 0x04, regVlanMask_7_w = 0x00 }
enum  Registers6 {
  regBytesXmittedOk_6_w = 0x0c, regBytesRcvdOk_6_w = 0x0a, regUpperFramesOk_6_b = 0x09, regFramesDeferred_6_b = 0x08,
  regFramesRecdOk_6_b = 0x07, regFramesXmittedOk_6_b = 0x06, regRxOverruns_6_b = 0x05, regLateCollisions_6_b = 0x04,
  regSingleCollisions_6_b = 0x03, regMultipleCollisions_6_b = 0x02, regSqeErrors_6_b = 0x01, regCarrierLost_6_b = 0x00
}
enum  Registers5 {
  regIndicationEnable_5_w = 0x0c, regInterruptEnable_5_w = 0x0a, regTxReclaimThresh_5_b = 0x09, regRxFilter_5_b = 0x08,
  regRxEarlyThresh_5_w = 0x06, regTxStartThresh_5_w = 0x00
}
enum  Registers4 {
  regUpperBytesOk_4_b = 0x0d, regBadSSD_4_b = 0x0c, regMediaStatus_4_w = 0x0a, regPhysicalMgmt_4_w = 0x08,
  regNetworkDiagnostic_4_w = 0x06, regFifoDiagnostic_4_w = 0x04, regVcoDiagnostic_4_w = 0x02
}
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  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  Registers1 { regRxStatus_1_w = 0x0a }
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  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

struct nica3c90x_probe (struct nic *nic, unsigned short *probeaddrs, struct pci_device *pci)
int pcibios_read_config_byte (unsigned int bus, unsigned int device_fn, unsigned int where, unsigned char *value)
int pcibios_read_config_word (unsigned int bus, unsigned int device_fn, unsigned int where, unsigned short *value)
int pcibios_read_config_dword (unsigned int bus, unsigned int device_fn, unsigned int where, unsigned int *value)
int pcibios_write_config_byte (unsigned int bus, unsigned int device_fn, unsigned int where, unsigned char value)
int pcibios_write_config_word (unsigned int bus, unsigned int device_fn, unsigned int where, unsigned short value)
int pcibios_write_config_dword (unsigned int bus, unsigned int device_fn, unsigned int where, unsigned int value)
void eth_pci_init (struct pci_device *pcidev)
void adjust_pci_device (struct pci_device *p)


Dokumentacja definicji

#define DEBUG   0

Definicja w linii 954 pliku sbox.cpp.

#define INT_CMDINPROGRESS   (1<<12)

Definicja w linii 214 pliku sbox.cpp.

#define INT_DNCOMPLETE   (1<<9)

Definicja w linii 212 pliku sbox.cpp.

#define INT_HOSTERROR   (1<<1)

Definicja w linii 205 pliku sbox.cpp.

#define INT_INTERRUPTLATCH   (1<<0)

Definicja w linii 204 pliku sbox.cpp.

#define INT_INTREQUESTED   (1<<6)

Definicja w linii 209 pliku sbox.cpp.

#define INT_LINKEVENT   (1<<8)

Definicja w linii 211 pliku sbox.cpp.

#define INT_RXCOMPLETE   (1<<4)

Definicja w linii 207 pliku sbox.cpp.

#define INT_RXEARLY   (1<<5)

Definicja w linii 208 pliku sbox.cpp.

#define INT_TXCOMPLETE   (1<<2)

Definicja w linii 206 pliku sbox.cpp.

#define INT_UPCOMPLETE   (1<<10)

Definicja w linii 213 pliku sbox.cpp.

#define INT_UPDATESTATS   (1<<7)

Definicja w linii 210 pliku sbox.cpp.

#define INT_WINDOWNUMBER   (7<<13)

Definicja w linii 215 pliku sbox.cpp.

#define virt_to_bus (  )     ((unsigned long)x)

Definicja w linii 51 pliku sbox.cpp.

Odwołania w e3c556_poll() i e3c556_transmit().

#define XCVR_MAGIC   (0x5A00)

Definicja w linii 43 pliku sbox.cpp.

Odwołania w a3c90x_probe().

#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 48 pliku sbox.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 176 pliku sbox.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 54 pliku sbox.cpp.

enum Registers0

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 152 pliku sbox.cpp.

enum Registers1

Wartości wyliczeń:
regRxStatus_1_w 

Definicja w linii 147 pliku sbox.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 140 pliku sbox.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 128 pliku sbox.cpp.

enum Registers4

Wartości wyliczeń:
regUpperBytesOk_4_b 
regBadSSD_4_b  Universal
regMediaStatus_4_w  Universal
regPhysicalMgmt_4_w  Universal with Exceptions, pg 201
regNetworkDiagnostic_4_w  Universal
regFifoDiagnostic_4_w  Universal with Exceptions, pg 203
regVcoDiagnostic_4_w  Universal with Exceptions, pg 196

Definicja w linii 117 pliku sbox.cpp.

enum Registers5

Wartości wyliczeń:
regIndicationEnable_5_w 
regInterruptEnable_5_w  Universal
regTxReclaimThresh_5_b  Universal
regRxFilter_5_b  905B Revision Only
regRxEarlyThresh_5_w  Universal
regTxStartThresh_5_w  Universal

Definicja w linii 107 pliku sbox.cpp.

enum Registers6

Wartości wyliczeń:
regBytesXmittedOk_6_w 
regBytesRcvdOk_6_w  Universal
regUpperFramesOk_6_b  Universal
regFramesDeferred_6_b  Universal
regFramesRecdOk_6_b  Universal
regFramesXmittedOk_6_b  Universal with Exceptions, pg 142
regRxOverruns_6_b  Universal
regLateCollisions_6_b  Universal
regSingleCollisions_6_b  Universal
regMultipleCollisions_6_b  Universal
regSqeErrors_6_b  Universal
regCarrierLost_6_b  Universal

Definicja w linii 91 pliku sbox.cpp.

enum Registers7

following are windowed registers

Wartości wyliczeń:
regPowerMgmtEvent_7_w 
regVlanEtherType_7_w  905B Revision Only
regVlanMask_7_w  905B Revision Only

Definicja w linii 84 pliku sbox.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 162 pliku sbox.cpp.


Dokumentacja funkcji

struct nic* a3c90x_probe ( struct nic nic,
unsigned short *  probeaddrs,
struct pci_device pci 
) [read]

10 Base TPO

10/100 T4

10/100 TPO

10 Base Combo

10 Base TPO

10 Base Combo

10 Base TPO and Base2

10 Base FL

10/100 TPO

10/100 T4

10 Base FX

Load the EEPROM contents

Print identification message

Retrieve the Hardware address and print it on the screen.

Program the MAC address into the station address registers

Fill in our entry in the etherboot arp table

Read the media options register, print a message and set default xcvr.

Uses Media Option command on B revision, Reset Option on non-B revision cards -- same register address

mask out VCO bit that is defined as 10baseFL bit on B-rev cards

Determine transceiver type to use, depending on value stored in eeprom 0x16

User-defined

I don't know what MII MAC only mode is!!!

enable DC converter for 10-Base-T

Set the link to the type we just determined.

Now that we set the xcvr type, reset the Tx and Rx, re-enable.

reset of the receiver on B-revision cards re-negotiates the link takes several seconds (a computer eternity)

Set the RX filter = receive only individual pkts & bcast.

set Indication and Interrupt flags , acknowledge any IRQ's

Set our exported functions

Definicja w linii 680 pliku sbox.cpp.

Odwołuje się do adjust_pci_device(), cmdAcknowledgeInterrupt, cmdEnableDcConverter, cmdRxEnable, cmdRxReset, cmdSetIndicationEnable, cmdSetInterruptEnable, cmdSetRxFilter, cmdTxEnable, cmdTxReset, ETH_ALEN, htons, IOPorts::inl(), IOPorts::inw(), nic::node_addr, IOPorts::outb(), IOPorts::outl(), IOPorts::outw(), printf, regCommandIntStatus_w, regInternalConfig_3_l, regResetMediaOptions_3_w, regStationAddress_2_3w, regStationMask_2_3w, regTxFreeThresh_b, nic::reset, winAddressing2, winTxRxOptions3 i XCVR_MAGIC.

void adjust_pci_device ( struct pci_device p  ) 

void eth_pci_init ( struct pci_device pcidev  ) 

Definicja w linii 1396 pliku sbox.cpp.

Odwołuje się do printf.

int pcibios_read_config_byte ( unsigned int  bus,
unsigned int  device_fn,
unsigned int  where,
unsigned char *  value 
)

Definicja w linii 1064 pliku sbox.cpp.

Odwołuje się do PCIBIOS_READ_CONFIG_BYTE, restore_flags i save_flags.

Odwołania w adjust_pci_device().

int pcibios_read_config_dword ( unsigned int  bus,
unsigned int  device_fn,
unsigned int  where,
unsigned int *  value 
)

Definicja w linii 1118 pliku sbox.cpp.

Odwołuje się do PCIBIOS_READ_CONFIG_DWORD, restore_flags i save_flags.

int pcibios_read_config_word ( unsigned int  bus,
unsigned int  device_fn,
unsigned int  where,
unsigned short *  value 
)

Definicja w linii 1091 pliku sbox.cpp.

Odwołuje się do PCIBIOS_READ_CONFIG_WORD, restore_flags i save_flags.

Odwołania w adjust_pci_device().

int pcibios_write_config_byte ( unsigned int  bus,
unsigned int  device_fn,
unsigned int  where,
unsigned char  value 
)

Definicja w linii 1145 pliku sbox.cpp.

Odwołuje się do cli, PCIBIOS_WRITE_CONFIG_BYTE, restore_flags i save_flags.

Odwołania w adjust_pci_device().

int pcibios_write_config_dword ( unsigned int  bus,
unsigned int  device_fn,
unsigned int  where,
unsigned int  value 
)

Definicja w linii 1199 pliku sbox.cpp.

Odwołuje się do cli, PCIBIOS_WRITE_CONFIG_DWORD, restore_flags i save_flags.

int pcibios_write_config_word ( unsigned int  bus,
unsigned int  device_fn,
unsigned int  where,
unsigned short  value 
)

Definicja w linii 1172 pliku sbox.cpp.

Odwołuje się do cli, PCIBIOS_WRITE_CONFIG_WORD, restore_flags i save_flags.

Odwołania w adjust_pci_device().


Dokumentacja zmiennych

unsigned long address

Definicja w linii 1017 pliku sbox.cpp.

unsigned char CurrentWindow

Definicja w linii 244 pliku sbox.cpp.

unsigned char HWAddr[ETH_ALEN]

Definicja w linii 246 pliku sbox.cpp.

unsigned int IOAddr

Definicja w linii 245 pliku sbox.cpp.

unsigned char isBrev

Definicja w linii 243 pliku sbox.cpp.

Definicja w linii 248 pliku sbox.cpp.

unsigned short segment

Definicja w linii 1018 pliku sbox.cpp.

Definicja w linii 247 pliku sbox.cpp.


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