Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7-nhusb]: src/sys/arch Adapt to branch
details: https://anonhg.NetBSD.org/src/rev/5848cf2ec6cd
branches: netbsd-7-nhusb
changeset: 801037:5848cf2ec6cd
user: skrll <skrll%NetBSD.org@localhost>
date: Mon Jan 23 08:02:54 2017 +0000
description:
Adapt to branch
diffstat:
sys/arch/amiga/dev/slhci_zbus.c | 6 +-
sys/arch/mips/adm5120/dev/ahci.c | 927 ++++++++++++-----------------------
sys/arch/mips/adm5120/dev/ahcivar.h | 18 +-
sys/arch/mips/conf/files.adm5120 | 4 +-
4 files changed, 337 insertions(+), 618 deletions(-)
diffs (truncated from 1744 to 300 lines):
diff -r 7b40d02ed853 -r 5848cf2ec6cd sys/arch/amiga/dev/slhci_zbus.c
--- a/sys/arch/amiga/dev/slhci_zbus.c Thu Jan 19 06:45:33 2017 +0000
+++ b/sys/arch/amiga/dev/slhci_zbus.c Mon Jan 23 08:02:54 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: slhci_zbus.c,v 1.1 2013/04/27 22:27:33 rkujawa Exp $ */
+/* $NetBSD: slhci_zbus.c,v 1.1.20.1 2017/01/23 08:02:54 skrll Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: slhci_zbus.c,v 1.1 2013/04/27 22:27:33 rkujawa Exp $");
+__KERNEL_RCSID(0, "$NetBSD: slhci_zbus.c,v 1.1.20.1 2017/01/23 08:02:54 skrll Exp $");
/*
* Thylacine driver.
@@ -100,7 +100,7 @@
zsc = device_private(self);
sc = &zsc->sc_sc;
sc->sc_dev = self;
- sc->sc_bus.hci_private = sc;
+ sc->sc_bus.ub_hcpriv = sc;
zsc->sc_bst.base = (bus_addr_t)zap->va;
zsc->sc_bst.absm = &amiga_bus_stride_1;
diff -r 7b40d02ed853 -r 5848cf2ec6cd sys/arch/mips/adm5120/dev/ahci.c
--- a/sys/arch/mips/adm5120/dev/ahci.c Thu Jan 19 06:45:33 2017 +0000
+++ b/sys/arch/mips/adm5120/dev/ahci.c Mon Jan 23 08:02:54 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ahci.c,v 1.12.10.1 2016/09/06 20:33:07 skrll Exp $ */
+/* $NetBSD: ahci.c,v 1.12.10.2 2017/01/23 08:02:54 skrll Exp $ */
/*-
* Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -64,14 +64,14 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.12.10.1 2016/09/06 20:33:07 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.12.10.2 2017/01/23 08:02:54 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <sys/bus.h>
#include <machine/cpu.h>
@@ -81,6 +81,7 @@
#include <dev/usb/usbdivar.h>
#include <dev/usb/usb_mem.h>
#include <dev/usb/usbdevs.h>
+#include <dev/usb/usbroothub.h>
#include <mips/adm5120/include/adm5120reg.h>
#include <mips/adm5120/include/adm5120var.h>
@@ -89,61 +90,54 @@
#include <mips/adm5120/dev/ahcireg.h>
#include <mips/adm5120/dev/ahcivar.h>
-static usbd_status ahci_open(usbd_pipe_handle);
+static usbd_status ahci_open(struct usbd_pipe *);
static void ahci_softintr(void *);
static void ahci_poll(struct usbd_bus *);
static void ahci_poll_hub(void *);
static void ahci_poll_device(void *arg);
-static usbd_status ahci_allocm(struct usbd_bus *, usb_dma_t *, u_int32_t);
-static void ahci_freem(struct usbd_bus *, usb_dma_t *);
-static usbd_xfer_handle ahci_allocx(struct usbd_bus *);
-static void ahci_freex(struct usbd_bus *, usbd_xfer_handle);
+static struct usbd_xfer *
+ ahci_allocx(struct usbd_bus *, unsigned int);
+static void ahci_freex(struct usbd_bus *, struct usbd_xfer *);
static void ahci_get_lock(struct usbd_bus *, kmutex_t **);
-
-static int ahci_str(usb_string_descriptor_t *, int, const char *);
+static int ahci_roothub_ctrl(struct usbd_bus *, usb_device_request_t *,
+ void *, int);
-static usbd_status ahci_root_ctrl_transfer(usbd_xfer_handle);
-static usbd_status ahci_root_ctrl_start(usbd_xfer_handle);
-static void ahci_root_ctrl_abort(usbd_xfer_handle);
-static void ahci_root_ctrl_close(usbd_pipe_handle);
-static void ahci_root_ctrl_done(usbd_xfer_handle);
+static usbd_status ahci_root_intr_transfer(struct usbd_xfer *);
+static usbd_status ahci_root_intr_start(struct usbd_xfer *);
+static void ahci_root_intr_abort(struct usbd_xfer *);
+static void ahci_root_intr_close(struct usbd_pipe *);
+static void ahci_root_intr_done(struct usbd_xfer *);
-static usbd_status ahci_root_intr_transfer(usbd_xfer_handle);
-static usbd_status ahci_root_intr_start(usbd_xfer_handle);
-static void ahci_root_intr_abort(usbd_xfer_handle);
-static void ahci_root_intr_close(usbd_pipe_handle);
-static void ahci_root_intr_done(usbd_xfer_handle);
+static usbd_status ahci_device_ctrl_transfer(struct usbd_xfer *);
+static usbd_status ahci_device_ctrl_start(struct usbd_xfer *);
+static void ahci_device_ctrl_abort(struct usbd_xfer *);
+static void ahci_device_ctrl_close(struct usbd_pipe *);
+static void ahci_device_ctrl_done(struct usbd_xfer *);
-static usbd_status ahci_device_ctrl_transfer(usbd_xfer_handle);
-static usbd_status ahci_device_ctrl_start(usbd_xfer_handle);
-static void ahci_device_ctrl_abort(usbd_xfer_handle);
-static void ahci_device_ctrl_close(usbd_pipe_handle);
-static void ahci_device_ctrl_done(usbd_xfer_handle);
-
-static usbd_status ahci_device_intr_transfer(usbd_xfer_handle);
-static usbd_status ahci_device_intr_start(usbd_xfer_handle);
-static void ahci_device_intr_abort(usbd_xfer_handle);
-static void ahci_device_intr_close(usbd_pipe_handle);
-static void ahci_device_intr_done(usbd_xfer_handle);
+static usbd_status ahci_device_intr_transfer(struct usbd_xfer *);
+static usbd_status ahci_device_intr_start(struct usbd_xfer *);
+static void ahci_device_intr_abort(struct usbd_xfer *);
+static void ahci_device_intr_close(struct usbd_pipe *);
+static void ahci_device_intr_done(struct usbd_xfer *);
-static usbd_status ahci_device_isoc_transfer(usbd_xfer_handle);
-static usbd_status ahci_device_isoc_start(usbd_xfer_handle);
-static void ahci_device_isoc_abort(usbd_xfer_handle);
-static void ahci_device_isoc_close(usbd_pipe_handle);
-static void ahci_device_isoc_done(usbd_xfer_handle);
+static usbd_status ahci_device_isoc_transfer(struct usbd_xfer *);
+static usbd_status ahci_device_isoc_start(struct usbd_xfer *);
+static void ahci_device_isoc_abort(struct usbd_xfer *);
+static void ahci_device_isoc_close(struct usbd_pipe *);
+static void ahci_device_isoc_done(struct usbd_xfer *);
-static usbd_status ahci_device_bulk_transfer(usbd_xfer_handle);
-static usbd_status ahci_device_bulk_start(usbd_xfer_handle);
-static void ahci_device_bulk_abort(usbd_xfer_handle);
-static void ahci_device_bulk_close(usbd_pipe_handle);
-static void ahci_device_bulk_done(usbd_xfer_handle);
+static usbd_status ahci_device_bulk_transfer(struct usbd_xfer *);
+static usbd_status ahci_device_bulk_start(struct usbd_xfer *);
+static void ahci_device_bulk_abort(struct usbd_xfer *);
+static void ahci_device_bulk_close(struct usbd_pipe *);
+static void ahci_device_bulk_done(struct usbd_xfer *);
static int ahci_transaction(struct ahci_softc *,
- usbd_pipe_handle, u_int8_t, int, u_char *, u_int8_t);
-static void ahci_noop(usbd_pipe_handle);
-static void ahci_abort_xfer(usbd_xfer_handle, usbd_status);
-static void ahci_device_clear_toggle(usbd_pipe_handle);
+ struct usbd_pipe *, uint8_t, int, u_char *, uint8_t);
+static void ahci_noop(struct usbd_pipe *);
+static void ahci_abort_xfer(struct usbd_xfer *, usbd_status);
+static void ahci_device_clear_toggle(struct usbd_pipe *);
extern int usbdebug;
extern int uhubdebug;
@@ -152,9 +146,6 @@
#define AHCI_DEBUG
-/* For root hub */
-#define AHCI_INTR_ENDPT (1)
-
#ifdef AHCI_DEBUG
#define D_TRACE (0x0001) /* function trace */
#define D_MSG (0x0002) /* debug messages */
@@ -166,80 +157,70 @@
void print_req(usb_device_request_t *);
void print_req_hub(usb_device_request_t *);
void print_dumpreg(struct ahci_softc *);
-void print_xfer(usbd_xfer_handle);
+void print_xfer(struct usbd_xfer *);
#else
#define DPRINTF(z,x)
#endif
struct usbd_bus_methods ahci_bus_methods = {
- .open_pipe = ahci_open,
- .soft_intr = ahci_softintr,
- .do_poll = ahci_poll,
- .allocm = ahci_allocm,
- .freem = ahci_freem,
- .allocx = ahci_allocx,
- .freex = ahci_freex,
- .get_lock = ahci_get_lock,
-};
-
-struct usbd_pipe_methods ahci_root_ctrl_methods = {
- .transfer = ahci_root_ctrl_transfer,
- .start = ahci_root_ctrl_start,
- .abort = ahci_root_ctrl_abort,
- .close = ahci_root_ctrl_close,
- .cleartoggle = ahci_noop,
- .done = ahci_root_ctrl_done,
+ .ubm_open = ahci_open,
+ .ubm_softint = ahci_softintr,
+ .ubm_dopoll = ahci_poll,
+ .ubm_allocx = ahci_allocx,
+ .ubm_freex = ahci_freex,
+ .ubm_getlock = ahci_get_lock,
+ .ubm_rhctrl = ahci_roothub_ctrl,
};
struct usbd_pipe_methods ahci_root_intr_methods = {
- .transfer = ahci_root_intr_transfer,
- .start = ahci_root_intr_start,
- .abort = ahci_root_intr_abort,
- .close = ahci_root_intr_close,
- .cleartoggle = ahci_noop,
- .done = ahci_root_intr_done,
+ .upm_transfer = ahci_root_intr_transfer,
+ .upm_start = ahci_root_intr_start,
+ .upm_abort = ahci_root_intr_abort,
+ .upm_close = ahci_root_intr_close,
+ .upm_cleartoggle = ahci_noop,
+ .upm_done = ahci_root_intr_done,
};
struct usbd_pipe_methods ahci_device_ctrl_methods = {
- .transfer = ahci_device_ctrl_transfer,
- .start = ahci_device_ctrl_start,
- .abort = ahci_device_ctrl_abort,
- .close = ahci_device_ctrl_close,
- .cleartoggle = ahci_noop,
- .done = ahci_device_ctrl_done,
+ .upm_transfer = ahci_device_ctrl_transfer,
+ .upm_start = ahci_device_ctrl_start,
+ .upm_abort = ahci_device_ctrl_abort,
+ .upm_close = ahci_device_ctrl_close,
+ .upm_cleartoggle = ahci_noop,
+ .upm_done = ahci_device_ctrl_done,
};
struct usbd_pipe_methods ahci_device_intr_methods = {
- .transfer = ahci_device_intr_transfer,
- .start = ahci_device_intr_start,
- .abort = ahci_device_intr_abort,
- .close = ahci_device_intr_close,
- .cleartoggle = ahci_device_clear_toggle,
- .done = ahci_device_intr_done,
+ .upm_transfer = ahci_device_intr_transfer,
+ .upm_start = ahci_device_intr_start,
+ .upm_abort = ahci_device_intr_abort,
+ .upm_close = ahci_device_intr_close,
+ .upm_cleartoggle = ahci_device_clear_toggle,
+ .upm_done = ahci_device_intr_done,
};
struct usbd_pipe_methods ahci_device_isoc_methods = {
- .transfer = ahci_device_isoc_transfer,
- .start = ahci_device_isoc_start,
- .abort = ahci_device_isoc_abort,
- .close = ahci_device_isoc_close,
- .cleartoggle = ahci_noop,
- .done = ahci_device_isoc_done,
+ .upm_transfer = ahci_device_isoc_transfer,
+ .upm_start = ahci_device_isoc_start,
+ .upm_abort = ahci_device_isoc_abort,
+ .upm_close = ahci_device_isoc_close,
+ .upm_cleartoggle = ahci_noop,
+ .upm_done = ahci_device_isoc_done,
};
struct usbd_pipe_methods ahci_device_bulk_methods = {
- .transfer = ahci_device_bulk_transfer,
- .start = ahci_device_bulk_start,
- .abort = ahci_device_bulk_abort,
- .close = ahci_device_bulk_close,
- .cleartoggle = ahci_device_clear_toggle,
- .done = ahci_device_bulk_done,
+ .upm_transfer = ahci_device_bulk_transfer,
+ .upm_start = ahci_device_bulk_start,
+ .upm_abort = ahci_device_bulk_abort,
+ .upm_close = ahci_device_bulk_close,
+ .upm_cleartoggle = ahci_device_clear_toggle,
+ .upm_done = ahci_device_bulk_done,
};
struct ahci_pipe {
struct usbd_pipe pipe;
- u_int32_t toggle;
+ uint32_t toggle;
};
static int ahci_match(device_t, cfdata_t, void *);
@@ -254,9 +235,9 @@
struct obio_attach_args *aa = aux;
if (strcmp(aa->oba_name, cf->cf_name) == 0)
- return (1);
+ return 1;
- return (0);
+ return 0;
}
#define REG_READ(o) bus_space_read_4(sc->sc_st, sc->sc_ioh, (o))
Home |
Main Index |
Thread Index |
Old Index