diff options
Diffstat (limited to 'sys/i386/isa/atapi.c')
-rw-r--r-- | sys/i386/isa/atapi.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sys/i386/isa/atapi.c b/sys/i386/isa/atapi.c index 9b3090d8bd203..44cdc4e235017 100644 --- a/sys/i386/isa/atapi.c +++ b/sys/i386/isa/atapi.c @@ -88,7 +88,7 @@ * You will need to make at least three routines: open(), close(), * strategy() and possibly ioctl(). * 2. Make attach() routine, which should allocate all the needed data - * structures and print the device description string (see xxxattach()). + * structures and print the device description string (see wcdattach()). * 3. Add an appropriate case to the switch in atapi_attach() routine, * call attach() routine of the new driver here. Add the appropriate * #include line at the top of attach.c. @@ -104,6 +104,7 @@ #ifndef ATAPI_MODULE # include "acd.h" +# include "wcd.h" # include "wfd.h" # include "wst.h" /* # include "wmd.h" -- add your driver here */ @@ -169,8 +170,11 @@ static int atapi_io (struct atapi *ata, struct atapicmd *ac); static int atapi_start_cmd (struct atapi *ata, struct atapicmd *ac); static int atapi_wait_cmd (struct atapi *ata, struct atapicmd *ac); +static void atapi_poll_dsc(struct atapi *ata); + extern int wdstart (int ctrlr); extern int acdattach(struct atapi*, int, struct atapi_params*, int); +extern int wcdattach(struct atapi*, int, struct atapi_params*, int); extern int wfdattach(struct atapi*, int, struct atapi_params*, int); extern int wstattach(struct atapi*, int, struct atapi_params*, int); @@ -300,9 +304,17 @@ int atapi_attach (int ctlr, int unit, int port) ata->attached[unit] = 1; return (1); #else +#if NWCD > 0 + /* ATAPI CD-ROM drives */ + if (wcdattach (ata, unit, ap, ata->debug) < 0) + break; + ata->attached[unit] = 1; + return (1); +#else printf ("wdc%d: ATAPI CD-ROMs not configured\n", ctlr); break; #endif +#endif case AT_TYPE_TAPE: /* streaming tape */ #if NWST > 0 @@ -368,7 +380,7 @@ static char *cmdname (u_char cmd) case 0xbd: return ("ATAPI_MECH_STATUS"); case 0xbe: return ("READ_CD"); } - snprintf (buf, sizeof(buf), "[0x%x]", cmd); + sprintf (buf, "[0x%x]", cmd); return (buf); } @@ -652,8 +664,8 @@ int atapi_start_cmd (struct atapi *ata, struct atapicmd *ac) */ int atapi_wait_cmd (struct atapi *ata, struct atapicmd *ac) { - /* Wait for DRQ from 100 usec to 3 msec for slow devices */ - int cnt = ata->intrcmd ? 10000 : ata->slow ? 3000 : 100; + /* Wait for DRQ from 50 usec to 3 msec for slow devices */ + int cnt = ata->intrcmd ? 10000 : ata->slow ? 3000 : 50; int ireason = 0, phase = 0; /* Wait for command phase. */ |