[SCSI] aacraid: add parameter to control FUA and SYNCHRONIZE_CACHE policy

aacraid.cache parameter, Disable Queue Flush commands:
        bit 0 - Disable FUA in WRITE SCSI commands
        bit 1 - Disable SYNCHRONIZE_CACHE SCSI command
        bit 2 - Disable only if Battery not protecting adapter supplied Cache

e.g.: aacraid.cache=7 will disable the FUA and SYNCHRONIZE_CACHE
commands if the adapter has reported that it's cache is battery backed
up.

This parameter permits experimentation with tradeoffs between
performance and caching policy.

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 53d415e..81cdac1 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -849,6 +849,10 @@
 
 	case AifCmdEventNotify:
 		switch (le32_to_cpu(((__le32 *)aifcmd->data)[0])) {
+		case AifEnBatteryEvent:
+			dev->cache_protected =
+				(((__le32 *)aifcmd->data)[1] == cpu_to_le32(3));
+			break;
 		/*
 		 *	Add an Array.
 		 */