Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Symbol namespace cleanup: rl_ -> rtk_



details:   https://anonhg.NetBSD.org/src/rev/6b82522b5ee9
branches:  trunk
changeset: 486189:6b82522b5ee9
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon May 15 01:55:12 2000 +0000

description:
Symbol namespace cleanup: rl_ -> rtk_

diffstat:

 sys/dev/cardbus/if_rtk_cardbus.c |   87 ++++-----
 sys/dev/ic/rtl81x9.c             |  345 ++++++++++++++++++--------------------
 sys/dev/ic/rtl81x9var.h          |   61 +++---
 sys/dev/pci/if_rtk_pci.c         |  113 +++++-------
 4 files changed, 286 insertions(+), 320 deletions(-)

diffs (truncated from 1434 to 300 lines):

diff -r 06f9bb720f73 -r 6b82522b5ee9 sys/dev/cardbus/if_rtk_cardbus.c
--- a/sys/dev/cardbus/if_rtk_cardbus.c  Mon May 15 01:40:44 2000 +0000
+++ b/sys/dev/cardbus/if_rtk_cardbus.c  Mon May 15 01:55:12 2000 +0000
@@ -1,4 +1,5 @@
-/*     $NetBSD: if_rtk_cardbus.c,v 1.1 2000/05/10 00:24:15 haya Exp $  */
+/*     $NetBSD: if_rtk_cardbus.c,v 1.2 2000/05/15 01:55:13 thorpej Exp $       */
+
 /*
  * Copyright (c) 2000 Masanori Kanaoka
  * All rights reserved.
@@ -31,7 +32,7 @@
  *     Cardbus specific routines for RealTek 8139 ethernet adapter.
  *     Tested for 
  *             - elecom-Laneed LD-10/100CBA (Accton MPX5030)
- *             - MELCO         LPC3-TX-CB   (RealTek 8138)
+ *             - MELCO         LPC3-TX-CB   (RealTek 8139)
  */
 
 #include "opt_inet.h"
@@ -98,21 +99,22 @@
 /*
  * Various supported device vendors/types and their names.
  */
-static struct rl_type rl_cardbus_devs[] = {
+static const struct rtk_type rtk_cardbus_devs[] = {
        { CARDBUS_VENDOR_ACCTON, CARDBUS_PRODUCT_ACCTON_MPX5030,
-               "Accton MPX 5030/5038 10/100BaseTX" },
+               "Accton MPX 5030/5038 10/100BaseTX",
+               RL_8139 },
        { CARDBUS_VENDOR_REALTEK, CARDBUS_PRODUCT_REALTEK_RT8138,
-               "RealTek 8138 10/100BaseTX" },
-       { 0, 0, NULL }
+               "RealTek 8138 10/100BaseTX", RL_8139 },
+       { 0, 0, NULL, 0 }
 };
 
-const struct rl_type *rl_cardbus_lookup
+const struct rtk_type *rtk_cardbus_lookup
        __P((const struct cardbus_attach_args *));
-static int rl_cardbus_match __P((struct device *, struct cfdata *, void *));
-static void rl_cardbus_attach __P((struct device *, struct device *, void *));
+static int rtk_cardbus_match __P((struct device *, struct cfdata *, void *));
+static void rtk_cardbus_attach __P((struct device *, struct device *, void *));
 
