diff options
author | scottl <scottl@FreeBSD.org> | 2007-04-07 19:40:58 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2007-04-07 19:40:58 +0000 |
commit | 1320f9f144d11efc5e2e12e3ab69a5a4559b06fe (patch) | |
tree | f3bff966194b6ef5bf3c76fcbd41adc4ff98caa6 /sys/compat/linux/linux_ioctl.h | |
parent | 9a4581bab30ccb9819a6020d5156ef862a0613f1 (diff) | |
download | FreeBSD-src-1320f9f144d11efc5e2e12e3ab69a5a4559b06fe.zip FreeBSD-src-1320f9f144d11efc5e2e12e3ab69a5a4559b06fe.tar.gz |
Add the CAM 'SG' peripheral device. This device implements a subset of the
Linux SCSI SG passthrough device API. The intention is to allow for both
running of Linux apps that want to talk to /dev/sg* nodes, and to facilitate
porting of apps from Linux to FreeBSD. As such, both native and linuxolator
entry points and definitions are provided.
Caveats:
- This does not support the procfs and sysfs nodes that the Linux SG
driver provides. Some Linux apps may rely on these for operation,
others may only use them for informational purposes.
- More ioctls need to be implemented.
- Linux uses a naming scheme of "sg[a-z]" for devices, while FreeBSD uses a
scheme of "sg[0-9]". Devfs aliasis (symlinks) are automatically created
to link the two together. However, tools like camcontrol only see the
native names.
- Some operations were originally designed to return byte counts or other
data directly as the syscall return value. The linuxolator doesn't appear
to support this well, so this driver just punts for these cases.
Now that the driver is in place, others are welcome to add missing
functionality. Thanks to Roman Divacky for pushing this work along.
Diffstat (limited to 'sys/compat/linux/linux_ioctl.h')
-rw-r--r-- | sys/compat/linux/linux_ioctl.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_ioctl.h b/sys/compat/linux/linux_ioctl.h index 17e5b164..4fc69b2 100644 --- a/sys/compat/linux/linux_ioctl.h +++ b/sys/compat/linux/linux_ioctl.h @@ -103,6 +103,8 @@ #define LINUX_CDROM_DEBUG 0x5330 #define LINUX_CDROM_GET_CAPABILITY 0x5331 #define LINUX_CDROMAUDIOBUFSIZ 0x5382 +#define LINUX_SCSI_GET_IDLUN 0x5382 +#define LINUX_SCSI_GET_BUS_NUMBER 0x5386 #define LINUX_DVD_READ_STRUCT 0x5390 #define LINUX_DVD_WRITE_STRUCT 0x5391 #define LINUX_DVD_AUTH 0x5392 @@ -130,6 +132,38 @@ #define LINUX_DVD_HOST_SEND_RPC_STATE 11 /* + * SG + */ +#define LINUX_SG_SET_TIMEOUT 0x2201 +#define LINUX_SG_GET_TIMEOUT 0x2202 +#define LINUX_SG_EMULATED_HOST 0x2203 +#define LINUX_SG_SET_TRANSFORM 0x2204 +#define LINUX_SG_GET_TRANSFORM 0x2205 +#define LINUX_SG_GET_COMMAND_Q 0x2270 +#define LINUX_SG_SET_COMMAND_Q 0x2271 +#define LINUX_SG_SET_RESERVED_SIZE 0x2275 +#define LINUX_SG_GET_RESERVED_SIZE 0x2272 +#define LINUX_SG_GET_SCSI_ID 0x2276 +#define LINUX_SG_SET_FORCE_LOW_DMA 0x2279 +#define LINUX_SG_GET_LOW_DMA 0x227a +#define LINUX_SG_SET_FORCE_PACK_ID 0x227b +#define LINUX_SG_GET_PACK_ID 0x227c +#define LINUX_SG_GET_NUM_WAITING 0x227d +#define LINUX_SG_SET_DEBUG 0x227e +#define LINUX_SG_GET_SG_TABLESIZE 0x227f +#define LINUX_SG_GET_VERSION_NUM 0x2282 +#define LINUX_SG_NEXT_CMD_LEN 0x2283 +#define LINUX_SG_SCSI_RESET 0x2284 +#define LINUX_SG_IO 0x2285 +#define LINUX_SG_GET_REQUEST_TABLE 0x2286 +#define LINUX_SG_SET_KEEP_ORPHAN 0x2287 +#define LINUX_SG_GET_KEEP_ORPHAN 0x2288 +#define LINUX_SG_GET_ACCESS_COUNT 0x2289 + +#define LINUX_IOCTL_SG_MIN 0x2200 +#define LINUX_IOCTL_SG_MAX 0x22ff + +/* * VFAT */ #define LINUX_VFAT_READDIR_BOTH 0x7201 |