|
|
1.1 root 1: #ifndef ASSIGN_H
2: #define ASSIGN_H
3:
4: /*
5: *-IMPORTS:
6: * <kernel/v_types.h>
7: * major_t
8: * minor_t
9: */
10:
11: #include "devadm.h"
12: #include <kernel/v_types.h>
13:
14:
15: /*
16: * Mapping between internal and external numbers is not simple; what makes it
17: * worse is that because there is a single mapping that has to be the same
18: * for both block and character tables, the construction of the bdevsw [] and
19: * cdevsw [] internal tables is constrained. This is only a problem if
20: * multiple external major numbers are allowed, and each device is only
21: * permitted to have a single internal major number. The interpretation of the
22: * 'M' flag in this circumstance is unclear.
23: *
24: * The assign_imajors () code should be able to deal with the most complex
25: * case, which is where multiple external majors may actually be mapped to
26: * multiple internal numbers, thus
27: *
28: * Block external : |-----scsi-------|
29: * Character external: |--tcp--| |-udp-| |ttys|
30: *
31: * Might map 'tcp' to internal 0, 'udp' to internal 1, 'ttys' to internal 2,
32: * while 'scsi' would have 0, 1, and 2 as internal major numbers.
33: *
34: * This is all hypothetical at the moment, since multiple majors are new to
35: * Coherent anyway. For simplicity, we may constrain the above to be an error
36: * by requiring unique internal number for each device. However, the machinery
37: * in assign_imajors () will have to be flexible enough to deal with the
38: * above.
39: *
40: * NOTE: The complex model is only applicable if a device does not care what
41: * minor numbers are given to it, since there is a single shared table used
42: * to map a range of external major numbers into a range of internal minor
43: * numbers. Since this table is shared, it constrains even more heavily the
44: * circumstances in which numbers can overlap. Without a flag to detect when
45: * a driver doesn't care about minor numbers, we simply forget about the
46: * complex model.
47: */
48:
49: struct extinfo {
50: major_t ei_nemajors;
51: major_t * ei_etoimajor;
52: major_t * ei_minoroffset;
53: int ei_ncdevs;
54: mdev_t ** ei_cdevsw;
55: int ei_nbdevs;
56: mdev_t ** ei_bdevsw;
57: int ei_nmodules;
58: mdev_t ** ei_modules;
59: int ei_ncohdrivers;
60: mdev_t ** ei_cohdrivers;
61: };
62:
63:
64: EXTERN_C_BEGIN
65:
66: extinfo_t * assign_imajors PROTO ((void));
67:
68: EXTERN_C_END
69:
70: #endif /* ! defined (ASSIGN_H) */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.