Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci run this through indent with some comment cleanu...



details:   https://anonhg.NetBSD.org/src/rev/6a9e8db0c9e4
branches:  trunk
changeset: 481764:6a9e8db0c9e4
user:      chopps <chopps%NetBSD.org@localhost>
date:      Sat Feb 05 18:20:08 2000 +0000

description:
run this through indent with some comment cleanup -- more knfing needed.

diffstat:

 sys/dev/pci/pccbb.c |  4493 +++++++++++++++++++++++++-------------------------
 1 files changed, 2220 insertions(+), 2273 deletions(-)

diffs (truncated from 5239 to 300 lines):

diff -r 9e4fcf2b362e -r 6a9e8db0c9e4 sys/dev/pci/pccbb.c
--- a/sys/dev/pci/pccbb.c       Sat Feb 05 18:11:55 2000 +0000
+++ b/sys/dev/pci/pccbb.c       Sat Feb 05 18:20:08 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pccbb.c,v 1.21 2000/01/26 09:02:41 haya Exp $  */
+/*     $NetBSD: pccbb.c,v 1.22 2000/02/05 18:20:08 chopps Exp $        */
 
 /*
  * Copyright (c) 1998, 1999 and 2000
@@ -75,10 +75,9 @@
 
 #include "locators.h"
 
-
 #ifndef __NetBSD_Version__
 struct cfdriver cbb_cd = {
-  NULL, "cbb", DV_DULL
+       NULL, "cbb", DV_DULL
 };
 #endif
 
@@ -90,7 +89,6 @@
 #define STATIC static
 #endif
 
-
 #ifdef __BROKEN_INDIRECT_CONFIG
 int pcicbbmatch __P((struct device *, void *, void *));
 #else
@@ -108,13 +106,13 @@
 #define Pcic_read(ph, reg) ((ph)->ph_read((ph), (reg)))
 #define Pcic_write(ph, reg, val) ((ph)->ph_write((ph), (reg), (val)))
 
-
 STATIC int cb_reset __P((struct pccbb_softc *));
 STATIC int cb_detect_voltage __P((struct pccbb_softc *));
 STATIC int cbbprint __P((void *, const char *));
 
 static int cb_chipset __P((u_int32_t, int *));
-STATIC void pccbb_pcmcia_attach_setup __P((struct pccbb_softc *, struct pcmciabus_attach_args *));
+STATIC void pccbb_pcmcia_attach_setup __P((struct pccbb_softc *,
+    struct pcmciabus_attach_args *));
 #if 0
 STATIC void pccbb_pcmcia_attach_card __P((struct pcic_handle *));
 STATIC void pccbb_pcmcia_detach_card __P((struct pcic_handle *, int));
@@ -123,40 +121,45 @@
 
 STATIC int pccbb_ctrl __P((cardbus_chipset_tag_t, int));
 STATIC int pccbb_power __P((cardbus_chipset_tag_t, int));
-STATIC int pccbb_cardenable __P((struct pccbb_softc *sc, int function));
+STATIC int pccbb_cardenable __P((struct pccbb_softc * sc, int function));
 #if !rbus
-static int pccbb_io_open __P((cardbus_chipset_tag_t, int, u_int32_t, u_int32_t));
+static int pccbb_io_open __P((cardbus_chipset_tag_t, int, u_int32_t,
+    u_int32_t));
 static int pccbb_io_close __P((cardbus_chipset_tag_t, int));
-static int pccbb_mem_open __P((cardbus_chipset_tag_t, int, u_int32_t, u_int32_t));
+static int pccbb_mem_open __P((cardbus_chipset_tag_t, int, u_int32_t,
+    u_int32_t));
 static int pccbb_mem_close __P((cardbus_chipset_tag_t, int));
 #endif /* !rbus */
-static void *pccbb_intr_establish __P((cardbus_chipset_tag_t, int irq, int level, int (* ih)(void *), void *sc));
+static void *pccbb_intr_establish __P((cardbus_chipset_tag_t, int irq,
+    int level, int (*ih) (void *), void *sc));
 static void pccbb_intr_disestablish __P((cardbus_chipset_tag_t ct, void *ih));
 
 static cardbustag_t pccbb_make_tag __P((cardbus_chipset_tag_t, int, int, int));
 static void pccbb_free_tag __P((cardbus_chipset_tag_t, cardbustag_t));
-static cardbusreg_t pccbb_conf_read __P((cardbus_chipset_tag_t, cardbustag_t, int));
-static void pccbb_conf_write __P((cardbus_chipset_tag_t, cardbustag_t, int, cardbusreg_t));
+static cardbusreg_t pccbb_conf_read __P((cardbus_chipset_tag_t, cardbustag_t,
+    int));
+static void pccbb_conf_write __P((cardbus_chipset_tag_t, cardbustag_t, int,
+    cardbusreg_t));
 static void pccbb_chipinit __P((struct pccbb_softc *));
 
