diff -uNr drivers/net/e1000e-0.5.11.2/Makefile drivers/net/e1000e/Makefile --- drivers/net/e1000e-0.5.11.2/Makefile Thu Jan 1 01:00:00 1970 +++ drivers/net/e1000e/Makefile Fri Sep 4 15:03:44 2009 @@ -0,0 +1,65 @@ +################################################################################ +# +# Intel PRO/1000 Linux driver +# Copyright(c) 1999 - 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or modify it +# 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 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., +# 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 "COPYING". +# +# Contact Information: +# Linux NICS+# e1000-devel Mailing List diff -uNr drivers/net/e1000e-0.5.11.2/e1000.h drivers/net/e1000e/e1000.h --- drivers/net/e1000e-0.5.11.2/e1000.h Tue Dec 2 21:03:00 2008 +++ drivers/net/e1000e/e1000.h Mon Aug 31 14:52:04 2009 @@ -41,10 +41,15 @@ struct e1000_info; +/* + * #define e_printk(level, adapter, format, arg...) \ + * printk(level "%s: %s: " format, pci_name(adapter->pdev), \ + * (strchr(adapter->netdev->name, '%') ? "" : \ + * adapter->netdev->name), ## arg) + */ #define e_printk(level, adapter, format, arg...) \ - printk(level "%s: %s: " format, pci_name(adapter->pdev), \ - (strchr(adapter->netdev->name, '%') ? "" : \ - adapter->netdev->name), ## arg) + printk(level "%s %s: " format , adapter->pdev->name , \ + adapter->pdev->slot_name , ## arg) #ifdef DEBUG #define e_dbg(format, arg...) \ @@ -137,11 +142,11 @@ unsigned long time_stamp; u16 length; u16 next_to_watch; - }; + } tx; /* Rx */ /* arrays of page information for packet split */ struct e1000_ps_page *ps_pages; - }; + } io; struct page *page; }; diff -uNr drivers/net/e1000e-0.5.11.2/ethtool.c drivers/net/e1000e/ethtool.c --- drivers/net/e1000e-0.5.11.2/ethtool.c Tue Dec 2 21:03:00 2008 +++ drivers/net/e1000e/ethtool.c Mon Aug 31 14:52:05 2009 @@ -1074,7 +1074,7 @@ if (tx_ring->buffer_info[i].dma) pci_unmap_single(pdev, tx_ring->buffer_info[i].dma, - tx_ring->buffer_info[i].length, + tx_ring->buffer_info[i].io.tx.length, PCI_DMA_TODEVICE); if (tx_ring->buffer_info[i].skb) dev_kfree_skb(tx_ring->buffer_info[i].skb); @@ -1164,7 +1164,7 @@ } skb_put(skb, skb_size); tx_ring->buffer_info[i].skb = skb; - tx_ring->buffer_info[i].length = skb->len; + tx_ring->buffer_info[i].io.tx.length = skb->len; tx_ring->buffer_info[i].dma = pci_map_single(pdev, skb->data, skb->len, PCI_DMA_TODEVICE); @@ -1557,7 +1557,7 @@ 1024); pci_dma_sync_single_for_device(pdev, tx_ring->buffer_info[k].dma, - tx_ring->buffer_info[k].length, + tx_ring->buffer_info[k].io.tx.length, PCI_DMA_TODEVICE); k++; if (k == tx_ring->count) diff -uNr drivers/net/e1000e-0.5.11.2/kcompat.h drivers/net/e1000e/kcompat.h --- drivers/net/e1000e-0.5.11.2/kcompat.h Tue Dec 2 21:03:00 2008 +++ drivers/net/e1000e/kcompat.h Mon Aug 31 14:52:05 2009 @@ -143,22 +143,49 @@ #endif -/* generic boolean compatibility */ -#undef TRUE -#undef FALSE -#define TRUE true -#define FALSE false -#ifdef GCC_VERSION -#if ( GCC_VERSION < 3000 ) -#define _Bool char -#endif -#endif -#ifndef bool -#define bool _Bool -#define true 1 -#define false 0 +/* generic boolean compatibility + * + * #undef TRUE + * #undef FALSE + * #define TRUE true + * #define FALSE false + * #ifdef GCC_VERSION + * #if ( GCC_VERSION < 3000 ) + * #define _Bool char + * #endif + * #endif + * #ifndef bool + * #define bool _Bool + * #define true 1 + * #define false 0 + * #endif + */ + +/* + * The Boolean Identity 'trouble' of GCC + * by Richard Knutsson + * http://lkml.indiana.edu/hypermail/linux/kernel/0607.2/0791.html + */ +#if defined(__GNUC__) && __GNUC__ >= 3 +typedef _Bool bool; +#else +/* + * warning You compiler doesn't seem to support boolean types, + * will set 'bool' as an 'unsigned char' + */ +typedef unsigned char bool; #endif +typedef bool u2; + +enum { + false = 0, + true = 1 +}; +/* + * Here ends "The Boolean Identity 'trouble' of GCC" + * by Richard Knutsson + */ #ifndef module_param #define module_param(v,t,p) MODULE_PARM(v, "i"); diff -uNr drivers/net/e1000e-0.5.11.2/netdev.c drivers/net/e1000e/netdev.c --- drivers/net/e1000e-0.5.11.2/netdev.c Tue Dec 2 21:03:00 2008 +++ drivers/net/e1000e/netdev.c Mon Aug 31 14:52:05 2009 @@ -457,7 +457,7 @@ rx_desc = E1000_RX_DESC_PS(*rx_ring, i); for (j = 0; j < PS_PAGE_BUFFERS; j++) { - ps_page = &buffer_info->ps_pages[j]; + ps_page = &buffer_info->io.ps_pages[j]; if (j >= adapter->rx_ps_pages) { /* all unused desc entries get hw null ptr */ rx_desc->read.buffer_addr[j+1] = ~cpu_to_le64(0); @@ -784,7 +784,7 @@ { if (buffer_info->dma) { pci_unmap_page(adapter->pdev, buffer_info->dma, - buffer_info->length, PCI_DMA_TODEVICE); + buffer_info->io.tx.length, PCI_DMA_TODEVICE); buffer_info->dma = 0; } if (buffer_info->skb) { @@ -797,7 +797,7 @@ { struct e1000_ring *tx_ring = adapter->tx_ring; unsigned int i = tx_ring->next_to_clean; - unsigned int eop = tx_ring->buffer_info[i].next_to_watch; + unsigned int eop = tx_ring->buffer_info[i].io.tx.next_to_watch; struct e1000_tx_desc *eop_desc = E1000_TX_DESC(*tx_ring, eop); /* detected Tx unit hang */ @@ -815,7 +815,7 @@ readl(adapter->hw.hw_addr + tx_ring->tail), tx_ring->next_to_use, tx_ring->next_to_clean, - tx_ring->buffer_info[eop].time_stamp, + tx_ring->buffer_info[eop].io.tx.time_stamp, eop, jiffies, eop_desc->upper.fields.status); @@ -839,7 +839,7 @@ unsigned int total_tx_bytes = 0, total_tx_packets = 0; i = tx_ring->next_to_clean; - eop = tx_ring->buffer_info[i].next_to_watch; + eop = tx_ring->buffer_info[i].io.tx.next_to_watch; eop_desc = E1000_TX_DESC(*tx_ring, eop); while (eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) { @@ -878,7 +878,7 @@ #endif } - eop = tx_ring->buffer_info[i].next_to_watch; + eop = tx_ring->buffer_info[i].io.tx.next_to_watch; eop_desc = E1000_TX_DESC(*tx_ring, eop); } @@ -909,7 +909,7 @@ */ adapter->detect_tx_hung = 0; if (tx_ring->buffer_info[eop].dma && - time_after(jiffies, tx_ring->buffer_info[eop].time_stamp + time_after(jiffies, tx_ring->buffer_info[eop].io.tx.time_stamp + (adapter->tx_timeout_factor * HZ)) && !(er32(STATUS) & E1000_STATUS_TXOFF)) { e1000_print_tx_hang(adapter); @@ -1053,7 +1053,7 @@ if (!length) break; - ps_page = &buffer_info->ps_pages[j]; + ps_page = &buffer_info->io.ps_pages[j]; pci_unmap_page(pdev, ps_page->dma, PAGE_SIZE, PCI_DMA_FROMDEVICE); ps_page->dma = 0; @@ -1340,7 +1340,7 @@ } for (j = 0; j < PS_PAGE_BUFFERS; j++) { - ps_page = &buffer_info->ps_pages[j]; + ps_page = &buffer_info->io.ps_pages[j]; if (!ps_page->page) break; pci_unmap_page(pdev, ps_page->dma, PAGE_SIZE, @@ -2106,10 +2106,10 @@ for (i = 0; i < rx_ring->count; i++) { buffer_info = &rx_ring->buffer_info[i]; - buffer_info->ps_pages = kcalloc(PS_PAGE_BUFFERS, + buffer_info->io.ps_pages = kcalloc(PS_PAGE_BUFFERS, sizeof(struct e1000_ps_page), GFP_KERNEL); - if (!buffer_info->ps_pages) + if (!buffer_info->io.ps_pages) goto err_pages; } @@ -2132,7 +2132,7 @@ err_pages: for (i = 0; i < rx_ring->count; i++) { buffer_info = &rx_ring->buffer_info[i]; - kfree(buffer_info->ps_pages); + kfree(buffer_info->io.ps_pages); } err: vfree(rx_ring->buffer_info); @@ -2205,7 +2205,7 @@ e1000_clean_rx_ring(adapter); for (i = 0; i < rx_ring->count; i++) { - kfree(rx_ring->buffer_info[i].ps_pages); + kfree(rx_ring->buffer_info[i].io.ps_pages); } vfree(rx_ring->buffer_info); @@ -4245,8 +4245,8 @@ context_desc->tcp_seg_setup.data = 0; context_desc->cmd_and_length = cpu_to_le32(cmd_len); - buffer_info->time_stamp = jiffies; - buffer_info->next_to_watch = i; + buffer_info->io.tx.time_stamp = jiffies; + buffer_info->io.tx.next_to_watch = i; i++; if (i == tx_ring->count) @@ -4276,9 +4276,9 @@ buffer_info = &tx_ring->buffer_info[i]; size = min(len, max_per_txd); - buffer_info->length = size; + buffer_info->io.tx.length = size; /* set time_stamp *before* dma to help avoid a possible race */ - buffer_info->time_stamp = jiffies; + buffer_info->io.tx.time_stamp = jiffies; buffer_info->dma = pci_map_single(adapter->pdev, skb->data + offset, @@ -4289,7 +4289,7 @@ adapter->tx_dma_failed++; return -1; } - buffer_info->next_to_watch = i; + buffer_info->io.tx.next_to_watch = i; len -= size; offset += size; @@ -4310,8 +4310,8 @@ buffer_info = &tx_ring->buffer_info[i]; size = min(len, max_per_txd); - buffer_info->length = size; - buffer_info->time_stamp = jiffies; + buffer_info->io.tx.length = size; + buffer_info->io.tx.time_stamp = jiffies; buffer_info->dma = pci_map_page(adapter->pdev, frag->page, @@ -4326,7 +4326,7 @@ return -1; } - buffer_info->next_to_watch = i; + buffer_info->io.tx.next_to_watch = i; len -= size; offset += size; @@ -4344,7 +4344,7 @@ i--; tx_ring->buffer_info[i].skb = skb; - tx_ring->buffer_info[first].next_to_watch = i; + tx_ring->buffer_info[first].io.tx.next_to_watch = i; return count; } @@ -4384,7 +4384,7 @@ tx_desc = E1000_TX_DESC(*tx_ring, i); tx_desc->buffer_addr = cpu_to_le64(buffer_info->dma); tx_desc->lower.data = - cpu_to_le32(txd_lower | buffer_info->length); + cpu_to_le32(txd_lower | buffer_info->io.tx.length); tx_desc->upper.data = cpu_to_le32(txd_upper); i++;+# Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 +# +################################################################################ + +########################################################################### +# Driver files +#FAMILYC = e1000_82571.c e1000_ich8lan.c e1000_80003es2lan.c +#FAMILYH = e1000_82571.h e1000_ich8lan.h e1000_80003es2lan.h +# +# +## core driver files +#CFILES = netdev.c ethtool.c param.c $(FAMILYC) \ +# e1000_mac.c e1000_nvm.c e1000_phy.c e1000_manage.c kcompat.c +#HFILES = e1000.h hw.h e1000_regs.h e1000_defines.h \ +# e1000_mac.h e1000_nvm.h e1000_phy.h e1000_manage.h $(FAMILYH) kcompat.h +# +#DRIVER_NAME = e1000e +# +########################################################################### + + +# +# Makefile for the Intel(R) PRO/1000 ethernet driver +# Adjusted to compile with gcc2 (gcc-2.95.3) on Linux-2.4 +# +# Robert M. Stockmann - RHCE, Tue Sep 1 02:05:55 CEST 2009 +# Network Engineer - UNIX/Linux Specialist +# crashrecovery.org stock@stokkie.net +# + +FAMILYO = e1000_82571.o e1000_ich8lan.o e1000_80003es2lan.o + +O_TARGET := e1000e.o + +obj-y := netdev.o ethtool.o param.o $(FAMILYO) \ + e1000_mac.o e1000_nvm.o e1000_phy.o e1000_manage.o kcompat.o +obj-m := $(O_TARGET) + +include $(TOPDIR)/Rules.make +EXTRA_CFLAGS_nostdinc := $(EXTRA_CFLAGS_nostdinc) \ + -DE1000E_NO_NAPI -DDRIVER_E1000E