Tick dma_read_factor, Tick dma_write_factor, PciConfigAll *cf,
PciConfigData *cd, Tsunami *t, uint32_t bus, uint32_t dev,
uint32_t func, bool rx_filter, const int eaddr[6])
- : PciDev(name, mmu, cf, cd, bus, dev, func), tsunami(t),
+ : PciDev(name, mmu, cf, cd, bus, dev, func), tsunami(t), io_enable(false),
txPacket(0), rxPacket(0), txPacketBufPtr(NULL), rxPacketBufPtr(NULL),
txXferLen(0), rxXferLen(0), txPktXmitted(0), txState(txIdle), CTDD(false),
txFifoCnt(0), txFifoAvail(MAX_TX_FIFO_SIZE), txHalt(false),
// Need to catch writes to BARs to update the PIO interface
switch (offset) {
+ //seems to work fine without all these, but i ut in the IO to
+ //double check, an assertion will fail if we need to properly
+ // imlpement it
+ case PCI_COMMAND:
+ if (config.data[offset] & PCI_CMD_IOSE)
+ io_enable = true;
+ else
+ io_enable = false;
+#if 0
+ if (config.data[offset] & PCI_CMD_BME)
+ bm_enabled = true;
+ else
+ bm_enabled = false;
+ break;
+
+ if (config.data[offset] & PCI_CMD_MSE)
+ mem_enable = true;
+ else
+ mem_enable = false;
+ break;
+#endif
+
case PCI0_BASE_ADDR0:
if (BARAddrs[0] != 0) {
Fault
NSGigE::read(MemReqPtr &req, uint8_t *data)
{
+ assert(io_enable);
+
//The mask is to give you only the offset into the device register file
Addr daddr = req->paddr & 0xfff;
DPRINTF(EthernetPIO, "read da=%#x pa=%#x va=%#x size=%d\n",
Fault
NSGigE::write(MemReqPtr &req, const uint8_t *data)
{
+ assert(io_enable);
+
Addr daddr = req->paddr & 0xfff;
DPRINTF(EthernetPIO, "write da=%#x pa=%#x va=%#x size=%d\n",
daddr, req->paddr, req->vaddr, req->size);
SERIALIZE_ARRAY(rom.perfectMatch, EADDR_LEN);
+ SERIALIZE_SCALAR(io_enable);
+
/*
* Serialize the data Fifos
*/
UNSERIALIZE_ARRAY(rom.perfectMatch, EADDR_LEN);
+ UNSERIALIZE_SCALAR(io_enable);
+
/*
* unserialize the data fifos
*/