summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2014-07-10 08:45:18 +0000
committermpi <mpi@openbsd.org>2014-07-10 08:45:18 +0000
commit9606a15dbc0c83e2301ee6c2a8b4d92efef4b40a (patch)
treebe795a767b851ed9adc323b8c360748ae149a9be
parentKNF comments, reflowing and moving out of the middle of argument lists in (diff)
downloadwireguard-openbsd-9606a15dbc0c83e2301ee6c2a8b4d92efef4b40a.tar.xz
wireguard-openbsd-9606a15dbc0c83e2301ee6c2a8b4d92efef4b40a.zip
Align octhci(4) with the other HC drivers and add it as a commented entry
to GENERIC. ok pirofti@
-rw-r--r--sys/arch/octeon/conf/GENERIC12
-rw-r--r--sys/arch/octeon/dev/octhci.c82
2 files changed, 30 insertions, 64 deletions
diff --git a/sys/arch/octeon/conf/GENERIC b/sys/arch/octeon/conf/GENERIC
index df87077ca42..c4aa7e4ee68 100644
--- a/sys/arch/octeon/conf/GENERIC
+++ b/sys/arch/octeon/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.14 2014/06/10 12:41:10 jasper Exp $
+# $OpenBSD: GENERIC,v 1.15 2014/07/10 08:45:18 mpi Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -58,3 +58,13 @@ pciide* at pci? flags 0x0000
# IDE hard drives
wd* at pciide? flags 0x0000
+
+# USB Controllers
+#octhci* at iobus?
+
+# USB bus support
+#usb* at octhci?
+
+# USB devices
+#uhub* at usb? # USB Hubs
+
diff --git a/sys/arch/octeon/dev/octhci.c b/sys/arch/octeon/dev/octhci.c
index 6e3d2629bd4..d8f10343670 100644
--- a/sys/arch/octeon/dev/octhci.c
+++ b/sys/arch/octeon/dev/octhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: octhci.c,v 1.1 2014/07/09 23:03:22 pirofti Exp $ */
+/* $OpenBSD: octhci.c,v 1.2 2014/07/10 08:45:18 mpi Exp $ */
/*
* Copyright (c) 2014 Paul Irofti <pirofti@openbsd.org>
@@ -40,9 +40,7 @@
#endif
struct octhci_softc {
- struct device sc_dev;
struct usbd_bus sc_bus; /* base device */
- struct device *sc_child; /* /dev/usb# device */
void *sc_ih; /* interrupt handler */
@@ -86,35 +84,6 @@ struct octhci_soft_td {
int islot;
};
-struct octhci_pipe {
- struct usbd_pipe pipe;
-
- struct octhci_soft_qh *sqh;
- union {
- struct octhci_soft_td *td;
- } tail;
- union {
- /* Control pipe */
- struct {
- struct usb_dma reqdma;
- u_int length;
- } ctl;
- /* Interrupt pipe */
- struct {
- u_int length;
- } intr;
- /* Bulk pipe */
- struct {
- u_int length;
- } bulk;
- /* Iso pipe */
- struct {
- u_int next_frame;
- u_int cur_xfers;
- } isoc;
- } u;
-};
-
usbd_status octhci_open(struct usbd_pipe *pipe);
void octhci_softintr(void *);
void octhci_poll(struct usbd_bus *);
@@ -122,11 +91,11 @@ struct usbd_xfer * octhci_allocx(struct usbd_bus *);
void octhci_freex(struct usbd_bus *, struct usbd_xfer *);
struct usbd_bus_methods octhci_bus_methods = {
- octhci_open,
- octhci_softintr,
- octhci_poll,
- octhci_allocx,
- octhci_freex,
+ .open_pipe = octhci_open,
+ .soft_intr = octhci_softintr,
+ .do_poll = octhci_poll,
+ .allocx = octhci_allocx,
+ .freex = octhci_freex,
};
#define OCTHCI_INTR_ENDPT 1
@@ -134,16 +103,14 @@ usbd_status octhci_root_ctrl_transfer(struct usbd_xfer *xfer);
usbd_status octhci_root_ctrl_start(struct usbd_xfer *xfer);
void octhci_root_ctrl_abort(struct usbd_xfer *xfer);
void octhci_root_ctrl_close(struct usbd_pipe *pipe);
-void octhci_root_ctrl_cleartoggle(struct usbd_pipe *pipe);
void octhci_root_ctrl_done(struct usbd_xfer *xfer);
struct usbd_pipe_methods octhci_root_ctrl_methods = {
- octhci_root_ctrl_transfer,
- octhci_root_ctrl_start,
- octhci_root_ctrl_abort,
- octhci_root_ctrl_close,
- octhci_root_ctrl_cleartoggle,
- octhci_root_ctrl_done,
+ .transfer = octhci_root_ctrl_transfer,
+ .start = octhci_root_ctrl_start,
+ .abort = octhci_root_ctrl_abort,
+ .close = octhci_root_ctrl_close,
+ .done = octhci_root_ctrl_done,
};
@@ -151,16 +118,14 @@ usbd_status octhci_root_intr_transfer(struct usbd_xfer *xfer);
usbd_status octhci_root_intr_start(struct usbd_xfer *xfer);
void octhci_root_intr_abort(struct usbd_xfer *xfer);
void octhci_root_intr_close(struct usbd_pipe *pipe);
-void octhci_root_intr_cleartoggle(struct usbd_pipe *pipe);
void octhci_root_intr_done(struct usbd_xfer *xfer);
struct usbd_pipe_methods octhci_root_intr_methods = {
- octhci_root_intr_transfer,
- octhci_root_intr_start,
- octhci_root_intr_abort,
- octhci_root_intr_close,
- octhci_root_intr_cleartoggle,
- octhci_root_intr_done,
+ .transfer = octhci_root_intr_transfer,
+ .start = octhci_root_intr_start,
+ .abort = octhci_root_intr_abort,
+ .close = octhci_root_intr_close,
+ .done = octhci_root_intr_done,
};
@@ -227,9 +192,10 @@ octhci_attach(struct device *parent, struct device *self, void *aux)
* sc->sc_bus.usbrev = USBREV_2_0;
*/
sc->sc_bus.methods = &octhci_bus_methods;
- sc->sc_bus.pipe_size = sizeof(struct octhci_pipe);
+ sc->sc_bus.pipe_size = sizeof(struct usbd_pipe);
sc->sc_bus.dmatag = aa->aa_dmat;
- sc->sc_child = config_found((void *)sc, &sc->sc_bus, usbctlprint);
+
+ config_found((void *)sc, &sc->sc_bus, usbctlprint);
}
void
@@ -544,11 +510,6 @@ octhci_root_ctrl_close(struct usbd_pipe *pipe)
}
void
-octhci_root_ctrl_cleartoggle(struct usbd_pipe *pipe)
-{
-}
-
-void
octhci_root_ctrl_done(struct usbd_xfer *xfer)
{
}
@@ -580,11 +541,6 @@ octhci_root_intr_close(struct usbd_pipe *pipe)
}
void
-octhci_root_intr_cleartoggle(struct usbd_pipe *pipe)
-{
-}
-
-void
octhci_root_intr_done(struct usbd_xfer *xfer)
{
}