aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_mbx.c
diff options
context:
space:
mode:
authorGiridhar Malavali <giridhar.malavali@qlogic.com>2010-03-19 20:03:58 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-04-11 10:44:10 -0400
commit6e98016ca077c5c751167bfdb1a3a2a3bee581cf (patch)
tree4704944f9e379e8ad2035d4257b96cb888f1b549 /drivers/scsi/qla2xxx/qla_mbx.c
parent077424e2e2c97c830d903891dfcd1532068b85b7 (diff)
[SCSI] qla2xxx: Re-organized BSG interface specific code.
1. Segregate BSG interface specific code to new files. 2. Handle multiple vendor specific commands indepedently. 3. Reorganised support for reset, management and update FCoE firmware commands. 4. Fixed memory leak issue in Loopback. 5. Added new vendor command to support iiDMA using BSG interface. 6. Proper cleanup of dma mapped and dma allocated buffers for BSG request. [jejb: fix up conflict and merge in Jiri Slaby lock imbalance patch] Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mbx.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c49
1 files changed, 44 insertions, 5 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 42eb7ffd5942..7f3bc45d2e20 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -711,7 +711,7 @@ qla2x00_verify_checksum(scsi_qla_host_t *vha, uint32_t risc_addr)
711 * Context: 711 * Context:
712 * Kernel context. 712 * Kernel context.
713 */ 713 */
714static int 714int
715qla2x00_issue_iocb_timeout(scsi_qla_host_t *vha, void *buffer, 715qla2x00_issue_iocb_timeout(scsi_qla_host_t *vha, void *buffer,
716 dma_addr_t phys_addr, size_t size, uint32_t tov) 716 dma_addr_t phys_addr, size_t size, uint32_t tov)
717{ 717{
@@ -2740,6 +2740,48 @@ qla2x00_read_sfp(scsi_qla_host_t *vha, dma_addr_t sfp_dma, uint16_t addr,
2740} 2740}
2741 2741
2742int 2742int
2743qla2x00_get_idma_speed(scsi_qla_host_t *vha, uint16_t loop_id,
2744 uint16_t *port_speed, uint16_t *mb)
2745{
2746 int rval;
2747 mbx_cmd_t mc;
2748 mbx_cmd_t *mcp = &mc;
2749
2750 if (!IS_IIDMA_CAPABLE(vha->hw))
2751 return QLA_FUNCTION_FAILED;
2752
2753 DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no));
2754
2755 mcp->mb[0] = MBC_PORT_PARAMS;
2756 mcp->mb[1] = loop_id;
2757 mcp->mb[2] = mcp->mb[3] = 0;
2758 mcp->mb[9] = vha->vp_idx;
2759 mcp->out_mb = MBX_9|MBX_3|MBX_2|MBX_1|MBX_0;
2760 mcp->in_mb = MBX_3|MBX_1|MBX_0;
2761 mcp->tov = MBX_TOV_SECONDS;
2762 mcp->flags = 0;
2763 rval = qla2x00_mailbox_command(vha, mcp);
2764
2765 /* Return mailbox statuses. */
2766 if (mb != NULL) {
2767 mb[0] = mcp->mb[0];
2768 mb[1] = mcp->mb[1];
2769 mb[3] = mcp->mb[3];
2770 }
2771
2772 if (rval != QLA_SUCCESS) {
2773 DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__,
2774 vha->host_no, rval));
2775 } else {
2776 DEBUG11(printk("%s(%ld): done.\n", __func__, vha->host_no));
2777 if (port_speed)
2778 *port_speed = mcp->mb[3];
2779 }
2780
2781 return rval;
2782}
2783
2784int
2743qla2x00_set_idma_speed(scsi_qla_host_t *vha, uint16_t loop_id, 2785qla2x00_set_idma_speed(scsi_qla_host_t *vha, uint16_t loop_id,
2744 uint16_t port_speed, uint16_t *mb) 2786 uint16_t port_speed, uint16_t *mb)
2745{ 2787{
@@ -3764,8 +3806,7 @@ qla2x00_echo_test(scsi_qla_host_t *vha, struct msg_echo_lb *mreq, uint16_t *mres
3764 return rval; 3806 return rval;
3765} 3807}
3766int 3808int
3767qla84xx_reset_chip(scsi_qla_host_t *ha, uint16_t enable_diagnostic, 3809qla84xx_reset_chip(scsi_qla_host_t *ha, uint16_t enable_diagnostic)
3768 uint16_t *cmd_status)
3769{ 3810{
3770 int rval; 3811 int rval;
3771 mbx_cmd_t mc; 3812 mbx_cmd_t mc;
@@ -3782,8 +3823,6 @@ qla84xx_reset_chip(scsi_qla_host_t *ha, uint16_t enable_diagnostic,
3782 mcp->flags = MBX_DMA_OUT|MBX_DMA_IN|IOCTL_CMD; 3823 mcp->flags = MBX_DMA_OUT|MBX_DMA_IN|IOCTL_CMD;
3783 rval = qla2x00_mailbox_command(ha, mcp); 3824 rval = qla2x00_mailbox_command(ha, mcp);
3784 3825
3785 /* Return mailbox statuses. */
3786 *cmd_status = mcp->mb[0];
3787 if (rval != QLA_SUCCESS) 3826 if (rval != QLA_SUCCESS)
3788 DEBUG16(printk("%s(%ld): failed=%x.\n", __func__, ha->host_no, 3827 DEBUG16(printk("%s(%ld): failed=%x.\n", __func__, ha->host_no,
3789 rval)); 3828 rval));