Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150502
b: refs/heads/master
c: 8ca783a
h: refs/heads/master
v: v3
  • Loading branch information
Don Skidmore authored and David S. Miller committed May 27, 2009
1 parent 0562332 commit 24557ce
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 20 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: f7c86a3252af7f1222f9ebce66f3654ad3aa9ff0
refs/heads/master: 8ca783ab78e3fa518885c4fef93d0972e450a4de
12 changes: 10 additions & 2 deletions trunk/drivers/net/ixgbe/ixgbe_82598.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ static s32 ixgbe_setup_copper_link_speed_82598(struct ixgbe_hw *hw,
static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw)
{
s32 status = 0;
s32 phy_status = 0;
u32 ctrl;
u32 gheccr;
u32 i;
Expand Down Expand Up @@ -745,13 +746,17 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw)
/* PHY ops must be identified and initialized prior to reset */

/* Init PHY and function pointers, perform SFP setup */
status = hw->phy.ops.init(hw);
if (status == IXGBE_ERR_SFP_NOT_SUPPORTED)
phy_status = hw->phy.ops.init(hw);
if (phy_status == IXGBE_ERR_SFP_NOT_SUPPORTED)
goto reset_hw_out;
else if (phy_status == IXGBE_ERR_SFP_NOT_PRESENT)
goto no_phy_reset;


hw->phy.ops.reset(hw);
}

no_phy_reset:
/*
* Prevent the PCI-E bus from from hanging by disabling PCI-E master
* access and verify no pending requests before reset
Expand Down Expand Up @@ -811,6 +816,9 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw)
hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr);

reset_hw_out:
if (phy_status)
status = phy_status;

return status;
}

Expand Down
33 changes: 17 additions & 16 deletions trunk/drivers/net/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2599,7 +2599,10 @@ int ixgbe_up(struct ixgbe_adapter *adapter)
void ixgbe_reset(struct ixgbe_adapter *adapter)
{
struct ixgbe_hw *hw = &adapter->hw;
if (hw->mac.ops.init_hw(hw))
int err;

err = hw->mac.ops.init_hw(hw);
if (err && (err != IXGBE_ERR_SFP_NOT_PRESENT))
dev_err(&adapter->pdev->dev, "Hardware Error\n");

/* reprogram the RAR[0] in case user changed it. */
Expand Down Expand Up @@ -5167,20 +5170,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
INIT_WORK(&adapter->sfp_config_module_task,
ixgbe_sfp_config_module_task);

err = ii->get_invariants(hw);
if (err == IXGBE_ERR_SFP_NOT_PRESENT) {
/* start a kernel thread to watch for a module to arrive */
set_bit(__IXGBE_SFP_MODULE_NOT_FOUND, &adapter->state);
mod_timer(&adapter->sfp_timer,
round_jiffies(jiffies + (2 * HZ)));
err = 0;
} else if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) {
DPRINTK(PROBE, ERR, "failed to load because an "
"unsupported SFP+ module type was detected.\n");
goto err_hw_init;
} else if (err) {
goto err_hw_init;
}
ii->get_invariants(hw);

/* setup the private structure */
err = ixgbe_sw_init(adapter);
Expand All @@ -5200,7 +5190,18 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,

/* reset_hw fills in the perm_addr as well */
err = hw->mac.ops.reset_hw(hw);
if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) {
if (err == IXGBE_ERR_SFP_NOT_PRESENT &&
hw->mac.type == ixgbe_mac_82598EB) {
/*
* Start a kernel thread to watch for a module to arrive.
* Only do this for 82598, since 82599 will generate
* interrupts on module arrival.
*/
set_bit(__IXGBE_SFP_MODULE_NOT_FOUND, &adapter->state);
mod_timer(&adapter->sfp_timer,
round_jiffies(jiffies + (2 * HZ)));
err = 0;
} else if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) {
dev_err(&adapter->pdev->dev, "failed to load because an "
"unsupported SFP+ module type was detected.\n");
goto err_sw_init;
Expand Down
13 changes: 12 additions & 1 deletion trunk/drivers/net/ixgbe/ixgbe_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,22 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
u8 cable_tech = 0;
u16 enforce_sfp = 0;

if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_fiber) {
hw->phy.sfp_type = ixgbe_sfp_type_not_present;
status = IXGBE_ERR_SFP_NOT_PRESENT;
goto out;
}

status = hw->phy.ops.read_i2c_eeprom(hw, IXGBE_SFF_IDENTIFIER,
&identifier);

if (status == IXGBE_ERR_SFP_NOT_PRESENT) {
if (status == IXGBE_ERR_SFP_NOT_PRESENT || status == IXGBE_ERR_I2C) {
status = IXGBE_ERR_SFP_NOT_PRESENT;
hw->phy.sfp_type = ixgbe_sfp_type_not_present;
if (hw->phy.type != ixgbe_phy_nl) {
hw->phy.id = 0;
hw->phy.type = ixgbe_phy_unknown;
}
goto out;
}

Expand Down

0 comments on commit 24557ce

Please sign in to comment.