summaryrefslogtreecommitdiffstats
path: root/isys/isys.h
blob: b00ffde5fb744b2840566aa77d559d25ae5512d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef H_ISYS
#define H_ISYS

#define MIN_ROOTPART_SIZE_MB	250

#define MIN_RAM			17000	    /* 20M or so */
#define MIN_GUI_RAM		35000
#define EARLY_SWAP_RAM		34000

enum driverMajor { DRIVER_NONE = 0, DRIVER_SCSI, DRIVER_NET, DRIVER_CDROM,
		   DRIVER_PCMCIA, DRIVER_FS, DRIVER_OTHER = 1000};
enum driverMinor { DRIVER_MINOR_NONE = 0, DRIVER_MINOR_ETHERNET,
		   DRIVER_MINOR_PLIP, DRIVER_MINOR_TR };

struct moduleArg {
    char * arg;
    char * description;
};

#define MI_FLAG_NOMISCARGS	(1 << 0)

struct moduleInfo {
    char * moduleName;
    char * description;
    enum driverMajor major;
    enum driverMinor minor;
    int numArgs;
    struct moduleArg * args;
    int flags;
    void * locationID;
};

struct moduleInfoSet_s {
    struct moduleInfo * moduleList;
    int numModules;
};

typedef struct moduleInfoSet_s * moduleInfoSet;

moduleInfoSet isysNewModuleInfoSet(void);
void isysFreeModuleInfoSet(moduleInfoSet mis);
int isysReadModuleInfo(const char * filename, moduleInfoSet mis, void * path);
struct moduleInfo * isysFindModuleInfo(moduleInfoSet mis, 
				       const char * moduleName);

/* NULL moduleName indicates the end of the list; the list must be freed() */
struct moduleInfo * isysGetModuleList(moduleInfoSet mis, 
				      enum driverMajor major);

/* returns -2 for errno, -1 for unknown device */
int devMakeInode(char * devName, char * path);

int insmod(char * modName, char * path, char ** args);
int rmmod(char * modName);

/* returns 0 for true, !0 for false */
int fileIsIso(const char * file);

#endif