ixgb_osdep.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*******************************************************************************
  2. Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
  3. This program is free software; you can redistribute it and/or modify it
  4. under the terms of the GNU General Public License as published by the Free
  5. Software Foundation; either version 2 of the License, or (at your option)
  6. any later version.
  7. This program is distributed in the hope that 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., 59
  13. Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. The full GNU General Public License is included in this distribution in the
  15. file called LICENSE.
  16. Contact Information:
  17. Linux NICS <linux.nics@intel.com>
  18. Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  19. *******************************************************************************/
  20. /* glue for the OS independent part of ixgb
  21. * includes register access macros
  22. */
  23. #ifndef _IXGB_OSDEP_H_
  24. #define _IXGB_OSDEP_H_
  25. #include <linux/types.h>
  26. #include <linux/pci.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_ */