From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mx.groups.io with SMTP id smtpd.web08.15286.1609775179752206971 for ; Mon, 04 Jan 2021 07:46:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DqOZGbyl; spf=pass (domain: gmail.com, ip: 209.85.128.45, mailfrom: aj.shirvani@gmail.com) Received: by mail-wm1-f45.google.com with SMTP id c133so18864562wme.4 for ; Mon, 04 Jan 2021 07:46:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=uifSzarZaAs9gkfHj/t7SNoOLCTpmQfr0Sv2Ez3uvQw=; b=DqOZGbylrzqhmjQYaX2DCOY0r3ZZJS+XRhVk6lD9TRUrBLRfNI+uvHstcUjUV/uKjh MLHHdaVXj5Rggyg7Kmq/9hu7/JVQ9JzYZu6r5HOwMJQMbcyQPbkKg48g3lA4Q4GWp/5m r/Lm+4nZi19ooxdicIlAe3fcWLsgj+wKhhHRFl3cPyZpNagn9VViYRZfjMuO3xvAvUiU s9AVf+2rdDHFmEKT2+nhHDtLmnHrIBxEI2UC+B078V0O6VxZeQrk1bFaZYz4Faut5pWf 1iDbktrIpkj8UDx+98wjIpEW+xB/KtvWlbgyQwJNZ2WRTrZYP0r55cRSxcJmliDSMxVP ToVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=uifSzarZaAs9gkfHj/t7SNoOLCTpmQfr0Sv2Ez3uvQw=; b=JIg0VP8k4bjibAjpWos8veB0ElNSslnJ+pDUs5rFqAoGNMq30YutFeGZxkILqFjxqW ww68K2n0Rq72WyZ70LE6V/c9OQwHtOX1aDtJZOde8Z1vdMVLxUd3goX3ImqiPCq+v2H7 ECBUuzlxoShDTFgS1RnwBi0jRiaEssDnk/VyVUKzEvvP5KHLUaLDR5I1vj2Gbj8AJSzi AYwlzLU+HhmZnV04YA0lGDUbmRJs7QgQ2yImw6qVG16cdOT3zqJIHUlY6Eh2CkTAc4R6 uoAj85Y5JNzzUGgBIilc7Kv4NmkFKZBGR64aGezjb1wO5P/raADA9K1K4gg/bGIbKiry oGyw== X-Gm-Message-State: AOAM530TiUvXhgO0DGg2P/WA7exIGkKaVsX2o4mTgFIExj1rEecMr42I V7qFroz5LXWuwiMbph5mbMff4HtHngiexZjV5n9BXYmRjWpSpZtw X-Google-Smtp-Source: ABdhPJzAOPRTsxgwnRXW4HS5DD7L3fdfv8ENp+5nkJxxPaUqRTiQxH5N7OQ2or+5S8KvR0zmXTfZAYJ2mzWg3R1S4i8= X-Received: by 2002:a1c:6a0e:: with SMTP id f14mr26771167wmc.102.1609775178022; Mon, 04 Jan 2021 07:46:18 -0800 (PST) MIME-Version: 1.0 From: "Ali Shirvani" Date: Mon, 4 Jan 2021 19:16:07 +0330 Message-ID: Subject: Correct method to send data to the USB device To: devel@edk2.groups.io Content-Type: multipart/alternative; boundary="000000000000a783a905b814fded" --000000000000a783a905b814fded Content-Type: text/plain; charset="UTF-8" Hi all, I want to send data to an USB device, I tried the following method, but I always got the TIME_OUT error message. Status = UsbIo->UsbSyncInterruptTransfer (UsbIo, 0x01, (VOID *)DataBuffer, &DataLength, 100, &TransferStatus); I've read the source code for mouse and keyboard drivers, but both of them receive data from the device and I want to send data to the device. Would you please guide me how I can send/ data from a USB device? Following is the output of `lsusb` related to the qemu virtual U2F device that I want to communicate with. Bus 002 Device 002: ID 46f4:0005 Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x46f4 idProduct 0x0005 bcdDevice 0.00 iManufacturer 1 QEMU iProduct 2 U2F USB key iSerial 3 0-0000:00:1d.7-1 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 41 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 4 U2F key config bmAttributes 0x80 (Bus Powered) MaxPower 30mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 No Subclass bInterfaceProtocol 0 None iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.10 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 34 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 5 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 5 Device Status: 0x0000 (Bus Powered) Regards, Ali --000000000000a783a905b814fded Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: base64 PGRpdiBkaXI9Imx0ciI+SGkgYWxsLDxicj48YnI+SSB3YW50IHRvIHNlbmQgZGF0YSB0byBhbiBV U0IgZGV2aWNlLCBJIHRyaWVkIHRoZSBmb2xsb3dpbmcgbWV0aG9kLCBidXQgSSBhbHdheXMgZ290 IHRoZSBUSU1FX09VVCBlcnJvciBtZXNzYWdlLjxicj48YnI+U3RhdHVzID0gVXNiSW8tJmd0O1Vz YlN5bmNJbnRlcnJ1cHRUcmFuc2ZlciAoVXNiSW8sIDB4MDEsIChWT0lEICopRGF0YUJ1ZmZlciw8 YnI+PGRpdj7CoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC oCDCoCDCoCDCoCDCoCZhbXA7RGF0YUxlbmd0aCwgMT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