From ae6dc5415bf4a931da56ce38d9e740a29b2ed190 Mon Sep 17 00:00:00 2001 From: ken Date: Mon, 5 May 2014 19:53:03 +0000 Subject: [PATCH] Adjust #if statements inside mprsas_send_smpcmd() to more accurately reflect when unmapped I/O support was added. For FreeBSD 10, it arrived just prior to __FreeBSD_version 1000028. For FreeBSD 9, it arrived just prior to __FreeBSD_version 902001. Also, fix compiler warnings in mprsas_send_smpcmd() that happen in the i386 PAE build for non-unmapped I/O builds. These were fixed in mps(4) in revision 241145, but didn't make it into the mpr(4) driver. This change should only affect FreeBSD versions outside the above revisions, and thus doesn't affect head. MFC after: 3 days Sponsored by: Spectra Logic Corporation --- sys/dev/mpr/mpr_sas.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c index 55bde0e3b531..b63f0672dacf 100644 --- a/sys/dev/mpr/mpr_sas.c +++ b/sys/dev/mpr/mpr_sas.c @@ -2501,7 +2501,8 @@ mprsas_send_smpcmd(struct mprsas_softc *sassc, union ccb *ccb, sg = NULL; error = 0; -#if __FreeBSD_version >= 1000029 +#if (__FreeBSD_version >= 1000028) || \ + ((__FreeBSD_version >= 902001) && (__FreeBSD_version < 1000000)) switch (ccb->ccb_h.flags & CAM_DATA_MASK) { case CAM_DATA_PADDR: case CAM_DATA_SG_PADDR: @@ -2561,7 +2562,7 @@ mprsas_send_smpcmd(struct mprsas_softc *sassc, union ccb *ccb, xpt_done(ccb); return; } -#else //__FreeBSD_version < 1000029 +#else /* __FreeBSD_version < 1000028 */ /* * XXX We don't yet support physical addresses here. */ @@ -2604,7 +2605,7 @@ mprsas_send_smpcmd(struct mprsas_softc *sassc, union ccb *ccb, bus_dma_segment_t *req_sg; req_sg = (bus_dma_segment_t *)ccb->smpio.smp_request; - request = (uint8_t *)req_sg[0].ds_addr; + request = (uint8_t *)(uintptr_t)req_sg[0].ds_addr; } else request = ccb->smpio.smp_request; @@ -2612,14 +2613,14 @@ mprsas_send_smpcmd(struct mprsas_softc *sassc, union ccb *ccb, bus_dma_segment_t *rsp_sg; rsp_sg = (bus_dma_segment_t *)ccb->smpio.smp_response; - response = (uint8_t *)rsp_sg[0].ds_addr; + response = (uint8_t *)(uintptr_t)rsp_sg[0].ds_addr; } else response = ccb->smpio.smp_response; } else { request = ccb->smpio.smp_request; response = ccb->smpio.smp_response; } -#endif //__FreeBSD_version >= 1000029 +#endif /* __FreeBSD_version < 1000028 */ cm = mpr_alloc_command(sc); if (cm == NULL) {