Deleted Added
full compact
scsi_sa.c (145050) scsi_sa.c (147723)
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 145050 2005-04-14 04:51:18Z mjacob $");
30__FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_sa.c 147723 2005-07-01 15:21:30Z avatar $");
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>

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

96#define QFRLS(ccb) \
97 if (((ccb)->ccb_h.status & CAM_DEV_QFRZN) != 0) \
98 cam_release_devq((ccb)->ccb_h.path, 0, 0, 0, FALSE)
99
100/*
101 * Driver states
102 */
103
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>

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

96#define QFRLS(ccb) \
97 if (((ccb)->ccb_h.status & CAM_DEV_QFRZN) != 0) \
98 cam_release_devq((ccb)->ccb_h.path, 0, 0, 0, FALSE)
99
100/*
101 * Driver states
102 */
103
104MALLOC_DEFINE(M_SCSISA, "SCSI sa", "SCSI sequential access buffers");
104
105typedef enum {
106 SA_STATE_NORMAL, SA_STATE_ABNORMAL
107} sa_state;
108
109#define ccb_pflags ppriv_field0
110#define ccb_bp ppriv_ptr1
111

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

1349 for (i = 0; i < SA_NUM_MODES; i++) {
1350 destroy_dev(softc->devs.mode_devs[i].r_dev);
1351 destroy_dev(softc->devs.mode_devs[i].nr_dev);
1352 destroy_dev(softc->devs.mode_devs[i].er_dev);
1353 }
1354
1355 xpt_print_path(periph->path);
1356 printf("removing device entry\n");
105
106typedef enum {
107 SA_STATE_NORMAL, SA_STATE_ABNORMAL
108} sa_state;
109
110#define ccb_pflags ppriv_field0
111#define ccb_bp ppriv_ptr1
112

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

1350 for (i = 0; i < SA_NUM_MODES; i++) {
1351 destroy_dev(softc->devs.mode_devs[i].r_dev);
1352 destroy_dev(softc->devs.mode_devs[i].nr_dev);
1353 destroy_dev(softc->devs.mode_devs[i].er_dev);
1354 }
1355
1356 xpt_print_path(periph->path);
1357 printf("removing device entry\n");
1357 free(softc, M_DEVBUF);
1358 free(softc, M_SCSISA);
1358}
1359
1360static void
1361saasync(void *callback_arg, u_int32_t code,
1362 struct cam_path *path, void *arg)
1363{
1364 struct cam_periph *periph;
1365

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

1415 }
1416
1417 if (cgd == NULL) {
1418 printf("saregister: no getdev CCB, can't register device\n");
1419 return (CAM_REQ_CMP_ERR);
1420 }
1421
1422 softc = (struct sa_softc *)
1359}
1360
1361static void
1362saasync(void *callback_arg, u_int32_t code,
1363 struct cam_path *path, void *arg)
1364{
1365 struct cam_periph *periph;
1366

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

1416 }
1417
1418 if (cgd == NULL) {
1419 printf("saregister: no getdev CCB, can't register device\n");
1420 return (CAM_REQ_CMP_ERR);
1421 }
1422
1423 softc = (struct sa_softc *)
1423 malloc(sizeof (*softc), M_DEVBUF, M_NOWAIT | M_ZERO);
1424 malloc(sizeof (*softc), M_SCSISA, M_NOWAIT | M_ZERO);
1424 if (softc == NULL) {
1425 printf("saregister: Unable to probe new device. "
1426 "Unable to allocate softc\n");
1427 return (CAM_REQ_CMP_ERR);
1428 }
1429 softc->scsi_rev = SID_ANSI_REV(&cgd->inq_data);
1430 softc->state = SA_STATE_NORMAL;
1431 softc->fileno = (daddr_t) -1;

--- 2174 unchanged lines hidden ---
1425 if (softc == NULL) {
1426 printf("saregister: Unable to probe new device. "
1427 "Unable to allocate softc\n");
1428 return (CAM_REQ_CMP_ERR);
1429 }
1430 softc->scsi_rev = SID_ANSI_REV(&cgd->inq_data);
1431 softc->state = SA_STATE_NORMAL;
1432 softc->fileno = (daddr_t) -1;

--- 2174 unchanged lines hidden ---