aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEric Moore <eric.moore@lsil.com>2006-07-11 19:22:22 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-07-13 09:13:13 -0400
commit786899b013cdf7aeb2aaaf7390c442f02bba24af (patch)
tree5b191f6ab2c7c471c3a57cf053095458caf006da /drivers
parent3bb056eb1df236f3344426860e584a8981486334 (diff)
[SCSI] mptfusion: sas enclosures with smart drive
Adding support for sas enclosures with smart drives. Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/message/fusion/mptbase.h1
-rw-r--r--drivers/message/fusion/mptscsih.c47
2 files changed, 48 insertions, 0 deletions
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index 014e1de0f7cb..ea92a55da4aa 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -363,6 +363,7 @@ typedef struct _VirtDevice {
363#define MPT_TARGET_FLAGS_VALID_56 0x10 363#define MPT_TARGET_FLAGS_VALID_56 0x10
364#define MPT_TARGET_FLAGS_SAF_TE_ISSUED 0x20 364#define MPT_TARGET_FLAGS_SAF_TE_ISSUED 0x20
365#define MPT_TARGET_FLAGS_RAID_COMPONENT 0x40 365#define MPT_TARGET_FLAGS_RAID_COMPONENT 0x40
366#define MPT_TARGET_FLAGS_LED_ON 0x80
366 367
367/* 368/*
368 * /proc/mpt interface 369 * /proc/mpt interface
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 8242b16e3168..c8a9d8e8c5de 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -497,6 +497,34 @@ nextSGEset:
497 return SUCCESS; 497 return SUCCESS;
498} /* mptscsih_AddSGE() */ 498} /* mptscsih_AddSGE() */
499 499
500static void
501mptscsih_issue_sep_command(MPT_ADAPTER *ioc, VirtTarget *vtarget,
502 U32 SlotStatus)
503{
504 MPT_FRAME_HDR *mf;
505 SEPRequest_t *SEPMsg;
506
507 if (ioc->bus_type == FC)
508 return;
509
510 if ((mf = mpt_get_msg_frame(ioc->InternalCtx, ioc)) == NULL) {
511 dfailprintk((MYIOC_s_WARN_FMT "%s: no msg frames!!\n",
512 ioc->name,__FUNCTION__));
513 return;
514 }
515
516 SEPMsg = (SEPRequest_t *)mf;
517 SEPMsg->Function = MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR;
518 SEPMsg->Bus = vtarget->bus_id;
519 SEPMsg->TargetID = vtarget->target_id;
520 SEPMsg->Action = MPI_SEP_REQ_ACTION_WRITE_STATUS;
521 SEPMsg->SlotStatus = SlotStatus;
522 devtverboseprintk((MYIOC_s_WARN_FMT
523 "Sending SEP cmd=%x id=%d bus=%d\n",
524 ioc->name, SlotStatus, SEPMsg->TargetID, SEPMsg->Bus));
525 mpt_put_msg_frame(ioc->DoneCtx, ioc, mf);
526}
527
500/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 528/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
501/* 529/*
502 * mptscsih_io_done - Main SCSI IO callback routine registered to 530 * mptscsih_io_done - Main SCSI IO callback routine registered to
@@ -520,6 +548,8 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
520 SCSIIORequest_t *pScsiReq; 548 SCSIIORequest_t *pScsiReq;
521 SCSIIOReply_t *pScsiReply; 549 SCSIIOReply_t *pScsiReply;
522 u16 req_idx, req_idx_MR; 550 u16 req_idx, req_idx_MR;
551 VirtDevice *vdev;
552 VirtTarget *vtarget;
523 553
524 hd = (MPT_SCSI_HOST *) ioc->sh->hostdata; 554 hd = (MPT_SCSI_HOST *) ioc->sh->hostdata;
525 555
@@ -640,6 +670,16 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
640 670
641 if (hd->sel_timeout[pScsiReq->TargetID] < 0xFFFF) 671 if (hd->sel_timeout[pScsiReq->TargetID] < 0xFFFF)
642 hd->sel_timeout[pScsiReq->TargetID]++; 672 hd->sel_timeout[pScsiReq->TargetID]++;
673
674 vdev = sc->device->hostdata;
675 if (!vdev)
676 break;
677 vtarget = vdev->vtarget;
678 if (vtarget->tflags & MPT_TARGET_FLAGS_LED_ON) {
679 mptscsih_issue_sep_command(ioc, vtarget,
680 MPI_SEP_REQ_SLOTSTATUS_UNCONFIGURED);
681 vtarget->tflags &= ~MPT_TARGET_FLAGS_LED_ON;
682 }
643 break; 683 break;
644 684
645 case MPI_IOCSTATUS_SCSI_TASK_TERMINATED: /* 0x0048 */ 685 case MPI_IOCSTATUS_SCSI_TASK_TERMINATED: /* 0x0048 */
@@ -2401,6 +2441,13 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR
2401 ioc->events[idx].data[1] = (sense_data[13] << 8) || sense_data[12]; 2441 ioc->events[idx].data[1] = (sense_data[13] << 8) || sense_data[12];
2402 2442
2403 ioc->eventContext++; 2443 ioc->eventContext++;
2444 if (hd->ioc->pcidev->vendor ==
2445 PCI_VENDOR_ID_IBM) {
2446 mptscsih_issue_sep_command(hd->ioc,
2447 vdev->vtarget, MPI_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT);
2448 vdev->vtarget->tflags |=
2449 MPT_TARGET_FLAGS_LED_ON;
2450 }
2404 } 2451 }
2405 } 2452 }
2406 } else { 2453 } else {