diff options
Diffstat (limited to 'drivers/scsi/scsi_transport_iscsi.c')
-rw-r--r-- | drivers/scsi/scsi_transport_iscsi.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index a631e58894f1..b4218390941e 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c | |||
@@ -1782,13 +1782,48 @@ iscsi_conn_attr(data_digest, ISCSI_PARAM_DATADGST_EN); | |||
1782 | iscsi_conn_attr(ifmarker, ISCSI_PARAM_IFMARKER_EN); | 1782 | iscsi_conn_attr(ifmarker, ISCSI_PARAM_IFMARKER_EN); |
1783 | iscsi_conn_attr(ofmarker, ISCSI_PARAM_OFMARKER_EN); | 1783 | iscsi_conn_attr(ofmarker, ISCSI_PARAM_OFMARKER_EN); |
1784 | iscsi_conn_attr(persistent_port, ISCSI_PARAM_PERSISTENT_PORT); | 1784 | iscsi_conn_attr(persistent_port, ISCSI_PARAM_PERSISTENT_PORT); |
1785 | iscsi_conn_attr(port, ISCSI_PARAM_CONN_PORT); | ||
1786 | iscsi_conn_attr(exp_statsn, ISCSI_PARAM_EXP_STATSN); | 1785 | iscsi_conn_attr(exp_statsn, ISCSI_PARAM_EXP_STATSN); |
1787 | iscsi_conn_attr(persistent_address, ISCSI_PARAM_PERSISTENT_ADDRESS); | 1786 | iscsi_conn_attr(persistent_address, ISCSI_PARAM_PERSISTENT_ADDRESS); |
1788 | iscsi_conn_attr(address, ISCSI_PARAM_CONN_ADDRESS); | ||
1789 | iscsi_conn_attr(ping_tmo, ISCSI_PARAM_PING_TMO); | 1787 | iscsi_conn_attr(ping_tmo, ISCSI_PARAM_PING_TMO); |
1790 | iscsi_conn_attr(recv_tmo, ISCSI_PARAM_RECV_TMO); | 1788 | iscsi_conn_attr(recv_tmo, ISCSI_PARAM_RECV_TMO); |
1791 | 1789 | ||
1790 | #define iscsi_conn_ep_attr_show(param) \ | ||
1791 | static ssize_t show_conn_ep_param_##param(struct device *dev, \ | ||
1792 | struct device_attribute *attr,\ | ||
1793 | char *buf) \ | ||
1794 | { \ | ||
1795 | struct iscsi_cls_conn *conn = iscsi_dev_to_conn(dev->parent); \ | ||
1796 | struct iscsi_transport *t = conn->transport; \ | ||
1797 | struct iscsi_endpoint *ep; \ | ||
1798 | ssize_t rc; \ | ||
1799 | \ | ||
1800 | /* \ | ||
1801 | * Need to make sure ep_disconnect does not free the LLD's \ | ||
1802 | * interconnect resources while we are trying to read them. \ | ||
1803 | */ \ | ||
1804 | mutex_lock(&conn->ep_mutex); \ | ||
1805 | ep = conn->ep; \ | ||
1806 | if (!ep && t->ep_connect) { \ | ||
1807 | mutex_unlock(&conn->ep_mutex); \ | ||
1808 | return -ENOTCONN; \ | ||
1809 | } \ | ||
1810 | \ | ||
1811 | if (ep) \ | ||
1812 | rc = t->get_ep_param(ep, param, buf); \ | ||
1813 | else \ | ||
1814 | rc = t->get_conn_param(conn, param, buf); \ | ||
1815 | mutex_unlock(&conn->ep_mutex); \ | ||
1816 | return rc; \ | ||
1817 | } | ||
1818 | |||
1819 | #define iscsi_conn_ep_attr(field, param) \ | ||
1820 | iscsi_conn_ep_attr_show(param) \ | ||
1821 | static ISCSI_CLASS_ATTR(conn, field, S_IRUGO, \ | ||
1822 | show_conn_ep_param_##param, NULL); | ||
1823 | |||
1824 | iscsi_conn_ep_attr(address, ISCSI_PARAM_CONN_ADDRESS); | ||
1825 | iscsi_conn_ep_attr(port, ISCSI_PARAM_CONN_PORT); | ||
1826 | |||
1792 | /* | 1827 | /* |
1793 | * iSCSI session attrs | 1828 | * iSCSI session attrs |
1794 | */ | 1829 | */ |