tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Porting Linux SCSI ioctl stuff (was: Re: LTFS) (Emmanuel Dreyfus) writes:

>NetBSD counterpart seems to be SCIOCCOMMAND, which uses a scsireq_t
>defined in <sys/scsiio.h>. I did not try yet to map fields, but I have a
>first problem: LTFS for Linux sets the flag field to
>SG_FLAG_LUN_INHIBIT, which is defined in Linux header with the following
>comment "default is to put device's lun into the 2nd byte of SCSI
>command". How is that expressed using NetBSD SCIOCCOMMAND?

scsi commands take a 3 bit LUN identifier in byte 2. By default Linux
fills it in, depending on the device you access. The flag tells it to
not modify byte 2.

NetBSD doesn't really support LUNs, so you cannot tell it to
not handle them automatically.

>2) SCSI_IOCTL_GET_IDLUN, "Used to obtain PUN and LUN info.". It is
>documented here:

There is a SCIOCIDENTIFY which does something similar.

>3) SG_GET_RESERVED_SIZE / SG_SET_RESERVED_SIZE, which are defined here:
>It seems this one is about ensuring kernel buffers are big enough for
>I/O. I have not found NetBSD's way of dealing with this feature.

This has no meaning to NetBSD. SCIOCCOMMAND takes data from user space.
There is no need to reserve space in the kernel to buffer that data.

Home | Main Index | Thread Index | Old Index