From owner-p4-projects Tue Jun 4 15:14:36 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 08A3E37B405; Tue, 4 Jun 2002 15:14:11 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 011CE37B401 for ; Tue, 4 Jun 2002 15:14:04 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g54ME3g14208 for perforce@freebsd.org; Tue, 4 Jun 2002 15:14:03 -0700 (PDT) (envelope-from jhb@freebsd.org) Date: Tue, 4 Jun 2002 15:14:03 -0700 (PDT) Message-Id: <200206042214.g54ME3g14208@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 12372 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=12372 Change 12372 by jhb@jhb_laptop on 2002/06/04 15:13:31 IFC. Affected files ... ... //depot/projects/smpng/sys/cam/scsi/scsi_all.c#9 integrate ... //depot/projects/smpng/sys/cam/scsi/scsi_all.h#3 integrate ... //depot/projects/smpng/sys/kern/kern_mutex.c#37 integrate ... //depot/projects/smpng/sys/sparc64/include/tsb.h#8 integrate Differences ... ==== //depot/projects/smpng/sys/cam/scsi/scsi_all.c#9 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/cam/scsi/scsi_all.c,v 1.33 2002/04/23 06:14:10 marcel Exp $ + * $FreeBSD: src/sys/cam/scsi/scsi_all.c,v 1.34 2002/06/04 17:41:47 mjacob Exp $ */ #include @@ -2582,6 +2582,34 @@ timeout); } +/* + * Prevent or allow the user to remove the media + */ +void +scsi_prevent(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t action, + u_int8_t sense_len, u_int32_t timeout) +{ + struct scsi_prevent *scsi_cmd; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_NONE, + tag_action, + /*data_ptr*/NULL, + /*dxfer_len*/0, + sense_len, + sizeof(*scsi_cmd), + timeout); + + scsi_cmd = (struct scsi_prevent *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = PREVENT_ALLOW; + scsi_cmd->how = action; +} + /* XXX allow specification of address and PMI bit and LBA */ void scsi_read_capacity(struct ccb_scsiio *csio, u_int32_t retries, @@ -2608,32 +2636,28 @@ scsi_cmd->opcode = READ_CAPACITY; } -/* - * Prevent or allow the user to remove the media - */ void -scsi_prevent(struct ccb_scsiio *csio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int8_t tag_action, u_int8_t action, - u_int8_t sense_len, u_int32_t timeout) +scsi_report_luns(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, struct scsi_report_luns_data *rpl_buf, + u_int32_t alloc_len, u_int8_t sense_len, u_int32_t timeout) { - struct scsi_prevent *scsi_cmd; + struct scsi_report_luns *scsi_cmd; cam_fill_csio(csio, retries, cbfcnp, - /*flags*/CAM_DIR_NONE, + /*flags*/CAM_DIR_IN, tag_action, - /*data_ptr*/NULL, - /*dxfer_len*/0, + /*data_ptr*/(u_int8_t *)rpl_buf, + /*dxfer_len*/alloc_len, sense_len, sizeof(*scsi_cmd), timeout); - - scsi_cmd = (struct scsi_prevent *)&csio->cdb_io.cdb_bytes; + scsi_cmd = (struct scsi_report_luns *)&csio->cdb_io.cdb_bytes; bzero(scsi_cmd, sizeof(*scsi_cmd)); - scsi_cmd->opcode = PREVENT_ALLOW; - scsi_cmd->how = action; + scsi_cmd->opcode = REPORT_LUNS; + scsi_ulto4b(alloc_len, scsi_cmd->addr); } /* ==== //depot/projects/smpng/sys/cam/scsi/scsi_all.h#3 (text+ko) ==== @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * $FreeBSD: src/sys/cam/scsi/scsi_all.h,v 1.18 2001/08/27 01:29:30 kbyanc Exp $ + * $FreeBSD: src/sys/cam/scsi/scsi_all.h,v 1.19 2002/06/04 17:41:47 mjacob Exp $ */ /* @@ -505,6 +505,7 @@ #define LOG_SENSE 0x4d #define MODE_SELECT_10 0x55 #define MODE_SENSE_10 0x5A +#define REPORT_LUNS 0xA0 #define MOVE_MEDIUM 0xa5 #define READ_12 0xa8 #define WRITE_12 0xaa @@ -675,6 +676,29 @@ u_int8_t length[4]; }; +struct scsi_report_luns +{ + u_int8_t opcode; + u_int8_t byte2; + u_int8_t unused[3]; + u_int8_t addr[4]; + u_int8_t control; +}; + +struct scsi_report_luns_data { + u_int8_t length[4]; /* length of LUN inventory, in bytes */ + u_int8_t reserved[4]; /* unused */ + /* + * LUN inventory- we only support the type zero form for now. + */ + struct { + u_int8_t lundata[8]; + } luns[1]; +}; +#define RPL_LUNDATA_ATYP_MASK 0xc0 /* MBZ for type 0 lun */ +#define RPL_LUNDATA_T0LUN 1 /* @ lundata[1] */ + + struct scsi_sense_data { u_int8_t error_code; @@ -753,6 +777,8 @@ #define SCSI_DEFAULT_DENSITY 0x00 /* use 'default' density */ #define SCSI_SAME_DENSITY 0x7f /* use 'same' density- >= SCSI-2 only */ + + /* * Status Byte */ @@ -943,16 +969,23 @@ u_int32_t param_len, u_int8_t sense_len, u_int32_t timeout); +void scsi_prevent(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t action, + u_int8_t sense_len, u_int32_t timeout); + void scsi_read_capacity(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, - struct scsi_read_capacity_data *rcap_buf, + struct scsi_read_capacity_data *, u_int8_t sense_len, u_int32_t timeout); -void scsi_prevent(struct ccb_scsiio *csio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int8_t tag_action, u_int8_t action, - u_int8_t sense_len, u_int32_t timeout); +void scsi_report_luns(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, + union ccb *), u_int8_t tag_action, + struct scsi_report_luns_data *, + u_int32_t alloc_len, u_int8_t sense_len, + u_int32_t timeout); void scsi_synchronize_cache(struct ccb_scsiio *csio, u_int32_t retries, ==== //depot/projects/smpng/sys/kern/kern_mutex.c#37 (text+ko) ==== @@ -27,7 +27,7 @@ * * from BSDI $Id: mutex_witness.c,v 1.1.2.20 2000/04/27 03:10:27 cp Exp $ * and BSDI $Id: synch_machdep.c,v 2.3.2.39 2000/04/27 03:10:25 cp Exp $ - * $FreeBSD: src/sys/kern/kern_mutex.c,v 1.98 2002/05/23 03:08:42 des Exp $ + * $FreeBSD: src/sys/kern/kern_mutex.c,v 1.100 2002/06/04 21:53:48 jhb Exp $ */ /* ==== //depot/projects/smpng/sys/sparc64/include/tsb.h#8 (text+ko) ==== @@ -26,13 +26,13 @@ * SUCH DAMAGE. * * from: BSDI: pmap.v9.h,v 1.10.2.6 1999/08/23 22:18:44 cp Exp - * $FreeBSD: src/sys/sparc64/include/tsb.h,v 1.14 2002/05/29 06:08:44 jake Exp $ + * $FreeBSD: src/sys/sparc64/include/tsb.h,v 1.15 2002/06/04 19:40:45 jake Exp $ */ #ifndef _MACHINE_TSB_H_ #define _MACHINE_TSB_H_ -#define TSB_PAGES_SHIFT (1) +#define TSB_PAGES_SHIFT (4) #define TSB_PAGES (1 << TSB_PAGES_SHIFT) #define TSB_BSHIFT (TSB_PAGES_SHIFT + PAGE_SHIFT) #define TSB_BSIZE (1UL << TSB_BSHIFT) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message