summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryong tan - Sun Microsystems - Beijing China <Yong.Tan@Sun.COM>2009-05-27 10:29:49 +0800
committeryong tan - Sun Microsystems - Beijing China <Yong.Tan@Sun.COM>2009-05-27 10:29:49 +0800
commit4d6eaea5019b5d24b19a812b20291ec4f8b8fa3d (patch)
treea6e3e1629e19557c4b39c89dfad0a153e1105f98
parent48056c53c7a3d65cab2626a67418401d97b58c1a (diff)
downloadillumos-gate-4d6eaea5019b5d24b19a812b20291ec4f8b8fa3d.tar.gz
6649689 bge private properties for interrupt coalescing should check for negative input values
6828220 mismatch device IDs between Broadcom bcm5703 copper and serdes 6793252 IBM eServer fma incorrectly shows fault.io.pciex.device-interr
-rw-r--r--usr/src/uts/common/io/bge/bge_chip2.c20
-rw-r--r--usr/src/uts/common/io/bge/bge_hw.h4
-rw-r--r--usr/src/uts/common/io/bge/bge_impl.h5
-rw-r--r--usr/src/uts/common/io/bge/bge_main2.c47
-rw-r--r--usr/src/uts/common/io/bge/bge_mii.c2
5 files changed, 63 insertions, 15 deletions
diff --git a/usr/src/uts/common/io/bge/bge_chip2.c b/usr/src/uts/common/io/bge/bge_chip2.c
index a2b7ae1a91..5a0c3e717d 100644
--- a/usr/src/uts/common/io/bge/bge_chip2.c
+++ b/usr/src/uts/common/io/bge/bge_chip2.c
@@ -1965,6 +1965,8 @@ bge_chip_id_init(bge_t *bgep)
cidp->mbuf_hi_water = bge_mbuf_hi_water;
cidp->rx_ticks_norm = bge_rx_ticks_norm;
cidp->rx_count_norm = bge_rx_count_norm;
+ cidp->tx_ticks_norm = bge_tx_ticks_norm;
+ cidp->tx_count_norm = bge_tx_count_norm;
if (cidp->rx_rings == 0 || cidp->rx_rings > BGE_RECV_RINGS_MAX)
cidp->rx_rings = BGE_RECV_RINGS_DEFAULT;
@@ -3567,6 +3569,19 @@ bge_chip_reset(bge_t *bgep, boolean_t enable_dma)
int bge_chip_start(bge_t *bgep, boolean_t reset_phys);
#pragma no_inline(bge_chip_start)
+void
+bge_chip_coalesce_update(bge_t *bgep)
+{
+ bge_reg_put32(bgep, SEND_COALESCE_MAX_BD_REG,
+ bgep->chipid.tx_count_norm);
+ bge_reg_put32(bgep, SEND_COALESCE_TICKS_REG,
+ bgep->chipid.tx_ticks_norm);
+ bge_reg_put32(bgep, RCV_COALESCE_MAX_BD_REG,
+ bgep->chipid.rx_count_norm);
+ bge_reg_put32(bgep, RCV_COALESCE_TICKS_REG,
+ bgep->chipid.rx_ticks_norm);
+}
+
int
bge_chip_start(bge_t *bgep, boolean_t reset_phys)
{
@@ -3828,10 +3843,7 @@ bge_chip_start(bge_t *bgep, boolean_t reset_phys)
/*
* Steps 59-62: initialise Host Coalescing parameters
*/
- bge_reg_put32(bgep, SEND_COALESCE_MAX_BD_REG, bge_tx_count_norm);
- bge_reg_put32(bgep, SEND_COALESCE_TICKS_REG, bge_tx_ticks_norm);
- bge_reg_put32(bgep, RCV_COALESCE_MAX_BD_REG, bge_rx_count_norm);
- bge_reg_put32(bgep, RCV_COALESCE_TICKS_REG, bge_rx_ticks_norm);
+ bge_chip_coalesce_update(bgep);
if (DEVICE_5704_SERIES_CHIPSETS(bgep)) {
bge_reg_put32(bgep, SEND_COALESCE_INT_BD_REG,
bge_tx_count_intr);
diff --git a/usr/src/uts/common/io/bge/bge_hw.h b/usr/src/uts/common/io/bge/bge_hw.h
index 43d47453c5..68b569cf2a 100644
--- a/usr/src/uts/common/io/bge/bge_hw.h
+++ b/usr/src/uts/common/io/bge/bge_hw.h
@@ -56,8 +56,8 @@ extern "C" {
#define DEVICE_ID_5701 0x1645
#define DEVICE_ID_5702 0x16a6
#define DEVICE_ID_5702fe 0x164d
-#define DEVICE_ID_5703C 0x1647
-#define DEVICE_ID_5703S 0x16a7
+#define DEVICE_ID_5703C 0x16a7
+#define DEVICE_ID_5703S 0x1647
#define DEVICE_ID_5703 0x16c7
#define DEVICE_ID_5704C 0x1648
#define DEVICE_ID_5704S 0x16a8
diff --git a/usr/src/uts/common/io/bge/bge_impl.h b/usr/src/uts/common/io/bge/bge_impl.h
index 3d2b73f325..34465733b6 100644
--- a/usr/src/uts/common/io/bge/bge_impl.h
+++ b/usr/src/uts/common/io/bge/bge_impl.h
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -632,6 +632,8 @@ typedef struct {
uint32_t rx_ticks_norm;
uint32_t rx_count_norm;
+ uint32_t tx_ticks_norm;
+ uint32_t tx_count_norm;
} chip_id_t;
#define CHIP_FLAG_SUPPORTED 0x80
@@ -1147,6 +1149,7 @@ void bge_reg_clr32(bge_t *bgep, bge_regno_t regno, uint32_t bits);
void bge_mbx_put(bge_t *bgep, bge_regno_t regno, uint64_t value);
void bge_chip_cfg_init(bge_t *bgep, chip_id_t *cidp, boolean_t enable_dma);
int bge_chip_id_init(bge_t *bgep);
+void bge_chip_coalesce_update(bge_t *bgep);
int bge_chip_start(bge_t *bgep, boolean_t reset_phy);
void bge_chip_stop(bge_t *bgep, boolean_t fault);
#ifndef __sparc
diff --git a/usr/src/uts/common/io/bge/bge_main2.c b/usr/src/uts/common/io/bge/bge_main2.c
index 3ab38a6a05..4a7d0c0dde 100644
--- a/usr/src/uts/common/io/bge/bge_main2.c
+++ b/usr/src/uts/common/io/bge/bge_main2.c
@@ -37,7 +37,7 @@ static char bge_ident[] = "Broadcom Gb Ethernet";
/*
* Make sure you keep the version ID up to date!
*/
-static char bge_version[] = "Broadcom Gb Ethernet v1.06";
+static char bge_version[] = "Broadcom Gb Ethernet v1.07";
/*
* Property names
@@ -1183,20 +1183,53 @@ bge_set_priv_prop(bge_t *bgep, const char *pr_name, uint_t pr_valsize,
}
return (err);
}
- if (strcmp(pr_name, "_intr_coalesce_blank_time") == 0) {
+ if (strcmp(pr_name, "_rx_intr_coalesce_blank_time") == 0) {
if (ddi_strtol(pr_val, (char **)NULL, 0, &result) != 0)
return (EINVAL);
+ if (result < 0)
+ err = EINVAL;
+ else {
+ bgep->chipid.rx_ticks_norm = (uint32_t)result;
+ bge_chip_coalesce_update(bgep);
+ }
+ return (err);
+ }
- bgep->chipid.rx_ticks_norm = (uint32_t)result;
- return (0);
+ if (strcmp(pr_name, "_rx_intr_coalesce_pkt_cnt") == 0) {
+ if (ddi_strtol(pr_val, (char **)NULL, 0, &result) != 0)
+ return (EINVAL);
+
+ if (result < 0)
+ err = EINVAL;
+ else {
+ bgep->chipid.rx_count_norm = (uint32_t)result;
+ bge_chip_coalesce_update(bgep);
+ }
+ return (err);
+ }
+ if (strcmp(pr_name, "_tx_intr_coalesce_blank_time") == 0) {
+ if (ddi_strtol(pr_val, (char **)NULL, 0, &result) != 0)
+ return (EINVAL);
+ if (result < 0)
+ err = EINVAL;
+ else {
+ bgep->chipid.tx_ticks_norm = (uint32_t)result;
+ bge_chip_coalesce_update(bgep);
+ }
+ return (err);
}
- if (strcmp(pr_name, "_intr_coalesce_pkt_cnt") == 0) {
+ if (strcmp(pr_name, "_tx_intr_coalesce_pkt_cnt") == 0) {
if (ddi_strtol(pr_val, (char **)NULL, 0, &result) != 0)
return (EINVAL);
- bgep->chipid.rx_count_norm = (uint32_t)result;
- return (0);
+ if (result < 0)
+ err = EINVAL;
+ else {
+ bgep->chipid.tx_count_norm = (uint32_t)result;
+ bge_chip_coalesce_update(bgep);
+ }
+ return (err);
}
return (ENOTSUP);
}
diff --git a/usr/src/uts/common/io/bge/bge_mii.c b/usr/src/uts/common/io/bge/bge_mii.c
index a32718d142..7a8f39ec49 100644
--- a/usr/src/uts/common/io/bge/bge_mii.c
+++ b/usr/src/uts/common/io/bge/bge_mii.c
@@ -545,7 +545,6 @@ bge_restart_copper(bge_t *bgep, boolean_t powerdown)
case MHCR_CHIP_ASIC_REV_5703:
case MHCR_CHIP_ASIC_REV_5704:
case MHCR_CHIP_ASIC_REV_5705:
- case MHCR_CHIP_ASIC_REV_5721_5751:
case MHCR_CHIP_ASIC_REV_5752:
case MHCR_CHIP_ASIC_REV_5714:
case MHCR_CHIP_ASIC_REV_5715:
@@ -556,6 +555,7 @@ bge_restart_copper(bge_t *bgep, boolean_t powerdown)
case MHCR_CHIP_ASIC_REV_5700:
case MHCR_CHIP_ASIC_REV_5701:
case MHCR_CHIP_ASIC_REV_5723:
+ case MHCR_CHIP_ASIC_REV_5721_5751:
/*
* Just a plain reset; the "check" code breaks these chips
*/