4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 *
21 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
22 * Use is subject to license terms.
23 *
24 * Copyright 2016 Joyent, Inc.
25 */
26
27 #ifndef _SYS_USB_SCSA2USB_H
28 #define _SYS_USB_SCSA2USB_H
29
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 #include <sys/usb/usba/usbai_private.h>
36
37 /*
38 * SCSA2USB: This header file contains the internal structures
39 * and variable definitions used in USB mass storage disk driver.
40 */
41
42
43 #define SCSA2USB_MAX_CLONE 256
44 #define SCSA2USB_INITIAL_ALLOC 4 /* initial soft space alloc */
638 /* Figure out Block Size before issuing a WRITE to CD-RW device */
639 #define SCSA2USB_CDRW_BLKSZ(bcount, len) ((bcount) / (len));
640 #define SCSA2USB_VALID_CDRW_BLKSZ(blksz) \
641 (((blksz) == CDROM_BLK_2048) || ((blksz) == CDROM_BLK_2352) || \
642 ((blksz) == CDROM_BLK_2336) || ((blksz) == CDROM_BLK_2324) || \
643 ((blksz) == 0))
644
645 /* debug and error msg logging */
646 #define DPRINT_MASK_SCSA 0x0001 /* for SCSA */
647 #define DPRINT_MASK_ATTA 0x0002 /* for ATTA */
648 #define DPRINT_MASK_EVENTS 0x0004 /* for event handling */
649 #define DPRINT_MASK_CALLBACKS 0x0008 /* for callbacks */
650 #define DPRINT_MASK_TIMEOUT 0x0010 /* for timeouts */
651 #define DPRINT_MASK_DUMPING 0x0020 /* for dumping */
652 #define DPRINT_MASK_PM 0x0040 /* for pwr mgmt */
653 #define DPRINT_MASK_ALL 0xffffffff /* for everything */
654
655 #ifdef DEBUG
656 #define SCSA2USB_PRINT_CDB scsa2usb_print_cdb
657 #else
658 #define SCSA2USB_PRINT_CDB 0 &&
659 #endif
660
661 /* ugen support */
662 #define SCSA2USB_MINOR_UGEN_BITS_MASK 0xff
663 #define SCSA2USB_MINOR_INSTANCE_MASK ~SCSA2USB_MINOR_UGEN_BITS_MASK
664 #define SCSA2USB_MINOR_INSTANCE_SHIFT 8
665
666 #define SCSA2USB_MINOR_TO_INSTANCE(minor) \
667 (((minor) & SCSA2USB_MINOR_INSTANCE_MASK) >> \
668 SCSA2USB_MINOR_INSTANCE_SHIFT)
669
670 #ifdef __cplusplus
671 }
672 #endif
673
674 #endif /* _SYS_USB_SCSA2USB_H */
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 *
21 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
22 * Use is subject to license terms.
23 *
24 * Copyright 2019, Joyent, Inc.
25 */
26
27 #ifndef _SYS_USB_SCSA2USB_H
28 #define _SYS_USB_SCSA2USB_H
29
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 #include <sys/usb/usba/usbai_private.h>
36
37 /*
38 * SCSA2USB: This header file contains the internal structures
39 * and variable definitions used in USB mass storage disk driver.
40 */
41
42
43 #define SCSA2USB_MAX_CLONE 256
44 #define SCSA2USB_INITIAL_ALLOC 4 /* initial soft space alloc */
638 /* Figure out Block Size before issuing a WRITE to CD-RW device */
639 #define SCSA2USB_CDRW_BLKSZ(bcount, len) ((bcount) / (len));
640 #define SCSA2USB_VALID_CDRW_BLKSZ(blksz) \
641 (((blksz) == CDROM_BLK_2048) || ((blksz) == CDROM_BLK_2352) || \
642 ((blksz) == CDROM_BLK_2336) || ((blksz) == CDROM_BLK_2324) || \
643 ((blksz) == 0))
644
645 /* debug and error msg logging */
646 #define DPRINT_MASK_SCSA 0x0001 /* for SCSA */
647 #define DPRINT_MASK_ATTA 0x0002 /* for ATTA */
648 #define DPRINT_MASK_EVENTS 0x0004 /* for event handling */
649 #define DPRINT_MASK_CALLBACKS 0x0008 /* for callbacks */
650 #define DPRINT_MASK_TIMEOUT 0x0010 /* for timeouts */
651 #define DPRINT_MASK_DUMPING 0x0020 /* for dumping */
652 #define DPRINT_MASK_PM 0x0040 /* for pwr mgmt */
653 #define DPRINT_MASK_ALL 0xffffffff /* for everything */
654
655 #ifdef DEBUG
656 #define SCSA2USB_PRINT_CDB scsa2usb_print_cdb
657 #else
658 #define SCSA2USB_PRINT_CDB(...)
659 #endif
660
661 /* ugen support */
662 #define SCSA2USB_MINOR_UGEN_BITS_MASK 0xff
663 #define SCSA2USB_MINOR_INSTANCE_MASK ~SCSA2USB_MINOR_UGEN_BITS_MASK
664 #define SCSA2USB_MINOR_INSTANCE_SHIFT 8
665
666 #define SCSA2USB_MINOR_TO_INSTANCE(minor) \
667 (((minor) & SCSA2USB_MINOR_INSTANCE_MASK) >> \
668 SCSA2USB_MINOR_INSTANCE_SHIFT)
669
670 #ifdef __cplusplus
671 }
672 #endif
673
674 #endif /* _SYS_USB_SCSA2USB_H */
|