diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 23:30:19 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 23:30:19 +0300 |
commit | abb359450f20c32ae03039d8736f12b1d561caf5 (patch) | |
tree | 6e8723885feb66a138f19f0ff31615dc13a8d859 /drivers/net/skge.c | |
parent | cb600d2f83c854ec3d6660063e4466431999489b (diff) | |
parent | 4e3dbdb1392a83bd21a6ff8f6bc785495058d37c (diff) | |
download | linux-abb359450f20c32ae03039d8736f12b1d561caf5.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1436 commits)
cassini: Use local-mac-address prom property for Cassini MAC address
net: remove the duplicate #ifdef __KERNEL__
net: bridge: check the length of skb after nf_bridge_maybe_copy_header()
netconsole: clarify stopping message
netconsole: don't announce stopping if nothing happened
cnic: Fix the type field in SPQ messages
netfilter: fix export secctx error handling
netfilter: fix the race when initializing nf_ct_expect_hash_rnd
ipv4: IP defragmentation must be ECN aware
net: r6040: Return proper error for r6040_init_one
dcb: use after free in dcb_flushapp()
dcb: unlock on error in dcbnl_ieee_get()
net: ixp4xx_eth: Return proper error for eth_init_one
include/linux/if_ether.h: Add #define ETH_P_LINK_CTL for HPNA and wlan local tunnel
net: add POLLPRI to sock_def_readable()
af_unix: Avoid socket->sk NULL OOPS in stream connect security hooks.
net_sched: pfifo_head_drop problem
mac80211: remove stray extern
mac80211: implement off-channel TX using hw r-o-c offload
mac80211: implement hardware offload for remain-on-channel
...
Diffstat (limited to 'drivers/net/skge.c')
-rw-r--r-- | drivers/net/skge.c | 54 |
1 files changed, 19 insertions, 35 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 220e0398f1d5..42daf98ba736 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -1191,7 +1191,7 @@ static void genesis_init(struct skge_hw *hw) static void genesis_reset(struct skge_hw *hw, int port) { - const u8 zero[8] = { 0 }; + static const u8 zero[8] = { 0 }; u32 reg; skge_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0); @@ -1557,7 +1557,7 @@ static void genesis_mac_init(struct skge_hw *hw, int port) int jumbo = hw->dev[port]->mtu > ETH_DATA_LEN; int i; u32 r; - const u8 zero[6] = { 0 }; + static const u8 zero[6] = { 0 }; for (i = 0; i < 10; i++) { skge_write16(hw, SK_REG(port, TX_MFF_CTRL1), @@ -2764,7 +2764,7 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb, td->dma_hi = map >> 32; if (skb->ip_summed == CHECKSUM_PARTIAL) { - const int offset = skb_transport_offset(skb); + const int offset = skb_checksum_start_offset(skb); /* This seems backwards, but it is what the sk98lin * does. Looks like hardware is wrong? @@ -4012,8 +4012,6 @@ static void __devexit skge_remove(struct pci_dev *pdev) if (!hw) return; - flush_scheduled_work(); - dev1 = hw->dev[1]; if (dev1) unregister_netdev(dev1); @@ -4044,53 +4042,40 @@ static void __devexit skge_remove(struct pci_dev *pdev) } #ifdef CONFIG_PM -static int skge_suspend(struct pci_dev *pdev, pm_message_t state) +static int skge_suspend(struct device *dev) { + struct pci_dev *pdev = to_pci_dev(dev); struct skge_hw *hw = pci_get_drvdata(pdev); - int i, err, wol = 0; + int i; if (!hw) return 0; - err = pci_save_state(pdev); - if (err) - return err; - for (i = 0; i < hw->ports; i++) { struct net_device *dev = hw->dev[i]; struct skge_port *skge = netdev_priv(dev); if (netif_running(dev)) skge_down(dev); + if (skge->wol) skge_wol_init(skge); - - wol |= skge->wol; } skge_write32(hw, B0_IMSK, 0); - pci_prepare_to_sleep(pdev); - return 0; } -static int skge_resume(struct pci_dev *pdev) +static int skge_resume(struct device *dev) { + struct pci_dev *pdev = to_pci_dev(dev); struct skge_hw *hw = pci_get_drvdata(pdev); int i, err; if (!hw) return 0; - err = pci_back_from_sleep(pdev); - if (err) - goto out; - - err = pci_restore_state(pdev); - if (err) - goto out; - err = skge_reset(hw); if (err) goto out; @@ -4111,12 +4096,19 @@ static int skge_resume(struct pci_dev *pdev) out: return err; } + +static SIMPLE_DEV_PM_OPS(skge_pm_ops, skge_suspend, skge_resume); +#define SKGE_PM_OPS (&skge_pm_ops) + +#else + +#define SKGE_PM_OPS NULL #endif static void skge_shutdown(struct pci_dev *pdev) { struct skge_hw *hw = pci_get_drvdata(pdev); - int i, wol = 0; + int i; if (!hw) return; @@ -4127,15 +4119,10 @@ static void skge_shutdown(struct pci_dev *pdev) if (skge->wol) skge_wol_init(skge); - wol |= skge->wol; } - if (pci_enable_wake(pdev, PCI_D3cold, wol)) - pci_enable_wake(pdev, PCI_D3hot, wol); - - pci_disable_device(pdev); + pci_wake_from_d3(pdev, device_may_wakeup(&pdev->dev)); pci_set_power_state(pdev, PCI_D3hot); - } static struct pci_driver skge_driver = { @@ -4143,11 +4130,8 @@ static struct pci_driver skge_driver = { .id_table = skge_id_table, .probe = skge_probe, .remove = __devexit_p(skge_remove), -#ifdef CONFIG_PM - .suspend = skge_suspend, - .resume = skge_resume, -#endif .shutdown = skge_shutdown, + .driver.pm = SKGE_PM_OPS, }; static struct dmi_system_id skge_32bit_dma_boards[] = { |