Hi, I received the following error in the kernel log while trying to use the 3Ware command line management utility (tw_cli): ioctl32(tw_cli:10922): Unknown cmd fd(3) cmd(0000001f){00} arg(081892d0) on /dev/twe0 The following patch against 193 adds the missing ioctls and allows the application to work. I'm not sure if this is the proper approach, but it works for all of my testing. Mike --- ia32_ioctl.c 2003-10-03 14:32:09.000000000 -0700 +++ ia32_ioctl.new 2004-02-02 13:42:55.000000000 -0800 @@ -112,7 +112,21 @@ #include <asm/mtrr.h> +/* 3ware Command packet opcodes */ +#define TW_OP_NOP 0x0 +#define TW_OP_INIT_CONNECTION 0x1 +#define TW_OP_READ 0x2 +#define TW_OP_WRITE 0x3 +#define TW_OP_VERIFY 0x4 +#define TW_OP_GET_PARAM 0x12 +#define TW_OP_SET_PARAM 0x13 +#define TW_OP_SECTOR_INFO 0x1a +#define TW_OP_AEN_LISTEN 0x1c +#define TW_OP_FLUSH_CACHE 0x0e +#define TW_CMD_PACKET 0x1d +#define TW_ATA_PASSTHRU 0x1e +#define TW_CMD_PACKET_WITH_DATA 0x1f #define A(__x) ((void *)(unsigned long)(__x)) #define AA(__x) A(__x) @@ -4224,6 +4238,21 @@ COMPATIBLE_IOCTL(NBD_PRINT_DEBUG) COMPATIBLE_IOCTL(NBD_SET_SIZE_BLOCKS) COMPATIBLE_IOCTL(NBD_DISCONNECT) +/* 3ware */ +COMPATIBLE_IOCTL(TW_OP_NOP) +COMPATIBLE_IOCTL(TW_OP_INIT_CONNECTION) +COMPATIBLE_IOCTL(TW_OP_READ) +COMPATIBLE_IOCTL(TW_OP_WRITE) +COMPATIBLE_IOCTL(TW_OP_VERIFY) +COMPATIBLE_IOCTL(TW_OP_GET_PARAM) +COMPATIBLE_IOCTL(TW_OP_SET_PARAM) +COMPATIBLE_IOCTL(TW_OP_SECTOR_INFO) +COMPATIBLE_IOCTL(TW_OP_AEN_LISTEN) +COMPATIBLE_IOCTL(TW_OP_FLUSH_CACHE) +COMPATIBLE_IOCTL(TW_CMD_PACKET) +COMPATIBLE_IOCTL(TW_ATA_PASSTHRU) +COMPATIBLE_IOCTL(TW_CMD_PACKET_WITH_DATA) + /* And these ioctls need translation */ HANDLE_IOCTL(TIOCGDEV, tiocgdev) HANDLE_IOCTL(TIOCGSERIAL, serial_struct_ioctl)
On Wed, 04 Feb 2004 14:12:45 -0800 Michael Madore <mmadore@aslab.com> wrote:
Hi,
I received the following error in the kernel log while trying to use the 3Ware command line management utility (tw_cli):
ioctl32(tw_cli:10922): Unknown cmd fd(3) cmd(0000001f){00} arg(081892d0) on /dev/twe0
The following patch against 193 adds the missing ioctls and allows the application to work. I'm not sure if this is the proper approach, but it works for all of my testing.
The problem is that the 3ware ioctls are broken. The emulation subsystem requires unique ioctl numbers (normally generated using the _IO*() macros using a subsystem ID) but they just used 1,2,3+. It may work for you here and it's fine if you don't have anything else with similarly broken ioctl numbers, but I cannot add this to the main kernel. I hear 3ware are working on a 64bit version of the utility so that may eventually fix it. Also you can use the "3dmd" tool, which uses scsi generic and should work without emulation. -Andi
Andi Kleen wrote:
On Wed, 04 Feb 2004 14:12:45 -0800 Michael Madore <mmadore@aslab.com> wrote:
Hi,
I received the following error in the kernel log while trying to use the 3Ware command line management utility (tw_cli):
ioctl32(tw_cli:10922): Unknown cmd fd(3) cmd(0000001f){00} arg(081892d0) on /dev/twe0
The following patch against 193 adds the missing ioctls and allows the application to work. I'm not sure if this is the proper approach, but it works for all of my testing.
The problem is that the 3ware ioctls are broken. The emulation subsystem requires unique ioctl numbers (normally generated using the _IO*() macros using a subsystem ID) but they just used 1,2,3+. It may work for you here and it's fine if you don't have anything else with similarly broken ioctl numbers, but I cannot add this to the main kernel.
Ok, thanks for the explanation. I was wondering why there where no _IO*() macros in the driver.
I hear 3ware are working on a 64bit version of the utility so that may eventually fix it. Also you can use the "3dmd" tool, which uses scsi generic and should work without emulation.
A 64 bit version would be the best solution. "3dmd" works fine, but it's nice to have a command line tool as well. Mike
On Wed, 04 Feb 2004 14:12:45 -0800 Michael Madore <mmadore@aslab.com> wrote:
Hi,
I received the following error in the kernel log while trying to use the 3Ware command line management utility (tw_cli):
ioctl32(tw_cli:10922): Unknown cmd fd(3) cmd(0000001f){00} arg(081892d0) on /dev/twe0
The following patch against 193 adds the missing ioctls and allows the application to work. I'm not sure if this is the proper approach, but it works for all of my testing.
The problem is that the 3ware ioctls are broken. The emulation subsystem requires unique ioctl numbers (normally generated using the _IO*() macros using a subsystem ID) but they just used 1,2,3+. It may work for you here and it's fine if you don't have anything else with similarly broken ioctl numbers, but I cannot add this to the main kernel. I hear 3ware are working on a 64bit version of the utility so that may eventually fix it. Also you can use the "3dmd" tool, which uses scsi generic and should work without emulation. -Andi
participants (2)
-
Andi Kleen
-
Michael Madore