diff options
author | Bhanu Prakash Gollapudi <bprakash@broadcom.com> | 2011-07-27 14:32:08 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-07-28 03:52:38 -0400 |
commit | f3820b719d91a0ed1e26831b1cfdcdf1641ab586 (patch) | |
tree | 9177b72447883de8c5377198912a94952333b230 /drivers/scsi/bnx2fc | |
parent | 7b594769120b43b8da1ff8f7b4c31a47fabd6ac0 (diff) |
[SCSI] bnx2fc: HSI changes for tape
Program the firmware task structure with init_flags indicating the device is
'sequence level error recovery' capable.
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bnx2fc')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_hwi.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c index 764c45254dc6..9f38c5725b86 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c +++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c | |||
@@ -1564,7 +1564,12 @@ void bnx2fc_init_cleanup_task(struct bnx2fc_cmd *io_req, | |||
1564 | FCOE_TCE_TX_WR_RX_RD_CONST_TASK_TYPE_SHIFT; | 1564 | FCOE_TCE_TX_WR_RX_RD_CONST_TASK_TYPE_SHIFT; |
1565 | task->txwr_rxrd.const_ctx.init_flags |= FCOE_TASK_CLASS_TYPE_3 << | 1565 | task->txwr_rxrd.const_ctx.init_flags |= FCOE_TASK_CLASS_TYPE_3 << |
1566 | FCOE_TCE_TX_WR_RX_RD_CONST_CLASS_TYPE_SHIFT; | 1566 | FCOE_TCE_TX_WR_RX_RD_CONST_CLASS_TYPE_SHIFT; |
1567 | task->txwr_rxrd.const_ctx.init_flags |= | 1567 | if (tgt->dev_type == TYPE_TAPE) |
1568 | task->txwr_rxrd.const_ctx.init_flags |= | ||
1569 | FCOE_TASK_DEV_TYPE_TAPE << | ||
1570 | FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT; | ||
1571 | else | ||
1572 | task->txwr_rxrd.const_ctx.init_flags |= | ||
1568 | FCOE_TASK_DEV_TYPE_DISK << | 1573 | FCOE_TASK_DEV_TYPE_DISK << |
1569 | FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT; | 1574 | FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT; |
1570 | task->txwr_rxrd.union_ctx.cleanup.ctx.cleaned_task_id = orig_xid; | 1575 | task->txwr_rxrd.union_ctx.cleanup.ctx.cleaned_task_id = orig_xid; |
@@ -1624,7 +1629,12 @@ void bnx2fc_init_mp_task(struct bnx2fc_cmd *io_req, | |||
1624 | /* init flags */ | 1629 | /* init flags */ |
1625 | task->txwr_rxrd.const_ctx.init_flags = task_type << | 1630 | task->txwr_rxrd.const_ctx.init_flags = task_type << |
1626 | FCOE_TCE_TX_WR_RX_RD_CONST_TASK_TYPE_SHIFT; | 1631 | FCOE_TCE_TX_WR_RX_RD_CONST_TASK_TYPE_SHIFT; |
1627 | task->txwr_rxrd.const_ctx.init_flags |= | 1632 | if (tgt->dev_type == TYPE_TAPE) |
1633 | task->txwr_rxrd.const_ctx.init_flags |= | ||
1634 | FCOE_TASK_DEV_TYPE_TAPE << | ||
1635 | FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT; | ||
1636 | else | ||
1637 | task->txwr_rxrd.const_ctx.init_flags |= | ||
1628 | FCOE_TASK_DEV_TYPE_DISK << | 1638 | FCOE_TASK_DEV_TYPE_DISK << |
1629 | FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT; | 1639 | FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT; |
1630 | task->txwr_rxrd.const_ctx.init_flags |= FCOE_TASK_CLASS_TYPE_3 << | 1640 | task->txwr_rxrd.const_ctx.init_flags |= FCOE_TASK_CLASS_TYPE_3 << |
@@ -1681,6 +1691,7 @@ void bnx2fc_init_task(struct bnx2fc_cmd *io_req, | |||
1681 | struct bnx2fc_rport *tgt = io_req->tgt; | 1691 | struct bnx2fc_rport *tgt = io_req->tgt; |
1682 | struct fcoe_cached_sge_ctx *cached_sge; | 1692 | struct fcoe_cached_sge_ctx *cached_sge; |
1683 | struct fcoe_ext_mul_sges_ctx *sgl; | 1693 | struct fcoe_ext_mul_sges_ctx *sgl; |
1694 | int dev_type = tgt->dev_type; | ||
1684 | u64 *fcp_cmnd; | 1695 | u64 *fcp_cmnd; |
1685 | u64 tmp_fcp_cmnd[4]; | 1696 | u64 tmp_fcp_cmnd[4]; |
1686 | u32 context_id; | 1697 | u32 context_id; |
@@ -1711,7 +1722,12 @@ void bnx2fc_init_task(struct bnx2fc_cmd *io_req, | |||
1711 | /* Init state to NORMAL */ | 1722 | /* Init state to NORMAL */ |
1712 | task->txwr_rxrd.const_ctx.init_flags = task_type << | 1723 | task->txwr_rxrd.const_ctx.init_flags = task_type << |
1713 | FCOE_TCE_TX_WR_RX_RD_CONST_TASK_TYPE_SHIFT; | 1724 | FCOE_TCE_TX_WR_RX_RD_CONST_TASK_TYPE_SHIFT; |
1714 | task->txwr_rxrd.const_ctx.init_flags |= | 1725 | if (dev_type == TYPE_TAPE) |
1726 | task->txwr_rxrd.const_ctx.init_flags |= | ||
1727 | FCOE_TASK_DEV_TYPE_TAPE << | ||
1728 | FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT; | ||
1729 | else | ||
1730 | task->txwr_rxrd.const_ctx.init_flags |= | ||
1715 | FCOE_TASK_DEV_TYPE_DISK << | 1731 | FCOE_TASK_DEV_TYPE_DISK << |
1716 | FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT; | 1732 | FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT; |
1717 | task->txwr_rxrd.const_ctx.init_flags |= FCOE_TASK_CLASS_TYPE_3 << | 1733 | task->txwr_rxrd.const_ctx.init_flags |= FCOE_TASK_CLASS_TYPE_3 << |
@@ -1754,7 +1770,8 @@ void bnx2fc_init_task(struct bnx2fc_cmd *io_req, | |||
1754 | cached_sge = &task->rxwr_only.union_ctx.read_info.sgl_ctx.cached_sge; | 1770 | cached_sge = &task->rxwr_only.union_ctx.read_info.sgl_ctx.cached_sge; |
1755 | sgl = &task->rxwr_only.union_ctx.read_info.sgl_ctx.sgl; | 1771 | sgl = &task->rxwr_only.union_ctx.read_info.sgl_ctx.sgl; |
1756 | bd_count = bd_tbl->bd_valid; | 1772 | bd_count = bd_tbl->bd_valid; |
1757 | if (task_type == FCOE_TASK_TYPE_READ) { | 1773 | if (task_type == FCOE_TASK_TYPE_READ && |
1774 | dev_type == TYPE_DISK) { | ||
1758 | if (bd_count == 1) { | 1775 | if (bd_count == 1) { |
1759 | 1776 | ||
1760 | struct fcoe_bd_ctx *fcoe_bd_tbl = bd_tbl->bd_tbl; | 1777 | struct fcoe_bd_ctx *fcoe_bd_tbl = bd_tbl->bd_tbl; |
@@ -1786,6 +1803,11 @@ void bnx2fc_init_task(struct bnx2fc_cmd *io_req, | |||
1786 | (u32)((u64)bd_tbl->bd_tbl_dma >> 32); | 1803 | (u32)((u64)bd_tbl->bd_tbl_dma >> 32); |
1787 | sgl->mul_sgl.sgl_size = bd_count; | 1804 | sgl->mul_sgl.sgl_size = bd_count; |
1788 | } | 1805 | } |
1806 | } else { | ||
1807 | sgl->mul_sgl.cur_sge_addr.lo = (u32)bd_tbl->bd_tbl_dma; | ||
1808 | sgl->mul_sgl.cur_sge_addr.hi = | ||
1809 | (u32)((u64)bd_tbl->bd_tbl_dma >> 32); | ||
1810 | sgl->mul_sgl.sgl_size = bd_count; | ||
1789 | } | 1811 | } |
1790 | } | 1812 | } |
1791 | 1813 | ||