1/* $FreeBSD: head/sys/dev/usb/usb_transfer.c 213435 2010-10-04 23:18:05Z hselasky $ */
2/*-
3 * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
--- 45 unchanged lines hidden (view full) ---
55#include <dev/usb/usb_process.h>
56#include <dev/usb/usb_transfer.h>
57#include <dev/usb/usb_device.h>
58#include <dev/usb/usb_debug.h>
59#include <dev/usb/usb_util.h>
60
61#include <dev/usb/usb_controller.h>
62#include <dev/usb/usb_bus.h>
63
64struct usb_std_packet_size {
65 struct {
66 uint16_t min; /* inclusive */
67 uint16_t max; /* inclusive */
68 } range;
69
70 uint16_t fixed[4];
--- 2120 unchanged lines hidden (view full) ---
2191 if (xfer->flags_int.bdma_enable &&
2192 (!xfer->flags_int.bdma_no_post_sync)) {
2193 usb_bdma_post_sync(xfer);
2194 }
2195#endif
2196 }
2197 }
2198
2199 /* call processing routine */
2200 (xfer->callback) (xfer, xfer->error);
2201
2202 /* pickup the USB mutex again */
2203 USB_BUS_LOCK(info->bus);
2204
2205 /*
2206 * Check if we got started after that we got cancelled, but
--- 171 unchanged lines hidden (view full) ---
2378{
2379 struct usb_xfer *xfer = arg;
2380 struct usb_endpoint *ep = xfer->endpoint;
2381
2382 USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED);
2383
2384 DPRINTF("start\n");
2385
2386 /* start the transfer */
2387 (ep->methods->start) (xfer);
2388
2389 xfer->flags_int.can_cancel_immed = 1;
2390
2391 /* check for error */
2392 if (xfer->error) {
2393 /* some error has happened */
--- 161 unchanged lines hidden (view full) ---
2555 usbd_transfer_timeout_ms(xfer,
2556 &usbd_transfer_start_cb,
2557 xfer->interval);
2558 return;
2559 }
2560 }
2561 DPRINTF("start\n");
2562
2563 /* start USB transfer */
2564 (ep->methods->start) (xfer);
2565
2566 xfer->flags_int.can_cancel_immed = 1;
2567
2568 /* check for error */
2569 if (xfer->error) {
2570 /* some error has happened */
--- 705 unchanged lines hidden ---
2/*-
3 * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
--- 45 unchanged lines hidden (view full) ---
55#include <dev/usb/usb_process.h>
56#include <dev/usb/usb_transfer.h>
57#include <dev/usb/usb_device.h>
58#include <dev/usb/usb_debug.h>
59#include <dev/usb/usb_util.h>
60
61#include <dev/usb/usb_controller.h>
62#include <dev/usb/usb_bus.h>
63
64struct usb_std_packet_size {
65 struct {
66 uint16_t min; /* inclusive */
67 uint16_t max; /* inclusive */
68 } range;
69
70 uint16_t fixed[4];
--- 2120 unchanged lines hidden (view full) ---
2191 if (xfer->flags_int.bdma_enable &&
2192 (!xfer->flags_int.bdma_no_post_sync)) {
2193 usb_bdma_post_sync(xfer);
2194 }
2195#endif
2196 }
2197 }
2198
2199 /* call processing routine */
2200 (xfer->callback) (xfer, xfer->error);
2201
2202 /* pickup the USB mutex again */
2203 USB_BUS_LOCK(info->bus);
2204
2205 /*
2206 * Check if we got started after that we got cancelled, but
--- 171 unchanged lines hidden (view full) ---
2378{
2379 struct usb_xfer *xfer = arg;
2380 struct usb_endpoint *ep = xfer->endpoint;
2381
2382 USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED);
2383
2384 DPRINTF("start\n");
2385
2386 /* start the transfer */
2387 (ep->methods->start) (xfer);
2388
2389 xfer->flags_int.can_cancel_immed = 1;
2390
2391 /* check for error */
2392 if (xfer->error) {
2393 /* some error has happened */
--- 161 unchanged lines hidden (view full) ---
2555 usbd_transfer_timeout_ms(xfer,
2556 &usbd_transfer_start_cb,
2557 xfer->interval);
2558 return;
2559 }
2560 }
2561 DPRINTF("start\n");
2562
2563 /* start USB transfer */
2564 (ep->methods->start) (xfer);
2565
2566 xfer->flags_int.can_cancel_immed = 1;
2567
2568 /* check for error */
2569 if (xfer->error) {
2570 /* some error has happened */
--- 705 unchanged lines hidden ---