Skip to content

Commit

Permalink
staging: et131x: Clean up the phy coma stuff
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Feb 4, 2011
1 parent ae3a08a commit 64b7283
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/et131x/et1310_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
/*
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/et131x/et1310_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
27 changes: 13 additions & 14 deletions drivers/staging/et131x/et131x_adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 */
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/et131x/et131x_initpci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
*
Expand Down

0 comments on commit 64b7283

Please sign in to comment.