changeset 10814:6099042edac0

6892693 rge with RTL8111C missing multicast packets
author KHF04453@nifty.ne.jp
date Mon, 19 Oct 2009 20:02:56 -0700
parents b0c1106a7114
children b7f7a9b95aa4
files usr/src/uts/common/io/rge/rge_chip.c usr/src/uts/common/io/rge/rge_hw.h usr/src/uts/common/io/rge/rge_main.c
diffstat 3 files changed, 22 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/rge/rge_chip.c	Mon Oct 19 15:08:04 2009 -0700
+++ b/usr/src/uts/common/io/rge/rge_chip.c	Mon Oct 19 20:02:56 2009 -0700
@@ -707,6 +707,7 @@
 	case MAC_VER_8168:
 	case MAC_VER_8168B_B:
 	case MAC_VER_8168B_C:
+	case MAC_VER_8168C:
 	case MAC_VER_8101E:
 	case MAC_VER_8101E_B:
 		chip->is_pcie = B_TRUE;
@@ -888,6 +889,7 @@
 		 * Increase the threshold voltage of RX sensitivity
 		 */
 		if (chip->mac_ver != MAC_VER_8168 &&
+		    chip->mac_ver != MAC_VER_8168C &&
 		    chip->mac_ver != MAC_VER_8101E_B)
 			rge_ephy_put16(rgep, 0x01, 0x1bd3);
 
@@ -896,7 +898,8 @@
 		if (rgep->chipid.mac_ver != MAC_VER_8101E &&
 		    rgep->chipid.mac_ver != MAC_VER_8101E_B &&
 		    rgep->chipid.mac_ver != MAC_VER_8101E_C &&
-		    rgep->chipid.mac_ver != MAC_VER_8168B_C) {
+		    rgep->chipid.mac_ver != MAC_VER_8168B_C &&
+		    rgep->chipid.mac_ver != MAC_VER_8168C) {
 			rge_reg_put16(rgep, PHY_STATUS_REG, val16);
 			rge_reg_put32(rgep, RT_CSI_DATA_REG, 0x00021c01);
 			rge_reg_put32(rgep, RT_CSI_ACCESS_REG, 0x8000f088);
@@ -1008,8 +1011,13 @@
 	 * Set multicast register
 	 */
 	hashp = (uint32_t *)rgep->mcast_hash;
-	rge_reg_put32(rgep, MULTICAST_0_REG, hashp[0]);
-	rge_reg_put32(rgep, MULTICAST_4_REG, hashp[1]);
+	if (rgep->promisc) {
+		rge_reg_put32(rgep, MULTICAST_0_REG, ~0U);
+		rge_reg_put32(rgep, MULTICAST_4_REG, ~0U);
+	} else {
+		rge_reg_put32(rgep, MULTICAST_0_REG, RGE_BSWAP_32(hashp[0]));
+		rge_reg_put32(rgep, MULTICAST_4_REG, RGE_BSWAP_32(hashp[1]));
+	}
 
 	/*
 	 * Msic register setting:
@@ -1203,8 +1211,13 @@
 	if (rgep->chipid.mac_ver == MAC_VER_8169SC) {
 		rge_reg_set8(rgep, RT_93c46_COMMOND_REG, RT_93c46_MODE_CONFIG);
 	}
-	rge_reg_put32(rgep, MULTICAST_0_REG, RGE_BSWAP_32(hashp[0]));
-	rge_reg_put32(rgep, MULTICAST_4_REG, RGE_BSWAP_32(hashp[1]));
+	if (rgep->promisc) {
+		rge_reg_put32(rgep, MULTICAST_0_REG, ~0U);
+		rge_reg_put32(rgep, MULTICAST_4_REG, ~0U);
+	} else {
+		rge_reg_put32(rgep, MULTICAST_0_REG, RGE_BSWAP_32(hashp[0]));
+		rge_reg_put32(rgep, MULTICAST_4_REG, RGE_BSWAP_32(hashp[1]));
+	}
 
 	/*
 	 * Return to normal network/host communication mode
@@ -1251,6 +1264,7 @@
 		break;
 	case RGE_SET_PROMISC:
 		/* Set or clear the PROMISCUOUS mode bit */
+		rge_set_multi_addr(rgep);
 		rge_set_promisc(rgep);
 		break;
 	default:
--- a/usr/src/uts/common/io/rge/rge_hw.h	Mon Oct 19 15:08:04 2009 -0700
+++ b/usr/src/uts/common/io/rge/rge_hw.h	Mon Oct 19 20:02:56 2009 -0700
@@ -168,7 +168,7 @@
 #define	MAC_VER_8168			0x20000000
 #define	MAC_VER_8168B_B			0x30000000
 #define	MAC_VER_8168B_C			0x38000000
-#define	MAC_VER_8168B_D			0x3c000000
+#define	MAC_VER_8168C			0x3c000000
 #define	MAC_VER_8101E			0x34000000
 #define	MAC_VER_8101E_B			0x24800000
 #define	MAC_VER_8101E_C			0x34800000
--- a/usr/src/uts/common/io/rge/rge_main.c	Mon Oct 19 15:08:04 2009 -0700
+++ b/usr/src/uts/common/io/rge/rge_main.c	Mon Oct 19 20:02:56 2009 -0700
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -1269,7 +1269,7 @@
 			*hcksum_txflags = HCKSUM_INET_FULL_V4 |
 			    HCKSUM_IPHDRCKSUM;
 			break;
-		case MAC_VER_8168B_D:
+		case MAC_VER_8168C:
 		case MAC_VER_8101E_B:
 		case MAC_VER_8101E_C:
 		default: