Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Make cosmetic changes in order to reduce differe...
details: https://anonhg.NetBSD.org/src/rev/e4cdb9fb804c
branches: trunk
changeset: 752722:e4cdb9fb804c
user: dyoung <dyoung%NetBSD.org@localhost>
date: Thu Mar 04 22:57:37 2010 +0000
description:
Make cosmetic changes in order to reduce differences with
sys/dev/cardbus/if_rtw_cardbus.c: remove an unnecessary #include.
Change a few cut & paste instances of ADM8211 to RTL8180. Make the
suspend & resume functions static, add declarations for them at the top
of the file, and move the functions themselves to the bottom.
diffstat:
sys/dev/pci/if_rtw_pci.c | 74 ++++++++++++++++++++++++-----------------------
1 files changed, 38 insertions(+), 36 deletions(-)
diffs (125 lines):
diff -r 94a0d8cfd6ca -r e4cdb9fb804c sys/dev/pci/if_rtw_pci.c
--- a/sys/dev/pci/if_rtw_pci.c Thu Mar 04 22:55:20 2010 +0000
+++ b/sys/dev/pci/if_rtw_pci.c Thu Mar 04 22:57:37 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_rtw_pci.c,v 1.17 2010/02/24 22:38:00 dyoung Exp $ */
+/* $NetBSD: if_rtw_pci.c,v 1.18 2010/03/04 22:57:37 dyoung Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rtw_pci.c,v 1.17 2010/02/24 22:38:00 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rtw_pci.c,v 1.18 2010/03/04 22:57:37 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -66,7 +66,6 @@
#include <sys/intr.h>
#include <dev/ic/rtwreg.h>
-#include <dev/ic/sa2400reg.h>
#include <dev/ic/rtwvar.h>
#include <dev/pci/pcivar.h>
@@ -74,13 +73,13 @@
#include <dev/pci/pcidevs.h>
/*
- * PCI configuration space registers used by the ADM8211.
+ * PCI configuration space registers used by the RTL8180.
*/
#define RTW_PCI_IOBA 0x10 /* i/o mapped base */
#define RTW_PCI_MMBA 0x14 /* memory mapped base */
struct rtw_pci_softc {
- struct rtw_softc psc_rtw; /* real ADM8211 softc */
+ struct rtw_softc psc_rtw; /* real RTL8180 softc */
pci_intr_handle_t psc_ih; /* interrupt handle */
void *psc_intrcookie;
@@ -96,6 +95,9 @@
CFATTACH_DECL_NEW(rtw_pci, sizeof(struct rtw_pci_softc),
rtw_pci_match, rtw_pci_attach, rtw_pci_detach, NULL);
+static bool rtw_pci_resume(device_t, const pmf_qual_t *);
+static bool rtw_pci_suspend(device_t, const pmf_qual_t *);
+
static const struct rtw_pci_product {
u_int32_t app_vendor; /* PCI vendor ID */
u_int32_t app_product; /* PCI product ID */
@@ -135,37 +137,6 @@
return (0);
}
-static bool
-rtw_pci_resume(device_t self, const pmf_qual_t *qual)
-{
- struct rtw_pci_softc *psc = device_private(self);
- struct rtw_softc *sc = &psc->psc_rtw;
-
- /* Establish the interrupt. */
- psc->psc_intrcookie = pci_intr_establish(psc->psc_pc, psc->psc_ih,
- IPL_NET, rtw_intr, sc);
- if (psc->psc_intrcookie == NULL) {
- aprint_error_dev(sc->sc_dev, "unable to establish interrupt\n");
- return false;
- }
-
- return rtw_resume(self, qual);
-}
-
-static bool
-rtw_pci_suspend(device_t self, const pmf_qual_t *qual)
-{
- struct rtw_pci_softc *psc = device_private(self);
-
- if (!rtw_suspend(self, qual))
- return false;
-
- /* Unhook the interrupt handler. */
- pci_intr_disestablish(psc->psc_pc, psc->psc_intrcookie);
- psc->psc_intrcookie = NULL;
- return true;
-}
-
static void
rtw_pci_attach(device_t parent, device_t self, void *aux)
{
@@ -278,3 +249,34 @@
return 0;
}
+
+static bool
+rtw_pci_resume(device_t self, const pmf_qual_t *qual)
+{
+ struct rtw_pci_softc *psc = device_private(self);
+ struct rtw_softc *sc = &psc->psc_rtw;
+
+ /* Establish the interrupt. */
+ psc->psc_intrcookie = pci_intr_establish(psc->psc_pc, psc->psc_ih,
+ IPL_NET, rtw_intr, sc);
+ if (psc->psc_intrcookie == NULL) {
+ aprint_error_dev(sc->sc_dev, "unable to establish interrupt\n");
+ return false;
+ }
+
+ return rtw_resume(self, qual);
+}
+
+static bool
+rtw_pci_suspend(device_t self, const pmf_qual_t *qual)
+{
+ struct rtw_pci_softc *psc = device_private(self);
+
+ if (!rtw_suspend(self, qual))
+ return false;
+
+ /* Unhook the interrupt handler. */
+ pci_intr_disestablish(psc->psc_pc, psc->psc_intrcookie);
+ psc->psc_intrcookie = NULL;
+ return true;
+}
Home |
Main Index |
Thread Index |
Old Index