mirror of
https://github.com/SCST-project/scst.git
synced 2026-07-19 22:42:38 +00:00
Patch from Bart Van Assche <bart.vanassche@gmail.com>, 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: <bart.vanassche@gmail.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@377 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
* Copyright (C) 2004 - 2005 FUJITA Tomonori <tomof@acm.org>
|
||||
* 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 @@ void iscsi_dump_iov(struct msghdr *msg)
|
||||
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);
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>
|
||||
* 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
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
* Copyright (C) 2004 - 2006 Xiranet Communications GmbH <arne.redlich@xiranet.com>
|
||||
* 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 @@ static u32 digest_data(struct iscsi_cmnd *cmd, u32 osize, u32 offset)
|
||||
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 @@ void digest_tx_data(struct iscsi_cmnd *cmnd)
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* cmnd is used here regardless of its sg comes from parent or was
|
||||
* allocated for this cmnd only, see cmnd_send_pdu()
|
||||
*/
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
* Copyright (C) 2004 Xiranet Communications GmbH <arne.redlich@xiranet.com>
|
||||
* 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
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
* Copyright (C) 2005 FUJITA Tomonori <tomof@acm.org>
|
||||
* 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
|
||||
|
||||
+15
-15
@@ -2,12 +2,12 @@
|
||||
* Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>
|
||||
* 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 @@ struct iscsi_cmnd *cmnd_alloc(struct iscsi_conn *conn, struct iscsi_cmnd *parent
|
||||
|
||||
#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 @@ again_rsp:
|
||||
|
||||
/*
|
||||
* 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 @@ void req_cmnd_release(struct iscsi_cmnd *req)
|
||||
|
||||
/*
|
||||
* 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 @@ void rsp_cmnd_release(struct iscsi_cmnd *cmnd)
|
||||
/**
|
||||
* 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 inline struct iscsi_cmnd *get_rsp_cmnd(struct iscsi_cmnd *req)
|
||||
|
||||
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 @@ static void iscsi_set_datasize(struct iscsi_cmnd *cmnd, u32 offset, u32 size)
|
||||
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 @@ static struct iscsi_cmnd *create_status_rsp(struct iscsi_cmnd *req, int status,
|
||||
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 void iscsi_cmnd_reject(struct iscsi_cmnd *req, int reason)
|
||||
|
||||
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 @@ static int iscsi_pre_exec(struct scst_cmd *scst_cmd)
|
||||
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 @@ static void __cmnd_abort(struct iscsi_cmnd *cmnd)
|
||||
/*
|
||||
* 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 @@ static void iscsi_preprocessing_done(struct scst_cmd *scst_cmd)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* No locks.
|
||||
*
|
||||
* IMPORTANT! Connection conn must be protected by additional conn_get()
|
||||
@@ -2611,7 +2611,7 @@ static int iscsi_xmit_response(struct scst_cmd *scst_cmd)
|
||||
}
|
||||
|
||||
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_reg:
|
||||
out_callb:
|
||||
#ifdef NET_PAGE_CALLBACKS_DEFINED
|
||||
net_set_get_put_page_callbacks(NULL, NULL);
|
||||
#endif
|
||||
#endif
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>
|
||||
* 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 @@ struct iscsi_session {
|
||||
#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 @@ struct iscsi_conn {
|
||||
|
||||
/* 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 @@ typedef void (iscsi_show_info_t)(struct seq_file *seq, struct iscsi_target *targ
|
||||
#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 @@ struct iscsi_cmnd {
|
||||
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 @@ static inline void conn_put(struct iscsi_conn *conn)
|
||||
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.
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>
|
||||
* 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
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
* Copyright (C) 2004 - 2005 FUJITA Tomonori <tomof@acm.org>
|
||||
* 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 @@ static void close_conn(struct iscsi_conn *conn)
|
||||
}
|
||||
|
||||
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 @@ retry:
|
||||
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 @@ retry:
|
||||
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 @@ retry1:
|
||||
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 @@ static int iscsi_do_send(struct iscsi_conn *conn, int state)
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* No locks, conn is wr processing.
|
||||
*
|
||||
* IMPORTANT! Connection conn must be protected by additional conn_get()
|
||||
@@ -1288,7 +1288,7 @@ int iscsi_send(struct iscsi_conn *conn)
|
||||
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;
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
* Copyright (C) 2005 FUJITA Tomonori <tomof@acm.org>
|
||||
* 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
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>
|
||||
* 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
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>
|
||||
* 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>
|
||||
* 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
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
* Copyright (C) 2004 - 2005 FUJITA Tomonori <tomof@acm.org>
|
||||
* 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 @@ static int proc_session_parse(int fd, struct session_file_operations *ops,
|
||||
goto out;
|
||||
} else
|
||||
log_error("Unknown %s string: %s\n", PROC_SESSION, p);
|
||||
|
||||
|
||||
done = 1;
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ static int iscsi_session_destroy(u32 tid, u64 sid)
|
||||
do {
|
||||
res = ioctl(ctrl_fd, DEL_SESSION, &info);
|
||||
} while (res < 0 && errno == EINTR);
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
* Copyright (C) 2005 FUJITA Tomonori <tomof@acm.org>
|
||||
* 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
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
* Copyright (C) 2004 - 2005 FUJITA Tomonori <tomof@acm.org>
|
||||
* 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 @@ static int iscsid_response_recv(int fd, struct iscsi_adm_req *req)
|
||||
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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>
|
||||
* 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
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>
|
||||
* 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 @@ static void sock_set_keepalive(int sock, int timeout)
|
||||
|
||||
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 @@ static void create_listen_socket(struct pollfd *array)
|
||||
}
|
||||
|
||||
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 @@ out:
|
||||
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 @@ static void event_loop(int timeout)
|
||||
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) {
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>
|
||||
* 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 @@ static void login_start(struct connection *conn)
|
||||
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);
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>
|
||||
* 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
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>
|
||||
* 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
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
* Copyright (C) 2004 - 2005 FUJITA Tomonori <tomof@acm.org>
|
||||
* 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
* Copyright (C) 2005 FUJITA Tomonori <tomof@acm.org>
|
||||
* 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
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
* Copyright (C) 2005 FUJITA Tomonori <tomof@acm.org>
|
||||
* 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
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
* Copyright (C) 2005 FUJITA Tomonori <tomof@acm.org>
|
||||
* 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
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>
|
||||
* 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
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>
|
||||
* 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
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>
|
||||
* 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
|
||||
|
||||
+189
-189
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -241,7 +241,7 @@ typedef struct _MPT_STM_PRIV
|
||||
#define FWVersion_0101 Reserved_0101_FWVersion
|
||||
#define EventDataSasPhyLinkStatus_t MpiEventDataSasPhyLinkStatus_t
|
||||
|
||||
#ifndef MPI_FCPORTPAGE1_FLAGS_FORCE_USE_NOSEEPROM_WWNS
|
||||
#ifndef MPI_FCPORTPAGE1_FLAGS_FORCE_USE_NOSEEPROM_WWNS
|
||||
#define MPI_FCPORTPAGE1_FLAGS_FORCE_USE_NOSEEPROM_WWNS (0x02000000)
|
||||
#endif
|
||||
|
||||
@@ -337,7 +337,7 @@ typedef struct _MPT_STM_PRIV
|
||||
#define MPT_STATUS_SENSE_NOT_SENT 2 /* sense couldn't be sent with status */
|
||||
#define MPT_STATUS_SENSE_HANDLE_RQ 3 /* REQUEST SENSE handled with cached sense */
|
||||
|
||||
struct mpt_cmd
|
||||
struct mpt_cmd
|
||||
{
|
||||
struct mpt_sess *sess;
|
||||
struct scst_cmd *scst_cmd;
|
||||
@@ -349,7 +349,7 @@ struct mpt_cmd
|
||||
dma_addr_t dma_handle;
|
||||
};
|
||||
|
||||
struct mpt_sess
|
||||
struct mpt_sess
|
||||
{
|
||||
struct scst_session *scst_sess;
|
||||
struct mpt_tgt *tgt;
|
||||
@@ -375,5 +375,5 @@ struct mpt_mgmt_cmd
|
||||
struct mpt_sess *sess;
|
||||
int task_mgmt;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+106
-106
@@ -1,17 +1,17 @@
|
||||
/*
|
||||
* qla2x00t.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* Leonid Stoljar
|
||||
* Nathaniel Clark <nate@misrule.us>
|
||||
*
|
||||
* Qlogic 2x00 SCSI target driver.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -142,7 +142,7 @@ static void q2t_modify_command_count(scsi_qla_host_t *ha, int cmd_count,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
TRACE_DBG("Sending MODIFY_LUN ha %p, cmd %d, imm %d",
|
||||
TRACE_DBG("Sending MODIFY_LUN ha %p, cmd %d, imm %d",
|
||||
ha, cmd_count, imm_count);
|
||||
|
||||
pkt = (modify_lun_entry_t *)tgt_data.req_pkt(ha);
|
||||
@@ -180,7 +180,7 @@ static void __q2t_send_notify_ack(scsi_qla_host_t *ha,
|
||||
int resp_code_valid, uint16_t ox_id)
|
||||
{
|
||||
nack_entry_t *ntfy;
|
||||
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
/* Send marker if required */
|
||||
@@ -233,7 +233,7 @@ static inline void q2t_send_notify_ack(scsi_qla_host_t *ha,
|
||||
resp_code_valid, iocb->ox_id);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* register with initiator driver (but target mode isn't enabled till
|
||||
* it's turned on via sysfs)
|
||||
*/
|
||||
@@ -257,7 +257,7 @@ static int q2t_target_detect(struct scst_tgt_template *templ)
|
||||
}
|
||||
|
||||
if (tgt_data.magic != QLA2X_INITIATOR_MAGIC) {
|
||||
PRINT_ERROR("Wrong version of the initiator driver: %d",
|
||||
PRINT_ERROR("Wrong version of the initiator driver: %d",
|
||||
tgt_data.magic);
|
||||
res = -EINVAL;
|
||||
}
|
||||
@@ -320,7 +320,7 @@ static void q2t_unreg_sess(struct q2t_sess *sess)
|
||||
PRINT_INFO("qla2x00tgt(%ld): session for loop_id %d deleted",
|
||||
sess->tgt->ha->instance, sess->loop_id);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Any commands for this session will be finished regularly,
|
||||
* because we must not drop SCSI commands on transport level,
|
||||
* at least without any response to the initiator.
|
||||
@@ -384,12 +384,12 @@ static int q2t_target_release(struct scst_tgt *scst_tgt)
|
||||
wait_event(tgt->waitQ, test_tgt_sess_count(tgt, ha));
|
||||
|
||||
/* big hammer */
|
||||
if(!ha->flags.host_shutting_down)
|
||||
if(!ha->flags.host_shutting_down)
|
||||
tgt_data.disable_lun(ha);
|
||||
|
||||
/* wait for sessions to clear out (just in case) */
|
||||
wait_event(tgt->waitQ, test_tgt_sess_count(tgt, ha));
|
||||
|
||||
wait_event(tgt->waitQ, test_tgt_sess_count(tgt, ha));
|
||||
|
||||
TRACE_MGMT_DBG("Finished waiting for tgt %p: empty(sess_list)=%d "
|
||||
"sess_count=%d", tgt, list_empty(&tgt->sess_list),
|
||||
tgt->sess_count);
|
||||
@@ -426,19 +426,19 @@ static int q2t_pci_map_calc_cnt(struct q2t_prm *prm)
|
||||
prm->tgt->datasegs_per_cmd) /
|
||||
prm->tgt->datasegs_per_cont;
|
||||
if (((uint16_t)(prm->seg_cnt - prm->tgt->datasegs_per_cmd)) %
|
||||
prm->tgt->datasegs_per_cont)
|
||||
prm->tgt->datasegs_per_cont)
|
||||
{
|
||||
prm->req_cnt++;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
TRACE_DBG("seg_cnt=%d, req_cnt=%d, res=%d", prm->seg_cnt,
|
||||
TRACE_DBG("seg_cnt=%d, req_cnt=%d, res=%d", prm->seg_cnt,
|
||||
prm->req_cnt, res);
|
||||
return res;
|
||||
|
||||
out_err:
|
||||
PRINT_ERROR("qla2x00tgt(%ld): PCI mapping failed: sg_cnt=%d",
|
||||
PRINT_ERROR("qla2x00tgt(%ld): PCI mapping failed: sg_cnt=%d",
|
||||
prm->tgt->ha->instance, prm->sg_cnt);
|
||||
res = -1;
|
||||
goto out;
|
||||
@@ -464,7 +464,7 @@ static inline uint32_t q2t_make_handle(scsi_qla_host_t *ha)
|
||||
}
|
||||
} while ((h == Q2T_NULL_HANDLE) ||
|
||||
(h == Q2T_BUSY_HANDLE) ||
|
||||
(h == Q2T_SKIP_HANDLE) ||
|
||||
(h == Q2T_SKIP_HANDLE) ||
|
||||
(ha->cmds[h] != NULL));
|
||||
|
||||
if (h != Q2T_NULL_HANDLE)
|
||||
@@ -493,7 +493,7 @@ static void q2t_build_ctio_pkt(struct q2t_prm *prm)
|
||||
prm->pkt->entry_type = CONTINUE_TGT_IO_TYPE;
|
||||
|
||||
prm->pkt->entry_count = (uint8_t) prm->req_cnt;
|
||||
|
||||
|
||||
h = q2t_make_handle(prm->tgt->ha);
|
||||
if (h != Q2T_NULL_HANDLE) {
|
||||
prm->tgt->ha->cmds[h] = prm->cmd;
|
||||
@@ -506,10 +506,10 @@ static void q2t_build_ctio_pkt(struct q2t_prm *prm)
|
||||
/* Set initiator ID */
|
||||
h = GET_TARGET_ID(prm->tgt->ha, &prm->cmd->atio);
|
||||
SET_TARGET_ID(prm->tgt->ha, prm->pkt->target, h);
|
||||
|
||||
|
||||
prm->pkt->exchange_id = prm->cmd->atio.exchange_id;
|
||||
|
||||
TRACE(TRACE_DEBUG|TRACE_SCSI,
|
||||
TRACE(TRACE_DEBUG|TRACE_SCSI,
|
||||
"handle(scst_cmd) -> %08x, timeout %d L %#x -> I %#x E %#x",
|
||||
prm->pkt->handle, timeout, le16_to_cpu(prm->cmd->atio.lun),
|
||||
GET_TARGET_ID(prm->tgt->ha, prm->pkt),
|
||||
@@ -549,7 +549,7 @@ static void q2t_load_data_segments(struct q2t_prm *prm)
|
||||
/* Load command entry data segments */
|
||||
for (cnt = 0;
|
||||
(cnt < prm->tgt->datasegs_per_cmd) && prm->seg_cnt;
|
||||
cnt++, prm->seg_cnt--)
|
||||
cnt++, prm->seg_cnt--)
|
||||
{
|
||||
*dword_ptr++ =
|
||||
cpu_to_le32(pci_dma_lo32(sg_dma_address(prm->sg)));
|
||||
@@ -573,10 +573,10 @@ static void q2t_load_data_segments(struct q2t_prm *prm)
|
||||
|
||||
/* Build continuation packets */
|
||||
while (prm->seg_cnt > 0) {
|
||||
cont_a64_entry_t *cont_pkt64 =
|
||||
cont_a64_entry_t *cont_pkt64 =
|
||||
(cont_a64_entry_t *)tgt_data.req_cont_pkt(prm->tgt->ha);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Make sure that from cont_pkt64 none of
|
||||
* 64-bit specific fields used for 32-bit
|
||||
* addressing. Cast to (cont_entry_t*) for
|
||||
@@ -602,7 +602,7 @@ static void q2t_load_data_segments(struct q2t_prm *prm)
|
||||
/* Load continuation entry data segments */
|
||||
for (cnt = 0;
|
||||
cnt < prm->tgt->datasegs_per_cont && prm->seg_cnt;
|
||||
cnt++, prm->seg_cnt--)
|
||||
cnt++, prm->seg_cnt--)
|
||||
{
|
||||
*dword_ptr++ =
|
||||
cpu_to_le32(pci_dma_lo32
|
||||
@@ -636,7 +636,7 @@ static void q2t_init_ctio_ret_entry(ctio_ret_entry_t *ctio_m1,
|
||||
{
|
||||
TRACE_ENTRY();
|
||||
|
||||
prm->sense_buffer_len = min((uint32_t)prm->sense_buffer_len,
|
||||
prm->sense_buffer_len = min((uint32_t)prm->sense_buffer_len,
|
||||
(uint32_t)sizeof(ctio_m1->sense_data));
|
||||
|
||||
ctio_m1->flags = __constant_cpu_to_le16(OF_SSTS | OF_FAST_POST |
|
||||
@@ -782,10 +782,10 @@ static int q2t_xmit_response(struct scst_cmd *scst_cmd)
|
||||
prm.pkt->scsi_status = cpu_to_le16(
|
||||
prm.rq_result);
|
||||
prm.pkt->residual = cpu_to_le32(prm.residual);
|
||||
prm.pkt->flags |=
|
||||
prm.pkt->flags |=
|
||||
__constant_cpu_to_le16(OF_SSTS);
|
||||
} else {
|
||||
ctio_ret_entry_t *ctio_m1 =
|
||||
ctio_ret_entry_t *ctio_m1 =
|
||||
(ctio_ret_entry_t *)
|
||||
tgt_data.req_cont_pkt(prm.tgt->ha);
|
||||
|
||||
@@ -810,7 +810,7 @@ static int q2t_xmit_response(struct scst_cmd *scst_cmd)
|
||||
} else {
|
||||
q2t_init_ctio_ret_entry((ctio_ret_entry_t *)prm.pkt, &prm);
|
||||
}
|
||||
|
||||
|
||||
prm.cmd->state = Q2T_STATE_PROCESSED; /* Mid-level is done processing */
|
||||
|
||||
TRACE_BUFFER("Xmitting", prm.pkt, REQUEST_ENTRY_SIZE);
|
||||
@@ -884,7 +884,7 @@ static int q2t_rdy_to_xfer(struct scst_cmd *scst_cmd)
|
||||
TRACE_BUFFER("Xfering", prm.pkt, REQUEST_ENTRY_SIZE);
|
||||
|
||||
q2t_exec_queue(prm.tgt->ha);
|
||||
|
||||
|
||||
out_unlock:
|
||||
/* Release ring specific lock */
|
||||
spin_unlock_irqrestore(&prm.tgt->ha->hardware_lock, flags);
|
||||
@@ -1001,7 +1001,7 @@ static inline struct scst_cmd *q2t_get_cmd(scsi_qla_host_t *ha, uint32_t handle)
|
||||
|
||||
/* ha->hardware_lock supposed to be held on entry */
|
||||
static void q2t_do_ctio_completion(scsi_qla_host_t *ha,
|
||||
uint32_t handle,
|
||||
uint32_t handle,
|
||||
uint16_t status,
|
||||
ctio_common_entry_t *ctio)
|
||||
{
|
||||
@@ -1012,10 +1012,10 @@ static void q2t_do_ctio_completion(scsi_qla_host_t *ha,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
if (ctio != NULL)
|
||||
if (ctio != NULL)
|
||||
loop_id = GET_TARGET_ID(ha, ctio);
|
||||
|
||||
TRACE(TRACE_DEBUG|TRACE_SCSI, "handle(ctio %p status %#x) <- %08x I %x",
|
||||
TRACE(TRACE_DEBUG|TRACE_SCSI, "handle(ctio %p status %#x) <- %08x I %x",
|
||||
ctio, status, handle, loop_id);
|
||||
|
||||
/* Clear out CTIO_COMPLETION_HANDLE_MARK */
|
||||
@@ -1061,7 +1061,7 @@ static void q2t_do_ctio_completion(scsi_qla_host_t *ha,
|
||||
scst_cmd = q2t_get_cmd(ha, handle);
|
||||
if (unlikely(scst_cmd == NULL)) {
|
||||
PRINT_INFO("qla2x00tgt(%ld): Suspicious: unable to "
|
||||
"find the command with handle %x",
|
||||
"find the command with handle %x",
|
||||
ha->instance, handle);
|
||||
goto out;
|
||||
}
|
||||
@@ -1076,7 +1076,7 @@ static void q2t_do_ctio_completion(scsi_qla_host_t *ha,
|
||||
if (sess == NULL) {
|
||||
PRINT_INFO("qla2x00tgt(%ld): Suspicious: "
|
||||
"ctio_completion for non-existing session "
|
||||
"(loop_id %d, tag %d)",
|
||||
"(loop_id %d, tag %d)",
|
||||
ha->instance, loop_id, tag);
|
||||
goto out;
|
||||
}
|
||||
@@ -1084,7 +1084,7 @@ static void q2t_do_ctio_completion(scsi_qla_host_t *ha,
|
||||
scst_cmd = scst_find_cmd_by_tag(sess->scst_sess, tag);
|
||||
if (scst_cmd == NULL) {
|
||||
PRINT_INFO("qla2x00tgt(%ld): Suspicious: unable to "
|
||||
"find the command with tag %d (loop_id %d)",
|
||||
"find the command with tag %d (loop_id %d)",
|
||||
ha->instance, tag, loop_id);
|
||||
goto out;
|
||||
}
|
||||
@@ -1318,9 +1318,9 @@ static char *q2t_find_name(scsi_qla_host_t *ha, int loop_id)
|
||||
list_for_each_entry(fcl, &ha->fcports, list) {
|
||||
if (loop_id == (fcl->loop_id & 0xFF)) {
|
||||
sprintf(wwn_str, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
fcl->port_name[0], fcl->port_name[1],
|
||||
fcl->port_name[2], fcl->port_name[3],
|
||||
fcl->port_name[4], fcl->port_name[5],
|
||||
fcl->port_name[0], fcl->port_name[1],
|
||||
fcl->port_name[2], fcl->port_name[3],
|
||||
fcl->port_name[4], fcl->port_name[5],
|
||||
fcl->port_name[6], fcl->port_name[7]);
|
||||
TRACE_DBG("found wwn: %s for loop_id: %d", wwn_str, loop_id);
|
||||
wwn_found = 1;
|
||||
@@ -1349,7 +1349,7 @@ static char *q2t_make_name(scsi_qla_host_t *ha, const uint8_t *name)
|
||||
goto out;
|
||||
}
|
||||
sprintf(wwn_str, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
name[1], name[0], name[3], name[2], name[5], name[4],
|
||||
name[1], name[0], name[3], name[2], name[5], name[4],
|
||||
name[7], name[6]);
|
||||
|
||||
out:
|
||||
@@ -1514,35 +1514,35 @@ static int q2t_handle_task_mgmt(scsi_qla_host_t *ha, notify_entry_t *iocb)
|
||||
case IMM_NTFY_CLEAR_ACA:
|
||||
TRACE(TRACE_MGMT, "%s", "IMM_NTFY_CLEAR_ACA received");
|
||||
rc = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_CLEAR_ACA,
|
||||
(uint8_t *)&lun, sizeof(lun),
|
||||
(uint8_t *)&lun, sizeof(lun),
|
||||
SCST_ATOMIC, mcmd);
|
||||
break;
|
||||
|
||||
case IMM_NTFY_TARGET_RESET:
|
||||
TRACE(TRACE_MGMT, "%s", "IMM_NTFY_TARGET_RESET received");
|
||||
rc = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_TARGET_RESET,
|
||||
(uint8_t *)&lun, sizeof(lun),
|
||||
(uint8_t *)&lun, sizeof(lun),
|
||||
SCST_ATOMIC, mcmd);
|
||||
break;
|
||||
|
||||
case IMM_NTFY_LUN_RESET:
|
||||
TRACE(TRACE_MGMT, "%s", "IMM_NTFY_LUN_RESET received");
|
||||
rc = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_LUN_RESET,
|
||||
(uint8_t *)&lun, sizeof(lun),
|
||||
(uint8_t *)&lun, sizeof(lun),
|
||||
SCST_ATOMIC, mcmd);
|
||||
break;
|
||||
|
||||
case IMM_NTFY_CLEAR_TS:
|
||||
TRACE(TRACE_MGMT, "%s", "IMM_NTFY_CLEAR_TS received");
|
||||
rc = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_CLEAR_TASK_SET,
|
||||
(uint8_t *)&lun, sizeof(lun),
|
||||
(uint8_t *)&lun, sizeof(lun),
|
||||
SCST_ATOMIC, mcmd);
|
||||
break;
|
||||
|
||||
case IMM_NTFY_ABORT_TS:
|
||||
TRACE(TRACE_MGMT, "%s", "IMM_NTFY_ABORT_TS received");
|
||||
rc = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_ABORT_TASK_SET,
|
||||
(uint8_t *)&lun, sizeof(lun),
|
||||
(uint8_t *)&lun, sizeof(lun),
|
||||
SCST_ATOMIC, mcmd);
|
||||
break;
|
||||
|
||||
@@ -1589,7 +1589,7 @@ static int q2t_abort_task(scsi_qla_host_t *ha, notify_entry_t *iocb)
|
||||
res = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
mcmd = kzalloc(sizeof(*mcmd), GFP_ATOMIC);
|
||||
if (mcmd == NULL) {
|
||||
TRACE(TRACE_OUT_OF_MEM, "%s", "Allocation of mgmt cmd failed");
|
||||
@@ -1600,7 +1600,7 @@ static int q2t_abort_task(scsi_qla_host_t *ha, notify_entry_t *iocb)
|
||||
mcmd->sess = sess;
|
||||
mcmd->notify_entry = *iocb;
|
||||
|
||||
rc = scst_rx_mgmt_fn_tag(sess->scst_sess, SCST_ABORT_TASK, tag,
|
||||
rc = scst_rx_mgmt_fn_tag(sess->scst_sess, SCST_ABORT_TASK, tag,
|
||||
SCST_ATOMIC, mcmd);
|
||||
if (rc != 0) {
|
||||
PRINT_ERROR("qla2x00tgt(%ld): scst_rx_mgmt_fn_tag() failed: %d",
|
||||
@@ -1665,20 +1665,20 @@ static void q2t_handle_imm_notify(scsi_qla_host_t *ha, notify_entry_t *iocb)
|
||||
|
||||
if (!ha->flags.enable_target_mode || ha->tgt == NULL) {
|
||||
TRACE(TRACE_MGMT_DEBUG|TRACE_SCSI|TRACE_DEBUG,
|
||||
"Acking %04x S %04x I %#x -> L %#x", status,
|
||||
"Acking %04x S %04x I %#x -> L %#x", status,
|
||||
le16_to_cpu(iocb->seq_id), loop_id,
|
||||
le16_to_cpu(iocb->lun));
|
||||
goto out;
|
||||
}
|
||||
|
||||
TRACE_BUFFER("IMMED Notify Coming Up", iocb, sizeof(*iocb));
|
||||
|
||||
|
||||
switch (status) {
|
||||
case IMM_NTFY_LIP_RESET:
|
||||
TRACE(TRACE_MGMT, "LIP reset (I %#x)", loop_id);
|
||||
/*
|
||||
* ToDo: doing so we reset all holding RESERVE'ations,
|
||||
* which could be unexpected, so be more carefull here
|
||||
/*
|
||||
* ToDo: doing so we reset all holding RESERVE'ations,
|
||||
* which could be unexpected, so be more carefull here
|
||||
*/
|
||||
q2t_clear_tgt_db(ha->tgt);
|
||||
/* set the Clear LIP reset event flag */
|
||||
@@ -1691,7 +1691,7 @@ static void q2t_handle_imm_notify(scsi_qla_host_t *ha, notify_entry_t *iocb)
|
||||
break;
|
||||
|
||||
case IMM_NTFY_ABORT_TASK:
|
||||
TRACE(TRACE_MGMT_MINOR, "Abort Task (S %04x I %#x -> L %#x)",
|
||||
TRACE(TRACE_MGMT_MINOR, "Abort Task (S %04x I %#x -> L %#x)",
|
||||
le16_to_cpu(iocb->seq_id), loop_id,
|
||||
le16_to_cpu(iocb->lun));
|
||||
if (q2t_abort_task(ha, iocb) == 0)
|
||||
@@ -1699,12 +1699,12 @@ static void q2t_handle_imm_notify(scsi_qla_host_t *ha, notify_entry_t *iocb)
|
||||
break;
|
||||
|
||||
case IMM_NTFY_PORT_LOGOUT:
|
||||
TRACE(TRACE_MGMT, "Port logout (S %04x I %#x -> L %#x)",
|
||||
TRACE(TRACE_MGMT, "Port logout (S %04x I %#x -> L %#x)",
|
||||
le16_to_cpu(iocb->seq_id), loop_id,
|
||||
le16_to_cpu(iocb->lun));
|
||||
/*
|
||||
* ToDo: doing so we reset all holding RESERVE'ations,
|
||||
* which could be unexpected, so be more carefull here
|
||||
/*
|
||||
* ToDo: doing so we reset all holding RESERVE'ations,
|
||||
* which could be unexpected, so be more carefull here
|
||||
*/
|
||||
q2t_port_logout(ha, loop_id);
|
||||
break;
|
||||
@@ -1715,9 +1715,9 @@ static void q2t_handle_imm_notify(scsi_qla_host_t *ha, notify_entry_t *iocb)
|
||||
/* ToDo: ports DB changes handling ?? */
|
||||
TRACE(TRACE_MGMT, "Port config changed, Global TPRLO or "
|
||||
"Global LOGO (%d)", status);
|
||||
/*
|
||||
* ToDo: doing so we reset all holding RESERVE'ations,
|
||||
* which could be unexpected, so be more carefull here
|
||||
/*
|
||||
* ToDo: doing so we reset all holding RESERVE'ations,
|
||||
* which could be unexpected, so be more carefull here
|
||||
*/
|
||||
q2t_clear_tgt_db(ha->tgt);
|
||||
break;
|
||||
@@ -1765,7 +1765,7 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
ha, ha->flags.enable_target_mode);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
if (pkt->entry_status != 0) {
|
||||
PRINT_ERROR("qla2x00tgt(%ld): Received response packet %x "
|
||||
"with error status %x", ha->instance, pkt->entry_type,
|
||||
@@ -1780,9 +1780,9 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
atio = (atio_entry_t *)pkt;
|
||||
TRACE_DBG("ACCEPT_TGT_IO instance %ld status %04x "
|
||||
"lun %04x read/write %d data_length %08x "
|
||||
"target_id %02x exchange_id %04x ",
|
||||
"target_id %02x exchange_id %04x ",
|
||||
ha->instance, le16_to_cpu(atio->status),
|
||||
le16_to_cpu(atio->lun),
|
||||
le16_to_cpu(atio->lun),
|
||||
atio->execution_codes,
|
||||
le32_to_cpu(atio->data_length),
|
||||
GET_TARGET_ID(ha, atio),
|
||||
@@ -1790,7 +1790,7 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
if (atio->status !=
|
||||
__constant_cpu_to_le16(ATIO_CDB_VALID)) {
|
||||
PRINT_ERROR("qla2x00tgt(%ld): ATIO with error "
|
||||
"status %x received", ha->instance,
|
||||
"status %x received", ha->instance,
|
||||
le16_to_cpu(atio->status));
|
||||
break;
|
||||
}
|
||||
@@ -1808,7 +1808,7 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
if (!ha->tgt->tgt_shutdown) {
|
||||
PRINT_INFO("qla2x00tgt(%ld): Unable to "
|
||||
"send the command to SCSI target "
|
||||
"mid-level, sending BUSY status",
|
||||
"mid-level, sending BUSY status",
|
||||
ha->instance);
|
||||
}
|
||||
q2t_send_busy(ha, atio);
|
||||
@@ -1819,34 +1819,34 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
"disabled", ha->instance);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case CONTINUE_TGT_IO_TYPE:
|
||||
if (ha->flags.enable_target_mode && ha->tgt != NULL) {
|
||||
ctio_common_entry_t *entry = (ctio_common_entry_t *)pkt;
|
||||
TRACE_DBG("CONTINUE_TGT_IO: instance %ld",
|
||||
ha->instance);
|
||||
q2t_do_ctio_completion(ha, entry->handle,
|
||||
le16_to_cpu(entry->status),
|
||||
le16_to_cpu(entry->status),
|
||||
entry);
|
||||
} else if (!ha->tgt->tgt_shutdown) {
|
||||
PRINT_ERROR("qla2x00tgt(%ld): CTIO, but target mode "
|
||||
"disabled", ha->instance);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case CTIO_A64_TYPE:
|
||||
if (ha->flags.enable_target_mode && ha->tgt != NULL) {
|
||||
ctio_common_entry_t *entry = (ctio_common_entry_t *)pkt;
|
||||
TRACE_DBG("CTIO_A64: instance %ld", ha->instance);
|
||||
q2t_do_ctio_completion(ha, entry->handle,
|
||||
le16_to_cpu(entry->status),
|
||||
q2t_do_ctio_completion(ha, entry->handle,
|
||||
le16_to_cpu(entry->status),
|
||||
entry);
|
||||
} else if (!ha->tgt->tgt_shutdown) {
|
||||
PRINT_ERROR("qla2x00tgt(%ld): CTIO_A64, but target "
|
||||
"mode disabled", ha->instance);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case IMMED_NOTIFY_TYPE:
|
||||
TRACE_DBG("%s", "IMMED_NOTIFY");
|
||||
q2t_handle_imm_notify(ha, (notify_entry_t *)pkt);
|
||||
@@ -1858,14 +1858,14 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
"with NULL tgt", ha->instance);
|
||||
} else if (ha->tgt->notify_ack_expected > 0) {
|
||||
nack_entry_t *entry = (nack_entry_t *)pkt;
|
||||
TRACE_DBG("NOTIFY_ACK seq %04x status %x",
|
||||
TRACE_DBG("NOTIFY_ACK seq %04x status %x",
|
||||
le16_to_cpu(entry->seq_id),
|
||||
le16_to_cpu(entry->status));
|
||||
ha->tgt->notify_ack_expected--;
|
||||
if (entry->status !=
|
||||
__constant_cpu_to_le16(NOTIFY_ACK_SUCCESS)) {
|
||||
PRINT_ERROR("qla2x00tgt(%ld): NOTIFY_ACK "
|
||||
"failed %x", ha->instance,
|
||||
"failed %x", ha->instance,
|
||||
le16_to_cpu(entry->status));
|
||||
}
|
||||
} else {
|
||||
@@ -1874,24 +1874,24 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
}
|
||||
break;
|
||||
|
||||
case MODIFY_LUN_TYPE:
|
||||
case MODIFY_LUN_TYPE:
|
||||
if ((ha->tgt != NULL) && (ha->tgt->modify_lun_expected > 0)) {
|
||||
struct q2t_tgt *tgt = ha->tgt;
|
||||
modify_lun_entry_t *entry = (modify_lun_entry_t *)pkt;
|
||||
TRACE_DBG("MODIFY_LUN %x, imm %c%d, cmd %c%d",
|
||||
TRACE_DBG("MODIFY_LUN %x, imm %c%d, cmd %c%d",
|
||||
entry->status,
|
||||
(entry->operators & MODIFY_LUN_IMM_ADD) ?'+'
|
||||
:(entry->operators & MODIFY_LUN_IMM_SUB) ?'-'
|
||||
:' ',
|
||||
entry->immed_notify_count,
|
||||
(entry->operators & MODIFY_LUN_CMD_ADD) ?'+'
|
||||
(entry->operators & MODIFY_LUN_IMM_ADD) ?'+'
|
||||
:(entry->operators & MODIFY_LUN_IMM_SUB) ?'-'
|
||||
:' ',
|
||||
entry->immed_notify_count,
|
||||
(entry->operators & MODIFY_LUN_CMD_ADD) ?'+'
|
||||
:(entry->operators & MODIFY_LUN_CMD_SUB) ?'-'
|
||||
:' ',
|
||||
:' ',
|
||||
entry->command_count);
|
||||
tgt->modify_lun_expected--;
|
||||
if (entry->status != MODIFY_LUN_SUCCESS) {
|
||||
PRINT_ERROR("qla2x00tgt(%ld): MODIFY_LUN "
|
||||
"failed %x", ha->instance,
|
||||
"failed %x", ha->instance,
|
||||
entry->status);
|
||||
}
|
||||
tgt->disable_lun_status = entry->status;
|
||||
@@ -1905,7 +1905,7 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
if (ha->tgt != NULL) {
|
||||
struct q2t_tgt *tgt = ha->tgt;
|
||||
elun_entry_t *entry = (elun_entry_t *)pkt;
|
||||
TRACE_DBG("ENABLE_LUN %x imm %u cmd %u ",
|
||||
TRACE_DBG("ENABLE_LUN %x imm %u cmd %u ",
|
||||
entry->status, entry->immed_notify_count,
|
||||
entry->command_count);
|
||||
if ((ha->flags.enable_target_mode) &&
|
||||
@@ -1918,8 +1918,8 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
"error: %#x", entry->status);
|
||||
entry->status = ENABLE_LUN_SUCCESS;
|
||||
} else if (entry->status != ENABLE_LUN_SUCCESS) {
|
||||
PRINT_ERROR("qla2x00tgt(%ld): ENABLE_LUN "
|
||||
"failed %x",
|
||||
PRINT_ERROR("qla2x00tgt(%ld): ENABLE_LUN "
|
||||
"failed %x",
|
||||
ha->instance, entry->status);
|
||||
ha->flags.enable_target_mode =
|
||||
~ha->flags.enable_target_mode;
|
||||
@@ -1948,7 +1948,7 @@ static void q2t_async_event(uint16_t code, scsi_qla_host_t *ha, uint16_t *mailbo
|
||||
sBUG_ON(ha == NULL);
|
||||
|
||||
if (unlikely(ha->tgt == NULL)) {
|
||||
TRACE(TRACE_DEBUG|TRACE_MGMT,
|
||||
TRACE(TRACE_DEBUG|TRACE_MGMT,
|
||||
"ASYNC EVENT %#x, but no tgt. ha %p tgt_flag %d",
|
||||
code, ha, ha->flags.enable_target_mode);
|
||||
goto out;
|
||||
@@ -1966,16 +1966,16 @@ static void q2t_async_event(uint16_t code, scsi_qla_host_t *ha, uint16_t *mailbo
|
||||
case MBA_CHG_IN_CONNECTION: /* Change in connection mode. */
|
||||
TRACE_MGMT_DBG("Async event %#x occured: clear tgt_db", code);
|
||||
#if 0
|
||||
/*
|
||||
* ToDo: doing so we reset all holding RESERVE'ations,
|
||||
* which could be unexpected, so be more carefull here
|
||||
/*
|
||||
* ToDo: doing so we reset all holding RESERVE'ations,
|
||||
* which could be unexpected, so be more carefull here
|
||||
*/
|
||||
q2t_clear_tgt_db(ha->tgt);
|
||||
#endif
|
||||
break;
|
||||
case MBA_RSCN_UPDATE:
|
||||
TRACE_MGMT_DBG("RSCN Update (%x) N_Port %#06x (fmt %x)",
|
||||
code, ((mailbox[1]&0xF)<<2)|le16_to_cpu(mailbox[2]),
|
||||
code, ((mailbox[1]&0xF)<<2)|le16_to_cpu(mailbox[2]),
|
||||
(mailbox[1]&0xF0)>>1);
|
||||
break;
|
||||
|
||||
@@ -2010,9 +2010,9 @@ static int q2t_get_target_name(scsi_qla_host_t *ha, char **wwn)
|
||||
}
|
||||
|
||||
sprintf(name, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
ha->port_name[0], ha->port_name[1],
|
||||
ha->port_name[2], ha->port_name[3],
|
||||
ha->port_name[4], ha->port_name[5],
|
||||
ha->port_name[0], ha->port_name[1],
|
||||
ha->port_name[2], ha->port_name[3],
|
||||
ha->port_name[4], ha->port_name[5],
|
||||
ha->port_name[6], ha->port_name[7]);
|
||||
|
||||
*wwn = name;
|
||||
@@ -2023,12 +2023,12 @@ out:
|
||||
|
||||
/* no lock held on entry */
|
||||
/* called via callback from qla2xxx */
|
||||
static void q2t_host_action(scsi_qla_host_t *ha,
|
||||
static void q2t_host_action(scsi_qla_host_t *ha,
|
||||
qla2x_tgt_host_action_t action)
|
||||
{
|
||||
struct q2t_tgt *tgt = NULL;
|
||||
unsigned long flags = 0;
|
||||
|
||||
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -2046,18 +2046,18 @@ static void q2t_host_action(scsi_qla_host_t *ha,
|
||||
"Allocation of tgt failed");
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
tgt->ha = ha;
|
||||
tgt->disable_lun_status = Q2T_DISABLE_LUN_STATUS_NOT_SET;
|
||||
INIT_LIST_HEAD(&tgt->sess_list);
|
||||
init_waitqueue_head(&tgt->waitQ);
|
||||
|
||||
|
||||
if (ha->flags.enable_64bit_addressing) {
|
||||
PRINT_INFO("qla2x00tgt(%ld): 64 Bit PCI "
|
||||
"Addressing Enabled", ha->instance);
|
||||
tgt->tgt_enable_64bit_addr = 1;
|
||||
/* 3 is reserved */
|
||||
sg_tablesize =
|
||||
sg_tablesize =
|
||||
QLA_MAX_SG64(ha->request_q_length - 3);
|
||||
tgt->datasegs_per_cmd = DATASEGS_PER_COMMAND64;
|
||||
tgt->datasegs_per_cont = DATASEGS_PER_CONT64;
|
||||
@@ -2069,7 +2069,7 @@ static void q2t_host_action(scsi_qla_host_t *ha,
|
||||
tgt->datasegs_per_cmd = DATASEGS_PER_COMMAND32;
|
||||
tgt->datasegs_per_cont = DATASEGS_PER_CONT32;
|
||||
}
|
||||
|
||||
|
||||
if (q2t_get_target_name(ha, &wwn) != 0) {
|
||||
kfree(tgt);
|
||||
goto out;
|
||||
@@ -2079,7 +2079,7 @@ static void q2t_host_action(scsi_qla_host_t *ha,
|
||||
kfree(wwn);
|
||||
if (!tgt->scst_tgt) {
|
||||
PRINT_ERROR("qla2x00tgt(%ld): scst_register() "
|
||||
"failed for host %ld(%p)", ha->instance,
|
||||
"failed for host %ld(%p)", ha->instance,
|
||||
ha->host_no, ha);
|
||||
kfree(tgt);
|
||||
goto out;
|
||||
@@ -2087,7 +2087,7 @@ static void q2t_host_action(scsi_qla_host_t *ha,
|
||||
|
||||
scst_tgt_set_sg_tablesize(tgt->scst_tgt, sg_tablesize);
|
||||
scst_tgt_set_tgt_priv(tgt->scst_tgt, tgt);
|
||||
|
||||
|
||||
spin_lock_irqsave(&ha->hardware_lock, flags);
|
||||
ha->tgt = tgt;
|
||||
spin_unlock_irqrestore(&ha->hardware_lock, flags);
|
||||
@@ -2095,7 +2095,7 @@ static void q2t_host_action(scsi_qla_host_t *ha,
|
||||
TRACE_DBG("Enable lun for host %ld(%ld,%p)",
|
||||
ha->host_no, ha->instance, ha);
|
||||
tgt_data.enable_lun(ha);
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
case DISABLE_TARGET_MODE:
|
||||
@@ -2105,9 +2105,9 @@ static void q2t_host_action(scsi_qla_host_t *ha,
|
||||
ha->flags.enable_target_mode = 0;
|
||||
spin_unlock_irqrestore(&ha->hardware_lock, flags);
|
||||
|
||||
if(!ha->flags.host_shutting_down)
|
||||
if(!ha->flags.host_shutting_down)
|
||||
tgt_data.disable_lun(ha);
|
||||
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -2120,7 +2120,7 @@ static void q2t_host_action(scsi_qla_host_t *ha,
|
||||
scst_unregister(tgt->scst_tgt);
|
||||
/*
|
||||
* Free of tgt happens via callback q2t_target_release
|
||||
* called from scst_unregister, so we shouldn't touch it again
|
||||
* called from scst_unregister, so we shouldn't touch it again
|
||||
*/
|
||||
tgt = NULL;
|
||||
break;
|
||||
@@ -2237,7 +2237,7 @@ static int __init q2t_init(void)
|
||||
goto out_free_kmem;
|
||||
|
||||
/*
|
||||
* qla2xxx_tgt_register_driver() happens in q2t_target_detect
|
||||
* qla2xxx_tgt_register_driver() happens in q2t_target_detect
|
||||
* called via scst_register_target_template()
|
||||
*/
|
||||
|
||||
@@ -2254,7 +2254,7 @@ out_unreg_target:
|
||||
|
||||
out_free_kmem:
|
||||
kmem_cache_destroy(q2t_cmd_cachep);
|
||||
|
||||
|
||||
qla2xxx_tgt_unregister_driver();
|
||||
goto out;
|
||||
}
|
||||
@@ -2266,9 +2266,9 @@ static void __exit q2t_exit(void)
|
||||
q2t_proc_log_entry_clean(&tgt_template);
|
||||
|
||||
scst_unregister_target_template(&tgt_template);
|
||||
|
||||
|
||||
qla2xxx_tgt_unregister_driver();
|
||||
|
||||
|
||||
kmem_cache_destroy(q2t_cmd_cachep);
|
||||
|
||||
TRACE_EXIT();
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
/*
|
||||
* qla2x00t.h
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* Leonid Stoljar
|
||||
* Nathaniel Clark <nate@misrule.us>
|
||||
*
|
||||
* Significant modification 2006 by Nathaniel Clark <nate@misrule.us>
|
||||
* Significant modification 2006 by Nathaniel Clark <nate@misrule.us>
|
||||
*
|
||||
* Qlogic 2x00 SCSI target driver.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -163,10 +163,10 @@ struct q2t_prm
|
||||
};
|
||||
|
||||
/* ha->hardware_lock supposed to be held on entry (to protect tgt->sess_list) */
|
||||
static inline struct q2t_sess *q2t_find_sess_by_lid(struct q2t_tgt *tgt,
|
||||
uint16_t lid)
|
||||
static inline struct q2t_sess *q2t_find_sess_by_lid(struct q2t_tgt *tgt,
|
||||
uint16_t lid)
|
||||
{
|
||||
struct q2t_sess *sess, *sess_tmp;
|
||||
struct q2t_sess *sess, *sess_tmp;
|
||||
sBUG_ON(tgt == NULL);
|
||||
list_for_each_entry_safe(sess, sess_tmp, &tgt->sess_list, list) {
|
||||
if (lid == (sess->loop_id))
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* qla2x_tgt.h
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2005 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
* Additional file for the target driver support.
|
||||
*
|
||||
*
|
||||
* 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; 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
|
||||
@@ -49,7 +49,7 @@ extern request_t *qla2x00_req_pkt(scsi_qla_host_t *ha);
|
||||
*/
|
||||
/* Caller MUST have hardware lock held */
|
||||
static inline void
|
||||
__qla2x00_en_dis_lun(scsi_qla_host_t *ha, int enable)
|
||||
__qla2x00_en_dis_lun(scsi_qla_host_t *ha, int enable)
|
||||
{
|
||||
elun_entry_t *pkt;
|
||||
|
||||
@@ -66,7 +66,7 @@ __qla2x00_en_dis_lun(scsi_qla_host_t *ha, int enable)
|
||||
pkt->immed_notify_count = 0;
|
||||
pkt->timeout = 0;
|
||||
}
|
||||
DEBUG2(printk(KERN_DEBUG
|
||||
DEBUG2(printk(KERN_DEBUG
|
||||
"scsi%lu:ENABLE_LUN IOCB imm %u cmd %u timeout %u\n",
|
||||
ha->host_no, pkt->immed_notify_count,
|
||||
pkt->command_count, pkt->timeout));
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/*
|
||||
* qla2x_tgt_def.h
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2005 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
* Additional file for the target driver support. Intended to define
|
||||
* for 2200 and 2300 thier own exported symbols with unique names.
|
||||
*
|
||||
*
|
||||
* 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; 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
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
#define QLA_EXTENDED_LUN 1
|
||||
|
||||
/*
|
||||
/*
|
||||
* Used to mark which completion handles (for RIO Status's) are for CTIO's
|
||||
* vs. regular (non-target) info.
|
||||
*/
|
||||
@@ -330,9 +330,9 @@ typedef struct
|
||||
* Type Definitions used by initiator & target halves
|
||||
\********************************************************************/
|
||||
|
||||
typedef enum {
|
||||
DISABLE_TARGET_MODE = 0,
|
||||
ENABLE_TARGET_MODE = 1
|
||||
typedef enum {
|
||||
DISABLE_TARGET_MODE = 0,
|
||||
ENABLE_TARGET_MODE = 1
|
||||
} qla2x_tgt_host_action_t;
|
||||
|
||||
struct qla2x_tgt_initiator
|
||||
@@ -349,7 +349,7 @@ struct qla2x_tgt_initiator
|
||||
struct qla2x_tgt_target
|
||||
{
|
||||
int magic;
|
||||
|
||||
|
||||
/* Callbacks - H/W lock MUST be held while calling any*/
|
||||
request_t *(*req_pkt)(scsi_qla_host_t *ha);
|
||||
void (*isp_cmd)(scsi_qla_host_t *ha);
|
||||
@@ -360,7 +360,7 @@ struct qla2x_tgt_target
|
||||
int (*get_counts)(scsi_qla_host_t *ha, uint8_t *cmd, uint8_t *imm);
|
||||
};
|
||||
|
||||
int qla2xxx_tgt_register_driver(/* IN */ struct qla2x_tgt_initiator *tgt,
|
||||
int qla2xxx_tgt_register_driver(/* IN */ struct qla2x_tgt_initiator *tgt,
|
||||
/* OUT */ struct qla2x_tgt_target *init);
|
||||
|
||||
void qla2xxx_tgt_unregister_driver(void);
|
||||
|
||||
+33
-33
@@ -29,7 +29,7 @@ qla2x00_show_tgt_enabled(struct class_device *cdev, char *buffer)
|
||||
ulong max_size = PAGE_SIZE;
|
||||
ulong size;
|
||||
|
||||
size = snprintf(buffer, max_size, "%d\n",
|
||||
size = snprintf(buffer, max_size, "%d\n",
|
||||
ha->flags.enable_target_mode);
|
||||
|
||||
return size;
|
||||
@@ -58,7 +58,7 @@ qla2x00_store_tgt_enabled(struct class_device *cdev,
|
||||
}
|
||||
|
||||
switch (buffer[0]) {
|
||||
case '0' :
|
||||
case '0' :
|
||||
if ((ha->flags.enable_target_mode) || force) {
|
||||
qla_target.tgt_host_action(ha, DISABLE_TARGET_MODE);
|
||||
msleep_interruptible(10*1000);
|
||||
@@ -79,12 +79,12 @@ qla2x00_store_tgt_enabled(struct class_device *cdev,
|
||||
if ((size > 2) && (buffer[2] == 'r')) {
|
||||
set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
|
||||
}
|
||||
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
static CLASS_DEVICE_ATTR(target_mode_enabled,
|
||||
S_IRUGO|S_IWUSR,
|
||||
static CLASS_DEVICE_ATTR(target_mode_enabled,
|
||||
S_IRUGO|S_IWUSR,
|
||||
qla2x00_show_tgt_enabled,
|
||||
qla2x00_store_tgt_enabled);
|
||||
|
||||
@@ -106,13 +106,13 @@ qla2x00_show_resource_counts(struct class_device *cdev, char *buffer)
|
||||
rval = qla2x00_mailbox_command(ha, &mc);
|
||||
|
||||
if (rval != QLA_SUCCESS) {
|
||||
size = snprintf(buffer, max_size,
|
||||
"Mailbox Command failed %d, mb %#x",
|
||||
size = snprintf(buffer, max_size,
|
||||
"Mailbox Command failed %d, mb %#x",
|
||||
rval, mc.mb[0]);
|
||||
goto out;
|
||||
}
|
||||
|
||||
size = snprintf(buffer, max_size,
|
||||
size = snprintf(buffer, max_size,
|
||||
"immed_notify\t%d\ncommand\t\t%d\n",
|
||||
mc.mb[2], mc.mb[1]);
|
||||
|
||||
@@ -143,7 +143,7 @@ qla2x00_show_port_database(struct class_device *cdev, char *buffer)
|
||||
dma_addr_t pmap_dma;
|
||||
port_data_t *pmap;
|
||||
ulong dma_size = 0x100*sizeof(*pmap);
|
||||
pmap = (port_data_t*)dma_alloc_coherent(&ha->pdev->dev, dma_size,
|
||||
pmap = (port_data_t*)dma_alloc_coherent(&ha->pdev->dev, dma_size,
|
||||
&pmap_dma, GFP_KERNEL);
|
||||
if (pmap == NULL) {
|
||||
size = snprintf(buffer, max_size, "DMA Alloc failed of %ld",
|
||||
@@ -165,30 +165,30 @@ qla2x00_show_port_database(struct class_device *cdev, char *buffer)
|
||||
rval = qla2x00_mailbox_command(ha, &mc);
|
||||
|
||||
if (rval != QLA_SUCCESS) {
|
||||
size = snprintf(buffer, max_size,
|
||||
"Mailbox Command failed %d, mb0 %#x mb1 %#x\n",
|
||||
size = snprintf(buffer, max_size,
|
||||
"Mailbox Command failed %d, mb0 %#x mb1 %#x\n",
|
||||
rval, mc.mb[0], mc.mb[1]);
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
entries = le16_to_cpu(mc.mb[1])/sizeof(*pmap);
|
||||
|
||||
size += snprintf(buffer+size, max_size-size,
|
||||
|
||||
size += snprintf(buffer+size, max_size-size,
|
||||
"Port Name List (%#04x) returned %d bytes\nL_ID WWPN\n",
|
||||
MBC_PORT_NODE_NAME_LIST, le16_to_cpu(mc.mb[1]));
|
||||
|
||||
for (i = 0; (i < entries) && (size < max_size); ++i) {
|
||||
size += snprintf(buffer+size, max_size-size,
|
||||
size += snprintf(buffer+size, max_size-size,
|
||||
"%04x %02x%02x%02x%02x%02x%02x%02x%02x\n",
|
||||
le16_to_cpu(pmap[i].loop_id),
|
||||
pmap[i].port_name[7], pmap[i].port_name[6],
|
||||
pmap[i].port_name[5], pmap[i].port_name[4],
|
||||
pmap[i].port_name[3], pmap[i].port_name[2],
|
||||
pmap[i].port_name[7], pmap[i].port_name[6],
|
||||
pmap[i].port_name[5], pmap[i].port_name[4],
|
||||
pmap[i].port_name[3], pmap[i].port_name[2],
|
||||
pmap[i].port_name[1], pmap[i].port_name[0]);
|
||||
}
|
||||
|
||||
out_free:
|
||||
dma_free_coherent(&ha->pdev->dev, dma_size, pmap, pmap_dma);
|
||||
dma_free_coherent(&ha->pdev->dev, dma_size, pmap, pmap_dma);
|
||||
|
||||
|
||||
if (size < max_size) {
|
||||
@@ -204,17 +204,17 @@ out_free:
|
||||
rval = qla2x00_get_id_list(ha, ha->gid_list, ha->gid_list_dma,
|
||||
&entries);
|
||||
if (rval != QLA_SUCCESS) {
|
||||
size += snprintf(buffer+size, max_size-size,
|
||||
size += snprintf(buffer+size, max_size-size,
|
||||
"qla2x00_get_id_list failed: %d",
|
||||
rval);
|
||||
goto get_id_failed;
|
||||
}
|
||||
|
||||
size += snprintf(buffer+size, max_size-size,
|
||||
|
||||
size += snprintf(buffer+size, max_size-size,
|
||||
"\nGet ID List (0x007C) returned %d entries\n"
|
||||
"L_ID PortID\n",
|
||||
entries);
|
||||
|
||||
|
||||
id_iter = (char *)ha->gid_list;
|
||||
for (i = 0; (i < entries) && (size < max_size); ++i) {
|
||||
gid = (struct gid_list_info *)id_iter;
|
||||
@@ -234,7 +234,7 @@ out_free:
|
||||
gid->area,
|
||||
gid->al_pa,
|
||||
gid->loop_id_2100);
|
||||
|
||||
|
||||
}
|
||||
id_iter += ha->gid_list_info_size;
|
||||
}
|
||||
@@ -245,8 +245,8 @@ get_id_failed:
|
||||
fc_port_t *fcport;
|
||||
char * state;
|
||||
char port_type[] = "URSBIT";
|
||||
|
||||
size += snprintf(buffer+size, max_size-size,
|
||||
|
||||
size += snprintf(buffer+size, max_size-size,
|
||||
"\nfc_ports database\n");
|
||||
|
||||
list_for_each_entry(fcport, &ha->fcports, list) {
|
||||
@@ -262,8 +262,8 @@ get_id_failed:
|
||||
case FCS_FAILOVER_FAILED : state = "Failover Failed"; break;
|
||||
default: state = "Unknown"; break;
|
||||
}
|
||||
|
||||
size += snprintf(buffer+size, max_size-size,
|
||||
|
||||
size += snprintf(buffer+size, max_size-size,
|
||||
"%04x %02x%02x%02x "
|
||||
"%02x%02x%02x%02x%02x%02x%02x%02x "
|
||||
"%c %s\n",
|
||||
@@ -271,9 +271,9 @@ get_id_failed:
|
||||
fcport->d_id.b.domain,
|
||||
fcport->d_id.b.area,
|
||||
fcport->d_id.b.al_pa,
|
||||
fcport->port_name[0], fcport->port_name[1],
|
||||
fcport->port_name[2], fcport->port_name[3],
|
||||
fcport->port_name[4], fcport->port_name[5],
|
||||
fcport->port_name[0], fcport->port_name[1],
|
||||
fcport->port_name[2], fcport->port_name[3],
|
||||
fcport->port_name[4], fcport->port_name[5],
|
||||
fcport->port_name[6], fcport->port_name[7],
|
||||
port_type[fcport->port_type], state);
|
||||
}
|
||||
@@ -291,7 +291,7 @@ qla2x00_update_portdb(struct class_device *cdev, const char *buffer, size_t size
|
||||
{
|
||||
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev));
|
||||
unsigned char reading = '0';
|
||||
|
||||
|
||||
switch (reading) {
|
||||
case '2':
|
||||
qla2x00_configure_loop(ha);
|
||||
@@ -385,7 +385,7 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj, struct bin_attribute *attr,
|
||||
break;
|
||||
case 1:
|
||||
if ((ha->fw_dump == NULL) && (ha->isp_ops.fw_dump != NULL))
|
||||
ha->isp_ops.fw_dump(ha, 0);
|
||||
ha->isp_ops.fw_dump(ha, 0);
|
||||
|
||||
if ((ha->fw_dump || ha->fw_dumped) && !ha->fw_dump_reading) {
|
||||
ha->fw_dump_reading = 1;
|
||||
@@ -1031,7 +1031,7 @@ struct class_device_attribute *qla2x00_host_attrs[] = {
|
||||
#if defined(FC_TARGET_SUPPORT)
|
||||
&class_device_attr_target_mode_enabled,
|
||||
&class_device_attr_resource_counts,
|
||||
&class_device_attr_port_database,
|
||||
&class_device_attr_port_database,
|
||||
#endif
|
||||
NULL,
|
||||
};
|
||||
|
||||
+2
-2
@@ -542,7 +542,7 @@ qla2300_ascii_fw_dump(scsi_qla_host_t *ha)
|
||||
qla_uprintf(&uiter, "\t");
|
||||
for (cnt2 = 8; cnt2 > 0 && cnt2 <= 8; --cnt2) {
|
||||
#define PRINTC(c) ((c > 0x20 && c < 0x7e) ?c :'.')
|
||||
qla_uprintf(&uiter, "%c",
|
||||
qla_uprintf(&uiter, "%c",
|
||||
PRINTC(fw->risc_ram[cnt-cnt2]));
|
||||
#undef PRINTC
|
||||
}
|
||||
@@ -948,7 +948,7 @@ qla2100_ascii_fw_dump(scsi_qla_host_t *ha)
|
||||
qla_uprintf(&uiter, "\t");
|
||||
for (cnt2 = 8; cnt2 > 0 && cnt2 <= 8; --cnt2) {
|
||||
#define PRINTC(c) ((c > 0x20 && c < 0x7e) ?c :'.')
|
||||
qla_uprintf(&uiter, "%c",
|
||||
qla_uprintf(&uiter, "%c",
|
||||
PRINTC(fw->risc_ram[cnt-cnt2]));
|
||||
#undef PRINTC
|
||||
}
|
||||
|
||||
+18
-18
@@ -690,10 +690,10 @@ qla2x00_chip_diag(scsi_qla_host_t *ha)
|
||||
data = RD_REG_WORD(®->ctrl_status);
|
||||
barrier();
|
||||
}
|
||||
|
||||
|
||||
if (!cnt)
|
||||
goto chip_diag_failed;
|
||||
|
||||
|
||||
DEBUG3(printk("scsi(%ld): Reset register cleared by chip reset\n",
|
||||
ha->host_no));
|
||||
|
||||
@@ -1432,7 +1432,7 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
|
||||
nv->id[2] != 'P' || nv->id[3] != ' ' || nv->nvram_version < 1) {
|
||||
/* Reset NVRAM data. */
|
||||
qla_printk(KERN_WARNING, ha, "Inconsistent NVRAM detected: "
|
||||
"checksum=0x%x nv=%p id=%c version=0x%x.\n", chksum, nv,
|
||||
"checksum=0x%x nv=%p id=%c version=0x%x.\n", chksum, nv,
|
||||
nv->id[0], nv->nvram_version);
|
||||
qla_printk(KERN_WARNING, ha, "Falling back to functioning (yet "
|
||||
"invalid -- WWPN) defaults.\n");
|
||||
@@ -1510,7 +1510,7 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
|
||||
#ifdef FC_TARGET_SUPPORT
|
||||
if (ha->flags.enable_target_mode)
|
||||
nv->firmware_options[0] |= BIT_4;
|
||||
else
|
||||
else
|
||||
#endif /* FC_TARGET_SUPPORT */
|
||||
nv->firmware_options[0] &= ~BIT_4;
|
||||
nv->firmware_options[1] |= (BIT_5 | BIT_0);
|
||||
@@ -1520,7 +1520,7 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
|
||||
nv->firmware_options[0] |= BIT_2;
|
||||
nv->firmware_options[0] &= ~BIT_3;
|
||||
nv->add_firmware_options[1] |= BIT_5 | BIT_4;
|
||||
|
||||
|
||||
if (IS_QLA2300(ha)) {
|
||||
if (ha->fb_rev == FPM_2310) {
|
||||
strcpy(ha->model_number, "QLA2310");
|
||||
@@ -4001,7 +4001,7 @@ __qla2x00_host_reset(scsi_qla_host_t *ha)
|
||||
{
|
||||
int ret = FAILED;
|
||||
|
||||
qla_printk(KERN_INFO, ha, "scsi(%ld): ADAPTER RESET ISSUED.\n",
|
||||
qla_printk(KERN_INFO, ha, "scsi(%ld): ADAPTER RESET ISSUED.\n",
|
||||
ha->host_no);
|
||||
|
||||
if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS)
|
||||
@@ -4022,7 +4022,7 @@ __qla2x00_host_reset(scsi_qla_host_t *ha)
|
||||
/* Waiting for our command in done_queue to be returned to OS.*/
|
||||
if (qla2x00_eh_wait_for_pending_commands(ha))
|
||||
ret = SUCCESS;
|
||||
|
||||
|
||||
out:
|
||||
qla_printk(KERN_INFO, ha, "%s: reset %s\n", __func__,
|
||||
(ret == FAILED) ? "failed" : "succeded");
|
||||
@@ -4035,7 +4035,7 @@ out:
|
||||
* host_reset, bring up w/ Target Mode Enabled
|
||||
*/
|
||||
void
|
||||
__qla2x00_enable_lun(scsi_qla_host_t *ha)
|
||||
__qla2x00_enable_lun(scsi_qla_host_t *ha)
|
||||
{
|
||||
unsigned long flags = 0;
|
||||
|
||||
@@ -4052,9 +4052,9 @@ __qla2x00_enable_lun(scsi_qla_host_t *ha)
|
||||
*
|
||||
* Disable Target Mode and reset the adapter
|
||||
*/
|
||||
void
|
||||
__qla2x00_disable_lun(scsi_qla_host_t *ha)
|
||||
{
|
||||
void
|
||||
__qla2x00_disable_lun(scsi_qla_host_t *ha)
|
||||
{
|
||||
unsigned long flags = 0;
|
||||
|
||||
spin_lock_irqsave(&ha->hardware_lock, flags);
|
||||
@@ -4087,7 +4087,7 @@ __qla2x00_issue_marker(scsi_qla_host_t *ha)
|
||||
int
|
||||
qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp);
|
||||
|
||||
int
|
||||
int
|
||||
qla2x00_get_resource_counts(scsi_qla_host_t *ha, uint8_t *cmd, uint8_t *imm)
|
||||
{
|
||||
mbx_cmd_t mc;
|
||||
@@ -4099,9 +4099,9 @@ qla2x00_get_resource_counts(scsi_qla_host_t *ha, uint8_t *cmd, uint8_t *imm)
|
||||
mc.in_mb = MBX_0|MBX_1|MBX_2;
|
||||
mc.tov = 30;
|
||||
mc.flags = 0;
|
||||
|
||||
|
||||
rval = qla2x00_mailbox_command(ha, &mc);
|
||||
|
||||
|
||||
*cmd = mc.mb[1];
|
||||
*imm = mc.mb[2];
|
||||
|
||||
@@ -4134,16 +4134,16 @@ int qla2xxx_tgt_register_driver(struct qla2x_tgt_initiator *tgt_data,
|
||||
int res = 0;
|
||||
|
||||
ENTER(__func__);
|
||||
|
||||
|
||||
if ((tgt_data == NULL) || (tgt_data->magic != QLA2X_TARGET_MAGIC)) {
|
||||
printk("***ERROR*** Wrong version of the target driver: %d\n",
|
||||
tgt_data->magic);
|
||||
res = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
memcpy(&qla_target, tgt_data, sizeof(qla_target));
|
||||
|
||||
|
||||
init_data->magic = QLA2X_INITIATOR_MAGIC;
|
||||
init_data->req_pkt = qla2x00_req_pkt;
|
||||
init_data->isp_cmd = qla2x00_isp_cmd;
|
||||
@@ -4153,7 +4153,7 @@ int qla2xxx_tgt_register_driver(struct qla2x_tgt_initiator *tgt_data,
|
||||
init_data->req_cont_pkt = qla2x00_req_cont_pkt;
|
||||
init_data->get_counts = qla2x00_get_resource_counts;
|
||||
/* ... */
|
||||
|
||||
|
||||
out:
|
||||
LEAVE(__func__);
|
||||
return res;
|
||||
|
||||
+12
-12
@@ -601,8 +601,8 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
|
||||
ha->flags.init_done && mb[1] != 0xffff &&
|
||||
#ifndef FC_TARGET_SUPPORT
|
||||
((ha->operating_mode == P2P && mb[1] != 0) ||
|
||||
(ha->operating_mode != P2P &&
|
||||
mb[1] != SNS_FIRST_LOOP_ID)) &&
|
||||
(ha->operating_mode != P2P &&
|
||||
mb[1] != SNS_FIRST_LOOP_ID)) &&
|
||||
#endif
|
||||
(mb[2] == 6 || mb[2] == 7)) {
|
||||
int rval;
|
||||
@@ -651,8 +651,8 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
|
||||
mb[2], mb[3]));
|
||||
#ifdef FC_TARGET_SUPPORT
|
||||
DEBUG2(printk("scsi(%ld): ha state %d init_done %d "
|
||||
"oper_mode %d topo %d\n",
|
||||
ha->host_no,
|
||||
"oper_mode %d topo %d\n",
|
||||
ha->host_no,
|
||||
atomic_read(&ha->loop_state),
|
||||
ha->flags.init_done,
|
||||
ha->operating_mode,
|
||||
@@ -845,14 +845,14 @@ qla2x00_process_response_queue(struct scsi_qla_host *ha)
|
||||
case STATUS_TYPE_21:
|
||||
handle_cnt = ((sts21_entry_t *)pkt)->handle_count;
|
||||
for (cnt = 0; cnt < handle_cnt; cnt++) {
|
||||
qla2x00_process_completed_request(ha,
|
||||
qla2x00_process_completed_request(ha,
|
||||
((sts21_entry_t *)pkt)->handle[cnt]);
|
||||
}
|
||||
break;
|
||||
case STATUS_TYPE_22:
|
||||
handle_cnt = ((sts22_entry_t *)pkt)->handle_count;
|
||||
for (cnt = 0; cnt < handle_cnt; cnt++) {
|
||||
qla2x00_process_completed_request(ha,
|
||||
qla2x00_process_completed_request(ha,
|
||||
((sts22_entry_t *)pkt)->handle[cnt]);
|
||||
}
|
||||
break;
|
||||
@@ -866,10 +866,10 @@ qla2x00_process_response_queue(struct scsi_qla_host *ha)
|
||||
case ACCEPT_TGT_IO_TYPE:
|
||||
case CONTINUE_TGT_IO_TYPE:
|
||||
case CTIO_A64_TYPE:
|
||||
case IMMED_NOTIFY_TYPE:
|
||||
case IMMED_NOTIFY_TYPE:
|
||||
case NOTIFY_ACK_TYPE:
|
||||
case ENABLE_LUN_TYPE:
|
||||
case MODIFY_LUN_TYPE:
|
||||
case MODIFY_LUN_TYPE:
|
||||
DEBUG4(printk(KERN_WARNING
|
||||
"qla2x00_response_pkt: "
|
||||
"calling tgt_response_pkt %p "
|
||||
@@ -880,7 +880,7 @@ qla2x00_process_response_queue(struct scsi_qla_host *ha)
|
||||
{
|
||||
qla_target.tgt_response_pkt(ha, pkt);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
#endif /* FC_TARGET_SUPPORT */
|
||||
case MBX_IOCB_TYPE:
|
||||
if (!IS_QLA2100(ha) && !IS_QLA2200(ha) &&
|
||||
@@ -1541,7 +1541,7 @@ qla24xx_process_response_queue(struct scsi_qla_host *ha)
|
||||
case IMMED_NOTIFY_TYPE: /* always send these responses if we can */
|
||||
case NOTIFY_ACK_TYPE:
|
||||
case ENABLE_LUN_TYPE:
|
||||
case MODIFY_LUN_TYPE:
|
||||
case MODIFY_LUN_TYPE:
|
||||
DEBUG4(printk(KERN_WARNING
|
||||
"qla2x00_response_pkt: "
|
||||
"calling tgt_response_pkt %p "
|
||||
@@ -1550,10 +1550,10 @@ qla24xx_process_response_queue(struct scsi_qla_host *ha)
|
||||
pkt->entry_type););
|
||||
if (qla_target.tgt_response_pkt)
|
||||
{
|
||||
qla_target.tgt_response_pkt(ha,
|
||||
qla_target.tgt_response_pkt(ha,
|
||||
(sts_entry_t *)pkt);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
#endif /* FC_TARGET_SUPPORT */
|
||||
default:
|
||||
/* Type Not Supported. */
|
||||
|
||||
+2
-2
@@ -804,7 +804,7 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
|
||||
"%s: failed while waiting for commands\n", __func__);
|
||||
} else {
|
||||
qla_printk(KERN_INFO, ha,
|
||||
"scsi(%ld:%d:%d): DEVICE RESET SUCCEEDED.\n",
|
||||
"scsi(%ld:%d:%d): DEVICE RESET SUCCEEDED.\n",
|
||||
ha->host_no, id, lun);
|
||||
}
|
||||
|
||||
@@ -1680,7 +1680,7 @@ void qla2x00_remove_one(struct pci_dev *pdev)
|
||||
|
||||
#if defined(FC_TARGET_SUPPORT)
|
||||
ha->flags.host_shutting_down = 1;
|
||||
if (qla_target.tgt_host_action != NULL)
|
||||
if (qla_target.tgt_host_action != NULL)
|
||||
qla_target.tgt_host_action(ha, DISABLE_TARGET_MODE);
|
||||
#endif
|
||||
|
||||
|
||||
+32
-32
@@ -2,17 +2,17 @@
|
||||
/*-
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
|
||||
@@ -530,7 +530,7 @@ isp_reset(ispsoftc_t *isp)
|
||||
if ((val & BIU2400_DMA_ACTIVE) == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (val & BIU2400_DMA_ACTIVE) {
|
||||
ISP_RESET0(isp);
|
||||
isp_prt(isp, ISP_LOGERR, "DMA Failed to Stop on Reset");
|
||||
@@ -624,7 +624,7 @@ isp_reset(ispsoftc_t *isp)
|
||||
ISP_WRITE(isp, BIU_SEMA, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Post-RISC Reset stuff.
|
||||
*/
|
||||
@@ -851,7 +851,7 @@ isp_reset(ispsoftc_t *isp)
|
||||
break;
|
||||
}
|
||||
ptr += ptr[3];
|
||||
}
|
||||
}
|
||||
isp->isp_loaded_fw = 1;
|
||||
} else if (dodnld && IS_23XX(isp)) {
|
||||
const uint16_t *ptr = isp->isp_mdvec->dv_ispfw;
|
||||
@@ -874,7 +874,7 @@ isp_reset(ispsoftc_t *isp)
|
||||
while (wi < ptr[3]) {
|
||||
uint16_t *cp;
|
||||
uint32_t nw;
|
||||
|
||||
|
||||
nw = ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)) >> 1;
|
||||
if (nw > wl) {
|
||||
nw = wl;
|
||||
@@ -1071,7 +1071,7 @@ isp_reset(ispsoftc_t *isp)
|
||||
isp->isp_fwrev[1] = 37;
|
||||
#endif
|
||||
isp->isp_fwrev[2] = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
isp->isp_fwrev[0] = mbs.param[1];
|
||||
isp->isp_fwrev[1] = mbs.param[2];
|
||||
@@ -1640,7 +1640,7 @@ isp_fibre_init(ispsoftc_t *isp)
|
||||
/*
|
||||
* Right now we just set extended options to prefer point-to-point
|
||||
* over loop based upon some soft config options.
|
||||
*
|
||||
*
|
||||
* NB: for the 2300, ICBOPT_EXTENDED is required.
|
||||
*/
|
||||
if (IS_2200(isp) || IS_23XX(isp)) {
|
||||
@@ -2331,7 +2331,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, uint32_t portid,
|
||||
msg = buf;
|
||||
break;
|
||||
case PLOGX_IOCBERR_PORTUSED:
|
||||
lev = ISP_LOGSANCFG|ISP_LOGDEBUG0;
|
||||
lev = ISP_LOGSANCFG|ISP_LOGDEBUG0;
|
||||
SNPRINTF(buf, sizeof (buf),
|
||||
"already logged in with N-Port handle 0x%x", parm1);
|
||||
msg = buf;
|
||||
@@ -3306,7 +3306,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan)
|
||||
"Valid", chan, tmp.portid, tmp.handle);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* We can wipe out the old handle value
|
||||
* here because it's no longer valid.
|
||||
@@ -3387,7 +3387,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan)
|
||||
*/
|
||||
|
||||
/*
|
||||
* Take less than half of our scratch area to store Port IDs
|
||||
* Take less than half of our scratch area to store Port IDs
|
||||
*/
|
||||
#define GIDLEN ((ISP_FC_SCRLEN >> 1) - 16 - SNS_GID_FT_REQ_SIZE)
|
||||
#define NGENT ((GIDLEN - 16) >> 2)
|
||||
@@ -3856,10 +3856,10 @@ isp_scan_fabric(ispsoftc_t *isp, int chan)
|
||||
/*
|
||||
* Try to re-login to this device using a
|
||||
* new handle. If that fails, mark it dead.
|
||||
*
|
||||
*
|
||||
* isp_login_device will check for handle and
|
||||
* portid consistency after re-login.
|
||||
*
|
||||
*
|
||||
*/
|
||||
if (isp_login_device(isp, chan, portid, &pdb,
|
||||
&oldhandle)) {
|
||||
@@ -3932,7 +3932,7 @@ isp_scan_fabric(ispsoftc_t *isp, int chan)
|
||||
* with the same port id. While we're at it, mark where the
|
||||
* last free entry was.
|
||||
*/
|
||||
|
||||
|
||||
dbidx = MAX_FC_TARG;
|
||||
for (lp = fcp->portdb; lp < &fcp->portdb[MAX_FC_TARG]; lp++) {
|
||||
if (lp >= &fcp->portdb[FL_ID] &&
|
||||
@@ -5865,7 +5865,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_t mbox)
|
||||
break;
|
||||
}
|
||||
handle =
|
||||
(ISP_READ(isp, OUTMAILBOX2) << 16) |
|
||||
(ISP_READ(isp, OUTMAILBOX2) << 16) |
|
||||
(ISP_READ(isp, OUTMAILBOX1));
|
||||
if (isp_target_async(isp, handle, mbox)) {
|
||||
rval = -1;
|
||||
@@ -6736,7 +6736,7 @@ isp_parse_status_24xx(ispsoftc_t *isp, isp24xx_statusreq_t *sp,
|
||||
case RQCS_DATA_UNDERRUN:
|
||||
ru_marked = (sp->req_scsi_status & RQCS_RU) != 0;
|
||||
/*
|
||||
* We can get an underrun w/o things being marked
|
||||
* We can get an underrun w/o things being marked
|
||||
* if we got a non-zero status.
|
||||
*/
|
||||
sv_marked = (sp->req_scsi_status & (RQCS_SV|RQCS_RV)) != 0;
|
||||
@@ -7265,7 +7265,7 @@ static const uint32_t mbpfc[] = {
|
||||
/*
|
||||
* Footnotes
|
||||
*
|
||||
* (1): this sets bits 21..16 in mailbox register #8, which we nominally
|
||||
* (1): this sets bits 21..16 in mailbox register #8, which we nominally
|
||||
* do not access at this time in the core driver. The caller is
|
||||
* responsible for setting this register first (Gross!). The assumption
|
||||
* is that we won't overflow.
|
||||
@@ -7866,7 +7866,7 @@ isp_setdfltsdparm(ispsoftc_t *isp)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
MEMZERO(&mbs, sizeof (mbs));
|
||||
mbs.param[0] = MBOX_GET_ACT_NEG_STATE;
|
||||
@@ -8127,13 +8127,13 @@ isp_read_nvram_2400(ispsoftc_t *isp, uint8_t *nvram_data)
|
||||
{
|
||||
int retval = 0;
|
||||
uint32_t addr, csum, lwrds, *dptr;
|
||||
|
||||
|
||||
if (isp->isp_port) {
|
||||
addr = ISP2400_NVRAM_PORT1_ADDR;
|
||||
} else {
|
||||
addr = ISP2400_NVRAM_PORT0_ADDR;
|
||||
}
|
||||
|
||||
|
||||
dptr = (uint32_t *) nvram_data;
|
||||
for (lwrds = 0; lwrds < ISP2400_NVRAM_SIZE >> 2; lwrds++) {
|
||||
isp_rd_2400_nvram(isp, addr++, dptr++);
|
||||
@@ -8173,7 +8173,7 @@ isp_rdnvram_word(ispsoftc_t *isp, int wo, uint16_t *rp)
|
||||
USEC_DELAY(10);
|
||||
|
||||
if (IS_FC(isp)) {
|
||||
wo &= ((ISP2100_NVRAM_SIZE >> 1) - 1);
|
||||
wo &= ((ISP2100_NVRAM_SIZE >> 1) - 1);
|
||||
if (IS_2312(isp) && isp->isp_port) {
|
||||
wo += 128;
|
||||
}
|
||||
@@ -8582,7 +8582,7 @@ isp_parse_nvram_2100(ispsoftc_t *isp, uint8_t *nvram_data)
|
||||
fcp->isp_loopid = ISP2100_NVRAM_HARDLOOPID(nvram_data);
|
||||
}
|
||||
if ((isp->isp_confopts & ISP_CFG_OWNEXCTHROTTLE) == 0) {
|
||||
DEFAULT_EXEC_THROTTLE(isp) =
|
||||
DEFAULT_EXEC_THROTTLE(isp) =
|
||||
ISP2100_NVRAM_EXECUTION_THROTTLE(nvram_data);
|
||||
}
|
||||
fcp->isp_fwoptions = ISP2100_NVRAM_OPTIONS(nvram_data);
|
||||
@@ -8667,7 +8667,7 @@ isp_parse_nvram_2400(ispsoftc_t *isp, uint8_t *nvram_data)
|
||||
fcp->isp_loopid = ISP2400_NVRAM_HARDLOOPID(nvram_data);
|
||||
}
|
||||
if ((isp->isp_confopts & ISP_CFG_OWNEXCTHROTTLE) == 0) {
|
||||
DEFAULT_EXEC_THROTTLE(isp) =
|
||||
DEFAULT_EXEC_THROTTLE(isp) =
|
||||
ISP2400_NVRAM_EXECUTION_THROTTLE(nvram_data);
|
||||
}
|
||||
fcp->isp_fwoptions = ISP2400_NVRAM_FIRMWARE_OPTIONS1(nvram_data);
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
/*-
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
@@ -1392,7 +1392,7 @@ isp_put_sns_request(ispsoftc_t *isp, sns_screq_t *src, sns_screq_t *dst)
|
||||
for (i = 0; i < nw; i++) {
|
||||
ISP_IOXPUT_16(isp, src->snscb_data[i], &dst->snscb_data[i]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
/*-
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
#ifndef _ISP_LIBRARY_H
|
||||
|
||||
+11
-11
@@ -2,17 +2,17 @@
|
||||
/*-
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
|
||||
+13
-13
@@ -2,17 +2,17 @@
|
||||
/*-
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
@@ -459,7 +459,7 @@ isp_target_notify(ispsoftc_t *isp, void *vptr, uint32_t *optrp)
|
||||
return (rval);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Toggle (on/off) target mode for bus/target/lun.
|
||||
*
|
||||
@@ -978,7 +978,7 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_entry_t *aep)
|
||||
tmd_notify_t nt;
|
||||
static const char f1[] =
|
||||
"%s from PortID 0x%06x lun %d seq 0x%08x%08x";
|
||||
static const char f2[] =
|
||||
static const char f2[] =
|
||||
"unknown Task Flag 0x%x lun %d PortID 0x%x tag 0x%08x%08x";
|
||||
uint16_t chan;
|
||||
uint32_t sid, did;
|
||||
|
||||
+11
-11
@@ -2,17 +2,17 @@
|
||||
/*-
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
/*-
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
@@ -349,7 +349,7 @@ typedef struct tmd_xact {
|
||||
* The cd_xact tag is the first or only transaction structure related to this command.
|
||||
*
|
||||
* The tag cd_lreserved, cd_hreserved are scratch areas for use for the outer and inner layers respectively.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TMD_CDBLEN
|
||||
|
||||
+20
-20
@@ -2,17 +2,17 @@
|
||||
/*-
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
@@ -399,7 +399,7 @@ typedef struct {
|
||||
uint16_t mrk_lun;
|
||||
uint8_t mrk_reserved1[48];
|
||||
} isp_marker_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
isphdr_t mrk_header;
|
||||
uint32_t mrk_handle;
|
||||
@@ -412,7 +412,7 @@ typedef struct {
|
||||
uint8_t mrk_lun[8];
|
||||
uint8_t mrk_reserved3[40];
|
||||
} isp_marker_24xx_t;
|
||||
|
||||
|
||||
|
||||
#define SYNC_DEVICE 0
|
||||
#define SYNC_TARGET 1
|
||||
@@ -666,7 +666,7 @@ typedef struct {
|
||||
uint8_t req_rsp_sense[28];
|
||||
} isp24xx_statusreq_t;
|
||||
|
||||
/*
|
||||
/*
|
||||
* For Qlogic 2X00, the high order byte of SCSI status has
|
||||
* additional meaning.
|
||||
*/
|
||||
@@ -719,7 +719,7 @@ typedef struct {
|
||||
ispds64_t ms_dataseg[2];
|
||||
} isp_ms_t;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Completion Status Codes.
|
||||
*/
|
||||
#define RQCS_COMPLETE 0x0000
|
||||
@@ -771,7 +771,7 @@ typedef struct {
|
||||
|
||||
|
||||
/*
|
||||
* 1X00 specific State Flags
|
||||
* 1X00 specific State Flags
|
||||
*/
|
||||
#define RQSF_GOT_BUS 0x0100
|
||||
#define RQSF_GOT_TARGET 0x0200
|
||||
@@ -952,7 +952,7 @@ typedef struct {
|
||||
#define ICBXOPT_RIO_32BIT 2
|
||||
#define ICBXOPT_RIO_16BIT_IOCB 3
|
||||
#define ICBXOPT_RIO_32BIT_IOCB 4
|
||||
#define ICBXOPT_ZIO 5
|
||||
#define ICBXOPT_ZIO 5
|
||||
#define ICBXOPT_TIMER_MASK 0x7
|
||||
|
||||
#define ICBZOPT_RATE_MASK 0xC000
|
||||
@@ -1045,7 +1045,7 @@ typedef struct {
|
||||
uint16_t icb_prqstqlen;
|
||||
uint16_t icb_rqstaddr[4];
|
||||
uint16_t icb_respaddr[4];
|
||||
uint16_t icb_priaddr[4];
|
||||
uint16_t icb_priaddr[4];
|
||||
uint16_t icb_reserved1[4];
|
||||
uint16_t icb_atio_in;
|
||||
uint16_t icb_atioqlen;
|
||||
@@ -1619,14 +1619,14 @@ typedef struct {
|
||||
typedef struct {
|
||||
uint16_t handle;
|
||||
uint16_t lun;
|
||||
uint32_t
|
||||
uint32_t
|
||||
channel : 8,
|
||||
portid : 24;
|
||||
uint32_t timeout;
|
||||
union {
|
||||
struct {
|
||||
uint32_t data_length;
|
||||
uint32_t
|
||||
uint32_t
|
||||
no_wait : 1,
|
||||
do_read : 1;
|
||||
uint8_t cdb[16];
|
||||
|
||||
+13
-13
@@ -2,17 +2,17 @@
|
||||
/*-
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
@@ -374,7 +374,7 @@
|
||||
|
||||
/*
|
||||
* 2400 Interface Offsets and Register Definitions
|
||||
*
|
||||
*
|
||||
* The 2400 looks quite different in terms of registers from other QLogic cards.
|
||||
* It is getting to be a genuine pain and challenge to keep the same model
|
||||
* for all.
|
||||
@@ -476,7 +476,7 @@
|
||||
#define OUTMAILBOX7 (MBOX_BLOCK+0xE)
|
||||
|
||||
/*
|
||||
* Strictly speaking, it's
|
||||
* Strictly speaking, it's
|
||||
* SCSI && 2100 : 8 MBOX registers
|
||||
* 2200: 24 MBOX registers
|
||||
* 2300/2400: 32 MBOX registers
|
||||
|
||||
+14
-14
@@ -2,17 +2,17 @@
|
||||
/*-
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
@@ -212,7 +212,7 @@ typedef struct {
|
||||
uint8_t isp_retry_count;
|
||||
uint8_t isp_retry_delay;
|
||||
struct {
|
||||
uint32_t
|
||||
uint32_t
|
||||
exc_throttle : 8,
|
||||
: 1,
|
||||
dev_enable : 1, /* ignored */
|
||||
@@ -318,7 +318,7 @@ typedef struct {
|
||||
* from 0..MAX_FC_TARG that is used to index into the isp_ini_map array. If
|
||||
* the value therein is non-zero, then that value minus one is used to index
|
||||
* into the Port Database to find the handle for forming commands. There is
|
||||
* back-index minus one value within to Port Database entry that tells us
|
||||
* back-index minus one value within to Port Database entry that tells us
|
||||
* which entry in isp_ini_map points to us (to avoid searching).
|
||||
*
|
||||
* Local loop devices the firmware automatically performs PLOGI on for us
|
||||
@@ -1013,7 +1013,7 @@ void isp_async(ispsoftc_t *, ispasync_t, ...);
|
||||
*
|
||||
* GET_DEFAULT_ROLE(ispsoftc_t *, int) Get Default Role for a channel
|
||||
* SET_DEFAULT_ROLE(ispsoftc_t *, int, int) Set Default Role for a channel
|
||||
* DEFAULT_IID(ispsoftc_t *, int) Default SCSI initiator ID
|
||||
* DEFAULT_IID(ispsoftc_t *, int) Default SCSI initiator ID
|
||||
* DEFAULT_LOOPID(ispsoftc_t *, int) Default FC Loop ID
|
||||
*
|
||||
* These establish reasonable defaults for each platform.
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
*/
|
||||
|
||||
#ifndef ISP_TARGET_MODE
|
||||
/*
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
*/
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
*/
|
||||
|
||||
#ifndef ISP_TARGET_MODE
|
||||
/************************************************************************
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
*/
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
*/
|
||||
|
||||
/*
|
||||
* Some very early boards have problems loading firmware that is larger than
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
*/
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
*/
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
*/
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
*/
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
|
||||
+38
-38
@@ -35,15 +35,15 @@
|
||||
* Rev. 1 March 2, 2000
|
||||
* RLU - Updated with latest definitions. Added more comments.
|
||||
*
|
||||
* Rev. 2 May 16, 2000
|
||||
* Rev. 2 May 16, 2000
|
||||
* SP - Updated definitions and changed structures (March 27, 2000)
|
||||
* SP - Addded structures
|
||||
* SP - Addded structures
|
||||
*
|
||||
* Rev. 3 June 1, 2000
|
||||
* Rev. 3 June 1, 2000
|
||||
* THL - Made major changes to include all changes talked in our meeting.
|
||||
*
|
||||
* Rev. 4 June 5, 2000
|
||||
* RLU - Added new definitions/structures for SDM_GET_AEN and SDM_REG_AEN
|
||||
* RLU - Added new definitions/structures for SDM_GET_AEN and SDM_REG_AEN
|
||||
* functions.
|
||||
* - Major definition/structure name changes as discussed in meetings.
|
||||
* - Deleted duplicated command code and structure definitions.
|
||||
@@ -68,7 +68,7 @@
|
||||
* Rev. 4.5 August 15, 2000
|
||||
* SP - Rolled back some changes made by Todd R.
|
||||
* Kept new status code SDM_STATUS_NO_MEMORY
|
||||
* Port types fabric and tape device
|
||||
* Port types fabric and tape device
|
||||
*
|
||||
* Rev. 4.7 Sep 6, 2000
|
||||
* YPL - Replace SDM_ with EXT_, _ISP with _CHIP.
|
||||
@@ -89,7 +89,7 @@
|
||||
*
|
||||
* Rev. 5.3 Sep 29, 2000
|
||||
* THL - Add access mode for NVRAM.
|
||||
*
|
||||
*
|
||||
* Rev. 5.4 Oct 03, 2000
|
||||
* THL - Add EXT_SC_GET_FC_STATISTICS.
|
||||
*
|
||||
@@ -109,55 +109,55 @@
|
||||
*
|
||||
* Rev. 5.8 Oct 25, 2000
|
||||
* BN - Added EXT_CC_DRIVER_PROP define
|
||||
*
|
||||
*
|
||||
* Rev. 5.9 Oct 26, 2000
|
||||
* BN - Sync with UnixApi project
|
||||
*
|
||||
*
|
||||
* Rev. 5.10 Oct 30, 2000
|
||||
* BN - Remove not needed #define for EXT_CC_DRIVER_PROP
|
||||
* - Add EXT_ to IS_LUN_BIT_SET, SET_LUN_BIT, CLR_LUN_BIT
|
||||
*
|
||||
*
|
||||
* Rev. 5.11 Nov 1, 2000
|
||||
* BN - Increased [1] of EXT_DEVICEDATA to [EXT_MAX_TARGET]
|
||||
* TLE - Decreased [EXT_MAX_TARGET] of EXT_DEVICEDATA to [1]
|
||||
*
|
||||
*
|
||||
* Rev. 5.12 Nov 7, 2000
|
||||
* RLU - Deleted EXT_DEF_MAX_LUNS define and changed all references
|
||||
* to it to use EXT_MAX_LUN.
|
||||
* - Changed the revision numbers for the last 2 revisions down
|
||||
* to use 5.x.
|
||||
*
|
||||
*
|
||||
* Rev. 5.13 Nov 14, 2000
|
||||
* WTR - Fixed pointer referencing problem in the LUN_BIT_MASK macros.
|
||||
* Updated comment at bit mask definition.
|
||||
*
|
||||
* Rev. 5.14 Dec 6, 2000
|
||||
* THL - Added Local and LoopID to discovered port/target property.
|
||||
*
|
||||
*
|
||||
* Rev. 5.15 Dec 24, 2000
|
||||
* YPL - Enhance port connection modes and driver attrib
|
||||
*
|
||||
*
|
||||
* Rev. 5.16 Dec 27, 2000
|
||||
* TLE - Add BufferHandle member to _EXT_ASYNC_EVENT data structure for
|
||||
* SCTP support
|
||||
*
|
||||
*
|
||||
* Rev. 5.17 Jan 10, 2001
|
||||
* YPL - Add edtov, ratov & fabric name in port property
|
||||
*
|
||||
*
|
||||
* Rev. 5.18 Feb 28, 2001
|
||||
* YPL - Remove SCTP fields and add fabric parameter flags in port property
|
||||
*
|
||||
*
|
||||
* Rev. 5.19 Mar 08, 2001
|
||||
* YPL - Remove SCTP fields from hba port prop
|
||||
*
|
||||
*
|
||||
* Rev. 5.20 June 11, 2001
|
||||
* YPL - Change to reserved fields and add fabric name field in port property
|
||||
*
|
||||
*
|
||||
* Rev. 5.21 June 29, 2001
|
||||
* YPL - Merge in changes decided long time ago (use _DEF_ for defines) &
|
||||
* reserved some EXT_CC for legacy ioctls, plus add RNID dataformat
|
||||
* values definition
|
||||
*
|
||||
*
|
||||
* Rev. 5.21 Sep 18, 2001
|
||||
* SP - Added New return status codes
|
||||
*
|
||||
@@ -412,14 +412,14 @@ typedef struct {
|
||||
|
||||
|
||||
/* Reserved command codes. */
|
||||
#define EXT_CC_RESERVED0A EXT_CC_RESERVED0A_OS
|
||||
#define EXT_CC_RESERVED0B EXT_CC_RESERVED0B_OS
|
||||
#define EXT_CC_RESERVED0C EXT_CC_RESERVED0C_OS
|
||||
#define EXT_CC_RESERVED0D EXT_CC_RESERVED0D_OS
|
||||
#define EXT_CC_RESERVED0E EXT_CC_RESERVED0E_OS
|
||||
#define EXT_CC_RESERVED0F EXT_CC_RESERVED0F_OS
|
||||
#define EXT_CC_RESERVED0G EXT_CC_RESERVED0G_OS
|
||||
#define EXT_CC_RESERVED0H EXT_CC_RESERVED0H_OS
|
||||
#define EXT_CC_RESERVED0A EXT_CC_RESERVED0A_OS
|
||||
#define EXT_CC_RESERVED0B EXT_CC_RESERVED0B_OS
|
||||
#define EXT_CC_RESERVED0C EXT_CC_RESERVED0C_OS
|
||||
#define EXT_CC_RESERVED0D EXT_CC_RESERVED0D_OS
|
||||
#define EXT_CC_RESERVED0E EXT_CC_RESERVED0E_OS
|
||||
#define EXT_CC_RESERVED0F EXT_CC_RESERVED0F_OS
|
||||
#define EXT_CC_RESERVED0G EXT_CC_RESERVED0G_OS
|
||||
#define EXT_CC_RESERVED0H EXT_CC_RESERVED0H_OS
|
||||
#define EXT_CC_RESERVED0I EXT_CC_RESERVED0I_OS
|
||||
#define EXT_CC_RESERVED0J EXT_CC_RESERVED0J_OS
|
||||
#define EXT_CC_RESERVED0Z EXT_CC_RESERVED0Z_OS
|
||||
@@ -474,8 +474,8 @@ typedef struct {
|
||||
#define EXT_SC_GET_DR_DUMP_BUF 5 /* Currently Not Supported */
|
||||
#define EXT_SC_GET_RISC_CODE 6 /* Currently Not Supported */
|
||||
#define EXT_SC_GET_FLASH_RAM 7 /* for backward compatible */
|
||||
#define EXT_SC_GET_BEACON_STATE 8
|
||||
#define EXT_SC_GET_FC4_STATISTICS 9
|
||||
#define EXT_SC_GET_BEACON_STATE 8
|
||||
#define EXT_SC_GET_FC4_STATISTICS 9
|
||||
#define EXT_SC_GET_LUN_BY_Q 10
|
||||
|
||||
/* 100 - 199 FC_INTF_TYPE */
|
||||
@@ -487,7 +487,7 @@ typedef struct {
|
||||
#define EXT_SC_GET_PORT_SUMMARY 106
|
||||
#define EXT_SC_GET_POSITION_MAP 107
|
||||
#define EXT_SC_GET_RETRY_CNT 108 /* Currently Not Supported */
|
||||
#define EXT_SC_GET_RNID 109
|
||||
#define EXT_SC_GET_RNID 109
|
||||
#define EXT_SC_GET_RTIN 110 /* Currently Not Supported */
|
||||
#define EXT_SC_GET_FC_LUN_BITMASK 111
|
||||
#define EXT_SC_GET_FC_STATISTICS 112 /* for backward compatible */
|
||||
@@ -496,7 +496,7 @@ typedef struct {
|
||||
#define EXT_SC_GET_SEL_TIMEOUT 201 /* Currently Not Supported */
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Sub codes for Set Data.
|
||||
* Use in combination with EXT_SET_DATA as the ioctl code
|
||||
*/
|
||||
@@ -507,7 +507,7 @@ typedef struct {
|
||||
|
||||
/* 100 - 199 FC_INTF_TYPE */
|
||||
#define EXT_SC_SET_LUN_BITMASK 103
|
||||
#define EXT_SC_SET_RNID 109
|
||||
#define EXT_SC_SET_RNID 109
|
||||
#define EXT_SC_SET_FC_LUN_BITMASK 111
|
||||
#define EXT_SC_RESERVED_BC112 112
|
||||
#define EXT_SC_RESERVED_BC113 113
|
||||
@@ -638,9 +638,9 @@ typedef struct _EXT_DISC_PORT {
|
||||
UINT16 TargetId; /* 2 */
|
||||
UINT8 Local; /* 1; Local or Remote */
|
||||
UINT8 ReservedByte[1]; /* 1 */
|
||||
|
||||
|
||||
UINT16 LoopID; /* 2; Loop ID */
|
||||
|
||||
|
||||
UINT32 Reserved[7]; /* 28 */
|
||||
} EXT_DISC_PORT, *PEXT_DISC_PORT; /* 60 */
|
||||
|
||||
@@ -662,9 +662,9 @@ typedef struct _EXT_DISC_TARGET {
|
||||
|
||||
UINT8 Local; /* 1; Local or Remote */
|
||||
UINT8 ReservedByte[1]; /* 1 */
|
||||
|
||||
|
||||
UINT16 LoopID; /* 2; Loop ID */
|
||||
|
||||
|
||||
UINT16 Reserved[13]; /* 26 */
|
||||
} EXT_DISC_TARGET, *PEXT_DISC_TARGET; /* 60 */
|
||||
|
||||
@@ -945,7 +945,7 @@ typedef struct _EXT_DEVICEDATAENTRY
|
||||
EXT_SCSI_ADDR TargetAddress; /* scsi address */
|
||||
UINT32 DeviceFlags; /* Flags for device */
|
||||
UINT16 LoopID; /* Loop ID */
|
||||
UINT16 BaseLunNumber;
|
||||
UINT16 BaseLunNumber;
|
||||
UINT32 Reserved[32];
|
||||
} EXT_DEVICEDATAENTRY, *PEXT_DEVICEDATAENTRY;
|
||||
|
||||
@@ -1068,7 +1068,7 @@ typedef struct _EXT_ELS_PT_REQ {
|
||||
|
||||
typedef struct _EXT_BEACON_CONTROL {
|
||||
UINT32 State; /* 4 */
|
||||
UINT32 Reserved[3]; /* 12 */
|
||||
UINT32 Reserved[3]; /* 12 */
|
||||
} EXT_BEACON_CONTROL , *PEXT_BEACON_CONTROL ; /* 16 */
|
||||
|
||||
#ifndef EXTERNAL_LUN_COUNT
|
||||
|
||||
+13
-13
@@ -75,41 +75,41 @@
|
||||
Rev 12 January 20, 2003 RL
|
||||
- Added EXT_DEF_USE_HBASELECT definition for use by
|
||||
the SETINSTANCE command.
|
||||
|
||||
|
||||
Rev 11 December 10, 2002 RL
|
||||
- Added EXT_CC_SEND_ELS_PASSTHRU_OS definition.
|
||||
|
||||
|
||||
Rev 10 October 26, 2001 RL
|
||||
- Corrected MAX_HBA, MAX_TARGET and MAX_LUN values to 255.
|
||||
|
||||
|
||||
Rev 9 July 26, 2001 RL
|
||||
- Added definition of signed types.
|
||||
|
||||
|
||||
Rev 8 July 05, 2001 RL
|
||||
- Redefined ioctl command values.
|
||||
|
||||
|
||||
Rev 7 Nov 06, 2000 BN
|
||||
- Added EXT_DEF_MAX_AEN_QUEUE_OS define
|
||||
- Added define for handle_hba_t
|
||||
|
||||
|
||||
Rev 6 Oct 25, 2000 BN
|
||||
- Added EXT_CC_DRIVER_PROP_OS define
|
||||
|
||||
|
||||
Rev 5 Oct 25, 2000 BN
|
||||
- Redo the copyright header and add AEN details
|
||||
|
||||
|
||||
Rev 4 Oct 23, 2000 BN
|
||||
- Added definition for BOOLEAN
|
||||
|
||||
|
||||
Rev 3 Oct 23, 2000 BN
|
||||
- Added definitions for EXT_ADDR_MODE_OS
|
||||
and also include of <linux/ioctl.h>
|
||||
|
||||
|
||||
Rev 2 Oct 18, 2000 BN
|
||||
- Enable API Exention support
|
||||
|
||||
|
||||
Rev 1 Original version Sep 7, 2000 BN
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@
|
||||
/***************************************************************
|
||||
* These are regular/external command codes, starting from 0.
|
||||
* The regular command code end index must be updated whenever
|
||||
* adding new commands.
|
||||
* adding new commands.
|
||||
***************************************************************/
|
||||
#define EXT_DEF_LN_REG_CC_START_IDX 0x00 /* reg cmd start index */
|
||||
|
||||
|
||||
+15
-15
@@ -2,17 +2,17 @@
|
||||
/*
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
@@ -64,7 +64,7 @@
|
||||
#ifdef CONFIG_PROC_FS
|
||||
|
||||
/*
|
||||
* 'safe' proc pretty print code
|
||||
* 'safe' proc pretty print code
|
||||
*/
|
||||
struct info_str {
|
||||
char *buffer;
|
||||
@@ -215,7 +215,7 @@ isplinux_proc_info(struct Scsi_Host *shp, char *buf, char **st, off_t off, int l
|
||||
info.length = len;
|
||||
info.offset = off;
|
||||
info.pos = 0;
|
||||
|
||||
|
||||
copy_info(&info, (char *)isplinux_info(isp->isp_host));
|
||||
#ifdef HBA_VERSION
|
||||
copy_info(&info, "\n HBA Version %s, built %s, %s", HBA_VERSION, __DATE__, __TIME__);
|
||||
@@ -903,7 +903,7 @@ isp_exti_setinstance(EXT_IOCTL *ext)
|
||||
api_channel = 0; /* XXXXXXXXXXXXXXXXXXXXXXX */
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
isp_exti_query(EXT_IOCTL *pext)
|
||||
{
|
||||
@@ -1975,7 +1975,7 @@ isp_perf_test(ispsoftc_t *isp, isp_perftst_t *tt)
|
||||
ISP_LOCKU_SOFTC(isp);
|
||||
ISP_DMAFREE(isp, Cmnd, handle);
|
||||
isp_destroy_handle(isp, handle);
|
||||
}
|
||||
}
|
||||
ISP_UNLKU_SOFTC(isp);
|
||||
}
|
||||
out:
|
||||
|
||||
+11
-11
@@ -2,17 +2,17 @@
|
||||
/*
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
|
||||
+19
-19
@@ -2,17 +2,17 @@
|
||||
/*
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
@@ -341,7 +341,7 @@ static inline void
|
||||
isplinux_flushwaitq(ispsoftc_t *isp)
|
||||
{
|
||||
Scsi_Cmnd *Cmnd, *Ncmnd;
|
||||
|
||||
|
||||
if ((Cmnd = isp->isp_osinfo.wqnext) == NULL) {
|
||||
return;
|
||||
}
|
||||
@@ -2136,7 +2136,7 @@ isp_handle_platform_atio7(ispsoftc_t *isp, at7_entry_t *aep)
|
||||
fcportdb_t *lp;
|
||||
fcparam *fcp;
|
||||
tmd_cmd_t *tmd;
|
||||
|
||||
|
||||
isp->isp_osinfo.cmds_started++;
|
||||
tattr = aep->at_ta_len >> 12;
|
||||
iulen = aep->at_ta_len & 0xffffff;
|
||||
@@ -3851,7 +3851,7 @@ isplinux_default_wwn(ispsoftc_t *isp, int chan, int isactive, int iswwnn)
|
||||
* The type 2 NAA fields for QLogic cards appear be laid out thusly:
|
||||
*
|
||||
* bits 63..60 NAA == 2
|
||||
* bits 59..57 unused/zero
|
||||
* bits 59..57 unused/zero
|
||||
* bit 56 port (1) or node (0) WWN distinguishor
|
||||
* bit 48 physical port on dual-port chips (23XX/24XX)
|
||||
*
|
||||
@@ -4034,7 +4034,7 @@ isp_parse_rolearg(ispsoftc_t *isp, int chan, char *roles)
|
||||
while (role && *role) {
|
||||
unsigned int id;
|
||||
char *eqtok, *commatok, *p, *q;
|
||||
|
||||
|
||||
eqtok = role;
|
||||
eqtok = strchr(role, '=');
|
||||
if (eqtok == NULL) {
|
||||
@@ -4109,7 +4109,7 @@ isp_parse_wwnarg(ispsoftc_t *isp, int chan, char *wwns)
|
||||
unsigned int id;
|
||||
int thischan;
|
||||
char *eqtok, *commatok, *colontok, *wwnstart, *p, *q;
|
||||
|
||||
|
||||
eqtok = wwnt;
|
||||
eqtok = strchr(wwnt, '=');
|
||||
if (eqtok == NULL) {
|
||||
@@ -4210,7 +4210,7 @@ isplinux_common_init(ispsoftc_t *isp)
|
||||
if (isp_fcduplex & (1 << isp->isp_unit)) {
|
||||
isp->isp_confopts |= ISP_CFG_FULL_DUPLEX;
|
||||
}
|
||||
isp->isp_osinfo.host->max_id = MAX_FC_TARG;
|
||||
isp->isp_osinfo.host->max_id = MAX_FC_TARG;
|
||||
isp->isp_osinfo.host->max_cmd_len = 16;
|
||||
|
||||
for (chan = 0; chan < isp->isp_nchan; chan++) {
|
||||
@@ -4326,13 +4326,13 @@ isplinux_reinit(ispsoftc_t *isp)
|
||||
if (isp->isp_state != ISP_RESETSTATE) {
|
||||
isp_prt(isp, ISP_LOGERR, "failed to enter RESET state");
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Until the midlayer starts using REPORT LUNS to dertermine how many
|
||||
* luns there are for SCSI-3 devices and sets a reasonable limit for
|
||||
* SCSI-2 devices, we'll follow this ruleset:
|
||||
*
|
||||
*
|
||||
* If our isp_maxluns parameter is unchanged from its default, we
|
||||
* limit ourselves to 8 luns for parallel SCSI, 256 for FC-SCSI.
|
||||
*
|
||||
|
||||
+14
-14
@@ -2,17 +2,17 @@
|
||||
/*
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
//#define DISABLE_FW_LOADER 1
|
||||
//#define ISP_DISABLE_1080_SUPPORT 1
|
||||
//#define ISP_DISABLE_12160_SUPPORT 1
|
||||
//#define ISP_DISABLE_12160_SUPPORT 1
|
||||
//#define ISP_DISABLE_2100_SUPPORT 1
|
||||
//#define ISP_DISABLE_2200_SUPPORT 1
|
||||
//#define ISP_DISABLE_2300_SUPPORT 1
|
||||
@@ -653,7 +653,7 @@ static inline void mbox_wait_complete(ispsoftc_t *, mbreg_t *);
|
||||
int isplinux_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int);
|
||||
const char *isplinux_info(struct Scsi_Host *);
|
||||
int isplinux_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
|
||||
int isplinux_biosparam(struct scsi_device *, struct block_device *, sector_t, int[]);
|
||||
int isplinux_biosparam(struct scsi_device *, struct block_device *, sector_t, int[]);
|
||||
int isplinux_get_default_id(ispsoftc_t *, int);
|
||||
int isplinux_get_default_role(ispsoftc_t *, int);
|
||||
void isplinux_set_default_role(ispsoftc_t *, int, int);
|
||||
@@ -868,7 +868,7 @@ static inline int
|
||||
fc_scratch_acquire(ispsoftc_t *isp, int chan)
|
||||
{
|
||||
if (ISP_DATA(isp, chan)->scratch_busy) {
|
||||
return (-1);
|
||||
return (-1);
|
||||
}
|
||||
ISP_DATA(isp, chan)->scratch_busy = 1;
|
||||
return (0);
|
||||
|
||||
+21
-21
@@ -2,17 +2,17 @@
|
||||
/*
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
@@ -402,7 +402,7 @@ void unmap_pci_mem(struct isp_pcisoftc *isp_pci, unsigned long size)
|
||||
}
|
||||
}
|
||||
|
||||
static __inline int
|
||||
static __inline int
|
||||
map_isp_mem(struct isp_pcisoftc *isp_pci, u_short cmd, vm_offset_t mem_base)
|
||||
{
|
||||
if (cmd & PCI_COMMAND_MEMORY) {
|
||||
@@ -414,7 +414,7 @@ map_isp_mem(struct isp_pcisoftc *isp_pci, u_short cmd, vm_offset_t mem_base)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static __inline int
|
||||
static __inline int
|
||||
map_isp_io(struct isp_pcisoftc *isp_pci, u_short cmd, vm_offset_t io_base)
|
||||
{
|
||||
if ((cmd & PCI_COMMAND_IO) && (io_base & 3) == 1) {
|
||||
@@ -723,7 +723,7 @@ isplinux_pci_init_one(struct Scsi_Host *host)
|
||||
isp->isp_type = ISP_HA_SCSI_UNKNOWN;
|
||||
if (isp->isp_mdvec->dv_ispfw == NULL)
|
||||
fwname = "ql1020_fw.bin";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifndef ISP_DISABLE_1080_SUPPORT
|
||||
if (pdev->device == PCI_DEVICE_ID_QLOGIC_ISP1080) {
|
||||
@@ -1592,7 +1592,7 @@ static int tdma_mkfc(ispsoftc_t *, tmd_xact_t *, ct2_entry_t *, uint32_t *, uint
|
||||
|
||||
/*
|
||||
* We need to handle DMA for target mode differently from initiator mode.
|
||||
*
|
||||
*
|
||||
* DMA mapping and construction and submission of CTIO Request Entries
|
||||
* and rendevous for completion are very tightly coupled because we start
|
||||
* out by knowing (per platform) how much data we have to move, but we
|
||||
@@ -1605,7 +1605,7 @@ static int tdma_mkfc(ispsoftc_t *, tmd_xact_t *, ct2_entry_t *, uint32_t *, uint
|
||||
* for the DMA mapping routines comes here instead with a pointer to a
|
||||
* partially filled in already allocated request queue entry.
|
||||
*/
|
||||
|
||||
|
||||
static int
|
||||
tdma_mk(ispsoftc_t *isp, tmd_xact_t *xact, ct_entry_t *cto, uint32_t *nxtip, uint32_t optr)
|
||||
{
|
||||
@@ -1915,7 +1915,7 @@ tdma_mk_2400(ispsoftc_t *isp, tmd_xact_t *xact, ct7_entry_t *cto, uint32_t *nxti
|
||||
int nseg, seg, ovseg, seglim, new_seg_cnt;
|
||||
#ifdef ALLOW_SYNTHETIC_CTIO
|
||||
ct7_entry_t *cto2 = NULL, ct2;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
nxti = *nxtip;
|
||||
curi = isp->isp_reqidx;
|
||||
@@ -2214,13 +2214,13 @@ tdma_mkfc(ispsoftc_t *isp, tmd_xact_t *xact, ct2_entry_t *cto, uint32_t *nxtip,
|
||||
int nseg, seg, ovseg, seglim, new_seg_cnt;
|
||||
#ifdef ALLOW_SYNTHETIC_CTIO
|
||||
ct2_entry_t *cto2 = NULL, ct2;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
nxti = *nxtip;
|
||||
curi = isp->isp_reqidx;
|
||||
qe = ISP_QUEUE_ENTRY(isp->isp_rquest, curi);
|
||||
|
||||
|
||||
|
||||
if (cto->ct_flags & CT2_SENDSTATUS) {
|
||||
int level;
|
||||
if ((cto->ct_flags & CT2_FLAG_MMASK) == CT2_FLAG_MODE0) {
|
||||
@@ -3210,7 +3210,7 @@ isp_pci_reset1(ispsoftc_t *isp)
|
||||
static void
|
||||
isp_pci_dumpregs(ispsoftc_t *isp, const char *msg)
|
||||
{
|
||||
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
|
||||
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
|
||||
uint16_t csr;
|
||||
|
||||
pci_read_config_word(pcs->pci_dev, PCI_COMMAND, &csr);
|
||||
@@ -3258,7 +3258,7 @@ isplinux_pci_exclude(struct pci_dev *dev)
|
||||
while (wrk && *wrk) {
|
||||
unsigned int id;
|
||||
char *commatok, *p, *q;
|
||||
|
||||
|
||||
commatok = strchr(wrk, ',');
|
||||
if (commatok) {
|
||||
*commatok = 0;
|
||||
|
||||
+16
-16
@@ -2,17 +2,17 @@
|
||||
/*
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
@@ -163,7 +163,7 @@
|
||||
|
||||
/*
|
||||
* Size to allocate both a scatterlist + payload for small allocations
|
||||
*/
|
||||
*/
|
||||
#define SGS_SIZE 1024
|
||||
#define SGS0 (roundup(sizeof (struct scatterlist), sizeof (void *)))
|
||||
#define SGS_PAYLOAD_SIZE (SGS_SIZE - SGS0)
|
||||
@@ -259,7 +259,7 @@ static struct scatterlist *sg_cache = NULL;
|
||||
|
||||
|
||||
/*
|
||||
* A memory disk is constructed of a two dimensional array of pointers to pages.
|
||||
* A memory disk is constructed of a two dimensional array of pointers to pages.
|
||||
*
|
||||
* Allocate a series of chunks of memory, each of which becomes a flat array
|
||||
* of pointers to pages that we allocate one at a time.
|
||||
@@ -345,7 +345,7 @@ static uint8_t inqdata[INQ_SIZE] = {
|
||||
'0', '0', '0', '1'
|
||||
};
|
||||
static uint8_t vp0data[7] = {
|
||||
DEFAULT_DEVICE_TYPE, 0, 0, 0x3, 0, 0x80, 0x83
|
||||
DEFAULT_DEVICE_TYPE, 0, 0, 0x3, 0, 0x80, 0x83
|
||||
};
|
||||
static uint8_t vp80data[36] = {
|
||||
DEFAULT_DEVICE_TYPE, 0x80, 0, 0x20,
|
||||
@@ -654,7 +654,7 @@ free_sdata_chain(sdata_t *sdp)
|
||||
{
|
||||
while (sdp) {
|
||||
sdata_t *nxt = sdp->next;
|
||||
scsi_target_kfree(sdp, sizeof (*sdp));
|
||||
scsi_target_kfree(sdp, sizeof (*sdp));
|
||||
sdp = nxt;
|
||||
}
|
||||
}
|
||||
@@ -2474,7 +2474,7 @@ scsi_target_endis(char *hba_name_unit, uint64_t nbytes, int chan, int lun, int e
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&scsi_target_lock, flags);
|
||||
|
||||
|
||||
if (en == 0) {
|
||||
scsi_free_disk(bp, chan, lun);
|
||||
} else {
|
||||
|
||||
+11
-11
@@ -2,17 +2,17 @@
|
||||
/*
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
/*
|
||||
* Copyright (c) 1997-2008 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -24,32 +24,32 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL") with platforms where the prevalant license
|
||||
* is the GNU Public License:
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of The Version 2 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* 421 Laurel Avenue
|
||||
* Menlo Park, CA 94025
|
||||
* USA
|
||||
*
|
||||
*
|
||||
* gplbsd at feral com
|
||||
*/
|
||||
/*
|
||||
@@ -157,7 +157,7 @@ main(int a, char **v)
|
||||
|
||||
if ((fd = open(SCSI_TARGET_DEV, O_RDWR)) < 0) {
|
||||
perror(SCSI_TARGET_DEV);
|
||||
return (1);
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (ioctl(fd, action, &x) < 0) {
|
||||
|
||||
+191
-191
File diff suppressed because it is too large
Load Diff
+13
-13
@@ -1,15 +1,15 @@
|
||||
/*
|
||||
* include/scst_const.h
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
*
|
||||
*
|
||||
* Contains common SCST constants.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -39,7 +39,7 @@
|
||||
#define SCST_CMD_DELIVERY_FAILED -1
|
||||
#define SCST_CMD_DELIVERY_ABORTED -2
|
||||
|
||||
/*************************************************************
|
||||
/*************************************************************
|
||||
** Values for task management functions
|
||||
*************************************************************/
|
||||
#define SCST_ABORT_TASK 0
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
/** SCST extensions **/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Notifies about I_T nexus loss event in the corresponding session.
|
||||
* Aborts all tasks there, resets the reservation, if any, and sets
|
||||
* up the I_T Nexus loss UA.
|
||||
@@ -61,7 +61,7 @@
|
||||
/* Aborts all tasks in the corresponding session */
|
||||
#define SCST_ABORT_ALL_TASKS_SESS 7
|
||||
|
||||
/*
|
||||
/*
|
||||
* Notifies about I_T nexus loss event. Aborts all tasks in all sessions
|
||||
* of the tgt, resets the reservations, if any, and sets up the I_T Nexus
|
||||
* loss UA.
|
||||
@@ -79,7 +79,7 @@
|
||||
*/
|
||||
#define SCST_UNREG_SESS_TM 10
|
||||
|
||||
/*************************************************************
|
||||
/*************************************************************
|
||||
** Values for mgmt cmd's status field. Codes taken from iSCSI
|
||||
*************************************************************/
|
||||
#define SCST_MGMT_STATUS_SUCCESS 0
|
||||
@@ -89,7 +89,7 @@
|
||||
#define SCST_MGMT_STATUS_REJECTED -255
|
||||
#define SCST_MGMT_STATUS_FAILED -129
|
||||
|
||||
/*************************************************************
|
||||
/*************************************************************
|
||||
** SCSI task attribute queue types
|
||||
*************************************************************/
|
||||
enum scst_cmd_queue_type
|
||||
@@ -101,8 +101,8 @@ enum scst_cmd_queue_type
|
||||
SCST_CMD_QUEUE_ACA
|
||||
};
|
||||
|
||||
/*************************************************************
|
||||
** Data direction aliases
|
||||
/*************************************************************
|
||||
** Data direction aliases
|
||||
*************************************************************/
|
||||
#define SCST_DATA_UNKNOWN 0
|
||||
#define SCST_DATA_WRITE 1
|
||||
@@ -151,7 +151,7 @@ static inline int scst_is_ua_sense(const uint8_t *sense)
|
||||
|
||||
#define SCST_STANDARD_SENSE_LEN 14
|
||||
|
||||
/*************************************************************
|
||||
/*************************************************************
|
||||
* SCSI opcodes not listed anywhere else
|
||||
*************************************************************/
|
||||
#ifndef REPORT_DEVICE_IDENTIFIER
|
||||
@@ -271,7 +271,7 @@ static inline int scst_is_ua_sense(const uint8_t *sense)
|
||||
#define SCST_CONTR_MODE_QUEUE_ALG_RESTRICTED_REORDER 0
|
||||
#define SCST_CONTR_MODE_QUEUE_ALG_UNRESTRICTED_REORDER 1
|
||||
|
||||
/*************************************************************
|
||||
/*************************************************************
|
||||
** Misc SCSI constants
|
||||
*************************************************************/
|
||||
#define SCST_SENSE_ASC_UA_RESET 0x29
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* include/scst_debug.h
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
*
|
||||
* Contains macroses for execution tracing and error reporting
|
||||
*
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/*
|
||||
* include/scst_user.h
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
*
|
||||
*
|
||||
* Contains constants and data structures for scst_user module.
|
||||
* See http://scst.sourceforge.net/doc/scst_user_spec.txt or
|
||||
* scst_user_spec.txt for description.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -28,8 +28,8 @@
|
||||
#define DEV_USER_VERSION_NAME "0.9.6"
|
||||
#define DEV_USER_VERSION DEV_USER_VERSION_NAME "$Revision$" SCST_CONST_VERSION
|
||||
|
||||
/*
|
||||
* Chosen so sizeof(scst_user_sess) <= sizeof(scst_user_scsi_cmd_exec)
|
||||
/*
|
||||
* Chosen so sizeof(scst_user_sess) <= sizeof(scst_user_scsi_cmd_exec)
|
||||
* (the largest one)
|
||||
*/
|
||||
#define SCST_MAX_NAME 45
|
||||
@@ -62,7 +62,7 @@
|
||||
#define aligned_u64 uint64_t __attribute__((aligned(8)))
|
||||
#endif
|
||||
|
||||
/*************************************************************
|
||||
/*************************************************************
|
||||
** Private ucmd states
|
||||
*************************************************************/
|
||||
#define UCMD_STATE_NEW 0
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* scst_cdrom.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
* SCSI CDROM (type 5) dev handler
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -59,11 +59,11 @@ static struct scst_dev_type cdrom_devtype = CDROM_TYPE;
|
||||
/**************************************************************
|
||||
* Function: cdrom_attach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : 1 if attached, error code otherwise
|
||||
*
|
||||
* Description:
|
||||
* Description:
|
||||
*************************************************************/
|
||||
int cdrom_attach(struct scst_device *dev)
|
||||
{
|
||||
@@ -113,8 +113,8 @@ int cdrom_attach(struct scst_device *dev)
|
||||
sbuff = sense_buffer;
|
||||
|
||||
TRACE_DBG("%s", "Doing READ_CAPACITY");
|
||||
res = scsi_execute(dev->scsi_dev, cmd, data_dir, buffer,
|
||||
buffer_size, sbuff,
|
||||
res = scsi_execute(dev->scsi_dev, cmd, data_dir, buffer,
|
||||
buffer_size, sbuff,
|
||||
CDROM_REG_TIMEOUT, 3, 0);
|
||||
|
||||
TRACE_DBG("READ_CAPACITY done: %x", res);
|
||||
@@ -170,7 +170,7 @@ out:
|
||||
/************************************************************
|
||||
* Function: cdrom_detach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : None
|
||||
*
|
||||
@@ -193,7 +193,7 @@ void cdrom_detach(struct scst_device *dev)
|
||||
static int cdrom_get_block_shift(struct scst_cmd *cmd)
|
||||
{
|
||||
struct cdrom_params *params = (struct cdrom_params *)cmd->dev->dh_priv;
|
||||
/*
|
||||
/*
|
||||
* No need for locks here, since *_detach() can not be
|
||||
* called, when there are existing commands.
|
||||
*/
|
||||
@@ -203,7 +203,7 @@ static int cdrom_get_block_shift(struct scst_cmd *cmd)
|
||||
/********************************************************************
|
||||
* Function: cdrom_parse
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : The state of the command
|
||||
*
|
||||
@@ -232,7 +232,7 @@ int cdrom_parse(struct scst_cmd *cmd)
|
||||
static void cdrom_set_block_shift(struct scst_cmd *cmd, int block_shift)
|
||||
{
|
||||
struct cdrom_params *params = (struct cdrom_params *)cmd->dev->dh_priv;
|
||||
/*
|
||||
/*
|
||||
* No need for locks here, since *_detach() can not be
|
||||
* called, when there are existing commands.
|
||||
*/
|
||||
@@ -246,13 +246,13 @@ static void cdrom_set_block_shift(struct scst_cmd *cmd, int block_shift)
|
||||
/********************************************************************
|
||||
* Function: cdrom_done
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns :
|
||||
* Returns :
|
||||
*
|
||||
* Description: This is the completion routine for the command,
|
||||
* it is used to extract any necessary information
|
||||
* about a command.
|
||||
* about a command.
|
||||
********************************************************************/
|
||||
int cdrom_done(struct scst_cmd *cmd)
|
||||
{
|
||||
@@ -271,7 +271,7 @@ static int __init cdrom_init(void)
|
||||
int res = 0;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
cdrom_devtype.module = THIS_MODULE;
|
||||
|
||||
res = scst_register_dev_driver(&cdrom_devtype);
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* scst_changer.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
* SCSI medium changer (type 8) dev handler
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -52,11 +52,11 @@ static struct scst_dev_type changer_devtype = CHANGER_TYPE;
|
||||
/**************************************************************
|
||||
* Function: changer_attach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : 1 if attached, error code otherwise
|
||||
*
|
||||
* Description:
|
||||
* Description:
|
||||
*************************************************************/
|
||||
int changer_attach(struct scst_device *dev)
|
||||
{
|
||||
@@ -86,7 +86,7 @@ int changer_attach(struct scst_device *dev)
|
||||
retries = SCST_DEV_UA_RETRIES;
|
||||
do {
|
||||
TRACE_DBG("%s", "Doing TEST_UNIT_READY");
|
||||
res = scsi_test_unit_ready(dev->scsi_dev, CHANGER_TIMEOUT,
|
||||
res = scsi_test_unit_ready(dev->scsi_dev, CHANGER_TIMEOUT,
|
||||
CHANGER_RETRIES
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
|
||||
);
|
||||
@@ -117,7 +117,7 @@ out:
|
||||
/************************************************************
|
||||
* Function: changer_detach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : None
|
||||
*
|
||||
@@ -134,7 +134,7 @@ void changer_detach(struct scst_device *dev)
|
||||
/********************************************************************
|
||||
* Function: changer_parse
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : The state of the command
|
||||
*
|
||||
@@ -162,13 +162,13 @@ int changer_parse(struct scst_cmd *cmd)
|
||||
/********************************************************************
|
||||
* Function: changer_done
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns :
|
||||
* Returns :
|
||||
*
|
||||
* Description: This is the completion routine for the command,
|
||||
* it is used to extract any necessary information
|
||||
* about a command.
|
||||
* about a command.
|
||||
********************************************************************/
|
||||
int changer_done(struct scst_cmd *cmd)
|
||||
{
|
||||
@@ -199,13 +199,13 @@ static int __init changer_init(void)
|
||||
int res = 0;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
changer_devtype.module = THIS_MODULE;
|
||||
|
||||
res = scst_register_dev_driver(&changer_devtype);
|
||||
if (res < 0)
|
||||
goto out;
|
||||
|
||||
|
||||
res = scst_dev_handler_build_std_proc(&changer_devtype);
|
||||
if (res != 0)
|
||||
goto out_err;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
TRACE_MINOR | TRACE_SPECIAL)
|
||||
#endif
|
||||
|
||||
static unsigned long dh_trace_flag = SCST_DEFAULT_DEV_LOG_FLAGS;
|
||||
static unsigned long dh_trace_flag = SCST_DEFAULT_DEV_LOG_FLAGS;
|
||||
#define trace_flag dh_trace_flag
|
||||
|
||||
#ifndef trace_log_tbl
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* scst_disk.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
@@ -8,12 +8,12 @@
|
||||
* &
|
||||
* SCSI disk (type 0) "performance" device handler (skip all READ and WRITE
|
||||
* operations).
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -135,11 +135,11 @@ module_exit(exit_scst_disk_driver);
|
||||
/**************************************************************
|
||||
* Function: disk_attach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : 1 if attached, error code otherwise
|
||||
*
|
||||
* Description:
|
||||
* Description:
|
||||
*************************************************************/
|
||||
int disk_attach(struct scst_device *dev)
|
||||
{
|
||||
@@ -189,13 +189,13 @@ int disk_attach(struct scst_device *dev)
|
||||
sbuff = sense_buffer;
|
||||
|
||||
TRACE_DBG("%s", "Doing READ_CAPACITY");
|
||||
res = scsi_execute(dev->scsi_dev, cmd, data_dir, buffer,
|
||||
buffer_size, sbuff,
|
||||
res = scsi_execute(dev->scsi_dev, cmd, data_dir, buffer,
|
||||
buffer_size, sbuff,
|
||||
DISK_REG_TIMEOUT, 3, 0);
|
||||
|
||||
TRACE_DBG("READ_CAPACITY done: %x", res);
|
||||
|
||||
if (!res || (sbuff[12] != 0x28 && sbuff[12] != 0x29))
|
||||
if (!res || (sbuff[12] != 0x28 && sbuff[12] != 0x29))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -245,7 +245,7 @@ out:
|
||||
/************************************************************
|
||||
* Function: disk_detach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : None
|
||||
*
|
||||
@@ -268,7 +268,7 @@ void disk_detach(struct scst_device *dev)
|
||||
static int disk_get_block_shift(struct scst_cmd *cmd)
|
||||
{
|
||||
struct disk_params *params = (struct disk_params *)cmd->dev->dh_priv;
|
||||
/*
|
||||
/*
|
||||
* No need for locks here, since *_detach() can not be
|
||||
* called, when there are existing commands.
|
||||
*/
|
||||
@@ -278,7 +278,7 @@ static int disk_get_block_shift(struct scst_cmd *cmd)
|
||||
/********************************************************************
|
||||
* Function: disk_parse
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : The state of the command
|
||||
*
|
||||
@@ -307,7 +307,7 @@ int disk_parse(struct scst_cmd *cmd)
|
||||
static void disk_set_block_shift(struct scst_cmd *cmd, int block_shift)
|
||||
{
|
||||
struct disk_params *params = (struct disk_params *)cmd->dev->dh_priv;
|
||||
/*
|
||||
/*
|
||||
* No need for locks here, since *_detach() can not be
|
||||
* called, when there are existing commands.
|
||||
*/
|
||||
@@ -321,13 +321,13 @@ static void disk_set_block_shift(struct scst_cmd *cmd, int block_shift)
|
||||
/********************************************************************
|
||||
* Function: disk_done
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns :
|
||||
* Returns :
|
||||
*
|
||||
* Description: This is the completion routine for the command,
|
||||
* it is used to extract any necessary information
|
||||
* about a command.
|
||||
* about a command.
|
||||
********************************************************************/
|
||||
int disk_done(struct scst_cmd *cmd)
|
||||
{
|
||||
@@ -344,9 +344,9 @@ int disk_done(struct scst_cmd *cmd)
|
||||
/********************************************************************
|
||||
* Function: disk_exec
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns :
|
||||
* Returns :
|
||||
*
|
||||
* Description: Make SCST do nothing for data READs and WRITES.
|
||||
* Intended for raw line performance testing
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* scst_modisk.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
@@ -8,12 +8,12 @@
|
||||
* &
|
||||
* SCSI MO disk (type 7) "performance" device handler (skip all READ and WRITE
|
||||
* operations).
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -93,7 +93,7 @@ static int __init init_scst_modisk_driver(void)
|
||||
if (res != 0)
|
||||
goto out_unreg1;
|
||||
|
||||
modisk_devtype_perf.module = THIS_MODULE;
|
||||
modisk_devtype_perf.module = THIS_MODULE;
|
||||
|
||||
res = scst_register_dev_driver(&modisk_devtype_perf);
|
||||
if (res < 0)
|
||||
@@ -115,7 +115,7 @@ out_unreg1_err1:
|
||||
|
||||
out_unreg1:
|
||||
scst_unregister_dev_driver(&modisk_devtype);
|
||||
goto out;
|
||||
goto out;
|
||||
}
|
||||
|
||||
static void __exit exit_scst_modisk_driver(void)
|
||||
@@ -135,11 +135,11 @@ module_exit(exit_scst_modisk_driver);
|
||||
/**************************************************************
|
||||
* Function: modisk_attach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : 1 if attached, error code otherwise
|
||||
*
|
||||
* Description:
|
||||
* Description:
|
||||
*************************************************************/
|
||||
int modisk_attach(struct scst_device *dev)
|
||||
{
|
||||
@@ -201,8 +201,8 @@ int modisk_attach(struct scst_device *dev)
|
||||
sbuff = sense_buffer;
|
||||
|
||||
TRACE_DBG("%s", "Doing READ_CAPACITY");
|
||||
res = scsi_execute(dev->scsi_dev, cmd, data_dir, buffer,
|
||||
buffer_size, sbuff,
|
||||
res = scsi_execute(dev->scsi_dev, cmd, data_dir, buffer,
|
||||
buffer_size, sbuff,
|
||||
MODISK_REG_TIMEOUT, 3, 0);
|
||||
|
||||
TRACE_DBG("READ_CAPACITY done: %x", res);
|
||||
@@ -228,7 +228,7 @@ int modisk_attach(struct scst_device *dev)
|
||||
sector_size, dev->scsi_dev->scsi_level, SCSI_2);
|
||||
} else {
|
||||
TRACE_BUFFER("Sense set", sbuff, SCST_SENSE_BUFFERSIZE);
|
||||
|
||||
|
||||
if (sbuff[2] != NOT_READY) {
|
||||
res = -ENODEV;
|
||||
goto out_free_buf;
|
||||
@@ -261,7 +261,7 @@ out:
|
||||
/************************************************************
|
||||
* Function: modisk_detach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : None
|
||||
*
|
||||
@@ -284,7 +284,7 @@ void modisk_detach(struct scst_device *dev)
|
||||
static int modisk_get_block_shift(struct scst_cmd *cmd)
|
||||
{
|
||||
struct modisk_params *params = (struct modisk_params *)cmd->dev->dh_priv;
|
||||
/*
|
||||
/*
|
||||
* No need for locks here, since *_detach() can not be
|
||||
* called, when there are existing commands.
|
||||
*/
|
||||
@@ -294,7 +294,7 @@ static int modisk_get_block_shift(struct scst_cmd *cmd)
|
||||
/********************************************************************
|
||||
* Function: modisk_parse
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : The state of the command
|
||||
*
|
||||
@@ -323,7 +323,7 @@ int modisk_parse(struct scst_cmd *cmd)
|
||||
static void modisk_set_block_shift(struct scst_cmd *cmd, int block_shift)
|
||||
{
|
||||
struct modisk_params *params = (struct modisk_params *)cmd->dev->dh_priv;
|
||||
/*
|
||||
/*
|
||||
* No need for locks here, since *_detach() can not be
|
||||
* called, when there are existing commands.
|
||||
*/
|
||||
@@ -337,13 +337,13 @@ static void modisk_set_block_shift(struct scst_cmd *cmd, int block_shift)
|
||||
/********************************************************************
|
||||
* Function: modisk_done
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns :
|
||||
* Returns :
|
||||
*
|
||||
* Description: This is the completion routine for the command,
|
||||
* it is used to extract any necessary information
|
||||
* about a command.
|
||||
* about a command.
|
||||
********************************************************************/
|
||||
int modisk_done(struct scst_cmd *cmd)
|
||||
{
|
||||
@@ -360,9 +360,9 @@ int modisk_done(struct scst_cmd *cmd)
|
||||
/********************************************************************
|
||||
* Function: modisk_exec
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns :
|
||||
* Returns :
|
||||
*
|
||||
* Description: Make SCST do nothing for data READs and WRITES.
|
||||
* Intended for raw line performance testing
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* scst_processor.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
* SCSI medium processor (type 3) dev handler
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -52,11 +52,11 @@ static struct scst_dev_type processor_devtype = PROCESSOR_TYPE;
|
||||
/**************************************************************
|
||||
* Function: processor_attach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : 1 if attached, error code otherwise
|
||||
*
|
||||
* Description:
|
||||
* Description:
|
||||
*************************************************************/
|
||||
int processor_attach(struct scst_device *dev)
|
||||
{
|
||||
@@ -86,7 +86,7 @@ int processor_attach(struct scst_device *dev)
|
||||
retries = SCST_DEV_UA_RETRIES;
|
||||
do {
|
||||
TRACE_DBG("%s", "Doing TEST_UNIT_READY");
|
||||
res = scsi_test_unit_ready(dev->scsi_dev, PROCESSOR_TIMEOUT,
|
||||
res = scsi_test_unit_ready(dev->scsi_dev, PROCESSOR_TIMEOUT,
|
||||
PROCESSOR_RETRIES
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
|
||||
);
|
||||
@@ -117,7 +117,7 @@ out:
|
||||
/************************************************************
|
||||
* Function: processor_detach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : None
|
||||
*
|
||||
@@ -134,7 +134,7 @@ void processor_detach(struct scst_device *dev)
|
||||
/********************************************************************
|
||||
* Function: processor_parse
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : The state of the command
|
||||
*
|
||||
@@ -161,13 +161,13 @@ int processor_parse(struct scst_cmd *cmd)
|
||||
/********************************************************************
|
||||
* Function: processor_done
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns :
|
||||
* Returns :
|
||||
*
|
||||
* Description: This is the completion routine for the command,
|
||||
* it is used to extract any necessary information
|
||||
* about a command.
|
||||
* about a command.
|
||||
********************************************************************/
|
||||
int processor_done(struct scst_cmd *cmd)
|
||||
{
|
||||
@@ -204,7 +204,7 @@ static int __init processor_init(void)
|
||||
res = scst_register_dev_driver(&processor_devtype);
|
||||
if (res < 0)
|
||||
goto out;
|
||||
|
||||
|
||||
res = scst_dev_handler_build_std_proc(&processor_devtype);
|
||||
if (res != 0)
|
||||
goto out_err;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* scst_raid.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
* SCSI raid(controller) (type 0xC) dev handler
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -52,11 +52,11 @@ static struct scst_dev_type raid_devtype = RAID_TYPE;
|
||||
/**************************************************************
|
||||
* Function: raid_attach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : 1 if attached, error code otherwise
|
||||
*
|
||||
* Description:
|
||||
* Description:
|
||||
*************************************************************/
|
||||
int raid_attach(struct scst_device *dev)
|
||||
{
|
||||
@@ -86,7 +86,7 @@ int raid_attach(struct scst_device *dev)
|
||||
retries = SCST_DEV_UA_RETRIES;
|
||||
do {
|
||||
TRACE_DBG("%s", "Doing TEST_UNIT_READY");
|
||||
res = scsi_test_unit_ready(dev->scsi_dev, RAID_TIMEOUT,
|
||||
res = scsi_test_unit_ready(dev->scsi_dev, RAID_TIMEOUT,
|
||||
RAID_RETRIES
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
|
||||
);
|
||||
@@ -117,7 +117,7 @@ out:
|
||||
/************************************************************
|
||||
* Function: raid_detach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : None
|
||||
*
|
||||
@@ -134,7 +134,7 @@ void raid_detach(struct scst_device *dev)
|
||||
/********************************************************************
|
||||
* Function: raid_parse
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : The state of the command
|
||||
*
|
||||
@@ -161,13 +161,13 @@ int raid_parse(struct scst_cmd *cmd)
|
||||
/********************************************************************
|
||||
* Function: raid_done
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns :
|
||||
* Returns :
|
||||
*
|
||||
* Description: This is the completion routine for the command,
|
||||
* it is used to extract any necessary information
|
||||
* about a command.
|
||||
* about a command.
|
||||
********************************************************************/
|
||||
int raid_done(struct scst_cmd *cmd)
|
||||
{
|
||||
@@ -204,7 +204,7 @@ static int __init raid_init(void)
|
||||
res = scst_register_dev_driver(&raid_devtype);
|
||||
if (res < 0)
|
||||
goto out;
|
||||
|
||||
|
||||
res = scst_dev_handler_build_std_proc(&raid_devtype);
|
||||
if (res != 0)
|
||||
goto out_err;
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
/*
|
||||
* scst_tape.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
* SCSI tape (type 1) dev handler
|
||||
* SCSI tape (type 1) dev handler
|
||||
* &
|
||||
* SCSI tape (type 1) "performance" device handler (skip all READ and WRITE
|
||||
* operations).
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -140,11 +140,11 @@ module_exit(exit_scst_tape_driver);
|
||||
/**************************************************************
|
||||
* Function: tape_attach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : 1 if attached, error code otherwise
|
||||
*
|
||||
* Description:
|
||||
* Description:
|
||||
*************************************************************/
|
||||
int tape_attach(struct scst_device *dev)
|
||||
{
|
||||
@@ -182,7 +182,7 @@ int tape_attach(struct scst_device *dev)
|
||||
retries = SCST_DEV_UA_RETRIES;
|
||||
do {
|
||||
TRACE_DBG("%s", "Doing TEST_UNIT_READY");
|
||||
res = scsi_test_unit_ready(dev->scsi_dev, TAPE_SMALL_TIMEOUT,
|
||||
res = scsi_test_unit_ready(dev->scsi_dev, TAPE_SMALL_TIMEOUT,
|
||||
TAPE_RETRIES
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
|
||||
);
|
||||
@@ -197,10 +197,10 @@ int tape_attach(struct scst_device *dev)
|
||||
}
|
||||
|
||||
TRACE_DBG("%s", "Doing MODE_SENSE");
|
||||
res = scsi_mode_sense(dev->scsi_dev,
|
||||
res = scsi_mode_sense(dev->scsi_dev,
|
||||
((dev->scsi_dev->scsi_level <= SCSI_2) ?
|
||||
((dev->scsi_dev->lun << 5) & 0xe0) : 0),
|
||||
0 /* Mode Page 0 */,
|
||||
0 /* Mode Page 0 */,
|
||||
buffer, buffer_size,
|
||||
TAPE_SMALL_TIMEOUT, TAPE_RETRIES,
|
||||
&data, NULL);
|
||||
@@ -253,7 +253,7 @@ out:
|
||||
/************************************************************
|
||||
* Function: tape_detach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : None
|
||||
*
|
||||
@@ -276,7 +276,7 @@ void tape_detach(struct scst_device *dev)
|
||||
static int tape_get_block_size(struct scst_cmd *cmd)
|
||||
{
|
||||
struct tape_params *params = (struct tape_params *)cmd->dev->dh_priv;
|
||||
/*
|
||||
/*
|
||||
* No need for locks here, since *_detach() can not be called,
|
||||
* when there are existing commands.
|
||||
*/
|
||||
@@ -286,7 +286,7 @@ static int tape_get_block_size(struct scst_cmd *cmd)
|
||||
/********************************************************************
|
||||
* Function: tape_parse
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : The state of the command
|
||||
*
|
||||
@@ -315,7 +315,7 @@ int tape_parse(struct scst_cmd *cmd)
|
||||
static void tape_set_block_size(struct scst_cmd *cmd, int block_size)
|
||||
{
|
||||
struct tape_params *params = (struct tape_params *)cmd->dev->dh_priv;
|
||||
/*
|
||||
/*
|
||||
* No need for locks here, since *_detach() can not be called, when
|
||||
* there are existing commands.
|
||||
*/
|
||||
@@ -326,13 +326,13 @@ static void tape_set_block_size(struct scst_cmd *cmd, int block_size)
|
||||
/********************************************************************
|
||||
* Function: tape_done
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns :
|
||||
* Returns :
|
||||
*
|
||||
* Description: This is the completion routine for the command,
|
||||
* it is used to extract any necessary information
|
||||
* about a command.
|
||||
* about a command.
|
||||
********************************************************************/
|
||||
int tape_done(struct scst_cmd *cmd)
|
||||
{
|
||||
@@ -344,8 +344,8 @@ int tape_done(struct scst_cmd *cmd)
|
||||
|
||||
if ((status == SAM_STAT_GOOD) || (status == SAM_STAT_CONDITION_MET)) {
|
||||
res = scst_tape_generic_dev_done(cmd, tape_set_block_size);
|
||||
} else if ((status == SAM_STAT_CHECK_CONDITION) &&
|
||||
SCST_SENSE_VALID(cmd->sense))
|
||||
} else if ((status == SAM_STAT_CHECK_CONDITION) &&
|
||||
SCST_SENSE_VALID(cmd->sense))
|
||||
{
|
||||
struct tape_params *params;
|
||||
TRACE_DBG("%s", "Extended sense");
|
||||
@@ -371,8 +371,8 @@ int tape_done(struct scst_cmd *cmd)
|
||||
if (TransferLength > Residue) {
|
||||
int resp_data_len = TransferLength - Residue;
|
||||
if (cmd->cdb[1] & SCST_TRANSFER_LEN_TYPE_FIXED) {
|
||||
/*
|
||||
* No need for locks here, since
|
||||
/*
|
||||
* No need for locks here, since
|
||||
* *_detach() can not be called, when
|
||||
* there are existing commands.
|
||||
*/
|
||||
@@ -394,9 +394,9 @@ int tape_done(struct scst_cmd *cmd)
|
||||
/********************************************************************
|
||||
* Function: tape_exec
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns :
|
||||
* Returns :
|
||||
*
|
||||
* Description: Make SCST do nothing for data READs and WRITES.
|
||||
* Intended for raw line performance testing
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
/*
|
||||
* scst_user.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
*
|
||||
* SCSI virtual user space device handler
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -119,7 +119,7 @@ struct scst_user_cmd
|
||||
{
|
||||
struct scst_cmd *cmd;
|
||||
struct scst_user_dev *dev;
|
||||
|
||||
|
||||
atomic_t ucmd_ref;
|
||||
|
||||
unsigned int buff_cached:1;
|
||||
@@ -157,7 +157,7 @@ static void dev_user_free_ucmd(struct scst_user_cmd *ucmd);
|
||||
static int dev_user_parse(struct scst_cmd *cmd);
|
||||
static int dev_user_exec(struct scst_cmd *cmd);
|
||||
static void dev_user_on_free_cmd(struct scst_cmd *cmd);
|
||||
static int dev_user_task_mgmt_fn(struct scst_mgmt_cmd *mcmd,
|
||||
static int dev_user_task_mgmt_fn(struct scst_mgmt_cmd *mcmd,
|
||||
struct scst_tgt_dev *tgt_dev);
|
||||
|
||||
static int dev_user_disk_done(struct scst_cmd *cmd);
|
||||
@@ -238,7 +238,7 @@ static inline int calc_num_pg(unsigned long buf, int len)
|
||||
|
||||
static inline int is_need_offs_page(unsigned long buf, int len)
|
||||
{
|
||||
return ((buf & ~PAGE_MASK) != 0) &&
|
||||
return ((buf & ~PAGE_MASK) != 0) &&
|
||||
((buf & PAGE_MASK) != ((buf+len-1) & PAGE_MASK));
|
||||
}
|
||||
|
||||
@@ -590,10 +590,10 @@ static int dev_user_alloc_space(struct scst_user_cmd *ucmd)
|
||||
ucmd->user_cmd.cmd_h = ucmd->h;
|
||||
ucmd->user_cmd.subcode = SCST_USER_ALLOC_MEM;
|
||||
ucmd->user_cmd.alloc_cmd.sess_h = (unsigned long)cmd->tgt_dev;
|
||||
memcpy(ucmd->user_cmd.alloc_cmd.cdb, cmd->cdb,
|
||||
memcpy(ucmd->user_cmd.alloc_cmd.cdb, cmd->cdb,
|
||||
min(sizeof(ucmd->user_cmd.alloc_cmd.cdb), sizeof(cmd->cdb)));
|
||||
ucmd->user_cmd.alloc_cmd.cdb_len = cmd->cdb_len;
|
||||
ucmd->user_cmd.alloc_cmd.alloc_len = ucmd->buff_cached ?
|
||||
ucmd->user_cmd.alloc_cmd.alloc_len = ucmd->buff_cached ?
|
||||
(cmd->sg_cnt << PAGE_SHIFT) : cmd->bufflen;
|
||||
ucmd->user_cmd.alloc_cmd.queue_type = cmd->queue_type;
|
||||
ucmd->user_cmd.alloc_cmd.data_direction = cmd->data_direction;
|
||||
@@ -642,7 +642,7 @@ out:
|
||||
static int dev_user_get_block(struct scst_cmd *cmd)
|
||||
{
|
||||
struct scst_user_dev *dev = (struct scst_user_dev*)cmd->dev->dh_priv;
|
||||
/*
|
||||
/*
|
||||
* No need for locks here, since *_detach() can not be
|
||||
* called, when there are existing commands.
|
||||
*/
|
||||
@@ -710,7 +710,7 @@ static int dev_user_parse(struct scst_cmd *cmd)
|
||||
ucmd->user_cmd.cmd_h = ucmd->h;
|
||||
ucmd->user_cmd.subcode = SCST_USER_PARSE;
|
||||
ucmd->user_cmd.parse_cmd.sess_h = (unsigned long)cmd->tgt_dev;
|
||||
memcpy(ucmd->user_cmd.parse_cmd.cdb, cmd->cdb,
|
||||
memcpy(ucmd->user_cmd.parse_cmd.cdb, cmd->cdb,
|
||||
min(sizeof(ucmd->user_cmd.parse_cmd.cdb),
|
||||
sizeof(cmd->cdb)));
|
||||
ucmd->user_cmd.parse_cmd.cdb_len = cmd->cdb_len;
|
||||
@@ -769,7 +769,7 @@ static void dev_user_flush_dcache(struct scst_user_cmd *ucmd)
|
||||
page = buf_ucmd->data_pages[i];
|
||||
#ifdef ARCH_HAS_FLUSH_ANON_PAGE
|
||||
struct vm_area_struct *vma = find_vma(current->mm, start);
|
||||
if (vma != NULL)
|
||||
if (vma != NULL)
|
||||
flush_anon_page(vma, page, start);
|
||||
#endif
|
||||
flush_dcache_page(page);
|
||||
@@ -810,7 +810,7 @@ static int dev_user_exec(struct scst_cmd *cmd)
|
||||
ucmd->user_cmd.cmd_h = ucmd->h;
|
||||
ucmd->user_cmd.subcode = SCST_USER_EXEC;
|
||||
ucmd->user_cmd.exec_cmd.sess_h = (unsigned long)cmd->tgt_dev;
|
||||
memcpy(ucmd->user_cmd.exec_cmd.cdb, cmd->cdb,
|
||||
memcpy(ucmd->user_cmd.exec_cmd.cdb, cmd->cdb,
|
||||
min(sizeof(ucmd->user_cmd.exec_cmd.cdb),
|
||||
sizeof(cmd->cdb)));
|
||||
ucmd->user_cmd.exec_cmd.cdb_len = cmd->cdb_len;
|
||||
@@ -818,7 +818,7 @@ static int dev_user_exec(struct scst_cmd *cmd)
|
||||
ucmd->user_cmd.exec_cmd.data_len = cmd->data_len;
|
||||
ucmd->user_cmd.exec_cmd.pbuf = ucmd->ubuff;
|
||||
if ((ucmd->ubuff == 0) && (cmd->data_direction != SCST_DATA_NONE)) {
|
||||
ucmd->user_cmd.exec_cmd.alloc_len = ucmd->buff_cached ?
|
||||
ucmd->user_cmd.exec_cmd.alloc_len = ucmd->buff_cached ?
|
||||
(cmd->sg_cnt << PAGE_SHIFT) : cmd->bufflen;
|
||||
}
|
||||
ucmd->user_cmd.exec_cmd.queue_type = cmd->queue_type;
|
||||
@@ -894,7 +894,7 @@ out:
|
||||
static void dev_user_set_block(struct scst_cmd *cmd, int block)
|
||||
{
|
||||
struct scst_user_dev *dev = (struct scst_user_dev*)cmd->dev->dh_priv;
|
||||
/*
|
||||
/*
|
||||
* No need for locks here, since *_detach() can not be
|
||||
* called, when there are existing commands.
|
||||
*/
|
||||
@@ -938,7 +938,7 @@ static void dev_user_add_to_ready(struct scst_user_cmd *ucmd)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
do_wake = (in_interrupt() ||
|
||||
do_wake = (in_interrupt() ||
|
||||
(ucmd->state == UCMD_STATE_ON_CACHE_FREEING));
|
||||
if (ucmd->cmd)
|
||||
do_wake |= ucmd->cmd->preprocessing_only;
|
||||
@@ -1134,7 +1134,7 @@ static int dev_user_process_reply_parse(struct scst_user_cmd *ucmd,
|
||||
struct scst_user_reply_cmd *reply)
|
||||
{
|
||||
int res = 0;
|
||||
struct scst_user_scsi_cmd_reply_parse *preply =
|
||||
struct scst_user_scsi_cmd_reply_parse *preply =
|
||||
&reply->parse_reply;
|
||||
struct scst_cmd *cmd = ucmd->cmd;
|
||||
|
||||
@@ -1381,7 +1381,7 @@ unlock_process:
|
||||
case UCMD_STATE_EXECING:
|
||||
res = dev_user_process_reply_exec(ucmd, reply);
|
||||
break;
|
||||
|
||||
|
||||
case UCMD_STATE_ON_FREEING:
|
||||
res = dev_user_process_reply_on_free(ucmd);
|
||||
break;
|
||||
@@ -1512,9 +1512,9 @@ again:
|
||||
if (unlikely(rc != 0)) {
|
||||
u->cmd->scst_cmd_done(u->cmd,
|
||||
SCST_CMD_STATE_DEFAULT);
|
||||
/*
|
||||
/*
|
||||
* !! At this point cmd & u can be !!
|
||||
* !! already freed !!
|
||||
* !! already freed !!
|
||||
*/
|
||||
spin_lock_irq(
|
||||
&dev->cmd_lists.cmd_list_lock);
|
||||
@@ -1901,7 +1901,7 @@ static void dev_user_unjam_cmd(struct scst_user_cmd *ucmd, int busy,
|
||||
spin_unlock_irqrestore(&dev->cmd_lists.cmd_list_lock, *flags);
|
||||
else
|
||||
spin_unlock_irq(&dev->cmd_lists.cmd_list_lock);
|
||||
|
||||
|
||||
TRACE_MGMT_DBG("EXEC: unjamming ucmd %p", ucmd);
|
||||
|
||||
if (test_bit(SCST_CMD_ABORTED, &ucmd->cmd->cmd_flags))
|
||||
@@ -2040,7 +2040,7 @@ repeat:
|
||||
if (ucmd->state & UCMD_STATE_SENT_MASK) {
|
||||
int st = ucmd->state & ~UCMD_STATE_SENT_MASK;
|
||||
if (tgt_dev != NULL) {
|
||||
if (__unjam_check_tgt_dev(ucmd, st,
|
||||
if (__unjam_check_tgt_dev(ucmd, st,
|
||||
tgt_dev) == 0)
|
||||
continue;
|
||||
} else if (tm) {
|
||||
@@ -2131,7 +2131,7 @@ static int dev_user_process_reply_tm_exec(struct scst_user_cmd *ucmd,
|
||||
return res;
|
||||
}
|
||||
|
||||
static int dev_user_task_mgmt_fn(struct scst_mgmt_cmd *mcmd,
|
||||
static int dev_user_task_mgmt_fn(struct scst_mgmt_cmd *mcmd,
|
||||
struct scst_tgt_dev *tgt_dev)
|
||||
{
|
||||
int res, rc;
|
||||
@@ -2273,7 +2273,7 @@ static void dev_user_detach(struct scst_device *sdev)
|
||||
/* dev will be freed by the caller */
|
||||
sdev->dh_priv = NULL;
|
||||
dev->sdev = NULL;
|
||||
|
||||
|
||||
TRACE_EXIT();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
/*
|
||||
* scst_vdisk.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
* (C) 2007 Ming Zhang <blackmagic02881 at gmail dot com>
|
||||
* (C) 2007 Ross Walker <rswwalker at hotmail dot com>
|
||||
*
|
||||
* SCSI disk (type 0) and CDROM (type 5) dev handler using files
|
||||
* SCSI disk (type 0) and CDROM (type 5) dev handler using files
|
||||
* on file systems or block devices (VDISK)
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <linux/file.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/string.h>
|
||||
@@ -319,7 +319,7 @@ static struct scst_dev_type vcdrom_devtype = VCDROM_TYPE;
|
||||
|
||||
static char *vdisk_proc_help_string =
|
||||
"echo \"open|close NAME [FILE_NAME [BLOCK_SIZE] [WRITE_THROUGH "
|
||||
"READ_ONLY O_DIRECT NULLIO NV_CACHE BLOCKIO]]\" >/proc/scsi_tgt/"
|
||||
"READ_ONLY O_DIRECT NULLIO NV_CACHE BLOCKIO]]\" >/proc/scsi_tgt/"
|
||||
VDISK_NAME "/" VDISK_NAME "\n";
|
||||
|
||||
static char *vcdrom_proc_help_string =
|
||||
@@ -335,11 +335,11 @@ MODULE_PARM_DESC(scst_vdisk_ID, "SCST virtual disk subsystem ID");
|
||||
/**************************************************************
|
||||
* Function: vdisk_open
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : fd, use IS_ERR(fd) to get error status
|
||||
*
|
||||
* Description:
|
||||
* Description:
|
||||
*************************************************************/
|
||||
static struct file *vdisk_open(const struct scst_vdisk_dev *virt_dev)
|
||||
{
|
||||
@@ -366,11 +366,11 @@ static struct file *vdisk_open(const struct scst_vdisk_dev *virt_dev)
|
||||
/**************************************************************
|
||||
* Function: vdisk_attach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : 1 if attached, error code otherwise
|
||||
*
|
||||
* Description:
|
||||
* Description:
|
||||
*************************************************************/
|
||||
static int vdisk_attach(struct scst_device *dev)
|
||||
{
|
||||
@@ -390,12 +390,12 @@ static int vdisk_attach(struct scst_device *dev)
|
||||
goto out;
|
||||
}
|
||||
|
||||
vd = (dev->handler->type == TYPE_DISK) ?
|
||||
vd = (dev->handler->type == TYPE_DISK) ?
|
||||
&vdisk_dev_list :
|
||||
&vcdrom_dev_list;
|
||||
|
||||
/*
|
||||
* scst_vdisk_mutex must be already taken before
|
||||
/*
|
||||
* scst_vdisk_mutex must be already taken before
|
||||
* scst_register_virtual_device()
|
||||
*/
|
||||
list_for_each_entry(vv, vd, vdisk_dev_list_entry) {
|
||||
@@ -404,7 +404,7 @@ static int vdisk_attach(struct scst_device *dev)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (virt_dev == NULL) {
|
||||
PRINT_ERROR("Device %s not found", dev->virt_name);
|
||||
res = -EINVAL;
|
||||
@@ -431,10 +431,10 @@ static int vdisk_attach(struct scst_device *dev)
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
|
||||
if ((fd->f_op == NULL) || (fd->f_op->readv == NULL) ||
|
||||
if ((fd->f_op == NULL) || (fd->f_op->readv == NULL) ||
|
||||
(fd->f_op->writev == NULL))
|
||||
#else
|
||||
if ((fd->f_op == NULL) || (fd->f_op->aio_read == NULL) ||
|
||||
if ((fd->f_op == NULL) || (fd->f_op->aio_read == NULL) ||
|
||||
(fd->f_op->aio_write == NULL))
|
||||
#endif
|
||||
{
|
||||
@@ -444,7 +444,7 @@ static int vdisk_attach(struct scst_device *dev)
|
||||
filp_close(fd, NULL);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
inode = fd->f_dentry->d_inode;
|
||||
|
||||
if (virt_dev->blockio && !S_ISBLK(inode->i_mode)) {
|
||||
@@ -465,7 +465,7 @@ static int vdisk_attach(struct scst_device *dev)
|
||||
goto out;
|
||||
}
|
||||
err = inode->i_size;
|
||||
|
||||
|
||||
filp_close(fd, NULL);
|
||||
}
|
||||
virt_dev->file_size = err;
|
||||
@@ -512,7 +512,7 @@ out:
|
||||
/************************************************************
|
||||
* Function: vdisk_detach
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : None
|
||||
*
|
||||
@@ -532,7 +532,7 @@ static void vdisk_detach(struct scst_device *dev)
|
||||
|
||||
/* virt_dev will be freed by the caller */
|
||||
dev->dh_priv = NULL;
|
||||
|
||||
|
||||
TRACE_EXIT();
|
||||
return;
|
||||
}
|
||||
@@ -622,7 +622,7 @@ static int vdisk_attach_tgt(struct scst_tgt_dev *tgt_dev)
|
||||
}
|
||||
|
||||
tgt_dev->dh_priv = ftgt_dev;
|
||||
|
||||
|
||||
out:
|
||||
TRACE_EXIT_RES(res);
|
||||
return res;
|
||||
@@ -630,7 +630,7 @@ out:
|
||||
|
||||
static void vdisk_detach_tgt(struct scst_tgt_dev *tgt_dev)
|
||||
{
|
||||
struct scst_vdisk_tgt_dev *ftgt_dev =
|
||||
struct scst_vdisk_tgt_dev *ftgt_dev =
|
||||
(struct scst_vdisk_tgt_dev *)tgt_dev->dh_priv;
|
||||
|
||||
TRACE_ENTRY();
|
||||
@@ -761,10 +761,10 @@ static int vdisk_do_job(struct scst_cmd *cmd)
|
||||
lba_start |= ((u64)cdb[3]) << 16;
|
||||
lba_start |= ((u64)cdb[4]) << 8;
|
||||
lba_start |= ((u64)cdb[5]);
|
||||
data_len = ((cdb[7] << (BYTE * 1)) + (cdb[8] << (BYTE * 0)))
|
||||
data_len = ((cdb[7] << (BYTE * 1)) + (cdb[8] << (BYTE * 0)))
|
||||
<< virt_dev->block_shift;
|
||||
if (data_len == 0)
|
||||
data_len = virt_dev->file_size -
|
||||
data_len = virt_dev->file_size -
|
||||
((loff_t)lba_start << virt_dev->block_shift);
|
||||
break;
|
||||
}
|
||||
@@ -775,7 +775,7 @@ static int vdisk_do_job(struct scst_cmd *cmd)
|
||||
if (unlikely(loff < 0) || unlikely(data_len < 0) ||
|
||||
unlikely((loff + data_len) > virt_dev->file_size)) {
|
||||
PRINT_INFO("Access beyond the end of the device "
|
||||
"(%lld of %lld, len %Ld)", (uint64_t)loff,
|
||||
"(%lld of %lld, len %Ld)", (uint64_t)loff,
|
||||
(uint64_t)virt_dev->file_size, (uint64_t)data_len);
|
||||
scst_set_cmd_error(cmd, SCST_LOAD_SENSE(
|
||||
scst_sense_block_out_range_error));
|
||||
@@ -977,7 +977,7 @@ static int vdisk_get_block_shift(struct scst_cmd *cmd)
|
||||
/********************************************************************
|
||||
* Function: vdisk_parse
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : The state of the command
|
||||
*
|
||||
@@ -994,7 +994,7 @@ static int vdisk_parse(struct scst_cmd *cmd)
|
||||
/********************************************************************
|
||||
* Function: vcdrom_parse
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns : The state of the command
|
||||
*
|
||||
@@ -1011,11 +1011,11 @@ static int vcdrom_parse(struct scst_cmd *cmd)
|
||||
/********************************************************************
|
||||
* Function: vcdrom_exec
|
||||
*
|
||||
* Argument:
|
||||
* Argument:
|
||||
*
|
||||
* Returns :
|
||||
* Returns :
|
||||
*
|
||||
* Description:
|
||||
* Description:
|
||||
********************************************************************/
|
||||
static int vcdrom_exec(struct scst_cmd *cmd)
|
||||
{
|
||||
@@ -1038,7 +1038,7 @@ static int vcdrom_exec(struct scst_cmd *cmd)
|
||||
goto out_done;
|
||||
}
|
||||
|
||||
if (virt_dev->media_changed && (cmd->cdb[0] != INQUIRY) &&
|
||||
if (virt_dev->media_changed && (cmd->cdb[0] != INQUIRY) &&
|
||||
(cmd->cdb[0] != REQUEST_SENSE) && (cmd->cdb[0] != REPORT_LUNS)) {
|
||||
spin_lock(&virt_dev->flags_lock);
|
||||
if (virt_dev->media_changed) {
|
||||
@@ -1080,7 +1080,7 @@ static void vdisk_exec_inquiry(struct scst_cmd *cmd)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
buf = kzalloc(INQ_BUF_SZ,
|
||||
buf = kzalloc(INQ_BUF_SZ,
|
||||
scst_cmd_atomic(cmd) ? GFP_ATOMIC : GFP_KERNEL);
|
||||
if (buf == NULL) {
|
||||
scst_set_busy(cmd);
|
||||
@@ -1110,7 +1110,7 @@ static void vdisk_exec_inquiry(struct scst_cmd *cmd)
|
||||
if (cmd->cdb[1] & EVPD) {
|
||||
int dev_id_num;
|
||||
char dev_id_str[6];
|
||||
|
||||
|
||||
for (dev_id_num = 0, i = 0; i < (int)strlen(virt_dev->name); i++) {
|
||||
unsigned int rv = random_values[(int)(virt_dev->name[i])];
|
||||
/*
|
||||
@@ -1270,7 +1270,7 @@ out:
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* <<Following mode pages info copied from ST318451LW with some corrections>>
|
||||
*
|
||||
* ToDo: revise them
|
||||
@@ -1405,7 +1405,7 @@ static void vdisk_exec_mode_sense(struct scst_cmd *cmd)
|
||||
virt_dev = (struct scst_vdisk_dev *)cmd->dev->dh_priv;
|
||||
blocksize = virt_dev->block_size;
|
||||
nblocks = virt_dev->nblocks;
|
||||
|
||||
|
||||
type = cmd->dev->handler->type; /* type dev */
|
||||
dbd = cmd->cdb[1] & DBD;
|
||||
pcontrol = (cmd->cdb[2] & 0xc0) >> 6;
|
||||
@@ -1621,7 +1621,7 @@ static void vdisk_exec_mode_select(struct scst_cmd *cmd)
|
||||
goto out_put;
|
||||
}
|
||||
break;
|
||||
#if 0 /*
|
||||
#if 0 /*
|
||||
* It's too early to implement it, since we can't control the backstorage
|
||||
* device parameters. ToDo
|
||||
*/
|
||||
@@ -1635,7 +1635,7 @@ static void vdisk_exec_mode_select(struct scst_cmd *cmd)
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
PRINT_ERROR("MODE SELECT: Invalid request %x",
|
||||
PRINT_ERROR("MODE SELECT: Invalid request %x",
|
||||
address[offset] & 0x3f);
|
||||
scst_set_cmd_error(cmd, SCST_LOAD_SENSE(
|
||||
scst_sense_invalid_field_in_parm_list));
|
||||
@@ -1696,7 +1696,7 @@ static void vdisk_exec_read_capacity(struct scst_cmd *cmd)
|
||||
buffer[5] = (blocksize >> (BYTE * 2)) & 0xFF;
|
||||
buffer[6] = (blocksize >> (BYTE * 1)) & 0xFF;
|
||||
buffer[7] = (blocksize >> (BYTE * 0)) & 0xFF;
|
||||
|
||||
|
||||
length = scst_get_buf_first(cmd, &address);
|
||||
if (unlikely(length <= 0)) {
|
||||
PRINT_ERROR("scst_get_buf_first() failed: %d", length);
|
||||
@@ -1777,7 +1777,7 @@ static void vdisk_exec_read_toc(struct scst_cmd *cmd)
|
||||
uint8_t *address;
|
||||
struct scst_vdisk_dev *virt_dev;
|
||||
uint32_t nblocks;
|
||||
uint8_t buffer[4+8+8] = { 0x00, 0x0a, 0x01, 0x01, 0x00, 0x14,
|
||||
uint8_t buffer[4+8+8] = { 0x00, 0x0a, 0x01, 0x01, 0x00, 0x14,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
TRACE_ENTRY();
|
||||
@@ -1867,7 +1867,7 @@ static void vdisk_exec_prevent_allow_medium_removal(struct scst_cmd *cmd)
|
||||
|
||||
if (cmd->dev->handler->type == TYPE_ROM) {
|
||||
spin_lock(&virt_dev->flags_lock);
|
||||
virt_dev->prevent_allow_medium_removal =
|
||||
virt_dev->prevent_allow_medium_removal =
|
||||
cmd->cdb[4] & 0x01 ? 1 : 0;
|
||||
spin_unlock(&virt_dev->flags_lock);
|
||||
}
|
||||
@@ -1915,7 +1915,7 @@ static struct iovec *vdisk_alloc_iv(struct scst_cmd *cmd,
|
||||
struct scst_vdisk_thr *thr)
|
||||
{
|
||||
int iv_count;
|
||||
|
||||
|
||||
iv_count = scst_get_buf_count(cmd);
|
||||
if (iv_count > thr->iv_count) {
|
||||
if (thr->iv != NULL)
|
||||
@@ -1989,11 +1989,11 @@ static void vdisk_exec_read(struct scst_cmd *cmd,
|
||||
int iv_count, i;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
iv = vdisk_alloc_iv(cmd, thr);
|
||||
if (iv == NULL)
|
||||
goto out;
|
||||
|
||||
|
||||
iv_count = 0;
|
||||
full_len = 0;
|
||||
i = -1;
|
||||
@@ -2020,14 +2020,14 @@ static void vdisk_exec_read(struct scst_cmd *cmd,
|
||||
if (virt_dev->nullio)
|
||||
err = full_len;
|
||||
else {
|
||||
/* SEEK */
|
||||
/* SEEK */
|
||||
if (fd->f_op->llseek) {
|
||||
err = fd->f_op->llseek(fd, loff, 0/*SEEK_SET*/);
|
||||
} else {
|
||||
err = default_llseek(fd, loff, 0/*SEEK_SET*/);
|
||||
}
|
||||
if (err != loff) {
|
||||
PRINT_ERROR("lseek trouble %Ld != %Ld", (uint64_t)err,
|
||||
PRINT_ERROR("lseek trouble %Ld != %Ld", (uint64_t)err,
|
||||
(uint64_t)loff);
|
||||
scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_hardw_error));
|
||||
goto out_set_fs;
|
||||
@@ -2041,7 +2041,7 @@ static void vdisk_exec_read(struct scst_cmd *cmd,
|
||||
}
|
||||
|
||||
if ((err < 0) || (err < full_len)) {
|
||||
PRINT_ERROR("readv() returned %Ld from %zd", (uint64_t)err,
|
||||
PRINT_ERROR("readv() returned %Ld from %zd", (uint64_t)err,
|
||||
full_len);
|
||||
if (err == -EAGAIN)
|
||||
scst_set_busy(cmd);
|
||||
@@ -2054,11 +2054,11 @@ static void vdisk_exec_read(struct scst_cmd *cmd,
|
||||
|
||||
out_set_fs:
|
||||
set_fs(old_fs);
|
||||
|
||||
out_put:
|
||||
|
||||
out_put:
|
||||
for(; i >= 0; i--)
|
||||
scst_put_buf(cmd, iv[i].iov_base);
|
||||
|
||||
|
||||
out:
|
||||
TRACE_EXIT();
|
||||
return;
|
||||
@@ -2082,7 +2082,7 @@ static void vdisk_exec_write(struct scst_cmd *cmd,
|
||||
iv = vdisk_alloc_iv(cmd, thr);
|
||||
if (iv == NULL)
|
||||
goto out;
|
||||
|
||||
|
||||
iv_count = 0;
|
||||
full_len = 0;
|
||||
length = scst_get_buf_first(cmd, &address);
|
||||
@@ -2118,7 +2118,7 @@ restart:
|
||||
err = default_llseek(fd, loff, 0 /*SEEK_SET */ );
|
||||
}
|
||||
if (err != loff) {
|
||||
PRINT_ERROR("lseek trouble %Ld != %Ld", (uint64_t)err,
|
||||
PRINT_ERROR("lseek trouble %Ld != %Ld", (uint64_t)err,
|
||||
(uint64_t)loff);
|
||||
scst_set_cmd_error(cmd,
|
||||
SCST_LOAD_SENSE(scst_sense_hardw_error));
|
||||
@@ -2129,13 +2129,13 @@ restart:
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
|
||||
err = fd->f_op->writev(fd, eiv, eiv_count, &fd->f_pos);
|
||||
#else
|
||||
err = do_sync_readv_writev(fd, iv, iv_count, full_len, &fd->f_pos,
|
||||
err = do_sync_readv_writev(fd, iv, iv_count, full_len, &fd->f_pos,
|
||||
fd->f_op->aio_write);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (err < 0) {
|
||||
PRINT_ERROR("write() returned %Ld from %zd",
|
||||
PRINT_ERROR("write() returned %Ld from %zd",
|
||||
(uint64_t)err, full_len);
|
||||
if (err == -EAGAIN)
|
||||
scst_set_busy(cmd);
|
||||
@@ -2145,7 +2145,7 @@ restart:
|
||||
}
|
||||
goto out_set_fs;
|
||||
} else if (err < full_len) {
|
||||
/*
|
||||
/*
|
||||
* Probably that's wrong, but sometimes write() returns
|
||||
* value less, than requested. Let's restart.
|
||||
*/
|
||||
@@ -2164,7 +2164,7 @@ restart:
|
||||
eiv++;
|
||||
eiv_count--;
|
||||
} else {
|
||||
eiv->iov_base =
|
||||
eiv->iov_base =
|
||||
(uint8_t*)eiv->iov_base + err;
|
||||
eiv->iov_len -= err;
|
||||
break;
|
||||
@@ -2176,7 +2176,7 @@ restart:
|
||||
out_set_fs:
|
||||
set_fs(old_fs);
|
||||
|
||||
out_put:
|
||||
out_put:
|
||||
while (iv_count > 0) {
|
||||
scst_put_buf(cmd, iv[iv_count-1].iov_base);
|
||||
iv_count--;
|
||||
@@ -2221,7 +2221,7 @@ static void blockio_endio(struct bio *bio, int error)
|
||||
if (unlikely(error != 0)) {
|
||||
PRINT_ERROR("cmd %p returned error %d", blockio_work->cmd,
|
||||
error);
|
||||
/*
|
||||
/*
|
||||
* The race with other such bio's doesn't matter, since all
|
||||
* scst_set_cmd_error() calls do the same local to this cmd
|
||||
* operations.
|
||||
@@ -2266,7 +2266,7 @@ static void blockio_exec_rw(struct scst_cmd *cmd, struct scst_vdisk_thr *thr,
|
||||
blockio_work = kmalloc(sizeof (*blockio_work), GFP_KERNEL);
|
||||
if (blockio_work == NULL)
|
||||
goto out_no_mem;
|
||||
|
||||
|
||||
blockio_work->cmd = cmd;
|
||||
|
||||
if (q)
|
||||
@@ -2304,7 +2304,7 @@ static void blockio_exec_rw(struct scst_cmd *cmd, struct scst_vdisk_thr *thr,
|
||||
bios++;
|
||||
need_new_bio = 0;
|
||||
bio->bi_end_io = blockio_endio;
|
||||
bio->bi_sector = lba_start0 <<
|
||||
bio->bi_sector = lba_start0 <<
|
||||
(virt_dev->block_shift - 9);
|
||||
bio->bi_bdev = bdev;
|
||||
bio->bi_private = blockio_work;
|
||||
@@ -2373,7 +2373,7 @@ out_no_mem:
|
||||
goto out;
|
||||
}
|
||||
|
||||
static void vdisk_exec_verify(struct scst_cmd *cmd,
|
||||
static void vdisk_exec_verify(struct scst_cmd *cmd,
|
||||
struct scst_vdisk_thr *thr, loff_t loff)
|
||||
{
|
||||
mm_segment_t old_fs;
|
||||
@@ -2391,7 +2391,7 @@ static void vdisk_exec_verify(struct scst_cmd *cmd,
|
||||
if (vdisk_fsync(thr, loff, cmd->bufflen, cmd) != 0)
|
||||
goto out;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Until the cache is cleared prior the verifying, there is not
|
||||
* much point in this code. ToDo.
|
||||
*
|
||||
@@ -2410,7 +2410,7 @@ static void vdisk_exec_verify(struct scst_cmd *cmd,
|
||||
err = default_llseek(fd, loff, 0/*SEEK_SET*/);
|
||||
}
|
||||
if (err != loff) {
|
||||
PRINT_ERROR("lseek trouble %Ld != %Ld", (uint64_t)err,
|
||||
PRINT_ERROR("lseek trouble %Ld != %Ld", (uint64_t)err,
|
||||
(uint64_t)loff);
|
||||
scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_hardw_error));
|
||||
goto out_set_fs;
|
||||
@@ -2523,7 +2523,7 @@ static int vdisk_task_mgmt_fn(struct scst_mgmt_cmd *mcmd,
|
||||
return SCST_DEV_TM_NOT_COMPLETED;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Called when a file in the /proc/VDISK_NAME/VDISK_NAME is read
|
||||
*/
|
||||
static int vdisk_read_proc(struct seq_file *seq, struct scst_dev_type *dev_type)
|
||||
@@ -2532,12 +2532,12 @@ static int vdisk_read_proc(struct seq_file *seq, struct scst_dev_type *dev_type)
|
||||
struct scst_vdisk_dev *virt_dev;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
if (mutex_lock_interruptible(&scst_vdisk_mutex) != 0) {
|
||||
res = -EINTR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
seq_printf(seq, "%-17s %-11s %-11s %-15s %s\n",
|
||||
"Name", "Size(MB)", "Block size", "Options", "File name");
|
||||
|
||||
@@ -2632,7 +2632,7 @@ static void vdisk_report_registering(const char *type,
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Called when a file in the /proc/VDISK_NAME/VDISK_NAME is written
|
||||
*/
|
||||
static int vdisk_write_proc(char *buffer, char **start, off_t offset,
|
||||
@@ -2646,12 +2646,12 @@ static int vdisk_write_proc(char *buffer, char **start, off_t offset,
|
||||
size_t len;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
/* VERY UGLY code. You can rewrite it if you want */
|
||||
|
||||
if (buffer[0] == '\0')
|
||||
goto out;
|
||||
|
||||
|
||||
if (mutex_lock_interruptible(&scst_vdisk_mutex) != 0) {
|
||||
res = -EINTR;
|
||||
goto out;
|
||||
@@ -2750,7 +2750,7 @@ static int vdisk_write_proc(char *buffer, char **start, off_t offset,
|
||||
}
|
||||
virt_dev->block_size = block_size;
|
||||
virt_dev->block_shift = block_shift;
|
||||
|
||||
|
||||
while (*p != '\0') {
|
||||
if (!strncmp("WRITE_THROUGH", p, 13)) {
|
||||
p += 13;
|
||||
@@ -2767,7 +2767,7 @@ static int vdisk_write_proc(char *buffer, char **start, off_t offset,
|
||||
} else if (!strncmp("O_DIRECT", p, 8)) {
|
||||
p += 8;
|
||||
#if 0
|
||||
|
||||
|
||||
virt_dev->o_direct_flag = 1;
|
||||
TRACE_DBG("%s", "O_DIRECT");
|
||||
#else
|
||||
@@ -2854,7 +2854,7 @@ static int vdisk_write_proc(char *buffer, char **start, off_t offset,
|
||||
goto out_up;
|
||||
}
|
||||
scst_unregister_virtual_device(virt_dev->virt_id);
|
||||
PRINT_INFO("Virtual device %s unregistered",
|
||||
PRINT_INFO("Virtual device %s unregistered",
|
||||
virt_dev->name);
|
||||
TRACE_DBG("virt_id %d unregister", virt_dev->virt_id);
|
||||
|
||||
@@ -2995,7 +2995,7 @@ static int vcdrom_close(char *name)
|
||||
goto out;
|
||||
}
|
||||
scst_unregister_virtual_device(virt_dev->virt_id);
|
||||
PRINT_INFO("Virtual device %s unregistered",
|
||||
PRINT_INFO("Virtual device %s unregistered",
|
||||
virt_dev->name);
|
||||
TRACE_DBG("virt_id %d unregister", virt_dev->virt_id);
|
||||
|
||||
@@ -3158,7 +3158,7 @@ out_free_resume:
|
||||
goto out_resume;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Called when a file in the /proc/VCDROM_NAME/VCDROM_NAME is read
|
||||
*/
|
||||
static int vcdrom_read_proc(struct seq_file *seq, struct scst_dev_type *dev_type)
|
||||
@@ -3172,10 +3172,10 @@ static int vcdrom_read_proc(struct seq_file *seq, struct scst_dev_type *dev_type
|
||||
res = -EINTR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
seq_printf(seq, "%-17s %-9s %s\n", "Name", "Size(MB)", "File name");
|
||||
|
||||
list_for_each_entry(virt_dev, &vcdrom_dev_list,
|
||||
list_for_each_entry(virt_dev, &vcdrom_dev_list,
|
||||
vdisk_dev_list_entry) {
|
||||
seq_printf(seq, "%-17s %-9d %s\n", virt_dev->name,
|
||||
(uint32_t)(virt_dev->file_size >> 20),
|
||||
@@ -3189,8 +3189,8 @@ out:
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* Called when a file in the /proc/VCDROM_NAME/VCDROM_NAME is written
|
||||
/*
|
||||
* Called when a file in the /proc/VCDROM_NAME/VCDROM_NAME is written
|
||||
*/
|
||||
static int vcdrom_write_proc(char *buffer, char **start, off_t offset,
|
||||
int length, int *eof, struct scst_dev_type *dev_type)
|
||||
@@ -3205,7 +3205,7 @@ static int vcdrom_write_proc(char *buffer, char **start, off_t offset,
|
||||
res = -EINTR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
p = buffer;
|
||||
if (p[strlen(p) - 1] == '\n') {
|
||||
p[strlen(p) - 1] = '\0';
|
||||
@@ -3290,7 +3290,7 @@ static int vdisk_proc_help_build(struct scst_dev_type *dev_type)
|
||||
TRACE_ENTRY();
|
||||
|
||||
root = scst_proc_get_dev_type_root(dev_type);
|
||||
vdisk_help_proc_data.data = (dev_type->type == TYPE_DISK) ?
|
||||
vdisk_help_proc_data.data = (dev_type->type == TYPE_DISK) ?
|
||||
vdisk_proc_help_string :
|
||||
vcdrom_proc_help_string;
|
||||
p = scst_create_proc_entry(root, VDISK_PROC_HELP, &vdisk_help_proc_data);
|
||||
@@ -3364,7 +3364,7 @@ static void exit_scst_vdisk(struct scst_dev_type *devtype,
|
||||
|
||||
if (list_empty(vdisk_dev_list))
|
||||
break;
|
||||
|
||||
|
||||
virt_dev = list_entry(vdisk_dev_list->next, typeof(*virt_dev),
|
||||
vdisk_dev_list_entry);
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
* scst_cdbprobe.h
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
|
||||
/* Must be included in only one .c file in the project!! */
|
||||
|
||||
#ifndef __SCST_CDBPROBE_H
|
||||
@@ -42,7 +42,7 @@ static int get_trans_len_read_pos(struct scst_cmd *cmd, uint8_t off);
|
||||
+=========================================================+
|
||||
|Key: M = command implementation is mandatory. |
|
||||
| O = command implementation is optional. |
|
||||
| V = Vendor-specific |
|
||||
| V = Vendor-specific |
|
||||
| R = Reserved |
|
||||
| ' '= DON'T use for this device |
|
||||
+=========================================================+
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/*
|
||||
* scst_debug.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
* Contains helper functions for execution tracing and error reporting.
|
||||
*
|
||||
* Contains helper functions for execution tracing and error reporting.
|
||||
* Intended to be included in main .c file.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
|
||||
+81
-81
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* scst_lib.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -139,7 +139,7 @@ void scst_set_sense(uint8_t *buffer, int len, int key,
|
||||
return;
|
||||
}
|
||||
|
||||
void scst_set_cmd_error_sense(struct scst_cmd *cmd, uint8_t *sense,
|
||||
void scst_set_cmd_error_sense(struct scst_cmd *cmd, uint8_t *sense,
|
||||
unsigned int len)
|
||||
{
|
||||
TRACE_ENTRY();
|
||||
@@ -259,7 +259,7 @@ void scst_free_device(struct scst_device *dev)
|
||||
TRACE_ENTRY();
|
||||
|
||||
#ifdef EXTRACHECKS
|
||||
if (!list_empty(&dev->dev_tgt_dev_list) ||
|
||||
if (!list_empty(&dev->dev_tgt_dev_list) ||
|
||||
!list_empty(&dev->dev_acg_dev_list)) {
|
||||
PRINT_CRIT_ERROR("%s: dev_tgt_dev_list or dev_acg_dev_list "
|
||||
"is not empty!", __FUNCTION__);
|
||||
@@ -296,7 +296,7 @@ struct scst_acg_dev *scst_alloc_acg_dev(struct scst_acg *acg,
|
||||
res->dev = dev;
|
||||
res->acg = acg;
|
||||
res->lun = lun;
|
||||
|
||||
|
||||
out:
|
||||
TRACE_EXIT_HRES(res);
|
||||
return res;
|
||||
@@ -306,14 +306,14 @@ out:
|
||||
void scst_free_acg_dev(struct scst_acg_dev *acg_dev)
|
||||
{
|
||||
TRACE_ENTRY();
|
||||
|
||||
TRACE_DBG("Removing acg_dev %p from acg_dev_list and dev_acg_dev_list",
|
||||
|
||||
TRACE_DBG("Removing acg_dev %p from acg_dev_list and dev_acg_dev_list",
|
||||
acg_dev);
|
||||
list_del(&acg_dev->acg_dev_list_entry);
|
||||
list_del(&acg_dev->dev_acg_dev_list_entry);
|
||||
|
||||
|
||||
kmem_cache_free(scst_acgd_cachep, acg_dev);
|
||||
|
||||
|
||||
TRACE_EXIT();
|
||||
return;
|
||||
}
|
||||
@@ -335,10 +335,10 @@ struct scst_acg *scst_alloc_add_acg(const char *acg_name)
|
||||
INIT_LIST_HEAD(&acg->acg_sess_list);
|
||||
INIT_LIST_HEAD(&acg->acn_list);
|
||||
acg->acg_name = acg_name;
|
||||
|
||||
|
||||
TRACE_DBG("Adding acg %s to scst_acg_list", acg_name);
|
||||
list_add_tail(&acg->scst_acg_list_entry, &scst_acg_list);
|
||||
|
||||
|
||||
out:
|
||||
TRACE_EXIT_HRES(acg);
|
||||
return acg;
|
||||
@@ -361,9 +361,9 @@ int scst_destroy_acg(struct scst_acg *acg)
|
||||
|
||||
TRACE_DBG("Removing acg %s from scst_acg_list", acg->acg_name);
|
||||
list_del(&acg->scst_acg_list_entry);
|
||||
|
||||
|
||||
/* Freeing acg_devs */
|
||||
list_for_each_entry_safe(acg_dev, acg_dev_tmp, &acg->acg_dev_list,
|
||||
list_for_each_entry_safe(acg_dev, acg_dev_tmp, &acg->acg_dev_list,
|
||||
acg_dev_list_entry) {
|
||||
struct scst_tgt_dev *tgt_dev, *tt;
|
||||
list_for_each_entry_safe(tgt_dev, tt,
|
||||
@@ -376,7 +376,7 @@ int scst_destroy_acg(struct scst_acg *acg)
|
||||
}
|
||||
|
||||
/* Freeing names */
|
||||
list_for_each_entry_safe(n, nn, &acg->acn_list,
|
||||
list_for_each_entry_safe(n, nn, &acg->acn_list,
|
||||
acn_list_entry) {
|
||||
list_del(&n->acn_list_entry);
|
||||
kfree(n->name);
|
||||
@@ -422,13 +422,13 @@ static struct scst_tgt_dev *scst_alloc_add_tgt_dev(struct scst_session *sess,
|
||||
tgt_dev->acg_dev = acg_dev;
|
||||
tgt_dev->sess = sess;
|
||||
atomic_set(&tgt_dev->tgt_dev_cmd_count, 0);
|
||||
|
||||
|
||||
scst_sgv_pool_use_norm(tgt_dev);
|
||||
|
||||
if (dev->scsi_dev != NULL) {
|
||||
ini_sg = dev->scsi_dev->host->sg_tablesize;
|
||||
ini_unchecked_isa_dma = dev->scsi_dev->host->unchecked_isa_dma;
|
||||
ini_use_clustering = (dev->scsi_dev->host->use_clustering ==
|
||||
ini_use_clustering = (dev->scsi_dev->host->use_clustering ==
|
||||
ENABLE_CLUSTERING);
|
||||
} else {
|
||||
ini_sg = (1 << 15) /* infinite */;
|
||||
@@ -437,9 +437,9 @@ static struct scst_tgt_dev *scst_alloc_add_tgt_dev(struct scst_session *sess,
|
||||
}
|
||||
tgt_dev->max_sg_cnt = min(ini_sg, sess->tgt->sg_tablesize);
|
||||
|
||||
if ((sess->tgt->tgtt->use_clustering || ini_use_clustering) &&
|
||||
if ((sess->tgt->tgtt->use_clustering || ini_use_clustering) &&
|
||||
!sess->tgt->tgtt->no_clustering) {
|
||||
scst_sgv_pool_use_norm_clust(tgt_dev);
|
||||
scst_sgv_pool_use_norm_clust(tgt_dev);
|
||||
}
|
||||
|
||||
if (sess->tgt->tgtt->unchecked_isa_dma || ini_unchecked_isa_dma) {
|
||||
@@ -452,12 +452,12 @@ static struct scst_tgt_dev *scst_alloc_add_tgt_dev(struct scst_session *sess,
|
||||
|
||||
if (dev->scsi_dev != NULL) {
|
||||
TRACE_MGMT_DBG("host=%d, channel=%d, id=%d, lun=%d, "
|
||||
"SCST lun=%Ld", dev->scsi_dev->host->host_no,
|
||||
dev->scsi_dev->channel, dev->scsi_dev->id,
|
||||
"SCST lun=%Ld", dev->scsi_dev->host->host_no,
|
||||
dev->scsi_dev->channel, dev->scsi_dev->id,
|
||||
dev->scsi_dev->lun, (uint64_t)tgt_dev->lun);
|
||||
}
|
||||
else {
|
||||
TRACE_MGMT_DBG("Virtual device %s on SCST lun=%Ld",
|
||||
TRACE_MGMT_DBG("Virtual device %s on SCST lun=%Ld",
|
||||
dev->virt_name, (uint64_t)tgt_dev->lun);
|
||||
}
|
||||
|
||||
@@ -474,7 +474,7 @@ static struct scst_tgt_dev *scst_alloc_add_tgt_dev(struct scst_session *sess,
|
||||
for(i = 0; i < (int)ARRAY_SIZE(tgt_dev->sn_slots); i++)
|
||||
atomic_set(&tgt_dev->sn_slots[i], 0);
|
||||
|
||||
if (dev->handler->parse_atomic &&
|
||||
if (dev->handler->parse_atomic &&
|
||||
(sess->tgt->tgtt->preprocessing_done == NULL)) {
|
||||
if (sess->tgt->tgtt->rdy_to_xfer_atomic ||
|
||||
(sess->tgt->tgtt->rdy_to_xfer == NULL))
|
||||
@@ -531,13 +531,13 @@ static struct scst_tgt_dev *scst_alloc_add_tgt_dev(struct scst_session *sess,
|
||||
}
|
||||
}
|
||||
|
||||
spin_lock_bh(&dev->dev_lock);
|
||||
spin_lock_bh(&dev->dev_lock);
|
||||
list_add_tail(&tgt_dev->dev_tgt_dev_list_entry, &dev->dev_tgt_dev_list);
|
||||
if (dev->dev_reserved)
|
||||
__set_bit(SCST_TGT_DEV_RESERVED, &tgt_dev->tgt_dev_flags);
|
||||
spin_unlock_bh(&dev->dev_lock);
|
||||
|
||||
sess_tgt_dev_list_head =
|
||||
sess_tgt_dev_list_head =
|
||||
&sess->sess_tgt_dev_list_hash[HASH_VAL(tgt_dev->lun)];
|
||||
list_add_tail(&tgt_dev->sess_tgt_dev_list_entry, sess_tgt_dev_list_head);
|
||||
|
||||
@@ -631,7 +631,7 @@ int scst_sess_alloc_tgt_devs(struct scst_session *sess)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
list_for_each_entry(acg_dev, &sess->acg->acg_dev_list,
|
||||
list_for_each_entry(acg_dev, &sess->acg->acg_dev_list,
|
||||
acg_dev_list_entry) {
|
||||
tgt_dev = scst_alloc_add_tgt_dev(sess, acg_dev);
|
||||
if (tgt_dev == NULL) {
|
||||
@@ -656,7 +656,7 @@ void scst_sess_free_tgt_devs(struct scst_session *sess)
|
||||
struct scst_tgt_dev *tgt_dev, *t;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
/* The session is going down, no users, so no locks */
|
||||
for(i = 0; i < TGT_DEV_HASH_SIZE; i++) {
|
||||
struct list_head *sess_tgt_dev_list_head =
|
||||
@@ -681,22 +681,22 @@ int scst_acg_add_dev(struct scst_acg *acg, struct scst_device *dev, lun_t lun,
|
||||
struct scst_tgt_dev *tgt_dev;
|
||||
struct scst_session *sess;
|
||||
LIST_HEAD(tmp_tgt_dev_list);
|
||||
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
INIT_LIST_HEAD(&tmp_tgt_dev_list);
|
||||
|
||||
|
||||
#ifdef EXTRACHECKS
|
||||
list_for_each_entry(acg_dev, &acg->acg_dev_list, acg_dev_list_entry) {
|
||||
if (acg_dev->dev == dev) {
|
||||
PRINT_ERROR("Device is already in group %s",
|
||||
PRINT_ERROR("Device is already in group %s",
|
||||
acg->acg_name);
|
||||
res = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
acg_dev = scst_alloc_acg_dev(acg, dev, lun);
|
||||
if (acg_dev == NULL) {
|
||||
res = -ENOMEM;
|
||||
@@ -704,12 +704,12 @@ int scst_acg_add_dev(struct scst_acg *acg, struct scst_device *dev, lun_t lun,
|
||||
}
|
||||
acg_dev->rd_only_flag = read_only;
|
||||
|
||||
TRACE_DBG("Adding acg_dev %p to acg_dev_list and dev_acg_dev_list",
|
||||
TRACE_DBG("Adding acg_dev %p to acg_dev_list and dev_acg_dev_list",
|
||||
acg_dev);
|
||||
list_add_tail(&acg_dev->acg_dev_list_entry, &acg->acg_dev_list);
|
||||
list_add_tail(&acg_dev->dev_acg_dev_list_entry, &dev->dev_acg_dev_list);
|
||||
|
||||
list_for_each_entry(sess, &acg->acg_sess_list, acg_sess_list_entry)
|
||||
|
||||
list_for_each_entry(sess, &acg->acg_sess_list, acg_sess_list_entry)
|
||||
{
|
||||
tgt_dev = scst_alloc_add_tgt_dev(sess, acg_dev);
|
||||
if (tgt_dev == NULL) {
|
||||
@@ -753,16 +753,16 @@ int scst_acg_remove_dev(struct scst_acg *acg, struct scst_device *dev)
|
||||
int res = 0;
|
||||
struct scst_acg_dev *acg_dev = NULL, *a;
|
||||
struct scst_tgt_dev *tgt_dev, *tt;
|
||||
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
list_for_each_entry(a, &acg->acg_dev_list, acg_dev_list_entry) {
|
||||
if (a->dev == dev) {
|
||||
acg_dev = a;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (acg_dev == NULL) {
|
||||
PRINT_ERROR("Device is not found in group %s", acg->acg_name);
|
||||
res = -EINVAL;
|
||||
@@ -800,10 +800,10 @@ int scst_acg_add_name(struct scst_acg *acg, const char *name)
|
||||
struct scst_acn *n;
|
||||
int len;
|
||||
char *nm;
|
||||
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
list_for_each_entry(n, &acg->acn_list, acn_list_entry)
|
||||
list_for_each_entry(n, &acg->acn_list, acn_list_entry)
|
||||
{
|
||||
if (strcmp(n->name, name) == 0) {
|
||||
PRINT_ERROR("Name %s already exists in group %s",
|
||||
@@ -812,14 +812,14 @@ int scst_acg_add_name(struct scst_acg *acg, const char *name)
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
n = kmalloc(sizeof(*n), GFP_KERNEL);
|
||||
if (n == NULL) {
|
||||
PRINT_ERROR("%s", "Unable to allocate scst_acn");
|
||||
res = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
len = strlen(name);
|
||||
nm = kmalloc(len + 1, GFP_KERNEL);
|
||||
if (nm == NULL) {
|
||||
@@ -827,10 +827,10 @@ int scst_acg_add_name(struct scst_acg *acg, const char *name)
|
||||
res = -ENOMEM;
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
|
||||
strcpy(nm, name);
|
||||
n->name = nm;
|
||||
|
||||
|
||||
list_add_tail(&n->acn_list_entry, &acg->acn_list);
|
||||
|
||||
out:
|
||||
@@ -851,9 +851,9 @@ int scst_acg_remove_name(struct scst_acg *acg, const char *name)
|
||||
{
|
||||
int res = -EINVAL;
|
||||
struct scst_acn *n;
|
||||
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
list_for_each_entry(n, &acg->acn_list, acn_list_entry)
|
||||
{
|
||||
if (strcmp(n->name, name) == 0) {
|
||||
@@ -864,7 +864,7 @@ int scst_acg_remove_name(struct scst_acg *acg, const char *name)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (res == 0) {
|
||||
PRINT_INFO("Removed name %s from group %s", name,
|
||||
acg->acg_name);
|
||||
@@ -977,7 +977,7 @@ struct scst_cmd *scst_complete_request_sense(struct scst_cmd *req_cmd)
|
||||
|
||||
if (scsi_status_is_good(req_cmd->status) && (len > 0) &&
|
||||
SCST_SENSE_VALID(buf) && (!SCST_NO_SENSE(buf))) {
|
||||
PRINT_BUFF_FLAG(TRACE_SCSI, "REQUEST SENSE returned",
|
||||
PRINT_BUFF_FLAG(TRACE_SCSI, "REQUEST SENSE returned",
|
||||
buf, len);
|
||||
scst_alloc_set_sense(orig_cmd, scst_cmd_atomic(req_cmd), buf,
|
||||
len);
|
||||
@@ -1023,7 +1023,7 @@ static void scst_send_release(struct scst_device *dev)
|
||||
uint8_t cdb[6];
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
if (dev->scsi_dev == NULL)
|
||||
goto out;
|
||||
|
||||
@@ -1069,7 +1069,7 @@ static void scst_send_release(struct scst_device *dev)
|
||||
int rc, i;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
if (dev->scsi_dev == NULL)
|
||||
goto out;
|
||||
|
||||
@@ -1189,10 +1189,10 @@ struct scst_session *scst_alloc_session(struct scst_tgt *tgt, int gfp_mask,
|
||||
PRINT_ERROR("%s", "Unable to allocate sess->initiator_name");
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
|
||||
strcpy(nm, initiator_name);
|
||||
sess->initiator_name = nm;
|
||||
|
||||
|
||||
out:
|
||||
TRACE_EXIT();
|
||||
return sess;
|
||||
@@ -1261,7 +1261,7 @@ void scst_sched_session_free(struct scst_session *sess)
|
||||
TRACE_DBG("Adding sess %p to scst_sess_shut_list", sess);
|
||||
list_add_tail(&sess->sess_shut_list_entry, &scst_sess_shut_list);
|
||||
spin_unlock_irqrestore(&scst_mgmt_lock, flags);
|
||||
|
||||
|
||||
wake_up(&scst_mgmt_waitQ);
|
||||
|
||||
TRACE_EXIT();
|
||||
@@ -1418,13 +1418,13 @@ void scst_check_retries(struct scst_tgt *tgt)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
/*
|
||||
* We don't worry about overflow of finished_cmds, because we check
|
||||
* only for its change
|
||||
/*
|
||||
* We don't worry about overflow of finished_cmds, because we check
|
||||
* only for its change
|
||||
*/
|
||||
atomic_inc(&tgt->finished_cmds);
|
||||
smp_mb__after_atomic_inc();
|
||||
if (unlikely(tgt->retry_cmds > 0))
|
||||
if (unlikely(tgt->retry_cmds > 0))
|
||||
{
|
||||
struct scst_cmd *c, *tc;
|
||||
unsigned long flags;
|
||||
@@ -1447,7 +1447,7 @@ void scst_check_retries(struct scst_tgt *tgt)
|
||||
|
||||
need_wake_up++;
|
||||
if (need_wake_up >= 2) /* "slow start" */
|
||||
break;
|
||||
break;
|
||||
}
|
||||
spin_unlock_irqrestore(&tgt->tgt_lock, flags);
|
||||
}
|
||||
@@ -1789,7 +1789,7 @@ int scst_get_cdb_info(struct scst_cmd *cmd)
|
||||
while (i < SCST_CDB_TBL_SIZE && scst_scsi_op_table[i].ops == op) {
|
||||
if (scst_scsi_op_table[i].devkey[dev_type] != SCST_CDB_NOTSUPP) {
|
||||
ptr = &scst_scsi_op_table[i];
|
||||
TRACE_DBG("op = 0x%02x+'%c%c%c%c%c%c%c%c%c%c'+<%s>",
|
||||
TRACE_DBG("op = 0x%02x+'%c%c%c%c%c%c%c%c%c%c'+<%s>",
|
||||
ptr->ops, ptr->devkey[0], /* disk */
|
||||
ptr->devkey[1], /* tape */
|
||||
ptr->devkey[2], /* printer */
|
||||
@@ -1854,7 +1854,7 @@ lun_t scst_unpack_lun(const uint8_t *lun, int len)
|
||||
if (len > 2) {
|
||||
switch(len) {
|
||||
case 8:
|
||||
if ((*((uint64_t*)lun) &
|
||||
if ((*((uint64_t*)lun) &
|
||||
__constant_cpu_to_be64(0x0000FFFFFFFFFFFFLL)) != 0)
|
||||
goto out_err;
|
||||
break;
|
||||
@@ -1941,7 +1941,7 @@ int scst_calc_block_shift(int sector_size)
|
||||
if (block_shift < 9) {
|
||||
PRINT_ERROR("Wrong sector size %d", sector_size);
|
||||
block_shift = -1;
|
||||
}
|
||||
}
|
||||
|
||||
TRACE_EXIT_RES(block_shift);
|
||||
return block_shift;
|
||||
@@ -1953,7 +1953,7 @@ int scst_sbc_generic_parse(struct scst_cmd *cmd,
|
||||
int res = 0;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
/*
|
||||
* SCST sets good defaults for cmd->data_direction and cmd->bufflen,
|
||||
* therefore change them only if necessary
|
||||
@@ -1986,7 +1986,7 @@ int scst_sbc_generic_parse(struct scst_cmd *cmd,
|
||||
}
|
||||
|
||||
if (cmd->op_flags & SCST_TRANSFER_LEN_TYPE_FIXED) {
|
||||
/*
|
||||
/*
|
||||
* No need for locks here, since *_detach() can not be
|
||||
* called, when there are existing commands.
|
||||
*/
|
||||
@@ -2242,7 +2242,7 @@ int scst_tape_generic_dev_done(struct scst_cmd *cmd,
|
||||
* based on cmd->status and cmd->data_direction, therefore change
|
||||
* them only if necessary
|
||||
*/
|
||||
|
||||
|
||||
switch (opcode) {
|
||||
case MODE_SENSE:
|
||||
case MODE_SELECT:
|
||||
@@ -2278,7 +2278,7 @@ int scst_tape_generic_dev_done(struct scst_cmd *cmd,
|
||||
/* It's all good */
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
switch (opcode) {
|
||||
case MODE_SENSE:
|
||||
case MODE_SELECT:
|
||||
@@ -2334,7 +2334,7 @@ int scst_obtain_device_parameters(struct scst_device *dev)
|
||||
memset(sense_buffer, 0, sizeof(sense_buffer));
|
||||
|
||||
TRACE(TRACE_SCSI, "%s", "Doing internal MODE_SENSE");
|
||||
res = scsi_execute(dev->scsi_dev, cmd, SCST_DATA_READ, buffer,
|
||||
res = scsi_execute(dev->scsi_dev, cmd, SCST_DATA_READ, buffer,
|
||||
sizeof(buffer), sense_buffer, SCST_DEFAULT_TIMEOUT,
|
||||
0, 0);
|
||||
|
||||
@@ -2450,7 +2450,7 @@ void scst_process_reset(struct scst_device *dev,
|
||||
dev->dev_double_ua_possible = 1;
|
||||
dev->dev_serialized = 1;
|
||||
|
||||
list_for_each_entry(tgt_dev, &dev->dev_tgt_dev_list,
|
||||
list_for_each_entry(tgt_dev, &dev->dev_tgt_dev_list,
|
||||
dev_tgt_dev_list_entry) {
|
||||
struct scst_session *sess = tgt_dev->sess;
|
||||
|
||||
@@ -2461,12 +2461,12 @@ void scst_process_reset(struct scst_device *dev,
|
||||
spin_lock_irq(&sess->sess_list_lock);
|
||||
|
||||
TRACE_DBG("Searching in search cmd list (sess=%p)", sess);
|
||||
list_for_each_entry(cmd, &sess->search_cmd_list,
|
||||
list_for_each_entry(cmd, &sess->search_cmd_list,
|
||||
search_cmd_list_entry) {
|
||||
if (cmd == exclude_cmd)
|
||||
continue;
|
||||
if ((cmd->tgt_dev == tgt_dev) ||
|
||||
((cmd->tgt_dev == NULL) &&
|
||||
((cmd->tgt_dev == NULL) &&
|
||||
(cmd->lun == tgt_dev->lun))) {
|
||||
scst_abort_cmd(cmd, mcmd,
|
||||
(tgt_dev->sess != originator), 0);
|
||||
@@ -2626,7 +2626,7 @@ void scst_dev_check_set_local_UA(struct scst_device *dev,
|
||||
if (exclude != NULL)
|
||||
exclude_tgt_dev = exclude->tgt_dev;
|
||||
|
||||
list_for_each_entry(tgt_dev, &dev->dev_tgt_dev_list,
|
||||
list_for_each_entry(tgt_dev, &dev->dev_tgt_dev_list,
|
||||
dev_tgt_dev_list_entry) {
|
||||
if (tgt_dev != exclude_tgt_dev)
|
||||
scst_check_set_UA(tgt_dev, sense, sense_len, 0);
|
||||
@@ -2663,7 +2663,7 @@ void scst_free_all_UA(struct scst_tgt_dev *tgt_dev)
|
||||
TRACE_ENTRY();
|
||||
|
||||
list_for_each_entry_safe(UA_entry, t, &tgt_dev->UA_list, UA_list_entry) {
|
||||
TRACE_MGMT_DBG("Clearing UA for tgt_dev lun %Ld",
|
||||
TRACE_MGMT_DBG("Clearing UA for tgt_dev lun %Ld",
|
||||
tgt_dev->lun);
|
||||
list_del(&UA_entry->UA_list_entry);
|
||||
kfree(UA_entry);
|
||||
@@ -2718,7 +2718,7 @@ restart:
|
||||
SCST_CMD_QUEUE_HEAD_OF_QUEUE);
|
||||
if (cmd->sn == expected_sn) {
|
||||
atomic_t *slot = cmd->sn_slot;
|
||||
/*
|
||||
/*
|
||||
* !! At this point any pointer in cmd, except !!
|
||||
* !! sn_slot and sn_cmd_list_entry, could be !!
|
||||
* !! already destroyed !!
|
||||
@@ -2728,7 +2728,7 @@ restart:
|
||||
tgt_dev->def_cmd_count--;
|
||||
list_del(&cmd->sn_cmd_list_entry);
|
||||
spin_unlock_irq(&tgt_dev->sn_lock);
|
||||
if (test_and_set_bit(SCST_CMD_CAN_BE_DESTROYED,
|
||||
if (test_and_set_bit(SCST_CMD_CAN_BE_DESTROYED,
|
||||
&cmd->cmd_flags)) {
|
||||
scst_destroy_put_cmd(cmd);
|
||||
}
|
||||
@@ -2827,7 +2827,7 @@ void scst_block_dev(struct scst_device *dev, int outstanding)
|
||||
|
||||
TRACE_MGMT_DBG("Waiting during blocking outstanding %d (on_dev_count "
|
||||
"%d)", outstanding, atomic_read(&dev->on_dev_count));
|
||||
wait_event(dev->on_dev_waitQ,
|
||||
wait_event(dev->on_dev_waitQ,
|
||||
atomic_read(&dev->on_dev_count) <= outstanding);
|
||||
TRACE_MGMT_DBG("%s", "wait_event() returned");
|
||||
}
|
||||
@@ -2957,7 +2957,7 @@ void scst_unblock_cmds(struct scst_device *dev)
|
||||
list_for_each_entry_safe(cmd, t, &dev->blocked_cmd_list,
|
||||
blocked_cmd_list_entry) {
|
||||
int brk = 0;
|
||||
/*
|
||||
/*
|
||||
* Since only one cmd per time is being executed, expected_sn
|
||||
* can't change behind us, if the corresponding cmd is in
|
||||
* blocked_cmd_list, but we could be called before
|
||||
@@ -2973,7 +2973,7 @@ void scst_unblock_cmds(struct scst_device *dev)
|
||||
else if (cmd->sn != (expected_sn+1))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
list_del(&cmd->blocked_cmd_list_entry);
|
||||
TRACE_MGMT_DBG("Adding cmd %p to head of active cmd list", cmd);
|
||||
spin_lock(&cmd->cmd_lists->cmd_list_lock);
|
||||
@@ -3096,7 +3096,7 @@ void scst_xmit_process_aborted_cmd(struct scst_cmd *cmd)
|
||||
/* It's completed and it's OK to return its result */
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
if (cmd->dev->tas) {
|
||||
TRACE_MGMT_DBG("Flag ABORTED OTHER set for cmd %p "
|
||||
"(tag %llu), returning TASK ABORTED ", cmd,
|
||||
@@ -3204,7 +3204,7 @@ void tm_dbg_init_tgt_dev(struct scst_tgt_dev *tgt_dev,
|
||||
unsigned long flags;
|
||||
/* Do TM debugging only for LUN 0 */
|
||||
spin_lock_irqsave(&scst_tm_dbg_lock, flags);
|
||||
tm_dbg_p_cmd_list_waitQ =
|
||||
tm_dbg_p_cmd_list_waitQ =
|
||||
&tgt_dev->dev->p_cmd_lists->cmd_list_waitQ;
|
||||
tm_dbg_state = INIT_TM_DBG_STATE;
|
||||
tm_dbg_on_state_passes =
|
||||
@@ -3288,7 +3288,7 @@ void tm_dbg_check_released_cmds(void)
|
||||
if (tm_dbg_flags.tm_dbg_release) {
|
||||
struct scst_cmd *cmd, *tc;
|
||||
spin_lock_irq(&scst_tm_dbg_lock);
|
||||
list_for_each_entry_safe_reverse(cmd, tc,
|
||||
list_for_each_entry_safe_reverse(cmd, tc,
|
||||
&tm_dbg_delayed_cmd_list, cmd_list_entry) {
|
||||
TRACE_MGMT_DBG("Releasing timed cmd %p (tag %llu), "
|
||||
"delayed_cmds_count=%d", cmd, cmd->tag,
|
||||
@@ -3336,7 +3336,7 @@ static void tm_dbg_change_state(void)
|
||||
tm_dbg_on_state_passes =
|
||||
tm_dbg_on_state_num_passes[tm_dbg_state];
|
||||
}
|
||||
|
||||
|
||||
TRACE_MGMT_DBG("%s", "Deleting timer");
|
||||
del_timer(&tm_dbg_timer);
|
||||
}
|
||||
@@ -3404,7 +3404,7 @@ void tm_dbg_release_cmd(struct scst_cmd *cmd)
|
||||
}
|
||||
|
||||
spin_lock(&cmd->cmd_lists->cmd_list_lock);
|
||||
list_move(&c->cmd_list_entry,
|
||||
list_move(&c->cmd_list_entry,
|
||||
&c->cmd_lists->active_cmd_list);
|
||||
wake_up(&c->cmd_lists->cmd_list_waitQ);
|
||||
spin_unlock(&cmd->cmd_lists->cmd_list_lock);
|
||||
|
||||
+39
-39
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* scst_main.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -133,7 +133,7 @@ static int suspend_count;
|
||||
|
||||
static int scst_virt_dev_last_id; /* protected by scst_mutex */
|
||||
|
||||
/*
|
||||
/*
|
||||
* This buffer and lock are intended to avoid memory allocation, which
|
||||
* could fail in improper places.
|
||||
*/
|
||||
@@ -147,7 +147,7 @@ module_param_named(scst_max_cmd_mem, scst_max_cmd_mem, long, 0);
|
||||
MODULE_PARM_DESC(scst_max_cmd_mem, "Maximum memory allowed to be consumed by "
|
||||
"the SCST commands at any given time in MB");
|
||||
|
||||
struct scst_dev_type scst_null_devtype =
|
||||
struct scst_dev_type scst_null_devtype =
|
||||
{
|
||||
name: "none",
|
||||
};
|
||||
@@ -175,7 +175,7 @@ int __scst_register_target_template(struct scst_tgt_template *vtt,
|
||||
res = -EINVAL;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
|
||||
if (!vtt->release) {
|
||||
PRINT_ERROR("Target driver %s doesn't have a "
|
||||
"release() method.", vtt->name);
|
||||
@@ -539,14 +539,14 @@ out_up:
|
||||
|
||||
if (res == 0) {
|
||||
PRINT_INFO("Attached SCSI target mid-level at "
|
||||
"scsi%d, channel %d, id %d, lun %d, type %d",
|
||||
scsidp->host->host_no, scsidp->channel, scsidp->id,
|
||||
"scsi%d, channel %d, id %d, lun %d, type %d",
|
||||
scsidp->host->host_no, scsidp->channel, scsidp->id,
|
||||
scsidp->lun, scsidp->type);
|
||||
}
|
||||
}
|
||||
else {
|
||||
PRINT_ERROR("Failed to attach SCSI target mid-level "
|
||||
"at scsi%d, channel %d, id %d, lun %d, type %d",
|
||||
scsidp->host->host_no, scsidp->channel, scsidp->id,
|
||||
"at scsi%d, channel %d, id %d, lun %d, type %d",
|
||||
scsidp->host->host_no, scsidp->channel, scsidp->id,
|
||||
scsidp->lun, scsidp->type);
|
||||
}
|
||||
|
||||
@@ -568,7 +568,7 @@ static void scst_unregister_device(struct scsi_device *scsidp)
|
||||
struct scst_acg_dev *acg_dev, *aa;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
scst_suspend_activity();
|
||||
mutex_lock(&scst_mutex);
|
||||
|
||||
@@ -585,9 +585,9 @@ static void scst_unregister_device(struct scsi_device *scsidp)
|
||||
}
|
||||
|
||||
list_del(&dev->dev_list_entry);
|
||||
|
||||
|
||||
list_for_each_entry_safe(acg_dev, aa, &dev->dev_acg_dev_list,
|
||||
dev_acg_dev_list_entry)
|
||||
dev_acg_dev_list_entry)
|
||||
{
|
||||
scst_acg_remove_dev(acg_dev->acg, dev);
|
||||
}
|
||||
@@ -636,21 +636,21 @@ out:
|
||||
return res;
|
||||
}
|
||||
|
||||
int scst_register_virtual_device(struct scst_dev_type *dev_handler,
|
||||
int scst_register_virtual_device(struct scst_dev_type *dev_handler,
|
||||
const char *dev_name)
|
||||
{
|
||||
int res, rc;
|
||||
struct scst_device *dev = NULL;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
if (dev_handler == NULL) {
|
||||
PRINT_ERROR("%s: valid device handler must be supplied",
|
||||
PRINT_ERROR("%s: valid device handler must be supplied",
|
||||
__FUNCTION__);
|
||||
res = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
if (dev_name == NULL) {
|
||||
PRINT_ERROR("%s: device name must be non-NULL", __FUNCTION__);
|
||||
res = -EINVAL;
|
||||
@@ -696,7 +696,7 @@ out:
|
||||
if (res > 0) {
|
||||
PRINT_INFO("Attached SCSI target mid-level to virtual "
|
||||
"device %s (id %d)", dev_name, dev->virt_id);
|
||||
}
|
||||
}
|
||||
else {
|
||||
PRINT_INFO("Failed to attach SCSI target mid-level to "
|
||||
"virtual device %s", dev_name);
|
||||
@@ -734,9 +734,9 @@ void scst_unregister_virtual_device(int id)
|
||||
}
|
||||
|
||||
list_del(&dev->dev_list_entry);
|
||||
|
||||
|
||||
list_for_each_entry_safe(acg_dev, aa, &dev->dev_acg_dev_list,
|
||||
dev_acg_dev_list_entry)
|
||||
dev_acg_dev_list_entry)
|
||||
{
|
||||
scst_acg_remove_dev(acg_dev->acg, dev);
|
||||
}
|
||||
@@ -1068,22 +1068,22 @@ out:
|
||||
}
|
||||
|
||||
/* The activity supposed to be suspended and scst_mutex held */
|
||||
int scst_assign_dev_handler(struct scst_device *dev,
|
||||
int scst_assign_dev_handler(struct scst_device *dev,
|
||||
struct scst_dev_type *handler)
|
||||
{
|
||||
int res = 0;
|
||||
struct scst_tgt_dev *tgt_dev;
|
||||
LIST_HEAD(attached_tgt_devs);
|
||||
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
sBUG_ON(handler == NULL);
|
||||
|
||||
|
||||
if (dev->handler == handler)
|
||||
goto out;
|
||||
|
||||
|
||||
if (dev->handler && dev->handler->detach_tgt) {
|
||||
list_for_each_entry(tgt_dev, &dev->dev_tgt_dev_list,
|
||||
list_for_each_entry(tgt_dev, &dev->dev_tgt_dev_list,
|
||||
dev_tgt_dev_list_entry) {
|
||||
TRACE_DBG("Calling dev handler's detach_tgt(%p)",
|
||||
tgt_dev);
|
||||
@@ -1118,9 +1118,9 @@ int scst_assign_dev_handler(struct scst_device *dev,
|
||||
}
|
||||
goto out_thr_null;
|
||||
}
|
||||
|
||||
|
||||
if (handler && handler->attach_tgt) {
|
||||
list_for_each_entry(tgt_dev, &dev->dev_tgt_dev_list,
|
||||
list_for_each_entry(tgt_dev, &dev->dev_tgt_dev_list,
|
||||
dev_tgt_dev_list_entry) {
|
||||
TRACE_DBG("Calling dev handler's attach_tgt(%p)",
|
||||
tgt_dev);
|
||||
@@ -1143,7 +1143,7 @@ out_thr_null:
|
||||
out_null:
|
||||
if (res != 0)
|
||||
dev->handler = &scst_null_devtype;
|
||||
|
||||
|
||||
out:
|
||||
TRACE_EXIT_RES(res);
|
||||
return res;
|
||||
@@ -1151,7 +1151,7 @@ out:
|
||||
out_err_detach_tgt:
|
||||
if (handler && handler->detach_tgt) {
|
||||
list_for_each_entry(tgt_dev, &attached_tgt_devs,
|
||||
extra_tgt_dev_list_entry)
|
||||
extra_tgt_dev_list_entry)
|
||||
{
|
||||
TRACE_DBG("Calling handler's detach_tgt(%p)",
|
||||
tgt_dev);
|
||||
@@ -1224,7 +1224,7 @@ int __scst_add_cmd_threads(int num)
|
||||
{
|
||||
int res = 0, i;
|
||||
static int scst_thread_num = 0;
|
||||
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
@@ -1311,7 +1311,7 @@ static int scst_start_all_threads(int num)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
mutex_lock(&scst_threads_info.cmd_threads_mutex);
|
||||
mutex_lock(&scst_threads_info.cmd_threads_mutex);
|
||||
res = __scst_add_cmd_threads(num);
|
||||
if (res < 0)
|
||||
goto out;
|
||||
@@ -1346,7 +1346,7 @@ static int scst_start_all_threads(int num)
|
||||
out:
|
||||
mutex_unlock(&scst_threads_info.cmd_threads_mutex);
|
||||
TRACE_EXIT_RES(res);
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
|
||||
void scst_get(void)
|
||||
@@ -1369,7 +1369,7 @@ static int scst_add(struct class_device *cdev, struct class_interface *intf)
|
||||
int res = 0;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
scsidp = to_scsi_device(cdev->dev);
|
||||
res = scst_register_device(scsidp);
|
||||
|
||||
@@ -1538,10 +1538,10 @@ static int __init init_scst(void)
|
||||
scst_num_cpus = num_online_cpus();
|
||||
|
||||
/* ToDo: register_cpu_notifier() */
|
||||
|
||||
|
||||
if (scst_threads == 0)
|
||||
scst_threads = scst_num_cpus;
|
||||
|
||||
|
||||
if (scst_threads < 1) {
|
||||
PRINT_ERROR("%s", "scst_threads can not be less than 1");
|
||||
scst_threads = scst_num_cpus;
|
||||
@@ -1555,7 +1555,7 @@ static int __init init_scst(void)
|
||||
sizeof(struct s)); \
|
||||
if (p == NULL) { res = -ENOMEM; goto o; } \
|
||||
} while (0)
|
||||
|
||||
|
||||
INIT_CACHEP(scst_mgmt_cachep, scst_mgmt_cmd, out);
|
||||
INIT_CACHEP(scst_mgmt_stub_cachep, scst_mgmt_cmd_stub,
|
||||
out_destroy_mgmt_cache);
|
||||
@@ -1620,7 +1620,7 @@ static int __init init_scst(void)
|
||||
res = -ENOMEM;
|
||||
goto out_destroy_sgv_pool;
|
||||
}
|
||||
|
||||
|
||||
res = scsi_register_interface(&scst_interface);
|
||||
if (res != 0)
|
||||
goto out_free_acg;
|
||||
@@ -1712,7 +1712,7 @@ static void __exit exit_scst(void)
|
||||
DECLARE_MUTEX_LOCKED(shm);
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
/* ToDo: unregister_cpu_notifier() */
|
||||
|
||||
scst_proc_cleanup_module();
|
||||
|
||||
+42
-42
@@ -1,15 +1,15 @@
|
||||
/*
|
||||
* scst_mem.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2006-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* Copyright (C) 2007 Krzysztof Blaszkowski <kb@sysmikro.com.pl>
|
||||
* 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
|
||||
@@ -97,7 +97,7 @@ static int scst_check_clustering(struct scatterlist *sg, int cur, int hint)
|
||||
pfn = page_to_pfn(sg_page(&sg[i]));
|
||||
pfn_next = pfn + (sg[i].length >> PAGE_SHIFT);
|
||||
full_page = (sg[i].length & (PAGE_SIZE - 1)) == 0;
|
||||
|
||||
|
||||
if ((pfn == pfn_cur_next) && full_page_cur)
|
||||
goto out_head;
|
||||
|
||||
@@ -110,7 +110,7 @@ static int scst_check_clustering(struct scatterlist *sg, int cur, int hint)
|
||||
pfn = page_to_pfn(sg_page(&sg[i]));
|
||||
pfn_next = pfn + (sg[i].length >> PAGE_SHIFT);
|
||||
full_page = (sg[i].length & (PAGE_SIZE - 1)) == 0;
|
||||
|
||||
|
||||
if ((pfn == pfn_cur_next) && full_page_cur)
|
||||
goto out_head;
|
||||
|
||||
@@ -150,13 +150,13 @@ static void scst_free_sys_sg_entries(struct scatterlist *sg, int sg_count,
|
||||
int pages =
|
||||
(len >> PAGE_SHIFT) + ((len & ~PAGE_MASK) != 0);
|
||||
|
||||
TRACE_MEM("page %lx, len %d, pages %d",
|
||||
TRACE_MEM("page %lx, len %d, pages %d",
|
||||
(unsigned long)p, len, pages);
|
||||
|
||||
while(pages > 0) {
|
||||
int order = 0;
|
||||
|
||||
/*
|
||||
/*
|
||||
* __free_pages() doesn't like freeing pages with not that order with
|
||||
* which they were allocated, so disable this small optimization.
|
||||
*/
|
||||
@@ -321,7 +321,7 @@ static void sgv_dtor_and_free(struct sgv_pool_obj *obj)
|
||||
}
|
||||
kfree(obj->sg_entries);
|
||||
}
|
||||
|
||||
|
||||
kmem_cache_free(obj->owner_pool->caches[obj->order], obj);
|
||||
return;
|
||||
}
|
||||
@@ -363,7 +363,7 @@ static struct sgv_pool_obj *sgv_pool_cached_get(struct sgv_pool *pool,
|
||||
}
|
||||
|
||||
out:
|
||||
return obj;
|
||||
return obj;
|
||||
}
|
||||
|
||||
static void sgv_pool_cached_put(struct sgv_pool_obj *sgv)
|
||||
@@ -400,13 +400,13 @@ static void sgv_pool_cached_put(struct sgv_pool_obj *sgv)
|
||||
&sgv_pools_mgr.mgr.sorted_recycling_list);
|
||||
|
||||
sgv->recycle_entry.time_stamp = jiffies;
|
||||
|
||||
|
||||
sgv_pools_mgr.mgr.thr.inactive_pages_total += 1 << sgv->order;
|
||||
if (!sgv_pools_mgr.mgr.pitbool_running) {
|
||||
sgv_pools_mgr.mgr.pitbool_running = 1;
|
||||
sched = 1;
|
||||
}
|
||||
|
||||
|
||||
spin_unlock_bh(&sgv_pools_mgr.mgr.pool_mgr_lock);
|
||||
|
||||
if (sched)
|
||||
@@ -579,11 +579,11 @@ struct scatterlist *sgv_pool_alloc(struct sgv_pool *pool, unsigned int size,
|
||||
order, gfp_mask) != 0))
|
||||
goto out_fail_free;
|
||||
}
|
||||
|
||||
if ((flags & SCST_POOL_NO_ALLOC_ON_CACHE_MISS) &&
|
||||
|
||||
if ((flags & SCST_POOL_NO_ALLOC_ON_CACHE_MISS) &&
|
||||
(flags & SCST_POOL_RETURN_OBJ_ON_ALLOC_FAIL))
|
||||
goto out_return;
|
||||
|
||||
|
||||
obj->allocator_priv = priv;
|
||||
if (sgv_pool_hiwmk_check(pages_to_alloc, no_fail) != 0)
|
||||
goto out_fail_free_sg_entries;
|
||||
@@ -607,10 +607,10 @@ struct scatterlist *sgv_pool_alloc(struct sgv_pool *pool, unsigned int size,
|
||||
|
||||
obj->sg_entries = obj->sg_entries_data;
|
||||
sg_init_table(obj->sg_entries, pages);
|
||||
|
||||
|
||||
if (sgv_pool_hiwmk_check(pages_to_alloc, no_fail) != 0)
|
||||
goto out_fail_free_sg_entries;
|
||||
TRACE_MEM("Big or no_cached sgv_obj %p (size %d)", obj, sz);
|
||||
TRACE_MEM("Big or no_cached sgv_obj %p (size %d)", obj, sz);
|
||||
}
|
||||
|
||||
obj->sg_count = scst_alloc_sg_entries(obj->sg_entries,
|
||||
@@ -655,7 +655,7 @@ success:
|
||||
obj->orig_sg = sg;
|
||||
obj->orig_length = obj->sg_entries[sg].length;
|
||||
if (pool->clustered) {
|
||||
obj->sg_entries[sg].length =
|
||||
obj->sg_entries[sg].length =
|
||||
(pages - obj->trans_tbl[sg].pg_count) << PAGE_SHIFT;
|
||||
}
|
||||
} else {
|
||||
@@ -727,7 +727,7 @@ void *sgv_get_priv(struct sgv_pool_obj *sgv)
|
||||
void sgv_pool_free(struct sgv_pool_obj *sgv)
|
||||
{
|
||||
int order = sgv->order, pages;
|
||||
|
||||
|
||||
TRACE_MEM("Freeing sgv_obj %p, order %d, sg_entries %p, "
|
||||
"sg_count %d, allocator_priv %p", sgv, order,
|
||||
sgv->sg_entries, sgv->sg_count, sgv->allocator_priv);
|
||||
@@ -849,17 +849,17 @@ int sgv_pool_init(struct sgv_pool *pool, const char *name, int clustered)
|
||||
atomic_set(&pool->cache_acc[i].merged, 0);
|
||||
|
||||
if (i <= sgv_pools_mgr.sgv_max_local_order) {
|
||||
size = sizeof(*obj) + (1 << i) *
|
||||
size = sizeof(*obj) + (1 << i) *
|
||||
(sizeof(obj->sg_entries[0]) +
|
||||
(clustered ? sizeof(obj->trans_tbl[0]) : 0));
|
||||
} else if (i <= sgv_pools_mgr.sgv_max_trans_order) {
|
||||
/* sgv ie sg_entries is allocated outside object but ttbl
|
||||
/* sgv ie sg_entries is allocated outside object but ttbl
|
||||
is embedded still */
|
||||
size = sizeof(*obj) + (1 << i) *
|
||||
((clustered ? sizeof(obj->trans_tbl[0]) : 0));
|
||||
size = sizeof(*obj) + (1 << i) *
|
||||
((clustered ? sizeof(obj->trans_tbl[0]) : 0));
|
||||
} else {
|
||||
size = sizeof(*obj);
|
||||
|
||||
|
||||
/* both sgv and ttbl are kallocated() */
|
||||
}
|
||||
|
||||
@@ -867,7 +867,7 @@ int sgv_pool_init(struct sgv_pool *pool, const char *name, int clustered)
|
||||
|
||||
scnprintf(pool->cache_names[i], sizeof(pool->cache_names[i]),
|
||||
"%s-%luK", name, (PAGE_SIZE >> 10) << i);
|
||||
pool->caches[i] = kmem_cache_create(pool->cache_names[i],
|
||||
pool->caches[i] = kmem_cache_create(pool->cache_names[i],
|
||||
size, 0, SCST_SLAB_FLAGS, NULL
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23))
|
||||
, NULL);
|
||||
@@ -921,11 +921,11 @@ static void sgv_pool_evaluate_local_order(struct scst_sgv_pools_manager *pmgr)
|
||||
TRACE_MEM("sgv_max_local_order %d, sgv_max_trans_order %d",
|
||||
pmgr->sgv_max_local_order, pmgr->sgv_max_trans_order);
|
||||
TRACE_MEM("max object size with embedded sgv & ttbl %zd",
|
||||
(1 << pmgr->sgv_max_local_order) *
|
||||
(1 << pmgr->sgv_max_local_order) *
|
||||
(sizeof(struct trans_tbl_ent) + sizeof(struct scatterlist))
|
||||
+ sizeof(struct sgv_pool_obj));
|
||||
TRACE_MEM("max object size with embedded sgv (!clustered) %zd",
|
||||
(1 << pmgr->sgv_max_local_order) *
|
||||
(1 << pmgr->sgv_max_local_order) *
|
||||
(sizeof(struct scatterlist))
|
||||
+ sizeof(struct sgv_pool_obj));
|
||||
TRACE_MEM("max object size with embedded ttbl %zd",
|
||||
@@ -945,13 +945,13 @@ void sgv_pool_deinit(struct sgv_pool *pool)
|
||||
|
||||
for(i = 0; i < SGV_POOL_ELEMENTS; i++) {
|
||||
struct sgv_pool_obj *e;
|
||||
|
||||
spin_lock_bh(&sgv_pools_mgr.mgr.pool_mgr_lock);
|
||||
|
||||
spin_lock_bh(&sgv_pools_mgr.mgr.pool_mgr_lock);
|
||||
while(!list_empty(&pool->recycling_lists[i])) {
|
||||
e = list_entry(pool->recycling_lists[i].next,
|
||||
struct sgv_pool_obj,
|
||||
recycle_entry.recycling_list_entry);
|
||||
|
||||
|
||||
__sgv_pool_cached_purge(e);
|
||||
spin_unlock_bh(&sgv_pools_mgr.mgr.pool_mgr_lock);
|
||||
|
||||
@@ -961,7 +961,7 @@ void sgv_pool_deinit(struct sgv_pool *pool)
|
||||
spin_lock_bh(&sgv_pools_mgr.mgr.pool_mgr_lock);
|
||||
}
|
||||
spin_unlock_bh(&sgv_pools_mgr.mgr.pool_mgr_lock);
|
||||
|
||||
|
||||
if (pool->caches[i])
|
||||
kmem_cache_destroy(pool->caches[i]);
|
||||
pool->caches[i] = NULL;
|
||||
@@ -1021,11 +1021,11 @@ static int sgv_pool_cached_shrinker(int nr, gfp_t gfpm)
|
||||
TRACE_ENTRY();
|
||||
|
||||
spin_lock_bh(&sgv_pools_mgr.mgr.pool_mgr_lock);
|
||||
|
||||
|
||||
if (nr > 0) {
|
||||
struct sgv_pool_obj *e;
|
||||
unsigned long rt = jiffies;
|
||||
|
||||
|
||||
while(!list_empty(&sgv_pools_mgr.mgr.sorted_recycling_list)) {
|
||||
e = list_entry(
|
||||
sgv_pools_mgr.mgr.sorted_recycling_list.next,
|
||||
@@ -1037,14 +1037,14 @@ static int sgv_pool_cached_shrinker(int nr, gfp_t gfpm)
|
||||
spin_unlock_bh(&sgv_pools_mgr.mgr.pool_mgr_lock);
|
||||
sgv_dtor_and_free(e);
|
||||
spin_lock_bh(&sgv_pools_mgr.mgr.pool_mgr_lock);
|
||||
} else
|
||||
} else
|
||||
break;
|
||||
|
||||
if (nr <= 0)
|
||||
|
||||
if (nr <= 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nr = sgv_pools_mgr.mgr.thr.inactive_pages_total;
|
||||
|
||||
spin_unlock_bh(&sgv_pools_mgr.mgr.pool_mgr_lock);
|
||||
@@ -1074,19 +1074,19 @@ static void sgv_pool_cached_pitbool(void *p)
|
||||
spin_unlock_bh(&sgv_pools_mgr.mgr.pool_mgr_lock);
|
||||
sgv_dtor_and_free(e);
|
||||
spin_lock_bh(&sgv_pools_mgr.mgr.pool_mgr_lock);
|
||||
} else
|
||||
} else
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
total_pages = sgv_pools_mgr.mgr.thr.inactive_pages_total;
|
||||
|
||||
spin_unlock_bh(&sgv_pools_mgr.mgr.pool_mgr_lock);
|
||||
|
||||
|
||||
if (total_pages) {
|
||||
schedule_delayed_work(&sgv_pools_mgr.mgr.apit_pool,
|
||||
PURGE_INTERVAL);
|
||||
}
|
||||
|
||||
|
||||
TRACE_EXIT();
|
||||
return;
|
||||
}
|
||||
@@ -1110,7 +1110,7 @@ int scst_sgv_pools_init(unsigned long mem_hwmark, unsigned long mem_lwmark)
|
||||
atomic_set(&pools->sgv_other_total_alloc, 0);
|
||||
INIT_LIST_HEAD(&pools->scst_sgv_pool_list);
|
||||
mutex_init(&pools->scst_sgv_pool_mutex);
|
||||
|
||||
|
||||
INIT_LIST_HEAD(&pools->mgr.sorted_recycling_list);
|
||||
spin_lock_init(&pools->mgr.pool_mgr_lock);
|
||||
|
||||
@@ -1196,7 +1196,7 @@ static void scst_do_sgv_read(struct seq_file *seq, const struct sgv_pool *pool)
|
||||
{
|
||||
int i, total = 0, hit = 0, merged = 0, allocated = 0;
|
||||
int oa, om;
|
||||
|
||||
|
||||
for(i = 0; i < SGV_POOL_ELEMENTS; i++) {
|
||||
int t;
|
||||
|
||||
|
||||
+13
-13
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* scst_mem.h
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2006-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#define SGV_POOL_ELEMENTS 11
|
||||
|
||||
/*
|
||||
/*
|
||||
* sg_num is indexed by the page number, pg_count is indexed by the sg number.
|
||||
* Made in one entry to simplify the code (eg all sizeof(*) parts) and save
|
||||
* some CPU cache for non-clustered case.
|
||||
@@ -33,7 +33,7 @@ struct trans_tbl_ent {
|
||||
struct sgv_pool_obj
|
||||
{
|
||||
int order;
|
||||
|
||||
|
||||
struct {
|
||||
unsigned long time_stamp; /* jiffies, protected by pool_mgr_lock */
|
||||
struct list_head recycling_list_entry;
|
||||
@@ -102,25 +102,25 @@ struct scst_sgv_pools_manager
|
||||
struct sgv_pool_mgr {
|
||||
spinlock_t pool_mgr_lock;
|
||||
struct list_head sorted_recycling_list; /* protected by pool_mgr_lock */
|
||||
int pitbool_running:1; /* protected by pool_mgr_lock */
|
||||
int pitbool_running:1; /* protected by pool_mgr_lock */
|
||||
|
||||
struct sgv_mem_throttling {
|
||||
u32 inactive_pages_total;
|
||||
u32 inactive_pages_total;
|
||||
atomic_t active_pages_total;
|
||||
|
||||
|
||||
u32 hi_wmk; /* compared against inactive_pages_total + active_pages_total */
|
||||
u32 lo_wmk; /* compared against inactive_pages_total only */
|
||||
|
||||
|
||||
u32 releases_on_hiwmk;
|
||||
u32 releases_failed;
|
||||
} thr; /* protected by pool_mgr_lock */
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23))
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23))
|
||||
struct shrinker *sgv_shrinker;
|
||||
#else
|
||||
struct shrinker sgv_shrinker;
|
||||
#endif
|
||||
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
|
||||
struct delayed_work apit_pool;
|
||||
#else
|
||||
@@ -129,13 +129,13 @@ struct scst_sgv_pools_manager
|
||||
} mgr;
|
||||
|
||||
int sgv_max_local_order, sgv_max_trans_order;
|
||||
|
||||
|
||||
atomic_t sgv_other_total_alloc;
|
||||
struct mutex scst_sgv_pool_mutex;
|
||||
struct list_head scst_sgv_pool_list;
|
||||
};
|
||||
|
||||
int sgv_pool_init(struct sgv_pool *pool, const char *name,
|
||||
int sgv_pool_init(struct sgv_pool *pool, const char *name,
|
||||
int clustered);
|
||||
void sgv_pool_deinit(struct sgv_pool *pool);
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* scst_module.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
* Support for loading target modules. The usage is similar to scsi_module.c
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -27,7 +27,7 @@ static int __init init_this_scst_driver(void)
|
||||
int res;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
res = scst_register_target_template(&driver_target_template);
|
||||
TRACE_DBG("scst_register_target_template() returned %d", res);
|
||||
if (res < 0)
|
||||
@@ -59,7 +59,7 @@ static void __exit exit_this_scst_driver(void)
|
||||
#endif
|
||||
|
||||
scst_unregister_target_template(&driver_target_template);
|
||||
|
||||
|
||||
TRACE_EXIT();
|
||||
return;
|
||||
}
|
||||
|
||||
+16
-16
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* scst_priv.h
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -39,7 +39,7 @@
|
||||
#define TRACE_RTRY 0x80000000
|
||||
#define TRACE_SCSI_SERIALIZING 0x40000000
|
||||
#define TRACE_SND_TOP 0x20000000 /** top being the edge away from the interupt */
|
||||
#define TRACE_RCV_TOP 0x01000000
|
||||
#define TRACE_RCV_TOP 0x01000000
|
||||
#define TRACE_SND_BOT 0x08000000 /** bottom being the edge toward the interupt */
|
||||
#define TRACE_RCV_BOT 0x04000000
|
||||
|
||||
@@ -83,10 +83,10 @@ extern unsigned long scst_trace_flag;
|
||||
#endif
|
||||
|
||||
/**
|
||||
** Bits for scst_flags
|
||||
** Bits for scst_flags
|
||||
**/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Set if new commands initialization is being suspended for a while.
|
||||
* Used to let TM commands execute while preparing the suspend, since
|
||||
* RESET or ABORT could be necessary to free SCSI commands.
|
||||
@@ -96,8 +96,8 @@ extern unsigned long scst_trace_flag;
|
||||
/* Set if new commands initialization is suspended for a while */
|
||||
#define SCST_FLAG_SUSPENDED 1
|
||||
|
||||
/**
|
||||
** Return codes for cmd state process functions
|
||||
/**
|
||||
** Return codes for cmd state process functions
|
||||
**/
|
||||
#define SCST_CMD_STATE_RES_CONT_SAME 0
|
||||
#define SCST_CMD_STATE_RES_CONT_NEXT 1
|
||||
@@ -107,7 +107,7 @@ extern unsigned long scst_trace_flag;
|
||||
#define SCST_DEFAULT_ACG_NAME "Default"
|
||||
|
||||
/**
|
||||
** Maximum count of uncompleted commands that an initiator could
|
||||
** Maximum count of uncompleted commands that an initiator could
|
||||
** queue on any device. Then it will start getting TASK QUEUE FULL status.
|
||||
**/
|
||||
#define SCST_MAX_TGT_DEV_COMMANDS 48
|
||||
@@ -299,7 +299,7 @@ void scst_free_internal_cmd(struct scst_cmd *cmd);
|
||||
int scst_prepare_request_sense(struct scst_cmd *orig_cmd);
|
||||
struct scst_cmd *scst_complete_request_sense(struct scst_cmd *cmd);
|
||||
|
||||
int scst_assign_dev_handler(struct scst_device *dev,
|
||||
int scst_assign_dev_handler(struct scst_device *dev,
|
||||
struct scst_dev_type *handler);
|
||||
|
||||
struct scst_session *scst_alloc_session(struct scst_tgt *tgt, int gfp_mask,
|
||||
@@ -324,8 +324,8 @@ void scst_tgt_retry_timer_fn(unsigned long arg);
|
||||
int scst_alloc_request(struct scst_cmd *cmd);
|
||||
void scst_release_request(struct scst_cmd *cmd);
|
||||
|
||||
static inline void scst_do_req(struct scsi_request *sreq,
|
||||
const void *cmnd, void *buffer, unsigned bufflen,
|
||||
static inline void scst_do_req(struct scsi_request *sreq,
|
||||
const void *cmnd, void *buffer, unsigned bufflen,
|
||||
void (*done)(struct scsi_cmnd *), int timeout, int retries)
|
||||
{
|
||||
#ifdef STRICT_SERIALIZING
|
||||
@@ -361,7 +361,7 @@ void scst_scsi_op_list_init(void);
|
||||
|
||||
lun_t scst_unpack_lun(const uint8_t *lun, int len);
|
||||
|
||||
struct scst_cmd *__scst_find_cmd_by_tag(struct scst_session *sess,
|
||||
struct scst_cmd *__scst_find_cmd_by_tag(struct scst_session *sess,
|
||||
uint64_t tag);
|
||||
|
||||
struct scst_mgmt_cmd *scst_alloc_mgmt_cmd(int gfp_mask);
|
||||
@@ -408,7 +408,7 @@ void scst_process_reset(struct scst_device *dev,
|
||||
|
||||
static inline int scst_is_ua_command(struct scst_cmd *cmd)
|
||||
{
|
||||
return ((cmd->cdb[0] != INQUIRY) &&
|
||||
return ((cmd->cdb[0] != INQUIRY) &&
|
||||
(cmd->cdb[0] != REQUEST_SENSE) &&
|
||||
(cmd->cdb[0] != REPORT_LUNS));
|
||||
}
|
||||
@@ -425,8 +425,8 @@ static inline int scst_is_implicit_hq(struct scst_cmd *cmd)
|
||||
|
||||
/*
|
||||
* Some notes on devices "blocking". Blocking means that no
|
||||
* commands will go from SCST to underlying SCSI device until it
|
||||
* is unblocked. But we don't care about all commands that
|
||||
* commands will go from SCST to underlying SCSI device until it
|
||||
* is unblocked. But we don't care about all commands that
|
||||
* already on the device.
|
||||
*/
|
||||
|
||||
|
||||
+14
-14
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* scst_proc.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -52,9 +52,9 @@ static struct scst_proc_data scst_threads_proc_data;
|
||||
static struct scst_proc_data scst_scsi_tgt_proc_data;
|
||||
static struct scst_proc_data scst_dev_handler_proc_data;
|
||||
|
||||
/*
|
||||
* Must be less than 4K page size, since our output routines
|
||||
* use some slack for overruns
|
||||
/*
|
||||
* Must be less than 4K page size, since our output routines
|
||||
* use some slack for overruns
|
||||
*/
|
||||
#define SCST_PROC_BLOCK_SIZE (PAGE_SIZE - 512)
|
||||
|
||||
@@ -395,7 +395,7 @@ static int lat_info_show(struct seq_file *seq, void *v)
|
||||
goto out;
|
||||
}
|
||||
|
||||
seq_printf(seq, "%-20s %-45s %-15s %15s\n", "Target name", "Initiator name",
|
||||
seq_printf(seq, "%-20s %-45s %-15s %15s\n", "Target name", "Initiator name",
|
||||
"SCST latency", "Processing latency (us)");
|
||||
|
||||
list_for_each_entry(acg, &scst_acg_list, scst_acg_list_entry) {
|
||||
@@ -685,7 +685,7 @@ static int __init scst_proc_init_groups(void)
|
||||
goto out_nomem;
|
||||
}
|
||||
|
||||
res = scst_proc_group_add_tree(scst_default_acg,
|
||||
res = scst_proc_group_add_tree(scst_default_acg,
|
||||
SCST_DEFAULT_ACG_NAME);
|
||||
if (res != 0)
|
||||
goto out_remove;
|
||||
@@ -716,7 +716,7 @@ static void scst_proc_cleanup_groups(void)
|
||||
|
||||
scst_proc_del_acg_tree(scst_default_acg->acg_proc_root,
|
||||
SCST_DEFAULT_ACG_NAME);
|
||||
TRACE_DBG("remove_proc_entry(%s, %p)",
|
||||
TRACE_DBG("remove_proc_entry(%s, %p)",
|
||||
SCST_PROC_GROUPS_ENTRY_NAME, scst_proc_scsi_tgt);
|
||||
remove_proc_entry(SCST_PROC_GROUPS_ENTRY_NAME, scst_proc_scsi_tgt);
|
||||
|
||||
@@ -1416,7 +1416,7 @@ static int scst_proc_assign_handler(char *buf)
|
||||
|
||||
if (dev->scsi_dev->type != handler->type) {
|
||||
PRINT_ERROR("Type %d of device %s differs from type "
|
||||
"%d of dev handler %s", dev->handler->type,
|
||||
"%d of dev handler %s", dev->handler->type,
|
||||
dev->handler->name, handler->type, handler->name);
|
||||
res = -EINVAL;
|
||||
goto out;
|
||||
@@ -1521,7 +1521,7 @@ static ssize_t scst_proc_groups_devices_write(struct file *file, const char __us
|
||||
}
|
||||
*e = 0;
|
||||
}
|
||||
|
||||
|
||||
list_for_each_entry(d, &scst_dev_list, dev_list_entry) {
|
||||
if (virt) {
|
||||
if (d->virt_id && !strcmp(d->virt_name, p)) {
|
||||
@@ -1711,7 +1711,7 @@ static ssize_t scst_proc_groups_names_write(struct file *file, const char __user
|
||||
scst_acg_remove_name(acg, p);
|
||||
break;
|
||||
case SCST_PROC_ACTION_CLEAR:
|
||||
list_for_each_entry_safe(n, nn, &acg->acn_list,
|
||||
list_for_each_entry_safe(n, nn, &acg->acn_list,
|
||||
acn_list_entry) {
|
||||
list_del(&n->acn_list_entry);
|
||||
kfree(n->name);
|
||||
@@ -1839,7 +1839,7 @@ static int scst_sessions_info_show(struct seq_file *seq, void *v)
|
||||
goto out;
|
||||
}
|
||||
|
||||
seq_printf(seq, "%-20s %-45s %-35s %-15s\n", "Target name", "Initiator name",
|
||||
seq_printf(seq, "%-20s %-45s %-35s %-15s\n", "Target name", "Initiator name",
|
||||
"Group name", "Command Count");
|
||||
|
||||
list_for_each_entry(acg, &scst_acg_list, scst_acg_list_entry) {
|
||||
@@ -1951,7 +1951,7 @@ static struct scst_proc_data scst_groups_devices_proc_data = {
|
||||
|
||||
#if defined(DEBUG) || defined(TRACING)
|
||||
|
||||
int scst_proc_read_tlb(const struct scst_proc_log *tbl, struct seq_file *seq,
|
||||
int scst_proc_read_tlb(const struct scst_proc_log *tbl, struct seq_file *seq,
|
||||
unsigned long log_level, int *first)
|
||||
{
|
||||
const struct scst_proc_log *t = tbl;
|
||||
|
||||
+99
-99
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* scst_targ.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004-2007 Vladislav Bolkhovitin <vst@vlnb.net>
|
||||
* and Leonid Stoljar
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -49,8 +49,8 @@ static inline void scst_schedule_tasklet(struct scst_cmd *cmd)
|
||||
tasklet_schedule(&t->tasklet);
|
||||
}
|
||||
|
||||
/*
|
||||
* Must not be called in parallel with scst_unregister_session_ex() for the
|
||||
/*
|
||||
* Must not be called in parallel with scst_unregister_session_ex() for the
|
||||
* same sess
|
||||
*/
|
||||
struct scst_cmd *scst_rx_cmd(struct scst_session *sess,
|
||||
@@ -78,7 +78,7 @@ struct scst_cmd *scst_rx_cmd(struct scst_session *sess,
|
||||
|
||||
cmd->start_time = jiffies;
|
||||
|
||||
/*
|
||||
/*
|
||||
* For both wrong lun and CDB defer the error reporting for
|
||||
* scst_cmd_init_done()
|
||||
*/
|
||||
@@ -122,7 +122,7 @@ static int scst_init_cmd(struct scst_cmd *cmd, int context)
|
||||
|
||||
/* Small context optimization */
|
||||
if (((context == SCST_CONTEXT_TASKLET) ||
|
||||
(context == SCST_CONTEXT_DIRECT_ATOMIC)) &&
|
||||
(context == SCST_CONTEXT_DIRECT_ATOMIC)) &&
|
||||
scst_cmd_is_expected_set(cmd)) {
|
||||
if (cmd->expected_data_direction == SCST_DATA_WRITE) {
|
||||
if ( !test_bit(SCST_TGT_DEV_AFTER_INIT_WR_ATOMIC,
|
||||
@@ -142,7 +142,7 @@ out:
|
||||
out_redirect:
|
||||
if (cmd->preprocessing_only) {
|
||||
/*
|
||||
* Poor man solution for single threaded targets, where
|
||||
* Poor man solution for single threaded targets, where
|
||||
* blocking receiver at least sometimes means blocking all.
|
||||
*/
|
||||
sBUG_ON(context != SCST_CONTEXT_DIRECT);
|
||||
@@ -194,7 +194,7 @@ void scst_cmd_init_done(struct scst_cmd *cmd, int pref_context)
|
||||
#endif
|
||||
|
||||
TRACE_DBG("Preferred context: %d (cmd %p)", pref_context, cmd);
|
||||
TRACE(TRACE_SCSI, "tag=%llu, lun=%Ld, CDB len=%d", cmd->tag,
|
||||
TRACE(TRACE_SCSI, "tag=%llu, lun=%Ld, CDB len=%d", cmd->tag,
|
||||
(uint64_t)cmd->lun, cmd->cdb_len);
|
||||
PRINT_BUFF_FLAG(TRACE_SCSI|TRACE_RCV_BOT, "Recieving CDB",
|
||||
cmd->cdb, cmd->cdb_len);
|
||||
@@ -229,7 +229,7 @@ void scst_cmd_init_done(struct scst_cmd *cmd, int pref_context)
|
||||
break;
|
||||
case SCST_SESS_IPH_INITING:
|
||||
TRACE_DBG("Adding cmd %p to init deferred cmd list", cmd);
|
||||
list_add_tail(&cmd->cmd_list_entry,
|
||||
list_add_tail(&cmd->cmd_list_entry,
|
||||
&sess->init_deferred_cmd_list);
|
||||
spin_unlock_irqrestore(&sess->sess_list_lock, flags);
|
||||
goto out;
|
||||
@@ -351,7 +351,7 @@ static int scst_pre_parse(struct scst_cmd *cmd)
|
||||
cmd->expected_data_direction,
|
||||
cmd->expected_transfer_len);
|
||||
cmd->data_direction = cmd->expected_data_direction;
|
||||
|
||||
|
||||
cmd->bufflen = cmd->expected_transfer_len;
|
||||
/* Restore (likely) lost CDB length */
|
||||
cmd->cdb_len = scst_get_cdb_len(cmd->cdb);
|
||||
@@ -496,7 +496,7 @@ static int scst_parse_cmd(struct scst_cmd *cmd)
|
||||
((cmd->sg == NULL) && (state > SCST_CMD_STATE_PREPARE_SPACE)))) {
|
||||
PRINT_ERROR("Dev handler %s parse() returned "
|
||||
"invalid cmd data_direction %d, bufflen %d, state %d "
|
||||
"or sg %p (opcode 0x%x)", dev->handler->name,
|
||||
"or sg %p (opcode 0x%x)", dev->handler->name,
|
||||
cmd->data_direction, cmd->bufflen, state, cmd->sg,
|
||||
cmd->cdb[0]);
|
||||
PRINT_BUFFER("Failed CDB", cmd->cdb, cmd->cdb_len);
|
||||
@@ -579,11 +579,11 @@ set_res:
|
||||
default:
|
||||
if (state >= 0) {
|
||||
PRINT_ERROR("Dev handler %s parse() returned "
|
||||
"invalid cmd state %d (opcode %d)",
|
||||
"invalid cmd state %d (opcode %d)",
|
||||
dev->handler->name, state, cmd->cdb[0]);
|
||||
} else {
|
||||
PRINT_ERROR("Dev handler %s parse() returned "
|
||||
"error %d (opcode %d)", dev->handler->name,
|
||||
"error %d (opcode %d)", dev->handler->name,
|
||||
state, cmd->cdb[0]);
|
||||
}
|
||||
goto out_error;
|
||||
@@ -595,7 +595,7 @@ set_res:
|
||||
else
|
||||
cmd->resp_data_len = 0;
|
||||
}
|
||||
|
||||
|
||||
out:
|
||||
TRACE_EXIT_HRES(res);
|
||||
return res;
|
||||
@@ -653,7 +653,7 @@ alloc:
|
||||
r = scst_alloc_space(cmd);
|
||||
else
|
||||
TRACE_MEM("%s", "data_buf_alloced set, returning");
|
||||
|
||||
|
||||
check:
|
||||
if (r != 0) {
|
||||
if (scst_cmd_atomic(cmd)) {
|
||||
@@ -744,7 +744,7 @@ void scst_restart_cmd(struct scst_cmd *cmd, int status, int pref_context)
|
||||
if (cmd->set_sn_on_restart_cmd)
|
||||
scst_cmd_set_sn(cmd);
|
||||
/* Small context optimization */
|
||||
if ((pref_context == SCST_CONTEXT_TASKLET) ||
|
||||
if ((pref_context == SCST_CONTEXT_TASKLET) ||
|
||||
(pref_context == SCST_CONTEXT_DIRECT_ATOMIC)) {
|
||||
if (cmd->data_direction == SCST_DATA_WRITE) {
|
||||
if ( !test_bit(SCST_TGT_DEV_AFTER_RESTART_WR_ATOMIC,
|
||||
@@ -975,9 +975,9 @@ void scst_rx_data(struct scst_cmd *cmd, int status, int pref_context)
|
||||
case SCST_RX_STATUS_SUCCESS:
|
||||
cmd->state = SCST_CMD_STATE_TGT_PRE_EXEC;
|
||||
/* Small context optimization */
|
||||
if ((pref_context == SCST_CONTEXT_TASKLET) ||
|
||||
if ((pref_context == SCST_CONTEXT_TASKLET) ||
|
||||
(pref_context == SCST_CONTEXT_DIRECT_ATOMIC)) {
|
||||
if ( !test_bit(SCST_TGT_DEV_AFTER_RX_DATA_ATOMIC,
|
||||
if ( !test_bit(SCST_TGT_DEV_AFTER_RX_DATA_ATOMIC,
|
||||
&cmd->tgt_dev->tgt_dev_flags))
|
||||
pref_context = SCST_CONTEXT_THREAD;
|
||||
}
|
||||
@@ -1104,9 +1104,9 @@ static void scst_do_cmd_done(struct scst_cmd *cmd, int result,
|
||||
static inline int scst_optimize_post_exec_context(struct scst_cmd *cmd,
|
||||
int context)
|
||||
{
|
||||
if ((context == SCST_CONTEXT_TASKLET) ||
|
||||
if ((context == SCST_CONTEXT_TASKLET) ||
|
||||
(context == SCST_CONTEXT_DIRECT_ATOMIC)) {
|
||||
if ( !test_bit(SCST_TGT_DEV_AFTER_EXEC_ATOMIC,
|
||||
if ( !test_bit(SCST_TGT_DEV_AFTER_EXEC_ATOMIC,
|
||||
&cmd->tgt_dev->tgt_dev_flags))
|
||||
context = SCST_CONTEXT_THREAD;
|
||||
}
|
||||
@@ -1216,7 +1216,7 @@ static void scst_cmd_done_local(struct scst_cmd *cmd, int next_state)
|
||||
TRACE_RECV_TOP("Exec'd %d S/G(s) at %p sg[0].page at "
|
||||
"%p", cmd->sg_cnt, sg, (void*)sg_page(&sg[0]));
|
||||
for(i = 0; i < cmd->sg_cnt; ++i) {
|
||||
TRACE_BUFF_FLAG(TRACE_RCV_TOP,
|
||||
TRACE_BUFF_FLAG(TRACE_RCV_TOP,
|
||||
"Exec'd sg", sg_virt(&sg[i]),
|
||||
sg[i].length);
|
||||
}
|
||||
@@ -1228,7 +1228,7 @@ static void scst_cmd_done_local(struct scst_cmd *cmd, int next_state)
|
||||
#ifdef EXTRACHECKS
|
||||
if ((next_state != SCST_CMD_STATE_PRE_DEV_DONE) &&
|
||||
(next_state != SCST_CMD_STATE_PRE_XMIT_RESP) &&
|
||||
(next_state != SCST_CMD_STATE_FINISHED))
|
||||
(next_state != SCST_CMD_STATE_FINISHED))
|
||||
{
|
||||
PRINT_ERROR("scst_cmd_done_local() received invalid cmd "
|
||||
"state %d (opcode %d)", next_state, cmd->cdb[0]);
|
||||
@@ -1345,7 +1345,7 @@ out_done:
|
||||
|
||||
TRACE_EXIT();
|
||||
return SCST_EXEC_COMPLETED;
|
||||
|
||||
|
||||
out_put_err:
|
||||
scst_put_buf(cmd, buffer);
|
||||
|
||||
@@ -1431,13 +1431,13 @@ static int scst_reserve_local(struct scst_cmd *cmd)
|
||||
list_for_each_entry(tgt_dev_tmp, &dev->dev_tgt_dev_list,
|
||||
dev_tgt_dev_list_entry) {
|
||||
if (cmd->tgt_dev != tgt_dev_tmp)
|
||||
set_bit(SCST_TGT_DEV_RESERVED,
|
||||
set_bit(SCST_TGT_DEV_RESERVED,
|
||||
&tgt_dev_tmp->tgt_dev_flags);
|
||||
}
|
||||
dev->dev_reserved = 1;
|
||||
|
||||
spin_unlock_bh(&dev->dev_lock);
|
||||
|
||||
|
||||
out:
|
||||
TRACE_EXIT_RES(res);
|
||||
return res;
|
||||
@@ -1478,9 +1478,9 @@ static int scst_release_local(struct scst_cmd *cmd)
|
||||
|
||||
spin_lock_bh(&dev->dev_lock);
|
||||
|
||||
/*
|
||||
* The device could be RELEASED behind us, if RESERVING session
|
||||
* is closed (see scst_free_tgt_dev()), but this actually doesn't
|
||||
/*
|
||||
* The device could be RELEASED behind us, if RESERVING session
|
||||
* is closed (see scst_free_tgt_dev()), but this actually doesn't
|
||||
* matter, so use lock and no retest for DEV_RESERVED bits again
|
||||
*/
|
||||
if (test_bit(SCST_TGT_DEV_RESERVED, &cmd->tgt_dev->tgt_dev_flags)) {
|
||||
@@ -1494,7 +1494,7 @@ static int scst_release_local(struct scst_cmd *cmd)
|
||||
list_for_each_entry(tgt_dev_tmp,
|
||||
&dev->dev_tgt_dev_list,
|
||||
dev_tgt_dev_list_entry) {
|
||||
clear_bit(SCST_TGT_DEV_RESERVED,
|
||||
clear_bit(SCST_TGT_DEV_RESERVED,
|
||||
&tgt_dev_tmp->tgt_dev_flags);
|
||||
}
|
||||
dev->dev_reserved = 0;
|
||||
@@ -1565,7 +1565,7 @@ int scst_check_local_events(struct scst_cmd *cmd)
|
||||
}
|
||||
}
|
||||
|
||||
if (unlikely(test_bit(SCST_TGT_DEV_UA_PENDING,
|
||||
if (unlikely(test_bit(SCST_TGT_DEV_UA_PENDING,
|
||||
&cmd->tgt_dev->tgt_dev_flags))) {
|
||||
if (scst_is_ua_command(cmd)) {
|
||||
rc = scst_set_pending_UA(cmd);
|
||||
@@ -1590,9 +1590,9 @@ out_uncomplete:
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* The result of cmd execution, if any, should be reported
|
||||
* via scst_cmd_done_local()
|
||||
/*
|
||||
* The result of cmd execution, if any, should be reported
|
||||
* via scst_cmd_done_local()
|
||||
*/
|
||||
static int scst_pre_exec(struct scst_cmd *cmd)
|
||||
{
|
||||
@@ -1634,9 +1634,9 @@ out_done:
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* The result of cmd execution, if any, should be reported
|
||||
* via scst_cmd_done_local()
|
||||
/*
|
||||
* The result of cmd execution, if any, should be reported
|
||||
* via scst_cmd_done_local()
|
||||
*/
|
||||
static inline int scst_local_exec(struct scst_cmd *cmd)
|
||||
{
|
||||
@@ -1725,7 +1725,7 @@ static int scst_do_send_to_midlev(struct scst_cmd *cmd)
|
||||
}
|
||||
|
||||
TRACE_DBG("Sending cmd %p to SCSI mid-level", cmd);
|
||||
|
||||
|
||||
if (unlikely(dev->scsi_dev == NULL)) {
|
||||
PRINT_ERROR("Command for virtual device must be "
|
||||
"processed by device handler (lun %Ld)!",
|
||||
@@ -1747,7 +1747,7 @@ static int scst_do_send_to_midlev(struct scst_cmd *cmd)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
|
||||
if (unlikely(scst_alloc_request(cmd) != 0)) {
|
||||
if (scst_cmd_atomic(cmd)) {
|
||||
rc = SCST_EXEC_NEED_THREAD;
|
||||
@@ -1758,7 +1758,7 @@ static int scst_do_send_to_midlev(struct scst_cmd *cmd)
|
||||
goto out_busy;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
scst_do_req(cmd->scsi_req, (void *)cmd->cdb,
|
||||
(void *)cmd->scsi_req->sr_buffer,
|
||||
cmd->scsi_req->sr_bufflen, scst_cmd_done, cmd->timeout,
|
||||
@@ -1799,7 +1799,7 @@ out_rc_error:
|
||||
out_error:
|
||||
scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_hardw_error));
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
|
||||
out_busy:
|
||||
scst_set_busy(cmd);
|
||||
/* go through */
|
||||
@@ -1837,14 +1837,14 @@ void scst_inc_expected_sn(struct scst_tgt_dev *tgt_dev, atomic_t *slot)
|
||||
tgt_dev->num_free_sn_slots++;
|
||||
TRACE_SN("Incremented num_free_sn_slots (%d)",
|
||||
tgt_dev->num_free_sn_slots);
|
||||
|
||||
|
||||
}
|
||||
spin_unlock_irq(&tgt_dev->sn_lock);
|
||||
}
|
||||
|
||||
inc:
|
||||
/*
|
||||
* No locks is needed, because only one thread at time can
|
||||
* No locks is needed, because only one thread at time can
|
||||
* be here (serialized by sn). Also it is supposed that there
|
||||
* could not be half-incremented halves.
|
||||
*/
|
||||
@@ -2049,7 +2049,7 @@ static int scst_check_sense(struct scst_cmd *cmd)
|
||||
spin_unlock_bh(&dev->dev_lock);
|
||||
}
|
||||
|
||||
if (unlikely(cmd->status == SAM_STAT_CHECK_CONDITION) &&
|
||||
if (unlikely(cmd->status == SAM_STAT_CHECK_CONDITION) &&
|
||||
SCST_SENSE_VALID(cmd->sense)) {
|
||||
PRINT_BUFF_FLAG(TRACE_SCSI, "Sense", cmd->sense,
|
||||
SCST_SENSE_BUFFERSIZE);
|
||||
@@ -2058,7 +2058,7 @@ static int scst_check_sense(struct scst_cmd *cmd)
|
||||
if (cmd->sense[12] == SCST_SENSE_ASC_UA_RESET) {
|
||||
if (dbl_ua_possible) {
|
||||
if (ua_sent) {
|
||||
TRACE(TRACE_MGMT_MINOR, "%s",
|
||||
TRACE(TRACE_MGMT_MINOR, "%s",
|
||||
"Double UA detected");
|
||||
/* Do retry */
|
||||
TRACE(TRACE_MGMT_MINOR, "Retrying cmd %p "
|
||||
@@ -2072,7 +2072,7 @@ static int scst_check_sense(struct scst_cmd *cmd)
|
||||
cmd->retry = 1;
|
||||
cmd->state = SCST_CMD_STATE_SEND_TO_MIDLEV;
|
||||
res = 1;
|
||||
/*
|
||||
/*
|
||||
* Dev is still blocked by this cmd, so
|
||||
* it's OK to clear SCST_DEV_SERIALIZED
|
||||
* here.
|
||||
@@ -2200,7 +2200,7 @@ static int scst_done_cmd_check(struct scst_cmd *cmd, int *pres)
|
||||
scst_put_buf(cmd, address);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Check and clear NormACA option for the device, if necessary,
|
||||
* since we don't support ACA
|
||||
*/
|
||||
@@ -2216,7 +2216,7 @@ static int scst_done_cmd_check(struct scst_cmd *cmd, int *pres)
|
||||
#ifdef EXTRACHECKS
|
||||
if (buffer[SCST_INQ_BYTE3] & SCST_INQ_NORMACA_BIT) {
|
||||
PRINT_INFO("NormACA set for device: "
|
||||
"lun=%Ld, type 0x%02x",
|
||||
"lun=%Ld, type 0x%02x",
|
||||
(uint64_t)cmd->lun, buffer[0]);
|
||||
}
|
||||
#endif
|
||||
@@ -2231,7 +2231,7 @@ static int scst_done_cmd_check(struct scst_cmd *cmd, int *pres)
|
||||
scst_put_buf(cmd, buffer);
|
||||
}
|
||||
|
||||
if (unlikely((cmd->cdb[0] == MODE_SELECT) ||
|
||||
if (unlikely((cmd->cdb[0] == MODE_SELECT) ||
|
||||
(cmd->cdb[0] == MODE_SELECT_10) ||
|
||||
(cmd->cdb[0] == LOG_SELECT))) {
|
||||
TRACE(TRACE_SCSI, "MODE/LOG SELECT succeeded (LUN %Ld)",
|
||||
@@ -2257,7 +2257,7 @@ static int scst_done_cmd_check(struct scst_cmd *cmd, int *pres)
|
||||
spin_lock_bh(&dev->dev_lock);
|
||||
list_for_each_entry(tgt_dev_tmp, &dev->dev_tgt_dev_list,
|
||||
dev_tgt_dev_list_entry) {
|
||||
clear_bit(SCST_TGT_DEV_RESERVED,
|
||||
clear_bit(SCST_TGT_DEV_RESERVED,
|
||||
&tgt_dev_tmp->tgt_dev_flags);
|
||||
}
|
||||
dev->dev_reserved = 0;
|
||||
@@ -2267,7 +2267,7 @@ static int scst_done_cmd_check(struct scst_cmd *cmd, int *pres)
|
||||
|
||||
/* Check for MODE PARAMETERS CHANGED UA */
|
||||
if ((cmd->dev->scsi_dev != NULL) &&
|
||||
(cmd->status == SAM_STAT_CHECK_CONDITION) &&
|
||||
(cmd->status == SAM_STAT_CHECK_CONDITION) &&
|
||||
SCST_SENSE_VALID(cmd->sense) &&
|
||||
scst_is_ua_sense(cmd->sense) &&
|
||||
(cmd->sense[12] == 0x2a) && (cmd->sense[13] == 0x01)) {
|
||||
@@ -2310,7 +2310,7 @@ static int scst_mode_select_checks(struct scst_cmd *cmd)
|
||||
TRACE_ENTRY();
|
||||
|
||||
if (likely(scsi_status_is_good(cmd->status))) {
|
||||
if (unlikely((cmd->cdb[0] == MODE_SELECT) ||
|
||||
if (unlikely((cmd->cdb[0] == MODE_SELECT) ||
|
||||
(cmd->cdb[0] == MODE_SELECT_10) ||
|
||||
(cmd->cdb[0] == LOG_SELECT))) {
|
||||
struct scst_device *dev = cmd->dev;
|
||||
@@ -2322,7 +2322,7 @@ static int scst_mode_select_checks(struct scst_cmd *cmd)
|
||||
}
|
||||
|
||||
TRACE(TRACE_SCSI, "MODE/LOG SELECT succeeded, "
|
||||
"setting the SELECT UA (lun=%Ld)",
|
||||
"setting the SELECT UA (lun=%Ld)",
|
||||
(uint64_t)cmd->lun);
|
||||
|
||||
spin_lock_bh(&dev->dev_lock);
|
||||
@@ -2344,7 +2344,7 @@ static int scst_mode_select_checks(struct scst_cmd *cmd)
|
||||
if (dev->scsi_dev != NULL)
|
||||
scst_obtain_device_parameters(dev);
|
||||
}
|
||||
} else if ((cmd->status == SAM_STAT_CHECK_CONDITION) &&
|
||||
} else if ((cmd->status == SAM_STAT_CHECK_CONDITION) &&
|
||||
SCST_SENSE_VALID(cmd->sense) &&
|
||||
scst_is_ua_sense(cmd->sense) &&
|
||||
(((cmd->sense[12] == 0x2a) && (cmd->sense[13] == 0x01)) ||
|
||||
@@ -2389,7 +2389,7 @@ static int scst_dev_done(struct scst_cmd *cmd)
|
||||
TRACE_ENTRY();
|
||||
|
||||
state = SCST_CMD_STATE_PRE_XMIT_RESP;
|
||||
if (likely(!scst_is_cmd_local(cmd)) &&
|
||||
if (likely(!scst_is_cmd_local(cmd)) &&
|
||||
likely(cmd->dev->handler->dev_done != NULL))
|
||||
{
|
||||
int rc;
|
||||
@@ -2429,11 +2429,11 @@ static int scst_dev_done(struct scst_cmd *cmd)
|
||||
default:
|
||||
if (state >= 0) {
|
||||
PRINT_ERROR("Dev handler %s dev_done() returned "
|
||||
"invalid cmd state %d",
|
||||
"invalid cmd state %d",
|
||||
cmd->dev->handler->name, state);
|
||||
} else {
|
||||
PRINT_ERROR("Dev handler %s dev_done() returned "
|
||||
"error %d", cmd->dev->handler->name,
|
||||
"error %d", cmd->dev->handler->name,
|
||||
state);
|
||||
}
|
||||
scst_set_cmd_error(cmd,
|
||||
@@ -2738,7 +2738,7 @@ static void scst_cmd_set_sn(struct scst_cmd *cmd)
|
||||
}
|
||||
cmd->sn_slot = tgt_dev->cur_sn_slot;
|
||||
cmd->sn = tgt_dev->curr_sn;
|
||||
|
||||
|
||||
tgt_dev->prev_cmd_ordered = 0;
|
||||
} else {
|
||||
TRACE(TRACE_MINOR, "***WARNING*** Not enough SN slots "
|
||||
@@ -2800,7 +2800,7 @@ ordered:
|
||||
TRACE_SN("cmd(%p)->sn: %ld (tgt_dev %p, *cur_sn_slot %d, "
|
||||
"num_free_sn_slots %d, prev_cmd_ordered %ld, "
|
||||
"cur_sn_slot %zd)", cmd, cmd->sn, tgt_dev,
|
||||
atomic_read(tgt_dev->cur_sn_slot),
|
||||
atomic_read(tgt_dev->cur_sn_slot),
|
||||
tgt_dev->num_free_sn_slots, tgt_dev->prev_cmd_ordered,
|
||||
tgt_dev->cur_sn_slot-tgt_dev->sn_slots);
|
||||
|
||||
@@ -2844,7 +2844,7 @@ static int scst_translate_lun(struct scst_cmd *cmd)
|
||||
"visible remotely", (uint64_t)cmd->lun);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
cmd->cmd_lists = tgt_dev->dev->p_cmd_lists;
|
||||
cmd->tgt_dev = tgt_dev;
|
||||
cmd->dev = tgt_dev->dev;
|
||||
@@ -3182,7 +3182,7 @@ void scst_process_active_cmd(struct scst_cmd *cmd, int context)
|
||||
case SCST_CMD_STATE_DEFAULT:
|
||||
case SCST_CMD_STATE_NEED_THREAD_CTX:
|
||||
PRINT_CRIT_ERROR("cmd %p is in state %d, not putting on "
|
||||
"useful list (left on scst cmd list)", cmd,
|
||||
"useful list (left on scst cmd list)", cmd,
|
||||
cmd->state);
|
||||
spin_unlock_irq(&cmd->cmd_lists->cmd_list_lock);
|
||||
sBUG();
|
||||
@@ -3210,7 +3210,7 @@ static void scst_do_job_active(struct list_head *cmd_list,
|
||||
#ifdef EXTRACHECKS
|
||||
{
|
||||
int c = context & ~SCST_CONTEXT_PROCESSABLE;
|
||||
sBUG_ON((c != SCST_CONTEXT_DIRECT_ATOMIC) &&
|
||||
sBUG_ON((c != SCST_CONTEXT_DIRECT_ATOMIC) &&
|
||||
(c != SCST_CONTEXT_DIRECT));
|
||||
}
|
||||
#endif
|
||||
@@ -3377,7 +3377,7 @@ void scst_done_cmd_mgmt(struct scst_cmd *cmd)
|
||||
cmd_mgmt_cmd_list_entry) {
|
||||
struct scst_mgmt_cmd *mcmd = mstb->mcmd;
|
||||
|
||||
TRACE_MGMT_DBG("mcmd %p, mcmd->cmd_done_wait_count %d",
|
||||
TRACE_MGMT_DBG("mcmd %p, mcmd->cmd_done_wait_count %d",
|
||||
mcmd, mcmd->cmd_done_wait_count);
|
||||
|
||||
mcmd->cmd_done_wait_count--;
|
||||
@@ -3425,7 +3425,7 @@ static void scst_finish_cmd_mgmt(struct scst_cmd *cmd)
|
||||
cmd_mgmt_cmd_list_entry) {
|
||||
struct scst_mgmt_cmd *mcmd = mstb->mcmd;
|
||||
|
||||
TRACE_MGMT_DBG("mcmd %p, mcmd->cmd_finish_wait_count %d",
|
||||
TRACE_MGMT_DBG("mcmd %p, mcmd->cmd_finish_wait_count %d",
|
||||
mcmd, mcmd->cmd_finish_wait_count);
|
||||
|
||||
list_del(&mstb->cmd_mgmt_cmd_list_entry);
|
||||
@@ -3495,7 +3495,7 @@ static inline int scst_is_strict_mgmt_fn(int mgmt_fn)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Might be called under sess_list_lock and IRQ off + BHs also off
|
||||
* Returns -1 if command is being executed (ABORT failed), 0 otherwise
|
||||
*/
|
||||
@@ -3528,12 +3528,12 @@ void scst_abort_cmd(struct scst_cmd *cmd, struct scst_mgmt_cmd *mcmd,
|
||||
|
||||
spin_unlock_irqrestore(&other_ini_lock, flags);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
/*
|
||||
* To sync with cmd->finished/done set in
|
||||
* scst_finish_cmd()/scst_pre_xmit_response()
|
||||
*/
|
||||
smp_mb__after_set_bit();
|
||||
smp_mb__after_set_bit();
|
||||
|
||||
if (cmd->tgt_dev == NULL) {
|
||||
unsigned long flags;
|
||||
@@ -3708,10 +3708,10 @@ static void __scst_abort_task_set(struct scst_mgmt_cmd *mcmd,
|
||||
spin_lock_irq(&sess->sess_list_lock);
|
||||
|
||||
TRACE_DBG("Searching in search cmd list (sess=%p)", sess);
|
||||
list_for_each_entry(cmd, &sess->search_cmd_list,
|
||||
list_for_each_entry(cmd, &sess->search_cmd_list,
|
||||
search_cmd_list_entry) {
|
||||
if ((cmd->tgt_dev == tgt_dev) ||
|
||||
((cmd->tgt_dev == NULL) &&
|
||||
((cmd->tgt_dev == NULL) &&
|
||||
(cmd->lun == tgt_dev->lun))) {
|
||||
if (mcmd->cmd_sn_set) {
|
||||
sBUG_ON(!cmd->tgt_sn_set);
|
||||
@@ -3807,7 +3807,7 @@ static int scst_clear_task_set(struct scst_mgmt_cmd *mcmd)
|
||||
|
||||
mutex_lock(&scst_mutex);
|
||||
|
||||
list_for_each_entry(tgt_dev, &dev->dev_tgt_dev_list,
|
||||
list_for_each_entry(tgt_dev, &dev->dev_tgt_dev_list,
|
||||
dev_tgt_dev_list_entry) {
|
||||
struct scst_session *sess = tgt_dev->sess;
|
||||
struct scst_cmd *cmd;
|
||||
@@ -3819,10 +3819,10 @@ static int scst_clear_task_set(struct scst_mgmt_cmd *mcmd)
|
||||
spin_lock_irq(&sess->sess_list_lock);
|
||||
|
||||
TRACE_DBG("Searching in search cmd list (sess=%p)", sess);
|
||||
list_for_each_entry(cmd, &sess->search_cmd_list,
|
||||
list_for_each_entry(cmd, &sess->search_cmd_list,
|
||||
search_cmd_list_entry) {
|
||||
if ((cmd->dev == dev) ||
|
||||
((cmd->dev == NULL) &&
|
||||
((cmd->dev == NULL) &&
|
||||
scst_is_cmd_belongs_to_dev(cmd, dev))) {
|
||||
scst_abort_cmd(cmd, mcmd, 1, 0);
|
||||
aborted = 1;
|
||||
@@ -3857,7 +3857,7 @@ static int scst_clear_task_set(struct scst_mgmt_cmd *mcmd)
|
||||
return res;
|
||||
}
|
||||
|
||||
/* Returns 0 if the command processing should be continued,
|
||||
/* Returns 0 if the command processing should be continued,
|
||||
* >0, if it should be requeued, <0 otherwise */
|
||||
static int scst_mgmt_cmd_init(struct scst_mgmt_cmd *mcmd)
|
||||
{
|
||||
@@ -3894,7 +3894,7 @@ static int scst_mgmt_cmd_init(struct scst_mgmt_cmd *mcmd)
|
||||
"cmd LUN %Lx, cmd tag %Lu", mcmd->lun, cmd->lun,
|
||||
mcmd->tag);
|
||||
mcmd->status = SCST_MGMT_STATUS_REJECTED;
|
||||
} else if (mcmd->cmd_sn_set &&
|
||||
} else if (mcmd->cmd_sn_set &&
|
||||
(scst_sn_before(mcmd->cmd_sn, cmd->tgt_sn) ||
|
||||
(mcmd->cmd_sn == cmd->tgt_sn))) {
|
||||
PRINT_ERROR("ABORT TASK: SN mismatch: mcmd SN %x, "
|
||||
@@ -3979,7 +3979,7 @@ static int scst_target_reset(struct scst_mgmt_cmd *mcmd)
|
||||
dev_tgt_dev_list_entry) {
|
||||
cont = 1;
|
||||
rc = scst_call_dev_task_mgmt_fn(mcmd, tgt_dev, 0);
|
||||
if (rc == SCST_DEV_TM_NOT_COMPLETED)
|
||||
if (rc == SCST_DEV_TM_NOT_COMPLETED)
|
||||
c = 1;
|
||||
else if ((rc < 0) &&
|
||||
(mcmd->status == SCST_MGMT_STATUS_SUCCESS))
|
||||
@@ -3987,7 +3987,7 @@ static int scst_target_reset(struct scst_mgmt_cmd *mcmd)
|
||||
}
|
||||
if (cont && !c)
|
||||
continue;
|
||||
|
||||
|
||||
if (dev->scsi_dev == NULL)
|
||||
continue;
|
||||
|
||||
@@ -4145,12 +4145,12 @@ static int scst_abort_all_nexus_loss_sess(struct scst_mgmt_cmd *mcmd,
|
||||
__scst_block_dev(dev);
|
||||
spin_unlock_bh(&dev->dev_lock);
|
||||
}
|
||||
|
||||
|
||||
__scst_abort_task_set(mcmd, tgt_dev, 0);
|
||||
|
||||
|
||||
rc = scst_call_dev_task_mgmt_fn(mcmd, tgt_dev, 0);
|
||||
if ((rc < 0) && (mcmd->status == SCST_MGMT_STATUS_SUCCESS))
|
||||
mcmd->status = rc;
|
||||
mcmd->status = rc;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4234,7 +4234,7 @@ static int scst_abort_all_nexus_loss_tgt(struct scst_mgmt_cmd *mcmd,
|
||||
|
||||
if (nexus_loss)
|
||||
scst_nexus_loss(tgt_dev);
|
||||
|
||||
|
||||
rc = scst_call_dev_task_mgmt_fn(mcmd, tgt_dev, 0);
|
||||
if ((rc < 0) &&
|
||||
(mcmd->status == SCST_MGMT_STATUS_SUCCESS))
|
||||
@@ -4426,7 +4426,7 @@ static void scst_mgmt_cmd_send_done(struct scst_mgmt_cmd *mcmd)
|
||||
|
||||
mutex_lock(&scst_mutex);
|
||||
for(i = 0; i < TGT_DEV_HASH_SIZE; i++) {
|
||||
struct list_head *sess_tgt_dev_list_head =
|
||||
struct list_head *sess_tgt_dev_list_head =
|
||||
&mcmd->sess->sess_tgt_dev_list_hash[i];
|
||||
list_for_each_entry(tgt_dev, sess_tgt_dev_list_head,
|
||||
sess_tgt_dev_list_entry) {
|
||||
@@ -4554,7 +4554,7 @@ int scst_mgmt_cmd_thread(void *arg)
|
||||
!test_bit(SCST_FLAG_SUSPENDING, &scst_flags)) {
|
||||
TRACE_MGMT_DBG("Adding mgmt cmd %p to head "
|
||||
"of delayed mgmt cmd list", mcmd);
|
||||
list_add(&mcmd->mgmt_cmd_list_entry,
|
||||
list_add(&mcmd->mgmt_cmd_list_entry,
|
||||
&scst_delayed_mgmt_cmd_list);
|
||||
} else {
|
||||
TRACE_MGMT_DBG("Adding mgmt cmd %p to head "
|
||||
@@ -4635,7 +4635,7 @@ static int scst_post_rx_mgmt_cmd(struct scst_session *sess,
|
||||
case SCST_SESS_IPH_INITING:
|
||||
TRACE_DBG("Adding mcmd %p to init deferred mcmd list",
|
||||
mcmd);
|
||||
list_add_tail(&mcmd->mgmt_cmd_list_entry,
|
||||
list_add_tail(&mcmd->mgmt_cmd_list_entry,
|
||||
&sess->init_deferred_mcmd_list);
|
||||
goto out_unlock;
|
||||
case SCST_SESS_IPH_SUCCESS:
|
||||
@@ -4669,8 +4669,8 @@ out_unlock:
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* Must not be called in parallel with scst_unregister_session_ex() for the
|
||||
/*
|
||||
* Must not be called in parallel with scst_unregister_session_ex() for the
|
||||
* same sess
|
||||
*/
|
||||
int scst_rx_mgmt_fn(struct scst_session *sess,
|
||||
@@ -4742,13 +4742,13 @@ static struct scst_acg *scst_find_acg(const char *initiator_name)
|
||||
struct scst_acn *n;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
list_for_each_entry(acg, &scst_acg_list, scst_acg_list_entry) {
|
||||
list_for_each_entry(n, &acg->acn_list,
|
||||
acn_list_entry)
|
||||
list_for_each_entry(n, &acg->acn_list,
|
||||
acn_list_entry)
|
||||
{
|
||||
if (strcmp(n->name, initiator_name) == 0) {
|
||||
TRACE_DBG("Access control group %s found",
|
||||
TRACE_DBG("Access control group %s found",
|
||||
acg->acg_name);
|
||||
res = acg;
|
||||
goto out;
|
||||
@@ -4756,7 +4756,7 @@ static struct scst_acg *scst_find_acg(const char *initiator_name)
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
out:
|
||||
TRACE_EXIT_HRES(res);
|
||||
return res;
|
||||
}
|
||||
@@ -4767,17 +4767,17 @@ static struct scst_acg *scst_find_acg_by_name(const char *acg_name)
|
||||
struct scst_acg *acg, *res = NULL;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
list_for_each_entry(acg, &scst_acg_list, scst_acg_list_entry) {
|
||||
if (strcmp(acg->acg_name, acg_name) == 0) {
|
||||
TRACE_DBG("Access control group %s found",
|
||||
TRACE_DBG("Access control group %s found",
|
||||
acg->acg_name);
|
||||
res = acg;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
out:
|
||||
TRACE_EXIT_HRES(res);
|
||||
return res;
|
||||
}
|
||||
@@ -4916,8 +4916,8 @@ out_free:
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* Must not be called in parallel with scst_rx_cmd() or
|
||||
/*
|
||||
* Must not be called in parallel with scst_rx_cmd() or
|
||||
* scst_rx_mgmt_fn_*() for the same sess
|
||||
*/
|
||||
void scst_unregister_session_ex(struct scst_session *sess, int wait,
|
||||
@@ -4992,7 +4992,7 @@ static void scst_pre_unreg_sess(struct scst_session *sess)
|
||||
TRACE_ENTRY();
|
||||
|
||||
tm_dbg_task_mgmt(NULL, "UNREGISTER SESSION", 1);
|
||||
|
||||
|
||||
mutex_lock(&scst_mutex);
|
||||
for(i = 0; i < TGT_DEV_HASH_SIZE; i++) {
|
||||
struct list_head *sess_tgt_dev_list_head =
|
||||
@@ -5133,7 +5133,7 @@ struct scst_cmd *__scst_find_cmd_by_tag(struct scst_session *sess, uint64_t tag)
|
||||
|
||||
TRACE_DBG("%s (sess=%p, tag=%llu)", "Searching in search cmd list",
|
||||
sess, tag);
|
||||
list_for_each_entry(cmd, &sess->search_cmd_list,
|
||||
list_for_each_entry(cmd, &sess->search_cmd_list,
|
||||
search_cmd_list_entry) {
|
||||
if (cmd->tag == tag)
|
||||
goto out;
|
||||
@@ -5159,7 +5159,7 @@ struct scst_cmd *scst_find_cmd(struct scst_session *sess, void *data,
|
||||
spin_lock_irqsave(&sess->sess_list_lock, flags);
|
||||
|
||||
TRACE_DBG("Searching in search cmd list (sess=%p)", sess);
|
||||
list_for_each_entry(cmd, &sess->search_cmd_list,
|
||||
list_for_each_entry(cmd, &sess->search_cmd_list,
|
||||
search_cmd_list_entry) {
|
||||
if (cmp_fn(cmd, data))
|
||||
goto out_unlock;
|
||||
|
||||
+3
-3
@@ -1144,13 +1144,13 @@ static int srpt_release_channel(struct srpt_rdma_ch *ch, int destroy_cmid)
|
||||
"%s: Release sess= %p sess_name= %s active_cmd= %d\n",
|
||||
__FUNCTION__, ch->scst_sess, ch->sess_name,
|
||||
ch->active_scmnd_cnt);
|
||||
|
||||
|
||||
list_for_each_entry_safe(ioctx, ioctx_tmp,
|
||||
&ch->active_scmnd_list, scmnd_list) {
|
||||
list_del(&ioctx->scmnd_list);
|
||||
ch->active_scmnd_cnt--;
|
||||
}
|
||||
|
||||
|
||||
scst_unregister_session(ch->scst_sess, 0, NULL);
|
||||
ch->scst_sess = NULL;
|
||||
}
|
||||
@@ -2245,7 +2245,7 @@ static void srpt_remove_one(struct ib_device *device)
|
||||
sdev = ib_get_client_data(device, &srpt_client);
|
||||
if (!sdev)
|
||||
return;
|
||||
|
||||
|
||||
wait_for_completion(&sdev->scst_released);
|
||||
|
||||
ib_unregister_event_handler(&sdev->event_handler);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user