Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27329
b: refs/heads/master
c: 76c224b
h: refs/heads/master
i:
  27327: a5f075d
v: v3
  • Loading branch information
Auke Kok authored and Auke Kok committed May 23, 2006
1 parent 1213087 commit 58788d9
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 82 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a42a507cd3af14a2696b7c020996e48c10bf7742
refs/heads/master: 76c224bc9fdf108ae6e97553322122f53bdbe75c
44 changes: 22 additions & 22 deletions trunk/drivers/net/e1000/e1000_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,15 +865,15 @@ static int
e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
{
struct net_device *netdev = adapter->netdev;
uint32_t mask, i=0, shared_int = TRUE;
uint32_t irq = adapter->pdev->irq;
uint32_t mask, i=0, shared_int = TRUE;
uint32_t irq = adapter->pdev->irq;

*data = 0;

/* Hook up test interrupt handler just for this test */
if (!request_irq(irq, &e1000_test_intr, 0, netdev->name, netdev)) {
shared_int = FALSE;
} else if (request_irq(irq, &e1000_test_intr, SA_SHIRQ,
if (!request_irq(irq, &e1000_test_intr, 0, netdev->name, netdev)) {
shared_int = FALSE;
} else if (request_irq(irq, &e1000_test_intr, SA_SHIRQ,
netdev->name, netdev)){
*data = 1;
return -1;
Expand All @@ -889,22 +889,22 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
/* Interrupt to test */
mask = 1 << i;

if (!shared_int) {
/* Disable the interrupt to be reported in
* the cause register and then force the same
* interrupt and see if one gets posted. If
* an interrupt was posted to the bus, the
* test failed.
*/
adapter->test_icr = 0;
E1000_WRITE_REG(&adapter->hw, IMC, mask);
E1000_WRITE_REG(&adapter->hw, ICS, mask);
msec_delay(10);

if (adapter->test_icr & mask) {
*data = 3;
break;
}
if (!shared_int) {
/* Disable the interrupt to be reported in
* the cause register and then force the same
* interrupt and see if one gets posted. If
* an interrupt was posted to the bus, the
* test failed.
*/
adapter->test_icr = 0;
E1000_WRITE_REG(&adapter->hw, IMC, mask);
E1000_WRITE_REG(&adapter->hw, ICS, mask);
msec_delay(10);

if (adapter->test_icr & mask) {
*data = 3;
break;
}
}

/* Enable the interrupt to be reported in
Expand All @@ -923,7 +923,7 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
break;
}

if (!shared_int) {
if (!shared_int) {
/* Disable the other interrupts to be reported in
* the cause register and then force the other
* interrupts and see if any get posted. If
Expand Down
88 changes: 44 additions & 44 deletions trunk/drivers/net/e1000/e1000_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ e1000_init_hw(struct e1000_hw *hw)
}

if (hw->mac_type == e1000_82573) {
e1000_enable_tx_pkt_filtering(hw);
e1000_enable_tx_pkt_filtering(hw);
}

switch (hw->mac_type) {
Expand Down Expand Up @@ -861,7 +861,7 @@ e1000_adjust_serdes_amplitude(struct e1000_hw *hw)

if(eeprom_data != EEPROM_RESERVED_WORD) {
/* Adjust SERDES output amplitude only. */
eeprom_data &= EEPROM_SERDES_AMPLITUDE_MASK;
eeprom_data &= EEPROM_SERDES_AMPLITUDE_MASK;
ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_EXT_CTRL, eeprom_data);
if(ret_val)
return ret_val;
Expand Down Expand Up @@ -1228,7 +1228,7 @@ e1000_copper_link_igp_setup(struct e1000_hw *hw)

if (hw->phy_reset_disable)
return E1000_SUCCESS;

ret_val = e1000_phy_reset(hw);
if (ret_val) {
DEBUGOUT("Error Resetting the PHY\n");
Expand Down Expand Up @@ -1370,7 +1370,7 @@ e1000_copper_link_ggp_setup(struct e1000_hw *hw)
DEBUGFUNC("e1000_copper_link_ggp_setup");

if(!hw->phy_reset_disable) {

/* Enable CRS on TX for half-duplex operation. */
ret_val = e1000_read_phy_reg(hw, GG82563_PHY_MAC_SPEC_CTRL,
&phy_data);
Expand Down Expand Up @@ -1519,7 +1519,7 @@ e1000_copper_link_mgp_setup(struct e1000_hw *hw)

if(hw->phy_reset_disable)
return E1000_SUCCESS;

/* Enable CRS on TX. This must be set for half-duplex operation. */
ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
if(ret_val)
Expand Down Expand Up @@ -1665,7 +1665,7 @@ e1000_copper_link_autoneg(struct e1000_hw *hw)
* collision distance in the Transmit Control Register.
* 2) Set up flow control on the MAC to that established with
* the link partner.
* 3) Config DSP to improve Gigabit link quality for some PHY revisions.
* 3) Config DSP to improve Gigabit link quality for some PHY revisions.
*
* hw - Struct containing variables accessed by shared code
******************************************************************************/
Expand All @@ -1674,7 +1674,7 @@ e1000_copper_link_postconfig(struct e1000_hw *hw)
{
int32_t ret_val;
DEBUGFUNC("e1000_copper_link_postconfig");

if(hw->mac_type >= e1000_82544) {
e1000_config_collision_dist(hw);
} else {
Expand All @@ -1698,7 +1698,7 @@ e1000_copper_link_postconfig(struct e1000_hw *hw)
return ret_val;
}
}

return E1000_SUCCESS;
}

Expand Down Expand Up @@ -1754,11 +1754,11 @@ e1000_setup_copper_link(struct e1000_hw *hw)
}

if(hw->autoneg) {
/* Setup autoneg and flow control advertisement
* and perform autonegotiation */
/* Setup autoneg and flow control advertisement
* and perform autonegotiation */
ret_val = e1000_copper_link_autoneg(hw);
if(ret_val)
return ret_val;
return ret_val;
} else {
/* PHY will be set to 10H, 10F, 100H,or 100F
* depending on value from forced_speed_duplex. */
Expand Down Expand Up @@ -1786,7 +1786,7 @@ e1000_setup_copper_link(struct e1000_hw *hw)
ret_val = e1000_copper_link_postconfig(hw);
if(ret_val)
return ret_val;

DEBUGOUT("Valid link established!!!\n");
return E1000_SUCCESS;
}
Expand Down Expand Up @@ -1984,7 +1984,7 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw)

