diff options
author | asami <asami@FreeBSD.org> | 1996-06-14 11:02:28 +0000 |
---|---|---|
committer | asami <asami@FreeBSD.org> | 1996-06-14 11:02:28 +0000 |
commit | 36a1932601c730683d263ee933dd90cd6dae96bf (patch) | |
tree | d76ce0bf0a31500c82596831333ff034e969773b /sys/scsi | |
parent | 5fa995752f02a42fcb2b0ca54149fef141f98060 (diff) | |
download | FreeBSD-src-36a1932601c730683d263ee933dd90cd6dae96bf.zip FreeBSD-src-36a1932601c730683d263ee933dd90cd6dae96bf.tar.gz |
The Great PC98 Merge.
All new code is "#ifdef PC98"ed so this should make no difference to
PC/AT (and its clones) users.
Ok'd by: core
Submitted by: FreeBSD(98) development team
Diffstat (limited to 'sys/scsi')
-rw-r--r-- | sys/scsi/scsiconf.c | 25 | ||||
-rw-r--r-- | sys/scsi/scsiconf.h | 10 | ||||
-rw-r--r-- | sys/scsi/sd.c | 43 |
3 files changed, 74 insertions, 4 deletions
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index 62efd5e..24223d3 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -16,7 +16,7 @@ * * New configuration setup: dufault@hda.com * - * $Id: scsiconf.c,v 1.58 1996/04/07 17:32:42 bde Exp $ + * $Id: scsiconf.c,v 1.59 1996/06/03 14:25:11 jfieber Exp $ */ #include "opt_scsi.h" @@ -29,6 +29,9 @@ #include <sys/sysctl.h> #include <sys/devconf.h> #include <sys/conf.h> +#ifdef PC98 +#include <sys/device.h> +#endif #include <machine/clock.h> @@ -619,6 +622,11 @@ scsi_assign_unit(struct scsi_link *sc_link) { int i; int found; +#ifdef PC98 + struct cfdata cf; + cf.cf_flags = 0; +#endif + found = 0; for (i = 0; scsi_dinit[i].name; i++) { if ((strcmp(sc_link->device->name, scsi_dinit[i].name) == 0) && @@ -630,6 +638,9 @@ scsi_assign_unit(struct scsi_link *sc_link) sc_link->scsibus == scsi_dinit[i].cunit) { sc_link->dev_unit = scsi_dinit[i].unit; found = 1; +#ifdef PC98 + cf.cf_flags = scsi_dinit[i].flags; +#endif if (bootverbose) printf("%s is configured at %d\n", sc_link->device->name, sc_link->dev_unit); @@ -640,6 +651,18 @@ scsi_assign_unit(struct scsi_link *sc_link) if (!found) sc_link->dev_unit = sc_link->device->free_unit++; +#ifdef PC98 + if (!found) { + for (i = 0; scsi_dinit[i].name; i++) { + if ((strcmp(sc_link->device->name, scsi_dinit[i].name) == 0) && + (scsi_dinit[i].target == SCCONF_UNSPEC)) + cf.cf_flags = scsi_dinit[i].flags; + } + } + if (sc_link->adapter->open_target_lu) + (*(sc_link->adapter->open_target_lu))(sc_link, &cf); +#endif + return sc_link->dev_unit; } diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h index d09f3a7..be3f6e0 100644 --- a/sys/scsi/scsiconf.h +++ b/sys/scsi/scsiconf.h @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * $Id: scsiconf.h,v 1.40 1996/03/10 07:13:11 gibbs Exp $ + * $Id: scsiconf.h,v 1.41 1996/03/31 03:19:09 gibbs Exp $ */ #ifndef SCSI_SCSICONF_H #define SCSI_SCSICONF_H 1 @@ -56,6 +56,9 @@ typedef int errval; struct buf; struct scsi_xfer; +#ifdef PC98 +struct cfdata; +#endif /* * These entrypoints are called by the high-end drivers to get services from @@ -66,7 +69,12 @@ struct scsi_adapter { /* 04*/ int32_t (*scsi_cmd) __P((struct scsi_xfer *xs)); /* 08*/ void (*scsi_minphys) __P((struct buf *bp)); +#ifdef PC98 +/* 12*/ int32_t (*open_target_lu) __P((struct scsi_link *sc_link, + struct cfdata *cf)); +#else /* 12*/ int32_t (*open_target_lu) __P((void)); +#endif /* 16*/ int32_t (*close_target_lu) __P((void)); /* 20*/ u_int32_t (*adapter_info) __P((int unit)); /* see definitions below */ /* 24*/ char *name; /* name of scsi bus controller */ diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 5ef8477..a78e727 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992 * - * $Id: sd.c,v 1.88 1996/05/02 14:20:54 phk Exp $ + * $Id: sd.c,v 1.89 1996/05/02 22:20:52 phk Exp $ */ #include "opt_bounce.h" @@ -52,7 +52,11 @@ static u_int32_t sdstrats, sdqueues; #define SECSIZE 512 +#ifdef PC98 +#define SDOUTSTANDING 2 +#else #define SDOUTSTANDING 4 +#endif #define SD_RETRIES 4 #define MAXTRANSFER 8 /* 1 page at a time */ @@ -738,7 +742,9 @@ sd_get_parms(unit, flags) union disk_pages pages; } scsi_sense; u_int32_t sectors; - +#ifdef PC98 + unsigned char *tmp; +#endif /* * First check if we have it all loaded */ @@ -752,6 +758,39 @@ sd_get_parms(unit, flags) scsi_cmd.op_code = MODE_SENSE; scsi_cmd.page = 4; scsi_cmd.length = 0x20; +#ifdef PC98 +#define PC98_SYSTEM_PARAMETER(x) pc98_system_parameter[(x)-0x400] + tmp = (unsigned char *)&PC98_SYSTEM_PARAMETER(0x460 + sc_link->target*4); + if ((PC98_SYSTEM_PARAMETER(0x482) & + ((1 << sc_link->target)&0xff)) != 0) { + disk_parms->sectors = *tmp; + disk_parms->cyls = ((*(tmp+3)<<8)|*(tmp+2))&0xfff; + switch (*(tmp + 3) & 0x30) { + case 0x00: + disk_parms->secsiz = 256; + printf("Warning!: not supported.\n"); + break; + case 0x10: + disk_parms->secsiz = 512; + break; + case 0x20: + disk_parms->secsiz = 1024; + printf("Warning!: not supported.\n"); + break; + default: + disk_parms->secsiz = 512; + printf("Warning!: not supported. But force to 512\n"); + } + if (*(tmp+3) & 0x40) { + disk_parms->cyls += (*(tmp+1)&0xf0)<<8; + disk_parms->heads = *(tmp+1)&0x0f; + } else { + disk_parms->heads = *(tmp+1); + } + disk_parms->disksize = disk_parms->sectors * disk_parms->heads * + disk_parms->cyls; + } else +#endif /* * If the command worked, use the results to fill out * the parameter structure |