patch-2.4.21 linux-2.4.21/drivers/net/e1000/e1000_osdep.h
Next file: linux-2.4.21/drivers/net/e1000/e1000_param.c
Previous file: linux-2.4.21/drivers/net/e1000/e1000_main.c
Back to the patch index
Back to the overall index
- Lines: 53
- Date:
2003-06-13 07:51:34.000000000 -0700
- Orig file:
linux-2.4.20/drivers/net/e1000/e1000_osdep.h
- Orig date:
2002-11-28 15:53:13.000000000 -0800
diff -urN linux-2.4.20/drivers/net/e1000/e1000_osdep.h linux-2.4.21/drivers/net/e1000/e1000_osdep.h
@@ -1,7 +1,7 @@
/*******************************************************************************
- Copyright(c) 1999 - 2002 Intel Corporation. All rights reserved.
+ Copyright(c) 1999 - 2003 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
@@ -27,7 +27,7 @@
*******************************************************************************/
-/* glue for the OS independant part of e1000
+/* glue for the OS independant part of e1000
* includes register access macros
*/
@@ -77,24 +77,22 @@
#define E1000_WRITE_REG(a, reg, value) ( \
- ((a)->mac_type >= e1000_82543) ? \
- (writel((value), ((a)->hw_addr + E1000_##reg))) : \
- (writel((value), ((a)->hw_addr + E1000_82542_##reg))))
+ writel((value), ((a)->hw_addr + \
+ (((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg))))
#define E1000_READ_REG(a, reg) ( \
- ((a)->mac_type >= e1000_82543) ? \
- readl((a)->hw_addr + E1000_##reg) : \
- readl((a)->hw_addr + E1000_82542_##reg))
+ readl((a)->hw_addr + \
+ (((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg)))
#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) ( \
- ((a)->mac_type >= e1000_82543) ? \
- writel((value), ((a)->hw_addr + E1000_##reg + ((offset) << 2))) : \
- writel((value), ((a)->hw_addr + E1000_82542_##reg + ((offset) << 2))))
+ 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) ( \
- ((a)->mac_type >= e1000_82543) ? \
- readl((a)->hw_addr + E1000_##reg + ((offset) << 2)) : \
- readl((a)->hw_addr + E1000_82542_##reg + ((offset) << 2)))
+ readl((a)->hw_addr + \
+ (((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg) + \
+ ((offset) << 2)))
#define E1000_WRITE_FLUSH(a) E1000_READ_REG(a, STATUS)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)