/// <summary> /// Probes for this device. /// </summary> /// <returns></returns> public override void Probe() { configAddress.Write32(BaseValue); var found = configAddress.Read32() == BaseValue; Device.Status = (found) ? DeviceStatus.Available : DeviceStatus.NotFound; }
/// <summary> /// Probes for this device. /// </summary> /// <returns></returns> public override void Probe() { configAddress.Write32(BaseValue); var found = configAddress.Read32() == BaseValue; if (!found) { Device.Status = DeviceStatus.NotFound; } }
public override void Start() { if (Device.Status != DeviceStatus.Available) { return; } // Enable the card //HardwareResources.DeviceResource.EnableDevice(); // TODO // Do a 32-bit write to set 32-bit mode rdp.Write32(0); // Get the EEPROM MAC Address var eepromMac = new byte[6]; var data = ioProm1.Read32(); eepromMac[0] = (byte)(data & 0xFF); eepromMac[1] = (byte)((data >> 8) & 0xFF); eepromMac[2] = (byte)((data >> 16) & 0xFF); eepromMac[3] = (byte)((data >> 24) & 0xFF); data = ioProm4.Read32(); eepromMac[4] = (byte)(data & 0xFF); eepromMac[5] = (byte)((data >> 8) & 0xFF); macAddress = new MACAddress(eepromMac); // Fill in the initialization block initBlock.Write32(0, (0x4 << 28) | (0x4 << 30)); initBlock.Write32(4, (uint)(eepromMac[0] | (eepromMac[1] << 8) | (eepromMac[2] << 16) | (eepromMac[3] << 24))); initBlock.Write32(8, (uint)(eepromMac[4] | (eepromMac[5] << 8))); // Fill in the hardware MAC address initBlock.Write32(16, 0x0); initBlock.Write32(24, 0x0); initBlock.Write32(28, rxDescriptor.Address); initBlock.Write32(32, txDescriptor.Address); // Write the initialization blocks address to the registers on the card InitializationBlockAddress = HAL.GetPhysicalAddress(initBlock); // Set the device to PCNet-PCI II Controller mode (full 32-bit mode) SoftwareStyleRegister = 0x03; nextTXDesc = 0; Device.Status = DeviceStatus.Online; }
/// <summary> /// Gets the value. /// </summary> /// <param name="command">The command.</param> /// <returns></returns> protected uint ReadRegister(uint command) { indexPort.Write32(command); return(valuePort.Read32()); }
/// <summary> /// Probes for this device. /// </summary> /// <returns></returns> public override bool Probe() { configAddress.Write32(BaseValue); return(configAddress.Read32() == BaseValue); }
/// <summary> /// Reads from configuration space /// </summary> /// <param name="bus">The bus.</param> /// <param name="slot">The slot.</param> /// <param name="function">The function.</param> /// <param name="register">The register.</param> /// <returns></returns> public uint ReadConfig32(byte bus, byte slot, byte function, byte register) { configAddress.Write32(GetIndex(bus, slot, function, register)); return(configData.Read32()); }