Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ulrich Eckhardt <eckhardt@satorlaser.com>
To: linux-mips@linux-mips.org
Cc: ralf@linux-mips.org
Subject: [patch] repair failed merges of 2.6.12 in au1000_eth.c
Date: Tue, 22 Mar 2005 14:04:39 +0100	[thread overview]
Message-ID: <200503221404.40050.eckhardt@satorlaser.com> (raw)

Hi!

Seems a few things went wrong merging 2.6.12 into the l-m.o CVS, leading to 
code duplication. The compiler complains about an unbalanced #ifdef.

Uli

Changes:
 * repair wrong merges of changes from 2.6.12
 * remove an unused variable an an unnecessary set of brackets

---
Index: drivers/net/au1000_eth.c
===================================================================
RCS file: /home/cvs/linux/drivers/net/au1000_eth.c,v
retrieving revision 1.43
diff -u -w -r1.43 au1000_eth.c
--- drivers/net/au1000_eth.c 18 Mar 2005 17:37:32 -0000 1.43
+++ drivers/net/au1000_eth.c 22 Mar 2005 11:56:10 -0000
@@ -990,67 +990,7 @@
     the stub will be found as well as the actual PHY. However,
     the last found PHY will be used... usually at Addr 31 (Db1500). 
  */
- if ( (!phy_found) )
- {
-  u16 phy_id0, phy_id1;
-  int i;
-
-  phy_id0 = 0x1234;
-  phy_id1 = 0x5678;
-
-  /* search our mii table for the current mii */ 
-  for (i = 0; mii_chip_table[i].phy_id1; i++) {
-   if (phy_id0 == mii_chip_table[i].phy_id0 &&
-       phy_id1 == mii_chip_table[i].phy_id1) {
-    struct mii_phy * mii_phy = aup->mii;
-
-    printk(KERN_INFO "%s: %s at phy address %d\n",
-           dev->name, mii_chip_table[i].name, 
-           phy_addr);
-#ifdef CONFIG_MIPS_BOSPORUS
-    phy_found = 1;
-#endif
-    mii_phy->chip_info = mii_chip_table+i;
-    aup->phy_addr = phy_addr;
-    aup->want_autoneg = 1;
-    aup->phy_ops = mii_chip_table[i].phy_ops;
-    aup->phy_ops->phy_init(dev,phy_addr);
-
-    // Check for dual-phy and then store required 
-    // values and set indicators. We need to do 
-    // this now since mdio_{read,write} need the 
-    // control and data register addresses.
-    #ifdef CONFIG_BCM5222_DUAL_PHY
-    if ( mii_chip_table[i].dual_phy) {
-
-     /* assume both phys are controlled 
-      * through MAC0. Board specific? */
-     
-     /* sanity check */
-     if (!au_macs[0] || !au_macs[0]->mii)
-      return -1;
-     aup->mii->mii_control_reg = (u32 *)
-      &au_macs[0]->mac->mii_control;
-     aup->mii->mii_data_reg = (u32 *)
-      &au_macs[0]->mac->mii_data;
-    }
-    #endif
-    goto found;
-   }
-  }
- }
-found:
-
-#ifdef CONFIG_MIPS_BOSPORUS
- /* This is a workaround for the Micrel/Kendin 5 port switch
-    The second MAC doesn't see a PHY connected... so we need to
-    trick it into thinking we have one.
-  
-    If this kernel is run on another Au1500 development board
-    the stub will be found as well as the actual PHY. However,
-    the last found PHY will be used... usually at Addr 31 (Db1500). 
- */
- if ( (!phy_found) )
+ if ( !phy_found)
  {
   u16 phy_id0, phy_id1;
   int i;
@@ -1841,7 +1781,6 @@
 
 static int au1000_close(struct net_device *dev)
 {
- int i;
  u32 flags;
  struct au1000_private *aup = (struct au1000_private *) dev->priv;
 
@@ -2159,23 +2098,6 @@
     return crc;
 }
 
-
-static unsigned const ethernet_polynomial = 0x04c11db7U;
-static inline u32 ether_crc(int length, unsigned char *data)
-{
-    int crc = -1;
-
-    while(--length >= 0) {
-  unsigned char current_octet = *data++;
-  int bit;
-  for (bit = 0; bit < 8; bit++, current_octet >>= 1)
-   crc = (crc << 1) ^
-    ((crc < 0) ^ (current_octet & 1) ? 
-     ethernet_polynomial : 0);
-    }
-    return crc;
-}
-
 static void set_rx_mode(struct net_device *dev)
 {
  struct au1000_private *aup = (struct au1000_private *) dev->priv;

                 reply	other threads:[~2005-03-22 13:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200503221404.40050.eckhardt@satorlaser.com \
    --to=eckhardt@satorlaser.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox