Commit b65f28be authored by Scott Feldman's avatar Scott Feldman Committed by Jeff Garzik

[E100] ASF wakeup enabled, but only if set in EEPROM

On Thu, 20 Mar 2003, Scott Feldman wrote:


* Check if ASF is enabled in EEPROM, and if so, enable
  PME wakeup when suspending.
parent e8851360
...@@ -303,6 +303,9 @@ struct driver_stats { ...@@ -303,6 +303,9 @@ struct driver_stats {
/* EEPROM bit definitions */ /* EEPROM bit definitions */
/*- EEPROM control register bits */ /*- EEPROM control register bits */
#define EEPROM_FLAG_ASF 0x8000
#define EEPROM_FLAG_GCL 0x4000
#define EN_TRNF 0x10 /* Enable turnoff */ #define EN_TRNF 0x10 /* Enable turnoff */
#define EEDO 0x08 /* EEPROM data out */ #define EEDO 0x08 /* EEPROM data out */
#define EEDI 0x04 /* EEPROM data in (set for writing data) */ #define EEDI 0x04 /* EEPROM data in (set for writing data) */
...@@ -321,6 +324,8 @@ struct driver_stats { ...@@ -321,6 +324,8 @@ struct driver_stats {
#define EEPROM_COMPATIBILITY_WORD 3 #define EEPROM_COMPATIBILITY_WORD 3
#define EEPROM_PWA_NO 8 #define EEPROM_PWA_NO 8
#define EEPROM_ID_WORD 0x0A #define EEPROM_ID_WORD 0x0A
#define EEPROM_CONFIG_ASF 0x0D
#define EEPROM_SMBUS_ADDR 0x90
#define EEPROM_SUM 0xbaba #define EEPROM_SUM 0xbaba
......
...@@ -228,6 +228,7 @@ static void e100_set_bool_option(struct e100_private *bdp, int, u32, int, ...@@ -228,6 +228,7 @@ static void e100_set_bool_option(struct e100_private *bdp, int, u32, int,
char *); char *);
unsigned char e100_wait_exec_cmplx(struct e100_private *, u32, u8, u8); unsigned char e100_wait_exec_cmplx(struct e100_private *, u32, u8, u8);
void e100_exec_cmplx(struct e100_private *, u32, u8); void e100_exec_cmplx(struct e100_private *, u32, u8);
static unsigned char e100_asf_enabled(struct e100_private *bdp);
/** /**
* e100_get_rx_struct - retrieve cell to hold skb buff from the pool * e100_get_rx_struct - retrieve cell to hold skb buff from the pool
...@@ -4135,7 +4136,7 @@ e100_suspend(struct pci_dev *pcid, u32 state) ...@@ -4135,7 +4136,7 @@ e100_suspend(struct pci_dev *pcid, u32 state)
e100_do_wol(pcid, bdp); e100_do_wol(pcid, bdp);
/* If wol is enabled */ /* If wol is enabled */
if (bdp->wolopts) { if (bdp->wolopts || e100_asf_enabled(bdp)) {
pci_enable_wake(pcid, 3, 1); /* Enable PME for power state D3 */ pci_enable_wake(pcid, 3, 1); /* Enable PME for power state D3 */
pci_set_power_state(pcid, 3); /* Set power state to D3. */ pci_set_power_state(pcid, 3); /* Set power state to D3. */
} else { } else {
...@@ -4163,6 +4164,31 @@ e100_resume(struct pci_dev *pcid) ...@@ -4163,6 +4164,31 @@ e100_resume(struct pci_dev *pcid)
} }
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
/**
* e100_asf_enabled - checks if ASF is configured on the current adaper
* by reading registers 0xD and 0x90 in the EEPROM
* @bdp: atapter's private data struct
*
* Returns: true if ASF is enabled
*/
static unsigned char
e100_asf_enabled(struct e100_private *bdp)
{
u16 asf_reg;
u16 smbus_addr_reg;
if ((bdp->pdev->device >= 0x1050) && (bdp->pdev->device <= 0x1055)) {
asf_reg = e100_eeprom_read(bdp, EEPROM_CONFIG_ASF);
if ((asf_reg & EEPROM_FLAG_ASF)
&& !(asf_reg & EEPROM_FLAG_GCL)) {
smbus_addr_reg =
e100_eeprom_read(bdp, EEPROM_SMBUS_ADDR);
if ((smbus_addr_reg & 0xFF) != 0xFE)
return true;
}
}
return false;
}
#ifdef E100_CU_DEBUG #ifdef E100_CU_DEBUG
unsigned char unsigned char
e100_cu_unknown_state(struct e100_private *bdp) e100_cu_unknown_state(struct e100_private *bdp)
......
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