scsi_sa.c (168752) | scsi_sa.c (168872) |
---|---|
1/*- 2 * Implementation of SCSI Sequential Access Peripheral driver for CAM. 3 * 4 * Copyright (c) 1999, 2000 Matthew Jacob 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 --- 13 unchanged lines hidden (view full) --- 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 29#include <sys/cdefs.h> | 1/*- 2 * Implementation of SCSI Sequential Access Peripheral driver for CAM. 3 * 4 * Copyright (c) 1999, 2000 Matthew Jacob 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 --- 13 unchanged lines hidden (view full) --- 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 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_sa.c 168752 2007-04-15 08:49:19Z scottl $"); | 30__FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_sa.c 168872 2007-04-19 18:14:33Z scottl $"); |
31 32#include <sys/param.h> 33#include <sys/queue.h> 34#ifdef _KERNEL 35#include <sys/systm.h> 36#include <sys/kernel.h> 37#endif 38#include <sys/types.h> --- 1477 unchanged lines hidden (view full) --- 1516 * The SA driver supports a blocksize, but we don't know the 1517 * blocksize until we media is inserted. So, set a flag to 1518 * indicate that the blocksize is unavailable right now. 1519 */ 1520 softc->device_stats = devstat_new_entry("sa", periph->unit_number, 0, 1521 DEVSTAT_BS_UNAVAILABLE, SID_TYPE(&cgd->inq_data) | 1522 DEVSTAT_TYPE_IF_SCSI, DEVSTAT_PRIORITY_TAPE); 1523 | 31 32#include <sys/param.h> 33#include <sys/queue.h> 34#ifdef _KERNEL 35#include <sys/systm.h> 36#include <sys/kernel.h> 37#endif 38#include <sys/types.h> --- 1477 unchanged lines hidden (view full) --- 1516 * The SA driver supports a blocksize, but we don't know the 1517 * blocksize until we media is inserted. So, set a flag to 1518 * indicate that the blocksize is unavailable right now. 1519 */ 1520 softc->device_stats = devstat_new_entry("sa", periph->unit_number, 0, 1521 DEVSTAT_BS_UNAVAILABLE, SID_TYPE(&cgd->inq_data) | 1522 DEVSTAT_TYPE_IF_SCSI, DEVSTAT_PRIORITY_TAPE); 1523 |
1524 cam_periph_unlock(periph); |
|
1524 softc->devs.ctl_dev = make_dev(&sa_cdevsw, SAMINOR(SA_CTLDEV, 1525 periph->unit_number, 0, SA_ATYPE_R), UID_ROOT, GID_OPERATOR, 1526 0660, "%s%d.ctl", periph->periph_name, periph->unit_number); 1527 softc->devs.ctl_dev->si_drv1 = periph; 1528 1529 for (i = 0; i < SA_NUM_MODES; i++) { 1530 1531 softc->devs.mode_devs[i].r_dev = make_dev(&sa_cdevsw, --- 26 unchanged lines hidden (view full) --- 1558 alias = make_dev_alias(softc->devs.mode_devs[i].nr_dev, 1559 "n%s%d", periph->periph_name, periph->unit_number); 1560 alias->si_drv1 = periph; 1561 alias = make_dev_alias(softc->devs.mode_devs[i].er_dev, 1562 "e%s%d", periph->periph_name, periph->unit_number); 1563 alias->si_drv1 = periph; 1564 } 1565 } | 1525 softc->devs.ctl_dev = make_dev(&sa_cdevsw, SAMINOR(SA_CTLDEV, 1526 periph->unit_number, 0, SA_ATYPE_R), UID_ROOT, GID_OPERATOR, 1527 0660, "%s%d.ctl", periph->periph_name, periph->unit_number); 1528 softc->devs.ctl_dev->si_drv1 = periph; 1529 1530 for (i = 0; i < SA_NUM_MODES; i++) { 1531 1532 softc->devs.mode_devs[i].r_dev = make_dev(&sa_cdevsw, --- 26 unchanged lines hidden (view full) --- 1559 alias = make_dev_alias(softc->devs.mode_devs[i].nr_dev, 1560 "n%s%d", periph->periph_name, periph->unit_number); 1561 alias->si_drv1 = periph; 1562 alias = make_dev_alias(softc->devs.mode_devs[i].er_dev, 1563 "e%s%d", periph->periph_name, periph->unit_number); 1564 alias->si_drv1 = periph; 1565 } 1566 } |
1567 cam_periph_lock(periph); |
|
1566 1567 /* 1568 * Add an async callback so that we get 1569 * notified if this device goes away. 1570 */ 1571 xpt_setup_ccb(&csa.ccb_h, periph->path, /* priority */ 5); 1572 csa.ccb_h.func_code = XPT_SASYNC_CB; 1573 csa.event_enable = AC_LOST_DEVICE; --- 2082 unchanged lines hidden --- | 1568 1569 /* 1570 * Add an async callback so that we get 1571 * notified if this device goes away. 1572 */ 1573 xpt_setup_ccb(&csa.ccb_h, periph->path, /* priority */ 5); 1574 csa.ccb_h.func_code = XPT_SASYNC_CB; 1575 csa.event_enable = AC_LOST_DEVICE; --- 2082 unchanged lines hidden --- |