scsi: aacraid: Added ioctl to trigger IOP/IWBR reset
authorRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Thu, 2 Feb 2017 23:53:34 +0000 (15:53 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 3 Feb 2017 15:35:04 +0000 (10:35 -0500)
Added a new ioctl interface to trigger an IOP or IWBR reset from ioctl.
Primary used by management utility to trigger resets.

Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Signed-off-by: Dave Carroll <David.Carroll@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/aacraid/aacraid.h
drivers/scsi/aacraid/commctrl.c

index 6f465c0bb4d1745bdb718c7a883a8e48a6175f29..4814fba41193a9e121d0ff396962b207cec14183 100644 (file)
@@ -2333,6 +2333,7 @@ struct revision
 #define FSACTL_FORCE_DELETE_DISK               CTL_CODE(2120, METHOD_NEITHER)
 #define FSACTL_GET_CONTAINERS                  2131
 #define FSACTL_SEND_LARGE_FIB                  CTL_CODE(2138, METHOD_BUFFERED)
+#define FSACTL_RESET_IOP                       CTL_CODE(2140, METHOD_BUFFERED)
 /* flags defined for IOP & HW SOFT RESET */
 #define HW_IOP_RESET                           0x01
 #define HW_SOFT_RESET                          0x02
index f98618c94bf03119f36a549752b4d2db1b32cf6a..d8fc6b8980baf2e5c34ade34992f210aae7468b7 100644 (file)
@@ -1011,7 +1011,22 @@ static int aac_get_pci_info(struct aac_dev* dev, void __user *arg)
        }
        return 0;
 }
+struct aac_reset_iop {
+       u8      reset_type;
+};
+
+static int aac_send_reset_adapter(struct aac_dev *dev, void __user *arg)
+{
+       struct aac_reset_iop reset;
+       int retval;
 
+       if (copy_from_user((void *)&reset, arg, sizeof(struct aac_reset_iop)))
+               return -EFAULT;
+
+       retval = aac_reset_adapter(dev, 0, reset.reset_type);
+       return retval;
+
+}
 
 int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg)
 {
@@ -1055,6 +1070,10 @@ int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg)
        case FSACTL_GET_PCI_INFO:
                status = aac_get_pci_info(dev,arg);
                break;
+       case FSACTL_RESET_IOP:
+               status = aac_send_reset_adapter(dev, arg);
+               break;
+
        default:
                status = -ENOTTY;
                break;