aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/cxgb3i/cxgb3i_iscsi.c')
-rw-r--r--drivers/scsi/cxgb3i/cxgb3i_iscsi.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
index fa2a44f37b36..e185dedc4c1f 100644
--- a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
+++ b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
@@ -101,8 +101,7 @@ free_snic:
101} 101}
102 102
103/** 103/**
104 * cxgb3i_adapter_remove - release all the resources held and cleanup any 104 * cxgb3i_adapter_remove - release the resources held and cleanup h/w settings
105 * h/w settings
106 * @t3dev: t3cdev adapter 105 * @t3dev: t3cdev adapter
107 */ 106 */
108void cxgb3i_adapter_remove(struct t3cdev *t3dev) 107void cxgb3i_adapter_remove(struct t3cdev *t3dev)
@@ -135,8 +134,7 @@ void cxgb3i_adapter_remove(struct t3cdev *t3dev)
135} 134}
136 135
137/** 136/**
138 * cxgb3i_hba_find_by_netdev - find the cxgb3i_hba structure with a given 137 * cxgb3i_hba_find_by_netdev - find the cxgb3i_hba structure via net_device
139 * net_device
140 * @t3dev: t3cdev adapter 138 * @t3dev: t3cdev adapter
141 */ 139 */
142struct cxgb3i_hba *cxgb3i_hba_find_by_netdev(struct net_device *ndev) 140struct cxgb3i_hba *cxgb3i_hba_find_by_netdev(struct net_device *ndev)
@@ -170,8 +168,7 @@ struct cxgb3i_hba *cxgb3i_hba_host_add(struct cxgb3i_adapter *snic,
170 int err; 168 int err;
171 169
172 shost = iscsi_host_alloc(&cxgb3i_host_template, 170 shost = iscsi_host_alloc(&cxgb3i_host_template,
173 sizeof(struct cxgb3i_hba), 171 sizeof(struct cxgb3i_hba), 1);
174 CXGB3I_SCSI_QDEPTH_DFLT);
175 if (!shost) { 172 if (!shost) {
176 cxgb3i_log_info("iscsi_host_alloc failed.\n"); 173 cxgb3i_log_info("iscsi_host_alloc failed.\n");
177 return NULL; 174 return NULL;
@@ -335,13 +332,12 @@ static void cxgb3i_ep_disconnect(struct iscsi_endpoint *ep)
335 * @cmds_max: max # of commands 332 * @cmds_max: max # of commands
336 * @qdepth: scsi queue depth 333 * @qdepth: scsi queue depth
337 * @initial_cmdsn: initial iscsi CMDSN for this session 334 * @initial_cmdsn: initial iscsi CMDSN for this session
338 * @host_no: pointer to return host no
339 * 335 *
340 * Creates a new iSCSI session 336 * Creates a new iSCSI session
341 */ 337 */
342static struct iscsi_cls_session * 338static struct iscsi_cls_session *
343cxgb3i_session_create(struct iscsi_endpoint *ep, u16 cmds_max, u16 qdepth, 339cxgb3i_session_create(struct iscsi_endpoint *ep, u16 cmds_max, u16 qdepth,
344 u32 initial_cmdsn, u32 *host_no) 340 u32 initial_cmdsn)
345{ 341{
346 struct cxgb3i_endpoint *cep; 342 struct cxgb3i_endpoint *cep;
347 struct cxgb3i_hba *hba; 343 struct cxgb3i_hba *hba;
@@ -360,8 +356,6 @@ cxgb3i_session_create(struct iscsi_endpoint *ep, u16 cmds_max, u16 qdepth,
360 cxgb3i_api_debug("ep 0x%p, cep 0x%p, hba 0x%p.\n", ep, cep, hba); 356 cxgb3i_api_debug("ep 0x%p, cep 0x%p, hba 0x%p.\n", ep, cep, hba);
361 BUG_ON(hba != iscsi_host_priv(shost)); 357 BUG_ON(hba != iscsi_host_priv(shost));
362 358
363 *host_no = shost->host_no;
364
365 cls_session = iscsi_session_setup(&cxgb3i_iscsi_transport, shost, 359 cls_session = iscsi_session_setup(&cxgb3i_iscsi_transport, shost,
366 cmds_max, 360 cmds_max,
367 sizeof(struct iscsi_tcp_task) + 361 sizeof(struct iscsi_tcp_task) +
@@ -394,9 +388,9 @@ static void cxgb3i_session_destroy(struct iscsi_cls_session *cls_session)
394} 388}
395 389
396/** 390/**
397 * cxgb3i_conn_max_xmit_dlength -- check the max. xmit pdu segment size, 391 * cxgb3i_conn_max_xmit_dlength -- calc the max. xmit pdu segment size
398 * reduce it to be within the hardware limit if needed
399 * @conn: iscsi connection 392 * @conn: iscsi connection
393 * check the max. xmit pdu payload, reduce it if needed
400 */ 394 */
401static inline int cxgb3i_conn_max_xmit_dlength(struct iscsi_conn *conn) 395static inline int cxgb3i_conn_max_xmit_dlength(struct iscsi_conn *conn)
402 396
@@ -417,8 +411,7 @@ static inline int cxgb3i_conn_max_xmit_dlength(struct iscsi_conn *conn)
417} 411}
418 412
419/** 413/**
420 * cxgb3i_conn_max_recv_dlength -- check the max. recv pdu segment size against 414 * cxgb3i_conn_max_recv_dlength -- check the max. recv pdu segment size
421 * the hardware limit
422 * @conn: iscsi connection 415 * @conn: iscsi connection
423 * return 0 if the value is valid, < 0 otherwise. 416 * return 0 if the value is valid, < 0 otherwise.
424 */ 417 */
@@ -759,9 +752,9 @@ static void cxgb3i_parse_itt(struct iscsi_conn *conn, itt_t itt,
759 752
760/** 753/**
761 * cxgb3i_reserve_itt - generate tag for a give task 754 * cxgb3i_reserve_itt - generate tag for a give task
762 * Try to set up ddp for a scsi read task.
763 * @task: iscsi task 755 * @task: iscsi task
764 * @hdr_itt: tag, filled in by this function 756 * @hdr_itt: tag, filled in by this function
757 * Set up ddp for scsi read tasks if possible.
765 */ 758 */
766int cxgb3i_reserve_itt(struct iscsi_task *task, itt_t *hdr_itt) 759int cxgb3i_reserve_itt(struct iscsi_task *task, itt_t *hdr_itt)
767{ 760{
@@ -809,9 +802,9 @@ int cxgb3i_reserve_itt(struct iscsi_task *task, itt_t *hdr_itt)
809 802
810/** 803/**
811 * cxgb3i_release_itt - release the tag for a given task 804 * cxgb3i_release_itt - release the tag for a given task
812 * if the tag is a ddp tag, release the ddp setup
813 * @task: iscsi task 805 * @task: iscsi task
814 * @hdr_itt: tag 806 * @hdr_itt: tag
807 * If the tag is a ddp tag, release the ddp setup
815 */ 808 */
816void cxgb3i_release_itt(struct iscsi_task *task, itt_t hdr_itt) 809void cxgb3i_release_itt(struct iscsi_task *task, itt_t hdr_itt)
817{ 810{
@@ -843,7 +836,7 @@ static struct scsi_host_template cxgb3i_host_template = {
843 .can_queue = CXGB3I_SCSI_QDEPTH_DFLT - 1, 836 .can_queue = CXGB3I_SCSI_QDEPTH_DFLT - 1,
844 .sg_tablesize = SG_ALL, 837 .sg_tablesize = SG_ALL,
845 .max_sectors = 0xFFFF, 838 .max_sectors = 0xFFFF,
846 .cmd_per_lun = ISCSI_DEF_CMD_PER_LUN, 839 .cmd_per_lun = CXGB3I_SCSI_QDEPTH_DFLT,
847 .eh_abort_handler = iscsi_eh_abort, 840 .eh_abort_handler = iscsi_eh_abort,
848 .eh_device_reset_handler = iscsi_eh_device_reset, 841 .eh_device_reset_handler = iscsi_eh_device_reset,
849 .eh_target_reset_handler = iscsi_eh_target_reset, 842 .eh_target_reset_handler = iscsi_eh_target_reset,