aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_mbx.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2006-10-02 15:00:43 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-10-03 18:28:38 -0400
commitd8b4521349274ab610d0b29384c704444e55cbca (patch)
tree5af421c4c6c262e966e2e3f37241b1cdb4fa199a /drivers/scsi/qla2xxx/qla_mbx.c
parentee0ca6bab394fe41a2b4de58c4532b09a41c9165 (diff)
[SCSI] qla2xxx: Add iIDMA support.
iIDMA (Intelligent Interleaved Direct Memory Access) allows for the HBA hardware to send FC frames at the rate at which they can be received by a target device. By taking advantage of the higher link rate, the HBA can maximize bandwidth utilization in a heterogeneous multi-speed SAN. Within a fabric topology, port speed detection is done via a Name Server command (GFPN_ID) followed by a Fabric Management command (GPSC). In an FCAL/N2N topology, port speed is based on the HBA link-rate. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mbx.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c86
1 files changed, 86 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 879f281e2ea2..4cde76c85cb3 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -2540,3 +2540,89 @@ qla2x00_read_sfp(scsi_qla_host_t *ha, dma_addr_t sfp_dma, uint16_t addr,
2540 2540
2541 return rval; 2541 return rval;
2542} 2542}
2543
2544int
2545qla2x00_get_idma_speed(scsi_qla_host_t *ha, uint16_t loop_id,
2546 uint16_t *port_speed, uint16_t *mb)
2547{
2548 int rval;
2549 mbx_cmd_t mc;
2550 mbx_cmd_t *mcp = &mc;
2551
2552 if (!IS_QLA24XX(ha))
2553 return QLA_FUNCTION_FAILED;
2554
2555 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
2556
2557 mcp->mb[0] = MBC_PORT_PARAMS;
2558 mcp->mb[1] = loop_id;
2559 mcp->mb[2] = mcp->mb[3] = mcp->mb[4] = mcp->mb[5] = 0;
2560 mcp->out_mb = MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
2561 mcp->in_mb = MBX_5|MBX_4|MBX_3|MBX_1|MBX_0;
2562 mcp->tov = 30;
2563 mcp->flags = 0;
2564 rval = qla2x00_mailbox_command(ha, mcp);
2565
2566 /* Return mailbox statuses. */
2567 if (mb != NULL) {
2568 mb[0] = mcp->mb[0];
2569 mb[1] = mcp->mb[1];
2570 mb[3] = mcp->mb[3];
2571 mb[4] = mcp->mb[4];
2572 mb[5] = mcp->mb[5];
2573 }
2574
2575 if (rval != QLA_SUCCESS) {
2576 DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__,
2577 ha->host_no, rval));
2578 } else {
2579 DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
2580 if (port_speed)
2581 *port_speed = mcp->mb[3];
2582 }
2583
2584 return rval;
2585}
2586
2587int
2588qla2x00_set_idma_speed(scsi_qla_host_t *ha, uint16_t loop_id,
2589 uint16_t port_speed, uint16_t *mb)
2590{
2591 int rval;
2592 mbx_cmd_t mc;
2593 mbx_cmd_t *mcp = &mc;
2594
2595 if (!IS_QLA24XX(ha))
2596 return QLA_FUNCTION_FAILED;
2597
2598 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
2599
2600 mcp->mb[0] = MBC_PORT_PARAMS;
2601 mcp->mb[1] = loop_id;
2602 mcp->mb[2] = BIT_0;
2603 mcp->mb[3] = port_speed & (BIT_2|BIT_1|BIT_0);
2604 mcp->mb[4] = mcp->mb[5] = 0;
2605 mcp->out_mb = MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
2606 mcp->in_mb = MBX_5|MBX_4|MBX_3|MBX_1|MBX_0;
2607 mcp->tov = 30;
2608 mcp->flags = 0;
2609 rval = qla2x00_mailbox_command(ha, mcp);
2610
2611 /* Return mailbox statuses. */
2612 if (mb != NULL) {
2613 mb[0] = mcp->mb[0];
2614 mb[1] = mcp->mb[1];
2615 mb[3] = mcp->mb[3];
2616 mb[4] = mcp->mb[4];
2617 mb[5] = mcp->mb[5];
2618 }
2619
2620 if (rval != QLA_SUCCESS) {
2621 DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__,
2622 ha->host_no, rval));
2623 } else {
2624 DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
2625 }
2626
2627 return rval;
2628}