[Midnightbsd-cvs] src: dev/aic7xxx: fix for midnightbsd

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Mar 15 10:24:22 EDT 2009


Log Message:
-----------
fix for midnightbsd

Modified Files:
--------------
    src/sys/dev/aic7xxx:
        aic79xx.c (r1.3 -> r1.4)
        aic79xx_osm.h (r1.3 -> r1.4)
        aic7xxx.c (r1.3 -> r1.4)
        aic7xxx_osm.h (r1.3 -> r1.4)
        aic_osm_lib.c (r1.3 -> r1.4)
        aic_osm_lib.h (r1.3 -> r1.4)

-------------- next part --------------
Index: aic_osm_lib.c
===================================================================
RCS file: /home/cvs/src/sys/dev/aic7xxx/aic_osm_lib.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -L sys/dev/aic7xxx/aic_osm_lib.c -L sys/dev/aic7xxx/aic_osm_lib.c -u -r1.3 -r1.4
--- sys/dev/aic7xxx/aic_osm_lib.c
+++ sys/dev/aic7xxx/aic_osm_lib.c
@@ -29,11 +29,12 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
+ * $MidnightBSD$
  * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic_osm_lib.c#5 $
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic_osm_lib.c,v 1.6 2007/07/31 20:11:03 scottl Exp $");
+/* $FreeBSD: src/sys/dev/aic7xxx/aic_osm_lib.c,v 1.6 2007/07/31 20:11:03 scottl Exp $ */
 
 static void	aic_recovery_thread(void *arg);
 
@@ -131,23 +132,6 @@
 void
 aic_calc_geometry(struct ccb_calc_geometry *ccg, int extended)
 {
-#if __FreeBSD_version >= 500000
 	cam_calc_geometry(ccg, extended);
-#else
-	uint32_t size_mb;
-	uint32_t secs_per_cylinder;
-
-	size_mb = ccg->volume_size / ((1024L * 1024L) / ccg->block_size);
-	if (size_mb > 1024 && extended) {
-		ccg->heads = 255;
-		ccg->secs_per_track = 63;
-	} else {
-		ccg->heads = 64;
-		ccg->secs_per_track = 32;
-	}
-	secs_per_cylinder = ccg->heads * ccg->secs_per_track;
-	ccg->cylinders = ccg->volume_size / secs_per_cylinder;
-	ccg->ccb_h.status = CAM_REQ_CMP;
-#endif
 }
 
Index: aic79xx_osm.h
===================================================================
RCS file: /home/cvs/src/sys/dev/aic7xxx/aic79xx_osm.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -L sys/dev/aic7xxx/aic79xx_osm.h -L sys/dev/aic7xxx/aic79xx_osm.h -u -r1.3 -r1.4
--- sys/dev/aic7xxx/aic79xx_osm.h
+++ sys/dev/aic7xxx/aic79xx_osm.h
@@ -32,6 +32,7 @@
  *
  * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic79xx_osm.h#23 $
  *
+ * $MidnightBSD$
  * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_osm.h,v 1.21 2007/04/17 06:26:24 scottl Exp $
  */
 
@@ -43,9 +44,7 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>		/* For device_t */
-#if __FreeBSD_version >= 500000
 #include <sys/endian.h>
-#endif
 #include <sys/eventhandler.h>
 #include <sys/kernel.h>
 #include <sys/malloc.h>
@@ -59,13 +58,8 @@
 
 #include <sys/rman.h>
 
-#if __FreeBSD_version >= 500000
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
-#else
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-#endif
 
 #include <cam/cam.h>
 #include <cam/cam_ccb.h>
Index: aic7xxx_osm.h
===================================================================
RCS file: /home/cvs/src/sys/dev/aic7xxx/aic7xxx_osm.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -L sys/dev/aic7xxx/aic7xxx_osm.h -L sys/dev/aic7xxx/aic7xxx_osm.h -u -r1.3 -r1.4
--- sys/dev/aic7xxx/aic7xxx_osm.h
+++ sys/dev/aic7xxx/aic7xxx_osm.h
@@ -31,6 +31,7 @@
  *
  * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic7xxx_osm.h#18 $
  *
+ * $MidnightBSD$
  * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_osm.h,v 1.33 2007/04/17 06:26:25 scottl Exp $
  */
 
@@ -42,20 +43,14 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>		/* For device_t */
-#if __FreeBSD_version >= 500000
 #include <sys/endian.h>
-#endif
 #include <sys/eventhandler.h>
 #include <sys/kernel.h>
 #include <sys/malloc.h>
 #include <sys/module.h>
 #include <sys/queue.h>
 
-#if __FreeBSD_version < 500000
-#include <pci.h>
-#else
 #define NPCI 1
-#endif
 
 #if NPCI > 0
 #define AIC_PCI_CONFIG 1
@@ -67,13 +62,8 @@
 #include <sys/rman.h>
 
 #if NPCI > 0
-#if __FreeBSD_version >= 500000
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
-#else
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-#endif
 #endif
 
 #include <cam/cam.h>
