Revision 227ebeb5 usb-linux.c

b/usb-linux.c
315 315
    }
316 316
}
317 317

  
318
static void async_cancel(USBPacket *unused, void *opaque)
318
static void async_cancel(USBPacket *p, void *opaque)
319 319
{
320
    AsyncURB *aurb = opaque;
321
    USBHostDevice *s = aurb->hdev;
320
    USBHostDevice *s = opaque;
321
    AsyncURB *aurb;
322 322

  
323
    DPRINTF("husb: async cancel. aurb %p\n", aurb);
323
    QLIST_FOREACH(aurb, &s->aurbs, next) {
324
        if (p != aurb->packet) {
325
            continue;
326
        }
324 327

  
325
    /* Mark it as dead (see async_complete above) */
326
    aurb->packet = NULL;
328
        DPRINTF("husb: async cancel: packet %p, aurb %p\n", p, aurb);
327 329

  
328
    int r = ioctl(s->fd, USBDEVFS_DISCARDURB, aurb);
329
    if (r < 0) {
330
        DPRINTF("husb: async. discard urb failed errno %d\n", errno);
330
        /* Mark it as dead (see async_complete above) */
331
        aurb->packet = NULL;
332

  
333
        int r = ioctl(s->fd, USBDEVFS_DISCARDURB, aurb);
334
        if (r < 0) {
335
            DPRINTF("husb: async. discard urb failed errno %d\n", errno);
336
        }
331 337
    }
332 338
}
333 339

  
......
696 702
        }
697 703
    }
698 704

  
699
    usb_defer_packet(p, async_cancel, aurb);
705
    usb_defer_packet(p, async_cancel, s);
700 706
    return USB_RET_ASYNC;
701 707
}
702 708

  
......
828 834
        }
829 835
    }
830 836

  
831
    usb_defer_packet(p, async_cancel, aurb);
837
    usb_defer_packet(p, async_cancel, s);
832 838
    return USB_RET_ASYNC;
833 839
}
834 840

  

Also available in: Unified diff