aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_mbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_mbox.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_mbox.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c
index a592733664e9..dfc63f6ccd7b 100644
--- a/drivers/scsi/lpfc/lpfc_mbox.c
+++ b/drivers/scsi/lpfc/lpfc_mbox.c
@@ -82,6 +82,24 @@ lpfc_read_nv(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb)
82} 82}
83 83
84/**********************************************/ 84/**********************************************/
85/* lpfc_config_async Issue a */
86/* MBX_ASYNC_EVT_ENABLE mailbox command */
87/**********************************************/
88void
89lpfc_config_async(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb,
90 uint32_t ring)
91{
92 MAILBOX_t *mb;
93
94 mb = &pmb->mb;
95 memset(pmb, 0, sizeof (LPFC_MBOXQ_t));
96 mb->mbxCommand = MBX_ASYNCEVT_ENABLE;
97 mb->un.varCfgAsyncEvent.ring = ring;
98 mb->mbxOwner = OWN_HOST;
99 return;
100}
101
102/**********************************************/
85/* lpfc_heart_beat Issue a HEART_BEAT */ 103/* lpfc_heart_beat Issue a HEART_BEAT */
86/* mailbox command */ 104/* mailbox command */
87/**********************************************/ 105/**********************************************/
@@ -270,8 +288,10 @@ lpfc_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, int vpi)
270 288
271 /* Get a buffer to hold the HBAs Service Parameters */ 289 /* Get a buffer to hold the HBAs Service Parameters */
272 290
273 if (((mp = kmalloc(sizeof (struct lpfc_dmabuf), GFP_KERNEL)) == 0) || 291 mp = kmalloc(sizeof (struct lpfc_dmabuf), GFP_KERNEL);
274 ((mp->virt = lpfc_mbuf_alloc(phba, 0, &(mp->phys))) == 0)) { 292 if (mp)
293 mp->virt = lpfc_mbuf_alloc(phba, 0, &mp->phys);
294 if (!mp || !mp->virt) {
275 kfree(mp); 295 kfree(mp);
276 mb->mbxCommand = MBX_READ_SPARM64; 296 mb->mbxCommand = MBX_READ_SPARM64;
277 /* READ_SPARAM: no buffers */ 297 /* READ_SPARAM: no buffers */
@@ -369,8 +389,10 @@ lpfc_reg_login(struct lpfc_hba *phba, uint16_t vpi, uint32_t did,
369 mb->mbxOwner = OWN_HOST; 389 mb->mbxOwner = OWN_HOST;
370 390
371 /* Get a buffer to hold NPorts Service Parameters */ 391 /* Get a buffer to hold NPorts Service Parameters */
372 if (((mp = kmalloc(sizeof (struct lpfc_dmabuf), GFP_KERNEL)) == NULL) || 392 mp = kmalloc(sizeof (struct lpfc_dmabuf), GFP_KERNEL);
373 ((mp->virt = lpfc_mbuf_alloc(phba, 0, &(mp->phys))) == 0)) { 393 if (mp)
394 mp->virt = lpfc_mbuf_alloc(phba, 0, &mp->phys);
395 if (!mp || !mp->virt) {
374 kfree(mp); 396 kfree(mp);
375 mb->mbxCommand = MBX_REG_LOGIN64; 397 mb->mbxCommand = MBX_REG_LOGIN64;
376 /* REG_LOGIN: no buffers */ 398 /* REG_LOGIN: no buffers */
@@ -874,7 +896,7 @@ lpfc_mbox_tmo_val(struct lpfc_hba *phba, int cmd)
874 case MBX_DOWN_LOAD: /* 0x1C */ 896 case MBX_DOWN_LOAD: /* 0x1C */
875 case MBX_DEL_LD_ENTRY: /* 0x1D */ 897 case MBX_DEL_LD_ENTRY: /* 0x1D */
876 case MBX_LOAD_AREA: /* 0x81 */ 898 case MBX_LOAD_AREA: /* 0x81 */
877 case MBX_FLASH_WR_ULA: /* 0x98 */ 899 case MBX_WRITE_WWN: /* 0x98 */
878 case MBX_LOAD_EXP_ROM: /* 0x9C */ 900 case MBX_LOAD_EXP_ROM: /* 0x9C */
879 return LPFC_MBOX_TMO_FLASH_CMD; 901 return LPFC_MBOX_TMO_FLASH_CMD;
880 } 902 }