Revision 7a8fc83f usb-linux.c

b/usb-linux.c
121 121
    Notifier  exit;
122 122

  
123 123
    struct endp_data endp_table[MAX_ENDPOINTS];
124
    QLIST_HEAD(, AsyncURB) aurbs;
124 125

  
125 126
    /* Host side address */
126 127
    int bus_num;
......
223 224
{
224 225
    struct usbdevfs_urb urb;
225 226
    struct usbdevfs_iso_packet_desc isocpd[ISO_FRAME_DESC_PER_URB];
227
    USBHostDevice *hdev;
228
    QLIST_ENTRY(AsyncURB) next;
226 229

  
227 230
    /* For regular async urbs */
228 231
    USBPacket     *packet;
229
    USBHostDevice *hdev;
230 232

  
231 233
    /* For buffered iso handling */
232 234
    int iso_frame_idx; /* -1 means in flight */
233 235
};
234 236

  
235
static AsyncURB *async_alloc(void)
237
static AsyncURB *async_alloc(USBHostDevice *s)
236 238
{
237
    return (AsyncURB *) qemu_mallocz(sizeof(AsyncURB));
239
    AsyncURB *aurb = qemu_mallocz(sizeof(AsyncURB));
240
    aurb->hdev = s;
241
    QLIST_INSERT_HEAD(&s->aurbs, aurb, next);
242
    return aurb;
238 243
}
239 244

  
240 245
static void async_free(AsyncURB *aurb)
241 246
{
247
    QLIST_REMOVE(aurb, next);
242 248
    qemu_free(aurb);
243 249
}
244 250

  
......
661 667
        return usb_host_handle_iso_data(s, p, p->pid == USB_TOKEN_IN);
662 668
    }
663 669

  
664
    aurb = async_alloc();
665
    aurb->hdev   = s;
670
    aurb = async_alloc(s);
666 671
    aurb->packet = p;
667 672

  
668 673
    urb = &aurb->urb;
......
787 792
        return USB_RET_STALL;
788 793
    }
789 794

  
790
    aurb = async_alloc();
791
    aurb->hdev   = s;
795
    aurb = async_alloc(s);
792 796
    aurb->packet = p;
793 797

  
794 798
    /*

Also available in: Unified diff