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