public void SetDescriptor(USBPacket packet, USBSetupPacket setupPacket)
 {
     throw new System.NotImplementedException();
 }
 public void SetFeature(USBPacket packet, USBSetupPacket setupPacket)
 {
 }
 public byte[] GetInterface(USBPacket packet, USBSetupPacket setupPacket)
 {
     throw new System.NotImplementedException();
 }
 public void SetConfiguration(USBPacket packet, USBSetupPacket setupPacket)
 {
 }
 public void ProcessClassSet(USBPacket packet, USBSetupPacket setupPacket)
 {
     throw new System.NotImplementedException();
 }
 public void ClearFeature(USBPacket packet, USBSetupPacket setupPacket)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 7
0
 public void SetInterface(USBPacket packet, USBSetupPacket setupPacket)
 {
     throw new NotImplementedException();
 }
 public void SetConfiguration(USBPacket packet, USBSetupPacket setupPacket)
 {
     // throw new NotImplementedException();
 }
Exemplo n.º 9
0
 public void ClearFeature(USBPacket packet, USBSetupPacket setupPacket)
 {
     throw new USBRequestException();
 }
Exemplo n.º 10
0
        public byte[] GetStatus(USBPacket packet, USBSetupPacket setupPacket)
        {
            var arr = new byte[2];

            return(arr);
        }
Exemplo n.º 11
0
 public void ProcessClassSet(USBPacket packet, USBSetupPacket setupPacket)
 {
 }
Exemplo n.º 12
0
 public byte[] ProcessClassGet(USBPacket packet, USBSetupPacket setupPacket)
 {
     return(controlPacket);
 }
Exemplo n.º 13
0
        public void ProcessVendorSet(USBPacket packet, USBSetupPacket setupPacket)
        {
            ushort index   = setupPacket.index;
            byte   request = setupPacket.request;
            ushort value   = setupPacket.value;

            if (request == (byte)vendorRequest.WriteRegister)
            {
                switch ((SCSR)index)
                {
                case SCSR.HwConfig:
                    if (packet.data != null)
                    {
                        hardwareConfigurationRegister = BitConverter.ToUInt32(packet.data, 0);
                    }
                    break;

                case SCSR.PmControl:
                    if (packet.data != null)
                    {
                        powerMenagementConfigurationRegister = BitConverter.ToUInt32(packet.data, 0);
                    }
                    break;

                case SCSR.MACAddressLo:
                    break;

                case SCSR.MACAddressHi:
                    break;

                case SCSR.MACControl:
                    if (packet.data != null)
                    {
                        macControlRegister = BitConverter.ToUInt32(packet.data, 0);
                    }
                    this.Log(LogLevel.Warning, "macControlRegister=0x{0:X}", macControlRegister);
                    break;

                case SCSR.E2PData:
                    break;

                case SCSR.E2PCommand:
                    if (packet.data != null)
                    {
                        e2pCommand = BitConverter.ToUInt32(packet.data, 0) & (~(0x80000000 | 0x00000400));
                    }
                    break;

                case SCSR.MediaIndependentInterfaceAddress:
                    if (packet.data != null)
                    {
                        miiAddress = BitConverter.ToUInt32(packet.data, 0);
                    }
                    break;

                case SCSR.MediaIndependentInterfaceData:
                    if (packet.data != null)
                    {
                        miiData = BitConverter.ToUInt32(packet.data, 0);
                    }
                    break;

                default:
                    this.Log(LogLevel.Warning, "Unknown register write request  (request=0x{0:X}, value=0x{1:X}, index=0x{2:X})", request, value, index);
                    break;
                }
            }
        }
 public void SetInterface(USBPacket packet, USBSetupPacket setupPacket)
 {
 }
Exemplo n.º 15
0
 public void ProcessVendorSet(USBPacket packet, USBSetupPacket setupPacket)
 {
     throw new NotImplementedException();
 }
        public byte[] ProcessVendorGet(USBPacket packet, USBSetupPacket setupPacket)
        {
            ushort index   = setupPacket.index;
            byte   request = setupPacket.request;
            ushort value   = setupPacket.value;

            if (request == (byte)vendorRequest.ReadRegister)
            {
                switch ((SCSR)index)
                {
                case SCSR.MACAddressLo:

                    break;

                case SCSR.MACAddressHi:

                    break;

                case SCSR.E2PData:
                    if ((e2pCommand & 0x000001FF) >= 0x1 && (e2pCommand & 0x000001FF) <= 0x6)
                    {
                        controlPacket    = new byte[1];
                        controlPacket[0] = MAC.Bytes[(e2pCommand & 0x000001FF) - 1];
                        return(controlPacket);
                    }
                    else
                    {
                        controlPacket = BitConverter.GetBytes((uint)0);
                        return(BitConverter.GetBytes((uint)0));
                    }

                case SCSR.MACControl:
                    controlPacket = BitConverter.GetBytes(macControlRegister);
                    return(BitConverter.GetBytes(macControlRegister));

                case SCSR.E2PCommand:
                    controlPacket = BitConverter.GetBytes(e2pCommand);
                    return(BitConverter.GetBytes(e2pCommand));

                case SCSR.HwConfig:
                    controlPacket = BitConverter.GetBytes(hardwareConfigurationRegister & (~0x00000008));
                    return(BitConverter.GetBytes(hardwareConfigurationRegister & (~0x00000008)));

                case SCSR.PmControl:
                    controlPacket = BitConverter.GetBytes(powerMenagementConfigurationRegister & (~0x00000010));
                    return(BitConverter.GetBytes(powerMenagementConfigurationRegister & (~0x00000010)));

                case SCSR.MediaIndependentInterfaceData:
                    controlPacket = BitConverter.GetBytes(miiData & (~0x8000) | 0x0004 | 0x0100);
                    return(BitConverter.GetBytes(miiData & (~0x8000) | 0x0004 | 0x0100));

                case SCSR.MediaIndependentInterfaceAddress:
                    controlPacket     = BitConverter.GetBytes(miiAddress);
                    controlPacket[0] &= ((byte)(0xFEu));
                    return(controlPacket);

                default:
                    this.Log(LogLevel.Warning, "Unknown register read request (request=0x{0:X}, value=0x{1:X}, index=0x{2:X})", request, value, index);
                    break;
                }
            }
            var arr = new byte[] { 0 };

            controlPacket = arr;
            return(arr);
        }
 public byte[] GetDescriptor(USBPacket packet, USBSetupPacket setupPacket)
 {
     return(null);
 }