Commit e0bfb7f3 authored by eddietwo's avatar eddietwo

import pure 6.1.16.2.DB e1000 driver from Max Poletto (Mazu)

parent ade1ef38
This diff is collapsed.
This diff is collapsed.
57018 10 src/Makefile
37816 8 src/bypass_modectrl_tool.c
63261 10 src/e1000.h
42983 5 src/e1000_bypass_ctrl.c
18468 3 src/e1000_bypass_ctrl.h
39386 53 src/e1000_ethtool.c
34197 231 src/e1000_hw.c
43684 120 src/e1000_hw.h
43421 127 src/e1000_main.c
13937 5 src/e1000_osdep.h
59469 23 src/e1000_param.c
12758 5 src/kcompat.c
21187 21 src/kcompat.h
30352 21 src/kcompat_ethtool.c
39773 19 LICENSE
00813 24 README
19518 6 ldistrib.txt
05050 16 e1000.spec
13318 10 e1000.7
This diff is collapsed.
This diff is collapsed.
Using Intel(R) Network Adapters with Linux* --
Information for Specific Linux* Distributions
==============================================
July 1, 2005
Contents
========
- SuSE* LINUX Enterprise Server 8 IA64 cause unresolved symbols
- SuSE LINUX Enterprise Server 9 warning message during driver build
- Red Hat* Linux 7.1 - Creating an RPM from tar / zipped File
- ACPI enable may cause Dual Port Pro/1000 adapters to fail
- Red Hat Enterprise Linux (RHEL)
- Loading and unloading modules with the Linux 2.6 Kernel
- Red Hat Enterprise Linux 3 with Intel(R) Desktop Board D915GEV
- Support
SuSE LINUX Enterprise Server 8 IA64 causes unresolved symbols
=============================================================
If you get unresolved symbol errors when loading the e1000 driver, perform
the following:
1. cd /usr/src/linux
2. make cloneconfig
3. make dep
Then rebuild the driver.
SuSE LINUX Enterprise Server 9 warning message during driver build
==================================================================
While building the driver on SuSE LINUX Enterprise Server 9 installations,
the following warning or something similar may be displayed. It is safe to
ignore this message. The driver will load and function normally.
Symbol version dump /usr/src/<kernel-version>-obj/<arch>/<kernel flavor>/
Module.symvers is missing, modules will have CONFIG_MODVERSIONS disabled.
While loading the driver, ignore the warnings in the syslog:
linux kernel: <driver name>: no version for "struct_module" found: kernel
tainted.
linux kernel: <driver name>: unsupported module, tainting kernel.
Red Hat Linux 7.1 - Creating an RPM from tar / zipped File
==========================================================
When trying to generate an RPM from the .tar.gz file, a segmentation fault
(core dump) occurs. This failure occurs because Red Hat Linux 7.1 uses
version 4.0.2 of the RPM utility. This version does not have the ability to
handle parameterized macros, which are used within the e100 and e1000 spec
files to generate an RPM. Updating the RPM utility to a more current version
resolves the issue. The utility can be obtained from http://www.rpm.org.
ACPI enable may cause Dual Port PRO/1000 Adapters to fail
=========================================================
If ACPI is turned on in the kernel, dual port adapters may not work.
This is due to a limitation in ACPI. Currently, this affects all new
versions of SuSE.
Red Hat Enterprise Linux (RHEL)
===============================
2.1 Distribution
----------------
If there are errors while compiling the driver, do the following:
1. Change to the kernel source directory.
2. Perform all the required steps to build the kernel up to and including
make dep.
3. Modify EXTRAVERSION in the Makefile in Red Hat kernel source directory
to match the version of the running kernel.
3. Build the driver, using instructions located in the README file.
While building the driver, ignore the warning:
/lib/modules/2.4.9-e.34/build/include/linux/rhconfig.h:31:60:
operator '(' has no left operand
NOTE: For Red Hat's procedure for building a Linux kernel we recommend
visiting their web site at www.redhat.com.
NOTE: This problem is resolved in Red Hat Enterprise Linux 2.1 Update 4.
2.5.50 Distribution
-------------------
In Redhat Enterprise Linux 4 (RHEL4), unplugging network cable while ethtool -p
is running will cause sytem to become unresponsive to keyboard commands, except
for control-alt-delete. Restarting the system appears to be the only remedy.
This occurs in distributions later than v2.5.50.
Loading and unloading modules with the Linux 2.6 Kernel
=======================================================
A new kernel API has been implemented within the Linux 2.6 kernel regarding
the module reference count. This results in the e100, e1000 and ixgb drivers
being used with a module reference count of zero. Consequently, our driver
module can be removed from the system while still being used by other modules.
Until the other modules within the Linux stack use the new API, unintended
consequences may occur with module removal. This may result in system hangs
and/or panics.
Red Hat Enterprise Linux 3 with Intel(R) Desktop Board D915GEV
==============================================================
If you are using a system based on an Intel(R) Desktop Board D915GEV, and install
a PCI Express (PCIe) adapter, and run a Linux distribution with the v2.4 kernel
(such as Red Hat Enterprise Linux 3), the system may panic or hang. This
behavior has been observed with various brands of PCIe adapters besides those
from Intel. This does not occur on a Linux distribution with a v2.6 kernel, such
as Red Hat EL 4 AS or SUSE Linux Enterprise Server (SLES) 9. Booting with the
'noapic' kernel parameter should also workaround this problem for systems running
with a 2.4 kernel.
Support
=======
For general information and support, go to the Intel support website at:
http://support.intel.com
If an issue is identified with the released source code on the supported
kernel with a supported adapter, email the specific information related to
the issue to linux.nics@intel.com.
Copyright and Legal Disclaimers
===============================
Copyright(c) 2005 Intel Corporation. All rights reserved.
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
Intel Corporation assumes no responsibility for errors or omissions in this
document. Nor does Intel make any commitment to update the information
contained herein.
Intel, Itanium, and Pentium are trademarks or registered trademarks of Intel
Corporation or its subsidiaries in the United States and other countries.
*Other names and brands may be claimed as the property of others.
This diff is collapsed.
/*******************************************************************************
Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
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.
This program is distributed in the hope that 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.
The full GNU General Public License is included in this distribution in the
file called LICENSE.
Contact Information:
Linux NICS <linux.nics@intel.com>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
/*
* Sample test app to excersize the Intel PRO Bypass Mode Control interface
*/
#include <stdio.h>
#include <string.h>
#include <linux/unistd.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <sys/types.h>
typedef __uint32_t uint32_t; /* hack, so we can include driver files */
typedef __uint16_t uint16_t; /* ditto */
typedef __uint8_t uint8_t; /* ditto */
#include "e1000_bypass_ctrl.h"
extern char *optarg;
extern int optopt, optind, opterr;
#define SYSCALL(X,S) { if((X) < 0) { perror(S); return -1; } }
#define FILEPART(S) ( rindex((S), '/') == NULL ? (S) : rindex((S), '/') + 1 )
static int
e1000_bypass_mode(int sock1, int sock2, struct ifreq *interface1,
struct ifreq *interface2, unsigned int sdpBits)
{
struct ibypass_ctrl_data *bypass_ctrl_data1, *bypass_ctrl_data2;
bypass_ctrl_data1 = (struct ibypass_ctrl_data *)interface1->ifr_data;
bypass_ctrl_data1->cmd = IDRIVE_BYPASS_CTRL_SIG;
bypass_ctrl_data1->bypass_param[0] = sdpBits & 0x3;
SYSCALL(ioctl(sock1, BYPASS_MODE_CTRL_SIOC, interface1), interface1->ifr_name);
bypass_ctrl_data2 = (struct ibypass_ctrl_data *)interface2->ifr_data;
bypass_ctrl_data2->cmd = IDRIVE_BYPASS_CTRL_SIG;
bypass_ctrl_data2->bypass_param[0] = ((sdpBits & 0xc) >> 2);
SYSCALL(ioctl(sock2, BYPASS_MODE_CTRL_SIOC, interface2), interface2->ifr_name);
switch (bypass_ctrl_data1->status) {
case BYPASS_MODE_STAT_OK:
printf("%s %s: Bypass Mode is passed\n",
interface1->ifr_name, interface2->ifr_name);
return 0;
case BYPASS_MODE_STAT_INVALID_STATE:
printf("%s %s: invalid Bypass Mode\n",
interface1->ifr_name, interface2->ifr_name);
return -1;
case BYPASS_MODE_STAT_FAILED:
printf("%s %s: Bypass Mode FAILED (NO link).\n",
interface1->ifr_name, interface2->ifr_name);
return -1;
default:
printf("%s %s: Bypass Mode FAILED.\n",
interface1->ifr_name, interface2->ifr_name);
printf("%s %s: Reason unknown.\n",
interface1->ifr_name, interface2->ifr_name);
return -1;
}
return 0;
}
static void
usage(char *name)
{
fprintf(stderr, "\nUsage: %s [OPTION]\n\n", name);
fprintf(stderr, " -1 <interface> -2 <interface>: \
interface (eth0, eth1, etc)\n\n");
fprintf(stderr, " -d <sdpBits>: sdp ModeCtrl Bits: (0<0000>, 1<0001>, etc)\n");
fprintf(stderr, " -s : To check the status of the bypass mode\n");
fprintf(stderr, " -m : ???\n");
}
int
main(int argc, char **argv)
{
struct ifreq interface1, interface2;
struct ibypass_ctrl_data bypass_ctrl_data1, bypass_ctrl_data2;
unsigned char *iface1 = NULL, *iface2 = NULL;
int retval = 0, ch, sock1, sock2;
unsigned int sdpBits;
unsigned char command_line_parsed = 0;
enum {
DRIVE_SDP = 0x1,
BYPASS_STATUS = 0x2,
};
unsigned int tests = 0;
/* Make sure at least two interface name were given on the
* command line */
if(argc < 3) {
usage(FILEPART(argv[0]));
return -1;
}
while((ch = getopt(argc, argv, ":1:2:d:s:m")) != -1) {
switch (ch) {
case '1':
iface1 = optarg;
break;
case '2':
iface2 = optarg;
break;
case 'd':
tests |= DRIVE_SDP;
sdpBits = strtol(optarg, NULL, 0);
break;
case 's':
tests |= BYPASS_STATUS;
sdpBits = strtol(optarg, NULL, 0);
break;
case 'm':
case ':':
case '?':
usage(FILEPART(argv[0]));
return -1;
}
command_line_parsed = 1;
}
if(command_line_parsed == 0) {
usage(FILEPART(argv[0]));
return -1;
}
if((iface1 == NULL) || (iface2 == NULL)) {
usage(FILEPART(argv[0]));
return -1;
}
/* Test for existance of the network interface-1 */
strcpy(interface1.ifr_name, iface1);
SYSCALL((sock1 = socket(AF_INET, SOCK_DGRAM, 0)), "Failed to create socket");
SYSCALL(ioctl(sock1, SIOCGIFINDEX, &interface1), interface1.ifr_name);
/* Test for the Bypass interface1, and get the driver ID */
bypass_ctrl_data1.interface_ver = IBYPASS_MODECTRL_VERSION;
bypass_ctrl_data1.driver_id = IBYPASS_E1000_DRIVER;
bypass_ctrl_data1.cmd = IBYPASS_MODE_IDENTIFY_DRIVER;
interface1.ifr_data = (char *)&bypass_ctrl_data1;
SYSCALL(ioctl(sock1, BYPASS_MODE_CTRL_SIOC, &interface1),
interface1.ifr_name);
if(bypass_ctrl_data1.driver_id != IBYPASS_E1000_DRIVER) {
fprintf(stderr, "Driver ID 0x%x not supported by %s\n",
IBYPASS_E1000_DRIVER, interface1.ifr_name);
return -1;
}
if(bypass_ctrl_data1.status != BYPASS_MODE_STAT_OK) {
fprintf(stderr, "Inf1 ver 0x%x not supported by %s\n",
IBYPASS_MODECTRL_VERSION, interface1.ifr_name);
return -1;
};
/* Test for existance of the network interface-2 */
strcpy(interface2.ifr_name, iface2);
SYSCALL((sock2 = socket(AF_INET, SOCK_DGRAM, 0)), "Failed to create socket");
SYSCALL(ioctl(sock2, SIOCGIFINDEX, &interface2), interface2.ifr_name);
/* Test for the iDIAG interface2, and get the driver ID */
bypass_ctrl_data2.interface_ver = IBYPASS_MODECTRL_VERSION;
bypass_ctrl_data2.driver_id = IBYPASS_E1000_DRIVER;
bypass_ctrl_data2.cmd = IBYPASS_MODE_IDENTIFY_DRIVER;
interface2.ifr_data = (char *)&bypass_ctrl_data2;
SYSCALL(ioctl(sock2, BYPASS_MODE_CTRL_SIOC, &interface2),
interface2.ifr_name);
if(bypass_ctrl_data2.driver_id != IBYPASS_E1000_DRIVER) {
fprintf(stderr, "Driver ID 0x%x not supported by %s\n",
IBYPASS_E1000_DRIVER, interface2.ifr_name);
return -1;
}
if(bypass_ctrl_data2.status != BYPASS_MODE_STAT_OK) {
fprintf(stderr, "Inf-2 ver 0x%x not supported by %s\n",
IBYPASS_MODECTRL_VERSION, interface2.ifr_name);
return -1;
};
/* Run the Bypass mode Control signals on SDP pins */
if(tests & DRIVE_SDP)
retval |= e1000_bypass_mode(sock1, sock2, &interface1, &interface2, sdpBits);
else if(tests & BYPASS_STATUS) {
/* Check the Status of the Bypass mode */
bypass_ctrl_data2.interface_ver = IBYPASS_MODECTRL_VERSION;
bypass_ctrl_data2.driver_id = IBYPASS_E1000_DRIVER;
bypass_ctrl_data2.cmd = ICHECK_BYPASS_CTRL_STATUS;
interface2.ifr_data = (char *)&bypass_ctrl_data2;
SYSCALL(ioctl(sock2, BYPASS_MODE_CTRL_SIOC, &interface2), interface2.ifr_name);
if ((bypass_ctrl_data2.status) == BYPASS_MODE_STAT_FAILED ){
bypass_ctrl_data1.interface_ver = IBYPASS_MODECTRL_VERSION;
bypass_ctrl_data1.driver_id = IBYPASS_E1000_DRIVER;
bypass_ctrl_data1.cmd = ICHECK_BYPASS_CTRL_STATUS;
interface1.ifr_data = (char *)&bypass_ctrl_data1;
SYSCALL(ioctl(sock1, BYPASS_MODE_CTRL_SIOC, &interface1), interface1.ifr_name);
}
retval == BYPASS_MODE_STAT_OK;
}
return retval;
}
This diff is collapsed.
/*******************************************************************************
Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
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.
This program is distributed in the hope that 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.
The full GNU General Public License is included in this distribution in the
file called LICENSE.
Contact Information:
Linux NICS <linux.nics@intel.com>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
/*
* Intel PRO diagnostics
*/
#include "e1000.h"
#include <asm/uaccess.h>
#include "e1000_bypass_ctrl.h"
#define E1000_CTRL_SDP0_SHIFT 18
#define E1000_CTRL_EXT_SDP6_SHIFT 6
static enum mode_status
e1000_drive_sdp_signals(struct e1000_adapter *adapter, uint32_t bypass_param)
{
uint32_t value;
DPRINTK(DRV, ERR, "Rcvd Sig %s-%1x\n", adapter->netdev->name, bypass_param);
value = (E1000_READ_REG(&adapter->hw, CTRL));
/* Make SDP0 Pin Directonality to Output */
value |= E1000_CTRL_SWDPIO0;
E1000_WRITE_REG(&adapter->hw, CTRL, value);
value &= ~E1000_CTRL_SWDPIN0;
value |= ((bypass_param & 0x1) << E1000_CTRL_SDP0_SHIFT);
E1000_WRITE_REG(&adapter->hw, CTRL, value);
value = (E1000_READ_REG(&adapter->hw, CTRL_EXT));
/* Make SDP2 Pin Directonality to Output */
value |= E1000_CTRL_EXT_SDP6_DIR;
E1000_WRITE_REG(&adapter->hw, CTRL_EXT, value);
value &= ~E1000_CTRL_EXT_SDP6_DATA;
value |= (((bypass_param & 0x2) >> 1) << E1000_CTRL_EXT_SDP6_SHIFT);
E1000_WRITE_REG(&adapter->hw, CTRL_EXT, value);
return BYPASS_MODE_STAT_OK;
}
static enum mode_status e1000_check_bypass_status(struct e1000_adapter *adapter)
{
uint32_t value;
if(E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_FUNC_1) {
value = ((E1000_READ_REG(&adapter->hw, CTRL_EXT)) & E1000_CTRL_EXT_SDP7_DATA);
if(value)
DPRINTK(DRV, ERR, "%s is in Bypass Mode\n", adapter->netdev->name);
else
DPRINTK(DRV, ERR, "%s is in Non-Bypass Mode\n", adapter->netdev->name);
return BYPASS_MODE_STAT_OK;
}
else
return BYPASS_MODE_STAT_FAILED;
}
int
e1000_bypass_ctrl_ioctl(struct net_device *netdev, struct ifreq *ifr)
{
void *useraddr = ifr->ifr_data;
struct ibypass_ctrl_data bypass_ctrl_data;
struct e1000_adapter *adapter = netdev->priv;
if(copy_from_user(&bypass_ctrl_data, useraddr, sizeof(bypass_ctrl_data)))
{
DPRINTK(DRV, ERR, "Could not copy from user %s\n", ifr->ifr_name);
return -EPERM;
}
bypass_ctrl_data.status = BYPASS_MODE_STAT_NOT_SUPPORTED;
if(bypass_ctrl_data.interface_ver != IBYPASS_MODECTRL_VERSION &&
bypass_ctrl_data.driver_id != IBYPASS_E1000_DRIVER)
{
DPRINTK(DRV, ERR, "incorrect inf ver/dirver id %s\n", ifr->ifr_name);
return -EFAULT;
}
/* Drive Bypass Mode Control SDP signals */
switch (bypass_ctrl_data.cmd) {
case IBYPASS_MODE_IDENTIFY_DRIVER:
bypass_ctrl_data.driver_id = IBYPASS_E1000_DRIVER;
bypass_ctrl_data.status = BYPASS_MODE_STAT_OK;
break;
case IDRIVE_BYPASS_CTRL_SIG:
bypass_ctrl_data.status =
e1000_drive_sdp_signals(adapter, (uint32_t)bypass_ctrl_data.bypass_param[0]);
break;
case ICHECK_BYPASS_CTRL_STATUS:
bypass_ctrl_data.status = e1000_check_bypass_status(adapter);
break;
default:
DPRINTK(DRV, ERR, "Unknown Bypass Ctrl Sig - %s\n", ifr->ifr_name);
bypass_ctrl_data.status = BYPASS_MODE_STAT_NOT_SUPPORTED;
break;
}
if(copy_to_user(useraddr, &bypass_ctrl_data, sizeof(bypass_ctrl_data)))
return -EPERM;
return 0;
}
/*******************************************************************************
Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
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.
This program is distributed in the hope that 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.
The full GNU General Public License is included in this distribution in the
file called LICENSE.
Contact Information:
Linux NICS <linux.nics@intel.com>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#ifndef _IDEWEY_BEACH_E1000_H
#define _IDEWEY_BEACH_E1000_H
/* Unique base driver identifier */
#define IBYPASS_E1000_DRIVER 0x02
#define IBYPASS_MODECTRL_VERSION 0x200
#define IBYPASS_PARAM_SIZE 0x80
#define IBYPASS_MODE_DRIVER_UNKNOWN 0x0
#define IBYPASS_MODE_IDENTIFY_DRIVER 0x0
#define BYPASS_MODE_CTRL_SIOC (SIOCDEVPRIVATE + 10)
/* e1000 diagnostic commands */
#define IDRIVE_BYPASS_CTRL_SIG 0x01
#define ICHECK_BYPASS_CTRL_STATUS 0x02
enum mode_status {
BYPASS_MODE_STAT_OK,
BYPASS_MODE_STAT_FAILED,
BYPASS_MODE_STAT_BAD_PARAM,
BYPASS_MODE_STAT_INVALID_STATE,
BYPASS_MODE_STAT_NOT_SUPPORTED,
};
struct ibypass_ctrl_data {
/* in */
uint32_t cmd;
uint32_t interface_ver;
uint32_t driver_id;
uint32_t reserved_in[8];
/* out */
enum mode_status status;
uint32_t reserved_out[8];
/* in/out */
uint8_t bypass_param[IBYPASS_PARAM_SIZE];
};
#endif /* _IDEWEY_BEACH_E1000_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*******************************************************************************
Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
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.
This program is distributed in the hope that 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.
The full GNU General Public License is included in this distribution in the
file called LICENSE.
Contact Information:
Linux NICS <linux.nics@intel.com>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
/* glue for the OS independent part of e1000
* includes register access macros
*/
#ifndef _E1000_OSDEP_H_
#define _E1000_OSDEP_H_
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <asm/io.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include "kcompat.h"
#define usec_delay(x) udelay(x)
#ifndef msec_delay
#define msec_delay(x) do { if(in_interrupt()) { \
/* Don't mdelay in interrupt context! */ \
BUG(); \
} else { \
msleep(x); \
} } while(0)
/* Some workarounds require millisecond delays and are run during interrupt
* context. Most notably, when establishing link, the phy may need tweaking
* but cannot process phy register reads/writes faster than millisecond
* intervals...and we establish link due to a "link status change" interrupt.
*/
#define msec_delay_irq(x) mdelay(x)
#endif
#define PCI_COMMAND_REGISTER PCI_COMMAND
#define CMD_MEM_WRT_INVALIDATE PCI_COMMAND_INVALIDATE
typedef enum {
#undef FALSE
FALSE = 0,
#undef TRUE
TRUE = 1
} boolean_t;
#define MSGOUT(S, A, B) printk(KERN_DEBUG S "\n", A, B)
#ifdef DBG
#define DEBUGOUT(S) printk(KERN_DEBUG S "\n")
#define DEBUGOUT1(S, A...) printk(KERN_DEBUG S "\n", A)
#else
#define DEBUGOUT(S)
#define DEBUGOUT1(S, A...)
#endif
#define DEBUGFUNC(F) DEBUGOUT(F)
#define DEBUGOUT2 DEBUGOUT1
#define DEBUGOUT3 DEBUGOUT2
#define DEBUGOUT7 DEBUGOUT3
#define E1000_WRITE_REG(a, reg, value) ( \
writel((value), ((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg))))
#define E1000_READ_REG(a, reg) ( \
readl((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg)))
#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) ( \
writel((value), ((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg) + \
((offset) << 2))))
#define E1000_READ_REG_ARRAY(a, reg, offset) ( \
readl((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg) + \
((offset) << 2)))