DEBUGOUT1("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg);

ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg);
ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg);
if(ret_val)
return ret_val;

Expand Down Expand Up @@ -2273,7 +2273,7 @@ e1000_config_mac_to_phy(struct e1000_hw *hw)

DEBUGFUNC("e1000_config_mac_to_phy");

/* 82544 or newer MAC, Auto Speed Detection takes care of
/* 82544 or newer MAC, Auto Speed Detection takes care of
* MAC speed/duplex configuration.*/
if (hw->mac_type >= e1000_82544)
return E1000_SUCCESS;
Expand All @@ -2292,9 +2292,9 @@ e1000_config_mac_to_phy(struct e1000_hw *hw)
if(ret_val)
return ret_val;

if(phy_data & M88E1000_PSSR_DPLX)
if(phy_data & M88E1000_PSSR_DPLX)
ctrl |= E1000_CTRL_FD;
else
else
ctrl &= ~E1000_CTRL_FD;

e1000_config_collision_dist(hw);
Expand Down Expand Up @@ -2884,7 +2884,7 @@ e1000_get_speed_and_duplex(struct e1000_hw *hw,
}
}

if ((hw->mac_type == e1000_80003es2lan) &&
if ((hw->mac_type == e1000_80003es2lan) &&
(hw->media_type == e1000_media_type_copper)) {
if (*speed == SPEED_1000)
ret_val = e1000_configure_kmrn_for_1000(hw);
Expand Down Expand Up @@ -3160,7 +3160,7 @@ e1000_read_phy_reg(struct e1000_hw *hw,
if (e1000_swfw_sync_acquire(hw, swfw))
return -E1000_ERR_SWFW_SYNC;

if((hw->phy_type == e1000_phy_igp ||
if((hw->phy_type == e1000_phy_igp ||
hw->phy_type == e1000_phy_igp_2) &&
(reg_addr > MAX_PHY_MULTI_PAGE_REG)) {
ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT,
Expand Down Expand Up @@ -3299,7 +3299,7 @@ e1000_write_phy_reg(struct e1000_hw *hw,
if (e1000_swfw_sync_acquire(hw, swfw))
return -E1000_ERR_SWFW_SYNC;

if((hw->phy_type == e1000_phy_igp ||
if((hw->phy_type == e1000_phy_igp ||
hw->phy_type == e1000_phy_igp_2) &&
(reg_addr > MAX_PHY_MULTI_PAGE_REG)) {
ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT,
Expand Down Expand Up @@ -3497,22 +3497,22 @@ e1000_phy_hw_reset(struct e1000_hw *hw)
}
/* Read the device control register and assert the E1000_CTRL_PHY_RST
* bit. Then, take it out of reset.
* For pre-e1000_82571 hardware, we delay for 10ms between the assert
* For pre-e1000_82571 hardware, we delay for 10ms between the assert
* and deassert. For e1000_82571 hardware and later, we instead delay
* for 50us between and 10ms after the deassertion.
*/
ctrl = E1000_READ_REG(hw, CTRL);
E1000_WRITE_REG(hw, CTRL, ctrl | E1000_CTRL_PHY_RST);
E1000_WRITE_FLUSH(hw);
if (hw->mac_type < e1000_82571)

if (hw->mac_type < e1000_82571)
msec_delay(10);
else
udelay(100);

E1000_WRITE_REG(hw, CTRL, ctrl);
E1000_WRITE_FLUSH(hw);

if (hw->mac_type >= e1000_82571)
msec_delay(10);
e1000_swfw_sync_release(hw, swfw);
Expand Down Expand Up @@ -3816,7 +3816,7 @@ e1000_phy_m88_get_info(struct e1000_hw *hw,
/* Check polarity status */
ret_val = e1000_check_polarity(hw, &polarity);
if(ret_val)
return ret_val;
return ret_val;
phy_info->cable_polarity = polarity;

ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
Expand Down Expand Up @@ -4541,14 +4541,14 @@ e1000_read_eeprom_eerd(struct e1000_hw *hw,

E1000_WRITE_REG(hw, EERD, eerd);
error = e1000_poll_eerd_eewr_done(hw, E1000_EEPROM_POLL_READ);

if(error) {
break;
}
data[i] = (E1000_READ_REG(hw, EERD) >> E1000_EEPROM_RW_REG_DATA);

}

return error;
}

Expand All @@ -4574,24 +4574,24 @@ e1000_write_eeprom_eewr(struct e1000_hw *hw,
return -E1000_ERR_SWFW_SYNC;

for (i = 0; i < words; i++) {
register_value = (data[i] << E1000_EEPROM_RW_REG_DATA) |
((offset+i) << E1000_EEPROM_RW_ADDR_SHIFT) |
register_value = (data[i] << E1000_EEPROM_RW_REG_DATA) |
((offset+i) << E1000_EEPROM_RW_ADDR_SHIFT) |
E1000_EEPROM_RW_REG_START;

error = e1000_poll_eerd_eewr_done(hw, E1000_EEPROM_POLL_WRITE);
if(error) {
break;
}
}

E1000_WRITE_REG(hw, EEWR, register_value);

error = e1000_poll_eerd_eewr_done(hw, E1000_EEPROM_POLL_WRITE);

if(error) {
break;
}
}
}

e1000_swfw_sync_release(hw, E1000_SWFW_EEP_SM);
return error;
}
Expand All @@ -4611,7 +4611,7 @@ e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd)
for(i = 0; i < attempts; i++) {
if(eerd == E1000_EEPROM_POLL_READ)
reg = E1000_READ_REG(hw, EERD);
else
else
reg = E1000_READ_REG(hw, EEWR);

if(reg & E1000_EEPROM_RW_REG_DONE) {
Expand Down Expand Up @@ -5136,7 +5136,7 @@ e1000_mc_addr_list_update(struct e1000_hw *hw,
uint32_t i;
uint32_t num_rar_entry;
uint32_t num_mta_entry;

DEBUGFUNC("e1000_mc_addr_list_update");

/* Set the new number of MC addresses that we are being requested to use. */
Expand Down Expand Up @@ -6241,7 +6241,7 @@ e1000_check_polarity(struct e1000_hw *hw,
* 1 - Downshift ocured.
*
* returns: - E1000_ERR_XXX
* E1000_SUCCESS
* E1000_SUCCESS
*
* For phy's older then IGP, this function reads the Downshift bit in the Phy
* Specific Status register. For IGP phy's, it reads the Downgrade bit in the
Expand All @@ -6256,7 +6256,7 @@ e1000_check_downshift(struct e1000_hw *hw)

DEBUGFUNC("e1000_check_downshift");

if(hw->phy_type == e1000_phy_igp ||
if(hw->phy_type == e1000_phy_igp ||
hw->phy_type == e1000_phy_igp_2) {
ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_LINK_HEALTH,
&phy_data);
Expand Down Expand Up @@ -6685,8 +6685,8 @@ e1000_set_d0_lplu_state(struct e1000_hw *hw,


} else {
phy_data |= IGP02E1000_PM_D0_LPLU;

phy_data |= IGP02E1000_PM_D0_LPLU;
ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, phy_data);
if (ret_val)
return ret_val;
Expand Down Expand Up @@ -6778,7 +6778,7 @@ int32_t
e1000_host_if_read_cookie(struct e1000_hw * hw, uint8_t *buffer)
{
uint8_t i;
uint32_t offset = E1000_MNG_DHCP_COOKIE_OFFSET;
uint32_t offset = E1000_MNG_DHCP_COOKIE_OFFSET;
uint8_t length = E1000_MNG_DHCP_COOKIE_LENGTH;

length = (length >> 2);
Expand All @@ -6797,7 +6797,7 @@ e1000_host_if_read_cookie(struct e1000_hw * hw, uint8_t *buffer)
* and also checks whether the previous command is completed.
* It busy waits in case of previous command is not completed.
*
* returns: - E1000_ERR_HOST_INTERFACE_COMMAND in case if is not ready or
* returns: - E1000_ERR_HOST_INTERFACE_COMMAND in case if is not ready or
* timeout
* - E1000_SUCCESS for success.
****************************************************************************/
Expand All @@ -6821,7 +6821,7 @@ e1000_mng_enable_host_if(struct e1000_hw * hw)
msec_delay_irq(1);
}

if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) {
if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) {
DEBUGOUT("Previous command timeout failed .\n");
return -E1000_ERR_HOST_INTERFACE_COMMAND;
}
Expand Down
Loading

0 comments on commit 58788d9

Please sign in to comment.