Index: aic79xx.c
===================================================================
RCS file: /home/cvs/src/sys/dev/aic7xxx/aic79xx.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -L sys/dev/aic7xxx/aic79xx.c -L sys/dev/aic7xxx/aic79xx.c -u -r1.3 -r1.4
--- sys/dev/aic7xxx/aic79xx.c
+++ sys/dev/aic7xxx/aic79xx.c
@@ -37,6 +37,8 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
+ * $MidnightBSD$
+ * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.c,v 1.40 2007/04/19 18:53:52 scottl Exp $
  * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#246 $
  */
 
@@ -46,7 +48,6 @@
 #include "aicasm/aicasm_insformat.h"
 #else
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic79xx.c,v 1.40 2007/04/19 18:53:52 scottl Exp $");
 #include <dev/aic7xxx/aic79xx_osm.h>
 #include <dev/aic7xxx/aic79xx_inline.h>
 #include <dev/aic7xxx/aicasm/aicasm_insformat.h>
@@ -2234,7 +2235,6 @@
 			printerror = 0;
 		} else if (ahd_sent_msg(ahd, AHDMSG_1B,
 					MSG_BUS_DEV_RESET, TRUE)) {
-#ifdef __FreeBSD__
 			/*
 			 * Don't mark the user's request for this BDR
 			 * as completing with CAM_BDR_SENT.  CAM3
@@ -2246,7 +2246,6 @@
 					  CAM_LUN_WILDCARD, SCB_LIST_NULL,
 					  ROLE_INITIATOR))
 				aic_set_transaction_status(scb, CAM_REQ_CMP);
-#endif
 			ahd_handle_devreset(ahd, &devinfo, CAM_LUN_WILDCARD,
 					    CAM_BDR_SENT, "Bus Device Reset",
 					    /*verbose_level*/0);
@@ -5225,23 +5224,11 @@
 {
 	struct  ahd_softc *ahd;
 
-#ifndef	__FreeBSD__
-	ahd = malloc(sizeof(*ahd), M_DEVBUF, M_NOWAIT);
-	if (!ahd) {
-		printf("aic7xxx: cannot malloc softc!\n");
-		free(name, M_DEVBUF);
-		return NULL;
-	}
-#else
 	ahd = device_get_softc((device_t)platform_arg);
-#endif
 	memset(ahd, 0, sizeof(*ahd));
 	ahd->seep_config = malloc(sizeof(*ahd->seep_config),
 				  M_DEVBUF, M_NOWAIT);
 	if (ahd->seep_config == NULL) {
-#ifndef	__FreeBSD__
-		free(ahd, M_DEVBUF);
-#endif
 		free(name, M_DEVBUF);
 		return (NULL);
 	}
@@ -5427,9 +5414,6 @@
 		free(ahd->seep_config, M_DEVBUF);
 	if (ahd->saved_stack != NULL)
 		free(ahd->saved_stack, M_DEVBUF);
-#ifndef __FreeBSD__
-	free(ahd, M_DEVBUF);
-#endif
 	return;
 }
 
Index: aic7xxx.c
===================================================================
RCS file: /home/cvs/src/sys/dev/aic7xxx/aic7xxx.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -L sys/dev/aic7xxx/aic7xxx.c -L sys/dev/aic7xxx/aic7xxx.c -u -r1.3 -r1.4
--- sys/dev/aic7xxx/aic7xxx.c
+++ sys/dev/aic7xxx/aic7xxx.c
@@ -37,6 +37,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
+ * $MidnightBSD$
  * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#155 $
  */
 
@@ -46,7 +47,7 @@
 #include "aicasm/aicasm_insformat.h"
 #else
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.112 2007/07/31 20:11:02 scottl Exp $");
+/* $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.112 2007/07/31 20:11:02 scottl Exp $ */
 #include <dev/aic7xxx/aic7xxx_osm.h>
 #include <dev/aic7xxx/aic7xxx_inline.h>
 #include <dev/aic7xxx/aicasm/aicasm_insformat.h>
