diff options
author | jkh <jkh@FreeBSD.org> | 1995-10-25 16:41:22 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1995-10-25 16:41:22 +0000 |
commit | 3096e63c3afc6f961b9b8c6d54cd25d49cf7672a (patch) | |
tree | ce07d65e288e261920dcd9d222dcdac99d3be3db /sys/i386/isa/matcd/matcd.c | |
parent | 771663de9b59b389786284cdb198923089749d08 (diff) | |
download | FreeBSD-src-3096e63c3afc6f961b9b8c6d54cd25d49cf7672a.zip FreeBSD-src-3096e63c3afc6f961b9b8c6d54cd25d49cf7672a.tar.gz |
Bring in version 1(26) - considerably less memory usage (and may bring us
down to 4MB bootability again).
Submitted by: Frank Durda IV <uhclem@fw.ast.com>
Diffstat (limited to 'sys/i386/isa/matcd/matcd.c')
-rw-r--r-- | sys/i386/isa/matcd/matcd.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/sys/i386/isa/matcd/matcd.c b/sys/i386/isa/matcd/matcd.c index e042f8f..ff24f71 100644 --- a/sys/i386/isa/matcd/matcd.c +++ b/sys/i386/isa/matcd/matcd.c @@ -314,10 +314,19 @@ Edit number code marking begins here - earlier edits were during development. I also fixed some duplicate location strings in the tsleep calls. 24-Sep-95 Frank Durda IV bsdmail@nemesis.lonestar.org +<26> Moved a function declaration that generated two warnings with + the FULLCONFIG/FULLDRIVER conditionals disabled. + Updated the igot function so that it correctly reports limited + functions when a sub-set driver is compiled. + Eliminated FULLCONFIG conditional and now set controller counts + based on the NMATCD #define produced by the config process. + Also, disable the audio-related ioctls based on the BOOTMFS + conditional to help make the boot floppy kernel smaller. + 18-Oct-95 Frank Durda IV bsdmail@nemesis.lonestar.org ---------------------------------------------------------------------------*/ /*Match this format: Version_dc(d)__dd-mmm-yy */ -static char MATCDVERSION[]="Version 1(25) 18-Sep-95"; +static char MATCDVERSION[]="Version 1(26) 18-Oct-95"; /* The following strings may not be changed*/ static char MATCDCOPYRIGHT[] = "Matsushita CD-ROM driver, Copr. 1994,1995 Frank Durda IV"; @@ -328,6 +337,7 @@ static char MATCDCOPYRIGHT[] = "Matsushita CD-ROM driver, Copr. 1994,1995 Frank Include declarations ---------------------------------------------------------------------------*/ +#include "matcd.h" /*<26>*/ #include <sys/param.h> /*<16>*/ #include <sys/systm.h> /*<16>*/ @@ -341,7 +351,7 @@ static char MATCDCOPYRIGHT[] = "Matsushita CD-ROM driver, Copr. 1994,1995 Frank #include "i386/isa/matcd/options.h" /*Conditional compile options and probe port hints*/ -#include "i386/isa/matcd/matcd.h" /*Drive-related defs & strings*/ +#include "i386/isa/matcd/matcddrv.h" /*Drive-related defs & strings*/ #include "i386/isa/matcd/creative.h" /*Host interface related defs*/ #ifdef FREE2 @@ -355,11 +365,6 @@ static char MATCDCOPYRIGHT[] = "Matsushita CD-ROM driver, Copr. 1994,1995 Frank Defines and structures ---------------------------------------------------------------------------*/ -#ifdef FULLCONFIG -#define NUMCTRLRS 4 /*With modern boards, four is max*/ -#else /*FULLCONFIG*/ -#define NUMCTRLRS 1 /*Produces a slightly smaller kernel*/ -#endif /*FULLCONFIG*/ #define DRIVESPERC 4 /*This is a constant*/ #define TOTALDRIVES NUMCTRLRS*DRIVESPERC /*Max possible drives*/ #if DIAGPORT > 0xff /*<10>*/ @@ -414,7 +419,6 @@ struct matcd_mbx { }; static struct matcd_data { /*<18>*/ - short config; short drivemode; /*Last state drive was set to*/ short flags; short status; /*Last audio-related function*/ @@ -423,8 +427,8 @@ static struct matcd_data { /*<18>*/ short iobase; /*<20>*/ short iftype; /*<20>Host interface type*/ struct disklabel dlabel; - int partflags[MAXPARTITIONS]; - int openflags; + unsigned int partflags[MAXPARTITIONS]; + unsigned int openflags; struct matcd_volinfo volinfo; struct matcd_mbx mbx; u_char patch[2]; /*<12>Last known audio routing*/ @@ -576,7 +580,6 @@ static int matcd_route(int ldrive, int cdrive, int controller,/*<12>*/ int command); /*<12>*/ static int matcd_pitch(int ldrive, int cdrive, int controller,/*<12>*/ struct ioc_pitch * speed); /*<12>*/ -static int matcd_igot(struct ioc_capability * sqp); /*<16>*/ #endif /*FULLDRIVER*/ static int matcd_toc_header(int ldrive, int cdrive, int controller,/*<13>*/ struct ioc_toc_header * toc); /*<13>*/ @@ -585,6 +588,7 @@ static int matcd_toc_entries(int ldrive, int cdrive, /*<13>*/ struct ioc_read_toc_entry *ioc_entry);/*<13>*/ static int matcd_read_subq(int ldrive, int cdrive, int controller,/*<14>*/ struct ioc_read_subchannel * sqp);/*<14>*/ +static int matcd_igot(struct ioc_capability * sqp); /*<26>*/ static int waitforit(int timelimit, int state, int port, char * where); /*<14>*/ static int get_stat(int port, int ldrive); /*<14>*/ @@ -1238,8 +1242,8 @@ int matcd_probe(struct isa_device *dev) int i,cdrive; unsigned char y; int port = dev->id_iobase; /*Take port hint from config file*/ - cdrive=nextcontroller; /*Controller defined by pass for now*/ + cdrive=nextcontroller; /*Controller defined by pass for now*/ #if DIAGPORT == 0x302 /*<10>*/ DIAGOUT(0x300,0x00); /*<10>Init diag board in case some other device probe scrambled it*/ @@ -1262,7 +1266,6 @@ int matcd_probe(struct isa_device *dev) i=nextcontroller*DRIVESPERC; /*Precompute controller offset*/ for (y=0; y<DRIVESPERC; y++) { matcd_data[i+y].flags=0; - matcd_data[i+y].config=0; } #ifdef DEBUGPROBE @@ -1411,7 +1414,7 @@ static inline void matcd_register(struct isa_device *id) int matcd_attach(struct isa_device *dev) { int i; - unsigned char z,cdrive; + unsigned int z,cdrive; unsigned char cmd[MAXCMDSIZ]; unsigned char data[12]; struct matcd_data *cd; @@ -1481,6 +1484,7 @@ int matcd_attach(struct isa_device *dev) void zero_cmd(char * lcmd) { int i; + for (i=0; i<MAXCMDSIZ; lcmd[i++]=0); return; } @@ -2255,6 +2259,7 @@ int chk_error(int errnum) int get_stat(int port,int ldrive) { int status,busstat; /*<16>*/ + status=inb(port+DATA); /*Read status byte, last step of cmd*/ busstat=inb(port+STATUS); /*<16>Get bus status - should be 0xff*/ while ((busstat & (DTEN|STEN)) != (DTEN|STEN)) { /*<19>*/ @@ -2706,6 +2711,7 @@ static int matcd_read_subq(int ldrive, int cdrive, int controller, static int matcd_igot(struct ioc_capability * sqp) { +#ifdef FULLDRIVER sqp->play_function=(CDDOPLAYTRK | /*Can play trks/indx*/ CDDOPLAYMSF | /*Can play msf to msf*/ CDDOPAUSE | /*Can pause playback*/ @@ -2720,6 +2726,10 @@ static int matcd_igot(struct ioc_capability * sqp) CDSETRIGHT | /*Can select right-only*/ CDSETMUTE | /*Can mute audio*/ CDSETPATCH); /*Direct patch settings*/ +#else /*FULLDRIVER*/ + sqp->play_function=0; /*No audio capability*/ + sqp->routing_function=0; /*No audio capability*/ +#endif /*FULLDRIVER*/ sqp->special_function=(CDDOEJECT | /*Door can be opened*/ CDDOCLOSE | /*Door can be closed*/ |