2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-29 07:34:06 +08:00

staging: et131x: Clean up the phy coma stuff

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Alan Cox 2011-02-01 15:41:58 +00:00 committed by Greg Kroah-Hartman
parent ae3a08aab5
commit 64b728319b
4 changed files with 23 additions and 24 deletions

View File

@ -740,7 +740,7 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
if (bmsr_ints.bits.link_status) {
if (bmsr.bits.link_status) {
etdev->PoMgmt.TransPhyComaModeOnBoot = 20;
etdev->boot_coma = 20;
/* Update our state variables and indicate the
* connected state
@ -831,7 +831,7 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
etdev->linkspeed = speed;
etdev->duplex_mode = duplex;
etdev->PoMgmt.TransPhyComaModeOnBoot = 20;
etdev->boot_coma = 20;
if (etdev->linkspeed == TRUEPHY_SPEED_10MBPS) {
/*

View File

@ -116,8 +116,8 @@ void EnablePhyComa(struct et131x_adapter *etdev)
/* Save the GbE PHY speed and duplex modes. Need to restore this
* when cable is plugged back in
*/
etdev->PoMgmt.PowerDownSpeed = etdev->AiForceSpeed;
etdev->PoMgmt.PowerDownDuplex = etdev->AiForceDpx;
etdev->pdown_speed = etdev->AiForceSpeed;
etdev->pdown_duplex = etdev->AiForceDpx;
/* Stop sending packets. */
spin_lock_irqsave(&etdev->send_hw_lock, flags);
@ -153,8 +153,8 @@ void DisablePhyComa(struct et131x_adapter *etdev)
/* Restore the GbE PHY speed and duplex modes;
* Reset JAGCore; re-configure and initialize JAGCore and gigE PHY
*/
etdev->AiForceSpeed = etdev->PoMgmt.PowerDownSpeed;
etdev->AiForceDpx = etdev->PoMgmt.PowerDownDuplex;
etdev->AiForceSpeed = etdev->pdown_speed;
etdev->AiForceDpx = etdev->pdown_duplex;
/* Re-initialize the send structures */
et131x_init_send(etdev);

View File

@ -145,19 +145,6 @@ typedef struct _ce_stats_t {
u32 InterruptStatus;
} CE_STATS_t, *PCE_STATS_t;
typedef struct _MP_POWER_MGMT {
/* variable putting the phy into coma mode when boot up with no cable
* plugged in after 5 seconds
*/
u8 TransPhyComaModeOnBoot;
/* Next two used to save power information at power down. This
* information will be used during power up to set up parts of Power
* Management in JAGCore
*/
u16 PowerDownSpeed;
u8 PowerDownDuplex;
} MP_POWER_MGMT, *PMP_POWER_MGMT;
/* The private adapter structure */
struct et131x_adapter {
@ -223,7 +210,19 @@ struct et131x_adapter {
/* Minimize init-time */
struct timer_list ErrorTimer;
MP_POWER_MGMT PoMgmt;
/* variable putting the phy into coma mode when boot up with no cable
* plugged in after 5 seconds
*/
u8 boot_coma;
/* Next two used to save power information at power down. This
* information will be used during power up to set up parts of Power
* Management in JAGCore
*/
u16 pdown_speed;
u8 pdown_duplex;
u32 CachedMaskValue;
/* Xcvr status at last poll */

View File

@ -276,11 +276,11 @@ void et131x_error_timer_handler(unsigned long data)
if (!etdev->Bmsr.bits.link_status &&
etdev->RegistryPhyComa &&
etdev->PoMgmt.TransPhyComaModeOnBoot < 11) {
etdev->PoMgmt.TransPhyComaModeOnBoot++;
etdev->boot_coma < 11) {
etdev->boot_coma++;
}
if (etdev->PoMgmt.TransPhyComaModeOnBoot == 10) {
if (etdev->boot_coma == 10) {
if (!etdev->Bmsr.bits.link_status
&& etdev->RegistryPhyComa) {
if ((pm_csr & ET_PM_PHY_SW_COMA) == 0) {
@ -728,7 +728,7 @@ static int __devinit et131x_pci_setup(struct pci_dev *pdev,
/* Initialize variable for counting how long we do not have
link status */
adapter->PoMgmt.TransPhyComaModeOnBoot = 0;
adapter->boot_coma = 0;
/* We can enable interrupts now
*