Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/cardbus Start to tuck Cardbus under the PCI abstract...
details: https://anonhg.NetBSD.org/src/rev/e3e9f82fe675
branches: trunk
changeset: 752378:e3e9f82fe675
user: dyoung <dyoung%NetBSD.org@localhost>
date: Wed Feb 24 19:52:51 2010 +0000
description:
Start to tuck Cardbus under the PCI abstraction. Step #1, textual
substitution: for all practical purposes, pcitag_t and cardbustag_t
are interchangeable, so just use pcitag_t. Ditto pcireg_t and
cardbusreg_t.
While I'm here, don't make a copy (sc_intrline) of
cardbus_attach_args.ca_intrline unless we use it, later.
diffstat:
sys/dev/cardbus/adv_cardbus.c | 8 +++-----
sys/dev/cardbus/ahc_cardbus.c | 8 +++-----
sys/dev/cardbus/cardbus_exrom.c | 8 ++++----
sys/dev/cardbus/cardbus_map.c | 38 +++++++++++++++++++-------------------
sys/dev/cardbus/com_cardbus.c | 18 +++++++++---------
sys/dev/cardbus/ehci_cardbus.c | 10 +++++-----
sys/dev/cardbus/fwohci_cardbus.c | 6 +++---
sys/dev/cardbus/if_ath_cardbus.c | 10 +++++-----
sys/dev/cardbus/if_ex_cardbus.c | 8 ++++----
sys/dev/cardbus/if_ral_cardbus.c | 6 +++---
sys/dev/cardbus/if_re_cardbus.c | 6 +++---
sys/dev/cardbus/if_rtk_cardbus.c | 6 +++---
sys/dev/cardbus/if_tlp_cardbus.c | 6 +++---
sys/dev/cardbus/njata_cardbus.c | 8 +++-----
sys/dev/cardbus/njs_cardbus.c | 8 +++-----
sys/dev/cardbus/ohci_cardbus.c | 6 +++---
sys/dev/cardbus/rbus_ppb.c | 8 ++++----
sys/dev/cardbus/siisata_cardbus.c | 12 ++++++------
sys/dev/cardbus/uhci_cardbus.c | 10 +++++-----
19 files changed, 91 insertions(+), 99 deletions(-)
diffs (truncated from 784 to 300 lines):
diff -r c87102fd37b1 -r e3e9f82fe675 sys/dev/cardbus/adv_cardbus.c
--- a/sys/dev/cardbus/adv_cardbus.c Wed Feb 24 19:20:13 2010 +0000
+++ b/sys/dev/cardbus/adv_cardbus.c Wed Feb 24 19:52:51 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adv_cardbus.c,v 1.22 2009/05/12 14:17:31 cegger Exp $ */
+/* $NetBSD: adv_cardbus.c,v 1.23 2010/02/24 19:52:51 dyoung Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adv_cardbus.c,v 1.22 2009/05/12 14:17:31 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adv_cardbus.c,v 1.23 2010/02/24 19:52:51 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -74,8 +74,7 @@
/* CardBus-specific goo. */
cardbus_devfunc_t sc_ct; /* our CardBus devfuncs */
- cardbus_intr_line_t sc_intrline; /* our interrupt line */
- cardbustag_t sc_tag;
+ pcitag_t sc_tag;
int sc_cbenable; /* what CardBus access type to enable */
int sc_csr; /* CSR bits */
@@ -151,7 +150,6 @@
csc->sc_ct = ct;
csc->sc_tag = ca->ca_tag;
- csc->sc_intrline = ca->ca_intrline;
csc->sc_cbenable = 0;
/*
diff -r c87102fd37b1 -r e3e9f82fe675 sys/dev/cardbus/ahc_cardbus.c
--- a/sys/dev/cardbus/ahc_cardbus.c Wed Feb 24 19:20:13 2010 +0000
+++ b/sys/dev/cardbus/ahc_cardbus.c Wed Feb 24 19:52:51 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ahc_cardbus.c,v 1.29 2009/11/12 19:21:03 dyoung Exp $ */
+/* $NetBSD: ahc_cardbus.c,v 1.30 2010/02/24 19:52:51 dyoung Exp $ */
/*-
* Copyright (c) 2000, 2005 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.29 2009/11/12 19:21:03 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.30 2010/02/24 19:52:51 dyoung Exp $");
#include "opt_ahc_cardbus.h"
@@ -77,8 +77,7 @@
/* CardBus-specific goo. */
cardbus_devfunc_t sc_ct; /* our CardBus devfuncs */
- cardbus_intr_line_t sc_intrline; /* our interrupt line */
- cardbustag_t sc_tag;
+ pcitag_t sc_tag;
int sc_cbenable; /* what CardBus access type to enable */
int sc_csr; /* CSR bits */
@@ -123,7 +122,6 @@
ahc->sc_dev = self;
csc->sc_ct = ct;
csc->sc_tag = ca->ca_tag;
- csc->sc_intrline = ca->ca_intrline;
printf(": Adaptec ADP-1480 SCSI\n");
diff -r c87102fd37b1 -r e3e9f82fe675 sys/dev/cardbus/cardbus_exrom.c
--- a/sys/dev/cardbus/cardbus_exrom.c Wed Feb 24 19:20:13 2010 +0000
+++ b/sys/dev/cardbus/cardbus_exrom.c Wed Feb 24 19:52:51 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cardbus_exrom.c,v 1.11 2008/04/29 06:53:02 martin Exp $ */
+/* $NetBSD: cardbus_exrom.c,v 1.12 2010/02/24 19:52:51 dyoung Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cardbus_exrom.c,v 1.11 2008/04/29 06:53:02 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cardbus_exrom.c,v 1.12 2010/02/24 19:52:51 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -147,10 +147,10 @@
#if 0
struct cardbus_exrom_data_structure {
char signature[4];
- cardbusreg_t id; /* vendor & device id */
+ pcireg_t id; /* vendor & device id */
u_int16_t structure_length;
u_int8_t structure_revision;
- cardbusreg_t class; /* class code in upper 24 bits */
+ pcireg_t class; /* class code in upper 24 bits */
u_int16_t image_length;
u_int16_t data_revision;
u_int8_t code_type;
diff -r c87102fd37b1 -r e3e9f82fe675 sys/dev/cardbus/cardbus_map.c
--- a/sys/dev/cardbus/cardbus_map.c Wed Feb 24 19:20:13 2010 +0000
+++ b/sys/dev/cardbus/cardbus_map.c Wed Feb 24 19:52:51 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cardbus_map.c,v 1.31 2009/12/15 22:17:12 snj Exp $ */
+/* $NetBSD: cardbus_map.c,v 1.32 2010/02/24 19:52:51 dyoung Exp $ */
/*
* Copyright (c) 1999 and 2000
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cardbus_map.c,v 1.31 2009/12/15 22:17:12 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cardbus_map.c,v 1.32 2010/02/24 19:52:51 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -53,16 +53,16 @@
static int cardbus_io_find(cardbus_chipset_tag_t, cardbus_function_tag_t,
- cardbustag_t, int, cardbusreg_t,
+ pcitag_t, int, pcireg_t,
bus_addr_t *, bus_size_t *, int *);
static int cardbus_mem_find(cardbus_chipset_tag_t, cardbus_function_tag_t,
- cardbustag_t, int, cardbusreg_t,
+ pcitag_t, int, pcireg_t,
bus_addr_t *, bus_size_t *, int *);
/*
* static int cardbus_io_find(cardbus_chipset_tag_t cc,
- * cardbus_function_tag_t cf, cardbustag_t tag,
- * int reg, cardbusreg_t type, bus_addr_t *basep,
+ * cardbus_function_tag_t cf, pcitag_t tag,
+ * int reg, pcireg_t type, bus_addr_t *basep,
* bus_size_t *sizep, int *flagsp)
* This code is stolen from sys/dev/pci_map.c.
*/
@@ -70,14 +70,14 @@
cardbus_io_find(
cardbus_chipset_tag_t cc,
cardbus_function_tag_t cf,
- cardbustag_t tag,
+ pcitag_t tag,
int reg,
- cardbusreg_t type,
+ pcireg_t type,
bus_addr_t *basep,
bus_size_t *sizep,
int *flagsp)
{
- cardbusreg_t address, mask;
+ pcireg_t address, mask;
int s;
/* EXT ROM is able to map on memory space ONLY. */
@@ -133,15 +133,15 @@
/*
* static int cardbus_mem_find(cardbus_chipset_tag_t cc,
- * cardbus_function_tag_t cf, cardbustag_t tag,
- * int reg, cardbusreg_t type, bus_addr_t *basep,
+ * cardbus_function_tag_t cf, pcitag_t tag,
+ * int reg, pcireg_t type, bus_addr_t *basep,
* bus_size_t *sizep, int *flagsp)
* This code is stolen from sys/dev/pci_map.c.
*/
static int
-cardbus_mem_find(cardbus_chipset_tag_t cc, cardbus_function_tag_t cf, cardbustag_t tag, int reg, cardbusreg_t type, bus_addr_t *basep, bus_size_t *sizep, int *flagsp)
+cardbus_mem_find(cardbus_chipset_tag_t cc, cardbus_function_tag_t cf, pcitag_t tag, int reg, pcireg_t type, bus_addr_t *basep, bus_size_t *sizep, int *flagsp)
{
- cardbusreg_t address, mask;
+ pcireg_t address, mask;
int s;
if (reg != CARDBUS_ROM_REG &&
@@ -216,7 +216,7 @@
/*
- * int cardbus_mapreg_map(struct cardbus_softc *, int, int, cardbusreg_t,
+ * int cardbus_mapreg_map(struct cardbus_softc *, int, int, pcireg_t,
* int bus_space_tag_t *, bus_space_handle_t *,
* bus_addr_t *, bus_size_t *)
* This function maps bus-space on the value of Base Address
@@ -226,7 +226,7 @@
* written on the BAR.
*/
int
-cardbus_mapreg_map(struct cardbus_softc *sc, int func, int reg, cardbusreg_t type, int busflags, bus_space_tag_t *tagp, bus_space_handle_t *handlep, bus_addr_t *basep, bus_size_t *sizep)
+cardbus_mapreg_map(struct cardbus_softc *sc, int func, int reg, pcireg_t type, int busflags, bus_space_tag_t *tagp, bus_space_handle_t *handlep, bus_addr_t *basep, bus_size_t *sizep)
{
cardbus_chipset_tag_t cc = sc->sc_cc;
cardbus_function_tag_t cf = sc->sc_cf;
@@ -239,7 +239,7 @@
bus_size_t size;
int flags;
int status = 0;
- cardbustag_t tag;
+ pcitag_t tag;
size = 0; /* XXX gcc */
flags = 0; /* XXX gcc */
@@ -332,7 +332,7 @@
cardbus_chipset_tag_t cc = sc->sc_cc;
cardbus_function_tag_t cf = sc->sc_cf;
int st = 1;
- cardbustag_t cardbustag;
+ pcitag_t cardbustag;
#if rbus
rbus_tag_t rbustag;
@@ -374,7 +374,7 @@
*/
int cardbus_save_bar(cardbus_devfunc_t ct)
{
- cardbustag_t tag = Cardbus_make_tag(ct);
+ pcitag_t tag = Cardbus_make_tag(ct);
cardbus_chipset_tag_t cc = ct->ct_cc;
cardbus_function_tag_t cf = ct->ct_cf;
@@ -402,7 +402,7 @@
*/
int cardbus_restore_bar(cardbus_devfunc_t ct)
{
- cardbustag_t tag = Cardbus_make_tag(ct);
+ pcitag_t tag = Cardbus_make_tag(ct);
cardbus_chipset_tag_t cc = ct->ct_cc;
cardbus_function_tag_t cf = ct->ct_cf;
diff -r c87102fd37b1 -r e3e9f82fe675 sys/dev/cardbus/com_cardbus.c
--- a/sys/dev/cardbus/com_cardbus.c Wed Feb 24 19:20:13 2010 +0000
+++ b/sys/dev/cardbus/com_cardbus.c Wed Feb 24 19:52:51 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: com_cardbus.c,v 1.23 2009/11/12 20:30:29 dyoung Exp $ */
+/* $NetBSD: com_cardbus.c,v 1.24 2010/02/24 19:52:51 dyoung Exp $ */
/*
* Copyright (c) 2000 Johan Danielsson
@@ -40,7 +40,7 @@
updated below. */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com_cardbus.c,v 1.23 2009/11/12 20:30:29 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_cardbus.c,v 1.24 2010/02/24 19:52:51 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -60,12 +60,12 @@
void *cc_ih;
cardbus_devfunc_t cc_ct;
bus_addr_t cc_addr;
- cardbusreg_t cc_base;
+ pcireg_t cc_base;
bus_size_t cc_size;
- cardbusreg_t cc_csr;
+ pcireg_t cc_csr;
int cc_cben;
- cardbustag_t cc_tag;
- cardbusreg_t cc_reg;
+ pcitag_t cc_tag;
+ pcireg_t cc_reg;
int cc_type;
};
@@ -85,7 +85,7 @@
static struct csdev {
int vendor;
int product;
- cardbusreg_t reg;
+ pcireg_t reg;
int type;
} csdevs[] = {
{ PCI_VENDOR_XIRCOM, PCI_PRODUCT_XIRCOM_MODEM56,
@@ -138,7 +138,7 @@
gofigure(struct cardbus_attach_args *ca, struct com_cardbus_softc *csc)
{
int i, index = -1;
- cardbusreg_t cis_ptr;
+ pcireg_t cis_ptr;
struct csdev *cp;
/* If this device is listed above, use the known values, */
@@ -267,7 +267,7 @@
cardbus_devfunc_t ct = csc->cc_ct;
cardbus_chipset_tag_t cc = ct->ct_cc;
cardbus_function_tag_t cf = ct->ct_cf;
- cardbusreg_t reg;
+ pcireg_t reg;
Cardbus_conf_write(ct, csc->cc_tag, csc->cc_reg, csc->cc_base);
diff -r c87102fd37b1 -r e3e9f82fe675 sys/dev/cardbus/ehci_cardbus.c
--- a/sys/dev/cardbus/ehci_cardbus.c Wed Feb 24 19:20:13 2010 +0000
+++ b/sys/dev/cardbus/ehci_cardbus.c Wed Feb 24 19:52:51 2010 +0000
@@ -1,4 +1,4 @@
Home |
Main Index |
Thread Index |
Old Index