From 0abb6eb12806cf99ea815810d470423083c3b9f4 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Wed, 27 Sep 2006 12:53:14 -0700 Subject: e100, e1000, ixgb: update copyright header and remove LICENSE This update to the copyright header adds the mailinglist, and aligns it with the kernel licensing as well as remove the offending 'all rights reserved'. Signed-off-by: Auke Kok --- drivers/net/e100.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'drivers/net/e100.c') diff --git a/drivers/net/e100.c b/drivers/net/e100.c index dc5e38aefca6..d9750e269a56 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c @@ -1,27 +1,27 @@ /******************************************************************************* - - Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved. + Intel PRO/100 Linux driver + Copyright(c) 1999 - 2006 Intel Corporation. This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. + under the terms and conditions of the GNU General Public License, + version 2, as published by the Free Software Foundation. - This program is distributed in the hope that it will be useful, but WITHOUT + This program is distributed in the hope it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 - Temple Place - Suite 330, Boston, MA 02111-1307, USA. + this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - The full GNU General Public License is included in this distribution in the - file called LICENSE. + The full GNU General Public License is included in this distribution in + the file called "COPYING". Contact Information: Linux NICS + e1000-devel Mailing List Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 *******************************************************************************/ -- cgit v1.2.3 From 0eb5a34cdf34ad07b6db2df1e523aaf6574601b4 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Wed, 27 Sep 2006 12:53:17 -0700 Subject: e100, e1000, ixgb: Fix an impossible memory overwrite bug We keep getting requests from people that think that this might be an exploitable hole where we would overwrite 4 bytes in the netdev struct if the pci name would exceed 15 characters. In reality this will never happen but we fix it anyway. Signed-off-by: Auke Kok --- drivers/net/e100.c | 2 +- drivers/net/e1000/e1000_main.c | 2 +- drivers/net/ixgb/ixgb_main.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/net/e100.c') diff --git a/drivers/net/e100.c b/drivers/net/e100.c index d9750e269a56..ab0868cb120c 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c @@ -2572,7 +2572,7 @@ static int __devinit e100_probe(struct pci_dev *pdev, #ifdef CONFIG_NET_POLL_CONTROLLER netdev->poll_controller = e100_netpoll; #endif - strcpy(netdev->name, pci_name(pdev)); + strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); nic = netdev_priv(netdev); nic->netdev = netdev; diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 082c02918a41..bd673802e8ce 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -759,7 +759,7 @@ e1000_probe(struct pci_dev *pdev, #ifdef CONFIG_NET_POLL_CONTROLLER netdev->poll_controller = e1000_netpoll; #endif - strcpy(netdev->name, pci_name(pdev)); + strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); netdev->mem_start = mmio_start; netdev->mem_end = mmio_start + mmio_len; diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index a88c2b8b66b1..fb4c1ad745b2 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c @@ -437,7 +437,7 @@ ixgb_probe(struct pci_dev *pdev, netdev->poll_controller = ixgb_netpoll; #endif - strcpy(netdev->name, pci_name(pdev)); + strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); netdev->mem_start = mmio_start; netdev->mem_end = mmio_start + mmio_len; netdev->base_addr = adapter->hw.io_base; -- cgit v1.2.3 From dc45010e28bc4a1bfa6043eee31d1c59e93e1546 Mon Sep 17 00:00:00 2001 From: Jesse Brandeburg Date: Wed, 27 Sep 2006 12:53:22 -0700 Subject: e100: Add debugging code for cb cleaning. Refine cb cleaning debug printout and print out all cleaned cbs' status. Signed-off-by: Jesse Brandeburg Signed-off-by: Auke Kok --- drivers/net/e100.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/net/e100.c') diff --git a/drivers/net/e100.c b/drivers/net/e100.c index ab0868cb120c..3909829d5199 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c @@ -1657,13 +1657,14 @@ static int e100_tx_clean(struct nic *nic) spin_lock(&nic->cb_lock); - DPRINTK(TX_DONE, DEBUG, "cb->status = 0x%04X\n", - nic->cb_to_clean->status); - /* Clean CBs marked complete */ for(cb = nic->cb_to_clean; cb->status & cpu_to_le16(cb_complete); cb = nic->cb_to_clean = cb->next) { + DPRINTK(TX_DONE, DEBUG, "cb[%d]->status = 0x%04X\n", + (int)(((void*)cb - (void*)nic->cbs)/sizeof(struct cb)), + cb->status); + if(likely(cb->skb != NULL)) { nic->net_stats.tx_packets++; nic->net_stats.tx_bytes += cb->skb->len; -- cgit v1.2.3 From 975b366af66280ed5b852a1a0446586ce71e306e Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Wed, 27 Sep 2006 12:53:25 -0700 Subject: e100: rework WoL and shutdown handling Unify our shutdown/suspend/resume code and make it similar to e1000: e1000_shutdown now calls suspend which does the exact same thing on shutdown except saving PCI config state on suspend. WoL setup code is now also more simple and works even when CONFIG_PM is not set, which was previously broken. Signed-off-by: Auke Kok --- drivers/net/e100.c | 51 ++++++++++++++++++++------------------------------- 1 file changed, 20 insertions(+), 31 deletions(-) (limited to 'drivers/net/e100.c') diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 3909829d5199..e9e712471b13 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c @@ -2715,68 +2715,56 @@ static void __devexit e100_remove(struct pci_dev *pdev) } } -#ifdef CONFIG_PM static int e100_suspend(struct pci_dev *pdev, pm_message_t state) { struct net_device *netdev = pci_get_drvdata(pdev); struct nic *nic = netdev_priv(netdev); - int retval; - if(netif_running(netdev)) + if (netif_running(netdev)) e100_down(nic); e100_hw_reset(nic); netif_device_detach(netdev); +#ifdef CONFIG_PM pci_save_state(pdev); - retval = pci_enable_wake(pdev, pci_choose_state(pdev, state), - nic->flags & (wol_magic | e100_asf(nic))); - if (retval) - DPRINTK(PROBE,ERR, "Error enabling wake\n"); + if (nic->flags & (wol_magic | e100_asf(nic))) +#else + if (nic->flags & (wol_magic)) +#endif + pci_enable_wake(pdev, pci_choose_state(pdev, state), 1); + else + /* disable PME */ + pci_enable_wake(pdev, 0, 0); + pci_disable_device(pdev); - retval = pci_set_power_state(pdev, pci_choose_state(pdev, state)); - if (retval) - DPRINTK(PROBE,ERR, "Error %d setting power state\n", retval); + pci_set_power_state(pdev, pci_choose_state(pdev, state)); return 0; } +#ifdef CONFIG_PM static int e100_resume(struct pci_dev *pdev) { struct net_device *netdev = pci_get_drvdata(pdev); struct nic *nic = netdev_priv(netdev); - int retval; - retval = pci_set_power_state(pdev, PCI_D0); - if (retval) - DPRINTK(PROBE,ERR, "Error waking adapter\n"); + pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); /* ack any pending wake events, disable PME */ - retval = pci_enable_wake(pdev, 0, 0); - if (retval) - DPRINTK(PROBE,ERR, "Error clearing wake events\n"); + pci_enable_wake(pdev, 0, 0); netif_device_attach(netdev); - if(netif_running(netdev)) + if (netif_running(netdev)) e100_up(nic); return 0; } -#endif +#endif /* CONFIG_PM */ static void e100_shutdown(struct pci_dev *pdev) { - struct net_device *netdev = pci_get_drvdata(pdev); - struct nic *nic = netdev_priv(netdev); - int retval; - -#ifdef CONFIG_PM - retval = pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); -#else - retval = pci_enable_wake(pdev, 0, nic->flags & (wol_magic)); -#endif - if (retval) - DPRINTK(PROBE,ERR, "Error enabling wake\n"); + e100_suspend(pdev, PMSG_SUSPEND); } /* ------------------ PCI Error Recovery infrastructure -------------- */ @@ -2860,8 +2848,9 @@ static struct pci_driver e100_driver = { .id_table = e100_id_table, .probe = e100_probe, .remove = __devexit_p(e100_remove), -#ifdef CONFIG_PM + /* Power Management hooks */ .suspend = e100_suspend, +#ifdef CONFIG_PM .resume = e100_resume, #endif .shutdown = e100_shutdown, -- cgit v1.2.3 From 76ddb3fd96a8dada2d09bc3f02b3a5efbc8390c5 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Wed, 27 Sep 2006 12:54:22 -0700 Subject: e100, e1000, ixgb: increment version numbers e100-3.5.17-k2 e1000-7.2.9-k2 ixgb-1.0.117-k2 Signed-off-by: Auke Kok --- drivers/net/e100.c | 2 +- drivers/net/e1000/e1000_main.c | 2 +- drivers/net/ixgb/ixgb_main.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/net/e100.c') diff --git a/drivers/net/e100.c b/drivers/net/e100.c index e9e712471b13..26073c345213 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c @@ -159,7 +159,7 @@ #define DRV_NAME "e100" #define DRV_EXT "-NAPI" -#define DRV_VERSION "3.5.16-k2"DRV_EXT +#define DRV_VERSION "3.5.17-k2"DRV_EXT #define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver" #define DRV_COPYRIGHT "Copyright(c) 1999-2006 Intel Corporation" #define PFX DRV_NAME ": " diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index d5e8fd5a69f2..7dca38fba6a1 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -35,7 +35,7 @@ static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; #else #define DRIVERNAPI "-NAPI" #endif -#define DRV_VERSION "7.2.7-k2"DRIVERNAPI +#define DRV_VERSION "7.2.9-k2"DRIVERNAPI char e1000_driver_version[] = DRV_VERSION; static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation."; diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index 5cce91723f76..cfde7c2569bb 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c @@ -36,7 +36,7 @@ static char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver"; #else #define DRIVERNAPI "-NAPI" #endif -#define DRV_VERSION "1.0.112-k2"DRIVERNAPI +#define DRV_VERSION "1.0.117-k2"DRIVERNAPI char ixgb_driver_version[] = DRV_VERSION; static char ixgb_copyright[] = "Copyright (c) 1999-2006 Intel Corporation."; -- cgit v1.2.3