Browse Source

niu: Fix probing regression for maramba on-board chips.

Changeset 7f7c4072ea552f97a0898331322f71986a97299c ("niu: Determine
the # of ports from the card's VPD data") caused maramba on-board
NIU ports to stop probing properly.

The old code had a fallback that would use a num_ports value of
4 if all the probing methods failed, but that was removed.

This restores the fallback of 4 ports, to get things working
again.

Bump driver version and release date.

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller 17 năm trước cách đây
mục cha
commit
be0c007ac6
1 tập tin đã thay đổi với 7 bổ sung4 xóa
  1. 7 4
      drivers/net/niu.c

+ 7 - 4
drivers/net/niu.c

@@ -1,6 +1,6 @@
 /* niu.c: Neptune ethernet driver.
 /* niu.c: Neptune ethernet driver.
  *
  *
- * Copyright (C) 2007 David S. Miller (davem@davemloft.net)
+ * Copyright (C) 2007, 2008 David S. Miller (davem@davemloft.net)
  */
  */
 
 
 #include <linux/module.h>
 #include <linux/module.h>
@@ -33,8 +33,8 @@
 
 
 #define DRV_MODULE_NAME		"niu"
 #define DRV_MODULE_NAME		"niu"
 #define PFX DRV_MODULE_NAME	": "
 #define PFX DRV_MODULE_NAME	": "
-#define DRV_MODULE_VERSION	"0.8"
-#define DRV_MODULE_RELDATE	"April 24, 2008"
+#define DRV_MODULE_VERSION	"0.9"
+#define DRV_MODULE_RELDATE	"May 4, 2008"
 
 
 static char version[] __devinitdata =
 static char version[] __devinitdata =
 	DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
 	DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
@@ -7264,8 +7264,11 @@ static int __devinit niu_get_and_validate_port(struct niu *np)
 				parent->num_ports = nr64(ESPC_NUM_PORTS_MACS) &
 				parent->num_ports = nr64(ESPC_NUM_PORTS_MACS) &
 					ESPC_NUM_PORTS_MACS_VAL;
 					ESPC_NUM_PORTS_MACS_VAL;
 
 
+				/* All of the current probing methods fail on
+				 * Maramba on-board parts.
+				 */
 				if (!parent->num_ports)
 				if (!parent->num_ports)
-					return -ENODEV;
+					parent->num_ports = 4;
 			}
 			}
 		}
 		}
 	}
 	}