summaryrefslogtreecommitdiffstats
path: root/sys/dev/hpt27xx/os_bsd.h
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2015-06-26 19:55:01 +0000
committerdelphij <delphij@FreeBSD.org>2015-06-26 19:55:01 +0000
commit5a956cd60ac8db0aa753b4d37c9058d08d572d46 (patch)
tree70c98e96ca1cb54e8c0ccd85d2def3a480a826ff /sys/dev/hpt27xx/os_bsd.h
parent36ff8dde8639f7ffd1e08f8c98fdcca3757cc2f2 (diff)
downloadFreeBSD-src-5a956cd60ac8db0aa753b4d37c9058d08d572d46.zip
FreeBSD-src-5a956cd60ac8db0aa753b4d37c9058d08d572d46.tar.gz
MFC r267386,269611,284730:
Update vendor driver to 1.2.7. This update improves driver reliability and adds support of 4Kn drives and report LUNs command. Many thanks to HighPoint for providing this driver update.
Diffstat (limited to 'sys/dev/hpt27xx/os_bsd.h')
-rw-r--r--sys/dev/hpt27xx/os_bsd.h69
1 files changed, 8 insertions, 61 deletions
diff --git a/sys/dev/hpt27xx/os_bsd.h b/sys/dev/hpt27xx/os_bsd.h
index fd1fe6d..db893e0 100644
--- a/sys/dev/hpt27xx/os_bsd.h
+++ b/sys/dev/hpt27xx/os_bsd.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2011 HighPoint Technologies, Inc.
+ * Copyright (c) 2005-2011 HighPoint Technologies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,12 +38,8 @@
#include <sys/param.h>
#include <sys/types.h>
#include <sys/cons.h>
-#if (__FreeBSD_version >= 500000)
#include <sys/time.h>
#include <sys/systm.h>
-#else
-#include <machine/clock.h> /*to support DELAY function under 4.x BSD versions*/
-#endif
#include <sys/stat.h>
#include <sys/malloc.h>
@@ -51,11 +47,9 @@
#include <sys/libkern.h>
#include <sys/kernel.h>
-#if (__FreeBSD_version >= 500000)
#include <sys/kthread.h>
#include <sys/mutex.h>
#include <sys/module.h>
-#endif
#include <sys/eventhandler.h>
#include <sys/bus.h>
@@ -63,9 +57,7 @@
#include <sys/ioccom.h>
#include <machine/resource.h>
-#if __FreeBSD_version >= 500043
#include <machine/pci_cfgreg.h>
-#endif
#include <machine/bus.h>
#include <machine/stdarg.h>
#include <sys/rman.h>
@@ -73,17 +65,8 @@
#include <vm/vm.h>
#include <vm/pmap.h>
-#if (__FreeBSD_version >= 500000)
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
-#else
-#include <pci/pcivar.h>
-#include <pci/pcireg.h>
-#endif
-
-#if (__FreeBSD_version <= 500043)
-#include <sys/devicestat.h>
-#endif
#include <cam/cam.h>
#include <cam/cam_ccb.h>
@@ -95,10 +78,6 @@
#include <cam/scsi/scsi_all.h>
#include <cam/scsi/scsi_message.h>
-#if (__FreeBSD_version < 500043)
-#include <sys/bus_private.h>
-#endif
-
typedef struct _INQUIRYDATA {
u_char DeviceType : 5;
@@ -174,7 +153,9 @@ typedef struct _os_cmdext {
struct _os_cmdext *next;
union ccb *ccb;
bus_dmamap_t dma_map;
+#if (__FreeBSD_version >= 1000510)
struct callout timeout;
+#endif
SG psg[os_max_sg_descriptors];
}
OS_CMDEXT, *POS_CMDEXT;
@@ -188,20 +169,18 @@ typedef struct _vbus_ext {
struct cam_sim *sim; /* sim for this vbus */
struct cam_path *path; /* peripheral, path, tgt, lun with this vbus */
-#if (__FreeBSD_version >= 500000)
struct mtx lock; /* general purpose lock */
-#else
- int hpt_splx;
-#endif
bus_dma_tag_t io_dmat; /* I/O buffer DMA tag */
POS_CMDEXT cmdext_list;
OSM_TASK *tasks;
struct task worker;
-
+#if (__FreeBSD_version >= 1000510)
struct callout timer;
-
+#else
+ struct callout_handle timer;
+#endif
eventhandler_tag shutdown_eh;
/* the LDM vbus instance continues */
@@ -209,20 +188,9 @@ typedef struct _vbus_ext {
}
VBUS_EXT, *PVBUS_EXT;
-#if __FreeBSD_version >= 500000
#define hpt_lock_vbus(vbus_ext) mtx_lock(&(vbus_ext)->lock)
#define hpt_unlock_vbus(vbus_ext) mtx_unlock(&(vbus_ext)->lock)
#define hpt_assert_vbus_locked(vbus_ext) mtx_assert(&(vbus_ext)->lock, MA_OWNED)
-#else
-static __inline void hpt_lock_vbus(PVBUS_EXT vbus_ext)
-{
- vbus_ext->hpt_splx = splcam();
-}
-static __inline void hpt_unlock_vbus(PVBUS_EXT vbus_ext)
-{
- splx(vbus_ext->hpt_splx);
-}
-#endif
#define HPT_OSM_TIMEOUT (20*hz) /* timeout value for OS commands */
@@ -231,35 +199,14 @@ static __inline void hpt_unlock_vbus(PVBUS_EXT vbus_ext)
#define HPT_SCAN_BUS _IO('H', 1)
-#if __FreeBSD_version >= 501000
+#if __FreeBSD_version < 1000510
#define TASK_ENQUEUE(task) taskqueue_enqueue(taskqueue_swi_giant,(task));
#else
#define TASK_ENQUEUE(task) taskqueue_enqueue(taskqueue_swi,(task));
#endif
-#if __FreeBSD_version >= 500000
static __inline int hpt_sleep(PVBUS_EXT vbus_ext, void *ident, int priority, const char *wmesg, int timo)
{
return msleep(ident, &vbus_ext->lock, priority, wmesg, timo);
}
-#else
-static __inline int hpt_sleep(PVBUS_EXT vbus_ext, void *ident, int priority, const char *wmesg, int timo)
-{
- int retval = 0;
-
- asleep(ident, priority, wmesg, timo);
- hpt_unlock_vbus(vbus_ext);
- retval = await(priority, timo);
- hpt_lock_vbus(vbus_ext);
-
- return retval;
-}
-#endif
-
-#if __FreeBSD_version < 501000
-#define READ_16 0x88
-#define WRITE_16 0x8a
-#define SERVICE_ACTION_IN 0x9e
-#endif
-#define HPT_DEV_MAJOR 200
OpenPOWER on IntegriCloud