mpt3sas: Handle active cable exception event

In-order to handle this 'MPI2_EVENT_ACTIVE_CABLE_EXCEPTION' event,
driver need to follow below steps,
1. Unmask the 'MPI2_EVENT_ACTIVE_CABLE_EXCEPTION' event,
so that FW can notify this event to host driver.
2. After receiving this event, add this event to AEN event queue,
for notifying this event to applications.
3. Then Print below message in kernel logs if the event data's reason
code is zero,
"Currently an active cable with ReceptacleID <ID_Value> cannot be powered
and devices connected to this active cable will not be seen. This active
cable requires <PowerValue_in_mW> of power"

This event is only for Intruder/Cutlass HBAs.

Signed-off-by: Chaitra P B <chaitra.basappa@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 93d7c28..b7f4e66 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -655,6 +655,9 @@
 	case MPI2_EVENT_TEMP_THRESHOLD:
 		desc = "Temperature Threshold";
 		break;
+	case MPI2_EVENT_ACTIVE_CABLE_EXCEPTION:
+		desc = "Active cable exception";
+		break;
 	}
 
 	if (!desc)
@@ -5424,6 +5427,8 @@
 	_base_unmask_events(ioc, MPI2_EVENT_IR_OPERATION_STATUS);
 	_base_unmask_events(ioc, MPI2_EVENT_LOG_ENTRY_ADDED);
 	_base_unmask_events(ioc, MPI2_EVENT_TEMP_THRESHOLD);
+	if (ioc->hba_mpi_version_belonged == MPI26_VERSION)
+		_base_unmask_events(ioc, MPI2_EVENT_ACTIVE_CABLE_EXCEPTION);
 
 	r = _base_make_ioc_operational(ioc, CAN_SLEEP);
 	if (r)