scsi: aacraid: Remove reference to Series-9
authorRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Wed, 10 May 2017 16:39:52 +0000 (09:39 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 13 Jun 2017 00:48:00 +0000 (20:48 -0400)
Remove reference to Series-9 HBA and created arc ctrl check function.

Signed-off-by: Prasad B Munirathnam <prasad.munirathnam@microsemi.com>
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: David Carroll <david.carroll@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/aacraid/aacraid.h
drivers/scsi/aacraid/comminit.c
drivers/scsi/aacraid/commsup.c
drivers/scsi/aacraid/linit.c

index bd0afdd7f2e41a99951ebf048d7e06694734912e..861a35c77c010caae214add1a8221262c0702b47 100644 (file)
@@ -424,7 +424,6 @@ struct aac_ciss_identify_pd {
 #define PMC_DEVICE_S6  0x28b
 #define PMC_DEVICE_S7  0x28c
 #define PMC_DEVICE_S8  0x28d
-#define PMC_DEVICE_S9  0x28f
 
 #define aac_phys_to_logical(x)  ((x)+1)
 #define aac_logical_to_phys(x)  ((x)?(x)-1:0)
@@ -2689,6 +2688,18 @@ int aac_probe_container(struct aac_dev *dev, int cid);
 int _aac_rx_init(struct aac_dev *dev);
 int aac_rx_select_comm(struct aac_dev *dev, int comm);
 int aac_rx_deliver_producer(struct fib * fib);
+
+static inline int aac_is_src(struct aac_dev *dev)
+{
+       u16 device = dev->pdev->device;
+
+       if (device == PMC_DEVICE_S6 ||
+               device == PMC_DEVICE_S7 ||
+               device == PMC_DEVICE_S8)
+               return 1;
+       return 0;
+}
+
 char * get_container_type(unsigned type);
 extern int numacb;
 extern char aac_driver_version[];
index 1151505853cf8c75d27a9335916bfe72f4cccc62..9ee025b1d0e041d4afbdb14667e9b5ea9112e891 100644 (file)
@@ -53,11 +53,8 @@ static inline int aac_is_msix_mode(struct aac_dev *dev)
 {
        u32 status = 0;
 
-       if (dev->pdev->device == PMC_DEVICE_S6 ||
-               dev->pdev->device == PMC_DEVICE_S7 ||
-               dev->pdev->device == PMC_DEVICE_S8) {
+       if (aac_is_src(dev))
                status = src_readl(dev, MUnit.OMR);
-       }
        return (status & AAC_INT_MODE_MSIX);
 }
 
@@ -325,9 +322,7 @@ int aac_send_shutdown(struct aac_dev * dev)
        /* FIB should be freed only after getting the response from the F/W */
        if (status != -ERESTARTSYS)
                aac_fib_free(fibctx);
-       if ((dev->pdev->device == PMC_DEVICE_S7 ||
-            dev->pdev->device == PMC_DEVICE_S8 ||
-            dev->pdev->device == PMC_DEVICE_S9) &&
+       if (aac_is_src(dev) &&
             dev->msi_enabled)
                aac_set_intx_mode(dev);
        return status;
@@ -583,9 +578,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
                dev->max_fib_size = status[1] & 0xFFE0;
                host->sg_tablesize = status[2] >> 16;
                dev->sg_tablesize = status[2] & 0xFFFF;
-               if (dev->pdev->device == PMC_DEVICE_S7 ||
-                   dev->pdev->device == PMC_DEVICE_S8 ||
-                   dev->pdev->device == PMC_DEVICE_S9) {
+               if (aac_is_src(dev)) {
                        if (host->can_queue > (status[3] >> 16) -
                                        AAC_NUM_MGT_FIB)
                                host->can_queue = (status[3] >> 16) -
@@ -604,10 +597,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
                        pr_warn("numacb=%d ignored\n", numacb);
        }
 
-       if (dev->pdev->device == PMC_DEVICE_S6 ||
-           dev->pdev->device == PMC_DEVICE_S7 ||
-           dev->pdev->device == PMC_DEVICE_S8 ||
-           dev->pdev->device == PMC_DEVICE_S9)
+       if (aac_is_src(dev))
                aac_define_int_mode(dev);
        /*
         *      Ok now init the communication subsystem
index 1541ebc1efa263485e2644ede67ff9e3b8d42377..1c617ccfaf12e4d140477c24faf1ca0038317797 100644 (file)
@@ -2591,10 +2591,7 @@ void aac_free_irq(struct aac_dev *dev)
        int cpu;
 
        cpu = cpumask_first(cpu_online_mask);
-       if (dev->pdev->device == PMC_DEVICE_S6 ||
-           dev->pdev->device == PMC_DEVICE_S7 ||
-           dev->pdev->device == PMC_DEVICE_S8 ||
-           dev->pdev->device == PMC_DEVICE_S9) {
+       if (aac_is_src(dev)) {
                if (dev->max_msix > 1) {
                        for (i = 0; i < dev->max_msix; i++)
                                free_irq(pci_irq_vector(dev->pdev, i),
index d933d2f93ed7d11d83e5f548f1e352b869898807..0f277df73af0f6b66d064536627e93b306664502 100644 (file)
@@ -1416,10 +1416,7 @@ static void __aac_shutdown(struct aac_dev * aac)
                kthread_stop(aac->thread);
        }
        aac_adapter_disable_int(aac);
-       if (aac->pdev->device == PMC_DEVICE_S6 ||
-           aac->pdev->device == PMC_DEVICE_S7 ||
-           aac->pdev->device == PMC_DEVICE_S8 ||
-           aac->pdev->device == PMC_DEVICE_S9) {
+       if (aac_is_src(aac)) {
                if (aac->max_msix > 1) {
                        for (i = 0; i < aac->max_msix; i++) {
                                free_irq(pci_irq_vector(aac->pdev, i),
@@ -1684,9 +1681,7 @@ static int aac_acquire_resources(struct aac_dev *dev)
        aac_adapter_enable_int(dev);
 
 
-       if ((dev->pdev->device == PMC_DEVICE_S7 ||
-            dev->pdev->device == PMC_DEVICE_S8 ||
-            dev->pdev->device == PMC_DEVICE_S9))
+       if (aac_is_src(dev))
                aac_define_int_mode(dev);
 
        if (dev->msi_enabled)