diff options
| author | Li-Zhen You <Li-Zhen.You@Sun.COM> | 2009-09-11 14:21:18 +0800 |
|---|---|---|
| committer | Li-Zhen You <Li-Zhen.You@Sun.COM> | 2009-09-11 14:21:18 +0800 |
| commit | 86d6718f496c4610ccde9646950290901cd512be (patch) | |
| tree | d8a742da1820b6b77366e45404d147f0667fd0a9 /usr/src | |
| parent | 7ba7860f5af89005c23337fb7cdc48145cc6b8ac (diff) | |
| download | illumos-joyent-86d6718f496c4610ccde9646950290901cd512be.tar.gz | |
6873347 nge can not set flowctrl on MCP55 based machines through dladm set-linkprop
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/uts/common/io/nge/nge_chip.c | 30 | ||||
| -rw-r--r-- | usr/src/uts/common/io/nge/nge_main.c | 21 | ||||
| -rw-r--r-- | usr/src/uts/common/io/nge/nge_xmii.c | 6 |
3 files changed, 34 insertions, 23 deletions
diff --git a/usr/src/uts/common/io/nge/nge_chip.c b/usr/src/uts/common/io/nge/nge_chip.c index 841c7edc04..5efae34727 100644 --- a/usr/src/uts/common/io/nge/nge_chip.c +++ b/usr/src/uts/common/io/nge/nge_chip.c @@ -1458,6 +1458,7 @@ nge_sync_mac_modes(nge_t *ngep) nge_bkoff_cntl bk_cntl; nge_mac2phy m2p; nge_rx_cntrl0 rx_cntl0; + nge_tx_cntl tx_cntl; nge_dev_spec_param_t *dev_param_p; dev_param_p = &ngep->dev_spec_param; @@ -1534,11 +1535,30 @@ nge_sync_mac_modes(nge_t *ngep) nge_reg_put32(ngep, NGE_BKOFF_CNTL, bk_cntl.cntl_val); rx_cntl0.cntl_val = nge_reg_get32(ngep, NGE_RX_CNTL0); - if (ngep->param_link_rx_pause && dev_param_p->rx_pause_frame) - rx_cntl0.cntl_bits.paen = NGE_SET; - else - rx_cntl0.cntl_bits.paen = NGE_CLEAR; - nge_reg_put32(ngep, NGE_RX_CNTL0, rx_cntl0.cntl_val); + if (ngep->param_link_rx_pause && dev_param_p->rx_pause_frame) { + if (rx_cntl0.cntl_bits.paen == NGE_CLEAR) { + rx_cntl0.cntl_bits.paen = NGE_SET; + nge_reg_put32(ngep, NGE_RX_CNTL0, rx_cntl0.cntl_val); + } + } else { + if (rx_cntl0.cntl_bits.paen == NGE_SET) { + rx_cntl0.cntl_bits.paen = NGE_CLEAR; + nge_reg_put32(ngep, NGE_RX_CNTL0, rx_cntl0.cntl_val); + } + } + + tx_cntl.cntl_val = nge_reg_get32(ngep, NGE_TX_CNTL); + if (ngep->param_link_tx_pause && dev_param_p->tx_pause_frame) { + if (tx_cntl.cntl_bits.paen == NGE_CLEAR) { + tx_cntl.cntl_bits.paen = NGE_SET; + nge_reg_put32(ngep, NGE_TX_CNTL, tx_cntl.cntl_val); + } + } else { + if (tx_cntl.cntl_bits.paen == NGE_SET) { + tx_cntl.cntl_bits.paen = NGE_CLEAR; + nge_reg_put32(ngep, NGE_TX_CNTL, tx_cntl.cntl_val); + } + } } /* diff --git a/usr/src/uts/common/io/nge/nge_main.c b/usr/src/uts/common/io/nge/nge_main.c index b1e939f866..e0f06f10e6 100644 --- a/usr/src/uts/common/io/nge/nge_main.c +++ b/usr/src/uts/common/io/nge/nge_main.c @@ -211,8 +211,6 @@ mac_priv_prop_t nge_priv_props[] = { {"_poll_busy_time", MAC_PROP_PERM_RW}, {"_rx_intr_hwater", MAC_PROP_PERM_RW}, {"_rx_intr_lwater", MAC_PROP_PERM_RW}, - {"_adv_pause_cap", MAC_PROP_PERM_RW}, - {"_adv_asym_pause_cap", MAC_PROP_PERM_RW}, {"_tx_n_intr", MAC_PROP_PERM_RW} }; @@ -1003,6 +1001,15 @@ nge_get_props(nge_t *ngep) DDI_PROP_DONTPASS, default_mtu, ETHERMTU); } else ngep->default_mtu = ETHERMTU; + if (dev_param_p->tx_pause_frame) + ngep->param_link_tx_pause = B_TRUE; + else + ngep->param_link_tx_pause = B_FALSE; + + if (dev_param_p->rx_pause_frame) + ngep->param_link_rx_pause = B_TRUE; + else + ngep->param_link_rx_pause = B_FALSE; if (ngep->default_mtu > ETHERMTU && ngep->default_mtu <= NGE_MTU_2500) { @@ -2072,16 +2079,6 @@ nge_get_priv_prop(nge_t *ngep, const char *pr_name, uint_t pr_flags, boolean_t is_default = (pr_flags & MAC_PROP_DEFAULT); int value; - if (strcmp(pr_name, "_adv_pause_cap") == 0) { - value = (is_default ? 1 : ngep->param_adv_pause); - err = 0; - goto done; - } - if (strcmp(pr_name, "_adv_asym_pause_cap") == 0) { - value = (is_default ? 1 : ngep->param_adv_asym_pause); - err = 0; - goto done; - } if (strcmp(pr_name, "_tx_bcopy_threshold") == 0) { value = (is_default ? NGE_TX_COPY_SIZE : ngep->param_txbcopy_threshold); diff --git a/usr/src/uts/common/io/nge/nge_xmii.c b/usr/src/uts/common/io/nge/nge_xmii.c index d5d630d028..cbe972e5f7 100644 --- a/usr/src/uts/common/io/nge/nge_xmii.c +++ b/usr/src/uts/common/io/nge/nge_xmii.c @@ -613,12 +613,6 @@ nge_check_copper(nge_t *ngep) ngep->param_lp_asym_pause = B_TRUE; if (lpan & MII_LP_PAUSE) ngep->param_lp_pause = B_TRUE; - ngep->param_link_tx_pause = B_FALSE; - - if (ngep->param_adv_autoneg) - ngep->param_link_rx_pause = B_FALSE; - else - ngep->param_link_rx_pause = ngep->param_adv_pause; if (linkup) { ngep->param_link_up = linkup; ngep->param_link_speed = nge_copper_link_speed[speed]; |
