Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/luna68k/stand/boot Pull more cleanups from OpenBSD/...
details: https://anonhg.NetBSD.org/src/rev/711ab6da7690
branches: trunk
changeset: 792422:711ab6da7690
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Fri Jan 03 07:17:19 2014 +0000
description:
Pull more cleanups from OpenBSD/luna88k:
- remove unused declarations
- rename struct scsi_fmt_cdb to scsi_generic_cdb
diffstat:
sys/arch/luna68k/stand/boot/samachdep.h | 10 +-
sys/arch/luna68k/stand/boot/sc.c | 4 +-
sys/arch/luna68k/stand/boot/scsi.c | 12 +-
sys/arch/luna68k/stand/boot/scsireg.h | 201 +----------------------------
sys/arch/luna68k/stand/boot/sd.c | 12 +-
sys/arch/luna68k/stand/boot/ufs_disksubr.c | 4 +-
6 files changed, 21 insertions(+), 222 deletions(-)
diffs (truncated from 383 to 300 lines):
diff -r 98d1df49980e -r 711ab6da7690 sys/arch/luna68k/stand/boot/samachdep.h
--- a/sys/arch/luna68k/stand/boot/samachdep.h Fri Jan 03 07:14:20 2014 +0000
+++ b/sys/arch/luna68k/stand/boot/samachdep.h Fri Jan 03 07:17:19 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: samachdep.h,v 1.13 2014/01/03 06:37:13 tsutsui Exp $ */
+/* $NetBSD: samachdep.h,v 1.14 2014/01/03 07:17:19 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1990, 1993
@@ -84,10 +84,6 @@
int cngetc(void);
void cnputc(int);
-/* devopen.c */
-extern u_int opendev;
-int atoi(char *);
-
/* disklabel.c */
extern u_char lbl_buff[];
int disklabel(int, char **);
@@ -171,8 +167,8 @@
void romcnputc(dev_t, int);
/* sc.c */
-struct scsi_fmt_cdb;
-int scsi_immed_command(int, int, int, struct scsi_fmt_cdb *, u_char *,
+struct scsi_generic_cdb;
+int scsi_immed_command(int, int, int, struct scsi_generic_cdb *, u_char *,
unsigned int);
int scsi_request_sense(int, int, int, u_char *, unsigned int);
int scsi_test_unit_rdy(int, int, int);
diff -r 98d1df49980e -r 711ab6da7690 sys/arch/luna68k/stand/boot/sc.c
--- a/sys/arch/luna68k/stand/boot/sc.c Fri Jan 03 07:14:20 2014 +0000
+++ b/sys/arch/luna68k/stand/boot/sc.c Fri Jan 03 07:17:19 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sc.c,v 1.7 2014/01/02 19:50:03 tsutsui Exp $ */
+/* $NetBSD: sc.c,v 1.8 2014/01/03 07:17:19 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -453,7 +453,7 @@
}
int
-scsi_immed_command(int ctlr, int slave, int unit, struct scsi_fmt_cdb *cdb,
+scsi_immed_command(int ctlr, int slave, int unit, struct scsi_generic_cdb *cdb,
u_char *buf, unsigned int len)
{
int status;
diff -r 98d1df49980e -r 711ab6da7690 sys/arch/luna68k/stand/boot/scsi.c
--- a/sys/arch/luna68k/stand/boot/scsi.c Fri Jan 03 07:14:20 2014 +0000
+++ b/sys/arch/luna68k/stand/boot/scsi.c Fri Jan 03 07:17:19 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scsi.c,v 1.3 2014/01/02 19:50:03 tsutsui Exp $ */
+/* $NetBSD: scsi.c,v 1.4 2014/01/03 07:17:19 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -89,13 +89,13 @@
u_char sensbuff[SENSBUFF]; /* ï¼?以ä¸?ã?¯ç?¡æ??å?³ã?§ã??ã??ã?? */
static struct scsi_inquiry inquirybuf;
-static struct scsi_fmt_cdb inquiry = {
+static struct scsi_generic_cdb inquiry = {
6,
{ CMD_INQUIRY, 0, 0, 0, sizeof(inquirybuf), 0 }
};
static u_long capacitybuf[2];
-struct scsi_fmt_cdb capacity = {
+struct scsi_generic_cdb capacity = {
10,
{ CMD_READ_CAPACITY, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
@@ -187,7 +187,7 @@
return(ST_NORMAL);
}
-static struct scsi_fmt_cdb scsi_cdb = {
+static struct scsi_generic_cdb scsi_cdb = {
10,
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
@@ -195,7 +195,7 @@
int
scsi_read_raw(u_int target, u_int blk, u_int nblk, u_char *buff, u_int len)
{
- struct scsi_fmt_cdb *cdb = &scsi_cdb;
+ struct scsi_generic_cdb *cdb = &scsi_cdb;
cdb->cdb[0] = CMD_READ_EXT;
@@ -224,7 +224,7 @@
int
scsi_write(u_int blk, u_char *buff, u_int len)
{
- struct scsi_fmt_cdb *cdb = &scsi_cdb;
+ struct scsi_generic_cdb *cdb = &scsi_cdb;
cdb->cdb[0] = CMD_WRITE_EXT;
diff -r 98d1df49980e -r 711ab6da7690 sys/arch/luna68k/stand/boot/scsireg.h
--- a/sys/arch/luna68k/stand/boot/scsireg.h Fri Jan 03 07:14:20 2014 +0000
+++ b/sys/arch/luna68k/stand/boot/scsireg.h Fri Jan 03 07:17:19 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scsireg.h,v 1.2 2013/01/22 15:48:40 tsutsui Exp $ */
+/* $NetBSD: scsireg.h,v 1.3 2014/01/03 07:17:19 tsutsui Exp $ */
/*
* Copyright (c) 1990, 1992, 1993
@@ -259,204 +259,7 @@
char rev[4];
};
-struct scsi_format_parms { /* physical BFI format */
- u_short reserved;
- u_short list_len;
- struct defect {
- unsigned cyl : 24;
- unsigned head : 8;
- long bytes_from_index;
- } defect[127];
-} format_parms;
-
-struct scsi_reassign_parms {
- u_short reserved;
- u_short list_len; /* length in bytes of defects only */
- struct new_defect {
- unsigned lba; /* logical block address */
- } new_defect[2];
-} reassign_parms;
-
-struct scsi_modesel_hdr {
- u_char rsvd1;
- u_char media_type;
- u_char rsvd2;
- u_char block_desc_len;
- u_int density : 8;
- u_int number_blocks :24;
- u_int rsvd3 : 8;
- u_int block_length :24;
-};
-
-struct scsi_modesense_hdr {
- u_char len;
- u_char media_type;
- u_char wp : 1;
- u_char rsvd1 : 7;
- u_char block_desc_len;
- u_int density : 8;
- u_int number_blocks :24;
- u_int rsvd2 : 8;
- u_int block_length :24;
-};
-
-/*
- * Mode Select / Mode sense "pages"
- */
-
-/*
- * Page One - Error Recovery Parameters
- */
-struct scsi_err_recovery {
- u_char page_savable : 1; /* save parameters */
- u_char reserved : 1;
- u_char page_code : 6; /* = 0x01 */
- u_char page_length; /* = 6 */
- u_char awre : 1; /* auto write realloc enabled */
- u_char arre : 1; /* auto read realloc enabled */
- u_char tb : 1; /* transfer block */
- u_char rc : 1; /* read continuous */
- u_char eec : 1; /* enable early correction */
- u_char per : 1; /* post error */
- u_char dte : 1; /* disable transfer on error */
- u_char dcr : 1; /* disable correction */
- u_char retry_count;
- u_char correction_span;
- u_char head_offset_count;
- u_char strobe_offset_count;
- u_char recovery_time_limit;
-};
-
-/*
- * Page Two - Disconnect / Reconnect Control Parameters
- */
-struct scsi_disco_reco {
- u_char page_savable : 1; /* save parameters */
- u_char rsvd : 1;
- u_char page_code : 6; /* = 0x02 */
- u_char page_length; /* = 10 */
- u_char buffer_full_ratio; /* write, how full before reconnect? */
- u_char buffer_empty_ratio; /* read, how full before reconnect? */
-
- u_short bus_inactivity_limit; /* how much bus time for busy */
- u_short disconnect_time_limit; /* min to remain disconnected */
- u_short connect_time_limit; /* min to remain connected */
- u_short reserved_1;
-};
-
-/*
- * Page Three - Direct Access Device Format Parameters
- */
-struct scsi_format {
- u_char page_savable : 1; /* save parameters */
- u_char rsvd : 1;
- u_char page_code : 6; /* = 0x03 */
- u_char page_length; /* = 22 */
- u_short tracks_per_zone; /* Handling of Defects Fields */
- u_short alt_sect_zone;
- u_short alt_tracks_zone;
- u_short alt_tracks_vol;
- u_short sect_track; /* Track Format Field */
- u_short data_sect; /* Sector Format Fields */
- u_short interleave;
- u_short track_skew_factor;
- u_short cyl_skew_factor;
- u_char ssec : 1; /* Drive Type Field */
- u_char hsec : 1;
- u_char rmb : 1;
- u_char surf : 1;
- u_char ins : 1;
- u_char reserved_1 : 3;
- u_char reserved_2;
- u_char reserved_3;
- u_char reserved_4;
-};
-
-/*
- * Page Four - Rigid Disk Drive Geometry Parameters
- */
-struct scsi_geometry {
- u_char page_savable : 1; /* save parameters */
- u_char rsvd : 1;
- u_char page_code : 6; /* = 0x04 */
- u_char page_length; /* = 18 */
- u_char cyl_ub; /* number of cylinders */
- u_char cyl_mb;
- u_char cyl_lb;
- u_char heads; /* number of heads */
- u_char precomp_cyl_ub; /* cylinder to start precomp */
- u_char precomp_cyl_mb;
- u_char precomp_cyl_lb;
- u_char current_cyl_ub; /* cyl to start reduced current */
- u_char current_cyl_mb;
- u_char current_cyl_lb;
- u_short step_rate; /* drive step rate */
- u_char landing_cyl_ub; /* landing zone cylinder */
- u_char landing_cyl_mb;
- u_char landing_cyl_lb;
- u_char reserved_1;
- u_char reserved_2;
- u_char reserved_3;
-};
-
-/*
- * Page 0x38 - Cache Control Parameters
- */
-struct scsi_cache {
- u_char page_savable : 1; /* save parameters */
- u_char rsvd : 1;
- u_char page_code : 6; /* = 0x38 */
- u_char page_length; /* = 14 */
- u_char rsvd_1 : 1;
- u_char wie : 1; /* write index enable */
- u_char rsvd_2 : 1;
- u_char ce : 1; /* cache enable */
- u_char table_size : 4;
- u_char prefetch_threshold;
- u_char maximum_threshold;
- u_char maximumprefetch_multiplier;
- u_char minimum_threshold;
- u_char minimum_prefetch_multiplier;
- u_char reserved[8];
-};
-
-/*
- * Driver ioctl's for various scsi operations.
- */
-#ifndef _IOCTL_
-#if 0
-#include <sys/ioctl.h>
-#endif
-#endif
-
-/*
- * Control for SCSI "format" mode.
- *
- * "Format" mode allows a privileged process to issue direct SCSI
- * commands to a drive (it is intended primarily to allow on-line
- * formatting). SDIOCSFORMAT with a non-zero arg will put the drive
- * into format mode; a zero arg will take it out. When in format
- * mode, only the process that issued the SDIOCFORMAT can read or
- * write the drive.
- *
- * In format mode, process is expected to
- * - do SDIOCSCSICOMMAND to supply cdb for next SCSI op
- * - do read or write as appropriate for cdb
- * - if i/o error, optionally do SDIOCSENSE to get completion
- * status and sense data from last scsi operation.
- */
Home |
Main Index |
Thread Index |
Old Index