@@ -1280,7 +1281,6 @@
 				printerror = 0;
 			} else if (ahc_sent_msg(ahc, AHCMSG_1B,
 						MSG_BUS_DEV_RESET, TRUE)) {
-#ifdef __FreeBSD__
 				/*
 				 * Don't mark the user's request for this BDR
 				 * as completing with CAM_BDR_SENT.  CAM3
@@ -1294,7 +1294,6 @@
 						  ROLE_INITIATOR)) {
 					aic_set_transaction_status(scb, CAM_REQ_CMP);
 				}
-#endif
 				ahc_compile_devinfo(&devinfo,
 						    initiator_role_id,
 						    target,
@@ -3903,23 +3902,11 @@
 	struct  ahc_softc *ahc;
 	int	i;
 
-#ifndef	__FreeBSD__
-	ahc = malloc(sizeof(*ahc), M_DEVBUF, M_NOWAIT);
-	if (!ahc) {
-		printf("aic7xxx: cannot malloc softc!\n");
-		free(name, M_DEVBUF);
-		return NULL;
-	}
-#else
 	ahc = device_get_softc((device_t)platform_arg);
-#endif
 	memset(ahc, 0, sizeof(*ahc));
 	ahc->seep_config = malloc(sizeof(*ahc->seep_config),
 				  M_DEVBUF, M_NOWAIT);
 	if (ahc->seep_config == NULL) {
-#ifndef	__FreeBSD__
-		free(ahc, M_DEVBUF);
-#endif
 		free(name, M_DEVBUF);
 		return (NULL);
 	}
@@ -4112,9 +4099,6 @@
 		free(ahc->name, M_DEVBUF);
 	if (ahc->seep_config != NULL)
 		free(ahc->seep_config, M_DEVBUF);
-#ifndef __FreeBSD__
-	free(ahc, M_DEVBUF);
-#endif
 	return;
 }
 
Index: aic_osm_lib.h
===================================================================
RCS file: /home/cvs/src/sys/dev/aic7xxx/aic_osm_lib.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -L sys/dev/aic7xxx/aic_osm_lib.h -L sys/dev/aic7xxx/aic_osm_lib.h -u -r1.3 -r1.4
--- sys/dev/aic7xxx/aic_osm_lib.h
+++ sys/dev/aic7xxx/aic_osm_lib.h
@@ -32,13 +32,12 @@
  *
  * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic_osm_lib.h#5 $
  *
+ * $MidnightBSD$
  * $FreeBSD: src/sys/dev/aic7xxx/aic_osm_lib.h,v 1.6 2007/04/17 06:26:25 scottl Exp $
  */
 
 /******************************** OS Includes *********************************/
-#if __FreeBSD_version >= 500000
 #include <sys/mutex.h>
-#endif
 
 /*************************** Library Symbol Mapping ***************************/
 #define	AIC_LIB_ENTRY_CONCAT(x, prefix)	prefix ## x
@@ -71,7 +70,6 @@
 #define	AIC_SHUTDOWN_RECOVERY		AIC_CONST_ENTRY(_SHUTDOWN_RECOVERY)
 
 /********************************* Byte Order *********************************/
-#if __FreeBSD_version >= 500000
 #define aic_htobe16(x) htobe16(x)
 #define aic_htobe32(x) htobe32(x)
 #define aic_htobe64(x) htobe64(x)
@@ -85,21 +83,6 @@
 #define aic_le16toh(x) le16toh(x)
 #define aic_le32toh(x) le32toh(x)
 #define aic_le64toh(x) le64toh(x)
-#else
-#define aic_htobe16(x) (x)
-#define aic_htobe32(x) (x)
-#define aic_htobe64(x) (x)
-#define aic_htole16(x) (x)
-#define aic_htole32(x) (x)
-#define aic_htole64(x) (x)
-
-#define aic_be16toh(x) (x)
-#define aic_be32toh(x) (x)
-#define aic_be64toh(x) (x)
-#define aic_le16toh(x) (x)
-#define aic_le32toh(x) (x)
-#define aic_le64toh(x) (x)
-#endif
 
 /************************* Forward Declarations *******************************/
 typedef device_t aic_dev_softc_t;
@@ -125,17 +108,11 @@
 }
 
 /****************************** Kernel Threads ********************************/
-#if __FreeBSD_version > 500005
 #define	aic_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \
 	kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg)
-#else
-#define	aic_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \
-	kthread_create(func, farg, proc_ptr, fmtstr, arg)
-#endif
 
 /******************************* Bus Space/DMA ********************************/
 
-#if __FreeBSD_version >= 501102
 #define aic_dma_tag_create(aic, parent_tag, alignment, boundary,	\
 			   lowaddr, highaddr, filter, filterarg,	\
 			   maxsize, nsegments, maxsegsz, flags,		\
@@ -145,16 +122,6 @@
 			   maxsize, nsegments, maxsegsz, flags,		\
 			   busdma_lock_mutex, &aic->platform_data->mtx,			\
 			   dma_tagp)
-#else
-#define aic_dma_tag_create(aic, parent_tag, alignment, boundary,	\
-			   lowaddr, highaddr, filter, filterarg,	\
-			   maxsize, nsegments, maxsegsz, flags,		\
-			   dma_tagp)					\
-	bus_dma_tag_create(parent_tag, alignment, boundary,		\
-			   lowaddr, highaddr, filter, filterarg,	\
-			   maxsize, nsegments, maxsegsz, flags,		\
-			   dma_tagp)
-#endif
 
 #define aic_dma_tag_destroy(aic, tag)					\
 	bus_dma_tag_destroy(tag)
@@ -186,11 +153,7 @@
 #include AIC_CORE_INCLUDE
 
 /***************************** Timer Facilities *******************************/
-#if __FreeBSD_version >= 500000
 #define aic_timer_init(timer) callout_init(timer, /*mpsafe*/1)
-#else
-#define aic_timer_init callout_init
-#endif
 #define aic_timer_stop callout_stop
 
 static __inline void aic_timer_reset(aic_timer_t *, u_int,


More information about the Midnightbsd-cvs mailing list