-
 STATIC int pccbb_pcmcia_mem_alloc __P((pcmcia_chipset_handle_t, bus_size_t,
-                                      struct pcmcia_mem_handle *));
+    struct pcmcia_mem_handle *));
 STATIC void pccbb_pcmcia_mem_free __P((pcmcia_chipset_handle_t,
-           struct pcmcia_mem_handle *));
+    struct pcmcia_mem_handle *));
 STATIC int pccbb_pcmcia_mem_map __P((pcmcia_chipset_handle_t, int, bus_addr_t,
-            bus_size_t, struct pcmcia_mem_handle *, bus_addr_t *, int *));
+    bus_size_t, struct pcmcia_mem_handle *, bus_addr_t *, int *));
 STATIC void pccbb_pcmcia_mem_unmap __P((pcmcia_chipset_handle_t, int));
 STATIC int pccbb_pcmcia_io_alloc __P((pcmcia_chipset_handle_t, bus_addr_t,
-           bus_size_t, bus_size_t, struct pcmcia_io_handle *));
+    bus_size_t, bus_size_t, struct pcmcia_io_handle *));
 STATIC void pccbb_pcmcia_io_free __P((pcmcia_chipset_handle_t,
-           struct pcmcia_io_handle *));
+    struct pcmcia_io_handle *));
 STATIC int pccbb_pcmcia_io_map __P((pcmcia_chipset_handle_t, int, bus_addr_t,
-           bus_size_t, struct pcmcia_io_handle *, int *));
+    bus_size_t, struct pcmcia_io_handle *, int *));
 STATIC void pccbb_pcmcia_io_unmap __P((pcmcia_chipset_handle_t, int));
 STATIC void *pccbb_pcmcia_intr_establish __P((pcmcia_chipset_handle_t,
-           struct pcmcia_function *, int, int (*) (void *), void *));
-STATIC void pccbb_pcmcia_intr_disestablish __P((pcmcia_chipset_handle_t, void *));
+    struct pcmcia_function *, int, int (*)(void *), void *));
+STATIC void pccbb_pcmcia_intr_disestablish __P((pcmcia_chipset_handle_t,
+    void *));
 STATIC void pccbb_pcmcia_socket_enable __P((pcmcia_chipset_handle_t));
 STATIC void pccbb_pcmcia_socket_disable __P((pcmcia_chipset_handle_t));
 STATIC int pccbb_pcmcia_card_detect __P((pcmcia_chipset_handle_t pch));
@@ -169,25 +172,25 @@
 #if rbus
 
 static int pccbb_rbus_cb_space_alloc __P((cardbus_chipset_tag_t, rbus_tag_t,
-                                         bus_addr_t addr, bus_size_t size,
-                                         bus_addr_t mask, bus_size_t align,
-                                         int flags, bus_addr_t *addrp,
-                                         bus_space_handle_t *bshp));
+    bus_addr_t addr, bus_size_t size, bus_addr_t mask, bus_size_t align,
+    int flags, bus_addr_t * addrp, bus_space_handle_t * bshp));
 static int pccbb_rbus_cb_space_free __P((cardbus_chipset_tag_t, rbus_tag_t,
-                                        bus_space_handle_t, bus_size_t));
+    bus_space_handle_t, bus_size_t));
 
 #endif /* rbus */
 
 #if rbus
 
-static int pccbb_open_win __P((struct pccbb_softc *, bus_space_tag_t, bus_addr_t, bus_size_t, bus_space_handle_t, int flags));
-static int pccbb_close_win __P((struct pccbb_softc *, bus_space_tag_t, bus_space_handle_t, bus_size_t));
+static int pccbb_open_win __P((struct pccbb_softc *, bus_space_tag_t,
+    bus_addr_t, bus_size_t, bus_space_handle_t, int flags));
+static int pccbb_close_win __P((struct pccbb_softc *, bus_space_tag_t,
+    bus_space_handle_t, bus_size_t));
 static int pccbb_winlist_insert __P((struct pccbb_win_chain **, bus_addr_t,
-                                    bus_size_t, bus_space_handle_t, int));
+    bus_size_t, bus_space_handle_t, int));
 static int pccbb_winlist_delete __P((struct pccbb_win_chain **,
-                                    bus_space_handle_t, bus_size_t));
+    bus_space_handle_t, bus_size_t));
 static void pccbb_winset __P((bus_addr_t align, struct pccbb_softc *,
-                             bus_space_tag_t));
+    bus_space_tag_t));
 void pccbb_winlist_show(struct pccbb_win_chain *);
 
 #endif /* rbus */
@@ -195,715 +198,699 @@
 /* for config_defer */
 static void pccbb_pci_callback __P((struct device *));
 
-
 #if defined SHOW_REGS
-static void cb_show_regs __P((pci_chipset_tag_t pc, pcitag_t tag, bus_space_tag_t memt, bus_space_handle_t memh));
+static void cb_show_regs __P((pci_chipset_tag_t pc, pcitag_t tag,
+    bus_space_tag_t memt, bus_space_handle_t memh));
 #endif
 