-struct rl_cardbus_softc {
-       struct rl_softc sc_rl;          /* real rl softc */ 
+struct rtk_cardbus_softc {
+       struct rtk_softc sc_rtk;        /* real rtk softc */ 
 
        /* CardBus-specific goo. */
        void *sc_ih;
@@ -127,18 +129,18 @@
 };
 
 struct cfattach rtk_cardbus_ca = {
-       sizeof(struct rl_cardbus_softc), rl_cardbus_match, rl_cardbus_attach,
+       sizeof(struct rtk_cardbus_softc), rtk_cardbus_match, rtk_cardbus_attach,
 };
 
-const struct rl_type *
-rl_cardbus_lookup(ca)
+const struct rtk_type *
+rtk_cardbus_lookup(ca)
        const struct cardbus_attach_args *ca;
 {
-       struct rl_type          *t;
+       const struct rtk_type *t;
 
-       for (t = rl_cardbus_devs; t->rl_name != NULL; t++){     
-               if (CARDBUS_VENDOR(ca->ca_id) == t->rl_vid &&
-                   CARDBUS_PRODUCT(ca->ca_id)  == t->rl_did) {
+       for (t = rtk_cardbus_devs; t->rtk_name != NULL; t++){   
+               if (CARDBUS_VENDOR(ca->ca_id) == t->rtk_vid &&
+                   CARDBUS_PRODUCT(ca->ca_id) == t->rtk_did) {
                        return (t);
                }
        }
@@ -146,49 +148,49 @@
 }
 
 int
-rl_cardbus_match(parent, match, aux)
+rtk_cardbus_match(parent, match, aux)
        struct device *parent;
        struct cfdata *match;
        void *aux;
 {
        struct cardbus_attach_args *ca = aux;
 
-       if (rl_cardbus_lookup(ca) != NULL)
+       if (rtk_cardbus_lookup(ca) != NULL)
                return (1);
+
        return (0);
 }
 
 
 void
-rl_cardbus_attach(parent, self, aux)
+rtk_cardbus_attach(parent, self, aux)
        struct device *parent, *self;
        void *aux;
 {
-       int s, pmreg;
+       struct rtk_cardbus_softc *csc = (struct rtk_cardbus_softc *)self;
+       struct rtk_softc *sc = &csc->sc_rtk;
        pcireg_t command;
-       struct rl_cardbus_softc *csc = (struct rl_cardbus_softc *)self;
-       struct rl_softc *sc = &csc->sc_rl;
        struct cardbus_attach_args *ca = aux;
        cardbus_devfunc_t ct = ca->ca_ct;
        cardbus_chipset_tag_t cc = ct->ct_cc;
        cardbus_function_tag_t cf = ct->ct_cf;
-       const struct rl_type *t;
+       const struct rtk_type *t;
        bus_addr_t adr;
        pcireg_t reg;
+       int pmreg;
 
        sc->sc_dmat = ca->ca_dmat;
        csc->sc_ct = ct;
        csc->sc_tag = ca->ca_tag;
        csc->sc_intrline = ca->ca_intrline;
 
-       t = rl_cardbus_lookup(ca); 
+       t = rtk_cardbus_lookup(ca); 
        if (t == NULL) { 
                printf("\n"); 
-               panic("rl_cardbus_attach: impossible");
+               panic("rtk_cardbus_attach: impossible");
         } 
-       printf(": %s\n", t->rl_name); 
+       printf(": %s\n", t->rtk_name); 
 
-       s = splimp();
        /*
         * Handle power management nonsense.
         */
@@ -228,7 +230,7 @@
         */
 #ifdef RL_USEIOSPACE
        if (Cardbus_mapreg_map(ct, RL_PCI_LOIO, CARDBUS_MAPREG_TYPE_IO, 0,
-           &sc->rl_btag, &sc->rl_bhandle, &adr, &csc->sc_mapsize) == 0) {
+           &sc->rtk_btag, &sc->rtk_bhandle, &adr, &csc->sc_mapsize) == 0) {
 #if rbus
 #else
                (*ct->ct_cf->cardbus_io_open)(cc, 0, adr, adr+csc->sc_mapsize);
@@ -241,7 +243,7 @@
        }
 #else
        if (Cardbus_mapreg_map(ct, RL_PCI_LOMEM, CARDBUS_MAPREG_TYPE_MEM, 0,
-           &sc->rl_btag, &sc->rl_bhandle, &adr, &csc->sc_mapsize) == 0) {
+           &sc->rtk_btag, &sc->rtk_bhandle, &adr, &csc->sc_mapsize) == 0) {
 #if rbus
 #else
                (*ct->ct_cf->cardbus_mem_open)(cc, 0, adr, adr+csc->sc_mapsize);
@@ -255,7 +257,7 @@
 #endif
        else {
                printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname);
-               goto fail;
+               return;
        }
        /* Make sure the right access type is on the CardBus bridge. */
        (*ct->ct_cf->cardbus_ctrl)(cc, csc->sc_cben);
@@ -284,32 +286,19 @@
                cardbus_conf_write(cc, cf, csc->sc_tag, CARDBUS_BHLC_REG, reg);
        }
 
-       if (t->rl_did == CARDBUS_PRODUCT_ACCTON_MPX5030 ||
-               t->rl_did == CARDBUS_PRODUCT_REALTEK_RT8138){
-               sc->rl_type = RL_8139;
-
-       } else {
-               printf("%s: unknown device ID: 0x%x\n",
-                   sc->sc_dev.dv_xname, t->rl_did);
-               goto fail;
-       }
+       sc->rtk_type = t->rtk_type;
 
        /* Allocate interrupt */
        printf("%s: interrupting at %d\n",
            sc->sc_dev.dv_xname, csc->sc_intrline);
        csc->sc_ih = cardbus_intr_establish(cc, cf, csc->sc_intrline, IPL_NET, 
-           rl_intr, sc);
+           rtk_intr, sc);
        if (csc->sc_ih == NULL) {
                printf("%s: unable to establish interrupt at %d\n",
                    sc->sc_dev.dv_xname, csc->sc_intrline);
                printf("\n");
-               goto fail;
+               return;
        }
 
-       rl_attach(sc);
-
-fail:
-       splx(s);
-       return;
+       rtk_attach(sc);
 }
