FreeBSD Bugzilla – Attachment 55500 Details for
Bug 83863
[ugen] Communication problem between opensc/openct via USB with e-gate smart-card.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
sys-bsd.c.diff
sys-bsd.c.diff (text/x-diff; charset="iso-8859-1"), 1.98 KB, created by
Hans Petter Selasky
on 2005-08-04 20:04:19 UTC
(
hide
)
Description:
sys-bsd.c.diff
Filename:
MIME Type:
Creator:
Hans Petter Selasky
Created:
2005-08-04 20:04:19 UTC
Size:
1.98 KB
patch
obsolete
>*** sys-bsd.c.ref Thu Aug 4 20:33:40 2005 >--- sys-bsd.c Thu Aug 4 20:59:59 2005 >*************** >*** 215,220 **** >--- 215,251 ---- > return 0; > } > >+ static void >+ ifd_sysdep_usb_clearstall(ifd_device_t *dev, u_int8_t endpoint) >+ { >+ struct usb_ctl_request ctrl; >+ int rc, val; >+ >+ bzero(&ctrl, sizeof(ctrl)); >+ >+ ctrl.ucr_request.bmRequestType = UT_WRITE_ENDPOINT; >+ ctrl.ucr_request.bRequest = UR_CLEAR_FEATURE; >+ USETW(ctrl.ucr_request.wValue, UF_ENDPOINT_HALT); >+ USETW(ctrl.ucr_request.wIndex, endpoint); >+ USETW(ctrl.ucr_request.wLength, 0); >+ >+ val = 1000; >+ if ((rc = ioctl(dev->fd, USB_SET_TIMEOUT, &val)) < 0) { >+ ifd_debug(1,"USB_SET_TIMEOUT failed: %d", rc); >+ ct_error("usb_set_timeout failed: %s(%d)", >+ strerror(errno), errno); >+ return; >+ } >+ >+ if ((rc = ioctl(dev->fd, USB_DO_REQUEST, &ctrl)) < 0) { >+ ifd_debug(1, "USB_DO_REQUEST failed: %d", rc); >+ ct_error("usb_do_request failed: %s (%d)", >+ strerror(errno), errno); >+ return; >+ } >+ return; >+ } >+ > /* > * USB control command > */ >*************** >*** 228,233 **** >--- 259,265 ---- > { > struct usb_ctl_request ctrl; > int rc,val; >+ int count = 1; > > ifd_debug(1, "BSD: ifd_sysdep_usb_control(0x%x)", request); > memset(&ctrl, 0, sizeof(ctrl)); >*************** >*** 247,252 **** >--- 279,286 ---- > if(len) > ifd_debug(5, "BSD: CTRL SEND data %s", ct_hexdump(data,len)); > >+ repeat: >+ > val = timeout; > if ((rc = ioctl(dev->fd, USB_SET_TIMEOUT, &val)) < 0) { > ifd_debug(1,"USB_SET_TIMEOUT failed: %d", rc); >*************** >*** 259,264 **** >--- 293,307 ---- > ifd_debug(1, "USB_DO_REQUEST failed: %d", rc); > ct_error("usb_do_request failed: %s (%d)", > strerror(errno), errno); >+ if(count) >+ { >+ count--; >+ >+ ifd_debug(1, "trying to clear stall ..."); >+ >+ ifd_sysdep_usb_clearstall(dev, 0); >+ goto repeat; >+ } > return IFD_ERROR_COMM_ERROR; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 83863
:
55498
|
55499
| 55500