mconsole_kern.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
  3. * Licensed under the GPL
  4. */
  5. #ifndef __MCONSOLE_KERN_H__
  6. #define __MCONSOLE_KERN_H__
  7. #include "linux/config.h"
  8. #include "linux/list.h"
  9. #include "mconsole.h"
  10. struct mconsole_entry {
  11. struct list_head list;
  12. struct mc_request request;
  13. };
  14. struct mc_device {
  15. struct list_head list;
  16. char *name;
  17. int (*config)(char *);
  18. int (*get_config)(char *, char *, int, char **);
  19. int (*id)(char **, int *, int *);
  20. int (*remove)(int);
  21. };
  22. #define CONFIG_CHUNK(str, size, current, chunk, end) \
  23. do { \
  24. current += strlen(chunk); \
  25. if(current >= size) \
  26. str = NULL; \
  27. if(str != NULL){ \
  28. strcpy(str, chunk); \
  29. str += strlen(chunk); \
  30. } \
  31. if(end) \
  32. current++; \
  33. } while(0)
  34. #ifdef CONFIG_MCONSOLE
  35. extern void mconsole_register_dev(struct mc_device *new);
  36. #else
  37. static inline void mconsole_register_dev(struct mc_device *new)
  38. {
  39. }
  40. #endif
  41. #endif
  42. /*
  43. * Overrides for Emacs so that we follow Linus's tabbing style.
  44. * Emacs will notice this stuff at the end of the file and automatically
  45. * adjust the settings for this buffer only. This must remain at the end
  46. * of the file.
  47. * ---------------------------------------------------------------------------
  48. * Local variables:
  49. * c-file-style: "linux"
  50. * End:
  51. */