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