-
-
 struct cfattach cbb_pci_ca = {
        sizeof(struct pccbb_softc), pcicbbmatch, pccbbattach
 };
 
-
 static struct pcmcia_chip_functions pccbb_pcmcia_funcs = {
-  pccbb_pcmcia_mem_alloc,
-  pccbb_pcmcia_mem_free,
-  pccbb_pcmcia_mem_map,
-  pccbb_pcmcia_mem_unmap,
-  pccbb_pcmcia_io_alloc,
-  pccbb_pcmcia_io_free,
-  pccbb_pcmcia_io_map,
-  pccbb_pcmcia_io_unmap,
-  pccbb_pcmcia_intr_establish,
-  pccbb_pcmcia_intr_disestablish,
-  pccbb_pcmcia_socket_enable,
-  pccbb_pcmcia_socket_disable,
-  pccbb_pcmcia_card_detect
+       pccbb_pcmcia_mem_alloc,
+       pccbb_pcmcia_mem_free,
+       pccbb_pcmcia_mem_map,
+       pccbb_pcmcia_mem_unmap,
+       pccbb_pcmcia_io_alloc,
+       pccbb_pcmcia_io_free,
+       pccbb_pcmcia_io_map,
+       pccbb_pcmcia_io_unmap,
+       pccbb_pcmcia_intr_establish,
+       pccbb_pcmcia_intr_disestablish,
+       pccbb_pcmcia_socket_enable,
+       pccbb_pcmcia_socket_disable,
+       pccbb_pcmcia_card_detect
 };
 
 #if rbus
 static struct cardbus_functions pccbb_funcs = {
-  pccbb_rbus_cb_space_alloc,
-  pccbb_rbus_cb_space_free,
-  pccbb_intr_establish,
-  pccbb_intr_disestablish,
-  pccbb_ctrl,
-  pccbb_power,
-  pccbb_make_tag,
-  pccbb_free_tag,
-  pccbb_conf_read,
-  pccbb_conf_write,
+       pccbb_rbus_cb_space_alloc,
+       pccbb_rbus_cb_space_free,
+       pccbb_intr_establish,
+       pccbb_intr_disestablish,
+       pccbb_ctrl,
+       pccbb_power,
+       pccbb_make_tag,
+       pccbb_free_tag,
+       pccbb_conf_read,
+       pccbb_conf_write,
 };
 #else
 static struct cardbus_functions pccbb_funcs = {
-  pccbb_ctrl,
-  pccbb_power,
-  pccbb_mem_open,
-  pccbb_mem_close,
-  pccbb_io_open,
-  pccbb_io_close,
-  pccbb_intr_establish,
-  pccbb_intr_disestablish,
-  pccbb_make_tag,
-  pccbb_conf_read,
-  pccbb_conf_write,
+       pccbb_ctrl,
+       pccbb_power,
+       pccbb_mem_open,
+       pccbb_mem_close,
+       pccbb_io_open,
+       pccbb_io_close,
+       pccbb_intr_establish,
+       pccbb_intr_disestablish,
+       pccbb_make_tag,
+       pccbb_conf_read,
+       pccbb_conf_write,
 };
 #endif
 
-
-
-
 int
 pcicbbmatch(parent, match, aux)
-     struct device *parent;
+       struct device *parent;
 #ifdef __BROKEN_INDIRECT_CONFIG
-     void *match;
+       void *match;
 #else
-     struct cfdata *match;
+       struct cfdata *match;
 #endif
-     void *aux;
+       void *aux;
 {
-    struct pci_attach_args *pa = (struct pci_attach_args *)aux;
-
-    if(PCI_CLASS(pa->pa_class) == PCI_CLASS_BRIDGE &&
-       PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_BRIDGE_CARDBUS &&
-       PCI_INTERFACE(pa->pa_class) == 0) {
-       return 1;
-    }
-
-    return 0;
+       struct pci_attach_args *pa = (struct pci_attach_args *)aux;
+
+       if (PCI_CLASS(pa->pa_class) == PCI_CLASS_BRIDGE &&
+           PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_BRIDGE_CARDBUS &&
+           PCI_INTERFACE(pa->pa_class) == 0) {
+               return 1;
+       }
+
+       return 0;
 }
 
-
 #define MAKEID(vendor, prod) (((vendor) << PCI_VENDOR_SHIFT) \
                               | ((prod) << PCI_PRODUCT_SHIFT))
 
-
 struct yenta_chipinfo {
-  pcireg_t yc_id;              /* vendor tag | product tag */
-  int yc_chiptype;
-  int yc_flags;
+       pcireg_t yc_id;                /* vendor tag | product tag */
+       int yc_chiptype;
+       int yc_flags;
 } yc_chipsets[] = {
-  /* Texas Instruments chips */
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1130), CB_TI113X,
-     PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1131), CB_TI113X,
-     PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
-
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1250), CB_TI12XX,
-     PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1220), CB_TI12XX,
-     PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1221), CB_TI12XX,



Home | Main Index | Thread Index | Old Index