/dev/sga (Linux) SCSI Command Stuff

Alexander Leidinger Alexander at Leidinger.net
Tue Apr 3 11:47:56 UTC 2007


Quoting Roman Divacky <rdivacky at freebsd.org> (from Mon, 2 Apr 2007  
23:42:58 +0200):

> On Mon, Apr 02, 2007 at 04:41:35PM -0500, Larry Rosenman wrote:
>> On Mon, 2 Apr 2007, Roman Divacky wrote:
>>
>> >On Mon, Apr 02, 2007 at 03:50:23PM -0500, Larry Rosenman wrote:

>> >>Also, we don't (AFAIK) expose /dev/sga to the linux world through the
>> >>linux-o-lator so I don't even know if what I want is possible.
>> >
>> >hehe.. guess what.. netbsd supports that :) at least partially. so PLEASE
>> >test the netbsd somehow so we know that the netbsd support is sufficient
>> The box is 150+ miles away stuffed in a colo.  It's also my main DNS / Mail
>> /
>> Web server.
>>
>> Sorry, but I don't think I can do that, at least with the scsi drive.
>>
>> I do have a new box coming that will have Seagate SATA drives, and might be
>> able to test that.....
>
> I am in a good mood so I guess I'll port the stuff from netbsd   
> tomorrow. it looks
> very easy. I hope you will test :)

linux_util.c rev. 1.30:
---snip---
   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.
---snip---

I didn't look at the implementation, but this struct looks like an  
translation layer...

Bye,
Alexander.

-- 
BOFH excuse #139:

UBNC (user brain not connected)

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137


More information about the freebsd-emulation mailing list