NOVA User-Level Environment  Version testbox/changed-memory-timing-317-g320d8b5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Host82576 Class Reference

This device usually comes as a PCIe card with two functions, each acting as a separate NIC with a few exceptions. More...

Inheritance diagram for Host82576:
PciDriver Base82576 StaticReceiver< Host82576 > Device

Public Member Functions

EthernetAddr ethernet_address ()
bool receive (MessageIrq &irq_msg)
void enable_irqs ()
 Host82576 (HostPci pci, DBus< MessageHostOp > &bus_hostop, Clock *clock, unsigned bdf)
- Public Member Functions inherited from StaticReceiver< Host82576 >
 StaticReceiver ()
- Public Member Functions inherited from Device
void debug_dump ()
 Device (const char *debug_name)

Private Member Functions

const char * debug_getname ()
void log_device_status ()
void handle_vf_reset (unsigned vf_no)
void vf_set_mac (unsigned vf_no, EthernetAddr mac)
void handle_vf_message (unsigned vf_no)
void handle_vf_ack (unsigned vf_no)

Private Attributes

volatile uint32_hwreg
unsigned _hostirq
EthernetAddr _mac

Additional Inherited Members

- Static Public Member Functions inherited from StaticReceiver< Host82576 >
static bool receive_static (Device *o, M &msg)
- Protected Types inherited from PciDriver
enum  MessageLevel {
  INFO = 1<<0, DEBUG = 1<<1, PCI = 1<<2, IRQ = 1<<3,
  RX = 1<<4, TX = 1<<5, VF = 1<<6, WARN = 1<<7,
  ALL = ~0U
}
- Protected Types inherited from Base82576
enum  Spec { RX_QUEUES = 16 }
enum  Register {
  CTRL = 0x0000/4, STATUS = 0x0008/4, CTRL_EXT = 0x0018/4, MDIC = 0x0020/4,
  SERDESCTL = 0x0024/4, FRTIMER = 0x1048/4, ICR = 0x01500/4, ICS = 0x01504/4,
  IMS = 0x01508/4, IMC = 0x0150C/4, IAM = 0x01510/4, GPIE = 0x01514/4,
  EICS = 0x01520/4, EIMS = 0x01524/4, EIMC = 0x01528/4, EIAC = 0x0152C/4,
  EIAM = 0x01530/4, EICR = 0x01580/4, IVAR0 = 0x01700/4, IVAR_MISC = 0x01740/4,
  RCTL = 0x00100/4, TCTL = 0x00400/4, RXPBS = 0x02404/4, DTXCTL = 0x03590/4,
  RAL0 = 0x05400/4, RAH0 = 0x05404/4, VT_CTL = 0x0581C/4, VMOLR0 = 0x05AD0/4,
  MRQC = 0x05818/4, PFMB0 = 0x00C00/4, PFMBMEM = 0x00800/4, MBVFICR = 0x00C80/4,
  MBVFIMR = 0x00C84/4, VFLRE = 0x00C88/4, VFRE = 0x00C8C/4, VFTE = 0x00C90/4,
  QDE = 0x02408/4, DTXSWC = 0x03500/4, WVBR = 0x03554/4, TCPTIMER = 0x0104C/4,
  MPC = 0x04010/4, GPRC = 0x04074/4, GPTC = 0x04080/4, RNBC = 0x040A0/4,
  UTA0 = 0x0A000/4, MTA0 = 0x05200/4
}
enum  TCPTimer { TCPTIMER_KICKSTART = 1U << 8, TCPTIMER_ENABLE = 1U << 9, TCPTIMER_FINISH = 1U << 10, TCPTIMER_LOOP = 1U << 11 }
enum  DTXSWC { DTX_VMDQ_LOOPBACK = 1U << 31 }
enum  DTXCTL { DTX_MDP_EN = 1U << 5, DTX_SPOOF_INT = 1U << 6 }
enum  VT {
  VT_CTL_DIS_DEF_POOL = 1U<<29, VT_CTL_REP_ENABLE = 1U<<30, VMOLR_RPML_MASK = (1U << 14) - 1, VMOLR_LPE = 1U << 16,
  VMOLR_AUPE = 1U << 24, VMOLR_ROMPE = 1U << 25, VMOLR_ROPE = 1U << 26, VMOLR_BAM = 1U << 27,
  VMOLR_MPE = 1U << 28, VMOLR_STRVLAN = 1U << 30, VMOLR_DEFAULT = 1U << 31
}
enum  Ctrl {
  CTRL_GIO_MASTER_DISABLE = 1U<<2, CTRL_SLU = 1U<<6, CTRL_FRCSPD = 1U<<11, CTRL_FRCDPLX = 1U<<12,
  CTRL_RST = 1U<<26, CTRL_VME = 1U<<30
}
enum  CtrlExt { CTRL_EXT_PFRSTD = 0x1U<<14, CTRL_EXT_LINK_MODE = 0x3U<<22 }
enum  Status {
  STATUS_FD = 0x1U, STATUS_LU = 0x2U, STATUS_LAN_ID = 0x3U<<2, STATUS_SPEED = 0x3U<<6,
  STATUS_SPEED_SHIFT = 6U, STATUS_NUMVF = 0xFU<<14, STATUS_NUMVF_SHIFT = 14U, STATUS_IOV = 1<<18U,
  STATUS_GIO_MASTER_ENABLE = 1<<19U
}
enum  StatusSpeed { SPEED_10M = 0x0, SPEED_100M = 0x1, SPEED_1000M = 0x2, SPEED_1000M2 = 0x3 }
enum  Interrupt {
  IRQ_TXDW = 1U<<7, IRQ_LSC = 1U<<2, IRQ_RXO = 1U<<6, IRQ_RXDW = 1U<<7,
  IRQ_VMMB = 1U<<8, IRQ_FER = 1U<<22, IRQ_NFER = 1U<<23, IRQ_SWD = 1U<<26,
  IRQ_TIMER = 1U<<30, IRQ_INTA = 1U<<31, EIRQ_TIMER = 1U<<30, EIRQ_OTHER = 1U<<31,
  GPIE_NSICR = 1U<<0, GPIE_MULTIPLE_MSIX = 1U<<4, GPIE_EIAME = 1U<<30, GPIE_PBA = 1U<<31
}
enum  ReceiveControl {
  RCTL_RXEN = 1<<1, RCTL_SBP = 1<<2, RCTL_UPE = 1<<3, RCTL_MPE = 1<<4,
  RCTL_LPE = 1<<5, RCTL_BAM = 1<<15, RCTL_BSIZE = 3<<16, RAH_AV = 1U<<31,
  RAH_POOLSEL_SHIFT = 18, MRQC_MRQE_011 = 3U, SRRCTL_DESCTYPE_ADV1B = 1U<<25, SRRCTL_DROP_EN = 1U<<31
}
enum  TransmitControl { TCTL_TXEN = 1U<<1, TCTL_PSP = 1U<<3, DTXSWC_LOOP_EN = 1U<<31 }
enum  PacketType {
  TYPE_L2 = 1<<11, TYPE_IPV4 = 1, TYPE_IPV4E = 1<<1, TYPE_IPV6 = 1<<2,
  TYPE_IPV6E = 1<<3, TYPE_TCP = 1<<4, TYPE_UDP = 1<<5
}
enum  PFMBX {
  Sts = 1U << 0, Ack = 1U << 1, VFU = 1U << 2, PFU = 1U << 3,
  RVFU = 1U << 4
}
enum  MBX {
  VF_RESET = 0x0001U, VF_SET_MAC_ADDR = 0x0002U, VF_SET_MULTICAST = 0x0003U, VF_SET_LPE = 0x0005U,
  VF_SET_PROMISC = 0x0006U, VF_SET_PROMISC_MULTICAST = 0x2U << 16, VF_SET_PROMISC_UNICAST = 0x4U << 16, PF_CONTROL_MSG = 0x0100U,
  CMD_ACK = 0x80000000U, CMD_NACK = 0x40000000U, CTS = 0x20000000U
}
- Protected Member Functions inherited from PciDriver
void spin (unsigned micros)
bool wait (volatile uint32 &reg, uint32 mask, uint32 value, unsigned timeout_micros=1000000)
 __attribute__ ((format(printf, 3, 4))) void msg(unsigned level
const char mword addr2phys (void *ptr)
 Translate a virtual to a physical address.
bool assign_pci ()
 PciDriver (const char *name, DBus< MessageHostOp > &bus_hostop, Clock *clock, unsigned msg_level, uint16 bdf)
- Protected Attributes inherited from PciDriver
const char * _name
DBus< MessageHostOp > & _bus_hostop
bool _dmar
Clock_clock
unsigned _msg_level
 Logging.
uint16 _bdf
const char * msg

Detailed Description

This device usually comes as a PCIe card with two functions, each acting as a separate NIC with a few exceptions.

There are several shared resources: EEPROM, PHY(s), Flash. If access to those resources is desired, the hardware-semaphore of the 82576 has to be used. We can blissfully ignore it, because we do not need access to any shared resource.

Constructor & Destructor Documentation

Host82576::Host82576 ( HostPci  pci,
DBus< MessageHostOp > &  bus_hostop,
Clock clock,
unsigned  bdf 
)
inline

Initialization (4.5)

Member Function Documentation

const char* Host82576::debug_getname ( )
inlineprivate
void Host82576::enable_irqs ( )
inline
EthernetAddr Host82576::ethernet_address ( )
inline
void Host82576::handle_vf_ack ( unsigned  vf_no)
inlineprivate
void Host82576::handle_vf_message ( unsigned  vf_no)
inlineprivate
void Host82576::handle_vf_reset ( unsigned  vf_no)
inlineprivate
void Host82576::log_device_status ( )
inlineprivate
bool Host82576::receive ( MessageIrq irq_msg)
inline
void Host82576::vf_set_mac ( unsigned  vf_no,
EthernetAddr  mac 
)
inlineprivate

Member Data Documentation

unsigned Host82576::_hostirq
private
volatile uint32* Host82576::_hwreg
private
EthernetAddr Host82576::_mac
private

The documentation for this class was generated from the following file: