aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorBhanu Prakash Gollapudi <bprakash@broadcom.com>2011-07-26 17:51:40 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-07-27 07:38:12 -0400
commitb252f4c7c39cc43c1a34c68951f98d7391a1a103 (patch)
tree8c9106ae222a32b8b418b091a11f51a9fd851d7f /drivers/scsi
parentaea71a024914e8b5b8bed31256dae42195a0a207 (diff)
[SCSI] bnx2fc: Enable REC & CONF support for the session
Based on PRLI response, identify if the target is FCP-2 (seq level error recovery) capable, and appropriately set the corresponding CONF, REC flags when offloading the session. Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc.h2
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_hwi.c12
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_io.c3
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_tgt.c8
4 files changed, 24 insertions, 1 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h
index 6012317c1f2f..d38dcc7f1047 100644
--- a/drivers/scsi/bnx2fc/bnx2fc.h
+++ b/drivers/scsi/bnx2fc/bnx2fc.h
@@ -244,9 +244,11 @@ struct bnx2fc_rport {
244 struct fc_rport_priv *rdata; 244 struct fc_rport_priv *rdata;
245 void __iomem *ctx_base; 245 void __iomem *ctx_base;
246#define DPM_TRIGER_TYPE 0x40 246#define DPM_TRIGER_TYPE 0x40
247 u32 io_timeout;
247 u32 fcoe_conn_id; 248 u32 fcoe_conn_id;
248 u32 context_id; 249 u32 context_id;
249 u32 sid; 250 u32 sid;
251 int dev_type;
250 252
251 unsigned long flags; 253 unsigned long flags;
252#define BNX2FC_FLAG_SESSION_READY 0x1 254#define BNX2FC_FLAG_SESSION_READY 0x1
diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
index ee1674b794b1..fa263b5902e1 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
@@ -279,6 +279,18 @@ int bnx2fc_send_session_ofld_req(struct fcoe_port *port,
279 ofld_req3.flags |= (((rdata->sp_features & FC_SP_FT_SEQC) ? 1 : 0) << 279 ofld_req3.flags |= (((rdata->sp_features & FC_SP_FT_SEQC) ? 1 : 0) <<
280 FCOE_KWQE_CONN_OFFLOAD3_B_CONT_INCR_SEQ_CNT_SHIFT); 280 FCOE_KWQE_CONN_OFFLOAD3_B_CONT_INCR_SEQ_CNT_SHIFT);
281 281
282 /*
283 * Info from PRLI response, this info is used for sequence level error
284 * recovery support
285 */
286 if (tgt->dev_type == TYPE_TAPE) {
287 ofld_req3.flags |= 1 <<
288 FCOE_KWQE_CONN_OFFLOAD3_B_CONF_REQ_SHIFT;
289 ofld_req3.flags |= (((rdata->flags & FC_RP_FLAGS_REC_SUPPORTED)
290 ? 1 : 0) <<
291 FCOE_KWQE_CONN_OFFLOAD3_B_REC_VALID_SHIFT);
292 }
293
282 /* vlan flag */ 294 /* vlan flag */
283 ofld_req3.flags |= (interface->vlan_enabled << 295 ofld_req3.flags |= (interface->vlan_enabled <<
284 FCOE_KWQE_CONN_OFFLOAD3_B_VLAN_FLAG_SHIFT); 296 FCOE_KWQE_CONN_OFFLOAD3_B_VLAN_FLAG_SHIFT);
diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index e711ea3dd900..72940b8625bd 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -1862,7 +1862,8 @@ static int bnx2fc_post_io_req(struct bnx2fc_rport *tgt,
1862 } 1862 }
1863 1863
1864 /* Time IO req */ 1864 /* Time IO req */
1865 bnx2fc_cmd_timer_set(io_req, BNX2FC_IO_TIMEOUT); 1865 if (tgt->io_timeout)
1866 bnx2fc_cmd_timer_set(io_req, BNX2FC_IO_TIMEOUT);
1866 /* Obtain free SQ entry */ 1867 /* Obtain free SQ entry */
1867 bnx2fc_add_2_sq(tgt, xid); 1868 bnx2fc_add_2_sq(tgt, xid);
1868 1869
diff --git a/drivers/scsi/bnx2fc/bnx2fc_tgt.c b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
index 263c2678ff62..7eff269d4c41 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_tgt.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
@@ -353,6 +353,14 @@ static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt,
353 tgt->rq_cons_idx = 0; 353 tgt->rq_cons_idx = 0;
354 atomic_set(&tgt->num_active_ios, 0); 354 atomic_set(&tgt->num_active_ios, 0);
355 355
356 if (rdata->flags & FC_RP_FLAGS_RETRY) {
357 tgt->dev_type = TYPE_TAPE;
358 tgt->io_timeout = 0; /* use default ULP timeout */
359 } else {
360 tgt->dev_type = TYPE_DISK;
361 tgt->io_timeout = BNX2FC_IO_TIMEOUT;
362 }
363
356 /* initialize sq doorbell */ 364 /* initialize sq doorbell */
357 sq_db->header.header = B577XX_DOORBELL_HDR_DB_TYPE; 365 sq_db->header.header = B577XX_DOORBELL_HDR_DB_TYPE;
358 sq_db->header.header |= B577XX_FCOE_CONNECTION_TYPE << 366 sq_db->header.header |= B577XX_FCOE_CONNECTION_TYPE <<