diff options
author | ps <ps@FreeBSD.org> | 2005-05-18 05:31:34 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2005-05-18 05:31:34 +0000 |
commit | e04ec83e806222d865bbf9be744c8460bf43e184 (patch) | |
tree | e6987f10e45de5c8fe2409ddad9a8d68e7700d32 /sys | |
parent | dbfc528c1e7eaa7e1f6d285bff1c5a048f62112e (diff) | |
download | FreeBSD-src-e04ec83e806222d865bbf9be744c8460bf43e184.zip FreeBSD-src-e04ec83e806222d865bbf9be744c8460bf43e184.tar.gz |
Support passthru ioctl commands from 32bit binaries.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ciss/ciss.c | 18 | ||||
-rw-r--r-- | sys/dev/ciss/cissio.h | 13 |
2 files changed, 30 insertions, 1 deletions
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index abb31f9..0b23fbf 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -4055,6 +4055,11 @@ static int ciss_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t *p) { struct ciss_softc *sc; + IOCTL_Command_struct *ioc = (IOCTL_Command_struct *)addr; +#ifdef __amd64__ + IOCTL_Command_struct32 *ioc32 = (IOCTL_Command_struct32 *)addr; + IOCTL_Command_struct ioc_swab; +#endif int error; debug_called(1); @@ -4146,8 +4151,19 @@ ciss_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t */ break; +#ifdef __amd64__ + case CCISS_PASSTHRU32: + ioc_swab.LUN_info = ioc32->LUN_info; + ioc_swab.Request = ioc32->Request; + ioc_swab.error_info = ioc32->error_info; + ioc_swab.buf_size = ioc32->buf_size; + ioc_swab.buf = (u_int8_t *)(uintptr_t)ioc32->buf; + ioc = &ioc_swab; + /* FALLTHROUGH */ +#endif + case CCISS_PASSTHRU: - error = ciss_user_command(sc, (IOCTL_Command_struct *)addr); + error = ciss_user_command(sc, ioc); break; default: diff --git a/sys/dev/ciss/cissio.h b/sys/dev/ciss/cissio.h index baf9b88..e05422a 100644 --- a/sys/dev/ciss/cissio.h +++ b/sys/dev/ciss/cissio.h @@ -184,6 +184,16 @@ typedef struct { u_int8_t *buf; /* 4 */ } __packed IOCTL_Command_struct; +#ifdef __amd64__ +typedef struct { + LUNAddr_struct LUN_info; /* 8 */ + RequestBlock_struct Request; /* 20 */ + ErrorInfo_struct error_info; /* 48 */ + u_int16_t buf_size; /* 2 */ + u_int32_t buf; /* 4 */ +} __packed IOCTL_Command_struct32; +#endif + /* * Note that we'd normally pass the struct in directly, but * this code is trying to be compatible with other drivers. @@ -199,5 +209,8 @@ typedef struct { #define CCISS_GETDRIVERVER _IOR ('C', 208, DriverVer_type) #define CCISS_REVALIDVOLS _IO ('C', 209) #define CCISS_PASSTHRU _IOWR ('C', 210, IOCTL_Command_struct) +#ifdef __amd64 +#define CCISS_PASSTHRU32 _IOWR ('C', 210, IOCTL_Command_struct32) +#endif #pragma pack() |