rt2x00debug.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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, see <http://www.gnu.org/licenses/>.
  14. */
  15. /*
  16. Module: rt2x00debug
  17. Abstract: Data structures for the rt2x00debug.
  18. */
  19. #ifndef RT2X00DEBUG_H
  20. #define RT2X00DEBUG_H
  21. struct rt2x00_dev;
  22. /**
  23. * enum rt2x00debugfs_entry_flags: Flags for debugfs registry entry
  24. *
  25. * @RT2X00DEBUGFS_OFFSET: rt2x00lib should pass the register offset
  26. * as argument when using the callback function read()/write()
  27. */
  28. enum rt2x00debugfs_entry_flags {
  29. RT2X00DEBUGFS_OFFSET = (1 << 0),
  30. };
  31. #define RT2X00DEBUGFS_REGISTER_ENTRY(__name, __type) \
  32. struct reg##__name { \
  33. void (*read)(struct rt2x00_dev *rt2x00dev, \
  34. const unsigned int word, __type *data); \
  35. void (*write)(struct rt2x00_dev *rt2x00dev, \
  36. const unsigned int word, __type data); \
  37. \
  38. unsigned int flags; \
  39. \
  40. unsigned int word_base; \
  41. unsigned int word_size; \
  42. unsigned int word_count; \
  43. } __name
  44. struct rt2x00debug {
  45. /*
  46. * Reference to the modules structure.
  47. */
  48. struct module *owner;
  49. /*
  50. * Register access entries.
  51. */
  52. RT2X00DEBUGFS_REGISTER_ENTRY(csr, u32);
  53. RT2X00DEBUGFS_REGISTER_ENTRY(eeprom, u16);
  54. RT2X00DEBUGFS_REGISTER_ENTRY(bbp, u8);
  55. RT2X00DEBUGFS_REGISTER_ENTRY(rf, u32);
  56. RT2X00DEBUGFS_REGISTER_ENTRY(rfcsr, u8);
  57. };
  58. #endif /* RT2X00DEBUG_H */