У меня есть работающий (на реальном оборудовании) драйвер EHCI и UHCI, а также работающие драйверы для мыши, концентратора и клавиатуры.Сейчас я пишу драйвер MassStorage.В QEMU и BOCHS все работает нормально (вывод отладочной информации BOCHS будет ниже), но на реальном оборудовании мой драйвер вначале дает сбой при «функции полной остановки» на конечных точках.Итак, я пытаюсь «очистить останов» на конечной точке, но мой контроллер устанавливает бит Halt в токене QH.Затем я отправляю CBW с командой «Start Stop Unit», создаю TD для чтения CSW, и устройство еще не завершило запрос (я жду завершения, но он никогда не приходит).
Итак,вывод отладки из BOCHS:
02862800000d[USBMSD] MASS STORAGE RESET:
02863200000d[USBMSD] USB_REQ_CLEAR_FEATURE:
02863600000d[USBMSD] USB_REQ_CLEAR_FEATURE:
02864000000d[USBMSD] MASS STORAGE: GET MAX LUN
02864400000d[USBMSD] packet hexdump (31 bytes)
02864400000d[USBMSD] 55 53 42 43 00 10 00 00 00 00 00 00 00 00 0A 00
02864400000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02864400000d[USBMSD] command on LUN 0
02864400000d[USBMSD] command tag 0x1000 flags 00000000 len 10 data 0
02864400000d[SCSIHD] command: lun=0 tag=0x1000 data=0x00
02864400000d[SCSIHD] Test Unit Ready
02864400000d[SCSIHD] command complete tag=0x1000 status=0 sense=0
02864400000d[USBMSD] command complete 0
02864800000d[USBMSD] command status 0 tag 0x1000, len 13
02864800000d[USBMSD] packet hexdump (13 bytes)
02864800000d[USBMSD] 55 53 42 53 00 10 00 00 00 00 00 00 00
02865200000d[USBMSD] packet hexdump (31 bytes)
02865200000d[USBMSD] 55 53 42 43 00 00 01 00 24 00 00 00 80 00 0A 12
02865200000d[USBMSD] 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00
02865200000d[USBMSD] command on LUN 0
02865200000d[USBMSD] command tag 0x10000 flags 00000080 len 10 data 36
02865200000d[SCSIHD] command: lun=0 tag=0x10000 data=0x12
02865200000d[SCSIHD] inquiry (len 36)
02865200000d[SCSIHD] read buf_len=36
02865600000d[USBMSD] data in 36/36
02865600000d[SCSIHD] read sector_count=0
02865600000d[SCSIHD] command complete tag=0x10000 status=0 sense=0
02865600000d[USBMSD] command complete 0
02865600000d[USBMSD] packet hexdump (36 bytes)
02865600000d[USBMSD] 00 00 03 02 1F 00 00 10 42 4F 43 48 53 20 20 00
02865600000d[USBMSD] 42 4F 43 48 53 20 48 41 52 44 44 49 53 4B 20 00
02865600000d[USBMSD] 31 2E 30 00
02866000000d[USBMSD] command status 0 tag 0x10000, len 13
02866000000d[USBMSD] packet hexdump (13 bytes)
02866000000d[USBMSD] 55 53 42 53 00 00 01 00 00 00 00 00 00
02866400000d[USBMSD] packet hexdump (31 bytes)
02866400000d[USBMSD] 55 53 42 43 00 00 00 00 08 00 00 00 80 00 0A 25
02866400000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02866400000d[USBMSD] command on LUN 0
02866400000d[USBMSD] command tag 0x0 flags 00000080 len 10 data 8
02866400000d[SCSIHD] command: lun=0 tag=0x0 data=0x25
02866400000d[SCSIHD] Read Capacity
02866400000d[SCSIHD] read buf_len=8
02866800000d[USBMSD] data in 8/8
02866800000d[SCSIHD] read sector_count=0
02866800000d[SCSIHD] command complete tag=0x0 status=0 sense=0
02866800000d[USBMSD] command complete 0
02866800000d[USBMSD] packet hexdump (8 bytes)
02866800000d[USBMSD] 00 02 30 03 00 00 02 00
02867200000d[USBMSD] command status 0 tag 0x0, len 13
02867200000d[USBMSD] packet hexdump (13 bytes)
02867200000d[USBMSD] 55 53 42 53 00 00 00 00 00 00 00 00 00
02867600000d[USBMSD] packet hexdump (31 bytes)
02867600000d[USBMSD] 55 53 42 43 10 00 01 00 00 04 00 00 80 00 0A 28
02867600000d[USBMSD] 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00
02867600000d[USBMSD] command on LUN 0
02867600000d[USBMSD] command tag 0x10010 flags 00000080 len 10 data 1024
02867600000d[SCSIHD] command: lun=0 tag=0x10010 data=0x28
02867600000d[SCSIHD] Read (sector 0, count 2)
02867600000d[SCSIHD] read sector_count=2
02868000000d[USBMSD] data in 512/1024
02868000000d[USBMSD] deferring packet 0BA31020
02871199600d[SCSIHD] data ready tag=0x10010 len=1024
02871199600d[USBMSD] packet hexdump (512 bytes)
02871199600d[USBMSD] EB 58 90 4D 53 44 4F 53 35 2E 30 00 02 01 BE 17
02871199600d[USBMSD] 02 00 00 00 00 F8 00 00 3F 00 20 00 01 00 00 00
02871199600d[USBMSD] 04 30 02 00 21 04 00 00 00 00 00 00 02 00 00 00
02871199600d[USBMSD] 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 80 01 29 AA 12 8D C8 4E 4F 20 4E 41 4D 45 20 20
02871199600d[USBMSD] 20 20 46 41 54 33 32 20 20 20 FC B8 00 90 8E C0
02871199600d[USBMSD] 2D 80 00 8E D0 BC 00 08 B9 00 01 BE 00 7C 31 FF
02871199600d[USBMSD] 8E DF F3 A5 06 6A 78 CB 0E 1F 88 16 40 00 80 26
02871199600d[USBMSD] 2F 00 0F 66 8B 36 2C 00 6A 60 07 31 DB E8 50 00
02871199600d[USBMSD] 66 56 9C 6A 60 07 31 FF BE F3 01 A0 0D 00 98 F7
02871199600d[USBMSD] 26 0B 00 C1 E8 05 89 C2 B9 0B 00 26 38 2D 75 03
02871199600d[USBMSD] E9 CB 00 60 F3 A6 61 74 0E 83 C7 20 4A 75 EC 9D
02871199600d[USBMSD] 66 5E 72 C4 E9 B7 00 26 FF 75 14 26 FF 75 1A 66
02871199600d[USBMSD] 5E 6A 60 07 31 DB E8 07 00 72 FB EA 00 06 00 00
02871199600d[USBMSD] A1 0B 00 C1 E8 02 66 98 66 89 F5 66 96 66 99 66
02871199600d[USBMSD] F7 F6 66 0F B7 3E 0E 00 66 01 F8 52 B9 01 00 E8
02871199600d[USBMSD] 49 00 5E 01 F6 01 F6 26 80 64 03 0F 26 66 8B 34
02871199600d[USBMSD] 66 67 8D 45 FE 66 0F B6 0E 0D 00 66 F7 E1 66 89
02871199600d[USBMSD] C5 66 0F B6 06 10 00 66 F7 26 24 00 66 01 E8 66
02871199600d[USBMSD] 01 F8 E8 16 00 A1 0B 00 C1 E8 04 F7 E1 8C C1 01
02871199600d[USBMSD] C1 8E C1 66 81 FE F8 FF FF 0F C3 66 60 60 6A 00
02871199600d[USBMSD] 6A 00 66 50 06 53 6A 01 6A 10 B4 42 8A 16 40 00
02871199600d[USBMSD] 89 E6 16 1F CD 13 0E 1F 72 14 83 C4 10 61 49 74
02871199600d[USBMSD] 0A 03 1E 0B 00 66 83 C0 01 EB D2 66 61 C3 B8 45
02871199600d[USBMSD] 0E CD 10 EB FE 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 00 00 00 53 54 41 52 54 55 50 20 20 20 20 55 AA
02871199600d[USBMSD] packet complete 0BA31020
02871600000d[USBMSD] data in 512/512
02871600000d[SCSIHD] read sector_count=0
02871600000d[SCSIHD] command complete tag=0x10010 status=0 sense=0
02871600000d[USBMSD] command complete 0
02871600000d[USBMSD] packet hexdump (512 bytes)
02871600000d[USBMSD] 52 52 61 41 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 72 72 41 61 87 0F 02 00 10 01 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA
02872000000d[USBMSD] command status 0 tag 0x10010, len 13
02872000000d[USBMSD] packet hexdump (13 bytes)
02872000000d[USBMSD] 55 53 42 53 10 00 01 00 00 00 00 00 00
02872400000d[USBMSD] packet hexdump (31 bytes)
02872400000d[USBMSD] 55 53 42 43 10 00 01 00 00 02 00 00 80 00 0A 28
02872400000d[USBMSD] 00 00 00 00 01 00 00 01 00 00 00 00 00 00 00
02872400000d[USBMSD] command on LUN 0
02872400000d[USBMSD] command tag 0x10010 flags 00000080 len 10 data 512
02872400000d[SCSIHD] command: lun=0 tag=0x10010 data=0x28
02872400000d[SCSIHD] Read (sector 1, count 1)
02872400000d[SCSIHD] read sector_count=1
02872800000d[USBMSD] data in 512/512
02872800000d[USBMSD] deferring packet 0BA311A0
02874000000d[SCSIHD] data ready tag=0x10010 len=512
02874000000d[USBMSD] packet hexdump (512 bytes)
02874000000d[USBMSD] 52 52 61 41 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 72 72 41 61 87 0F 02 00 10 01 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA
02874000000d[SCSIHD] read sector_count=0
02874000000d[SCSIHD] command complete tag=0x10010 status=0 sense=0
02874000000d[USBMSD] command complete 0
02874000000d[USBMSD] packet complete 0BA311A0
02874800000d[USBMSD] command status 0 tag 0x10010, len 13
02874800000d[USBMSD] packet hexdump (13 bytes)
02874800000d[USBMSD] 55 53 42 53 10 00 01 00 00 00 00 00 00
Итак, как вы можете видеть, у меня все хорошо, но реальное оборудование так не считает.