summaryrefslogtreecommitdiffstats
path: root/sys/dev/mpr/mpr_sas.h
diff options
context:
space:
mode:
authorslm <slm@FreeBSD.org>2015-05-28 18:24:22 +0000
committerslm <slm@FreeBSD.org>2015-05-28 18:24:22 +0000
commit05c1c03afa71dc36b5fb0718cbb68399a0e0e9a7 (patch)
tree3ebe0f956c8dd657f2b9e1d906b2b1b5bd78fc7e /sys/dev/mpr/mpr_sas.h
parente30be399be1d292717acb645781b1ca75dbb525f (diff)
downloadFreeBSD-src-05c1c03afa71dc36b5fb0718cbb68399a0e0e9a7.zip
FreeBSD-src-05c1c03afa71dc36b5fb0718cbb68399a0e0e9a7.tar.gz
The wrong commit message was given with r283632. This is the correct message.
- Updated all files with 2015 Avago copyright, and updated LSI's copyright dates. - Changed all of the PCI device strings from LSI to Avago Technologies (LSI). - Added a sysctl variable to control how StartStopUnit behavior works. User can select to spin down disks based on if disk is SSD or HDD. - Inquiry data is required to tell if a disk will support SSU at shutdown or not. Due to the addition of mpssas_async, which gets Advanced Info but not Inquiry data, the setting of supports_SSU was moved to the mpssas_scsiio_complete function, which snoops for any Inquiry commands. And, since disks are shutdown as a target and not a LUN, this process was simplified by basing it on targets and not LUNs. - Added a sysctl variable that sets the amount of time to retry after sending a failed SATA ID command. This helps with some bad disks and large disks that require a lot of time to spin up. Part of this change was to add a callout to handle timeouts with the SATA ID command. The callout function is called mpssas_ata_id_timeout(). (Fixes PR 191348) - Changed the way resets work by allowing I/O to continue to devices that are not currently under a reset condition. This uses devq's instead of simq's and makes use of the MPSSAS_TARGET_INRESET flag. This change also adds a function called mpssas_prepare_tm(). - Some changes were made to reduce code duplication when getting a SAS address for a SATA disk. - Fixed some formatting and whitespace. - Bump version of mps driver to 9.255.01.00-fbsd PR: 191348 Reviewed by: ken, scottl Approved by: ken, scottl MFC after: 1 week
Diffstat (limited to 'sys/dev/mpr/mpr_sas.h')
-rw-r--r--sys/dev/mpr/mpr_sas.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/sys/dev/mpr/mpr_sas.h b/sys/dev/mpr/mpr_sas.h
index 9d3116a..ebeed30 100644
--- a/sys/dev/mpr/mpr_sas.h
+++ b/sys/dev/mpr/mpr_sas.h
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2011-2014 LSI Corp.
+ * Copyright (c) 2011-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
@@ -35,7 +36,6 @@ struct mprsas_lun {
lun_id_t lun_id;
uint8_t eedp_formatted;
uint32_t eedp_block_size;
- uint8_t stop_at_shutdown;
};
struct mprsas_target {
@@ -55,11 +55,10 @@ struct mprsas_target {
#define MPRSAS_TARGET_INREMOVAL (1 << 3)
#define MPR_TARGET_FLAGS_RAID_COMPONENT (1 << 4)
#define MPR_TARGET_FLAGS_VOLUME (1 << 5)
+#define MPR_TARGET_IS_SATA_SSD (1 << 6)
#define MPRSAS_TARGET_INRECOVERY (MPRSAS_TARGET_INABORT | \
MPRSAS_TARGET_INRESET | MPRSAS_TARGET_INCHIPRESET)
-#define MPRSAS_TARGET_ADD (1 << 29)
-#define MPRSAS_TARGET_REMOVE (1 << 30)
uint16_t tid;
SLIST_HEAD(, mprsas_lun) luns;
TAILQ_HEAD(, mpr_command) commands;
@@ -82,6 +81,8 @@ struct mprsas_target {
unsigned int logical_unit_resets;
unsigned int target_resets;
uint8_t scsi_req_desc_type;
+ uint8_t stop_at_shutdown;
+ uint8_t supports_SSU;
};
struct mprsas_softc {
@@ -92,7 +93,6 @@ struct mprsas_softc {
#define MPRSAS_DISCOVERY_TIMEOUT_PENDING (1 << 2)
#define MPRSAS_QUEUE_FROZEN (1 << 3)
#define MPRSAS_SHUTDOWN (1 << 4)
-#define MPRSAS_SCANTHREAD (1 << 5)
u_int maxtargets;
struct mprsas_target *targets;
struct cam_devq *devq;
@@ -103,7 +103,6 @@ struct mprsas_softc {
struct mpr_event_handle *mprsas_eh;
u_int startup_refcount;
- u_int tm_count;
struct proc *sysctl_proc;
struct taskqueue *ev_tq;
@@ -150,6 +149,19 @@ mprsas_set_lun(uint8_t *lun, u_int ccblun)
return (0);
}
+static __inline void
+mprsas_set_ccbstatus(union ccb *ccb, int status)
+{
+ ccb->ccb_h.status &= ~CAM_STATUS_MASK;
+ ccb->ccb_h.status |= status;
+}
+
+static __inline int
+mprsas_get_ccbstatus(union ccb *ccb)
+{
+ return (ccb->ccb_h.status & CAM_STATUS_MASK);
+}
+
#define MPR_SET_SINGLE_LUN(req, lun) \
do { \
bzero((req)->LUN, 8); \
@@ -158,11 +170,10 @@ do { \
void mprsas_rescan_target(struct mpr_softc *sc, struct mprsas_target *targ);
void mprsas_discovery_end(struct mprsas_softc *sassc);
+void mprsas_prepare_for_tm(struct mpr_softc *sc, struct mpr_command *tm,
+ struct mprsas_target *target, lun_id_t lun_id);
void mprsas_startup_increment(struct mprsas_softc *sassc);
void mprsas_startup_decrement(struct mprsas_softc *sassc);
-void mprsas_release_simq_reinit(struct mprsas_softc *sassc);
-struct mpr_command * mprsas_alloc_tm(struct mpr_softc *sc);
-void mprsas_free_tm(struct mpr_softc *sc, struct mpr_command *tm);
void mprsas_firmware_event_work(void *arg, int pending);
int mprsas_check_id(struct mprsas_softc *sassc, int id);
OpenPOWER on IntegriCloud