Commit 3cecd920 authored by Mark Einon's avatar Mark Einon Committed by Greg Kroah-Hartman

staging: et131x: Remove redundant phy code

Now we are using a phy_device, remove driver functionality that is now handled by the phydev.
Signed-off-by: default avatarMark Einon <mark.einon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f660732f
This diff is collapsed.
......@@ -116,8 +116,12 @@ void et1310_enable_phy_coma(struct et131x_adapter *adapter)
/* Save the GbE PHY speed and duplex modes. Need to restore this
* when cable is plugged back in
*/
adapter->pdown_speed = adapter->ai_force_speed;
adapter->pdown_duplex = adapter->ai_force_duplex;
/*
* TODO - when PM is re-enabled, check if we need to
* perform a similar task as this -
* adapter->pdown_speed = adapter->ai_force_speed;
* adapter->pdown_duplex = adapter->ai_force_duplex;
*/
/* Stop sending packets. */
spin_lock_irqsave(&adapter->send_hw_lock, flags);
......@@ -153,8 +157,11 @@ void et1310_disable_phy_coma(struct et131x_adapter *adapter)
/* Restore the GbE PHY speed and duplex modes;
* Reset JAGCore; re-configure and initialize JAGCore and gigE PHY
*/
adapter->ai_force_speed = adapter->pdown_speed;
adapter->ai_force_duplex = adapter->pdown_duplex;
/* TODO - when PM is re-enabled, check if we need to
* perform a similar task as this -
* adapter->ai_force_speed = adapter->pdown_speed;
* adapter->ai_force_duplex = adapter->pdown_duplex;
*/
/* Re-initialize the send structures */
et131x_init_send(adapter);
......
......@@ -89,17 +89,12 @@ void et1310_enable_phy_coma(struct et131x_adapter *adapter);
void et1310_disable_phy_coma(struct et131x_adapter *adapter);
/* et1310_phy.c */
void et1310_phy_init(struct et131x_adapter *adapter);
void et1310_phy_reset(struct et131x_adapter *adapter);
void et1310_phy_power_down(struct et131x_adapter *adapter, bool down);
void et1310_phy_advertise_1000BaseT(struct et131x_adapter *adapter,
u16 duplex);
void et1310_phy_access_mii_bit(struct et131x_adapter *adapter,
u16 action,
u16 regnum, u16 bitnum, u8 *value);
int et131x_xcvr_find(struct et131x_adapter *adapter);
void et131x_setphy_normal(struct et131x_adapter *adapter);
void et131x_xcvr_init(struct et131x_adapter *adapter);
/* static inline function does not work because et131x_adapter is not always
* defined
......
......@@ -137,7 +137,6 @@ void et131x_hwaddr_init(struct et131x_adapter *adapter)
}
}
/**
* et131x_pci_init - initial PCI setup
* @adapter: pointer to our private adapter structure
......@@ -146,7 +145,6 @@ void et131x_hwaddr_init(struct et131x_adapter *adapter)
* Perform the initial setup of PCI registers and if possible initialise
* the MAC address. At this point the I/O registers have yet to be mapped
*/
static int et131x_pci_init(struct et131x_adapter *adapter,
struct pci_dev *pdev)
{
......@@ -347,28 +345,8 @@ void et131x_adapter_setup(struct et131x_adapter *adapter)
et1310_config_macstat_regs(adapter);
/* Prepare the TRUEPHY library. */
et1310_phy_init(adapter);
/* Reset the phy now so changes take place */
et1310_phy_reset(adapter);
/* Power down PHY */
et1310_phy_power_down(adapter, 1);
/*
* We need to turn off 1000 base half dulplex, the mac does not
* support it. For the 10/100 part, turn off all gig advertisement
*/
if (adapter->pdev->device != ET131X_PCI_DEVICE_ID_FAST)
et1310_phy_advertise_1000BaseT(adapter, TRUEPHY_ADV_DUPLEX_FULL);
else
et1310_phy_advertise_1000BaseT(adapter, TRUEPHY_ADV_DUPLEX_NONE);
/* Power up PHY */
et1310_phy_power_down(adapter, 0);
et131x_setphy_normal(adapter);
et131x_xcvr_init(adapter);
}
/**
......@@ -547,8 +525,6 @@ static struct et131x_adapter *et131x_adapter_init(struct net_device *netdev,
struct pci_dev *pdev)
{
static const u8 default_mac[] = { 0x00, 0x05, 0x3d, 0x00, 0x02, 0x00 };
static const u8 duplex[] = { 0, 1, 2, 1, 2, 2 };
static const u16 speed[] = { 0, 10, 10, 100, 100, 1000 };
struct et131x_adapter *adapter;
......@@ -571,15 +547,11 @@ static struct et131x_adapter *et131x_adapter_init(struct net_device *netdev,
spin_lock_init(&adapter->fbr_lock);
spin_lock_init(&adapter->phy_lock);
adapter->speed_duplex = 0; /* Auto Speed Auto Duplex */
adapter->registry_jumbo_packet = 1514; /* 1514-9216 */
/* Set the MAC address to a default */
memcpy(adapter->addr, default_mac, ETH_ALEN);
adapter->ai_force_speed = speed[adapter->speed_duplex];
adapter->ai_force_duplex = duplex[adapter->speed_duplex]; /* Auto FDX */
return adapter;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment