|
Lines 435-450
Link Here
|
| 435 |
if (endpt == USB_CONTROL_ENDPOINT) |
435 |
if (endpt == USB_CONTROL_ENDPOINT) |
| 436 |
return (ENODEV); |
436 |
return (ENODEV); |
| 437 |
|
437 |
|
| 438 |
#ifdef DIAGNOSTIC |
|
|
| 439 |
if (sce->edesc == NULL) { |
438 |
if (sce->edesc == NULL) { |
| 440 |
printf("ugenread: no edesc\n"); |
439 |
printf("ugenread: no edesc\n"); |
| 441 |
return (EIO); |
440 |
return (EIO); |
| 442 |
} |
441 |
} |
|
|
442 |
|
| 443 |
if (sce->pipeh == NULL) { |
443 |
if (sce->pipeh == NULL) { |
| 444 |
printf("ugenread: no pipe\n"); |
444 |
printf("ugenread: no pipe\n"); |
| 445 |
return (EIO); |
445 |
return (EIO); |
| 446 |
} |
446 |
} |
| 447 |
#endif |
|
|
| 448 |
|
447 |
|
| 449 |
switch (sce->edesc->bmAttributes & UE_XFERTYPE) { |
448 |
switch (sce->edesc->bmAttributes & UE_XFERTYPE) { |
| 450 |
case UE_INTERRUPT: |
449 |
case UE_INTERRUPT: |
|
Lines 559-565
Link Here
|
| 559 |
if (endpt == USB_CONTROL_ENDPOINT) |
558 |
if (endpt == USB_CONTROL_ENDPOINT) |
| 560 |
return (ENODEV); |
559 |
return (ENODEV); |
| 561 |
|
560 |
|
| 562 |
#ifdef DIAGNOSTIC |
|
|
| 563 |
if (sce->edesc == NULL) { |
561 |
if (sce->edesc == NULL) { |
| 564 |
printf("ugenwrite: no edesc\n"); |
562 |
printf("ugenwrite: no edesc\n"); |
| 565 |
return (EIO); |
563 |
return (EIO); |
|
Lines 568-574
Link Here
|
| 568 |
printf("ugenwrite: no pipe\n"); |
566 |
printf("ugenwrite: no pipe\n"); |
| 569 |
return (EIO); |
567 |
return (EIO); |
| 570 |
} |
568 |
} |
| 571 |
#endif |
|
|
| 572 |
|
569 |
|
| 573 |
switch (sce->edesc->bmAttributes & UE_XFERTYPE) { |
570 |
switch (sce->edesc->bmAttributes & UE_XFERTYPE) { |
| 574 |
case UE_BULK: |
571 |
case UE_BULK: |
|
Lines 897-908
Link Here
|
| 897 |
sce = &sc->sc_endpoints[endpt][IN]; |
894 |
sce = &sc->sc_endpoints[endpt][IN]; |
| 898 |
if (sce == NULL) |
895 |
if (sce == NULL) |
| 899 |
return (EINVAL); |
896 |
return (EINVAL); |
| 900 |
#ifdef DIAGNOSTIC |
897 |
|
| 901 |
if (sce->pipeh == NULL) { |
898 |
if (sce->pipeh == NULL) { |
| 902 |
printf("ugenioctl: USB_SET_SHORT_XFER, no pipe\n"); |
899 |
printf("ugenioctl: USB_SET_SHORT_XFER, no pipe\n"); |
| 903 |
return (EIO); |
900 |
return (EIO); |
| 904 |
} |
901 |
} |
| 905 |
#endif |
902 |
|
| 906 |
if (*(int *)addr) |
903 |
if (*(int *)addr) |
| 907 |
sce->state |= UGEN_SHORT_OK; |
904 |
sce->state |= UGEN_SHORT_OK; |
| 908 |
else |
905 |
else |
|
Lines 912-923
Link Here
|
| 912 |
sce = &sc->sc_endpoints[endpt][IN]; |
909 |
sce = &sc->sc_endpoints[endpt][IN]; |
| 913 |
if (sce == NULL) |
910 |
if (sce == NULL) |
| 914 |
return (EINVAL); |
911 |
return (EINVAL); |
| 915 |
#ifdef DIAGNOSTIC |
912 |
|
| 916 |
if (sce->pipeh == NULL) { |
913 |
if (sce->pipeh == NULL) { |
| 917 |
printf("ugenioctl: USB_SET_TIMEOUT, no pipe\n"); |
914 |
printf("ugenioctl: USB_SET_TIMEOUT, no pipe\n"); |
| 918 |
return (EIO); |
915 |
return (EIO); |
| 919 |
} |
916 |
} |
| 920 |
#endif |
917 |
|
| 921 |
sce->timeout = *(int *)addr; |
918 |
sce->timeout = *(int *)addr; |
| 922 |
return (0); |
919 |
return (0); |
| 923 |
default: |
920 |
default: |
|
Lines 1177-1183
Link Here
|
| 1177 |
sce = &sc->sc_endpoints[UGENENDPOINT(dev)][IN]; |
1174 |
sce = &sc->sc_endpoints[UGENENDPOINT(dev)][IN]; |
| 1178 |
if (sce == NULL) |
1175 |
if (sce == NULL) |
| 1179 |
return (EINVAL); |
1176 |
return (EINVAL); |
| 1180 |
#ifdef DIAGNOSTIC |
1177 |
|
| 1181 |
if (!sce->edesc) { |
1178 |
if (!sce->edesc) { |
| 1182 |
printf("ugenwrite: no edesc\n"); |
1179 |
printf("ugenwrite: no edesc\n"); |
| 1183 |
return (EIO); |
1180 |
return (EIO); |
|
Lines 1186-1192
Link Here
|
| 1186 |
printf("ugenpoll: no pipe\n"); |
1183 |
printf("ugenpoll: no pipe\n"); |
| 1187 |
return (EIO); |
1184 |
return (EIO); |
| 1188 |
} |
1185 |
} |
| 1189 |
#endif |
1186 |
|
| 1190 |
s = splusb(); |
1187 |
s = splusb(); |
| 1191 |
switch (sce->edesc->bmAttributes & UE_XFERTYPE) { |
1188 |
switch (sce->edesc->bmAttributes & UE_XFERTYPE) { |
| 1192 |
case UE_INTERRUPT: |
1189 |
case UE_INTERRUPT: |