I guess this for OpenCT, right?
Can you please send all the needed patches to make it work?
Also, please don't use asprintf, as it is gnu specific and is not used
in other parts of the sources.

Thank you,
Alon.

On 5/16/08, David Imhoff <[EMAIL PROTECTED]> wrote:
> Hi,
>
>  Below i appended a patch that fixes sys-bsd.c to use the correct device
>  filenames on OpenBSD. An earlier patch already fixed this for the control
>  endpoint, but this caused the other endpoints to be accessed under
>  '/dev/ugenX.00.E'. This patch causes the correct filenames to be used
>  for all endpoints.
>
>  Best regards,
>
>  David
>
>  Ps. OpenBSD also requires the patch supplied on this mailing list by
>  Hasso Tepper in "[PATCH] Fix BSD support of USB devices (somewhat)" for
>  CCID devices to work properly.
>
>  --- sys-bsd.c.orig      2008-05-16 09:39:49.143742366 +0200
>  +++ sys-bsd.c   2008-05-16 09:42:20.057799942 +0200
>  @@ -63,7 +63,11 @@
>                 return 0;
>         }
>
>  +#ifdef __OpenBSD__
>  +       sprintf((char *)&filename, "%s.%.2d", name, endpoint);
>  +#else
>         sprintf((char *)&filename, "%s.%d", name, endpoint);
>  +#endif /* __OpenBSD__ */
>
>         if ((interfaces[interface][endpoint].ep_fd = open(filename, flags)) < 
> 0) {
>                 ifd_debug(6, "open_ep: error opening \"%s\": %s", filename,
>  @@ -314,7 +318,19 @@
>
>   int ifd_sysdep_usb_open(const char *device)
>   {
>  +#ifdef __OpenBSD__
>  +       char *path;
>  +       int fd;
>  +
>  +       if (asprintf(&path, "%s.00", device) < 0)
>  +               return -1;
>  +       ifd_debug(1, "BSD: ifd_sysdep_usb_open(%s)", path);
>  +       fd = open(path, O_RDWR);
>  +       free(path);
>  +       return fd;
>  +#else
>         return open(device, O_RDWR);
>  +#endif /* __OpenBSD__ */
>   }
>
>   int ifd_sysdep_usb_reset(ifd_device_t * dev)
>  @@ -384,13 +400,8 @@
>
>                         if (!(driver = ifd_driver_for_id(&id)))
>                                 continue;
>  -#ifdef __OpenBSD__
>  -                       snprintf(typedev, sizeof(typedev),
>  -                                "usb:/dev/%s.00", 
> device_info.udi_devnames[0]);
>  -#else
>                         snprintf(typedev, sizeof(typedev),
>                                  "usb:/dev/%s", device_info.udi_devnames[0]);
>  -#endif                         /* __OpenBSD__ */
>
>                         ifd_spawn_handler(driver, typedev, -1);
>                 }
>
>
>  _______________________________________________
>  opensc-devel mailing list
>  [email protected]
>  http://www.opensc-project.org/mailman/listinfo/opensc-devel
>
_______________________________________________
opensc-devel mailing list
[email protected]
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to