diff options
author | Pavel Machek <pavel@ucw.cz> | 2005-09-03 18:56:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 03:06:15 -0400 |
commit | 829ca9a30a2ddb727981d80fabdbff2ea86bc9ea (patch) | |
tree | 044087fb18aa4b5f5bbd233f54f9eec3439ad6de /drivers/net | |
parent | 7e958883bced7e435f5a76349e15684858d3477c (diff) |
[PATCH] swsusp: fix remaining u32 vs. pm_message_t confusion
Fix remaining bits of u32 vs. pm_message confusion. Should not break
anything.
Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bnx2.c | 18 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 14 | ||||
-rw-r--r-- | drivers/net/irda/vlsi_ir.c | 11 | ||||
-rw-r--r-- | drivers/net/phy/mdio_bus.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco_pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/islpci_hotplug.c | 2 |
6 files changed, 19 insertions, 30 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 7babf6af4e28..55a72c7ad001 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -2004,14 +2004,14 @@ bnx2_init_cpus(struct bnx2 *bp) | |||
2004 | } | 2004 | } |
2005 | 2005 | ||
2006 | static int | 2006 | static int |
2007 | bnx2_set_power_state(struct bnx2 *bp, int state) | 2007 | bnx2_set_power_state(struct bnx2 *bp, pci_power_t state) |
2008 | { | 2008 | { |
2009 | u16 pmcsr; | 2009 | u16 pmcsr; |
2010 | 2010 | ||
2011 | pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, &pmcsr); | 2011 | pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, &pmcsr); |
2012 | 2012 | ||
2013 | switch (state) { | 2013 | switch (state) { |
2014 | case 0: { | 2014 | case PCI_D0: { |
2015 | u32 val; | 2015 | u32 val; |
2016 | 2016 | ||
2017 | pci_write_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, | 2017 | pci_write_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, |
@@ -2032,7 +2032,7 @@ bnx2_set_power_state(struct bnx2 *bp, int state) | |||
2032 | REG_WR(bp, BNX2_RPM_CONFIG, val); | 2032 | REG_WR(bp, BNX2_RPM_CONFIG, val); |
2033 | break; | 2033 | break; |
2034 | } | 2034 | } |
2035 | case 3: { | 2035 | case PCI_D3hot: { |
2036 | int i; | 2036 | int i; |
2037 | u32 val, wol_msg; | 2037 | u32 val, wol_msg; |
2038 | 2038 | ||
@@ -3886,7 +3886,7 @@ bnx2_open(struct net_device *dev) | |||
3886 | struct bnx2 *bp = dev->priv; | 3886 | struct bnx2 *bp = dev->priv; |
3887 | int rc; | 3887 | int rc; |
3888 | 3888 | ||
3889 | bnx2_set_power_state(bp, 0); | 3889 | bnx2_set_power_state(bp, PCI_D0); |
3890 | bnx2_disable_int(bp); | 3890 | bnx2_disable_int(bp); |
3891 | 3891 | ||
3892 | rc = bnx2_alloc_mem(bp); | 3892 | rc = bnx2_alloc_mem(bp); |
@@ -4197,7 +4197,7 @@ bnx2_close(struct net_device *dev) | |||
4197 | bnx2_free_mem(bp); | 4197 | bnx2_free_mem(bp); |
4198 | bp->link_up = 0; | 4198 | bp->link_up = 0; |
4199 | netif_carrier_off(bp->dev); | 4199 | netif_carrier_off(bp->dev); |
4200 | bnx2_set_power_state(bp, 3); | 4200 | bnx2_set_power_state(bp, PCI_D3hot); |
4201 | return 0; | 4201 | return 0; |
4202 | } | 4202 | } |
4203 | 4203 | ||
@@ -5203,7 +5203,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5203 | BNX2_PCICFG_MISC_CONFIG_REG_WINDOW_ENA | | 5203 | BNX2_PCICFG_MISC_CONFIG_REG_WINDOW_ENA | |
5204 | BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP); | 5204 | BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP); |
5205 | 5205 | ||
5206 | bnx2_set_power_state(bp, 0); | 5206 | bnx2_set_power_state(bp, PCI_D0); |
5207 | 5207 | ||
5208 | bp->chip_id = REG_RD(bp, BNX2_MISC_ID); | 5208 | bp->chip_id = REG_RD(bp, BNX2_MISC_ID); |
5209 | 5209 | ||
@@ -5495,7 +5495,7 @@ bnx2_remove_one(struct pci_dev *pdev) | |||
5495 | } | 5495 | } |
5496 | 5496 | ||
5497 | static int | 5497 | static int |
5498 | bnx2_suspend(struct pci_dev *pdev, u32 state) | 5498 | bnx2_suspend(struct pci_dev *pdev, pm_message_t state) |
5499 | { | 5499 | { |
5500 | struct net_device *dev = pci_get_drvdata(pdev); | 5500 | struct net_device *dev = pci_get_drvdata(pdev); |
5501 | struct bnx2 *bp = dev->priv; | 5501 | struct bnx2 *bp = dev->priv; |
@@ -5513,7 +5513,7 @@ bnx2_suspend(struct pci_dev *pdev, u32 state) | |||
5513 | reset_code = BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL; | 5513 | reset_code = BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL; |
5514 | bnx2_reset_chip(bp, reset_code); | 5514 | bnx2_reset_chip(bp, reset_code); |
5515 | bnx2_free_skbs(bp); | 5515 | bnx2_free_skbs(bp); |
5516 | bnx2_set_power_state(bp, state); | 5516 | bnx2_set_power_state(bp, pci_choose_state(pdev, state)); |
5517 | return 0; | 5517 | return 0; |
5518 | } | 5518 | } |
5519 | 5519 | ||
@@ -5526,7 +5526,7 @@ bnx2_resume(struct pci_dev *pdev) | |||
5526 | if (!netif_running(dev)) | 5526 | if (!netif_running(dev)) |
5527 | return 0; | 5527 | return 0; |
5528 | 5528 | ||
5529 | bnx2_set_power_state(bp, 0); | 5529 | bnx2_set_power_state(bp, PCI_D0); |
5530 | netif_device_attach(dev); | 5530 | netif_device_attach(dev); |
5531 | bnx2_init_nic(bp); | 5531 | bnx2_init_nic(bp); |
5532 | bnx2_netif_start(bp); | 5532 | bnx2_netif_start(bp); |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 9b596e0bbf95..7c8a0a22dcd5 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -162,7 +162,7 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid); | |||
162 | static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid); | 162 | static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid); |
163 | static void e1000_restore_vlan(struct e1000_adapter *adapter); | 163 | static void e1000_restore_vlan(struct e1000_adapter *adapter); |
164 | 164 | ||
165 | static int e1000_suspend(struct pci_dev *pdev, uint32_t state); | 165 | static int e1000_suspend(struct pci_dev *pdev, pm_message_t state); |
166 | #ifdef CONFIG_PM | 166 | #ifdef CONFIG_PM |
167 | static int e1000_resume(struct pci_dev *pdev); | 167 | static int e1000_resume(struct pci_dev *pdev); |
168 | #endif | 168 | #endif |
@@ -3642,7 +3642,7 @@ e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx) | |||
3642 | } | 3642 | } |
3643 | 3643 | ||
3644 | static int | 3644 | static int |
3645 | e1000_suspend(struct pci_dev *pdev, uint32_t state) | 3645 | e1000_suspend(struct pci_dev *pdev, pm_message_t state) |
3646 | { | 3646 | { |
3647 | struct net_device *netdev = pci_get_drvdata(pdev); | 3647 | struct net_device *netdev = pci_get_drvdata(pdev); |
3648 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3648 | struct e1000_adapter *adapter = netdev_priv(netdev); |
@@ -3726,9 +3726,7 @@ e1000_suspend(struct pci_dev *pdev, uint32_t state) | |||
3726 | } | 3726 | } |
3727 | 3727 | ||
3728 | pci_disable_device(pdev); | 3728 | pci_disable_device(pdev); |
3729 | 3729 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | |
3730 | state = (state > 0) ? 3 : 0; | ||
3731 | pci_set_power_state(pdev, state); | ||
3732 | 3730 | ||
3733 | return 0; | 3731 | return 0; |
3734 | } | 3732 | } |
@@ -3741,13 +3739,13 @@ e1000_resume(struct pci_dev *pdev) | |||
3741 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3739 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3742 | uint32_t manc, ret_val, swsm; | 3740 | uint32_t manc, ret_val, swsm; |
3743 | 3741 | ||
3744 | pci_set_power_state(pdev, 0); | 3742 | pci_set_power_state(pdev, PCI_D0); |
3745 | pci_restore_state(pdev); | 3743 | pci_restore_state(pdev); |
3746 | ret_val = pci_enable_device(pdev); | 3744 | ret_val = pci_enable_device(pdev); |
3747 | pci_set_master(pdev); | 3745 | pci_set_master(pdev); |
3748 | 3746 | ||
3749 | pci_enable_wake(pdev, 3, 0); | 3747 | pci_enable_wake(pdev, PCI_D3hot, 0); |
3750 | pci_enable_wake(pdev, 4, 0); /* 4 == D3 cold */ | 3748 | pci_enable_wake(pdev, PCI_D3cold, 0); |
3751 | 3749 | ||
3752 | e1000_reset(adapter); | 3750 | e1000_reset(adapter); |
3753 | E1000_WRITE_REG(&adapter->hw, WUS, ~0); | 3751 | E1000_WRITE_REG(&adapter->hw, WUS, ~0); |
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c index 006e4f575606..4be95398bac4 100644 --- a/drivers/net/irda/vlsi_ir.c +++ b/drivers/net/irda/vlsi_ir.c | |||
@@ -1749,11 +1749,6 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1749 | struct net_device *ndev = pci_get_drvdata(pdev); | 1749 | struct net_device *ndev = pci_get_drvdata(pdev); |
1750 | vlsi_irda_dev_t *idev; | 1750 | vlsi_irda_dev_t *idev; |
1751 | 1751 | ||
1752 | if (state < 1 || state > 3 ) { | ||
1753 | IRDA_ERROR("%s - %s: invalid pm state request: %u\n", | ||
1754 | __FUNCTION__, PCIDEV_NAME(pdev), state); | ||
1755 | return 0; | ||
1756 | } | ||
1757 | if (!ndev) { | 1752 | if (!ndev) { |
1758 | IRDA_ERROR("%s - %s: no netdevice \n", | 1753 | IRDA_ERROR("%s - %s: no netdevice \n", |
1759 | __FUNCTION__, PCIDEV_NAME(pdev)); | 1754 | __FUNCTION__, PCIDEV_NAME(pdev)); |
@@ -1781,7 +1776,7 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1781 | idev->new_baud = idev->baud; | 1776 | idev->new_baud = idev->baud; |
1782 | } | 1777 | } |
1783 | 1778 | ||
1784 | pci_set_power_state(pdev,state); | 1779 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); |
1785 | pdev->current_state = state; | 1780 | pdev->current_state = state; |
1786 | idev->resume_ok = 1; | 1781 | idev->resume_ok = 1; |
1787 | up(&idev->sem); | 1782 | up(&idev->sem); |
@@ -1807,8 +1802,8 @@ static int vlsi_irda_resume(struct pci_dev *pdev) | |||
1807 | return 0; | 1802 | return 0; |
1808 | } | 1803 | } |
1809 | 1804 | ||
1810 | pci_set_power_state(pdev, 0); | 1805 | pci_set_power_state(pdev, PCI_D0); |
1811 | pdev->current_state = 0; | 1806 | pdev->current_state = PM_EVENT_ON; |
1812 | 1807 | ||
1813 | if (!idev->resume_ok) { | 1808 | if (!idev->resume_ok) { |
1814 | /* should be obsolete now - but used to happen due to: | 1809 | /* should be obsolete now - but used to happen due to: |
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 41f62c0c5fcb..5e81494e9a9a 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
@@ -128,7 +128,7 @@ static int mdio_bus_match(struct device *dev, struct device_driver *drv) | |||
128 | /* Suspend and resume. Copied from platform_suspend and | 128 | /* Suspend and resume. Copied from platform_suspend and |
129 | * platform_resume | 129 | * platform_resume |
130 | */ | 130 | */ |
131 | static int mdio_bus_suspend(struct device * dev, u32 state) | 131 | static int mdio_bus_suspend(struct device * dev, pm_message_t state) |
132 | { | 132 | { |
133 | int ret = 0; | 133 | int ret = 0; |
134 | struct device_driver *drv = dev->driver; | 134 | struct device_driver *drv = dev->driver; |
diff --git a/drivers/net/wireless/orinoco_pci.c b/drivers/net/wireless/orinoco_pci.c index 7a6f52ea7faa..42e03438291b 100644 --- a/drivers/net/wireless/orinoco_pci.c +++ b/drivers/net/wireless/orinoco_pci.c | |||
@@ -301,8 +301,6 @@ static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
301 | unsigned long flags; | 301 | unsigned long flags; |
302 | int err; | 302 | int err; |
303 | 303 | ||
304 | printk(KERN_DEBUG "%s: Orinoco-PCI entering sleep mode (state=%d)\n", | ||
305 | dev->name, state); | ||
306 | 304 | ||
307 | err = orinoco_lock(priv, &flags); | 305 | err = orinoco_lock(priv, &flags); |
308 | if (err) { | 306 | if (err) { |
diff --git a/drivers/net/wireless/prism54/islpci_hotplug.c b/drivers/net/wireless/prism54/islpci_hotplug.c index c17391d947f3..dc040caab7d7 100644 --- a/drivers/net/wireless/prism54/islpci_hotplug.c +++ b/drivers/net/wireless/prism54/islpci_hotplug.c | |||
@@ -267,8 +267,6 @@ prism54_suspend(struct pci_dev *pdev, pm_message_t state) | |||
267 | islpci_private *priv = ndev ? netdev_priv(ndev) : NULL; | 267 | islpci_private *priv = ndev ? netdev_priv(ndev) : NULL; |
268 | BUG_ON(!priv); | 268 | BUG_ON(!priv); |
269 | 269 | ||
270 | printk(KERN_NOTICE "%s: got suspend request (state %d)\n", | ||
271 | ndev->name, state); | ||
272 | 270 | ||
273 | pci_save_state(pdev); | 271 | pci_save_state(pdev); |
274 | 272 | ||