aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/bnx2i/bnx2i_iscsi.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
index c66c5a45aa27..a46ccc380ab1 100644
--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
+++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
@@ -1500,6 +1500,26 @@ static int bnx2i_host_get_param(struct Scsi_Host *shost,
1500 case ISCSI_HOST_PARAM_NETDEV_NAME: 1500 case ISCSI_HOST_PARAM_NETDEV_NAME:
1501 len = sprintf(buf, "%s\n", hba->netdev->name); 1501 len = sprintf(buf, "%s\n", hba->netdev->name);
1502 break; 1502 break;
1503 case ISCSI_HOST_PARAM_IPADDRESS: {
1504 struct list_head *active_list = &hba->ep_active_list;
1505
1506 read_lock_bh(&hba->ep_rdwr_lock);
1507 if (!list_empty(&hba->ep_active_list)) {
1508 struct bnx2i_endpoint *bnx2i_ep;
1509 struct cnic_sock *csk;
1510
1511 bnx2i_ep = list_first_entry(active_list,
1512 struct bnx2i_endpoint,
1513 link);
1514 csk = bnx2i_ep->cm_sk;
1515 if (test_bit(SK_F_IPV6, &csk->flags))
1516 len = sprintf(buf, "%pI6\n", csk->src_ip);
1517 else
1518 len = sprintf(buf, "%pI4\n", csk->src_ip);
1519 }
1520 read_unlock_bh(&hba->ep_rdwr_lock);
1521 break;
1522 }
1503 default: 1523 default:
1504 return iscsi_host_get_param(shost, param, buf); 1524 return iscsi_host_get_param(shost, param, buf);
1505 } 1525 }
@@ -2131,7 +2151,8 @@ struct iscsi_transport bnx2i_iscsi_transport = {
2131 ISCSI_LU_RESET_TMO | ISCSI_TGT_RESET_TMO | 2151 ISCSI_LU_RESET_TMO | ISCSI_TGT_RESET_TMO |
2132 ISCSI_PING_TMO | ISCSI_RECV_TMO | 2152 ISCSI_PING_TMO | ISCSI_RECV_TMO |
2133 ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME, 2153 ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME,
2134 .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_NETDEV_NAME, 2154 .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS |
2155 ISCSI_HOST_NETDEV_NAME,
2135 .create_session = bnx2i_session_create, 2156 .create_session = bnx2i_session_create,
2136 .destroy_session = bnx2i_session_destroy, 2157 .destroy_session = bnx2i_session_destroy,
2137 .create_conn = bnx2i_conn_create, 2158 .create_conn = bnx2i_conn_create,