Index: head/sys/dev/aac/aac.c =================================================================== --- head/sys/dev/aac/aac.c +++ head/sys/dev/aac/aac.c @@ -38,6 +38,7 @@ #define AAC_DRIVERNAME "aac" #include "opt_aac.h" +#include "opt_compat.h" /* #include */ #include @@ -45,7 +46,9 @@ #include #include #include +#include #include +#include #include #include @@ -3521,7 +3524,19 @@ fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - if ((error = copyin(arg, &agf, sizeof(agf))) == 0) { +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) { + struct get_adapter_fib_ioctl32 agf32; + error = copyin(arg, &agf32, sizeof(agf32)); + if (error == 0) { + agf.AdapterFibContext = agf32.AdapterFibContext; + agf.Wait = agf32.Wait; + agf.AifFib = (caddr_t)(uintptr_t)agf32.AifFib; + } + } else +#endif + error = copyin(arg, &agf, sizeof(agf)); + if (error == 0) { for (ctx = sc->fibctx; ctx; ctx = ctx->next) { if (agf.AdapterFibContext == ctx->unique) break; Index: head/sys/dev/aacraid/aacraid.c =================================================================== --- head/sys/dev/aacraid/aacraid.c +++ head/sys/dev/aacraid/aacraid.c @@ -39,6 +39,7 @@ #define AAC_DRIVERNAME "aacraid" #include "opt_aacraid.h" +#include "opt_compat.h" /* #include */ #include @@ -46,7 +47,9 @@ #include #include #include +#include #include +#include #include #include @@ -3381,7 +3384,19 @@ fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); mtx_lock(&sc->aac_io_lock); - if ((error = copyin(arg, &agf, sizeof(agf))) == 0) { +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) { + struct get_adapter_fib_ioctl32 agf32; + error = copyin(arg, &agf32, sizeof(agf32)); + if (error == 0) { + agf.AdapterFibContext = agf32.AdapterFibContext; + agf.Wait = agf32.Wait; + agf.AifFib = (caddr_t)(uintptr_t)agf32.AifFib; + } + } else +#endif + error = copyin(arg, &agf, sizeof(agf)); + if (error == 0) { for (ctx = sc->fibctx; ctx; ctx = ctx->next) { if (agf.AdapterFibContext == ctx->unique) break; Index: head/sys/modules/aac/Makefile =================================================================== --- head/sys/modules/aac/Makefile +++ head/sys/modules/aac/Makefile @@ -8,7 +8,7 @@ KMOD= aac SRCS= aac.c aac_pci.c aac_disk.c aac_cam.c -SRCS+= opt_scsi.h opt_cam.h opt_aac.h +SRCS+= opt_scsi.h opt_cam.h opt_compat.h opt_aac.h SRCS+= device_if.h bus_if.h pci_if.h # To enable debug output from the driver, uncomment these two lines. Index: head/sys/modules/aacraid/Makefile =================================================================== --- head/sys/modules/aacraid/Makefile +++ head/sys/modules/aacraid/Makefile @@ -8,7 +8,7 @@ KMOD= aacraid SRCS= aacraid.c aacraid_pci.c aacraid_cam.c -SRCS+= opt_scsi.h opt_cam.h opt_aacraid.h +SRCS+= opt_scsi.h opt_cam.h opt_compat.h opt_aacraid.h SRCS+= device_if.h bus_if.h pci_if.h # To enable debug output from the driver, uncomment these two lines. Index: head/sys/sys/aac_ioctl.h =================================================================== --- head/sys/sys/aac_ioctl.h +++ head/sys/sys/aac_ioctl.h @@ -175,6 +175,14 @@ caddr_t AifFib; }; +#ifdef _KERNEL +struct get_adapter_fib_ioctl32 { + u_int32_t AdapterFibContext; + int Wait; + u_int32_t AifFib; +}; +#endif + struct aac_query_disk { int32_t ContainerNumber; int32_t Bus;