fix argument to usb_setup_reserve() (called from USB host adapter drivers)
to be device_t consistently, from Quentin Garnier
This commit is contained in:
parent
551ca764ea
commit
26a4d5b843
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: ehci.c,v 1.135 2008/04/28 20:23:58 martin Exp $ */
|
/* $NetBSD: ehci.c,v 1.136 2008/05/21 17:19:44 drochner Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004,2005 The NetBSD Foundation, Inc.
|
* Copyright (c) 2004,2005 The NetBSD Foundation, Inc.
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.135 2008/04/28 20:23:58 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.136 2008/05/21 17:19:44 drochner Exp $");
|
||||||
|
|
||||||
#include "ohci.h"
|
#include "ohci.h"
|
||||||
#include "uhci.h"
|
#include "uhci.h"
|
||||||
|
@ -363,7 +363,7 @@ ehci_init(ehci_softc_t *sc)
|
||||||
|
|
||||||
sc->sc_bus.usbrev = USBREV_2_0;
|
sc->sc_bus.usbrev = USBREV_2_0;
|
||||||
|
|
||||||
usb_setup_reserve(sc, &sc->sc_dma_reserve, sc->sc_bus.dmatag,
|
usb_setup_reserve(sc->sc_dev, &sc->sc_dma_reserve, sc->sc_bus.dmatag,
|
||||||
USB_MEM_RESERVE);
|
USB_MEM_RESERVE);
|
||||||
|
|
||||||
/* Reset the controller */
|
/* Reset the controller */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: ohci.c,v 1.192 2008/04/28 20:23:59 martin Exp $ */
|
/* $NetBSD: ohci.c,v 1.193 2008/05/21 17:19:44 drochner Exp $ */
|
||||||
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
|
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.192 2008/04/28 20:23:59 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.193 2008/05/21 17:19:44 drochner Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
@ -694,7 +694,7 @@ ohci_init(ohci_softc_t *sc)
|
||||||
SIMPLEQ_INIT(&sc->sc_free_xfers);
|
SIMPLEQ_INIT(&sc->sc_free_xfers);
|
||||||
|
|
||||||
#ifdef __NetBSD__
|
#ifdef __NetBSD__
|
||||||
usb_setup_reserve(sc, &sc->sc_dma_reserve, sc->sc_bus.dmatag,
|
usb_setup_reserve(sc->sc_dev, &sc->sc_dma_reserve, sc->sc_bus.dmatag,
|
||||||
USB_MEM_RESERVE);
|
USB_MEM_RESERVE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: uhci.c,v 1.217 2008/04/28 20:23:59 martin Exp $ */
|
/* $NetBSD: uhci.c,v 1.218 2008/05/21 17:19:44 drochner Exp $ */
|
||||||
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
|
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.217 2008/04/28 20:23:59 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.218 2008/05/21 17:19:44 drochner Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
@ -429,7 +429,7 @@ uhci_init(uhci_softc_t *sc)
|
||||||
uhci_reset(sc);
|
uhci_reset(sc);
|
||||||
|
|
||||||
#ifdef __NetBSD__
|
#ifdef __NetBSD__
|
||||||
usb_setup_reserve(sc, &sc->sc_dma_reserve, sc->sc_bus.dmatag,
|
usb_setup_reserve(sc->sc_dev, &sc->sc_dma_reserve, sc->sc_bus.dmatag,
|
||||||
USB_MEM_RESERVE);
|
USB_MEM_RESERVE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: usb_mem.c,v 1.35 2008/04/28 20:24:00 martin Exp $ */
|
/* $NetBSD: usb_mem.c,v 1.36 2008/05/21 17:19:44 drochner Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.35 2008/04/28 20:24:00 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.36 2008/05/21 17:19:44 drochner Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
@ -307,7 +307,8 @@ usb_reserve_allocm(struct usb_dma_reserve *rs, usb_dma_t *dma, u_int32_t size)
|
||||||
EX_NOWAIT, &start);
|
EX_NOWAIT, &start);
|
||||||
|
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
aprint_error_dev((struct device *)rs->softc, "usb_reserve_allocm of size %u failed (error %d)\n",
|
aprint_error_dev(rs->dv,
|
||||||
|
"usb_reserve_allocm of size %u failed (error %d)\n",
|
||||||
size, error);
|
size, error);
|
||||||
return USBD_NOMEM;
|
return USBD_NOMEM;
|
||||||
}
|
}
|
||||||
|
@ -338,16 +339,15 @@ usb_reserve_freem(struct usb_dma_reserve *rs, usb_dma_t *dma)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
usb_setup_reserve(void *softc, struct usb_dma_reserve *rs, bus_dma_tag_t dtag,
|
usb_setup_reserve(device_t dv, struct usb_dma_reserve *rs, bus_dma_tag_t dtag,
|
||||||
size_t size)
|
size_t size)
|
||||||
{
|
{
|
||||||
int error, nseg;
|
int error, nseg;
|
||||||
bus_dma_segment_t seg;
|
bus_dma_segment_t seg;
|
||||||
struct device *dv = softc;
|
|
||||||
|
|
||||||
rs->dtag = dtag;
|
rs->dtag = dtag;
|
||||||
rs->size = size;
|
rs->size = size;
|
||||||
rs->softc = softc;
|
rs->dv = dv;
|
||||||
|
|
||||||
error = bus_dmamem_alloc(dtag, USB_MEM_RESERVE, PAGE_SIZE, 0,
|
error = bus_dmamem_alloc(dtag, USB_MEM_RESERVE, PAGE_SIZE, 0,
|
||||||
&seg, 1, &nseg, BUS_DMA_NOWAIT);
|
&seg, 1, &nseg, BUS_DMA_NOWAIT);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: usb_mem.h,v 1.25 2008/04/28 20:24:00 martin Exp $ */
|
/* $NetBSD: usb_mem.h,v 1.26 2008/05/21 17:19:44 drochner Exp $ */
|
||||||
/* $FreeBSD: src/sys/dev/usb/usb_mem.h,v 1.9 1999/11/17 22:33:47 n_hibma Exp $ */
|
/* $FreeBSD: src/sys/dev/usb/usb_mem.h,v 1.9 1999/11/17 22:33:47 n_hibma Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -63,7 +63,7 @@ struct usb_dma_reserve {
|
||||||
bus_addr_t paddr;
|
bus_addr_t paddr;
|
||||||
size_t size;
|
size_t size;
|
||||||
struct extent *extent;
|
struct extent *extent;
|
||||||
void *softc;
|
device_t dv;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(_KERNEL_OPT)
|
#if defined(_KERNEL_OPT)
|
||||||
|
@ -76,7 +76,7 @@ struct usb_dma_reserve {
|
||||||
|
|
||||||
usbd_status usb_reserve_allocm(struct usb_dma_reserve *, usb_dma_t *,
|
usbd_status usb_reserve_allocm(struct usb_dma_reserve *, usb_dma_t *,
|
||||||
u_int32_t);
|
u_int32_t);
|
||||||
int usb_setup_reserve(void *, struct usb_dma_reserve *, bus_dma_tag_t, size_t);
|
int usb_setup_reserve(device_t, struct usb_dma_reserve *, bus_dma_tag_t, size_t);
|
||||||
void usb_reserve_freem(struct usb_dma_reserve *, usb_dma_t *);
|
void usb_reserve_freem(struct usb_dma_reserve *, usb_dma_t *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue