1 /* $FreeBSD: src/sys/dev/isp/isp_target.h,v 1.31 2009/08/01 01:04:26 mjacob Exp $ */
3 * Copyright (c) 1997-2009 by Matthew Jacob
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * Qlogic Target Mode Structure and Flag Definitions
36 * Notify structure- these are for asynchronous events that need to be sent
37 * as notifications to the outer layer. It should be pretty self-explanatory.
58 typedef struct isp_notify
{
59 void * nt_hba
; /* HBA tag */
63 uint64_t nt_wwn
; /* source (wwn) */
64 uint64_t nt_tgt
; /* destination (wwn) */
65 uint64_t nt_tagval
; /* tag value */
67 nt_sid
: 24; /* source port id */
69 nt_failed
: 1, /* notify operation failed */
70 nt_need_ack
: 1, /* this notify needs an ACK */
71 nt_did
: 24; /* destination port id */
73 nt_lun
: 16, /* logical unit */
74 nt_nphdl
: 16; /* n-port handle */
75 uint8_t nt_channel
; /* channel id */
76 isp_ncode_t nt_ncode
; /* action */
78 #define MATCH_TMD(tmd, iid, lun, tag) \
81 (iid == INI_ANY || iid == tmd->cd_iid) && \
82 (lun == LUN_ANY || lun == tmd->cd_lun) && \
83 (tag == TAG_ANY || tag == tmd->cd_tagval) \
89 #define ISP_TDQE(isp, msg, idx, arg) \
90 if (isp->isp_dblev & ISP_LOGTDEBUG2) isp_print_qentry(isp, msg, idx, arg)
95 #define INI_ANY ((uint64_t) -1)
96 #define VALID_INI(ini) (ini != INI_NONE && ini != INI_ANY)
97 #define LUN_ANY 0xffff
98 #define TGT_ANY ((uint64_t) -1)
99 #define TAG_ANY ((uint64_t) 0)
100 #endif /* _ISP_TARGET_H */