On Thu, May 24, 2012 at 9:12 PM, Xiaofan Chen <xiaof...@gmail.com> wrote:
> On Thu, May 24, 2012 at 7:10 PM, Pete Batard <p...@akeo.ie> wrote:
>> Finally got around looking further at the Darwin issue. It looks like the
>> main problem was that process_new_device() was maintaining a static device
>> pointer for the last device seen (last_dev), and the value wasn't reset as
>> it should when calling get_device_list(), resulting in a bad pointer ref.
>>
>> To ensure we can issue concurrent calls to get_device_list(), I chose to
>> maintained last_dev there and just pass it as a parameter to
>> process_new_device(). Testing seem to indicate that this avoids the issue we
>> experienced previously.

One git question first, how to revert the v2 patch and then apply
this patch? For now I just blow away the whole directory
and clone again. But there should be a simple way.

There are quite some warnings generated after applying the
two Darwin patches.

mymacmini:build xiaofanc$ make
make  all-recursive
Making all in libusb
  CC       libusb_1_0_la-core.lo
  CC       libusb_1_0_la-descriptor.lo
  CC       libusb_1_0_la-io.lo
  CC       libusb_1_0_la-sync.lo
  CC       libusb_1_0_la-darwin_usb.lo
../../libusbx/libusb/os/darwin_usb.c: In function 'ep_to_pipeRef':
../../libusbx/libusb/os/darwin_usb.c:137: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c:147: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c: In function 'darwin_devices_detached':
../../libusbx/libusb/os/darwin_usb.c:298: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c: In function 'event_thread_main':
../../libusbx/libusb/os/darwin_usb.c:365: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c:390: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c:401: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c: In function 'darwin_check_configuration':
../../libusbx/libusb/os/darwin_usb.c:589: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c: In function 'process_new_device':
../../libusbx/libusb/os/darwin_usb.c:738: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c:742: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c:807: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c: In function 'darwin_open':
../../libusbx/libusb/os/darwin_usb.c:905: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c: In function 'get_endpoints':
../../libusbx/libusb/os/darwin_usb.c:1040: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c:1060: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c: In function 'darwin_claim_interface':
../../libusbx/libusb/os/darwin_usb.c:1168: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c: In function 'darwin_abort_transfers':
../../libusbx/libusb/os/darwin_usb.c:1553: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c: In function 'darwin_async_io_callback':
../../libusbx/libusb/os/darwin_usb.c:1598: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c: In function 'darwin_handle_callback':
../../libusbx/libusb/os/darwin_usb.c:1654: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
../../libusbx/libusb/os/darwin_usb.c: In function 'op_handle_events':
../../libusbx/libusb/os/darwin_usb.c:1688: warning: passing argument 4
of 'usbi_log' from incompatible pointer type
  CC       libusb_1_0_la-threads_posix.lo
  CCLD     libusb-1.0.la
Making all in doc
make[2]: Nothing to be done for `all'.
Making all in examples
  CC       listdevs.o
  CCLD     listdevs
  CC       xusb.o
  CCLD     xusb
  CC       dpfp.o
  CCLD     dpfp
  CC       dpfp_threaded-dpfp_threaded.o
  CCLD     dpfp_threaded
make[2]: Nothing to be done for `all-am'.

mymacmini:examples xiaofanc$ ./xusb 0403:cff8
Using libusbx v1.0.11.10507

Opening device...
[timestamp] [threadID] facility level [function call] <message>
--------------------------------------------------------------------------------
[ 0.000000] [00000e07] libusbx: warning
[darwin_cache_device_descriptor] could not retrieve device descriptor
05ac:8281: device not responding. skipping device
[ 0.538919] [00000e07] libusbx: warning
[darwin_cache_device_descriptor] could not retrieve device descriptor
05ac:8281: device not responding. skipping device
bus: 250, port path from HCD: 1
speed: 480 Mbit/s (USB 2.0 HighSpeed)

Reading device descriptor:
            length: 18
      device class: 0
               S/N: 3
           VID:PID: 0403:CFF8
         bcdDevice: 0700
   iMan:iProd:iSer: 1:2:3
          nb confs: 1

Reading configuration descriptors:
             nb interfaces: 2
              interface[0]: id = 0
interface[0].altsetting[0]: num endpoints = 2
   Class.SubClass.Protocol: FF.FF.FF
       endpoint[0].address: 81
           max packet size: 0200
          polling interval: 00
       endpoint[1].address: 02
           max packet size: 0200
          polling interval: 00
              interface[1]: id = 1
interface[1].altsetting[0]: num endpoints = 2
   Class.SubClass.Protocol: FF.FF.FF
       endpoint[0].address: 83
           max packet size: 0200
          polling interval: 00
       endpoint[1].address: 04
           max packet size: 0200
          polling interval: 00

Claiming interface 0...

Claiming interface 1...

Reading string descriptors:
   String (0x01): "Amontec"
   String (0x02): "Amontec JTAGkey-2"
   String (0x03): "53T9XDR4"
[ 0.702742] [00000e07] libusbx: warning [darwin_transfer_status]
transfer error: pipe is stalled

Releasing interface 0...
Releasing interface 1...
Closing device...


-- 
Xiaofan

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to