Loading drivers/net/e1000/e1000_ethtool.c +7 −7 Original line number Original line Diff line number Diff line Loading @@ -228,11 +228,11 @@ e1000_get_pauseparam(struct net_device *netdev, pause->autoneg = pause->autoneg = (adapter->fc_autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE); (adapter->fc_autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE); if (hw->fc == e1000_fc_rx_pause) if (hw->fc == E1000_FC_RX_PAUSE) pause->rx_pause = 1; pause->rx_pause = 1; else if (hw->fc == e1000_fc_tx_pause) else if (hw->fc == E1000_FC_TX_PAUSE) pause->tx_pause = 1; pause->tx_pause = 1; else if (hw->fc == e1000_fc_full) { else if (hw->fc == E1000_FC_FULL) { pause->rx_pause = 1; pause->rx_pause = 1; pause->tx_pause = 1; pause->tx_pause = 1; } } Loading @@ -252,13 +252,13 @@ e1000_set_pauseparam(struct net_device *netdev, msleep(1); msleep(1); if (pause->rx_pause && pause->tx_pause) if (pause->rx_pause && pause->tx_pause) hw->fc = e1000_fc_full; hw->fc = E1000_FC_FULL; else if (pause->rx_pause && !pause->tx_pause) else if (pause->rx_pause && !pause->tx_pause) hw->fc = e1000_fc_rx_pause; hw->fc = E1000_FC_RX_PAUSE; else if (!pause->rx_pause && pause->tx_pause) else if (!pause->rx_pause && pause->tx_pause) hw->fc = e1000_fc_tx_pause; hw->fc = E1000_FC_TX_PAUSE; else if (!pause->rx_pause && !pause->tx_pause) else if (!pause->rx_pause && !pause->tx_pause) hw->fc = e1000_fc_none; hw->fc = E1000_FC_NONE; hw->original_fc = hw->fc; hw->original_fc = hw->fc; Loading drivers/net/e1000/e1000_hw.c +42 −42 Original line number Original line Diff line number Diff line Loading @@ -1017,11 +1017,11 @@ e1000_setup_link(struct e1000_hw *hw) * control setting, then the variable hw->fc will * control setting, then the variable hw->fc will * be initialized based on a value in the EEPROM. * be initialized based on a value in the EEPROM. */ */ if (hw->fc == e1000_fc_default) { if (hw->fc == E1000_FC_DEFAULT) { switch (hw->mac_type) { switch (hw->mac_type) { case e1000_ich8lan: case e1000_ich8lan: case e1000_82573: case e1000_82573: hw->fc = e1000_fc_full; hw->fc = E1000_FC_FULL; break; break; default: default: ret_val = e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, ret_val = e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, Loading @@ -1031,12 +1031,12 @@ e1000_setup_link(struct e1000_hw *hw) return -E1000_ERR_EEPROM; return -E1000_ERR_EEPROM; } } if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == 0) if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == 0) hw->fc = e1000_fc_none; hw->fc = E1000_FC_NONE; else if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == else if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == EEPROM_WORD0F_ASM_DIR) EEPROM_WORD0F_ASM_DIR) hw->fc = e1000_fc_tx_pause; hw->fc = E1000_FC_TX_PAUSE; else else hw->fc = e1000_fc_full; hw->fc = E1000_FC_FULL; break; break; } } } } Loading @@ -1046,10 +1046,10 @@ e1000_setup_link(struct e1000_hw *hw) * hub or switch with different Flow Control capabilities. * hub or switch with different Flow Control capabilities. */ */ if (hw->mac_type == e1000_82542_rev2_0) if (hw->mac_type == e1000_82542_rev2_0) hw->fc &= (~e1000_fc_tx_pause); hw->fc &= (~E1000_FC_TX_PAUSE); if ((hw->mac_type < e1000_82543) && (hw->report_tx_early == 1)) if ((hw->mac_type < e1000_82543) && (hw->report_tx_early == 1)) hw->fc &= (~e1000_fc_rx_pause); hw->fc &= (~E1000_FC_RX_PAUSE); hw->original_fc = hw->fc; hw->original_fc = hw->fc; Loading Loading @@ -1101,7 +1101,7 @@ e1000_setup_link(struct e1000_hw *hw) * ability to transmit pause frames in not enabled, then these * ability to transmit pause frames in not enabled, then these * registers will be set to 0. * registers will be set to 0. */ */ if (!(hw->fc & e1000_fc_tx_pause)) { if (!(hw->fc & E1000_FC_TX_PAUSE)) { E1000_WRITE_REG(hw, FCRTL, 0); E1000_WRITE_REG(hw, FCRTL, 0); E1000_WRITE_REG(hw, FCRTH, 0); E1000_WRITE_REG(hw, FCRTH, 0); } else { } else { Loading Loading @@ -1188,11 +1188,11 @@ e1000_setup_fiber_serdes_link(struct e1000_hw *hw) * 3: Both Rx and TX flow control (symmetric) are enabled. * 3: Both Rx and TX flow control (symmetric) are enabled. */ */ switch (hw->fc) { switch (hw->fc) { case e1000_fc_none: case E1000_FC_NONE: /* Flow control is completely disabled by a software over-ride. */ /* Flow control is completely disabled by a software over-ride. */ txcw = (E1000_TXCW_ANE | E1000_TXCW_FD); txcw = (E1000_TXCW_ANE | E1000_TXCW_FD); break; break; case e1000_fc_rx_pause: case E1000_FC_RX_PAUSE: /* RX Flow control is enabled and TX Flow control is disabled by a /* RX Flow control is enabled and TX Flow control is disabled by a * software over-ride. Since there really isn't a way to advertise * software over-ride. Since there really isn't a way to advertise * that we are capable of RX Pause ONLY, we will advertise that we * that we are capable of RX Pause ONLY, we will advertise that we Loading @@ -1201,13 +1201,13 @@ e1000_setup_fiber_serdes_link(struct e1000_hw *hw) */ */ txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK); txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK); break; break; case e1000_fc_tx_pause: case E1000_FC_TX_PAUSE: /* TX Flow control is enabled, and RX Flow control is disabled, by a /* TX Flow control is enabled, and RX Flow control is disabled, by a * software over-ride. * software over-ride. */ */ txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_ASM_DIR); txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_ASM_DIR); break; break; case e1000_fc_full: case E1000_FC_FULL: /* Flow control (both RX and TX) is enabled by a software over-ride. */ /* Flow control (both RX and TX) is enabled by a software over-ride. */ txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK); txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK); break; break; Loading Loading @@ -2123,13 +2123,13 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw) * in the EEPROM is used. * in the EEPROM is used. */ */ switch (hw->fc) { switch (hw->fc) { case e1000_fc_none: /* 0 */ case E1000_FC_NONE: /* 0 */ /* Flow control (RX & TX) is completely disabled by a /* Flow control (RX & TX) is completely disabled by a * software over-ride. * software over-ride. */ */ mii_autoneg_adv_reg &= ~(NWAY_AR_ASM_DIR | NWAY_AR_PAUSE); mii_autoneg_adv_reg &= ~(NWAY_AR_ASM_DIR | NWAY_AR_PAUSE); break; break; case e1000_fc_rx_pause: /* 1 */ case E1000_FC_RX_PAUSE: /* 1 */ /* RX Flow control is enabled, and TX Flow control is /* RX Flow control is enabled, and TX Flow control is * disabled, by a software over-ride. * disabled, by a software over-ride. */ */ Loading @@ -2141,14 +2141,14 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw) */ */ mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE); mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE); break; break; case e1000_fc_tx_pause: /* 2 */ case E1000_FC_TX_PAUSE: /* 2 */ /* TX Flow control is enabled, and RX Flow control is /* TX Flow control is enabled, and RX Flow control is * disabled, by a software over-ride. * disabled, by a software over-ride. */ */ mii_autoneg_adv_reg |= NWAY_AR_ASM_DIR; mii_autoneg_adv_reg |= NWAY_AR_ASM_DIR; mii_autoneg_adv_reg &= ~NWAY_AR_PAUSE; mii_autoneg_adv_reg &= ~NWAY_AR_PAUSE; break; break; case e1000_fc_full: /* 3 */ case E1000_FC_FULL: /* 3 */ /* Flow control (both RX and TX) is enabled by a software /* Flow control (both RX and TX) is enabled by a software * over-ride. * over-ride. */ */ Loading Loading @@ -2192,7 +2192,7 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw) DEBUGFUNC("e1000_phy_force_speed_duplex"); DEBUGFUNC("e1000_phy_force_speed_duplex"); /* Turn off Flow control if we are forcing speed and duplex. */ /* Turn off Flow control if we are forcing speed and duplex. */ hw->fc = e1000_fc_none; hw->fc = E1000_FC_NONE; DEBUGOUT1("hw->fc = %d\n", hw->fc); DEBUGOUT1("hw->fc = %d\n", hw->fc); Loading Loading @@ -2546,18 +2546,18 @@ e1000_force_mac_fc(struct e1000_hw *hw) */ */ switch (hw->fc) { switch (hw->fc) { case e1000_fc_none: case E1000_FC_NONE: ctrl &= (~(E1000_CTRL_TFCE | E1000_CTRL_RFCE)); ctrl &= (~(E1000_CTRL_TFCE | E1000_CTRL_RFCE)); break; break; case e1000_fc_rx_pause: case E1000_FC_RX_PAUSE: ctrl &= (~E1000_CTRL_TFCE); ctrl &= (~E1000_CTRL_TFCE); ctrl |= E1000_CTRL_RFCE; ctrl |= E1000_CTRL_RFCE; break; break; case e1000_fc_tx_pause: case E1000_FC_TX_PAUSE: ctrl &= (~E1000_CTRL_RFCE); ctrl &= (~E1000_CTRL_RFCE); ctrl |= E1000_CTRL_TFCE; ctrl |= E1000_CTRL_TFCE; break; break; case e1000_fc_full: case E1000_FC_FULL: ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE); ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE); break; break; default: default: Loading Loading @@ -2656,14 +2656,14 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) * LOCAL DEVICE | LINK PARTNER * LOCAL DEVICE | LINK PARTNER * PAUSE | ASM_DIR | PAUSE | ASM_DIR | NIC Resolution * PAUSE | ASM_DIR | PAUSE | ASM_DIR | NIC Resolution *-------|---------|-------|---------|-------------------- *-------|---------|-------|---------|-------------------- * 0 | 0 | DC | DC | e1000_fc_none * 0 | 0 | DC | DC | E1000_FC_NONE * 0 | 1 | 0 | DC | e1000_fc_none * 0 | 1 | 0 | DC | E1000_FC_NONE * 0 | 1 | 1 | 0 | e1000_fc_none * 0 | 1 | 1 | 0 | E1000_FC_NONE * 0 | 1 | 1 | 1 | e1000_fc_tx_pause * 0 | 1 | 1 | 1 | E1000_FC_TX_PAUSE * 1 | 0 | 0 | DC | e1000_fc_none * 1 | 0 | 0 | DC | E1000_FC_NONE * 1 | DC | 1 | DC | e1000_fc_full * 1 | DC | 1 | DC | E1000_FC_FULL * 1 | 1 | 0 | 0 | e1000_fc_none * 1 | 1 | 0 | 0 | E1000_FC_NONE * 1 | 1 | 0 | 1 | e1000_fc_rx_pause * 1 | 1 | 0 | 1 | E1000_FC_RX_PAUSE * * */ */ /* Are both PAUSE bits set to 1? If so, this implies /* Are both PAUSE bits set to 1? If so, this implies Loading @@ -2675,7 +2675,7 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) * LOCAL DEVICE | LINK PARTNER * LOCAL DEVICE | LINK PARTNER * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result *-------|---------|-------|---------|-------------------- *-------|---------|-------|---------|-------------------- * 1 | DC | 1 | DC | e1000_fc_full * 1 | DC | 1 | DC | E1000_FC_FULL * * */ */ if ((mii_nway_adv_reg & NWAY_AR_PAUSE) && if ((mii_nway_adv_reg & NWAY_AR_PAUSE) && Loading @@ -2686,11 +2686,11 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) * ONLY. Hence, we must now check to see if we need to * ONLY. Hence, we must now check to see if we need to * turn OFF the TRANSMISSION of PAUSE frames. * turn OFF the TRANSMISSION of PAUSE frames. */ */ if (hw->original_fc == e1000_fc_full) { if (hw->original_fc == E1000_FC_FULL) { hw->fc = e1000_fc_full; hw->fc = E1000_FC_FULL; DEBUGOUT("Flow Control = FULL.\n"); DEBUGOUT("Flow Control = FULL.\n"); } else { } else { hw->fc = e1000_fc_rx_pause; hw->fc = E1000_FC_RX_PAUSE; DEBUGOUT("Flow Control = RX PAUSE frames only.\n"); DEBUGOUT("Flow Control = RX PAUSE frames only.\n"); } } } } Loading @@ -2699,14 +2699,14 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) * LOCAL DEVICE | LINK PARTNER * LOCAL DEVICE | LINK PARTNER * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result *-------|---------|-------|---------|-------------------- *-------|---------|-------|---------|-------------------- * 0 | 1 | 1 | 1 | e1000_fc_tx_pause * 0 | 1 | 1 | 1 | E1000_FC_TX_PAUSE * * */ */ else if (!(mii_nway_adv_reg & NWAY_AR_PAUSE) && else if (!(mii_nway_adv_reg & NWAY_AR_PAUSE) && (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { hw->fc = e1000_fc_tx_pause; hw->fc = E1000_FC_TX_PAUSE; DEBUGOUT("Flow Control = TX PAUSE frames only.\n"); DEBUGOUT("Flow Control = TX PAUSE frames only.\n"); } } /* For transmitting PAUSE frames ONLY. /* For transmitting PAUSE frames ONLY. Loading @@ -2714,14 +2714,14 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) * LOCAL DEVICE | LINK PARTNER * LOCAL DEVICE | LINK PARTNER * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result *-------|---------|-------|---------|-------------------- *-------|---------|-------|---------|-------------------- * 1 | 1 | 0 | 1 | e1000_fc_rx_pause * 1 | 1 | 0 | 1 | E1000_FC_RX_PAUSE * * */ */ else if ((mii_nway_adv_reg & NWAY_AR_PAUSE) && else if ((mii_nway_adv_reg & NWAY_AR_PAUSE) && (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { hw->fc = e1000_fc_rx_pause; hw->fc = E1000_FC_RX_PAUSE; DEBUGOUT("Flow Control = RX PAUSE frames only.\n"); DEBUGOUT("Flow Control = RX PAUSE frames only.\n"); } } /* Per the IEEE spec, at this point flow control should be /* Per the IEEE spec, at this point flow control should be Loading @@ -2744,13 +2744,13 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) * be asked to delay transmission of packets than asking * be asked to delay transmission of packets than asking * our link partner to pause transmission of frames. * our link partner to pause transmission of frames. */ */ else if ((hw->original_fc == e1000_fc_none || else if ((hw->original_fc == E1000_FC_NONE || hw->original_fc == e1000_fc_tx_pause) || hw->original_fc == E1000_FC_TX_PAUSE) || hw->fc_strict_ieee) { hw->fc_strict_ieee) { hw->fc = e1000_fc_none; hw->fc = E1000_FC_NONE; DEBUGOUT("Flow Control = NONE.\n"); DEBUGOUT("Flow Control = NONE.\n"); } else { } else { hw->fc = e1000_fc_rx_pause; hw->fc = E1000_FC_RX_PAUSE; DEBUGOUT("Flow Control = RX PAUSE frames only.\n"); DEBUGOUT("Flow Control = RX PAUSE frames only.\n"); } } Loading @@ -2765,7 +2765,7 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) } } if (duplex == HALF_DUPLEX) if (duplex == HALF_DUPLEX) hw->fc = e1000_fc_none; hw->fc = E1000_FC_NONE; /* Now we call a subroutine to actually force the MAC /* Now we call a subroutine to actually force the MAC * controller to use the correct flow control settings. * controller to use the correct flow control settings. Loading drivers/net/e1000/e1000_hw.h +5 −5 Original line number Original line Diff line number Diff line Loading @@ -92,11 +92,11 @@ typedef enum { /* Flow Control Settings */ /* Flow Control Settings */ typedef enum { typedef enum { e1000_fc_none = 0, E1000_FC_NONE = 0, e1000_fc_rx_pause = 1, E1000_FC_RX_PAUSE = 1, e1000_fc_tx_pause = 2, E1000_FC_TX_PAUSE = 2, e1000_fc_full = 3, E1000_FC_FULL = 3, e1000_fc_default = 0xFF E1000_FC_DEFAULT = 0xFF } e1000_fc_type; } e1000_fc_type; struct e1000_shadow_ram { struct e1000_shadow_ram { Loading drivers/net/e1000/e1000_param.c +6 −6 Original line number Original line Diff line number Diff line Loading @@ -396,17 +396,17 @@ e1000_check_options(struct e1000_adapter *adapter) { /* Flow Control */ { /* Flow Control */ struct e1000_opt_list fc_list[] = struct e1000_opt_list fc_list[] = {{ e1000_fc_none, "Flow Control Disabled" }, {{ E1000_FC_NONE, "Flow Control Disabled" }, { e1000_fc_rx_pause,"Flow Control Receive Only" }, { E1000_FC_RX_PAUSE,"Flow Control Receive Only" }, { e1000_fc_tx_pause,"Flow Control Transmit Only" }, { E1000_FC_TX_PAUSE,"Flow Control Transmit Only" }, { e1000_fc_full, "Flow Control Enabled" }, { E1000_FC_FULL, "Flow Control Enabled" }, { e1000_fc_default, "Flow Control Hardware Default" }}; { E1000_FC_DEFAULT, "Flow Control Hardware Default" }}; struct e1000_option opt = { struct e1000_option opt = { .type = list_option, .type = list_option, .name = "Flow Control", .name = "Flow Control", .err = "reading default settings from EEPROM", .err = "reading default settings from EEPROM", .def = e1000_fc_default, .def = E1000_FC_DEFAULT, .arg = { .l = { .nr = ARRAY_SIZE(fc_list), .arg = { .l = { .nr = ARRAY_SIZE(fc_list), .p = fc_list }} .p = fc_list }} }; }; Loading Loading
drivers/net/e1000/e1000_ethtool.c +7 −7 Original line number Original line Diff line number Diff line Loading @@ -228,11 +228,11 @@ e1000_get_pauseparam(struct net_device *netdev, pause->autoneg = pause->autoneg = (adapter->fc_autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE); (adapter->fc_autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE); if (hw->fc == e1000_fc_rx_pause) if (hw->fc == E1000_FC_RX_PAUSE) pause->rx_pause = 1; pause->rx_pause = 1; else if (hw->fc == e1000_fc_tx_pause) else if (hw->fc == E1000_FC_TX_PAUSE) pause->tx_pause = 1; pause->tx_pause = 1; else if (hw->fc == e1000_fc_full) { else if (hw->fc == E1000_FC_FULL) { pause->rx_pause = 1; pause->rx_pause = 1; pause->tx_pause = 1; pause->tx_pause = 1; } } Loading @@ -252,13 +252,13 @@ e1000_set_pauseparam(struct net_device *netdev, msleep(1); msleep(1); if (pause->rx_pause && pause->tx_pause) if (pause->rx_pause && pause->tx_pause) hw->fc = e1000_fc_full; hw->fc = E1000_FC_FULL; else if (pause->rx_pause && !pause->tx_pause) else if (pause->rx_pause && !pause->tx_pause) hw->fc = e1000_fc_rx_pause; hw->fc = E1000_FC_RX_PAUSE; else if (!pause->rx_pause && pause->tx_pause) else if (!pause->rx_pause && pause->tx_pause) hw->fc = e1000_fc_tx_pause; hw->fc = E1000_FC_TX_PAUSE; else if (!pause->rx_pause && !pause->tx_pause) else if (!pause->rx_pause && !pause->tx_pause) hw->fc = e1000_fc_none; hw->fc = E1000_FC_NONE; hw->original_fc = hw->fc; hw->original_fc = hw->fc; Loading
drivers/net/e1000/e1000_hw.c +42 −42 Original line number Original line Diff line number Diff line Loading @@ -1017,11 +1017,11 @@ e1000_setup_link(struct e1000_hw *hw) * control setting, then the variable hw->fc will * control setting, then the variable hw->fc will * be initialized based on a value in the EEPROM. * be initialized based on a value in the EEPROM. */ */ if (hw->fc == e1000_fc_default) { if (hw->fc == E1000_FC_DEFAULT) { switch (hw->mac_type) { switch (hw->mac_type) { case e1000_ich8lan: case e1000_ich8lan: case e1000_82573: case e1000_82573: hw->fc = e1000_fc_full; hw->fc = E1000_FC_FULL; break; break; default: default: ret_val = e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, ret_val = e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, Loading @@ -1031,12 +1031,12 @@ e1000_setup_link(struct e1000_hw *hw) return -E1000_ERR_EEPROM; return -E1000_ERR_EEPROM; } } if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == 0) if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == 0) hw->fc = e1000_fc_none; hw->fc = E1000_FC_NONE; else if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == else if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == EEPROM_WORD0F_ASM_DIR) EEPROM_WORD0F_ASM_DIR) hw->fc = e1000_fc_tx_pause; hw->fc = E1000_FC_TX_PAUSE; else else hw->fc = e1000_fc_full; hw->fc = E1000_FC_FULL; break; break; } } } } Loading @@ -1046,10 +1046,10 @@ e1000_setup_link(struct e1000_hw *hw) * hub or switch with different Flow Control capabilities. * hub or switch with different Flow Control capabilities. */ */ if (hw->mac_type == e1000_82542_rev2_0) if (hw->mac_type == e1000_82542_rev2_0) hw->fc &= (~e1000_fc_tx_pause); hw->fc &= (~E1000_FC_TX_PAUSE); if ((hw->mac_type < e1000_82543) && (hw->report_tx_early == 1)) if ((hw->mac_type < e1000_82543) && (hw->report_tx_early == 1)) hw->fc &= (~e1000_fc_rx_pause); hw->fc &= (~E1000_FC_RX_PAUSE); hw->original_fc = hw->fc; hw->original_fc = hw->fc; Loading Loading @@ -1101,7 +1101,7 @@ e1000_setup_link(struct e1000_hw *hw) * ability to transmit pause frames in not enabled, then these * ability to transmit pause frames in not enabled, then these * registers will be set to 0. * registers will be set to 0. */ */ if (!(hw->fc & e1000_fc_tx_pause)) { if (!(hw->fc & E1000_FC_TX_PAUSE)) { E1000_WRITE_REG(hw, FCRTL, 0); E1000_WRITE_REG(hw, FCRTL, 0); E1000_WRITE_REG(hw, FCRTH, 0); E1000_WRITE_REG(hw, FCRTH, 0); } else { } else { Loading Loading @@ -1188,11 +1188,11 @@ e1000_setup_fiber_serdes_link(struct e1000_hw *hw) * 3: Both Rx and TX flow control (symmetric) are enabled. * 3: Both Rx and TX flow control (symmetric) are enabled. */ */ switch (hw->fc) { switch (hw->fc) { case e1000_fc_none: case E1000_FC_NONE: /* Flow control is completely disabled by a software over-ride. */ /* Flow control is completely disabled by a software over-ride. */ txcw = (E1000_TXCW_ANE | E1000_TXCW_FD); txcw = (E1000_TXCW_ANE | E1000_TXCW_FD); break; break; case e1000_fc_rx_pause: case E1000_FC_RX_PAUSE: /* RX Flow control is enabled and TX Flow control is disabled by a /* RX Flow control is enabled and TX Flow control is disabled by a * software over-ride. Since there really isn't a way to advertise * software over-ride. Since there really isn't a way to advertise * that we are capable of RX Pause ONLY, we will advertise that we * that we are capable of RX Pause ONLY, we will advertise that we Loading @@ -1201,13 +1201,13 @@ e1000_setup_fiber_serdes_link(struct e1000_hw *hw) */ */ txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK); txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK); break; break; case e1000_fc_tx_pause: case E1000_FC_TX_PAUSE: /* TX Flow control is enabled, and RX Flow control is disabled, by a /* TX Flow control is enabled, and RX Flow control is disabled, by a * software over-ride. * software over-ride. */ */ txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_ASM_DIR); txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_ASM_DIR); break; break; case e1000_fc_full: case E1000_FC_FULL: /* Flow control (both RX and TX) is enabled by a software over-ride. */ /* Flow control (both RX and TX) is enabled by a software over-ride. */ txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK); txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK); break; break; Loading Loading @@ -2123,13 +2123,13 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw) * in the EEPROM is used. * in the EEPROM is used. */ */ switch (hw->fc) { switch (hw->fc) { case e1000_fc_none: /* 0 */ case E1000_FC_NONE: /* 0 */ /* Flow control (RX & TX) is completely disabled by a /* Flow control (RX & TX) is completely disabled by a * software over-ride. * software over-ride. */ */ mii_autoneg_adv_reg &= ~(NWAY_AR_ASM_DIR | NWAY_AR_PAUSE); mii_autoneg_adv_reg &= ~(NWAY_AR_ASM_DIR | NWAY_AR_PAUSE); break; break; case e1000_fc_rx_pause: /* 1 */ case E1000_FC_RX_PAUSE: /* 1 */ /* RX Flow control is enabled, and TX Flow control is /* RX Flow control is enabled, and TX Flow control is * disabled, by a software over-ride. * disabled, by a software over-ride. */ */ Loading @@ -2141,14 +2141,14 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw) */ */ mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE); mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE); break; break; case e1000_fc_tx_pause: /* 2 */ case E1000_FC_TX_PAUSE: /* 2 */ /* TX Flow control is enabled, and RX Flow control is /* TX Flow control is enabled, and RX Flow control is * disabled, by a software over-ride. * disabled, by a software over-ride. */ */ mii_autoneg_adv_reg |= NWAY_AR_ASM_DIR; mii_autoneg_adv_reg |= NWAY_AR_ASM_DIR; mii_autoneg_adv_reg &= ~NWAY_AR_PAUSE; mii_autoneg_adv_reg &= ~NWAY_AR_PAUSE; break; break; case e1000_fc_full: /* 3 */ case E1000_FC_FULL: /* 3 */ /* Flow control (both RX and TX) is enabled by a software /* Flow control (both RX and TX) is enabled by a software * over-ride. * over-ride. */ */ Loading Loading @@ -2192,7 +2192,7 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw) DEBUGFUNC("e1000_phy_force_speed_duplex"); DEBUGFUNC("e1000_phy_force_speed_duplex"); /* Turn off Flow control if we are forcing speed and duplex. */ /* Turn off Flow control if we are forcing speed and duplex. */ hw->fc = e1000_fc_none; hw->fc = E1000_FC_NONE; DEBUGOUT1("hw->fc = %d\n", hw->fc); DEBUGOUT1("hw->fc = %d\n", hw->fc); Loading Loading @@ -2546,18 +2546,18 @@ e1000_force_mac_fc(struct e1000_hw *hw) */ */ switch (hw->fc) { switch (hw->fc) { case e1000_fc_none: case E1000_FC_NONE: ctrl &= (~(E1000_CTRL_TFCE | E1000_CTRL_RFCE)); ctrl &= (~(E1000_CTRL_TFCE | E1000_CTRL_RFCE)); break; break; case e1000_fc_rx_pause: case E1000_FC_RX_PAUSE: ctrl &= (~E1000_CTRL_TFCE); ctrl &= (~E1000_CTRL_TFCE); ctrl |= E1000_CTRL_RFCE; ctrl |= E1000_CTRL_RFCE; break; break; case e1000_fc_tx_pause: case E1000_FC_TX_PAUSE: ctrl &= (~E1000_CTRL_RFCE); ctrl &= (~E1000_CTRL_RFCE); ctrl |= E1000_CTRL_TFCE; ctrl |= E1000_CTRL_TFCE; break; break; case e1000_fc_full: case E1000_FC_FULL: ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE); ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE); break; break; default: default: Loading Loading @@ -2656,14 +2656,14 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) * LOCAL DEVICE | LINK PARTNER * LOCAL DEVICE | LINK PARTNER * PAUSE | ASM_DIR | PAUSE | ASM_DIR | NIC Resolution * PAUSE | ASM_DIR | PAUSE | ASM_DIR | NIC Resolution *-------|---------|-------|---------|-------------------- *-------|---------|-------|---------|-------------------- * 0 | 0 | DC | DC | e1000_fc_none * 0 | 0 | DC | DC | E1000_FC_NONE * 0 | 1 | 0 | DC | e1000_fc_none * 0 | 1 | 0 | DC | E1000_FC_NONE * 0 | 1 | 1 | 0 | e1000_fc_none * 0 | 1 | 1 | 0 | E1000_FC_NONE * 0 | 1 | 1 | 1 | e1000_fc_tx_pause * 0 | 1 | 1 | 1 | E1000_FC_TX_PAUSE * 1 | 0 | 0 | DC | e1000_fc_none * 1 | 0 | 0 | DC | E1000_FC_NONE * 1 | DC | 1 | DC | e1000_fc_full * 1 | DC | 1 | DC | E1000_FC_FULL * 1 | 1 | 0 | 0 | e1000_fc_none * 1 | 1 | 0 | 0 | E1000_FC_NONE * 1 | 1 | 0 | 1 | e1000_fc_rx_pause * 1 | 1 | 0 | 1 | E1000_FC_RX_PAUSE * * */ */ /* Are both PAUSE bits set to 1? If so, this implies /* Are both PAUSE bits set to 1? If so, this implies Loading @@ -2675,7 +2675,7 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) * LOCAL DEVICE | LINK PARTNER * LOCAL DEVICE | LINK PARTNER * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result *-------|---------|-------|---------|-------------------- *-------|---------|-------|---------|-------------------- * 1 | DC | 1 | DC | e1000_fc_full * 1 | DC | 1 | DC | E1000_FC_FULL * * */ */ if ((mii_nway_adv_reg & NWAY_AR_PAUSE) && if ((mii_nway_adv_reg & NWAY_AR_PAUSE) && Loading @@ -2686,11 +2686,11 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) * ONLY. Hence, we must now check to see if we need to * ONLY. Hence, we must now check to see if we need to * turn OFF the TRANSMISSION of PAUSE frames. * turn OFF the TRANSMISSION of PAUSE frames. */ */ if (hw->original_fc == e1000_fc_full) { if (hw->original_fc == E1000_FC_FULL) { hw->fc = e1000_fc_full; hw->fc = E1000_FC_FULL; DEBUGOUT("Flow Control = FULL.\n"); DEBUGOUT("Flow Control = FULL.\n"); } else { } else { hw->fc = e1000_fc_rx_pause; hw->fc = E1000_FC_RX_PAUSE; DEBUGOUT("Flow Control = RX PAUSE frames only.\n"); DEBUGOUT("Flow Control = RX PAUSE frames only.\n"); } } } } Loading @@ -2699,14 +2699,14 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) * LOCAL DEVICE | LINK PARTNER * LOCAL DEVICE | LINK PARTNER * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result *-------|---------|-------|---------|-------------------- *-------|---------|-------|---------|-------------------- * 0 | 1 | 1 | 1 | e1000_fc_tx_pause * 0 | 1 | 1 | 1 | E1000_FC_TX_PAUSE * * */ */ else if (!(mii_nway_adv_reg & NWAY_AR_PAUSE) && else if (!(mii_nway_adv_reg & NWAY_AR_PAUSE) && (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { hw->fc = e1000_fc_tx_pause; hw->fc = E1000_FC_TX_PAUSE; DEBUGOUT("Flow Control = TX PAUSE frames only.\n"); DEBUGOUT("Flow Control = TX PAUSE frames only.\n"); } } /* For transmitting PAUSE frames ONLY. /* For transmitting PAUSE frames ONLY. Loading @@ -2714,14 +2714,14 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) * LOCAL DEVICE | LINK PARTNER * LOCAL DEVICE | LINK PARTNER * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result *-------|---------|-------|---------|-------------------- *-------|---------|-------|---------|-------------------- * 1 | 1 | 0 | 1 | e1000_fc_rx_pause * 1 | 1 | 0 | 1 | E1000_FC_RX_PAUSE * * */ */ else if ((mii_nway_adv_reg & NWAY_AR_PAUSE) && else if ((mii_nway_adv_reg & NWAY_AR_PAUSE) && (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { hw->fc = e1000_fc_rx_pause; hw->fc = E1000_FC_RX_PAUSE; DEBUGOUT("Flow Control = RX PAUSE frames only.\n"); DEBUGOUT("Flow Control = RX PAUSE frames only.\n"); } } /* Per the IEEE spec, at this point flow control should be /* Per the IEEE spec, at this point flow control should be Loading @@ -2744,13 +2744,13 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) * be asked to delay transmission of packets than asking * be asked to delay transmission of packets than asking * our link partner to pause transmission of frames. * our link partner to pause transmission of frames. */ */ else if ((hw->original_fc == e1000_fc_none || else if ((hw->original_fc == E1000_FC_NONE || hw->original_fc == e1000_fc_tx_pause) || hw->original_fc == E1000_FC_TX_PAUSE) || hw->fc_strict_ieee) { hw->fc_strict_ieee) { hw->fc = e1000_fc_none; hw->fc = E1000_FC_NONE; DEBUGOUT("Flow Control = NONE.\n"); DEBUGOUT("Flow Control = NONE.\n"); } else { } else { hw->fc = e1000_fc_rx_pause; hw->fc = E1000_FC_RX_PAUSE; DEBUGOUT("Flow Control = RX PAUSE frames only.\n"); DEBUGOUT("Flow Control = RX PAUSE frames only.\n"); } } Loading @@ -2765,7 +2765,7 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) } } if (duplex == HALF_DUPLEX) if (duplex == HALF_DUPLEX) hw->fc = e1000_fc_none; hw->fc = E1000_FC_NONE; /* Now we call a subroutine to actually force the MAC /* Now we call a subroutine to actually force the MAC * controller to use the correct flow control settings. * controller to use the correct flow control settings. Loading
drivers/net/e1000/e1000_hw.h +5 −5 Original line number Original line Diff line number Diff line Loading @@ -92,11 +92,11 @@ typedef enum { /* Flow Control Settings */ /* Flow Control Settings */ typedef enum { typedef enum { e1000_fc_none = 0, E1000_FC_NONE = 0, e1000_fc_rx_pause = 1, E1000_FC_RX_PAUSE = 1, e1000_fc_tx_pause = 2, E1000_FC_TX_PAUSE = 2, e1000_fc_full = 3, E1000_FC_FULL = 3, e1000_fc_default = 0xFF E1000_FC_DEFAULT = 0xFF } e1000_fc_type; } e1000_fc_type; struct e1000_shadow_ram { struct e1000_shadow_ram { Loading
drivers/net/e1000/e1000_param.c +6 −6 Original line number Original line Diff line number Diff line Loading @@ -396,17 +396,17 @@ e1000_check_options(struct e1000_adapter *adapter) { /* Flow Control */ { /* Flow Control */ struct e1000_opt_list fc_list[] = struct e1000_opt_list fc_list[] = {{ e1000_fc_none, "Flow Control Disabled" }, {{ E1000_FC_NONE, "Flow Control Disabled" }, { e1000_fc_rx_pause,"Flow Control Receive Only" }, { E1000_FC_RX_PAUSE,"Flow Control Receive Only" }, { e1000_fc_tx_pause,"Flow Control Transmit Only" }, { E1000_FC_TX_PAUSE,"Flow Control Transmit Only" }, { e1000_fc_full, "Flow Control Enabled" }, { E1000_FC_FULL, "Flow Control Enabled" }, { e1000_fc_default, "Flow Control Hardware Default" }}; { E1000_FC_DEFAULT, "Flow Control Hardware Default" }}; struct e1000_option opt = { struct e1000_option opt = { .type = list_option, .type = list_option, .name = "Flow Control", .name = "Flow Control", .err = "reading default settings from EEPROM", .err = "reading default settings from EEPROM", .def = e1000_fc_default, .def = E1000_FC_DEFAULT, .arg = { .l = { .nr = ARRAY_SIZE(fc_list), .arg = { .l = { .nr = ARRAY_SIZE(fc_list), .p = fc_list }} .p = fc_list }} }; }; Loading