rt2x00debug.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
  3. <http://rt2x00.serialmonkey.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the
  14. Free Software Foundation, Inc.,
  15. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  16. */
  17. /*
  18. Module: rt2x00debug
  19. Abstract: Data structures for the rt2x00debug.
  20. */
  21. #ifndef RT2X00DEBUG_H
  22. #define RT2X00DEBUG_H
  23. struct rt2x00_dev;
  24. /**
  25. * enum rt2x00debugfs_entry_flags: Flags for debugfs registry entry
  26. *
  27. * @RT2X00DEBUGFS_OFFSET: rt2x00lib should pass the register offset
  28. * as argument when using the callback function read()/write()
  29. */
  30. enum rt2x00debugfs_entry_flags {
  31. RT2X00DEBUGFS_OFFSET = (1 << 0),
  32. };
  33. #define RT2X00DEBUGFS_REGISTER_ENTRY(__name, __type) \
  34. struct reg##__name { \
  35. void (*read)(struct rt2x00_dev *rt2x00dev, \
  36. const unsigned int word, __type *data); \
  37. void (*write)(struct rt2x00_dev *rt2x00dev, \
  38. const unsigned int word, __type data); \
  39. \
  40. unsigned int flags; \
  41. \
  42. unsigned int word_base; \
  43. unsigned int word_size; \
  44. unsigned int word_count; \
  45. } __name
  46. struct rt2x00debug {
  47. /*
  48. * Reference to the modules structure.
  49. */
  50. struct module *owner;
  51. /*
  52. * Register access entries.
  53. */
  54. RT2X00DEBUGFS_REGISTER_ENTRY(csr, u32);
  55. RT2X00DEBUGFS_REGISTER_ENTRY(eeprom, u16);
  56. RT2X00DEBUGFS_REGISTER_ENTRY(bbp, u8);
  57. RT2X00DEBUGFS_REGISTER_ENTRY(rf, u32);
  58. };
  59. #endif /* RT2X00DEBUG_H */