summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorambrisko <ambrisko@FreeBSD.org>2006-05-05 16:10:45 +0000
committerambrisko <ambrisko@FreeBSD.org>2006-05-05 16:10:45 +0000
commit31b22ce0171d5f314ab71ecfdc903cd5b4abff7c (patch)
treec811b5cf32301e6302a0ae1c83535f7a7e3ba038 /sys/i386
parent1075788769bc1869a86b8413188a63dca0c3f9ad (diff)
downloadFreeBSD-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/i386')
-rw-r--r--sys/i386/linux/linux_sysvec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index 0333acb..40e6e48 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -93,6 +93,7 @@ extern int linux_szsigcode;
extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL];
SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler);
+SET_DECLARE(linux_device_handler_set, struct linux_device_handler);
static int linux_fixup(register_t **stack_base,
struct image_params *iparams);
@@ -887,6 +888,7 @@ linux_elf_modevent(module_t mod, int type, void *data)
Elf32_Brandinfo **brandinfo;
int error;
struct linux_ioctl_handler **lihp;
+ struct linux_device_handler **ldhp;
error = 0;
@@ -899,6 +901,8 @@ linux_elf_modevent(module_t mod, int type, void *data)
if (error == 0) {
SET_FOREACH(lihp, linux_ioctl_handler_set)
linux_ioctl_register_handler(*lihp);
+ SET_FOREACH(ldhp, linux_device_handler_set)
+ linux_device_register_handler(*ldhp);
if (bootverbose)
printf("Linux ELF exec handler installed\n");
} else
@@ -918,6 +922,8 @@ linux_elf_modevent(module_t mod, int type, void *data)
if (error == 0) {
SET_FOREACH(lihp, linux_ioctl_handler_set)
linux_ioctl_unregister_handler(*lihp);
+ SET_FOREACH(ldhp, linux_device_handler_set)
+ linux_device_unregister_handler(*ldhp);
if (bootverbose)
printf("Linux ELF exec handler removed\n");
} else
OpenPOWER on IntegriCloud