CVS commit: src/sys/dev/cardbus

2021-04-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 17 01:19:48 UTC 2021

Modified Files:
src/sys/dev/cardbus: cardslot.c cardslotvar.h

Log Message:
convert cardslot event thread from wakeup/tsleep to mutex/condvar.
this avoids a strange hang at reboot i am seeing on an old pentium4-m
laptop, that was introduced with kern_mutex.c 1.91/92, though i can
not really explain why that matters (in the waiting thread, a pointer
that should be NULL remains non NULL.)  thanks to jmcneill@ for some
helpful review commentary here.

don't panic() if either "cardbus" or "pcmcia" didn't attach and a
card is inserted.  this can happen for various reasons, including
some regression in netbsd (-current, and -9, at least) that suggests
using PCI_BUS_FIXUP (though it still fails to attach the card i have.)

both found with GCC 10 testing, though both also occur with GCC 7 in
the netbsd-9 tree as well.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/cardbus/cardslot.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/cardbus/cardslotvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/cardslot.c
diff -u src/sys/dev/cardbus/cardslot.c:1.57 src/sys/dev/cardbus/cardslot.c:1.58
--- src/sys/dev/cardbus/cardslot.c:1.57	Sun Oct  4 06:15:54 2020
+++ src/sys/dev/cardbus/cardslot.c	Sat Apr 17 01:19:48 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cardslot.c,v 1.57 2020/10/04 06:15:54 nat Exp $	*/
+/*	$NetBSD: cardslot.c,v 1.58 2021/04/17 01:19:48 mrg Exp $	*/
 
 /*
  * Copyright (c) 1999 and 2000
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cardslot.c,v 1.57 2020/10/04 06:15:54 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cardslot.c,v 1.58 2021/04/17 01:19:48 mrg Exp $");
 
 #include "opt_cardslot.h"
 
@@ -129,6 +129,8 @@ cardslotattach(device_t parent, device_t
 	sc->sc_16_softc = NULL;
 	SIMPLEQ_INIT(>sc_events);
 	sc->sc_th_enable = 0;
+	mutex_init(>sc_event_lock, MUTEX_DEFAULT, IPL_TTY);
+	cv_init(>sc_event_cv, "evexit");
 
 	aprint_naive("\n");
 	aprint_normal("\n");
@@ -192,14 +194,24 @@ cardslotdetach(device_t self, int flags)
 	if ((rc = config_detach_children(self, flags)) != 0)
 		return rc;
 
-	sc->sc_th_enable = 0;
-	wakeup(>sc_events);
-	while (sc->sc_event_thread != NULL)
-		(void)tsleep(sc, PWAIT, "cardslotthd", 0);
+	mutex_enter(>sc_event_lock);
+
+	if (sc->sc_event_thread != NULL) {
+		sc->sc_th_enable = 0;
+		cv_signal(>sc_event_cv);
+		while (sc->sc_event_thread != NULL) {
+			cv_wait(>sc_event_cv, >sc_event_lock);
+		}
+	}
 
 	if (!SIMPLEQ_EMPTY(>sc_events))
 		aprint_error_dev(self, "events outstanding");
 
+	mutex_exit(>sc_event_lock);
+
+	mutex_destroy(>sc_event_lock);
+	cv_destroy(>sc_event_cv);
+
 	pmf_device_deregister(self);
 	return 0;
 }
@@ -272,13 +284,11 @@ cardslot_event_throw(struct cardslot_sof
 
 	ce->ce_type = ev;
 
-	{
-		int s = spltty();
-		SIMPLEQ_INSERT_TAIL(>sc_events, ce, ce_q);
-		splx(s);
-	}
+	mutex_enter(>sc_event_lock);
+	SIMPLEQ_INSERT_TAIL(>sc_events, ce, ce_q);
+	mutex_exit(>sc_event_lock);
 
-	wakeup(>sc_events);
+	cv_signal(>sc_event_cv);
 
 	return;
 }
@@ -296,29 +306,28 @@ cardslot_event_thread(void *arg)
 {
 	struct cardslot_softc *sc = arg;
 	struct cardslot_event *ce;
-	int s, first = 1;
+	int first = 1;
 	static int antonym_ev[4] = {
 		CARDSLOT_EVENT_REMOVAL_16, CARDSLOT_EVENT_INSERTION_16,
 		CARDSLOT_EVENT_REMOVAL_CB, CARDSLOT_EVENT_INSERTION_CB
 	};
 
+	mutex_enter(>sc_event_lock);
 	while (sc->sc_th_enable) {
-		s = spltty();
 		if ((ce = SIMPLEQ_FIRST(>sc_events)) == NULL) {
-			splx(s);
 			if (first) {
 first = 0;
+mutex_exit(>sc_event_lock);
 config_pending_decr(sc->sc_dev);
+mutex_enter(>sc_event_lock);
 			}
-			(void) tsleep(>sc_events, PWAIT, "cardslotev", 0);
+			cv_wait(>sc_event_cv, >sc_event_lock);
 			continue;
 		}
 		SIMPLEQ_REMOVE_HEAD(>sc_events, ce_q);
-		splx(s);
 
 		if (IS_CARDSLOT_INSERT_REMOVE_EV(ce->ce_type)) {
 			/* Chattering suppression */
-			s = spltty();
 			while (1) {
 struct cardslot_event *ce1, *ce2;
 
@@ -340,8 +349,8 @@ cardslot_event_thread(void *arg)
 	free(ce2, M_TEMP);
 }
 			}
-			splx(s);
 		}
