Esempio n. 1
0
 public ES1370(PCIDevice device) : base(device)
 {
     isr=(InterruptStatusRegister.Load(getMemReference()));
     sir = (SerialInterfaceRegister.Load(getMemReference()));
     uir = (UARTInterfaceRegister.Load(getMemReference()));
     cr=(ControlRegister.Load(getMemReference()));
     //dacs.Add(new AK(new DACak4531(), cr.DAC1Enabled,(byte)MainRegister.Bit.SerialIntContr,MainRegister.Bit.Dac1FrameAddr, (byte)MainRegister.Bit.Dac1FrameSize));
     //dacs.Add(new DACManager(new DACak4531(), cr.DAC2Enabled, (byte)MainRegister.Bit.SerialIntContr, (byte)MainRegister.Bit.Dac2FrameAddr, (byte)MainRegister.Bit.Dac2FrameSize));
 }
Esempio n. 2
0
 public RTL8139_Old(PCIDevice device)
 {
     if (device == null) {
         throw new ArgumentException("PCI Device is null. Unable to get RTL8139 card");
     }
     pciCard = device;
     mem = device.GetAddressSpace(1) as Kernel.MemoryAddressSpace;
     valueReg = Register.ValueTypeRegisters.Load(mem);
     imr = Register.InterruptMaskRegister.Load(mem);
     isr = Register.InterruptStatusRegister.Load(mem);
 }
Esempio n. 3
0
        public RTL8139(PCIDevice device)
        {
            if (device == null) {
                throw new ArgumentException("PCI Device is null. Unable to get Realtek 8139 card");
            }
            pciCard = device;

            // We are handling this device
            pciCard.Claimed = true;

            // Setup interrupt handling
            //Interrupts.IRQ11 += HandleNetworkInterrupt;
            //Interrupts.AddIRQHandler(device.InterruptLine, HandleNetworkInterrupt);

            // Get IO Address from PCI Bus
            io = pciCard.GetAddressSpace(0);

            // Enable the card
            pciCard.EnableDevice();

            // Turn on the card
            io.Write8(0x52, 0x01);

            //Do a software reset
            SoftwareReset();

            // Get the MAC Address
            byte[] eeprom_mac = new byte[6];
            for (uint b = 0; b < 6; b++)
            {
                eeprom_mac[b] = io.Read8(b);
            }

            this.mac = new MACAddress(eeprom_mac);

            // Get a receive buffer and assign it to the card
            rxBuffer = new ManagedMemorySpace(RxBufferSize + 2048 + 16, 4);

            RBStartRegister = rxBuffer.Offset;

            // Setup receive Configuration
            RecvConfigRegister = 0xF381;
            // Setup Transmit Configuration
            TransmitConfigRegister = 0x3000300;

            // Setup Interrupts
            IntMaskRegister = 0x7F;
            IntStatusRegister = 0xFFFF;

            // Setup our Receive and Transmit Queues
            mRecvBuffer = new Queue<byte[]>();
            mTransmitBuffer = new Queue<byte[]>();
        }