Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Add some useful macros.



details:   https://anonhg.NetBSD.org/src/rev/f8bff8abceeb
branches:  trunk
changeset: 517056:f8bff8abceeb
user:      augustss <augustss%NetBSD.org@localhost>
date:      Tue Nov 06 03:16:17 2001 +0000

description:
Add some useful macros.

diffstat:

 sys/dev/usb/ehcivar.h |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (31 lines):

diff -r 9a97e9bb2651 -r f8bff8abceeb sys/dev/usb/ehcivar.h
--- a/sys/dev/usb/ehcivar.h     Tue Nov 06 03:11:10 2001 +0000
+++ b/sys/dev/usb/ehcivar.h     Tue Nov 06 03:16:17 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehcivar.h,v 1.1 2000/12/24 06:39:02 augustss Exp $     */
+/*     $NetBSD: ehcivar.h,v 1.2 2001/11/06 03:16:17 augustss Exp $     */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -41,6 +41,7 @@
        bus_space_tag_t iot;
        bus_space_handle_t ioh;
        bus_size_t sc_size;
+       u_int sc_offs;                  /* offset to operational regs */
 
        char sc_vendor[16];             /* vendor string for root hub */
        int sc_id_vendor;               /* vendor ID for root hub */
@@ -51,6 +52,13 @@
        device_ptr_t sc_child;          /* /dev/usb# device */
 } ehci_softc_t;
 
+#define EOREAD1(sc, a) bus_space_read_1((sc)->iot, (sc)->ioh, (sc)->sc_offs+(a))
+#define EOREAD2(sc, a) bus_space_read_2((sc)->iot, (sc)->ioh, (sc)->sc_offs+(a))
+#define EOREAD4(sc, a) bus_space_read_4((sc)->iot, (sc)->ioh, (sc)->sc_offs+(a))
+#define EOWRITE1(sc, a, x) bus_space_write_1((sc)->iot, (sc)->ioh, (sc)->sc_offs+(a), (x))
+#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 *);
 int            ehci_intr(void *);
 int            ehci_detach(ehci_softc_t *, int);



Home | Main Index | Thread Index | Old Index