+		mutex_exit(>sc_event_lock);
 
 		switch (ce->ce_type) {
 		case CARDSLOT_EVENT_INSERTION_CB:
@@ -371,8 +380,10 @@ cardslot_event_thread(void *arg)
 	CARDSLOT_STATUS_NOTWORK);
 }
 			} else {
-panic("no cardbus on %s",
+printf("%s: no cardbus on %s\n", __func__,
   device_xname(sc->sc_dev));
+CARDSLOT_SET_WORK(sc->sc_status,
+CARDSLOT_STATUS_NOTWORK);
 			}
 
 			break;
@@ -400,8 +411,10 @@ cardslot_event_thread(void *arg)
 	CARDSLOT_STATUS_WORKING);
 }
 			} else {
-panic("no 16-bit pcmcia on %s",
+printf("%s: no 16-bit pcmcia on %s\n", __func__,
   device_xname(sc->sc_dev));
+CARDSLOT_SET_WORK(sc->sc_status,
+CARDSLOT_STATUS_NOTWORK);
 			}
 
 			break;
@@ -451,12 +464,14 @@ 

CVS commit: src/sys/dev/cardbus

2020-10-04 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sun Oct  4 06:15:55 UTC 2020

Modified Files:
src/sys/dev/cardbus: cardslot.c

Log Message:
Ensure event_thread stays in event loop upon creation.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/cardbus/cardslot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/cardslot.c
diff -u src/sys/dev/cardbus/cardslot.c:1.56 src/sys/dev/cardbus/cardslot.c:1.57
--- src/sys/dev/cardbus/cardslot.c:1.56	Sat Sep 24 23:54:49 2016
+++ src/sys/dev/cardbus/cardslot.c	Sun Oct  4 06:15:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cardslot.c,v 1.56 2016/09/24 23:54:49 mrg Exp $	*/
+/*	$NetBSD: cardslot.c,v 1.57 2020/10/04 06:15:54 nat Exp $	*/
 
 /*
  * Copyright (c) 1999 and 2000
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cardslot.c,v 1.56 2016/09/24 23:54:49 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cardslot.c,v 1.57 2020/10/04 06:15:54 nat Exp $");
 
 #include "opt_cardslot.h"
 
@@ -157,6 +157,7 @@ cardslotattach(device_t parent, device_t
 	}
 
 	if (csc != NULL || psc != NULL) {
+		sc->sc_th_enable = 1;
 		config_pending_incr(self);
 		if (kthread_create(PRI_NONE, 0, NULL, cardslot_event_thread,
 		sc, >sc_event_thread, "%s", device_xname(self))) {
@@ -164,7 +165,6 @@ cardslotattach(device_t parent, device_t
 	 "unable to create thread\n");
 			panic("cardslotattach");
 		}
-		sc->sc_th_enable = 1;
 	}
 
 	if (csc && (csc->sc_cf->cardbus_ctrl)(csc->sc_cc, CARDBUS_CD)) {



CVS commit: src/sys/dev/cardbus

2019-03-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Mar  5 08:16:53 UTC 2019

Modified Files:
src/sys/dev/cardbus: rbus_ppb.c

Log Message:
 Catch up with MI pci changes to fix compile error.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/cardbus/rbus_ppb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/rbus_ppb.c
diff -u src/sys/dev/cardbus/rbus_ppb.c:1.46 src/sys/dev/cardbus/rbus_ppb.c:1.47
--- src/sys/dev/cardbus/rbus_ppb.c:1.46	Fri Mar  1 09:26:00 2019
+++ src/sys/dev/cardbus/rbus_ppb.c	Tue Mar  5 08:16:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rbus_ppb.c,v 1.46 2019/03/01 09:26:00 msaitoh Exp $	*/
+/*	$NetBSD: rbus_ppb.c,v 1.47 2019/03/05 08:16:53 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rbus_ppb.c,v 1.46 2019/03/01 09:26:00 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rbus_ppb.c,v 1.47 2019/03/05 08:16:53 msaitoh Exp $");
 
 #include 
 #include 
@@ -415,16 +415,17 @@ rbus_pci_addr_fixup(struct ppb_cardbus_s
 	pci_conf_write(pc, pci_bus_tag[busnum], PCI_BRIDGE_MEMORY_REG,
 		__SHIFTIN((start >> 16) & PCI_BRIDGE_MEMORY_ADDR,
 		PCI_BRIDGE_MEMORY_BASE) |
-		__SHIFTIN(((start + rct.bussize_memreqs[busnum] + PPB_MEM_MIN
-			- 1) >> 16) & PCI_BRIDGE_MEMORY_ADDR,
-		PCI_BRIDGE_MEMORY_LIMIT));
+		__SHIFTIN(((start + rct.bussize_memreqs[busnum]
+			+ PCI_BRIDGE_MEM_MIN - 1) >> 16)
+		& PCI_BRIDGE_MEMORY_ADDR, PCI_BRIDGE_MEMORY_LIMIT));
 
 	/* and set the prefetchable limits as well */
 	pci_conf_write(pc, pci_bus_tag[busnum], PCI_BRIDGE_PREFETCHMEM_REG,
 		__SHIFTIN((start >> 16) & PCI_BRIDGE_PREFETCHMEM_ADDR,
 		PCI_BRIDGE_PREFETCHMEM_BASE) |
-		__SHIFTIN(((start + rct.bussize_memreqs[busnum] + PPB_MEM_MIN
-			- 1) >> 16) & PCI_BRIDGE_PREFETCHMEM_ADDR,
+		__SHIFTIN(((start + rct.bussize_memreqs[busnum]
+			+ PCI_BRIDGE_MEM_MIN - 1) >> 16)
+		& PCI_BRIDGE_PREFETCHMEM_ADDR,
 		PCI_BRIDGE_PREFETCHMEM_LIMIT));
 
 	/* pci_conf_print(pc, pci_bus_tag[busnum], NULL); */



CVS commit: src/sys/dev/cardbus

2018-12-14 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Dec 14 21:49:22 UTC 2018

Modified Files:
src/sys/dev/cardbus: files.cardbus
Added Files:
src/sys/dev/cardbus: if_malo_cardbus.c

Log Message:
add cardbus attachment for malo(4), from OpenBSD


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/cardbus/files.cardbus
cvs rdiff -u -r0 -r1.1 src/sys/dev/cardbus/if_malo_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/files.cardbus
diff -u src/sys/dev/cardbus/files.cardbus:1.38 src/sys/dev/cardbus/files.cardbus:1.39
--- src/sys/dev/cardbus/files.cardbus:1.38	Sat Mar 30 02:38:59 2013
+++ src/sys/dev/cardbus/files.cardbus	Fri Dec 14 21:49:22 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.cardbus,v 1.38 2013/03/30 02:38:59 christos Exp $
+#	$NetBSD: files.cardbus,v 1.39 2018/12/14 21:49:22 jakllsch Exp $
 #
 # files.cardbus
 #
@@ -155,3 +155,9 @@ file	dev/cardbus/siisata_cardbus.c	siisa
 #
 attach	sdhc at cardbus with sdhc_cardbus
 file	dev/cardbus/sdhc_cardbus.c	sdhc_cardbus
+
+#
+# Marvel Libertas Open
+#
+attach	malo at cardbus with malo_cardbus
+file	dev/cardbus/if_malo_cardbus.c		malo_cardbus

Added files:

Index: src/sys/dev/cardbus/if_malo_cardbus.c
diff -u /dev/null src/sys/dev/cardbus/if_malo_cardbus.c:1.1
--- /dev/null	Fri Dec 14 21:49:22 2018
+++ src/sys/dev/cardbus/if_malo_cardbus.c	Fri Dec 14 21:49:22 2018
@@ -0,0 +1,231 @@
+/*	$NetBSD: if_malo_cardbus.c,v 1.1 2018/12/14 21:49:22 jakllsch Exp $ */
+/*	$OpenBSD: if_malo_cardbus.c,v 1.12 2013/12/06 21:03:02 deraadt Exp $ */
+
+/*
+ * Copyright (c) 2006 Claudio Jeker 
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: if_malo_cardbus.c,v 1.1 2018/12/14 21:49:22 jakllsch Exp $");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+struct malo_cardbus_softc {
+	struct malo_softc	sc_malo;
+
+	/* cardbus specific goo */
+	cardbus_devfunc_t	sc_ct;
+	pcitag_t		sc_tag;
+	void			*sc_ih;
+	bus_size_t		sc_mapsize1;
+	bus_size_t		sc_mapsize2;
+	pcireg_t		sc_bar1_val;
+	pcireg_t		sc_bar2_val;
+};
+
+int	malo_cardbus_match(device_t, cfdata_t, void *);
+void	malo_cardbus_attach(device_t, device_t, void *);
+int	malo_cardbus_detach(device_t, int);
+
+CFATTACH_DECL_NEW(malo_cardbus, sizeof (struct malo_cardbus_softc),
+malo_cardbus_match, malo_cardbus_attach, malo_cardbus_detach, NULL);
+
+void	malo_cardbus_setup(struct malo_cardbus_softc *csc);
+int	malo_cardbus_enable(struct malo_softc *sc);
+void	malo_cardbus_disable(struct malo_softc *sc);
+
+int
+malo_cardbus_match(device_t parent, cfdata_t match, void *aux)
+{
+	struct cardbus_attach_args *ca = aux;
+
+	if (PCI_VENDOR(ca->ca_id) == PCI_VENDOR_MARVELL) {
+		switch (PCI_PRODUCT(ca->ca_id)) {
+			case PCI_PRODUCT_MARVELL_88W8310:
+			case PCI_PRODUCT_MARVELL_88W8335_1:
+			case PCI_PRODUCT_MARVELL_88W8335_2:
+return 1;
+			default:
+return 0;
+		}
+	}
+
+	return 0;
+}
+
+void
+malo_cardbus_attach(struct device *parent, struct device *self, void *aux)
+{
+	struct malo_cardbus_softc *csc = device_private(self);
+	struct malo_softc *sc = >sc_malo;
+	struct cardbus_attach_args *ca = aux;
+	cardbus_devfunc_t ct = ca->ca_ct;
+	char devinfo[256];
+	bus_addr_t base;
+	int error;
+
+	pci_devinfo(ca->ca_id, ca->ca_class, 0, devinfo, sizeof(devinfo));
+	aprint_normal(": %s\n", devinfo);
+
+	sc->sc_dev = self;
+	sc->sc_dmat = ca->ca_dmat;
+	csc->sc_ct = ct;
+	csc->sc_tag = ca->ca_tag;
+
+	/* power management hooks */
+	sc->sc_enable = malo_cardbus_enable;
+	sc->sc_disable = malo_cardbus_disable;
+
+	/* map control/status registers */
+	error = Cardbus_mapreg_map(ct, PCI_BAR0,
+	PCI_MAPREG_TYPE_MEM, 0, >sc_mem1_bt, >sc_mem1_bh,
+	, >sc_mapsize1);
+	if (error != 0) {
+		aprint_error(": can't map mem1 space\n");
+		return;
+	}
+	csc->sc_bar1_val = base | PCI_MAPREG_TYPE_MEM;
+
+	error = Cardbus_mapreg_map(ct, PCI_BAR1,
+	PCI_MAPREG_TYPE_MEM, 0, >sc_mem2_bt, >sc_mem2_bh,
+	, >sc_mapsize2);
+	if (error != 0) {
+		aprint_error(": can't map mem2 space\n");
+		Cardbus_mapreg_unmap(ct, 

CVS commit: src/sys/dev/cardbus

2018-12-14 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Dec 14 21:27:03 UTC 2018

Modified Files:
src/sys/dev/cardbus: if_ral_cardbus.c

Log Message:
fix whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/cardbus/if_ral_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/if_ral_cardbus.c
diff -u src/sys/dev/cardbus/if_ral_cardbus.c:1.24 src/sys/dev/cardbus/if_ral_cardbus.c:1.25
--- src/sys/dev/cardbus/if_ral_cardbus.c:1.24	Thu Jul 14 10:19:06 2016
+++ src/sys/dev/cardbus/if_ral_cardbus.c	Fri Dec 14 21:27:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ral_cardbus.c,v 1.24 2016/07/14 10:19:06 msaitoh Exp $	*/
+/*	$NetBSD: if_ral_cardbus.c,v 1.25 2018/12/14 21:27:03 jakllsch Exp $	*/
 /*	$OpenBSD: if_ral_cardbus.c,v 1.6 2006/01/09 20:03:31 damien Exp $  */
 
 /*-
@@ -22,7 +22,7 @@
  * CardBus front-end for the Ralink RT2560/RT2561/RT2561S/RT2661 driver.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ral_cardbus.c,v 1.24 2016/07/14 10:19:06 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ral_cardbus.c,v 1.25 2018/12/14 21:27:03 jakllsch Exp $");
 
 
 #include 
@@ -106,10 +106,10 @@ void	ral_cardbus_setup(struct ral_cardbu
 int
 ral_cardbus_match(device_t parent, cfdata_t cfdata, void *aux)
 {
-struct cardbus_attach_args *ca = aux;
+	struct cardbus_attach_args *ca = aux;
 
-if (PCI_VENDOR(ca->ca_id) == PCI_VENDOR_RALINK) {
-switch (PCI_PRODUCT(ca->ca_id)) {
+	if (PCI_VENDOR(ca->ca_id) == PCI_VENDOR_RALINK) {
+		switch (PCI_PRODUCT(ca->ca_id)) {
 		case PCI_PRODUCT_RALINK_RT2560:
 		case PCI_PRODUCT_RALINK_RT2561:
 		case PCI_PRODUCT_RALINK_RT2561S:
@@ -117,10 +117,10 @@ ral_cardbus_match(device_t parent, cfdat
 			return 1;
 		default:
 			return 0;
-}
-}
+		}
+	}
 
-return 0;
+	return 0;
 }
 
 void



CVS commit: src/sys/dev/cardbus

2018-04-02 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Apr  2 11:02:53 UTC 2018

Modified Files:
src/sys/dev/cardbus: ahc_cardbus.c

Log Message:
Remove extra printf duplicate with MI codes.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/cardbus/ahc_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/ahc_cardbus.c
diff -u src/sys/dev/cardbus/ahc_cardbus.c:1.36 src/sys/dev/cardbus/ahc_cardbus.c:1.37
--- src/sys/dev/cardbus/ahc_cardbus.c:1.36	Thu Jul 14 04:00:45 2016
+++ src/sys/dev/cardbus/ahc_cardbus.c	Mon Apr  2 11:02:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahc_cardbus.c,v 1.36 2016/07/14 04:00:45 msaitoh Exp $	*/
+/*	$NetBSD: ahc_cardbus.c,v 1.37 2018/04/02 11:02:52 rin Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2005 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.36 2016/07/14 04:00:45 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.37 2018/04/02 11:02:52 rin Exp $");
 
 #include "opt_ahc_cardbus.h"
 
@@ -229,8 +229,6 @@ ahc_cardbus_attach(device_t parent, devi
 		ahc->our_id = our_id;
 	}
 
-	printf("%s: aic7860", ahc_name(ahc));
-
 	/*
 	 * Record our termination setting for the
 	 * generic initialization routine.



CVS commit: src/sys/dev/cardbus

2016-09-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Sep 24 23:54:49 UTC 2016

Modified Files:
src/sys/dev/cardbus: cardslot.c

Log Message:
weak alias some pcmcia functions (to an returns error function) so this
links when pcmcia isn't in the kernel.  PR#7253.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/cardbus/cardslot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/cardslot.c
diff -u src/sys/dev/cardbus/cardslot.c:1.55 src/sys/dev/cardbus/cardslot.c:1.56
--- src/sys/dev/cardbus/cardslot.c:1.55	Sat Oct 12 16:49:00 2013
+++ src/sys/dev/cardbus/cardslot.c	Sat Sep 24 23:54:49 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: cardslot.c,v 1.55 2013/10/12 16:49:00 christos Exp $	*/
+/*	$NetBSD: cardslot.c,v 1.56 2016/09/24 23:54:49 mrg Exp $	*/
 
 /*
  * Copyright (c) 1999 and 2000
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cardslot.c,v 1.55 2013/10/12 16:49:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cardslot.c,v 1.56 2016/09/24 23:54:49 mrg Exp $");
 
 #include "opt_cardslot.h"
 
@@ -56,6 +56,16 @@ __KERNEL_RCSID(0, "$NetBSD: cardslot.c,v
 #define DPRINTF(a)
 #endif
 
+int pcmcia_error(device_t);
+int
+pcmcia_error(device_t dev)
+{
+
+	return 1;
+}
+__weak_alias(pcmcia_card_attach, pcmcia_error);
+__weak_alias(pcmcia_card_deactivate, pcmcia_error);
+__weak_alias(pcmcia_card_detach, pcmcia_error);
 
 
 STATIC void cardslotchilddet(device_t, device_t);



CVS commit: src/sys/dev/cardbus

2014-10-17 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Oct 17 20:52:01 UTC 2014

Modified Files:
src/sys/dev/cardbus: rbus_ppb.c

Log Message:
Fix i386 CARDBUS build.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/cardbus/rbus_ppb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/rbus_ppb.c
diff -u src/sys/dev/cardbus/rbus_ppb.c:1.42 src/sys/dev/cardbus/rbus_ppb.c:1.43
--- src/sys/dev/cardbus/rbus_ppb.c:1.42	Thu Feb  2 19:43:02 2012
+++ src/sys/dev/cardbus/rbus_ppb.c	Fri Oct 17 20:52:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rbus_ppb.c,v 1.42 2012/02/02 19:43:02 tls Exp $	*/
+/*	$NetBSD: rbus_ppb.c,v 1.43 2014/10/17 20:52:00 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rbus_ppb.c,v 1.42 2012/02/02 19:43:02 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: rbus_ppb.c,v 1.43 2014/10/17 20:52:00 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -156,23 +156,14 @@ rbus_intr_fixup(pci_chipset_tag_t pc,
 void
 rbus_do_header_fixup(pci_chipset_tag_t pc, pcitag_t tag, void *context)
 {
-  int pin, irq;
   int bus, device, function;
-  pcireg_t intr, id;
+  pcireg_t intr;
   int *pline = (int *)context;
   int line = *pline;
 
   pci_decompose_tag(pc, tag, bus, device, function);
-  id = pci_conf_read(pc, tag, PCI_ID_REG);
 
   intr = pci_conf_read(pc, tag, PCI_INTERRUPT_REG);
-  pin = PCI_INTERRUPT_PIN(intr);
-  irq = PCI_INTERRUPT_LINE(intr);
-
-#if 0
-  printf(do_header %02x:%02x:%02x pin=%d = line %d\n,
-	 bus, device, function, pin, line);
-#endif
 
   intr = ~(PCI_INTERRUPT_LINE_MASK  PCI_INTERRUPT_LINE_SHIFT);
   intr |= (line  PCI_INTERRUPT_LINE_SHIFT);
@@ -532,7 +523,6 @@ rbus_do_phys_allocate(pci_chipset_tag_t 
 	struct cardbus_softc *sc = rct-sc;
 	cardbus_function_t   *cf = sc-sc_cf;
 	rbus_tag_t  rbustag;
-	bus_space_tag_t bustag;
 	bus_addr_t mask = size -1;
 	bus_addr_t base = 0;
 	bus_space_handle_t handle;
@@ -565,11 +555,9 @@ rbus_do_phys_allocate(pci_chipset_tag_t 
 	}
 
 	if(PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_IO) {
-	  bustag  = sc-sc_iot;
 	  rbustag = rct-iobustags[bus];
 	  bustype = io;
 	} else {
-	  bustag  = sc-sc_memt;
 	  rbustag = rct-membustags[bus];
 	  bustype = mem;
 	}
@@ -630,16 +618,10 @@ ppb_cardbus_attach(device_t parent, devi
 	struct pcibus_attach_args pba;
 	char devinfo[256];
 	pcireg_t busdata;
-	int mybus, rv;
-	u_int16_t pciirq;
 	int minbus, maxbus;
 
 	csc-sc_dev = self;
 
-	mybus = ct-ct_bus;
-	pciirq = 0;
-	rv = 0;
-
 	pci_devinfo(ca-ca_id, ca-ca_class, 0, devinfo, sizeof(devinfo));
 	printf(: %s (rev. 0x%02x)\n, devinfo, PCI_REVISION(ca-ca_class));
 



CVS commit: src/sys/dev/cardbus

2013-11-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Nov 21 21:17:50 UTC 2013

Modified Files:
src/sys/dev/cardbus: if_rtw_cardbus.c

Log Message:
Expand #ifdef notyet section to encompass the use of the variable
declared within.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/cardbus/if_rtw_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/if_rtw_cardbus.c
diff -u src/sys/dev/cardbus/if_rtw_cardbus.c:1.43 src/sys/dev/cardbus/if_rtw_cardbus.c:1.44
--- src/sys/dev/cardbus/if_rtw_cardbus.c:1.43	Thu Oct 17 21:22:28 2013
+++ src/sys/dev/cardbus/if_rtw_cardbus.c	Thu Nov 21 21:17:50 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: if_rtw_cardbus.c,v 1.43 2013/10/17 21:22:28 christos Exp $ */
+/* $NetBSD: if_rtw_cardbus.c,v 1.44 2013/11/21 21:17:50 riz Exp $ */
 
 /*-
  * Copyright (c) 2004, 2005 David Young.  All rights reserved.
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_rtw_cardbus.c,v 1.43 2013/10/17 21:22:28 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_rtw_cardbus.c,v 1.44 2013/11/21 21:17:50 riz Exp $);
 
 #include opt_inet.h
 
@@ -215,17 +215,17 @@ rtw_cardbus_attach(device_t parent, devi
 		panic(rtw_cardbus_attach: impossible);
 	}
 
+	printf(: %s\n, rcp-rcp_product_name);
+
 #ifdef notyet
 	/* Get revision info. */
 	int rev = PCI_REVISION(ca-ca_class);
-#endif
-
-	printf(: %s\n, rcp-rcp_product_name);
 
 	RTW_DPRINTF(RTW_DEBUG_ATTACH,
 	(%s: pass %d.%d signature %08x\n, device_xname(self),
 	 (rev  4)  0xf, rev  0xf,
 	 Cardbus_conf_read(ct, csc-sc_tag, 0x80)));
+#endif
 
 	/*
 	 * Map the device.



CVS commit: src/sys/dev/cardbus

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:22:28 UTC 2013

Modified Files:
src/sys/dev/cardbus: if_rtw_cardbus.c

Log Message:
move notyet variable into notyet section


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/cardbus/if_rtw_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/if_rtw_cardbus.c
diff -u src/sys/dev/cardbus/if_rtw_cardbus.c:1.42 src/sys/dev/cardbus/if_rtw_cardbus.c:1.43
--- src/sys/dev/cardbus/if_rtw_cardbus.c:1.42	Mon Aug  1 07:20:27 2011
+++ src/sys/dev/cardbus/if_rtw_cardbus.c	Thu Oct 17 17:22:28 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: if_rtw_cardbus.c,v 1.42 2011/08/01 11:20:27 drochner Exp $ */
+/* $NetBSD: if_rtw_cardbus.c,v 1.43 2013/10/17 21:22:28 christos Exp $ */
 
 /*-
  * Copyright (c) 2004, 2005 David Young.  All rights reserved.
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_rtw_cardbus.c,v 1.42 2011/08/01 11:20:27 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_rtw_cardbus.c,v 1.43 2013/10/17 21:22:28 christos Exp $);
 
 #include opt_inet.h
 
@@ -203,7 +203,6 @@ rtw_cardbus_attach(device_t parent, devi
 	cardbus_devfunc_t ct = ca-ca_ct;
 	const struct rtw_cardbus_product *rcp;
 	bus_addr_t adr;
-	int rev;
 
 	sc-sc_dev = self;
 	sc-sc_dmat = ca-ca_dmat;
@@ -216,8 +215,10 @@ rtw_cardbus_attach(device_t parent, devi
 		panic(rtw_cardbus_attach: impossible);
 	}
 
+#ifdef notyet
 	/* Get revision info. */
-	rev = PCI_REVISION(ca-ca_class);
+	int rev = PCI_REVISION(ca-ca_class);
+#endif
 
 	printf(: %s\n, rcp-rcp_product_name);
 



CVS commit: src/sys/dev/cardbus

2012-02-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 18 00:36:57 UTC 2012

Modified Files:
src/sys/dev/cardbus: cardbusvar.h

Log Message:
Remove uneeded and unused structure.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/cardbus/cardbusvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/cardbusvar.h
diff -u src/sys/dev/cardbus/cardbusvar.h:1.55 src/sys/dev/cardbus/cardbusvar.h:1.56
--- src/sys/dev/cardbus/cardbusvar.h:1.55	Mon Aug  1 11:20:27 2011
+++ src/sys/dev/cardbus/cardbusvar.h	Sat Feb 18 00:36:57 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cardbusvar.h,v 1.55 2011/08/01 11:20:27 drochner Exp $	*/
+/*	$NetBSD: cardbusvar.h,v 1.56 2012/02/18 00:36:57 matt Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 and 2000
@@ -32,10 +32,6 @@
 #include dev/cardbus/cardbusreg.h
 #include dev/cardbus/rbus.h
 
-struct {
-	int dummy;
-} cardbus_chipset_tag;
-
 typedef struct cardbus_chipset_tag *cardbus_chipset_tag_t;
 
 /*



CVS commit: src/sys/dev/cardbus

2011-05-24 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue May 24 16:37:04 UTC 2011

Modified Files:
src/sys/dev/cardbus: cardslot.c

Log Message:
Kill redundant ()


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/cardbus/cardslot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/cardslot.c
diff -u src/sys/dev/cardbus/cardslot.c:1.52 src/sys/dev/cardbus/cardslot.c:1.53
--- src/sys/dev/cardbus/cardslot.c:1.52	Fri Mar 19 01:44:05 2010
+++ src/sys/dev/cardbus/cardslot.c	Tue May 24 16:37:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cardslot.c,v 1.52 2010/03/19 01:44:05 dyoung Exp $	*/
+/*	$NetBSD: cardslot.c,v 1.53 2011/05/24 16:37:04 joerg Exp $	*/
 
 /*
  * Copyright (c) 1999 and 2000
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cardslot.c,v 1.52 2010/03/19 01:44:05 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: cardslot.c,v 1.53 2011/05/24 16:37:04 joerg Exp $);
 
 #include opt_cardslot.h
 
@@ -220,7 +220,7 @@
 		return 0;
 	}
 
-	if ((cf-cf_loc[PCMCIABUSCF_CONTROLLER] == PCMCIABUSCF_CONTROLLER_DEFAULT)) {
+	if (cf-cf_loc[PCMCIABUSCF_CONTROLLER] == PCMCIABUSCF_CONTROLLER_DEFAULT) {
 		return (config_match(parent, cf, aux));
 	}
 



CVS commit: src/sys/dev/cardbus

2010-07-27 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Jul 27 21:05:04 UTC 2010

Modified Files:
src/sys/dev/cardbus: if_rtk_cardbus.c

Log Message:
No need to store map size locally now.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/cardbus/if_rtk_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/if_rtk_cardbus.c
diff -u src/sys/dev/cardbus/if_rtk_cardbus.c:1.44 src/sys/dev/cardbus/if_rtk_cardbus.c:1.45
--- src/sys/dev/cardbus/if_rtk_cardbus.c:1.44	Thu Mar 11 17:24:27 2010
+++ src/sys/dev/cardbus/if_rtk_cardbus.c	Tue Jul 27 21:05:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_rtk_cardbus.c,v 1.44 2010/03/11 17:24:27 dyoung Exp $	*/
+/*	$NetBSD: if_rtk_cardbus.c,v 1.45 2010/07/27 21:05:04 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2000 Masanori Kanaoka
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_rtk_cardbus.c,v 1.44 2010/03/11 17:24:27 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_rtk_cardbus.c,v 1.45 2010/07/27 21:05:04 jakllsch Exp $);
 
 #include opt_inet.h
 #include rnd.h
@@ -130,7 +130,6 @@
 	pcireg_t sc_csr;
 	int sc_bar_reg;
 	pcireg_t sc_bar_val;
-	bus_size_t sc_mapsize;
 	cardbus_intr_line_t sc_intrline;
 };
 
@@ -206,14 +205,14 @@
 	csc-sc_csr = PCI_COMMAND_MASTER_ENABLE;
 #ifdef RTK_USEIOSPACE
 	if (Cardbus_mapreg_map(ct, RTK_PCI_LOIO, PCI_MAPREG_TYPE_IO, 0,
-	sc-rtk_btag, sc-rtk_bhandle, adr, csc-sc_mapsize) == 0) {
+	sc-rtk_btag, sc-rtk_bhandle, adr, sc-rtk_bsize) == 0) {
 		csc-sc_csr |= PCI_COMMAND_IO_ENABLE;
 		csc-sc_bar_reg = RTK_PCI_LOIO;
 		csc-sc_bar_val = adr | PCI_MAPREG_TYPE_IO;
 	}
 #else
 	if (Cardbus_mapreg_map(ct, RTK_PCI_LOMEM, PCI_MAPREG_TYPE_MEM, 0,
-	sc-rtk_btag, sc-rtk_bhandle, adr, csc-sc_mapsize) == 0) {
+	sc-rtk_btag, sc-rtk_bhandle, adr, sc-rtk_bsize) == 0) {
 		csc-sc_csr |= PCI_COMMAND_MEM_ENABLE;
 		csc-sc_bar_reg = RTK_PCI_LOMEM;
 		csc-sc_bar_val = adr | PCI_MAPREG_TYPE_MEM;
@@ -268,7 +267,7 @@
 	 */
 	if (csc-sc_bar_reg != 0)
 		Cardbus_mapreg_unmap(ct, csc-sc_bar_reg,
-		sc-rtk_btag, sc-rtk_bhandle, csc-sc_mapsize);
+		sc-rtk_btag, sc-rtk_bhandle, sc-rtk_bsize);
 
 	return 0;
 }



CVS commit: src/sys/dev/cardbus

2010-04-19 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Apr 19 07:05:15 UTC 2010

Modified Files:
src/sys/dev/cardbus: fwohci_cardbus.c

Log Message:
Not necessary '\n'.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/cardbus/fwohci_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/fwohci_cardbus.c
diff -u src/sys/dev/cardbus/fwohci_cardbus.c:1.32 src/sys/dev/cardbus/fwohci_cardbus.c:1.33
--- src/sys/dev/cardbus/fwohci_cardbus.c:1.32	Mon Mar 29 03:05:27 2010
+++ src/sys/dev/cardbus/fwohci_cardbus.c	Mon Apr 19 07:05:15 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwohci_cardbus.c,v 1.32 2010/03/29 03:05:27 kiyohara Exp $	*/
+/*	$NetBSD: fwohci_cardbus.c,v 1.33 2010/04/19 07:05:15 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fwohci_cardbus.c,v 1.32 2010/03/29 03:05:27 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: fwohci_cardbus.c,v 1.33 2010/04/19 07:05:15 kiyohara Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -66,8 +66,7 @@
 static int fwohci_cardbus_detach(device_t, int);
 
 CFATTACH_DECL_NEW(fwohci_cardbus, sizeof(struct fwohci_cardbus_softc),
-fwohci_cardbus_match, fwohci_cardbus_attach,
-fwohci_cardbus_detach, NULL);
+fwohci_cardbus_match, fwohci_cardbus_attach, fwohci_cardbus_detach, NULL);
 
 static int
 fwohci_cardbus_match(device_t parent, cfdata_t match, void *aux)



CVS commit: src/sys/dev/cardbus

2010-03-31 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Apr  1 05:58:52 UTC 2010

Modified Files:
src/sys/dev/cardbus: siisata_cardbus.c

Log Message:
Cosmetic: join a couple of lines.  Stop storing the value of a BAR in a
temporary variable with the name 'csr'.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/cardbus/siisata_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/siisata_cardbus.c
diff -u src/sys/dev/cardbus/siisata_cardbus.c:1.12 src/sys/dev/cardbus/siisata_cardbus.c:1.13
--- src/sys/dev/cardbus/siisata_cardbus.c:1.12	Thu Mar 18 20:54:56 2010
+++ src/sys/dev/cardbus/siisata_cardbus.c	Thu Apr  1 05:58:52 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata_cardbus.c,v 1.12 2010/03/18 20:54:56 dyoung Exp $ */
+/* $NetBSD: siisata_cardbus.c,v 1.13 2010/04/01 05:58:52 dyoung Exp $ */
 /* Id: siisata_pci.c,v 1.11 2008/05/21 16:20:11 jakllsch Exp  */
 
 /*
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: siisata_cardbus.c,v 1.12 2010/03/18 20:54:56 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: siisata_cardbus.c,v 1.13 2010/04/01 05:58:52 dyoung Exp $);
 
 #include sys/types.h
 #include sys/malloc.h
@@ -175,9 +175,7 @@
 	{
 #define SIISATA_BAR0_SIZE	128
 		grsize = SIISATA_BAR0_SIZE;
-		csr =
-		Cardbus_conf_read(ct, ca-ca_tag, SIISATA_CARDBUS_BAR0);
-		base = PCI_MAPREG_MEM_ADDR(csr);
+		base = PCI_MAPREG_MEM_ADDR(Cardbus_conf_read(ct, ca-ca_tag, SIISATA_CARDBUS_BAR0));
 		memt = csc-sc_memt;
 		if ((*cf-cardbus_space_alloc)(cc, csc-sc_rbus_memt, base,
 		grsize, grsize - 1, grsize, 0, base, memh)) {
@@ -186,8 +184,7 @@
 			SIISATANAME(sc));
 			return;
 		}
-		Cardbus_conf_write(ct, ca-ca_tag, SIISATA_CARDBUS_BAR0,
-		base);
+		Cardbus_conf_write(ct, ca-ca_tag, SIISATA_CARDBUS_BAR0, base);
 	}
 	sc-sc_grt = memt;
 	sc-sc_grh = memh;
@@ -211,8 +208,7 @@
 			SIISATANAME(sc));
 			return;
 		}
-		Cardbus_conf_write(ct, ca-ca_tag, SIISATA_CARDBUS_BAR1,
-		base);
+		Cardbus_conf_write(ct, ca-ca_tag, SIISATA_CARDBUS_BAR1, base);
 	}
 	sc-sc_prt = memt;
 	sc-sc_prh = memh;



CVS commit: src/sys/dev/cardbus

2010-03-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Mar 18 20:52:43 UTC 2010

Modified Files:
src/sys/dev/cardbus: if_fxp_cardbus.c

Log Message:
Simplify interrupt (dis)establishment by two source transformations:

-   cardbus_intr_disestablish(cc, cf, ih);
+   Cardbus_intr_disestablish(ct, ih);

-   ih = cardbus_intr_establish(cc, cf, ...);
+   ih = Cardbus_intr_establish(ct, ...);

The identical change to a few other CardBus NICs has not caused any
problems, as expected, so I'm going to commit this rather safe change
and get on with the work.

Testers have been enlisted.  I will revisit this change if I get any
negative responses.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/cardbus/if_fxp_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/if_fxp_cardbus.c
diff -u src/sys/dev/cardbus/if_fxp_cardbus.c:1.46 src/sys/dev/cardbus/if_fxp_cardbus.c:1.47
--- src/sys/dev/cardbus/if_fxp_cardbus.c:1.46	Fri Feb 26 00:57:02 2010
+++ src/sys/dev/cardbus/if_fxp_cardbus.c	Thu Mar 18 20:52:43 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_fxp_cardbus.c,v 1.46 2010/02/26 00:57:02 dyoung Exp $	*/
+/*	$NetBSD: if_fxp_cardbus.c,v 1.47 2010/03/18 20:52:43 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_fxp_cardbus.c,v 1.46 2010/02/26 00:57:02 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_fxp_cardbus.c,v 1.47 2010/03/18 20:52:43 dyoung Exp $);
 
 #include opt_inet.h
 #include rnd.h
@@ -212,8 +212,7 @@
 fxp_cardbus_enable(struct fxp_softc * sc)
 {
 	struct fxp_cardbus_softc *csc = (struct fxp_cardbus_softc *)sc;
-	cardbus_chipset_tag_t cc = csc-ct-ct_cc;
-	cardbus_function_tag_t cf = csc-ct-ct_cf;
+	cardbus_devfunc_t ct = csc-ct;
 
 	Cardbus_function_enable(csc-ct);
 
@@ -221,7 +220,7 @@
 
 	/* Map and establish the interrupt. */
 
-	sc-sc_ih = cardbus_intr_establish(cc, cf, csc-intrline, IPL_NET,
+	sc-sc_ih = Cardbus_intr_establish(ct, csc-intrline, IPL_NET,
 	fxp_intr, sc);
 	if (NULL == sc-sc_ih) {
 		aprint_error_dev(sc-sc_dev, couldn't establish interrupt\n);
@@ -235,12 +234,10 @@
 fxp_cardbus_disable(struct fxp_softc * sc)
 {
 	struct fxp_cardbus_softc *csc = (struct fxp_cardbus_softc *)sc;
-	struct cardbus_devfunc *ct = csc-ct;
-	cardbus_chipset_tag_t cc = ct-ct_cc;
-	cardbus_function_tag_t cf = ct-ct_cf;
+	cardbus_devfunc_t ct = csc-ct;
 
 	/* Remove interrupt handler. */
-	cardbus_intr_disestablish(cc, cf, sc-sc_ih);
+	Cardbus_intr_disestablish(ct, sc-sc_ih);
 
 	Cardbus_function_disable(csc-ct);
 }
@@ -263,7 +260,7 @@
 	/*
 	 * Unhook the interrupt handler.
 	 */
-	cardbus_intr_disestablish(ct-ct_cc, ct-ct_cf, sc-sc_ih);
+	Cardbus_intr_disestablish(ct, sc-sc_ih);
 
 	/*
 	 * release bus space and close window



CVS commit: src/sys/dev/cardbus

2010-03-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Mar 18 20:54:56 UTC 2010

Modified Files:
src/sys/dev/cardbus: adv_cardbus.c ahc_cardbus.c com_cardbus.c
siisata_cardbus.c uhci_cardbus.c

Log Message:
This is *always* compiled with #define rbus 1, so get rid of the
conditional compilation.

Simplify interrupt (dis)establishment by two source transformations:

-   cardbus_intr_disestablish(cc, cf, ih);
+   Cardbus_intr_disestablish(ct, ih);

-   ih = cardbus_intr_establish(cc, cf, ...);
+   ih = Cardbus_intr_establish(ct, ...);

The identical change to a few other CardBus NICs has not caused any
problems, as expected, so I'm going to commit this rather safe change
and get on with the work.

Testers have been enlisted.  I will revisit this change if I get any
negative responses.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/cardbus/adv_cardbus.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/cardbus/ahc_cardbus.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/cardbus/com_cardbus.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/cardbus/siisata_cardbus.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/cardbus/uhci_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/adv_cardbus.c
diff -u src/sys/dev/cardbus/adv_cardbus.c:1.26 src/sys/dev/cardbus/adv_cardbus.c:1.27
--- src/sys/dev/cardbus/adv_cardbus.c:1.26	Fri Feb 26 00:57:01 2010
+++ src/sys/dev/cardbus/adv_cardbus.c	Thu Mar 18 20:54:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: adv_cardbus.c,v 1.26 2010/02/26 00:57:01 dyoung Exp $	*/
+/*	$NetBSD: adv_cardbus.c,v 1.27 2010/03/18 20:54:56 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.26 2010/02/26 00:57:01 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: adv_cardbus.c,v 1.27 2010/03/18 20:54:56 dyoung Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -109,8 +109,6 @@
 	struct adv_cardbus_softc *csc = device_private(self);
 	struct asc_softc *sc = csc-sc_adv;
 	cardbus_devfunc_t ct = ca-ca_ct;
-	cardbus_chipset_tag_t cc = ct-ct_cc;
-	cardbus_function_tag_t cf = ct-ct_cf;
 	bus_space_tag_t iot;
 	bus_space_handle_t ioh;
 	pcireg_t reg;
@@ -181,20 +179,20 @@
 	}
 
 	/* Enable the appropriate bits in the PCI CSR. */
-	reg = cardbus_conf_read(cc, cf, ca-ca_tag, PCI_COMMAND_STATUS_REG);
+	reg = Cardbus_conf_read(ct, ca-ca_tag, PCI_COMMAND_STATUS_REG);
 	reg = ~(PCI_COMMAND_IO_ENABLE|PCI_COMMAND_MEM_ENABLE);
 	reg |= csc-sc_csr;
-	cardbus_conf_write(cc, cf, ca-ca_tag, PCI_COMMAND_STATUS_REG, reg);
+	Cardbus_conf_write(ct, ca-ca_tag, PCI_COMMAND_STATUS_REG, reg);
 
 	/*
 	 * Make sure the latency timer is set to some reasonable
 	 * value.
 	 */
-	reg = cardbus_conf_read(cc, cf, ca-ca_tag, PCI_BHLC_REG);
+	reg = Cardbus_conf_read(ct, ca-ca_tag, PCI_BHLC_REG);
 	if (PCI_LATTIMER(reg)  latency) {
 		reg = ~(PCI_LATTIMER_MASK  PCI_LATTIMER_SHIFT);
 		reg |= (latency  PCI_LATTIMER_SHIFT);
-		cardbus_conf_write(cc, cf, ca-ca_tag, PCI_BHLC_REG, reg);
+		Cardbus_conf_write(ct, ca-ca_tag, PCI_BHLC_REG, reg);
 	}
 
 	ASC_SET_CHIP_CONTROL(iot, ioh, ASC_CC_HALT);
@@ -218,7 +216,7 @@
 	/*
 	 * Establish the interrupt.
 	 */
-	sc-sc_ih = cardbus_intr_establish(cc, cf, ca-ca_intrline, IPL_BIO,
+	sc-sc_ih = Cardbus_intr_establish(ct, ca-ca_intrline, IPL_BIO,
 	adv_intr, sc);
 	if (sc-sc_ih == NULL) {
 		aprint_error_dev(sc-sc_dev,
@@ -245,8 +243,7 @@
 		return rv;
 
 	if (sc-sc_ih) {
-		cardbus_intr_disestablish(csc-sc_ct-ct_cc,
-		csc-sc_ct-ct_cf, sc-sc_ih);
+		Cardbus_intr_disestablish(csc-sc_ct, sc-sc_ih);
 		sc-sc_ih = 0;
 	}
 

Index: src/sys/dev/cardbus/ahc_cardbus.c
diff -u src/sys/dev/cardbus/ahc_cardbus.c:1.33 src/sys/dev/cardbus/ahc_cardbus.c:1.34
--- src/sys/dev/cardbus/ahc_cardbus.c:1.33	Fri Feb 26 00:57:01 2010
+++ src/sys/dev/cardbus/ahc_cardbus.c	Thu Mar 18 20:54:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahc_cardbus.c,v 1.33 2010/02/26 00:57:01 dyoung Exp $	*/
+/*	$NetBSD: ahc_cardbus.c,v 1.34 2010/03/18 20:54:56 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.33 2010/02/26 00:57:01 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: ahc_cardbus.c,v 1.34 2010/03/18 20:54:56 dyoung Exp $);
 
 #include opt_ahc_cardbus.h
 
@@ -110,8 +110,6 @@
 	struct ahc_cardbus_softc *csc = device_private(self);
 	struct ahc_softc *ahc = csc-sc_ahc;
 	cardbus_devfunc_t ct = ca-ca_ct;
-	cardbus_chipset_tag_t cc = ct-ct_cc;
-	cardbus_function_tag_t cf = ct-ct_cf;
 	bus_space_tag_t bst;
 	bus_space_handle_t bsh;
 	pcireg_t reg;
@@ -146,20 +144,20 @@
 	}
 
 	/* Enable the appropriate bits in the PCI CSR. */
-	reg = cardbus_conf_read(cc, cf, ca-ca_tag, PCI_COMMAND_STATUS_REG);
+	reg = Cardbus_conf_read(ct, ca-ca_tag, PCI_COMMAND_STATUS_REG);
 	reg = 

CVS commit: src/sys/dev/cardbus

2010-03-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Fri Mar 19 01:34:46 UTC 2010

Modified Files:
src/sys/dev/cardbus: if_ex_cardbus.c

Log Message:
Use Cardbus_intr_disestablish() instead of cardbus_intr_disestablish().

Get rid of a (short) staircase in ex_cardbus_detach().


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/cardbus/if_ex_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/if_ex_cardbus.c
diff -u src/sys/dev/cardbus/if_ex_cardbus.c:1.51 src/sys/dev/cardbus/if_ex_cardbus.c:1.52
--- src/sys/dev/cardbus/if_ex_cardbus.c:1.51	Wed Mar 10 21:00:36 2010
+++ src/sys/dev/cardbus/if_ex_cardbus.c	Fri Mar 19 01:34:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ex_cardbus.c,v 1.51 2010/03/10 21:00:36 dyoung Exp $	*/
+/*	$NetBSD: if_ex_cardbus.c,v 1.52 2010/03/19 01:34:46 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1998 and 1999
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ex_cardbus.c,v 1.51 2010/03/10 21:00:36 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ex_cardbus.c,v 1.52 2010/03/19 01:34:46 dyoung Exp $);
 
 /* #define EX_DEBUG 4 */	/* define to report information for debugging */
 
@@ -300,7 +300,7 @@
 }
 
 int
-ex_cardbus_detach(device_t self, int arg)
+ex_cardbus_detach(device_t self, int flags)
 {
 	struct ex_cardbus_softc *csc = device_private(self);
 	struct ex_softc *sc = csc-sc_softc;
@@ -313,23 +313,23 @@
 	}
 #endif
 
-	rv = ex_detach(sc);
-	if (rv == 0) {
-		/*
-		 * Unhook the interrupt handler.
-		 */
-		Cardbus_intr_disestablish(ct, sc-sc_ih);
+	if ((rv = ex_detach(sc)) != 0)
+		return rv;
 
-		if (csc-sc_cardtype == EX_CB_CYCLONE) {
-			Cardbus_mapreg_unmap(ct,
-			CARDBUS_3C575BTX_FUNCSTAT_PCIREG,
-			csc-sc_funct, csc-sc_funch, csc-sc_funcsize);
-		}
+	/*
+	 * Unhook the interrupt handler.
+	 */
+	Cardbus_intr_disestablish(ct, sc-sc_ih);
 
-		Cardbus_mapreg_unmap(ct, PCI_BAR0, sc-sc_iot,
-		sc-sc_ioh, csc-sc_mapsize);
+	if (csc-sc_cardtype == EX_CB_CYCLONE) {
+		Cardbus_mapreg_unmap(ct,
+		CARDBUS_3C575BTX_FUNCSTAT_PCIREG,
+		csc-sc_funct, csc-sc_funch, csc-sc_funcsize);
 	}
-	return (rv);
+
+	Cardbus_mapreg_unmap(ct, PCI_BAR0, sc-sc_iot,
+	sc-sc_ioh, csc-sc_mapsize);
+	return 0;
 }
 
 int
@@ -354,11 +354,11 @@
 ex_cardbus_disable(struct ex_softc *sc)
 {
 	struct ex_cardbus_softc *csc = (struct ex_cardbus_softc *)sc;
-	cardbus_function_tag_t cf = csc-sc_ct-ct_cf;
-	cardbus_chipset_tag_t cc = csc-sc_ct-ct_cc;
 
-	cardbus_intr_disestablish(cc, cf, sc-sc_ih);
-	sc-sc_ih = NULL;
+	if (sc-sc_ih != NULL) {
+		Cardbus_intr_disestablish(csc-sc_ct, sc-sc_ih);
+		sc-sc_ih = NULL;
+	}
 
  	Cardbus_function_disable(csc-sc_ct);
 



CVS commit: src/sys/dev/cardbus

2010-03-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Fri Mar 19 01:44:05 UTC 2010

Modified Files:
src/sys/dev/cardbus: cardslot.c

Log Message:
Remove superfluous cast (device_t to device_t).


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/cardbus/cardslot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/cardslot.c
diff -u src/sys/dev/cardbus/cardslot.c:1.51 src/sys/dev/cardbus/cardslot.c:1.52
--- src/sys/dev/cardbus/cardslot.c:1.51	Tue Dec 15 22:17:12 2009
+++ src/sys/dev/cardbus/cardslot.c	Fri Mar 19 01:44:05 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cardslot.c,v 1.51 2009/12/15 22:17:12 snj Exp $	*/
+/*	$NetBSD: cardslot.c,v 1.52 2010/03/19 01:44:05 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1999 and 2000
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cardslot.c,v 1.51 2009/12/15 22:17:12 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: cardslot.c,v 1.52 2010/03/19 01:44:05 dyoung Exp $);
 
 #include opt_cardslot.h
 
@@ -382,7 +382,7 @@
 			}
 			if (sc-sc_16_softc) {
 CARDSLOT_SET_CARDTYPE(sc-sc_status, CARDSLOT_STATUS_CARD_16);
-if (pcmcia_card_attach((device_t)sc-sc_16_softc)) {
+if (pcmcia_card_attach(sc-sc_16_softc)) {
 	/* Do not attach */
 	CARDSLOT_SET_WORK(sc-sc_status,
 	CARDSLOT_STATUS_NOTWORK);



CVS commit: src/sys/dev/cardbus

2010-03-15 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Mon Mar 15 19:43:17 UTC 2010

Modified Files:
src/sys/dev/cardbus: cardbusvar.h

Log Message:
Delete unused members ct_rbus_iot and ct_rbus_memt from struct
cardbus_devfunc.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/cardbus/cardbusvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/cardbusvar.h
diff -u src/sys/dev/cardbus/cardbusvar.h:1.51 src/sys/dev/cardbus/cardbusvar.h:1.52
--- src/sys/dev/cardbus/cardbusvar.h:1.51	Thu Mar  4 22:37:38 2010
+++ src/sys/dev/cardbus/cardbusvar.h	Mon Mar 15 19:43:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cardbusvar.h,v 1.51 2010/03/04 22:37:38 dyoung Exp $	*/
+/*	$NetBSD: cardbusvar.h,v 1.52 2010/03/15 19:43:17 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 and 2000
@@ -177,9 +177,6 @@
 	int ct_bus;			/* bus number */
 	int ct_func;			/* function number */
 
-	rbus_tag_t ct_rbus_iot;		/* CardBus i/o rbus tag */
-	rbus_tag_t ct_rbus_memt;	/* CardBus mem rbus tag */
-
 	pcireg_t ct_bar[6];		/* Base Address Regs 0 to 6 */
 	pcireg_t ct_bhlc;		/* Latency timer and cache line size */
 	/* u_int32_t ct_cisreg; */	/* CIS reg: is it needed??? */



CVS commit: src/sys/dev/cardbus

2010-03-15 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Mon Mar 15 19:50:50 UTC 2010

Modified Files:
src/sys/dev/cardbus: cardbusvar.h

Log Message:
Delete unused member ct_bar[] from struct cardbus_devfunc.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/cardbus/cardbusvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/cardbusvar.h
diff -u src/sys/dev/cardbus/cardbusvar.h:1.53 src/sys/dev/cardbus/cardbusvar.h:1.54
--- src/sys/dev/cardbus/cardbusvar.h:1.53	Mon Mar 15 19:48:31 2010
+++ src/sys/dev/cardbus/cardbusvar.h	Mon Mar 15 19:50:50 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cardbusvar.h,v 1.53 2010/03/15 19:48:31 dyoung Exp $	*/
+/*	$NetBSD: cardbusvar.h,v 1.54 2010/03/15 19:50:50 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 and 2000
@@ -177,7 +177,6 @@
 	int ct_bus;			/* bus number */
 	int ct_func;			/* function number */
 
-	pcireg_t ct_bar[6];		/* Base Address Regs 0 to 6 */
 	pcireg_t ct_bhlc;		/* Latency timer and cache line size */
 	/* u_int32_t ct_cisreg; */	/* CIS reg: is it needed??? */
 



CVS commit: src/sys/dev/cardbus

2010-02-24 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Feb 24 19:52:52 UTC 2010

Modified Files:
src/sys/dev/cardbus: adv_cardbus.c ahc_cardbus.c cardbus_exrom.c
cardbus_map.c com_cardbus.c ehci_cardbus.c fwohci_cardbus.c
if_ath_cardbus.c if_ex_cardbus.c if_ral_cardbus.c if_re_cardbus.c
if_rtk_cardbus.c if_tlp_cardbus.c njata_cardbus.c njs_cardbus.c
ohci_cardbus.c rbus_ppb.c siisata_cardbus.c uhci_cardbus.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/cardbus/adv_cardbus.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/cardbus/ahc_cardbus.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/cardbus/cardbus_exrom.c \
src/sys/dev/cardbus/njs_cardbus.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/cardbus/cardbus_map.c \
src/sys/dev/cardbus/rbus_ppb.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/cardbus/com_cardbus.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/cardbus/ehci_cardbus.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/cardbus/fwohci_cardbus.c
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/cardbus/if_ath_cardbus.c
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/cardbus/if_ex_cardbus.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/cardbus/if_ral_cardbus.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/cardbus/if_re_cardbus.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/cardbus/if_rtk_cardbus.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/cardbus/if_tlp_cardbus.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/cardbus/njata_cardbus.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/cardbus/ohci_cardbus.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/cardbus/siisata_cardbus.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/cardbus/uhci_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/adv_cardbus.c
diff -u src/sys/dev/cardbus/adv_cardbus.c:1.22 src/sys/dev/cardbus/adv_cardbus.c:1.23
--- src/sys/dev/cardbus/adv_cardbus.c:1.22	Tue May 12 14:17:31 2009
+++ src/sys/dev/cardbus/adv_cardbus.c	Wed Feb 24 19:52:51 2010
@@ -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;
 
 	/*

Index: src/sys/dev/cardbus/ahc_cardbus.c
diff -u src/sys/dev/cardbus/ahc_cardbus.c:1.29 src/sys/dev/cardbus/ahc_cardbus.c:1.30
--- src/sys/dev/cardbus/ahc_cardbus.c:1.29	Thu Nov 12 19:21:03 2009
+++ src/sys/dev/cardbus/ahc_cardbus.c	Wed Feb 24 19:52:51 2010
@@ -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);
 

Index: src/sys/dev/cardbus/cardbus_exrom.c
diff -u src/sys/dev/cardbus/cardbus_exrom.c:1.11 src/sys/dev/cardbus/cardbus_exrom.c:1.12
--- src/sys/dev/cardbus/cardbus_exrom.c:1.11	Tue Apr 29 06:53:02 2008
+++ src/sys/dev/cardbus/cardbus_exrom.c	Wed Feb 24 19:52:51 2010
@@ -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 

CVS commit: src/sys/dev/cardbus

2010-01-18 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Jan 18 18:52:35 UTC 2010

Modified Files:
src/sys/dev/cardbus: if_ath_cardbus.c if_atw_cardbus.c if_fxp_cardbus.c
if_ral_cardbus.c if_rtk_cardbus.c if_rtw_cardbus.c if_tlp_cardbus.c

Log Message:
Remove conditional inclusion of unused bpf.h


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/cardbus/if_ath_cardbus.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/cardbus/if_atw_cardbus.c
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/cardbus/if_fxp_cardbus.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/cardbus/if_ral_cardbus.c
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/cardbus/if_rtk_cardbus.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/cardbus/if_rtw_cardbus.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/cardbus/if_tlp_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/if_ath_cardbus.c
diff -u src/sys/dev/cardbus/if_ath_cardbus.c:1.37 src/sys/dev/cardbus/if_ath_cardbus.c:1.38
--- src/sys/dev/cardbus/if_ath_cardbus.c:1.37	Fri Jan  8 19:47:42 2010
+++ src/sys/dev/cardbus/if_ath_cardbus.c	Mon Jan 18 18:52:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ath_cardbus.c,v 1.37 2010/01/08 19:47:42 dyoung Exp $ */
+/*	$NetBSD: if_ath_cardbus.c,v 1.38 2010/01/18 18:52:35 pooka Exp $ */
 /*
  * Copyright (c) 2003
  *	Ichiro FUKUHARA ich...@ichiro.org.
@@ -30,10 +30,9 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ath_cardbus.c,v 1.37 2010/01/08 19:47:42 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ath_cardbus.c,v 1.38 2010/01/18 18:52:35 pooka Exp $);
 
 #include opt_inet.h
-#include bpfilter.h
 
 #include sys/param.h
 #include sys/systm.h
@@ -55,10 +54,6 @@
 #include net80211/ieee80211_netbsd.h
 #include net80211/ieee80211_var.h
 
-#if NBPFILTER  0
-#include net/bpf.h
-#endif
-
 #ifdef INET
 #include netinet/in.h
 #include netinet/if_inarp.h

Index: src/sys/dev/cardbus/if_atw_cardbus.c
diff -u src/sys/dev/cardbus/if_atw_cardbus.c:1.28 src/sys/dev/cardbus/if_atw_cardbus.c:1.29
--- src/sys/dev/cardbus/if_atw_cardbus.c:1.28	Fri Jan  8 19:47:42 2010
+++ src/sys/dev/cardbus/if_atw_cardbus.c	Mon Jan 18 18:52:35 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: if_atw_cardbus.c,v 1.28 2010/01/08 19:47:42 dyoung Exp $ */
+/* $NetBSD: if_atw_cardbus.c,v 1.29 2010/01/18 18:52:35 pooka Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2003 The NetBSD Foundation, Inc.
@@ -36,10 +36,9 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_atw_cardbus.c,v 1.28 2010/01/08 19:47:42 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_atw_cardbus.c,v 1.29 2010/01/18 18:52:35 pooka Exp $);
 
 #include opt_inet.h
-#include bpfilter.h
 
 #include sys/param.h
 #include sys/systm.h
@@ -62,10 +61,6 @@
 #include net80211/ieee80211_radiotap.h
 #include net80211/ieee80211_var.h
 
-#if NBPFILTER  0
-#include net/bpf.h
-#endif
-
 #ifdef INET
 #include netinet/in.h
 #include netinet/if_inarp.h

Index: src/sys/dev/cardbus/if_fxp_cardbus.c
diff -u src/sys/dev/cardbus/if_fxp_cardbus.c:1.40 src/sys/dev/cardbus/if_fxp_cardbus.c:1.41
--- src/sys/dev/cardbus/if_fxp_cardbus.c:1.40	Sat Sep  5 14:50:10 2009
+++ src/sys/dev/cardbus/if_fxp_cardbus.c	Mon Jan 18 18:52:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_fxp_cardbus.c,v 1.40 2009/09/05 14:50:10 tsutsui Exp $	*/
+/*	$NetBSD: if_fxp_cardbus.c,v 1.41 2010/01/18 18:52:35 pooka Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,10 +34,9 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_fxp_cardbus.c,v 1.40 2009/09/05 14:50:10 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_fxp_cardbus.c,v 1.41 2010/01/18 18:52:35 pooka Exp $);
 
 #include opt_inet.h
-#include bpfilter.h
 #include rnd.h
 
 #include sys/param.h
@@ -61,10 +60,6 @@
 
 #include machine/endian.h
 
-#if NBPFILTER  0
-#include net/bpf.h
-#endif
-
 #ifdef INET
 #include netinet/in.h
 #include netinet/if_inarp.h

Index: src/sys/dev/cardbus/if_ral_cardbus.c
diff -u src/sys/dev/cardbus/if_ral_cardbus.c:1.16 src/sys/dev/cardbus/if_ral_cardbus.c:1.17
--- src/sys/dev/cardbus/if_ral_cardbus.c:1.16	Tue May 12 14:17:31 2009
+++ src/sys/dev/cardbus/if_ral_cardbus.c	Mon Jan 18 18:52:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ral_cardbus.c,v 1.16 2009/05/12 14:17:31 cegger Exp $	*/
+/*	$NetBSD: if_ral_cardbus.c,v 1.17 2010/01/18 18:52:35 pooka Exp $	*/
 /*	$OpenBSD: if_ral_cardbus.c,v 1.6 2006/01/09 20:03:31 damien Exp $  */
 
 /*-
@@ -22,9 +22,8 @@
  * CardBus front-end for the Ralink RT2560/RT2561/RT2561S/RT2661 driver.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ral_cardbus.c,v 1.16 2009/05/12 14:17:31 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ral_cardbus.c,v 1.17 2010/01/18 18:52:35 pooka Exp $);
 
-#include bpfilter.h
 
 #include sys/param.h
 #include sys/sockio.h

Index: src/sys/dev/cardbus/if_rtk_cardbus.c
diff -u src/sys/dev/cardbus/if_rtk_cardbus.c:1.38 src/sys/dev/cardbus/if_rtk_cardbus.c:1.39
--- 

CVS commit: src/sys/dev/cardbus

2010-01-08 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Fri Jan  8 19:47:42 UTC 2010

Modified Files:
src/sys/dev/cardbus: cardbus.c ehci_cardbus.c if_ath_cardbus.c
if_atw_cardbus.c if_rtw_cardbus.c siisata_cardbus.c

Log Message:
Expand PMF_FN_* macros.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/cardbus/cardbus.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/cardbus/ehci_cardbus.c
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/cardbus/if_ath_cardbus.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/cardbus/if_atw_cardbus.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/cardbus/if_rtw_cardbus.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/cardbus/siisata_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/cardbus.c
diff -u src/sys/dev/cardbus/cardbus.c:1.98 src/sys/dev/cardbus/cardbus.c:1.99
--- src/sys/dev/cardbus/cardbus.c:1.98	Tue Dec 15 22:17:12 2009
+++ src/sys/dev/cardbus/cardbus.c	Fri Jan  8 19:47:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cardbus.c,v 1.98 2009/12/15 22:17:12 snj Exp $	*/
+/*	$NetBSD: cardbus.c,v 1.99 2010/01/08 19:47:42 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 1999 and 2000
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cardbus.c,v 1.98 2009/12/15 22:17:12 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: cardbus.c,v 1.99 2010/01/08 19:47:42 dyoung Exp $);
 
 #include opt_cardbus.h
 
@@ -1166,7 +1166,7 @@
 };
 
 static bool
-cardbus_child_suspend(device_t dv PMF_FN_ARGS)
+cardbus_child_suspend(device_t dv, pmf_qual_t qual)
 {
 	struct cardbus_child_power *priv = device_pmf_bus_private(dv);
 
@@ -1186,7 +1186,7 @@
 }
 
 static bool
-cardbus_child_resume(device_t dv PMF_FN_ARGS)
+cardbus_child_resume(device_t dv, pmf_qual_t qual)
 {
 	struct cardbus_child_power *priv = device_pmf_bus_private(dv);
 

Index: src/sys/dev/cardbus/ehci_cardbus.c
diff -u src/sys/dev/cardbus/ehci_cardbus.c:1.23 src/sys/dev/cardbus/ehci_cardbus.c:1.24
--- src/sys/dev/cardbus/ehci_cardbus.c:1.23	Tue May 12 12:11:17 2009
+++ src/sys/dev/cardbus/ehci_cardbus.c	Fri Jan  8 19:47:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci_cardbus.c,v 1.23 2009/05/12 12:11:17 cegger Exp $	*/
+/*	$NetBSD: ehci_cardbus.c,v 1.24 2010/01/08 19:47:42 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ehci_cardbus.c,v 1.23 2009/05/12 12:11:17 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: ehci_cardbus.c,v 1.24 2010/01/08 19:47:42 dyoung Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -102,9 +102,9 @@
 }
 
 static bool
-ehci_cardbus_suspend(device_t dv PMF_FN_ARGS)
+ehci_cardbus_suspend(device_t dv, pmf_qual_t qual)
 {
-	ehci_suspend(dv PMF_FN_CALL);
+	ehci_suspend(dv, qual);
 #if 0
 	struct ehci_cardbus_softc *sc = device_private(dv);
 	ehci_release_ownership(sc-sc, sc-sc_pc, sc-sc_tag);
@@ -114,13 +114,13 @@
 }
 
 static bool
-ehci_cardbus_resume(device_t dv PMF_FN_ARGS)
+ehci_cardbus_resume(device_t dv, pmf_qual_t qual)
 {
 #if 0
 	struct ehci_cardbus_softc *sc = device_private(dv);
 	ehci_get_ownership(sc-sc, sc-sc_pc, sc-sc_tag);
 #endif
-	return ehci_resume(dv PMF_FN_CALL);
+	return ehci_resume(dv, qual);
 }
 
 void

Index: src/sys/dev/cardbus/if_ath_cardbus.c
diff -u src/sys/dev/cardbus/if_ath_cardbus.c:1.36 src/sys/dev/cardbus/if_ath_cardbus.c:1.37
--- src/sys/dev/cardbus/if_ath_cardbus.c:1.36	Wed Oct 21 14:15:52 2009
+++ src/sys/dev/cardbus/if_ath_cardbus.c	Fri Jan  8 19:47:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ath_cardbus.c,v 1.36 2009/10/21 14:15:52 rmind Exp $ */
+/*	$NetBSD: if_ath_cardbus.c,v 1.37 2010/01/08 19:47:42 dyoung Exp $ */
 /*
  * Copyright (c) 2003
  *	Ichiro FUKUHARA ich...@ichiro.org.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ath_cardbus.c,v 1.36 2009/10/21 14:15:52 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ath_cardbus.c,v 1.37 2010/01/08 19:47:42 dyoung Exp $);
 
 #include opt_inet.h
 #include bpfilter.h
@@ -114,7 +114,7 @@
 void	ath_cardbus_setup(struct ath_cardbus_softc *);
 
 static bool
-ath_cardbus_suspend(device_t self PMF_FN_ARGS)
+ath_cardbus_suspend(device_t self, pmf_qual_t qual)
 {
 	struct ath_cardbus_softc *csc = device_private(self);
 
@@ -128,7 +128,7 @@
 }
 
 static bool
-ath_cardbus_resume(device_t self PMF_FN_ARGS)
+ath_cardbus_resume(device_t self, pmf_qual_t qual)
 {
 	struct ath_cardbus_softc *csc = device_private(self);
 

Index: src/sys/dev/cardbus/if_atw_cardbus.c
diff -u src/sys/dev/cardbus/if_atw_cardbus.c:1.27 src/sys/dev/cardbus/if_atw_cardbus.c:1.28
--- src/sys/dev/cardbus/if_atw_cardbus.c:1.27	Wed Sep 16 16:34:50 2009
+++ src/sys/dev/cardbus/if_atw_cardbus.c	Fri Jan  8 19:47:42 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: if_atw_cardbus.c,v 1.27 2009/09/16 16:34:50 dyoung Exp $ */
+/* $NetBSD: if_atw_cardbus.c,v 1.28 2010/01/08 19:47:42 dyoung Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2003 The 

CVS commit: src/sys/dev/cardbus

2009-11-12 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Nov 12 20:30:29 UTC 2009

Modified Files:
src/sys/dev/cardbus: com_cardbus.c

Log Message:
Don't use com_activate(), it's going away.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/cardbus/com_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/com_cardbus.c
diff -u src/sys/dev/cardbus/com_cardbus.c:1.22 src/sys/dev/cardbus/com_cardbus.c:1.23
--- src/sys/dev/cardbus/com_cardbus.c:1.22	Tue Jun 24 19:44:52 2008
+++ src/sys/dev/cardbus/com_cardbus.c	Thu Nov 12 20:30:29 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: com_cardbus.c,v 1.22 2008/06/24 19:44:52 drochner Exp $ */
+/* $NetBSD: com_cardbus.c,v 1.23 2009/11/12 20:30:29 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.22 2008/06/24 19:44:52 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: com_cardbus.c,v 1.23 2009/11/12 20:30:29 dyoung Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -80,7 +80,7 @@
 static void com_cardbus_disable(struct com_softc*);
 
 CFATTACH_DECL_NEW(com_cardbus, sizeof(struct com_cardbus_softc),
-com_cardbus_match, com_cardbus_attach, com_cardbus_detach, com_activate);
+com_cardbus_match, com_cardbus_attach, com_cardbus_detach, NULL);
 
 static struct csdev {
 	int		vendor;



CVS commit: src/sys/dev/cardbus

2009-09-05 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  5 14:50:10 UTC 2009

Modified Files:
src/sys/dev/cardbus: if_ath_cardbus.c if_fxp_cardbus.c if_rtk_cardbus.c
if_rtw_cardbus.c

Log Message:
Invert logic around nested pmf(9) registrations for readability.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/cardbus/if_ath_cardbus.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/cardbus/if_fxp_cardbus.c
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/cardbus/if_rtk_cardbus.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/cardbus/if_rtw_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/if_ath_cardbus.c
diff -u src/sys/dev/cardbus/if_ath_cardbus.c:1.33 src/sys/dev/cardbus/if_ath_cardbus.c:1.34
--- src/sys/dev/cardbus/if_ath_cardbus.c:1.33	Tue May 12 12:11:17 2009
+++ src/sys/dev/cardbus/if_ath_cardbus.c	Sat Sep  5 14:50:10 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ath_cardbus.c,v 1.33 2009/05/12 12:11:17 cegger Exp $ */
+/*	$NetBSD: if_ath_cardbus.c,v 1.34 2009/09/05 14:50:10 tsutsui Exp $ */
 /*
  * Copyright (c) 2003
  *	Ichiro FUKUHARA ich...@ichiro.org.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ath_cardbus.c,v 1.33 2009/05/12 12:11:17 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ath_cardbus.c,v 1.34 2009/09/05 14:50:10 tsutsui Exp $);
 
 #include opt_inet.h
 #include bpfilter.h
@@ -215,12 +215,12 @@
 	if (ath_attach(PCI_PRODUCT(ca-ca_id), sc) != 0)
 		return;
 
-	if (!pmf_device_register(self, ath_cardbus_suspend, ath_cardbus_resume))
-		aprint_error_dev(self, couldn't establish power handler\n);
-	else {
+	if (pmf_device_register(self,
+	ath_cardbus_suspend, ath_cardbus_resume)) {
 		pmf_class_network_register(self, sc-sc_if);
 		pmf_device_suspend_self(self);
-	}
+	} else
+		aprint_error_dev(self, couldn't establish power handler\n);
 }
 
 int

Index: src/sys/dev/cardbus/if_fxp_cardbus.c
diff -u src/sys/dev/cardbus/if_fxp_cardbus.c:1.39 src/sys/dev/cardbus/if_fxp_cardbus.c:1.40
--- src/sys/dev/cardbus/if_fxp_cardbus.c:1.39	Tue May 12 14:17:31 2009
+++ src/sys/dev/cardbus/if_fxp_cardbus.c	Sat Sep  5 14:50:10 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_fxp_cardbus.c,v 1.39 2009/05/12 14:17:31 cegger Exp $	*/
+/*	$NetBSD: if_fxp_cardbus.c,v 1.40 2009/09/05 14:50:10 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_fxp_cardbus.c,v 1.39 2009/05/12 14:17:31 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_fxp_cardbus.c,v 1.40 2009/09/05 14:50:10 tsutsui Exp $);
 
 #include opt_inet.h
 #include bpfilter.h
@@ -183,10 +183,10 @@
 	fxp_attach(sc);
 	fxp_disable(sc);
 
-	if (!pmf_device_register(self, NULL, NULL))
-		aprint_error_dev(self, couldn't establish power handler\n);
-	else
+	if (pmf_device_register(self, NULL, NULL))
 		pmf_class_network_register(self, sc-sc_ethercom.ec_if);
+	else
+		aprint_error_dev(self, couldn't establish power handler\n);
 }
 
 static void

Index: src/sys/dev/cardbus/if_rtk_cardbus.c
diff -u src/sys/dev/cardbus/if_rtk_cardbus.c:1.37 src/sys/dev/cardbus/if_rtk_cardbus.c:1.38
--- src/sys/dev/cardbus/if_rtk_cardbus.c:1.37	Tue Jun 24 19:44:52 2008
+++ src/sys/dev/cardbus/if_rtk_cardbus.c	Sat Sep  5 14:50:10 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_rtk_cardbus.c,v 1.37 2008/06/24 19:44:52 drochner Exp $	*/
+/*	$NetBSD: if_rtk_cardbus.c,v 1.38 2009/09/05 14:50:10 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2000 Masanori Kanaoka
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_rtk_cardbus.c,v 1.37 2008/06/24 19:44:52 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_rtk_cardbus.c,v 1.38 2009/09/05 14:50:10 tsutsui Exp $);
 
 #include opt_inet.h
 #include bpfilter.h
@@ -246,10 +246,10 @@
 
 	rtk_attach(sc);
 
-	if (!pmf_device_register(self, NULL, NULL))
-		aprint_error_dev(self, couldn't establish power handler\n);
-	else
+	if (pmf_device_register(self, NULL, NULL))
 		pmf_class_network_register(self, sc-ethercom.ec_if);
+	else
+		aprint_error_dev(self, couldn't establish power handler\n);
 
 	/*
 	 * Power down the socket.

Index: src/sys/dev/cardbus/if_rtw_cardbus.c
diff -u src/sys/dev/cardbus/if_rtw_cardbus.c:1.29 src/sys/dev/cardbus/if_rtw_cardbus.c:1.30
--- src/sys/dev/cardbus/if_rtw_cardbus.c:1.29	Tue May 12 12:11:17 2009
+++ src/sys/dev/cardbus/if_rtw_cardbus.c	Sat Sep  5 14:50:10 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: if_rtw_cardbus.c,v 1.29 2009/05/12 12:11:17 cegger Exp $ */
+/* $NetBSD: if_rtw_cardbus.c,v 1.30 2009/09/05 14:50:10 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2004, 2005 David Young.  All rights reserved.
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_rtw_cardbus.c,v 1.29 2009/05/12 12:11:17 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_rtw_cardbus.c,v 1.30 2009/09/05 14:50:10 tsutsui Exp $);
 
 #include opt_inet.h
 #include bpfilter.h
@@ -296,15 

CVS commit: src/sys/dev/cardbus

2009-05-12 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue May 12 12:11:17 UTC 2009

Modified Files:
src/sys/dev/cardbus: adv_cardbus.c cardbus.c cardslot.c ehci_cardbus.c
fwohci_cardbus.c if_ath_cardbus.c if_fxp_cardbus.c if_ral_cardbus.c
if_rtw_cardbus.c ohci_cardbus.c rbus_ppb.c uhci_cardbus.c

Log Message:
struct cfdata * - cfdata_t, no functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/cardbus/adv_cardbus.c
cvs rdiff -u -r1.96 -r1.97 src/sys/dev/cardbus/cardbus.c
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/cardbus/cardslot.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/cardbus/ehci_cardbus.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/cardbus/fwohci_cardbus.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/cardbus/if_ath_cardbus.c
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/cardbus/if_fxp_cardbus.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/cardbus/if_ral_cardbus.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/cardbus/if_rtw_cardbus.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/cardbus/ohci_cardbus.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/cardbus/rbus_ppb.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/cardbus/uhci_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/adv_cardbus.c
diff -u src/sys/dev/cardbus/adv_cardbus.c:1.20 src/sys/dev/cardbus/adv_cardbus.c:1.21
--- src/sys/dev/cardbus/adv_cardbus.c:1.20	Sat Mar 14 15:36:16 2009
+++ src/sys/dev/cardbus/adv_cardbus.c	Tue May 12 12:11:17 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: adv_cardbus.c,v 1.20 2009/03/14 15:36:16 dsl Exp $	*/
+/*	$NetBSD: adv_cardbus.c,v 1.21 2009/05/12 12:11:17 cegger 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.20 2009/03/14 15:36:16 dsl Exp $);
+__KERNEL_RCSID(0, $NetBSD: adv_cardbus.c,v 1.21 2009/05/12 12:11:17 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -82,7 +82,7 @@
 	bus_size_t sc_size;
 };
 
-int	adv_cardbus_match(struct device *, struct cfdata *, void *);
+int	adv_cardbus_match(struct device *, cfdata_t, void *);
 void	adv_cardbus_attach(struct device *, struct device *, void *);
 int	adv_cardbus_detach(struct device *, int);
 
@@ -90,7 +90,7 @@
 adv_cardbus_match, adv_cardbus_attach, adv_cardbus_detach, NULL);
 
 int
-adv_cardbus_match(struct device *parent, struct cfdata *match,
+adv_cardbus_match(struct device *parent, cfdata_t match,
 void *aux)
 {
 	struct cardbus_attach_args *ca = aux;

Index: src/sys/dev/cardbus/cardbus.c
diff -u src/sys/dev/cardbus/cardbus.c:1.96 src/sys/dev/cardbus/cardbus.c:1.97
--- src/sys/dev/cardbus/cardbus.c:1.96	Thu Apr  2 00:09:33 2009
+++ src/sys/dev/cardbus/cardbus.c	Tue May 12 12:11:17 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cardbus.c,v 1.96 2009/04/02 00:09:33 dyoung Exp $	*/
+/*	$NetBSD: cardbus.c,v 1.97 2009/05/12 12:11:17 cegger Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 1999 and 2000
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cardbus.c,v 1.96 2009/04/02 00:09:33 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: cardbus.c,v 1.97 2009/05/12 12:11:17 cegger Exp $);
 
 #include opt_cardbus.h
 
@@ -71,7 +71,7 @@
 
 STATIC void cardbusattach(device_t, device_t, void *);
 STATIC int cardbusdetach(device_t, int);
-STATIC int cardbusmatch(device_t, struct cfdata *, void *);
+STATIC int cardbusmatch(device_t, cfdata_t, void *);
 int cardbus_rescan(device_t, const char *, const int *);
 void cardbus_childdetached(device_t, device_t);
 static int cardbusprint(void *, const char *);
@@ -103,7 +103,7 @@
 
 
 STATIC int
-cardbusmatch(device_t parent, struct cfdata *cf, void *aux)
+cardbusmatch(device_t parent, cfdata_t cf, void *aux)
 {
 
 	return (1);

Index: src/sys/dev/cardbus/cardslot.c
diff -u src/sys/dev/cardbus/cardslot.c:1.47 src/sys/dev/cardbus/cardslot.c:1.48
--- src/sys/dev/cardbus/cardslot.c:1.47	Thu Apr  2 00:09:33 2009
+++ src/sys/dev/cardbus/cardslot.c	Tue May 12 12:11:17 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cardslot.c,v 1.47 2009/04/02 00:09:33 dyoung Exp $	*/
+/*	$NetBSD: cardslot.c,v 1.48 2009/05/12 12:11:17 cegger Exp $	*/
 
 /*
  * Copyright (c) 1999 and 2000
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cardslot.c,v 1.47 2009/04/02 00:09:33 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: cardslot.c,v 1.48 2009/05/12 12:11:17 cegger Exp $);
 
 #include opt_cardslot.h
 
@@ -67,12 +67,12 @@
 STATIC void cardslotattach(struct device *, struct device *, void *);
 STATIC int cardslotdetach(device_t, int);
 
-STATIC int cardslotmatch(struct device *, struct cfdata *, void *);
+STATIC int cardslotmatch(struct device *, cfdata_t, void *);
 static void cardslot_event_thread(void *arg);
 
 STATIC int cardslot_cb_print(void *aux, const char *pcic);
 static int cardslot_16_print(void *, const char *);
-static int cardslot_16_submatch(struct device *, struct 

CVS commit: src/sys/dev/cardbus

2009-05-12 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue May 12 14:17:31 UTC 2009

Modified Files:
src/sys/dev/cardbus: adv_cardbus.c cardslot.c if_fxp_cardbus.c
if_ral_cardbus.c njata_cardbus.c njs_cardbus.c rbus_ppb.c

Log Message:
struct device * - device_t, no functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/cardbus/adv_cardbus.c
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/cardbus/cardslot.c
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/cardbus/if_fxp_cardbus.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/cardbus/if_ral_cardbus.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/cardbus/njata_cardbus.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/cardbus/njs_cardbus.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/cardbus/rbus_ppb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/adv_cardbus.c
diff -u src/sys/dev/cardbus/adv_cardbus.c:1.21 src/sys/dev/cardbus/adv_cardbus.c:1.22
--- src/sys/dev/cardbus/adv_cardbus.c:1.21	Tue May 12 12:11:17 2009
+++ src/sys/dev/cardbus/adv_cardbus.c	Tue May 12 14:17:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: adv_cardbus.c,v 1.21 2009/05/12 12:11:17 cegger Exp $	*/
+/*	$NetBSD: adv_cardbus.c,v 1.22 2009/05/12 14:17:31 cegger 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.21 2009/05/12 12:11:17 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: adv_cardbus.c,v 1.22 2009/05/12 14:17:31 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -82,15 +82,15 @@
 	bus_size_t sc_size;
 };
 
-int	adv_cardbus_match(struct device *, cfdata_t, void *);
-void	adv_cardbus_attach(struct device *, struct device *, void *);
-int	adv_cardbus_detach(struct device *, int);
+int	adv_cardbus_match(device_t, cfdata_t, void *);
+void	adv_cardbus_attach(device_t, device_t, void *);
+int	adv_cardbus_detach(device_t, int);
 
 CFATTACH_DECL(adv_cardbus, sizeof(struct adv_cardbus_softc),
 adv_cardbus_match, adv_cardbus_attach, adv_cardbus_detach, NULL);
 
 int
-adv_cardbus_match(struct device *parent, cfdata_t match,
+adv_cardbus_match(device_t parent, cfdata_t match,
 void *aux)
 {
 	struct cardbus_attach_args *ca = aux;
@@ -103,7 +103,7 @@
 }
 
 void
-adv_cardbus_attach(struct device *parent, struct device *self,
+adv_cardbus_attach(device_t parent, device_t self,
 void *aux)
 {
 	struct cardbus_attach_args *ca = aux;
@@ -239,7 +239,7 @@
 }
 
 int
-adv_cardbus_detach(struct device *self, int flags)
+adv_cardbus_detach(device_t self, int flags)
 {
 	struct adv_cardbus_softc *csc = device_private(self);
 	struct asc_softc *sc = csc-sc_adv;

Index: src/sys/dev/cardbus/cardslot.c
diff -u src/sys/dev/cardbus/cardslot.c:1.48 src/sys/dev/cardbus/cardslot.c:1.49
--- src/sys/dev/cardbus/cardslot.c:1.48	Tue May 12 12:11:17 2009
+++ src/sys/dev/cardbus/cardslot.c	Tue May 12 14:17:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cardslot.c,v 1.48 2009/05/12 12:11:17 cegger Exp $	*/
+/*	$NetBSD: cardslot.c,v 1.49 2009/05/12 14:17:31 cegger Exp $	*/
 
 /*
  * Copyright (c) 1999 and 2000
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cardslot.c,v 1.48 2009/05/12 12:11:17 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: cardslot.c,v 1.49 2009/05/12 14:17:31 cegger Exp $);
 
 #include opt_cardslot.h
 
@@ -64,15 +64,15 @@
 
 
 
-STATIC void cardslotattach(struct device *, struct device *, void *);
+STATIC void cardslotattach(device_t, device_t, void *);
 STATIC int cardslotdetach(device_t, int);
 
-STATIC int cardslotmatch(struct device *, cfdata_t, void *);
+STATIC int cardslotmatch(device_t, cfdata_t, void *);
 static void cardslot_event_thread(void *arg);
 
 STATIC int cardslot_cb_print(void *aux, const char *pcic);
 static int cardslot_16_print(void *, const char *);
-static int cardslot_16_submatch(struct device *, cfdata_t,
+static int cardslot_16_submatch(device_t, cfdata_t,
  const int *, void *);
 
 CFATTACH_DECL3_NEW(cardslot, sizeof(struct cardslot_softc),
@@ -80,7 +80,7 @@
 DVF_DETACH_SHUTDOWN);
 
 STATIC int
-cardslotmatch(struct device *parent, cfdata_t cf,
+cardslotmatch(device_t parent, cfdata_t cf,
 void *aux)
 {
 	struct cardslot_attach_args *caa = aux;
@@ -96,7 +96,7 @@
 
 
 STATIC void
-cardslotattach(struct device *parent, struct device *self,
+cardslotattach(device_t parent, device_t self,
 void *aux)
 {
 	struct cardslot_softc *sc = device_private(self);
@@ -204,7 +204,7 @@
 
 
 static int
-cardslot_16_submatch(struct device *parent, cfdata_t cf,
+cardslot_16_submatch(device_t parent, cfdata_t cf,
 const int *ldesc, void *aux)
 {
 
@@ -375,7 +375,7 @@
 			}
 			if (sc-sc_16_softc) {
 CARDSLOT_SET_CARDTYPE(sc-sc_status, CARDSLOT_STATUS_CARD_16);
-if (pcmcia_card_attach((struct device *)sc-sc_16_softc)) {
+if (pcmcia_card_attach((device_t)sc-sc_16_softc)) {
 	/* Do not attach */