Deleted Added
full compact
mpt_cam.h (147883) mpt_cam.h (148679)
1/* $FreeBSD: head/sys/dev/mpt/mpt_cam.h 147883 2005-07-10 15:05:39Z scottl $ */
1/* $FreeBSD: head/sys/dev/mpt/mpt_cam.h 148679 2005-08-03 14:08:41Z gibbs $ */
2/*-
3 * LSI MPT Host Adapter FreeBSD Wrapper Definitions (CAM version)
4 *
5 * Copyright (c) 2000, 2001 by Greg Ansley, Adam Prewett
6 *
7 * Partially derived from Matty Jacobs ISP driver.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice immediately at the beginning of the file, without modification,
14 * this list of conditions, and the following disclaimer.
15 * 2. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 *
28 * Additional Copyright (c) 2002 by Matthew Jacob under same license.
29 */
30/*-
31 * Copyright (c) 2004, Avid Technology, Inc. and its contributors.
32 * Copyright (c) 2005, WHEEL Sp. z o.o.
33 * Copyright (c) 2004, 2005 Justin T. Gibbs
34 * All rights reserved.
35 *
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions are
38 * met:
39 * 1. Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
42 * substantially similar to the "NO WARRANTY" disclaimer below
43 * ("Disclaimer") and any redistribution must be conditioned upon including
44 * a substantially similar Disclaimer requirement for further binary
45 * redistribution.
2/*-
3 * LSI MPT Host Adapter FreeBSD Wrapper Definitions (CAM version)
4 *
5 * Copyright (c) 2000, 2001 by Greg Ansley, Adam Prewett
6 *
7 * Partially derived from Matty Jacobs ISP driver.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice immediately at the beginning of the file, without modification,
14 * this list of conditions, and the following disclaimer.
15 * 2. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 *
28 * Additional Copyright (c) 2002 by Matthew Jacob under same license.
29 */
30/*-
31 * Copyright (c) 2004, Avid Technology, Inc. and its contributors.
32 * Copyright (c) 2005, WHEEL Sp. z o.o.
33 * Copyright (c) 2004, 2005 Justin T. Gibbs
34 * All rights reserved.
35 *
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions are
38 * met:
39 * 1. Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
42 * substantially similar to the "NO WARRANTY" disclaimer below
43 * ("Disclaimer") and any redistribution must be conditioned upon including
44 * a substantially similar Disclaimer requirement for further binary
45 * redistribution.
46 * 3. Neither the name of the LSI Logic Corporation nor the names of its
47 * contributors may be used to endorse or promote products derived from
48 * this software without specific prior written permission.
46 * 3. Neither the names of the above listed copyright holders nor the names
47 * of any contributors may be used to endorse or promote products derived
48 * from this software without specific prior written permission.
49 *
50 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
51 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
52 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
53 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
54 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
55 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
56 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
57 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
58 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
59 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE COPYRIGHT
60 * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 */
62#ifndef _MPT_CAM_H_
63#define _MPT_CAM_H_
64
65#include <cam/cam.h>
66#include <cam/cam_debug.h>
67#include <cam/cam_ccb.h>
68#include <cam/cam_sim.h>
69#include <cam/cam_xpt.h>
70#include <cam/cam_xpt_sim.h>
71#include <cam/cam_debug.h>
72#include <cam/scsi/scsi_all.h>
73#include <cam/scsi/scsi_message.h>
74
75#define ccb_mpt_ptr sim_priv.entries[0].ptr
76#define ccb_req_ptr sim_priv.entries[1].ptr
77
78/************************** CCB Manipulation Routines *************************/
79static __inline void mpt_freeze_ccb(union ccb *ccb);
80static __inline void mpt_set_ccb_status(union ccb *ccb, cam_status status);
81
82static __inline void
83mpt_freeze_ccb(union ccb *ccb)
84{
85 if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) {
86 ccb->ccb_h.status |= CAM_DEV_QFRZN;
87 xpt_freeze_devq(ccb->ccb_h.path, /*count*/1);
88 }
89}
90
91static __inline void
92mpt_set_ccb_status(union ccb *ccb, cam_status status)
93{
94 ccb->ccb_h.status &= ~CAM_STATUS_MASK;
95 ccb->ccb_h.status |= status;
96}
97
98/****************************** Timeout Recovery ******************************/
99/*
100 * The longest timeout specified for a Task Managent command.
101 */
102#define MPT_TMF_MAX_TIMEOUT (20000)
103
104static __inline void
105mpt_wakeup_recovery_thread(struct mpt_softc *mpt)
106{
107 wakeup(mpt);
108}
109
110#endif /*_MPT_CAM_H_ */
49 *
50 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
51 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
52 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
53 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
54 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
55 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
56 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
57 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
58 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
59 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE COPYRIGHT
60 * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 */
62#ifndef _MPT_CAM_H_
63#define _MPT_CAM_H_
64
65#include <cam/cam.h>
66#include <cam/cam_debug.h>
67#include <cam/cam_ccb.h>
68#include <cam/cam_sim.h>
69#include <cam/cam_xpt.h>
70#include <cam/cam_xpt_sim.h>
71#include <cam/cam_debug.h>
72#include <cam/scsi/scsi_all.h>
73#include <cam/scsi/scsi_message.h>
74
75#define ccb_mpt_ptr sim_priv.entries[0].ptr
76#define ccb_req_ptr sim_priv.entries[1].ptr
77
78/************************** CCB Manipulation Routines *************************/
79static __inline void mpt_freeze_ccb(union ccb *ccb);
80static __inline void mpt_set_ccb_status(union ccb *ccb, cam_status status);
81
82static __inline void
83mpt_freeze_ccb(union ccb *ccb)
84{
85 if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) {
86 ccb->ccb_h.status |= CAM_DEV_QFRZN;
87 xpt_freeze_devq(ccb->ccb_h.path, /*count*/1);
88 }
89}
90
91static __inline void
92mpt_set_ccb_status(union ccb *ccb, cam_status status)
93{
94 ccb->ccb_h.status &= ~CAM_STATUS_MASK;
95 ccb->ccb_h.status |= status;
96}
97
98/****************************** Timeout Recovery ******************************/
99/*
100 * The longest timeout specified for a Task Managent command.
101 */
102#define MPT_TMF_MAX_TIMEOUT (20000)
103
104static __inline void
105mpt_wakeup_recovery_thread(struct mpt_softc *mpt)
106{
107 wakeup(mpt);
108}
109
110#endif /*_MPT_CAM_H_ */