aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cxgbi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-17 20:54:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-17 20:54:40 -0400
commitc55d267de274d308927b60c3e740c1a826832317 (patch)
tree21b53a8c725d9f9650f60d94b349459d5b8dae10 /drivers/scsi/cxgbi
parent61ef46fd45c3c62dc7c880a45dd2aa841b9af8fb (diff)
parentbc898c97f7ba24def788d9f80786cf028a197122 (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/cxgbi')
-rw-r--r--drivers/scsi/cxgbi/cxgb3i/cxgb3i.c56
-rw-r--r--drivers/scsi/cxgbi/cxgb3i/cxgb3i.h19
-rw-r--r--drivers/scsi/cxgbi/cxgb4i/cxgb4i.c7
-rw-r--r--drivers/scsi/cxgbi/libcxgbi.c66
-rw-r--r--drivers/scsi/cxgbi/libcxgbi.h5
5 files changed, 56 insertions, 97 deletions
diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
index a129a170b47b..fc2cdb62f53b 100644
--- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
+++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
@@ -105,7 +105,7 @@ static struct iscsi_transport cxgb3i_iscsi_transport = {
105 /* owner and name should be set already */ 105 /* owner and name should be set already */
106 .caps = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_HDRDGST 106 .caps = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_HDRDGST
107 | CAP_DATADGST | CAP_DIGEST_OFFLOAD | 107 | CAP_DATADGST | CAP_DIGEST_OFFLOAD |
108 CAP_PADDING_OFFLOAD, 108 CAP_PADDING_OFFLOAD | CAP_TEXT_NEGO,
109 .param_mask = ISCSI_MAX_RECV_DLENGTH | ISCSI_MAX_XMIT_DLENGTH | 109 .param_mask = ISCSI_MAX_RECV_DLENGTH | ISCSI_MAX_XMIT_DLENGTH |
110 ISCSI_HDRDGST_EN | ISCSI_DATADGST_EN | 110 ISCSI_HDRDGST_EN | ISCSI_DATADGST_EN |
111 ISCSI_INITIAL_R2T_EN | ISCSI_MAX_R2T | 111 ISCSI_INITIAL_R2T_EN | ISCSI_MAX_R2T |
@@ -137,7 +137,7 @@ static struct iscsi_transport cxgb3i_iscsi_transport = {
137 .destroy_conn = iscsi_tcp_conn_teardown, 137 .destroy_conn = iscsi_tcp_conn_teardown,
138 .start_conn = iscsi_conn_start, 138 .start_conn = iscsi_conn_start,
139 .stop_conn = iscsi_conn_stop, 139 .stop_conn = iscsi_conn_stop,
140 .get_conn_param = cxgbi_get_conn_param, 140 .get_conn_param = iscsi_conn_get_param,
141 .set_param = cxgbi_set_conn_param, 141 .set_param = cxgbi_set_conn_param,
142 .get_stats = cxgbi_get_conn_stats, 142 .get_stats = cxgbi_get_conn_stats,
143 /* pdu xmit req from user space */ 143 /* pdu xmit req from user space */
@@ -152,6 +152,7 @@ static struct iscsi_transport cxgb3i_iscsi_transport = {
152 .xmit_pdu = cxgbi_conn_xmit_pdu, 152 .xmit_pdu = cxgbi_conn_xmit_pdu,
153 .parse_pdu_itt = cxgbi_parse_pdu_itt, 153 .parse_pdu_itt = cxgbi_parse_pdu_itt,
154 /* TCP connect/disconnect */ 154 /* TCP connect/disconnect */
155 .get_ep_param = cxgbi_get_ep_param,
155 .ep_connect = cxgbi_ep_connect, 156 .ep_connect = cxgbi_ep_connect,
156 .ep_poll = cxgbi_ep_poll, 157 .ep_poll = cxgbi_ep_poll,
157 .ep_disconnect = cxgbi_ep_disconnect, 158 .ep_disconnect = cxgbi_ep_disconnect,
@@ -1108,10 +1109,11 @@ static int ddp_set_map(struct cxgbi_sock *csk, struct cxgbi_pagepod_hdr *hdr,
1108 csk, idx, npods, gl); 1109 csk, idx, npods, gl);
1109 1110
1110 for (i = 0; i < npods; i++, idx++, pm_addr += PPOD_SIZE) { 1111 for (i = 0; i < npods; i++, idx++, pm_addr += PPOD_SIZE) {
1111 struct sk_buff *skb = ddp->gl_skb[idx]; 1112 struct sk_buff *skb = alloc_wr(sizeof(struct ulp_mem_io) +
1113 PPOD_SIZE, 0, GFP_ATOMIC);
1112 1114
1113 /* hold on to the skb until we clear the ddp mapping */ 1115 if (!skb)
1114 skb_get(skb); 1116 return -ENOMEM;
1115 1117
1116 ulp_mem_io_set_hdr(skb, pm_addr); 1118 ulp_mem_io_set_hdr(skb, pm_addr);
1117 cxgbi_ddp_ppod_set((struct cxgbi_pagepod *)(skb->head + 1119 cxgbi_ddp_ppod_set((struct cxgbi_pagepod *)(skb->head +
@@ -1136,56 +1138,20 @@ static void ddp_clear_map(struct cxgbi_hba *chba, unsigned int tag,
1136 cdev, idx, npods, tag); 1138 cdev, idx, npods, tag);
1137 1139
1138 for (i = 0; i < npods; i++, idx++, pm_addr += PPOD_SIZE) { 1140 for (i = 0; i < npods; i++, idx++, pm_addr += PPOD_SIZE) {
1139 struct sk_buff *skb = ddp->gl_skb[idx]; 1141 struct sk_buff *skb = alloc_wr(sizeof(struct ulp_mem_io) +
1142 PPOD_SIZE, 0, GFP_ATOMIC);
1140 1143
1141 if (!skb) { 1144 if (!skb) {
1142 pr_err("tag 0x%x, 0x%x, %d/%u, skb NULL.\n", 1145 pr_err("tag 0x%x, 0x%x, %d/%u, skb OOM.\n",
1143 tag, idx, i, npods); 1146 tag, idx, i, npods);
1144 continue; 1147 continue;
1145 } 1148 }
1146 ddp->gl_skb[idx] = NULL;
1147 memset(skb->head + sizeof(struct ulp_mem_io), 0, PPOD_SIZE);
1148 ulp_mem_io_set_hdr(skb, pm_addr); 1149 ulp_mem_io_set_hdr(skb, pm_addr);
1149 skb->priority = CPL_PRIORITY_CONTROL; 1150 skb->priority = CPL_PRIORITY_CONTROL;
1150 cxgb3_ofld_send(cdev->lldev, skb); 1151 cxgb3_ofld_send(cdev->lldev, skb);
1151 } 1152 }
1152} 1153}
1153 1154
1154static void ddp_free_gl_skb(struct cxgbi_ddp_info *ddp, int idx, int cnt)
1155{
1156 int i;
1157
1158 log_debug(1 << CXGBI_DBG_DDP,
1159 "ddp 0x%p, idx %d, cnt %d.\n", ddp, idx, cnt);
1160
1161 for (i = 0; i < cnt; i++, idx++)
1162 if (ddp->gl_skb[idx]) {
1163 kfree_skb(ddp->gl_skb[idx]);
1164 ddp->gl_skb[idx] = NULL;
1165 }
1166}
1167
1168static int ddp_alloc_gl_skb(struct cxgbi_ddp_info *ddp, int idx,
1169 int cnt, gfp_t gfp)
1170{
1171 int i;
1172
1173 log_debug(1 << CXGBI_DBG_DDP,
1174 "ddp 0x%p, idx %d, cnt %d.\n", ddp, idx, cnt);
1175
1176 for (i = 0; i < cnt; i++) {
1177 struct sk_buff *skb = alloc_wr(sizeof(struct ulp_mem_io) +
1178 PPOD_SIZE, 0, gfp);
1179 if (skb)
1180 ddp->gl_skb[idx + i] = skb;
1181 else {
1182 ddp_free_gl_skb(ddp, idx, i);
1183 return -ENOMEM;
1184 }
1185 }
1186 return 0;
1187}
1188
1189static int ddp_setup_conn_pgidx(struct cxgbi_sock *csk, 1155static int ddp_setup_conn_pgidx(struct cxgbi_sock *csk,
1190 unsigned int tid, int pg_idx, bool reply) 1156 unsigned int tid, int pg_idx, bool reply)
1191{ 1157{
@@ -1316,8 +1282,6 @@ static int cxgb3i_ddp_init(struct cxgbi_device *cdev)
1316 } 1282 }
1317 tdev->ulp_iscsi = ddp; 1283 tdev->ulp_iscsi = ddp;
1318 1284
1319 cdev->csk_ddp_free_gl_skb = ddp_free_gl_skb;
1320 cdev->csk_ddp_alloc_gl_skb = ddp_alloc_gl_skb;
1321 cdev->csk_ddp_setup_digest = ddp_setup_conn_digest; 1285 cdev->csk_ddp_setup_digest = ddp_setup_conn_digest;
1322 cdev->csk_ddp_setup_pgidx = ddp_setup_conn_pgidx; 1286 cdev->csk_ddp_setup_pgidx = ddp_setup_conn_pgidx;
1323 cdev->csk_ddp_set = ddp_set_map; 1287 cdev->csk_ddp_set = ddp_set_map;
diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h
index 5f5e3394b594..20593fd69d8f 100644
--- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h
+++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h
@@ -24,10 +24,21 @@
24 24
25extern cxgb3_cpl_handler_func cxgb3i_cpl_handlers[NUM_CPL_CMDS]; 25extern cxgb3_cpl_handler_func cxgb3i_cpl_handlers[NUM_CPL_CMDS];
26 26
27#define cxgb3i_get_private_ipv4addr(ndev) \ 27static inline unsigned int cxgb3i_get_private_ipv4addr(struct net_device *ndev)
28 (((struct port_info *)(netdev_priv(ndev)))->iscsi_ipv4addr) 28{
29#define cxgb3i_set_private_ipv4addr(ndev, addr) \ 29 return ((struct port_info *)(netdev_priv(ndev)))->iscsi_ipv4addr;
30 (((struct port_info *)(netdev_priv(ndev)))->iscsi_ipv4addr) = addr 30}
31
32static inline void cxgb3i_set_private_ipv4addr(struct net_device *ndev,
33 unsigned int addr)
34{
35 struct port_info *pi = (struct port_info *)netdev_priv(ndev);
36
37 pi->iscsic.flags = addr ? 1 : 0;
38 pi->iscsi_ipv4addr = addr;
39 if (addr)
40 memcpy(pi->iscsic.mac_addr, ndev->dev_addr, ETH_ALEN);
41}
31 42
32struct cpl_iscsi_hdr_norss { 43struct cpl_iscsi_hdr_norss {
33 union opcode_tid ot; 44 union opcode_tid ot;
diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
index 8c04fada710b..f3a4cd7cf782 100644
--- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
+++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
@@ -106,7 +106,7 @@ static struct iscsi_transport cxgb4i_iscsi_transport = {
106 .name = DRV_MODULE_NAME, 106 .name = DRV_MODULE_NAME,
107 .caps = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_HDRDGST | 107 .caps = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_HDRDGST |
108 CAP_DATADGST | CAP_DIGEST_OFFLOAD | 108 CAP_DATADGST | CAP_DIGEST_OFFLOAD |
109 CAP_PADDING_OFFLOAD, 109 CAP_PADDING_OFFLOAD | CAP_TEXT_NEGO,
110 .param_mask = ISCSI_MAX_RECV_DLENGTH | ISCSI_MAX_XMIT_DLENGTH | 110 .param_mask = ISCSI_MAX_RECV_DLENGTH | ISCSI_MAX_XMIT_DLENGTH |
111 ISCSI_HDRDGST_EN | ISCSI_DATADGST_EN | 111 ISCSI_HDRDGST_EN | ISCSI_DATADGST_EN |
112 ISCSI_INITIAL_R2T_EN | ISCSI_MAX_R2T | 112 ISCSI_INITIAL_R2T_EN | ISCSI_MAX_R2T |
@@ -138,7 +138,7 @@ static struct iscsi_transport cxgb4i_iscsi_transport = {
138 .destroy_conn = iscsi_tcp_conn_teardown, 138 .destroy_conn = iscsi_tcp_conn_teardown,
139 .start_conn = iscsi_conn_start, 139 .start_conn = iscsi_conn_start,
140 .stop_conn = iscsi_conn_stop, 140 .stop_conn = iscsi_conn_stop,
141 .get_conn_param = cxgbi_get_conn_param, 141 .get_conn_param = iscsi_conn_get_param,
142 .set_param = cxgbi_set_conn_param, 142 .set_param = cxgbi_set_conn_param,
143 .get_stats = cxgbi_get_conn_stats, 143 .get_stats = cxgbi_get_conn_stats,
144 /* pdu xmit req from user space */ 144 /* pdu xmit req from user space */
@@ -153,6 +153,7 @@ static struct iscsi_transport cxgb4i_iscsi_transport = {
153 .xmit_pdu = cxgbi_conn_xmit_pdu, 153 .xmit_pdu = cxgbi_conn_xmit_pdu,
154 .parse_pdu_itt = cxgbi_parse_pdu_itt, 154 .parse_pdu_itt = cxgbi_parse_pdu_itt,
155 /* TCP connect/disconnect */ 155 /* TCP connect/disconnect */
156 .get_ep_param = cxgbi_get_ep_param,
156 .ep_connect = cxgbi_ep_connect, 157 .ep_connect = cxgbi_ep_connect,
157 .ep_poll = cxgbi_ep_poll, 158 .ep_poll = cxgbi_ep_poll,
158 .ep_disconnect = cxgbi_ep_disconnect, 159 .ep_disconnect = cxgbi_ep_disconnect,
@@ -1425,8 +1426,6 @@ static int cxgb4i_ddp_init(struct cxgbi_device *cdev)
1425 cxgbi_ddp_page_size_factor(pgsz_factor); 1426 cxgbi_ddp_page_size_factor(pgsz_factor);
1426 cxgb4_iscsi_init(lldi->ports[0], tagmask, pgsz_factor); 1427 cxgb4_iscsi_init(lldi->ports[0], tagmask, pgsz_factor);
1427 1428
1428 cdev->csk_ddp_free_gl_skb = NULL;
1429 cdev->csk_ddp_alloc_gl_skb = NULL;
1430 cdev->csk_ddp_setup_digest = ddp_setup_conn_digest; 1429 cdev->csk_ddp_setup_digest = ddp_setup_conn_digest;
1431 cdev->csk_ddp_setup_pgidx = ddp_setup_conn_pgidx; 1430 cdev->csk_ddp_setup_pgidx = ddp_setup_conn_pgidx;
1432 cdev->csk_ddp_set = ddp_set_map; 1431 cdev->csk_ddp_set = ddp_set_map;
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index a24dff9f9163..de764ea7419d 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -530,6 +530,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr)
530 csk->dst = dst; 530 csk->dst = dst;
531 csk->daddr.sin_addr.s_addr = daddr->sin_addr.s_addr; 531 csk->daddr.sin_addr.s_addr = daddr->sin_addr.s_addr;
532 csk->daddr.sin_port = daddr->sin_port; 532 csk->daddr.sin_port = daddr->sin_port;
533 csk->daddr.sin_family = daddr->sin_family;
533 csk->saddr.sin_addr.s_addr = rt->rt_src; 534 csk->saddr.sin_addr.s_addr = rt->rt_src;
534 535
535 return csk; 536 return csk;
@@ -1264,12 +1265,6 @@ static int ddp_tag_reserve(struct cxgbi_sock *csk, unsigned int tid,
1264 return idx; 1265 return idx;
1265 } 1266 }
1266 1267
1267 if (cdev->csk_ddp_alloc_gl_skb) {
1268 err = cdev->csk_ddp_alloc_gl_skb(ddp, idx, npods, gfp);
1269 if (err < 0)
1270 goto unmark_entries;
1271 }
1272
1273 tag = cxgbi_ddp_tag_base(tformat, sw_tag); 1268 tag = cxgbi_ddp_tag_base(tformat, sw_tag);
1274 tag |= idx << PPOD_IDX_SHIFT; 1269 tag |= idx << PPOD_IDX_SHIFT;
1275 1270
@@ -1280,11 +1275,8 @@ static int ddp_tag_reserve(struct cxgbi_sock *csk, unsigned int tid,
1280 hdr.page_offset = htonl(gl->offset); 1275 hdr.page_offset = htonl(gl->offset);
1281 1276
1282 err = cdev->csk_ddp_set(csk, &hdr, idx, npods, gl); 1277 err = cdev->csk_ddp_set(csk, &hdr, idx, npods, gl);
1283 if (err < 0) { 1278 if (err < 0)
1284 if (cdev->csk_ddp_free_gl_skb)
1285 cdev->csk_ddp_free_gl_skb(ddp, idx, npods);
1286 goto unmark_entries; 1279 goto unmark_entries;
1287 }
1288 1280
1289 ddp->idx_last = idx; 1281 ddp->idx_last = idx;
1290 log_debug(1 << CXGBI_DBG_DDP, 1282 log_debug(1 << CXGBI_DBG_DDP,
@@ -1350,8 +1342,6 @@ static void ddp_destroy(struct kref *kref)
1350 >> PPOD_PAGES_SHIFT; 1342 >> PPOD_PAGES_SHIFT;
1351 pr_info("cdev 0x%p, ddp %d + %d.\n", cdev, i, npods); 1343 pr_info("cdev 0x%p, ddp %d + %d.\n", cdev, i, npods);
1352 kfree(gl); 1344 kfree(gl);
1353 if (cdev->csk_ddp_free_gl_skb)
1354 cdev->csk_ddp_free_gl_skb(ddp, i, npods);
1355 i += npods; 1345 i += npods;
1356 } else 1346 } else
1357 i++; 1347 i++;
@@ -1394,8 +1384,6 @@ int cxgbi_ddp_init(struct cxgbi_device *cdev,
1394 return -ENOMEM; 1384 return -ENOMEM;
1395 } 1385 }
1396 ddp->gl_map = (struct cxgbi_gather_list **)(ddp + 1); 1386 ddp->gl_map = (struct cxgbi_gather_list **)(ddp + 1);
1397 ddp->gl_skb = (struct sk_buff **)(((char *)ddp->gl_map) +
1398 ppmax * sizeof(struct cxgbi_gather_list *));
1399 cdev->ddp = ddp; 1387 cdev->ddp = ddp;
1400 1388
1401 spin_lock_init(&ddp->map_lock); 1389 spin_lock_init(&ddp->map_lock);
@@ -1895,13 +1883,16 @@ EXPORT_SYMBOL_GPL(cxgbi_conn_alloc_pdu);
1895 1883
1896static inline void tx_skb_setmode(struct sk_buff *skb, int hcrc, int dcrc) 1884static inline void tx_skb_setmode(struct sk_buff *skb, int hcrc, int dcrc)
1897{ 1885{
1898 u8 submode = 0; 1886 if (hcrc || dcrc) {
1887 u8 submode = 0;
1899 1888
1900 if (hcrc) 1889 if (hcrc)
1901 submode |= 1; 1890 submode |= 1;
1902 if (dcrc) 1891 if (dcrc)
1903 submode |= 2; 1892 submode |= 2;
1904 cxgbi_skcb_ulp_mode(skb) = (ULP2_MODE_ISCSI << 4) | submode; 1893 cxgbi_skcb_ulp_mode(skb) = (ULP2_MODE_ISCSI << 4) | submode;
1894 } else
1895 cxgbi_skcb_ulp_mode(skb) = 0;
1905} 1896}
1906 1897
1907int cxgbi_conn_init_pdu(struct iscsi_task *task, unsigned int offset, 1898int cxgbi_conn_init_pdu(struct iscsi_task *task, unsigned int offset,
@@ -2197,32 +2188,34 @@ int cxgbi_set_conn_param(struct iscsi_cls_conn *cls_conn,
2197} 2188}
2198EXPORT_SYMBOL_GPL(cxgbi_set_conn_param); 2189EXPORT_SYMBOL_GPL(cxgbi_set_conn_param);
2199 2190
2200int cxgbi_get_conn_param(struct iscsi_cls_conn *cls_conn, 2191int cxgbi_get_ep_param(struct iscsi_endpoint *ep, enum iscsi_param param,
2201 enum iscsi_param param, char *buf) 2192 char *buf)
2202{ 2193{
2203 struct iscsi_conn *iconn = cls_conn->dd_data; 2194 struct cxgbi_endpoint *cep = ep->dd_data;
2195 struct cxgbi_sock *csk;
2204 int len; 2196 int len;
2205 2197
2206 log_debug(1 << CXGBI_DBG_ISCSI, 2198 log_debug(1 << CXGBI_DBG_ISCSI,
2207 "cls_conn 0x%p, param %d.\n", cls_conn, param); 2199 "cls_conn 0x%p, param %d.\n", ep, param);
2208 2200
2209 switch (param) { 2201 switch (param) {
2210 case ISCSI_PARAM_CONN_PORT: 2202 case ISCSI_PARAM_CONN_PORT:
2211 spin_lock_bh(&iconn->session->lock);
2212 len = sprintf(buf, "%hu\n", iconn->portal_port);
2213 spin_unlock_bh(&iconn->session->lock);
2214 break;
2215 case ISCSI_PARAM_CONN_ADDRESS: 2203 case ISCSI_PARAM_CONN_ADDRESS:
2216 spin_lock_bh(&iconn->session->lock); 2204 if (!cep)
2217 len = sprintf(buf, "%s\n", iconn->portal_address); 2205 return -ENOTCONN;
2218 spin_unlock_bh(&iconn->session->lock); 2206
2219 break; 2207 csk = cep->csk;
2208 if (!csk)
2209 return -ENOTCONN;
2210
2211 return iscsi_conn_get_addr_param((struct sockaddr_storage *)
2212 &csk->daddr, param, buf);
2220 default: 2213 default:
2221 return iscsi_conn_get_param(cls_conn, param, buf); 2214 return -ENOSYS;
2222 } 2215 }
2223 return len; 2216 return len;
2224} 2217}
2225EXPORT_SYMBOL_GPL(cxgbi_get_conn_param); 2218EXPORT_SYMBOL_GPL(cxgbi_get_ep_param);
2226 2219
2227struct iscsi_cls_conn * 2220struct iscsi_cls_conn *
2228cxgbi_create_conn(struct iscsi_cls_session *cls_session, u32 cid) 2221cxgbi_create_conn(struct iscsi_cls_session *cls_session, u32 cid)
@@ -2289,11 +2282,6 @@ int cxgbi_bind_conn(struct iscsi_cls_session *cls_session,
2289 cxgbi_conn_max_xmit_dlength(conn); 2282 cxgbi_conn_max_xmit_dlength(conn);
2290 cxgbi_conn_max_recv_dlength(conn); 2283 cxgbi_conn_max_recv_dlength(conn);
2291 2284
2292 spin_lock_bh(&conn->session->lock);
2293 sprintf(conn->portal_address, "%pI4", &csk->daddr.sin_addr.s_addr);
2294 conn->portal_port = ntohs(csk->daddr.sin_port);
2295 spin_unlock_bh(&conn->session->lock);
2296
2297 log_debug(1 << CXGBI_DBG_ISCSI, 2285 log_debug(1 << CXGBI_DBG_ISCSI,
2298 "cls 0x%p,0x%p, ep 0x%p, cconn 0x%p, csk 0x%p.\n", 2286 "cls 0x%p,0x%p, ep 0x%p, cconn 0x%p, csk 0x%p.\n",
2299 cls_session, cls_conn, ep, cconn, csk); 2287 cls_session, cls_conn, ep, cconn, csk);
diff --git a/drivers/scsi/cxgbi/libcxgbi.h b/drivers/scsi/cxgbi/libcxgbi.h
index c57d59db000c..0a20fd5f7102 100644
--- a/drivers/scsi/cxgbi/libcxgbi.h
+++ b/drivers/scsi/cxgbi/libcxgbi.h
@@ -131,7 +131,6 @@ struct cxgbi_ddp_info {
131 unsigned int rsvd_tag_mask; 131 unsigned int rsvd_tag_mask;
132 spinlock_t map_lock; 132 spinlock_t map_lock;
133 struct cxgbi_gather_list **gl_map; 133 struct cxgbi_gather_list **gl_map;
134 struct sk_buff **gl_skb;
135}; 134};
136 135
137#define DDP_PGIDX_MAX 4 136#define DDP_PGIDX_MAX 4
@@ -536,8 +535,6 @@ struct cxgbi_device {
536 struct cxgbi_ddp_info *ddp; 535 struct cxgbi_ddp_info *ddp;
537 536
538 void (*dev_ddp_cleanup)(struct cxgbi_device *); 537 void (*dev_ddp_cleanup)(struct cxgbi_device *);
539 void (*csk_ddp_free_gl_skb)(struct cxgbi_ddp_info *, int, int);
540 int (*csk_ddp_alloc_gl_skb)(struct cxgbi_ddp_info *, int, int, gfp_t);
541 int (*csk_ddp_set)(struct cxgbi_sock *, struct cxgbi_pagepod_hdr *, 538 int (*csk_ddp_set)(struct cxgbi_sock *, struct cxgbi_pagepod_hdr *,
542 unsigned int, unsigned int, 539 unsigned int, unsigned int,
543 struct cxgbi_gather_list *); 540 struct cxgbi_gather_list *);
@@ -715,7 +712,7 @@ void cxgbi_cleanup_task(struct iscsi_task *task);
715void cxgbi_get_conn_stats(struct iscsi_cls_conn *, struct iscsi_stats *); 712void cxgbi_get_conn_stats(struct iscsi_cls_conn *, struct iscsi_stats *);
716int cxgbi_set_conn_param(struct iscsi_cls_conn *, 713int cxgbi_set_conn_param(struct iscsi_cls_conn *,
717 enum iscsi_param, char *, int); 714 enum iscsi_param, char *, int);
718int cxgbi_get_conn_param(struct iscsi_cls_conn *, enum iscsi_param, char *); 715int cxgbi_get_ep_param(struct iscsi_endpoint *ep, enum iscsi_param, char *);
719struct iscsi_cls_conn *cxgbi_create_conn(struct iscsi_cls_session *, u32); 716struct iscsi_cls_conn *cxgbi_create_conn(struct iscsi_cls_session *, u32);
720int cxgbi_bind_conn(struct iscsi_cls_session *, 717int cxgbi_bind_conn(struct iscsi_cls_session *,
721 struct iscsi_cls_conn *, u64, int); 718 struct iscsi_cls_conn *, u64, int);