mconsole_kern.h 1.2 KB

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