Changeset 3536
- Timestamp:
- Feb 6, 2013 7:48:16 AM (4 months ago)
- Location:
- dev/usb2
- Files:
-
- 9 edited
-
device/keyboard/request.fth (modified) (1 diff)
-
hcd/ehci/bulk.fth (modified) (7 diffs)
-
hcd/ehci/intr.fth (modified) (6 diffs)
-
hcd/hcd-call.fth (modified) (1 diff)
-
hcd/hcd.fth (modified) (1 diff)
-
hcd/ohci/bulk.fth (modified) (6 diffs)
-
hcd/ohci/intr.fth (modified) (6 diffs)
-
hcd/uhci/bulk.fth (modified) (5 diffs)
-
hcd/uhci/intr.fth (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dev/usb2/device/keyboard/request.fth
r747 r3536 78 78 79 79 : get-data? ( adr len -- actual ) 80 locked? if nip nip 0 exit then \ bulk or interrupt methods are active 80 81 intr-in? if nip nip restart-intr-in exit then \ USB error; restart 81 82 ?dup if ( adr len actual ) -
dev/usb2/hcd/ehci/bulk.fth
r2591 r3536 422 422 423 423 : bulk-in? ( -- actual usberr ) 424 lock 424 425 bulk-in-ready? if ( usberr | buf actual 0 ) 425 426 ?dup if ( usberr ) … … 433 434 0 0 ( actual usberr ) 434 435 then 436 unlock 435 437 ; 436 438 … … 461 463 : bulk-in ( buf len pipe -- actual usberr ) 462 464 debug? if ." bulk-in" cr then 465 lock 463 466 dup to bulk-in-pipe 464 467 process-bulk-args … … 481 484 my-bulk-qh dup fixup-bulk-in-data ( actual usberr qh ) 482 485 remove-qh ( actual usberr ) 486 unlock 483 487 ; 484 488 485 489 0 instance value bulk-out-busy? 486 490 : done-bulk-out ( -- error? ) 491 lock 487 492 \ Process results 488 493 my-bulk-qh done-error? ( usberr ) … … 491 496 my-bulk-qh remove-qh ( usberr ) 492 497 false to bulk-out-busy? ( usberr ) 498 unlock 493 499 ; 494 500 : start-bulk-out ( buf len pipe -- usberr ) … … 498 504 499 505 debug? if ." bulk-out" cr then 506 lock 500 507 dup to bulk-out-pipe ( buf len pipe ) 501 508 process-bulk-args ( ) … … 508 515 true to bulk-out-busy? ( ) 509 516 0 ( usberr ) 517 unlock 510 518 ; 511 519 : bulk-out ( buf len pipe -- usberr ) -
dev/usb2/hcd/ehci/intr.fth
r2814 r3536 52 52 intr-in-qh if 4drop exit then \ Already started 53 53 54 lock 54 55 to intr-in-interval 55 56 dup to intr-in-pipe … … 64 65 intr-in-qh pt-intr fill-qh 65 66 intr-in-qh my-speed intr-in-interval insert-intr-qh 67 unlock 66 68 ; 67 69 68 70 : intr-in? ( -- actual usberr ) 69 71 intr-in-qh 0= if 0 USB_ERR_INV_OP exit then ( ) 72 lock 70 73 clear-usb-error ( ) 71 74 \ Ironically, we can't use Interrupt-On-Completion for interrupt pipes, … … 92 95 intr-in-qh fixup-intr-in-data ( actual usberr ) 93 96 then ( actual usberr ) 97 unlock 94 98 ; 95 99 … … 112 116 intr-in-qh 0= if exit then 113 117 118 lock 114 119 \ Setup qTD again 115 120 intr-in-qtd restart-intr-in-qtd … … 120 125 intr-in-qtd >qtd-phys l@ intr-in-qh >hcqh-overlay >hcqtd-next le-l! 121 126 intr-in-qh push-qhqtds 127 unlock 122 128 ; 123 129 … … 125 131 debug? if ." end-intr-in" cr then 126 132 intr-in-qh 0= if exit then 133 lock 127 134 intr-in-qh dup fixup-intr-in-data 128 135 intr-in-qtd map-out-bptrs 129 136 dup remove-intr-qh free-qh 130 137 0 to intr-in-qh 0 to intr-in-qtd 138 unlock 131 139 ; 132 140 -
dev/usb2/hcd/hcd-call.fth
r2446 r3536 10 10 : dma-alloc ( size -- virt ) " dma-alloc" $call-parent ; 11 11 : dma-free ( virt size -- ) " dma-free" $call-parent ; 12 13 : locked? ( -- flag ) 14 " locked?" $call-parent 15 ; 12 16 13 17 \ Probing support -
dev/usb2/hcd/hcd.fth
r3444 r3536 54 54 then 55 55 ; 56 57 0 value locked? \ Interrupt lockout for USB keyboard get-data? 58 : lock ( -- ) true to locked? ; 59 : unlock ( -- ) false to locked? ; 56 60 57 61 \ --------------------------------------------------------------------------- -
dev/usb2/hcd/ohci/bulk.fth
r2591 r3536 125 125 : bulk-in? ( -- actual usberr ) 126 126 bulk-in-ed 0= if 0 USB_ERR_INV_OP exit then 127 lock 127 128 clear-usb-error ( ) 128 129 process-hc-status ( ) … … 140 141 0 usb-error ( actual usberr ) 141 142 then 143 unlock 142 144 ; 143 145 … … 158 160 : restart-bulk-in ( -- ) 159 161 debug? if ." restart-bulk-in" cr then 162 lock 160 163 bulk-in-ed 0= if exit then 161 164 bulk-in-ed ed-set-skip … … 169 172 ed-unset-skip 170 173 enable-bulk 174 unlock 171 175 ; 172 176 173 177 : end-bulk-in ( -- ) 174 178 debug? if ." end-bulk-in" cr then 179 lock 175 180 bulk-in-ed 0= if exit then 176 181 bulk-in-td map-out-cbp 177 182 bulk-in-ed remove-my-bulk 178 183 0 to bulk-in-ed 0 to bulk-in-td 184 unlock 179 185 ; 180 186 181 187 : bulk-in ( buf len pipe -- actual usberr ) 182 188 debug? if ." bulk-in" cr then 189 lock 183 190 dup to bulk-in-pipe 184 191 bulk-in-timeout process-bulk-args ( ) … … 207 214 my-ed dup fixup-bulk-in-data ( actual usberr ed ) 208 215 remove-my-bulk ( actual usberr ) 216 unlock 209 217 ; 210 218 211 219 : bulk-out ( buf len pipe -- usberr ) 212 220 debug? if ." bulk-out" cr then 221 lock 213 222 dup to bulk-out-pipe 214 223 bulk-out-timeout process-bulk-args … … 228 237 my-ed dup fixup-bulk-out-data 229 238 remove-my-bulk 239 unlock 230 240 ; 231 241 -
dev/usb2/hcd/ohci/intr.fth
r2591 r3536 62 62 debug? if ." begin-intr-in" cr then 63 63 intr-in-ed if 4drop exit then \ Already started 64 lock 64 65 #intr-in++ 65 66 … … 75 76 intr-in-ed dup fill-intr-in-ed 76 77 insert-in-intr 78 unlock 77 79 ; 78 80 79 81 : intr-in? ( -- actual usberr ) 80 82 intr-in-ed 0= if 0 USB_ERR_INV_OP exit then 83 lock 81 84 clear-usb-error ( ) 82 85 process-hc-status ( ) … … 94 97 0 usb-error ( actual usberr ) 95 98 then 99 unlock 96 100 ; 97 101 … … 112 116 : restart-intr-in ( -- ) 113 117 intr-in-ed 0= if exit then 118 lock 114 119 intr-in-ed ed-set-skip 115 120 … … 121 126 intr-in-ed dup push-edtds 122 127 ed-unset-skip 128 unlock 123 129 ; 124 130 … … 126 132 debug? if ." end-intr-in" cr then 127 133 intr-in-ed 0= if exit then 134 lock 128 135 #intr-in-- 129 136 intr-in-td map-out-cbp 130 137 intr-in-ed remove-my-intr 131 138 0 to intr-in-ed 0 to intr-in-td 139 unlock 132 140 ; 133 141 -
dev/usb2/hcd/uhci/bulk.fth
r2591 r3536 112 112 : bulk-in? ( -- actual usberr ) 113 113 bulk-in-qh 0= if 0 USB_ERR_INV_OP exit then 114 lock 114 115 clear-usb-error 115 116 process-hc-status … … 130 131 bulk-in-td dup >td-buf l@ swap >td-pbuf l@ 2 pick dma-pull 131 132 then 133 unlock 132 134 ; 133 135 … … 171 173 : bulk-in ( buf len pipe -- actual usberr ) 172 174 debug? if ." bulk-in" cr then 175 lock 173 176 dup to bulk-in-pipe 174 177 bulk-in-timeout process-bulk-args … … 198 201 my-#tds fixup-bulk-in-data ( actual usberr qh ) 199 202 dup remove-qh free-qhtds ( actual usberr ) 203 unlock 200 204 ; 201 205 202 206 : bulk-out ( buf len pipe -- usberr ) 203 207 debug? if ." bulk-out" cr then 208 lock 204 209 dup to bulk-out-pipe 205 210 bulk-out-timeout process-bulk-args … … 220 225 my-#tds fixup-bulk-out-data ( actual usberr qh ) 221 226 dup remove-qh free-qhtds ( actual usberr ) 227 unlock 222 228 ; 223 229 -
dev/usb2/hcd/uhci/intr.fth
r2714 r3536 61 61 intr-in-qh if 4drop exit then \ Already started 62 62 63 lock 63 64 to intr-in-interval 64 65 dup to intr-in-pipe … … 71 72 \ Start intr in transaction 72 73 intr-in-qh intr-in-interval insert-intr-qh 74 unlock 73 75 ; 74 76 75 77 : intr-in? ( -- actual usberr ) 76 78 intr-in-qh 0= if 0 USB_ERR_INV_OP exit then 79 lock 77 80 clear-usb-error 78 81 process-hc-status … … 86 89 0 usb-error ( actual usberr ) 87 90 then 91 unlock 88 92 ; 89 93 … … 105 109 intr-in-qh 0= if exit then 106 110 111 lock 107 112 \ Setup TD again 108 113 intr-in-td restart-intr-in-td … … 111 116 intr-in-td >td-phys l@ intr-in-qh >hcqh-elem le-l! 112 117 intr-in-qh push-qhtds 118 unlock 113 119 ; 114 120 … … 117 123 intr-in-qh 0= if exit then 118 124 125 lock 119 126 intr-in-td intr-in-qh >qh-#tds l@ fixup-intr-in-data 120 127 intr-in-td map-out-buf 121 128 intr-in-qh dup remove-qh free-qhtds 122 129 0 to intr-in-qh 0 to intr-in-td 130 unlock 123 131 ; 124 132
Note: See TracChangeset
for help on using the changeset viewer.
