aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/comminit.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/aacraid/comminit.c')
-rw-r--r--drivers/scsi/aacraid/comminit.c54
1 files changed, 32 insertions, 22 deletions
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
index 8e4b525b1b79..8e5d3be16127 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -58,7 +58,8 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
58 dma_addr_t phys; 58 dma_addr_t phys;
59 unsigned long aac_max_hostphysmempages; 59 unsigned long aac_max_hostphysmempages;
60 60
61 if (dev->comm_interface == AAC_COMM_MESSAGE_TYPE1) 61 if (dev->comm_interface == AAC_COMM_MESSAGE_TYPE1 ||
62 dev->comm_interface == AAC_COMM_MESSAGE_TYPE2)
62 host_rrq_size = (dev->scsi_host_ptr->can_queue 63 host_rrq_size = (dev->scsi_host_ptr->can_queue
63 + AAC_NUM_MGT_FIB) * sizeof(u32); 64 + AAC_NUM_MGT_FIB) * sizeof(u32);
64 size = fibsize + sizeof(struct aac_init) + commsize + 65 size = fibsize + sizeof(struct aac_init) + commsize +
@@ -75,7 +76,8 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
75 dev->comm_phys = phys; 76 dev->comm_phys = phys;
76 dev->comm_size = size; 77 dev->comm_size = size;
77 78
78 if (dev->comm_interface == AAC_COMM_MESSAGE_TYPE1) { 79 if (dev->comm_interface == AAC_COMM_MESSAGE_TYPE1 ||
80 dev->comm_interface == AAC_COMM_MESSAGE_TYPE2) {
79 dev->host_rrq = (u32 *)(base + fibsize); 81 dev->host_rrq = (u32 *)(base + fibsize);
80 dev->host_rrq_pa = phys + fibsize; 82 dev->host_rrq_pa = phys + fibsize;
81 memset(dev->host_rrq, 0, host_rrq_size); 83 memset(dev->host_rrq, 0, host_rrq_size);
@@ -115,26 +117,32 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
115 else 117 else
116 init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES); 118 init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES);
117 119
118 init->InitFlags = 0; 120 init->InitFlags = cpu_to_le32(INITFLAGS_DRIVER_USES_UTC_TIME |
121 INITFLAGS_DRIVER_SUPPORTS_PM);
122 init->MaxIoCommands = cpu_to_le32(dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB);
123 init->MaxIoSize = cpu_to_le32(dev->scsi_host_ptr->max_sectors << 9);
124 init->MaxFibSize = cpu_to_le32(dev->max_fib_size);
125 init->MaxNumAif = cpu_to_le32(dev->max_num_aif);
126
119 if (dev->comm_interface == AAC_COMM_MESSAGE) { 127 if (dev->comm_interface == AAC_COMM_MESSAGE) {
120 init->InitFlags |= cpu_to_le32(INITFLAGS_NEW_COMM_SUPPORTED); 128 init->InitFlags |= cpu_to_le32(INITFLAGS_NEW_COMM_SUPPORTED);
121 dprintk((KERN_WARNING"aacraid: New Comm Interface enabled\n")); 129 dprintk((KERN_WARNING"aacraid: New Comm Interface enabled\n"));
122 } else if (dev->comm_interface == AAC_COMM_MESSAGE_TYPE1) { 130 } else if (dev->comm_interface == AAC_COMM_MESSAGE_TYPE1) {
123 init->InitStructRevision = cpu_to_le32(ADAPTER_INIT_STRUCT_REVISION_6); 131 init->InitStructRevision = cpu_to_le32(ADAPTER_INIT_STRUCT_REVISION_6);
124 init->InitFlags |= cpu_to_le32(INITFLAGS_NEW_COMM_TYPE1_SUPPORTED); 132 init->InitFlags |= cpu_to_le32(INITFLAGS_NEW_COMM_SUPPORTED |
125 dprintk((KERN_WARNING 133 INITFLAGS_NEW_COMM_TYPE1_SUPPORTED | INITFLAGS_FAST_JBOD_SUPPORTED);
126 "aacraid: New Comm Interface type1 enabled\n")); 134 init->HostRRQ_AddrHigh = cpu_to_le32((u32)((u64)dev->host_rrq_pa >> 32));
135 init->HostRRQ_AddrLow = cpu_to_le32((u32)(dev->host_rrq_pa & 0xffffffff));
136 dprintk((KERN_WARNING"aacraid: New Comm Interface type1 enabled\n"));
137 } else if (dev->comm_interface == AAC_COMM_MESSAGE_TYPE2) {
138 init->InitStructRevision = cpu_to_le32(ADAPTER_INIT_STRUCT_REVISION_7);
139 init->InitFlags |= cpu_to_le32(INITFLAGS_NEW_COMM_SUPPORTED |
140 INITFLAGS_NEW_COMM_TYPE2_SUPPORTED | INITFLAGS_FAST_JBOD_SUPPORTED);
141 init->HostRRQ_AddrHigh = cpu_to_le32((u32)((u64)dev->host_rrq_pa >> 32));
142 init->HostRRQ_AddrLow = cpu_to_le32((u32)(dev->host_rrq_pa & 0xffffffff));
143 init->MiniPortRevision = cpu_to_le32(0L); /* number of MSI-X */
144 dprintk((KERN_WARNING"aacraid: New Comm Interface type2 enabled\n"));
127 } 145 }
128 init->InitFlags |= cpu_to_le32(INITFLAGS_DRIVER_USES_UTC_TIME |
129 INITFLAGS_DRIVER_SUPPORTS_PM);
130 init->MaxIoCommands = cpu_to_le32(dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB);
131 init->MaxIoSize = cpu_to_le32(dev->scsi_host_ptr->max_sectors << 9);
132 init->MaxFibSize = cpu_to_le32(dev->max_fib_size);
133
134 init->MaxNumAif = cpu_to_le32(dev->max_num_aif);
135 init->HostRRQ_AddrHigh = cpu_to_le32((u32)((u64)dev->host_rrq_pa >> 32));
136 init->HostRRQ_AddrLow = cpu_to_le32((u32)(dev->host_rrq_pa & 0xffffffff));
137
138 146
139 /* 147 /*
140 * Increment the base address by the amount already used 148 * Increment the base address by the amount already used
@@ -354,13 +362,15 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
354 if ((status[1] & le32_to_cpu(AAC_OPT_NEW_COMM_TYPE1))) { 362 if ((status[1] & le32_to_cpu(AAC_OPT_NEW_COMM_TYPE1))) {
355 /* driver supports TYPE1 (Tupelo) */ 363 /* driver supports TYPE1 (Tupelo) */
356 dev->comm_interface = AAC_COMM_MESSAGE_TYPE1; 364 dev->comm_interface = AAC_COMM_MESSAGE_TYPE1;
365 } else if ((status[1] & le32_to_cpu(AAC_OPT_NEW_COMM_TYPE2))) {
366 /* driver supports TYPE2 (Denali) */
367 dev->comm_interface = AAC_COMM_MESSAGE_TYPE2;
357 } else if ((status[1] & le32_to_cpu(AAC_OPT_NEW_COMM_TYPE4)) || 368 } else if ((status[1] & le32_to_cpu(AAC_OPT_NEW_COMM_TYPE4)) ||
358 (status[1] & le32_to_cpu(AAC_OPT_NEW_COMM_TYPE3)) || 369 (status[1] & le32_to_cpu(AAC_OPT_NEW_COMM_TYPE3))) {
359 (status[1] & le32_to_cpu(AAC_OPT_NEW_COMM_TYPE2))) { 370 /* driver doesn't TYPE3 and TYPE4 */
360 /* driver doesn't support TYPE2 (Series7), TYPE3 and TYPE4 */ 371 /* switch to sync. mode */
361 /* switch to sync. mode */ 372 dev->comm_interface = AAC_COMM_MESSAGE_TYPE2;
362 dev->comm_interface = AAC_COMM_MESSAGE_TYPE1; 373 dev->sync_mode = 1;
363 dev->sync_mode = 1;
364 } 374 }
365 } 375 }
366 if ((dev->comm_interface == AAC_COMM_MESSAGE) && 376 if ((dev->comm_interface == AAC_COMM_MESSAGE) &&