summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2013-04-15 09:23:03 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2013-04-15 09:23:03 +0000
commit5cef08fefab2a1e12eeb54bbb0608448920630e8 (patch)
tree54b4b49685c176f00e369f015a0e43fd73199777 /sys/dev
parentef6d59f94200628194940cb20aa4986edec4b629 (diff)
Get rid of various 'typedef struct' definitions and use plain structure
definitions instead. We don't change usb.h for now to stay compatible with userland. Tested by mpi@ on macppc and myself on i386. ok mpi@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cardbus/ehci_cardbus.c4
-rw-r--r--sys/dev/cardbus/ohci_cardbus.c4
-rw-r--r--sys/dev/cardbus/uhci_cardbus.c4
-rw-r--r--sys/dev/pci/ehci_pci.c4
-rw-r--r--sys/dev/pci/ohci_pci.c4
-rw-r--r--sys/dev/pci/uhci_pci.c4
-rw-r--r--sys/dev/usb/ehci.c484
-rw-r--r--sys/dev/usb/ehcireg.h24
-rw-r--r--sys/dev/usb/ehcivar.h58
-rw-r--r--sys/dev/usb/ezload.c8
-rw-r--r--sys/dev/usb/ezload.h8
-rw-r--r--sys/dev/usb/if_athn_usb.c22
-rw-r--r--sys/dev/usb/if_athn_usb.h18
-rw-r--r--sys/dev/usb/if_atu.c14
-rw-r--r--sys/dev/usb/if_atureg.h10
-rw-r--r--sys/dev/usb/if_aue.c18
-rw-r--r--sys/dev/usb/if_auereg.h10
-rw-r--r--sys/dev/usb/if_axe.c12
-rw-r--r--sys/dev/usb/if_axereg.h10
-rw-r--r--sys/dev/usb/if_cdce.c32
-rw-r--r--sys/dev/usb/if_cdcef.c34
-rw-r--r--sys/dev/usb/if_cdcereg.h18
-rw-r--r--sys/dev/usb/if_cue.c14
-rw-r--r--sys/dev/usb/if_cuereg.h10
-rw-r--r--sys/dev/usb/if_kue.c16
-rw-r--r--sys/dev/usb/if_kuereg.h10
-rw-r--r--sys/dev/usb/if_mos.c12
-rw-r--r--sys/dev/usb/if_mosreg.h10
-rw-r--r--sys/dev/usb/if_otus.c14
-rw-r--r--sys/dev/usb/if_otusreg.h84
-rw-r--r--sys/dev/usb/if_ral.c16
-rw-r--r--sys/dev/usb/if_ralvar.h16
-rw-r--r--sys/dev/usb/if_rsu.c16
-rw-r--r--sys/dev/usb/if_rsureg.h16
-rw-r--r--sys/dev/usb/if_rum.c14
-rw-r--r--sys/dev/usb/if_rumvar.h16
-rw-r--r--sys/dev/usb/if_run.c10
-rw-r--r--sys/dev/usb/if_runvar.h14
-rw-r--r--sys/dev/usb/if_smsc.c12
-rw-r--r--sys/dev/usb/if_smscreg.h10
-rw-r--r--sys/dev/usb/if_uath.c16
-rw-r--r--sys/dev/usb/if_uathvar.h24
-rw-r--r--sys/dev/usb/if_udav.c14
-rw-r--r--sys/dev/usb/if_udavreg.h14
-rw-r--r--sys/dev/usb/if_upgt.c10
-rw-r--r--sys/dev/usb/if_upgtvar.h12
-rw-r--r--sys/dev/usb/if_upl.c26
-rw-r--r--sys/dev/usb/if_url.c14
-rw-r--r--sys/dev/usb/if_urlreg.h14
-rw-r--r--sys/dev/usb/if_urndis.c14
-rw-r--r--sys/dev/usb/if_urndisreg.h12
-rw-r--r--sys/dev/usb/if_urtw.c14
-rw-r--r--sys/dev/usb/if_urtwn.c12
-rw-r--r--sys/dev/usb/if_urtwnreg.h16
-rw-r--r--sys/dev/usb/if_urtwreg.h16
-rw-r--r--sys/dev/usb/if_wi_usb.c28
-rw-r--r--sys/dev/usb/if_zyd.c16
-rw-r--r--sys/dev/usb/if_zydreg.h12
-rw-r--r--sys/dev/usb/moscom.c6
-rw-r--r--sys/dev/usb/ohci.c502
-rw-r--r--sys/dev/usb/ohcireg.h14
-rw-r--r--sys/dev/usb/ohcivar.h58
-rw-r--r--sys/dev/usb/uark.c6
-rw-r--r--sys/dev/usb/uaudio.c36
-rw-r--r--sys/dev/usb/uaudioreg.h6
-rw-r--r--sys/dev/usb/uberry.c6
-rw-r--r--sys/dev/usb/ubsa.c18
-rw-r--r--sys/dev/usb/ubt.c61
-rw-r--r--sys/dev/usb/uchcom.c20
-rw-r--r--sys/dev/usb/ucom.c32
-rw-r--r--sys/dev/usb/ucomvar.h6
-rw-r--r--sys/dev/usb/ucycom.c8
-rw-r--r--sys/dev/usb/udcf.c10
-rw-r--r--sys/dev/usb/udfu.c14
-rw-r--r--sys/dev/usb/udl.c8
-rw-r--r--sys/dev/usb/udl.h10
-rw-r--r--sys/dev/usb/udsbr.c6
-rw-r--r--sys/dev/usb/ueagle.c25
-rw-r--r--sys/dev/usb/ueaglevar.h16
-rw-r--r--sys/dev/usb/uftdi.c10
-rw-r--r--sys/dev/usb/ugen.c39
-rw-r--r--sys/dev/usb/uhci.c572
-rw-r--r--sys/dev/usb/uhcireg.h10
-rw-r--r--sys/dev/usb/uhcivar.h66
-rw-r--r--sys/dev/usb/uhidev.c8
-rw-r--r--sys/dev/usb/uhidev.h16
-rw-r--r--sys/dev/usb/uhub.c20
-rw-r--r--sys/dev/usb/uipaq.c10
-rw-r--r--sys/dev/usb/ukbd.c6
-rw-r--r--sys/dev/usb/ulpt.c24
-rw-r--r--sys/dev/usb/umass.c56
-rw-r--r--sys/dev/usb/umassvar.h27
-rw-r--r--sys/dev/usb/umbg.c16
-rw-r--r--sys/dev/usb/umct.c16
-rw-r--r--sys/dev/usb/umidi.c14
-rw-r--r--sys/dev/usb/umidireg.h18
-rw-r--r--sys/dev/usb/umidivar.h10
-rw-r--r--sys/dev/usb/umodem.c44
-rw-r--r--sys/dev/usb/umsm.c30
-rw-r--r--sys/dev/usb/uoak.h4
-rw-r--r--sys/dev/usb/uoaklux.c4
-rw-r--r--sys/dev/usb/uoakrh.c4
-rw-r--r--sys/dev/usb/uoakv.c4
-rw-r--r--sys/dev/usb/uow.c18
-rw-r--r--sys/dev/usb/uplcom.c25
-rw-r--r--sys/dev/usb/urio.c18
-rw-r--r--sys/dev/usb/usb.c30
-rw-r--r--sys/dev/usb/usb_mem.c26
-rw-r--r--sys/dev/usb/usb_mem.h12
-rw-r--r--sys/dev/usb/usb_subr.c79
-rw-r--r--sys/dev/usb/usbcdc.h38
-rw-r--r--sys/dev/usb/usbdi.c170
-rw-r--r--sys/dev/usb/usbdi.h148
-rw-r--r--sys/dev/usb/usbdi_util.c78
-rw-r--r--sys/dev/usb/usbdi_util.h58
-rw-r--r--sys/dev/usb/usbdivar.h60
-rw-r--r--sys/dev/usb/usbf.c40
-rw-r--r--sys/dev/usb/usbf.h98
-rw-r--r--sys/dev/usb/usbf_subr.c152
-rw-r--r--sys/dev/usb/usbfvar.h42
-rw-r--r--sys/dev/usb/usbhid.h6
-rw-r--r--sys/dev/usb/uscanner.c14
-rw-r--r--sys/dev/usb/uslcom.c6
-rw-r--r--sys/dev/usb/usps.c14
-rw-r--r--sys/dev/usb/uthum.c6
-rw-r--r--sys/dev/usb/uticom.c26
-rw-r--r--sys/dev/usb/utrh.c6
-rw-r--r--sys/dev/usb/uts.c16
-rw-r--r--sys/dev/usb/utwitch.c6
-rw-r--r--sys/dev/usb/uvideo.c26
-rw-r--r--sys/dev/usb/uvideo.h14
-rw-r--r--sys/dev/usb/uvisor.c10
-rw-r--r--sys/dev/usb/uvscom.c16
-rw-r--r--sys/dev/usb/uyap.c6
134 files changed, 2268 insertions, 2290 deletions
diff --git a/sys/dev/cardbus/ehci_cardbus.c b/sys/dev/cardbus/ehci_cardbus.c
index af54433b740..edb642c0679 100644
--- a/sys/dev/cardbus/ehci_cardbus.c
+++ b/sys/dev/cardbus/ehci_cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehci_cardbus.c,v 1.16 2012/10/08 21:47:50 deraadt Exp $ */
+/* $OpenBSD: ehci_cardbus.c,v 1.17 2013/04/15 09:23:00 mglocker Exp $ */
/* $NetBSD: ehci_cardbus.c,v 1.6.6.3 2004/09/21 13:27:25 skrll Exp $ */
/*
@@ -64,7 +64,7 @@ void ehci_cardbus_attach(struct device *, struct device *, void *);
int ehci_cardbus_detach(struct device *, int);
struct ehci_cardbus_softc {
- ehci_softc_t sc;
+ struct ehci_softc sc;
cardbus_chipset_tag_t sc_cc;
cardbus_function_tag_t sc_cf;
cardbus_devfunc_t sc_ct;
diff --git a/sys/dev/cardbus/ohci_cardbus.c b/sys/dev/cardbus/ohci_cardbus.c
index c0f2cf4653a..7de068f889b 100644
--- a/sys/dev/cardbus/ohci_cardbus.c
+++ b/sys/dev/cardbus/ohci_cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci_cardbus.c,v 1.17 2010/09/07 16:21:41 deraadt Exp $ */
+/* $OpenBSD: ohci_cardbus.c,v 1.18 2013/04/15 09:23:00 mglocker Exp $ */
/* $NetBSD: ohci_cardbus.c,v 1.19 2004/08/02 19:14:28 mycroft Exp $ */
/*
@@ -63,7 +63,7 @@ void ohci_cardbus_attach(struct device *, struct device *, void *);
int ohci_cardbus_detach(struct device *, int);
struct ohci_cardbus_softc {
- ohci_softc_t sc;
+ struct ohci_softc sc;
cardbus_chipset_tag_t sc_cc;
cardbus_function_tag_t sc_cf;
cardbus_devfunc_t sc_ct;
diff --git a/sys/dev/cardbus/uhci_cardbus.c b/sys/dev/cardbus/uhci_cardbus.c
index 67571f5fc78..52e11c7869b 100644
--- a/sys/dev/cardbus/uhci_cardbus.c
+++ b/sys/dev/cardbus/uhci_cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci_cardbus.c,v 1.11 2010/03/27 21:40:13 jsg Exp $ */
+/* $OpenBSD: uhci_cardbus.c,v 1.12 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@ void uhci_cardbus_attach(struct device *, struct device *, void *);
int uhci_cardbus_detach(struct device *, int);
struct uhci_cardbus_softc {
- uhci_softc_t sc;
+ struct uhci_softc sc;
cardbus_chipset_tag_t sc_cc;
cardbus_function_tag_t sc_cf;
cardbus_devfunc_t sc_ct;
diff --git a/sys/dev/pci/ehci_pci.c b/sys/dev/pci/ehci_pci.c
index 80dc2ae3221..563477bf02a 100644
--- a/sys/dev/pci/ehci_pci.c
+++ b/sys/dev/pci/ehci_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehci_pci.c,v 1.25 2012/10/20 19:13:25 deraadt Exp $ */
+/* $OpenBSD: ehci_pci.c,v 1.26 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: ehci_pci.c,v 1.15 2004/04/23 21:13:06 itojun Exp $ */
/*
@@ -59,7 +59,7 @@ extern int ehcidebug;
#endif
struct ehci_pci_softc {
- ehci_softc_t sc;
+ struct ehci_softc sc;
pci_chipset_tag_t sc_pc;
pcitag_t sc_tag;
void *sc_ih; /* interrupt vectoring */
diff --git a/sys/dev/pci/ohci_pci.c b/sys/dev/pci/ohci_pci.c
index 3a61e7b8d79..4290d305208 100644
--- a/sys/dev/pci/ohci_pci.c
+++ b/sys/dev/pci/ohci_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci_pci.c,v 1.38 2010/12/14 16:13:16 jakemsr Exp $ */
+/* $OpenBSD: ohci_pci.c,v 1.39 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: ohci_pci.c,v 1.23 2002/10/02 16:51:47 thorpej Exp $ */
/*
@@ -63,7 +63,7 @@ void ohci_pci_attach_deferred(struct device *);
int ohci_pci_detach(struct device *, int);
struct ohci_pci_softc {
- ohci_softc_t sc;
+ struct ohci_softc sc;
pci_chipset_tag_t sc_pc;
void *sc_ih; /* interrupt vectoring */
};
diff --git a/sys/dev/pci/uhci_pci.c b/sys/dev/pci/uhci_pci.c
index 77a657c9a99..c14f0fefab9 100644
--- a/sys/dev/pci/uhci_pci.c
+++ b/sys/dev/pci/uhci_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci_pci.c,v 1.31 2010/12/14 16:13:16 jakemsr Exp $ */
+/* $OpenBSD: uhci_pci.c,v 1.32 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: uhci_pci.c,v 1.24 2002/10/02 16:51:58 thorpej Exp $ */
/*
@@ -57,7 +57,7 @@ int uhci_pci_detach(struct device *, int);
int uhci_pci_activate(struct device *, int);
struct uhci_pci_softc {
- uhci_softc_t sc;
+ struct uhci_softc sc;
pci_chipset_tag_t sc_pc;
pcitag_t sc_tag;
void *sc_ih; /* interrupt vectoring */
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c
index 0c8fbc6f1cf..aefdd9bcab0 100644
--- a/sys/dev/usb/ehci.c
+++ b/sys/dev/usb/ehci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehci.c,v 1.129 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: ehci.c,v 1.130 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */
/*
@@ -92,17 +92,17 @@ int ehcidebug = 0;
struct ehci_pipe {
struct usbd_pipe pipe;
- ehci_soft_qh_t *sqh;
+ struct ehci_soft_qh *sqh;
union {
- ehci_soft_qtd_t *qtd;
- /* ehci_soft_itd_t *itd; */
+ struct ehci_soft_qtd *qtd;
+ /* struct ehci_soft_itd *itd; */
} tail;
union {
/* Control pipe */
struct {
- usb_dma_t reqdma;
+ struct usb_dma reqdma;
u_int length;
- /*ehci_soft_qtd_t *setup, *data, *stat;*/
+ /* struct ehci_soft_qtd *setup, *data, *stat; */
} ctl;
/* Interrupt pipe */
struct {
@@ -122,107 +122,108 @@ struct ehci_pipe {
u_int8_t ehci_reverse_bits(u_int8_t, int);
-usbd_status ehci_open(usbd_pipe_handle);
+usbd_status ehci_open(struct usbd_pipe *);
void ehci_poll(struct usbd_bus *);
void ehci_softintr(void *);
-int ehci_intr1(ehci_softc_t *);
-void ehci_waitintr(ehci_softc_t *, usbd_xfer_handle);
-void ehci_check_intr(ehci_softc_t *, struct ehci_xfer *);
-void ehci_check_qh_intr(ehci_softc_t *, struct ehci_xfer *);
-void ehci_check_itd_intr(ehci_softc_t *, struct ehci_xfer *);
+int ehci_intr1(struct ehci_softc *);
+void ehci_waitintr(struct ehci_softc *, struct usbd_xfer *);
+void ehci_check_intr(struct ehci_softc *, struct ehci_xfer *);
+void ehci_check_qh_intr(struct ehci_softc *, struct ehci_xfer *);
+void ehci_check_itd_intr(struct ehci_softc *, struct ehci_xfer *);
void ehci_idone(struct ehci_xfer *);
void ehci_timeout(void *);
void ehci_timeout_task(void *);
void ehci_intrlist_timeout(void *);
-usbd_status ehci_allocm(struct usbd_bus *, usb_dma_t *, u_int32_t);
-void ehci_freem(struct usbd_bus *, usb_dma_t *);
-
-usbd_xfer_handle ehci_allocx(struct usbd_bus *);
-void ehci_freex(struct usbd_bus *, usbd_xfer_handle);
-
-usbd_status ehci_root_ctrl_transfer(usbd_xfer_handle);
-usbd_status ehci_root_ctrl_start(usbd_xfer_handle);
-void ehci_root_ctrl_abort(usbd_xfer_handle);
-void ehci_root_ctrl_close(usbd_pipe_handle);
-void ehci_root_ctrl_done(usbd_xfer_handle);
-
-usbd_status ehci_root_intr_transfer(usbd_xfer_handle);
-usbd_status ehci_root_intr_start(usbd_xfer_handle);
-void ehci_root_intr_abort(usbd_xfer_handle);
-void ehci_root_intr_close(usbd_pipe_handle);
-void ehci_root_intr_done(usbd_xfer_handle);
-
-usbd_status ehci_device_ctrl_transfer(usbd_xfer_handle);
-usbd_status ehci_device_ctrl_start(usbd_xfer_handle);
-void ehci_device_ctrl_abort(usbd_xfer_handle);
-void ehci_device_ctrl_close(usbd_pipe_handle);
-void ehci_device_ctrl_done(usbd_xfer_handle);
-
-usbd_status ehci_device_bulk_transfer(usbd_xfer_handle);
-usbd_status ehci_device_bulk_start(usbd_xfer_handle);
-void ehci_device_bulk_abort(usbd_xfer_handle);
-void ehci_device_bulk_close(usbd_pipe_handle);
-void ehci_device_bulk_done(usbd_xfer_handle);
-
-usbd_status ehci_device_intr_transfer(usbd_xfer_handle);
-usbd_status ehci_device_intr_start(usbd_xfer_handle);
-void ehci_device_intr_abort(usbd_xfer_handle);
-void ehci_device_intr_close(usbd_pipe_handle);
-void ehci_device_intr_done(usbd_xfer_handle);
-
-usbd_status ehci_device_isoc_transfer(usbd_xfer_handle);
-usbd_status ehci_device_isoc_start(usbd_xfer_handle);
-void ehci_device_isoc_abort(usbd_xfer_handle);
-void ehci_device_isoc_close(usbd_pipe_handle);
-void ehci_device_isoc_done(usbd_xfer_handle);
-
-void ehci_device_clear_toggle(usbd_pipe_handle pipe);
-void ehci_noop(usbd_pipe_handle pipe);
+usbd_status ehci_allocm(struct usbd_bus *, struct usb_dma *, u_int32_t);
+void ehci_freem(struct usbd_bus *, struct usb_dma *);
+
+struct usbd_xfer *ehci_allocx(struct usbd_bus *);
+void ehci_freex(struct usbd_bus *, struct usbd_xfer *);
+
+usbd_status ehci_root_ctrl_transfer(struct usbd_xfer *);
+usbd_status ehci_root_ctrl_start(struct usbd_xfer *);
+void ehci_root_ctrl_abort(struct usbd_xfer *);
+void ehci_root_ctrl_close(struct usbd_pipe *);
+void ehci_root_ctrl_done(struct usbd_xfer *);
+
+usbd_status ehci_root_intr_transfer(struct usbd_xfer *);
+usbd_status ehci_root_intr_start(struct usbd_xfer *);
+void ehci_root_intr_abort(struct usbd_xfer *);
+void ehci_root_intr_close(struct usbd_pipe *);
+void ehci_root_intr_done(struct usbd_xfer *);
+
+usbd_status ehci_device_ctrl_transfer(struct usbd_xfer *);
+usbd_status ehci_device_ctrl_start(struct usbd_xfer *);
+void ehci_device_ctrl_abort(struct usbd_xfer *);
+void ehci_device_ctrl_close(struct usbd_pipe *);
+void ehci_device_ctrl_done(struct usbd_xfer *);
+
+usbd_status ehci_device_bulk_transfer(struct usbd_xfer *);
+usbd_status ehci_device_bulk_start(struct usbd_xfer *);
+void ehci_device_bulk_abort(struct usbd_xfer *);
+void ehci_device_bulk_close(struct usbd_pipe *);
+void ehci_device_bulk_done(struct usbd_xfer *);
+
+usbd_status ehci_device_intr_transfer(struct usbd_xfer *);
+usbd_status ehci_device_intr_start(struct usbd_xfer *);
+void ehci_device_intr_abort(struct usbd_xfer *);
+void ehci_device_intr_close(struct usbd_pipe *);
+void ehci_device_intr_done(struct usbd_xfer *);
+
+usbd_status ehci_device_isoc_transfer(struct usbd_xfer *);
+usbd_status ehci_device_isoc_start(struct usbd_xfer *);
+void ehci_device_isoc_abort(struct usbd_xfer *);
+void ehci_device_isoc_close(struct usbd_pipe *);
+void ehci_device_isoc_done(struct usbd_xfer *);
+
+void ehci_device_clear_toggle(struct usbd_pipe *pipe);
+void ehci_noop(struct usbd_pipe *pipe);
int ehci_str(usb_string_descriptor_t *, int, const char *);
-void ehci_pcd(ehci_softc_t *, usbd_xfer_handle);
-void ehci_disown(ehci_softc_t *, int, int);
+void ehci_pcd(struct ehci_softc *, struct usbd_xfer *);
+void ehci_disown(struct ehci_softc *, int, int);
-ehci_soft_qh_t *ehci_alloc_sqh(ehci_softc_t *);
-void ehci_free_sqh(ehci_softc_t *, ehci_soft_qh_t *);
+struct ehci_soft_qh *ehci_alloc_sqh(struct ehci_softc *);
+void ehci_free_sqh(struct ehci_softc *, struct ehci_soft_qh *);
-ehci_soft_qtd_t *ehci_alloc_sqtd(ehci_softc_t *);
-void ehci_free_sqtd(ehci_softc_t *, ehci_soft_qtd_t *);
+struct ehci_soft_qtd *ehci_alloc_sqtd(struct ehci_softc *);
+void ehci_free_sqtd(struct ehci_softc *, struct ehci_soft_qtd *);
usbd_status ehci_alloc_sqtd_chain(struct ehci_pipe *,
- ehci_softc_t *, u_int, int, usbd_xfer_handle,
- ehci_soft_qtd_t **, ehci_soft_qtd_t **);
-void ehci_free_sqtd_chain(ehci_softc_t *, struct ehci_xfer *exfer);
+ struct ehci_softc *, u_int, int, struct usbd_xfer *,
+ struct ehci_soft_qtd **, struct ehci_soft_qtd **);
+void ehci_free_sqtd_chain(struct ehci_softc *,
+ struct ehci_xfer *exfer);
-ehci_soft_itd_t *ehci_alloc_itd(ehci_softc_t *sc);
-void ehci_free_itd(ehci_softc_t *sc, ehci_soft_itd_t *itd);
-void ehci_rem_free_itd_chain(ehci_softc_t *sc,
+struct ehci_soft_itd *ehci_alloc_itd(struct ehci_softc *sc);
+void ehci_free_itd(struct ehci_softc *sc, struct ehci_soft_itd *itd);
+void ehci_rem_free_itd_chain(struct ehci_softc *sc,
struct ehci_xfer *exfer);
-void ehci_abort_isoc_xfer(usbd_xfer_handle xfer,
+void ehci_abort_isoc_xfer(struct usbd_xfer *xfer,
usbd_status status);
-usbd_status ehci_device_request(usbd_xfer_handle xfer);
+usbd_status ehci_device_request(struct usbd_xfer *xfer);
-usbd_status ehci_device_setintr(ehci_softc_t *, ehci_soft_qh_t *,
+usbd_status ehci_device_setintr(struct ehci_softc *, struct ehci_soft_qh *,
int ival);
-void ehci_add_qh(ehci_soft_qh_t *, ehci_soft_qh_t *);
-void ehci_rem_qh(ehci_softc_t *, ehci_soft_qh_t *);
-void ehci_set_qh_qtd(ehci_soft_qh_t *, ehci_soft_qtd_t *);
-void ehci_sync_hc(ehci_softc_t *);
+void ehci_add_qh(struct ehci_soft_qh *, struct ehci_soft_qh *);
+void ehci_rem_qh(struct ehci_softc *, struct ehci_soft_qh *);
+void ehci_set_qh_qtd(struct ehci_soft_qh *, struct ehci_soft_qtd *);
+void ehci_sync_hc(struct ehci_softc *);
-void ehci_close_pipe(usbd_pipe_handle);
-void ehci_abort_xfer(usbd_xfer_handle, usbd_status);
+void ehci_close_pipe(struct usbd_pipe *);
+void ehci_abort_xfer(struct usbd_xfer *, usbd_status);
#ifdef EHCI_DEBUG
-void ehci_dump_regs(ehci_softc_t *);
+void ehci_dump_regs(struct ehci_softc *);
void ehci_dump(void);
-ehci_softc_t *theehci;
+struct ehci_softc *theehci;
void ehci_dump_link(ehci_link_t, int);
-void ehci_dump_sqtds(ehci_soft_qtd_t *);
-void ehci_dump_sqtd(ehci_soft_qtd_t *);
-void ehci_dump_qtd(ehci_qtd_t *);
-void ehci_dump_sqh(ehci_soft_qh_t *);
+void ehci_dump_sqtds(struct ehci_soft_qtd *);
+void ehci_dump_sqtd(struct ehci_soft_qtd *);
+void ehci_dump_qtd(struct ehci_qtd *);
+void ehci_dump_sqh(struct ehci_soft_qh *);
#if notyet
void ehci_dump_sitd(struct ehci_soft_itd *itd);
void ehci_dump_itd(struct ehci_soft_itd *);
@@ -325,12 +326,12 @@ ehci_reverse_bits(u_int8_t c, int nbits)
}
usbd_status
-ehci_init(ehci_softc_t *sc)
+ehci_init(struct ehci_softc *sc)
{
u_int32_t sparams, cparams, hcr;
u_int i, j;
usbd_status err;
- ehci_soft_qh_t *sqh;
+ struct ehci_soft_qh *sqh;
#ifdef EHCI_DEBUG
u_int32_t vers;
@@ -400,7 +401,7 @@ ehci_init(ehci_softc_t *sc)
EOWRITE4(sc, EHCI_PERIODICLISTBASE, DMAADDR(&sc->sc_fldma, 0));
- sc->sc_softitds = malloc(sc->sc_flsize * sizeof(ehci_soft_itd_t *),
+ sc->sc_softitds = malloc(sc->sc_flsize * sizeof(struct ehci_soft_itd *),
M_USB, M_NOWAIT | M_ZERO);
if (sc->sc_softitds == NULL)
return (ENOMEM);
@@ -530,7 +531,7 @@ ehci_init(ehci_softc_t *sc)
int
ehci_intr(void *v)
{
- ehci_softc_t *sc = v;
+ struct ehci_softc *sc = v;
if (sc == NULL || sc->sc_bus.dying)
return (0);
@@ -548,7 +549,7 @@ ehci_intr(void *v)
}
int
-ehci_intr1(ehci_softc_t *sc)
+ehci_intr1(struct ehci_softc *sc)
{
u_int32_t intrs, eintrs;
@@ -617,7 +618,7 @@ ehci_intr1(ehci_softc_t *sc)
}
void
-ehci_pcd(ehci_softc_t *sc, usbd_xfer_handle xfer)
+ehci_pcd(struct ehci_softc *sc, struct usbd_xfer *xfer)
{
u_char *p;
int i, m;
@@ -645,7 +646,7 @@ ehci_pcd(ehci_softc_t *sc, usbd_xfer_handle xfer)
void
ehci_softintr(void *v)
{
- ehci_softc_t *sc = v;
+ struct ehci_softc *sc = v;
struct ehci_xfer *ex, *nextex;
DPRINTFN(10,("%s: ehci_softintr (%d)\n", sc->sc_bus.bdev.dv_xname,
@@ -683,7 +684,7 @@ ehci_softintr(void *v)
/* Check for an interrupt. */
void
-ehci_check_intr(ehci_softc_t *sc, struct ehci_xfer *ex)
+ehci_check_intr(struct ehci_softc *sc, struct ehci_xfer *ex)
{
int attr;
@@ -699,9 +700,9 @@ ehci_check_intr(ehci_softc_t *sc, struct ehci_xfer *ex)
}
void
-ehci_check_qh_intr(ehci_softc_t *sc, struct ehci_xfer *ex)
+ehci_check_qh_intr(struct ehci_softc *sc, struct ehci_xfer *ex)
{
- ehci_soft_qtd_t *sqtd, *lsqtd;
+ struct ehci_soft_qtd *sqtd, *lsqtd;
__uint32_t status;
if (ex->sqtdstart == NULL) {
@@ -722,19 +723,19 @@ ehci_check_qh_intr(ehci_softc_t *sc, struct ehci_xfer *ex)
* short packet (SPD and not ACTIVE).
*/
usb_syncmem(&lsqtd->dma,
- lsqtd->offs + offsetof(ehci_qtd_t, qtd_status),
+ lsqtd->offs + offsetof(struct ehci_qtd, qtd_status),
sizeof(lsqtd->qtd.qtd_status),
BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
if (letoh32(lsqtd->qtd.qtd_status) & EHCI_QTD_ACTIVE) {
DPRINTFN(12, ("ehci_check_intr: active ex=%p\n", ex));
for (sqtd = ex->sqtdstart; sqtd != lsqtd; sqtd=sqtd->nextqtd) {
usb_syncmem(&sqtd->dma,
- sqtd->offs + offsetof(ehci_qtd_t, qtd_status),
+ sqtd->offs + offsetof(struct ehci_qtd, qtd_status),
sizeof(sqtd->qtd.qtd_status),
BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
status = letoh32(sqtd->qtd.qtd_status);
usb_syncmem(&sqtd->dma,
- sqtd->offs + offsetof(ehci_qtd_t, qtd_status),
+ sqtd->offs + offsetof(struct ehci_qtd, qtd_status),
sizeof(sqtd->qtd.qtd_status), BUS_DMASYNC_PREREAD);
/* If there's an active QTD the xfer isn't done. */
if (status & EHCI_QTD_ACTIVE)
@@ -749,7 +750,7 @@ ehci_check_qh_intr(ehci_softc_t *sc, struct ehci_xfer *ex)
DPRINTFN(12, ("ehci_check_intr: ex=%p std=%p still active\n",
ex, ex->sqtdstart));
usb_syncmem(&lsqtd->dma,
- lsqtd->offs + offsetof(ehci_qtd_t, qtd_status),
+ lsqtd->offs + offsetof(struct ehci_qtd, qtd_status),
sizeof(lsqtd->qtd.qtd_status), BUS_DMASYNC_PREREAD);
return;
}
@@ -761,8 +762,8 @@ ehci_check_qh_intr(ehci_softc_t *sc, struct ehci_xfer *ex)
}
void
-ehci_check_itd_intr(ehci_softc_t *sc, struct ehci_xfer *ex) {
- ehci_soft_itd_t *itd;
+ehci_check_itd_intr(struct ehci_softc *sc, struct ehci_xfer *ex) {
+ struct ehci_soft_itd *itd;
int i;
if (&ex->xfer != SIMPLEQ_FIRST(&ex->xfer.pipe->queue))
@@ -785,7 +786,7 @@ ehci_check_itd_intr(ehci_softc_t *sc, struct ehci_xfer *ex) {
* check no active transfers in last itd, meaning we're finished
*/
- usb_syncmem(&itd->dma, itd->offs + offsetof(ehci_itd_t, itd_ctl),
+ usb_syncmem(&itd->dma, itd->offs + offsetof(struct ehci_itd, itd_ctl),
sizeof(itd->itd.itd_ctl), BUS_DMASYNC_POSTWRITE |
BUS_DMASYNC_POSTREAD);
@@ -810,11 +811,11 @@ done:
void
ehci_idone(struct ehci_xfer *ex)
{
- usbd_xfer_handle xfer = &ex->xfer;
+ struct usbd_xfer *xfer = &ex->xfer;
#ifdef EHCI_DEBUG
struct ehci_pipe *epipe = (struct ehci_pipe *)xfer->pipe;
#endif
- ehci_soft_qtd_t *sqtd;
+ struct ehci_soft_qtd *sqtd;
u_int32_t status = 0, nstatus = 0;
int actlen, cerr;
@@ -879,7 +880,7 @@ ehci_idone(struct ehci_xfer *ex)
for (itd = ex->itdstart; itd != NULL; itd = itd->xfer_next) {
usb_syncmem(&itd->dma,
- itd->offs + offsetof(ehci_itd_t, itd_ctl),
+ itd->offs + offsetof(struct ehci_itd, itd_ctl),
sizeof(itd->itd.itd_ctl), BUS_DMASYNC_POSTWRITE |
BUS_DMASYNC_POSTREAD);
@@ -974,7 +975,7 @@ ehci_idone(struct ehci_xfer *ex)
* too long.
*/
void
-ehci_waitintr(ehci_softc_t *sc, usbd_xfer_handle xfer)
+ehci_waitintr(struct ehci_softc *sc, struct usbd_xfer *xfer)
{
int timo;
u_int32_t intrs;
@@ -1008,7 +1009,7 @@ ehci_waitintr(ehci_softc_t *sc, usbd_xfer_handle xfer)
void
ehci_poll(struct usbd_bus *bus)
{
- ehci_softc_t *sc = (ehci_softc_t *)bus;
+ struct ehci_softc *sc = (struct ehci_softc *)bus;
#ifdef EHCI_DEBUG
static int last;
int new;
@@ -1167,7 +1168,7 @@ ehci_activate(struct device *self, int act)
void
ehci_shutdown(void *v)
{
- ehci_softc_t *sc = v;
+ struct ehci_softc *sc = v;
DPRINTF(("ehci_shutdown: stopping the HC\n"));
EOWRITE4(sc, EHCI_USBCMD, 0); /* Halt controller */
@@ -1175,7 +1176,7 @@ ehci_shutdown(void *v)
}
usbd_status
-ehci_allocm(struct usbd_bus *bus, usb_dma_t *dma, u_int32_t size)
+ehci_allocm(struct usbd_bus *bus, struct usb_dma *dma, u_int32_t size)
{
struct ehci_softc *sc = (struct ehci_softc *)bus;
usbd_status err;
@@ -1189,18 +1190,18 @@ ehci_allocm(struct usbd_bus *bus, usb_dma_t *dma, u_int32_t size)
}
void
-ehci_freem(struct usbd_bus *bus, usb_dma_t *dma)
+ehci_freem(struct usbd_bus *bus, struct usb_dma *dma)
{
struct ehci_softc *sc = (struct ehci_softc *)bus;
usb_freemem(&sc->sc_bus, dma);
}
-usbd_xfer_handle
+struct usbd_xfer *
ehci_allocx(struct usbd_bus *bus)
{
struct ehci_softc *sc = (struct ehci_softc *)bus;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
xfer = SIMPLEQ_FIRST(&sc->sc_free_xfers);
if (xfer != NULL) {
@@ -1227,7 +1228,7 @@ ehci_allocx(struct usbd_bus *bus)
}
void
-ehci_freex(struct usbd_bus *bus, usbd_xfer_handle xfer)
+ehci_freex(struct usbd_bus *bus, struct usbd_xfer *xfer)
{
struct ehci_softc *sc = (struct ehci_softc *)bus;
@@ -1247,7 +1248,7 @@ ehci_freex(struct usbd_bus *bus, usbd_xfer_handle xfer)
}
void
-ehci_device_clear_toggle(usbd_pipe_handle pipe)
+ehci_device_clear_toggle(struct usbd_pipe *pipe)
{
struct ehci_pipe *epipe = (struct ehci_pipe *)pipe;
@@ -1265,13 +1266,13 @@ ehci_device_clear_toggle(usbd_pipe_handle pipe)
}
void
-ehci_noop(usbd_pipe_handle pipe)
+ehci_noop(struct usbd_pipe *pipe)
{
}
#ifdef EHCI_DEBUG
void
-ehci_dump_regs(ehci_softc_t *sc)
+ehci_dump_regs(struct ehci_softc *sc)
{
int i;
@@ -1329,7 +1330,7 @@ ehci_dump_link(ehci_link_t link, int type)
}
void
-ehci_dump_sqtds(ehci_soft_qtd_t *sqtd)
+ehci_dump_sqtds(struct ehci_soft_qtd *sqtd)
{
int i;
u_int32_t stop;
@@ -1338,12 +1339,12 @@ ehci_dump_sqtds(ehci_soft_qtd_t *sqtd)
for (i = 0; sqtd && i < 20 && !stop; sqtd = sqtd->nextqtd, i++) {
ehci_dump_sqtd(sqtd);
usb_syncmem(&sqtd->dma,
- sqtd->offs + offsetof(ehci_qtd_t, qtd_next),
+ sqtd->offs + offsetof(struct ehci_qtd, qtd_next),
sizeof(sqtd->qtd),
BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
stop = sqtd->qtd.qtd_next & htole32(EHCI_LINK_TERMINATE);
usb_syncmem(&sqtd->dma,
- sqtd->offs + offsetof(ehci_qtd_t, qtd_next),
+ sqtd->offs + offsetof(struct ehci_qtd, qtd_next),
sizeof(sqtd->qtd), BUS_DMASYNC_PREREAD);
}
if (!stop)
@@ -1351,7 +1352,7 @@ ehci_dump_sqtds(ehci_soft_qtd_t *sqtd)
}
void
-ehci_dump_sqtd(ehci_soft_qtd_t *sqtd)
+ehci_dump_sqtd(struct ehci_soft_qtd *sqtd)
{
usb_syncmem(&sqtd->dma, sqtd->offs,
sizeof(sqtd->qtd), BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
@@ -1362,7 +1363,7 @@ ehci_dump_sqtd(ehci_soft_qtd_t *sqtd)
}
void
-ehci_dump_qtd(ehci_qtd_t *qtd)
+ehci_dump_qtd(struct ehci_qtd *qtd)
{
u_int32_t s;
char sbuf[128];
@@ -1384,9 +1385,9 @@ ehci_dump_qtd(ehci_qtd_t *qtd)
}
void
-ehci_dump_sqh(ehci_soft_qh_t *sqh)
+ehci_dump_sqh(struct ehci_soft_qh *sqh)
{
- ehci_qh_t *qh = &sqh->qh;
+ struct ehci_qh *qh = &sqh->qh;
u_int32_t endp, endphub;
usb_syncmem(&sqh->dma, sqh->offs,
@@ -1466,15 +1467,15 @@ ehci_dump_exfer(struct ehci_xfer *ex)
#endif /* EHCI_DEBUG */
usbd_status
-ehci_open(usbd_pipe_handle pipe)
+ehci_open(struct usbd_pipe *pipe)
{
- usbd_device_handle dev = pipe->device;
- ehci_softc_t *sc = (ehci_softc_t *)dev->bus;
+ struct usbd_device *dev = pipe->device;
+ struct ehci_softc *sc = (struct ehci_softc *)dev->bus;
usb_endpoint_descriptor_t *ed = pipe->endpoint->edesc;
u_int8_t addr = dev->address;
u_int8_t xfertype = ed->bmAttributes & UE_XFERTYPE;
struct ehci_pipe *epipe = (struct ehci_pipe *)pipe;
- ehci_soft_qh_t *sqh;
+ struct ehci_soft_qh *sqh;
usbd_status err;
int s;
int ival, speed, naks;
@@ -1635,22 +1636,22 @@ bad:
* If in the intr schedule it may not.
*/
void
-ehci_add_qh(ehci_soft_qh_t *sqh, ehci_soft_qh_t *head)
+ehci_add_qh(struct ehci_soft_qh *sqh, struct ehci_soft_qh *head)
{
SPLUSBCHECK;
- usb_syncmem(&head->dma, head->offs + offsetof(ehci_qh_t, qh_link),
+ usb_syncmem(&head->dma, head->offs + offsetof(struct ehci_qh, qh_link),
sizeof(head->qh.qh_link), BUS_DMASYNC_POSTWRITE);
sqh->next = head->next;
sqh->prev = head;
sqh->qh.qh_link = head->qh.qh_link;
- usb_syncmem(&sqh->dma, sqh->offs + offsetof(ehci_qh_t, qh_link),
+ usb_syncmem(&sqh->dma, sqh->offs + offsetof(struct ehci_qh, qh_link),
sizeof(sqh->qh.qh_link), BUS_DMASYNC_PREWRITE);
head->next = sqh;
if (sqh->next)
sqh->next->prev = sqh;
head->qh.qh_link = htole32(sqh->physaddr | EHCI_LINK_QH);
- usb_syncmem(&head->dma, head->offs + offsetof(ehci_qh_t, qh_link),
+ usb_syncmem(&head->dma, head->offs + offsetof(struct ehci_qh, qh_link),
sizeof(head->qh.qh_link), BUS_DMASYNC_PREWRITE);
#ifdef EHCI_DEBUG
@@ -1666,25 +1667,25 @@ ehci_add_qh(ehci_soft_qh_t *sqh, ehci_soft_qh_t *head)
* Will always have a 'next' if it's in the async list as it's circular.
*/
void
-ehci_rem_qh(ehci_softc_t *sc, ehci_soft_qh_t *sqh)
+ehci_rem_qh(struct ehci_softc *sc, struct ehci_soft_qh *sqh)
{
SPLUSBCHECK;
/* XXX */
- usb_syncmem(&sqh->dma, sqh->offs + offsetof(ehci_qh_t, qh_link),
+ usb_syncmem(&sqh->dma, sqh->offs + offsetof(struct ehci_qh, qh_link),
sizeof(sqh->qh.qh_link), BUS_DMASYNC_POSTWRITE);
sqh->prev->qh.qh_link = sqh->qh.qh_link;
sqh->prev->next = sqh->next;
if (sqh->next)
sqh->next->prev = sqh->prev;
usb_syncmem(&sqh->prev->dma,
- sqh->prev->offs + offsetof(ehci_qh_t, qh_link),
+ sqh->prev->offs + offsetof(struct ehci_qh, qh_link),
sizeof(sqh->prev->qh.qh_link), BUS_DMASYNC_PREWRITE);
ehci_sync_hc(sc);
}
void
-ehci_set_qh_qtd(ehci_soft_qh_t *sqh, ehci_soft_qtd_t *sqtd)
+ehci_set_qh_qtd(struct ehci_soft_qh *sqh, struct ehci_soft_qtd *sqtd)
{
int i;
u_int32_t status;
@@ -1699,7 +1700,7 @@ ehci_set_qh_qtd(ehci_soft_qh_t *sqh, ehci_soft_qtd_t *sqtd)
sqh->qh.qh_qtd.qtd_status =
htole32(EHCI_QTD_SET_STATUS(EHCI_QTD_HALTED));
usb_syncmem(&sqh->dma,
- sqh->offs + offsetof(ehci_qh_t, qh_qtd.qtd_status),
+ sqh->offs + offsetof(struct ehci_qh, qh_qtd.qtd_status),
sizeof(sqh->qh.qh_qtd.qtd_status),
BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
sqh->qh.qh_curqtd = 0;
@@ -1713,7 +1714,7 @@ ehci_set_qh_qtd(ehci_soft_qh_t *sqh, ehci_soft_qtd_t *sqtd)
/* Set !HALTED && !ACTIVE to start execution, preserve some fields */
sqh->qh.qh_qtd.qtd_status = status;
usb_syncmem(&sqh->dma,
- sqh->offs + offsetof(ehci_qh_t, qh_qtd.qtd_status),
+ sqh->offs + offsetof(struct ehci_qh, qh_qtd.qtd_status),
sizeof(sqh->qh.qh_qtd.qtd_status),
BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
}
@@ -1725,7 +1726,7 @@ ehci_set_qh_qtd(ehci_soft_qh_t *sqh, ehci_soft_qtd_t *sqtd)
* To make this easier we first obtain exclusive use of the doorbell.
*/
void
-ehci_sync_hc(ehci_softc_t *sc)
+ehci_sync_hc(struct ehci_softc *sc)
{
int s, error;
int tries = 0;
@@ -1761,7 +1762,7 @@ ehci_sync_hc(ehci_softc_t *sc)
/*Call at splusb*/
void
-ehci_rem_free_itd_chain(ehci_softc_t *sc, struct ehci_xfer *exfer)
+ehci_rem_free_itd_chain(struct ehci_softc *sc, struct ehci_xfer *exfer)
{
struct ehci_soft_itd *itd, *prev;
@@ -1788,7 +1789,7 @@ ehci_rem_free_itd_chain(ehci_softc_t *sc, struct ehci_xfer *exfer)
/* XXX this part is untested... */
prev->itd.itd_next = itd->itd.itd_next;
usb_syncmem(&itd->dma,
- itd->offs + offsetof(ehci_itd_t, itd_next),
+ itd->offs + offsetof(struct ehci_itd, itd_next),
sizeof(itd->itd.itd_next), BUS_DMASYNC_PREWRITE);
prev->u.frame_list.next = itd->u.frame_list.next;
@@ -1905,7 +1906,7 @@ ehci_str(usb_string_descriptor_t *p, int l, const char *s)
* Simulate a hardware hub by handling all the necessary requests.
*/
usbd_status
-ehci_root_ctrl_transfer(usbd_xfer_handle xfer)
+ehci_root_ctrl_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -1919,9 +1920,9 @@ ehci_root_ctrl_transfer(usbd_xfer_handle xfer)
}
usbd_status
-ehci_root_ctrl_start(usbd_xfer_handle xfer)
+ehci_root_ctrl_start(struct usbd_xfer *xfer)
{
- ehci_softc_t *sc = (ehci_softc_t *)xfer->pipe->device->bus;
+ struct ehci_softc *sc = (struct ehci_softc *)xfer->pipe->device->bus;
usb_device_request_t *req;
void *buf = NULL;
int port, i;
@@ -2298,7 +2299,7 @@ ehci_root_ctrl_start(usbd_xfer_handle xfer)
}
void
-ehci_disown(ehci_softc_t *sc, int index, int lowspeed)
+ehci_disown(struct ehci_softc *sc, int index, int lowspeed)
{
int port;
u_int32_t v;
@@ -2312,26 +2313,26 @@ ehci_disown(ehci_softc_t *sc, int index, int lowspeed)
/* Abort a root control request. */
void
-ehci_root_ctrl_abort(usbd_xfer_handle xfer)
+ehci_root_ctrl_abort(struct usbd_xfer *xfer)
{
/* Nothing to do, all transfers are synchronous. */
}
/* Close the root pipe. */
void
-ehci_root_ctrl_close(usbd_pipe_handle pipe)
+ehci_root_ctrl_close(struct usbd_pipe *pipe)
{
DPRINTF(("ehci_root_ctrl_close\n"));
/* Nothing to do. */
}
void
-ehci_root_intr_done(usbd_xfer_handle xfer)
+ehci_root_intr_done(struct usbd_xfer *xfer)
{
}
usbd_status
-ehci_root_intr_transfer(usbd_xfer_handle xfer)
+ehci_root_intr_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -2345,10 +2346,10 @@ ehci_root_intr_transfer(usbd_xfer_handle xfer)
}
usbd_status
-ehci_root_intr_start(usbd_xfer_handle xfer)
+ehci_root_intr_start(struct usbd_xfer *xfer)
{
- usbd_pipe_handle pipe = xfer->pipe;
- ehci_softc_t *sc = (ehci_softc_t *)pipe->device->bus;
+ struct usbd_pipe *pipe = xfer->pipe;
+ struct ehci_softc *sc = (struct ehci_softc *)pipe->device->bus;
if (sc->sc_bus.dying)
return (USBD_IOERROR);
@@ -2360,7 +2361,7 @@ ehci_root_intr_start(usbd_xfer_handle xfer)
/* Abort a root interrupt request. */
void
-ehci_root_intr_abort(usbd_xfer_handle xfer)
+ehci_root_intr_abort(struct usbd_xfer *xfer)
{
int s;
@@ -2376,9 +2377,9 @@ ehci_root_intr_abort(usbd_xfer_handle xfer)
/* Close the root pipe. */
void
-ehci_root_intr_close(usbd_pipe_handle pipe)
+ehci_root_intr_close(struct usbd_pipe *pipe)
{
- ehci_softc_t *sc = (ehci_softc_t *)pipe->device->bus;
+ struct ehci_softc *sc = (struct ehci_softc *)pipe->device->bus;
DPRINTF(("ehci_root_intr_close\n"));
@@ -2386,19 +2387,19 @@ ehci_root_intr_close(usbd_pipe_handle pipe)
}
void
-ehci_root_ctrl_done(usbd_xfer_handle xfer)
+ehci_root_ctrl_done(struct usbd_xfer *xfer)
{
}
/************************/
-ehci_soft_qh_t *
-ehci_alloc_sqh(ehci_softc_t *sc)
+struct ehci_soft_qh *
+ehci_alloc_sqh(struct ehci_softc *sc)
{
- ehci_soft_qh_t *sqh;
+ struct ehci_soft_qh *sqh;
usbd_status err;
int i, offs;
- usb_dma_t dma;
+ struct usb_dma dma;
if (sc->sc_freeqhs == NULL) {
DPRINTFN(2, ("ehci_alloc_sqh: allocating chunk\n"));
@@ -2422,26 +2423,26 @@ ehci_alloc_sqh(ehci_softc_t *sc)
}
sqh = sc->sc_freeqhs;
sc->sc_freeqhs = sqh->next;
- memset(&sqh->qh, 0, sizeof(ehci_qh_t));
+ memset(&sqh->qh, 0, sizeof(struct ehci_qh));
sqh->next = NULL;
sqh->prev = NULL;
return (sqh);
}
void
-ehci_free_sqh(ehci_softc_t *sc, ehci_soft_qh_t *sqh)
+ehci_free_sqh(struct ehci_softc *sc, struct ehci_soft_qh *sqh)
{
sqh->next = sc->sc_freeqhs;
sc->sc_freeqhs = sqh;
}
-ehci_soft_qtd_t *
-ehci_alloc_sqtd(ehci_softc_t *sc)
+struct ehci_soft_qtd *
+ehci_alloc_sqtd(struct ehci_softc *sc)
{
- ehci_soft_qtd_t *sqtd;
+ struct ehci_soft_qtd *sqtd;
usbd_status err;
int i, offs;
- usb_dma_t dma;
+ struct usb_dma dma;
int s;
if (sc->sc_freeqtds == NULL) {
@@ -2470,7 +2471,7 @@ ehci_alloc_sqtd(ehci_softc_t *sc)
s = splusb();
sqtd = sc->sc_freeqtds;
sc->sc_freeqtds = sqtd->nextqtd;
- memset(&sqtd->qtd, 0, sizeof(ehci_qtd_t));
+ memset(&sqtd->qtd, 0, sizeof(struct ehci_qtd));
sqtd->nextqtd = NULL;
splx(s);
@@ -2478,7 +2479,7 @@ ehci_alloc_sqtd(ehci_softc_t *sc)
}
void
-ehci_free_sqtd(ehci_softc_t *sc, ehci_soft_qtd_t *sqtd)
+ehci_free_sqtd(struct ehci_softc *sc, struct ehci_soft_qtd *sqtd)
{
int s;
@@ -2489,15 +2490,16 @@ ehci_free_sqtd(ehci_softc_t *sc, ehci_soft_qtd_t *sqtd)
}
usbd_status
-ehci_alloc_sqtd_chain(struct ehci_pipe *epipe, ehci_softc_t *sc, u_int alen,
- int rd, usbd_xfer_handle xfer, ehci_soft_qtd_t **sp, ehci_soft_qtd_t **ep)
+ehci_alloc_sqtd_chain(struct ehci_pipe *epipe, struct ehci_softc *sc,
+ u_int alen, int rd, struct usbd_xfer *xfer, struct ehci_soft_qtd **sp,
+ struct ehci_soft_qtd **ep)
{
- ehci_soft_qtd_t *next, *cur;
+ struct ehci_soft_qtd *next, *cur;
ehci_physaddr_t dataphys, dataphyspage, dataphyslastpage, nextphys;
u_int32_t qtdstatus;
u_int len, curlen;
int mps, i, iscontrol, forceshort;
- usb_dma_t *dma = &xfer->dmabuf;
+ struct usb_dma *dma = &xfer->dmabuf;
DPRINTFN(alen<4*4096,("ehci_alloc_sqtd_chain: start len=%d\n", alen));
@@ -2636,10 +2638,10 @@ ehci_alloc_sqtd_chain(struct ehci_pipe *epipe, ehci_softc_t *sc, u_int alen,
}
void
-ehci_free_sqtd_chain(ehci_softc_t *sc, struct ehci_xfer *ex)
+ehci_free_sqtd_chain(struct ehci_softc *sc, struct ehci_xfer *ex)
{
struct ehci_pipe *epipe = (struct ehci_pipe *)ex->xfer.pipe;
- ehci_soft_qtd_t *sqtd, *next;
+ struct ehci_soft_qtd *sqtd, *next;
DPRINTFN(10,("ehci_free_sqtd_chain: sqtd=%p\n", ex->sqtdstart));
@@ -2651,13 +2653,13 @@ ehci_free_sqtd_chain(ehci_softc_t *sc, struct ehci_xfer *ex)
epipe->sqh->sqtd = NULL;
}
-ehci_soft_itd_t *
-ehci_alloc_itd(ehci_softc_t *sc)
+struct ehci_soft_itd *
+ehci_alloc_itd(struct ehci_softc *sc)
{
struct ehci_soft_itd *itd, *freeitd;
usbd_status err;
int i, s, offs, frindex, previndex;
- usb_dma_t dma;
+ struct usb_dma dma;
s = splusb();
@@ -2701,8 +2703,8 @@ ehci_alloc_itd(ehci_softc_t *sc)
itd = freeitd;
LIST_REMOVE(itd, u.free_list);
- memset(&itd->itd, 0, sizeof(ehci_itd_t));
- usb_syncmem(&itd->dma, itd->offs + offsetof(ehci_itd_t, itd_next),
+ memset(&itd->itd, 0, sizeof(struct ehci_itd));
+ usb_syncmem(&itd->dma, itd->offs + offsetof(struct ehci_itd, itd_next),
sizeof(itd->itd.itd_next), BUS_DMASYNC_PREWRITE |
BUS_DMASYNC_PREREAD);
@@ -2716,7 +2718,7 @@ ehci_alloc_itd(ehci_softc_t *sc)
}
void
-ehci_free_itd(ehci_softc_t *sc, ehci_soft_itd_t *itd)
+ehci_free_itd(struct ehci_softc *sc, struct ehci_soft_itd *itd)
{
int s;
@@ -2732,11 +2734,11 @@ ehci_free_itd(ehci_softc_t *sc, ehci_soft_itd_t *itd)
* Assumes that there are no pending transactions.
*/
void
-ehci_close_pipe(usbd_pipe_handle pipe)
+ehci_close_pipe(struct usbd_pipe *pipe)
{
struct ehci_pipe *epipe = (struct ehci_pipe *)pipe;
- ehci_softc_t *sc = (ehci_softc_t *)pipe->device->bus;
- ehci_soft_qh_t *sqh = epipe->sqh;
+ struct ehci_softc *sc = (struct ehci_softc *)pipe->device->bus;
+ struct ehci_soft_qh *sqh = epipe->sqh;
int s;
s = splusb();
@@ -2758,13 +2760,13 @@ ehci_close_pipe(usbd_pipe_handle pipe)
* interrupt processing to process it.
*/
void
-ehci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
+ehci_abort_xfer(struct usbd_xfer *xfer, usbd_status status)
{
#define exfer EXFER(xfer)
struct ehci_pipe *epipe = (struct ehci_pipe *)xfer->pipe;
- ehci_softc_t *sc = (ehci_softc_t *)epipe->pipe.device->bus;
- ehci_soft_qh_t *sqh = epipe->sqh;
- ehci_soft_qtd_t *sqtd;
+ struct ehci_softc *sc = (struct ehci_softc *)epipe->pipe.device->bus;
+ struct ehci_soft_qh *sqh = epipe->sqh;
+ struct ehci_soft_qtd *sqtd;
int s;
DPRINTF(("ehci_abort_xfer: xfer=%p pipe=%p\n", xfer, epipe));
@@ -2816,23 +2818,23 @@ ehci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
* otherwise the queue head may go active again.
*/
usb_syncmem(&sqh->dma,
- sqh->offs + offsetof(ehci_qh_t, qh_qtd.qtd_status),
+ sqh->offs + offsetof(struct ehci_qh, qh_qtd.qtd_status),
sizeof(sqh->qh.qh_qtd.qtd_status),
BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
sqh->qh.qh_qtd.qtd_status = htole32(EHCI_QTD_HALTED);
usb_syncmem(&sqh->dma,
- sqh->offs + offsetof(ehci_qh_t, qh_qtd.qtd_status),
+ sqh->offs + offsetof(struct ehci_qh, qh_qtd.qtd_status),
sizeof(sqh->qh.qh_qtd.qtd_status),
BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
for (sqtd = exfer->sqtdstart; sqtd != NULL; sqtd = sqtd->nextqtd) {
usb_syncmem(&sqtd->dma,
- sqtd->offs + offsetof(ehci_qtd_t, qtd_status),
+ sqtd->offs + offsetof(struct ehci_qtd, qtd_status),
sizeof(sqtd->qtd.qtd_status),
BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
sqtd->qtd.qtd_status = htole32(EHCI_QTD_HALTED);
usb_syncmem(&sqtd->dma,
- sqtd->offs + offsetof(ehci_qtd_t, qtd_status),
+ sqtd->offs + offsetof(struct ehci_qtd, qtd_status),
sizeof(sqtd->qtd.qtd_status),
BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
}
@@ -2865,18 +2867,18 @@ ehci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
}
void
-ehci_abort_isoc_xfer(usbd_xfer_handle xfer, usbd_status status)
+ehci_abort_isoc_xfer(struct usbd_xfer *xfer, usbd_status status)
{
ehci_isoc_trans_t trans_status;
struct ehci_pipe *epipe;
struct ehci_xfer *exfer;
- ehci_softc_t *sc;
+ struct ehci_softc *sc;
struct ehci_soft_itd *itd;
int s, i, wake;
epipe = (struct ehci_pipe *) xfer->pipe;
exfer = EXFER(xfer);
- sc = (ehci_softc_t *)epipe->pipe.device->bus;
+ sc = (struct ehci_softc *)epipe->pipe.device->bus;
DPRINTF(("ehci_abort_isoc_xfer: xfer %p pipe %p\n", xfer, epipe));
@@ -2942,7 +2944,7 @@ ehci_timeout(void *addr)
{
struct ehci_xfer *exfer = addr;
struct ehci_pipe *epipe = (struct ehci_pipe *)exfer->xfer.pipe;
- ehci_softc_t *sc = (ehci_softc_t *)epipe->pipe.device->bus;
+ struct ehci_softc *sc = (struct ehci_softc *)epipe->pipe.device->bus;
DPRINTF(("ehci_timeout: exfer=%p\n", exfer));
#if defined(EHCI_DEBUG) && defined(USB_DEBUG)
@@ -2962,7 +2964,7 @@ ehci_timeout(void *addr)
void
ehci_timeout_task(void *addr)
{
- usbd_xfer_handle xfer = addr;
+ struct usbd_xfer *xfer = addr;
int s;
DPRINTF(("ehci_timeout_task: xfer=%p\n", xfer));
@@ -2986,7 +2988,7 @@ ehci_timeout_task(void *addr)
void
ehci_intrlist_timeout(void *arg)
{
- ehci_softc_t *sc = arg;
+ struct ehci_softc *sc = arg;
int s;
if (sc->sc_bus.dying)
@@ -3001,7 +3003,7 @@ ehci_intrlist_timeout(void *arg)
/************************/
usbd_status
-ehci_device_ctrl_transfer(usbd_xfer_handle xfer)
+ehci_device_ctrl_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -3015,9 +3017,9 @@ ehci_device_ctrl_transfer(usbd_xfer_handle xfer)
}
usbd_status
-ehci_device_ctrl_start(usbd_xfer_handle xfer)
+ehci_device_ctrl_start(struct usbd_xfer *xfer)
{
- ehci_softc_t *sc = (ehci_softc_t *)xfer->pipe->device->bus;
+ struct ehci_softc *sc = (struct ehci_softc *)xfer->pipe->device->bus;
usbd_status err;
if (sc->sc_bus.dying)
@@ -3042,10 +3044,10 @@ ehci_device_ctrl_start(usbd_xfer_handle xfer)
}
void
-ehci_device_ctrl_done(usbd_xfer_handle xfer)
+ehci_device_ctrl_done(struct usbd_xfer *xfer)
{
struct ehci_xfer *ex = EXFER(xfer);
- ehci_softc_t *sc = (ehci_softc_t *)xfer->pipe->device->bus;
+ struct ehci_softc *sc = (struct ehci_softc *)xfer->pipe->device->bus;
/*struct ehci_pipe *epipe = (struct ehci_pipe *)xfer->pipe;*/
DPRINTFN(10,("ehci_ctrl_done: xfer=%p\n", xfer));
@@ -3066,7 +3068,7 @@ ehci_device_ctrl_done(usbd_xfer_handle xfer)
/* Abort a device control request. */
void
-ehci_device_ctrl_abort(usbd_xfer_handle xfer)
+ehci_device_ctrl_abort(struct usbd_xfer *xfer)
{
DPRINTF(("ehci_device_ctrl_abort: xfer=%p\n", xfer));
ehci_abort_xfer(xfer, USBD_CANCELLED);
@@ -3074,23 +3076,23 @@ ehci_device_ctrl_abort(usbd_xfer_handle xfer)
/* Close a device control pipe. */
void
-ehci_device_ctrl_close(usbd_pipe_handle pipe)
+ehci_device_ctrl_close(struct usbd_pipe *pipe)
{
DPRINTF(("ehci_device_ctrl_close: pipe=%p\n", pipe));
ehci_close_pipe(pipe);
}
usbd_status
-ehci_device_request(usbd_xfer_handle xfer)
+ehci_device_request(struct usbd_xfer *xfer)
{
#define exfer EXFER(xfer)
struct ehci_pipe *epipe = (struct ehci_pipe *)xfer->pipe;
usb_device_request_t *req = &xfer->request;
- usbd_device_handle dev = epipe->pipe.device;
- ehci_softc_t *sc = (ehci_softc_t *)dev->bus;
+ struct usbd_device *dev = epipe->pipe.device;
+ struct ehci_softc *sc = (struct ehci_softc *)dev->bus;
int addr = dev->address;
- ehci_soft_qtd_t *setup, *stat, *next;
- ehci_soft_qh_t *sqh;
+ struct ehci_soft_qtd *setup, *stat, *next;
+ struct ehci_soft_qh *sqh;
int isread;
u_int len;
usbd_status err;
@@ -3132,7 +3134,7 @@ ehci_device_request(usbd_xfer_handle xfer)
/* Set up data transaction */
if (len != 0) {
- ehci_soft_qtd_t *end;
+ struct ehci_soft_qtd *end;
err = ehci_alloc_sqtd_chain(epipe, sc, len, isread, xfer,
&next, &end);
@@ -3238,7 +3240,7 @@ ehci_device_request(usbd_xfer_handle xfer)
/************************/
usbd_status
-ehci_device_bulk_transfer(usbd_xfer_handle xfer)
+ehci_device_bulk_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -3252,14 +3254,14 @@ ehci_device_bulk_transfer(usbd_xfer_handle xfer)
}
usbd_status
-ehci_device_bulk_start(usbd_xfer_handle xfer)
+ehci_device_bulk_start(struct usbd_xfer *xfer)
{
#define exfer EXFER(xfer)
struct ehci_pipe *epipe = (struct ehci_pipe *)xfer->pipe;
- usbd_device_handle dev = epipe->pipe.device;
- ehci_softc_t *sc = (ehci_softc_t *)dev->bus;
- ehci_soft_qtd_t *data, *dataend;
- ehci_soft_qh_t *sqh;
+ struct usbd_device *dev = epipe->pipe.device;
+ struct ehci_softc *sc = (struct ehci_softc *)dev->bus;
+ struct ehci_soft_qtd *data, *dataend;
+ struct ehci_soft_qh *sqh;
usbd_status err;
u_int len;
int isread, endpt;
@@ -3345,7 +3347,7 @@ ehci_device_bulk_start(usbd_xfer_handle xfer)
}
void
-ehci_device_bulk_abort(usbd_xfer_handle xfer)
+ehci_device_bulk_abort(struct usbd_xfer *xfer)
{
DPRINTF(("ehci_device_bulk_abort: xfer=%p\n", xfer));
ehci_abort_xfer(xfer, USBD_CANCELLED);
@@ -3355,17 +3357,17 @@ ehci_device_bulk_abort(usbd_xfer_handle xfer)
* Close a device bulk pipe.
*/
void
-ehci_device_bulk_close(usbd_pipe_handle pipe)
+ehci_device_bulk_close(struct usbd_pipe *pipe)
{
DPRINTF(("ehci_device_bulk_close: pipe=%p\n", pipe));
ehci_close_pipe(pipe);
}
void
-ehci_device_bulk_done(usbd_xfer_handle xfer)
+ehci_device_bulk_done(struct usbd_xfer *xfer)
{
struct ehci_xfer *ex = EXFER(xfer);
- ehci_softc_t *sc = (ehci_softc_t *)xfer->pipe->device->bus;
+ struct ehci_softc *sc = (struct ehci_softc *)xfer->pipe->device->bus;
struct ehci_pipe *epipe = (struct ehci_pipe *)xfer->pipe;
int endpt = epipe->pipe.endpoint->edesc->bEndpointAddress;
int rd = UE_GET_DIR(endpt) == UE_DIR_IN;
@@ -3386,7 +3388,7 @@ ehci_device_bulk_done(usbd_xfer_handle xfer)
/************************/
usbd_status
-ehci_device_setintr(ehci_softc_t *sc, ehci_soft_qh_t *sqh, int ival)
+ehci_device_setintr(struct ehci_softc *sc, struct ehci_soft_qh *sqh, int ival)
{
struct ehci_soft_islot *isp;
int islot, lev;
@@ -3408,7 +3410,7 @@ ehci_device_setintr(ehci_softc_t *sc, ehci_soft_qh_t *sqh, int ival)
}
usbd_status
-ehci_device_intr_transfer(usbd_xfer_handle xfer)
+ehci_device_intr_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -3425,14 +3427,14 @@ ehci_device_intr_transfer(usbd_xfer_handle xfer)
}
usbd_status
-ehci_device_intr_start(usbd_xfer_handle xfer)
+ehci_device_intr_start(struct usbd_xfer *xfer)
{
#define exfer EXFER(xfer)
struct ehci_pipe *epipe = (struct ehci_pipe *)xfer->pipe;
- usbd_device_handle dev = xfer->pipe->device;
- ehci_softc_t *sc = (ehci_softc_t *)dev->bus;
- ehci_soft_qtd_t *data, *dataend;
- ehci_soft_qh_t *sqh;
+ struct usbd_device *dev = xfer->pipe->device;
+ struct ehci_softc *sc = (struct ehci_softc *)dev->bus;
+ struct ehci_soft_qtd *data, *dataend;
+ struct ehci_soft_qh *sqh;
usbd_status err;
u_int len;
int isread, endpt;
@@ -3513,7 +3515,7 @@ ehci_device_intr_start(usbd_xfer_handle xfer)
}
void
-ehci_device_intr_abort(usbd_xfer_handle xfer)
+ehci_device_intr_abort(struct usbd_xfer *xfer)
{
DPRINTFN(1, ("ehci_device_intr_abort: xfer=%p\n", xfer));
if (xfer->pipe->intrxfer == xfer) {
@@ -3529,21 +3531,21 @@ ehci_device_intr_abort(usbd_xfer_handle xfer)
}
void
-ehci_device_intr_close(usbd_pipe_handle pipe)
+ehci_device_intr_close(struct usbd_pipe *pipe)
{
DPRINTF(("ehci_device_intr_close: pipe=%p\n", pipe));
ehci_close_pipe(pipe);
}
void
-ehci_device_intr_done(usbd_xfer_handle xfer)
+ehci_device_intr_done(struct usbd_xfer *xfer)
{
#define exfer EXFER(xfer)
struct ehci_xfer *ex = EXFER(xfer);
- ehci_softc_t *sc = (ehci_softc_t *)xfer->pipe->device->bus;
+ struct ehci_softc *sc = (struct ehci_softc *)xfer->pipe->device->bus;
struct ehci_pipe *epipe = (struct ehci_pipe *)xfer->pipe;
- ehci_soft_qtd_t *data, *dataend;
- ehci_soft_qh_t *sqh;
+ struct ehci_soft_qtd *data, *dataend;
+ struct ehci_soft_qh *sqh;
usbd_status err;
u_int len;
int isread, endpt, s;
@@ -3605,7 +3607,7 @@ ehci_device_intr_done(usbd_xfer_handle xfer)
/************************/
usbd_status
-ehci_device_isoc_transfer(usbd_xfer_handle xfer)
+ehci_device_isoc_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -3617,13 +3619,13 @@ ehci_device_isoc_transfer(usbd_xfer_handle xfer)
}
usbd_status
-ehci_device_isoc_start(usbd_xfer_handle xfer)
+ehci_device_isoc_start(struct usbd_xfer *xfer)
{
struct ehci_pipe *epipe;
- ehci_softc_t *sc;
+ struct ehci_softc *sc;
struct ehci_xfer *exfer;
- ehci_soft_itd_t *itd, *prev, *start, *stop;
- usb_dma_t *dma_buf;
+ struct ehci_soft_itd *itd, *prev, *start, *stop;
+ struct usb_dma *dma_buf;
int i, j, k, frames, uframes, ufrperframe;
int s, trans_count, offs, total_length;
int frindex;
@@ -3634,7 +3636,7 @@ ehci_device_isoc_start(usbd_xfer_handle xfer)
trans_count = 0;
total_length = 0;
exfer = (struct ehci_xfer *) xfer;
- sc = (ehci_softc_t *)xfer->pipe->device->bus;
+ sc = (struct ehci_softc *)xfer->pipe->device->bus;
epipe = (struct ehci_pipe *)xfer->pipe;
/*
@@ -3883,28 +3885,28 @@ ehci_device_isoc_start(usbd_xfer_handle xfer)
}
void
-ehci_device_isoc_abort(usbd_xfer_handle xfer)
+ehci_device_isoc_abort(struct usbd_xfer *xfer)
{
DPRINTFN(1, ("ehci_device_isoc_abort: xfer = %p\n", xfer));
ehci_abort_isoc_xfer(xfer, USBD_CANCELLED);
}
void
-ehci_device_isoc_close(usbd_pipe_handle pipe)
+ehci_device_isoc_close(struct usbd_pipe *pipe)
{
DPRINTFN(1, ("ehci_device_isoc_close: nothing in the pipe to free?\n"));
}
void
-ehci_device_isoc_done(usbd_xfer_handle xfer)
+ehci_device_isoc_done(struct usbd_xfer *xfer)
{
struct ehci_xfer *exfer;
- ehci_softc_t *sc;
+ struct ehci_softc *sc;
struct ehci_pipe *epipe;
int s;
exfer = EXFER(xfer);
- sc = (ehci_softc_t *)xfer->pipe->device->bus;
+ sc = (struct ehci_softc *)xfer->pipe->device->bus;
epipe = (struct ehci_pipe *) xfer->pipe;
s = splusb();
diff --git a/sys/dev/usb/ehcireg.h b/sys/dev/usb/ehcireg.h
index 4e3ff662ecd..b182e139e2a 100644
--- a/sys/dev/usb/ehcireg.h
+++ b/sys/dev/usb/ehcireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehcireg.h,v 1.17 2011/11/02 19:19:47 eric Exp $ */
+/* $OpenBSD: ehcireg.h,v 1.18 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: ehcireg.h,v 1.17 2004/06/23 06:45:56 mycroft Exp $ */
/*
@@ -193,7 +193,7 @@ typedef u_int32_t ehci_isoc_bufr_ptr_t;
/* Isochronous Transfer Descriptor */
#define EHCI_ITD_NTRANS 8
#define EHCI_ITD_NBUFFERS 7
-typedef struct {
+struct ehci_itd {
volatile ehci_link_t itd_next;
volatile ehci_isoc_trans_t itd_ctl[8];
#define EHCI_ITD_GET_STATUS(x) (((x) >> 28) & 0xf)
@@ -225,12 +225,12 @@ typedef struct {
#define EHCI_ITD_GET_MULTI(x) ((x) & 0x3)
#define EHCI_ITD_SET_MULTI(x) ((x) & 0x3)
volatile ehci_isoc_bufr_ptr_t itd_bufr_hi[7];
-} ehci_itd_t;
+};
#define EHCI_ITD_ALIGN 32
/* Split Transaction Isochronous Transfer Descriptor */
#define EHCI_SITD_NBUFFERS 2
-typedef struct {
+struct ehci_sitd {
ehci_link_t sitd_next;
u_int32_t sitd_endp;
#define EHCI_SITD_GET_ADDR(x) (((x) >> 0) & 0x7f) /* endpoint addr */
@@ -278,12 +278,12 @@ typedef struct {
#define EHCI_SITD_TP_END 0x3
ehci_link_t sitd_back;
ehci_physaddr_t sitd_buffer_hi[EHCI_SITD_NBUFFERS]; /* 64bit */
-} ehci_sitd_t;
+};
#define EHCI_SITD_ALIGN 32
/* Queue Element Transfer Descriptor */
#define EHCI_QTD_NBUFFERS 5
-typedef struct {
+struct ehci_qtd {
ehci_link_t qtd_next;
ehci_link_t qtd_altnext;
u_int32_t qtd_status;
@@ -316,11 +316,11 @@ typedef struct {
#define EHCI_QTD_TOGGLE_MASK 0x80000000
ehci_physaddr_t qtd_buffer[EHCI_QTD_NBUFFERS];
ehci_physaddr_t qtd_buffer_hi[EHCI_QTD_NBUFFERS];
-} ehci_qtd_t;
+};
#define EHCI_QTD_ALIGN 32
/* Queue Head */
-typedef struct {
+struct ehci_qh {
ehci_link_t qh_link;
u_int32_t qh_endp;
#define EHCI_QH_GET_ADDR(x) (((x) >> 0) & 0x7f) /* endpoint addr */
@@ -358,15 +358,15 @@ typedef struct {
#define EHCI_QH_GET_MULT(x) (((x) >> 30) & 0x03) /* pipe multiplier */
#define EHCI_QH_SET_MULT(x) ((x) << 30)
ehci_link_t qh_curqtd;
- ehci_qtd_t qh_qtd;
-} ehci_qh_t;
+ struct ehci_qtd qh_qtd;
+};
#define EHCI_QH_ALIGN 32
/* Periodic Frame Span Traversal Node */
-typedef struct {
+struct ehci_fstn {
ehci_link_t fstn_link;
ehci_link_t fstn_back;
-} ehci_fstn_t;
+};
#define EHCI_FSTN_ALIGN 32
#endif /* _DEV_PCI_EHCIREG_H_ */
diff --git a/sys/dev/usb/ehcivar.h b/sys/dev/usb/ehcivar.h
index d3967570061..3dda56431ac 100644
--- a/sys/dev/usb/ehcivar.h
+++ b/sys/dev/usb/ehcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehcivar.h,v 1.24 2012/10/09 13:41:04 deraadt Exp $ */
+/* $OpenBSD: ehcivar.h,v 1.25 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: ehcivar.h,v 1.19 2005/04/29 15:04:29 augustss Exp $ */
/*
@@ -30,33 +30,33 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-typedef struct ehci_soft_qtd {
- ehci_qtd_t qtd;
+struct ehci_soft_qtd {
+ struct ehci_qtd qtd;
struct ehci_soft_qtd *nextqtd; /* mirrors nextqtd in TD */
ehci_physaddr_t physaddr;
- usb_dma_t dma; /* qTD's DMA infos */
- int offs; /* qTD's offset in usb_dma_t */
+ struct usb_dma dma; /* qTD's DMA infos */
+ int offs; /* qTD's offset in struct usb_dma */
LIST_ENTRY(ehci_soft_qtd) hnext;
u_int16_t len;
-} ehci_soft_qtd_t;
+};
#define EHCI_SQTD_SIZE ((sizeof (struct ehci_soft_qtd) + EHCI_QTD_ALIGN - 1) / EHCI_QTD_ALIGN * EHCI_QTD_ALIGN)
#define EHCI_SQTD_CHUNK (EHCI_PAGE_SIZE / EHCI_SQTD_SIZE)
-typedef struct ehci_soft_qh {
- ehci_qh_t qh;
+struct ehci_soft_qh {
+ struct ehci_qh qh;
struct ehci_soft_qh *next;
struct ehci_soft_qh *prev;
struct ehci_soft_qtd *sqtd;
ehci_physaddr_t physaddr;
- usb_dma_t dma; /* QH's DMA infos */
- int offs; /* QH's offset in usb_dma_t */
+ struct usb_dma dma; /* QH's DMA infos */
+ int offs; /* QH's offset in struct usb_dma */
int islot;
-} ehci_soft_qh_t;
+};
#define EHCI_SQH_SIZE ((sizeof (struct ehci_soft_qh) + EHCI_QH_ALIGN - 1) / EHCI_QH_ALIGN * EHCI_QH_ALIGN)
#define EHCI_SQH_CHUNK (EHCI_PAGE_SIZE / EHCI_SQH_SIZE)
-typedef struct ehci_soft_itd {
- ehci_itd_t itd;
+struct ehci_soft_itd {
+ struct ehci_itd itd;
union {
struct {
/* soft_itds links in a periodic frame*/
@@ -68,11 +68,11 @@ typedef struct ehci_soft_itd {
} u;
struct ehci_soft_itd *xfer_next; /* Next soft_itd in xfer */
ehci_physaddr_t physaddr;
- usb_dma_t dma;
+ struct usb_dma dma;
int offs;
int slot;
struct timeval t; /* store free time */
-} ehci_soft_itd_t;
+};
#define EHCI_ITD_SIZE ((sizeof(struct ehci_soft_itd) + EHCI_QH_ALIGN - 1) / EHCI_ITD_ALIGN * EHCI_ITD_ALIGN)
#define EHCI_ITD_CHUNK (EHCI_PAGE_SIZE / EHCI_ITD_SIZE)
@@ -80,10 +80,10 @@ struct ehci_xfer {
struct usbd_xfer xfer;
struct usb_task abort_task;
TAILQ_ENTRY(ehci_xfer) inext; /* list of active xfers */
- ehci_soft_qtd_t *sqtdstart;
- ehci_soft_qtd_t *sqtdend;
- ehci_soft_itd_t *itdstart;
- ehci_soft_itd_t *itdend;
+ struct ehci_soft_qtd *sqtdstart;
+ struct ehci_soft_qtd *sqtdend;
+ struct ehci_soft_itd *itdstart;
+ struct ehci_soft_itd *itdend;
u_int isoc_len;
u_int32_t ehci_xfer_flags;
#ifdef DIAGNOSTIC
@@ -97,7 +97,7 @@ struct ehci_xfer {
/* Information about an entry in the interrupt list. */
struct ehci_soft_islot {
- ehci_soft_qh_t *sqh; /* Queue Head. */
+ struct ehci_soft_qh *sqh; /* Queue Head. */
};
#define EHCI_FRAMELIST_MAXCOUNT 1024
@@ -113,7 +113,7 @@ struct ehci_soft_islot {
#define EHCI_FREE_LIST_INTERVAL 100
-typedef struct ehci_softc {
+struct ehci_softc {
struct usbd_bus sc_bus; /* base device */
bus_space_tag_t iot;
bus_space_handle_t ioh;
@@ -127,7 +127,7 @@ typedef struct ehci_softc {
u_int32_t sc_cmd; /* shadow of cmd reg during suspend */
- usb_dma_t sc_fldma;
+ struct usb_dma sc_fldma;
ehci_link_t *sc_flist;
u_int sc_flsize;
@@ -140,19 +140,19 @@ typedef struct ehci_softc {
TAILQ_HEAD(, ehci_xfer) sc_intrhead;
- ehci_soft_qh_t *sc_freeqhs;
- ehci_soft_qtd_t *sc_freeqtds;
+ struct ehci_soft_qh *sc_freeqhs;
+ struct ehci_soft_qtd *sc_freeqtds;
LIST_HEAD(sc_freeitds, ehci_soft_itd) sc_freeitds;
int sc_noport;
u_int8_t sc_addr; /* device address */
u_int8_t sc_conf; /* device configuration */
- usbd_xfer_handle sc_intrxfer;
+ struct usbd_xfer *sc_intrxfer;
char sc_isreset;
char sc_softwake;
u_int32_t sc_eintrs;
- ehci_soft_qh_t *sc_async_head;
+ struct ehci_soft_qh *sc_async_head;
SIMPLEQ_HEAD(, usbd_xfer) sc_free_xfers; /* free xfers */
@@ -161,7 +161,7 @@ typedef struct ehci_softc {
struct timeout sc_tmo_intrlist;
struct device *sc_child; /* /dev/usb# device */
-} ehci_softc_t;
+};
#define EREAD1(sc, a) bus_space_read_1((sc)->iot, (sc)->ioh, (a))
#define EREAD2(sc, a) bus_space_read_2((sc)->iot, (sc)->ioh, (a))
@@ -176,8 +176,8 @@ typedef struct ehci_softc {
#define EOWRITE2(sc, a, x) bus_space_write_2((sc)->iot, (sc)->ioh, (sc)->sc_offs+(a), (x))
#define EOWRITE4(sc, a, x) bus_space_write_4((sc)->iot, (sc)->ioh, (sc)->sc_offs+(a), (x))
-usbd_status ehci_init(ehci_softc_t *);
+usbd_status ehci_init(struct ehci_softc *);
int ehci_intr(void *);
-int ehci_detach(ehci_softc_t *, int);
+int ehci_detach(struct ehci_softc *, int);
int ehci_activate(struct device *, int);
void ehci_shutdown(void *);
diff --git a/sys/dev/usb/ezload.c b/sys/dev/usb/ezload.c
index 6cc6d7da422..84ee1efa03f 100644
--- a/sys/dev/usb/ezload.c
+++ b/sys/dev/usb/ezload.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ezload.c,v 1.11 2008/06/26 05:42:18 ray Exp $ */
+/* $OpenBSD: ezload.c,v 1.12 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: ezload.c,v 1.5 2002/07/11 21:14:25 augustss Exp $ */
/*
@@ -83,7 +83,7 @@ int ezloaddebug = 0;
#endif
usbd_status
-ezload_reset(usbd_device_handle dev, int reset)
+ezload_reset(struct usbd_device *dev, int reset)
{
usb_device_request_t req;
uByte rst;
@@ -100,7 +100,7 @@ ezload_reset(usbd_device_handle dev, int reset)
}
usbd_status
-ezload_download(usbd_device_handle dev, const char *name, const u_char *buf,
+ezload_download(struct usbd_device *dev, const char *name, const u_char *buf,
size_t buflen)
{
usb_device_request_t req;
@@ -145,7 +145,7 @@ ezload_download(usbd_device_handle dev, const char *name, const u_char *buf,
}
usbd_status
-ezload_downloads_and_reset(usbd_device_handle dev, char **names)
+ezload_downloads_and_reset(struct usbd_device *dev, char **names)
{
usbd_status err;
size_t buflen;
diff --git a/sys/dev/usb/ezload.h b/sys/dev/usb/ezload.h
index 8f2f48d9a54..a68aa3002cc 100644
--- a/sys/dev/usb/ezload.h
+++ b/sys/dev/usb/ezload.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ezload.h,v 1.4 2008/06/26 05:42:18 ray Exp $ */
+/* $OpenBSD: ezload.h,v 1.5 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: ezload.h,v 1.2 2001/01/18 20:28:23 jdolecek Exp $ */
/*
@@ -37,8 +37,8 @@ struct ezdata {
};
#ifdef _KERNEL
-usbd_status ezload_reset(usbd_device_handle, int);
-usbd_status ezload_download(usbd_device_handle, const char *name,
+usbd_status ezload_reset(struct usbd_device *, int);
+usbd_status ezload_download(struct usbd_device *, const char *name,
const u_char *buf, size_t buflen);
-usbd_status ezload_downloads_and_reset(usbd_device_handle, char **);
+usbd_status ezload_downloads_and_reset(struct usbd_device *, char **);
#endif
diff --git a/sys/dev/usb/if_athn_usb.c b/sys/dev/usb/if_athn_usb.c
index ff31dcc6e42..39e7add9a91 100644
--- a/sys/dev/usb/if_athn_usb.c
+++ b/sys/dev/usb/if_athn_usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_athn_usb.c,v 1.15 2013/04/12 12:58:39 mpi Exp $ */
+/* $OpenBSD: if_athn_usb.c,v 1.16 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2011 Damien Bergamini <damien.bergamini@free.fr>
@@ -119,7 +119,7 @@ int athn_usb_htc_msg(struct athn_usb_softc *, uint16_t, void *,
int athn_usb_htc_setup(struct athn_usb_softc *);
int athn_usb_htc_connect_svc(struct athn_usb_softc *, uint16_t,
uint8_t, uint8_t, uint8_t *);
-void athn_usb_wmieof(usbd_xfer_handle, usbd_private_handle,
+void athn_usb_wmieof(struct usbd_xfer *, void *,
usbd_status);
int athn_usb_wmi_xcmd(struct athn_usb_softc *, uint16_t, void *,
int, void *);
@@ -160,18 +160,18 @@ void athn_usb_set_key_cb(struct athn_usb_softc *, void *);
void athn_usb_delete_key(struct ieee80211com *,
struct ieee80211_node *, struct ieee80211_key *);
void athn_usb_delete_key_cb(struct athn_usb_softc *, void *);
-void athn_usb_bcneof(usbd_xfer_handle, usbd_private_handle,
+void athn_usb_bcneof(struct usbd_xfer *, void *,
usbd_status);
void athn_usb_swba(struct athn_usb_softc *);
void athn_usb_rx_wmi_ctrl(struct athn_usb_softc *, uint8_t *, int);
-void athn_usb_intr(usbd_xfer_handle, usbd_private_handle,
+void athn_usb_intr(struct usbd_xfer *, void *,
usbd_status);
void athn_usb_rx_radiotap(struct athn_softc *, struct mbuf *,
struct ar_rx_status *);
void athn_usb_rx_frame(struct athn_usb_softc *, struct mbuf *);
-void athn_usb_rxeof(usbd_xfer_handle, usbd_private_handle,
+void athn_usb_rxeof(struct usbd_xfer *, void *,
usbd_status);
-void athn_usb_txeof(usbd_xfer_handle, usbd_private_handle,
+void athn_usb_txeof(struct usbd_xfer *, void *,
usbd_status);
int athn_usb_tx(struct athn_softc *, struct mbuf *,
struct ieee80211_node *);
@@ -847,7 +847,7 @@ athn_usb_htc_connect_svc(struct athn_usb_softc *usc, uint16_t svc_id,
}
void
-athn_usb_wmieof(usbd_xfer_handle xfer, usbd_private_handle priv,
+athn_usb_wmieof(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct athn_usb_softc *usc = priv;
@@ -1401,7 +1401,7 @@ athn_usb_delete_key_cb(struct athn_usb_softc *usc, void *arg)
#ifndef IEEE80211_STA_ONLY
void
-athn_usb_bcneof(usbd_xfer_handle xfer, usbd_private_handle priv,
+athn_usb_bcneof(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct athn_usb_tx_data *data = priv;
@@ -1520,7 +1520,7 @@ athn_usb_rx_wmi_ctrl(struct athn_usb_softc *usc, uint8_t *buf, int len)
}
void
-athn_usb_intr(usbd_xfer_handle xfer, usbd_private_handle priv,
+athn_usb_intr(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct athn_usb_softc *usc = priv;
@@ -1734,7 +1734,7 @@ athn_usb_rx_frame(struct athn_usb_softc *usc, struct mbuf *m)
}
void
-athn_usb_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv,
+athn_usb_rxeof(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct athn_usb_rx_data *data = priv;
@@ -1842,7 +1842,7 @@ athn_usb_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv,
}
void
-athn_usb_txeof(usbd_xfer_handle xfer, usbd_private_handle priv,
+athn_usb_txeof(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct athn_usb_tx_data *data = priv;
diff --git a/sys/dev/usb/if_athn_usb.h b/sys/dev/usb/if_athn_usb.h
index c1bf5247f98..ccbd0633d9b 100644
--- a/sys/dev/usb/if_athn_usb.h
+++ b/sys/dev/usb/if_athn_usb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_athn_usb.h,v 1.3 2012/11/10 14:35:06 mikeb Exp $ */
+/* $OpenBSD: if_athn_usb.h,v 1.4 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2011 Damien Bergamini <damien.bergamini@free.fr>
@@ -376,13 +376,13 @@ struct athn_usb_rx_stream {
struct athn_usb_rx_data {
struct athn_usb_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
};
struct athn_usb_tx_data {
struct athn_usb_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
TAILQ_ENTRY(athn_usb_tx_data) next;
};
@@ -420,8 +420,8 @@ struct athn_usb_softc {
int sc_athn_attached;
/* USB specific goo. */
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
struct usb_task sc_task;
u_int flags;
@@ -429,10 +429,10 @@ struct athn_usb_softc {
struct athn_usb_rx_stream rx_stream;
- usbd_pipe_handle tx_data_pipe;
- usbd_pipe_handle rx_data_pipe;
- usbd_pipe_handle rx_intr_pipe;
- usbd_pipe_handle tx_intr_pipe;
+ struct usbd_pipe *tx_data_pipe;
+ struct usbd_pipe *rx_data_pipe;
+ struct usbd_pipe *rx_intr_pipe;
+ struct usbd_pipe *tx_intr_pipe;
uint8_t *ibuf;
struct ar_wmi_cmd_reg_write wbuf[AR_MAX_WRITE_COUNT];
diff --git a/sys/dev/usb/if_atu.c b/sys/dev/usb/if_atu.c
index be670b829ad..70591778acc 100644
--- a/sys/dev/usb/if_atu.c
+++ b/sys/dev/usb/if_atu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atu.c,v 1.102 2013/04/12 12:58:39 mpi Exp $ */
+/* $OpenBSD: if_atu.c,v 1.103 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 2003, 2004
* Daan Vreeken <Danovitsch@Vitsch.net>. All rights reserved.
@@ -251,8 +251,8 @@ struct atu_radfirm {
};
int atu_newbuf(struct atu_softc *, struct atu_chain *, struct mbuf *);
-void atu_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void atu_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void atu_rxeof(struct usbd_xfer *, void *, usbd_status);
+void atu_txeof(struct usbd_xfer *, void *, usbd_status);
void atu_start(struct ifnet *);
int atu_ioctl(struct ifnet *, u_long, caddr_t);
int atu_init(struct ifnet *);
@@ -302,7 +302,7 @@ atu_usb_request(struct atu_softc *sc, u_int8_t type,
u_int8_t *data)
{
usb_device_request_t req;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
usbd_status err;
int total_len = 0, s;
@@ -1258,7 +1258,7 @@ atu_attach(struct device *parent, struct device *self, void *aux)
struct atu_softc *sc = (struct atu_softc *)self;
struct usb_attach_arg *uaa = aux;
usbd_status err;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
u_int8_t mode, channel;
int i;
@@ -1648,7 +1648,7 @@ atu_xfer_list_free(struct atu_softc *sc, struct atu_chain *ch,
* the higher level protocols.
*/
void
-atu_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+atu_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct atu_chain *c = (struct atu_chain *)priv;
struct atu_softc *sc = c->atu_sc;
@@ -1786,7 +1786,7 @@ done:
* the list buffers.
*/
void
-atu_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+atu_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct atu_chain *c = (struct atu_chain *)priv;
struct atu_softc *sc = c->atu_sc;
diff --git a/sys/dev/usb/if_atureg.h b/sys/dev/usb/if_atureg.h
index a8d6c724873..23e15fadaa4 100644
--- a/sys/dev/usb/if_atureg.h
+++ b/sys/dev/usb/if_atureg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atureg.h,v 1.32 2010/12/06 04:41:39 jakemsr Exp $ */
+/* $OpenBSD: if_atureg.h,v 1.33 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 2003
* Daan Vreeken <Danovitsch@Vitsch.net>. All rights reserved.
@@ -107,7 +107,7 @@ struct atu_softc;
struct atu_chain {
struct atu_softc *atu_sc;
- usbd_xfer_handle atu_xfer;
+ struct usbd_xfer *atu_xfer;
char *atu_buf;
struct mbuf *atu_mbuf;
u_int8_t atu_idx;
@@ -179,11 +179,11 @@ struct atu_softc {
#define ATU_C_JOIN 2
struct usb_task sc_task;
- usbd_device_handle atu_udev;
- usbd_interface_handle atu_iface;
+ struct usbd_device *atu_udev;
+ struct usbd_interface *atu_iface;
struct ifmedia atu_media;
int atu_ed[ATU_ENDPT_MAX];
- usbd_pipe_handle atu_ep[ATU_ENDPT_MAX];
+ struct usbd_pipe *atu_ep[ATU_ENDPT_MAX];
int atu_unit;
int atu_if_flags;
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c
index 684f78f1ed9..c4badfb05c3 100644
--- a/sys/dev/usb/if_aue.c
+++ b/sys/dev/usb/if_aue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_aue.c,v 1.86 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: if_aue.c,v 1.87 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: if_aue.c,v 1.82 2003/03/05 17:37:36 shiba Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -231,9 +231,9 @@ int aue_tx_list_init(struct aue_softc *);
int aue_rx_list_init(struct aue_softc *);
int aue_newbuf(struct aue_softc *, struct aue_chain *, struct mbuf *);
int aue_send(struct aue_softc *, struct mbuf *, int);
-void aue_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void aue_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void aue_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void aue_intr(struct usbd_xfer *, void *, usbd_status);
+void aue_rxeof(struct usbd_xfer *, void *, usbd_status);
+void aue_txeof(struct usbd_xfer *, void *, usbd_status);
void aue_tick(void *);
void aue_tick_task(void *);
void aue_start(struct ifnet *);
@@ -717,8 +717,8 @@ aue_attach(struct device *parent, struct device *self, void *aux)
u_char eaddr[ETHER_ADDR_LEN];
struct ifnet *ifp;
struct mii_data *mii;
- usbd_device_handle dev = uaa->device;
- usbd_interface_handle iface;
+ struct usbd_device *dev = uaa->device;
+ struct usbd_interface *iface;
usbd_status err;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
@@ -997,7 +997,7 @@ aue_tx_list_init(struct aue_softc *sc)
}
void
-aue_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+aue_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct aue_softc *sc = priv;
struct ifnet *ifp = GET_IFP(sc);
@@ -1039,7 +1039,7 @@ aue_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
* the higher level protocols.
*/
void
-aue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+aue_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct aue_chain *c = priv;
struct aue_softc *sc = c->aue_sc;
@@ -1142,7 +1142,7 @@ aue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
*/
void
-aue_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+aue_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct aue_chain *c = priv;
struct aue_softc *sc = c->aue_sc;
diff --git a/sys/dev/usb/if_auereg.h b/sys/dev/usb/if_auereg.h
index ab5a0dc886a..e0a020c5e30 100644
--- a/sys/dev/usb/if_auereg.h
+++ b/sys/dev/usb/if_auereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_auereg.h,v 1.15 2010/12/06 04:41:39 jakemsr Exp $ */
+/* $OpenBSD: if_auereg.h,v 1.16 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: if_auereg.h,v 1.16 2001/10/10 02:14:17 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -208,7 +208,7 @@ struct aue_softc;
struct aue_chain {
struct aue_softc *aue_sc;
- usbd_xfer_handle aue_xfer;
+ struct usbd_xfer *aue_xfer;
char *aue_buf;
struct mbuf *aue_mbuf;
int aue_idx;
@@ -234,12 +234,12 @@ struct aue_softc {
struct timeout aue_stat_ch;
- usbd_device_handle aue_udev;
- usbd_interface_handle aue_iface;
+ struct usbd_device *aue_udev;
+ struct usbd_interface *aue_iface;
u_int16_t aue_vendor;
u_int16_t aue_product;
int aue_ed[AUE_ENDPT_MAX];
- usbd_pipe_handle aue_ep[AUE_ENDPT_MAX];
+ struct usbd_pipe *aue_ep[AUE_ENDPT_MAX];
u_int8_t aue_link;
int aue_if_flags;
struct aue_cdata aue_cdata;
diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c
index a66a7d31fdf..e013cc35f59 100644
--- a/sys/dev/usb/if_axe.c
+++ b/sys/dev/usb/if_axe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_axe.c,v 1.117 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: if_axe.c,v 1.118 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Jonathan Gray <jsg@openbsd.org>
@@ -200,8 +200,8 @@ int axe_tx_list_init(struct axe_softc *);
int axe_rx_list_init(struct axe_softc *);
struct mbuf *axe_newbuf(void);
int axe_encap(struct axe_softc *, struct mbuf *, int);
-void axe_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void axe_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void axe_rxeof(struct usbd_xfer *, void *, usbd_status);
+void axe_txeof(struct usbd_xfer *, void *, usbd_status);
void axe_tick(void *);
void axe_tick_task(void *);
void axe_start(struct ifnet *);
@@ -665,7 +665,7 @@ axe_attach(struct device *parent, struct device *self, void *aux)
{
struct axe_softc *sc = (struct axe_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
usbd_status err;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
@@ -986,7 +986,7 @@ axe_tx_list_init(struct axe_softc *sc)
* the higher level protocols.
*/
void
-axe_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+axe_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct axe_chain *c = (struct axe_chain *)priv;
struct axe_softc *sc = c->axe_sc;
@@ -1104,7 +1104,7 @@ done:
*/
void
-axe_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+axe_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct axe_softc *sc;
struct axe_chain *c;
diff --git a/sys/dev/usb/if_axereg.h b/sys/dev/usb/if_axereg.h
index 502d0ad4b21..84ea37a29b7 100644
--- a/sys/dev/usb/if_axereg.h
+++ b/sys/dev/usb/if_axereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_axereg.h,v 1.22 2012/11/10 18:46:21 brad Exp $ */
+/* $OpenBSD: if_axereg.h,v 1.23 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000-2003
@@ -190,7 +190,7 @@ struct axe_softc;
struct axe_chain {
struct axe_softc *axe_sc;
- usbd_xfer_handle axe_xfer;
+ struct usbd_xfer *axe_xfer;
char *axe_buf;
struct mbuf *axe_mbuf;
int axe_accum;
@@ -217,8 +217,8 @@ struct axe_softc {
struct arpcom arpcom;
#define GET_IFP(sc) (&(sc)->arpcom.ac_if)
struct mii_data axe_mii;
- usbd_device_handle axe_udev;
- usbd_interface_handle axe_iface;
+ struct usbd_device *axe_udev;
+ struct usbd_interface *axe_iface;
u_int16_t axe_vendor;
u_int16_t axe_product;
@@ -226,7 +226,7 @@ struct axe_softc {
u_int16_t axe_flags;
int axe_ed[AXE_ENDPT_MAX];
- usbd_pipe_handle axe_ep[AXE_ENDPT_MAX];
+ struct usbd_pipe *axe_ep[AXE_ENDPT_MAX];
int axe_unit;
struct axe_cdata axe_cdata;
struct timeout axe_stat_ch;
diff --git a/sys/dev/usb/if_cdce.c b/sys/dev/usb/if_cdce.c
index 6820c92bca8..d3def9a2c7b 100644
--- a/sys/dev/usb/if_cdce.c
+++ b/sys/dev/usb/if_cdce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cdce.c,v 1.52 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: if_cdce.c,v 1.53 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com>
@@ -84,14 +84,14 @@ int cdce_rx_list_init(struct cdce_softc *);
int cdce_newbuf(struct cdce_softc *, struct cdce_chain *,
struct mbuf *);
int cdce_encap(struct cdce_softc *, struct mbuf *, int);
-void cdce_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void cdce_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void cdce_rxeof(struct usbd_xfer *, void *, usbd_status);
+void cdce_txeof(struct usbd_xfer *, void *, usbd_status);
void cdce_start(struct ifnet *);
int cdce_ioctl(struct ifnet *, u_long, caddr_t);
void cdce_init(void *);
void cdce_watchdog(struct ifnet *);
void cdce_stop(struct cdce_softc *);
-void cdce_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void cdce_intr(struct usbd_xfer *, void *, usbd_status);
static uint32_t cdce_crc32(const void *, size_t);
const struct cdce_type cdce_devs[] = {
@@ -161,15 +161,15 @@ cdce_attach(struct device *parent, struct device *self, void *aux)
struct usb_attach_arg *uaa = aux;
int s;
struct ifnet *ifp;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
const struct cdce_type *t;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
- usb_cdc_union_descriptor_t *ud;
- usb_cdc_ethernet_descriptor_t *ethd;
+ struct usb_cdc_union_descriptor *ud;
+ struct usb_cdc_ethernet_descriptor *ethd;
usb_config_descriptor_t *cd;
const usb_descriptor_t *desc;
- usbd_desc_iter_t iter;
+ struct usbd_desc_iter iter;
usb_string_descriptor_t eaddr_str;
struct timeval now;
u_int32_t macaddr_lo;
@@ -198,7 +198,7 @@ cdce_attach(struct device *parent, struct device *self, void *aux)
}
switch(desc->bDescriptorSubtype) {
case UDESCSUB_CDC_UNION:
- ud = (usb_cdc_union_descriptor_t *)desc;
+ ud = (struct usb_cdc_union_descriptor *)desc;
if ((sc->cdce_flags & CDCE_SWAPUNION) == 0 &&
ud->bMasterInterface == ctl_ifcno)
data_ifcno = ud->bSlaveInterface[0];
@@ -212,7 +212,7 @@ cdce_attach(struct device *parent, struct device *self, void *aux)
printf("extra ethernet descriptor\n");
return;
}
- ethd = (usb_cdc_ethernet_descriptor_t *)desc;
+ ethd = (struct usb_cdc_ethernet_descriptor *)desc;
break;
}
desc = usb_desc_iter_next(&iter);
@@ -742,7 +742,7 @@ cdce_tx_list_init(struct cdce_softc *sc)
}
void
-cdce_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+cdce_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct cdce_chain *c = priv;
struct cdce_softc *sc = c->cdce_sc;
@@ -819,7 +819,7 @@ done:
}
void
-cdce_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+cdce_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct cdce_chain *c = priv;
struct cdce_softc *sc = c->cdce_sc;
@@ -881,11 +881,11 @@ cdce_activate(struct device *self, int act)
}
void
-cdce_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
+cdce_intr(struct usbd_xfer *xfer, void *addr, usbd_status status)
{
struct cdce_softc *sc = addr;
- usb_cdc_notification_t *buf = &sc->cdce_intr_buf;
- usb_cdc_connection_speed_t *speed;
+ struct usb_cdc_notification *buf = &sc->cdce_intr_buf;
+ struct usb_cdc_connection_speed *speed;
u_int32_t count;
if (status == USBD_CANCELLED)
@@ -907,7 +907,7 @@ cdce_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
UGETW(buf->wValue) ? "connected" : "disconnected"));
break;
case UCDC_N_CONNECTION_SPEED_CHANGE:
- speed = (usb_cdc_connection_speed_t *)&buf->data;
+ speed = (struct usb_cdc_connection_speed *)&buf->data;
DPRINTFN(1, ("cdce_intr: up=%d, down=%d\n",
UGETDW(speed->dwUSBitRate),
UGETDW(speed->dwDSBitRate)));
diff --git a/sys/dev/usb/if_cdcef.c b/sys/dev/usb/if_cdcef.c
index f8be8fa671e..1d590b3943f 100644
--- a/sys/dev/usb/if_cdcef.c
+++ b/sys/dev/usb/if_cdcef.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cdcef.c,v 1.27 2010/12/30 03:06:31 jakemsr Exp $ */
+/* $OpenBSD: if_cdcef.c,v 1.28 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 2007 Dale Rahn <drahn@openbsd.org>
@@ -61,14 +61,14 @@
struct cdcef_softc {
struct usbf_function sc_dev;
- usbf_config_handle sc_config;
- usbf_interface_handle sc_iface;
- usbf_endpoint_handle sc_ep_in;
- usbf_endpoint_handle sc_ep_out;
- usbf_pipe_handle sc_pipe_in;
- usbf_pipe_handle sc_pipe_out;
- usbf_xfer_handle sc_xfer_in;
- usbf_xfer_handle sc_xfer_out;
+ struct usbf_config *sc_config;
+ struct usbf_interface *sc_iface;
+ struct usbf_endpoint *sc_ep_in;
+ struct usbf_endpoint *sc_ep_out;
+ struct usbf_pipe *sc_pipe_in;
+ struct usbf_pipe *sc_pipe_out;
+ struct usbf_xfer *sc_xfer_in;
+ struct usbf_xfer *sc_xfer_out;
void *sc_buffer_in;
void *sc_buffer_out;
@@ -88,14 +88,14 @@ struct cdcef_softc {
int cdcef_match(struct device *, void *, void *);
void cdcef_attach(struct device *, struct device *, void *);
-usbf_status cdcef_do_request(usbf_function_handle,
+usbf_status cdcef_do_request(struct usbf_function *,
usb_device_request_t *, void **);
void cdcef_start(struct ifnet *);
-void cdcef_txeof(usbf_xfer_handle, usbf_private_handle,
+void cdcef_txeof(struct usbf_xfer *, void *,
usbf_status);
-void cdcef_rxeof(usbf_xfer_handle, usbf_private_handle,
+void cdcef_rxeof(struct usbf_xfer *, void *,
usbf_status);
int cdcef_ioctl(struct ifnet *ifp, u_long command, caddr_t data);
void cdcef_watchdog(struct ifnet *ifp);
@@ -143,10 +143,10 @@ cdcef_attach(struct device *parent, struct device *self, void *aux)
{
struct cdcef_softc *sc = (struct cdcef_softc *)self;
struct usbf_attach_arg *uaa = aux;
- usbf_device_handle dev = uaa->device;
+ struct usbf_device *dev = uaa->device;
struct ifnet *ifp;
usbf_status err;
- usb_cdc_union_descriptor_t udesc;
+ struct usb_cdc_union_descriptor udesc;
int s;
u_int16_t macaddr_hi;
@@ -267,7 +267,7 @@ cdcef_attach(struct device *parent, struct device *self, void *aux)
}
usbf_status
-cdcef_do_request(usbf_function_handle fun, usb_device_request_t *req,
+cdcef_do_request(struct usbf_function *fun, usb_device_request_t *req,
void **data)
{
printf("cdcef_do_request\n");
@@ -316,7 +316,7 @@ cdcef_start(struct ifnet *ifp)
}
void
-cdcef_txeof(usbf_xfer_handle xfer, usbf_private_handle priv,
+cdcef_txeof(struct usbf_xfer *xfer, void *priv,
usbf_status err)
{
struct cdcef_softc *sc = priv;
@@ -361,7 +361,7 @@ cdcef_start_timeout (void *v)
void
-cdcef_rxeof(usbf_xfer_handle xfer, usbf_private_handle priv,
+cdcef_rxeof(struct usbf_xfer *xfer, void *priv,
usbf_status status)
{
struct cdcef_softc *sc = priv;
diff --git a/sys/dev/usb/if_cdcereg.h b/sys/dev/usb/if_cdcereg.h
index a989943f022..c97474f4b27 100644
--- a/sys/dev/usb/if_cdcereg.h
+++ b/sys/dev/usb/if_cdcereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cdcereg.h,v 1.3 2007/07/23 16:41:15 mbalmer Exp $ */
+/* $OpenBSD: if_cdcereg.h,v 1.4 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com>
@@ -49,7 +49,7 @@ struct cdce_softc;
struct cdce_chain {
struct cdce_softc *cdce_sc;
- usbd_xfer_handle cdce_xfer;
+ struct usbd_xfer *cdce_xfer;
char *cdce_buf;
struct mbuf *cdce_mbuf;
int cdce_accum;
@@ -69,17 +69,17 @@ struct cdce_softc {
struct device cdce_dev;
struct arpcom cdce_arpcom;
#define GET_IFP(sc) (&(sc)->cdce_arpcom.ac_if)
- usbd_device_handle cdce_udev;
- usbd_interface_handle cdce_ctl_iface;
+ struct usbd_device *cdce_udev;
+ struct usbd_interface *cdce_ctl_iface;
int cdce_intr_no;
- usbd_pipe_handle cdce_intr_pipe;
- usb_cdc_notification_t cdce_intr_buf;
+ struct usbd_pipe *cdce_intr_pipe;
+ struct usb_cdc_notification cdce_intr_buf;
int cdce_intr_size;
- usbd_interface_handle cdce_data_iface;
+ struct usbd_interface *cdce_data_iface;
int cdce_bulkin_no;
- usbd_pipe_handle cdce_bulkin_pipe;
+ struct usbd_pipe *cdce_bulkin_pipe;
int cdce_bulkout_no;
- usbd_pipe_handle cdce_bulkout_pipe;
+ struct usbd_pipe *cdce_bulkout_pipe;
char cdce_dying;
int cdce_unit;
struct cdce_cdata cdce_cdata;
diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c
index a1eeda2e121..c0a6688d964 100644
--- a/sys/dev/usb/if_cue.c
+++ b/sys/dev/usb/if_cue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cue.c,v 1.60 2011/07/03 15:47:17 matthew Exp $ */
+/* $OpenBSD: if_cue.c,v 1.61 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: if_cue.c,v 1.40 2002/07/11 21:14:26 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -130,8 +130,8 @@ int cue_tx_list_init(struct cue_softc *);
int cue_rx_list_init(struct cue_softc *);
int cue_newbuf(struct cue_softc *, struct cue_chain *, struct mbuf *);
int cue_send(struct cue_softc *, struct mbuf *, int);
-void cue_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void cue_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void cue_rxeof(struct usbd_xfer *, void *, usbd_status);
+void cue_txeof(struct usbd_xfer *, void *, usbd_status);
void cue_tick(void *);
void cue_tick_task(void *);
void cue_start(struct ifnet *);
@@ -448,8 +448,8 @@ cue_attach(struct device *parent, struct device *self, void *aux)
struct usb_attach_arg *uaa = aux;
int s;
u_char eaddr[ETHER_ADDR_LEN];
- usbd_device_handle dev = uaa->device;
- usbd_interface_handle iface;
+ struct usbd_device *dev = uaa->device;
+ struct usbd_interface *iface;
usbd_status err;
struct ifnet *ifp;
usb_interface_descriptor_t *id;
@@ -699,7 +699,7 @@ cue_tx_list_init(struct cue_softc *sc)
* the higher level protocols.
*/
void
-cue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+cue_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct cue_chain *c = priv;
struct cue_softc *sc = c->cue_sc;
@@ -795,7 +795,7 @@ done:
* the list buffers.
*/
void
-cue_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+cue_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct cue_chain *c = priv;
struct cue_softc *sc = c->cue_sc;
diff --git a/sys/dev/usb/if_cuereg.h b/sys/dev/usb/if_cuereg.h
index 914f67db92d..ebb463ae222 100644
--- a/sys/dev/usb/if_cuereg.h
+++ b/sys/dev/usb/if_cuereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cuereg.h,v 1.11 2010/12/06 04:41:39 jakemsr Exp $ */
+/* $OpenBSD: if_cuereg.h,v 1.12 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: if_cuereg.h,v 1.14 2001/01/21 22:09:24 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -149,7 +149,7 @@ struct cue_softc;
struct cue_chain {
struct cue_softc *cue_sc;
- usbd_xfer_handle cue_xfer;
+ struct usbd_xfer *cue_xfer;
char *cue_buf;
struct mbuf *cue_mbuf;
int cue_idx;
@@ -172,12 +172,12 @@ struct cue_softc {
struct timeout cue_stat_ch;
- usbd_device_handle cue_udev;
- usbd_interface_handle cue_iface;
+ struct usbd_device *cue_udev;
+ struct usbd_interface *cue_iface;
u_int16_t cue_vendor;
u_int16_t cue_product;
int cue_ed[CUE_ENDPT_MAX];
- usbd_pipe_handle cue_ep[CUE_ENDPT_MAX];
+ struct usbd_pipe *cue_ep[CUE_ENDPT_MAX];
u_int8_t cue_mctab[CUE_MCAST_TABLE_LEN];
int cue_if_flags;
u_int16_t cue_rxfilt;
diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c
index 07bc5ba058e..039804d6d33 100644
--- a/sys/dev/usb/if_kue.c
+++ b/sys/dev/usb/if_kue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_kue.c,v 1.66 2013/04/10 07:46:24 mpi Exp $ */
+/* $OpenBSD: if_kue.c,v 1.67 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: if_kue.c,v 1.50 2002/07/16 22:00:31 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -174,8 +174,8 @@ int kue_rx_list_init(struct kue_softc *);
int kue_newbuf(struct kue_softc *, struct kue_chain *,struct mbuf *);
int kue_send(struct kue_softc *, struct mbuf *, int);
int kue_open_pipes(struct kue_softc *);
-void kue_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void kue_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void kue_rxeof(struct usbd_xfer *, void *, usbd_status);
+void kue_txeof(struct usbd_xfer *, void *, usbd_status);
void kue_start(struct ifnet *);
int kue_ioctl(struct ifnet *, u_long, caddr_t);
void kue_init(void *);
@@ -416,8 +416,8 @@ kue_attachhook(void *xsc)
struct kue_softc *sc = xsc;
int s;
struct ifnet *ifp;
- usbd_device_handle dev = sc->kue_udev;
- usbd_interface_handle iface;
+ struct usbd_device *dev = sc->kue_udev;
+ struct usbd_interface *iface;
usbd_status err;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
@@ -522,7 +522,7 @@ kue_attach(struct device *parent, struct device *self, void *aux)
{
struct kue_softc *sc = (struct kue_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
usbd_status err;
DPRINTFN(5,(" : kue_attach: sc=%p, dev=%p", sc, dev));
@@ -698,7 +698,7 @@ kue_tx_list_init(struct kue_softc *sc)
* the higher level protocols.
*/
void
-kue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+kue_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct kue_chain *c = priv;
struct kue_softc *sc = c->kue_sc;
@@ -801,7 +801,7 @@ kue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
*/
void
-kue_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+kue_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct kue_chain *c = priv;
struct kue_softc *sc = c->kue_sc;
diff --git a/sys/dev/usb/if_kuereg.h b/sys/dev/usb/if_kuereg.h
index e6cbe18b6d2..8e8b875f439 100644
--- a/sys/dev/usb/if_kuereg.h
+++ b/sys/dev/usb/if_kuereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_kuereg.h,v 1.9 2007/06/26 06:33:17 jsg Exp $ */
+/* $OpenBSD: if_kuereg.h,v 1.10 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: if_kuereg.h,v 1.11 2001/01/21 02:35:31 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -148,7 +148,7 @@ struct kue_softc;
struct kue_chain {
struct kue_softc *kue_sc;
- usbd_xfer_handle kue_xfer;
+ struct usbd_xfer *kue_xfer;
char *kue_buf;
struct mbuf *kue_mbuf;
int kue_idx;
@@ -169,13 +169,13 @@ struct kue_softc {
struct arpcom arpcom;
#define GET_IFP(sc) (&(sc)->arpcom.ac_if)
- usbd_device_handle kue_udev;
- usbd_interface_handle kue_iface;
+ struct usbd_device *kue_udev;
+ struct usbd_interface *kue_iface;
u_int16_t kue_vendor;
u_int16_t kue_product;
struct kue_ether_desc kue_desc;
int kue_ed[KUE_ENDPT_MAX];
- usbd_pipe_handle kue_ep[KUE_ENDPT_MAX];
+ struct usbd_pipe *kue_ep[KUE_ENDPT_MAX];
int kue_if_flags;
u_int16_t kue_rxfilt;
u_int8_t *kue_mcfilters;
diff --git a/sys/dev/usb/if_mos.c b/sys/dev/usb/if_mos.c
index 3cadf8a6e87..1b234f58591 100644
--- a/sys/dev/usb/if_mos.c
+++ b/sys/dev/usb/if_mos.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_mos.c,v 1.19 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: if_mos.c,v 1.20 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 2008 Johann Christian Rode <jcrode@gmx.net>
@@ -152,8 +152,8 @@ int mos_tx_list_init(struct mos_softc *);
int mos_rx_list_init(struct mos_softc *);
struct mbuf *mos_newbuf(void);
int mos_encap(struct mos_softc *, struct mbuf *, int);
-void mos_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void mos_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void mos_rxeof(struct usbd_xfer *, void *, usbd_status);
+void mos_txeof(struct usbd_xfer *, void *, usbd_status);
void mos_tick(void *);
void mos_tick_task(void *);
void mos_start(struct ifnet *);
@@ -628,7 +628,7 @@ mos_attach(struct device *parent, struct device *self, void *aux)
struct mos_softc *sc = (struct mos_softc *)self;
struct usb_attach_arg *uaa = aux;
struct ifnet *ifp;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
usbd_status err;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
@@ -912,7 +912,7 @@ mos_tx_list_init(struct mos_softc *sc)
* the higher level protocols.
*/
void
-mos_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+mos_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct mos_chain *c = (struct mos_chain *)priv;
struct mos_softc *sc = c->mos_sc;
@@ -1017,7 +1017,7 @@ done:
*/
void
-mos_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+mos_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct mos_softc *sc;
struct mos_chain *c;
diff --git a/sys/dev/usb/if_mosreg.h b/sys/dev/usb/if_mosreg.h
index 19f7205a3d3..2f5786b0e95 100644
--- a/sys/dev/usb/if_mosreg.h
+++ b/sys/dev/usb/if_mosreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_mosreg.h,v 1.6 2012/10/22 03:23:19 brad Exp $ */
+/* $OpenBSD: if_mosreg.h,v 1.7 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 2008 Johann Christian Rode <jcrode@gmx.net>
@@ -149,7 +149,7 @@ struct mos_softc;
struct mos_chain {
struct mos_softc *mos_sc;
- usbd_xfer_handle mos_xfer;
+ struct usbd_xfer *mos_xfer;
char *mos_buf;
struct mbuf *mos_mbuf;
int mos_accum;
@@ -171,13 +171,13 @@ struct mos_softc {
struct arpcom arpcom;
#define GET_IFP(sc) (&(sc)->arpcom.ac_if)
struct mii_data mos_mii;
- usbd_device_handle mos_udev;
- usbd_interface_handle mos_iface;
+ struct usbd_device *mos_udev;
+ struct usbd_interface *mos_iface;
u_int16_t mos_flags;
int mos_ed[MOS_ENDPT_MAX];
- usbd_pipe_handle mos_ep[MOS_ENDPT_MAX];
+ struct usbd_pipe *mos_ep[MOS_ENDPT_MAX];
int mos_unit;
struct mos_cdata mos_cdata;
struct timeout mos_stat_ch;
diff --git a/sys/dev/usb/if_otus.c b/sys/dev/usb/if_otus.c
index 368aa54ca0c..2a9326ec63b 100644
--- a/sys/dev/usb/if_otus.c
+++ b/sys/dev/usb/if_otus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_otus.c,v 1.33 2013/04/12 12:58:39 mpi Exp $ */
+/* $OpenBSD: if_otus.c,v 1.34 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -133,11 +133,11 @@ int otus_media_change(struct ifnet *);
int otus_read_eeprom(struct otus_softc *);
void otus_newassoc(struct ieee80211com *, struct ieee80211_node *,
int);
-void otus_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void otus_intr(struct usbd_xfer *, void *, usbd_status);
void otus_cmd_rxeof(struct otus_softc *, uint8_t *, int);
void otus_sub_rxeof(struct otus_softc *, uint8_t *, int);
-void otus_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void otus_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void otus_rxeof(struct usbd_xfer *, void *, usbd_status);
+void otus_txeof(struct usbd_xfer *, void *, usbd_status);
int otus_tx(struct otus_softc *, struct mbuf *,
struct ieee80211_node *);
void otus_start(struct ifnet *);
@@ -995,7 +995,7 @@ otus_newassoc(struct ieee80211com *ic, struct ieee80211_node *ni, int isnew)
/* ARGSUSED */
void
-otus_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+otus_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
#if 0
struct otus_softc *sc = priv;
@@ -1228,7 +1228,7 @@ otus_sub_rxeof(struct otus_softc *sc, uint8_t *buf, int len)
}
void
-otus_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+otus_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct otus_rx_data *data = priv;
struct otus_softc *sc = data->sc;
@@ -1274,7 +1274,7 @@ otus_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
}
void
-otus_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+otus_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct otus_tx_data *data = priv;
struct otus_softc *sc = data->sc;
diff --git a/sys/dev/usb/if_otusreg.h b/sys/dev/usb/if_otusreg.h
index f3547ba7635..a230991f7b0 100644
--- a/sys/dev/usb/if_otusreg.h
+++ b/sys/dev/usb/if_otusreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_otusreg.h,v 1.7 2009/05/11 18:06:25 damien Exp $ */
+/* $OpenBSD: if_otusreg.h,v 1.8 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -690,7 +690,7 @@ static const uint32_t ar5416_banks_vals_2ghz[] = {
#define AR5416_EEPROM_MODAL_SPURS 5
#define AR5416_MAX_CHAINS 2
-typedef struct BaseEepHeader {
+struct BaseEepHeader {
uint16_t length;
uint16_t checksum;
uint16_t version;
@@ -706,15 +706,15 @@ typedef struct BaseEepHeader {
uint32_t binBuildNumber;
uint8_t deviceType;
uint8_t futureBase[33];
-} __packed BASE_EEP_HEADER;
+} __packed;
-typedef struct spurChanStruct {
+struct spurChanStruct {
uint16_t spurChan;
uint8_t spurRangeLow;
uint8_t spurRangeHigh;
-} __packed SPUR_CHAN;
+} __packed;
-typedef struct ModalEepHeader {
+struct ModalEepHeader {
uint32_t antCtrlChain[AR5416_MAX_CHAINS];
uint32_t antCtrlCommon;
int8_t antennaGainCh[AR5416_MAX_CHAINS];
@@ -746,54 +746,54 @@ typedef struct ModalEepHeader {
uint8_t bswMargin[AR5416_MAX_CHAINS];
uint8_t swSettleHt40;
uint8_t futureModal[22];
- SPUR_CHAN spurChans[AR5416_EEPROM_MODAL_SPURS];
-} __packed MODAL_EEP_HEADER;
+ struct spurChanStruct spurChans[AR5416_EEPROM_MODAL_SPURS];
+} __packed;
-typedef struct calDataPerFreq {
+struct calDataPerFreq {
uint8_t pwrPdg[AR5416_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS];
uint8_t vpdPdg[AR5416_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS];
-} __packed CAL_DATA_PER_FREQ;
+} __packed;
-typedef struct CalTargetPowerLegacy {
+struct CalTargetPowerLegacy {
uint8_t bChannel;
uint8_t tPow2x[4];
-} __packed CAL_TARGET_POWER_LEG;
+} __packed;
-typedef struct CalTargetPowerHt {
+struct CalTargetPowerHt {
uint8_t bChannel;
uint8_t tPow2x[8];
-} __packed CAL_TARGET_POWER_HT;
+} __packed;
-typedef struct CalCtlEdges {
+struct CalCtlEdges {
uint8_t bChannel;
uint8_t tPowerFlag;
-} __packed CAL_CTL_EDGES;
+} __packed;
-typedef struct CalCtlData {
- CAL_CTL_EDGES ctlEdges[AR5416_MAX_CHAINS][AR5416_NUM_BAND_EDGES];
-} __packed CAL_CTL_DATA;
+struct CalCtlData {
+ struct CalCtlEdges ctlEdges[AR5416_MAX_CHAINS][AR5416_NUM_BAND_EDGES];
+} __packed;
-typedef struct ar5416eeprom {
- BASE_EEP_HEADER baseEepHeader;
+struct ar5416eeprom {
+ struct BaseEepHeader baseEepHeader;
uint8_t custData[64];
- MODAL_EEP_HEADER modalHeader[2];
+ struct ModalEepHeader modalHeader[2];
uint8_t calFreqPier5G[AR5416_NUM_5G_CAL_PIERS];
uint8_t calFreqPier2G[AR5416_NUM_2G_CAL_PIERS];
- CAL_DATA_PER_FREQ calPierData5G[AR5416_MAX_CHAINS]
+ struct calDataPerFreq calPierData5G[AR5416_MAX_CHAINS]
[AR5416_NUM_5G_CAL_PIERS];
- CAL_DATA_PER_FREQ calPierData2G[AR5416_MAX_CHAINS]
+ struct calDataPerFreq calPierData2G[AR5416_MAX_CHAINS]
[AR5416_NUM_2G_CAL_PIERS];
- CAL_TARGET_POWER_LEG calTPow5G[AR5416_NUM_5G_20_TARGET_POWERS];
- CAL_TARGET_POWER_HT calTPow5GHT20[AR5416_NUM_5G_20_TARGET_POWERS];
- CAL_TARGET_POWER_HT calTPow5GHT40[AR5416_NUM_5G_40_TARGET_POWERS];
- CAL_TARGET_POWER_LEG calTPowCck[AR5416_NUM_2G_CCK_TARGET_POWERS];
- CAL_TARGET_POWER_LEG calTPow2G[AR5416_NUM_2G_20_TARGET_POWERS];
- CAL_TARGET_POWER_HT calTPow2GHT20[AR5416_NUM_2G_20_TARGET_POWERS];
- CAL_TARGET_POWER_HT calTPow2GHT40[AR5416_NUM_2G_40_TARGET_POWERS];
+ struct CalTargetPowerLegacy calTPow5G[AR5416_NUM_5G_20_TARGET_POWERS];
+ struct CalTargetPowerHt calTPow5GHT20[AR5416_NUM_5G_20_TARGET_POWERS];
+ struct CalTargetPowerHt calTPow5GHT40[AR5416_NUM_5G_40_TARGET_POWERS];
+ struct CalTargetPowerLegacy calTPowCck[AR5416_NUM_2G_CCK_TARGET_POWERS];
+ struct CalTargetPowerLegacy calTPow2G[AR5416_NUM_2G_20_TARGET_POWERS];
+ struct CalTargetPowerHt calTPow2GHT20[AR5416_NUM_2G_20_TARGET_POWERS];
+ struct CalTargetPowerHt calTPow2GHT40[AR5416_NUM_2G_40_TARGET_POWERS];
uint8_t ctlIndex[AR5416_NUM_CTLS];
- CAL_CTL_DATA ctlData[AR5416_NUM_CTLS];
+ struct CalCtlData ctlData[AR5416_NUM_CTLS];
uint8_t padding;
-} __packed AR5416_EEPROM;
+} __packed;
#define OTUS_TX_DATA_LIST_COUNT 8
@@ -869,7 +869,7 @@ struct otus_tx_radiotap_header {
struct otus_softc;
struct otus_tx_cmd {
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
void *odata;
uint16_t token;
@@ -878,13 +878,13 @@ struct otus_tx_cmd {
struct otus_rx_data {
struct otus_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
};
struct otus_tx_data {
struct otus_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
};
@@ -924,18 +924,18 @@ struct otus_softc {
enum ieee80211_state, int);
void (*sc_led_newstate)(struct otus_softc *);
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
struct ar5416eeprom eeprom;
uint8_t capflags;
uint8_t rxmask;
uint8_t txmask;
- usbd_pipe_handle data_tx_pipe;
- usbd_pipe_handle data_rx_pipe;
- usbd_pipe_handle cmd_tx_pipe;
- usbd_pipe_handle cmd_rx_pipe;
+ struct usbd_pipe *data_tx_pipe;
+ struct usbd_pipe *data_rx_pipe;
+ struct usbd_pipe *cmd_tx_pipe;
+ struct usbd_pipe *cmd_rx_pipe;
uint8_t *ibuf;
int sc_if_flags;
diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c
index 7d14a32e800..d8becd379ae 100644
--- a/sys/dev/usb/if_ral.c
+++ b/sys/dev/usb/if_ral.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ral.c,v 1.122 2013/04/12 12:58:39 mpi Exp $ */
+/* $OpenBSD: if_ral.c,v 1.123 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2005, 2006
@@ -116,8 +116,8 @@ void ural_next_scan(void *);
void ural_task(void *);
int ural_newstate(struct ieee80211com *, enum ieee80211_state,
int);
-void ural_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void ural_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void ural_txeof(struct usbd_xfer *, void *, usbd_status);
+void ural_rxeof(struct usbd_xfer *, void *, usbd_status);
#if NBPFILTER > 0
uint8_t ural_rxrate(const struct ural_rx_desc *);
#endif
@@ -163,7 +163,7 @@ void ural_newassoc(struct ieee80211com *, struct ieee80211_node *,
int);
void ural_amrr_start(struct ural_softc *, struct ieee80211_node *);
void ural_amrr_timeout(void *);
-void ural_amrr_update(usbd_xfer_handle, usbd_private_handle,
+void ural_amrr_update(struct usbd_xfer *, void *,
usbd_status status);
static const struct {
@@ -675,7 +675,7 @@ ural_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
#define RAL_RXTX_TURNAROUND 5 /* us */
void
-ural_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+ural_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct ural_tx_data *data = priv;
struct ural_softc *sc = data->sc;
@@ -715,7 +715,7 @@ ural_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
}
void
-ural_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+ural_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct ural_rx_data *data = priv;
struct ural_softc *sc = data->sc;
@@ -998,7 +998,7 @@ int
ural_tx_bcn(struct ural_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
{
struct ural_tx_desc *desc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
usbd_status error;
uint8_t cmd = 0;
uint8_t *buf;
@@ -2197,7 +2197,7 @@ ural_amrr_timeout(void *arg)
}
void
-ural_amrr_update(usbd_xfer_handle xfer, usbd_private_handle priv,
+ural_amrr_update(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct ural_softc *sc = (struct ural_softc *)priv;
diff --git a/sys/dev/usb/if_ralvar.h b/sys/dev/usb/if_ralvar.h
index 51244ef37a1..2d6f3742526 100644
--- a/sys/dev/usb/if_ralvar.h
+++ b/sys/dev/usb/if_ralvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ralvar.h,v 1.9 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: if_ralvar.h,v 1.10 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2005
@@ -56,14 +56,14 @@ struct ural_softc;
struct ural_tx_data {
struct ural_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
struct ieee80211_node *ni;
};
struct ural_rx_data {
struct ural_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
struct mbuf *m;
};
@@ -74,8 +74,8 @@ struct ural_softc {
int (*sc_newstate)(struct ieee80211com *,
enum ieee80211_state, int);
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
int sc_rx_no;
int sc_tx_no;
@@ -84,10 +84,10 @@ struct ural_softc {
uint16_t macbbp_rev;
uint8_t rf_rev;
- usbd_xfer_handle amrr_xfer;
+ struct usbd_xfer *amrr_xfer;
- usbd_pipe_handle sc_rx_pipeh;
- usbd_pipe_handle sc_tx_pipeh;
+ struct usbd_pipe *sc_rx_pipeh;
+ struct usbd_pipe *sc_tx_pipeh;
enum ieee80211_state sc_state;
int sc_arg;
diff --git a/sys/dev/usb/if_rsu.c b/sys/dev/usb/if_rsu.c
index 367c948382b..c33ba01bc9e 100644
--- a/sys/dev/usb/if_rsu.c
+++ b/sys/dev/usb/if_rsu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rsu.c,v 1.16 2013/04/12 12:58:39 mpi Exp $ */
+/* $OpenBSD: if_rsu.c,v 1.17 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -176,8 +176,8 @@ void rsu_rx_multi_event(struct rsu_softc *, uint8_t *, int);
int8_t rsu_get_rssi(struct rsu_softc *, int, void *);
void rsu_rx_frame(struct rsu_softc *, uint8_t *, int);
void rsu_rx_multi_frame(struct rsu_softc *, uint8_t *, int);
-void rsu_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void rsu_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void rsu_rxeof(struct usbd_xfer *, void *, usbd_status);
+void rsu_txeof(struct usbd_xfer *, void *, usbd_status);
int rsu_tx(struct rsu_softc *, struct mbuf *,
struct ieee80211_node *);
int rsu_send_mgmt(struct ieee80211com *, struct ieee80211_node *,
@@ -743,7 +743,7 @@ rsu_fw_cmd(struct rsu_softc *sc, uint8_t code, void *buf, int len)
struct rsu_tx_data *data;
struct r92s_tx_desc *txd;
struct r92s_fw_cmd_hdr *cmd;
- usbd_pipe_handle pipe;
+ struct usbd_pipe *pipe;
int cmdsz, xferlen;
data = sc->fwcmd_data;
@@ -1445,7 +1445,7 @@ rsu_rx_multi_frame(struct rsu_softc *sc, uint8_t *buf, int len)
}
void
-rsu_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+rsu_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct rsu_rx_data *data = priv;
struct rsu_softc *sc = data->sc;
@@ -1481,7 +1481,7 @@ rsu_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
}
void
-rsu_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+rsu_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct rsu_tx_data *data = priv;
struct rsu_softc *sc = data->sc;
@@ -1519,7 +1519,7 @@ rsu_tx(struct rsu_softc *sc, struct mbuf *m, struct ieee80211_node *ni)
struct ieee80211_key *k = NULL;
struct rsu_tx_data *data;
struct r92s_tx_desc *txd;
- usbd_pipe_handle pipe;
+ struct usbd_pipe *pipe;
uint16_t qos;
uint8_t type, qid, tid = 0;
int hasqos, xferlen, error;
@@ -1996,7 +1996,7 @@ rsu_fw_loadsection(struct rsu_softc *sc, uint8_t *buf, int len)
{
struct rsu_tx_data *data;
struct r92s_tx_desc *txd;
- usbd_pipe_handle pipe;
+ struct usbd_pipe *pipe;
int mlen, error;
data = sc->fwcmd_data;
diff --git a/sys/dev/usb/if_rsureg.h b/sys/dev/usb/if_rsureg.h
index 47b77aca6fe..825558a3b93 100644
--- a/sys/dev/usb/if_rsureg.h
+++ b/sys/dev/usb/if_rsureg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rsureg.h,v 1.2 2010/12/12 14:03:41 damien Exp $ */
+/* $OpenBSD: if_rsureg.h,v 1.3 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -679,15 +679,15 @@ struct rsu_softc;
struct rsu_rx_data {
struct rsu_softc *sc;
- usbd_pipe_handle pipe;
- usbd_xfer_handle xfer;
+ struct usbd_pipe *pipe;
+ struct usbd_xfer *xfer;
uint8_t *buf;
};
struct rsu_tx_data {
struct rsu_softc *sc;
- usbd_pipe_handle pipe;
- usbd_xfer_handle xfer;
+ struct usbd_pipe *pipe;
+ struct usbd_xfer *xfer;
uint8_t *buf;
TAILQ_ENTRY(rsu_tx_data) next;
};
@@ -718,11 +718,11 @@ struct rsu_softc {
struct ieee80211com sc_ic;
int (*sc_newstate)(struct ieee80211com *,
enum ieee80211_state, int);
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
struct usb_task sc_task;
struct timeout calib_to;
- usbd_pipe_handle pipe[R92S_MAX_EP];
+ struct usbd_pipe *pipe[R92S_MAX_EP];
int npipes;
const uint8_t *qid2idx;
diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c
index 6d5b495dde4..e44999d88d9 100644
--- a/sys/dev/usb/if_rum.c
+++ b/sys/dev/usb/if_rum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rum.c,v 1.99 2011/10/26 17:31:54 jasper Exp $ */
+/* $OpenBSD: if_rum.c,v 1.100 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini@free.fr>
@@ -146,8 +146,8 @@ int rum_media_change(struct ifnet *);
void rum_next_scan(void *);
void rum_task(void *);
int rum_newstate(struct ieee80211com *, enum ieee80211_state, int);
-void rum_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void rum_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void rum_txeof(struct usbd_xfer *, void *, usbd_status);
+void rum_rxeof(struct usbd_xfer *, void *, usbd_status);
#if NBPFILTER > 0
uint8_t rum_rxrate(const struct rum_rx_desc *);
#endif
@@ -194,7 +194,7 @@ void rum_newassoc(struct ieee80211com *, struct ieee80211_node *,
int);
void rum_amrr_start(struct rum_softc *, struct ieee80211_node *);
void rum_amrr_timeout(void *);
-void rum_amrr_update(usbd_xfer_handle, usbd_private_handle,
+void rum_amrr_update(struct usbd_xfer *, void *,
usbd_status status);
static const struct {
@@ -748,7 +748,7 @@ rum_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
#define RUM_CTS_SIZE 14 /* 10 + 4(FCS) */
void
-rum_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+rum_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct rum_tx_data *data = priv;
struct rum_softc *sc = data->sc;
@@ -788,7 +788,7 @@ rum_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
}
void
-rum_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+rum_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct rum_rx_data *data = priv;
struct rum_softc *sc = data->sc;
@@ -2275,7 +2275,7 @@ rum_amrr_timeout(void *arg)
}
void
-rum_amrr_update(usbd_xfer_handle xfer, usbd_private_handle priv,
+rum_amrr_update(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct rum_softc *sc = (struct rum_softc *)priv;
diff --git a/sys/dev/usb/if_rumvar.h b/sys/dev/usb/if_rumvar.h
index 60332de99a7..4d3c996509c 100644
--- a/sys/dev/usb/if_rumvar.h
+++ b/sys/dev/usb/if_rumvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rumvar.h,v 1.8 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: if_rumvar.h,v 1.9 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2005, 2006 Damien Bergamini <damien.bergamini@free.fr>
@@ -56,14 +56,14 @@ struct rum_softc;
struct rum_tx_data {
struct rum_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
struct ieee80211_node *ni;
};
struct rum_rx_data {
struct rum_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
struct mbuf *m;
};
@@ -74,8 +74,8 @@ struct rum_softc {
int (*sc_newstate)(struct ieee80211com *,
enum ieee80211_state, int);
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
struct ieee80211_channel *sc_curchan;
@@ -86,10 +86,10 @@ struct rum_softc {
uint8_t rf_rev;
uint8_t rffreq;
- usbd_xfer_handle amrr_xfer;
+ struct usbd_xfer *amrr_xfer;
- usbd_pipe_handle sc_rx_pipeh;
- usbd_pipe_handle sc_tx_pipeh;
+ struct usbd_pipe *sc_rx_pipeh;
+ struct usbd_pipe *sc_tx_pipeh;
enum ieee80211_state sc_state;
int sc_arg;
diff --git a/sys/dev/usb/if_run.c b/sys/dev/usb/if_run.c
index dd9fcae2d20..b03d75936f8 100644
--- a/sys/dev/usb/if_run.c
+++ b/sys/dev/usb/if_run.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_run.c,v 1.91 2012/10/12 19:53:24 haesbaert Exp $ */
+/* $OpenBSD: if_run.c,v 1.92 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2008-2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -358,8 +358,8 @@ void run_calibrate_cb(struct run_softc *, void *);
void run_newassoc(struct ieee80211com *, struct ieee80211_node *,
int);
void run_rx_frame(struct run_softc *, uint8_t *, int);
-void run_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void run_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void run_rxeof(struct usbd_xfer *, void *, usbd_status);
+void run_txeof(struct usbd_xfer *, void *, usbd_status);
int run_tx(struct run_softc *, struct mbuf *,
struct ieee80211_node *);
void run_start(struct ifnet *);
@@ -2051,7 +2051,7 @@ run_rx_frame(struct run_softc *sc, uint8_t *buf, int dmalen)
}
void
-run_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+run_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct run_rx_data *data = priv;
struct run_softc *sc = data->sc;
@@ -2101,7 +2101,7 @@ skip: /* setup a new transfer */
}
void
-run_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+run_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct run_tx_data *data = priv;
struct run_softc *sc = data->sc;
diff --git a/sys/dev/usb/if_runvar.h b/sys/dev/usb/if_runvar.h
index 29ab534f5e2..34576e38958 100644
--- a/sys/dev/usb/if_runvar.h
+++ b/sys/dev/usb/if_runvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_runvar.h,v 1.8 2010/02/08 18:46:47 damien Exp $ */
+/* $OpenBSD: if_runvar.h,v 1.9 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2008,2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -77,20 +77,20 @@ struct run_softc;
struct run_tx_data {
struct run_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
uint8_t qid;
};
struct run_rx_data {
struct run_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
};
struct run_tx_ring {
struct run_tx_data data[RUN_TX_RING_COUNT];
- usbd_pipe_handle pipeh;
+ struct usbd_pipe *pipeh;
int cur;
int queued;
uint8_t pipe_no;
@@ -98,7 +98,7 @@ struct run_tx_ring {
struct run_rx_ring {
struct run_rx_data data[RUN_RX_RING_COUNT];
- usbd_pipe_handle pipeh;
+ struct usbd_pipe *pipeh;
uint8_t pipe_no;
};
@@ -139,8 +139,8 @@ struct run_softc {
int (*sc_srom_read)(struct run_softc *,
uint16_t, uint16_t *);
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
uint16_t mac_ver;
uint16_t mac_rev;
diff --git a/sys/dev/usb/if_smsc.c b/sys/dev/usb/if_smsc.c
index 3c52ecce080..5f6ae133ff2 100644
--- a/sys/dev/usb/if_smsc.c
+++ b/sys/dev/usb/if_smsc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_smsc.c,v 1.6 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: if_smsc.c,v 1.7 2013/04/15 09:23:01 mglocker Exp $ */
/* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
/*-
* Copyright (c) 2012
@@ -173,8 +173,8 @@ void smsc_unlock_mii(struct smsc_softc *sc);
int smsc_tx_list_init(struct smsc_softc *);
int smsc_rx_list_init(struct smsc_softc *);
int smsc_encap(struct smsc_softc *, struct mbuf *, int);
-void smsc_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void smsc_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void smsc_rxeof(struct usbd_xfer *, void *, usbd_status);
+void smsc_txeof(struct usbd_xfer *, void *, usbd_status);
int smsc_read_reg(struct smsc_softc *, uint32_t, uint32_t *);
int smsc_write_reg(struct smsc_softc *, uint32_t, uint32_t);
@@ -950,7 +950,7 @@ smsc_attach(struct device *parent, struct device *self, void *aux)
{
struct smsc_softc *sc = (struct smsc_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
struct mii_data *mii;
@@ -1182,7 +1182,7 @@ smsc_unlock_mii(struct smsc_softc *sc)
}
void
-smsc_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+smsc_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct smsc_chain *c = (struct smsc_chain *)priv;
struct smsc_softc *sc = c->sc_sc;
@@ -1291,7 +1291,7 @@ done:
}
void
-smsc_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+smsc_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct smsc_softc *sc;
struct smsc_chain *c;
diff --git a/sys/dev/usb/if_smscreg.h b/sys/dev/usb/if_smscreg.h
index 3a82b5fa151..a5ee3c6649b 100644
--- a/sys/dev/usb/if_smscreg.h
+++ b/sys/dev/usb/if_smscreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_smscreg.h,v 1.3 2012/11/10 18:48:22 brad Exp $ */
+/* $OpenBSD: if_smscreg.h,v 1.4 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2012
* Ben Gray <bgray@freebsd.org>.
@@ -251,7 +251,7 @@
struct smsc_chain {
struct smsc_softc *sc_sc;
- usbd_xfer_handle sc_xfer;
+ struct usbd_xfer *sc_xfer;
char *sc_buf;
struct mbuf *sc_mbuf;
int sc_accum;
@@ -269,11 +269,11 @@ struct smsc_cdata {
struct smsc_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
struct arpcom sc_ac;
struct mii_data sc_mii;
int sc_phyno;
- usbd_interface_handle sc_iface;
+ struct usbd_interface *sc_iface;
/*
* The following stores the settings in the mac control (MAC_CSR)
@@ -288,7 +288,7 @@ struct smsc_softc {
struct usb_task sc_stop_task;
int sc_ed[SMSC_ENDPT_MAX];
- usbd_pipe_handle sc_ep[SMSC_ENDPT_MAX];
+ struct usbd_pipe *sc_ep[SMSC_ENDPT_MAX];
struct rwlock sc_mii_lock;
diff --git a/sys/dev/usb/if_uath.c b/sys/dev/usb/if_uath.c
index be0659acb64..e345ab63174 100644
--- a/sys/dev/usb/if_uath.c
+++ b/sys/dev/usb/if_uath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_uath.c,v 1.53 2013/04/12 12:58:39 mpi Exp $ */
+/* $OpenBSD: if_uath.c,v 1.54 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2006
@@ -159,9 +159,9 @@ int uath_write_reg(struct uath_softc *, uint32_t, uint32_t);
int uath_write_multi(struct uath_softc *, uint32_t, const void *, int);
int uath_read_reg(struct uath_softc *, uint32_t, uint32_t *);
int uath_read_eeprom(struct uath_softc *, uint32_t, void *);
-void uath_cmd_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void uath_data_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void uath_data_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void uath_cmd_rxeof(struct usbd_xfer *, void *, usbd_status);
+void uath_data_rxeof(struct usbd_xfer *, void *, usbd_status);
+void uath_data_txeof(struct usbd_xfer *, void *, usbd_status);
int uath_tx_null(struct uath_softc *);
int uath_tx_data(struct uath_softc *, struct mbuf *,
struct ieee80211_node *);
@@ -1108,7 +1108,7 @@ uath_read_eeprom(struct uath_softc *sc, uint32_t reg, void *odata)
}
void
-uath_cmd_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv,
+uath_cmd_rxeof(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct uath_rx_cmd *cmd = priv;
@@ -1170,7 +1170,7 @@ uath_cmd_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv,
}
void
-uath_data_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv,
+uath_data_rxeof(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct uath_rx_data *data = priv;
@@ -1329,7 +1329,7 @@ uath_tx_null(struct uath_softc *sc)
}
void
-uath_data_txeof(usbd_xfer_handle xfer, usbd_private_handle priv,
+uath_data_txeof(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct uath_tx_data *data = priv;
@@ -2019,7 +2019,7 @@ uath_stop(struct ifnet *ifp, int disable)
int
uath_loadfirmware(struct uath_softc *sc, const u_char *fw, int len)
{
- usbd_xfer_handle ctlxfer, txxfer, rxxfer;
+ struct usbd_xfer *ctlxfer, *txxfer, *rxxfer;
struct uath_fwblock *txblock, *rxblock;
uint8_t *txdata;
int error = 0;
diff --git a/sys/dev/usb/if_uathvar.h b/sys/dev/usb/if_uathvar.h
index 5ae648c724c..85c04d0b512 100644
--- a/sys/dev/usb/if_uathvar.h
+++ b/sys/dev/usb/if_uathvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_uathvar.h,v 1.6 2007/09/11 19:53:58 damien Exp $ */
+/* $OpenBSD: if_uathvar.h,v 1.7 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2006
@@ -53,28 +53,28 @@ struct uath_tx_radiotap_header {
struct uath_tx_data {
struct uath_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
struct ieee80211_node *ni;
};
struct uath_rx_data {
struct uath_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
struct mbuf *m;
};
struct uath_tx_cmd {
struct uath_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
void *odata;
};
struct uath_rx_cmd {
struct uath_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
};
@@ -114,16 +114,16 @@ struct uath_softc {
int cmd_idx;
int tx_queued;
- usbd_device_handle sc_udev;
- usbd_device_handle sc_uhub;
+ struct usbd_device *sc_udev;
+ struct usbd_device *sc_uhub;
int sc_port;
- usbd_interface_handle sc_iface;
+ struct usbd_interface *sc_iface;
- usbd_pipe_handle data_tx_pipe;
- usbd_pipe_handle data_rx_pipe;
- usbd_pipe_handle cmd_tx_pipe;
- usbd_pipe_handle cmd_rx_pipe;
+ struct usbd_pipe *data_tx_pipe;
+ struct usbd_pipe *data_rx_pipe;
+ struct usbd_pipe *cmd_tx_pipe;
+ struct usbd_pipe *cmd_rx_pipe;
enum ieee80211_state sc_state;
int sc_arg;
diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c
index f46cb507792..e22bea89013 100644
--- a/sys/dev/usb/if_udav.c
+++ b/sys/dev/usb/if_udav.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_udav.c,v 1.61 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: if_udav.c,v 1.62 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: if_udav.c,v 1.3 2004/04/23 17:25:25 itojun Exp $ */
/* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */
/*
@@ -106,8 +106,8 @@ int udav_tx_list_init(struct udav_softc *);
int udav_newbuf(struct udav_softc *, struct udav_chain *, struct mbuf *);
void udav_start(struct ifnet *);
int udav_send(struct udav_softc *, struct mbuf *, int);
-void udav_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void udav_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void udav_txeof(struct usbd_xfer *, void *, usbd_status);
+void udav_rxeof(struct usbd_xfer *, void *, usbd_status);
void udav_tick(void *);
void udav_tick_task(void *);
int udav_ioctl(struct ifnet *, u_long, caddr_t);
@@ -189,8 +189,8 @@ udav_attach(struct device *parent, struct device *self, void *aux)
{
struct udav_softc *sc = (struct udav_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
- usbd_interface_handle iface;
+ struct usbd_device *dev = uaa->device;
+ struct usbd_interface *iface;
usbd_status err;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
@@ -1021,7 +1021,7 @@ udav_send(struct udav_softc *sc, struct mbuf *m, int idx)
}
void
-udav_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+udav_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct udav_chain *c = priv;
struct udav_softc *sc = c->udav_sc;
@@ -1068,7 +1068,7 @@ udav_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
}
void
-udav_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+udav_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct udav_chain *c = priv;
struct udav_softc *sc = c->udav_sc;
diff --git a/sys/dev/usb/if_udavreg.h b/sys/dev/usb/if_udavreg.h
index 40694c4233e..8105c237fd0 100644
--- a/sys/dev/usb/if_udavreg.h
+++ b/sys/dev/usb/if_udavreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_udavreg.h,v 1.12 2011/03/31 17:06:25 mk Exp $ */
+/* $OpenBSD: if_udavreg.h,v 1.13 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: if_udavreg.h,v 1.2 2003/09/04 15:17:39 tsutsui Exp $ */
/* $nabe: if_udavreg.h,v 1.2 2003/08/21 16:26:40 nabe Exp $ */
/*
@@ -140,7 +140,7 @@
struct udav_chain {
struct udav_softc *udav_sc;
- usbd_xfer_handle udav_xfer;
+ struct usbd_xfer *udav_xfer;
char *udav_buf;
struct mbuf *udav_mbuf;
int udav_idx;
@@ -161,17 +161,17 @@ struct udav_cdata {
struct udav_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
/* USB */
- usbd_interface_handle sc_ctl_iface;
+ struct usbd_interface *sc_ctl_iface;
/* int sc_ctl_iface_no; */
int sc_bulkin_no; /* bulk in endpoint */
int sc_bulkout_no; /* bulk out endpoint */
int sc_intrin_no; /* intr in endpoint */
- usbd_pipe_handle sc_pipe_rx;
- usbd_pipe_handle sc_pipe_tx;
- usbd_pipe_handle sc_pipe_intr;
+ struct usbd_pipe *sc_pipe_rx;
+ struct usbd_pipe *sc_pipe_tx;
+ struct usbd_pipe *sc_pipe_intr;
struct timeout sc_stat_ch;
u_int sc_rx_errs;
/* u_int sc_intr_errs; */
diff --git a/sys/dev/usb/if_upgt.c b/sys/dev/usb/if_upgt.c
index 83107bba766..d2f81200f0f 100644
--- a/sys/dev/usb/if_upgt.c
+++ b/sys/dev/usb/if_upgt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_upgt.c,v 1.56 2011/07/03 15:47:17 matthew Exp $ */
+/* $OpenBSD: if_upgt.c,v 1.57 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org>
@@ -120,7 +120,7 @@ void upgt_start(struct ifnet *);
void upgt_watchdog(struct ifnet *);
void upgt_tx_task(void *);
void upgt_tx_done(struct upgt_softc *, uint8_t *);
-void upgt_rx_cb(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void upgt_rx_cb(struct usbd_xfer *, void *, usbd_status);
void upgt_rx(struct upgt_softc *, uint8_t *, int);
void upgt_setup_rates(struct upgt_softc *);
uint8_t upgt_rx_rate(struct upgt_softc *, const int);
@@ -137,7 +137,7 @@ void upgt_free_tx(struct upgt_softc *);
void upgt_free_rx(struct upgt_softc *);
void upgt_free_cmd(struct upgt_softc *);
int upgt_bulk_xmit(struct upgt_softc *, struct upgt_data *,
- usbd_pipe_handle, uint32_t *, int);
+ struct usbd_pipe *, uint32_t *, int);
void upgt_hexdump(void *, int);
uint32_t upgt_crc32_le(const void *, size_t);
@@ -1669,7 +1669,7 @@ upgt_tx_done(struct upgt_softc *sc, uint8_t *data)
}
void
-upgt_rx_cb(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+upgt_rx_cb(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct upgt_data *data_rx = priv;
struct upgt_softc *sc = data_rx->sc;
@@ -2316,7 +2316,7 @@ upgt_free_cmd(struct upgt_softc *sc)
int
upgt_bulk_xmit(struct upgt_softc *sc, struct upgt_data *data,
- usbd_pipe_handle pipeh, uint32_t *size, int flags)
+ struct usbd_pipe *pipeh, uint32_t *size, int flags)
{
usbd_status status;
diff --git a/sys/dev/usb/if_upgtvar.h b/sys/dev/usb/if_upgtvar.h
index 2f444812dae..75ef28fd92b 100644
--- a/sys/dev/usb/if_upgtvar.h
+++ b/sys/dev/usb/if_upgtvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_upgtvar.h,v 1.16 2010/12/06 04:41:39 jakemsr Exp $ */
+/* $OpenBSD: if_upgtvar.h,v 1.17 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org>
@@ -76,7 +76,7 @@ struct upgt_tx_radiotap_header {
*/
struct upgt_data {
struct upgt_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
void *buf;
struct ieee80211_node *ni;
struct mbuf *m;
@@ -395,14 +395,14 @@ struct upgt_memory {
struct upgt_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
int sc_rx_no;
int sc_tx_no;
struct usb_task sc_task_newstate;
struct usb_task sc_task_tx;
- usbd_pipe_handle sc_rx_pipeh;
- usbd_pipe_handle sc_tx_pipeh;
+ struct usbd_pipe *sc_rx_pipeh;
+ struct usbd_pipe *sc_tx_pipeh;
struct upgt_data tx_data[UPGT_TX_COUNT];
struct upgt_data rx_data;
diff --git a/sys/dev/usb/if_upl.c b/sys/dev/usb/if_upl.c
index 03e0c3873ff..566734ac4d1 100644
--- a/sys/dev/usb/if_upl.c
+++ b/sys/dev/usb/if_upl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_upl.c,v 1.50 2013/02/07 13:35:18 mpi Exp $ */
+/* $OpenBSD: if_upl.c,v 1.51 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: if_upl.c,v 1.19 2002/07/11 21:14:26 augustss Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -108,7 +108,7 @@ struct upl_softc;
struct upl_chain {
struct upl_softc *upl_sc;
- usbd_xfer_handle upl_xfer;
+ struct usbd_xfer *upl_xfer;
char *upl_buf;
struct mbuf *upl_mbuf;
int upl_idx;
@@ -129,12 +129,12 @@ struct upl_softc {
struct ifnet sc_if;
struct timeout sc_stat_ch;
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
u_int16_t sc_vendor;
u_int16_t sc_product;
int sc_ed[UPL_ENDPT_MAX];
- usbd_pipe_handle sc_ep[UPL_ENDPT_MAX];
+ struct usbd_pipe *sc_ep[UPL_ENDPT_MAX];
struct upl_cdata sc_cdata;
uByte sc_ibuf;
@@ -185,9 +185,9 @@ int upl_tx_list_init(struct upl_softc *);
int upl_rx_list_init(struct upl_softc *);
int upl_newbuf(struct upl_softc *, struct upl_chain *, struct mbuf *);
int upl_send(struct upl_softc *, struct mbuf *, int);
-void upl_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void upl_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void upl_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void upl_intr(struct usbd_xfer *, void *, usbd_status);
+void upl_rxeof(struct usbd_xfer *, void *, usbd_status);
+void upl_txeof(struct usbd_xfer *, void *, usbd_status);
void upl_start(struct ifnet *);
int upl_ioctl(struct ifnet *, u_long, caddr_t);
void upl_init(void *);
@@ -218,8 +218,8 @@ upl_attach(struct device *parent, struct device *self, void *aux)
struct upl_softc *sc = (struct upl_softc *)self;
struct usb_attach_arg *uaa = aux;
int s;
- usbd_device_handle dev = uaa->device;
- usbd_interface_handle iface;
+ struct usbd_device *dev = uaa->device;
+ struct usbd_interface *iface;
usbd_status err;
struct ifnet *ifp;
usb_interface_descriptor_t *id;
@@ -455,7 +455,7 @@ upl_tx_list_init(struct upl_softc *sc)
* the higher level protocols.
*/
void
-upl_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+upl_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct upl_chain *c = priv;
struct upl_softc *sc = c->upl_sc;
@@ -544,7 +544,7 @@ upl_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
* the list buffers.
*/
void
-upl_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+upl_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct upl_chain *c = priv;
struct upl_softc *sc = c->upl_sc;
@@ -761,7 +761,7 @@ upl_openpipes(struct upl_softc *sc)
}
void
-upl_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+upl_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct upl_softc *sc = priv;
struct ifnet *ifp = &sc->sc_if;
diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c
index b2fa946b415..4a5c6c6e23a 100644
--- a/sys/dev/usb/if_url.c
+++ b/sys/dev/usb/if_url.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_url.c,v 1.65 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: if_url.c,v 1.66 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: if_url.c,v 1.6 2002/09/29 10:19:21 martin Exp $ */
/*
* Copyright (c) 2001, 2002
@@ -106,8 +106,8 @@ int url_tx_list_init(struct url_softc *);
int url_newbuf(struct url_softc *, struct url_chain *, struct mbuf *);
void url_start(struct ifnet *);
int url_send(struct url_softc *, struct mbuf *, int);
-void url_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void url_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void url_txeof(struct usbd_xfer *, void *, usbd_status);
+void url_rxeof(struct usbd_xfer *, void *, usbd_status);
void url_tick(void *);
void url_tick_task(void *);
int url_ioctl(struct ifnet *, u_long, caddr_t);
@@ -189,8 +189,8 @@ url_attach(struct device *parent, struct device *self, void *aux)
{
struct url_softc *sc = (struct url_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
- usbd_interface_handle iface;
+ struct usbd_device *dev = uaa->device;
+ struct usbd_interface *iface;
usbd_status err;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
@@ -889,7 +889,7 @@ url_send(struct url_softc *sc, struct mbuf *m, int idx)
}
void
-url_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+url_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct url_chain *c = priv;
struct url_softc *sc = c->url_sc;
@@ -936,7 +936,7 @@ url_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
}
void
-url_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+url_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct url_chain *c = priv;
struct url_softc *sc = c->url_sc;
diff --git a/sys/dev/usb/if_urlreg.h b/sys/dev/usb/if_urlreg.h
index 87cd7fa6e89..eefd88d783c 100644
--- a/sys/dev/usb/if_urlreg.h
+++ b/sys/dev/usb/if_urlreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urlreg.h,v 1.13 2010/12/06 04:41:39 jakemsr Exp $ */
+/* $OpenBSD: if_urlreg.h,v 1.14 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: if_urlreg.h,v 1.1 2002/03/28 21:09:11 ichiro Exp $ */
/*
* Copyright (c) 2001, 2002
@@ -130,7 +130,7 @@ typedef uWord url_rxhdr_t; /* Recive Header */
struct url_chain {
struct url_softc *url_sc;
- usbd_xfer_handle url_xfer;
+ struct usbd_xfer *url_xfer;
char *url_buf;
struct mbuf *url_mbuf;
int url_idx;
@@ -151,17 +151,17 @@ struct url_cdata {
struct url_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
/* USB */
- usbd_interface_handle sc_ctl_iface;
+ struct usbd_interface *sc_ctl_iface;
/* int sc_ctl_iface_no; */
int sc_bulkin_no; /* bulk in endpoint */
int sc_bulkout_no; /* bulk out endpoint */
int sc_intrin_no; /* intr in endpoint */
- usbd_pipe_handle sc_pipe_rx;
- usbd_pipe_handle sc_pipe_tx;
- usbd_pipe_handle sc_pipe_intr;
+ struct usbd_pipe *sc_pipe_rx;
+ struct usbd_pipe *sc_pipe_tx;
+ struct usbd_pipe *sc_pipe_intr;
struct timeout sc_stat_ch;
u_int sc_rx_errs;
/* u_int sc_intr_errs; */
diff --git a/sys/dev/usb/if_urndis.c b/sys/dev/usb/if_urndis.c
index 6df4108fd2a..fff202918f9 100644
--- a/sys/dev/usb/if_urndis.c
+++ b/sys/dev/usb/if_urndis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urndis.c,v 1.37 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: if_urndis.c,v 1.38 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 2010 Jonathan Armani <armani@openbsd.org>
@@ -74,8 +74,8 @@ void urndis_watchdog(struct ifnet *);
#endif
void urndis_start(struct ifnet *);
-void urndis_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void urndis_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void urndis_rxeof(struct usbd_xfer *, void *, usbd_status);
+void urndis_txeof(struct usbd_xfer *, void *, usbd_status);
int urndis_rx_list_init(struct urndis_softc *);
int urndis_tx_list_init(struct urndis_softc *);
@@ -1217,8 +1217,8 @@ urndis_start(struct ifnet *ifp)
}
void
-urndis_rxeof(usbd_xfer_handle xfer,
- usbd_private_handle priv,
+urndis_rxeof(struct usbd_xfer *xfer,
+ void *priv,
usbd_status status)
{
struct urndis_chain *c;
@@ -1259,8 +1259,8 @@ done:
}
void
-urndis_txeof(usbd_xfer_handle xfer,
- usbd_private_handle priv,
+urndis_txeof(struct usbd_xfer *xfer,
+ void *priv,
usbd_status status)
{
struct urndis_chain *c;
diff --git a/sys/dev/usb/if_urndisreg.h b/sys/dev/usb/if_urndisreg.h
index d1eae6808ba..608a89bdf49 100644
--- a/sys/dev/usb/if_urndisreg.h
+++ b/sys/dev/usb/if_urndisreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urndisreg.h,v 1.15 2012/06/20 10:51:27 fgsch Exp $ */
+/* $OpenBSD: if_urndisreg.h,v 1.16 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 2010 Jonathan Armani <armani@openbsd.org>
@@ -25,7 +25,7 @@
struct urndis_chain {
struct urndis_softc *sc_softc;
- usbd_xfer_handle sc_xfer;
+ struct usbd_xfer *sc_xfer;
char *sc_buf;
struct mbuf *sc_mbuf;
int sc_idx;
@@ -50,15 +50,15 @@ struct urndis_softc {
u_int32_t sc_filter;
/* USB goo */
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
int sc_ifaceno_ctl;
- usbd_interface_handle sc_iface_data;
+ struct usbd_interface *sc_iface_data;
struct timeval sc_rx_notice;
int sc_bulkin_no;
- usbd_pipe_handle sc_bulkin_pipe;
+ struct usbd_pipe *sc_bulkin_pipe;
int sc_bulkout_no;
- usbd_pipe_handle sc_bulkout_pipe;
+ struct usbd_pipe *sc_bulkout_pipe;
struct urndis_cdata sc_data;
};
diff --git a/sys/dev/usb/if_urtw.c b/sys/dev/usb/if_urtw.c
index 0d0917fc3d0..ea9c4474536 100644
--- a/sys/dev/usb/if_urtw.c
+++ b/sys/dev/usb/if_urtw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urtw.c,v 1.40 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: if_urtw.c,v 1.41 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2009 Martynas Venckus <martynas@openbsd.org>
@@ -483,13 +483,13 @@ int urtw_alloc_rx_data_list(struct urtw_softc *);
void urtw_free_rx_data_list(struct urtw_softc *);
int urtw_alloc_tx_data_list(struct urtw_softc *);
void urtw_free_tx_data_list(struct urtw_softc *);
-void urtw_rxeof(usbd_xfer_handle, usbd_private_handle,
+void urtw_rxeof(struct usbd_xfer *, void *,
usbd_status);
int urtw_tx_start(struct urtw_softc *,
struct ieee80211_node *, struct mbuf *, int);
-void urtw_txeof_low(usbd_xfer_handle, usbd_private_handle,
+void urtw_txeof_low(struct usbd_xfer *, void *,
usbd_status);
-void urtw_txeof_normal(usbd_xfer_handle, usbd_private_handle,
+void urtw_txeof_normal(struct usbd_xfer *, void *,
usbd_status);
void urtw_next_scan(void *);
void urtw_task(void *);
@@ -2566,7 +2566,7 @@ urtw_watchdog(struct ifnet *ifp)
}
void
-urtw_txeof_low(usbd_xfer_handle xfer, usbd_private_handle priv,
+urtw_txeof_low(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct urtw_tx_data *data = priv;
@@ -2605,7 +2605,7 @@ urtw_txeof_low(usbd_xfer_handle xfer, usbd_private_handle priv,
}
void
-urtw_txeof_normal(usbd_xfer_handle xfer, usbd_private_handle priv,
+urtw_txeof_normal(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct urtw_tx_data *data = priv;
@@ -3114,7 +3114,7 @@ urtw_isbmode(uint16_t rate)
}
void
-urtw_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+urtw_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct urtw_rx_data *data = priv;
struct urtw_softc *sc = data->sc;
diff --git a/sys/dev/usb/if_urtwn.c b/sys/dev/usb/if_urtwn.c
index 07ac8e557f2..7cbe765dea2 100644
--- a/sys/dev/usb/if_urtwn.c
+++ b/sys/dev/usb/if_urtwn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urtwn.c,v 1.24 2013/03/29 07:43:52 brad Exp $ */
+/* $OpenBSD: if_urtwn.c,v 1.25 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -187,9 +187,9 @@ void urtwn_delete_key_cb(struct urtwn_softc *, void *);
void urtwn_update_avgrssi(struct urtwn_softc *, int, int8_t);
int8_t urtwn_get_rssi(struct urtwn_softc *, int, void *);
void urtwn_rx_frame(struct urtwn_softc *, uint8_t *, int);
-void urtwn_rxeof(usbd_xfer_handle, usbd_private_handle,
+void urtwn_rxeof(struct usbd_xfer *, void *,
usbd_status);
-void urtwn_txeof(usbd_xfer_handle, usbd_private_handle,
+void urtwn_txeof(struct usbd_xfer *, void *,
usbd_status);
int urtwn_tx(struct urtwn_softc *, struct mbuf *,
struct ieee80211_node *);
@@ -1632,7 +1632,7 @@ urtwn_rx_frame(struct urtwn_softc *sc, uint8_t *buf, int pktlen)
}
void
-urtwn_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv,
+urtwn_rxeof(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct urtwn_rx_data *data = priv;
@@ -1698,7 +1698,7 @@ urtwn_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv,
}
void
-urtwn_txeof(usbd_xfer_handle xfer, usbd_private_handle priv,
+urtwn_txeof(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct urtwn_tx_data *data = priv;
@@ -1737,7 +1737,7 @@ urtwn_tx(struct urtwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni)
struct ieee80211_key *k = NULL;
struct urtwn_tx_data *data;
struct r92c_tx_desc *txd;
- usbd_pipe_handle pipe;
+ struct usbd_pipe *pipe;
uint16_t qos, sum;
uint8_t raid, type, tid, qid;
int i, hasqos, xferlen, error;
diff --git a/sys/dev/usb/if_urtwnreg.h b/sys/dev/usb/if_urtwnreg.h
index 45936c52c82..91c4f1bca85 100644
--- a/sys/dev/usb/if_urtwnreg.h
+++ b/sys/dev/usb/if_urtwnreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urtwnreg.h,v 1.3 2010/11/16 18:02:59 damien Exp $ */
+/* $OpenBSD: if_urtwnreg.h,v 1.4 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -1045,14 +1045,14 @@ struct urtwn_softc;
struct urtwn_rx_data {
struct urtwn_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
};
struct urtwn_tx_data {
struct urtwn_softc *sc;
- usbd_pipe_handle pipe;
- usbd_xfer_handle xfer;
+ struct usbd_pipe *pipe;
+ struct usbd_xfer *xfer;
uint8_t *buf;
TAILQ_ENTRY(urtwn_tx_data) next;
};
@@ -1084,13 +1084,13 @@ struct urtwn_softc {
struct ieee80211com sc_ic;
int (*sc_newstate)(struct ieee80211com *,
enum ieee80211_state, int);
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
struct usb_task sc_task;
struct timeout scan_to;
struct timeout calib_to;
- usbd_pipe_handle rx_pipe;
- usbd_pipe_handle tx_pipe[R92C_MAX_EPOUT];
+ struct usbd_pipe *rx_pipe;
+ struct usbd_pipe *tx_pipe[R92C_MAX_EPOUT];
int ac2idx[EDCA_NUM_AC];
u_int sc_flags;
#define URTWN_FLAG_CCK_HIPWR 0x01
diff --git a/sys/dev/usb/if_urtwreg.h b/sys/dev/usb/if_urtwreg.h
index 1d67a95604e..53a301689fc 100644
--- a/sys/dev/usb/if_urtwreg.h
+++ b/sys/dev/usb/if_urtwreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urtwreg.h,v 1.13 2010/08/27 17:08:01 jsg Exp $ */
+/* $OpenBSD: if_urtwreg.h,v 1.14 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2009 Martynas Venckus <martynas@openbsd.org>
@@ -260,14 +260,14 @@
struct urtw_tx_data {
struct urtw_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
struct ieee80211_node *ni;
};
struct urtw_rx_data {
struct urtw_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
struct mbuf *m;
};
@@ -327,8 +327,8 @@ struct urtw_softc {
struct urtw_rf sc_rf;
struct usb_task sc_task;
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
enum ieee80211_state sc_state;
int sc_arg;
@@ -356,9 +356,9 @@ struct urtw_softc {
uint8_t sc_gpio_blinktime;
uint8_t sc_gpio_blinkstate;
/* RX/TX */
- usbd_pipe_handle sc_rxpipe;
- usbd_pipe_handle sc_txpipe_low;
- usbd_pipe_handle sc_txpipe_normal;
+ struct usbd_pipe *sc_rxpipe;
+ struct usbd_pipe *sc_txpipe_low;
+ struct usbd_pipe *sc_txpipe_normal;
#define URTW_PRIORITY_LOW 0
#define URTW_PRIORITY_NORMAL 1
#define URTW_DATA_TIMEOUT 10000 /* 10 sec */
diff --git a/sys/dev/usb/if_wi_usb.c b/sys/dev/usb/if_wi_usb.c
index 09a63c6f666..6674122dd99 100644
--- a/sys/dev/usb/if_wi_usb.c
+++ b/sys/dev/usb/if_wi_usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_usb.c,v 1.56 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: if_wi_usb.c,v 1.57 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 2003 Dale Rahn. All rights reserved.
@@ -80,13 +80,13 @@
int wi_usb_do_transmit_sync(struct wi_usb_softc *wsc, struct wi_usb_chain *c,
void *ident);
-void wi_usb_txeof(usbd_xfer_handle xfer, usbd_private_handle priv,
+void wi_usb_txeof(struct usbd_xfer *xfer, void *priv,
usbd_status status);
-void wi_usb_txeof_frm(usbd_xfer_handle xfer, usbd_private_handle priv,
+void wi_usb_txeof_frm(struct usbd_xfer *xfer, void *priv,
usbd_status status);
-void wi_usb_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv,
+void wi_usb_rxeof(struct usbd_xfer *xfer, void *priv,
usbd_status status);
-void wi_usb_intr(usbd_xfer_handle xfer, usbd_private_handle priv,
+void wi_usb_intr(struct usbd_xfer *xfer, void *priv,
usbd_status status);
void wi_usb_stop(struct wi_usb_softc *usc);
int wi_usb_tx_list_init(struct wi_usb_softc *usc);
@@ -139,12 +139,12 @@ struct wi_usb_softc {
struct timeout wi_usb_stat_ch;
- usbd_device_handle wi_usb_udev;
- usbd_interface_handle wi_usb_iface;
+ struct usbd_device *wi_usb_udev;
+ struct usbd_interface *wi_usb_iface;
u_int16_t wi_usb_vendor;
u_int16_t wi_usb_product;
int wi_usb_ed[WI_USB_ENDPT_MAX];
- usbd_pipe_handle wi_usb_ep[WI_USB_ENDPT_MAX];
+ struct usbd_pipe *wi_usb_ep[WI_USB_ENDPT_MAX];
struct wi_usb_chain wi_usb_tx_chain[WI_USB_TX_LIST_CNT];
struct wi_usb_chain wi_usb_rx_chain[WI_USB_RX_LIST_CNT];
@@ -302,8 +302,8 @@ wi_usb_attach(struct device *parent, struct device *self, void *aux)
struct wi_usb_softc *sc = (struct wi_usb_softc *)self;
struct usb_attach_arg *uaa = aux;
/* int s; */
- usbd_device_handle dev = uaa->device;
- usbd_interface_handle iface;
+ struct usbd_device *dev = uaa->device;
+ struct usbd_interface *iface;
usbd_status err;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
@@ -1089,7 +1089,7 @@ done:
*/
void
-wi_usb_txeof(usbd_xfer_handle xfer, usbd_private_handle priv,
+wi_usb_txeof(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct wi_usb_chain *c = priv;
@@ -1132,7 +1132,7 @@ wi_usb_txeof(usbd_xfer_handle xfer, usbd_private_handle priv,
*/
void
-wi_usb_txeof_frm(usbd_xfer_handle xfer, usbd_private_handle priv,
+wi_usb_txeof_frm(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct wi_usb_chain *c = priv;
@@ -1367,7 +1367,7 @@ wi_dump_data(void *buffer, int len)
* A frame has been received.
*/
void
-wi_usb_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+wi_usb_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct wi_usb_chain *c = priv;
struct wi_usb_softc *sc = c->wi_usb_sc;
@@ -1490,7 +1490,7 @@ wi_usb_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status
}
void
-wi_usb_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+wi_usb_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct wi_usb_softc *sc = priv;
diff --git a/sys/dev/usb/if_zyd.c b/sys/dev/usb/if_zyd.c
index 587d45428f0..cfaf635a1a1 100644
--- a/sys/dev/usb/if_zyd.c
+++ b/sys/dev/usb/if_zyd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_zyd.c,v 1.89 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: if_zyd.c,v 1.90 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2006 by Damien Bergamini <damien.bergamini@free.fr>
@@ -231,10 +231,10 @@ int zyd_set_rxfilter(struct zyd_softc *);
void zyd_set_chan(struct zyd_softc *, struct ieee80211_channel *);
int zyd_set_beacon_interval(struct zyd_softc *, int);
uint8_t zyd_plcp_signal(int);
-void zyd_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void zyd_intr(struct usbd_xfer *, void *, usbd_status);
void zyd_rx_data(struct zyd_softc *, const uint8_t *, uint16_t);
-void zyd_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void zyd_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void zyd_rxeof(struct usbd_xfer *, void *, usbd_status);
+void zyd_txeof(struct usbd_xfer *, void *, usbd_status);
int zyd_tx(struct zyd_softc *, struct mbuf *,
struct ieee80211_node *);
void zyd_start(struct ifnet *);
@@ -767,7 +767,7 @@ int
zyd_cmd(struct zyd_softc *sc, uint16_t code, const void *idata, int ilen,
void *odata, int olen, u_int flags)
{
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
struct zyd_cmd cmd;
uint16_t xferflags;
usbd_status error;
@@ -1821,7 +1821,7 @@ zyd_plcp_signal(int rate)
}
void
-zyd_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+zyd_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct zyd_softc *sc = (struct zyd_softc *)priv;
const struct zyd_cmd *cmd;
@@ -1984,7 +1984,7 @@ zyd_rx_data(struct zyd_softc *sc, const uint8_t *buf, uint16_t len)
}
void
-zyd_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+zyd_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct zyd_rx_data *data = priv;
struct zyd_softc *sc = data->sc;
@@ -2043,7 +2043,7 @@ skip: /* setup a new transfer */
}
void
-zyd_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+zyd_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct zyd_tx_data *data = priv;
struct zyd_softc *sc = data->sc;
diff --git a/sys/dev/usb/if_zydreg.h b/sys/dev/usb/if_zydreg.h
index c858a224248..e2eff309211 100644
--- a/sys/dev/usb/if_zydreg.h
+++ b/sys/dev/usb/if_zydreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_zydreg.h,v 1.25 2010/11/19 21:12:14 miod Exp $ */
+/* $OpenBSD: if_zydreg.h,v 1.26 2013/04/15 09:23:01 mglocker Exp $ */
/*-
* Copyright (c) 2006 by Damien Bergamini <damien.bergamini@free.fr>
@@ -1116,14 +1116,14 @@ struct zyd_mac_pair {
struct zyd_tx_data {
struct zyd_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
struct ieee80211_node *ni;
};
struct zyd_rx_data {
struct zyd_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
const uint8_t *buf;
};
@@ -1181,8 +1181,8 @@ struct zyd_softc {
struct zyd_rf sc_rf;
struct usb_task sc_task;
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
enum ieee80211_state sc_state;
int sc_arg;
@@ -1216,7 +1216,7 @@ struct zyd_softc {
#define ZYD_ENDPT_IIN 2
#define ZYD_ENDPT_IOUT 3
#define ZYD_ENDPT_CNT 4
- usbd_pipe_handle zyd_ep[ZYD_ENDPT_CNT];
+ struct usbd_pipe *zyd_ep[ZYD_ENDPT_CNT];
uint8_t *ibuf;
struct zyd_rx_data rx_data[ZYD_RX_LIST_CNT];
diff --git a/sys/dev/usb/moscom.c b/sys/dev/usb/moscom.c
index b6fca780819..df072b619e9 100644
--- a/sys/dev/usb/moscom.c
+++ b/sys/dev/usb/moscom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: moscom.c,v 1.16 2011/07/03 15:47:17 matthew Exp $ */
+/* $OpenBSD: moscom.c,v 1.17 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -134,8 +134,8 @@
struct moscom_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
struct device *sc_subdev;
u_char sc_msr;
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index 996670fbbbd..4411ba127a7 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci.c,v 1.108 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: ohci.c,v 1.109 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
@@ -82,109 +82,109 @@ int ohcidebug = 0;
struct ohci_pipe;
-ohci_soft_ed_t *ohci_alloc_sed(ohci_softc_t *);
-void ohci_free_sed(ohci_softc_t *, ohci_soft_ed_t *);
+struct ohci_soft_ed *ohci_alloc_sed(struct ohci_softc *);
+void ohci_free_sed(struct ohci_softc *, struct ohci_soft_ed *);
-ohci_soft_td_t *ohci_alloc_std(ohci_softc_t *);
-void ohci_free_std(ohci_softc_t *, ohci_soft_td_t *);
+struct ohci_soft_td *ohci_alloc_std(struct ohci_softc *);
+void ohci_free_std(struct ohci_softc *, struct ohci_soft_td *);
-ohci_soft_itd_t *ohci_alloc_sitd(ohci_softc_t *);
-void ohci_free_sitd(ohci_softc_t *,ohci_soft_itd_t *);
+struct ohci_soft_itd *ohci_alloc_sitd(struct ohci_softc *);
+void ohci_free_sitd(struct ohci_softc *, struct ohci_soft_itd *);
#if 0
-void ohci_free_std_chain(ohci_softc_t *, ohci_soft_td_t *,
- ohci_soft_td_t *);
+void ohci_free_std_chain(struct ohci_softc *, struct ohci_soft_td *,
+ struct ohci_soft_td *);
#endif
usbd_status ohci_alloc_std_chain(struct ohci_pipe *,
- ohci_softc_t *, u_int, int, usbd_xfer_handle,
- ohci_soft_td_t *, ohci_soft_td_t **);
+ struct ohci_softc *, u_int, int, struct usbd_xfer *,
+ struct ohci_soft_td *, struct ohci_soft_td **);
void ohci_shutdown(void *v);
-usbd_status ohci_open(usbd_pipe_handle);
+usbd_status ohci_open(struct usbd_pipe *);
void ohci_poll(struct usbd_bus *);
void ohci_softintr(void *);
-void ohci_waitintr(ohci_softc_t *, usbd_xfer_handle);
-void ohci_add_done(ohci_softc_t *, ohci_physaddr_t);
-void ohci_rhsc(ohci_softc_t *, usbd_xfer_handle);
-
-usbd_status ohci_device_request(usbd_xfer_handle xfer);
-void ohci_add_ed(ohci_soft_ed_t *, ohci_soft_ed_t *);
-void ohci_rem_ed(ohci_soft_ed_t *, ohci_soft_ed_t *);
-void ohci_hash_add_td(ohci_softc_t *, ohci_soft_td_t *);
-void ohci_hash_rem_td(ohci_softc_t *, ohci_soft_td_t *);
-ohci_soft_td_t *ohci_hash_find_td(ohci_softc_t *, ohci_physaddr_t);
-void ohci_hash_add_itd(ohci_softc_t *, ohci_soft_itd_t *);
-void ohci_hash_rem_itd(ohci_softc_t *, ohci_soft_itd_t *);
-ohci_soft_itd_t *ohci_hash_find_itd(ohci_softc_t *, ohci_physaddr_t);
-
-usbd_status ohci_setup_isoc(usbd_pipe_handle pipe);
-void ohci_device_isoc_enter(usbd_xfer_handle);
-
-usbd_status ohci_allocm(struct usbd_bus *, usb_dma_t *, u_int32_t);
-void ohci_freem(struct usbd_bus *, usb_dma_t *);
-
-usbd_xfer_handle ohci_allocx(struct usbd_bus *);
-void ohci_freex(struct usbd_bus *, usbd_xfer_handle);
-
-usbd_status ohci_root_ctrl_transfer(usbd_xfer_handle);
-usbd_status ohci_root_ctrl_start(usbd_xfer_handle);
-void ohci_root_ctrl_abort(usbd_xfer_handle);
-void ohci_root_ctrl_close(usbd_pipe_handle);
-void ohci_root_ctrl_done(usbd_xfer_handle);
-
-usbd_status ohci_root_intr_transfer(usbd_xfer_handle);
-usbd_status ohci_root_intr_start(usbd_xfer_handle);
-void ohci_root_intr_abort(usbd_xfer_handle);
-void ohci_root_intr_close(usbd_pipe_handle);
-void ohci_root_intr_done(usbd_xfer_handle);
-
-usbd_status ohci_device_ctrl_transfer(usbd_xfer_handle);
-usbd_status ohci_device_ctrl_start(usbd_xfer_handle);
-void ohci_device_ctrl_abort(usbd_xfer_handle);
-void ohci_device_ctrl_close(usbd_pipe_handle);
-void ohci_device_ctrl_done(usbd_xfer_handle);
-
-usbd_status ohci_device_bulk_transfer(usbd_xfer_handle);
-usbd_status ohci_device_bulk_start(usbd_xfer_handle);
-void ohci_device_bulk_abort(usbd_xfer_handle);
-void ohci_device_bulk_close(usbd_pipe_handle);
-void ohci_device_bulk_done(usbd_xfer_handle);
-
-usbd_status ohci_device_intr_transfer(usbd_xfer_handle);
-usbd_status ohci_device_intr_start(usbd_xfer_handle);
-void ohci_device_intr_abort(usbd_xfer_handle);
-void ohci_device_intr_close(usbd_pipe_handle);
-void ohci_device_intr_done(usbd_xfer_handle);
-
-usbd_status ohci_device_isoc_transfer(usbd_xfer_handle);
-usbd_status ohci_device_isoc_start(usbd_xfer_handle);
-void ohci_device_isoc_abort(usbd_xfer_handle);
-void ohci_device_isoc_close(usbd_pipe_handle);
-void ohci_device_isoc_done(usbd_xfer_handle);
-
-usbd_status ohci_device_setintr(ohci_softc_t *sc,
+void ohci_waitintr(struct ohci_softc *, struct usbd_xfer *);
+void ohci_add_done(struct ohci_softc *, ohci_physaddr_t);
+void ohci_rhsc(struct ohci_softc *, struct usbd_xfer *);
+
+usbd_status ohci_device_request(struct usbd_xfer *xfer);
+void ohci_add_ed(struct ohci_soft_ed *, struct ohci_soft_ed *);
+void ohci_rem_ed(struct ohci_soft_ed *, struct ohci_soft_ed *);
+void ohci_hash_add_td(struct ohci_softc *, struct ohci_soft_td *);
+void ohci_hash_rem_td(struct ohci_softc *, struct ohci_soft_td *);
+struct ohci_soft_td *ohci_hash_find_td(struct ohci_softc *, ohci_physaddr_t);
+void ohci_hash_add_itd(struct ohci_softc *, struct ohci_soft_itd *);
+void ohci_hash_rem_itd(struct ohci_softc *, struct ohci_soft_itd *);
+struct ohci_soft_itd *ohci_hash_find_itd(struct ohci_softc *, ohci_physaddr_t);
+
+usbd_status ohci_setup_isoc(struct usbd_pipe *pipe);
+void ohci_device_isoc_enter(struct usbd_xfer *);
+
+usbd_status ohci_allocm(struct usbd_bus *, struct usb_dma *, u_int32_t);
+void ohci_freem(struct usbd_bus *, struct usb_dma *);
+
+struct usbd_xfer *ohci_allocx(struct usbd_bus *);
+void ohci_freex(struct usbd_bus *, struct usbd_xfer *);
+
+usbd_status ohci_root_ctrl_transfer(struct usbd_xfer *);
+usbd_status ohci_root_ctrl_start(struct usbd_xfer *);
+void ohci_root_ctrl_abort(struct usbd_xfer *);
+void ohci_root_ctrl_close(struct usbd_pipe *);
+void ohci_root_ctrl_done(struct usbd_xfer *);
+
+usbd_status ohci_root_intr_transfer(struct usbd_xfer *);
+usbd_status ohci_root_intr_start(struct usbd_xfer *);
+void ohci_root_intr_abort(struct usbd_xfer *);
+void ohci_root_intr_close(struct usbd_pipe *);
+void ohci_root_intr_done(struct usbd_xfer *);
+
+usbd_status ohci_device_ctrl_transfer(struct usbd_xfer *);
+usbd_status ohci_device_ctrl_start(struct usbd_xfer *);
+void ohci_device_ctrl_abort(struct usbd_xfer *);
+void ohci_device_ctrl_close(struct usbd_pipe *);
+void ohci_device_ctrl_done(struct usbd_xfer *);
+
+usbd_status ohci_device_bulk_transfer(struct usbd_xfer *);
+usbd_status ohci_device_bulk_start(struct usbd_xfer *);
+void ohci_device_bulk_abort(struct usbd_xfer *);
+void ohci_device_bulk_close(struct usbd_pipe *);
+void ohci_device_bulk_done(struct usbd_xfer *);
+
+usbd_status ohci_device_intr_transfer(struct usbd_xfer *);
+usbd_status ohci_device_intr_start(struct usbd_xfer *);
+void ohci_device_intr_abort(struct usbd_xfer *);
+void ohci_device_intr_close(struct usbd_pipe *);
+void ohci_device_intr_done(struct usbd_xfer *);
+
+usbd_status ohci_device_isoc_transfer(struct usbd_xfer *);
+usbd_status ohci_device_isoc_start(struct usbd_xfer *);
+void ohci_device_isoc_abort(struct usbd_xfer *);
+void ohci_device_isoc_close(struct usbd_pipe *);
+void ohci_device_isoc_done(struct usbd_xfer *);
+
+usbd_status ohci_device_setintr(struct ohci_softc *sc,
struct ohci_pipe *pipe, int ival);
int ohci_str(usb_string_descriptor_t *, int, const char *);
void ohci_timeout(void *);
void ohci_timeout_task(void *);
-void ohci_rhsc_able(ohci_softc_t *, int);
+void ohci_rhsc_able(struct ohci_softc *, int);
void ohci_rhsc_enable(void *);
-void ohci_close_pipe(usbd_pipe_handle, ohci_soft_ed_t *);
-void ohci_abort_xfer(usbd_xfer_handle, usbd_status);
+void ohci_close_pipe(struct usbd_pipe *, struct ohci_soft_ed *);
+void ohci_abort_xfer(struct usbd_xfer *, usbd_status);
-void ohci_device_clear_toggle(usbd_pipe_handle pipe);
-void ohci_noop(usbd_pipe_handle pipe);
+void ohci_device_clear_toggle(struct usbd_pipe *pipe);
+void ohci_noop(struct usbd_pipe *pipe);
#ifdef OHCI_DEBUG
-void ohci_dumpregs(ohci_softc_t *);
-void ohci_dump_tds(ohci_soft_td_t *);
-void ohci_dump_td(ohci_soft_td_t *);
-void ohci_dump_ed(ohci_soft_ed_t *);
-void ohci_dump_itd(ohci_soft_itd_t *);
-void ohci_dump_itds(ohci_soft_itd_t *);
+void ohci_dumpregs(struct ohci_softc *);
+void ohci_dump_tds(struct ohci_soft_td *);
+void ohci_dump_td(struct ohci_soft_td *);
+void ohci_dump_ed(struct ohci_soft_ed *);
+void ohci_dump_itd(struct ohci_soft_itd *);
+void ohci_dump_itds(struct ohci_soft_itd *);
#endif
#define OBARR(sc) bus_space_barrier((sc)->iot, (sc)->ioh, 0, (sc)->sc_size, \
@@ -197,21 +197,21 @@ void ohci_dump_itds(ohci_soft_itd_t *);
do { OBARR(sc); bus_space_write_4((sc)->iot, (sc)->ioh, (r), (x)); } while (0)
static __inline u_int8_t
-OREAD1(ohci_softc_t *sc, bus_size_t r)
+OREAD1(struct ohci_softc *sc, bus_size_t r)
{
OBARR(sc);
return bus_space_read_1(sc->iot, sc->ioh, r);
}
static __inline u_int16_t
-OREAD2(ohci_softc_t *sc, bus_size_t r)
+OREAD2(struct ohci_softc *sc, bus_size_t r)
{
OBARR(sc);
return bus_space_read_2(sc->iot, sc->ioh, r);
}
static __inline u_int32_t
-OREAD4(ohci_softc_t *sc, bus_size_t r)
+OREAD4(struct ohci_softc *sc, bus_size_t r)
{
OBARR(sc);
return bus_space_read_4(sc->iot, sc->ioh, r);
@@ -226,18 +226,18 @@ u_int8_t revbits[OHCI_NO_INTRS] =
struct ohci_pipe {
struct usbd_pipe pipe;
- ohci_soft_ed_t *sed;
+ struct ohci_soft_ed *sed;
union {
- ohci_soft_td_t *td;
- ohci_soft_itd_t *itd;
+ struct ohci_soft_td *td;
+ struct ohci_soft_itd *itd;
} tail;
/* Info needed for different pipe kinds. */
union {
/* Control pipe */
struct {
- usb_dma_t reqdma;
+ struct usb_dma reqdma;
u_int length;
- ohci_soft_td_t *setup, *data, *stat;
+ struct ohci_soft_td *setup, *data, *stat;
} ctl;
/* Interrupt pipe */
struct {
@@ -416,13 +416,13 @@ ohci_detach(struct ohci_softc *sc, int flags)
return (rv);
}
-ohci_soft_ed_t *
-ohci_alloc_sed(ohci_softc_t *sc)
+struct ohci_soft_ed *
+ohci_alloc_sed(struct ohci_softc *sc)
{
- ohci_soft_ed_t *sed;
+ struct ohci_soft_ed *sed;
usbd_status err;
int i, offs;
- usb_dma_t dma;
+ struct usb_dma dma;
if (sc->sc_freeeds == NULL) {
DPRINTFN(2, ("ohci_alloc_sed: allocating chunk\n"));
@@ -440,25 +440,25 @@ ohci_alloc_sed(ohci_softc_t *sc)
}
sed = sc->sc_freeeds;
sc->sc_freeeds = sed->next;
- memset(&sed->ed, 0, sizeof(ohci_ed_t));
+ memset(&sed->ed, 0, sizeof(struct ohci_ed));
sed->next = NULL;
return (sed);
}
void
-ohci_free_sed(ohci_softc_t *sc, ohci_soft_ed_t *sed)
+ohci_free_sed(struct ohci_softc *sc, struct ohci_soft_ed *sed)
{
sed->next = sc->sc_freeeds;
sc->sc_freeeds = sed;
}
-ohci_soft_td_t *
-ohci_alloc_std(ohci_softc_t *sc)
+struct ohci_soft_td *
+ohci_alloc_std(struct ohci_softc *sc)
{
- ohci_soft_td_t *std;
+ struct ohci_soft_td *std;
usbd_status err;
int i, offs;
- usb_dma_t dma;
+ struct usb_dma dma;
int s;
if (sc->sc_freetds == NULL) {
@@ -481,7 +481,7 @@ ohci_alloc_std(ohci_softc_t *sc)
s = splusb();
std = sc->sc_freetds;
sc->sc_freetds = std->nexttd;
- memset(&std->td, 0, sizeof(ohci_td_t));
+ memset(&std->td, 0, sizeof(struct ohci_td));
std->nexttd = NULL;
std->xfer = NULL;
ohci_hash_add_td(sc, std);
@@ -491,7 +491,7 @@ ohci_alloc_std(ohci_softc_t *sc)
}
void
-ohci_free_std(ohci_softc_t *sc, ohci_soft_td_t *std)
+ohci_free_std(struct ohci_softc *sc, struct ohci_soft_td *std)
{
int s;
@@ -503,15 +503,15 @@ ohci_free_std(ohci_softc_t *sc, ohci_soft_td_t *std)
}
usbd_status
-ohci_alloc_std_chain(struct ohci_pipe *opipe, ohci_softc_t *sc,
- u_int alen, int rd, usbd_xfer_handle xfer,
- ohci_soft_td_t *sp, ohci_soft_td_t **ep)
+ohci_alloc_std_chain(struct ohci_pipe *opipe, struct ohci_softc *sc,
+ u_int alen, int rd, struct usbd_xfer *xfer,
+ struct ohci_soft_td *sp, struct ohci_soft_td **ep)
{
- ohci_soft_td_t *next, *cur;
+ struct ohci_soft_td *next, *cur;
ohci_physaddr_t dataphys, dataphysend;
u_int32_t tdflags;
u_int len, curlen;
- usb_dma_t *dma = &xfer->dmabuf;
+ struct usb_dma *dma = &xfer->dmabuf;
u_int16_t flags = xfer->flags;
DPRINTFN(alen < 4096,("ohci_alloc_std_chain: start len=%u\n", alen));
@@ -598,10 +598,10 @@ ohci_alloc_std_chain(struct ohci_pipe *opipe, ohci_softc_t *sc,
#if 0
void
-ohci_free_std_chain(ohci_softc_t *sc, ohci_soft_td_t *std,
- ohci_soft_td_t *stdend)
+ohci_free_std_chain(struct ohci_softc *sc, struct ohci_soft_td *std,
+ struct ohci_soft_td *stdend)
{
- ohci_soft_td_t *p;
+ struct ohci_soft_td *p;
for (; std != stdend; std = p) {
p = std->nexttd;
@@ -610,13 +610,13 @@ ohci_free_std_chain(ohci_softc_t *sc, ohci_soft_td_t *std,
}
#endif
-ohci_soft_itd_t *
-ohci_alloc_sitd(ohci_softc_t *sc)
+struct ohci_soft_itd *
+ohci_alloc_sitd(struct ohci_softc *sc)
{
- ohci_soft_itd_t *sitd;
+ struct ohci_soft_itd *sitd;
usbd_status err;
int i, s, offs;
- usb_dma_t dma;
+ struct usb_dma dma;
if (sc->sc_freeitds == NULL) {
DPRINTFN(2, ("ohci_alloc_sitd: allocating chunk\n"));
@@ -638,7 +638,7 @@ ohci_alloc_sitd(ohci_softc_t *sc)
s = splusb();
sitd = sc->sc_freeitds;
sc->sc_freeitds = sitd->nextitd;
- memset(&sitd->itd, 0, sizeof(ohci_itd_t));
+ memset(&sitd->itd, 0, sizeof(struct ohci_itd));
sitd->nextitd = NULL;
sitd->xfer = NULL;
ohci_hash_add_itd(sc, sitd);
@@ -652,7 +652,7 @@ ohci_alloc_sitd(ohci_softc_t *sc)
}
void
-ohci_free_sitd(ohci_softc_t *sc, ohci_soft_itd_t *sitd)
+ohci_free_sitd(struct ohci_softc *sc, struct ohci_soft_itd *sitd)
{
int s;
@@ -675,7 +675,7 @@ ohci_free_sitd(ohci_softc_t *sc, ohci_soft_itd_t *sitd)
}
usbd_status
-ohci_checkrev(ohci_softc_t *sc)
+ohci_checkrev(struct ohci_softc *sc)
{
u_int32_t rev;
@@ -696,7 +696,7 @@ ohci_checkrev(ohci_softc_t *sc)
}
usbd_status
-ohci_handover(ohci_softc_t *sc)
+ohci_handover(struct ohci_softc *sc)
{
u_int32_t s, ctl;
int i;
@@ -725,9 +725,9 @@ ohci_handover(ohci_softc_t *sc)
}
usbd_status
-ohci_init(ohci_softc_t *sc)
+ohci_init(struct ohci_softc *sc)
{
- ohci_soft_ed_t *sed, *psed;
+ struct ohci_soft_ed *sed, *psed;
usbd_status err;
int i;
u_int32_t ctl, rwc, ival, hcr, fm, per, desca, descb;
@@ -950,7 +950,7 @@ ohci_init(ohci_softc_t *sc)
}
usbd_status
-ohci_allocm(struct usbd_bus *bus, usb_dma_t *dma, u_int32_t size)
+ohci_allocm(struct usbd_bus *bus, struct usb_dma *dma, u_int32_t size)
{
struct ohci_softc *sc = (struct ohci_softc *)bus;
@@ -958,18 +958,18 @@ ohci_allocm(struct usbd_bus *bus, usb_dma_t *dma, u_int32_t size)
}
void
-ohci_freem(struct usbd_bus *bus, usb_dma_t *dma)
+ohci_freem(struct usbd_bus *bus, struct usb_dma *dma)
{
struct ohci_softc *sc = (struct ohci_softc *)bus;
usb_freemem(&sc->sc_bus, dma);
}
-usbd_xfer_handle
+struct usbd_xfer *
ohci_allocx(struct usbd_bus *bus)
{
struct ohci_softc *sc = (struct ohci_softc *)bus;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
xfer = SIMPLEQ_FIRST(&sc->sc_free_xfers);
if (xfer != NULL) {
@@ -993,7 +993,7 @@ ohci_allocx(struct usbd_bus *bus)
}
void
-ohci_freex(struct usbd_bus *bus, usbd_xfer_handle xfer)
+ohci_freex(struct usbd_bus *bus, struct usbd_xfer *xfer)
{
struct ohci_softc *sc = (struct ohci_softc *)bus;
@@ -1014,7 +1014,7 @@ ohci_freex(struct usbd_bus *bus, usbd_xfer_handle xfer)
void
ohci_shutdown(void *v)
{
- ohci_softc_t *sc = v;
+ struct ohci_softc *sc = v;
DPRINTF(("ohci_shutdown: stopping the HC\n"));
OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET);
@@ -1022,7 +1022,7 @@ ohci_shutdown(void *v)
#ifdef OHCI_DEBUG
void
-ohci_dumpregs(ohci_softc_t *sc)
+ohci_dumpregs(struct ohci_softc *sc)
{
DPRINTF(("ohci_dumpregs: rev=0x%08x control=0x%08x command=0x%08x\n",
OREAD4(sc, OHCI_REVISION),
@@ -1061,12 +1061,12 @@ ohci_dumpregs(ohci_softc_t *sc)
}
#endif
-int ohci_intr1(ohci_softc_t *);
+int ohci_intr1(struct ohci_softc *);
int
ohci_intr(void *p)
{
- ohci_softc_t *sc = p;
+ struct ohci_softc *sc = p;
if (sc == NULL || sc->sc_bus.dying)
return (0);
@@ -1087,7 +1087,7 @@ ohci_intr(void *p)
}
int
-ohci_intr1(ohci_softc_t *sc)
+ohci_intr1(struct ohci_softc *sc)
{
u_int32_t intrs, eintrs;
ohci_physaddr_t done;
@@ -1193,7 +1193,7 @@ ohci_intr1(ohci_softc_t *sc)
}
void
-ohci_rhsc_able(ohci_softc_t *sc, int on)
+ohci_rhsc_able(struct ohci_softc *sc, int on)
{
DPRINTFN(4, ("ohci_rhsc_able: on=%d\n", on));
if (on) {
@@ -1208,7 +1208,7 @@ ohci_rhsc_able(ohci_softc_t *sc, int on)
void
ohci_rhsc_enable(void *v_sc)
{
- ohci_softc_t *sc = v_sc;
+ struct ohci_softc *sc = v_sc;
int s;
if (sc->sc_bus.dying)
@@ -1245,10 +1245,10 @@ char *ohci_cc_strs[] = {
#endif
void
-ohci_add_done(ohci_softc_t *sc, ohci_physaddr_t done)
+ohci_add_done(struct ohci_softc *sc, ohci_physaddr_t done)
{
- ohci_soft_itd_t *sitd, *sidone, **ip;
- ohci_soft_td_t *std, *sdone, **p;
+ struct ohci_soft_itd *sitd, *sidone, **ip;
+ struct ohci_soft_td *std, *sdone, **p;
/* Reverse the done list. */
for (sdone = NULL, sidone = NULL; done != 0; ) {
@@ -1284,10 +1284,10 @@ ohci_add_done(ohci_softc_t *sc, ohci_physaddr_t done)
void
ohci_softintr(void *v)
{
- ohci_softc_t *sc = v;
- ohci_soft_itd_t *sitd, *sidone, *sitdnext;
- ohci_soft_td_t *std, *sdone, *stdnext;
- usbd_xfer_handle xfer;
+ struct ohci_softc *sc = v;
+ struct ohci_soft_itd *sitd, *sidone, *sitdnext;
+ struct ohci_soft_td *std, *sdone, *stdnext;
+ struct usbd_xfer *xfer;
struct ohci_pipe *opipe;
int len, cc, s;
int i, j, actlen, iframes, uedir;
@@ -1362,7 +1362,7 @@ ohci_softintr(void *v)
* belonging to the failed transfer, and then restart
* the endpoint.
*/
- ohci_soft_td_t *p, *n;
+ struct ohci_soft_td *p, *n;
opipe = (struct ohci_pipe *)xfer->pipe;
DPRINTFN(15,("ohci_process_done: error cc=%d (%s)\n",
@@ -1416,7 +1416,7 @@ ohci_softintr(void *v)
sitd->isdone = 1;
#endif
if (sitd->flags & OHCI_CALL_DONE) {
- ohci_soft_itd_t *next;
+ struct ohci_soft_itd *next;
opipe = (struct ohci_pipe *)xfer->pipe;
opipe->u.iso.inuse -= xfer->nframes;
@@ -1475,7 +1475,7 @@ ohci_softintr(void *v)
}
void
-ohci_device_ctrl_done(usbd_xfer_handle xfer)
+ohci_device_ctrl_done(struct usbd_xfer *xfer)
{
DPRINTFN(10,("ohci_device_ctrl_done: xfer=%p\n", xfer));
@@ -1487,12 +1487,12 @@ ohci_device_ctrl_done(usbd_xfer_handle xfer)
}
void
-ohci_device_intr_done(usbd_xfer_handle xfer)
+ohci_device_intr_done(struct usbd_xfer *xfer)
{
struct ohci_pipe *opipe = (struct ohci_pipe *)xfer->pipe;
- ohci_softc_t *sc = (ohci_softc_t *)opipe->pipe.device->bus;
- ohci_soft_ed_t *sed = opipe->sed;
- ohci_soft_td_t *data, *tail;
+ struct ohci_softc *sc = (struct ohci_softc *)opipe->pipe.device->bus;
+ struct ohci_soft_ed *sed = opipe->sed;
+ struct ohci_soft_td *data, *tail;
DPRINTFN(10, ("ohci_device_intr_done: xfer=%p, actlen=%d\n", xfer,
@@ -1529,14 +1529,14 @@ ohci_device_intr_done(usbd_xfer_handle xfer)
}
void
-ohci_device_bulk_done(usbd_xfer_handle xfer)
+ohci_device_bulk_done(struct usbd_xfer *xfer)
{
DPRINTFN(10, ("ohci_device_bulk_done: xfer=%p, actlen=%d\n", xfer,
xfer->actlen));
}
void
-ohci_rhsc(ohci_softc_t *sc, usbd_xfer_handle xfer)
+ohci_rhsc(struct ohci_softc *sc, struct usbd_xfer *xfer)
{
u_char *p;
int i, m;
@@ -1567,12 +1567,12 @@ ohci_rhsc(ohci_softc_t *sc, usbd_xfer_handle xfer)
}
void
-ohci_root_intr_done(usbd_xfer_handle xfer)
+ohci_root_intr_done(struct usbd_xfer *xfer)
{
}
void
-ohci_root_ctrl_done(usbd_xfer_handle xfer)
+ohci_root_ctrl_done(struct usbd_xfer *xfer)
{
}
@@ -1582,7 +1582,7 @@ ohci_root_ctrl_done(usbd_xfer_handle xfer)
* too long.
*/
void
-ohci_waitintr(ohci_softc_t *sc, usbd_xfer_handle xfer)
+ohci_waitintr(struct ohci_softc *sc, struct usbd_xfer *xfer)
{
int timo;
u_int32_t intrs;
@@ -1615,7 +1615,7 @@ ohci_waitintr(ohci_softc_t *sc, usbd_xfer_handle xfer)
void
ohci_poll(struct usbd_bus *bus)
{
- ohci_softc_t *sc = (ohci_softc_t *)bus;
+ struct ohci_softc *sc = (struct ohci_softc *)bus;
#ifdef OHCI_DEBUG
static int last;
int new;
@@ -1631,15 +1631,15 @@ ohci_poll(struct usbd_bus *bus)
}
usbd_status
-ohci_device_request(usbd_xfer_handle xfer)
+ohci_device_request(struct usbd_xfer *xfer)
{
struct ohci_pipe *opipe = (struct ohci_pipe *)xfer->pipe;
usb_device_request_t *req = &xfer->request;
- usbd_device_handle dev = opipe->pipe.device;
- ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
+ struct usbd_device *dev = opipe->pipe.device;
+ struct ohci_softc *sc = (struct ohci_softc *)dev->bus;
int addr = dev->address;
- ohci_soft_td_t *setup, *stat, *next, *tail;
- ohci_soft_ed_t *sed;
+ struct ohci_soft_td *setup, *stat, *next, *tail;
+ struct ohci_soft_ed *sed;
int isread;
u_int len;
usbd_status err;
@@ -1683,7 +1683,7 @@ ohci_device_request(usbd_xfer_handle xfer)
/* Set up data transaction */
if (len != 0) {
- ohci_soft_td_t *std = stat;
+ struct ohci_soft_td *std = stat;
err = ohci_alloc_std_chain(opipe, sc, len, isread, xfer,
std, &stat);
@@ -1767,7 +1767,7 @@ ohci_device_request(usbd_xfer_handle xfer)
* Add an ED to the schedule. Called at splusb().
*/
void
-ohci_add_ed(ohci_soft_ed_t *sed, ohci_soft_ed_t *head)
+ohci_add_ed(struct ohci_soft_ed *sed, struct ohci_soft_ed *head)
{
DPRINTFN(8,("ohci_add_ed: sed=%p head=%p\n", sed, head));
@@ -1782,9 +1782,9 @@ ohci_add_ed(ohci_soft_ed_t *sed, ohci_soft_ed_t *head)
* Remove an ED from the schedule. Called at splusb().
*/
void
-ohci_rem_ed(ohci_soft_ed_t *sed, ohci_soft_ed_t *head)
+ohci_rem_ed(struct ohci_soft_ed *sed, struct ohci_soft_ed *head)
{
- ohci_soft_ed_t *p;
+ struct ohci_soft_ed *p;
SPLUSBCHECK;
@@ -1810,7 +1810,7 @@ ohci_rem_ed(ohci_soft_ed_t *sed, ohci_soft_ed_t *head)
#define HASH(a) (((a) >> 4) % OHCI_HASH_SIZE)
/* Called at splusb() */
void
-ohci_hash_add_td(ohci_softc_t *sc, ohci_soft_td_t *std)
+ohci_hash_add_td(struct ohci_softc *sc, struct ohci_soft_td *std)
{
int h = HASH(std->physaddr);
@@ -1821,18 +1821,18 @@ ohci_hash_add_td(ohci_softc_t *sc, ohci_soft_td_t *std)
/* Called at splusb() */
void
-ohci_hash_rem_td(ohci_softc_t *sc, ohci_soft_td_t *std)
+ohci_hash_rem_td(struct ohci_softc *sc, struct ohci_soft_td *std)
{
SPLUSBCHECK;
LIST_REMOVE(std, hnext);
}
-ohci_soft_td_t *
-ohci_hash_find_td(ohci_softc_t *sc, ohci_physaddr_t a)
+struct ohci_soft_td *
+ohci_hash_find_td(struct ohci_softc *sc, ohci_physaddr_t a)
{
int h = HASH(a);
- ohci_soft_td_t *std;
+ struct ohci_soft_td *std;
for (std = LIST_FIRST(&sc->sc_hash_tds[h]);
std != NULL;
@@ -1844,7 +1844,7 @@ ohci_hash_find_td(ohci_softc_t *sc, ohci_physaddr_t a)
/* Called at splusb() */
void
-ohci_hash_add_itd(ohci_softc_t *sc, ohci_soft_itd_t *sitd)
+ohci_hash_add_itd(struct ohci_softc *sc, struct ohci_soft_itd *sitd)
{
int h = HASH(sitd->physaddr);
@@ -1858,7 +1858,7 @@ ohci_hash_add_itd(ohci_softc_t *sc, ohci_soft_itd_t *sitd)
/* Called at splusb() */
void
-ohci_hash_rem_itd(ohci_softc_t *sc, ohci_soft_itd_t *sitd)
+ohci_hash_rem_itd(struct ohci_softc *sc, struct ohci_soft_itd *sitd)
{
SPLUSBCHECK;
@@ -1868,11 +1868,11 @@ ohci_hash_rem_itd(ohci_softc_t *sc, ohci_soft_itd_t *sitd)
LIST_REMOVE(sitd, hnext);
}
-ohci_soft_itd_t *
-ohci_hash_find_itd(ohci_softc_t *sc, ohci_physaddr_t a)
+struct ohci_soft_itd *
+ohci_hash_find_itd(struct ohci_softc *sc, ohci_physaddr_t a)
{
int h = HASH(a);
- ohci_soft_itd_t *sitd;
+ struct ohci_soft_itd *sitd;
for (sitd = LIST_FIRST(&sc->sc_hash_itds[h]);
sitd != NULL;
@@ -1887,7 +1887,7 @@ ohci_timeout(void *addr)
{
struct ohci_xfer *oxfer = addr;
struct ohci_pipe *opipe = (struct ohci_pipe *)oxfer->xfer.pipe;
- ohci_softc_t *sc = (ohci_softc_t *)opipe->pipe.device->bus;
+ struct ohci_softc *sc = (struct ohci_softc *)opipe->pipe.device->bus;
DPRINTF(("ohci_timeout: oxfer=%p\n", oxfer));
@@ -1905,7 +1905,7 @@ ohci_timeout(void *addr)
void
ohci_timeout_task(void *addr)
{
- usbd_xfer_handle xfer = addr;
+ struct usbd_xfer *xfer = addr;
int s;
DPRINTF(("ohci_timeout_task: xfer=%p\n", xfer));
@@ -1917,14 +1917,14 @@ ohci_timeout_task(void *addr)
#ifdef OHCI_DEBUG
void
-ohci_dump_tds(ohci_soft_td_t *std)
+ohci_dump_tds(struct ohci_soft_td *std)
{
for (; std; std = std->nexttd)
ohci_dump_td(std);
}
void
-ohci_dump_td(ohci_soft_td_t *std)
+ohci_dump_td(struct ohci_soft_td *std)
{
char sbuf[128];
@@ -1944,7 +1944,7 @@ ohci_dump_td(ohci_soft_td_t *std)
}
void
-ohci_dump_itd(ohci_soft_itd_t *sitd)
+ohci_dump_itd(struct ohci_soft_itd *sitd)
{
int i;
@@ -1965,14 +1965,14 @@ ohci_dump_itd(ohci_soft_itd_t *sitd)
}
void
-ohci_dump_itds(ohci_soft_itd_t *sitd)
+ohci_dump_itds(struct ohci_soft_itd *sitd)
{
for (; sitd; sitd = sitd->nextitd)
ohci_dump_itd(sitd);
}
void
-ohci_dump_ed(ohci_soft_ed_t *sed)
+ohci_dump_ed(struct ohci_soft_ed *sed)
{
char sbuf[128], sbuf2[128];
@@ -1995,17 +1995,17 @@ ohci_dump_ed(ohci_soft_ed_t *sed)
#endif
usbd_status
-ohci_open(usbd_pipe_handle pipe)
+ohci_open(struct usbd_pipe *pipe)
{
- usbd_device_handle dev = pipe->device;
- ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
+ struct usbd_device *dev = pipe->device;
+ struct ohci_softc *sc = (struct ohci_softc *)dev->bus;
usb_endpoint_descriptor_t *ed = pipe->endpoint->edesc;
struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
u_int8_t addr = dev->address;
u_int8_t xfertype = ed->bmAttributes & UE_XFERTYPE;
- ohci_soft_ed_t *sed;
- ohci_soft_td_t *std;
- ohci_soft_itd_t *sitd;
+ struct ohci_soft_ed *sed;
+ struct ohci_soft_td *std;
+ struct ohci_soft_itd *sitd;
ohci_physaddr_t tdphys;
u_int32_t fmt;
usbd_status err;
@@ -2112,11 +2112,11 @@ ohci_open(usbd_pipe_handle pipe)
* Assumes that there are no pending transactions.
*/
void
-ohci_close_pipe(usbd_pipe_handle pipe, ohci_soft_ed_t *head)
+ohci_close_pipe(struct usbd_pipe *pipe, struct ohci_soft_ed *head)
{
struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
- ohci_soft_ed_t *sed = opipe->sed;
+ struct ohci_softc *sc = (struct ohci_softc *)pipe->device->bus;
+ struct ohci_soft_ed *sed = opipe->sed;
int s;
s = splusb();
@@ -2124,7 +2124,7 @@ ohci_close_pipe(usbd_pipe_handle pipe, ohci_soft_ed_t *head)
sed->ed.ed_flags |= htole32(OHCI_ED_SKIP);
if ((letoh32(sed->ed.ed_tailp) & OHCI_HEADMASK) !=
(letoh32(sed->ed.ed_headp) & OHCI_HEADMASK)) {
- ohci_soft_td_t *std;
+ struct ohci_soft_td *std;
std = ohci_hash_find_td(sc, letoh32(sed->ed.ed_headp));
printf("ohci_close_pipe: pipe not empty sed=%p hd=0x%x "
"tl=0x%x pipe=%p, std=%p\n", sed,
@@ -2165,12 +2165,12 @@ ohci_close_pipe(usbd_pipe_handle pipe, ohci_soft_ed_t *head)
* interrupt processing to process it.
*/
void
-ohci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
+ohci_abort_xfer(struct usbd_xfer *xfer, usbd_status status)
{
struct ohci_pipe *opipe = (struct ohci_pipe *)xfer->pipe;
- ohci_softc_t *sc = (ohci_softc_t *)opipe->pipe.device->bus;
- ohci_soft_ed_t *sed = opipe->sed;
- ohci_soft_td_t *p, *n;
+ struct ohci_softc *sc = (struct ohci_softc *)opipe->pipe.device->bus;
+ struct ohci_soft_ed *sed = opipe->sed;
+ struct ohci_soft_td *p, *n;
ohci_physaddr_t headp;
int s, hit;
@@ -2347,7 +2347,7 @@ ohci_str(usb_string_descriptor_t *p, int l, const char *s)
* Simulate a hardware hub by handling all the necessary requests.
*/
usbd_status
-ohci_root_ctrl_transfer(usbd_xfer_handle xfer)
+ohci_root_ctrl_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -2361,9 +2361,9 @@ ohci_root_ctrl_transfer(usbd_xfer_handle xfer)
}
usbd_status
-ohci_root_ctrl_start(usbd_xfer_handle xfer)
+ohci_root_ctrl_start(struct usbd_xfer *xfer)
{
- ohci_softc_t *sc = (ohci_softc_t *)xfer->pipe->device->bus;
+ struct ohci_softc *sc = (struct ohci_softc *)xfer->pipe->device->bus;
usb_device_request_t *req;
void *buf = NULL;
int port, i;
@@ -2675,21 +2675,21 @@ ohci_root_ctrl_start(usbd_xfer_handle xfer)
/* Abort a root control request. */
void
-ohci_root_ctrl_abort(usbd_xfer_handle xfer)
+ohci_root_ctrl_abort(struct usbd_xfer *xfer)
{
/* Nothing to do, all transfers are synchronous. */
}
/* Close the root pipe. */
void
-ohci_root_ctrl_close(usbd_pipe_handle pipe)
+ohci_root_ctrl_close(struct usbd_pipe *pipe)
{
DPRINTF(("ohci_root_ctrl_close\n"));
/* Nothing to do. */
}
usbd_status
-ohci_root_intr_transfer(usbd_xfer_handle xfer)
+ohci_root_intr_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -2703,10 +2703,10 @@ ohci_root_intr_transfer(usbd_xfer_handle xfer)
}
usbd_status
-ohci_root_intr_start(usbd_xfer_handle xfer)
+ohci_root_intr_start(struct usbd_xfer *xfer)
{
- usbd_pipe_handle pipe = xfer->pipe;
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
+ struct usbd_pipe *pipe = xfer->pipe;
+ struct ohci_softc *sc = (struct ohci_softc *)pipe->device->bus;
if (sc->sc_bus.dying)
return (USBD_IOERROR);
@@ -2718,7 +2718,7 @@ ohci_root_intr_start(usbd_xfer_handle xfer)
/* Abort a root interrupt request. */
void
-ohci_root_intr_abort(usbd_xfer_handle xfer)
+ohci_root_intr_abort(struct usbd_xfer *xfer)
{
int s;
@@ -2734,9 +2734,9 @@ ohci_root_intr_abort(usbd_xfer_handle xfer)
/* Close the root pipe. */
void
-ohci_root_intr_close(usbd_pipe_handle pipe)
+ohci_root_intr_close(struct usbd_pipe *pipe)
{
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
+ struct ohci_softc *sc = (struct ohci_softc *)pipe->device->bus;
DPRINTF(("ohci_root_intr_close\n"));
@@ -2746,7 +2746,7 @@ ohci_root_intr_close(usbd_pipe_handle pipe)
/************************/
usbd_status
-ohci_device_ctrl_transfer(usbd_xfer_handle xfer)
+ohci_device_ctrl_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -2760,9 +2760,9 @@ ohci_device_ctrl_transfer(usbd_xfer_handle xfer)
}
usbd_status
-ohci_device_ctrl_start(usbd_xfer_handle xfer)
+ohci_device_ctrl_start(struct usbd_xfer *xfer)
{
- ohci_softc_t *sc = (ohci_softc_t *)xfer->pipe->device->bus;
+ struct ohci_softc *sc = (struct ohci_softc *)xfer->pipe->device->bus;
usbd_status err;
if (sc->sc_bus.dying)
@@ -2788,7 +2788,7 @@ ohci_device_ctrl_start(usbd_xfer_handle xfer)
/* Abort a device control request. */
void
-ohci_device_ctrl_abort(usbd_xfer_handle xfer)
+ohci_device_ctrl_abort(struct usbd_xfer *xfer)
{
DPRINTF(("ohci_device_ctrl_abort: xfer=%p\n", xfer));
ohci_abort_xfer(xfer, USBD_CANCELLED);
@@ -2796,10 +2796,10 @@ ohci_device_ctrl_abort(usbd_xfer_handle xfer)
/* Close a device control pipe. */
void
-ohci_device_ctrl_close(usbd_pipe_handle pipe)
+ohci_device_ctrl_close(struct usbd_pipe *pipe)
{
struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
+ struct ohci_softc *sc = (struct ohci_softc *)pipe->device->bus;
DPRINTF(("ohci_device_ctrl_close: pipe=%p\n", pipe));
ohci_close_pipe(pipe, sc->sc_ctrl_head);
@@ -2809,7 +2809,7 @@ ohci_device_ctrl_close(usbd_pipe_handle pipe)
/************************/
void
-ohci_device_clear_toggle(usbd_pipe_handle pipe)
+ohci_device_clear_toggle(struct usbd_pipe *pipe)
{
struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
@@ -2817,12 +2817,12 @@ ohci_device_clear_toggle(usbd_pipe_handle pipe)
}
void
-ohci_noop(usbd_pipe_handle pipe)
+ohci_noop(struct usbd_pipe *pipe)
{
}
usbd_status
-ohci_device_bulk_transfer(usbd_xfer_handle xfer)
+ohci_device_bulk_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -2836,14 +2836,14 @@ ohci_device_bulk_transfer(usbd_xfer_handle xfer)
}
usbd_status
-ohci_device_bulk_start(usbd_xfer_handle xfer)
+ohci_device_bulk_start(struct usbd_xfer *xfer)
{
struct ohci_pipe *opipe = (struct ohci_pipe *)xfer->pipe;
- usbd_device_handle dev = opipe->pipe.device;
- ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
+ struct usbd_device *dev = opipe->pipe.device;
+ struct ohci_softc *sc = (struct ohci_softc *)dev->bus;
int addr = dev->address;
- ohci_soft_td_t *data, *tail, *tdp;
- ohci_soft_ed_t *sed;
+ struct ohci_soft_td *data, *tail, *tdp;
+ struct ohci_soft_ed *sed;
u_int len;
int s, isread, endpt;
usbd_status err;
@@ -2940,7 +2940,7 @@ ohci_device_bulk_start(usbd_xfer_handle xfer)
}
void
-ohci_device_bulk_abort(usbd_xfer_handle xfer)
+ohci_device_bulk_abort(struct usbd_xfer *xfer)
{
DPRINTF(("ohci_device_bulk_abort: xfer=%p\n", xfer));
ohci_abort_xfer(xfer, USBD_CANCELLED);
@@ -2950,10 +2950,10 @@ ohci_device_bulk_abort(usbd_xfer_handle xfer)
* Close a device bulk pipe.
*/
void
-ohci_device_bulk_close(usbd_pipe_handle pipe)
+ohci_device_bulk_close(struct usbd_pipe *pipe)
{
struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
+ struct ohci_softc *sc = (struct ohci_softc *)pipe->device->bus;
DPRINTF(("ohci_device_bulk_close: pipe=%p\n", pipe));
ohci_close_pipe(pipe, sc->sc_bulk_head);
@@ -2963,7 +2963,7 @@ ohci_device_bulk_close(usbd_pipe_handle pipe)
/************************/
usbd_status
-ohci_device_intr_transfer(usbd_xfer_handle xfer)
+ohci_device_intr_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -2977,13 +2977,13 @@ ohci_device_intr_transfer(usbd_xfer_handle xfer)
}
usbd_status
-ohci_device_intr_start(usbd_xfer_handle xfer)
+ohci_device_intr_start(struct usbd_xfer *xfer)
{
struct ohci_pipe *opipe = (struct ohci_pipe *)xfer->pipe;
- usbd_device_handle dev = opipe->pipe.device;
- ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
- ohci_soft_ed_t *sed = opipe->sed;
- ohci_soft_td_t *data, *tail;
+ struct usbd_device *dev = opipe->pipe.device;
+ struct ohci_softc *sc = (struct ohci_softc *)dev->bus;
+ struct ohci_soft_ed *sed = opipe->sed;
+ struct ohci_soft_td *data, *tail;
int s, len, isread, endpt;
if (sc->sc_bus.dying)
@@ -3061,7 +3061,7 @@ ohci_device_intr_start(usbd_xfer_handle xfer)
/* Abort a device control request. */
void
-ohci_device_intr_abort(usbd_xfer_handle xfer)
+ohci_device_intr_abort(struct usbd_xfer *xfer)
{
if (xfer->pipe->intrxfer == xfer) {
DPRINTF(("ohci_device_intr_abort: remove\n"));
@@ -3072,14 +3072,14 @@ ohci_device_intr_abort(usbd_xfer_handle xfer)
/* Close a device interrupt pipe. */
void
-ohci_device_intr_close(usbd_pipe_handle pipe)
+ohci_device_intr_close(struct usbd_pipe *pipe)
{
struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
+ struct ohci_softc *sc = (struct ohci_softc *)pipe->device->bus;
int nslots = opipe->u.intr.nslots;
int pos = opipe->u.intr.pos;
int j;
- ohci_soft_ed_t *p, *sed = opipe->sed;
+ struct ohci_soft_ed *p, *sed = opipe->sed;
int s;
DPRINTFN(1,("ohci_device_intr_close: pipe=%p nslots=%d pos=%d\n",
@@ -3108,12 +3108,12 @@ ohci_device_intr_close(usbd_pipe_handle pipe)
}
usbd_status
-ohci_device_setintr(ohci_softc_t *sc, struct ohci_pipe *opipe, int ival)
+ohci_device_setintr(struct ohci_softc *sc, struct ohci_pipe *opipe, int ival)
{
int i, j, s, best;
u_int npoll, slow, shigh, nslots;
u_int bestbw, bw;
- ohci_soft_ed_t *hsed, *sed = opipe->sed;
+ struct ohci_soft_ed *hsed, *sed = opipe->sed;
DPRINTFN(2, ("ohci_setintr: pipe=%p\n", opipe));
if (ival == 0) {
@@ -3172,7 +3172,7 @@ ohci_device_setintr(ohci_softc_t *sc, struct ohci_pipe *opipe, int ival)
/***********************/
usbd_status
-ohci_device_isoc_transfer(usbd_xfer_handle xfer)
+ohci_device_isoc_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -3198,14 +3198,14 @@ ohci_device_isoc_transfer(usbd_xfer_handle xfer)
}
void
-ohci_device_isoc_enter(usbd_xfer_handle xfer)
+ohci_device_isoc_enter(struct usbd_xfer *xfer)
{
struct ohci_pipe *opipe = (struct ohci_pipe *)xfer->pipe;
- usbd_device_handle dev = opipe->pipe.device;
- ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
- ohci_soft_ed_t *sed = opipe->sed;
+ struct usbd_device *dev = opipe->pipe.device;
+ struct ohci_softc *sc = (struct ohci_softc *)dev->bus;
+ struct ohci_soft_ed *sed = opipe->sed;
struct iso *iso = &opipe->u.iso;
- ohci_soft_itd_t *sitd, *nsitd;
+ struct ohci_soft_itd *sitd, *nsitd;
ohci_physaddr_t buf, offs, noffs, bp0;
int i, ncur, nframes;
int s;
@@ -3319,10 +3319,10 @@ ohci_device_isoc_enter(usbd_xfer_handle xfer)
}
usbd_status
-ohci_device_isoc_start(usbd_xfer_handle xfer)
+ohci_device_isoc_start(struct usbd_xfer *xfer)
{
struct ohci_pipe *opipe = (struct ohci_pipe *)xfer->pipe;
- ohci_softc_t *sc = (ohci_softc_t *)opipe->pipe.device->bus;
+ struct ohci_softc *sc = (struct ohci_softc *)opipe->pipe.device->bus;
DPRINTFN(5,("ohci_device_isoc_start: xfer=%p\n", xfer));
@@ -3345,12 +3345,12 @@ ohci_device_isoc_start(usbd_xfer_handle xfer)
}
void
-ohci_device_isoc_abort(usbd_xfer_handle xfer)
+ohci_device_isoc_abort(struct usbd_xfer *xfer)
{
struct ohci_pipe *opipe = (struct ohci_pipe *)xfer->pipe;
- ohci_softc_t *sc = (ohci_softc_t *)opipe->pipe.device->bus;
- ohci_soft_ed_t *sed;
- ohci_soft_itd_t *sitd;
+ struct ohci_softc *sc = (struct ohci_softc *)opipe->pipe.device->bus;
+ struct ohci_soft_ed *sed;
+ struct ohci_soft_itd *sitd;
int s;
s = splusb();
@@ -3402,16 +3402,16 @@ ohci_device_isoc_abort(usbd_xfer_handle xfer)
}
void
-ohci_device_isoc_done(usbd_xfer_handle xfer)
+ohci_device_isoc_done(struct usbd_xfer *xfer)
{
DPRINTFN(1,("ohci_device_isoc_done: xfer=%p\n", xfer));
}
usbd_status
-ohci_setup_isoc(usbd_pipe_handle pipe)
+ohci_setup_isoc(struct usbd_pipe *pipe)
{
struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
+ struct ohci_softc *sc = (struct ohci_softc *)pipe->device->bus;
struct iso *iso = &opipe->u.iso;
int s;
@@ -3426,10 +3426,10 @@ ohci_setup_isoc(usbd_pipe_handle pipe)
}
void
-ohci_device_isoc_close(usbd_pipe_handle pipe)
+ohci_device_isoc_close(struct usbd_pipe *pipe)
{
struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
+ struct ohci_softc *sc = (struct ohci_softc *)pipe->device->bus;
DPRINTF(("ohci_device_isoc_close: pipe=%p\n", pipe));
ohci_close_pipe(pipe, sc->sc_isoc_head);
diff --git a/sys/dev/usb/ohcireg.h b/sys/dev/usb/ohcireg.h
index fafa9c1ad8f..00f86a0e4fa 100644
--- a/sys/dev/usb/ohcireg.h
+++ b/sys/dev/usb/ohcireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohcireg.h,v 1.13 2008/06/26 05:42:18 ray Exp $ */
+/* $OpenBSD: ohcireg.h,v 1.14 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: ohcireg.h,v 1.19 2002/07/11 21:14:27 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohcireg.h,v 1.8 1999/11/17 22:33:40 n_hibma Exp $ */
@@ -142,7 +142,7 @@ struct ohci_hcca {
#define OHCI_PAGE(x) ((x) &~ 0xfff)
#define OHCI_PAGE_OFFSET(x) ((x) & 0xfff)
-typedef struct {
+struct ohci_ed {
u_int32_t ed_flags;
#define OHCI_ED_GET_FA(s) ((s) & 0x7f)
#define OHCI_ED_ADDRMASK 0x0000007f
@@ -166,11 +166,11 @@ typedef struct {
#define OHCI_TOGGLECARRY 0x00000002
#define OHCI_HEADMASK 0xfffffffc
ohci_physaddr_t ed_nexted;
-} ohci_ed_t;
+};
/* #define OHCI_ED_SIZE 16 */
#define OHCI_ED_ALIGN 16
-typedef struct {
+struct ohci_td {
u_int32_t td_flags;
#define OHCI_TD_R 0x00040000 /* Buffer Rounding */
#define OHCI_TD_DP_MASK 0x00180000 /* Direction / PID */
@@ -191,12 +191,12 @@ typedef struct {
ohci_physaddr_t td_cbp; /* Current Buffer Pointer */
ohci_physaddr_t td_nexttd; /* Next TD */
ohci_physaddr_t td_be; /* Buffer End */
-} ohci_td_t;
+};
/* #define OHCI_TD_SIZE 16 */
#define OHCI_TD_ALIGN 16
#define OHCI_ITD_NOFFSET 8
-typedef struct {
+struct ohci_itd {
u_int32_t itd_flags;
#define OHCI_ITD_GET_SF(x) ((x) & 0x0000ffff)
#define OHCI_ITD_SET_SF(x) ((x) & 0xffff)
@@ -216,7 +216,7 @@ typedef struct {
#define OHCI_ITD_MK_OFFS(len) (0xe000 | ((len) & 0x1fff))
#define OHCI_ITD_PSW_LENGTH(x) ((x) & 0xfff) /* Transfer length */
#define OHCI_ITD_PSW_GET_CC(x) ((x) >> 12) /* Condition Code */
-} ohci_itd_t;
+};
/* #define OHCI_ITD_SIZE 32 */
#define OHCI_ITD_ALIGN 32
diff --git a/sys/dev/usb/ohcivar.h b/sys/dev/usb/ohcivar.h
index 21b498f771d..e1b6123f106 100644
--- a/sys/dev/usb/ohcivar.h
+++ b/sys/dev/usb/ohcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohcivar.h,v 1.31 2010/12/14 16:13:16 jakemsr Exp $ */
+/* $OpenBSD: ohcivar.h,v 1.32 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: ohcivar.h,v 1.32 2003/02/22 05:24:17 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohcivar.h,v 1.13 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -32,43 +32,43 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-typedef struct ohci_soft_ed {
- ohci_ed_t ed;
+struct ohci_soft_ed {
+ struct ohci_ed ed;
struct ohci_soft_ed *next;
ohci_physaddr_t physaddr;
-} ohci_soft_ed_t;
+};
#define OHCI_SED_SIZE ((sizeof (struct ohci_soft_ed) + OHCI_ED_ALIGN - 1) / OHCI_ED_ALIGN * OHCI_ED_ALIGN)
#define OHCI_SED_CHUNK 128
-typedef struct ohci_soft_td {
- ohci_td_t td;
+struct ohci_soft_td {
+ struct ohci_td td;
struct ohci_soft_td *nexttd; /* mirrors nexttd in TD */
struct ohci_soft_td *dnext; /* next in done list */
ohci_physaddr_t physaddr;
LIST_ENTRY(ohci_soft_td) hnext;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
u_int16_t len;
u_int16_t flags;
#define OHCI_CALL_DONE 0x0001
#define OHCI_ADD_LEN 0x0002
-} ohci_soft_td_t;
+};
#define OHCI_STD_SIZE ((sizeof (struct ohci_soft_td) + OHCI_TD_ALIGN - 1) / OHCI_TD_ALIGN * OHCI_TD_ALIGN)
#define OHCI_STD_CHUNK 128
-typedef struct ohci_soft_itd {
- ohci_itd_t itd;
+struct ohci_soft_itd {
+ struct ohci_itd itd;
struct ohci_soft_itd *nextitd; /* mirrors nexttd in ITD */
struct ohci_soft_itd *dnext; /* next in done list */
ohci_physaddr_t physaddr;
LIST_ENTRY(ohci_soft_itd) hnext;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
u_int16_t flags;
#ifdef DIAGNOSTIC
char isdone;
#endif
-} ohci_soft_itd_t;
+};
#define OHCI_SITD_SIZE ((sizeof (struct ohci_soft_itd) + OHCI_ITD_ALIGN - 1) / OHCI_ITD_ALIGN * OHCI_ITD_ALIGN)
#define OHCI_SITD_CHUNK 64
@@ -77,21 +77,21 @@ typedef struct ohci_soft_itd {
#define OHCI_HASH_SIZE 128
-typedef struct ohci_softc {
+struct ohci_softc {
struct usbd_bus sc_bus; /* base device */
bus_space_tag_t iot;
bus_space_handle_t ioh;
bus_size_t sc_size;
- usb_dma_t sc_hccadma;
+ struct usb_dma sc_hccadma;
struct ohci_hcca *sc_hcca;
- ohci_soft_ed_t *sc_eds[OHCI_NO_EDS];
+ struct ohci_soft_ed *sc_eds[OHCI_NO_EDS];
u_int sc_bws[OHCI_NO_INTRS];
u_int32_t sc_eintrs;
- ohci_soft_ed_t *sc_isoc_head;
- ohci_soft_ed_t *sc_ctrl_head;
- ohci_soft_ed_t *sc_bulk_head;
+ struct ohci_soft_ed *sc_isoc_head;
+ struct ohci_soft_ed *sc_ctrl_head;
+ struct ohci_soft_ed *sc_bulk_head;
LIST_HEAD(, ohci_soft_td) sc_hash_tds[OHCI_HASH_SIZE];
LIST_HEAD(, ohci_soft_itd) sc_hash_itds[OHCI_HASH_SIZE];
@@ -102,16 +102,16 @@ typedef struct ohci_softc {
char sc_softwake;
- ohci_soft_ed_t *sc_freeeds;
- ohci_soft_td_t *sc_freetds;
- ohci_soft_itd_t *sc_freeitds;
+ struct ohci_soft_ed *sc_freeeds;
+ struct ohci_soft_td *sc_freetds;
+ struct ohci_soft_itd *sc_freeitds;
SIMPLEQ_HEAD(, usbd_xfer) sc_free_xfers; /* free xfers */
- usbd_xfer_handle sc_intrxfer;
+ struct usbd_xfer *sc_intrxfer;
- ohci_soft_itd_t *sc_sidone;
- ohci_soft_td_t *sc_sdone;
+ struct ohci_soft_itd *sc_sidone;
+ struct ohci_soft_td *sc_sdone;
char sc_vendor[16];
int sc_id_vendor;
@@ -128,16 +128,16 @@ typedef struct ohci_softc {
struct timeout sc_tmo_rhsc;
struct device *sc_child;
-} ohci_softc_t;
+};
struct ohci_xfer {
struct usbd_xfer xfer;
struct usb_task abort_task;
};
-usbd_status ohci_checkrev(ohci_softc_t *);
-usbd_status ohci_handover(ohci_softc_t *);
-usbd_status ohci_init(ohci_softc_t *);
+usbd_status ohci_checkrev(struct ohci_softc *);
+usbd_status ohci_handover(struct ohci_softc *);
+usbd_status ohci_init(struct ohci_softc *);
int ohci_intr(void *);
-int ohci_detach(ohci_softc_t *, int);
+int ohci_detach(struct ohci_softc *, int);
int ohci_activate(struct device *, int);
diff --git a/sys/dev/usb/uark.c b/sys/dev/usb/uark.c
index 38b14b39781..1cba4f27437 100644
--- a/sys/dev/usb/uark.c
+++ b/sys/dev/usb/uark.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uark.c,v 1.16 2011/07/03 15:47:17 matthew Exp $ */
+/* $OpenBSD: uark.c,v 1.17 2013/04/15 09:23:01 mglocker Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -61,8 +61,8 @@ int uarkebug = 0;
struct uark_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
struct device *sc_subdev;
u_char sc_msr;
diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c
index 04439cb2dd5..29777f31b62 100644
--- a/sys/dev/usb/uaudio.c
+++ b/sys/dev/usb/uaudio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uaudio.c,v 1.98 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: uaudio.c,v 1.99 2013/04/15 09:23:01 mglocker Exp $ */
/* $NetBSD: uaudio.c,v 1.90 2004/10/29 17:12:53 kent Exp $ */
/*
@@ -108,10 +108,10 @@ struct as_info {
u_int8_t attributes; /* Copy of bmAttributes of
* usb_audio_streaming_endpoint_descriptor
*/
- usbd_interface_handle ifaceh;
+ struct usbd_interface *ifaceh;
const usb_interface_descriptor_t *idesc;
- const usb_endpoint_descriptor_audio_t *edesc;
- const usb_endpoint_descriptor_audio_t *edesc1;
+ const struct usb_endpoint_descriptor_audio *edesc;
+ const struct usb_endpoint_descriptor_audio *edesc1;
const struct usb_audio_streaming_type1_descriptor *asf1desc;
int sc_busy; /* currently used */
};
@@ -119,8 +119,8 @@ struct as_info {
struct chan {
void (*intr)(void *); /* DMA completion intr handler */
void *arg; /* arg for intr() */
- usbd_pipe_handle pipe;
- usbd_pipe_handle sync_pipe;
+ struct usbd_pipe *pipe;
+ struct usbd_pipe *sync_pipe;
u_int sample_size;
u_int sample_rate;
@@ -149,7 +149,7 @@ struct chan {
struct chanbuf {
struct chan *chan;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
u_char *buffer;
u_int16_t sizes[UAUDIO_MAX_FRAMES];
u_int16_t offsets[UAUDIO_MAX_FRAMES];
@@ -158,7 +158,7 @@ struct chan {
struct syncbuf {
struct chan *chan;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
u_char *buffer;
u_int16_t sizes[UAUDIO_MAX_FRAMES];
u_int16_t offsets[UAUDIO_MAX_FRAMES];
@@ -229,7 +229,7 @@ struct uaudio_devs {
struct uaudio_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev; /* USB device */
+ struct usbd_device *sc_udev; /* USB device */
int sc_ac_iface; /* Audio Control interface */
struct chan sc_playchan; /* play channel */
struct chan sc_recchan; /* record channel */
@@ -365,14 +365,14 @@ void uaudio_chan_init
void uaudio_chan_set_param(struct chan *, u_char *, u_char *, int);
void uaudio_chan_ptransfer(struct chan *);
void uaudio_chan_pintr
- (usbd_xfer_handle, usbd_private_handle, usbd_status);
+ (struct usbd_xfer *, void *, usbd_status);
void uaudio_chan_psync_transfer(struct chan *);
void uaudio_chan_psync_intr
- (usbd_xfer_handle, usbd_private_handle, usbd_status);
+ (struct usbd_xfer *, void *, usbd_status);
void uaudio_chan_rtransfer(struct chan *);
void uaudio_chan_rintr
- (usbd_xfer_handle, usbd_private_handle, usbd_status);
+ (struct usbd_xfer *, void *, usbd_status);
int uaudio_open(void *, int);
void uaudio_close(void *);
@@ -1650,8 +1650,8 @@ uaudio_process_as(struct uaudio_softc *sc, const char *buf, int *offsp,
{
const struct usb_audio_streaming_interface_descriptor *asid;
const struct usb_audio_streaming_type1_descriptor *asf1d;
- const usb_endpoint_descriptor_audio_t *ed;
- const usb_endpoint_descriptor_audio_t *sync_ed;
+ const struct usb_endpoint_descriptor_audio *ed;
+ const struct usb_endpoint_descriptor_audio *sync_ed;
const struct usb_audio_streaming_endpoint_descriptor *sed;
int format, chan, prec, enc, bps;
int dir, type, sync, sync_addr;
@@ -2822,7 +2822,7 @@ usbd_status
uaudio_chan_alloc_buffers(struct uaudio_softc *sc, struct chan *ch)
{
struct as_info *as = &sc->sc_alts[ch->altidx];
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
void *buf;
int i, size;
@@ -2972,7 +2972,7 @@ uaudio_chan_ptransfer(struct chan *ch)
}
void
-uaudio_chan_pintr(usbd_xfer_handle xfer, usbd_private_handle priv,
+uaudio_chan_pintr(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct chanbuf *cb = priv;
@@ -3029,7 +3029,7 @@ uaudio_chan_psync_transfer(struct chan *ch)
}
void
-uaudio_chan_psync_intr(usbd_xfer_handle xfer, usbd_private_handle priv,
+uaudio_chan_psync_intr(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct syncbuf *sb = priv;
@@ -3129,7 +3129,7 @@ uaudio_chan_rtransfer(struct chan *ch)
}
void
-uaudio_chan_rintr(usbd_xfer_handle xfer, usbd_private_handle priv,
+uaudio_chan_rintr(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct chanbuf *cb = priv;
diff --git a/sys/dev/usb/uaudioreg.h b/sys/dev/usb/uaudioreg.h
index 27048a525a4..bdc22696518 100644
--- a/sys/dev/usb/uaudioreg.h
+++ b/sys/dev/usb/uaudioreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uaudioreg.h,v 1.14 2010/07/23 19:59:09 jakemsr Exp $ */
+/* $OpenBSD: uaudioreg.h,v 1.15 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: uaudioreg.h,v 1.11 2002/10/23 02:32:37 christos Exp $ */
/*
@@ -48,7 +48,7 @@
#define UDESCSUB_AC_EXTENSION 8
/* The first fields are identical to usb_endpoint_descriptor_t */
-typedef struct {
+struct usb_endpoint_descriptor_audio {
uByte bLength;
uByte bDescriptorType;
uByte bEndpointAddress;
@@ -64,7 +64,7 @@ typedef struct {
*/
uByte bRefresh;
uByte bSynchAddress;
-} __packed usb_endpoint_descriptor_audio_t;
+} __packed;
#define USB_ENDPOINT_DESCRIPTOR_AUDIO_SIZE 9
struct usb_audio_control_descriptor {
diff --git a/sys/dev/usb/uberry.c b/sys/dev/usb/uberry.c
index 5b2bd018b38..8089f05e697 100644
--- a/sys/dev/usb/uberry.c
+++ b/sys/dev/usb/uberry.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uberry.c,v 1.20 2011/07/03 15:47:17 matthew Exp $ */
+/* $OpenBSD: uberry.c,v 1.21 2013/04/15 09:23:02 mglocker Exp $ */
/*-
* Copyright (c) 2006 Theo de Raadt <deraadt@openbsd.org>
@@ -38,8 +38,8 @@
struct uberry_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
};
#define UBERRY_INTERFACE_NO 0
diff --git a/sys/dev/usb/ubsa.c b/sys/dev/usb/ubsa.c
index 597ad10d294..43484a66606 100644
--- a/sys/dev/usb/ubsa.c
+++ b/sys/dev/usb/ubsa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubsa.c,v 1.56 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: ubsa.c,v 1.57 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: ubsa.c,v 1.5 2002/11/25 00:51:33 fvdl Exp $ */
/*-
* Copyright (c) 2002, Alexander Kabaev <kan.FreeBSD.org>.
@@ -146,13 +146,13 @@ int ubsadebug = 0;
struct ubsa_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev; /* USB device */
- usbd_interface_handle sc_iface; /* interface */
+ struct usbd_device *sc_udev; /* USB device */
+ struct usbd_interface *sc_iface; /* interface */
int sc_iface_number; /* interface number */
int sc_intr_number; /* interrupt number */
- usbd_pipe_handle sc_intr_pipe; /* interrupt pipe */
+ struct usbd_pipe *sc_intr_pipe; /* interrupt pipe */
u_char *sc_intr_buf; /* interrupt buffer */
int sc_isize;
@@ -168,7 +168,7 @@ struct ubsa_softc {
};
-void ubsa_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void ubsa_intr(struct usbd_xfer *, void *, usbd_status);
void ubsa_get_status(void *, int, u_char *, u_char *);
void ubsa_set(void *, int, int, int);
@@ -250,7 +250,7 @@ ubsa_attach(struct device *parent, struct device *self, void *aux)
{
struct ubsa_softc *sc = (struct ubsa_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
usb_config_descriptor_t *cdesc;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
@@ -666,14 +666,14 @@ ubsa_close(void *addr, int portno)
}
void
-ubsa_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+ubsa_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct ubsa_softc *sc = priv;
u_char *buf;
- usb_cdc_notification_t *cdcbuf;
+ struct usb_cdc_notification *cdcbuf;
buf = sc->sc_intr_buf;
- cdcbuf = (usb_cdc_notification_t *)sc->sc_intr_buf;
+ cdcbuf = (struct usb_cdc_notification *)sc->sc_intr_buf;
if (sc->sc_dying)
return;
diff --git a/sys/dev/usb/ubt.c b/sys/dev/usb/ubt.c
index 3a3de03a9c8..7b401cfca2e 100644
--- a/sys/dev/usb/ubt.c
+++ b/sys/dev/usb/ubt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubt.c,v 1.22 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: ubt.c,v 1.23 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: ubt.c,v 1.35 2008/07/28 14:19:26 drochner Exp $ */
/*-
@@ -142,7 +142,7 @@ int ubt_debug = UBT_DEBUG;
struct ubt_isoc_xfer {
struct ubt_softc *softc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
uint16_t size[UBT_NFRAMES];
int busy;
@@ -150,55 +150,55 @@ struct ubt_isoc_xfer {
struct ubt_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
int sc_refcnt;
int sc_dying;
int sc_enabled;
/* Control Interface */
- usbd_interface_handle sc_iface0;
+ struct usbd_interface *sc_iface0;
/* Commands (control) */
- usbd_xfer_handle sc_cmd_xfer;
+ struct usbd_xfer *sc_cmd_xfer;
uint8_t *sc_cmd_buf;
int sc_cmd_busy; /* write active */
struct ifqueue sc_cmd_queue; /* output queue */
/* Events (interrupt) */
int sc_evt_addr; /* endpoint address */
- usbd_pipe_handle sc_evt_pipe;
+ struct usbd_pipe *sc_evt_pipe;
uint8_t *sc_evt_buf;
/* ACL data (in) */
int sc_aclrd_addr; /* endpoint address */
- usbd_pipe_handle sc_aclrd_pipe; /* read pipe */
- usbd_xfer_handle sc_aclrd_xfer; /* read xfer */
+ struct usbd_pipe *sc_aclrd_pipe; /* read pipe */
+ struct usbd_xfer *sc_aclrd_xfer; /* read xfer */
uint8_t *sc_aclrd_buf; /* read buffer */
int sc_aclrd_busy; /* reading */
/* ACL data (out) */
int sc_aclwr_addr; /* endpoint address */
- usbd_pipe_handle sc_aclwr_pipe; /* write pipe */
- usbd_xfer_handle sc_aclwr_xfer; /* write xfer */
+ struct usbd_pipe *sc_aclwr_pipe; /* write pipe */
+ struct usbd_xfer *sc_aclwr_xfer; /* write xfer */
uint8_t *sc_aclwr_buf; /* write buffer */
int sc_aclwr_busy; /* write active */
struct ifqueue sc_aclwr_queue;/* output queue */
/* ISOC interface */
- usbd_interface_handle sc_iface1; /* ISOC interface */
+ struct usbd_interface *sc_iface1; /* ISOC interface */
int sc_config; /* current config no */
int sc_alt_config; /* no of alternates */
/* SCO data (in) */
int sc_scord_addr; /* endpoint address */
- usbd_pipe_handle sc_scord_pipe; /* read pipe */
+ struct usbd_pipe *sc_scord_pipe; /* read pipe */
int sc_scord_size; /* frame length */
struct ubt_isoc_xfer sc_scord[UBT_NXFERS];
struct mbuf *sc_scord_mbuf; /* current packet */
/* SCO data (out) */
int sc_scowr_addr; /* endpoint address */
- usbd_pipe_handle sc_scowr_pipe; /* write pipe */
+ struct usbd_pipe *sc_scowr_pipe; /* write pipe */
int sc_scowr_size; /* frame length */
struct ubt_isoc_xfer sc_scowr[UBT_NXFERS];
struct mbuf *sc_scowr_mbuf; /* current packet */
@@ -221,30 +221,24 @@ void ubt_disable(struct device *);
void ubt_xmit_cmd(struct device *, struct mbuf *);
void ubt_xmit_cmd_start(struct ubt_softc *);
-void ubt_xmit_cmd_complete(usbd_xfer_handle,
- usbd_private_handle, usbd_status);
+void ubt_xmit_cmd_complete(struct usbd_xfer *, void *, usbd_status);
void ubt_xmit_acl(struct device *, struct mbuf *);
void ubt_xmit_acl_start(struct ubt_softc *);
-void ubt_xmit_acl_complete(usbd_xfer_handle,
- usbd_private_handle, usbd_status);
+void ubt_xmit_acl_complete(struct usbd_xfer *, void *, usbd_status);
void ubt_xmit_sco(struct device *, struct mbuf *);
void ubt_xmit_sco_start(struct ubt_softc *);
void ubt_xmit_sco_start1(struct ubt_softc *, struct ubt_isoc_xfer *);
-void ubt_xmit_sco_complete(usbd_xfer_handle,
- usbd_private_handle, usbd_status);
+void ubt_xmit_sco_complete(struct usbd_xfer *, void *, usbd_status);
-void ubt_recv_event(usbd_xfer_handle,
- usbd_private_handle, usbd_status);
+void ubt_recv_event(struct usbd_xfer *, void *, usbd_status);
void ubt_recv_acl_start(struct ubt_softc *);
-void ubt_recv_acl_complete(usbd_xfer_handle,
- usbd_private_handle, usbd_status);
+void ubt_recv_acl_complete(struct usbd_xfer *, void *, usbd_status);
void ubt_recv_sco_start1(struct ubt_softc *, struct ubt_isoc_xfer *);
-void ubt_recv_sco_complete(usbd_xfer_handle,
- usbd_private_handle, usbd_status);
+void ubt_recv_sco_complete(struct usbd_xfer *, void *, usbd_status);
void ubt_stats(struct device *, struct bt_stats *, int);
@@ -941,8 +935,7 @@ ubt_xmit_cmd_start(struct ubt_softc *sc)
}
void
-ubt_xmit_cmd_complete(usbd_xfer_handle xfer,
- usbd_private_handle h, usbd_status status)
+ubt_xmit_cmd_complete(struct usbd_xfer *xfer, void *h, usbd_status status)
{
struct ubt_softc *sc = h;
uint32_t count;
@@ -1054,8 +1047,7 @@ ubt_xmit_acl_start(struct ubt_softc *sc)
}
void
-ubt_xmit_acl_complete(usbd_xfer_handle xfer,
- usbd_private_handle h, usbd_status status)
+ubt_xmit_acl_complete(struct usbd_xfer *xfer, void *h, usbd_status status)
{
struct ubt_softc *sc = h;
@@ -1204,8 +1196,7 @@ ubt_xmit_sco_start1(struct ubt_softc *sc, struct ubt_isoc_xfer *isoc)
}
void
-ubt_xmit_sco_complete(usbd_xfer_handle xfer,
- usbd_private_handle h, usbd_status status)
+ubt_xmit_sco_complete(struct usbd_xfer *xfer, void *h, usbd_status status)
{
struct ubt_isoc_xfer *isoc = h;
struct ubt_softc *sc;
@@ -1280,7 +1271,7 @@ ubt_mbufload(uint8_t *buf, int count, uint8_t type)
}
void
-ubt_recv_event(usbd_xfer_handle xfer, usbd_private_handle h, usbd_status status)
+ubt_recv_event(struct usbd_xfer *xfer, void *h, usbd_status status)
{
struct ubt_softc *sc = h;
struct mbuf *m;
@@ -1350,8 +1341,7 @@ ubt_recv_acl_start(struct ubt_softc *sc)
}
void
-ubt_recv_acl_complete(usbd_xfer_handle xfer,
- usbd_private_handle h, usbd_status status)
+ubt_recv_acl_complete(struct usbd_xfer *xfer, void *h, usbd_status status)
{
struct ubt_softc *sc = h;
struct mbuf *m;
@@ -1438,8 +1428,7 @@ ubt_recv_sco_start1(struct ubt_softc *sc, struct ubt_isoc_xfer *isoc)
}
void
-ubt_recv_sco_complete(usbd_xfer_handle xfer,
- usbd_private_handle h, usbd_status status)
+ubt_recv_sco_complete(struct usbd_xfer *xfer, void *h, usbd_status status)
{
struct ubt_isoc_xfer *isoc = h;
struct ubt_softc *sc;
diff --git a/sys/dev/usb/uchcom.c b/sys/dev/usb/uchcom.c
index 3bacf17c553..21cce2cd147 100644
--- a/sys/dev/usb/uchcom.c
+++ b/sys/dev/usb/uchcom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uchcom.c,v 1.15 2011/07/03 15:47:17 matthew Exp $ */
+/* $OpenBSD: uchcom.c,v 1.16 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: uchcom.c,v 1.1 2007/09/03 17:57:37 tshiozak Exp $ */
/*
@@ -109,14 +109,14 @@ int uchcomdebug = 0;
struct uchcom_softc
{
struct device sc_dev;
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
struct device *sc_subdev;
- usbd_interface_handle sc_iface;
+ struct usbd_interface *sc_iface;
int sc_dying;
/* */
int sc_intr_endpoint;
int sc_intr_size;
- usbd_pipe_handle sc_intr_pipe;
+ struct usbd_pipe *sc_intr_pipe;
u_char *sc_intr_buf;
/* */
uint8_t sc_version;
@@ -166,12 +166,11 @@ void uchcom_set(void *, int, int, int);
int uchcom_param(void *, int, struct termios *);
int uchcom_open(void *, int);
void uchcom_close(void *, int);
-void uchcom_intr(usbd_xfer_handle, usbd_private_handle,
- usbd_status);
+void uchcom_intr(struct usbd_xfer *, void *, usbd_status);
int uchcom_set_config(struct uchcom_softc *);
int uchcom_find_ifaces(struct uchcom_softc *,
- usbd_interface_handle *);
+ struct usbd_interface **);
int uchcom_find_endpoints(struct uchcom_softc *,
struct uchcom_endpoints *);
void uchcom_close_intr_pipe(struct uchcom_softc *);
@@ -259,7 +258,7 @@ uchcom_attach(struct device *parent, struct device *self, void *aux)
struct uchcom_softc *sc = (struct uchcom_softc *)self;
struct usb_attach_arg *uaa = aux;
struct ucom_attach_args uca;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
struct uchcom_endpoints endpoints;
sc->sc_udev = dev;
@@ -363,7 +362,7 @@ uchcom_set_config(struct uchcom_softc *sc)
}
int
-uchcom_find_ifaces(struct uchcom_softc *sc, usbd_interface_handle *riface)
+uchcom_find_ifaces(struct uchcom_softc *sc, struct usbd_interface **riface)
{
usbd_status err;
@@ -1009,8 +1008,7 @@ uchcom_close(void *arg, int portno)
* callback when the modem status is changed.
*/
void
-uchcom_intr(usbd_xfer_handle xfer, usbd_private_handle priv,
- usbd_status status)
+uchcom_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct uchcom_softc *sc = priv;
u_char *buf = sc->sc_intr_buf;
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
index ac156b636c6..a5d2c3a6792 100644
--- a/sys/dev/usb/ucom.c
+++ b/sys/dev/usb/ucom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ucom.c,v 1.57 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: ucom.c,v 1.58 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: ucom.c,v 1.49 2003/01/01 00:10:25 thorpej Exp $ */
/*
@@ -80,28 +80,28 @@ int ucomdebug = 0;
struct ucom_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev; /* USB device */
+ struct usbd_device *sc_udev; /* USB device */
struct uhidev_softc *sc_uhidev; /* hid device (if deeper) */
- usbd_interface_handle sc_iface; /* data interface */
+ struct usbd_interface *sc_iface; /* data interface */
int sc_bulkin_no; /* bulk in endpoint address */
- usbd_pipe_handle sc_bulkin_pipe; /* bulk in pipe */
- usbd_xfer_handle sc_ixfer; /* read request */
+ struct usbd_pipe *sc_bulkin_pipe;/* bulk in pipe */
+ struct usbd_xfer *sc_ixfer; /* read request */
u_char *sc_ibuf; /* read buffer */
u_int sc_ibufsize; /* read buffer size */
u_int sc_ibufsizepad; /* read buffer size padded */
int sc_bulkout_no; /* bulk out endpoint address */
- usbd_pipe_handle sc_bulkout_pipe;/* bulk out pipe */
- usbd_xfer_handle sc_oxfer; /* write request */
+ struct usbd_pipe *sc_bulkout_pipe;/* bulk out pipe */
+ struct usbd_xfer *sc_oxfer; /* write request */
u_char *sc_obuf; /* write buffer */
u_int sc_obufsize; /* write buffer size */
u_int sc_opkthdrlen; /* header length of
* output packet */
- usbd_pipe_handle sc_ipipe; /* hid interrupt input pipe */
- usbd_pipe_handle sc_opipe; /* hid interrupt pipe */
+ struct usbd_pipe *sc_ipipe; /* hid interrupt input pipe */
+ struct usbd_pipe *sc_opipe; /* hid interrupt pipe */
struct ucom_methods *sc_methods;
void *sc_parent;
@@ -133,8 +133,8 @@ void ucom_dtr(struct ucom_softc *, int);
void ucom_rts(struct ucom_softc *, int);
void ucom_break(struct ucom_softc *, int);
usbd_status ucomstartread(struct ucom_softc *);
-void ucomreadcb(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void ucomwritecb(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void ucomreadcb(struct usbd_xfer *, void *, usbd_status);
+void ucomwritecb(struct usbd_xfer *, void *, usbd_status);
void tiocm_to_ucom(struct ucom_softc *, u_long, int);
int ucom_to_tiocm(struct ucom_softc *);
void ucom_lock(struct ucom_softc *);
@@ -959,11 +959,11 @@ ucomstart(struct tty *tp)
#endif
if (sc->sc_bulkout_pipe != NULL) {
usbd_setup_xfer(sc->sc_oxfer, sc->sc_bulkout_pipe,
- (usbd_private_handle)sc, sc->sc_obuf, cnt,
+ (void *)sc, sc->sc_obuf, cnt,
USBD_NO_COPY, USBD_NO_TIMEOUT, ucomwritecb);
} else {
usbd_setup_xfer(sc->sc_oxfer, sc->sc_opipe,
- (usbd_private_handle)sc, sc->sc_obuf, cnt,
+ (void *)sc, sc->sc_obuf, cnt,
USBD_NO_COPY, USBD_NO_TIMEOUT, ucomwritecb);
}
/* What can we do on error? */
@@ -998,7 +998,7 @@ ucomstop(struct tty *tp, int flag)
}
void
-ucomwritecb(usbd_xfer_handle xfer, usbd_private_handle p, usbd_status status)
+ucomwritecb(struct usbd_xfer *xfer, void *p, usbd_status status)
{
struct ucom_softc *sc = (struct ucom_softc *)p;
struct tty *tp = sc->sc_tty;
@@ -1057,7 +1057,7 @@ ucomstartread(struct ucom_softc *sc)
if (sc->sc_bulkin_pipe != NULL) {
usbd_setup_xfer(sc->sc_ixfer, sc->sc_bulkin_pipe,
- (usbd_private_handle)sc,
+ (void *)sc,
sc->sc_ibuf, sc->sc_ibufsize,
USBD_SHORT_XFER_OK | USBD_NO_COPY,
USBD_NO_TIMEOUT, ucomreadcb);
@@ -1072,7 +1072,7 @@ ucomstartread(struct ucom_softc *sc)
}
void
-ucomreadcb(usbd_xfer_handle xfer, usbd_private_handle p, usbd_status status)
+ucomreadcb(struct usbd_xfer *xfer, void *p, usbd_status status)
{
struct ucom_softc *sc = (struct ucom_softc *)p;
struct tty *tp = sc->sc_tty;
diff --git a/sys/dev/usb/ucomvar.h b/sys/dev/usb/ucomvar.h
index 9732dba92b6..216725b439b 100644
--- a/sys/dev/usb/ucomvar.h
+++ b/sys/dev/usb/ucomvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ucomvar.h,v 1.17 2008/06/26 05:42:18 ray Exp $ */
+/* $OpenBSD: ucomvar.h,v 1.18 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: ucomvar.h,v 1.10 2001/12/31 12:15:21 augustss Exp $ */
/*
@@ -91,8 +91,8 @@ struct ucom_attach_args {
u_int obufsize;
u_int opkthdrlen;
const char *info; /* attach message */
- usbd_device_handle device;
- usbd_interface_handle iface;
+ struct usbd_device *device;
+ struct usbd_interface *iface;
struct ucom_methods *methods;
void *arg;
};
diff --git a/sys/dev/usb/ucycom.c b/sys/dev/usb/ucycom.c
index f8aa9e43eab..ef3c06ff899 100644
--- a/sys/dev/usb/ucycom.c
+++ b/sys/dev/usb/ucycom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ucycom.c,v 1.21 2013/03/28 03:31:55 tedu Exp $ */
+/* $OpenBSD: ucycom.c,v 1.22 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: ucycom.c,v 1.3 2005/08/05 07:27:47 skrll Exp $ */
/*
@@ -99,7 +99,7 @@ int ucycomdebug = 200;
struct ucycom_softc {
struct uhidev sc_hdev;
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
/* uhidev parameters */
size_t sc_flen; /* feature report length */
@@ -188,7 +188,7 @@ ucycom_attach(struct device *parent, struct device *self, void *aux)
struct ucycom_softc *sc = (struct ucycom_softc *)self;
struct usb_attach_arg *uaa = aux;
struct uhidev_attach_arg *uha = (struct uhidev_attach_arg *)uaa;
- usbd_device_handle dev = uha->parent->sc_udev;
+ struct usbd_device *dev = uha->parent->sc_udev;
struct ucom_attach_args uca;
int size, repid, err;
void *desc;
@@ -473,7 +473,7 @@ ucycom_param(void *addr, int portno, struct termios *t)
void
ucycom_intr(struct uhidev *addr, void *ibuf, u_int len)
{
- extern void ucomreadcb(usbd_xfer_handle, usbd_private_handle, usbd_status);
+ extern void ucomreadcb(struct usbd_xfer *, void *, usbd_status);
struct ucycom_softc *sc = (struct ucycom_softc *)addr;
uint8_t *cp = ibuf;
int n, st, s;
diff --git a/sys/dev/usb/udcf.c b/sys/dev/usb/udcf.c
index fdb35606ef5..184c42ec403 100644
--- a/sys/dev/usb/udcf.c
+++ b/sys/dev/usb/udcf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udcf.c,v 1.56 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: udcf.c,v 1.57 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2006, 2007, 2008 Marc Balmer <mbalmer@openbsd.org>
@@ -65,8 +65,8 @@ static const char *clockname[2] = {
struct udcf_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev; /* USB device */
- usbd_interface_handle sc_iface; /* data interface */
+ struct usbd_device *sc_udev; /* USB device */
+ struct usbd_interface *sc_iface; /* data interface */
struct timeout sc_to;
struct usb_task sc_task;
@@ -178,8 +178,8 @@ udcf_attach(struct device *parent, struct device *self, void *aux)
{
struct udcf_softc *sc = (struct udcf_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
- usbd_interface_handle iface;
+ struct usbd_device *dev = uaa->device;
+ struct usbd_interface *iface;
struct timeval t;
usbd_status err;
diff --git a/sys/dev/usb/udfu.c b/sys/dev/usb/udfu.c
index fc5b74f5d65..7097f61f109 100644
--- a/sys/dev/usb/udfu.c
+++ b/sys/dev/usb/udfu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udfu.c,v 1.4 2011/07/03 15:47:17 matthew Exp $ */
+/* $OpenBSD: udfu.c,v 1.5 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2009 Federico G. Schwindt <fgsch@openbsd.org>
@@ -47,7 +47,7 @@
#define DFU_GETSTATE UT_READ_CLASS_INTERFACE, 5
#define DFU_STATE_appIDLE 0
-typedef struct {
+struct dfu_functional_descriptor {
uByte bLength;
uByte bDescriptorType;
uByte bmAttributes;
@@ -55,13 +55,13 @@ typedef struct {
uWord wDetachTimeOut;
uWord wTransferSize;
uWord bcdDFUVersion;
-} __packed dfu_functional_descriptor_t;
+} __packed;
#define UDFU_DETACH_TIMEOUT 1000 /* in milliseconds */
struct udfu_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
int sc_iface_index;
@@ -181,9 +181,9 @@ udfu_activate(struct device *self, int act)
void
udfu_parse_desc(struct udfu_softc *sc)
{
- dfu_functional_descriptor_t *dd;
+ struct dfu_functional_descriptor *dd;
const usb_descriptor_t *desc;
- usbd_desc_iter_t iter;
+ struct usbd_desc_iter iter;
usb_desc_iter_init(sc->sc_udev, &iter);
while ((desc = usb_desc_iter_next(&iter))) {
@@ -194,7 +194,7 @@ udfu_parse_desc(struct udfu_softc *sc)
if (!desc)
return;
- dd = (dfu_functional_descriptor_t *)desc;
+ dd = (struct dfu_functional_descriptor *)desc;
DPRINTF(("%s: %s: bLength=%d bDescriptorType=%d bmAttributes=%d "
"wDetachTimeOut=%d wTransferSize=%d bcdDFUVersion=%d\n",
diff --git a/sys/dev/usb/udl.c b/sys/dev/usb/udl.c
index d3f831a3de0..a8a966e3e71 100644
--- a/sys/dev/usb/udl.c
+++ b/sys/dev/usb/udl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udl.c,v 1.72 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: udl.c,v 1.73 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2009 Marcus Glocker <mglocker@openbsd.org>
@@ -134,8 +134,7 @@ void udl_cmd_write_reg_1(struct udl_softc *, uint8_t, uint8_t);
void udl_cmd_write_reg_3(struct udl_softc *, uint8_t, uint32_t);
usbd_status udl_cmd_send(struct udl_softc *);
usbd_status udl_cmd_send_async(struct udl_softc *);
-void udl_cmd_send_async_cb(usbd_xfer_handle, usbd_private_handle,
- usbd_status);
+void udl_cmd_send_async_cb(struct usbd_xfer *, void *, usbd_status);
usbd_status udl_init_chip(struct udl_softc *);
void udl_init_fb_offsets(struct udl_softc *, uint32_t, uint32_t,
@@ -1852,8 +1851,7 @@ udl_cmd_send_async(struct udl_softc *sc)
}
void
-udl_cmd_send_async_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
- usbd_status status)
+udl_cmd_send_async_cb(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct udl_cmd_xfer *cx = priv;
struct udl_softc *sc = cx->sc;
diff --git a/sys/dev/usb/udl.h b/sys/dev/usb/udl.h
index 80a9155a3d1..a969267e664 100644
--- a/sys/dev/usb/udl.h
+++ b/sys/dev/usb/udl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: udl.h,v 1.20 2012/12/05 08:35:56 jasper Exp $ */
+/* $OpenBSD: udl.h,v 1.21 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2009 Marcus Glocker <mglocker@openbsd.org>
@@ -30,7 +30,7 @@
struct udl_cmd_xfer {
struct udl_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t busy;
uint8_t *buf;
};
@@ -51,9 +51,9 @@ struct udl_cmd_buf {
*/
struct udl_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
- usbd_pipe_handle sc_tx_pipeh;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
+ struct usbd_pipe *sc_tx_pipeh;
/* wsdisplay glue */
struct device *sc_wsdisplay;
diff --git a/sys/dev/usb/udsbr.c b/sys/dev/usb/udsbr.c
index 02fdb98a41a..de701ff6c68 100644
--- a/sys/dev/usb/udsbr.c
+++ b/sys/dev/usb/udsbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udsbr.c,v 1.23 2011/07/03 15:47:17 matthew Exp $ */
+/* $OpenBSD: udsbr.c,v 1.24 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: udsbr.c,v 1.7 2002/07/11 21:14:27 augustss Exp $ */
/*
@@ -76,7 +76,7 @@ struct radio_hw_if udsbr_hw_if = {
struct udsbr_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
char sc_mute;
char sc_vol;
@@ -131,7 +131,7 @@ udsbr_attach(struct device *parent, struct device *self, void *aux)
{
struct udsbr_softc *sc = (struct udsbr_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
usbd_status err;
DPRINTFN(10,("udsbr_attach: sc=%p\n", sc));
diff --git a/sys/dev/usb/ueagle.c b/sys/dev/usb/ueagle.c
index d61da52d60c..d12fe974811 100644
--- a/sys/dev/usb/ueagle.c
+++ b/sys/dev/usb/ueagle.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ueagle.c,v 1.37 2013/04/12 12:58:39 mpi Exp $ */
+/* $OpenBSD: ueagle.c,v 1.38 2013/04/15 09:23:02 mglocker Exp $ */
/*-
* Copyright (c) 2003-2006
@@ -104,14 +104,11 @@ void ueagle_stat_thread(void *);
int ueagle_boot(struct ueagle_softc *);
void ueagle_swap_intr(struct ueagle_softc *, struct ueagle_swap *);
void ueagle_cmv_intr(struct ueagle_softc *, struct ueagle_cmv *);
-void ueagle_intr(usbd_xfer_handle, usbd_private_handle,
- usbd_status);
+void ueagle_intr(struct usbd_xfer *, void *, usbd_status);
uint32_t ueagle_crc_update(uint32_t, uint8_t *, int);
void ueagle_push_cell(struct ueagle_softc *, uint8_t *);
-void ueagle_rxeof(usbd_xfer_handle, usbd_private_handle,
- usbd_status);
-void ueagle_txeof(usbd_xfer_handle, usbd_private_handle,
- usbd_status);
+void ueagle_rxeof(struct usbd_xfer *, void *, usbd_status);
+void ueagle_txeof(struct usbd_xfer *, void *, usbd_status);
int ueagle_encap(struct ueagle_softc *, struct mbuf *);
void ueagle_start(struct ifnet *);
int ueagle_open_vcc(struct ueagle_softc *,
@@ -304,7 +301,7 @@ void
ueagle_loadpage(void *xsc)
{
struct ueagle_softc *sc = xsc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
struct ueagle_block_info bi;
uint16_t pageno = sc->pageno;
uint16_t ovl = sc->ovl;
@@ -688,7 +685,7 @@ ueagle_cmv_intr(struct ueagle_softc *sc, struct ueagle_cmv *cmv)
}
void
-ueagle_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+ueagle_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct ueagle_softc *sc = priv;
struct ueagle_intr *intr;
@@ -899,8 +896,7 @@ fail: m_freem(vcc->m);
}
void
-ueagle_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv,
- usbd_status status)
+ueagle_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct ueagle_isoreq *req = priv;
struct ueagle_softc *sc = req->sc;
@@ -935,8 +931,7 @@ ueagle_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv,
}
void
-ueagle_txeof(usbd_xfer_handle xfer, usbd_private_handle priv,
- usbd_status status)
+ueagle_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct ueagle_txreq *req = priv;
struct ueagle_softc *sc = req->sc;
@@ -1196,7 +1191,7 @@ int
ueagle_open_pipes(struct ueagle_softc *sc)
{
usb_endpoint_descriptor_t *edesc;
- usbd_interface_handle iface;
+ struct usbd_interface *iface;
struct ueagle_txreq *txreq;
struct ueagle_isoreq *isoreq;
usbd_status error;
@@ -1354,7 +1349,7 @@ int
ueagle_init(struct ifnet *ifp)
{
struct ueagle_softc *sc = ifp->if_softc;
- usbd_interface_handle iface;
+ struct usbd_interface *iface;
usbd_status error;
size_t len;
diff --git a/sys/dev/usb/ueaglevar.h b/sys/dev/usb/ueaglevar.h
index f5c39281568..73ec0d7270b 100644
--- a/sys/dev/usb/ueaglevar.h
+++ b/sys/dev/usb/ueaglevar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ueaglevar.h,v 1.3 2010/12/06 04:41:40 jakemsr Exp $ */
+/* $OpenBSD: ueaglevar.h,v 1.4 2013/04/15 09:23:02 mglocker Exp $ */
/*-
* Copyright (c) 2003-2005
@@ -108,14 +108,14 @@ struct ueagle_softc;
struct ueagle_isoreq {
struct ueagle_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint16_t frlengths[UEAGLE_NISOFRMS];
uint8_t *offsets[UEAGLE_NISOFRMS];
};
struct ueagle_txreq {
struct ueagle_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
uint8_t *buf;
};
@@ -159,7 +159,7 @@ struct ueagle_softc {
struct device sc_dev;
struct ifnet sc_if;
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
struct proc *stat_thread;
struct usb_task sc_swap_task;
@@ -171,10 +171,10 @@ struct ueagle_softc {
struct usb_task sc_init_task;
- usbd_pipe_handle pipeh_tx;
- usbd_pipe_handle pipeh_rx;
- usbd_pipe_handle pipeh_idma;
- usbd_pipe_handle pipeh_intr;
+ struct usbd_pipe *pipeh_tx;
+ struct usbd_pipe *pipeh_rx;
+ struct usbd_pipe *pipeh_idma;
+ struct usbd_pipe *pipeh_intr;
struct ueagle_isoreq isoreqs[UEAGLE_NISOREQS];
struct ueagle_txreq txreqs[UEAGLE_TX_LIST_CNT];
diff --git a/sys/dev/usb/uftdi.c b/sys/dev/usb/uftdi.c
index 5c524638454..5e52060f803 100644
--- a/sys/dev/usb/uftdi.c
+++ b/sys/dev/usb/uftdi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uftdi.c,v 1.63 2012/09/11 16:04:44 deraadt Exp $ */
+/* $OpenBSD: uftdi.c,v 1.64 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: uftdi.c,v 1.14 2003/02/23 04:20:07 simonb Exp $ */
/*
@@ -79,8 +79,8 @@ int uftdidebug = 0;
struct uftdi_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev; /* device */
- usbd_interface_handle sc_iface; /* interface */
+ struct usbd_device *sc_udev; /* device */
+ struct usbd_interface *sc_iface; /* interface */
enum uftdi_type sc_type;
u_int sc_hdrlen;
@@ -788,8 +788,8 @@ uftdi_attach(struct device *parent, struct device *self, void *aux)
{
struct uftdi_softc *sc = (struct uftdi_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
- usbd_interface_handle iface;
+ struct usbd_device *dev = uaa->device;
+ struct usbd_interface *iface;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
char *devname = sc->sc_dev.dv_xname;
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index 513805594b3..1fd5dda6543 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ugen.c,v 1.70 2013/04/01 19:49:53 mglocker Exp $ */
+/* $OpenBSD: ugen.c,v 1.71 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */
/* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -71,11 +71,11 @@ int ugendebug = 0;
struct ugen_endpoint {
struct ugen_softc *sc;
usb_endpoint_descriptor_t *edesc;
- usbd_interface_handle iface;
+ struct usbd_interface *iface;
int state;
#define UGEN_ASLP 0x02 /* waiting for data */
#define UGEN_SHORT_OK 0x04 /* short xfers are OK */
- usbd_pipe_handle pipeh;
+ struct usbd_pipe *pipeh;
struct clist q;
struct selinfo rsel;
u_char *ibuf; /* start of buffer (circular for isoc) */
@@ -85,7 +85,7 @@ struct ugen_endpoint {
u_int32_t timeout;
struct isoreq {
struct ugen_endpoint *sce;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
void *dmabuf;
u_int16_t sizes[UGEN_NISORFRMS];
} isoreqs[UGEN_NISOREQS];
@@ -93,7 +93,7 @@ struct ugen_endpoint {
struct ugen_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
char sc_is_open[USB_MAX_ENDPOINTS];
struct ugen_endpoint sc_endpoints[USB_MAX_ENDPOINTS][2];
@@ -105,10 +105,8 @@ struct ugen_softc {
u_char sc_secondary;
};
-void ugenintr(usbd_xfer_handle xfer, usbd_private_handle addr,
- usbd_status status);
-void ugen_isoc_rintr(usbd_xfer_handle xfer, usbd_private_handle addr,
- usbd_status status);
+void ugenintr(struct usbd_xfer *xfer, void *addr, usbd_status status);
+void ugen_isoc_rintr(struct usbd_xfer *xfer, void *addr, usbd_status status);
int ugen_do_read(struct ugen_softc *, int, struct uio *, int);
int ugen_do_write(struct ugen_softc *, int, struct uio *, int);
int ugen_do_ioctl(struct ugen_softc *, int, u_long,
@@ -158,7 +156,7 @@ ugen_attach(struct device *parent, struct device *self, void *aux)
{
struct ugen_softc *sc = (struct ugen_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle udev;
+ struct usbd_device *udev;
usbd_status err;
int conf;
@@ -192,9 +190,9 @@ ugen_attach(struct device *parent, struct device *self, void *aux)
int
ugen_set_config(struct ugen_softc *sc, int configno)
{
- usbd_device_handle dev = sc->sc_udev;
+ struct usbd_device *dev = sc->sc_udev;
usb_config_descriptor_t *cdesc;
- usbd_interface_handle iface;
+ struct usbd_interface *iface;
usb_endpoint_descriptor_t *ed;
struct ugen_endpoint *sce;
u_int8_t niface, nendpt;
@@ -275,7 +273,7 @@ ugenopen(dev_t dev, int flag, int mode, struct proc *p)
struct ugen_endpoint *sce;
int dir, isize;
usbd_status err;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
void *buf;
int i, j;
@@ -477,7 +475,7 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag)
struct ugen_endpoint *sce = &sc->sc_endpoints[endpt][IN];
u_int32_t n, tn;
char buf[UGEN_BBSIZE];
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
usbd_status err;
int s;
int error = 0;
@@ -644,7 +642,7 @@ ugen_do_write(struct ugen_softc *sc, int endpt, struct uio *uio, int flag)
u_int32_t n;
int error = 0;
char buf[UGEN_BBSIZE];
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
usbd_status err;
DPRINTFN(5, ("%s: ugenwrite: %d\n", sc->sc_dev.dv_xname, endpt));
@@ -792,7 +790,7 @@ ugen_detach(struct device *self, int flags)
}
void
-ugenintr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
+ugenintr(struct usbd_xfer *xfer, void *addr, usbd_status status)
{
struct ugen_endpoint *sce = addr;
/*struct ugen_softc *sc = sce->sc;*/
@@ -828,8 +826,7 @@ ugenintr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
}
void
-ugen_isoc_rintr(usbd_xfer_handle xfer, usbd_private_handle addr,
- usbd_status status)
+ugen_isoc_rintr(struct usbd_xfer *xfer, void *addr, usbd_status status)
{
struct isoreq *req = addr;
struct ugen_endpoint *sce = req->sce;
@@ -889,7 +886,7 @@ ugen_isoc_rintr(usbd_xfer_handle xfer, usbd_private_handle addr,
usbd_status
ugen_set_interface(struct ugen_softc *sc, int ifaceidx, int altno)
{
- usbd_interface_handle iface;
+ struct usbd_interface *iface;
usb_endpoint_descriptor_t *ed;
usbd_status err;
struct ugen_endpoint *sce;
@@ -946,7 +943,7 @@ out:
int
ugen_get_alt_index(struct ugen_softc *sc, int ifaceidx)
{
- usbd_interface_handle iface;
+ struct usbd_interface *iface;
usbd_status err;
err = usbd_device2interface_handle(sc->sc_udev, ifaceidx, &iface);
@@ -961,7 +958,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
{
struct ugen_endpoint *sce;
usbd_status err;
- usbd_interface_handle iface;
+ struct usbd_interface *iface;
struct usb_config_desc *cd;
usb_config_descriptor_t *cdesc;
struct usb_interface_desc *id;
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 83a8727e714..75e34fa69ca 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci.c,v 1.93 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: uhci.c,v 1.94 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -70,7 +70,7 @@ struct cfdriver uhci_cd = {
};
#ifdef UHCI_DEBUG
-uhci_softc_t *thesc;
+struct uhci_softc *thesc;
#define DPRINTF(x) if (uhcidebug) printf x
#define DPRINTFN(n,x) if (uhcidebug>(n)) printf x
int uhcidebug = 0;
@@ -93,147 +93,148 @@ struct uhci_pipe {
int nexttoggle;
u_char aborting;
- usbd_xfer_handle abortstart, abortend;
+ struct usbd_xfer *abortstart, *abortend;
/* Info needed for different pipe kinds. */
union {
/* Control pipe */
struct {
- uhci_soft_qh_t *sqh;
- usb_dma_t reqdma;
- uhci_soft_td_t *setup, *stat;
+ struct uhci_soft_qh *sqh;
+ struct usb_dma reqdma;
+ struct uhci_soft_td *setup, *stat;
u_int length;
} ctl;
/* Interrupt pipe */
struct {
int npoll;
int isread;
- uhci_soft_qh_t **qhs;
+ struct uhci_soft_qh **qhs;
} intr;
/* Bulk pipe */
struct {
- uhci_soft_qh_t *sqh;
+ struct uhci_soft_qh *sqh;
u_int length;
int isread;
} bulk;
/* Iso pipe */
struct iso {
- uhci_soft_td_t **stds;
+ struct uhci_soft_td **stds;
int next, inuse;
} iso;
} u;
};
-void uhci_globalreset(uhci_softc_t *);
-usbd_status uhci_portreset(uhci_softc_t*, int);
-void uhci_reset(uhci_softc_t *);
+void uhci_globalreset(struct uhci_softc *);
+usbd_status uhci_portreset(struct uhci_softc *, int);
+void uhci_reset(struct uhci_softc *);
void uhci_shutdown(void *v);
-usbd_status uhci_run(uhci_softc_t *, int run);
-uhci_soft_td_t *uhci_alloc_std(uhci_softc_t *);
-void uhci_free_std(uhci_softc_t *, uhci_soft_td_t *);
-uhci_soft_qh_t *uhci_alloc_sqh(uhci_softc_t *);
-void uhci_free_sqh(uhci_softc_t *, uhci_soft_qh_t *);
+usbd_status uhci_run(struct uhci_softc *, int run);
+struct uhci_soft_td *uhci_alloc_std(struct uhci_softc *);
+void uhci_free_std(struct uhci_softc *, struct uhci_soft_td *);
+struct uhci_soft_qh *uhci_alloc_sqh(struct uhci_softc *);
+void uhci_free_sqh(struct uhci_softc *, struct uhci_soft_qh *);
#if 0
-void uhci_enter_ctl_q(uhci_softc_t *, uhci_soft_qh_t *,
- uhci_intr_info_t *);
-void uhci_exit_ctl_q(uhci_softc_t *, uhci_soft_qh_t *);
+void uhci_enter_ctl_q(struct uhci_softc *, struct uhci_soft_qh *,
+ struct uhci_intr_info *);
+void uhci_exit_ctl_q(struct uhci_softc *, struct uhci_soft_qh *);
#endif
-void uhci_free_std_chain(uhci_softc_t *,
- uhci_soft_td_t *, uhci_soft_td_t *);
+void uhci_free_std_chain(struct uhci_softc *,
+ struct uhci_soft_td *, struct uhci_soft_td *);
usbd_status uhci_alloc_std_chain(struct uhci_pipe *,
- uhci_softc_t *, u_int, int, u_int16_t, usb_dma_t *,
- uhci_soft_td_t **, uhci_soft_td_t **);
+ struct uhci_softc *, u_int, int, u_int16_t,
+ struct usb_dma *, struct uhci_soft_td **,
+ struct uhci_soft_td **);
void uhci_poll_hub(void *);
-void uhci_waitintr(uhci_softc_t *, usbd_xfer_handle);
-void uhci_check_intr(uhci_softc_t *, uhci_intr_info_t *);
-void uhci_idone(uhci_intr_info_t *);
+void uhci_waitintr(struct uhci_softc *, struct usbd_xfer *);
+void uhci_check_intr(struct uhci_softc *, struct uhci_intr_info *);
+void uhci_idone(struct uhci_intr_info *);
-void uhci_abort_xfer(usbd_xfer_handle, usbd_status status);
+void uhci_abort_xfer(struct usbd_xfer *, usbd_status status);
void uhci_timeout(void *);
void uhci_timeout_task(void *);
-void uhci_add_ls_ctrl(uhci_softc_t *, uhci_soft_qh_t *);
-void uhci_add_hs_ctrl(uhci_softc_t *, uhci_soft_qh_t *);
-void uhci_add_bulk(uhci_softc_t *, uhci_soft_qh_t *);
-void uhci_remove_ls_ctrl(uhci_softc_t *,uhci_soft_qh_t *);
-void uhci_remove_hs_ctrl(uhci_softc_t *,uhci_soft_qh_t *);
-void uhci_remove_bulk(uhci_softc_t *,uhci_soft_qh_t *);
+void uhci_add_ls_ctrl(struct uhci_softc *, struct uhci_soft_qh *);
+void uhci_add_hs_ctrl(struct uhci_softc *, struct uhci_soft_qh *);
+void uhci_add_bulk(struct uhci_softc *, struct uhci_soft_qh *);
+void uhci_remove_ls_ctrl(struct uhci_softc *, struct uhci_soft_qh *);
+void uhci_remove_hs_ctrl(struct uhci_softc *, struct uhci_soft_qh *);
+void uhci_remove_bulk(struct uhci_softc *,struct uhci_soft_qh *);
int uhci_str(usb_string_descriptor_t *, int, char *);
-void uhci_add_loop(uhci_softc_t *sc);
-void uhci_rem_loop(uhci_softc_t *sc);
-
-usbd_status uhci_setup_isoc(usbd_pipe_handle pipe);
-void uhci_device_isoc_enter(usbd_xfer_handle);
-
-usbd_status uhci_allocm(struct usbd_bus *, usb_dma_t *, u_int32_t);
-void uhci_freem(struct usbd_bus *, usb_dma_t *);
-
-usbd_xfer_handle uhci_allocx(struct usbd_bus *);
-void uhci_freex(struct usbd_bus *, usbd_xfer_handle);
-
-usbd_status uhci_device_ctrl_transfer(usbd_xfer_handle);
-usbd_status uhci_device_ctrl_start(usbd_xfer_handle);
-void uhci_device_ctrl_abort(usbd_xfer_handle);
-void uhci_device_ctrl_close(usbd_pipe_handle);
-void uhci_device_ctrl_done(usbd_xfer_handle);
-
-usbd_status uhci_device_intr_transfer(usbd_xfer_handle);
-usbd_status uhci_device_intr_start(usbd_xfer_handle);
-void uhci_device_intr_abort(usbd_xfer_handle);
-void uhci_device_intr_close(usbd_pipe_handle);
-void uhci_device_intr_done(usbd_xfer_handle);
-
-usbd_status uhci_device_bulk_transfer(usbd_xfer_handle);
-usbd_status uhci_device_bulk_start(usbd_xfer_handle);
-void uhci_device_bulk_abort(usbd_xfer_handle);
-void uhci_device_bulk_close(usbd_pipe_handle);
-void uhci_device_bulk_done(usbd_xfer_handle);
-
-usbd_status uhci_device_isoc_transfer(usbd_xfer_handle);
-usbd_status uhci_device_isoc_start(usbd_xfer_handle);
-void uhci_device_isoc_abort(usbd_xfer_handle);
-void uhci_device_isoc_close(usbd_pipe_handle);
-void uhci_device_isoc_done(usbd_xfer_handle);
-
-usbd_status uhci_root_ctrl_transfer(usbd_xfer_handle);
-usbd_status uhci_root_ctrl_start(usbd_xfer_handle);
-void uhci_root_ctrl_abort(usbd_xfer_handle);
-void uhci_root_ctrl_close(usbd_pipe_handle);
-void uhci_root_ctrl_done(usbd_xfer_handle);
-
-usbd_status uhci_root_intr_transfer(usbd_xfer_handle);
-usbd_status uhci_root_intr_start(usbd_xfer_handle);
-void uhci_root_intr_abort(usbd_xfer_handle);
-void uhci_root_intr_close(usbd_pipe_handle);
-void uhci_root_intr_done(usbd_xfer_handle);
-
-usbd_status uhci_open(usbd_pipe_handle);
+void uhci_add_loop(struct uhci_softc *sc);
+void uhci_rem_loop(struct uhci_softc *sc);
+
+usbd_status uhci_setup_isoc(struct usbd_pipe *pipe);
+void uhci_device_isoc_enter(struct usbd_xfer *);
+
+usbd_status uhci_allocm(struct usbd_bus *, struct usb_dma *, u_int32_t);
+void uhci_freem(struct usbd_bus *, struct usb_dma *);
+
+struct usbd_xfer *uhci_allocx(struct usbd_bus *);
+void uhci_freex(struct usbd_bus *, struct usbd_xfer *);
+
+usbd_status uhci_device_ctrl_transfer(struct usbd_xfer *);
+usbd_status uhci_device_ctrl_start(struct usbd_xfer *);
+void uhci_device_ctrl_abort(struct usbd_xfer *);
+void uhci_device_ctrl_close(struct usbd_pipe *);
+void uhci_device_ctrl_done(struct usbd_xfer *);
+
+usbd_status uhci_device_intr_transfer(struct usbd_xfer *);
+usbd_status uhci_device_intr_start(struct usbd_xfer *);
+void uhci_device_intr_abort(struct usbd_xfer *);
+void uhci_device_intr_close(struct usbd_pipe *);
+void uhci_device_intr_done(struct usbd_xfer *);
+
+usbd_status uhci_device_bulk_transfer(struct usbd_xfer *);
+usbd_status uhci_device_bulk_start(struct usbd_xfer *);
+void uhci_device_bulk_abort(struct usbd_xfer *);
+void uhci_device_bulk_close(struct usbd_pipe *);
+void uhci_device_bulk_done(struct usbd_xfer *);
+
+usbd_status uhci_device_isoc_transfer(struct usbd_xfer *);
+usbd_status uhci_device_isoc_start(struct usbd_xfer *);
+void uhci_device_isoc_abort(struct usbd_xfer *);
+void uhci_device_isoc_close(struct usbd_pipe *);
+void uhci_device_isoc_done(struct usbd_xfer *);
+
+usbd_status uhci_root_ctrl_transfer(struct usbd_xfer *);
+usbd_status uhci_root_ctrl_start(struct usbd_xfer *);
+void uhci_root_ctrl_abort(struct usbd_xfer *);
+void uhci_root_ctrl_close(struct usbd_pipe *);
+void uhci_root_ctrl_done(struct usbd_xfer *);
+
+usbd_status uhci_root_intr_transfer(struct usbd_xfer *);
+usbd_status uhci_root_intr_start(struct usbd_xfer *);
+void uhci_root_intr_abort(struct usbd_xfer *);
+void uhci_root_intr_close(struct usbd_pipe *);
+void uhci_root_intr_done(struct usbd_xfer *);
+
+usbd_status uhci_open(struct usbd_pipe *);
void uhci_poll(struct usbd_bus *);
void uhci_softintr(void *);
-usbd_status uhci_device_request(usbd_xfer_handle xfer);
+usbd_status uhci_device_request(struct usbd_xfer *xfer);
-void uhci_add_intr(uhci_softc_t *, uhci_soft_qh_t *);
-void uhci_remove_intr(uhci_softc_t *, uhci_soft_qh_t *);
-usbd_status uhci_device_setintr(uhci_softc_t *sc,
- struct uhci_pipe *pipe, int ival);
+void uhci_add_intr(struct uhci_softc *, struct uhci_soft_qh *);
+void uhci_remove_intr(struct uhci_softc *, struct uhci_soft_qh *);
+usbd_status uhci_device_setintr(struct uhci_softc *sc,
+ struct uhci_pipe *pipe, int ival);
-void uhci_device_clear_toggle(usbd_pipe_handle pipe);
-void uhci_noop(usbd_pipe_handle pipe);
+void uhci_device_clear_toggle(struct usbd_pipe *pipe);
+void uhci_noop(struct usbd_pipe *pipe);
-__inline__ uhci_soft_qh_t *uhci_find_prev_qh(uhci_soft_qh_t *,
- uhci_soft_qh_t *);
+__inline__ struct uhci_soft_qh *uhci_find_prev_qh(struct uhci_soft_qh *,
+ struct uhci_soft_qh *);
#ifdef UHCI_DEBUG
-void uhci_dump_all(uhci_softc_t *);
-void uhci_dumpregs(uhci_softc_t *);
-void uhci_dump_qhs(uhci_soft_qh_t *);
-void uhci_dump_qh(uhci_soft_qh_t *);
-void uhci_dump_tds(uhci_soft_td_t *);
-void uhci_dump_td(uhci_soft_td_t *);
-void uhci_dump_ii(uhci_intr_info_t *ii);
-void uhci_dump(void);
+void uhci_dump_all(struct uhci_softc *);
+void uhci_dumpregs(struct uhci_softc *);
+void uhci_dump_qhs(struct uhci_soft_qh *);
+void uhci_dump_qh(struct uhci_soft_qh *);
+void uhci_dump_tds(struct uhci_soft_td *);
+void uhci_dump_td(struct uhci_soft_td *);
+void uhci_dump_ii(struct uhci_intr_info *ii);
+void uhci_dump(void);
#endif
#define UBARR(sc) bus_space_barrier((sc)->iot, (sc)->ioh, 0, (sc)->sc_size, \
@@ -249,21 +250,21 @@ void uhci_dump(void);
} while (/*CONSTCOND*/0)
static __inline u_int8_t
-UREAD1(uhci_softc_t *sc, bus_size_t r)
+UREAD1(struct uhci_softc *sc, bus_size_t r)
{
UBARR(sc);
return bus_space_read_1(sc->iot, sc->ioh, r);
}
static __inline u_int16_t
-UREAD2(uhci_softc_t *sc, bus_size_t r)
+UREAD2(struct uhci_softc *sc, bus_size_t r)
{
UBARR(sc);
return bus_space_read_2(sc->iot, sc->ioh, r);
}
static __inline u_int32_t
-UREAD4(uhci_softc_t *sc, bus_size_t r)
+UREAD4(struct uhci_softc *sc, bus_size_t r)
{
UBARR(sc);
return bus_space_read_4(sc->iot, sc->ioh, r);
@@ -351,8 +352,8 @@ struct usbd_pipe_methods uhci_device_isoc_methods = {
} while (0)
#define uhci_active_intr_info(ii) ((ii)->list.le_prev != NULL)
-__inline__ uhci_soft_qh_t *
-uhci_find_prev_qh(uhci_soft_qh_t *pqh, uhci_soft_qh_t *sqh)
+__inline__ struct uhci_soft_qh *
+uhci_find_prev_qh(struct uhci_soft_qh *pqh, struct uhci_soft_qh *sqh)
{
DPRINTFN(15,("uhci_find_prev_qh: pqh=%p sqh=%p\n", pqh, sqh));
@@ -368,7 +369,7 @@ uhci_find_prev_qh(uhci_soft_qh_t *pqh, uhci_soft_qh_t *sqh)
}
void
-uhci_globalreset(uhci_softc_t *sc)
+uhci_globalreset(struct uhci_softc *sc)
{
UHCICMD(sc, UHCI_CMD_GRESET); /* global reset */
usb_delay_ms(&sc->sc_bus, USB_BUS_RESET_DELAY); /* wait a little */
@@ -376,12 +377,12 @@ uhci_globalreset(uhci_softc_t *sc)
}
usbd_status
-uhci_init(uhci_softc_t *sc)
+uhci_init(struct uhci_softc *sc)
{
usbd_status err;
int i, j;
- uhci_soft_qh_t *clsqh, *chsqh, *bsqh, *sqh, *lsqh;
- uhci_soft_td_t *std;
+ struct uhci_soft_qh *clsqh, *chsqh, *bsqh, *sqh, *lsqh;
+ struct uhci_soft_td *std;
DPRINTFN(1,("uhci_init: start\n"));
@@ -593,7 +594,7 @@ uhci_activate(struct device *self, int act)
int
uhci_detach(struct uhci_softc *sc, int flags)
{
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
int rv = 0;
if (sc->sc_child != NULL)
@@ -625,7 +626,7 @@ uhci_detach(struct uhci_softc *sc, int flags)
}
usbd_status
-uhci_allocm(struct usbd_bus *bus, usb_dma_t *dma, u_int32_t size)
+uhci_allocm(struct usbd_bus *bus, struct usb_dma *dma, u_int32_t size)
{
struct uhci_softc *sc = (struct uhci_softc *)bus;
u_int32_t n;
@@ -640,9 +641,9 @@ uhci_allocm(struct usbd_bus *bus, usb_dma_t *dma, u_int32_t size)
n = size / 8;
if (n > 16) {
u_int32_t i;
- uhci_soft_td_t **stds;
+ struct uhci_soft_td **stds;
DPRINTF(("uhci_allocm: get %d TDs\n", n));
- stds = malloc(sizeof(uhci_soft_td_t *) * n, M_TEMP,
+ stds = malloc(sizeof(struct uhci_soft_td *) * n, M_TEMP,
M_NOWAIT | M_ZERO);
if (stds == NULL)
panic("uhci_allocm");
@@ -658,16 +659,16 @@ uhci_allocm(struct usbd_bus *bus, usb_dma_t *dma, u_int32_t size)
}
void
-uhci_freem(struct usbd_bus *bus, usb_dma_t *dma)
+uhci_freem(struct usbd_bus *bus, struct usb_dma *dma)
{
usb_freemem(&((struct uhci_softc *)bus)->sc_bus, dma);
}
-usbd_xfer_handle
+struct usbd_xfer *
uhci_allocx(struct usbd_bus *bus)
{
struct uhci_softc *sc = (struct uhci_softc *)bus;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
xfer = SIMPLEQ_FIRST(&sc->sc_free_xfers);
if (xfer != NULL) {
@@ -693,7 +694,7 @@ uhci_allocx(struct usbd_bus *bus)
}
void
-uhci_freex(struct usbd_bus *bus, usbd_xfer_handle xfer)
+uhci_freex(struct usbd_bus *bus, struct usbd_xfer *xfer)
{
struct uhci_softc *sc = (struct uhci_softc *)bus;
@@ -718,7 +719,7 @@ uhci_freex(struct usbd_bus *bus, usbd_xfer_handle xfer)
void
uhci_shutdown(void *v)
{
- uhci_softc_t *sc = v;
+ struct uhci_softc *sc = v;
DPRINTF(("uhci_shutdown: stopping the HC\n"));
uhci_run(sc, 0); /* stop the controller */
@@ -726,7 +727,7 @@ uhci_shutdown(void *v)
#ifdef UHCI_DEBUG
void
-uhci_dumpregs(uhci_softc_t *sc)
+uhci_dumpregs(struct uhci_softc *sc)
{
DPRINTFN(-1,("%s regs: cmd=%04x, sts=%04x, intr=%04x, frnum=%04x, "
"flbase=%08x, sof=%04x, portsc1=%04x, portsc2=%04x\n",
@@ -742,7 +743,7 @@ uhci_dumpregs(uhci_softc_t *sc)
}
void
-uhci_dump_td(uhci_soft_td_t *p)
+uhci_dump_td(struct uhci_soft_td *p)
{
char sbuf[128], sbuf2[128];
@@ -773,7 +774,7 @@ uhci_dump_td(uhci_soft_td_t *p)
}
void
-uhci_dump_qh(uhci_soft_qh_t *sqh)
+uhci_dump_qh(struct uhci_soft_qh *sqh)
{
DPRINTFN(-1,("QH(%p) at %08x: hlink=%08x elink=%08x\n", sqh,
(int)sqh->physaddr, letoh32(sqh->qh.qh_hlink),
@@ -788,7 +789,7 @@ uhci_dump(void)
}
void
-uhci_dump_all(uhci_softc_t *sc)
+uhci_dump_all(struct uhci_softc *sc)
{
uhci_dumpregs(sc);
printf("intrs=%d\n", sc->sc_bus.no_intrs);
@@ -798,7 +799,7 @@ uhci_dump_all(uhci_softc_t *sc)
void
-uhci_dump_qhs(uhci_soft_qh_t *sqh)
+uhci_dump_qhs(struct uhci_soft_qh *sqh)
{
uhci_dump_qh(sqh);
@@ -829,9 +830,9 @@ uhci_dump_qhs(uhci_soft_qh_t *sqh)
}
void
-uhci_dump_tds(uhci_soft_td_t *std)
+uhci_dump_tds(struct uhci_soft_td *std)
{
- uhci_soft_td_t *td;
+ struct uhci_soft_td *td;
for(td = std; td != NULL; td = td->link.std) {
uhci_dump_td(td);
@@ -848,11 +849,11 @@ uhci_dump_tds(uhci_soft_td_t *std)
}
void
-uhci_dump_ii(uhci_intr_info_t *ii)
+uhci_dump_ii(struct uhci_intr_info *ii)
{
- usbd_pipe_handle pipe;
+ struct usbd_pipe *pipe;
usb_endpoint_descriptor_t *ed;
- usbd_device_handle dev;
+ struct usbd_device *dev;
#ifdef DIAGNOSTIC
#define DONE ii->isdone
@@ -899,7 +900,7 @@ void uhci_dump_iis(struct uhci_softc *sc);
void
uhci_dump_iis(struct uhci_softc *sc)
{
- uhci_intr_info_t *ii;
+ struct uhci_intr_info *ii;
printf("intr_info list:\n");
for (ii = LIST_FIRST(&sc->sc_intrhead); ii; ii = LIST_NEXT(ii, list))
@@ -918,9 +919,9 @@ void iidump(void) { uhci_dump_iis(thesc); }
void
uhci_poll_hub(void *addr)
{
- usbd_xfer_handle xfer = addr;
- usbd_pipe_handle pipe = xfer->pipe;
- uhci_softc_t *sc = (uhci_softc_t *)pipe->device->bus;
+ struct usbd_xfer *xfer = addr;
+ struct usbd_pipe *pipe = xfer->pipe;
+ struct uhci_softc *sc = (struct uhci_softc *)pipe->device->bus;
int s;
u_char *p;
@@ -953,12 +954,12 @@ uhci_poll_hub(void *addr)
}
void
-uhci_root_intr_done(usbd_xfer_handle xfer)
+uhci_root_intr_done(struct usbd_xfer *xfer)
{
}
void
-uhci_root_ctrl_done(usbd_xfer_handle xfer)
+uhci_root_ctrl_done(struct usbd_xfer *xfer)
{
}
@@ -969,7 +970,7 @@ uhci_root_ctrl_done(usbd_xfer_handle xfer)
* If we are already looping, just count it.
*/
void
-uhci_add_loop(uhci_softc_t *sc) {
+uhci_add_loop(struct uhci_softc *sc) {
#ifdef UHCI_DEBUG
if (uhcinoloop)
return;
@@ -983,7 +984,7 @@ uhci_add_loop(uhci_softc_t *sc) {
}
void
-uhci_rem_loop(uhci_softc_t *sc) {
+uhci_rem_loop(struct uhci_softc *sc) {
#ifdef UHCI_DEBUG
if (uhcinoloop)
return;
@@ -996,9 +997,9 @@ uhci_rem_loop(uhci_softc_t *sc) {
/* Add high speed control QH, called at splusb(). */
void
-uhci_add_hs_ctrl(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
+uhci_add_hs_ctrl(struct uhci_softc *sc, struct uhci_soft_qh *sqh)
{
- uhci_soft_qh_t *eqh;
+ struct uhci_soft_qh *eqh;
SPLUSBCHECK;
@@ -1016,9 +1017,9 @@ uhci_add_hs_ctrl(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
/* Remove high speed control QH, called at splusb(). */
void
-uhci_remove_hs_ctrl(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
+uhci_remove_hs_ctrl(struct uhci_softc *sc, struct uhci_soft_qh *sqh)
{
- uhci_soft_qh_t *pqh;
+ struct uhci_soft_qh *pqh;
SPLUSBCHECK;
@@ -1049,9 +1050,9 @@ uhci_remove_hs_ctrl(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
/* Add low speed control QH, called at splusb(). */
void
-uhci_add_ls_ctrl(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
+uhci_add_ls_ctrl(struct uhci_softc *sc, struct uhci_soft_qh *sqh)
{
- uhci_soft_qh_t *eqh;
+ struct uhci_soft_qh *eqh;
SPLUSBCHECK;
@@ -1066,9 +1067,9 @@ uhci_add_ls_ctrl(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
/* Remove low speed control QH, called at splusb(). */
void
-uhci_remove_ls_ctrl(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
+uhci_remove_ls_ctrl(struct uhci_softc *sc, struct uhci_soft_qh *sqh)
{
- uhci_soft_qh_t *pqh;
+ struct uhci_soft_qh *pqh;
SPLUSBCHECK;
@@ -1088,9 +1089,9 @@ uhci_remove_ls_ctrl(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
/* Add bulk QH, called at splusb(). */
void
-uhci_add_bulk(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
+uhci_add_bulk(struct uhci_softc *sc, struct uhci_soft_qh *sqh)
{
- uhci_soft_qh_t *eqh;
+ struct uhci_soft_qh *eqh;
SPLUSBCHECK;
@@ -1106,9 +1107,9 @@ uhci_add_bulk(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
/* Remove bulk QH, called at splusb(). */
void
-uhci_remove_bulk(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
+uhci_remove_bulk(struct uhci_softc *sc, struct uhci_soft_qh *sqh)
{
- uhci_soft_qh_t *pqh;
+ struct uhci_soft_qh *pqh;
SPLUSBCHECK;
@@ -1127,12 +1128,12 @@ uhci_remove_bulk(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
sc->sc_bulk_end = pqh;
}
-int uhci_intr1(uhci_softc_t *);
+int uhci_intr1(struct uhci_softc *);
int
uhci_intr(void *arg)
{
- uhci_softc_t *sc = arg;
+ struct uhci_softc *sc = arg;
if (sc->sc_bus.dying)
return (0);
@@ -1142,7 +1143,7 @@ uhci_intr(void *arg)
}
int
-uhci_intr1(uhci_softc_t *sc)
+uhci_intr1(struct uhci_softc *sc)
{
int status;
int ack;
@@ -1215,8 +1216,8 @@ uhci_intr1(uhci_softc_t *sc)
void
uhci_softintr(void *v)
{
- uhci_softc_t *sc = v;
- uhci_intr_info_t *ii, *nextii;
+ struct uhci_softc *sc = v;
+ struct uhci_intr_info *ii, *nextii;
DPRINTFN(10,("%s: uhci_softintr (%d)\n", sc->sc_bus.bdev.dv_xname,
sc->sc_bus.intr_context));
@@ -1252,9 +1253,9 @@ uhci_softintr(void *v)
/* Check for an interrupt. */
void
-uhci_check_intr(uhci_softc_t *sc, uhci_intr_info_t *ii)
+uhci_check_intr(struct uhci_softc *sc, struct uhci_intr_info *ii)
{
- uhci_soft_td_t *std, *lstd;
+ struct uhci_soft_td *std, *lstd;
u_int32_t status;
DPRINTFN(15, ("uhci_check_intr: ii=%p\n", ii));
@@ -1312,11 +1313,11 @@ uhci_check_intr(uhci_softc_t *sc, uhci_intr_info_t *ii)
/* Called at splusb() */
void
-uhci_idone(uhci_intr_info_t *ii)
+uhci_idone(struct uhci_intr_info *ii)
{
- usbd_xfer_handle xfer = ii->xfer;
+ struct usbd_xfer *xfer = ii->xfer;
struct uhci_pipe *upipe = (struct uhci_pipe *)xfer->pipe;
- uhci_soft_td_t *std;
+ struct uhci_soft_td *std;
u_int32_t status = 0, nstatus;
int actlen;
@@ -1341,7 +1342,7 @@ uhci_idone(uhci_intr_info_t *ii)
if (xfer->nframes != 0) {
/* Isoc transfer, do things differently. */
- uhci_soft_td_t **stds = upipe->u.iso.stds;
+ struct uhci_soft_td **stds = upipe->u.iso.stds;
int i, n, nframes, len;
DPRINTFN(5,("uhci_idone: ii=%p isoc ready\n", ii));
@@ -1442,10 +1443,10 @@ uhci_idone(uhci_intr_info_t *ii)
void
uhci_timeout(void *addr)
{
- uhci_intr_info_t *ii = addr;
+ struct uhci_intr_info *ii = addr;
struct uhci_xfer *uxfer = UXFER(ii->xfer);
struct uhci_pipe *upipe = (struct uhci_pipe *)uxfer->xfer.pipe;
- uhci_softc_t *sc = (uhci_softc_t *)upipe->pipe.device->bus;
+ struct uhci_softc *sc = (struct uhci_softc *)upipe->pipe.device->bus;
DPRINTF(("uhci_timeout: uxfer=%p\n", uxfer));
@@ -1463,7 +1464,7 @@ uhci_timeout(void *addr)
void
uhci_timeout_task(void *addr)
{
- usbd_xfer_handle xfer = addr;
+ struct usbd_xfer *xfer = addr;
int s;
DPRINTF(("uhci_timeout_task: xfer=%p\n", xfer));
@@ -1480,10 +1481,10 @@ uhci_timeout_task(void *addr)
* Only used during boot when interrupts are not enabled yet.
*/
void
-uhci_waitintr(uhci_softc_t *sc, usbd_xfer_handle xfer)
+uhci_waitintr(struct uhci_softc *sc, struct usbd_xfer *xfer)
{
int timo = xfer->timeout;
- uhci_intr_info_t *ii;
+ struct uhci_intr_info *ii;
DPRINTFN(10,("uhci_waitintr: timeout = %dms\n", timo));
@@ -1514,14 +1515,14 @@ uhci_waitintr(uhci_softc_t *sc, usbd_xfer_handle xfer)
void
uhci_poll(struct usbd_bus *bus)
{
- uhci_softc_t *sc = (uhci_softc_t *)bus;
+ struct uhci_softc *sc = (struct uhci_softc *)bus;
if (UREAD2(sc, UHCI_STS) & UHCI_STS_ALLINTRS)
uhci_intr1(sc);
}
void
-uhci_reset(uhci_softc_t *sc)
+uhci_reset(struct uhci_softc *sc)
{
int n;
@@ -1536,7 +1537,7 @@ uhci_reset(uhci_softc_t *sc)
}
usbd_status
-uhci_run(uhci_softc_t *sc, int run)
+uhci_run(struct uhci_softc *sc, int run)
{
int s, n, running;
u_int16_t cmd;
@@ -1577,13 +1578,13 @@ uhci_run(uhci_softc_t *sc, int run)
* only one TD/QH (32 bytes) was placed in each allocated chunk.
*/
-uhci_soft_td_t *
-uhci_alloc_std(uhci_softc_t *sc)
+struct uhci_soft_td *
+uhci_alloc_std(struct uhci_softc *sc)
{
- uhci_soft_td_t *std;
+ struct uhci_soft_td *std;
usbd_status err;
int i, offs;
- usb_dma_t dma;
+ struct usb_dma dma;
if (sc->sc_freetds == NULL) {
DPRINTFN(2,("uhci_alloc_std: allocating chunk\n"));
@@ -1601,12 +1602,12 @@ uhci_alloc_std(uhci_softc_t *sc)
}
std = sc->sc_freetds;
sc->sc_freetds = std->link.std;
- memset(&std->td, 0, sizeof(uhci_td_t));
+ memset(&std->td, 0, sizeof(struct uhci_td));
return std;
}
void
-uhci_free_std(uhci_softc_t *sc, uhci_soft_td_t *std)
+uhci_free_std(struct uhci_softc *sc, struct uhci_soft_td *std)
{
#ifdef DIAGNOSTIC
#define TD_IS_FREE 0x12345678
@@ -1620,13 +1621,13 @@ uhci_free_std(uhci_softc_t *sc, uhci_soft_td_t *std)
sc->sc_freetds = std;
}
-uhci_soft_qh_t *
-uhci_alloc_sqh(uhci_softc_t *sc)
+struct uhci_soft_qh *
+uhci_alloc_sqh(struct uhci_softc *sc)
{
- uhci_soft_qh_t *sqh;
+ struct uhci_soft_qh *sqh;
usbd_status err;
int i, offs;
- usb_dma_t dma;
+ struct usb_dma dma;
if (sc->sc_freeqhs == NULL) {
DPRINTFN(2, ("uhci_alloc_sqh: allocating chunk\n"));
@@ -1644,22 +1645,22 @@ uhci_alloc_sqh(uhci_softc_t *sc)
}
sqh = sc->sc_freeqhs;
sc->sc_freeqhs = sqh->hlink;
- memset(&sqh->qh, 0, sizeof(uhci_qh_t));
+ memset(&sqh->qh, 0, sizeof(struct uhci_qh));
return (sqh);
}
void
-uhci_free_sqh(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
+uhci_free_sqh(struct uhci_softc *sc, struct uhci_soft_qh *sqh)
{
sqh->hlink = sc->sc_freeqhs;
sc->sc_freeqhs = sqh;
}
void
-uhci_free_std_chain(uhci_softc_t *sc, uhci_soft_td_t *std,
- uhci_soft_td_t *stdend)
+uhci_free_std_chain(struct uhci_softc *sc, struct uhci_soft_td *std,
+ struct uhci_soft_td *stdend)
{
- uhci_soft_td_t *p;
+ struct uhci_soft_td *p;
for (; std != stdend; std = p) {
p = std->link.std;
@@ -1668,11 +1669,11 @@ uhci_free_std_chain(uhci_softc_t *sc, uhci_soft_td_t *std,
}
usbd_status
-uhci_alloc_std_chain(struct uhci_pipe *upipe, uhci_softc_t *sc, u_int len,
- int rd, u_int16_t flags, usb_dma_t *dma,
- uhci_soft_td_t **sp, uhci_soft_td_t **ep)
+uhci_alloc_std_chain(struct uhci_pipe *upipe, struct uhci_softc *sc, u_int len,
+ int rd, u_int16_t flags, struct usb_dma *dma,
+ struct uhci_soft_td **sp, struct uhci_soft_td **ep)
{
- uhci_soft_td_t *p, *lastp;
+ struct uhci_soft_td *p, *lastp;
uhci_physaddr_t lastlink;
int i, ntd, l, tog, maxp;
u_int32_t status;
@@ -1740,19 +1741,19 @@ uhci_alloc_std_chain(struct uhci_pipe *upipe, uhci_softc_t *sc, u_int len,
}
void
-uhci_device_clear_toggle(usbd_pipe_handle pipe)
+uhci_device_clear_toggle(struct usbd_pipe *pipe)
{
struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
upipe->nexttoggle = 0;
}
void
-uhci_noop(usbd_pipe_handle pipe)
+uhci_noop(struct usbd_pipe *pipe)
{
}
usbd_status
-uhci_device_bulk_transfer(usbd_xfer_handle xfer)
+uhci_device_bulk_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -1769,14 +1770,14 @@ uhci_device_bulk_transfer(usbd_xfer_handle xfer)
}
usbd_status
-uhci_device_bulk_start(usbd_xfer_handle xfer)
+uhci_device_bulk_start(struct usbd_xfer *xfer)
{
struct uhci_pipe *upipe = (struct uhci_pipe *)xfer->pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
- uhci_intr_info_t *ii = &UXFER(xfer)->iinfo;
- uhci_soft_td_t *data, *dataend;
- uhci_soft_qh_t *sqh;
+ struct usbd_device *dev = upipe->pipe.device;
+ struct uhci_softc *sc = (struct uhci_softc *)dev->bus;
+ struct uhci_intr_info *ii = &UXFER(xfer)->iinfo;
+ struct uhci_soft_td *data, *dataend;
+ struct uhci_soft_qh *sqh;
usbd_status err;
u_int len;
int isread, endpt;
@@ -1855,7 +1856,7 @@ uhci_device_bulk_start(usbd_xfer_handle xfer)
/* Abort a device bulk request. */
void
-uhci_device_bulk_abort(usbd_xfer_handle xfer)
+uhci_device_bulk_abort(struct usbd_xfer *xfer)
{
DPRINTF(("uhci_device_bulk_abort:\n"));
uhci_abort_xfer(xfer, USBD_CANCELLED);
@@ -1872,12 +1873,12 @@ uhci_device_bulk_abort(usbd_xfer_handle xfer)
* interrupt processing to process it.
*/
void
-uhci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
+uhci_abort_xfer(struct usbd_xfer *xfer, usbd_status status)
{
- uhci_intr_info_t *ii = &UXFER(xfer)->iinfo;
+ struct uhci_intr_info *ii = &UXFER(xfer)->iinfo;
struct uhci_pipe *upipe = (struct uhci_pipe *)xfer->pipe;
- uhci_softc_t *sc = (uhci_softc_t *)upipe->pipe.device->bus;
- uhci_soft_td_t *std;
+ struct uhci_softc *sc = (struct uhci_softc *)upipe->pipe.device->bus;
+ struct uhci_soft_td *std;
int s;
DPRINTFN(1,("uhci_abort_xfer: xfer=%p, status=%d\n", xfer, status));
@@ -1933,18 +1934,18 @@ uhci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
/* Close a device bulk pipe. */
void
-uhci_device_bulk_close(usbd_pipe_handle pipe)
+uhci_device_bulk_close(struct usbd_pipe *pipe)
{
struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
+ struct usbd_device *dev = upipe->pipe.device;
+ struct uhci_softc *sc = (struct uhci_softc *)dev->bus;
uhci_free_sqh(sc, upipe->u.bulk.sqh);
pipe->endpoint->savedtoggle = upipe->nexttoggle;
}
usbd_status
-uhci_device_ctrl_transfer(usbd_xfer_handle xfer)
+uhci_device_ctrl_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -1961,9 +1962,9 @@ uhci_device_ctrl_transfer(usbd_xfer_handle xfer)
}
usbd_status
-uhci_device_ctrl_start(usbd_xfer_handle xfer)
+uhci_device_ctrl_start(struct usbd_xfer *xfer)
{
- uhci_softc_t *sc = (uhci_softc_t *)xfer->pipe->device->bus;
+ struct uhci_softc *sc = (struct uhci_softc *)xfer->pipe->device->bus;
usbd_status err;
if (sc->sc_bus.dying)
@@ -1985,7 +1986,7 @@ uhci_device_ctrl_start(usbd_xfer_handle xfer)
}
usbd_status
-uhci_device_intr_transfer(usbd_xfer_handle xfer)
+uhci_device_intr_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -2002,14 +2003,14 @@ uhci_device_intr_transfer(usbd_xfer_handle xfer)
}
usbd_status
-uhci_device_intr_start(usbd_xfer_handle xfer)
+uhci_device_intr_start(struct usbd_xfer *xfer)
{
struct uhci_pipe *upipe = (struct uhci_pipe *)xfer->pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
- uhci_intr_info_t *ii = &UXFER(xfer)->iinfo;
- uhci_soft_td_t *data, *dataend;
- uhci_soft_qh_t *sqh;
+ struct usbd_device *dev = upipe->pipe.device;
+ struct uhci_softc *sc = (struct uhci_softc *)dev->bus;
+ struct uhci_intr_info *ii = &UXFER(xfer)->iinfo;
+ struct uhci_soft_td *data, *dataend;
+ struct uhci_soft_qh *sqh;
usbd_status err;
int isread, endpt;
int i, s;
@@ -2085,7 +2086,7 @@ uhci_device_intr_start(usbd_xfer_handle xfer)
/* Abort a device control request. */
void
-uhci_device_ctrl_abort(usbd_xfer_handle xfer)
+uhci_device_ctrl_abort(struct usbd_xfer *xfer)
{
DPRINTF(("uhci_device_ctrl_abort:\n"));
uhci_abort_xfer(xfer, USBD_CANCELLED);
@@ -2093,13 +2094,13 @@ uhci_device_ctrl_abort(usbd_xfer_handle xfer)
/* Close a device control pipe. */
void
-uhci_device_ctrl_close(usbd_pipe_handle pipe)
+uhci_device_ctrl_close(struct usbd_pipe *pipe)
{
}
/* Abort a device interrupt request. */
void
-uhci_device_intr_abort(usbd_xfer_handle xfer)
+uhci_device_intr_abort(struct usbd_xfer *xfer)
{
DPRINTFN(1,("uhci_device_intr_abort: xfer=%p\n", xfer));
if (xfer->pipe->intrxfer == xfer) {
@@ -2111,10 +2112,10 @@ uhci_device_intr_abort(usbd_xfer_handle xfer)
/* Close a device interrupt pipe. */
void
-uhci_device_intr_close(usbd_pipe_handle pipe)
+uhci_device_intr_close(struct usbd_pipe *pipe)
{
struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- uhci_softc_t *sc = (uhci_softc_t *)pipe->device->bus;
+ struct uhci_softc *sc = (struct uhci_softc *)pipe->device->bus;
int i, npoll;
int s;
@@ -2139,17 +2140,17 @@ uhci_device_intr_close(usbd_pipe_handle pipe)
}
usbd_status
-uhci_device_request(usbd_xfer_handle xfer)
+uhci_device_request(struct usbd_xfer *xfer)
{
struct uhci_pipe *upipe = (struct uhci_pipe *)xfer->pipe;
usb_device_request_t *req = &xfer->request;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
+ struct usbd_device *dev = upipe->pipe.device;
+ struct uhci_softc *sc = (struct uhci_softc *)dev->bus;
int addr = dev->address;
int endpt = upipe->pipe.endpoint->edesc->bEndpointAddress;
- uhci_intr_info_t *ii = &UXFER(xfer)->iinfo;
- uhci_soft_td_t *setup, *data, *stat, *next, *dataend;
- uhci_soft_qh_t *sqh;
+ struct uhci_intr_info *ii = &UXFER(xfer)->iinfo;
+ struct uhci_soft_td *setup, *data, *stat, *next, *dataend;
+ struct uhci_soft_qh *sqh;
u_int len;
u_int32_t ls;
usbd_status err;
@@ -2232,9 +2233,9 @@ uhci_device_request(usbd_xfer_handle xfer)
uhci_add_intr_info(sc, ii);
#ifdef UHCI_DEBUG
if (uhcidebug > 12) {
- uhci_soft_td_t *std;
- uhci_soft_qh_t *xqh;
- uhci_soft_qh_t *sxqh;
+ struct uhci_soft_td *std;
+ struct uhci_soft_qh *xqh;
+ struct uhci_soft_qh *sxqh;
int maxqh = 0;
uhci_physaddr_t link;
DPRINTF(("uhci_device_request: follow from [0]\n"));
@@ -2244,7 +2245,7 @@ uhci_device_request(usbd_xfer_handle xfer)
link = letoh32(std->td.td_link);
uhci_dump_td(std);
}
- sxqh = (uhci_soft_qh_t *)std;
+ sxqh = (struct uhci_soft_qh *)std;
uhci_dump_qh(sxqh);
for (xqh = sxqh;
xqh != NULL;
@@ -2269,7 +2270,7 @@ uhci_device_request(usbd_xfer_handle xfer)
}
usbd_status
-uhci_device_isoc_transfer(usbd_xfer_handle xfer)
+uhci_device_isoc_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -2295,13 +2296,13 @@ uhci_device_isoc_transfer(usbd_xfer_handle xfer)
}
void
-uhci_device_isoc_enter(usbd_xfer_handle xfer)
+uhci_device_isoc_enter(struct usbd_xfer *xfer)
{
struct uhci_pipe *upipe = (struct uhci_pipe *)xfer->pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
+ struct usbd_device *dev = upipe->pipe.device;
+ struct uhci_softc *sc = (struct uhci_softc *)dev->bus;
struct iso *iso = &upipe->u.iso;
- uhci_soft_td_t *std;
+ struct uhci_soft_td *std;
u_int32_t buf, len, status;
int s, i, next, nframes;
@@ -2365,12 +2366,12 @@ uhci_device_isoc_enter(usbd_xfer_handle xfer)
}
usbd_status
-uhci_device_isoc_start(usbd_xfer_handle xfer)
+uhci_device_isoc_start(struct usbd_xfer *xfer)
{
struct uhci_pipe *upipe = (struct uhci_pipe *)xfer->pipe;
- uhci_softc_t *sc = (uhci_softc_t *)upipe->pipe.device->bus;
- uhci_intr_info_t *ii = &UXFER(xfer)->iinfo;
- uhci_soft_td_t *end;
+ struct uhci_softc *sc = (struct uhci_softc *)upipe->pipe.device->bus;
+ struct uhci_intr_info *ii = &UXFER(xfer)->iinfo;
+ struct uhci_soft_td *end;
int s, i;
DPRINTFN(5,("uhci_device_isoc_start: xfer=%p\n", xfer));
@@ -2420,11 +2421,11 @@ uhci_device_isoc_start(usbd_xfer_handle xfer)
}
void
-uhci_device_isoc_abort(usbd_xfer_handle xfer)
+uhci_device_isoc_abort(struct usbd_xfer *xfer)
{
struct uhci_pipe *upipe = (struct uhci_pipe *)xfer->pipe;
- uhci_soft_td_t **stds = upipe->u.iso.stds;
- uhci_soft_td_t *std;
+ struct uhci_soft_td **stds = upipe->u.iso.stds;
+ struct uhci_soft_td *std;
int i, n, s, nframes, maxlen, len;
s = splusb();
@@ -2466,12 +2467,12 @@ uhci_device_isoc_abort(usbd_xfer_handle xfer)
}
void
-uhci_device_isoc_close(usbd_pipe_handle pipe)
+uhci_device_isoc_close(struct usbd_pipe *pipe)
{
struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
- uhci_soft_td_t *std, *vstd;
+ struct usbd_device *dev = upipe->pipe.device;
+ struct uhci_softc *sc = (struct uhci_softc *)dev->bus;
+ struct uhci_soft_td *std, *vstd;
struct iso *iso;
int i, s;
@@ -2510,21 +2511,22 @@ uhci_device_isoc_close(usbd_pipe_handle pipe)
}
usbd_status
-uhci_setup_isoc(usbd_pipe_handle pipe)
+uhci_setup_isoc(struct usbd_pipe *pipe)
{
struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
+ struct usbd_device *dev = upipe->pipe.device;
+ struct uhci_softc *sc = (struct uhci_softc *)dev->bus;
int addr = upipe->pipe.device->address;
int endpt = upipe->pipe.endpoint->edesc->bEndpointAddress;
int rd = UE_GET_DIR(endpt) == UE_DIR_IN;
- uhci_soft_td_t *std, *vstd;
+ struct uhci_soft_td *std, *vstd;
u_int32_t token;
struct iso *iso;
int i, s;
iso = &upipe->u.iso;
- iso->stds = malloc(UHCI_VFRAMELIST_COUNT * sizeof (uhci_soft_td_t *),
+ iso->stds = malloc(UHCI_VFRAMELIST_COUNT *
+ sizeof (struct uhci_soft_td *),
M_USBHC, M_WAITOK);
token = rd ? UHCI_TD_IN (0, endpt, addr, 0) :
@@ -2565,9 +2567,9 @@ uhci_setup_isoc(usbd_pipe_handle pipe)
}
void
-uhci_device_isoc_done(usbd_xfer_handle xfer)
+uhci_device_isoc_done(struct usbd_xfer *xfer)
{
- uhci_intr_info_t *ii = &UXFER(xfer)->iinfo;
+ struct uhci_intr_info *ii = &UXFER(xfer)->iinfo;
DPRINTFN(4, ("uhci_device_isoc_done: length=%d\n", xfer->actlen));
@@ -2600,12 +2602,12 @@ uhci_device_isoc_done(usbd_xfer_handle xfer)
}
void
-uhci_device_intr_done(usbd_xfer_handle xfer)
+uhci_device_intr_done(struct usbd_xfer *xfer)
{
- uhci_intr_info_t *ii = &UXFER(xfer)->iinfo;
- uhci_softc_t *sc = ii->sc;
+ struct uhci_intr_info *ii = &UXFER(xfer)->iinfo;
+ struct uhci_softc *sc = ii->sc;
struct uhci_pipe *upipe = (struct uhci_pipe *)xfer->pipe;
- uhci_soft_qh_t *sqh;
+ struct uhci_soft_qh *sqh;
int i, npoll;
DPRINTFN(5, ("uhci_device_intr_done: length=%d\n", xfer->actlen));
@@ -2620,7 +2622,7 @@ uhci_device_intr_done(usbd_xfer_handle xfer)
/* XXX Wasteful. */
if (xfer->pipe->repeat) {
- uhci_soft_td_t *data, *dataend;
+ struct uhci_soft_td *data, *dataend;
DPRINTFN(5,("uhci_device_intr_done: requeuing\n"));
@@ -2662,10 +2664,10 @@ uhci_device_intr_done(usbd_xfer_handle xfer)
/* Deallocate request data structures */
void
-uhci_device_ctrl_done(usbd_xfer_handle xfer)
+uhci_device_ctrl_done(struct usbd_xfer *xfer)
{
- uhci_intr_info_t *ii = &UXFER(xfer)->iinfo;
- uhci_softc_t *sc = ii->sc;
+ struct uhci_intr_info *ii = &UXFER(xfer)->iinfo;
+ struct uhci_softc *sc = ii->sc;
struct uhci_pipe *upipe = (struct uhci_pipe *)xfer->pipe;
#ifdef DIAGNOSTIC
@@ -2691,10 +2693,10 @@ uhci_device_ctrl_done(usbd_xfer_handle xfer)
/* Deallocate request data structures */
void
-uhci_device_bulk_done(usbd_xfer_handle xfer)
+uhci_device_bulk_done(struct usbd_xfer *xfer)
{
- uhci_intr_info_t *ii = &UXFER(xfer)->iinfo;
- uhci_softc_t *sc = ii->sc;
+ struct uhci_intr_info *ii = &UXFER(xfer)->iinfo;
+ struct uhci_softc *sc = ii->sc;
struct uhci_pipe *upipe = (struct uhci_pipe *)xfer->pipe;
DPRINTFN(5,("uhci_device_bulk_done: xfer=%p ii=%p sc=%p upipe=%p\n",
@@ -2714,10 +2716,10 @@ uhci_device_bulk_done(usbd_xfer_handle xfer)
/* Add interrupt QH, called with vflock. */
void
-uhci_add_intr(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
+uhci_add_intr(struct uhci_softc *sc, struct uhci_soft_qh *sqh)
{
struct uhci_vframe *vf = &sc->sc_vframes[sqh->pos];
- uhci_soft_qh_t *eqh;
+ struct uhci_soft_qh *eqh;
DPRINTFN(4, ("uhci_add_intr: n=%d sqh=%p\n", sqh->pos, sqh));
@@ -2732,10 +2734,10 @@ uhci_add_intr(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
/* Remove interrupt QH. */
void
-uhci_remove_intr(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
+uhci_remove_intr(struct uhci_softc *sc, struct uhci_soft_qh *sqh)
{
struct uhci_vframe *vf = &sc->sc_vframes[sqh->pos];
- uhci_soft_qh_t *pqh;
+ struct uhci_soft_qh *pqh;
DPRINTFN(4, ("uhci_remove_intr: n=%d sqh=%p\n", sqh->pos, sqh));
@@ -2755,9 +2757,9 @@ uhci_remove_intr(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
}
usbd_status
-uhci_device_setintr(uhci_softc_t *sc, struct uhci_pipe *upipe, int ival)
+uhci_device_setintr(struct uhci_softc *sc, struct uhci_pipe *upipe, int ival)
{
- uhci_soft_qh_t *sqh, **qhs;
+ struct uhci_soft_qh *sqh, **qhs;
int i, npoll, s;
u_int bestbw, bw, bestoffs, offs;
@@ -2772,7 +2774,7 @@ uhci_device_setintr(uhci_softc_t *sc, struct uhci_pipe *upipe, int ival)
npoll = (UHCI_VFRAMELIST_COUNT + ival - 1) / ival;
DPRINTFN(2, ("uhci_device_setintr: ival=%d npoll=%d\n", ival, npoll));
- qhs = malloc(npoll * sizeof(uhci_soft_qh_t *), M_USBHC, M_NOWAIT);
+ qhs = malloc(npoll * sizeof(struct uhci_soft_qh *), M_USBHC, M_NOWAIT);
if (qhs == NULL)
return (USBD_NOMEM);
@@ -2821,9 +2823,9 @@ uhci_device_setintr(uhci_softc_t *sc, struct uhci_pipe *upipe, int ival)
/* Open a new pipe. */
usbd_status
-uhci_open(usbd_pipe_handle pipe)
+uhci_open(struct usbd_pipe *pipe)
{
- uhci_softc_t *sc = (uhci_softc_t *)pipe->device->bus;
+ struct uhci_softc *sc = (struct uhci_softc *)pipe->device->bus;
struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
usb_endpoint_descriptor_t *ed = pipe->endpoint->edesc;
usbd_status err;
@@ -2987,7 +2989,7 @@ uhci_str(usb_string_descriptor_t *p, int l, char *s)
* events have been reset.
*/
usbd_status
-uhci_portreset(uhci_softc_t *sc, int index)
+uhci_portreset(struct uhci_softc *sc, int index)
{
int lim, port, x;
@@ -3074,7 +3076,7 @@ uhci_portreset(uhci_softc_t *sc, int index)
* Simulate a hardware hub by handling all the necessary requests.
*/
usbd_status
-uhci_root_ctrl_transfer(usbd_xfer_handle xfer)
+uhci_root_ctrl_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -3091,9 +3093,9 @@ uhci_root_ctrl_transfer(usbd_xfer_handle xfer)
}
usbd_status
-uhci_root_ctrl_start(usbd_xfer_handle xfer)
+uhci_root_ctrl_start(struct usbd_xfer *xfer)
{
- uhci_softc_t *sc = (uhci_softc_t *)xfer->pipe->device->bus;
+ struct uhci_softc *sc = (struct uhci_softc *)xfer->pipe->device->bus;
usb_device_request_t *req;
void *buf = NULL;
int port, x;
@@ -3422,23 +3424,23 @@ uhci_root_ctrl_start(usbd_xfer_handle xfer)
/* Abort a root control request. */
void
-uhci_root_ctrl_abort(usbd_xfer_handle xfer)
+uhci_root_ctrl_abort(struct usbd_xfer *xfer)
{
/* Nothing to do, all transfers are synchronous. */
}
/* Close the root pipe. */
void
-uhci_root_ctrl_close(usbd_pipe_handle pipe)
+uhci_root_ctrl_close(struct usbd_pipe *pipe)
{
DPRINTF(("uhci_root_ctrl_close\n"));
}
/* Abort a root interrupt request. */
void
-uhci_root_intr_abort(usbd_xfer_handle xfer)
+uhci_root_intr_abort(struct usbd_xfer *xfer)
{
- uhci_softc_t *sc = (uhci_softc_t *)xfer->pipe->device->bus;
+ struct uhci_softc *sc = (struct uhci_softc *)xfer->pipe->device->bus;
timeout_del(&sc->sc_poll_handle);
sc->sc_intr_xfer = NULL;
@@ -3455,7 +3457,7 @@ uhci_root_intr_abort(usbd_xfer_handle xfer)
}
usbd_status
-uhci_root_intr_transfer(usbd_xfer_handle xfer)
+uhci_root_intr_transfer(struct usbd_xfer *xfer)
{
usbd_status err;
@@ -3472,10 +3474,10 @@ uhci_root_intr_transfer(usbd_xfer_handle xfer)
/* Start a transfer on the root interrupt pipe */
usbd_status
-uhci_root_intr_start(usbd_xfer_handle xfer)
+uhci_root_intr_start(struct usbd_xfer *xfer)
{
- usbd_pipe_handle pipe = xfer->pipe;
- uhci_softc_t *sc = (uhci_softc_t *)pipe->device->bus;
+ struct usbd_pipe *pipe = xfer->pipe;
+ struct uhci_softc *sc = (struct uhci_softc *)pipe->device->bus;
DPRINTFN(3, ("uhci_root_intr_start: xfer=%p len=%u flags=%d\n",
xfer, xfer->length, xfer->flags));
@@ -3493,9 +3495,9 @@ uhci_root_intr_start(usbd_xfer_handle xfer)
/* Close the root interrupt pipe. */
void
-uhci_root_intr_close(usbd_pipe_handle pipe)
+uhci_root_intr_close(struct usbd_pipe *pipe)
{
- uhci_softc_t *sc = (uhci_softc_t *)pipe->device->bus;
+ struct uhci_softc *sc = (struct uhci_softc *)pipe->device->bus;
timeout_del(&sc->sc_poll_handle);
sc->sc_intr_xfer = NULL;
diff --git a/sys/dev/usb/uhcireg.h b/sys/dev/usb/uhcireg.h
index bb99bc9a0fe..35b24f20375 100644
--- a/sys/dev/usb/uhcireg.h
+++ b/sys/dev/usb/uhcireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhcireg.h,v 1.14 2008/06/26 05:42:18 ray Exp $ */
+/* $OpenBSD: uhcireg.h,v 1.15 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: uhcireg.h,v 1.16 2002/07/11 21:14:29 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhcireg.h,v 1.12 1999/11/17 22:33:42 n_hibma Exp $ */
@@ -134,7 +134,7 @@ typedef u_int32_t uhci_physaddr_t;
* the controller "owns" the qh_elink field.
*/
-typedef struct {
+struct uhci_td {
uhci_physaddr_t td_link;
u_int32_t td_status;
#define UHCI_TD_GET_ACTLEN(s) (((s) + 1) & 0x3ff)
@@ -167,7 +167,7 @@ typedef struct {
#define UHCI_TD_GET_MAXLEN(s) ((((s) >> 21) + 1) & 0x7ff)
#define UHCI_TD_MAXLEN_MASK 0xffe00000
u_int32_t td_buffer;
-} uhci_td_t;
+};
#define UHCI_TD_ERROR (UHCI_TD_BITSTUFF|UHCI_TD_CRCTO|UHCI_TD_BABBLE|UHCI_TD_DBUFFER|UHCI_TD_STALLED)
@@ -180,9 +180,9 @@ typedef struct {
UHCI_TD_SET_ENDPT(endp) | UHCI_TD_SET_DEVADDR(dev) | UHCI_TD_PID_IN | \
UHCI_TD_SET_DT(dt))
-typedef struct {
+struct uhci_qh {
uhci_physaddr_t qh_hlink;
uhci_physaddr_t qh_elink;
-} uhci_qh_t;
+};
#endif /* _DEV_PCI_UHCIREG_H_ */
diff --git a/sys/dev/usb/uhcivar.h b/sys/dev/usb/uhcivar.h
index 1316fc3db3b..09e71b715c5 100644
--- a/sys/dev/usb/uhcivar.h
+++ b/sys/dev/usb/uhcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhcivar.h,v 1.24 2010/12/14 16:13:16 jakemsr Exp $ */
+/* $OpenBSD: uhcivar.h,v 1.25 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: uhcivar.h,v 1.36 2002/12/31 00:39:11 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhcivar.h,v 1.14 1999/11/17 22:33:42 n_hibma Exp $ */
@@ -48,8 +48,8 @@
*/
#define UHCI_VFRAMELIST_COUNT 128
-typedef struct uhci_soft_qh uhci_soft_qh_t;
-typedef struct uhci_soft_td uhci_soft_td_t;
+struct uhci_soft_qh;
+struct uhci_soft_td;
typedef union {
struct uhci_soft_qh *sqh;
@@ -63,20 +63,20 @@ typedef union {
* the interrupt all structs are linked together so they can be
* searched at interrupt time.
*/
-typedef struct uhci_intr_info {
+struct uhci_intr_info {
struct uhci_softc *sc;
- usbd_xfer_handle xfer;
- uhci_soft_td_t *stdstart;
- uhci_soft_td_t *stdend;
+ struct usbd_xfer *xfer;
+ struct uhci_soft_td *stdstart;
+ struct uhci_soft_td *stdend;
LIST_ENTRY(uhci_intr_info) list;
#ifdef DIAGNOSTIC
int isdone;
#endif
-} uhci_intr_info_t;
+};
struct uhci_xfer {
struct usbd_xfer xfer;
- uhci_intr_info_t iinfo;
+ struct uhci_intr_info iinfo;
struct usb_task abort_task;
int curframe;
};
@@ -87,7 +87,7 @@ struct uhci_xfer {
* Extra information that we need for a TD.
*/
struct uhci_soft_td {
- uhci_td_t td; /* The real TD, must be first */
+ struct uhci_td td; /* The real TD, must be first */
uhci_soft_td_qh_t link; /* soft version of the td_link field */
uhci_physaddr_t physaddr; /* TD's physical address. */
};
@@ -104,9 +104,9 @@ struct uhci_soft_td {
* Extra information that we need for a QH.
*/
struct uhci_soft_qh {
- uhci_qh_t qh; /* The real QH, must be first */
- uhci_soft_qh_t *hlink; /* soft version of qh_hlink */
- uhci_soft_td_t *elink; /* soft version of qh_elink */
+ struct uhci_qh qh; /* The real QH, must be first */
+ struct uhci_soft_qh *hlink; /* soft version of qh_hlink */
+ struct uhci_soft_td *elink; /* soft version of qh_elink */
uhci_physaddr_t physaddr; /* QH's physical address. */
int pos; /* Timeslot position */
};
@@ -118,34 +118,34 @@ struct uhci_soft_qh {
* Information about an entry in the virtual frame list.
*/
struct uhci_vframe {
- uhci_soft_td_t *htd; /* pointer to dummy TD */
- uhci_soft_td_t *etd; /* pointer to last TD */
- uhci_soft_qh_t *hqh; /* pointer to dummy QH */
- uhci_soft_qh_t *eqh; /* pointer to last QH */
+ struct uhci_soft_td *htd; /* pointer to dummy TD */
+ struct uhci_soft_td *etd; /* pointer to last TD */
+ struct uhci_soft_qh *hqh; /* pointer to dummy QH */
+ struct uhci_soft_qh *eqh; /* pointer to last QH */
u_int bandwidth; /* max bandwidth used by this frame */
};
-typedef struct uhci_softc {
+struct uhci_softc {
struct usbd_bus sc_bus; /* base device */
bus_space_tag_t iot;
bus_space_handle_t ioh;
bus_size_t sc_size;
uhci_physaddr_t *sc_pframes;
- usb_dma_t sc_dma;
+ struct usb_dma sc_dma;
struct uhci_vframe sc_vframes[UHCI_VFRAMELIST_COUNT];
- uhci_soft_qh_t *sc_lctl_start; /* dummy QH for low speed control */
- uhci_soft_qh_t *sc_lctl_end; /* last control QH */
- uhci_soft_qh_t *sc_hctl_start; /* dummy QH for high speed control */
- uhci_soft_qh_t *sc_hctl_end; /* last control QH */
- uhci_soft_qh_t *sc_bulk_start; /* dummy QH for bulk */
- uhci_soft_qh_t *sc_bulk_end; /* last bulk transfer */
- uhci_soft_qh_t *sc_last_qh; /* dummy QH at the end */
+ struct uhci_soft_qh *sc_lctl_start; /* dummy QH for low speed control */
+ struct uhci_soft_qh *sc_lctl_end; /* last control QH */
+ struct uhci_soft_qh *sc_hctl_start;/* dummy QH for high speed control */
+ struct uhci_soft_qh *sc_hctl_end; /* last control QH */
+ struct uhci_soft_qh *sc_bulk_start; /* dummy QH for bulk */
+ struct uhci_soft_qh *sc_bulk_end; /* last bulk transfer */
+ struct uhci_soft_qh *sc_last_qh; /* dummy QH at the end */
u_int32_t sc_loops; /* number of QHs that wants looping */
- uhci_soft_td_t *sc_freetds; /* TD free list */
- uhci_soft_qh_t *sc_freeqhs; /* QH free list */
+ struct uhci_soft_td *sc_freetds; /* TD free list */
+ struct uhci_soft_qh *sc_freeqhs; /* QH free list */
SIMPLEQ_HEAD(, usbd_xfer) sc_free_xfers; /* free xfers */
@@ -164,7 +164,7 @@ typedef struct uhci_softc {
/* Info for the root hub interrupt "pipe". */
int sc_ival; /* time between root hub intrs */
- usbd_xfer_handle sc_intr_xfer; /* root hub interrupt transfer */
+ struct usbd_xfer *sc_intr_xfer; /* root hub interrupt transfer */
struct timeout sc_poll_handle;
char sc_vendor[32]; /* vendor string for root hub */
@@ -173,10 +173,10 @@ typedef struct uhci_softc {
void *sc_shutdownhook; /* cookie from shutdown hook */
struct device *sc_child; /* /dev/usb# device */
-} uhci_softc_t;
+};
-usbd_status uhci_init(uhci_softc_t *);
-usbd_status uhci_run(uhci_softc_t *, int run);
+usbd_status uhci_init(struct uhci_softc *);
+usbd_status uhci_run(struct uhci_softc *, int run);
int uhci_intr(void *);
-int uhci_detach(uhci_softc_t *, int);
+int uhci_detach(struct uhci_softc *, int);
int uhci_activate(struct device *, int);
diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c
index c43b67fe4f8..a5777b8c9ad 100644
--- a/sys/dev/usb/uhidev.c
+++ b/sys/dev/usb/uhidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhidev.c,v 1.42 2011/07/03 15:47:17 matthew Exp $ */
+/* $OpenBSD: uhidev.c,v 1.43 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -67,7 +67,7 @@ int uhidevdebug = 0;
#define DPRINTFN(n,x)
#endif
-void uhidev_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void uhidev_intr(struct usbd_xfer *, void *, usbd_status);
int uhidev_maxrepid(void *buf, int len);
int uhidevprint(void *aux, const char *pnp);
@@ -114,7 +114,7 @@ uhidev_attach(struct device *parent, struct device *self, void *aux)
{
struct uhidev_softc *sc = (struct uhidev_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_interface_handle iface = uaa->iface;
+ struct usbd_interface *iface = uaa->iface;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
struct uhidev_attach_arg uha;
@@ -376,7 +376,7 @@ uhidev_detach(struct device *self, int flags)
}
void
-uhidev_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
+uhidev_intr(struct usbd_xfer *xfer, void *addr, usbd_status status)
{
struct uhidev_softc *sc = addr;
struct uhidev *scd;
diff --git a/sys/dev/usb/uhidev.h b/sys/dev/usb/uhidev.h
index 079b1f839e4..b01f7b6afac 100644
--- a/sys/dev/usb/uhidev.h
+++ b/sys/dev/usb/uhidev.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhidev.h,v 1.11 2010/08/02 23:17:34 miod Exp $ */
+/* $OpenBSD: uhidev.h,v 1.12 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: uhidev.h,v 1.3 2002/10/08 09:56:17 dan Exp $ */
/*
@@ -39,18 +39,18 @@
struct uhidev_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface; /* interface */
- usbd_pipe_handle sc_ipipe; /* input interrupt pipe */
- usbd_xfer_handle sc_ixfer; /* read request */
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;/* interface */
+ struct usbd_pipe *sc_ipipe; /* input interrupt pipe */
+ struct usbd_xfer *sc_ixfer; /* read request */
int sc_iep_addr;
u_char *sc_ibuf;
u_int sc_isize;
- usbd_pipe_handle sc_opipe; /* output interrupt pipe */
- usbd_xfer_handle sc_oxfer; /* write request */
- usbd_xfer_handle sc_owxfer; /* internal write request */
+ struct usbd_pipe *sc_opipe; /* output interrupt pipe */
+ struct usbd_xfer *sc_oxfer; /* write request */
+ struct usbd_xfer *sc_owxfer; /* internal write request */
int sc_oep_addr;
void *sc_repdesc;
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
index 9c03b5aa544..b777b65cde9 100644
--- a/sys/dev/usb/uhub.c
+++ b/sys/dev/usb/uhub.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhub.c,v 1.60 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: uhub.c,v 1.61 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: uhub.c,v 1.64 2003/02/08 03:32:51 ichiro Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */
@@ -62,8 +62,8 @@ int uhubdebug = 0;
struct uhub_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_hub; /* USB device */
- usbd_pipe_handle sc_ipipe; /* interrupt pipe */
+ struct usbd_device *sc_hub; /* USB device */
+ struct usbd_pipe *sc_ipipe; /* interrupt pipe */
u_int8_t *sc_statusbuf; /* per port status buffer */
size_t sc_statuslen; /* status bufferlen */
u_char sc_running;
@@ -72,8 +72,8 @@ struct uhub_softc {
#define UHUB_IS_HIGH_SPEED(sc) (UHUB_PROTO(sc) != UDPROTO_FSHUB)
#define UHUB_IS_SINGLE_TT(sc) (UHUB_PROTO(sc) == UDPROTO_HSHUBSTT)
-usbd_status uhub_explore(usbd_device_handle hub);
-void uhub_intr(usbd_xfer_handle, usbd_private_handle,usbd_status);
+usbd_status uhub_explore(struct usbd_device *hub);
+void uhub_intr(struct usbd_xfer *, void *, usbd_status);
/*
* We need two attachment points:
@@ -124,13 +124,13 @@ uhub_attach(struct device *parent, struct device *self, void *aux)
{
struct uhub_softc *sc = (struct uhub_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
usbd_status err;
struct usbd_hub *hub = NULL;
usb_device_request_t req;
usb_hub_descriptor_t hubdesc;
int p, port, nports, nremov, pwrdly;
- usbd_interface_handle iface;
+ struct usbd_interface *iface;
usb_endpoint_descriptor_t *ed;
struct usbd_tt *tts = NULL;
@@ -339,7 +339,7 @@ uhub_attach(struct device *parent, struct device *self, void *aux)
}
usbd_status
-uhub_explore(usbd_device_handle dev)
+uhub_explore(struct usbd_device *dev)
{
usb_hub_descriptor_t *hd = &dev->hub->hubdesc;
struct uhub_softc *sc = dev->hub->hubsoftc;
@@ -519,7 +519,7 @@ uhub_activate(struct device *self, int act)
{
struct uhub_softc *sc = (struct uhub_softc *)self;
struct usbd_hub *hub = sc->sc_hub->hub;
- usbd_device_handle dev;
+ struct usbd_device *dev;
int nports, port, i;
switch (act) {
@@ -585,7 +585,7 @@ uhub_detach(struct device *self, int flags)
* to be explored again.
*/
void
-uhub_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
+uhub_intr(struct usbd_xfer *xfer, void *addr, usbd_status status)
{
struct uhub_softc *sc = addr;
diff --git a/sys/dev/usb/uipaq.c b/sys/dev/usb/uipaq.c
index be18e7a0d4b..c68c89a257c 100644
--- a/sys/dev/usb/uipaq.c
+++ b/sys/dev/usb/uipaq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipaq.c,v 1.20 2011/07/03 15:47:17 matthew Exp $ */
+/* $OpenBSD: uipaq.c,v 1.21 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -75,8 +75,8 @@ int uipaqdebug = 0;
struct uipaq_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev; /* device */
- usbd_interface_handle sc_iface; /* interface */
+ struct usbd_device *sc_udev; /* device */
+ struct usbd_interface *sc_iface; /* interface */
struct device *sc_subdev; /* ucom uses that */
u_int16_t sc_lcr; /* state for DTR/RTS */
@@ -162,8 +162,8 @@ uipaq_attach(struct device *parent, struct device *self, void *aux)
{
struct uipaq_softc *sc = (struct uipaq_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
- usbd_interface_handle iface;
+ struct usbd_device *dev = uaa->device;
+ struct usbd_interface *iface;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
char *devname = sc->sc_dev.dv_xname;
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c
index 9e086ee4120..d800cb5a08e 100644
--- a/sys/dev/usb/ukbd.c
+++ b/sys/dev/usb/ukbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ukbd.c,v 1.58 2012/07/13 12:33:08 shadchin Exp $ */
+/* $OpenBSD: ukbd.c,v 1.59 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -211,7 +211,7 @@ ukbd_attach(struct device *parent, struct device *self, void *aux)
struct hidkbd *kbd = &sc->sc_kbd;
struct usb_attach_arg *uaa = aux;
struct uhidev_attach_arg *uha = (struct uhidev_attach_arg *)uaa;
- usb_hid_descriptor_t *hid;
+ struct usb_hid_descriptor *hid;
u_int32_t qflags;
int dlen, repid;
void *desc;
@@ -421,7 +421,7 @@ void
ukbd_cnpollc(void *v, int on)
{
struct ukbd_softc *sc = v;
- usbd_device_handle dev;
+ struct usbd_device *dev;
DPRINTFN(2,("ukbd_cnpollc: sc=%p on=%d\n", v, on));
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c
index 446aef7c3b8..39d1d031182 100644
--- a/sys/dev/usb/ulpt.c
+++ b/sys/dev/usb/ulpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ulpt.c,v 1.42 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: ulpt.c,v 1.43 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: ulpt.c,v 1.57 2003/01/05 10:19:42 scw Exp $ */
/* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */
@@ -81,17 +81,17 @@ int ulptdebug = 0;
struct ulpt_softc {
struct device sc_dev;
- usbd_device_handle sc_udev; /* device */
- usbd_interface_handle sc_iface; /* interface */
+ struct usbd_device *sc_udev; /* device */
+ struct usbd_interface *sc_iface;/* interface */
int sc_ifaceno;
int sc_out;
- usbd_pipe_handle sc_out_pipe; /* bulk out pipe */
+ struct usbd_pipe *sc_out_pipe; /* bulk out pipe */
int sc_in;
- usbd_pipe_handle sc_in_pipe; /* bulk in pipe */
- usbd_xfer_handle sc_in_xfer1;
- usbd_xfer_handle sc_in_xfer2;
+ struct usbd_pipe *sc_in_pipe; /* bulk in pipe */
+ struct usbd_xfer *sc_in_xfer1;
+ struct usbd_xfer *sc_in_xfer2;
u_char sc_junk[64]; /* somewhere to dump input */
u_char sc_state;
@@ -212,8 +212,8 @@ ulpt_attach(struct device *parent, struct device *self, void *aux)
{
struct ulpt_softc *sc = (struct ulpt_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
- usbd_interface_handle iface = uaa->iface;
+ struct usbd_device *dev = uaa->device;
+ struct usbd_interface *iface = uaa->iface;
usb_interface_descriptor_t *ifcd = usbd_get_interface_descriptor(iface);
usb_interface_descriptor_t *id, *iend;
usb_config_descriptor_t *cdesc;
@@ -451,7 +451,7 @@ ulpt_reset(struct ulpt_softc *sc)
}
static void
-ulpt_input(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+ulpt_input(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct ulpt_softc *sc = priv;
@@ -618,7 +618,7 @@ ulpt_do_write(struct ulpt_softc *sc, struct uio *uio, int flags)
u_int32_t n;
int error = 0;
void *bufp;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
usbd_status err;
DPRINTF(("ulptwrite\n"));
@@ -677,7 +677,7 @@ ulpt_ucode_loader_hp(struct ulpt_softc *sc)
size_t ucode_size;
const char *ucode_name = sc->sc_fwdev->ucode_name;
int offset = 0, remain;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
void *bufp;
/* open microcode file */
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c
index 2e01138267d..a25fc2aa44a 100644
--- a/sys/dev/usb/umass.c
+++ b/sys/dev/usb/umass.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umass.c,v 1.62 2011/07/03 15:47:17 matthew Exp $ */
+/* $OpenBSD: umass.c,v 1.63 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: umass.c,v 1.116 2004/06/30 05:53:46 mycroft Exp $ */
/*
@@ -197,17 +197,17 @@ void umass_disco(struct umass_softc *sc);
/* generic transfer functions */
usbd_status umass_polled_transfer(struct umass_softc *sc,
- usbd_xfer_handle xfer);
+ struct usbd_xfer *xfer);
usbd_status umass_setup_transfer(struct umass_softc *sc,
- usbd_pipe_handle pipe,
+ struct usbd_pipe *pipe,
void *buffer, int buflen, int flags,
- usbd_xfer_handle xfer);
+ struct usbd_xfer *xfer);
usbd_status umass_setup_ctrl_transfer(struct umass_softc *sc,
usb_device_request_t *req,
void *buffer, int buflen, int flags,
- usbd_xfer_handle xfer);
+ struct usbd_xfer *xfer);
void umass_clear_endpoint_stall(struct umass_softc *sc, int endpt,
- usbd_xfer_handle xfer);
+ struct usbd_xfer *xfer);
void umass_adjust_transfer(struct umass_softc *);
#if 0
void umass_reset(struct umass_softc *sc, transfer_cb_f cb, void *priv);
@@ -217,7 +217,7 @@ void umass_reset(struct umass_softc *sc, transfer_cb_f cb, void *priv);
void umass_bbb_transfer(struct umass_softc *, int, void *, int, void *,
int, int, u_int, umass_callback, void *);
void umass_bbb_reset(struct umass_softc *, int);
-void umass_bbb_state(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void umass_bbb_state(struct usbd_xfer *, void *, usbd_status);
u_int8_t umass_bbb_get_max_lun(struct umass_softc *);
@@ -225,9 +225,9 @@ u_int8_t umass_bbb_get_max_lun(struct umass_softc *);
void umass_cbi_transfer(struct umass_softc *, int, void *, int, void *,
int, int, u_int, umass_callback, void *);
void umass_cbi_reset(struct umass_softc *, int);
-void umass_cbi_state(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void umass_cbi_state(struct usbd_xfer *, void *, usbd_status);
-int umass_cbi_adsc(struct umass_softc *, char *, int, usbd_xfer_handle);
+int umass_cbi_adsc(struct umass_softc *, char *, int, struct usbd_xfer *);
const struct umass_wire_methods umass_bbb_methods = {
umass_bbb_transfer,
@@ -244,9 +244,9 @@ const struct umass_wire_methods umass_cbi_methods = {
#ifdef UMASS_DEBUG
/* General debugging functions */
void umass_bbb_dump_cbw(struct umass_softc *sc,
- umass_bbb_cbw_t *cbw);
+ struct umass_bbb_cbw *cbw);
void umass_bbb_dump_csw(struct umass_softc *sc,
- umass_bbb_csw_t *csw);
+ struct umass_bbb_csw *csw);
void umass_dump_buffer(struct umass_softc *sc, u_int8_t *buffer,
int buflen, int printlen);
#endif
@@ -719,7 +719,7 @@ umass_disco(struct umass_softc *sc)
*/
usbd_status
-umass_polled_transfer(struct umass_softc *sc, usbd_xfer_handle xfer)
+umass_polled_transfer(struct umass_softc *sc, struct usbd_xfer *xfer)
{
usbd_status err;
@@ -728,7 +728,7 @@ umass_polled_transfer(struct umass_softc *sc, usbd_xfer_handle xfer)
/*
* If a polled transfer is already in progress, preserve the new
- * usbd_xfer_handle and run it after the running one completes.
+ * struct usbd_xfer and run it after the running one completes.
* This converts the recursive calls into the umass_*_state callbacks
* into iteration, preventing us from running out of stack under
* error conditions.
@@ -778,9 +778,9 @@ start_next_xfer:
}
usbd_status
-umass_setup_transfer(struct umass_softc *sc, usbd_pipe_handle pipe,
+umass_setup_transfer(struct umass_softc *sc, struct usbd_pipe *pipe,
void *buffer, int buflen, int flags,
- usbd_xfer_handle xfer)
+ struct usbd_xfer *xfer)
{
usbd_status err;
@@ -815,7 +815,7 @@ umass_setup_transfer(struct umass_softc *sc, usbd_pipe_handle pipe,
usbd_status
umass_setup_ctrl_transfer(struct umass_softc *sc, usb_device_request_t *req,
- void *buffer, int buflen, int flags, usbd_xfer_handle xfer)
+ void *buffer, int buflen, int flags, struct usbd_xfer *xfer)
{
usbd_status err;
@@ -887,7 +887,7 @@ umass_adjust_transfer(struct umass_softc *sc)
void
umass_clear_endpoint_stall(struct umass_softc *sc, int endpt,
- usbd_xfer_handle xfer)
+ struct usbd_xfer *xfer)
{
if (sc->sc_dying)
return;
@@ -1018,14 +1018,14 @@ umass_bbb_transfer(struct umass_softc *sc, int lun, void *cmd, int cmdlen,
KASSERT(datalen == 0 || dir != DIR_NONE,
("%s: direction is NONE while datalen is not zero\n",
sc->sc_dev.dv_xname));
- KASSERT(sizeof(umass_bbb_cbw_t) == UMASS_BBB_CBW_SIZE,
+ KASSERT(sizeof(struct umass_bbb_cbw) == UMASS_BBB_CBW_SIZE,
("%s: CBW struct does not have the right size (%d vs. %d)\n",
sc->sc_dev.dv_xname,
- sizeof(umass_bbb_cbw_t), UMASS_BBB_CBW_SIZE));
- KASSERT(sizeof(umass_bbb_csw_t) == UMASS_BBB_CSW_SIZE,
+ sizeof(struct umass_bbb_cbw), UMASS_BBB_CBW_SIZE));
+ KASSERT(sizeof(struct umass_bbb_csw) == UMASS_BBB_CSW_SIZE,
("%s: CSW struct does not have the right size (%d vs. %d)\n",
sc->sc_dev.dv_xname,
- sizeof(umass_bbb_csw_t), UMASS_BBB_CSW_SIZE));
+ sizeof(struct umass_bbb_csw), UMASS_BBB_CSW_SIZE));
/*
* Determine the direction of the data transfer and the length.
@@ -1085,11 +1085,10 @@ umass_bbb_transfer(struct umass_softc *sc, int lun, void *cmd, int cmdlen,
}
void
-umass_bbb_state(usbd_xfer_handle xfer, usbd_private_handle priv,
- usbd_status err)
+umass_bbb_state(struct usbd_xfer *xfer, void *priv, usbd_status err)
{
struct umass_softc *sc = (struct umass_softc *) priv;
- usbd_xfer_handle next_xfer;
+ struct usbd_xfer *next_xfer;
KASSERT(sc->sc_wire & UMASS_WPROTO_BBB,
("sc->sc_wire == 0x%02x wrong for umass_bbb_state\n",
@@ -1398,7 +1397,7 @@ umass_bbb_state(usbd_xfer_handle xfer, usbd_private_handle priv,
int
umass_cbi_adsc(struct umass_softc *sc, char *buffer, int buflen,
- usbd_xfer_handle xfer)
+ struct usbd_xfer *xfer)
{
KASSERT(sc->sc_wire & (UMASS_WPROTO_CBI|UMASS_WPROTO_CBI_I),
("sc->sc_wire == 0x%02x wrong for umass_cbi_adsc\n",
@@ -1538,8 +1537,7 @@ umass_cbi_transfer(struct umass_softc *sc, int lun,
}
void
-umass_cbi_state(usbd_xfer_handle xfer, usbd_private_handle priv,
- usbd_status err)
+umass_cbi_state(struct usbd_xfer *xfer, void *priv, usbd_status err)
{
struct umass_softc *sc = (struct umass_softc *) priv;
@@ -1863,7 +1861,7 @@ umass_bbb_get_max_lun(struct umass_softc *sc)
#ifdef UMASS_DEBUG
void
-umass_bbb_dump_cbw(struct umass_softc *sc, umass_bbb_cbw_t *cbw)
+umass_bbb_dump_cbw(struct umass_softc *sc, struct umass_bbb_cbw *cbw)
{
int clen = cbw->bCDBLength;
int dlen = UGETDW(cbw->dCBWDataTransferLength);
@@ -1883,7 +1881,7 @@ umass_bbb_dump_cbw(struct umass_softc *sc, umass_bbb_cbw_t *cbw)
}
void
-umass_bbb_dump_csw(struct umass_softc *sc, umass_bbb_csw_t *csw)
+umass_bbb_dump_csw(struct umass_softc *sc, struct umass_bbb_csw *csw)
{
int sig = UGETDW(csw->dCSWSignature);
int tag = UGETDW(csw->dCSWTag);
diff --git a/sys/dev/usb/umassvar.h b/sys/dev/usb/umassvar.h
index e60b29a8f77..8734f0d0774 100644
--- a/sys/dev/usb/umassvar.h
+++ b/sys/dev/usb/umassvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: umassvar.h,v 1.12 2007/06/13 06:25:03 mbalmer Exp $ */
+/* $OpenBSD: umassvar.h,v 1.13 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: umassvar.h,v 1.20 2003/09/08 19:31:01 mycroft Exp $ */
/*-
* Copyright (c) 1999 MAEKAWA Masahide <bishop@rr.iij4u.or.jp>,
@@ -72,7 +72,7 @@ extern int umassdebug;
#define UR_BBB_GET_MAX_LUN 0xfe
/* Command Block Wrapper */
-typedef struct {
+struct umass_bbb_cbw {
uDWord dCBWSignature;
#define CBWSIGNATURE 0x43425355
uDWord dCBWTag;
@@ -84,11 +84,11 @@ typedef struct {
uByte bCDBLength;
#define CBWCDBLENGTH 16
uByte CBWCDB[CBWCDBLENGTH];
-} umass_bbb_cbw_t;
+};
#define UMASS_BBB_CBW_SIZE 31
/* Command Status Wrapper */
-typedef struct {
+struct umass_bbb_csw {
uDWord dCSWSignature;
#define CSWSIGNATURE 0x53425355
#define CSWSIGNATURE_OLYMPUS_C1 0x55425355
@@ -98,7 +98,7 @@ typedef struct {
#define CSWSTATUS_GOOD 0x0
#define CSWSTATUS_FAILED 0x1
#define CSWSTATUS_PHASE 0x2
-} umass_bbb_csw_t;
+};
#define UMASS_BBB_CSW_SIZE 13
/* CBI features */
@@ -136,8 +136,7 @@ typedef void (*umass_callback)(struct umass_softc *, void *, int, int);
typedef void (*umass_wire_xfer)(struct umass_softc *, int, void *, int, void *,
int, int, u_int, umass_callback, void *);
typedef void (*umass_wire_reset)(struct umass_softc *, int);
-typedef void (*umass_wire_state)(usbd_xfer_handle, usbd_private_handle,
- usbd_status);
+typedef void (*umass_wire_state)(struct usbd_xfer *, void *, usbd_status);
struct umass_wire_methods {
umass_wire_xfer wire_xfer;
@@ -152,12 +151,12 @@ struct umassbus_softc {
/* the per device structure */
struct umass_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev; /* device */
- usbd_interface_handle sc_iface; /* interface */
+ struct usbd_device *sc_udev; /* device */
+ struct usbd_interface *sc_iface; /* interface */
int sc_ifaceno; /* interface number */
u_int8_t sc_epaddr[UMASS_NEP];
- usbd_pipe_handle sc_pipe[UMASS_NEP];
+ struct usbd_pipe *sc_pipe[UMASS_NEP];
usb_device_request_t sc_req;
const struct umass_wire_methods *sc_methods;
@@ -183,8 +182,8 @@ struct umass_softc {
u_int32_t sc_busquirks;
/* Bulk specific variables for transfers in progress */
- umass_bbb_cbw_t cbw; /* command block wrapper */
- umass_bbb_csw_t csw; /* command status wrapper*/
+ struct umass_bbb_cbw cbw; /* command block wrapper */
+ struct umass_bbb_csw csw; /* command status wrapper*/
/* CBI specific variables for transfers in progress */
umass_cbi_cbl_t cbl; /* command block */
umass_cbi_sbl_t sbl; /* status block */
@@ -216,7 +215,7 @@ struct umass_softc {
#define XFER_NR 9 /* maximum number */
- usbd_xfer_handle transfer_xfer[XFER_NR]; /* for ctrl xfers */
+ struct usbd_xfer *transfer_xfer[XFER_NR]; /* for ctrl xfers */
void *data_buffer;
@@ -268,7 +267,7 @@ struct umass_softc {
/* For polled transfers */
int polling_depth;
usbd_status polled_xfer_status;
- usbd_xfer_handle next_polled_xfer;
+ struct usbd_xfer *next_polled_xfer;
};
#define UMASS_MAX_TRANSFER_SIZE MAXBSIZE
diff --git a/sys/dev/usb/umbg.c b/sys/dev/usb/umbg.c
index 9ce5172f871..74a365a0443 100644
--- a/sys/dev/usb/umbg.c
+++ b/sys/dev/usb/umbg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umbg.c,v 1.20 2013/04/12 12:58:39 mpi Exp $ */
+/* $OpenBSD: umbg.c,v 1.21 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2007 Marc Balmer <mbalmer@openbsd.org>
@@ -49,13 +49,13 @@ int umbgdebug = 0;
struct umbg_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev; /* USB device */
- usbd_interface_handle sc_iface; /* data interface */
+ struct usbd_device *sc_udev; /* USB device */
+ struct usbd_interface *sc_iface; /* data interface */
int sc_bulkin_no;
- usbd_pipe_handle sc_bulkin_pipe;
+ struct usbd_pipe *sc_bulkin_pipe;
int sc_bulkout_no;
- usbd_pipe_handle sc_bulkout_pipe;
+ struct usbd_pipe *sc_bulkout_pipe;
struct timeout sc_to; /* get time from device */
struct usb_task sc_task;
@@ -172,8 +172,8 @@ umbg_attach(struct device *parent, struct device *self, void *aux)
{
struct umbg_softc *sc = (struct umbg_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
- usbd_interface_handle iface = uaa->iface;
+ struct usbd_device *dev = uaa->device;
+ struct usbd_interface *iface = uaa->iface;
struct mbg_time tframe;
usb_endpoint_descriptor_t *ed;
usbd_status err;
@@ -393,7 +393,7 @@ umbg_read(struct umbg_softc *sc, u_int8_t cmd, char *buf, size_t len,
struct timespec *tstamp)
{
usbd_status err;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
xfer = usbd_alloc_xfer(sc->sc_udev);
if (xfer == NULL) {
diff --git a/sys/dev/usb/umct.c b/sys/dev/usb/umct.c
index b32e24cff3e..b4d6ecd5013 100644
--- a/sys/dev/usb/umct.c
+++ b/sys/dev/usb/umct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umct.c,v 1.35 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: umct.c,v 1.36 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: umct.c,v 1.10 2003/02/23 04:20:07 simonb Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -73,17 +73,17 @@ int umctdebug = 0;
struct umct_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev; /* USB device */
- usbd_interface_handle sc_iface; /* interface */
+ struct usbd_device *sc_udev; /* USB device */
+ struct usbd_interface *sc_iface; /* interface */
int sc_iface_number; /* interface number */
u_int16_t sc_product;
int sc_intr_number; /* interrupt number */
- usbd_pipe_handle sc_intr_pipe; /* interrupt pipe */
+ struct usbd_pipe *sc_intr_pipe; /* interrupt pipe */
u_char *sc_intr_buf; /* interrupt buffer */
int sc_isize;
- usb_cdc_line_state_t sc_line_state; /* current line state */
+ struct usb_cdc_line_state sc_line_state; /* current line state */
u_char sc_dtr; /* current DTR state */
u_char sc_rts; /* current RTS state */
u_char sc_break; /* set break */
@@ -110,7 +110,7 @@ struct umct_softc {
void umct_init(struct umct_softc *);
void umct_set_baudrate(struct umct_softc *, u_int);
void umct_set_lcr(struct umct_softc *, u_int);
-void umct_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void umct_intr(struct usbd_xfer *, void *, usbd_status);
void umct_set(void *, int, int, int);
void umct_dtr(struct umct_softc *, int);
@@ -180,7 +180,7 @@ umct_attach(struct device *parent, struct device *self, void *aux)
{
struct umct_softc *sc = (struct umct_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
usb_config_descriptor_t *cdesc;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
@@ -584,7 +584,7 @@ umct_close(void *addr, int portno)
}
void
-umct_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+umct_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct umct_softc *sc = priv;
u_char *buf = sc->sc_intr_buf;
diff --git a/sys/dev/usb/umidi.c b/sys/dev/usb/umidi.c
index 01f39b6975e..7db162c750a 100644
--- a/sys/dev/usb/umidi.c
+++ b/sys/dev/usb/umidi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umidi.c,v 1.35 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: umidi.c,v 1.36 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: umidi.c,v 1.16 2002/07/11 21:14:32 augustss Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -113,8 +113,8 @@ static usbd_status start_input_transfer(struct umidi_endpoint *);
static usbd_status start_output_transfer(struct umidi_endpoint *);
static int out_jack_output(struct umidi_jack *, int);
static void out_jack_flush(struct umidi_jack *);
-static void in_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
-static void out_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
+static void in_intr(struct usbd_xfer *, void *, usbd_status);
+static void out_intr(struct usbd_xfer *, void *, usbd_status);
static int out_build_packet(int, struct umidi_packet *, uByte, u_char *);
@@ -1109,7 +1109,7 @@ start_input_transfer(struct umidi_endpoint *ep)
{
usbd_status err;
usbd_setup_xfer(ep->xfer, ep->pipe,
- (usbd_private_handle)ep,
+ (void *)ep,
ep->buffer, ep->packetsize,
USBD_SHORT_XFER_OK | USBD_NO_COPY, USBD_NO_TIMEOUT, in_intr);
err = usbd_transfer(ep->xfer);
@@ -1126,7 +1126,7 @@ start_output_transfer(struct umidi_endpoint *ep)
{
usbd_status err;
usbd_setup_xfer(ep->xfer, ep->pipe,
- (usbd_private_handle)ep,
+ (void *)ep,
ep->buffer, ep->used,
USBD_NO_COPY, USBD_NO_TIMEOUT, out_intr);
err = usbd_transfer(ep->xfer);
@@ -1207,7 +1207,7 @@ out_jack_flush(struct umidi_jack *j)
static void
-in_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+in_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
int cn, evlen, remain, i;
unsigned char *buf;
@@ -1238,7 +1238,7 @@ in_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
}
static void
-out_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+out_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct umidi_endpoint *ep = (struct umidi_endpoint *)priv;
struct umidi_softc *sc = ep->sc;
diff --git a/sys/dev/usb/umidireg.h b/sys/dev/usb/umidireg.h
index b96fc9f9204..d61d2c2567e 100644
--- a/sys/dev/usb/umidireg.h
+++ b/sys/dev/usb/umidireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: umidireg.h,v 1.7 2008/06/26 05:42:19 ray Exp $ */
+/* $OpenBSD: umidireg.h,v 1.8 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: umidireg.h,v 1.3 2003/12/04 13:57:31 keihan Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -38,36 +38,36 @@
#define UMIDI_EMBEDDED 0x01
#define UMIDI_EXTERNAL 0x02
-typedef struct {
+struct umidi_cs_interface_descriptor {
uByte bLength;
uByte bDescriptorType;
uByte bDescriptorSubtype;
uWord bcdMSC;
uWord wTotalLength;
-} __packed umidi_cs_interface_descriptor_t;
+} __packed;
#define UMIDI_CS_INTERFACE_DESCRIPTOR_SIZE 7
-typedef struct {
+struct umidi_cs_endpoint_descriptor {
uByte bLength;
uByte bDescriptorType;
uByte bDescriptorSubType;
uByte bNumEmbMIDIJack;
-} __packed umidi_cs_endpoint_descriptor_t;
+} __packed;
#define UMIDI_CS_ENDPOINT_DESCRIPTOR_SIZE 4
-typedef struct {
+struct umidi_jack_descriptor {
uByte bLength;
uByte bDescriptorType;
uByte bDescriptorSubtype;
uByte bJackType;
uByte bJackID;
-} __packed umidi_jack_descriptor_t;
+} __packed;
#define UMIDI_JACK_DESCRIPTOR_SIZE 5
#define TO_D(p) ((usb_descriptor_t *)(p))
#define NEXT_D(desc) TO_D((caddr_t)(desc)+(desc)->bLength)
#define TO_IFD(desc) ((usb_interface_descriptor_t *)(desc))
-#define TO_CSIFD(desc) ((umidi_cs_interface_descriptor_t *)(desc))
+#define TO_CSIFD(desc) ((struct umidi_cs_interface_descriptor *)(desc))
#define TO_EPD(desc) ((usb_endpoint_descriptor_t *)(desc))
-#define TO_CSEPD(desc) ((umidi_cs_endpoint_descriptor_t *)(desc))
+#define TO_CSEPD(desc) ((struct umidi_cs_endpoint_descriptor *)(desc))
diff --git a/sys/dev/usb/umidivar.h b/sys/dev/usb/umidivar.h
index a9edea09194..3100a3444e5 100644
--- a/sys/dev/usb/umidivar.h
+++ b/sys/dev/usb/umidivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: umidivar.h,v 1.14 2012/09/02 20:51:36 ratchov Exp $ */
+/* $OpenBSD: umidivar.h,v 1.15 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: umidivar.h,v 1.5 2002/09/12 21:00:42 augustss Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -85,8 +85,8 @@ struct umidi_endpoint {
struct umidi_softc *sc;
/* */
int addr;
- usbd_pipe_handle pipe;
- usbd_xfer_handle xfer;
+ struct usbd_pipe *pipe;
+ struct usbd_xfer *xfer;
unsigned char *buffer;
unsigned packetsize;
int num_open;
@@ -101,8 +101,8 @@ struct umidi_endpoint {
/* software context */
struct umidi_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
struct umidi_quirk *sc_quirk;
int sc_dying;
diff --git a/sys/dev/usb/umodem.c b/sys/dev/usb/umodem.c
index 1d3f12de64c..26b8c369424 100644
--- a/sys/dev/usb/umodem.c
+++ b/sys/dev/usb/umodem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umodem.c,v 1.47 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: umodem.c,v 1.48 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: umodem.c,v 1.45 2002/09/23 05:51:23 simonb Exp $ */
/*
@@ -85,18 +85,18 @@ int umodemdebug = 0;
struct umodem_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev; /* USB device */
+ struct usbd_device *sc_udev; /* USB device */
int sc_ctl_iface_no;
- usbd_interface_handle sc_ctl_iface; /* control interface */
- usbd_interface_handle sc_data_iface; /* data interface */
+ struct usbd_interface *sc_ctl_iface; /* control interface */
+ struct usbd_interface *sc_data_iface; /* data interface */
int sc_cm_cap; /* CM capabilities */
int sc_acm_cap; /* ACM capabilities */
int sc_cm_over_data;
- usb_cdc_line_state_t sc_line_state; /* current line state */
+ struct usb_cdc_line_state sc_line_state;/* current line state */
u_char sc_dtr; /* current DTR state */
u_char sc_rts; /* current RTS state */
@@ -106,8 +106,8 @@ struct umodem_softc {
u_char sc_dying; /* disconnecting */
int sc_ctl_notify; /* Notification endpoint */
- usbd_pipe_handle sc_notify_pipe; /* Notification pipe */
- usb_cdc_notification_t sc_notify_buf; /* Notification structure */
+ struct usbd_pipe *sc_notify_pipe; /* Notification pipe */
+ struct usb_cdc_notification sc_notify_buf; /* Notification structure */
u_char sc_lsr; /* Local status register */
u_char sc_msr; /* Modem status register */
};
@@ -115,7 +115,7 @@ struct umodem_softc {
usbd_status umodem_set_comm_feature(struct umodem_softc *sc,
int feature, int state);
usbd_status umodem_set_line_coding(struct umodem_softc *sc,
- usb_cdc_line_state_t *state);
+ struct usb_cdc_line_state *state);
void umodem_get_status(void *, int portno, u_char *lsr, u_char *msr);
void umodem_set(void *, int, int, int);
@@ -127,7 +127,7 @@ int umodem_param(void *, int, struct termios *);
int umodem_ioctl(void *, int, u_long, caddr_t, int, struct proc *);
int umodem_open(void *, int portno);
void umodem_close(void *, int portno);
-void umodem_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void umodem_intr(struct usbd_xfer *, void *, usbd_status);
struct ucom_methods umodem_methods = {
umodem_get_status,
@@ -165,10 +165,10 @@ umodem_get_caps(struct usb_attach_arg *uaa, int ctl_iface_no,
{
const usb_descriptor_t *desc;
const usb_interface_descriptor_t *id;
- const usb_cdc_cm_descriptor_t *cmd;
- const usb_cdc_acm_descriptor_t *acmd;
- const usb_cdc_union_descriptor_t *uniond;
- usbd_desc_iter_t iter;
+ const struct usb_cdc_cm_descriptor *cmd;
+ const struct usb_cdc_acm_descriptor *acmd;
+ const struct usb_cdc_union_descriptor *uniond;
+ struct usbd_desc_iter iter;
int current_iface_no = -1;
*data_iface_no = -1;
@@ -189,16 +189,17 @@ umodem_get_caps(struct usb_attach_arg *uaa, int ctl_iface_no,
desc->bDescriptorType == UDESC_CS_INTERFACE) {
switch(desc->bDescriptorSubtype) {
case UDESCSUB_CDC_CM:
- cmd = (usb_cdc_cm_descriptor_t *)desc;
+ cmd = (struct usb_cdc_cm_descriptor *)desc;
*cm_cap = cmd->bmCapabilities;
*data_iface_no = cmd->bDataInterface;
break;
case UDESCSUB_CDC_ACM:
- acmd = (usb_cdc_acm_descriptor_t *)desc;
+ acmd = (struct usb_cdc_acm_descriptor *)desc;
*acm_cap = acmd->bmCapabilities;
break;
case UDESCSUB_CDC_UNION:
- uniond = (usb_cdc_union_descriptor_t *)desc;
+ uniond =
+ (struct usb_cdc_union_descriptor *)desc;
*data_iface_no = uniond->bSlaveInterface[0];
break;
}
@@ -258,7 +259,7 @@ umodem_attach(struct device *parent, struct device *self, void *aux)
{
struct umodem_softc *sc = (struct umodem_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
usbd_status err;
@@ -450,7 +451,7 @@ umodem_close(void *addr, int portno)
}
void
-umodem_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+umodem_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct umodem_softc *sc = priv;
u_char mstatus;
@@ -528,7 +529,7 @@ umodem_param(void *addr, int portno, struct termios *t)
{
struct umodem_softc *sc = addr;
usbd_status err;
- usb_cdc_line_state_t ls;
+ struct usb_cdc_line_state ls;
DPRINTF(("umodem_param: sc=%p\n", sc));
@@ -681,7 +682,8 @@ umodem_set(void *addr, int portno, int reg, int onoff)
}
usbd_status
-umodem_set_line_coding(struct umodem_softc *sc, usb_cdc_line_state_t *state)
+umodem_set_line_coding(struct umodem_softc *sc,
+ struct usb_cdc_line_state *state)
{
usb_device_request_t req;
usbd_status err;
@@ -718,7 +720,7 @@ umodem_set_comm_feature(struct umodem_softc *sc, int feature, int state)
{
usb_device_request_t req;
usbd_status err;
- usb_cdc_abstract_state_t ast;
+ struct usb_cdc_abstract_state ast;
DPRINTF(("umodem_set_comm_feature: feature=%d state=%d\n", feature,
state));
diff --git a/sys/dev/usb/umsm.c b/sys/dev/usb/umsm.c
index 9c25e0a7714..7e31a230766 100644
--- a/sys/dev/usb/umsm.c
+++ b/sys/dev/usb/umsm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umsm.c,v 1.89 2013/01/04 02:49:44 jsg Exp $ */
+/* $OpenBSD: umsm.c,v 1.90 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2008 Yojiro UO <yuo@nui.org>
@@ -61,14 +61,14 @@ int umsm_activate(struct device *, int);
int umsm_open(void *, int);
void umsm_close(void *, int);
-void umsm_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void umsm_intr(struct usbd_xfer *, void *, usbd_status);
void umsm_get_status(void *, int, u_char *, u_char *);
void umsm_set(void *, int, int, int);
struct umsm_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
int sc_iface_no;
struct device *sc_subdev;
u_char sc_dying;
@@ -76,7 +76,7 @@ struct umsm_softc {
/* interrupt ep */
int sc_intr_number;
- usbd_pipe_handle sc_intr_pipe;
+ struct usbd_pipe *sc_intr_pipe;
u_char *sc_intr_buf;
int sc_isize;
@@ -86,8 +86,8 @@ struct umsm_softc {
u_char sc_rts; /* current RTS state */
};
-usbd_status umsm_huawei_changemode(usbd_device_handle);
-usbd_status umsm_truinstall_changemode(usbd_device_handle);
+usbd_status umsm_huawei_changemode(struct usbd_device *);
+usbd_status umsm_truinstall_changemode(struct usbd_device *);
usbd_status umsm_umass_changemode(struct umsm_softc *);
struct ucom_methods umsm_methods = {
@@ -505,14 +505,14 @@ umsm_close(void *addr, int portno)
}
void
-umsm_intr(usbd_xfer_handle xfer, usbd_private_handle priv,
+umsm_intr(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct umsm_softc *sc = priv;
- usb_cdc_notification_t *buf;
+ struct usb_cdc_notification *buf;
u_char mstatus;
- buf = (usb_cdc_notification_t *)sc->sc_intr_buf;
+ buf = (struct usb_cdc_notification *)sc->sc_intr_buf;
if (sc->sc_dying)
return;
@@ -612,7 +612,7 @@ umsm_set(void *addr, int portno, int reg, int onoff)
}
usbd_status
-umsm_huawei_changemode(usbd_device_handle dev)
+umsm_huawei_changemode(struct usbd_device *dev)
{
usb_device_request_t req;
usbd_status err;
@@ -631,7 +631,7 @@ umsm_huawei_changemode(usbd_device_handle dev)
}
usbd_status
-umsm_truinstall_changemode(usbd_device_handle dev)
+umsm_truinstall_changemode(struct usbd_device *dev)
{
usb_device_request_t req;
usbd_status err;
@@ -657,14 +657,14 @@ umsm_umass_changemode(struct umsm_softc *sc)
#define UMASS_SERVICE_ACTION_OUT 0x9f
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
- usbd_xfer_handle xfer;
- usbd_pipe_handle cmdpipe;
+ struct usbd_xfer *xfer;
+ struct usbd_pipe *cmdpipe;
usbd_status err;
u_int32_t n;
void *bufp;
int target_ep, i;
- umass_bbb_cbw_t cbw;
+ struct umass_bbb_cbw cbw;
static int dCBWTag = 0x12345678;
USETDW(cbw.dCBWSignature, CBWSIGNATURE);
diff --git a/sys/dev/usb/uoak.h b/sys/dev/usb/uoak.h
index 0bc2ca9daff..b58daf74c9d 100644
--- a/sys/dev/usb/uoak.h
+++ b/sys/dev/usb/uoak.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uoak.h,v 1.2 2012/10/19 14:52:38 deraadt Exp $ */
+/* $OpenBSD: uoak.h,v 1.3 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2012 Yojiro UO <yuo@nui.org>
@@ -115,7 +115,7 @@ struct uoak_softc {
struct uhidev *sc_hdev;
void *sc_parent;
struct ksensordev *sc_sensordev;
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
uint16_t sc_flag;
struct usb_device_info sc_udi;
diff --git a/sys/dev/usb/uoaklux.c b/sys/dev/usb/uoaklux.c
index 1a15b5bc3b9..ffa6c664b2b 100644
--- a/sys/dev/usb/uoaklux.c
+++ b/sys/dev/usb/uoaklux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uoaklux.c,v 1.3 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: uoaklux.c,v 1.4 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2012 Yojiro UO <yuo@nui.org>
@@ -128,7 +128,7 @@ uoaklux_attach(struct device *parent, struct device *self, void *aux)
struct uoaklux_softc *sc = (struct uoaklux_softc *)self;
struct usb_attach_arg *uaa = aux;
struct uhidev_attach_arg *uha = (struct uhidev_attach_arg *)uaa;
- usbd_device_handle dev = uha->parent->sc_udev;
+ struct usbd_device *dev = uha->parent->sc_udev;
struct uoak_softc *scc = &sc->sc_uoak_softc;
int err, size, repid;
diff --git a/sys/dev/usb/uoakrh.c b/sys/dev/usb/uoakrh.c
index 2b4656514cc..769b97d7233 100644
--- a/sys/dev/usb/uoakrh.c
+++ b/sys/dev/usb/uoakrh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uoakrh.c,v 1.4 2013/04/06 13:03:09 sf Exp $ */
+/* $OpenBSD: uoakrh.c,v 1.5 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2012 Yojiro UO <yuo@nui.org>
@@ -131,7 +131,7 @@ uoakrh_attach(struct device *parent, struct device *self, void *aux)
struct uoakrh_softc *sc = (struct uoakrh_softc *)self;
struct usb_attach_arg *uaa = aux;
struct uhidev_attach_arg *uha = (struct uhidev_attach_arg *)uaa;
- usbd_device_handle dev = uha->parent->sc_udev;
+ struct usbd_device *dev = uha->parent->sc_udev;
struct uoak_softc *scc = &sc->sc_uoak_softc;
int err, size, repid;
diff --git a/sys/dev/usb/uoakv.c b/sys/dev/usb/uoakv.c
index 567174a78d0..4f9996a64e9 100644
--- a/sys/dev/usb/uoakv.c
+++ b/sys/dev/usb/uoakv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uoakv.c,v 1.3 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: uoakv.c,v 1.4 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2012 Yojiro UO <yuo@nui.org>
@@ -131,7 +131,7 @@ uoakv_attach(struct device *parent, struct device *self, void *aux)
struct uoakv_softc *sc = (struct uoakv_softc *)self;
struct usb_attach_arg *uaa = aux;
struct uhidev_attach_arg *uha = (struct uhidev_attach_arg *)uaa;
- usbd_device_handle dev = uha->parent->sc_udev;
+ struct usbd_device *dev = uha->parent->sc_udev;
struct uoak_softc *scc = &sc->sc_uoak_softc;
int i, err, size, repid;
diff --git a/sys/dev/usb/uow.c b/sys/dev/usb/uow.c
index 3f65108eca4..372d9b19e23 100644
--- a/sys/dev/usb/uow.c
+++ b/sys/dev/usb/uow.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uow.c,v 1.32 2013/04/12 12:58:39 mpi Exp $ */
+/* $OpenBSD: uow.c,v 1.33 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -43,13 +43,13 @@ struct uow_softc {
struct onewire_bus sc_ow_bus;
struct device *sc_ow_dev;
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
- usbd_pipe_handle sc_ph_ibulk;
- usbd_pipe_handle sc_ph_obulk;
- usbd_pipe_handle sc_ph_intr;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
+ struct usbd_pipe *sc_ph_ibulk;
+ struct usbd_pipe *sc_ph_obulk;
+ struct usbd_pipe *sc_ph_intr;
u_int8_t sc_regs[DS2490_NREGS];
- usbd_xfer_handle sc_xfer;
+ struct usbd_xfer *sc_xfer;
u_int8_t sc_fifo[DS2490_DATAFIFOSIZE];
};
@@ -89,7 +89,7 @@ int uow_cmd(struct uow_softc *, int, int, int);
#define uow_commcmd(s, c, p) uow_cmd((s), DS2490_COMM_CMD, (c), (p))
#define uow_modecmd(s, c, p) uow_cmd((s), DS2490_MODE_CMD, (c), (p))
-void uow_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void uow_intr(struct usbd_xfer *, void *, usbd_status);
int uow_read(struct uow_softc *, void *, int);
int uow_write(struct uow_softc *, const void *, int);
int uow_reset(struct uow_softc *);
@@ -429,7 +429,7 @@ again:
}
void
-uow_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+uow_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct uow_softc *sc = priv;
diff --git a/sys/dev/usb/uplcom.c b/sys/dev/usb/uplcom.c
index 8953ab90c9b..921cc75f161 100644
--- a/sys/dev/usb/uplcom.c
+++ b/sys/dev/usb/uplcom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uplcom.c,v 1.58 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: uplcom.c,v 1.59 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: uplcom.c,v 1.29 2002/09/23 05:51:23 simonb Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -81,17 +81,17 @@ int uplcomdebug = 0;
struct uplcom_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev; /* USB device */
- usbd_interface_handle sc_iface; /* interface */
+ struct usbd_device *sc_udev; /* USB device */
+ struct usbd_interface *sc_iface; /* interface */
int sc_iface_number; /* interface number */
- usbd_interface_handle sc_intr_iface; /* interrupt interface */
+ struct usbd_interface *sc_intr_iface; /* interrupt interface */
int sc_intr_number; /* interrupt number */
- usbd_pipe_handle sc_intr_pipe; /* interrupt pipe */
+ struct usbd_pipe *sc_intr_pipe; /* interrupt pipe */
u_char *sc_intr_buf; /* interrupt buffer */
int sc_isize;
- usb_cdc_line_state_t sc_line_state; /* current line state */
+ struct usb_cdc_line_state sc_line_state;/* current line state */
int sc_dtr; /* current DTR state */
int sc_rts; /* current RTS state */
@@ -113,9 +113,9 @@ struct uplcom_softc {
usbd_status uplcom_reset(struct uplcom_softc *);
usbd_status uplcom_set_line_coding(struct uplcom_softc *sc,
- usb_cdc_line_state_t *state);
+ struct usb_cdc_line_state *state);
usbd_status uplcom_set_crtscts(struct uplcom_softc *);
-void uplcom_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void uplcom_intr(struct usbd_xfer *, void *, usbd_status);
void uplcom_set(void *, int, int, int);
void uplcom_dtr(struct uplcom_softc *, int);
@@ -219,7 +219,7 @@ uplcom_attach(struct device *parent, struct device *self, void *aux)
{
struct uplcom_softc *sc = (struct uplcom_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
usb_config_descriptor_t *cdesc;
usb_device_descriptor_t *ddesc;
usb_interface_descriptor_t *id;
@@ -585,7 +585,8 @@ uplcom_set_crtscts(struct uplcom_softc *sc)
}
usbd_status
-uplcom_set_line_coding(struct uplcom_softc *sc, usb_cdc_line_state_t *state)
+uplcom_set_line_coding(struct uplcom_softc *sc,
+ struct usb_cdc_line_state *state)
{
usb_device_request_t req;
usbd_status err;
@@ -622,7 +623,7 @@ uplcom_param(void *addr, int portno, struct termios *t)
{
struct uplcom_softc *sc = addr;
usbd_status err;
- usb_cdc_line_state_t ls;
+ struct usb_cdc_line_state ls;
DPRINTF(("uplcom_param: sc=%p\n", sc));
@@ -765,7 +766,7 @@ uplcom_close(void *addr, int portno)
}
void
-uplcom_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+uplcom_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct uplcom_softc *sc = priv;
u_char *buf = sc->sc_intr_buf;
diff --git a/sys/dev/usb/urio.c b/sys/dev/usb/urio.c
index b9549507f73..bf6feeb72dc 100644
--- a/sys/dev/usb/urio.c
+++ b/sys/dev/usb/urio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: urio.c,v 1.40 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: urio.c,v 1.41 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: urio.c,v 1.15 2002/10/23 09:14:02 jdolecek Exp $ */
/*
@@ -71,13 +71,13 @@ int uriodebug = 0;
struct urio_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
int sc_in_addr;
- usbd_pipe_handle sc_in_pipe;
+ struct usbd_pipe *sc_in_pipe;
int sc_out_addr;
- usbd_pipe_handle sc_out_pipe;
+ struct usbd_pipe *sc_out_pipe;
int sc_refcnt;
char sc_dying;
@@ -130,8 +130,8 @@ urio_attach(struct device *parent, struct device *self, void *aux)
{
struct urio_softc *sc = (struct urio_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
- usbd_interface_handle iface;
+ struct usbd_device *dev = uaa->device;
+ struct usbd_interface *iface;
usbd_status err;
usb_endpoint_descriptor_t *ed;
u_int8_t epcount;
@@ -301,7 +301,7 @@ int
urioread(dev_t dev, struct uio *uio, int flag)
{
struct urio_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
usbd_status err;
void *bufp;
u_int32_t n, tn;
@@ -358,7 +358,7 @@ int
uriowrite(dev_t dev, struct uio *uio, int flag)
{
struct urio_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
usbd_status err;
void *bufp;
u_int32_t n;
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index 07566b0c598..b3bf1440a09 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb.c,v 1.85 2013/04/08 10:34:20 mglocker Exp $ */
+/* $OpenBSD: usb.c,v 1.86 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */
/*
@@ -89,7 +89,7 @@ int usb_noexplore = 0;
struct usb_softc {
struct device sc_dev; /* base device */
- usbd_bus_handle sc_bus; /* USB controller */
+ struct usbd_bus *sc_bus; /* USB controller */
struct usbd_port sc_port; /* dummy port for root hub */
struct usb_task sc_explore_task;
@@ -141,7 +141,7 @@ void
usb_attach(struct device *parent, struct device *self, void *aux)
{
struct usb_softc *sc = (struct usb_softc *)self;
- usbd_device_handle dev;
+ struct usbd_device *dev;
usbd_status err;
int usbrev;
int speed;
@@ -269,7 +269,7 @@ usb_create_task_threads(void *arg)
* context ASAP.
*/
void
-usb_add_task(usbd_device_handle dev, struct usb_task *task)
+usb_add_task(struct usbd_device *dev, struct usb_task *task)
{
int s;
@@ -304,7 +304,7 @@ usb_add_task(usbd_device_handle dev, struct usb_task *task)
}
void
-usb_rem_task(usbd_device_handle dev, struct usb_task *task)
+usb_rem_task(struct usbd_device *dev, struct usb_task *task)
{
int s;
@@ -335,7 +335,7 @@ usb_rem_task(usbd_device_handle dev, struct usb_task *task)
}
void
-usb_wait_task(usbd_device_handle dev, struct usb_task *task)
+usb_wait_task(struct usbd_device *dev, struct usb_task *task)
{
int s;
@@ -354,7 +354,7 @@ usb_wait_task(usbd_device_handle dev, struct usb_task *task)
}
void
-usb_rem_wait_task(usbd_device_handle dev, struct usb_task *task)
+usb_rem_wait_task(struct usbd_device *dev, struct usb_task *task)
{
usb_rem_task(dev, task);
usb_wait_task(dev, task);
@@ -484,7 +484,7 @@ usbd_fill_di_task(void *arg)
{
struct usb_device_info *di = (struct usb_device_info *)arg;
struct usb_softc *sc;
- usbd_device_handle dev;
+ struct usbd_device *dev;
/* check that the bus and device are still present */
if (di->udi_bus >= usb_cd.cd_ndevs)
@@ -504,7 +504,7 @@ usbd_fill_udc_task(void *arg)
{
struct usb_device_cdesc *udc = (struct usb_device_cdesc *)arg;
struct usb_softc *sc;
- usbd_device_handle dev;
+ struct usbd_device *dev;
int addr = udc->udc_addr;
usb_config_descriptor_t *cdesc;
@@ -531,7 +531,7 @@ usbd_fill_udf_task(void *arg)
{
struct usb_device_fdesc *udf = (struct usb_device_fdesc *)arg;
struct usb_softc *sc;
- usbd_device_handle dev;
+ struct usbd_device *dev;
int addr = udf->udf_addr;
usb_config_descriptor_t *cdesc;
@@ -648,7 +648,7 @@ usbioctl(dev_t devt, u_long cmd, caddr_t data, int flag, struct proc *p)
struct usb_device_info *di = (void *)data;
int addr = di->udi_addr;
struct usb_task di_task;
- usbd_device_handle dev;
+ struct usbd_device *dev;
if (addr < 1 || addr >= USB_MAX_DEVICES)
return (EINVAL);
@@ -813,7 +813,7 @@ usb_explore(void *v)
}
void
-usb_needs_explore(usbd_device_handle dev, int first_explore)
+usb_needs_explore(struct usbd_device *dev, int first_explore)
{
struct usb_softc *usbctl = (struct usb_softc *)dev->bus->usbctl;
@@ -829,7 +829,7 @@ usb_needs_explore(usbd_device_handle dev, int first_explore)
}
void
-usb_needs_reattach(usbd_device_handle dev)
+usb_needs_reattach(struct usbd_device *dev)
{
DPRINTFN(2,("usb_needs_reattach\n"));
dev->powersrc->reattach = 1;
@@ -837,7 +837,7 @@ usb_needs_reattach(usbd_device_handle dev)
}
void
-usb_schedsoftintr(usbd_bus_handle bus)
+usb_schedsoftintr(struct usbd_bus *bus)
{
DPRINTFN(10,("usb_schedsoftintr: polling=%d\n", bus->use_polling));
@@ -852,7 +852,7 @@ int
usb_activate(struct device *self, int act)
{
struct usb_softc *sc = (struct usb_softc *)self;
- usbd_device_handle dev = sc->sc_port.device;
+ struct usbd_device *dev = sc->sc_port.device;
int i, rv = 0, r;
switch (act) {
diff --git a/sys/dev/usb/usb_mem.c b/sys/dev/usb/usb_mem.c
index d4725ae8835..7eca6e7ba67 100644
--- a/sys/dev/usb/usb_mem.c
+++ b/sys/dev/usb/usb_mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_mem.c,v 1.24 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: usb_mem.c,v 1.25 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: usb_mem.c,v 1.26 2003/02/01 06:23:40 thorpej Exp $ */
/*
@@ -49,7 +49,7 @@
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdivar.h> /* just for usb_dma_t */
+#include <dev/usb/usbdivar.h> /* just for struct usb_dma */
#include <dev/usb/usb_mem.h>
#ifdef USB_DEBUG
@@ -67,14 +67,14 @@ extern int usbdebug;
/* This struct is overlayed on free fragments. */
struct usb_frag_dma {
- usb_dma_block_t *block;
+ struct usb_dma_block *block;
u_int offs;
LIST_ENTRY(usb_frag_dma) next;
};
usbd_status usb_block_allocmem(bus_dma_tag_t, size_t, size_t,
- usb_dma_block_t **);
-void usb_block_freemem(usb_dma_block_t *);
+ struct usb_dma_block **);
+void usb_block_freemem(struct usb_dma_block *);
LIST_HEAD(, usb_dma_block) usb_blk_freelist =
LIST_HEAD_INITIALIZER(usb_blk_freelist);
@@ -85,10 +85,10 @@ LIST_HEAD(, usb_frag_dma) usb_frag_freelist =
usbd_status
usb_block_allocmem(bus_dma_tag_t tag, size_t size, size_t align,
- usb_dma_block_t **dmap)
+ struct usb_dma_block **dmap)
{
int error;
- usb_dma_block_t *p;
+ struct usb_dma_block *p;
int s;
DPRINTFN(5, ("usb_block_allocmem: size=%lu align=%lu\n",
@@ -168,7 +168,7 @@ free0:
#if 0
void
-usb_block_real_freemem(usb_dma_block_t *p)
+usb_block_real_freemem(struct usb_dma_block *p)
{
#ifdef DIAGNOSTIC
if (!curproc) {
@@ -190,7 +190,7 @@ usb_block_real_freemem(usb_dma_block_t *p)
* XXX when should we really free?
*/
void
-usb_block_freemem(usb_dma_block_t *p)
+usb_block_freemem(struct usb_dma_block *p)
{
int s;
@@ -202,12 +202,12 @@ usb_block_freemem(usb_dma_block_t *p)
}
usbd_status
-usb_allocmem(usbd_bus_handle bus, size_t size, size_t align, usb_dma_t *p)
+usb_allocmem(struct usbd_bus *bus, size_t size, size_t align, struct usb_dma *p)
{
bus_dma_tag_t tag = bus->dmatag;
usbd_status err;
struct usb_frag_dma *f;
- usb_dma_block_t *b;
+ struct usb_dma_block *b;
int i;
int s;
@@ -253,7 +253,7 @@ usb_allocmem(usbd_bus_handle bus, size_t size, size_t align, usb_dma_t *p)
}
void
-usb_freemem(usbd_bus_handle bus, usb_dma_t *p)
+usb_freemem(struct usbd_bus *bus, struct usb_dma *p)
{
struct usb_frag_dma *f;
int s;
@@ -273,7 +273,7 @@ usb_freemem(usbd_bus_handle bus, usb_dma_t *p)
}
void
-usb_syncmem(usb_dma_t *p, bus_addr_t offset, bus_size_t len, int ops)
+usb_syncmem(struct usb_dma *p, bus_addr_t offset, bus_size_t len, int ops)
{
bus_dmamap_sync(p->block->tag, p->block->map, p->offs + offset,
len, ops);
diff --git a/sys/dev/usb/usb_mem.h b/sys/dev/usb/usb_mem.h
index 566e95b689c..f80fa4c7a70 100644
--- a/sys/dev/usb/usb_mem.h
+++ b/sys/dev/usb/usb_mem.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_mem.h,v 1.13 2010/09/29 20:06:38 kettenis Exp $ */
+/* $OpenBSD: usb_mem.h,v 1.14 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: usb_mem.h,v 1.20 2003/05/03 18:11:42 wiz Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_mem.h,v 1.9 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -32,7 +32,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-typedef struct usb_dma_block {
+struct usb_dma_block {
bus_dma_tag_t tag;
bus_dmamap_t map;
caddr_t kaddr;
@@ -42,12 +42,12 @@ typedef struct usb_dma_block {
size_t align;
int fullblock;
LIST_ENTRY(usb_dma_block) next;
-} usb_dma_block_t;
+};
#define DMAADDR(dma, o) ((dma)->block->map->dm_segs[0].ds_addr + (dma)->offs + (o))
#define KERNADDR(dma, o) \
((void *)((char *)((dma)->block->kaddr + (dma)->offs) + (o)))
-usbd_status usb_allocmem(usbd_bus_handle,size_t,size_t, usb_dma_t *);
-void usb_freemem(usbd_bus_handle, usb_dma_t *);
-void usb_syncmem(usb_dma_t *, bus_addr_t, bus_size_t, int);
+usbd_status usb_allocmem(struct usbd_bus *,size_t,size_t, struct usb_dma *);
+void usb_freemem(struct usbd_bus *, struct usb_dma *);
+void usb_syncmem(struct usb_dma *, bus_addr_t, bus_size_t, int);
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index b7cf9af5dde..4fe7b513230 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_subr.c,v 1.88 2013/04/10 07:48:36 mpi Exp $ */
+/* $OpenBSD: usb_subr.c,v 1.89 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -59,18 +59,18 @@ extern int usbdebug;
#define DPRINTFN(n,x)
#endif
-usbd_status usbd_set_config(usbd_device_handle, int);
-void usbd_devinfo(usbd_device_handle, int, char *, size_t);
-void usbd_devinfo_vp(usbd_device_handle, char *, size_t,
+usbd_status usbd_set_config(struct usbd_device *, int);
+void usbd_devinfo(struct usbd_device *, int, char *, size_t);
+void usbd_devinfo_vp(struct usbd_device *, char *, size_t,
char *, size_t, int);
-char *usbd_get_string(usbd_device_handle, int, char *, size_t);
-int usbd_getnewaddr(usbd_bus_handle);
+char *usbd_get_string(struct usbd_device *, int, char *, size_t);
+int usbd_getnewaddr(struct usbd_bus *);
int usbd_print(void *, const char *);
int usbd_submatch(struct device *, void *, void *);
-void usbd_free_iface_data(usbd_device_handle, int);
-void usbd_kill_pipe(usbd_pipe_handle);
+void usbd_free_iface_data(struct usbd_device *, int);
+void usbd_kill_pipe(struct usbd_pipe *);
usbd_status usbd_probe_and_attach(struct device *,
- usbd_device_handle, int, int);
+ struct usbd_device *, int, int);
#ifdef USBVERBOSE
#include <dev/usb/usbdevs_data.h>
@@ -113,7 +113,7 @@ usbd_errstr(usbd_status err)
}
usbd_status
-usbd_get_string_desc(usbd_device_handle dev, int sindex, int langid,
+usbd_get_string_desc(struct usbd_device *dev, int sindex, int langid,
usb_string_descriptor_t *sdesc, int *sizep)
{
usb_device_request_t req;
@@ -149,7 +149,7 @@ usbd_get_string_desc(usbd_device_handle dev, int sindex, int langid,
}
char *
-usbd_get_string(usbd_device_handle dev, int si, char *buf, size_t buflen)
+usbd_get_string(struct usbd_device *dev, int si, char *buf, size_t buflen)
{
int swap = dev->quirks->uq_flags & UQ_SWAP_UNICODE;
usb_string_descriptor_t us;
@@ -211,7 +211,7 @@ usbd_trim_spaces(char *p)
}
void
-usbd_devinfo_vp(usbd_device_handle dev, char *v, size_t vl,
+usbd_devinfo_vp(struct usbd_device *dev, char *v, size_t vl,
char *p, size_t pl, int usedev)
{
usb_device_descriptor_t *udd = &dev->ddesc;
@@ -285,7 +285,7 @@ usbd_printBCD(char *cp, size_t len, int bcd)
}
void
-usbd_devinfo(usbd_device_handle dev, int showclass, char *base, size_t len)
+usbd_devinfo(struct usbd_device *dev, int showclass, char *base, size_t len)
{
usb_device_descriptor_t *udd = &dev->ddesc;
char vendor[USB_MAX_STRING_LEN];
@@ -316,7 +316,7 @@ usbd_devinfo(usbd_device_handle dev, int showclass, char *base, size_t len)
/* Delay for a certain number of ms */
void
-usb_delay_ms(usbd_bus_handle bus, u_int ms)
+usb_delay_ms(struct usbd_bus *bus, u_int ms)
{
static int usb_delay_wchan;
@@ -330,7 +330,7 @@ usb_delay_ms(usbd_bus_handle bus, u_int ms)
/* Delay given a device handle. */
void
-usbd_delay_ms(usbd_device_handle dev, u_int ms)
+usbd_delay_ms(struct usbd_device *dev, u_int ms)
{
if (usbd_is_dying(dev))
return;
@@ -339,7 +339,8 @@ usbd_delay_ms(usbd_device_handle dev, u_int ms)
}
usbd_status
-usbd_port_disown_to_1_1(usbd_device_handle dev, int port, usb_port_status_t *ps)
+usbd_port_disown_to_1_1(struct usbd_device *dev, int port,
+ usb_port_status_t *ps)
{
usb_device_request_t req;
usbd_status err;
@@ -375,7 +376,7 @@ usbd_port_disown_to_1_1(usbd_device_handle dev, int port, usb_port_status_t *ps)
}
usbd_status
-usbd_reset_port(usbd_device_handle dev, int port, usb_port_status_t *ps)
+usbd_reset_port(struct usbd_device *dev, int port, usb_port_status_t *ps)
{
usb_device_request_t req;
usbd_status err;
@@ -484,9 +485,9 @@ usbd_find_edesc(usb_config_descriptor_t *cd, int ifaceidx, int altidx,
}
usbd_status
-usbd_fill_iface_data(usbd_device_handle dev, int ifaceidx, int altidx)
+usbd_fill_iface_data(struct usbd_device *dev, int ifaceidx, int altidx)
{
- usbd_interface_handle ifc = &dev->ifaces[ifaceidx];
+ struct usbd_interface *ifc = &dev->ifaces[ifaceidx];
usb_interface_descriptor_t *idesc;
char *p, *end;
int endpt, nendpt;
@@ -574,15 +575,15 @@ usbd_fill_iface_data(usbd_device_handle dev, int ifaceidx, int altidx)
}
void
-usbd_free_iface_data(usbd_device_handle dev, int ifcno)
+usbd_free_iface_data(struct usbd_device *dev, int ifcno)
{
- usbd_interface_handle ifc = &dev->ifaces[ifcno];
+ struct usbd_interface *ifc = &dev->ifaces[ifcno];
if (ifc->endpoints)
free(ifc->endpoints, M_USB);
}
usbd_status
-usbd_set_config(usbd_device_handle dev, int conf)
+usbd_set_config(struct usbd_device *dev, int conf)
{
usb_device_request_t req;
@@ -595,7 +596,7 @@ usbd_set_config(usbd_device_handle dev, int conf)
}
usbd_status
-usbd_set_config_no(usbd_device_handle dev, int no, int msg)
+usbd_set_config_no(struct usbd_device *dev, int no, int msg)
{
int index;
usb_config_descriptor_t cd;
@@ -617,7 +618,7 @@ usbd_set_config_no(usbd_device_handle dev, int no, int msg)
}
usbd_status
-usbd_set_config_index(usbd_device_handle dev, int index, int msg)
+usbd_set_config_index(struct usbd_device *dev, int index, int msg)
{
usb_status_t ds;
usb_config_descriptor_t cd, *cdp;
@@ -785,10 +786,10 @@ usbd_set_config_index(usbd_device_handle dev, int index, int msg)
/* XXX add function for alternate settings */
usbd_status
-usbd_setup_pipe(usbd_device_handle dev, usbd_interface_handle iface,
- struct usbd_endpoint *ep, int ival, usbd_pipe_handle *pipe)
+usbd_setup_pipe(struct usbd_device *dev, struct usbd_interface *iface,
+ struct usbd_endpoint *ep, int ival, struct usbd_pipe **pipe)
{
- usbd_pipe_handle p;
+ struct usbd_pipe *p;
usbd_status err;
DPRINTFN(1,("usbd_setup_pipe: dev=%p iface=%p ep=%p pipe=%p\n",
@@ -821,7 +822,7 @@ usbd_setup_pipe(usbd_device_handle dev, usbd_interface_handle iface,
/* Abort the device control pipe. */
void
-usbd_kill_pipe(usbd_pipe_handle pipe)
+usbd_kill_pipe(struct usbd_pipe *pipe)
{
usbd_abort_pipe(pipe);
pipe->methods->close(pipe);
@@ -830,7 +831,7 @@ usbd_kill_pipe(usbd_pipe_handle pipe)
}
int
-usbd_getnewaddr(usbd_bus_handle bus)
+usbd_getnewaddr(struct usbd_bus *bus)
{
int addr;
@@ -841,7 +842,7 @@ usbd_getnewaddr(usbd_bus_handle bus)
}
usbd_status
-usbd_probe_and_attach(struct device *parent, usbd_device_handle dev, int port,
+usbd_probe_and_attach(struct device *parent, struct usbd_device *dev, int port,
int addr)
{
struct usb_attach_arg uaa;
@@ -849,7 +850,7 @@ usbd_probe_and_attach(struct device *parent, usbd_device_handle dev, int port,
int i, confi, nifaces, len;
usbd_status err;
struct device *dv;
- usbd_interface_handle *ifaces;
+ struct usbd_interface **ifaces;
extern struct rwlock usbpalock;
rw_enter_write(&usbpalock);
@@ -904,7 +905,7 @@ usbd_probe_and_attach(struct device *parent, usbd_device_handle dev, int port,
}
nifaces = dev->cdesc->bNumInterface;
uaa.configno = dev->cdesc->bConfigurationValue;
- ifaces = malloc(nifaces * sizeof(usbd_interface_handle),
+ ifaces = malloc(nifaces * sizeof(struct usbd_interface),
M_USB, M_NOWAIT);
if (ifaces == NULL) {
err = USBD_NOMEM;
@@ -1001,10 +1002,10 @@ fail:
* and attach a driver.
*/
usbd_status
-usbd_new_device(struct device *parent, usbd_bus_handle bus, int depth,
+usbd_new_device(struct device *parent, struct usbd_bus *bus, int depth,
int speed, int port, struct usbd_port *up)
{
- usbd_device_handle dev, adev;
+ struct usbd_device *dev, *adev;
struct usbd_device *hub;
usb_device_descriptor_t *dd;
usb_port_status_t ps;
@@ -1224,7 +1225,7 @@ usbd_new_device(struct device *parent, usbd_bus_handle bus, int depth,
}
usbd_status
-usbd_reload_device_desc(usbd_device_handle dev)
+usbd_reload_device_desc(struct usbd_device *dev)
{
usbd_status err;
@@ -1322,7 +1323,7 @@ usbd_submatch(struct device *parent, void *match, void *aux)
}
void
-usbd_fill_deviceinfo(usbd_device_handle dev, struct usb_device_info *di,
+usbd_fill_deviceinfo(struct usbd_device *dev, struct usb_device_info *di,
int usedev)
{
struct usbd_port *p;
@@ -1387,7 +1388,7 @@ usbd_fill_deviceinfo(usbd_device_handle dev, struct usb_device_info *di,
/* Retrieve a complete descriptor for a certain device and index. */
usb_config_descriptor_t *
-usbd_get_cdesc(usbd_device_handle dev, int index, int *lenp)
+usbd_get_cdesc(struct usbd_device *dev, int index, int *lenp)
{
usb_config_descriptor_t *cdesc, *tdesc, cdescr;
int len;
@@ -1420,7 +1421,7 @@ usbd_get_cdesc(usbd_device_handle dev, int index, int *lenp)
}
void
-usb_free_device(usbd_device_handle dev, struct usbd_port *up)
+usb_free_device(struct usbd_device *dev, struct usbd_port *up)
{
int ifcidx, nifc;
@@ -1464,7 +1465,7 @@ usb_free_device(usbd_device_handle dev, struct usbd_port *up)
void
usb_disconnect_port(struct usbd_port *up, struct device *parent)
{
- usbd_device_handle dev = up->device;
+ struct usbd_device *dev = up->device;
int i;
DPRINTFN(3,("uhub_disconnect: up=%p dev=%p port=%d\n",
diff --git a/sys/dev/usb/usbcdc.h b/sys/dev/usb/usbcdc.h
index f08f6138c80..c70ecfcc162 100644
--- a/sys/dev/usb/usbcdc.h
+++ b/sys/dev/usb/usbcdc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbcdc.h,v 1.8 2008/06/26 05:42:19 ray Exp $ */
+/* $OpenBSD: usbcdc.h,v 1.9 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: usbcdc.h,v 1.8 2001/02/16 20:15:57 kenh Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbcdc.h,v 1.7 1999/11/17 22:33:48 n_hibma Exp $ */
@@ -53,14 +53,14 @@
#define UDESCSUB_CDC_ENF 15 /* Ethernet Networking */
#define UDESCSUB_CDC_ANF 16 /* ATM Networking */
-typedef struct {
+struct usb_cdc_header_descriptor {
uByte bLength;
uByte bDescriptorType;
uByte bDescriptorSubtype;
uWord bcdCDC;
-} __packed usb_cdc_header_descriptor_t;
+} __packed;
-typedef struct {
+struct usb_cdc_cm_descriptor {
uByte bLength;
uByte bDescriptorType;
uByte bDescriptorSubtype;
@@ -68,9 +68,9 @@ typedef struct {
#define USB_CDC_CM_DOES_CM 0x01
#define USB_CDC_CM_OVER_DATA 0x02
uByte bDataInterface;
-} __packed usb_cdc_cm_descriptor_t;
+} __packed;
-typedef struct {
+struct usb_cdc_acm_descriptor {
uByte bLength;
uByte bDescriptorType;
uByte bDescriptorSubtype;
@@ -79,17 +79,17 @@ typedef struct {
#define USB_CDC_ACM_HAS_LINE 0x02
#define USB_CDC_ACM_HAS_BREAK 0x04
#define USB_CDC_ACM_HAS_NETWORK_CONN 0x08
-} __packed usb_cdc_acm_descriptor_t;
+} __packed;
-typedef struct {
+struct usb_cdc_union_descriptor {
uByte bLength;
uByte bDescriptorType;
uByte bDescriptorSubtype;
uByte bMasterInterface;
uByte bSlaveInterface[1];
-} __packed usb_cdc_union_descriptor_t;
+} __packed;
-typedef struct {
+struct usb_cdc_ethernet_descriptor {
uByte bLength;
uByte bDescriptorType;
uByte bDescriptorSubtype;
@@ -98,7 +98,7 @@ typedef struct {
uWord wMaxSegmentSize;
uWord wNumberMCFilters;
uByte bNumberPowerFilters;
-} __packed usb_cdc_ethernet_descriptor_t;
+} __packed;
#define UCDC_SEND_ENCAPSULATED_COMMAND 0x00
#define UCDC_GET_ENCAPSULATED_RESPONSE 0x01
@@ -116,14 +116,14 @@ typedef struct {
#define UCDC_BREAK_ON 0xffff
#define UCDC_BREAK_OFF 0x0000
-typedef struct {
+struct usb_cdc_abstract_state {
uWord wState;
#define UCDC_IDLE_SETTING 0x0001
#define UCDC_DATA_MULTIPLEXED 0x0002
-} __packed usb_cdc_abstract_state_t;
+} __packed;
#define UCDC_ABSTRACT_STATE_LENGTH 2
-typedef struct {
+struct usb_cdc_line_state {
uDWord dwDTERate;
uByte bCharFormat;
#define UCDC_STOP_BIT_1 0
@@ -136,10 +136,10 @@ typedef struct {
#define UCDC_PARITY_MARK 3
#define UCDC_PARITY_SPACE 4
uByte bDataBits;
-} __packed usb_cdc_line_state_t;
+} __packed;
#define UCDC_LINE_STATE_LENGTH 7
-typedef struct {
+struct usb_cdc_notification {
uByte bmRequestType;
#define UCDC_NOTIFICATION 0xa1
uByte bNotification;
@@ -155,13 +155,13 @@ typedef struct {
uWord wIndex;
uWord wLength;
uByte data[16];
-} __packed usb_cdc_notification_t;
+} __packed;
#define UCDC_NOTIFICATION_LENGTH 8
-typedef struct {
+struct usb_cdc_connection_speed {
uDWord dwUSBitRate;
uDWord dwDSBitRate;
-} __packed usb_cdc_connection_speed_t;
+} __packed;
#define UCDC_CONNECTION_SPEED_LENGTH 8
/*
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index fbee534fd8c..45f9442199f 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdi.c,v 1.49 2013/04/12 13:05:56 mpi Exp $ */
+/* $OpenBSD: usbdi.c,v 1.50 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: usbdi.c,v 1.103 2002/09/27 15:37:38 provos Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */
@@ -56,11 +56,11 @@ extern int usbdebug;
#define DPRINTFN(n,x)
#endif
-void usbd_do_request_async_cb(usbd_xfer_handle, usbd_private_handle,
+void usbd_do_request_async_cb(struct usbd_xfer *, void *,
usbd_status);
-void usbd_start_next(usbd_pipe_handle pipe);
-usbd_status usbd_open_pipe_ival(usbd_interface_handle, u_int8_t, u_int8_t,
- usbd_pipe_handle *, int);
+void usbd_start_next(struct usbd_pipe *pipe);
+usbd_status usbd_open_pipe_ival(struct usbd_interface *, u_int8_t, u_int8_t,
+ struct usbd_pipe **, int);
int usbd_nbuses = 0;
@@ -84,57 +84,57 @@ usbd_finish(void)
}
int
-usbd_is_dying(usbd_device_handle dev)
+usbd_is_dying(struct usbd_device *dev)
{
return (dev->dying || dev->bus->dying);
}
void
-usbd_deactivate(usbd_device_handle dev)
+usbd_deactivate(struct usbd_device *dev)
{
dev->dying = 1;
}
void
-usbd_ref_incr(usbd_device_handle dev)
+usbd_ref_incr(struct usbd_device *dev)
{
dev->ref_cnt++;
}
void
-usbd_ref_decr(usbd_device_handle dev)
+usbd_ref_decr(struct usbd_device *dev)
{
if (--dev->ref_cnt == 0 && dev->dying)
wakeup(&dev->ref_cnt);
}
void
-usbd_ref_wait(usbd_device_handle dev)
+usbd_ref_wait(struct usbd_device *dev)
{
while (dev->ref_cnt > 0)
tsleep(&dev->ref_cnt, PWAIT, "usbref", hz * 60);
}
int
-usbd_get_devcnt(usbd_device_handle dev)
+usbd_get_devcnt(struct usbd_device *dev)
{
return (dev->ndevs);
}
void
-usbd_claim_iface(usbd_device_handle dev, int ifaceidx)
+usbd_claim_iface(struct usbd_device *dev, int ifaceidx)
{
dev->ifaces[ifaceidx].claimed = 1;
}
int
-usbd_iface_claimed(usbd_device_handle dev, int ifaceidx)
+usbd_iface_claimed(struct usbd_device *dev, int ifaceidx)
{
return (dev->ifaces[ifaceidx].claimed);
}
static __inline int
-usbd_xfer_isread(usbd_xfer_handle xfer)
+usbd_xfer_isread(struct usbd_xfer *xfer)
{
if (xfer->rqflags & URQ_REQUEST)
return (xfer->request.bmRequestType & UT_READ);
@@ -180,9 +180,9 @@ usbd_dump_endpoint(struct usbd_endpoint *endp)
}
void
-usbd_dump_queue(usbd_pipe_handle pipe)
+usbd_dump_queue(struct usbd_pipe *pipe)
{
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
printf("usbd_dump_queue: pipe=%p\n", pipe);
SIMPLEQ_FOREACH(xfer, &pipe->queue, next) {
@@ -191,7 +191,7 @@ usbd_dump_queue(usbd_pipe_handle pipe)
}
void
-usbd_dump_pipe(usbd_pipe_handle pipe)
+usbd_dump_pipe(struct usbd_pipe *pipe)
{
printf("usbd_dump_pipe: pipe=%p\n", pipe);
if (pipe == NULL)
@@ -207,18 +207,18 @@ usbd_dump_pipe(usbd_pipe_handle pipe)
#endif
usbd_status
-usbd_open_pipe(usbd_interface_handle iface, u_int8_t address, u_int8_t flags,
- usbd_pipe_handle *pipe)
+usbd_open_pipe(struct usbd_interface *iface, u_int8_t address, u_int8_t flags,
+ struct usbd_pipe **pipe)
{
return (usbd_open_pipe_ival(iface, address, flags, pipe,
USBD_DEFAULT_INTERVAL));
}
usbd_status
-usbd_open_pipe_ival(usbd_interface_handle iface, u_int8_t address,
- u_int8_t flags, usbd_pipe_handle *pipe, int ival)
+usbd_open_pipe_ival(struct usbd_interface *iface, u_int8_t address,
+ u_int8_t flags, struct usbd_pipe **pipe, int ival)
{
- usbd_pipe_handle p;
+ struct usbd_pipe *p;
struct usbd_endpoint *ep;
usbd_status err;
int i;
@@ -246,13 +246,13 @@ usbd_open_pipe_ival(usbd_interface_handle iface, u_int8_t address,
}
usbd_status
-usbd_open_pipe_intr(usbd_interface_handle iface, u_int8_t address,
- u_int8_t flags, usbd_pipe_handle *pipe, usbd_private_handle priv,
+usbd_open_pipe_intr(struct usbd_interface *iface, u_int8_t address,
+ u_int8_t flags, struct usbd_pipe **pipe, void *priv,
void *buffer, u_int32_t len, usbd_callback cb, int ival)
{
usbd_status err;
- usbd_xfer_handle xfer;
- usbd_pipe_handle ipipe;
+ struct usbd_xfer *xfer;
+ struct usbd_pipe *ipipe;
DPRINTFN(3,("usbd_open_pipe_intr: address=0x%x flags=0x%x len=%d\n",
address, flags, len));
@@ -286,7 +286,7 @@ usbd_open_pipe_intr(usbd_interface_handle iface, u_int8_t address,
}
usbd_status
-usbd_close_pipe(usbd_pipe_handle pipe)
+usbd_close_pipe(struct usbd_pipe *pipe)
{
#ifdef DIAGNOSTIC
if (pipe == NULL) {
@@ -309,10 +309,10 @@ usbd_close_pipe(usbd_pipe_handle pipe)
}
usbd_status
-usbd_transfer(usbd_xfer_handle xfer)
+usbd_transfer(struct usbd_xfer *xfer)
{
- usbd_pipe_handle pipe = xfer->pipe;
- usb_dma_t *dmap = &xfer->dmabuf;
+ struct usbd_pipe *pipe = xfer->pipe;
+ struct usb_dma *dmap = &xfer->dmabuf;
usbd_status err;
u_int size;
int s;
@@ -380,7 +380,7 @@ usbd_transfer(usbd_xfer_handle xfer)
}
void *
-usbd_alloc_buffer(usbd_xfer_handle xfer, u_int32_t size)
+usbd_alloc_buffer(struct usbd_xfer *xfer, u_int32_t size)
{
struct usbd_bus *bus = xfer->device->bus;
usbd_status err;
@@ -397,7 +397,7 @@ usbd_alloc_buffer(usbd_xfer_handle xfer, u_int32_t size)
}
void
-usbd_free_buffer(usbd_xfer_handle xfer)
+usbd_free_buffer(struct usbd_xfer *xfer)
{
#ifdef DIAGNOSTIC
if (!(xfer->rqflags & (URQ_DEV_DMABUF | URQ_AUTO_DMABUF))) {
@@ -410,17 +410,17 @@ usbd_free_buffer(usbd_xfer_handle xfer)
}
void *
-usbd_get_buffer(usbd_xfer_handle xfer)
+usbd_get_buffer(struct usbd_xfer *xfer)
{
if (!(xfer->rqflags & URQ_DEV_DMABUF))
return (0);
return (KERNADDR(&xfer->dmabuf, 0));
}
-usbd_xfer_handle
-usbd_alloc_xfer(usbd_device_handle dev)
+struct usbd_xfer *
+usbd_alloc_xfer(struct usbd_device *dev)
{
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
xfer = dev->bus->methods->allocx(dev->bus);
if (xfer == NULL)
@@ -432,7 +432,7 @@ usbd_alloc_xfer(usbd_device_handle dev)
}
usbd_status
-usbd_free_xfer(usbd_xfer_handle xfer)
+usbd_free_xfer(struct usbd_xfer *xfer)
{
DPRINTFN(5,("usbd_free_xfer: %p\n", xfer));
if (xfer->rqflags & (URQ_DEV_DMABUF | URQ_AUTO_DMABUF))
@@ -442,8 +442,8 @@ usbd_free_xfer(usbd_xfer_handle xfer)
}
void
-usbd_setup_xfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe,
- usbd_private_handle priv, void *buffer, u_int32_t length, u_int16_t flags,
+usbd_setup_xfer(struct usbd_xfer *xfer, struct usbd_pipe *pipe,
+ void *priv, void *buffer, u_int32_t length, u_int16_t flags,
u_int32_t timeout, usbd_callback callback)
{
xfer->pipe = pipe;
@@ -460,8 +460,8 @@ usbd_setup_xfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe,
}
void
-usbd_setup_default_xfer(usbd_xfer_handle xfer, usbd_device_handle dev,
- usbd_private_handle priv, u_int32_t timeout, usb_device_request_t *req,
+usbd_setup_default_xfer(struct usbd_xfer *xfer, struct usbd_device *dev,
+ void *priv, u_int32_t timeout, usb_device_request_t *req,
void *buffer, u_int32_t length, u_int16_t flags, usbd_callback callback)
{
xfer->pipe = dev->default_pipe;
@@ -479,8 +479,8 @@ usbd_setup_default_xfer(usbd_xfer_handle xfer, usbd_device_handle dev,
}
void
-usbd_setup_isoc_xfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe,
- usbd_private_handle priv, u_int16_t *frlengths, u_int32_t nframes,
+usbd_setup_isoc_xfer(struct usbd_xfer *xfer, struct usbd_pipe *pipe,
+ void *priv, u_int16_t *frlengths, u_int32_t nframes,
u_int16_t flags, usbd_callback callback)
{
xfer->pipe = pipe;
@@ -498,7 +498,7 @@ usbd_setup_isoc_xfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe,
}
void
-usbd_get_xfer_status(usbd_xfer_handle xfer, usbd_private_handle *priv,
+usbd_get_xfer_status(struct usbd_xfer *xfer, void **priv,
void **buffer, u_int32_t *count, usbd_status *status)
{
if (priv != NULL)
@@ -512,7 +512,7 @@ usbd_get_xfer_status(usbd_xfer_handle xfer, usbd_private_handle *priv,
}
usb_config_descriptor_t *
-usbd_get_config_descriptor(usbd_device_handle dev)
+usbd_get_config_descriptor(struct usbd_device *dev)
{
#ifdef DIAGNOSTIC
if (dev == NULL) {
@@ -524,7 +524,7 @@ usbd_get_config_descriptor(usbd_device_handle dev)
}
usb_interface_descriptor_t *
-usbd_get_interface_descriptor(usbd_interface_handle iface)
+usbd_get_interface_descriptor(struct usbd_interface *iface)
{
#ifdef DIAGNOSTIC
if (iface == NULL) {
@@ -536,13 +536,13 @@ usbd_get_interface_descriptor(usbd_interface_handle iface)
}
usb_device_descriptor_t *
-usbd_get_device_descriptor(usbd_device_handle dev)
+usbd_get_device_descriptor(struct usbd_device *dev)
{
return (&dev->ddesc);
}
usb_endpoint_descriptor_t *
-usbd_interface2endpoint_descriptor(usbd_interface_handle iface, u_int8_t index)
+usbd_interface2endpoint_descriptor(struct usbd_interface *iface, u_int8_t index)
{
if (index >= iface->idesc->bNumEndpoints)
return (0);
@@ -550,9 +550,9 @@ usbd_interface2endpoint_descriptor(usbd_interface_handle iface, u_int8_t index)
}
usbd_status
-usbd_abort_pipe(usbd_pipe_handle pipe)
+usbd_abort_pipe(struct usbd_pipe *pipe)
{
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
int s;
#ifdef DIAGNOSTIC
@@ -583,9 +583,9 @@ usbd_abort_pipe(usbd_pipe_handle pipe)
}
usbd_status
-usbd_clear_endpoint_stall(usbd_pipe_handle pipe)
+usbd_clear_endpoint_stall(struct usbd_pipe *pipe)
{
- usbd_device_handle dev = pipe->device;
+ struct usbd_device *dev = pipe->device;
usb_device_request_t req;
usbd_status err;
@@ -614,9 +614,9 @@ XXX should we do this?
}
usbd_status
-usbd_clear_endpoint_stall_async(usbd_pipe_handle pipe)
+usbd_clear_endpoint_stall_async(struct usbd_pipe *pipe)
{
- usbd_device_handle dev = pipe->device;
+ struct usbd_device *dev = pipe->device;
usb_device_request_t req;
usbd_status err;
@@ -632,13 +632,13 @@ usbd_clear_endpoint_stall_async(usbd_pipe_handle pipe)
}
void
-usbd_clear_endpoint_toggle(usbd_pipe_handle pipe)
+usbd_clear_endpoint_toggle(struct usbd_pipe *pipe)
{
pipe->methods->cleartoggle(pipe);
}
usbd_status
-usbd_endpoint_count(usbd_interface_handle iface, u_int8_t *count)
+usbd_endpoint_count(struct usbd_interface *iface, u_int8_t *count)
{
#ifdef DIAGNOSTIC
if (iface == NULL || iface->idesc == NULL) {
@@ -651,7 +651,7 @@ usbd_endpoint_count(usbd_interface_handle iface, u_int8_t *count)
}
usbd_status
-usbd_interface_count(usbd_device_handle dev, u_int8_t *count)
+usbd_interface_count(struct usbd_device *dev, u_int8_t *count)
{
if (dev->cdesc == NULL)
return (USBD_NOT_CONFIGURED);
@@ -660,15 +660,15 @@ usbd_interface_count(usbd_device_handle dev, u_int8_t *count)
}
void
-usbd_interface2device_handle(usbd_interface_handle iface,
- usbd_device_handle *dev)
+usbd_interface2device_handle(struct usbd_interface *iface,
+ struct usbd_device **dev)
{
*dev = iface->device;
}
usbd_status
-usbd_device2interface_handle(usbd_device_handle dev, u_int8_t ifaceno,
- usbd_interface_handle *iface)
+usbd_device2interface_handle(struct usbd_device *dev, u_int8_t ifaceno,
+ struct usbd_interface **iface)
{
if (dev->cdesc == NULL)
return (USBD_NOT_CONFIGURED);
@@ -678,15 +678,15 @@ usbd_device2interface_handle(usbd_device_handle dev, u_int8_t ifaceno,
return (USBD_NORMAL_COMPLETION);
}
-usbd_device_handle
-usbd_pipe2device_handle(usbd_pipe_handle pipe)
+struct usbd_device *
+usbd_pipe2device_handle(struct usbd_pipe *pipe)
{
return (pipe->device);
}
/* XXXX use altno */
usbd_status
-usbd_set_interface(usbd_interface_handle iface, int altidx)
+usbd_set_interface(struct usbd_interface *iface, int altidx)
{
usb_device_request_t req;
usbd_status err;
@@ -738,13 +738,13 @@ usbd_get_no_alts(usb_config_descriptor_t *cdesc, int ifaceno)
}
int
-usbd_get_interface_altindex(usbd_interface_handle iface)
+usbd_get_interface_altindex(struct usbd_interface *iface)
{
return (iface->altindex);
}
usbd_status
-usbd_get_interface(usbd_interface_handle iface, u_int8_t *aiface)
+usbd_get_interface(struct usbd_interface *iface, u_int8_t *aiface)
{
usb_device_request_t req;
@@ -760,10 +760,10 @@ usbd_get_interface(usbd_interface_handle iface, u_int8_t *aiface)
/* Called at splusb() */
void
-usb_transfer_complete(usbd_xfer_handle xfer)
+usb_transfer_complete(struct usbd_xfer *xfer)
{
- usbd_pipe_handle pipe = xfer->pipe;
- usb_dma_t *dmap = &xfer->dmabuf;
+ struct usbd_pipe *pipe = xfer->pipe;
+ struct usb_dma *dmap = &xfer->dmabuf;
int repeat = pipe->repeat;
int polling;
@@ -861,9 +861,9 @@ usb_transfer_complete(usbd_xfer_handle xfer)
}
usbd_status
-usb_insert_transfer(usbd_xfer_handle xfer)
+usb_insert_transfer(struct usbd_xfer *xfer)
{
- usbd_pipe_handle pipe = xfer->pipe;
+ struct usbd_pipe *pipe = xfer->pipe;
usbd_status err;
int s;
@@ -891,9 +891,9 @@ usb_insert_transfer(usbd_xfer_handle xfer)
/* Called at splusb() */
void
-usbd_start_next(usbd_pipe_handle pipe)
+usbd_start_next(struct usbd_pipe *pipe)
{
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
usbd_status err;
SPLUSBCHECK;
@@ -925,17 +925,17 @@ usbd_start_next(usbd_pipe_handle pipe)
}
usbd_status
-usbd_do_request(usbd_device_handle dev, usb_device_request_t *req, void *data)
+usbd_do_request(struct usbd_device *dev, usb_device_request_t *req, void *data)
{
return (usbd_do_request_flags(dev, req, data, 0, 0,
USBD_DEFAULT_TIMEOUT));
}
usbd_status
-usbd_do_request_flags(usbd_device_handle dev, usb_device_request_t *req,
+usbd_do_request_flags(struct usbd_device *dev, usb_device_request_t *req,
void *data, uint16_t flags, int *actlen, uint32_t timeout)
{
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
usbd_status err;
#ifdef DIAGNOSTIC
@@ -1009,7 +1009,7 @@ usbd_do_request_flags(usbd_device_handle dev, usb_device_request_t *req,
}
void
-usbd_do_request_async_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
+usbd_do_request_async_cb(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
#if defined(USB_DEBUG) || defined(DIAGNOSTIC)
@@ -1029,10 +1029,10 @@ usbd_do_request_async_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
* Can be used from interrupt context.
*/
usbd_status
-usbd_do_request_async(usbd_device_handle dev, usb_device_request_t *req,
+usbd_do_request_async(struct usbd_device *dev, usb_device_request_t *req,
void *data)
{
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
usbd_status err;
xfer = usbd_alloc_xfer(dev);
@@ -1049,7 +1049,7 @@ usbd_do_request_async(usbd_device_handle dev, usb_device_request_t *req,
}
const struct usbd_quirks *
-usbd_get_quirks(usbd_device_handle dev)
+usbd_get_quirks(struct usbd_device *dev)
{
#ifdef DIAGNOSTIC
if (dev == NULL) {
@@ -1066,13 +1066,13 @@ usbd_get_quirks(usbd_device_handle dev)
* Called from keyboard driver when in polling mode.
*/
void
-usbd_dopoll(usbd_interface_handle iface)
+usbd_dopoll(struct usbd_interface *iface)
{
iface->device->bus->methods->do_poll(iface->device->bus);
}
void
-usbd_set_polling(usbd_device_handle dev, int on)
+usbd_set_polling(struct usbd_device *dev, int on)
{
if (on)
dev->bus->use_polling++;
@@ -1084,7 +1084,7 @@ usbd_set_polling(usbd_device_handle dev, int on)
}
usb_endpoint_descriptor_t *
-usbd_get_endpoint_descriptor(usbd_interface_handle iface, u_int8_t address)
+usbd_get_endpoint_descriptor(struct usbd_interface *iface, u_int8_t address)
{
struct usbd_endpoint *ep;
int i;
@@ -1130,7 +1130,7 @@ usb_match_device(const struct usb_devno *tbl, u_int nentries, u_int sz,
}
void
-usb_desc_iter_init(usbd_device_handle dev, usbd_desc_iter_t *iter)
+usb_desc_iter_init(struct usbd_device *dev, struct usbd_desc_iter *iter)
{
const usb_config_descriptor_t *cd = usbd_get_config_descriptor(dev);
@@ -1139,7 +1139,7 @@ usb_desc_iter_init(usbd_device_handle dev, usbd_desc_iter_t *iter)
}
const usb_descriptor_t *
-usb_desc_iter_next(usbd_desc_iter_t *iter)
+usb_desc_iter_next(struct usbd_desc_iter *iter)
{
const usb_descriptor_t *desc;
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
index 86648b6bca4..414c0e00d4c 100644
--- a/sys/dev/usb/usbdi.h
+++ b/sys/dev/usb/usbdi.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdi.h,v 1.47 2013/04/12 12:58:39 mpi Exp $ */
+/* $OpenBSD: usbdi.h,v 1.48 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: usbdi.h,v 1.62 2002/07/11 21:14:35 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi.h,v 1.18 1999/11/17 22:33:49 n_hibma Exp $ */
@@ -32,12 +32,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-typedef struct usbd_bus *usbd_bus_handle;
-typedef struct usbd_device *usbd_device_handle;
-typedef struct usbd_interface *usbd_interface_handle;
-typedef struct usbd_pipe *usbd_pipe_handle;
-typedef struct usbd_xfer *usbd_xfer_handle;
-typedef void *usbd_private_handle;
+struct usbd_bus;
+struct usbd_device;
+struct usbd_interface;
+struct usbd_pipe;
+struct usbd_xfer;
typedef enum { /* keep in sync with usbd_status_msgs */
USBD_NORMAL_COMPLETION = 0, /* must be 0 */
@@ -64,8 +63,7 @@ typedef enum { /* keep in sync with usbd_status_msgs */
USBD_ERROR_MAX /* must be last */
} usbd_status;
-typedef void (*usbd_callback)(usbd_xfer_handle, usbd_private_handle,
- usbd_status);
+typedef void (*usbd_callback)(struct usbd_xfer *, void *, usbd_status);
/* Open flags */
#define USBD_EXCLUSIVE_USE 0x01
@@ -84,99 +82,99 @@ typedef void (*usbd_callback)(usbd_xfer_handle, usbd_private_handle,
#define DEVINFOSIZE 1024
-usbd_status usbd_open_pipe(usbd_interface_handle iface, u_int8_t address,
- u_int8_t flags, usbd_pipe_handle *pipe);
-usbd_status usbd_close_pipe(usbd_pipe_handle pipe);
-usbd_status usbd_transfer(usbd_xfer_handle req);
-usbd_xfer_handle usbd_alloc_xfer(usbd_device_handle);
-usbd_status usbd_free_xfer(usbd_xfer_handle xfer);
-void usbd_setup_xfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe,
- usbd_private_handle priv, void *buffer, u_int32_t length, u_int16_t flags,
+usbd_status usbd_open_pipe(struct usbd_interface *iface, u_int8_t address,
+ u_int8_t flags, struct usbd_pipe **pipe);
+usbd_status usbd_close_pipe(struct usbd_pipe *pipe);
+usbd_status usbd_transfer(struct usbd_xfer *req);
+struct usbd_xfer *usbd_alloc_xfer(struct usbd_device *);
+usbd_status usbd_free_xfer(struct usbd_xfer *xfer);
+void usbd_setup_xfer(struct usbd_xfer *xfer, struct usbd_pipe *pipe,
+ void *priv, void *buffer, u_int32_t length, u_int16_t flags,
u_int32_t timeout, usbd_callback);
-void usbd_setup_default_xfer(usbd_xfer_handle xfer, usbd_device_handle dev,
- usbd_private_handle priv, u_int32_t timeout, usb_device_request_t *req,
+void usbd_setup_default_xfer(struct usbd_xfer *xfer, struct usbd_device *dev,
+ void *priv, u_int32_t timeout, usb_device_request_t *req,
void *buffer, u_int32_t length, u_int16_t flags, usbd_callback);
-void usbd_setup_isoc_xfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe,
- usbd_private_handle priv, u_int16_t *frlengths, u_int32_t nframes,
+void usbd_setup_isoc_xfer(struct usbd_xfer *xfer, struct usbd_pipe *pipe,
+ void *priv, u_int16_t *frlengths, u_int32_t nframes,
u_int16_t flags, usbd_callback);
-void usbd_get_xfer_status(usbd_xfer_handle xfer, usbd_private_handle *priv,
+void usbd_get_xfer_status(struct usbd_xfer *xfer, void **priv,
void **buffer, u_int32_t *count, usbd_status *status);
usb_endpoint_descriptor_t *usbd_interface2endpoint_descriptor(
- usbd_interface_handle iface, u_int8_t address);
-usbd_status usbd_abort_pipe(usbd_pipe_handle pipe);
-usbd_status usbd_clear_endpoint_stall(usbd_pipe_handle pipe);
-usbd_status usbd_clear_endpoint_stall_async(usbd_pipe_handle pipe);
-void usbd_clear_endpoint_toggle(usbd_pipe_handle pipe);
-usbd_status usbd_endpoint_count(usbd_interface_handle dev, u_int8_t *count);
-usbd_status usbd_interface_count(usbd_device_handle dev, u_int8_t *count);
-void usbd_interface2device_handle(usbd_interface_handle iface,
- usbd_device_handle *dev);
-usbd_status usbd_device2interface_handle(usbd_device_handle dev,
- u_int8_t ifaceno, usbd_interface_handle *iface);
+ struct usbd_interface *iface, u_int8_t address);
+usbd_status usbd_abort_pipe(struct usbd_pipe *pipe);
+usbd_status usbd_clear_endpoint_stall(struct usbd_pipe *pipe);
+usbd_status usbd_clear_endpoint_stall_async(struct usbd_pipe *pipe);
+void usbd_clear_endpoint_toggle(struct usbd_pipe *pipe);
+usbd_status usbd_endpoint_count(struct usbd_interface *dev, u_int8_t *count);
+usbd_status usbd_interface_count(struct usbd_device *dev, u_int8_t *count);
+void usbd_interface2device_handle(struct usbd_interface *iface,
+ struct usbd_device **dev);
+usbd_status usbd_device2interface_handle(struct usbd_device *dev,
+ u_int8_t ifaceno, struct usbd_interface **iface);
-usbd_device_handle usbd_pipe2device_handle(usbd_pipe_handle);
-void *usbd_alloc_buffer(usbd_xfer_handle xfer, u_int32_t size);
-void usbd_free_buffer(usbd_xfer_handle xfer);
-void *usbd_get_buffer(usbd_xfer_handle xfer);
-usbd_status usbd_open_pipe_intr(usbd_interface_handle iface, u_int8_t address,
- u_int8_t flags, usbd_pipe_handle *pipe, usbd_private_handle priv,
+struct usbd_device *usbd_pipe2device_handle(struct usbd_pipe *);
+void *usbd_alloc_buffer(struct usbd_xfer *xfer, u_int32_t size);
+void usbd_free_buffer(struct usbd_xfer *xfer);
+void *usbd_get_buffer(struct usbd_xfer *xfer);
+usbd_status usbd_open_pipe_intr(struct usbd_interface *iface, u_int8_t address,
+ u_int8_t flags, struct usbd_pipe **pipe, void *priv,
void *buffer, u_int32_t length, usbd_callback, int);
-usbd_status usbd_do_request(usbd_device_handle pipe, usb_device_request_t *req,
+usbd_status usbd_do_request(struct usbd_device *pipe, usb_device_request_t *req,
void *data);
-usbd_status usbd_do_request_async(usbd_device_handle pipe,
+usbd_status usbd_do_request_async(struct usbd_device *pipe,
usb_device_request_t *req, void *data);
-usbd_status usbd_do_request_flags(usbd_device_handle pipe,
+usbd_status usbd_do_request_flags(struct usbd_device *pipe,
usb_device_request_t *req, void *data, u_int16_t flags, int*, u_int32_t);
usb_interface_descriptor_t *usbd_get_interface_descriptor(
- usbd_interface_handle iface);
-usb_config_descriptor_t *usbd_get_config_descriptor(usbd_device_handle dev);
-usb_device_descriptor_t *usbd_get_device_descriptor(usbd_device_handle dev);
-usbd_status usbd_set_interface(usbd_interface_handle, int);
+ struct usbd_interface *iface);
+usb_config_descriptor_t *usbd_get_config_descriptor(struct usbd_device *dev);
+usb_device_descriptor_t *usbd_get_device_descriptor(struct usbd_device *dev);
+usbd_status usbd_set_interface(struct usbd_interface *, int);
int usbd_get_no_alts(usb_config_descriptor_t *, int);
-usbd_status usbd_get_interface(usbd_interface_handle iface, u_int8_t *aiface);
-void usbd_fill_deviceinfo(usbd_device_handle, struct usb_device_info *, int);
+usbd_status usbd_get_interface(struct usbd_interface *iface, u_int8_t *aiface);
+void usbd_fill_deviceinfo(struct usbd_device *, struct usb_device_info *, int);
void usbd_fill_di_task(void *);
void usbd_fill_udc_task(void *);
void usbd_fill_udf_task(void *);
-usb_config_descriptor_t *usbd_get_cdesc(usbd_device_handle, int, int *);
-int usbd_get_interface_altindex(usbd_interface_handle iface);
+usb_config_descriptor_t *usbd_get_cdesc(struct usbd_device *, int, int *);
+int usbd_get_interface_altindex(struct usbd_interface *iface);
usb_interface_descriptor_t *usbd_find_idesc(usb_config_descriptor_t *cd,
int iindex, int ano);
usb_endpoint_descriptor_t *usbd_find_edesc(usb_config_descriptor_t *cd,
int ifaceidx, int altidx, int endptidx);
-void usbd_dopoll(usbd_interface_handle);
-void usbd_set_polling(usbd_device_handle iface, int on);
+void usbd_dopoll(struct usbd_interface *);
+void usbd_set_polling(struct usbd_device *iface, int on);
const char *usbd_errstr(usbd_status err);
-const struct usbd_quirks *usbd_get_quirks(usbd_device_handle);
+const struct usbd_quirks *usbd_get_quirks(struct usbd_device *);
usb_endpoint_descriptor_t *usbd_get_endpoint_descriptor(
- usbd_interface_handle iface, u_int8_t address);
+ struct usbd_interface *iface, u_int8_t address);
-usbd_status usbd_reload_device_desc(usbd_device_handle);
+usbd_status usbd_reload_device_desc(struct usbd_device *);
int usbd_ratecheck(struct timeval *last);
-int usbd_get_devcnt(usbd_device_handle);
-void usbd_claim_iface(usbd_device_handle, int);
-int usbd_iface_claimed(usbd_device_handle, int);
+int usbd_get_devcnt(struct usbd_device *);
+void usbd_claim_iface(struct usbd_device *, int);
+int usbd_iface_claimed(struct usbd_device *, int);
-int usbd_is_dying(usbd_device_handle);
-void usbd_deactivate(usbd_device_handle);
+int usbd_is_dying(struct usbd_device *);
+void usbd_deactivate(struct usbd_device *);
-void usbd_ref_incr(usbd_device_handle);
-void usbd_ref_decr(usbd_device_handle);
-void usbd_ref_wait(usbd_device_handle);
+void usbd_ref_incr(struct usbd_device *);
+void usbd_ref_decr(struct usbd_device *);
+void usbd_ref_wait(struct usbd_device *);
/* An iterator for descriptors. */
-typedef struct {
+struct usbd_desc_iter {
const uByte *cur;
const uByte *end;
-} usbd_desc_iter_t;
-void usb_desc_iter_init(usbd_device_handle, usbd_desc_iter_t *);
-const usb_descriptor_t *usb_desc_iter_next(usbd_desc_iter_t *);
+};
+void usb_desc_iter_init(struct usbd_device *, struct usbd_desc_iter *);
+const usb_descriptor_t *usb_desc_iter_next(struct usbd_desc_iter *);
/*
* The usb_task structs form a queue of things to run in the USB task
@@ -186,7 +184,7 @@ const usb_descriptor_t *usb_desc_iter_next(usbd_desc_iter_t *);
*/
struct usb_task {
TAILQ_ENTRY(usb_task) next;
- usbd_device_handle dev;
+ struct usbd_device *dev;
void (*fun)(void *);
void *arg;
char type;
@@ -200,10 +198,10 @@ struct usb_task {
};
-void usb_add_task(usbd_device_handle, struct usb_task *);
-void usb_rem_task(usbd_device_handle, struct usb_task *);
-void usb_wait_task(usbd_device_handle, struct usb_task *);
-void usb_rem_wait_task(usbd_device_handle, struct usb_task *);
+void usb_add_task(struct usbd_device *, struct usb_task *);
+void usb_rem_task(struct usbd_device *, struct usb_task *);
+void usb_wait_task(struct usbd_device *, struct usb_task *);
+void usb_rem_wait_task(struct usbd_device *, struct usb_task *);
#define usb_init_task(t, f, a, y) \
((t)->fun = (f), \
(t)->arg = (a), \
@@ -231,10 +229,10 @@ struct usb_attach_arg {
int product;
int release;
int matchlvl;
- usbd_device_handle device; /* current device */
- usbd_interface_handle iface; /* current interface */
+ struct usbd_device *device; /* current device */
+ struct usbd_interface *iface; /* current interface */
int usegeneric;
- usbd_interface_handle *ifaces; /* all interfaces */
+ struct usbd_interface **ifaces;/* all interfaces */
int nifaces; /* number of interfaces */
};
diff --git a/sys/dev/usb/usbdi_util.c b/sys/dev/usb/usbdi_util.c
index 34c47690d4b..146b1be3138 100644
--- a/sys/dev/usb/usbdi_util.c
+++ b/sys/dev/usb/usbdi_util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdi_util.c,v 1.30 2013/04/10 07:48:36 mpi Exp $ */
+/* $OpenBSD: usbdi_util.c,v 1.31 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: usbdi_util.c,v 1.40 2002/07/11 21:14:36 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi_util.c,v 1.14 1999/11/17 22:33:50 n_hibma Exp $ */
@@ -54,7 +54,7 @@ extern int usbdebug;
#endif
usbd_status
-usbd_get_desc(usbd_device_handle dev, int type, int index, int len, void *desc)
+usbd_get_desc(struct usbd_device *dev, int type, int index, int len, void *desc)
{
usb_device_request_t req;
@@ -70,7 +70,7 @@ usbd_get_desc(usbd_device_handle dev, int type, int index, int len, void *desc)
}
usbd_status
-usbd_get_config_desc(usbd_device_handle dev, int confidx,
+usbd_get_config_desc(struct usbd_device *dev, int confidx,
usb_config_descriptor_t *d)
{
usbd_status err;
@@ -90,7 +90,7 @@ usbd_get_config_desc(usbd_device_handle dev, int confidx,
}
usbd_status
-usbd_get_device_status(usbd_device_handle dev, usb_status_t *st)
+usbd_get_device_status(struct usbd_device *dev, usb_status_t *st)
{
usb_device_request_t req;
@@ -103,7 +103,7 @@ usbd_get_device_status(usbd_device_handle dev, usb_status_t *st)
}
usbd_status
-usbd_get_hub_status(usbd_device_handle dev, usb_hub_status_t *st)
+usbd_get_hub_status(struct usbd_device *dev, usb_hub_status_t *st)
{
usb_device_request_t req;
@@ -116,7 +116,7 @@ usbd_get_hub_status(usbd_device_handle dev, usb_hub_status_t *st)
}
usbd_status
-usbd_set_address(usbd_device_handle dev, int addr)
+usbd_set_address(struct usbd_device *dev, int addr)
{
usb_device_request_t req;
@@ -129,7 +129,7 @@ usbd_set_address(usbd_device_handle dev, int addr)
}
usbd_status
-usbd_get_port_status(usbd_device_handle dev, int port, usb_port_status_t *ps)
+usbd_get_port_status(struct usbd_device *dev, int port, usb_port_status_t *ps)
{
usb_device_request_t req;
@@ -142,7 +142,7 @@ usbd_get_port_status(usbd_device_handle dev, int port, usb_port_status_t *ps)
}
usbd_status
-usbd_clear_hub_feature(usbd_device_handle dev, int sel)
+usbd_clear_hub_feature(struct usbd_device *dev, int sel)
{
usb_device_request_t req;
@@ -155,7 +155,7 @@ usbd_clear_hub_feature(usbd_device_handle dev, int sel)
}
usbd_status
-usbd_set_hub_feature(usbd_device_handle dev, int sel)
+usbd_set_hub_feature(struct usbd_device *dev, int sel)
{
usb_device_request_t req;
@@ -168,7 +168,7 @@ usbd_set_hub_feature(usbd_device_handle dev, int sel)
}
usbd_status
-usbd_clear_port_feature(usbd_device_handle dev, int port, int sel)
+usbd_clear_port_feature(struct usbd_device *dev, int port, int sel)
{
usb_device_request_t req;
@@ -181,7 +181,7 @@ usbd_clear_port_feature(usbd_device_handle dev, int port, int sel)
}
usbd_status
-usbd_set_port_feature(usbd_device_handle dev, int port, int sel)
+usbd_set_port_feature(struct usbd_device *dev, int port, int sel)
{
usb_device_request_t req;
@@ -194,10 +194,10 @@ usbd_set_port_feature(usbd_device_handle dev, int port, int sel)
}
usbd_status
-usbd_get_protocol(usbd_interface_handle iface, u_int8_t *report)
+usbd_get_protocol(struct usbd_interface *iface, u_int8_t *report)
{
usb_interface_descriptor_t *id = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
+ struct usbd_device *dev;
usb_device_request_t req;
DPRINTFN(4, ("usbd_get_protocol: iface=%p, endpt=%d\n", iface,
@@ -214,10 +214,10 @@ usbd_get_protocol(usbd_interface_handle iface, u_int8_t *report)
}
usbd_status
-usbd_set_protocol(usbd_interface_handle iface, int report)
+usbd_set_protocol(struct usbd_interface *iface, int report)
{
usb_interface_descriptor_t *id = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
+ struct usbd_device *dev;
usb_device_request_t req;
DPRINTFN(4, ("usbd_set_protocol: iface=%p, report=%d, endpt=%d\n",
@@ -234,11 +234,11 @@ usbd_set_protocol(usbd_interface_handle iface, int report)
}
usbd_status
-usbd_set_report(usbd_interface_handle iface, int type, int id, void *data,
+usbd_set_report(struct usbd_interface *iface, int type, int id, void *data,
int len)
{
usb_interface_descriptor_t *ifd = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
+ struct usbd_device *dev;
usb_device_request_t req;
DPRINTFN(4, ("usbd_set_report: len=%d\n", len));
@@ -254,11 +254,11 @@ usbd_set_report(usbd_interface_handle iface, int type, int id, void *data,
}
usbd_status
-usbd_set_report_async(usbd_interface_handle iface, int type, int id,
+usbd_set_report_async(struct usbd_interface *iface, int type, int id,
void *data, int len)
{
usb_interface_descriptor_t *ifd = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
+ struct usbd_device *dev;
usb_device_request_t req;
DPRINTFN(4, ("usbd_set_report_async: len=%d\n", len));
@@ -274,11 +274,11 @@ usbd_set_report_async(usbd_interface_handle iface, int type, int id,
}
usbd_status
-usbd_get_report(usbd_interface_handle iface, int type, int id, void *data,
+usbd_get_report(struct usbd_interface *iface, int type, int id, void *data,
int len)
{
usb_interface_descriptor_t *ifd = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
+ struct usbd_device *dev;
usb_device_request_t req;
DPRINTFN(4, ("usbd_get_report: len=%d\n", len));
@@ -294,10 +294,10 @@ usbd_get_report(usbd_interface_handle iface, int type, int id, void *data,
}
usbd_status
-usbd_set_idle(usbd_interface_handle iface, int duration, int id)
+usbd_set_idle(struct usbd_interface *iface, int duration, int id)
{
usb_interface_descriptor_t *ifd = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
+ struct usbd_device *dev;
usb_device_request_t req;
DPRINTFN(4, ("usbd_set_idle: %d %d\n", duration, id));
@@ -313,7 +313,7 @@ usbd_set_idle(usbd_interface_handle iface, int duration, int id)
}
usbd_status
-usbd_get_report_descriptor(usbd_device_handle dev, int ifcno, int size,
+usbd_get_report_descriptor(struct usbd_device *dev, int ifcno, int size,
void *d)
{
usb_device_request_t req;
@@ -326,13 +326,13 @@ usbd_get_report_descriptor(usbd_device_handle dev, int ifcno, int size,
return (usbd_do_request(dev, &req, d));
}
-usb_hid_descriptor_t *
-usbd_get_hid_descriptor(usbd_interface_handle ifc)
+struct usb_hid_descriptor *
+usbd_get_hid_descriptor(struct usbd_interface *ifc)
{
usb_interface_descriptor_t *idesc = usbd_get_interface_descriptor(ifc);
- usbd_device_handle dev;
+ struct usbd_device *dev;
usb_config_descriptor_t *cdesc;
- usb_hid_descriptor_t *hd;
+ struct usb_hid_descriptor *hd;
char *p, *end;
if (idesc == NULL)
@@ -344,7 +344,7 @@ usbd_get_hid_descriptor(usbd_interface_handle ifc)
end = (char *)cdesc + UGETW(cdesc->wTotalLength);
for (; p < end; p += hd->bLength) {
- hd = (usb_hid_descriptor_t *)p;
+ hd = (struct usb_hid_descriptor *)p;
if (p + hd->bLength <= end && hd->bDescriptorType == UDESC_HID)
return (hd);
if (hd->bDescriptorType == UDESC_INTERFACE)
@@ -354,12 +354,12 @@ usbd_get_hid_descriptor(usbd_interface_handle ifc)
}
usbd_status
-usbd_read_report_desc(usbd_interface_handle ifc, void **descp, int *sizep,
+usbd_read_report_desc(struct usbd_interface *ifc, void **descp, int *sizep,
int mem)
{
usb_interface_descriptor_t *id;
- usb_hid_descriptor_t *hid;
- usbd_device_handle dev;
+ struct usb_hid_descriptor *hid;
+ struct usbd_device *dev;
usbd_status err;
usbd_interface2device_handle(ifc, &dev);
@@ -384,7 +384,7 @@ usbd_read_report_desc(usbd_interface_handle ifc, void **descp, int *sizep,
}
usbd_status
-usbd_get_config(usbd_device_handle dev, u_int8_t *conf)
+usbd_get_config(struct usbd_device *dev, u_int8_t *conf)
{
usb_device_request_t req;
@@ -396,17 +396,17 @@ usbd_get_config(usbd_device_handle dev, u_int8_t *conf)
return (usbd_do_request(dev, &req, conf));
}
-void usbd_bulk_transfer_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
+void usbd_bulk_transfer_cb(struct usbd_xfer *xfer, void *priv,
usbd_status status);
void
-usbd_bulk_transfer_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
+usbd_bulk_transfer_cb(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
wakeup(xfer);
}
usbd_status
-usbd_bulk_transfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe,
+usbd_bulk_transfer(struct usbd_xfer *xfer, struct usbd_pipe *pipe,
u_int16_t flags, u_int32_t timeout, void *buf, u_int32_t *size, char *lbl)
{
usbd_status err;
@@ -438,17 +438,17 @@ usbd_bulk_transfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe,
return (err);
}
-void usbd_intr_transfer_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
+void usbd_intr_transfer_cb(struct usbd_xfer *xfer, void *priv,
usbd_status status);
void
-usbd_intr_transfer_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
+usbd_intr_transfer_cb(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
wakeup(xfer);
}
usbd_status
-usbd_intr_transfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe,
+usbd_intr_transfer(struct usbd_xfer *xfer, struct usbd_pipe *pipe,
u_int16_t flags, u_int32_t timeout, void *buf, u_int32_t *size, char *lbl)
{
usbd_status err;
diff --git a/sys/dev/usb/usbdi_util.h b/sys/dev/usb/usbdi_util.h
index 922ca2b6a9a..f53d2f1ca03 100644
--- a/sys/dev/usb/usbdi_util.h
+++ b/sys/dev/usb/usbdi_util.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdi_util.h,v 1.20 2013/04/10 07:48:36 mpi Exp $ */
+/* $OpenBSD: usbdi_util.h,v 1.21 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: usbdi_util.h,v 1.28 2002/07/11 21:14:36 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi_util.h,v 1.9 1999/11/17 22:33:50 n_hibma Exp $ */
@@ -32,49 +32,49 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-usbd_status usbd_get_desc(usbd_device_handle dev, int type,
+usbd_status usbd_get_desc(struct usbd_device *dev, int type,
int index, int len, void *desc);
-usbd_status usbd_get_config_desc(usbd_device_handle, int,
+usbd_status usbd_get_config_desc(struct usbd_device *, int,
usb_config_descriptor_t *);
-usbd_status usbd_set_address(usbd_device_handle dev, int addr);
-usbd_status usbd_get_port_status(usbd_device_handle,
+usbd_status usbd_set_address(struct usbd_device *dev, int addr);
+usbd_status usbd_get_port_status(struct usbd_device *,
int, usb_port_status_t *);
-usbd_status usbd_set_hub_feature(usbd_device_handle dev, int);
-usbd_status usbd_clear_hub_feature(usbd_device_handle, int);
-usbd_status usbd_set_port_feature(usbd_device_handle dev, int, int);
-usbd_status usbd_clear_port_feature(usbd_device_handle, int, int);
-usbd_status usbd_get_device_status(usbd_device_handle, usb_status_t *);
-usbd_status usbd_get_hub_status(usbd_device_handle, usb_hub_status_t *);
-usbd_status usbd_get_protocol(usbd_interface_handle dev, u_int8_t *report);
-usbd_status usbd_set_protocol(usbd_interface_handle dev, int report);
-usbd_status usbd_get_report_descriptor(usbd_device_handle dev, int ifcno,
+usbd_status usbd_set_hub_feature(struct usbd_device *dev, int);
+usbd_status usbd_clear_hub_feature(struct usbd_device *, int);
+usbd_status usbd_set_port_feature(struct usbd_device *dev, int, int);
+usbd_status usbd_clear_port_feature(struct usbd_device *, int, int);
+usbd_status usbd_get_device_status(struct usbd_device *, usb_status_t *);
+usbd_status usbd_get_hub_status(struct usbd_device *, usb_hub_status_t *);
+usbd_status usbd_get_protocol(struct usbd_interface *dev, u_int8_t *report);
+usbd_status usbd_set_protocol(struct usbd_interface *dev, int report);
+usbd_status usbd_get_report_descriptor(struct usbd_device *dev, int ifcno,
int size, void *d);
-struct usb_hid_descriptor *usbd_get_hid_descriptor(usbd_interface_handle ifc);
-usbd_status usbd_set_report(usbd_interface_handle iface, int type, int id,
+struct usb_hid_descriptor *usbd_get_hid_descriptor(struct usbd_interface *ifc);
+usbd_status usbd_set_report(struct usbd_interface *iface, int type, int id,
void *data,int len);
-usbd_status usbd_set_report_async(usbd_interface_handle iface, int type,
+usbd_status usbd_set_report_async(struct usbd_interface *iface, int type,
int id, void *data, int len);
-usbd_status usbd_get_report(usbd_interface_handle iface, int type, int id,
+usbd_status usbd_get_report(struct usbd_interface *iface, int type, int id,
void *data, int len);
-usbd_status usbd_set_idle(usbd_interface_handle iface, int duration,int id);
-usbd_status usbd_read_report_desc(usbd_interface_handle ifc, void **descp,
+usbd_status usbd_set_idle(struct usbd_interface *iface, int duration,int id);
+usbd_status usbd_read_report_desc(struct usbd_interface *ifc, void **descp,
int *sizep, int mem);
-usbd_status usbd_get_config(usbd_device_handle dev, u_int8_t *conf);
-usbd_status usbd_get_string_desc(usbd_device_handle dev, int sindex,
+usbd_status usbd_get_config(struct usbd_device *dev, u_int8_t *conf);
+usbd_status usbd_get_string_desc(struct usbd_device *dev, int sindex,
int langid,usb_string_descriptor_t *sdesc, int *sizep);
-void usbd_delay_ms(usbd_device_handle, u_int);
+void usbd_delay_ms(struct usbd_device *, u_int);
-usbd_status usbd_set_config_no(usbd_device_handle dev, int no, int msg);
-usbd_status usbd_set_config_index(usbd_device_handle dev, int index,
+usbd_status usbd_set_config_no(struct usbd_device *dev, int no, int msg);
+usbd_status usbd_set_config_index(struct usbd_device *dev, int index,
int msg);
-usbd_status usbd_bulk_transfer(usbd_xfer_handle xfer,
- usbd_pipe_handle pipe, u_int16_t flags, u_int32_t timeout,
+usbd_status usbd_bulk_transfer(struct usbd_xfer *xfer,
+ struct usbd_pipe *pipe, u_int16_t flags, u_int32_t timeout,
void *buf, u_int32_t *size, char *lbl);
-usbd_status usbd_intr_transfer(usbd_xfer_handle xfer,
- usbd_pipe_handle pipe, u_int16_t flags, u_int32_t timeout,
+usbd_status usbd_intr_transfer(struct usbd_xfer *xfer,
+ struct usbd_pipe *pipe, u_int16_t flags, u_int32_t timeout,
void *buf, u_int32_t *size, char *lbl);
void usb_detach_wait(struct device *);
diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h
index 115b3dabee0..a7809234b9c 100644
--- a/sys/dev/usb/usbdivar.h
+++ b/sys/dev/usb/usbdivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdivar.h,v 1.46 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: usbdivar.h,v 1.47 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: usbdivar.h,v 1.70 2002/07/11 21:14:36 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdivar.h,v 1.11 1999/11/17 22:33:51 n_hibma Exp $ */
@@ -36,10 +36,10 @@
/* From usb_mem.h */
struct usb_dma_block;
-typedef struct {
+struct usb_dma {
struct usb_dma_block *block;
u_int offs;
-} usb_dma_t;
+};
struct usbd_xfer;
struct usbd_pipe;
@@ -54,20 +54,20 @@ struct usbd_bus_methods {
usbd_status (*open_pipe)(struct usbd_pipe *pipe);
void (*soft_intr)(void *);
void (*do_poll)(struct usbd_bus *);
- usbd_status (*allocm)(struct usbd_bus *, usb_dma_t *,
+ usbd_status (*allocm)(struct usbd_bus *, struct usb_dma *,
u_int32_t bufsize);
- void (*freem)(struct usbd_bus *, usb_dma_t *);
+ void (*freem)(struct usbd_bus *, struct usb_dma *);
struct usbd_xfer * (*allocx)(struct usbd_bus *);
void (*freex)(struct usbd_bus *, struct usbd_xfer *);
};
struct usbd_pipe_methods {
- usbd_status (*transfer)(usbd_xfer_handle xfer);
- usbd_status (*start)(usbd_xfer_handle xfer);
- void (*abort)(usbd_xfer_handle xfer);
- void (*close)(usbd_pipe_handle pipe);
- void (*cleartoggle)(usbd_pipe_handle pipe);
- void (*done)(usbd_xfer_handle xfer);
+ usbd_status (*transfer)(struct usbd_xfer *xfer);
+ usbd_status (*start)(struct usbd_xfer *xfer);
+ void (*abort)(struct usbd_xfer *xfer);
+ void (*close)(struct usbd_pipe *pipe);
+ void (*cleartoggle)(struct usbd_pipe *pipe);
+ void (*done)(struct usbd_xfer *xfer);
};
struct usbd_tt {
@@ -87,7 +87,7 @@ struct usbd_port {
};
struct usbd_hub {
- usbd_status (*explore)(usbd_device_handle hub);
+ usbd_status (*explore)(struct usbd_device *hub);
void *hubsoftc;
usb_hub_descriptor_t hubdesc;
struct usbd_port *ports;
@@ -100,7 +100,7 @@ struct usbd_bus {
u_int32_t pipe_size; /* size of a pipe struct */
/* Filled by usb driver */
struct usbd_device *root_hub;
- usbd_device_handle devices[USB_MAX_DEVICES];
+ struct usbd_device *devices[USB_MAX_DEVICES];
char use_polling;
char dying;
int flags;
@@ -168,7 +168,7 @@ struct usbd_pipe {
SIMPLEQ_HEAD(, usbd_xfer) queue;
LIST_ENTRY(usbd_pipe) next;
- usbd_xfer_handle intrxfer; /* used for repeating requests */
+ struct usbd_xfer *intrxfer; /* used for repeating requests */
char repeat;
int interval;
@@ -203,7 +203,7 @@ struct usbd_xfer {
/* For memory allocation */
struct usbd_device *device;
- usb_dma_t dmabuf;
+ struct usb_dma dmabuf;
int rqflags;
#define URQ_REQUEST 0x01
@@ -226,33 +226,33 @@ void usb_end_tasks(void);
void usbd_dump_iface(struct usbd_interface *iface);
void usbd_dump_device(struct usbd_device *dev);
void usbd_dump_endpoint(struct usbd_endpoint *endp);
-void usbd_dump_queue(usbd_pipe_handle pipe);
-void usbd_dump_pipe(usbd_pipe_handle pipe);
+void usbd_dump_queue(struct usbd_pipe *pipe);
+void usbd_dump_pipe(struct usbd_pipe *pipe);
#endif
/* Routines from usb_subr.c */
int usbctlprint(void *, const char *);
-void usb_delay_ms(usbd_bus_handle, u_int);
-usbd_status usbd_port_disown_to_1_1(usbd_device_handle dev,
+void usb_delay_ms(struct usbd_bus *, u_int);
+usbd_status usbd_port_disown_to_1_1(struct usbd_device *dev,
int port, usb_port_status_t *ps);
-usbd_status usbd_reset_port(usbd_device_handle dev,
+usbd_status usbd_reset_port(struct usbd_device *dev,
int port, usb_port_status_t *ps);
-usbd_status usbd_setup_pipe(usbd_device_handle dev,
- usbd_interface_handle iface, struct usbd_endpoint *, int,
- usbd_pipe_handle *pipe);
-usbd_status usbd_new_device(struct device *parent, usbd_bus_handle bus,
+usbd_status usbd_setup_pipe(struct usbd_device *dev,
+ struct usbd_interface *iface, struct usbd_endpoint *, int,
+ struct usbd_pipe **pipe);
+usbd_status usbd_new_device(struct device *parent, struct usbd_bus *bus,
int depth, int lowspeed, int port, struct usbd_port *);
int usbd_printBCD(char *cp, size_t len, int bcd);
-usbd_status usbd_fill_iface_data(usbd_device_handle dev, int i, int a);
-void usb_free_device(usbd_device_handle, struct usbd_port *);
+usbd_status usbd_fill_iface_data(struct usbd_device *dev, int i, int a);
+void usb_free_device(struct usbd_device *, struct usbd_port *);
-usbd_status usb_insert_transfer(usbd_xfer_handle xfer);
-void usb_transfer_complete(usbd_xfer_handle xfer);
+usbd_status usb_insert_transfer(struct usbd_xfer *xfer);
+void usb_transfer_complete(struct usbd_xfer *xfer);
void usb_disconnect_port(struct usbd_port *up, struct device *);
/* Routines from usb.c */
-void usb_needs_explore(usbd_device_handle, int);
-void usb_needs_reattach(usbd_device_handle);
+void usb_needs_explore(struct usbd_device *, int);
+void usb_needs_reattach(struct usbd_device *);
void usb_schedsoftintr(struct usbd_bus *);
/* Locator stuff. */
diff --git a/sys/dev/usb/usbf.c b/sys/dev/usb/usbf.c
index b24f5ace46e..8f42e158c3c 100644
--- a/sys/dev/usb/usbf.c
+++ b/sys/dev/usb/usbf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbf.c,v 1.14 2011/09/27 19:58:38 miod Exp $ */
+/* $OpenBSD: usbf.c,v 1.15 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -74,7 +74,7 @@ int usbfdebug = 0;
struct usbf_softc {
struct device sc_dev; /* base device */
- usbf_bus_handle sc_bus; /* USB device controller */
+ struct usbf_bus *sc_bus; /* USB device controller */
struct usbf_port sc_port; /* dummy port for function */
struct proc *sc_proc; /* task thread */
TAILQ_HEAD(,usbf_task) sc_tskq; /* task queue head */
@@ -90,13 +90,13 @@ void usbf_attach(struct device *, struct device *, void *);
void usbf_create_thread(void *);
void usbf_task_thread(void *);
-usbf_status usbf_get_descriptor(usbf_device_handle, usb_device_request_t *,
+usbf_status usbf_get_descriptor(struct usbf_device *, usb_device_request_t *,
void **);
-void usbf_set_address(usbf_device_handle, u_int8_t);
-usbf_status usbf_set_config(usbf_device_handle, u_int8_t);
+void usbf_set_address(struct usbf_device *, u_int8_t);
+usbf_status usbf_set_config(struct usbf_device *, u_int8_t);
#ifdef USBF_DEBUG
-void usbf_dump_request(usbf_device_handle, usb_device_request_t *);
+void usbf_dump_request(struct usbf_device *, usb_device_request_t *);
#endif
struct cfattach usbf_ca = {
@@ -178,7 +178,7 @@ usbf_attach(struct device *parent, struct device *self, void *aux)
* process context ASAP.
*/
void
-usbf_add_task(usbf_device_handle dev, struct usbf_task *task)
+usbf_add_task(struct usbf_device *dev, struct usbf_task *task)
{
struct usbf_softc *sc = dev->bus->usbfctl;
int s;
@@ -200,7 +200,7 @@ usbf_add_task(usbf_device_handle dev, struct usbf_task *task)
}
void
-usbf_rem_task(usbf_device_handle dev, struct usbf_task *task)
+usbf_rem_task(struct usbf_device *dev, struct usbf_task *task)
{
struct usbf_softc *sc = dev->bus->usbfctl;
int s;
@@ -273,9 +273,9 @@ usbf_task_thread(void *arg)
*/
void
-usbf_host_reset(usbf_bus_handle bus)
+usbf_host_reset(struct usbf_bus *bus)
{
- usbf_device_handle dev = bus->usbfctl->sc_port.device;
+ struct usbf_device *dev = bus->usbfctl->sc_port.device;
DPRINTF(0,("usbf_host_reset\n"));
@@ -289,7 +289,7 @@ usbf_host_reset(usbf_bus_handle bus)
*/
usbf_status
-usbf_get_descriptor(usbf_device_handle dev, usb_device_request_t *req,
+usbf_get_descriptor(struct usbf_device *dev, usb_device_request_t *req,
void **data)
{
u_int8_t type = UGETW(req->wValue) >> 8;
@@ -374,7 +374,7 @@ usbf_get_descriptor(usbf_device_handle dev, usb_device_request_t *req,
* if the device is not currently in the Default state.
*/
void
-usbf_set_address(usbf_device_handle dev, u_int8_t address)
+usbf_set_address(struct usbf_device *dev, u_int8_t address)
{
DPRINTF(0,("usbf_set_address: dev=%p, %u -> %u\n", dev,
dev->address, address));
@@ -386,10 +386,10 @@ usbf_set_address(usbf_device_handle dev, u_int8_t address)
* will be in the Configured state upon successful return from this routine.
*/
usbf_status
-usbf_set_config(usbf_device_handle dev, u_int8_t new)
+usbf_set_config(struct usbf_device *dev, u_int8_t new)
{
- usbf_config_handle cfg = dev->config;
- usbf_function_handle fun = dev->function;
+ struct usbf_config *cfg = dev->config;
+ struct usbf_function *fun = dev->function;
usbf_status err = USBF_NORMAL_COMPLETION;
u_int8_t old = cfg ? cfg->uc_cdesc->bConfigurationValue :
USB_UNCONFIG_NO;
@@ -433,12 +433,12 @@ usbf_set_config(usbf_device_handle dev, u_int8_t new)
* Handle device requests coming in via endpoint 0 pipe.
*/
void
-usbf_do_request(usbf_xfer_handle xfer, usbf_private_handle priv,
+usbf_do_request(struct usbf_xfer *xfer, void *priv,
usbf_status err)
{
- usbf_device_handle dev = xfer->pipe->device;
+ struct usbf_device *dev = xfer->pipe->device;
usb_device_request_t *req = xfer->buffer;
- usbf_config_handle cfg;
+ struct usbf_config *cfg;
void *data = NULL;
u_int16_t value;
u_int16_t index;
@@ -531,7 +531,7 @@ usbf_do_request(usbf_xfer_handle xfer, usbf_private_handle priv,
}
default: {
- usbf_function_handle fun = dev->function;
+ struct usbf_function *fun = dev->function;
if (fun == NULL)
err = USBF_STALLED;
@@ -687,7 +687,7 @@ usbf_request_desc_string(usb_device_request_t *req)
}
void
-usbf_dump_request(usbf_device_handle dev, usb_device_request_t *req)
+usbf_dump_request(struct usbf_device *dev, usb_device_request_t *req)
{
struct usbf_softc *sc = dev->bus->usbfctl;
diff --git a/sys/dev/usb/usbf.h b/sys/dev/usb/usbf.h
index 56c6cea79d0..23c4f8abc71 100644
--- a/sys/dev/usb/usbf.h
+++ b/sys/dev/usb/usbf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbf.h,v 1.3 2007/06/19 11:52:07 mbalmer Exp $ */
+/* $OpenBSD: usbf.h,v 1.4 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -23,15 +23,14 @@
#ifndef _USBF_H_
#define _USBF_H_
-typedef struct usbf_function *usbf_function_handle;
-typedef struct usbf_bus *usbf_bus_handle;
-typedef struct usbf_device *usbf_device_handle;
-typedef struct usbf_config *usbf_config_handle;
-typedef struct usbf_interface *usbf_interface_handle;
-typedef struct usbf_endpoint *usbf_endpoint_handle;
-typedef struct usbf_pipe *usbf_pipe_handle;
-typedef struct usbf_xfer *usbf_xfer_handle;
-typedef void *usbf_private_handle;
+struct usbf_function;
+struct usbf_bus;
+struct usbf_device;
+struct usbf_config;
+struct usbf_interface;
+struct usbf_endpoint;
+struct usbf_pipe;
+struct usbf_xfer;
/*
* Return codes for many of the function driver interface routines
@@ -65,19 +64,18 @@ typedef enum { /* keep in sync with USBF_ERROR_STRS */
"STALLED", /* 10 */ \
};
-typedef void (*usbf_callback)(usbf_xfer_handle, usbf_private_handle,
- usbf_status);
+typedef void (*usbf_callback)(struct usbf_xfer *, void *, usbf_status);
/*
* Attach USB function at the logical device.
*/
struct usbf_attach_arg {
- usbf_device_handle device;
+ struct usbf_device *device;
};
struct usbf_function_methods {
- usbf_status (*set_config)(usbf_function_handle, usbf_config_handle);
- usbf_status (*do_request)(usbf_function_handle,
+ usbf_status (*set_config)(struct usbf_function *, struct usbf_config *);
+ usbf_status (*do_request)(struct usbf_function *,
usb_device_request_t *req, void **data);
};
@@ -99,59 +97,59 @@ struct usbf_function {
const char *usbf_errstr(usbf_status);
/* device */
-void usbf_devinfo_setup(usbf_device_handle, u_int8_t, u_int8_t,
+void usbf_devinfo_setup(struct usbf_device *, u_int8_t, u_int8_t,
u_int8_t, u_int16_t, u_int16_t, u_int16_t, const char *,
const char *, const char *);
-char *usbf_devinfo_alloc(usbf_device_handle);
+char *usbf_devinfo_alloc(struct usbf_device *);
void usbf_devinfo_free(char *);
-usb_device_descriptor_t *usbf_device_descriptor(usbf_device_handle);
-usb_string_descriptor_t *usbf_string_descriptor(usbf_device_handle, u_int8_t);
-usb_config_descriptor_t *usbf_config_descriptor(usbf_device_handle, u_int8_t);
+usb_device_descriptor_t *usbf_device_descriptor(struct usbf_device *);
+usb_string_descriptor_t *usbf_string_descriptor(struct usbf_device *, u_int8_t);
+usb_config_descriptor_t *usbf_config_descriptor(struct usbf_device *, u_int8_t);
/* configuration */
-u_int8_t usbf_add_string(usbf_device_handle, const char *);
-usbf_status usbf_add_config(usbf_device_handle, usbf_config_handle *);
-usbf_status usbf_add_config_desc(usbf_config_handle, usb_descriptor_t *,
+u_int8_t usbf_add_string(struct usbf_device *, const char *);
+usbf_status usbf_add_config(struct usbf_device *, struct usbf_config **);
+usbf_status usbf_add_config_desc(struct usbf_config *, usb_descriptor_t *,
usb_descriptor_t **);
-usbf_status usbf_add_interface(usbf_config_handle, u_int8_t, u_int8_t,
- u_int8_t, const char *, usbf_interface_handle *);
-usbf_status usbf_add_endpoint(usbf_interface_handle, u_int8_t,
- u_int8_t, u_int16_t, u_int8_t, usbf_endpoint_handle *);
-usbf_status usbf_end_config(usbf_config_handle);
-usbf_endpoint_handle usbf_config_endpoint(usbf_config_handle, u_int8_t);
+usbf_status usbf_add_interface(struct usbf_config *, u_int8_t, u_int8_t,
+ u_int8_t, const char *, struct usbf_interface **);
+usbf_status usbf_add_endpoint(struct usbf_interface *, u_int8_t,
+ u_int8_t, u_int16_t, u_int8_t, struct usbf_endpoint **);
+usbf_status usbf_end_config(struct usbf_config *);
+struct usbf_endpoint *usbf_config_endpoint(struct usbf_config *, u_int8_t);
/* interface */
-int usbf_interface_number(usbf_interface_handle);
-usbf_endpoint_handle usbf_iface_endpoint(usbf_interface_handle, u_int8_t);
+int usbf_interface_number(struct usbf_interface *);
+struct usbf_endpoint *usbf_iface_endpoint(struct usbf_interface *, u_int8_t);
/* endpoint */
-u_int8_t usbf_endpoint_address(usbf_endpoint_handle);
-u_int8_t usbf_endpoint_attributes(usbf_endpoint_handle);
+u_int8_t usbf_endpoint_address(struct usbf_endpoint *);
+u_int8_t usbf_endpoint_attributes(struct usbf_endpoint *);
#define usbf_endpoint_index(e) UE_GET_ADDR(usbf_endpoint_address((e)))
#define usbf_endpoint_dir(e) UE_GET_DIR(usbf_endpoint_address((e)))
#define usbf_endpoint_type(e) UE_GET_XFERTYPE(usbf_endpoint_attributes((e)))
/* pipe */
-usbf_status usbf_open_pipe(usbf_interface_handle, u_int8_t,
- usbf_pipe_handle *);
-void usbf_abort_pipe(usbf_pipe_handle);
-void usbf_close_pipe(usbf_pipe_handle);
-void usbf_stall_pipe(usbf_pipe_handle);
+usbf_status usbf_open_pipe(struct usbf_interface *, u_int8_t,
+ struct usbf_pipe **);
+void usbf_abort_pipe(struct usbf_pipe *);
+void usbf_close_pipe(struct usbf_pipe *);
+void usbf_stall_pipe(struct usbf_pipe *);
/* transfer */
-usbf_xfer_handle usbf_alloc_xfer(usbf_device_handle);
-void usbf_free_xfer(usbf_xfer_handle);
-void *usbf_alloc_buffer(usbf_xfer_handle, u_int32_t);
-void usbf_free_buffer(usbf_xfer_handle);
-void usbf_setup_xfer(usbf_xfer_handle, usbf_pipe_handle,
- usbf_private_handle, void *, u_int32_t, u_int16_t,
+struct usbf_xfer *usbf_alloc_xfer(struct usbf_device *);
+void usbf_free_xfer(struct usbf_xfer *);
+void *usbf_alloc_buffer(struct usbf_xfer *, u_int32_t);
+void usbf_free_buffer(struct usbf_xfer *);
+void usbf_setup_xfer(struct usbf_xfer *, struct usbf_pipe *,
+ void *, void *, u_int32_t, u_int16_t,
u_int32_t, usbf_callback);
-void usbf_setup_default_xfer(usbf_xfer_handle, usbf_pipe_handle,
- usbf_private_handle, usb_device_request_t *, u_int16_t,
+void usbf_setup_default_xfer(struct usbf_xfer *, struct usbf_pipe *,
+ void *, usb_device_request_t *, u_int16_t,
u_int32_t, usbf_callback);
-void usbf_get_xfer_status(usbf_xfer_handle, usbf_private_handle *,
+void usbf_get_xfer_status(struct usbf_xfer *, void **,
void **, u_int32_t *, usbf_status *);
-usbf_status usbf_transfer(usbf_xfer_handle);
+usbf_status usbf_transfer(struct usbf_xfer *);
/*
* The usbf_task structure describes a task to be perfomed in process
@@ -165,8 +163,8 @@ struct usbf_task {
char onqueue;
};
-void usbf_add_task(usbf_device_handle, struct usbf_task *);
-void usbf_rem_task(usbf_device_handle, struct usbf_task *);
+void usbf_add_task(struct usbf_device *, struct usbf_task *);
+void usbf_rem_task(struct usbf_device *, struct usbf_task *);
#define usbf_init_task(t, f, a) ((t)->fun=(f), (t)->arg=(a), (t)->onqueue=0)
#endif
diff --git a/sys/dev/usb/usbf_subr.c b/sys/dev/usb/usbf_subr.c
index 5b8d6075e70..ed6a491d5aa 100644
--- a/sys/dev/usb/usbf_subr.c
+++ b/sys/dev/usb/usbf_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbf_subr.c,v 1.16 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: usbf_subr.c,v 1.17 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -42,15 +42,15 @@ extern int usbfdebug;
#endif
void *usbf_realloc(void **, size_t *, size_t);
-size_t usbf_get_string(usbf_device_handle, u_int8_t, char *, size_t);
-usbf_status usbf_open_pipe_ival(usbf_interface_handle, u_int8_t,
- usbf_pipe_handle *, int);
-usbf_status usbf_setup_pipe(usbf_device_handle, usbf_interface_handle,
+size_t usbf_get_string(struct usbf_device *, u_int8_t, char *, size_t);
+usbf_status usbf_open_pipe_ival(struct usbf_interface *, u_int8_t,
+ struct usbf_pipe **, int);
+usbf_status usbf_setup_pipe(struct usbf_device *, struct usbf_interface *,
struct usbf_endpoint *, int,
- usbf_pipe_handle *);
-void usbf_start_next(usbf_pipe_handle);
-void usbf_set_endpoint_halt(usbf_endpoint_handle);
-void usbf_clear_endpoint_halt(usbf_endpoint_handle);
+ struct usbf_pipe **);
+void usbf_start_next(struct usbf_pipe *);
+void usbf_set_endpoint_halt(struct usbf_endpoint *);
+void usbf_clear_endpoint_halt(struct usbf_endpoint *);
static const char * const usbf_error_strs[] = USBF_ERROR_STRS;
@@ -101,7 +101,7 @@ usbf_realloc(void **pp, size_t *sizep, size_t newsize)
* Attach a function driver.
*/
static usbf_status
-usbf_probe_and_attach(struct device *parent, usbf_device_handle dev, int port)
+usbf_probe_and_attach(struct device *parent, struct usbf_device *dev, int port)
{
struct usbf_attach_arg uaa;
struct device *dv;
@@ -132,7 +132,7 @@ usbf_probe_and_attach(struct device *parent, usbf_device_handle dev, int port)
}
static void
-usbf_remove_device(usbf_device_handle dev, struct usbf_port *up)
+usbf_remove_device(struct usbf_device *dev, struct usbf_port *up)
{
KASSERT(dev != NULL && dev == up->device);
@@ -145,7 +145,7 @@ usbf_remove_device(usbf_device_handle dev, struct usbf_port *up)
}
usbf_status
-usbf_new_device(struct device *parent, usbf_bus_handle bus, int depth,
+usbf_new_device(struct device *parent, struct usbf_bus *bus, int depth,
int speed, int port, struct usbf_port *up)
{
struct usbf_device *dev;
@@ -237,7 +237,7 @@ usbf_new_device(struct device *parent, usbf_bus_handle bus, int depth,
* the default device identification according to the particular function.
*/
void
-usbf_devinfo_setup(usbf_device_handle dev, u_int8_t devclass,
+usbf_devinfo_setup(struct usbf_device *dev, u_int8_t devclass,
u_int8_t subclass, u_int8_t proto, u_int16_t vendor, u_int16_t product,
u_int16_t device, const char *manf, const char *prod, const char *ser)
{
@@ -262,7 +262,7 @@ usbf_devinfo_setup(usbf_device_handle dev, u_int8_t devclass,
}
char *
-usbf_devinfo_alloc(usbf_device_handle dev)
+usbf_devinfo_alloc(struct usbf_device *dev)
{
char manf[40];
char prod[40];
@@ -300,7 +300,7 @@ usbf_devinfo_free(char *devinfo)
* instead of failing.
*/
u_int8_t
-usbf_add_string(usbf_device_handle dev, const char *string)
+usbf_add_string(struct usbf_device *dev, const char *string)
{
usb_string_descriptor_t *sd;
size_t oldsize;
@@ -334,7 +334,7 @@ usbf_add_string(usbf_device_handle dev, const char *string)
}
usb_string_descriptor_t *
-usbf_string_descriptor(usbf_device_handle dev, u_int8_t id)
+usbf_string_descriptor(struct usbf_device *dev, u_int8_t id)
{
static usb_string_descriptor_t sd0;
static usb_string_descriptor_t sd1;
@@ -367,7 +367,7 @@ usbf_string_descriptor(usbf_device_handle dev, u_int8_t id)
}
size_t
-usbf_get_string(usbf_device_handle dev, u_int8_t id, char *s, size_t size)
+usbf_get_string(struct usbf_device *dev, u_int8_t id, char *s, size_t size)
{
usb_string_descriptor_t *sd = NULL;
size_t i, len;
@@ -396,7 +396,7 @@ usbf_get_string(usbf_device_handle dev, u_int8_t id, char *s, size_t size)
* The new configuration initially has zero interfaces.
*/
usbf_status
-usbf_add_config(usbf_device_handle dev, usbf_config_handle *ucp)
+usbf_add_config(struct usbf_device *dev, struct usbf_config **ucp)
{
struct usbf_config *uc;
usb_config_descriptor_t *cd;
@@ -442,7 +442,7 @@ usbf_add_config(usbf_device_handle dev, usbf_config_handle *ucp)
* device configuration descriptor.
*/
usbf_status
-usbf_add_config_desc(usbf_config_handle uc, usb_descriptor_t *d,
+usbf_add_config_desc(struct usbf_config *uc, usb_descriptor_t *d,
usb_descriptor_t **dp)
{
usb_config_descriptor_t *cd;
@@ -467,9 +467,9 @@ usbf_add_config_desc(usbf_config_handle uc, usb_descriptor_t *d,
}
usbf_status
-usbf_add_interface(usbf_config_handle uc, u_int8_t bInterfaceClass,
+usbf_add_interface(struct usbf_config *uc, u_int8_t bInterfaceClass,
u_int8_t bInterfaceSubClass, u_int8_t bInterfaceProtocol,
- const char *string, usbf_interface_handle *uip)
+ const char *string, struct usbf_interface **uip)
{
struct usbf_interface *ui;
usb_interface_descriptor_t *id;
@@ -508,9 +508,9 @@ usbf_add_interface(usbf_config_handle uc, u_int8_t bInterfaceClass,
}
usbf_status
-usbf_add_endpoint(usbf_interface_handle ui, u_int8_t bEndpointAddress,
+usbf_add_endpoint(struct usbf_interface *ui, u_int8_t bEndpointAddress,
u_int8_t bmAttributes, u_int16_t wMaxPacketSize, u_int8_t bInterval,
- usbf_endpoint_handle *uep)
+ struct usbf_endpoint **uep)
{
struct usbf_endpoint *ue;
usb_endpoint_descriptor_t *ed;
@@ -550,7 +550,7 @@ usbf_add_endpoint(usbf_interface_handle ui, u_int8_t bEndpointAddress,
* the real USB configuration descriptor that can be sent to the USB host.
*/
usbf_status
-usbf_end_config(usbf_config_handle uc)
+usbf_end_config(struct usbf_config *uc)
{
struct usbf_interface *ui;
struct usbf_endpoint *ue;
@@ -585,13 +585,13 @@ usbf_end_config(usbf_config_handle uc)
}
usb_device_descriptor_t *
-usbf_device_descriptor(usbf_device_handle dev)
+usbf_device_descriptor(struct usbf_device *dev)
{
return &dev->ddesc;
}
usb_config_descriptor_t *
-usbf_config_descriptor(usbf_device_handle dev, u_int8_t index)
+usbf_config_descriptor(struct usbf_device *dev, u_int8_t index)
{
struct usbf_config *uc;
@@ -603,36 +603,36 @@ usbf_config_descriptor(usbf_device_handle dev, u_int8_t index)
}
int
-usbf_interface_number(usbf_interface_handle iface)
+usbf_interface_number(struct usbf_interface *iface)
{
return iface->idesc->bInterfaceNumber;
}
u_int8_t
-usbf_endpoint_address(usbf_endpoint_handle endpoint)
+usbf_endpoint_address(struct usbf_endpoint *endpoint)
{
return endpoint->edesc->bEndpointAddress;
}
u_int8_t
-usbf_endpoint_attributes(usbf_endpoint_handle endpoint)
+usbf_endpoint_attributes(struct usbf_endpoint *endpoint)
{
return endpoint->edesc->bmAttributes;
}
usbf_status
-usbf_open_pipe(usbf_interface_handle iface, u_int8_t address,
- usbf_pipe_handle *pipe)
+usbf_open_pipe(struct usbf_interface *iface, u_int8_t address,
+ struct usbf_pipe **pipe)
{
return usbf_open_pipe_ival(iface, address, pipe, 0);
}
usbf_status
-usbf_open_pipe_ival(usbf_interface_handle iface, u_int8_t address,
- usbf_pipe_handle *pipe, int ival)
+usbf_open_pipe_ival(struct usbf_interface *iface, u_int8_t address,
+ struct usbf_pipe **pipe, int ival)
{
struct usbf_endpoint *ep;
- usbf_pipe_handle p;
+ struct usbf_pipe *p;
usbf_status err;
ep = usbf_iface_endpoint(iface, address);
@@ -649,8 +649,8 @@ usbf_open_pipe_ival(usbf_interface_handle iface, u_int8_t address,
}
usbf_status
-usbf_setup_pipe(usbf_device_handle dev, usbf_interface_handle iface,
- struct usbf_endpoint *ep, int ival, usbf_pipe_handle *pipe)
+usbf_setup_pipe(struct usbf_device *dev, struct usbf_interface *iface,
+ struct usbf_endpoint *ep, int ival, struct usbf_pipe **pipe)
{
struct usbf_pipe *p;
usbf_status err;
@@ -680,9 +680,9 @@ usbf_setup_pipe(usbf_device_handle dev, usbf_interface_handle iface,
/* Dequeue all pipe operations. */
void
-usbf_abort_pipe(usbf_pipe_handle pipe)
+usbf_abort_pipe(struct usbf_pipe *pipe)
{
- usbf_xfer_handle xfer;
+ struct usbf_xfer *xfer;
int s;
s = splusb();
@@ -702,7 +702,7 @@ usbf_abort_pipe(usbf_pipe_handle pipe)
/* Abort all pipe operations and close the pipe. */
void
-usbf_close_pipe(usbf_pipe_handle pipe)
+usbf_close_pipe(struct usbf_pipe *pipe)
{
usbf_abort_pipe(pipe);
pipe->methods->close(pipe);
@@ -711,15 +711,15 @@ usbf_close_pipe(usbf_pipe_handle pipe)
}
void
-usbf_stall_pipe(usbf_pipe_handle pipe)
+usbf_stall_pipe(struct usbf_pipe *pipe)
{
DPRINTF(0,("usbf_stall_pipe not implemented\n"));
}
-usbf_endpoint_handle
-usbf_iface_endpoint(usbf_interface_handle iface, u_int8_t address)
+struct usbf_endpoint *
+usbf_iface_endpoint(struct usbf_interface *iface, u_int8_t address)
{
- usbf_endpoint_handle ep;
+ struct usbf_endpoint *ep;
SIMPLEQ_FOREACH(ep, &iface->endpoint_head, next) {
if (ep->edesc->bEndpointAddress == address)
@@ -728,11 +728,11 @@ usbf_iface_endpoint(usbf_interface_handle iface, u_int8_t address)
return NULL;
}
-usbf_endpoint_handle
-usbf_config_endpoint(usbf_config_handle cfg, u_int8_t address)
+struct usbf_endpoint *
+usbf_config_endpoint(struct usbf_config *cfg, u_int8_t address)
{
- usbf_interface_handle iface;
- usbf_endpoint_handle ep;
+ struct usbf_interface *iface;
+ struct usbf_endpoint *ep;
SIMPLEQ_FOREACH(iface, &cfg->iface_head, next) {
SIMPLEQ_FOREACH(ep, &iface->endpoint_head, next) {
@@ -744,20 +744,20 @@ usbf_config_endpoint(usbf_config_handle cfg, u_int8_t address)
}
void
-usbf_set_endpoint_halt(usbf_endpoint_handle endpoint)
+usbf_set_endpoint_halt(struct usbf_endpoint *endpoint)
{
}
void
-usbf_clear_endpoint_halt(usbf_endpoint_handle endpoint)
+usbf_clear_endpoint_halt(struct usbf_endpoint *endpoint)
{
}
usbf_status
-usbf_set_endpoint_feature(usbf_config_handle cfg, u_int8_t address,
+usbf_set_endpoint_feature(struct usbf_config *cfg, u_int8_t address,
u_int16_t value)
{
- usbf_endpoint_handle ep;
+ struct usbf_endpoint *ep;
DPRINTF(0,("usbf_set_endpoint_feature: cfg=%p address=%#x"
" value=%#x\n", cfg, address, value));
@@ -777,10 +777,10 @@ usbf_set_endpoint_feature(usbf_config_handle cfg, u_int8_t address,
}
usbf_status
-usbf_clear_endpoint_feature(usbf_config_handle cfg, u_int8_t address,
+usbf_clear_endpoint_feature(struct usbf_config *cfg, u_int8_t address,
u_int16_t value)
{
- usbf_endpoint_handle ep;
+ struct usbf_endpoint *ep;
DPRINTF(0,("usbf_clear_endpoint_feature: cfg=%p address=%#x"
" value=%#x\n", cfg, address, value));
@@ -799,8 +799,8 @@ usbf_clear_endpoint_feature(usbf_config_handle cfg, u_int8_t address,
}
}
-usbf_xfer_handle
-usbf_alloc_xfer(usbf_device_handle dev)
+struct usbf_xfer *
+usbf_alloc_xfer(struct usbf_device *dev)
{
struct usbf_xfer *xfer;
@@ -815,7 +815,7 @@ usbf_alloc_xfer(usbf_device_handle dev)
}
void
-usbf_free_xfer(usbf_xfer_handle xfer)
+usbf_free_xfer(struct usbf_xfer *xfer)
{
DPRINTF(1,("usbf_free_xfer: %p\n", xfer));
if (xfer->rqflags & (URQ_DEV_DMABUF | URQ_AUTO_DMABUF))
@@ -824,7 +824,7 @@ usbf_free_xfer(usbf_xfer_handle xfer)
}
usbf_status
-usbf_allocmem(usbf_bus_handle bus, size_t size, size_t align, usb_dma_t *p)
+usbf_allocmem(struct usbf_bus *bus, size_t size, size_t align, struct usb_dma *p)
{
struct usbd_bus dbus;
usbd_status err;
@@ -836,13 +836,13 @@ usbf_allocmem(usbf_bus_handle bus, size_t size, size_t align, usb_dma_t *p)
}
void
-usbf_freemem(usbf_bus_handle bus, usb_dma_t *p)
+usbf_freemem(struct usbf_bus *bus, struct usb_dma *p)
{
- usb_freemem((usbd_bus_handle)NULL, p);
+ usb_freemem((struct usbd_bus *)NULL, p);
}
void *
-usbf_alloc_buffer(usbf_xfer_handle xfer, u_int32_t size)
+usbf_alloc_buffer(struct usbf_xfer *xfer, u_int32_t size)
{
struct usbf_bus *bus = xfer->device->bus;
usbf_status err;
@@ -861,7 +861,7 @@ usbf_alloc_buffer(usbf_xfer_handle xfer, u_int32_t size)
}
void
-usbf_free_buffer(usbf_xfer_handle xfer)
+usbf_free_buffer(struct usbf_xfer *xfer)
{
#ifdef DIAGNOSTIC
if (!(xfer->rqflags & URQ_DEV_DMABUF)) {
@@ -879,10 +879,10 @@ usbf_free_buffer(usbf_xfer_handle xfer)
* easily compare traces.
*/
static void
-usbf_dump_buffer(usbf_xfer_handle xfer)
+usbf_dump_buffer(struct usbf_xfer *xfer)
{
struct device *dev = (struct device *)xfer->pipe->device->bus->usbfctl;
- usbf_endpoint_handle ep = xfer->pipe->endpoint;
+ struct usbf_endpoint *ep = xfer->pipe->endpoint;
int index = usbf_endpoint_index(ep);
int dir = usbf_endpoint_dir(ep);
u_char *p = xfer->buffer;
@@ -905,8 +905,8 @@ usbf_dump_buffer(usbf_xfer_handle xfer)
#endif
void
-usbf_setup_xfer(usbf_xfer_handle xfer, usbf_pipe_handle pipe,
- usbf_private_handle priv, void *buffer, u_int32_t length,
+usbf_setup_xfer(struct usbf_xfer *xfer, struct usbf_pipe *pipe,
+ void *priv, void *buffer, u_int32_t length,
u_int16_t flags, u_int32_t timeout, usbf_callback callback)
{
xfer->pipe = pipe;
@@ -922,8 +922,8 @@ usbf_setup_xfer(usbf_xfer_handle xfer, usbf_pipe_handle pipe,
}
void
-usbf_setup_default_xfer(usbf_xfer_handle xfer, usbf_pipe_handle pipe,
- usbf_private_handle priv, usb_device_request_t *req, u_int16_t flags,
+usbf_setup_default_xfer(struct usbf_xfer *xfer, struct usbf_pipe *pipe,
+ void *priv, usb_device_request_t *req, u_int16_t flags,
u_int32_t timeout, usbf_callback callback)
{
xfer->pipe = pipe;
@@ -939,7 +939,7 @@ usbf_setup_default_xfer(usbf_xfer_handle xfer, usbf_pipe_handle pipe,
}
void
-usbf_get_xfer_status(usbf_xfer_handle xfer, usbf_private_handle *priv,
+usbf_get_xfer_status(struct usbf_xfer *xfer, void **priv,
void **buffer, u_int32_t *actlen, usbf_status *status)
{
if (priv != NULL)
@@ -953,9 +953,9 @@ usbf_get_xfer_status(usbf_xfer_handle xfer, usbf_private_handle *priv,
}
usbf_status
-usbf_transfer(usbf_xfer_handle xfer)
+usbf_transfer(struct usbf_xfer *xfer)
{
- usbf_pipe_handle pipe = xfer->pipe;
+ struct usbf_pipe *pipe = xfer->pipe;
usbf_status err;
err = pipe->methods->transfer(xfer);
@@ -969,9 +969,9 @@ usbf_transfer(usbf_xfer_handle xfer)
}
usbf_status
-usbf_insert_transfer(usbf_xfer_handle xfer)
+usbf_insert_transfer(struct usbf_xfer *xfer)
{
- usbf_pipe_handle pipe = xfer->pipe;
+ struct usbf_pipe *pipe = xfer->pipe;
usbf_status err;
int s;
@@ -991,9 +991,9 @@ usbf_insert_transfer(usbf_xfer_handle xfer)
}
void
-usbf_start_next(usbf_pipe_handle pipe)
+usbf_start_next(struct usbf_pipe *pipe)
{
- usbf_xfer_handle xfer;
+ struct usbf_xfer *xfer;
usbf_status err;
SPLUSBCHECK;
@@ -1014,9 +1014,9 @@ usbf_start_next(usbf_pipe_handle pipe)
/* Called at splusb() */
void
-usbf_transfer_complete(usbf_xfer_handle xfer)
+usbf_transfer_complete(struct usbf_xfer *xfer)
{
- usbf_pipe_handle pipe = xfer->pipe;
+ struct usbf_pipe *pipe = xfer->pipe;
int repeat = pipe->repeat;
SPLUSBCHECK;
diff --git a/sys/dev/usb/usbfvar.h b/sys/dev/usb/usbfvar.h
index f742181a2a9..7fc72e3176e 100644
--- a/sys/dev/usb/usbfvar.h
+++ b/sys/dev/usb/usbfvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbfvar.h,v 1.7 2009/11/04 19:14:10 kettenis Exp $ */
+/* $OpenBSD: usbfvar.h,v 1.8 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -58,7 +58,7 @@ struct usbf_device {
struct usbf_xfer *default_xfer; /* device request xfer */
struct usbf_xfer *data_xfer; /* request response xfer */
int address; /* assigned by host (or 0) */
- usbf_config_handle config; /* set by host (or NULL) */
+ struct usbf_config *config; /* set by host (or NULL) */
usb_status_t status; /* device status */
usb_device_request_t def_req; /* device request buffer */
struct usbf_endpoint def_ep; /* for pipe 0 */
@@ -73,18 +73,19 @@ struct usbf_device {
/*** software control structures ***/
struct usbf_pipe_methods {
- usbf_status (*transfer)(usbf_xfer_handle);
- usbf_status (*start)(usbf_xfer_handle);
- void (*abort)(usbf_xfer_handle);
- void (*done)(usbf_xfer_handle);
- void (*close)(usbf_pipe_handle);
+ usbf_status (*transfer)(struct usbf_xfer *);
+ usbf_status (*start)(struct usbf_xfer *);
+ void (*abort)(struct usbf_xfer *);
+ void (*done)(struct usbf_xfer *);
+ void (*close)(struct usbf_pipe *);
};
struct usbf_bus_methods {
usbf_status (*open_pipe)(struct usbf_pipe *);
void (*soft_intr)(void *);
- usbf_status (*allocm)(struct usbf_bus *, usb_dma_t *, u_int32_t);
- void (*freem)(struct usbf_bus *, usb_dma_t *);
+ usbf_status (*allocm)(struct usbf_bus *, struct usb_dma *,
+ u_int32_t);
+ void (*freem)(struct usbf_bus *, struct usb_dma *);
struct usbf_xfer *(*allocx)(struct usbf_bus *);
void (*freex)(struct usbf_bus *, struct usbf_xfer *);
};
@@ -130,7 +131,7 @@ struct usbf_pipe {
struct usbf_xfer {
struct usbf_pipe *pipe;
- usbf_private_handle priv;
+ void *priv;
void *buffer;
u_int32_t length;
u_int32_t actlen;
@@ -143,27 +144,26 @@ struct usbf_xfer {
/* for memory management */
struct usbf_device *device;
int rqflags;
- usb_dma_t dmabuf;
+ struct usb_dma dmabuf;
struct timeout timeout_handle;
};
/* usbf.c */
-void usbf_host_reset(usbf_bus_handle);
-void usbf_do_request(usbf_xfer_handle, usbf_private_handle,
- usbf_status);
+void usbf_host_reset(struct usbf_bus *);
+void usbf_do_request(struct usbf_xfer *, void *, usbf_status);
/* usbf_subr.c */
-usbf_status usbf_new_device(struct device *, usbf_bus_handle, int, int, int,
+usbf_status usbf_new_device(struct device *, struct usbf_bus *, int, int, int,
struct usbf_port *);
-usbf_status usbf_set_endpoint_feature(usbf_config_handle, u_int8_t,
+usbf_status usbf_set_endpoint_feature(struct usbf_config *, u_int8_t,
u_int16_t);
-usbf_status usbf_clear_endpoint_feature(usbf_config_handle, u_int8_t,
+usbf_status usbf_clear_endpoint_feature(struct usbf_config *, u_int8_t,
u_int16_t);
-usbf_status usbf_insert_transfer(usbf_xfer_handle xfer);
-void usbf_transfer_complete(usbf_xfer_handle xfer);
-usbf_status usbf_allocmem(usbf_bus_handle, size_t, size_t, usb_dma_t *);
-void usbf_freemem(usbf_bus_handle, usb_dma_t *);
+usbf_status usbf_insert_transfer(struct usbf_xfer *xfer);
+void usbf_transfer_complete(struct usbf_xfer *xfer);
+usbf_status usbf_allocmem(struct usbf_bus *, size_t, size_t, struct usb_dma *);
+void usbf_freemem(struct usbf_bus *, struct usb_dma *);
usbf_status usbf_softintr_establish(struct usbf_bus *);
void usbf_schedsoftintr(struct usbf_bus *);
diff --git a/sys/dev/usb/usbhid.h b/sys/dev/usb/usbhid.h
index af05a2c9ee6..7bcb7507f59 100644
--- a/sys/dev/usb/usbhid.h
+++ b/sys/dev/usb/usbhid.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbhid.h,v 1.14 2011/12/04 15:09:35 mpi Exp $ */
+/* $OpenBSD: usbhid.h,v 1.15 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: usbhid.h,v 1.11 2001/12/28 00:20:24 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbhid.h,v 1.7 1999/11/17 22:33:51 n_hibma Exp $ */
@@ -48,7 +48,7 @@
#define UR_GET_PROTOCOL 0x03
#define UR_SET_PROTOCOL 0x0b
-typedef struct usb_hid_descriptor {
+struct usb_hid_descriptor {
uByte bLength;
uByte bDescriptorType;
uWord bcdHID;
@@ -58,7 +58,7 @@ typedef struct usb_hid_descriptor {
uByte bDescriptorType;
uWord wDescriptorLength;
} descrs[1];
-} __packed usb_hid_descriptor_t;
+} __packed;
#define USB_HID_DESCRIPTOR_SIZE(n) (9+(n)*3)
/* Usage pages */
diff --git a/sys/dev/usb/uscanner.c b/sys/dev/usb/uscanner.c
index 963035de1ad..7cabf53865b 100644
--- a/sys/dev/usb/uscanner.c
+++ b/sys/dev/usb/uscanner.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uscanner.c,v 1.47 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: uscanner.c,v 1.48 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: uscanner.c,v 1.40 2003/01/27 00:32:44 wiz Exp $ */
/*
@@ -184,21 +184,21 @@ static const struct uscan_info uscanner_devs[] = {
struct uscanner_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
u_int sc_dev_flags;
- usbd_pipe_handle sc_bulkin_pipe;
+ struct usbd_pipe *sc_bulkin_pipe;
int sc_bulkin;
- usbd_xfer_handle sc_bulkin_xfer;
+ struct usbd_xfer *sc_bulkin_xfer;
void *sc_bulkin_buffer;
int sc_bulkin_bufferlen;
int sc_bulkin_datalen;
- usbd_pipe_handle sc_bulkout_pipe;
+ struct usbd_pipe *sc_bulkout_pipe;
int sc_bulkout;
- usbd_xfer_handle sc_bulkout_xfer;
+ struct usbd_xfer *sc_bulkout_xfer;
void *sc_bulkout_buffer;
int sc_bulkout_bufferlen;
int sc_bulkout_datalen;
diff --git a/sys/dev/usb/uslcom.c b/sys/dev/usb/uslcom.c
index 1ad89602853..e6f19b6d0e1 100644
--- a/sys/dev/usb/uslcom.c
+++ b/sys/dev/usb/uslcom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uslcom.c,v 1.27 2012/09/29 12:06:27 jsg Exp $ */
+/* $OpenBSD: uslcom.c,v 1.28 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -88,8 +88,8 @@ int uslcomdebug = 0;
struct uslcom_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
struct device *sc_subdev;
u_char sc_msr;
diff --git a/sys/dev/usb/usps.c b/sys/dev/usb/usps.c
index c9cd55d0d7a..c6ad21501f5 100644
--- a/sys/dev/usb/usps.c
+++ b/sys/dev/usb/usps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usps.c,v 1.2 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: usps.c,v 1.3 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2011 Yojiro UO <yuo@nui.org>
@@ -72,11 +72,11 @@ struct usps_port_sensor {
struct usps_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
- usbd_pipe_handle sc_ipipe;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
+ struct usbd_pipe *sc_ipipe;
int sc_isize;
- usbd_xfer_handle sc_xfer;
+ struct usbd_xfer *sc_xfer;
uint8_t sc_buf[16];
uint8_t *sc_intrbuf;
@@ -116,7 +116,7 @@ int usps_match(struct device *, void *, void *);
void usps_attach(struct device *, struct device *, void *);
int usps_detach(struct device *, int);
int usps_activate(struct device *, int);
-void usps_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void usps_intr(struct usbd_xfer *, void *, usbd_status);
usbd_status usps_cmd(struct usps_softc *, uint8_t, uint16_t, uint16_t);
usbd_status usps_set_measurement_mode(struct usps_softc *, int);
@@ -414,7 +414,7 @@ usps_set_measurement_mode(struct usps_softc *sc, int mode)
}
void
-usps_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+usps_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct usps_softc *sc = priv;
struct usps_port_pkt *pkt;
diff --git a/sys/dev/usb/uthum.c b/sys/dev/usb/uthum.c
index 58964efb87e..e5bf3825029 100644
--- a/sys/dev/usb/uthum.c
+++ b/sys/dev/usb/uthum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthum.c,v 1.18 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: uthum.c,v 1.19 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2009, 2010 Yojiro UO <yuo@nui.org>
@@ -115,7 +115,7 @@ struct uthum_sensor {
struct uthum_softc {
struct uhidev sc_hdev;
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
u_char sc_dying;
uint16_t sc_flag;
int sc_device_type;
@@ -203,7 +203,7 @@ uthum_attach(struct device *parent, struct device *self, void *aux)
struct uthum_softc *sc = (struct uthum_softc *)self;
struct usb_attach_arg *uaa = aux;
struct uhidev_attach_arg *uha = (struct uhidev_attach_arg *)uaa;
- usbd_device_handle dev = uha->parent->sc_udev;
+ struct usbd_device *dev = uha->parent->sc_udev;
int i, size, repid;
void *desc;
diff --git a/sys/dev/usb/uticom.c b/sys/dev/usb/uticom.c
index 2c2651a3ba6..be374862bb5 100644
--- a/sys/dev/usb/uticom.c
+++ b/sys/dev/usb/uticom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uticom.c,v 1.19 2013/04/12 12:58:39 mpi Exp $ */
+/* $OpenBSD: uticom.c,v 1.20 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2005 Dmitry Komissaroff <dxi@mail.ru>.
*
@@ -120,14 +120,14 @@ struct uticom_buf {
struct uticom_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev; /* device */
- usbd_interface_handle sc_iface; /* interface */
+ struct usbd_device *sc_udev; /* device */
+ struct usbd_interface *sc_iface; /* interface */
int sc_iface_number; /* interface number */
- usbd_interface_handle sc_intr_iface; /* interrupt interface */
+ struct usbd_interface *sc_intr_iface; /* interrupt interface */
int sc_intr_number; /* interrupt number */
- usbd_pipe_handle sc_intr_pipe; /* interrupt pipe */
+ struct usbd_pipe *sc_intr_pipe; /* interrupt pipe */
u_char *sc_intr_buf; /* interrupt buffer */
int sc_isize;
@@ -144,7 +144,7 @@ struct uticom_softc {
static usbd_status uticom_reset(struct uticom_softc *);
static usbd_status uticom_set_crtscts(struct uticom_softc *);
-static void uticom_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
+static void uticom_intr(struct usbd_xfer *, void *, usbd_status);
static void uticom_set(void *, int, int, int);
static void uticom_dtr(struct uticom_softc *, int);
@@ -161,7 +161,7 @@ static void uticom_close(void *, int);
void uticom_attach_hook(void *arg);
static int uticom_download_fw(struct uticom_softc *sc, int pipeno,
- usbd_device_handle dev);
+ struct usbd_device *dev);
struct ucom_methods uticom_methods = {
uticom_get_status,
@@ -216,7 +216,7 @@ uticom_attach(struct device *parent, struct device *self, void *aux)
{
struct uticom_softc *sc = (struct uticom_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
sc->sc_udev = dev;
sc->sc_iface = uaa->iface;
@@ -800,7 +800,7 @@ uticom_close(void *addr, int portno)
}
static void
-uticom_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+uticom_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct uticom_softc *sc = priv;
u_char *buf = sc->sc_intr_buf;
@@ -906,7 +906,7 @@ uticom_ioctl(void *addr, int portno, u_long cmd, caddr_t data, int flag,
static int
uticom_download_fw(struct uticom_softc *sc, int pipeno,
- usbd_device_handle dev)
+ struct usbd_device *dev)
{
u_char *obuf, *firmware;
size_t firmware_size;
@@ -914,9 +914,9 @@ uticom_download_fw(struct uticom_softc *sc, int pipeno,
uint8_t cs = 0, *buffer;
usbd_status err;
struct uticom_fw_header *header;
- usbd_xfer_handle oxfer = 0;
+ struct usbd_xfer *oxfer = 0;
usbd_status error = 0;
- usbd_pipe_handle pipe;
+ struct usbd_pipe *pipe;
error = loadfirmware("tusb3410", &firmware, &firmware_size);
if (error)
@@ -969,7 +969,7 @@ uticom_download_fw(struct uticom_softc *sc, int pipeno,
memcpy(obuf, buffer, buffer_size);
- usbd_setup_xfer(oxfer, pipe, (usbd_private_handle)sc, obuf, buffer_size,
+ usbd_setup_xfer(oxfer, pipe, (void *)sc, obuf, buffer_size,
USBD_NO_COPY | USBD_SYNCHRONOUS, USBD_NO_TIMEOUT, 0);
err = usbd_transfer(oxfer);
diff --git a/sys/dev/usb/utrh.c b/sys/dev/usb/utrh.c
index b4d18c54ff3..1e178d2f32b 100644
--- a/sys/dev/usb/utrh.c
+++ b/sys/dev/usb/utrh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utrh.c,v 1.9 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: utrh.c,v 1.10 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2009 Yojiro UO <yuo@nui.org>
@@ -54,7 +54,7 @@ int utrhdebug = 0;
struct utrh_softc {
struct uhidev sc_hdev;
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
u_char sc_dying;
uint16_t sc_flag;
@@ -116,7 +116,7 @@ utrh_attach(struct device *parent, struct device *self, void *aux)
struct utrh_softc *sc = (struct utrh_softc *)self;
struct usb_attach_arg *uaa = aux;
struct uhidev_attach_arg *uha = (struct uhidev_attach_arg *)uaa;
- usbd_device_handle dev = uha->parent->sc_udev;
+ struct usbd_device *dev = uha->parent->sc_udev;
int size, repid, err;
void *desc;
diff --git a/sys/dev/usb/uts.c b/sys/dev/usb/uts.c
index db956ec22e0..7d7aedf13bc 100644
--- a/sys/dev/usb/uts.c
+++ b/sys/dev/usb/uts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uts.c,v 1.30 2011/07/03 15:47:17 matthew Exp $ */
+/* $OpenBSD: uts.c,v 1.31 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2007 Robert Nagy <robert@openbsd.org>
@@ -62,14 +62,14 @@ struct tsscale {
struct uts_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
- usbd_interface_handle sc_iface;
+ struct usbd_device *sc_udev;
+ struct usbd_interface *sc_iface;
int sc_iface_number;
int sc_product;
int sc_vendor;
int sc_intr_number;
- usbd_pipe_handle sc_intr_pipe;
+ struct usbd_pipe *sc_intr_pipe;
u_char *sc_ibuf;
int sc_isize;
u_int8_t sc_pkts;
@@ -100,8 +100,8 @@ const struct usb_devno uts_devs[] = {
{ USB_VENDOR_GUNZE, USB_PRODUCT_GUNZE_TOUCHPANEL }
};
-void uts_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
-void uts_get_pos(usbd_private_handle addr, struct uts_pos *tp);
+void uts_intr(struct usbd_xfer *, void *, usbd_status);
+void uts_get_pos(void *addr, struct uts_pos *tp);
int uts_enable(void *);
void uts_disable(void *);
@@ -374,7 +374,7 @@ uts_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *l)
}
void
-uts_get_pos(usbd_private_handle addr, struct uts_pos *tp)
+uts_get_pos(void *addr, struct uts_pos *tp)
{
struct uts_softc *sc = addr;
u_char *p = sc->sc_ibuf;
@@ -449,7 +449,7 @@ uts_get_pos(usbd_private_handle addr, struct uts_pos *tp)
}
void
-uts_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
+uts_intr(struct usbd_xfer *xfer, void *addr, usbd_status status)
{
struct uts_softc *sc = addr;
u_int32_t len;
diff --git a/sys/dev/usb/utwitch.c b/sys/dev/usb/utwitch.c
index 200795676a1..e8288f9c24c 100644
--- a/sys/dev/usb/utwitch.c
+++ b/sys/dev/usb/utwitch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utwitch.c,v 1.6 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: utwitch.c,v 1.7 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2010 Yojiro UO <yuo@nui.org>
@@ -61,7 +61,7 @@ int utwitchdebug = 0;
struct utwitch_softc {
struct uhidev sc_hdev;
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
u_char sc_dying;
uint16_t sc_flag;
@@ -131,7 +131,7 @@ utwitch_attach(struct device *parent, struct device *self, void *aux)
struct utwitch_softc *sc = (struct utwitch_softc *)self;
struct usb_attach_arg *uaa = aux;
struct uhidev_attach_arg *uha = (struct uhidev_attach_arg *)uaa;
- usbd_device_handle dev = uha->parent->sc_udev;
+ struct usbd_device *dev = uha->parent->sc_udev;
int size, repid, err;
void *desc;
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index 85d9c49307b..d0a08b3d0c5 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.c,v 1.169 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: uvideo.c,v 1.170 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
@@ -94,8 +94,8 @@ usbd_status uvideo_vs_parse_desc_frame(struct uvideo_softc *);
usbd_status uvideo_vs_parse_desc_frame_sub(struct uvideo_softc *,
const usb_descriptor_t *);
usbd_status uvideo_vs_parse_desc_alt(struct uvideo_softc *, int, int, int);
-usbd_status uvideo_vs_set_alt(struct uvideo_softc *, usbd_interface_handle,
- int);
+usbd_status uvideo_vs_set_alt(struct uvideo_softc *,
+ struct usbd_interface *, int);
int uvideo_desc_len(const usb_descriptor_t *, int, int, int, int);
void uvideo_find_res(struct uvideo_softc *, int, int, int,
struct uvideo_res *);
@@ -117,7 +117,7 @@ void uvideo_vs_start_bulk_thread(void *);
void uvideo_vs_start_isoc(struct uvideo_softc *);
void uvideo_vs_start_isoc_ixfer(struct uvideo_softc *,
struct uvideo_isoc_xfer *);
-void uvideo_vs_cb(usbd_xfer_handle, usbd_private_handle,
+void uvideo_vs_cb(struct usbd_xfer *, void *,
usbd_status);
usbd_status uvideo_vs_decode_stream_header(struct uvideo_softc *,
uint8_t *, int);
@@ -578,7 +578,7 @@ uvideo_activate(struct device *self, int act)
usbd_status
uvideo_vc_parse_desc(struct uvideo_softc *sc)
{
- usbd_desc_iter_t iter;
+ struct usbd_desc_iter iter;
const usb_descriptor_t *desc;
int vc_header_found;
usbd_status error;
@@ -772,7 +772,7 @@ uvideo_has_ctrl(struct usb_video_vc_processing_desc *desc, int ctrl_bit)
usbd_status
uvideo_vs_parse_desc(struct uvideo_softc *sc, usb_config_descriptor_t *cdesc)
{
- usbd_desc_iter_t iter;
+ struct usbd_desc_iter iter;
const usb_descriptor_t *desc;
usb_interface_descriptor_t *id;
int i, iface, numalts;
@@ -868,7 +868,7 @@ uvideo_vs_parse_desc_input_header(struct uvideo_softc *sc,
usbd_status
uvideo_vs_parse_desc_format(struct uvideo_softc *sc)
{
- usbd_desc_iter_t iter;
+ struct usbd_desc_iter iter;
const usb_descriptor_t *desc;
DPRINTF(1, "%s: %s\n", DEVNAME(sc), __func__);
@@ -1006,7 +1006,7 @@ uvideo_vs_parse_desc_format_uncompressed(struct uvideo_softc *sc,
usbd_status
uvideo_vs_parse_desc_frame(struct uvideo_softc *sc)
{
- usbd_desc_iter_t iter;
+ struct usbd_desc_iter iter;
const usb_descriptor_t *desc;
usbd_status error;
@@ -1091,7 +1091,7 @@ usbd_status
uvideo_vs_parse_desc_alt(struct uvideo_softc *sc, int vs_nr, int iface, int numalts)
{
struct uvideo_vs_iface *vs;
- usbd_desc_iter_t iter;
+ struct usbd_desc_iter iter;
const usb_descriptor_t *desc;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
@@ -1158,10 +1158,10 @@ next:
}
usbd_status
-uvideo_vs_set_alt(struct uvideo_softc *sc, usbd_interface_handle ifaceh,
+uvideo_vs_set_alt(struct uvideo_softc *sc, struct usbd_interface *ifaceh,
int max_packet_size)
{
- usbd_desc_iter_t iter;
+ struct usbd_desc_iter iter;
const usb_descriptor_t *desc;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
@@ -1950,7 +1950,7 @@ uvideo_vs_start_isoc_ixfer(struct uvideo_softc *sc,
}
void
-uvideo_vs_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
+uvideo_vs_cb(struct usbd_xfer *xfer, void *priv,
usbd_status status)
{
struct uvideo_isoc_xfer *ixfer = priv;
@@ -2206,7 +2206,7 @@ uvideo_read(struct uvideo_softc *sc, uint8_t *buf, int len)
void
uvideo_dump_desc_all(struct uvideo_softc *sc)
{
- usbd_desc_iter_t iter;
+ struct usbd_desc_iter iter;
const usb_descriptor_t *desc;
usb_desc_iter_init(sc->sc_udev, &iter);
diff --git a/sys/dev/usb/uvideo.h b/sys/dev/usb/uvideo.h
index bd2727ab98c..6036228708e 100644
--- a/sys/dev/usb/uvideo.h
+++ b/sys/dev/usb/uvideo.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.h,v 1.54 2011/04/11 02:04:48 jakemsr Exp $ */
+/* $OpenBSD: uvideo.h,v 1.55 2013/04/15 09:23:02 mglocker Exp $ */
/*
* Copyright (c) 2007 Robert Nagy <robert@openbsd.org>
@@ -415,22 +415,22 @@ struct uvideo_format_desc {
#define UVIDEO_NFRAMES_MAX 40
struct uvideo_isoc_xfer {
struct uvideo_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
void *buf;
uint16_t size[UVIDEO_NFRAMES_MAX];
};
struct uvideo_bulk_xfer {
struct uvideo_softc *sc;
- usbd_xfer_handle xfer;
+ struct usbd_xfer *xfer;
void *buf;
uint16_t size;
};
#define UVIDEO_IXFERS 3
struct uvideo_vs_iface {
- usbd_interface_handle ifaceh;
- usbd_pipe_handle pipeh;
+ struct usbd_interface *ifaceh;
+ struct usbd_pipe *pipeh;
int iface;
int numalts;
int curalt;
@@ -661,9 +661,9 @@ struct uvideo_controls {
struct uvideo_softc {
struct device sc_dev;
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
int sc_nifaces;
- usbd_interface_handle *sc_ifaces;
+ struct usbd_interface **sc_ifaces;
struct device *sc_videodev;
diff --git a/sys/dev/usb/uvisor.c b/sys/dev/usb/uvisor.c
index ba57360c583..dc8684d07bd 100644
--- a/sys/dev/usb/uvisor.c
+++ b/sys/dev/usb/uvisor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvisor.c,v 1.45 2012/02/24 06:19:00 guenther Exp $ */
+/* $OpenBSD: uvisor.c,v 1.46 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: uvisor.c,v 1.21 2003/08/03 21:59:26 nathanw Exp $ */
/*
@@ -127,8 +127,8 @@ struct uvisor_palm_connection_info {
struct uvisor_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev; /* device */
- usbd_interface_handle sc_iface; /* interface */
+ struct usbd_device *sc_udev; /* device */
+ struct usbd_interface *sc_iface; /* interface */
/*
* added sc_vendor for later interrogation in failed initialisations
*/
@@ -232,8 +232,8 @@ uvisor_attach(struct device *parent, struct device *self, void *aux)
{
struct uvisor_softc *sc = (struct uvisor_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
- usbd_interface_handle iface;
+ struct usbd_device *dev = uaa->device;
+ struct usbd_interface *iface;
usb_interface_descriptor_t *id;
struct uvisor_connection_info coninfo;
struct uvisor_palm_connection_info palmconinfo;
diff --git a/sys/dev/usb/uvscom.c b/sys/dev/usb/uvscom.c
index ebe8bd5952d..c0610c82f14 100644
--- a/sys/dev/usb/uvscom.c
+++ b/sys/dev/usb/uvscom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvscom.c,v 1.26 2013/03/28 03:58:03 tedu Exp $ */
+/* $OpenBSD: uvscom.c,v 1.27 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: uvscom.c,v 1.9 2003/02/12 15:36:20 ichiro Exp $ */
/*-
* Copyright (c) 2001-2002, Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
@@ -130,13 +130,13 @@ static int uvscomdebug = 1;
struct uvscom_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev; /* USB device */
- usbd_interface_handle sc_iface; /* interface */
+ struct usbd_device *sc_udev; /* USB device */
+ struct usbd_interface *sc_iface; /* interface */
int sc_iface_number;/* interface number */
- usbd_interface_handle sc_intr_iface; /* interrupt interface */
+ struct usbd_interface *sc_intr_iface; /* interrupt interface */
int sc_intr_number; /* interrupt number */
- usbd_pipe_handle sc_intr_pipe; /* interrupt pipe */
+ struct usbd_pipe *sc_intr_pipe; /* interrupt pipe */
u_char *sc_intr_buf; /* interrupt buffer */
int sc_isize;
@@ -173,7 +173,7 @@ void uvscom_rts(struct uvscom_softc *, int);
void uvscom_break(struct uvscom_softc *, int);
void uvscom_set(void *, int, int, int);
-void uvscom_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
+void uvscom_intr(struct usbd_xfer *, void *, usbd_status);
int uvscom_param(void *, int, struct termios *);
int uvscom_open(void *, int);
void uvscom_close(void *, int);
@@ -238,7 +238,7 @@ uvscom_attach(struct device *parent, struct device *self, void *aux)
{
struct uvscom_softc *sc = (struct uvscom_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
usb_config_descriptor_t *cdesc;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
@@ -793,7 +793,7 @@ uvscom_close(void *addr, int portno)
}
void
-uvscom_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
+uvscom_intr(struct usbd_xfer *xfer, void *priv, usbd_status status)
{
struct uvscom_softc *sc = priv;
u_char *buf = sc->sc_intr_buf;
diff --git a/sys/dev/usb/uyap.c b/sys/dev/usb/uyap.c
index a5ce28e5c25..e30861896b6 100644
--- a/sys/dev/usb/uyap.c
+++ b/sys/dev/usb/uyap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uyap.c,v 1.19 2011/07/03 15:47:18 matthew Exp $ */
+/* $OpenBSD: uyap.c,v 1.20 2013/04/15 09:23:02 mglocker Exp $ */
/* $NetBSD: uyap.c,v 1.6 2002/07/11 21:14:37 augustss Exp $ */
/*
@@ -45,7 +45,7 @@
struct uyap_softc {
struct device sc_dev; /* base device */
- usbd_device_handle sc_udev;
+ struct usbd_device *sc_udev;
};
int uyap_match(struct device *, void *, void *);
@@ -105,7 +105,7 @@ uyap_attach(struct device *parent, struct device *self, void *aux)
{
struct uyap_softc *sc = (struct uyap_softc *)self;
struct usb_attach_arg *uaa = aux;
- usbd_device_handle dev = uaa->device;
+ struct usbd_device *dev = uaa->device;
printf("%s: downloading firmware\n", sc->sc_dev.dv_xname);