PERFORCE change 181804 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Tue Aug 3 20:40:06 UTC 2010
http://p4web.freebsd.org/@@181804?ac=10
Change 181804 by hselasky at hselasky_laptop001 on 2010/08/03 20:39:29
USB core:
- moved "start_dma_delay" to "bus_methods".
- factored out reference to "bus" pointer.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/usb_controller.h#24 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#182 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/usb_controller.h#24 (text+ko) ====
@@ -118,6 +118,10 @@
/* Optional device uninit */
void (*device_uninit) (struct usb_device *);
+
+ /* Optional for device and host mode */
+
+ void (*start_dma_delay)(struct usb_xfer *);
};
/*
@@ -136,8 +140,6 @@
/* Optional */
- void (*start_dma_delay)(struct usb_xfer *);
-
void *info;
};
==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#182 (text+ko) ====
@@ -2562,14 +2562,17 @@
usbd_callback_wrapper_sub(struct usb_xfer *xfer)
{
struct usb_endpoint *ep;
+ struct usb_bus *bus;
usb_frcount_t x;
+ bus = xfer->xroot->bus;
+
if ((!xfer->flags_int.open) &&
(!xfer->flags_int.did_close)) {
DPRINTF("close\n");
- USB_BUS_LOCK(xfer->xroot->bus);
+ USB_BUS_LOCK(bus);
(xfer->endpoint->methods->close) (xfer);
- USB_BUS_UNLOCK(xfer->xroot->bus);
+ USB_BUS_UNLOCK(bus);
/* only close once */
xfer->flags_int.did_close = 1;
return (1); /* wait for new callback */
@@ -2581,7 +2584,7 @@
if ((xfer->error != 0) && (!xfer->flags_int.did_dma_delay) &&
((xfer->error == USB_ERR_CANCELLED) ||
(xfer->error == USB_ERR_TIMEOUT) ||
- (xfer->endpoint->methods->start_dma_delay != NULL))) {
+ (bus->methods->start_dma_delay != NULL))) {
usb_timeout_t temp;
@@ -2597,20 +2600,20 @@
"on %p\n", temp, xfer);
if (temp != 0) {
- USB_BUS_LOCK(xfer->xroot->bus);
+ USB_BUS_LOCK(bus);
/*
* Some hardware solutions have dedicated
* events when it is safe to free DMA'ed
* memory. For the other hardware platforms we
* use a static delay.
*/
- if (xfer->endpoint->methods->start_dma_delay != NULL) {
- (xfer->endpoint->methods->start_dma_delay) (xfer);
+ if (bus->methods->start_dma_delay != NULL) {
+ (bus->methods->start_dma_delay) (xfer);
} else {
usbd_transfer_timeout_ms(xfer,
(void *)&usb_dma_delay_done_cb, temp);
}
- USB_BUS_UNLOCK(xfer->xroot->bus);
+ USB_BUS_UNLOCK(bus);
return (1); /* wait for new callback */
}
}
@@ -2702,7 +2705,7 @@
* If the current USB transfer is completing we need to start the
* next one:
*/
- USB_BUS_LOCK(xfer->xroot->bus);
+ USB_BUS_LOCK(bus);
if (ep->endpoint_q.curr == xfer) {
usb_command_wrapper(&ep->endpoint_q, NULL);
@@ -2714,7 +2717,7 @@
xfer->endpoint->is_synced = 0;
}
}
- USB_BUS_UNLOCK(xfer->xroot->bus);
+ USB_BUS_UNLOCK(bus);
done:
return (0);
}
More information about the p4-projects
mailing list