Beispiel #1
0
        public static SupportState GetEhciState()
        {
            var device = new PciDevice(_access, 0, 20, 0);

            Supported.TryGetValue(device.DeviceId, out var ehci);

            var firstEhci = new PciDevice(_access, 0, 29, 0);

            if (firstEhci.DeviceId != ehci.Primary)
            {
                return(SupportState.WarnPrimaryEhciInactive);
            }

            var secondEhci = new PciDevice(_access, 0, 26, 0);

            if (secondEhci.DeviceId != ehci.Secondary)
            {
                return(SupportState.WarnSecondaryEhciInactive);
            }

            return(SupportState.Supported);
        }
Beispiel #2
0
        private bool Check()
        {
            for (byte i = 0; i < 32; i++)
            {
                var device = new PciDevice(this, 0, i, 0);

                var cls = device.Class;
                if (cls != PciClass.BridgeHost && cls != PciClass.DisplayVga)
                {
                    continue;
                }

                var vendor = device.Vendor;

                if (vendor != PciVendor.Intel && vendor != PciVendor.Compaq)
                {
                    continue;
                }

                return(true);
            }

            return(false);
        }
Beispiel #3
0
        public static uint GetRouting()
        {
            var device = new PciDevice(_access, 0, 20, 0);

            return(device.ReadUInt32(0xD0));
        }
Beispiel #4
0
        public static void SwitchTo20()
        {
            var device = new PciDevice(_access, 0, 20, 0);

            device.Write(0xD0, (uint)0);
        }
Beispiel #5
0
        public static void SetRouting(uint value)
        {
            var device = new PciDevice(_access, 0, 20, 0);

            device.Write(0xD0, value);
        }
Beispiel #6
0
        public void Write(PciDevice device, ushort offset, uint value)
        {
            var ptr = PrepareAccess(device, offset);

            DirectIo.Write(value, ptr);
        }
Beispiel #7
0
        public byte ReadByte(PciDevice device, ushort offset)
        {
            var ptr = PrepareAccess(device, offset);

            return(DirectIo.ReadByte(ptr));
        }
Beispiel #8
0
        public ushort ReadUint16(PciDevice device, ushort offset)
        {
            var ptr = PrepareAccess(device, offset);

            return(DirectIo.ReadUInt16(ptr));
        }