Deleted Added
full compact
scsi_target.c (228481) scsi_target.c (236712)
1/*-
2 * Generic SCSI Target Kernel Mode Driver
3 *
4 * Copyright (c) 2002 Nate Lawson.
5 * Copyright (c) 1998, 1999, 2001, 2002 Justin T. Gibbs.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Generic SCSI Target Kernel Mode Driver
3 *
4 * Copyright (c) 2002 Nate Lawson.
5 * Copyright (c) 1998, 1999, 2001, 2002 Justin T. Gibbs.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_target.c 228481 2011-12-13 21:26:33Z ed $");
31__FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_target.c 236712 2012-06-07 10:05:51Z mav $");
32
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/kernel.h>
37#include <sys/conf.h>
38#include <sys/malloc.h>
39#include <sys/poll.h>

--- 221 unchanged lines hidden (view full) ---

261 break;
262 }
263 cam_periph_lock(softc->periph);
264 status = targdisable(softc);
265 cam_periph_unlock(softc->periph);
266 break;
267 case TARGIOCDEBUG:
268 {
32
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/kernel.h>
37#include <sys/conf.h>
38#include <sys/malloc.h>
39#include <sys/poll.h>

--- 221 unchanged lines hidden (view full) ---

261 break;
262 }
263 cam_periph_lock(softc->periph);
264 status = targdisable(softc);
265 cam_periph_unlock(softc->periph);
266 break;
267 case TARGIOCDEBUG:
268 {
269#ifdef CAMDEBUG
270 struct ccb_debug cdbg;
271
272 /* If no periph available, disallow debugging changes */
273 if ((softc->state & TARG_STATE_LUN_ENABLED) == 0) {
274 status = CAM_DEV_NOT_THERE;
275 break;
276 }
277 bzero(&cdbg, sizeof cdbg);

--- 4 unchanged lines hidden (view full) ---

282 cam_periph_lock(softc->periph);
283 xpt_setup_ccb(&cdbg.ccb_h, softc->path, CAM_PRIORITY_NORMAL);
284 cdbg.ccb_h.func_code = XPT_DEBUG;
285 cdbg.ccb_h.cbfcnp = targdone;
286
287 xpt_action((union ccb *)&cdbg);
288 cam_periph_unlock(softc->periph);
289 status = cdbg.ccb_h.status & CAM_STATUS_MASK;
269 struct ccb_debug cdbg;
270
271 /* If no periph available, disallow debugging changes */
272 if ((softc->state & TARG_STATE_LUN_ENABLED) == 0) {
273 status = CAM_DEV_NOT_THERE;
274 break;
275 }
276 bzero(&cdbg, sizeof cdbg);

--- 4 unchanged lines hidden (view full) ---

281 cam_periph_lock(softc->periph);
282 xpt_setup_ccb(&cdbg.ccb_h, softc->path, CAM_PRIORITY_NORMAL);
283 cdbg.ccb_h.func_code = XPT_DEBUG;
284 cdbg.ccb_h.cbfcnp = targdone;
285
286 xpt_action((union ccb *)&cdbg);
287 cam_periph_unlock(softc->periph);
288 status = cdbg.ccb_h.status & CAM_STATUS_MASK;
290#else
291 status = CAM_FUNC_NOTAVAIL;
292#endif
293 break;
294 }
295 default:
296 status = CAM_PROVIDE_FAIL;
297 break;
298 }
299
300 return (targcamstatus(status));

--- 872 unchanged lines hidden ---
289 break;
290 }
291 default:
292 status = CAM_PROVIDE_FAIL;
293 break;
294 }
295
296 return (targcamstatus(status));

--- 872 unchanged lines hidden ---