aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptbase.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r--drivers/message/fusion/mptbase.c179
1 files changed, 114 insertions, 65 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 12dd8d493ee2..29d0635cce1d 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -46,7 +46,6 @@
46*/ 46*/
47/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 47/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
48 48
49#include <linux/config.h>
50#include <linux/kernel.h> 49#include <linux/kernel.h>
51#include <linux/module.h> 50#include <linux/module.h>
52#include <linux/errno.h> 51#include <linux/errno.h>
@@ -369,20 +368,21 @@ static irqreturn_t
369mpt_interrupt(int irq, void *bus_id, struct pt_regs *r) 368mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
370{ 369{
371 MPT_ADAPTER *ioc = bus_id; 370 MPT_ADAPTER *ioc = bus_id;
372 u32 pa; 371 u32 pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo);
372
373 if (pa == 0xFFFFFFFF)
374 return IRQ_NONE;
373 375
374 /* 376 /*
375 * Drain the reply FIFO! 377 * Drain the reply FIFO!
376 */ 378 */
377 while (1) { 379 do {
378 pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo); 380 if (pa & MPI_ADDRESS_REPLY_A_BIT)
379 if (pa == 0xFFFFFFFF)
380 return IRQ_HANDLED;
381 else if (pa & MPI_ADDRESS_REPLY_A_BIT)
382 mpt_reply(ioc, pa); 381 mpt_reply(ioc, pa);
383 else 382 else
384 mpt_turbo_reply(ioc, pa); 383 mpt_turbo_reply(ioc, pa);
385 } 384 pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo);
385 } while (pa != 0xFFFFFFFF);
386 386
387 return IRQ_HANDLED; 387 return IRQ_HANDLED;
388} 388}
@@ -436,8 +436,6 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
436 */ 436 */
437 if (pEvReply->MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY) { 437 if (pEvReply->MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY) {
438 freereq = 0; 438 freereq = 0;
439 devtverboseprintk((MYIOC_s_WARN_FMT "EVENT_NOTIFICATION reply %p does not return Request frame\n",
440 ioc->name, pEvReply));
441 } else { 439 } else {
442 devtverboseprintk((MYIOC_s_WARN_FMT "EVENT_NOTIFICATION reply %p returns Request frame\n", 440 devtverboseprintk((MYIOC_s_WARN_FMT "EVENT_NOTIFICATION reply %p returns Request frame\n",
443 ioc->name, pEvReply)); 441 ioc->name, pEvReply));
@@ -678,19 +676,19 @@ int
678mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx) 676mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx)
679{ 677{
680 MPT_ADAPTER *ioc; 678 MPT_ADAPTER *ioc;
679 const struct pci_device_id *id;
681 680
682 if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS) { 681 if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS)
683 return -EINVAL; 682 return -EINVAL;
684 }
685 683
686 MptDeviceDriverHandlers[cb_idx] = dd_cbfunc; 684 MptDeviceDriverHandlers[cb_idx] = dd_cbfunc;
687 685
688 /* call per pci device probe entry point */ 686 /* call per pci device probe entry point */
689 list_for_each_entry(ioc, &ioc_list, list) { 687 list_for_each_entry(ioc, &ioc_list, list) {
690 if(dd_cbfunc->probe) { 688 id = ioc->pcidev->driver ?
691 dd_cbfunc->probe(ioc->pcidev, 689 ioc->pcidev->driver->id_table : NULL;
692 ioc->pcidev->driver->id_table); 690 if (dd_cbfunc->probe)
693 } 691 dd_cbfunc->probe(ioc->pcidev, id);
694 } 692 }
695 693
696 return 0; 694 return 0;
@@ -1056,9 +1054,8 @@ mpt_host_page_alloc(MPT_ADAPTER *ioc, pIOCInit_t ioc_init)
1056 1054
1057 dinitprintk((MYIOC_s_INFO_FMT 1055 dinitprintk((MYIOC_s_INFO_FMT
1058 "host_page_buffer @ %p, dma @ %x, sz=%d bytes\n", 1056 "host_page_buffer @ %p, dma @ %x, sz=%d bytes\n",
1059 ioc->name, 1057 ioc->name, ioc->HostPageBuffer,
1060 ioc->HostPageBuffer, 1058 (u32)ioc->HostPageBuffer_dma,
1061 ioc->HostPageBuffer_dma,
1062 host_page_buffer_sz)); 1059 host_page_buffer_sz));
1063 ioc->alloc_total += host_page_buffer_sz; 1060 ioc->alloc_total += host_page_buffer_sz;
1064 ioc->HostPageBuffer_sz = host_page_buffer_sz; 1061 ioc->HostPageBuffer_sz = host_page_buffer_sz;
@@ -1220,31 +1217,25 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1220 port = psize = 0; 1217 port = psize = 0;
1221 for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) { 1218 for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) {
1222 if (pci_resource_flags(pdev, ii) & PCI_BASE_ADDRESS_SPACE_IO) { 1219 if (pci_resource_flags(pdev, ii) & PCI_BASE_ADDRESS_SPACE_IO) {
1220 if (psize)
1221 continue;
1223 /* Get I/O space! */ 1222 /* Get I/O space! */
1224 port = pci_resource_start(pdev, ii); 1223 port = pci_resource_start(pdev, ii);
1225 psize = pci_resource_len(pdev,ii); 1224 psize = pci_resource_len(pdev,ii);
1226 } else { 1225 } else {
1226 if (msize)
1227 continue;
1227 /* Get memmap */ 1228 /* Get memmap */
1228 mem_phys = pci_resource_start(pdev, ii); 1229 mem_phys = pci_resource_start(pdev, ii);
1229 msize = pci_resource_len(pdev,ii); 1230 msize = pci_resource_len(pdev,ii);
1230 break;
1231 } 1231 }
1232 } 1232 }
1233 ioc->mem_size = msize; 1233 ioc->mem_size = msize;
1234 1234
1235 if (ii == DEVICE_COUNT_RESOURCE) {
1236 printk(KERN_ERR MYNAM ": ERROR - MPT adapter has no memory regions defined!\n");
1237 kfree(ioc);
1238 return -EINVAL;
1239 }
1240
1241 dinitprintk((KERN_INFO MYNAM ": MPT adapter @ %lx, msize=%dd bytes\n", mem_phys, msize));
1242 dinitprintk((KERN_INFO MYNAM ": (port i/o @ %lx, psize=%dd bytes)\n", port, psize));
1243
1244 mem = NULL; 1235 mem = NULL;
1245 /* Get logical ptr for PciMem0 space */ 1236 /* Get logical ptr for PciMem0 space */
1246 /*mem = ioremap(mem_phys, msize);*/ 1237 /*mem = ioremap(mem_phys, msize);*/
1247 mem = ioremap(mem_phys, 0x100); 1238 mem = ioremap(mem_phys, msize);
1248 if (mem == NULL) { 1239 if (mem == NULL) {
1249 printk(KERN_ERR MYNAM ": ERROR - Unable to map adapter memory!\n"); 1240 printk(KERN_ERR MYNAM ": ERROR - Unable to map adapter memory!\n");
1250 kfree(ioc); 1241 kfree(ioc);
@@ -1344,11 +1335,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1344 ioc->bus_type = SAS; 1335 ioc->bus_type = SAS;
1345 ioc->errata_flag_1064 = 1; 1336 ioc->errata_flag_1064 = 1;
1346 } 1337 }
1347 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1066) {
1348 ioc->prod_name = "LSISAS1066";
1349 ioc->bus_type = SAS;
1350 ioc->errata_flag_1064 = 1;
1351 }
1352 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068) { 1338 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068) {
1353 ioc->prod_name = "LSISAS1068"; 1339 ioc->prod_name = "LSISAS1068";
1354 ioc->bus_type = SAS; 1340 ioc->bus_type = SAS;
@@ -1358,14 +1344,14 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1358 ioc->prod_name = "LSISAS1064E"; 1344 ioc->prod_name = "LSISAS1064E";
1359 ioc->bus_type = SAS; 1345 ioc->bus_type = SAS;
1360 } 1346 }
1361 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1066E) {
1362 ioc->prod_name = "LSISAS1066E";
1363 ioc->bus_type = SAS;
1364 }
1365 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068E) { 1347 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068E) {
1366 ioc->prod_name = "LSISAS1068E"; 1348 ioc->prod_name = "LSISAS1068E";
1367 ioc->bus_type = SAS; 1349 ioc->bus_type = SAS;
1368 } 1350 }
1351 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1078) {
1352 ioc->prod_name = "LSISAS1078";
1353 ioc->bus_type = SAS;
1354 }
1369 1355
1370 if (ioc->errata_flag_1064) 1356 if (ioc->errata_flag_1064)
1371 pci_disable_io_access(pdev); 1357 pci_disable_io_access(pdev);
@@ -1391,6 +1377,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1391 printk(KERN_WARNING MYNAM 1377 printk(KERN_WARNING MYNAM
1392 ": WARNING - %s did not initialize properly! (%d)\n", 1378 ": WARNING - %s did not initialize properly! (%d)\n",
1393 ioc->name, r); 1379 ioc->name, r);
1380
1394 list_del(&ioc->list); 1381 list_del(&ioc->list);
1395 if (ioc->alt_ioc) 1382 if (ioc->alt_ioc)
1396 ioc->alt_ioc->alt_ioc = NULL; 1383 ioc->alt_ioc->alt_ioc = NULL;
@@ -1706,7 +1693,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1706 printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n", 1693 printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n",
1707 ioc->name); 1694 ioc->name);
1708 rc = request_irq(ioc->pcidev->irq, mpt_interrupt, 1695 rc = request_irq(ioc->pcidev->irq, mpt_interrupt,
1709 SA_SHIRQ, ioc->name, ioc); 1696 IRQF_SHARED, ioc->name, ioc);
1710 if (rc < 0) { 1697 if (rc < 0) {
1711 printk(MYIOC_s_ERR_FMT "Unable to allocate " 1698 printk(MYIOC_s_ERR_FMT "Unable to allocate "
1712 "interrupt %d!\n", ioc->name, 1699 "interrupt %d!\n", ioc->name,
@@ -1773,9 +1760,9 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1773 * chips (mpt_adapter_disable, 1760 * chips (mpt_adapter_disable,
1774 * mpt_diag_reset) 1761 * mpt_diag_reset)
1775 */ 1762 */
1776 ioc->cached_fw = NULL;
1777 ddlprintk((MYIOC_s_INFO_FMT ": mpt_upload: alt_%s has cached_fw=%p \n", 1763 ddlprintk((MYIOC_s_INFO_FMT ": mpt_upload: alt_%s has cached_fw=%p \n",
1778 ioc->name, ioc->alt_ioc->name, ioc->alt_ioc->cached_fw)); 1764 ioc->name, ioc->alt_ioc->name, ioc->alt_ioc->cached_fw));
1765 ioc->alt_ioc->cached_fw = NULL;
1779 } 1766 }
1780 } else { 1767 } else {
1781 printk(KERN_WARNING MYNAM ": firmware upload failure!\n"); 1768 printk(KERN_WARNING MYNAM ": firmware upload failure!\n");
@@ -1896,7 +1883,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1896 /* FIXME? Examine results here? */ 1883 /* FIXME? Examine results here? */
1897 } 1884 }
1898 1885
1899out: 1886 out:
1900 if ((ret != 0) && irq_allocated) { 1887 if ((ret != 0) && irq_allocated) {
1901 free_irq(ioc->pci_irq, ioc); 1888 free_irq(ioc->pci_irq, ioc);
1902 if (mpt_msi_enable) 1889 if (mpt_msi_enable)
@@ -2681,6 +2668,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag)
2681 dinitprintk((MYIOC_s_INFO_FMT "INFO - Wait IOC_OPERATIONAL state (cnt=%d)\n", 2668 dinitprintk((MYIOC_s_INFO_FMT "INFO - Wait IOC_OPERATIONAL state (cnt=%d)\n",
2682 ioc->name, count)); 2669 ioc->name, count));
2683 2670
2671 ioc->aen_event_read_flag=0;
2684 return r; 2672 return r;
2685} 2673}
2686 2674
@@ -2748,6 +2736,8 @@ mpt_alloc_fw_memory(MPT_ADAPTER *ioc, int size)
2748 if (ioc->alt_ioc && ioc->alt_ioc->cached_fw) { 2736 if (ioc->alt_ioc && ioc->alt_ioc->cached_fw) {
2749 ioc->cached_fw = ioc->alt_ioc->cached_fw; /* use alt_ioc's memory */ 2737 ioc->cached_fw = ioc->alt_ioc->cached_fw; /* use alt_ioc's memory */
2750 ioc->cached_fw_dma = ioc->alt_ioc->cached_fw_dma; 2738 ioc->cached_fw_dma = ioc->alt_ioc->cached_fw_dma;
2739 ioc->alloc_total += size;
2740 ioc->alt_ioc->alloc_total -= size;
2751 } else { 2741 } else {
2752 if ( (ioc->cached_fw = pci_alloc_consistent(ioc->pcidev, size, &ioc->cached_fw_dma) ) ) 2742 if ( (ioc->cached_fw = pci_alloc_consistent(ioc->pcidev, size, &ioc->cached_fw_dma) ) )
2753 ioc->alloc_total += size; 2743 ioc->alloc_total += size;
@@ -3177,6 +3167,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
3177static int 3167static int
3178mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) 3168mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
3179{ 3169{
3170 MPT_ADAPTER *iocp=NULL;
3180 u32 diag0val; 3171 u32 diag0val;
3181 u32 doorbell; 3172 u32 doorbell;
3182 int hard_reset_done = 0; 3173 int hard_reset_done = 0;
@@ -3185,6 +3176,37 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
3185 u32 diag1val = 0; 3176 u32 diag1val = 0;
3186#endif 3177#endif
3187 3178
3179 if (ioc->pcidev->device == MPI_MANUFACTPAGE_DEVID_SAS1078) {
3180 drsprintk((MYIOC_s_WARN_FMT "%s: Doorbell=%p; 1078 reset "
3181 "address=%p\n", ioc->name, __FUNCTION__,
3182 &ioc->chip->Doorbell, &ioc->chip->Reset_1078));
3183 CHIPREG_WRITE32(&ioc->chip->Reset_1078, 0x07);
3184 if (sleepFlag == CAN_SLEEP)
3185 msleep(1);
3186 else
3187 mdelay(1);
3188
3189 for (count = 0; count < 60; count ++) {
3190 doorbell = CHIPREG_READ32(&ioc->chip->Doorbell);
3191 doorbell &= MPI_IOC_STATE_MASK;
3192
3193 drsprintk((MYIOC_s_INFO_FMT
3194 "looking for READY STATE: doorbell=%x"
3195 " count=%d\n",
3196 ioc->name, doorbell, count));
3197 if (doorbell == MPI_IOC_STATE_READY) {
3198 return 0;
3199 }
3200
3201 /* wait 1 sec */
3202 if (sleepFlag == CAN_SLEEP)
3203 msleep(1000);
3204 else
3205 mdelay(1000);
3206 }
3207 return -1;
3208 }
3209
3188 /* Clear any existing interrupts */ 3210 /* Clear any existing interrupts */
3189 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); 3211 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
3190 3212
@@ -3281,17 +3303,23 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
3281 /* FIXME? Examine results here? */ 3303 /* FIXME? Examine results here? */
3282 } 3304 }
3283 3305
3284 if (ioc->cached_fw) { 3306 if (ioc->cached_fw)
3307 iocp = ioc;
3308 else if (ioc->alt_ioc && ioc->alt_ioc->cached_fw)
3309 iocp = ioc->alt_ioc;
3310 if (iocp) {
3285 /* If the DownloadBoot operation fails, the 3311 /* If the DownloadBoot operation fails, the
3286 * IOC will be left unusable. This is a fatal error 3312 * IOC will be left unusable. This is a fatal error
3287 * case. _diag_reset will return < 0 3313 * case. _diag_reset will return < 0
3288 */ 3314 */
3289 for (count = 0; count < 30; count ++) { 3315 for (count = 0; count < 30; count ++) {
3290 diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); 3316 diag0val = CHIPREG_READ32(&iocp->chip->Diagnostic);
3291 if (!(diag0val & MPI_DIAG_RESET_ADAPTER)) { 3317 if (!(diag0val & MPI_DIAG_RESET_ADAPTER)) {
3292 break; 3318 break;
3293 } 3319 }
3294 3320
3321 dprintk((MYIOC_s_INFO_FMT "cached_fw: diag0val=%x count=%d\n",
3322 iocp->name, diag0val, count));
3295 /* wait 1 sec */ 3323 /* wait 1 sec */
3296 if (sleepFlag == CAN_SLEEP) { 3324 if (sleepFlag == CAN_SLEEP) {
3297 msleep (1000); 3325 msleep (1000);
@@ -3300,7 +3328,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
3300 } 3328 }
3301 } 3329 }
3302 if ((count = mpt_downloadboot(ioc, 3330 if ((count = mpt_downloadboot(ioc,
3303 (MpiFwHeader_t *)ioc->cached_fw, sleepFlag)) < 0) { 3331 (MpiFwHeader_t *)iocp->cached_fw, sleepFlag)) < 0) {
3304 printk(KERN_WARNING MYNAM 3332 printk(KERN_WARNING MYNAM
3305 ": firmware downloadboot failure (%d)!\n", count); 3333 ": firmware downloadboot failure (%d)!\n", count);
3306 } 3334 }
@@ -3887,18 +3915,18 @@ WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
3887 3915
3888 if (sleepFlag == CAN_SLEEP) { 3916 if (sleepFlag == CAN_SLEEP) {
3889 while (--cntdn) { 3917 while (--cntdn) {
3918 msleep (1);
3890 intstat = CHIPREG_READ32(&ioc->chip->IntStatus); 3919 intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
3891 if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS)) 3920 if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS))
3892 break; 3921 break;
3893 msleep (1);
3894 count++; 3922 count++;
3895 } 3923 }
3896 } else { 3924 } else {
3897 while (--cntdn) { 3925 while (--cntdn) {
3926 mdelay (1);
3898 intstat = CHIPREG_READ32(&ioc->chip->IntStatus); 3927 intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
3899 if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS)) 3928 if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS))
3900 break; 3929 break;
3901 mdelay (1);
3902 count++; 3930 count++;
3903 } 3931 }
3904 } 3932 }
@@ -4863,6 +4891,7 @@ mpt_read_ioc_pg_4(MPT_ADAPTER *ioc)
4863 pIoc4 = pci_alloc_consistent(ioc->pcidev, iocpage4sz, &ioc4_dma); 4891 pIoc4 = pci_alloc_consistent(ioc->pcidev, iocpage4sz, &ioc4_dma);
4864 if (!pIoc4) 4892 if (!pIoc4)
4865 return; 4893 return;
4894 ioc->alloc_total += iocpage4sz;
4866 } else { 4895 } else {
4867 ioc4_dma = ioc->spi_data.IocPg4_dma; 4896 ioc4_dma = ioc->spi_data.IocPg4_dma;
4868 iocpage4sz = ioc->spi_data.IocPg4Sz; 4897 iocpage4sz = ioc->spi_data.IocPg4Sz;
@@ -4879,6 +4908,7 @@ mpt_read_ioc_pg_4(MPT_ADAPTER *ioc)
4879 } else { 4908 } else {
4880 pci_free_consistent(ioc->pcidev, iocpage4sz, pIoc4, ioc4_dma); 4909 pci_free_consistent(ioc->pcidev, iocpage4sz, pIoc4, ioc4_dma);
4881 ioc->spi_data.pIocPg4 = NULL; 4910 ioc->spi_data.pIocPg4 = NULL;
4911 ioc->alloc_total -= iocpage4sz;
4882 } 4912 }
4883} 4913}
4884 4914
@@ -5010,19 +5040,18 @@ SendEventAck(MPT_ADAPTER *ioc, EventNotificationReply_t *evnp)
5010 EventAck_t *pAck; 5040 EventAck_t *pAck;
5011 5041
5012 if ((pAck = (EventAck_t *) mpt_get_msg_frame(mpt_base_index, ioc)) == NULL) { 5042 if ((pAck = (EventAck_t *) mpt_get_msg_frame(mpt_base_index, ioc)) == NULL) {
5013 printk(MYIOC_s_WARN_FMT "Unable to allocate event ACK " 5043 dfailprintk((MYIOC_s_WARN_FMT "%s, no msg frames!!\n",
5014 "request frame for Event=%x EventContext=%x EventData=%x!\n", 5044 ioc->name,__FUNCTION__));
5015 ioc->name, evnp->Event, le32_to_cpu(evnp->EventContext),
5016 le32_to_cpu(evnp->Data[0]));
5017 return -1; 5045 return -1;
5018 } 5046 }
5019 memset(pAck, 0, sizeof(*pAck));
5020 5047
5021 dprintk((MYIOC_s_INFO_FMT "Sending EventAck\n", ioc->name)); 5048 devtverboseprintk((MYIOC_s_INFO_FMT "Sending EventAck\n", ioc->name));
5022 5049
5023 pAck->Function = MPI_FUNCTION_EVENT_ACK; 5050 pAck->Function = MPI_FUNCTION_EVENT_ACK;
5024 pAck->ChainOffset = 0; 5051 pAck->ChainOffset = 0;
5052 pAck->Reserved[0] = pAck->Reserved[1] = 0;
5025 pAck->MsgFlags = 0; 5053 pAck->MsgFlags = 0;
5054 pAck->Reserved1[0] = pAck->Reserved1[1] = pAck->Reserved1[2] = 0;
5026 pAck->Event = evnp->Event; 5055 pAck->Event = evnp->Event;
5027 pAck->EventContext = evnp->EventContext; 5056 pAck->EventContext = evnp->EventContext;
5028 5057
@@ -5592,7 +5621,7 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)
5592 5621
5593 /* The SCSI driver needs to adjust timeouts on all current 5622 /* The SCSI driver needs to adjust timeouts on all current
5594 * commands prior to the diagnostic reset being issued. 5623 * commands prior to the diagnostic reset being issued.
5595 * Prevents timeouts occuring during a diagnostic reset...very bad. 5624 * Prevents timeouts occurring during a diagnostic reset...very bad.
5596 * For all other protocol drivers, this is a no-op. 5625 * For all other protocol drivers, this is a no-op.
5597 */ 5626 */
5598 { 5627 {
@@ -5684,9 +5713,9 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr)
5684 break; 5713 break;
5685 case MPI_EVENT_EVENT_CHANGE: 5714 case MPI_EVENT_EVENT_CHANGE:
5686 if (evData0) 5715 if (evData0)
5687 ds = "Events(ON) Change"; 5716 ds = "Events ON";
5688 else 5717 else
5689 ds = "Events(OFF) Change"; 5718 ds = "Events OFF";
5690 break; 5719 break;
5691 case MPI_EVENT_INTEGRATED_RAID: 5720 case MPI_EVENT_INTEGRATED_RAID:
5692 { 5721 {
@@ -5757,8 +5786,27 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr)
5757 break; 5786 break;
5758 case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED: 5787 case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED:
5759 snprintf(evStr, EVENT_DESCR_STR_SZ, 5788 snprintf(evStr, EVENT_DESCR_STR_SZ,
5760 "SAS Device Status Change: No Persistancy " 5789 "SAS Device Status Change: No Persistancy: id=%d", id);
5761 "Added: id=%d", id); 5790 break;
5791 case MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET:
5792 snprintf(evStr, EVENT_DESCR_STR_SZ,
5793 "SAS Device Status Change: Internal Device Reset : id=%d", id);
5794 break;
5795 case MPI_EVENT_SAS_DEV_STAT_RC_TASK_ABORT_INTERNAL:
5796 snprintf(evStr, EVENT_DESCR_STR_SZ,
5797 "SAS Device Status Change: Internal Task Abort : id=%d", id);
5798 break;
5799 case MPI_EVENT_SAS_DEV_STAT_RC_ABORT_TASK_SET_INTERNAL:
5800 snprintf(evStr, EVENT_DESCR_STR_SZ,
5801 "SAS Device Status Change: Internal Abort Task Set : id=%d", id);
5802 break;
5803 case MPI_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL:
5804 snprintf(evStr, EVENT_DESCR_STR_SZ,
5805 "SAS Device Status Change: Internal Clear Task Set : id=%d", id);
5806 break;
5807 case MPI_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL:
5808 snprintf(evStr, EVENT_DESCR_STR_SZ,
5809 "SAS Device Status Change: Internal Query Task : id=%d", id);
5762 break; 5810 break;
5763 default: 5811 default:
5764 snprintf(evStr, EVENT_DESCR_STR_SZ, 5812 snprintf(evStr, EVENT_DESCR_STR_SZ,
@@ -6014,7 +6062,7 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply
6014 * @ioc: Pointer to MPT_ADAPTER structure 6062 * @ioc: Pointer to MPT_ADAPTER structure
6015 * @log_info: U32 LogInfo reply word from the IOC 6063 * @log_info: U32 LogInfo reply word from the IOC
6016 * 6064 *
6017 * Refer to lsi/fc_log.h. 6065 * Refer to lsi/mpi_log_fc.h.
6018 */ 6066 */
6019static void 6067static void
6020mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info) 6068mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info)
@@ -6111,8 +6159,10 @@ mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info)
6111 "Invalid SAS Address", /* 01h */ 6159 "Invalid SAS Address", /* 01h */
6112 NULL, /* 02h */ 6160 NULL, /* 02h */
6113 "Invalid Page", /* 03h */ 6161 "Invalid Page", /* 03h */
6114 NULL, /* 04h */ 6162 "Diag Message Error", /* 04h */
6115 "Task Terminated" /* 05h */ 6163 "Task Terminated", /* 05h */
6164 "Enclosure Management", /* 06h */
6165 "Target Mode" /* 07h */
6116 }; 6166 };
6117 static char *pl_code_str[] = { 6167 static char *pl_code_str[] = {
6118 NULL, /* 00h */ 6168 NULL, /* 00h */
@@ -6138,7 +6188,7 @@ mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info)
6138 "IO Executed", /* 14h */ 6188 "IO Executed", /* 14h */
6139 "Persistant Reservation Out Not Affiliation Owner", /* 15h */ 6189 "Persistant Reservation Out Not Affiliation Owner", /* 15h */
6140 "Open Transmit DMA Abort", /* 16h */ 6190 "Open Transmit DMA Abort", /* 16h */
6141 NULL, /* 17h */ 6191 "IO Device Missing Delay Retry", /* 17h */
6142 NULL, /* 18h */ 6192 NULL, /* 18h */
6143 NULL, /* 19h */ 6193 NULL, /* 19h */
6144 NULL, /* 1Ah */ 6194 NULL, /* 1Ah */
@@ -6218,7 +6268,7 @@ static void
6218mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf) 6268mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf)
6219{ 6269{
6220 u32 status = ioc_status & MPI_IOCSTATUS_MASK; 6270 u32 status = ioc_status & MPI_IOCSTATUS_MASK;
6221 char *desc = ""; 6271 char *desc = NULL;
6222 6272
6223 switch (status) { 6273 switch (status) {
6224 case MPI_IOCSTATUS_INVALID_FUNCTION: /* 0x0001 */ 6274 case MPI_IOCSTATUS_INVALID_FUNCTION: /* 0x0001 */
@@ -6328,7 +6378,7 @@ mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf)
6328 desc = "Others"; 6378 desc = "Others";
6329 break; 6379 break;
6330 } 6380 }
6331 if (desc != "") 6381 if (desc != NULL)
6332 printk(MYIOC_s_INFO_FMT "IOCStatus(0x%04x): %s\n", ioc->name, status, desc); 6382 printk(MYIOC_s_INFO_FMT "IOCStatus(0x%04x): %s\n", ioc->name, status, desc);
6333} 6383}
6334 6384
@@ -6366,7 +6416,6 @@ EXPORT_SYMBOL(mpt_alloc_fw_memory);
6366EXPORT_SYMBOL(mpt_free_fw_memory); 6416EXPORT_SYMBOL(mpt_free_fw_memory);
6367EXPORT_SYMBOL(mptbase_sas_persist_operation); 6417EXPORT_SYMBOL(mptbase_sas_persist_operation);
6368 6418
6369
6370/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 6419/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
6371/* 6420/*
6372 * fusion_init - Fusion MPT base driver initialization routine. 6421 * fusion_init - Fusion MPT base driver initialization routine.