-
diff -r 06f9bb720f73 -r 6b82522b5ee9 sys/dev/ic/rtl81x9.c
--- a/sys/dev/ic/rtl81x9.c      Mon May 15 01:40:44 2000 +0000
+++ b/sys/dev/ic/rtl81x9.c      Mon May 15 01:55:12 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtl81x9.c,v 1.7 2000/05/12 16:44:20 thorpej Exp $      */
+/*     $NetBSD: rtl81x9.c,v 1.8 2000/05/15 01:55:14 thorpej Exp $      */
 
 /*
  * Copyright (c) 1997, 1998
@@ -127,15 +127,6 @@
 #include <dev/mii/mii.h>
 #include <dev/mii/miivar.h>
 
-/*
- * Default to using PIO access for this driver. On SMP systems,
- * there appear to be problems with memory mapped mode: it looks like
- * doing too many memory mapped access back to back in rapid succession
- * can hang the bus. I'm inclined to blame this on crummy design/construction
- * on the part of RealTek. Memory mapped mode does appear to work on
- * uniprocessor systems though.
- */
-
 #include <dev/ic/rtl81x9reg.h>
 #include <dev/ic/rtl81x9var.h>
 
@@ -145,34 +136,34 @@
 #define STATIC static
 #endif
 
-STATIC void rl_reset           __P((struct rl_softc *));
-STATIC void rl_rxeof           __P((struct rl_softc *));
-STATIC void rl_txeof           __P((struct rl_softc *));
-STATIC void rl_start           __P((struct ifnet *));
-STATIC int rl_ioctl            __P((struct ifnet *, u_long, caddr_t));
-STATIC void rl_init            __P((void *));
-STATIC void rl_stop            __P((struct rl_softc *));
-STATIC void rl_watchdog                __P((struct ifnet *));
-STATIC void rl_shutdown                __P((void *));
-STATIC int rl_ifmedia_upd      __P((struct ifnet *));
-STATIC void rl_ifmedia_sts     __P((struct ifnet *, struct ifmediareq *));
+STATIC void rtk_reset          __P((struct rtk_softc *));
+STATIC void rtk_rxeof          __P((struct rtk_softc *));
+STATIC void rtk_txeof          __P((struct rtk_softc *));
+STATIC void rtk_start          __P((struct ifnet *));
+STATIC int rtk_ioctl           __P((struct ifnet *, u_long, caddr_t));
+STATIC void rtk_init           __P((void *));
+STATIC void rtk_stop           __P((struct rtk_softc *));
+STATIC void rtk_watchdog               __P((struct ifnet *));
+STATIC void rtk_shutdown               __P((void *));
+STATIC int rtk_ifmedia_upd     __P((struct ifnet *));
+STATIC void rtk_ifmedia_sts    __P((struct ifnet *, struct ifmediareq *));
 
-STATIC u_int16_t rl_read_eeprom __P((struct rl_softc *, int, int));
-STATIC void rl_eeprom_putbyte  __P((struct rl_softc *, int, int));
-STATIC void rl_mii_sync                __P((struct rl_softc *));
-STATIC void rl_mii_send                __P((struct rl_softc *, u_int32_t, int));
-STATIC int rl_mii_readreg      __P((struct rl_softc *, struct rl_mii_frame *));
-STATIC int rl_mii_writereg     __P((struct rl_softc *, struct rl_mii_frame *));
+STATIC u_int16_t rtk_read_eeprom __P((struct rtk_softc *, int, int));
+STATIC void rtk_eeprom_putbyte __P((struct rtk_softc *, int, int));
+STATIC void rtk_mii_sync               __P((struct rtk_softc *));
+STATIC void rtk_mii_send               __P((struct rtk_softc *, u_int32_t, int));
+STATIC int rtk_mii_readreg     __P((struct rtk_softc *, struct rtk_mii_frame *));
+STATIC int rtk_mii_writereg    __P((struct rtk_softc *, struct rtk_mii_frame *));
 
-STATIC int rl_phy_readreg      __P((struct device *, int, int));
-STATIC void rl_phy_writereg    __P((struct device *, int, int, int));
-STATIC void rl_phy_statchg     __P((struct device *));
-STATIC void rl_tick __P((void *));
+STATIC int rtk_phy_readreg     __P((struct device *, int, int));
+STATIC void rtk_phy_writereg   __P((struct device *, int, int, int));
+STATIC void rtk_phy_statchg    __P((struct device *));
+STATIC void rtk_tick __P((void *));
 
-STATIC void rl_setmulti                __P((struct rl_softc *));
-STATIC int rl_list_tx_init     __P((struct rl_softc *));
+STATIC void rtk_setmulti               __P((struct rtk_softc *));
+STATIC int rtk_list_tx_init    __P((struct rtk_softc *));
 
-STATIC int rl_ether_ioctl __P((struct ifnet *, u_long, caddr_t));
+STATIC int rtk_ether_ioctl __P((struct ifnet *, u_long, caddr_t));
 
 
 #define EE_SET(x)                                      \
@@ -186,8 +177,8 @@
 /*
  * Send a read command and address to the EEPROM, check for ACK.
  */
-STATIC void rl_eeprom_putbyte(sc, addr, addr_len)
-       struct rl_softc         *sc;
+STATIC void rtk_eeprom_putbyte(sc, addr, addr_len)
+       struct rtk_softc                *sc;
        int                     addr, addr_len;
 {
        int                     d, i;
@@ -214,8 +205,8 @@
 /*
  * Read a word of data stored in the EEPROM at address 'addr.'



Home | Main Index | Thread Index | Old Index