Deleted Added
full compact
scsi_da.c (76322) scsi_da.c (76362)
1/*
2 * Implementation of SCSI Direct Access Peripheral driver for CAM.
3 *
4 * Copyright (c) 1997 Justin T. Gibbs.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

20 * 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
26 * SUCH DAMAGE.
27 *
1/*
2 * Implementation of SCSI Direct Access Peripheral driver for CAM.
3 *
4 * Copyright (c) 1997 Justin T. Gibbs.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

20 * 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
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/cam/scsi/scsi_da.c 76322 2001-05-06 20:00:03Z phk $
28 * $FreeBSD: head/sys/cam/scsi/scsi_da.c 76362 2001-05-08 08:30:48Z phk $
29 */
30
31#ifdef _KERNEL
32#include "opt_hw_wdog.h"
33#endif /* _KERNEL */
34
35#include <sys/param.h>
36

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

550 u_int unit;
551 u_int part;
552 int s;
553
554 unit = dkunit(bp->bio_dev);
555 part = dkpart(bp->bio_dev);
556 periph = cam_extend_get(daperiphs, unit);
557 if (periph == NULL) {
29 */
30
31#ifdef _KERNEL
32#include "opt_hw_wdog.h"
33#endif /* _KERNEL */
34
35#include <sys/param.h>
36

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

550 u_int unit;
551 u_int part;
552 int s;
553
554 unit = dkunit(bp->bio_dev);
555 part = dkpart(bp->bio_dev);
556 periph = cam_extend_get(daperiphs, unit);
557 if (periph == NULL) {
558 bp->bio_error = ENXIO;
559 goto bad;
558 biofinish(bp, NULL, ENXIO);
559 return;
560 }
561 softc = (struct da_softc *)periph->softc;
562#if 0
563 /*
564 * check it's not too big a transfer for our adapter
565 */
566 scsi_minphys(bp,&sd_switch);
567#endif

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

573 */
574 s = splbio();
575
576 /*
577 * If the device has been made invalid, error out
578 */
579 if ((softc->flags & DA_FLAG_PACK_INVALID)) {
580 splx(s);
560 }
561 softc = (struct da_softc *)periph->softc;
562#if 0
563 /*
564 * check it's not too big a transfer for our adapter
565 */
566 scsi_minphys(bp,&sd_switch);
567#endif

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

573 */
574 s = splbio();
575
576 /*
577 * If the device has been made invalid, error out
578 */
579 if ((softc->flags & DA_FLAG_PACK_INVALID)) {
580 splx(s);
581 bp->bio_error = ENXIO;
582 goto bad;
581 biofinish(bp, NULL, ENXIO);
582 return;
583 }
584
585 /*
586 * Place it in the queue of disk activities for this disk
587 */
588 bioqdisksort(&softc->bio_queue, bp);
589
590 splx(s);
591
592 /*
593 * Schedule ourselves for performing the work.
594 */
595 xpt_schedule(periph, /* XXX priority */1);
596
597 return;
583 }
584
585 /*
586 * Place it in the queue of disk activities for this disk
587 */
588 bioqdisksort(&softc->bio_queue, bp);
589
590 splx(s);
591
592 /*
593 * Schedule ourselves for performing the work.
594 */
595 xpt_schedule(periph, /* XXX priority */1);
596
597 return;
598bad:
599 bp->bio_flags |= BIO_ERROR;
600
601 /*
602 * Correctly set the buf to indicate a completed xfer
603 */
604 bp->bio_resid = bp->bio_bcount;
605 biodone(bp);
606 return;
607}
608
609/* For 2.2-stable support */
610#ifndef ENOIOCTL
611#define ENOIOCTL -1
612#endif
613
614static int

--- 1033 unchanged lines hidden ---
598}
599
600/* For 2.2-stable support */
601#ifndef ENOIOCTL
602#define ENOIOCTL -1
603#endif
604
605static int

--- 1033 unchanged lines hidden ---