Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 May 2014 19:53:03 +0000 (UTC)
From:      "Kenneth D. Merry" <ken@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r265386 - head/sys/dev/mpr
Message-ID:  <201405051953.s45Jr3Ro046866@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ken
Date: Mon May  5 19:53:03 2014
New Revision: 265386
URL: http://svnweb.freebsd.org/changeset/base/265386

Log:
  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

Modified:
  head/sys/dev/mpr/mpr_sas.c

Modified: head/sys/dev/mpr/mpr_sas.c
==============================================================================
--- head/sys/dev/mpr/mpr_sas.c	Mon May  5 19:38:29 2014	(r265385)
+++ head/sys/dev/mpr/mpr_sas.c	Mon May  5 19:53:03 2014	(r265386)
@@ -2501,7 +2501,8 @@ mprsas_send_smpcmd(struct mprsas_softc *
 	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 *
 		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 *
 			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 *
 			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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405051953.s45Jr3Ro046866>