From: <vl...@us...> - 2008-05-19 10:21:51
|
Revision: 377 http://scst.svn.sourceforge.net/scst/?rev=377&view=rev Author: vlnb Date: 2008-05-19 03:21:41 -0700 (Mon, 19 May 2008) Log Message: ----------- Patch from Bart Van Assche <bar...@gm...>, except few chuncks from qla2x00t/ obviously not related to the target mode addon: One of the Linux kernel patch submission requirements is that source files do not contain trailing whitespace. The patch below removes trailing whitespace from .c and .h source files. Note: it might be more convenient to run the script I used to generate this patch than to review and apply the patch below. This is how I generated and verified the patch below: cat <<EOF >./strip-trailing-whitespace #!/bin/bash trap "rm -f $t" EXIT t=/tmp/temporary-file.$$ for f in "$@" do sed 's/[ ]*$//' <"$f" >"$t" && mv "$t" "$f" done EOF chmod a+x ./strip-trailing-whitespace find -name '*.[ch]' | xargs ./strip-trailing-whitespace svn diff -x -w Signed-off-by: <bar...@gm...> Modified Paths: -------------- trunk/iscsi-scst/include/iscsi_scst.h trunk/iscsi-scst/include/iscsi_scst_ver.h trunk/iscsi-scst/kernel/config.c trunk/iscsi-scst/kernel/conn.c trunk/iscsi-scst/kernel/digest.c trunk/iscsi-scst/kernel/digest.h trunk/iscsi-scst/kernel/event.c trunk/iscsi-scst/kernel/iscsi.c trunk/iscsi-scst/kernel/iscsi.h trunk/iscsi-scst/kernel/iscsi_dbg.h trunk/iscsi-scst/kernel/iscsi_hdr.h trunk/iscsi-scst/kernel/nthread.c trunk/iscsi-scst/kernel/param.c trunk/iscsi-scst/kernel/session.c trunk/iscsi-scst/kernel/target.c trunk/iscsi-scst/usr/chap.c trunk/iscsi-scst/usr/config.h trunk/iscsi-scst/usr/conn.c trunk/iscsi-scst/usr/ctldev.c trunk/iscsi-scst/usr/event.c trunk/iscsi-scst/usr/iscsi_adm.c trunk/iscsi-scst/usr/iscsi_adm.h trunk/iscsi-scst/usr/iscsi_hdr.h trunk/iscsi-scst/usr/iscsi_scstd.c trunk/iscsi-scst/usr/iscsid.c trunk/iscsi-scst/usr/iscsid.h trunk/iscsi-scst/usr/log.c trunk/iscsi-scst/usr/message.c trunk/iscsi-scst/usr/misc.h trunk/iscsi-scst/usr/param.c trunk/iscsi-scst/usr/param.h trunk/iscsi-scst/usr/plain.c trunk/iscsi-scst/usr/session.c trunk/iscsi-scst/usr/target.c trunk/iscsi-scst/usr/types.h trunk/mpt/mpt_scst.c trunk/mpt/mpt_scst.h trunk/qla2x00t/qla2x00-target/qla2x00t.c trunk/qla2x00t/qla2x00-target/qla2x00t.h trunk/qla2x00t/qla2x_tgt.h trunk/qla2x00t/qla2x_tgt_def.h trunk/qla2x00t/qla_attr.c trunk/qla2x00t/qla_dbg.c trunk/qla2x00t/qla_init.c trunk/qla2x00t/qla_isr.c trunk/qla2x00t/qla_os.c trunk/qla_isp/common/isp.c trunk/qla_isp/common/isp_library.c trunk/qla_isp/common/isp_library.h trunk/qla_isp/common/isp_stds.h trunk/qla_isp/common/isp_target.c trunk/qla_isp/common/isp_target.h trunk/qla_isp/common/isp_tpublic.h trunk/qla_isp/common/ispmbox.h trunk/qla_isp/common/ispreg.h trunk/qla_isp/common/ispvar.h trunk/qla_isp/firmware/asm_1000.h trunk/qla_isp/firmware/asm_1040.h trunk/qla_isp/firmware/asm_1080.h trunk/qla_isp/firmware/asm_12160.h trunk/qla_isp/firmware/asm_2100.h trunk/qla_isp/firmware/asm_2200.h trunk/qla_isp/firmware/asm_2300.h trunk/qla_isp/firmware/asm_2322.h trunk/qla_isp/firmware/asm_2400.h trunk/qla_isp/linux/exioct.h trunk/qla_isp/linux/exioctln.h trunk/qla_isp/linux/isp_cb_ops.c trunk/qla_isp/linux/isp_ioctl.h trunk/qla_isp/linux/isp_linux.c trunk/qla_isp/linux/isp_linux.h trunk/qla_isp/linux/isp_pci.c trunk/qla_isp/linux/scsi_target.c trunk/qla_isp/linux/scsi_target.h trunk/qla_isp/linux/scsi_target_ctl.c trunk/scst/include/scst.h trunk/scst/include/scst_const.h trunk/scst/include/scst_debug.h trunk/scst/include/scst_user.h trunk/scst/src/dev_handlers/scst_cdrom.c trunk/scst/src/dev_handlers/scst_changer.c trunk/scst/src/dev_handlers/scst_dev_handler.h trunk/scst/src/dev_handlers/scst_disk.c trunk/scst/src/dev_handlers/scst_modisk.c trunk/scst/src/dev_handlers/scst_processor.c trunk/scst/src/dev_handlers/scst_raid.c trunk/scst/src/dev_handlers/scst_tape.c trunk/scst/src/dev_handlers/scst_user.c trunk/scst/src/dev_handlers/scst_vdisk.c trunk/scst/src/scst_cdbprobe.h trunk/scst/src/scst_debug.c trunk/scst/src/scst_lib.c trunk/scst/src/scst_main.c trunk/scst/src/scst_mem.c trunk/scst/src/scst_mem.h trunk/scst/src/scst_module.c trunk/scst/src/scst_priv.h trunk/scst/src/scst_proc.c trunk/scst/src/scst_targ.c trunk/srpt/src/ib_srpt.c trunk/usr/fileio/common.c trunk/usr/fileio/common.h trunk/usr/fileio/debug.c trunk/usr/fileio/debug.h trunk/usr/fileio/fileio.c Modified: trunk/iscsi-scst/include/iscsi_scst.h =================================================================== --- trunk/iscsi-scst/include/iscsi_scst.h 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/include/iscsi_scst.h 2008-05-19 10:21:41 UTC (rev 377) @@ -1,12 +1,12 @@ /* * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/include/iscsi_scst_ver.h =================================================================== --- trunk/iscsi-scst/include/iscsi_scst_ver.h 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/include/iscsi_scst_ver.h 2008-05-19 10:21:41 UTC (rev 377) @@ -1,12 +1,12 @@ /* * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/kernel/config.c =================================================================== --- trunk/iscsi-scst/kernel/config.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/kernel/config.c 2008-05-19 10:21:41 UTC (rev 377) @@ -2,11 +2,11 @@ * Copyright (C) 2004 - 2005 FUJITA Tomonori <to...@ac...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -505,7 +505,7 @@ if (trace_flag & TRACE_D_IOV) { int i; printk("%p, %zd\n", msg->msg_iov, msg->msg_iovlen); - for (i = 0; i < min_t(size_t, msg->msg_iovlen, + for (i = 0; i < min_t(size_t, msg->msg_iovlen, ISCSI_CONN_IOV_MAX); i++) { printk("%d: %p,%zd\n", i, msg->msg_iov[i].iov_base, msg->msg_iov[i].iov_len); Modified: trunk/iscsi-scst/kernel/conn.c =================================================================== --- trunk/iscsi-scst/kernel/conn.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/kernel/conn.c 2008-05-19 10:21:41 UTC (rev 377) @@ -2,12 +2,12 @@ * Copyright (C) 2002-2003 Ardis Technolgies <ro...@ar...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/kernel/digest.c =================================================================== --- trunk/iscsi-scst/kernel/digest.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/kernel/digest.c 2008-05-19 10:21:41 UTC (rev 377) @@ -4,11 +4,11 @@ * Copyright (C) 2004 - 2006 Xiranet Communications GmbH <arn...@xi...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -117,7 +117,7 @@ offset += sg[0].offset; idx = offset >> PAGE_SHIFT; offset &= ~PAGE_MASK; - + count = get_pgcnt(size, offset); TRACE_DBG("req %p, idx %d, count %d, sg_cnt %d, size %d, " @@ -209,7 +209,7 @@ offset = 0; } - /* + /* * cmnd is used here regardless of its sg comes from parent or was * allocated for this cmnd only, see cmnd_send_pdu() */ Modified: trunk/iscsi-scst/kernel/digest.h =================================================================== --- trunk/iscsi-scst/kernel/digest.h 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/kernel/digest.h 2008-05-19 10:21:41 UTC (rev 377) @@ -4,11 +4,11 @@ * Copyright (C) 2004 Xiranet Communications GmbH <arn...@xi...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/kernel/event.c =================================================================== --- trunk/iscsi-scst/kernel/event.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/kernel/event.c 2008-05-19 10:21:41 UTC (rev 377) @@ -4,11 +4,11 @@ * Copyright (C) 2005 FUJITA Tomonori <to...@ac...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/kernel/iscsi.c =================================================================== --- trunk/iscsi-scst/kernel/iscsi.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/kernel/iscsi.c 2008-05-19 10:21:41 UTC (rev 377) @@ -2,12 +2,12 @@ * Copyright (C) 2002-2003 Ardis Technolgies <ro...@ar...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -148,7 +148,7 @@ #ifdef NET_PAGE_CALLBACKS_DEFINED atomic_set(&cmnd->net_ref_cnt, 0); -#endif +#endif spin_lock_init(&cmnd->rsp_cmd_lock); INIT_LIST_HEAD(&cmnd->rsp_cmd_list); INIT_LIST_HEAD(&cmnd->rx_ddigest_cmd_list); @@ -382,7 +382,7 @@ /* * Corresponding conn may also gets destroyed atfer this function, except only - * if it's called from the read thread! + * if it's called from the read thread! */ void req_cmnd_release(struct iscsi_cmnd *req) { @@ -437,7 +437,7 @@ /* * Corresponding conn may also gets destroyed atfer this function, except only - * if it's called from the read thread! + * if it's called from the read thread! */ void rsp_cmnd_release(struct iscsi_cmnd *cmnd) { @@ -458,7 +458,7 @@ /** * create a new command used as response. * - * iscsi_cmnd_create_rsp_cmnd - + * iscsi_cmnd_create_rsp_cmnd - * @cmnd: ptr to request command * * @return ptr to response command or NULL @@ -494,7 +494,7 @@ static void iscsi_cmnds_init_write(struct list_head *send, int flags) { - struct iscsi_cmnd *rsp = list_entry(send->next, struct iscsi_cmnd, + struct iscsi_cmnd *rsp = list_entry(send->next, struct iscsi_cmnd, write_list_entry); struct iscsi_conn *conn = rsp->conn; struct list_head *pos, *next; @@ -572,7 +572,7 @@ u8 *p = (u8*)page_address(sg_page(&cmnd->sg[idx])) + (last_off & ~PAGE_MASK); int i = 4 - (size & 3); - while(i--) + while(i--) *p++ = 0; } } @@ -679,7 +679,7 @@ if (rsp->bufflen - rsp->pdu.datasize) { int i = rsp->pdu.datasize; u8 *p = (u8 *)sense + i; - + while (i < rsp->bufflen) { *p ++ = 0; i++; @@ -747,7 +747,7 @@ static inline int iscsi_get_allowed_cmds(struct iscsi_session *sess) { - int res = max(-1, (int)sess->max_queued_cmnds - + int res = max(-1, (int)sess->max_queued_cmnds - atomic_read(&sess->active_cmds)-1); TRACE_DBG("allowed cmds %d (sess %p, active_cmds %d)", res, sess, atomic_read(&sess->active_cmds)); @@ -1165,7 +1165,7 @@ SCST_LOAD_SENSE(iscsi_sense_crc_error)); res = SCST_PREPROCESS_STATUS_ERROR_SENSE_SET; /* - * The rest of rx_ddigest_cmd_list will be freed + * The rest of rx_ddigest_cmd_list will be freed * in req_cmnd_release() */ goto out; @@ -1562,7 +1562,7 @@ /* * Here, if cmnd is data_waiting, we should iscsi_fail_waiting_cmnd() * it. But, since this function can be called from any thread, not only - * from the read one, we at the moment can't do that, because of + * from the read one, we at the moment can't do that, because of * absence of appropriate locking protection. But this isn't a stuff * for 0.9.6. So, currently a misbehaving initiator, not sending * data in R2T state for a sharing between targets device, for which @@ -2479,7 +2479,7 @@ return; } -/* +/* * No locks. * * IMPORTANT! Connection conn must be protected by additional conn_get() @@ -2611,7 +2611,7 @@ } if (req->bufflen != 0) { - /* + /* * Check above makes sure that is_send_status is set, * so status is valid here, but in future that could change. * ToDo @@ -2967,7 +2967,7 @@ out_callb: #ifdef NET_PAGE_CALLBACKS_DEFINED net_set_get_put_page_callbacks(NULL, NULL); -#endif +#endif goto out; } Modified: trunk/iscsi-scst/kernel/iscsi.h =================================================================== --- trunk/iscsi-scst/kernel/iscsi.h 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/kernel/iscsi.h 2008-05-19 10:21:41 UTC (rev 377) @@ -2,12 +2,12 @@ * Copyright (C) 2002-2003 Ardis Technolgies <ro...@ar...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -124,7 +124,7 @@ #define ISCSI_CONN_IOV_MAX (PAGE_SIZE/sizeof(struct iovec)) #define ISCSI_CONN_RD_STATE_IDLE 0 -#define ISCSI_CONN_RD_STATE_IN_LIST 1 +#define ISCSI_CONN_RD_STATE_IN_LIST 1 #define ISCSI_CONN_RD_STATE_PROCESSING 2 #define ISCSI_CONN_WR_STATE_IDLE 0 @@ -137,7 +137,7 @@ /* Both protected by session->sn_lock */ u32 stat_sn; - u32 exp_stat_sn; + u32 exp_stat_sn; spinlock_t cmd_list_lock; /* BH lock */ @@ -235,7 +235,7 @@ #define ISCSI_REJECT_CMD 2 #define ISCSI_REJECT_DATA 3 -/* +/* * Most of the fields don't need any protection, since accessed from only a * single thread, except where noted. */ @@ -287,7 +287,7 @@ unsigned long write_timeout; /* - * Unprotected, since could be accessed from only a single + * Unprotected, since could be accessed from only a single * thread at time */ struct list_head rx_ddigest_cmd_list; @@ -538,7 +538,7 @@ atomic_read(&conn->conn_ref_cnt)-1); sBUG_ON(atomic_read(&conn->conn_ref_cnt) == 0); - /* + /* * It always ordered to protect from undesired side effects like * accessing just destroyed object because of this *_dec() reordering. */ Modified: trunk/iscsi-scst/kernel/iscsi_dbg.h =================================================================== --- trunk/iscsi-scst/kernel/iscsi_dbg.h 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/kernel/iscsi_dbg.h 2008-05-19 10:21:41 UTC (rev 377) @@ -1,12 +1,12 @@ /* * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/kernel/iscsi_hdr.h =================================================================== --- trunk/iscsi-scst/kernel/iscsi_hdr.h 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/kernel/iscsi_hdr.h 2008-05-19 10:21:41 UTC (rev 377) @@ -2,12 +2,12 @@ * Copyright (C) 2002-2003 Ardis Technolgies <ro...@ar...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/kernel/nthread.c =================================================================== --- trunk/iscsi-scst/kernel/nthread.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/kernel/nthread.c 2008-05-19 10:21:41 UTC (rev 377) @@ -4,11 +4,11 @@ * Copyright (C) 2004 - 2005 FUJITA Tomonori <to...@ac...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -398,7 +398,7 @@ } sBUG_ON(cmnd->parent_req != NULL); - + spin_lock_bh(&cmnd->rsp_cmd_lock); list_for_each_entry(rsp, &cmnd->rsp_cmd_list, rsp_cmd_list_entry) { TRACE_CONN_CLOSE_DBG(" rsp %p, ref_cnt %d, net_ref_cnt %d, " @@ -1012,7 +1012,7 @@ break; goto out_iov; } - sBUG_ON(iop > conn->write_iov + + sBUG_ON(iop > conn->write_iov + sizeof(conn->write_iov)/sizeof(conn->write_iov[0])); iop->iov_base += rest; iop->iov_len -= rest; @@ -1082,7 +1082,7 @@ retry2: res = sendpage(sock, sg_page(&sg[idx]), offset, size, flags); TRACE_WRITE("Final %s %#Lx:%u: %d(%lu,%u,%u, cmd %p, page %p)", - (sendpage != sock_no_sendpage) ? "sendpage" : + (sendpage != sock_no_sendpage) ? "sendpage" : "sock_no_sendpage", conn->session->sid, conn->cid, res, sg_page(&sg[idx])->index, offset, size, @@ -1110,7 +1110,7 @@ res = sendpage(sock, sg_page(&sg[idx]), offset, sendsize, flags | MSG_MORE); TRACE_WRITE("%s %#Lx:%u: %d(%lu,%u,%u, cmd %p, page %p)", - (sendpage != sock_no_sendpage) ? "sendpage" : + (sendpage != sock_no_sendpage) ? "sendpage" : "sock_no_sendpage", (unsigned long long)conn->session->sid, conn->cid, res, sg_page(&sg[idx])->index, offset, sendsize, @@ -1257,7 +1257,7 @@ return res; } -/* +/* * No locks, conn is wr processing. * * IMPORTANT! Connection conn must be protected by additional conn_get() @@ -1288,7 +1288,7 @@ init_tx_hdigest(cmnd); conn->write_state = TX_BHS_DATA; case TX_BHS_DATA: - res = iscsi_do_send(conn, ddigest && cmnd->pdu.datasize ? + res = iscsi_do_send(conn, ddigest && cmnd->pdu.datasize ? TX_INIT_DDIGEST : TX_END); if (res <= 0 || conn->write_state != TX_INIT_DDIGEST) break; Modified: trunk/iscsi-scst/kernel/param.c =================================================================== --- trunk/iscsi-scst/kernel/param.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/kernel/param.c 2008-05-19 10:21:41 UTC (rev 377) @@ -2,11 +2,11 @@ * Copyright (C) 2005 FUJITA Tomonori <to...@ac...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/kernel/session.c =================================================================== --- trunk/iscsi-scst/kernel/session.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/kernel/session.c 2008-05-19 10:21:41 UTC (rev 377) @@ -2,12 +2,12 @@ * Copyright (C) 2002-2003 Ardis Technolgies <ro...@ar...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/kernel/target.c =================================================================== --- trunk/iscsi-scst/kernel/target.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/kernel/target.c 2008-05-19 10:21:41 UTC (rev 377) @@ -2,12 +2,12 @@ * Copyright (C) 2002-2003 Ardis Technolgies <ro...@ar...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/chap.c =================================================================== --- trunk/iscsi-scst/usr/chap.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/chap.c 2008-05-19 10:21:41 UTC (rev 377) @@ -15,7 +15,7 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/config.h =================================================================== --- trunk/iscsi-scst/usr/config.h 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/config.h 2008-05-19 10:21:41 UTC (rev 377) @@ -1,12 +1,12 @@ /* * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/conn.c =================================================================== --- trunk/iscsi-scst/usr/conn.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/conn.c 2008-05-19 10:21:41 UTC (rev 377) @@ -2,12 +2,12 @@ * Copyright (C) 2002-2003 Ardis Technolgies <ro...@ar...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/ctldev.c =================================================================== --- trunk/iscsi-scst/usr/ctldev.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/ctldev.c 2008-05-19 10:21:41 UTC (rev 377) @@ -2,11 +2,11 @@ * Copyright (C) 2004 - 2005 FUJITA Tomonori <to...@ac...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -208,7 +208,7 @@ goto out; } else log_error("Unknown %s string: %s\n", PROC_SESSION, p); - + done = 1; } @@ -414,7 +414,7 @@ do { res = ioctl(ctrl_fd, DEL_SESSION, &info); } while (res < 0 && errno == EINTR); - + return res; } Modified: trunk/iscsi-scst/usr/event.c =================================================================== --- trunk/iscsi-scst/usr/event.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/event.c 2008-05-19 10:21:41 UTC (rev 377) @@ -4,11 +4,11 @@ * Copyright (C) 2005 FUJITA Tomonori <to...@ac...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/iscsi_adm.c =================================================================== --- trunk/iscsi-scst/usr/iscsi_adm.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/iscsi_adm.c 2008-05-19 10:21:41 UTC (rev 377) @@ -4,11 +4,11 @@ * Copyright (C) 2004 - 2005 FUJITA Tomonori <to...@ac...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -159,7 +159,7 @@ do { ret = readv(fd, iov, 2); } while (ret < 0 && errno == EINTR); - + if (ret != sizeof(rsp) + sizeof(*req)) { err = (ret < 0) ? -errno : -EIO; fprintf(stderr, "%s %d %d %d\n", __FUNCTION__, __LINE__, ret, Modified: trunk/iscsi-scst/usr/iscsi_adm.h =================================================================== --- trunk/iscsi-scst/usr/iscsi_adm.h 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/iscsi_adm.h 2008-05-19 10:21:41 UTC (rev 377) @@ -1,12 +1,12 @@ /* * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/iscsi_hdr.h =================================================================== --- trunk/iscsi-scst/usr/iscsi_hdr.h 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/iscsi_hdr.h 2008-05-19 10:21:41 UTC (rev 377) @@ -2,12 +2,12 @@ * Copyright (C) 2002-2003 Ardis Technolgies <ro...@ar...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/iscsi_scstd.c =================================================================== --- trunk/iscsi-scst/usr/iscsi_scstd.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/iscsi_scstd.c 2008-05-19 10:21:41 UTC (rev 377) @@ -2,12 +2,12 @@ * Copyright (C) 2002-2003 Ardis Technolgies <ro...@ar...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -123,14 +123,14 @@ if (setsockopt(sock, SOL_TCP, TCP_KEEPCNT, &opt, sizeof(opt))) log_warning("unable to set TCP_KEEPCNT on server socket (%s)!", strerror(errno)); - + if (setsockopt(sock, SOL_TCP, TCP_KEEPIDLE, &timeout, sizeof(timeout))) log_warning("unable to set TCP_KEEPIDLE on server socket (%s)!", strerror(errno)); - + opt = 3; if (setsockopt(sock, SOL_TCP, TCP_KEEPINTVL, &opt, sizeof(opt))) log_warning("unable to set KEEPINTVL on server socket (%s)!", strerror(errno)); - + opt = 1; if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &opt, sizeof(opt))) log_warning("unable to set SO_KEEPALIVE on server socket (%s)!", strerror(errno)); @@ -166,7 +166,7 @@ } sock_set_keepalive(sock, 50); - + opt = 1; if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt))) log_warning("Unable to set SO_REUSEADDR on server socket (%s)!", @@ -422,7 +422,7 @@ void wait_4_iscsi_event(int timeout) { int res; - + do { res = poll(&poll_array[POLL_NL], 1, timeout); } while (res < 0 && errno == EINTR); @@ -497,12 +497,12 @@ for (i = 0; i < INCOMING_MAX; i++) { struct connection *conn = incoming[i]; struct pollfd *pollfd = &poll_array[POLL_INCOMING + i]; - + if (!conn || !pollfd->revents) continue; pollfd->revents = 0; - + event_conn(conn, pollfd); if (conn->state == STATE_CLOSE) { Modified: trunk/iscsi-scst/usr/iscsid.c =================================================================== --- trunk/iscsi-scst/usr/iscsid.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/iscsid.c 2008-05-19 10:21:41 UTC (rev 377) @@ -2,12 +2,12 @@ * Copyright (C) 2002-2003 Ardis Technolgies <ro...@ar...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -394,7 +394,7 @@ rsp->status_detail = ISCSI_STATUS_SVC_UNAVAILABLE; conn->state = STATE_EXIT; } - conn->session_param[key_max_recv_data_length].exec_val = + conn->session_param[key_max_recv_data_length].exec_val = conn->session_param[key_max_recv_data_length].local_val; } conn->exp_cmd_sn = be32_to_cpu(req->cmd_sn); Modified: trunk/iscsi-scst/usr/iscsid.h =================================================================== --- trunk/iscsi-scst/usr/iscsid.h 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/iscsid.h 2008-05-19 10:21:41 UTC (rev 377) @@ -2,12 +2,12 @@ * Copyright (C) 2002-2003 Ardis Technolgies <ro...@ar...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/log.c =================================================================== --- trunk/iscsi-scst/usr/log.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/log.c 2008-05-19 10:21:41 UTC (rev 377) @@ -2,12 +2,12 @@ * Copyright (C) 2002-2003 Ardis Technolgies <ro...@ar...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/message.c =================================================================== --- trunk/iscsi-scst/usr/message.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/message.c 2008-05-19 10:21:41 UTC (rev 377) @@ -2,11 +2,11 @@ * Copyright (C) 2004 - 2005 FUJITA Tomonori <to...@ac...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/misc.h =================================================================== --- trunk/iscsi-scst/usr/misc.h 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/misc.h 2008-05-19 10:21:41 UTC (rev 377) @@ -1,12 +1,12 @@ /* * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/param.c =================================================================== --- trunk/iscsi-scst/usr/param.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/param.c 2008-05-19 10:21:41 UTC (rev 377) @@ -2,11 +2,11 @@ * Copyright (C) 2005 FUJITA Tomonori <to...@ac...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/param.h =================================================================== --- trunk/iscsi-scst/usr/param.h 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/param.h 2008-05-19 10:21:41 UTC (rev 377) @@ -2,11 +2,11 @@ * Copyright (C) 2005 FUJITA Tomonori <to...@ac...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/plain.c =================================================================== --- trunk/iscsi-scst/usr/plain.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/plain.c 2008-05-19 10:21:41 UTC (rev 377) @@ -4,11 +4,11 @@ * Copyright (C) 2005 FUJITA Tomonori <to...@ac...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/session.c =================================================================== --- trunk/iscsi-scst/usr/session.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/session.c 2008-05-19 10:21:41 UTC (rev 377) @@ -2,12 +2,12 @@ * Copyright (C) 2002-2003 Ardis Technolgies <ro...@ar...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/target.c =================================================================== --- trunk/iscsi-scst/usr/target.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/target.c 2008-05-19 10:21:41 UTC (rev 377) @@ -2,12 +2,12 @@ * Copyright (C) 2002-2003 Ardis Technolgies <ro...@ar...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/iscsi-scst/usr/types.h =================================================================== --- trunk/iscsi-scst/usr/types.h 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/iscsi-scst/usr/types.h 2008-05-19 10:21:41 UTC (rev 377) @@ -2,12 +2,12 @@ * Copyright (C) 2002-2003 Ardis Technolgies <ro...@ar...> * Copyright (C) 2007 Vladislav Bolkhovitin * Copyright (C) 2007 CMS Distribution Limited - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2 * of the License. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Modified: trunk/mpt/mpt_scst.c =================================================================== --- trunk/mpt/mpt_scst.c 2008-05-16 17:47:31 UTC (rev 376) +++ trunk/mpt/mpt_scst.c 2008-05-19 10:21:41 UTC (rev 377) @@ -7,7 +7,7 @@ * and Leonid Stoljar * * MPT SCSI target mode driver for SCST. - * + * * Originally By: Stephen Shirron * Port to SCST By: Hu Gang <hu...@so...> * @@ -15,7 +15,7 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -90,7 +90,7 @@ static void stmapp_tgt_command(MPT_STM_PRIV *priv, u32 reply_word); static void stm_cmd_buf_post(MPT_STM_PRIV *priv, int index); -static void stm_tgt_reply_high_pri(MPT_ADAPTER *ioc, +static void stm_tgt_reply_high_pri(MPT_ADAPTER *ioc, TargetCmdBufferPostErrorReply_t *rep); static void stm_target_reply_error(MPT_ADAPTER *ioc, TargetErrorReply_t *rep); static void stmapp_target_error(MPT_STM_PRIV *priv, u32 reply_word, int index, @@ -122,7 +122,7 @@ static void stm_wait(MPT_STM_PRIV *priv, int milliseconds, int sleep); static int stm_wait_for(MPT_STM_PRIV *priv, volatile int *flag, int seconds, int sleep); -static void stmapp_srr_process(MPT_STM_PRIV *priv, int rx_id, int r_ctl, +static void stmapp_srr_process(MPT_STM_PRIV *priv, int rx_id, int r_ctl, u32 offset, LinkServiceBufferPostReply_t *rep, int index); static void stm_set_scsi_port_page1(MPT_STM_PRIV *priv, int sleep); @@ -144,7 +144,7 @@ MPT_STM_PRIV *priv = tgt->priv; TRACE_ENTRY(); - TRACE_DBG("priv %p, tgt %p", priv, tgt); + TRACE_DBG("priv %p, tgt %p", priv, tgt); sBUG_ON(tgt == NULL); sBUG_ON(ioc == NULL); @@ -210,7 +210,7 @@ } static int -mpt_proc_target_write(struct file *file, const char __user *buf, +mpt_proc_target_write(struct file *file, const char __user *buf, size_t length, loff_t *off) { @@ -249,10 +249,10 @@ int id = simple_strtoul(s, NULL, 0); if (id < MPT_MAX_SCSI_DEVICES) { if (IsScsi(tgt->priv)) { - TRACE_DBG("Changing target id to %d\n", + TRACE_DBG("Changing target id to %d\n", id); tgt->priv->port_id = id; - stm_set_scsi_port_page1(tgt->priv, + stm_set_scsi_port_page1(tgt->priv, NO_SLEEP); } } @@ -273,7 +273,7 @@ static int mpt_target_release(struct scst_tgt *scst_tgt); static int stmapp_pending_sense(struct mpt_cmd *mpt_cmd); static int mpt_xmit_response(struct scst_cmd *scst_cmd); -static void mpt_inquiry_no_tagged_commands(MPT_STM_PRIV *priv, +static void mpt_inquiry_no_tagged_commands(MPT_STM_PRIV *priv, struct scst_cmd *scst_cmd); static int mpt_rdy_to_xfer(struct scst_cmd *scst_cmd); static void mpt_on_free_cmd(struct scst_cmd *scst_cmd); @@ -301,13 +301,13 @@ .task_mgmt_fn_done = mpt_task_mgmt_fn_done, }; -static inline void +static inline void mpt_msg_frame_free(MPT_STM_PRIV *priv, int index) { MPT_ADAPTER *ioc = priv->ioc; if (priv->current_mf[index] != NULL) { TRACE_DBG("%s: free mf index %d, %p", ioc->name, - MF_TO_INDEX(priv->current_mf[index]), + MF_TO_INDEX(priv->current_mf[index]), priv->current_mf[index]); mpt_free_msg_frame(_HANDLE_IOC_ID, priv->current_mf[index]); priv->current_mf[index] = NULL; @@ -321,7 +321,7 @@ MPT_FRAME_HDR *mf; if (index != -1) { - TRACE_DBG("%s: current_mf %p, index %d", + TRACE_DBG("%s: current_mf %p, index %d", ioc->name, priv->current_mf[index], index); WARN_ON(priv->current_mf[index] != NULL); } @@ -331,12 +331,12 @@ if (mf == NULL) { sBUG_ON(1); } - + if (index != -1) { priv->current_mf[index] = mf; } - TRACE_DBG("%s: alloc mf index %d, %p, %d", ioc->name, + TRACE_DBG("%s: alloc mf index %d, %p, %d", ioc->name, MF_TO_INDEX(mf), mf, index); return mf; @@ -353,7 +353,7 @@ struct proc_dir_entry *p; struct proc_dir_entry *root; char name[4]; - + TRACE_ENTRY(); ret = mpt_stm_adapter_install(ioc); if (ret != 0) { @@ -379,12 +379,12 @@ tgt->priv->scsi_id_config = 0; atomic_set(&tgt->sess_count, 0); init_waitqueue_head(&tgt->waitQ); - + tgt->scst_tgt = scst_register(&tgt_template, NULL); if (tgt->scst_tgt == NULL) { PRINT_ERROR(MYNAM ": scst_register() " "failed for host %p", pdev); - + ret = -ENODEV; goto out; } @@ -406,11 +406,11 @@ scst_tgt_set_tgt_priv(tgt->scst_tgt, tgt); mpt_stm_priv[ioc->id]->tgt = tgt; _mpt_ada_nums ++; - + out: - + TRACE_EXIT_RES(ret); - + return ret; } @@ -438,7 +438,7 @@ * the system. Each found adapter should be registered by calling * scst_register(). The function should return a value >= 0 to signify * the number of detected target adapters. A negative value should be - * returned whenever there is an error. + * returned whenever there is an error. */ static int mpt_target_detect(struct scst_tgt_template *templ) { @@ -456,17 +456,17 @@ ret = -ENODEV; goto out; } - + ret = _mpt_ada_nums; - + out: TRACE_EXIT_RES(ret); - + return ret; } static struct scst_cmd * -_stm_target_command(MPT_STM_PRIV *priv, int reply_word, +_stm_target_command(MPT_STM_PRIV *priv, int reply_word, struct mpt_cmd *mpt_cmd) { u8 *cdb; @@ -478,9 +478,9 @@ #ifdef DEBUG MPT_ADAPTER *ioc = priv->ioc; #endif - /* - * Get the CBD, LUN, tag, Task Mgmt flags, and data length from the - * receive packet + /* + * Get the CBD, LUN, tag, Task Mgmt flags, and data length from the + * receive packet */ TRACE_ENTRY(); @@ -546,7 +546,7 @@ TRACE_DBG("%s: cmd %p, re_word %x, alias %x, lun %x, tag %x," "%s, init_idx %d, %p, %d", - ioc->name, cmd, reply_word, alias, lun, tag, alias_lun, + ioc->name, cmd, reply_word, alias, lun, tag, alias_lun, init_index, priv->scst_cmd[index], dl); mpt_cmd->CMD = cmd; @@ -581,7 +581,7 @@ stmapp_set_status(cmd->priv, cmd->CMD, STS_BUSY); } -static void +static void mpt_alloc_session_done(struct scst_session *scst_sess, void *data, int result) { struct mpt_sess *sess = (struct mpt_sess *) data; @@ -592,7 +592,7 @@ TRACE_ENTRY(); if (result == 0) { scst_sess_set_tgt_priv(scst_sess, sess); - + while (!list_empty(&sess->delayed_cmds)) { cmd = list_entry(sess->delayed_cmds.next, typeof(*cmd), delayed_cmds_entry); @@ -600,7 +600,7 @@ if (rc == 0) rc = mpt_send_cmd_to_scst(cmd, SCST_CONTEXT_THREAD); if (rc != 0) { - PRINT_INFO(MYNAM ": Unable to get the command, sending BUSY state %p", + PRINT_INFO(MYNAM ": Unable to get the command, sending BUSY state %p", cmd); mpt_send_busy(cmd); kfree(cmd); @@ -619,27 +619,27 @@ kfree(cmd); } tgt->sess[sess->init_index] = NULL; - + TRACE_MEM("kfree for sess %p", sess); kfree(sess); - + if (atomic_dec_and_test(&tgt->sess_count)) wake_up_all(&tgt->waitQ); } - + __clear_bit(MPT_SESS_INITING, &sess->sess_flags); TRACE_EXIT(); return; } -static int +static int mpt_send_cmd_to_scst(struct mpt_cmd *cmd, int context) { int res = 0; - + TRACE_ENTRY(); - + cmd->scst_cmd = _stm_target_command(cmd->priv, cmd->reply_word, cmd); if (cmd->scst_cmd == NULL) { res = -EFAULT; @@ -650,9 +650,9 @@ #endif scst_cmd_init_done(cmd->scst_cmd, context); - out: + out: TRACE_EXIT_RES(res); - + return res; } @@ -685,7 +685,7 @@ } static void -stm_data_done(MPT_ADAPTER *ioc, u32 reply_word, +stm_data_done(MPT_ADAPTER *ioc, u32 reply_word, struct scst_cmd *scst_cmd, struct mpt_cmd *cmd, int index) { MPT_STM_PRIV *priv = mpt_stm_priv[ioc->id]; @@ -704,7 +704,7 @@ TRACE_EXIT(); } -void +void stm_tgt_reply(MPT_ADAPTER *ioc, u32 reply_word) { MPT_STM_PRIV *priv = mpt_stm_priv[ioc->id]; @@ -713,7 +713,7 @@ struct scst_cmd *scst_cmd; struct mpt_cmd *cmd; volatile int *io_state; - + TRACE_ENTRY(); index = GET_IO_INDEX(reply_word); @@ -724,23 +724,23 @@ TRACE_DBG("index %d, state %x, scst cmd %p, current_mf %p", index, *io_state, scst_cmd, priv->current_mf[index]); /* - * if scst_cmd is NULL it show the command buffer not using by + * if scst_cmd is NULL it show the command buffer not using by * SCST, let parse the CDB */ if (scst_cmd == NULL) { WARN_ON((*io_state & ~IO_STATE_HIGH_PRIORITY) != IO_STATE_POSTED); *io_state &= ~IO_STATE_POSTED; - + mpt_msg_frame_free(priv, index); stmapp_tgt_command(priv, reply_word); goto out; } - + cmd = (struct mpt_cmd *)scst_cmd_get_tgt_priv(scst_cmd); - TRACE_DBG("scst cmd %p, index %d, cmd %p, cmd state %s", + TRACE_DBG("scst cmd %p, index %d, cmd %p, cmd state %s", scst_cmd, index, cmd, mpt_state_string[cmd->state]); - + if (cmd->state == MPT_STATE_NEED_DATA) { int context = SCST_CONTEXT_TASKLET; int rx_status = SCST_RX_STATUS_SUCCESS; @@ -801,18 +801,18 @@ switch (atomic_read(&priv->pending_sense[init_index])) { /* attempt to send status and sense succeeded */ case MPT_STATUS_SENSE_ATTEMPT: - atomic_set(&priv->pending_sense[init_index], + atomic_set(&priv->pending_sense[init_index], MPT_STATUS_SENSE_IDLE); /* ToDo: check and set scst_set_delivery_status(), if necessary */ scst_tgt_cmd_done(scst_cmd); break; - /* we tried to send status and sense - * simltaneously and failed. Prepare to handle - * the next command without SCST if it is + /* we tried to send status and sense + * simltaneously and failed. Prepare to handle + * the next command without SCST if it is * REQUEST_SENSE */ case MPT_STATUS_SENSE_NOT_SENT: - atomic_set(&priv->pending_sense[init_index], + atomic_set(&priv->pending_sense[init_index], MPT_STATUS_SENSE_HANDLE_RQ); /* ToDo: check and set scst_set_delivery_status(), if necessary */ scst_tgt_cmd_done(scst_cmd); @@ -821,17 +821,17 @@ /* we've handled REQUEST_SENSE ourselves and * we're done with the command. Clean up */ case MPT_STATUS_SENSE_HANDLE_RQ: - TRACE_DBG("%s: clearing pending sense", + TRACE_DBG("%s: clearing pending sense", ioc->name); - atomic_set(&priv->pending_sense[init_index], + atomic_set(&priv->pending_sense[init_index], MPT_STATUS_SENSE_IDLE); mpt_on_free_cmd(scst_cmd); /* scst_cmd alloced in stmapp_pending_sense */ - kfree(scst_cmd); + kfree(scst_cmd); break; default: - /* nothing much to do here, we aren't + /* nothing much to do here, we aren't * handling cached sense/status */ /* ToDo: check and set scst_set_delivery_status(), if necessary */ scst_tgt_cmd_done(scst_cmd); @@ -863,7 +863,7 @@ /* * just insert into list - * bug how can i handle it + * bug how can i handle it */ if (*io_state == 0 && cmd->state == MPT_STATE_NEW) { WARN_ON(1); @@ -881,11 +881,11 @@ #endif WARN_ON(1); out: - + TRACE_EXIT(); } -static int +static int mpt_is_task_mgm(MPT_STM_PRIV *priv, u32 reply_word, int *lun) { int task_mgmt = 0, index; @@ -927,22 +927,22 @@ int init_index, res = 0, task_mgmt, lun; TRACE_ENTRY(); - + tgt = priv->tgt; task_mgmt = mpt_is_task_mgm(priv, reply_word, &lun); if (task_mgmt) { mpt_handle_task_mgmt(priv, reply_word, task_mgmt, lun); } - + init_index = GET_INITIATOR_INDEX(reply_word); - + if (test_bit(MPT_TGT_SHUTDOWN, &tgt->tgt_flags)) { TRACE_DBG("New command while the device %p is shutting down", tgt); res = -EFAULT; goto out; } - + cmd = kmalloc(sizeof(*cmd), GFP_ATOMIC); TRACE_MEM("kmalloc(GFP_ATOMIC) for cmd (%d): %p", sizeof(*cmd), cmd); if (cmd == NULL) { @@ -950,7 +950,7 @@ res = -ENOMEM; goto out; } - + memset(cmd, 0, sizeof(*cmd)); cmd->priv = priv; cmd->reply_word = reply_word; @@ -966,29 +966,29 @@ goto out_free_cmd; } /* WWPN */ - + atomic_inc(&tgt->sess_count); smp_mb__after_atomic_inc(); - + memset(sess, 0, sizeof(*sess)); sess->tgt = tgt; sess->init_index = init_index; INIT_LIST_HEAD(&sess->delayed_cmds); - + sess->scst_sess = scst_register_session(tgt->scst_tgt, 1, "", sess, mpt_alloc_session_done); if (sess->scst_sess == NULL) { - PRINT_ERROR(MYNAM ": scst_register_session failed %p", + PRINT_ERROR(MYNAM ": scst_register_session failed %p", tgt); res = -EFAULT; goto out_free_sess; } - + __set_bit(MPT_SESS_INITING, &sess->sess_flags); - + tgt->sess[init_index] = sess; scst_sess_set_tgt_priv(sess->scst_sess, sess); - + cmd->sess = sess; list_add_tail(&cmd->delayed_cmds_entry, &sess->delayed_cmds); goto out; @@ -1009,7 +1009,7 @@ goto out_free_cmd; } } - + out: TRACE_EXIT(); return; @@ -1029,7 +1029,7 @@ /* * mpt_target_release - * + * * this function is * intended to free up the resources allocated to the device. The function * should return 0 to indicate successful release or a negative value if @@ -1058,7 +1058,7 @@ struct mpt_cmd *cmd; }; -static inline void +static inline void mpt_dump_sge(MPT_SGE *sge, struct scatterlist *sg) { if (sge) { @@ -1066,13 +1066,13 @@ struct page *page = NULL; address = bus_to_virt(sge->address); page = virt_to_page(address); - TRACE_DBG("address %p, length %x, count %d, page %p", + TRACE_DBG("address %p, length %x, count %d, page %p", address, sge->length, page_count(page), page); TRACE_BUFFER("sge data", address, min(sge->length, (u32)0x10)); } if (sg) { TRACE_DBG("sg %p, page %p, %p, offset %d, dma address %x, len %d", - sg, sg->page, page_address(sg->page), + sg, sg->page, page_address(sg->page), sg->offset, sg->dma_address, sg->length); TRACE_BUFFER("sg data", page_address(sg->page), (u32)0x10); } @@ -1096,8 +1096,8 @@ prm->sg = (struct scatterlist *)prm->buffer; prm->seg_cnt = pci_map_sg(priv->ioc->pcidev, prm->sg, prm->use_sg, scst_to_tgt_dma_dir(prm->data_direction)); - - pci_dma_sync_sg_for_cpu(priv->ioc->pcidev, prm->sg, prm->use_sg, + + pci_dma_sync_sg_for_cpu(priv->ioc->pcidev, prm->sg, prm->use_sg, scst_to_tgt_dma_dir(prm->data_direction)); for (i = 0; i < prm->use_sg; i++) { sgl->sge[i].length = sg_dma_len(&prm->sg[i]); @@ -1110,11 +1110,11 @@ mpt_dump_sge(&sgl->sge[i], &prm->sg[i]); bufflen -= sgl->sge[i].length; } - pci_dma_sync_sg_for_device(priv->ioc->pcidev, prm->sg, prm->use_sg, + pci_dma_sync_sg_for_device(priv->ioc->pcidev, prm->sg, prm->use_sg, scst_to_tgt_dma_dir(prm->data_direction)); - + sgl->num_sges = prm->seg_cnt; - + TRACE_EXIT(); } @@ -1122,7 +1122,7 @@ mpt_set_sense_info(MPT_STM_PRIV *priv, CMD *cmd, int len, u8 *sense_buf) { u8 *info = NULL; - + TRACE_ENTRY(); if (IsScsi(priv)) { @@ -1180,11 +1180,11 @@ TRACE_ENTRY(); req = (TargetAssistRequest_t *)mpt_msg_frame_alloc(ioc,index); memset(req, 0, sizeof(*req)); - + if (priv->exiting) { flags &= ~TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER; } - + if (priv->io_state[index] & IO_STATE_HIGH_PRIORITY) { flags |= TARGET_ASSIST_FLAGS_HIGH_PRIORITY; if (flags & TARGET_ASSIST_FLAGS_AUTO_STATUS) { @@ -1192,7 +1192,7 @@ priv->io_state[index] |= IO_STATE_AUTO_REPOST; } } - + if (priv->fcp2_capable/* && priv->initiators != NULL*/) { init_index = GET_INITIATOR_INDEX(reply_word); /*init = priv->initiators[init_index]; @@ -1202,7 +1202,7 @@ } TRACE_DBG("flags %x, tag %x, lun %x, offset %x, length %x", flags, tag, lun, offset, length); - + req->StatusCode = 0; req->TargetAssistFlags = (u8)flags; req->Function = MPI_FUNCTION_TARGET_ASSIST; @@ -1229,7 +1229,7 @@ (u8)(MPI_SGE_FLAGS_CHAIN_ELEMENT | MPI_SGE_FLAGS_MPT_STM_ADDRESSING); dma_addr = priv->hw_dma + - ((u8 *)priv->hw->cmd_buf[index].chain_sge - + ((u8 *)priv->hw->cmd_buf[index].chain_sge - (u8 *)priv->hw); stm_set_dma_addr(sge_chain->Address, dma_addr); /* set the "last element" flag in the mf */ @@ -1347,7 +1347,7 @@ } #endif res = 0; - + priv->io_state[index] |= IO_STATE_DATA_SENT; if (flags & TARGET_ASSIST_FLAGS_AUTO_STATUS) priv->io_state[index] |= IO_STATE_STATUS_SENT; @@ -1361,28 +1361,28 @@ } TRACE_EXIT_RES(res); - - return res; + + return res; } -/* +/* * calling mpt_send_target_data * */ -static void +static void mpt_send_target_data(struct mpt_prm *prm, int flags) { MPT_STM_PRIV *priv; u32 reply_word; int index, lun, tag, length, offset; MPT_SGL *sgl; - + TRACE_ENTRY(); priv = prm->tgt->priv; sgl = &priv->sgl; - + mpt_sge_to_sgl(prm, priv, sgl); - + reply_word = prm->cmd->CMD->reply_word; index = GET_IO_INDEX(reply_word); @@ -1392,15 +1392,15 @@ if (prm->data_direction == SCST_DATA_READ) { flags |= TARGET_ASSIST_FLAGS_DATA_DIRECTION; } - + length = prm->bufflen; offset = 0; -#if 0 +#if 0 TRACE_DBG("priv %p, reply_word %x, index %x, flags %x, lun %x, " "tag %x, sgl %p, length %x, offset %x", - priv, reply_word, index, flags, lun, tag, + priv, reply_word, index, flags, lun, tag, sgl,... [truncated message content] |