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 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 |
104MALLOC_DEFINE(M_SCSISA, "SCSI sa", "SCSI sequential access buffers"); |
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"); |
1358 free(softc, M_SCSISA); |
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 *) |
1424 malloc(sizeof (*softc), M_SCSISA, M_NOWAIT | M_ZERO); |
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 --- |