diff options
author | ambrisko <ambrisko@FreeBSD.org> | 2006-05-05 16:10:45 +0000 |
---|---|---|
committer | ambrisko <ambrisko@FreeBSD.org> | 2006-05-05 16:10:45 +0000 |
commit | 31b22ce0171d5f314ab71ecfdc903cd5b4abff7c (patch) | |
tree | c811b5cf32301e6302a0ae1c83535f7a7e3ba038 /sys/compat/linux/linux_util.h | |
parent | 1075788769bc1869a86b8413188a63dca0c3f9ad (diff) | |
download | FreeBSD-src-31b22ce0171d5f314ab71ecfdc903cd5b4abff7c.zip FreeBSD-src-31b22ce0171d5f314ab71ecfdc903cd5b4abff7c.tar.gz |
Enhance the Linux emulation layer to make MegaRAID SAS managements tool happy.
Add back in a scheme to emulate old type major/minor numbers via hooks into
stat, linprocfs to return major/minors that Linux app's expect. Currently
only /dev/null is always registered. Drivers can register via the Linux
type shim similar to the ioctl shim but by using
linux_device_register_handler/linux_device_unregister_handler functions.
The structure is:
struct linux_device_handler {
char *bsd_driver_name;
char *linux_driver_name;
char *bsd_device_name;
char *linux_device_name;
int linux_major;
int linux_minor;
int linux_char_device;
};
Linprocfs uses this to display the major number of the driver. The
soon to be available linsysfs will use it to fill in the driver name.
Linux_stat uses it to translate the major/minor into Linux type values.
Note major numbers are dynamically assigned via passing in a -1 for
the major number so we don't need to keep track of them.
This is somewhat needed due to us switching to our devfs. MegaCli
will not run until I add in the linsysfs and mfi Linux compat changes.
Sponsored by: IronPort Systems
Diffstat (limited to 'sys/compat/linux/linux_util.h')
-rw-r--r-- | sys/compat/linux/linux_util.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_util.h b/sys/compat/linux/linux_util.h index 49a535d..b2711f8 100644 --- a/sys/compat/linux/linux_util.h +++ b/sys/compat/linux/linux_util.h @@ -110,4 +110,21 @@ struct __hack void linux_msg(const struct thread *td, const char *fmt, ...) __printflike(2, 3); +struct linux_device_handler { + char *bsd_driver_name; + char *linux_driver_name; + char *bsd_device_name; + char *linux_device_name; + int linux_major; + int linux_minor; + int linux_char_device; +}; + +int linux_device_register_handler(struct linux_device_handler *h); +int linux_device_unregister_handler(struct linux_device_handler *h); +char *linux_driver_get_name_dev(device_t dev); +int linux_driver_get_major_minor(char *node, int *major, int *minor); +char *linux_get_char_devices(void); +void linux_free_get_char_devices(char *string); + #endif /* !_LINUX_UTIL_H_ */ |