]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/powerpc/cpu/mpc8260/ether_fcc.c
net: cosmetic: Name ethaddr variables consistently
[karo-tx-uboot.git] / arch / powerpc / cpu / mpc8260 / ether_fcc.c
index b05f5762e535a23f924d0503728c271f8aaf7429..240e7aedf3a1fbd2ff748130828f15c5654a2367 100644 (file)
@@ -6,23 +6,7 @@
  * (C) Copyright 2000 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  * Marius Groeger <mgroeger@sysgo.de>
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -53,8 +37,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_ETHER_ON_FCC) && defined(CONFIG_CMD_NET) && \
-       defined(CONFIG_NET_MULTI)
+#if defined(CONFIG_ETHER_ON_FCC) && defined(CONFIG_CMD_NET)
 
 static struct ether_fcc_info_s
 {
@@ -143,7 +126,7 @@ static RTXBD rtx __attribute__ ((aligned(8)));
 #error "rtx must be 64-bit aligned"
 #endif
 
-static int fec_send(struct eth_device* dev, volatile void *packet, int length)
+static int fec_send(struct eth_device *dev, void *packet, int length)
 {
     int i;
     int result = 0;
@@ -316,7 +299,7 @@ static int fec_init(struct eth_device* dev, bd_t *bis)
      * it unique by setting a few bits in the upper byte of the
      * non-static part of the address.
      */
-#define ea eth_get_dev()->enetaddr
+#define ea eth_get_ethaddr()
     pram_ptr->fen_paddrh = (ea[5] << 8) + ea[4];
     pram_ptr->fen_paddrm = (ea[3] << 8) + ea[2];
     pram_ptr->fen_paddrl = (ea[1] << 8) + ea[0];
@@ -654,7 +637,7 @@ eth_loopback_test (void)
 
        puts ("FCC Ethernet External loopback test\n");
 
-       eth_getenv_enetaddr("ethaddr", NetOurEther);
+       eth_getenv_enetaddr("ethaddr", net_ethaddr);
 
        /*
         * global initialisations for all FCC channels
@@ -662,32 +645,7 @@ eth_loopback_test (void)
 
        /* 28.9 - (1-2): ioports have been set up already */
 
-#if defined(CONFIG_HYMOD)
-       /*
-        * Attention: this is board-specific
-        * 0, FCC1
-        * 1, FCC2
-        * 2, FCC3
-        */
-#       define FCC_START_LOOP 0
-#       define FCC_END_LOOP   2
-
-       /*
-        * Attention: this is board-specific
-        * - FCC1 Rx-CLK is CLK10
-        * - FCC1 Tx-CLK is CLK11
-        * - FCC2 Rx-CLK is CLK13
-        * - FCC2 Tx-CLK is CLK14
-        * - FCC3 Rx-CLK is CLK15
-        * - FCC3 Tx-CLK is CLK16
-        */
-
-       /* 28.9 - (3): connect FCC's tx and rx clocks */
-       immr->im_cpmux.cmx_uar = 0;
-       immr->im_cpmux.cmx_fcr = CMXFCR_RF1CS_CLK10|CMXFCR_TF1CS_CLK11|\
-           CMXFCR_RF2CS_CLK13|CMXFCR_TF2CS_CLK14|\
-           CMXFCR_RF3CS_CLK15|CMXFCR_TF3CS_CLK16;
-#elif defined(CONFIG_SACSng)
+#if defined(CONFIG_SACSng)
        /*
         * Attention: this is board-specific
         * 1, FCC2
@@ -763,7 +721,7 @@ eth_loopback_test (void)
                                BD_ENET_TX_LAST | BD_ENET_TX_TC;
 
                        memset ((void *)bp, patbytes[i], ELBT_BUFSZ);
-                       NetSetEther (bp, NetBcastAddr, 0x8000);
+                       NetSetEther(bp, net_bcast_ethaddr, 0x8000);
                }
                ecp->txbd[ELBT_NTXBD - 1].cbd_sc |= BD_ENET_TX_WRAP;
 
@@ -841,11 +799,9 @@ eth_loopback_test (void)
                 * So, far we have only been given one Ethernet address. We use
                 * the same address for all channels
                 */
-#define ea NetOurEther
-               fpp->fen_paddrh = (ea[5] << 8) + ea[4];
-               fpp->fen_paddrm = (ea[3] << 8) + ea[2];
-               fpp->fen_paddrl = (ea[1] << 8) + ea[0];
-#undef ea
+               fpp->fen_paddrh = (net_ethaddr[5] << 8) + net_ethaddr[4];
+               fpp->fen_paddrm = (net_ethaddr[3] << 8) + net_ethaddr[2];
+               fpp->fen_paddrl = (net_ethaddr[1] << 8) + net_ethaddr[0];
 
                fpp->fen_minflr = PKT_MINBUF_SIZE; /* min frame len register */
                /*
@@ -1050,23 +1006,22 @@ eth_loopback_test (void)
                                        }
                                        else {
                                                ushort datlen = bdp->cbd_datlen;
-                                               Ethernet_t *ehp;
+                                               struct ethernet_hdr *ehp;
                                                ushort prot;
                                                int ours, tb, n, nbytes;
 
-                                               ehp = (Ethernet_t *) \
+                                               ehp = (struct ethernet_hdr *) \
                                                        &ecp->rxbufs[i][0];
 
                                                ours = memcmp (ehp->et_src, \
-                                                       NetOurEther, 6);
+                                                       net_ethaddr, 6);
 
                                                prot = swap16 (ehp->et_protlen);
                                                tb = prot & 0x8000;
                                                n = prot & 0x7fff;
 
-                                               nbytes = ELBT_BUFSZ - \
-                                                       offsetof (Ethernet_t, \
-                                                               et_dsap) - \
+                                               nbytes = ELBT_BUFSZ -
+                                                       ETHER_HDR_SIZE -
                                                        ELBT_CRCSZ;
 
                                                /* check the frame is correct */
@@ -1081,10 +1036,10 @@ eth_loopback_test (void)
                                                                patwords[n];
                                                        uint nbb;
 
-                                                       nbb = badbits ( \
-                                                               &ehp->et_dsap, \
-                                                               nbytes, \
-                                                               patword);
+                                                       nbb = badbits(
+                                                           ((uchar *)&ehp) +
+                                                           ETHER_HDR_SIZE,
+                                                           nbytes, patword);
 
                                                        ecp->rxeacc.badbit += \
                                                                nbb;