ixgb_osdep.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*******************************************************************************
  2. Intel PRO/10GbE Linux driver
  3. Copyright(c) 1999 - 2006 Intel Corporation.
  4. This program is free software; you can redistribute it and/or modify it
  5. under the terms and conditions of the GNU General Public License,
  6. version 2, as published by the Free Software Foundation.
  7. This program is distributed in the hope it will be useful, but WITHOUT
  8. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  9. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  10. more details.
  11. You should have received a copy of the GNU General Public License along with
  12. this program; if not, write to the Free Software Foundation, Inc.,
  13. 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  14. The full GNU General Public License is included in this distribution in
  15. the file called "COPYING".
  16. Contact Information:
  17. Linux NICS <linux.nics@intel.com>
  18. e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
  19. Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  20. *******************************************************************************/
  21. /* glue for the OS independent part of ixgb
  22. * includes register access macros
  23. */
  24. #ifndef _IXGB_OSDEP_H_
  25. #define _IXGB_OSDEP_H_
  26. #include <linux/types.h>
  27. #include <linux/delay.h>
  28. #include <asm/io.h>
  29. #include <linux/interrupt.h>
  30. #include <linux/sched.h>
  31. typedef enum {
  32. #undef FALSE
  33. FALSE = 0,
  34. #undef TRUE
  35. TRUE = 1
  36. } boolean_t;
  37. #undef ASSERT
  38. #define ASSERT(x) if(!(x)) BUG()
  39. #define MSGOUT(S, A, B) printk(KERN_DEBUG S "\n", A, B)
  40. #ifdef DBG
  41. #define DEBUGOUT(S) printk(KERN_DEBUG S "\n")
  42. #define DEBUGOUT1(S, A...) printk(KERN_DEBUG S "\n", A)
  43. #else
  44. #define DEBUGOUT(S)
  45. #define DEBUGOUT1(S, A...)
  46. #endif
  47. #define DEBUGFUNC(F) DEBUGOUT(F)
  48. #define DEBUGOUT2 DEBUGOUT1
  49. #define DEBUGOUT3 DEBUGOUT2
  50. #define DEBUGOUT7 DEBUGOUT3
  51. #define IXGB_WRITE_REG(a, reg, value) ( \
  52. writel((value), ((a)->hw_addr + IXGB_##reg)))
  53. #define IXGB_READ_REG(a, reg) ( \
  54. readl((a)->hw_addr + IXGB_##reg))
  55. #define IXGB_WRITE_REG_ARRAY(a, reg, offset, value) ( \
  56. writel((value), ((a)->hw_addr + IXGB_##reg + ((offset) << 2))))
  57. #define IXGB_READ_REG_ARRAY(a, reg, offset) ( \
  58. readl((a)->hw_addr + IXGB_##reg + ((offset) << 2)))
  59. #define IXGB_WRITE_FLUSH(a) IXGB_READ_REG(a, STATUS)
  60. #define IXGB_MEMCPY memcpy
  61. #endif /* _IXGB_OSDEP_H_ */