netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] Sis900 bug fixes 3/4
       [not found] ` <20040518123020.GF23565@picchio.gall.it>
@ 2004-05-19 14:28   ` Daniele Venzano
  2004-05-19 23:58     ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Daniele Venzano @ 2004-05-19 14:28 UTC (permalink / raw)
  To: Linux Kernel Mailing List, Andrew Morton
  Cc: netdev, Jeff Garzik, Dominik Karall


[-- Attachment #1.1: Type: text/plain, Size: 766 bytes --]

On Tue, May 18, 2004 at 02:30:20PM +0200, Daniele Venzano wrote:
> Dominik:
> Could you please test this patch ? Thanks.

After further testing with Dominik, I made a new patch that actually
works. So, please disregard patch number 3 I sent before and use this
one instead. The other patches need no changes and can be found here:

http://teg.homeunix.org/sis900.html

They are:
sis900-maintainers
sis900-isa-bridge-id
sis900-phy-detection (attached below)
sis900-header-cleanups

This patch has been tested on a previously working system (keeps
working) and on a before-not-working one (now works as expected).

Please, consider this patchset for inclusion.

-- 
-----------------------------
Daniele Venzano
Web: http://teg.homeunix.org


[-- Attachment #1.2: sis900-phy-detection.diff --]
[-- Type: text/plain, Size: 2108 bytes --]

--- linux-2.6.6/drivers/net/sis900.c	2004-05-18 21:46:41.000000000 +0200
+++ linux-sis900/drivers/net/sis900.c	2004-05-18 21:44:31.000000000 +0200
@@ -116,6 +116,7 @@
 #define	HOME 	0x0001
 #define LAN	0x0002
 #define MIX	0x0003
+#define UNKNOWN	0x0
 } mii_chip_table[] = {
 	{ "SiS 900 Internal MII PHY", 		0x001d, 0x8000, LAN },
 	{ "SiS 7014 Physical Layer Solution", 	0x0016, 0xf830, LAN },
@@ -577,9 +578,11 @@
 				break;
 			}
 			
-		if( !mii_chip_table[i].phy_id1 )
+		if( !mii_chip_table[i].phy_id1 ) {
 			printk(KERN_INFO "%s: Unknown PHY transceiver found at address %d.\n",
-			       net_dev->name, phy_addr);			
+			       net_dev->name, phy_addr);
+			mii_phy->phy_types = UNKNOWN;
+		}
 	}
 	
 	if (sis_priv->mii == NULL) {
@@ -644,15 +647,15 @@
 static u16 sis900_default_phy(struct net_device * net_dev)
 {
 	struct sis900_private * sis_priv = net_dev->priv;
- 	struct mii_phy *phy = NULL, *phy_home = NULL, *default_phy = NULL;
+ 	struct mii_phy *phy = NULL, *phy_home = NULL, *default_phy = NULL, *phy_lan = NULL;
 	u16 status;
 
         for( phy=sis_priv->first_mii; phy; phy=phy->next ){
 		status = mdio_read(net_dev, phy->phy_addr, MII_STATUS);
 		status = mdio_read(net_dev, phy->phy_addr, MII_STATUS);
 
-		/* Link ON & Not select deafalut PHY */
-		 if ( (status & MII_STAT_LINK) && !(default_phy) )
+		/* Link ON & Not select default PHY & not ghost PHY */
+		 if ( (status & MII_STAT_LINK) && !default_phy && (phy->phy_types != UNKNOWN) )
 		 	default_phy = phy;
 		 else{
 			status = mdio_read(net_dev, phy->phy_addr, MII_CONTROL);
@@ -660,12 +663,16 @@
 				status | MII_CNTL_AUTO | MII_CNTL_ISOLATE);
 			if( phy->phy_types == HOME )
 				phy_home = phy;
+			else if (phy->phy_types == LAN)
+				phy_lan = phy;
 		 }
 	}
 
-	if( (!default_phy) && phy_home )
+	if( !default_phy && phy_home )
 		default_phy = phy_home;
-	else if(!default_phy)
+	else if( !default_phy && phy_lan )
+		default_phy = phy_lan;
+	else if ( !default_phy )
 		default_phy = sis_priv->first_mii;
 
 	if( sis_priv->mii != default_phy ){

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Sis900 bug fixes 3/4
  2004-05-19 14:28   ` [PATCH] Sis900 bug fixes 3/4 Daniele Venzano
@ 2004-05-19 23:58     ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2004-05-19 23:58 UTC (permalink / raw)
  To: Daniele Venzano, Andrew Morton
  Cc: Linux Kernel Mailing List, netdev, Dominik Karall

Daniele Venzano wrote:
> http://teg.homeunix.org/sis900.html
> 
> They are:
> sis900-maintainers

Let's hold off on this for now...  we can commit this patch anytime, and 
there is no harm in being "unofficial maintainer" for a while.


> sis900-isa-bridge-id

applied, with modifications, to netdev-2.6


> sis900-phy-detection (attached below)

I'd like to wait until my netdev-2.6 changes (just pushed to their 
public BK home, bk://gkernel.bkbits.net/netdev-2.6) are pulled by 
Andrew, and incorporated into the update of his -mm tree.

This patch will likely need some rediffing.


> sis900-header-cleanups

applied, with modifications, to netdev-2.6

Also I applied the sis900-detach found on the web page.

	Jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-19 23:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20040518120237.GC23565@picchio.gall.it>
     [not found] ` <20040518123020.GF23565@picchio.gall.it>
2004-05-19 14:28   ` [PATCH] Sis900 bug fixes 3/4 Daniele Venzano
2004-05-19 23:58     ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).