diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-17 20:54:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-17 20:54:40 -0400 |
commit | c55d267de274d308927b60c3e740c1a826832317 (patch) | |
tree | 21b53a8c725d9f9650f60d94b349459d5b8dae10 /drivers/scsi/bnx2i | |
parent | 61ef46fd45c3c62dc7c880a45dd2aa841b9af8fb (diff) | |
parent | bc898c97f7ba24def788d9f80786cf028a197122 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (170 commits)
[SCSI] scsi_dh_rdac: Add MD36xxf into device list
[SCSI] scsi_debug: add consecutive medium errors
[SCSI] libsas: fix ata list corruption issue
[SCSI] hpsa: export resettable host attribute
[SCSI] hpsa: move device attributes to avoid forward declarations
[SCSI] scsi_debug: Logical Block Provisioning (SBC3r26)
[SCSI] sd: Logical Block Provisioning update
[SCSI] Include protection operation in SCSI command trace
[SCSI] hpsa: fix incorrect PCI IDs and add two new ones (2nd try)
[SCSI] target: Fix volume size misreporting for volumes > 2TB
[SCSI] bnx2fc: Broadcom FCoE offload driver
[SCSI] fcoe: fix broken fcoe interface reset
[SCSI] fcoe: precedence bug in fcoe_filter_frames()
[SCSI] libfcoe: Remove stale fcoe-netdev entries
[SCSI] libfcoe: Move FCOE_MTU definition from fcoe.h to libfcoe.h
[SCSI] libfc: introduce __fc_fill_fc_hdr that accepts fc_hdr as an argument
[SCSI] fcoe, libfc: initialize EM anchors list and then update npiv EMs
[SCSI] Revert "[SCSI] libfc: fix exchange being deleted when the abort itself is timed out"
[SCSI] libfc: Fixing a memory leak when destroying an interface
[SCSI] megaraid_sas: Version and Changelog update
...
Fix up trivial conflicts due to whitespace differences in
drivers/scsi/libsas/{sas_ata.c,sas_scsi_host.c}
Diffstat (limited to 'drivers/scsi/bnx2i')
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i.h | 4 | ||||
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_hwi.c | 125 | ||||
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_init.c | 29 | ||||
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_iscsi.c | 53 |
4 files changed, 176 insertions, 35 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i.h b/drivers/scsi/bnx2i/bnx2i.h index e1ca5fe7e6bb..cfd59023227b 100644 --- a/drivers/scsi/bnx2i/bnx2i.h +++ b/drivers/scsi/bnx2i/bnx2i.h | |||
@@ -360,7 +360,7 @@ struct bnx2i_hba { | |||
360 | #define ADAPTER_STATE_LINK_DOWN 2 | 360 | #define ADAPTER_STATE_LINK_DOWN 2 |
361 | #define ADAPTER_STATE_INIT_FAILED 31 | 361 | #define ADAPTER_STATE_INIT_FAILED 31 |
362 | unsigned int mtu_supported; | 362 | unsigned int mtu_supported; |
363 | #define BNX2I_MAX_MTU_SUPPORTED 1500 | 363 | #define BNX2I_MAX_MTU_SUPPORTED 9000 |
364 | 364 | ||
365 | struct Scsi_Host *shost; | 365 | struct Scsi_Host *shost; |
366 | 366 | ||
@@ -751,6 +751,8 @@ extern int bnx2i_send_iscsi_login(struct bnx2i_conn *conn, | |||
751 | struct iscsi_task *mtask); | 751 | struct iscsi_task *mtask); |
752 | extern int bnx2i_send_iscsi_tmf(struct bnx2i_conn *conn, | 752 | extern int bnx2i_send_iscsi_tmf(struct bnx2i_conn *conn, |
753 | struct iscsi_task *mtask); | 753 | struct iscsi_task *mtask); |
754 | extern int bnx2i_send_iscsi_text(struct bnx2i_conn *conn, | ||
755 | struct iscsi_task *mtask); | ||
754 | extern int bnx2i_send_iscsi_scsicmd(struct bnx2i_conn *conn, | 756 | extern int bnx2i_send_iscsi_scsicmd(struct bnx2i_conn *conn, |
755 | struct bnx2i_cmd *cmnd); | 757 | struct bnx2i_cmd *cmnd); |
756 | extern int bnx2i_send_iscsi_nopout(struct bnx2i_conn *conn, | 758 | extern int bnx2i_send_iscsi_nopout(struct bnx2i_conn *conn, |
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index 96505e3ab986..1da34c019b8a 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c | |||
@@ -445,6 +445,56 @@ int bnx2i_send_iscsi_tmf(struct bnx2i_conn *bnx2i_conn, | |||
445 | } | 445 | } |
446 | 446 | ||
447 | /** | 447 | /** |
448 | * bnx2i_send_iscsi_text - post iSCSI text WQE to hardware | ||
449 | * @conn: iscsi connection | ||
450 | * @mtask: driver command structure which is requesting | ||
451 | * a WQE to sent to chip for further processing | ||
452 | * | ||
453 | * prepare and post an iSCSI Text request WQE to CNIC firmware | ||
454 | */ | ||
455 | int bnx2i_send_iscsi_text(struct bnx2i_conn *bnx2i_conn, | ||
456 | struct iscsi_task *mtask) | ||
457 | { | ||
458 | struct bnx2i_cmd *bnx2i_cmd; | ||
459 | struct bnx2i_text_request *text_wqe; | ||
460 | struct iscsi_text *text_hdr; | ||
461 | u32 dword; | ||
462 | |||
463 | bnx2i_cmd = (struct bnx2i_cmd *)mtask->dd_data; | ||
464 | text_hdr = (struct iscsi_text *)mtask->hdr; | ||
465 | text_wqe = (struct bnx2i_text_request *) bnx2i_conn->ep->qp.sq_prod_qe; | ||
466 | |||
467 | memset(text_wqe, 0, sizeof(struct bnx2i_text_request)); | ||
468 | |||
469 | text_wqe->op_code = text_hdr->opcode; | ||
470 | text_wqe->op_attr = text_hdr->flags; | ||
471 | text_wqe->data_length = ntoh24(text_hdr->dlength); | ||
472 | text_wqe->itt = mtask->itt | | ||
473 | (ISCSI_TASK_TYPE_MPATH << ISCSI_TEXT_REQUEST_TYPE_SHIFT); | ||
474 | text_wqe->ttt = be32_to_cpu(text_hdr->ttt); | ||
475 | |||
476 | text_wqe->cmd_sn = be32_to_cpu(text_hdr->cmdsn); | ||
477 | |||
478 | text_wqe->resp_bd_list_addr_lo = (u32) bnx2i_conn->gen_pdu.resp_bd_dma; | ||
479 | text_wqe->resp_bd_list_addr_hi = | ||
480 | (u32) ((u64) bnx2i_conn->gen_pdu.resp_bd_dma >> 32); | ||
481 | |||
482 | dword = ((1 << ISCSI_TEXT_REQUEST_NUM_RESP_BDS_SHIFT) | | ||
483 | (bnx2i_conn->gen_pdu.resp_buf_size << | ||
484 | ISCSI_TEXT_REQUEST_RESP_BUFFER_LENGTH_SHIFT)); | ||
485 | text_wqe->resp_buffer = dword; | ||
486 | text_wqe->bd_list_addr_lo = (u32) bnx2i_conn->gen_pdu.req_bd_dma; | ||
487 | text_wqe->bd_list_addr_hi = | ||
488 | (u32) ((u64) bnx2i_conn->gen_pdu.req_bd_dma >> 32); | ||
489 | text_wqe->num_bds = 1; | ||
490 | text_wqe->cq_index = 0; /* CQ# used for completion, 5771x only */ | ||
491 | |||
492 | bnx2i_ring_dbell_update_sq_params(bnx2i_conn, 1); | ||
493 | return 0; | ||
494 | } | ||
495 | |||
496 | |||
497 | /** | ||
448 | * bnx2i_send_iscsi_scsicmd - post iSCSI scsicmd request WQE to hardware | 498 | * bnx2i_send_iscsi_scsicmd - post iSCSI scsicmd request WQE to hardware |
449 | * @conn: iscsi connection | 499 | * @conn: iscsi connection |
450 | * @cmd: driver command structure which is requesting | 500 | * @cmd: driver command structure which is requesting |
@@ -490,15 +540,18 @@ int bnx2i_send_iscsi_nopout(struct bnx2i_conn *bnx2i_conn, | |||
490 | bnx2i_cmd = (struct bnx2i_cmd *)task->dd_data; | 540 | bnx2i_cmd = (struct bnx2i_cmd *)task->dd_data; |
491 | nopout_hdr = (struct iscsi_nopout *)task->hdr; | 541 | nopout_hdr = (struct iscsi_nopout *)task->hdr; |
492 | nopout_wqe = (struct bnx2i_nop_out_request *)ep->qp.sq_prod_qe; | 542 | nopout_wqe = (struct bnx2i_nop_out_request *)ep->qp.sq_prod_qe; |
543 | |||
544 | memset(nopout_wqe, 0x00, sizeof(struct bnx2i_nop_out_request)); | ||
545 | |||
493 | nopout_wqe->op_code = nopout_hdr->opcode; | 546 | nopout_wqe->op_code = nopout_hdr->opcode; |
494 | nopout_wqe->op_attr = ISCSI_FLAG_CMD_FINAL; | 547 | nopout_wqe->op_attr = ISCSI_FLAG_CMD_FINAL; |
495 | memcpy(nopout_wqe->lun, nopout_hdr->lun, 8); | 548 | memcpy(nopout_wqe->lun, nopout_hdr->lun, 8); |
496 | 549 | ||
497 | if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) { | 550 | if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) { |
498 | u32 tmp = nopout_hdr->lun[0]; | 551 | u32 tmp = nopout_wqe->lun[0]; |
499 | /* 57710 requires LUN field to be swapped */ | 552 | /* 57710 requires LUN field to be swapped */ |
500 | nopout_hdr->lun[0] = nopout_hdr->lun[1]; | 553 | nopout_wqe->lun[0] = nopout_wqe->lun[1]; |
501 | nopout_hdr->lun[1] = tmp; | 554 | nopout_wqe->lun[1] = tmp; |
502 | } | 555 | } |
503 | 556 | ||
504 | nopout_wqe->itt = ((u16)task->itt | | 557 | nopout_wqe->itt = ((u16)task->itt | |
@@ -1425,6 +1478,68 @@ done: | |||
1425 | return 0; | 1478 | return 0; |
1426 | } | 1479 | } |
1427 | 1480 | ||
1481 | |||
1482 | /** | ||
1483 | * bnx2i_process_text_resp - this function handles iscsi text response | ||
1484 | * @session: iscsi session pointer | ||
1485 | * @bnx2i_conn: iscsi connection pointer | ||
1486 | * @cqe: pointer to newly DMA'ed CQE entry for processing | ||
1487 | * | ||
1488 | * process iSCSI Text Response CQE& complete it to open-iscsi user daemon | ||
1489 | */ | ||
1490 | static int bnx2i_process_text_resp(struct iscsi_session *session, | ||
1491 | struct bnx2i_conn *bnx2i_conn, | ||
1492 | struct cqe *cqe) | ||
1493 | { | ||
1494 | struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; | ||
1495 | struct iscsi_task *task; | ||
1496 | struct bnx2i_text_response *text; | ||
1497 | struct iscsi_text_rsp *resp_hdr; | ||
1498 | int pld_len; | ||
1499 | int pad_len; | ||
1500 | |||
1501 | text = (struct bnx2i_text_response *) cqe; | ||
1502 | spin_lock(&session->lock); | ||
1503 | task = iscsi_itt_to_task(conn, text->itt & ISCSI_LOGIN_RESPONSE_INDEX); | ||
1504 | if (!task) | ||
1505 | goto done; | ||
1506 | |||
1507 | resp_hdr = (struct iscsi_text_rsp *)&bnx2i_conn->gen_pdu.resp_hdr; | ||
1508 | memset(resp_hdr, 0, sizeof(struct iscsi_hdr)); | ||
1509 | resp_hdr->opcode = text->op_code; | ||
1510 | resp_hdr->flags = text->response_flags; | ||
1511 | resp_hdr->hlength = 0; | ||
1512 | |||
1513 | hton24(resp_hdr->dlength, text->data_length); | ||
1514 | resp_hdr->itt = task->hdr->itt; | ||
1515 | resp_hdr->ttt = cpu_to_be32(text->ttt); | ||
1516 | resp_hdr->statsn = task->hdr->exp_statsn; | ||
1517 | resp_hdr->exp_cmdsn = cpu_to_be32(text->exp_cmd_sn); | ||
1518 | resp_hdr->max_cmdsn = cpu_to_be32(text->max_cmd_sn); | ||
1519 | pld_len = text->data_length; | ||
1520 | bnx2i_conn->gen_pdu.resp_wr_ptr = bnx2i_conn->gen_pdu.resp_buf + | ||
1521 | pld_len; | ||
1522 | pad_len = 0; | ||
1523 | if (pld_len & 0x3) | ||
1524 | pad_len = 4 - (pld_len % 4); | ||
1525 | |||
1526 | if (pad_len) { | ||
1527 | int i = 0; | ||
1528 | for (i = 0; i < pad_len; i++) { | ||
1529 | bnx2i_conn->gen_pdu.resp_wr_ptr[0] = 0; | ||
1530 | bnx2i_conn->gen_pdu.resp_wr_ptr++; | ||
1531 | } | ||
1532 | } | ||
1533 | __iscsi_complete_pdu(conn, (struct iscsi_hdr *)resp_hdr, | ||
1534 | bnx2i_conn->gen_pdu.resp_buf, | ||
1535 | bnx2i_conn->gen_pdu.resp_wr_ptr - | ||
1536 | bnx2i_conn->gen_pdu.resp_buf); | ||
1537 | done: | ||
1538 | spin_unlock(&session->lock); | ||
1539 | return 0; | ||
1540 | } | ||
1541 | |||
1542 | |||
1428 | /** | 1543 | /** |
1429 | * bnx2i_process_tmf_resp - this function handles iscsi TMF response | 1544 | * bnx2i_process_tmf_resp - this function handles iscsi TMF response |
1430 | * @session: iscsi session pointer | 1545 | * @session: iscsi session pointer |
@@ -1766,6 +1881,10 @@ static void bnx2i_process_new_cqes(struct bnx2i_conn *bnx2i_conn) | |||
1766 | bnx2i_process_tmf_resp(session, bnx2i_conn, | 1881 | bnx2i_process_tmf_resp(session, bnx2i_conn, |
1767 | qp->cq_cons_qe); | 1882 | qp->cq_cons_qe); |
1768 | break; | 1883 | break; |
1884 | case ISCSI_OP_TEXT_RSP: | ||
1885 | bnx2i_process_text_resp(session, bnx2i_conn, | ||
1886 | qp->cq_cons_qe); | ||
1887 | break; | ||
1769 | case ISCSI_OP_LOGOUT_RSP: | 1888 | case ISCSI_OP_LOGOUT_RSP: |
1770 | bnx2i_process_logout_resp(session, bnx2i_conn, | 1889 | bnx2i_process_logout_resp(session, bnx2i_conn, |
1771 | qp->cq_cons_qe); | 1890 | qp->cq_cons_qe); |
diff --git a/drivers/scsi/bnx2i/bnx2i_init.c b/drivers/scsi/bnx2i/bnx2i_init.c index 72a7b2d4a439..1d24a2819736 100644 --- a/drivers/scsi/bnx2i/bnx2i_init.c +++ b/drivers/scsi/bnx2i/bnx2i_init.c | |||
@@ -18,8 +18,8 @@ static struct list_head adapter_list = LIST_HEAD_INIT(adapter_list); | |||
18 | static u32 adapter_count; | 18 | static u32 adapter_count; |
19 | 19 | ||
20 | #define DRV_MODULE_NAME "bnx2i" | 20 | #define DRV_MODULE_NAME "bnx2i" |
21 | #define DRV_MODULE_VERSION "2.6.2.2" | 21 | #define DRV_MODULE_VERSION "2.6.2.3" |
22 | #define DRV_MODULE_RELDATE "Nov 23, 2010" | 22 | #define DRV_MODULE_RELDATE "Dec 31, 2010" |
23 | 23 | ||
24 | static char version[] __devinitdata = | 24 | static char version[] __devinitdata = |
25 | "Broadcom NetXtreme II iSCSI Driver " DRV_MODULE_NAME \ | 25 | "Broadcom NetXtreme II iSCSI Driver " DRV_MODULE_NAME \ |
@@ -29,7 +29,7 @@ static char version[] __devinitdata = | |||
29 | MODULE_AUTHOR("Anil Veerabhadrappa <anilgv@broadcom.com> and " | 29 | MODULE_AUTHOR("Anil Veerabhadrappa <anilgv@broadcom.com> and " |
30 | "Eddie Wai <eddie.wai@broadcom.com>"); | 30 | "Eddie Wai <eddie.wai@broadcom.com>"); |
31 | 31 | ||
32 | MODULE_DESCRIPTION("Broadcom NetXtreme II BCM5706/5708/5709/57710/57711" | 32 | MODULE_DESCRIPTION("Broadcom NetXtreme II BCM5706/5708/5709/57710/57711/57712" |
33 | " iSCSI Driver"); | 33 | " iSCSI Driver"); |
34 | MODULE_LICENSE("GPL"); | 34 | MODULE_LICENSE("GPL"); |
35 | MODULE_VERSION(DRV_MODULE_VERSION); | 35 | MODULE_VERSION(DRV_MODULE_VERSION); |
@@ -88,9 +88,11 @@ void bnx2i_identify_device(struct bnx2i_hba *hba) | |||
88 | (hba->pci_did == PCI_DEVICE_ID_NX2_5709S)) { | 88 | (hba->pci_did == PCI_DEVICE_ID_NX2_5709S)) { |
89 | set_bit(BNX2I_NX2_DEV_5709, &hba->cnic_dev_type); | 89 | set_bit(BNX2I_NX2_DEV_5709, &hba->cnic_dev_type); |
90 | hba->mail_queue_access = BNX2I_MQ_BIN_MODE; | 90 | hba->mail_queue_access = BNX2I_MQ_BIN_MODE; |
91 | } else if (hba->pci_did == PCI_DEVICE_ID_NX2_57710 || | 91 | } else if (hba->pci_did == PCI_DEVICE_ID_NX2_57710 || |
92 | hba->pci_did == PCI_DEVICE_ID_NX2_57711 || | 92 | hba->pci_did == PCI_DEVICE_ID_NX2_57711 || |
93 | hba->pci_did == PCI_DEVICE_ID_NX2_57711E) | 93 | hba->pci_did == PCI_DEVICE_ID_NX2_57711E || |
94 | hba->pci_did == PCI_DEVICE_ID_NX2_57712 || | ||
95 | hba->pci_did == PCI_DEVICE_ID_NX2_57712E) | ||
94 | set_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type); | 96 | set_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type); |
95 | else | 97 | else |
96 | printk(KERN_ALERT "bnx2i: unknown device, 0x%x\n", | 98 | printk(KERN_ALERT "bnx2i: unknown device, 0x%x\n", |
@@ -161,6 +163,21 @@ void bnx2i_start(void *handle) | |||
161 | struct bnx2i_hba *hba = handle; | 163 | struct bnx2i_hba *hba = handle; |
162 | int i = HZ; | 164 | int i = HZ; |
163 | 165 | ||
166 | if (!hba->cnic->max_iscsi_conn) { | ||
167 | printk(KERN_ALERT "bnx2i: dev %s does not support " | ||
168 | "iSCSI\n", hba->netdev->name); | ||
169 | |||
170 | if (test_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic)) { | ||
171 | mutex_lock(&bnx2i_dev_lock); | ||
172 | list_del_init(&hba->link); | ||
173 | adapter_count--; | ||
174 | hba->cnic->unregister_device(hba->cnic, CNIC_ULP_ISCSI); | ||
175 | clear_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic); | ||
176 | mutex_unlock(&bnx2i_dev_lock); | ||
177 | bnx2i_free_hba(hba); | ||
178 | } | ||
179 | return; | ||
180 | } | ||
164 | bnx2i_send_fw_iscsi_init_msg(hba); | 181 | bnx2i_send_fw_iscsi_init_msg(hba); |
165 | while (!test_bit(ADAPTER_STATE_UP, &hba->adapter_state) && i--) | 182 | while (!test_bit(ADAPTER_STATE_UP, &hba->adapter_state) && i--) |
166 | msleep(BNX2I_INIT_POLL_TIME); | 183 | msleep(BNX2I_INIT_POLL_TIME); |
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c index f0dce26593eb..1809f9ccc4ce 100644 --- a/drivers/scsi/bnx2i/bnx2i_iscsi.c +++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c | |||
@@ -1092,6 +1092,9 @@ static int bnx2i_iscsi_send_generic_request(struct iscsi_task *task) | |||
1092 | case ISCSI_OP_SCSI_TMFUNC: | 1092 | case ISCSI_OP_SCSI_TMFUNC: |
1093 | rc = bnx2i_send_iscsi_tmf(bnx2i_conn, task); | 1093 | rc = bnx2i_send_iscsi_tmf(bnx2i_conn, task); |
1094 | break; | 1094 | break; |
1095 | case ISCSI_OP_TEXT: | ||
1096 | rc = bnx2i_send_iscsi_text(bnx2i_conn, task); | ||
1097 | break; | ||
1095 | default: | 1098 | default: |
1096 | iscsi_conn_printk(KERN_ALERT, bnx2i_conn->cls_conn->dd_data, | 1099 | iscsi_conn_printk(KERN_ALERT, bnx2i_conn->cls_conn->dd_data, |
1097 | "send_gen: unsupported op 0x%x\n", | 1100 | "send_gen: unsupported op 0x%x\n", |
@@ -1455,42 +1458,40 @@ static void bnx2i_conn_destroy(struct iscsi_cls_conn *cls_conn) | |||
1455 | 1458 | ||
1456 | 1459 | ||
1457 | /** | 1460 | /** |
1458 | * bnx2i_conn_get_param - return iscsi connection parameter to caller | 1461 | * bnx2i_ep_get_param - return iscsi ep parameter to caller |
1459 | * @cls_conn: pointer to iscsi cls conn | 1462 | * @ep: pointer to iscsi endpoint |
1460 | * @param: parameter type identifier | 1463 | * @param: parameter type identifier |
1461 | * @buf: buffer pointer | 1464 | * @buf: buffer pointer |
1462 | * | 1465 | * |
1463 | * returns iSCSI connection parameters | 1466 | * returns iSCSI ep parameters |
1464 | */ | 1467 | */ |
1465 | static int bnx2i_conn_get_param(struct iscsi_cls_conn *cls_conn, | 1468 | static int bnx2i_ep_get_param(struct iscsi_endpoint *ep, |
1466 | enum iscsi_param param, char *buf) | 1469 | enum iscsi_param param, char *buf) |
1467 | { | 1470 | { |
1468 | struct iscsi_conn *conn = cls_conn->dd_data; | 1471 | struct bnx2i_endpoint *bnx2i_ep = ep->dd_data; |
1469 | struct bnx2i_conn *bnx2i_conn = conn->dd_data; | 1472 | struct bnx2i_hba *hba = bnx2i_ep->hba; |
1470 | int len = 0; | 1473 | int len = -ENOTCONN; |
1471 | 1474 | ||
1472 | if (!(bnx2i_conn && bnx2i_conn->ep && bnx2i_conn->ep->hba)) | 1475 | if (!hba) |
1473 | goto out; | 1476 | return -ENOTCONN; |
1474 | 1477 | ||
1475 | switch (param) { | 1478 | switch (param) { |
1476 | case ISCSI_PARAM_CONN_PORT: | 1479 | case ISCSI_PARAM_CONN_PORT: |
1477 | mutex_lock(&bnx2i_conn->ep->hba->net_dev_lock); | 1480 | mutex_lock(&hba->net_dev_lock); |
1478 | if (bnx2i_conn->ep->cm_sk) | 1481 | if (bnx2i_ep->cm_sk) |
1479 | len = sprintf(buf, "%hu\n", | 1482 | len = sprintf(buf, "%hu\n", bnx2i_ep->cm_sk->dst_port); |
1480 | bnx2i_conn->ep->cm_sk->dst_port); | 1483 | mutex_unlock(&hba->net_dev_lock); |
1481 | mutex_unlock(&bnx2i_conn->ep->hba->net_dev_lock); | ||
1482 | break; | 1484 | break; |
1483 | case ISCSI_PARAM_CONN_ADDRESS: | 1485 | case ISCSI_PARAM_CONN_ADDRESS: |
1484 | mutex_lock(&bnx2i_conn->ep->hba->net_dev_lock); | 1486 | mutex_lock(&hba->net_dev_lock); |
1485 | if (bnx2i_conn->ep->cm_sk) | 1487 | if (bnx2i_ep->cm_sk) |
1486 | len = sprintf(buf, "%pI4\n", | 1488 | len = sprintf(buf, "%pI4\n", &bnx2i_ep->cm_sk->dst_ip); |
1487 | &bnx2i_conn->ep->cm_sk->dst_ip); | 1489 | mutex_unlock(&hba->net_dev_lock); |
1488 | mutex_unlock(&bnx2i_conn->ep->hba->net_dev_lock); | ||
1489 | break; | 1490 | break; |
1490 | default: | 1491 | default: |
1491 | return iscsi_conn_get_param(cls_conn, param, buf); | 1492 | return -ENOSYS; |
1492 | } | 1493 | } |
1493 | out: | 1494 | |
1494 | return len; | 1495 | return len; |
1495 | } | 1496 | } |
1496 | 1497 | ||
@@ -1935,13 +1936,13 @@ static int bnx2i_ep_tcp_conn_active(struct bnx2i_endpoint *bnx2i_ep) | |||
1935 | cnic_dev_10g = 1; | 1936 | cnic_dev_10g = 1; |
1936 | 1937 | ||
1937 | switch (bnx2i_ep->state) { | 1938 | switch (bnx2i_ep->state) { |
1938 | case EP_STATE_CONNECT_FAILED: | ||
1939 | case EP_STATE_CLEANUP_FAILED: | 1939 | case EP_STATE_CLEANUP_FAILED: |
1940 | case EP_STATE_OFLD_FAILED: | 1940 | case EP_STATE_OFLD_FAILED: |
1941 | case EP_STATE_DISCONN_TIMEDOUT: | 1941 | case EP_STATE_DISCONN_TIMEDOUT: |
1942 | ret = 0; | 1942 | ret = 0; |
1943 | break; | 1943 | break; |
1944 | case EP_STATE_CONNECT_START: | 1944 | case EP_STATE_CONNECT_START: |
1945 | case EP_STATE_CONNECT_FAILED: | ||
1945 | case EP_STATE_CONNECT_COMPL: | 1946 | case EP_STATE_CONNECT_COMPL: |
1946 | case EP_STATE_ULP_UPDATE_START: | 1947 | case EP_STATE_ULP_UPDATE_START: |
1947 | case EP_STATE_ULP_UPDATE_COMPL: | 1948 | case EP_STATE_ULP_UPDATE_COMPL: |
@@ -2167,7 +2168,8 @@ struct iscsi_transport bnx2i_iscsi_transport = { | |||
2167 | .name = "bnx2i", | 2168 | .name = "bnx2i", |
2168 | .caps = CAP_RECOVERY_L0 | CAP_HDRDGST | | 2169 | .caps = CAP_RECOVERY_L0 | CAP_HDRDGST | |
2169 | CAP_MULTI_R2T | CAP_DATADGST | | 2170 | CAP_MULTI_R2T | CAP_DATADGST | |
2170 | CAP_DATA_PATH_OFFLOAD, | 2171 | CAP_DATA_PATH_OFFLOAD | |
2172 | CAP_TEXT_NEGO, | ||
2171 | .param_mask = ISCSI_MAX_RECV_DLENGTH | | 2173 | .param_mask = ISCSI_MAX_RECV_DLENGTH | |
2172 | ISCSI_MAX_XMIT_DLENGTH | | 2174 | ISCSI_MAX_XMIT_DLENGTH | |
2173 | ISCSI_HDRDGST_EN | | 2175 | ISCSI_HDRDGST_EN | |
@@ -2200,7 +2202,7 @@ struct iscsi_transport bnx2i_iscsi_transport = { | |||
2200 | .bind_conn = bnx2i_conn_bind, | 2202 | .bind_conn = bnx2i_conn_bind, |
2201 | .destroy_conn = bnx2i_conn_destroy, | 2203 | .destroy_conn = bnx2i_conn_destroy, |
2202 | .set_param = iscsi_set_param, | 2204 | .set_param = iscsi_set_param, |
2203 | .get_conn_param = bnx2i_conn_get_param, | 2205 | .get_conn_param = iscsi_conn_get_param, |
2204 | .get_session_param = iscsi_session_get_param, | 2206 | .get_session_param = iscsi_session_get_param, |
2205 | .get_host_param = bnx2i_host_get_param, | 2207 | .get_host_param = bnx2i_host_get_param, |
2206 | .start_conn = bnx2i_conn_start, | 2208 | .start_conn = bnx2i_conn_start, |
@@ -2209,6 +2211,7 @@ struct iscsi_transport bnx2i_iscsi_transport = { | |||
2209 | .xmit_task = bnx2i_task_xmit, | 2211 | .xmit_task = bnx2i_task_xmit, |
2210 | .get_stats = bnx2i_conn_get_stats, | 2212 | .get_stats = bnx2i_conn_get_stats, |
2211 | /* TCP connect - disconnect - option-2 interface calls */ | 2213 | /* TCP connect - disconnect - option-2 interface calls */ |
2214 | .get_ep_param = bnx2i_ep_get_param, | ||
2212 | .ep_connect = bnx2i_ep_connect, | 2215 | .ep_connect = bnx2i_ep_connect, |
2213 | .ep_poll = bnx2i_ep_poll, | 2216 | .ep_poll = bnx2i_ep_poll, |
2214 | .ep_disconnect = bnx2i_ep_disconnect, | 2217 | .ep_disconnect = bnx2i_ep_disconnect, |