mcd.c (1239) | mcd.c (1241) |
---|---|
1/* 2 * Copyright 1993 by Holger Veit (data part) 3 * Copyright 1993 by Brian Moore (audio part) 4 * Changes Copyright 1993 by Gary Clark II 5 * 6 * Rewrote probe routine to work on newer Mitsumi drives. 7 * Additional changes (C) 1994 by Jordan K. Hubbard 8 * --- 25 unchanged lines hidden (view full) --- 34 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 35 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 36 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 37 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 38 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 39 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 40 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 * | 1/* 2 * Copyright 1993 by Holger Veit (data part) 3 * Copyright 1993 by Brian Moore (audio part) 4 * Changes Copyright 1993 by Gary Clark II 5 * 6 * Rewrote probe routine to work on newer Mitsumi drives. 7 * Additional changes (C) 1994 by Jordan K. Hubbard 8 * --- 25 unchanged lines hidden (view full) --- 34 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 35 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 36 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 37 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 38 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 39 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 40 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 * |
42 * $Id: mcd.c,v 1.11 1994/03/05 03:54:19 jkh Exp $ | 42 * $Id: mcd.c,v 1.12 1994/03/05 21:41:51 ats Exp $ |
43 */ 44static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; 45 46#include "mcd.h" 47#if NMCD > 0 48#include "types.h" 49#include "param.h" 50#include "systm.h" --- 43 unchanged lines hidden (view full) --- 94#define MCDMBXBSY 0x0200 /* local mbx is busy */ 95 96/* status */ 97#define MCDAUDIOBSY MCD_ST_AUDIOBSY /* playing audio */ 98#define MCDDSKCHNG MCD_ST_DSKCHNG /* sensed change of disk */ 99#define MCDDSKIN MCD_ST_DSKIN /* sensed disk in drive */ 100#define MCDDOOROPEN MCD_ST_DOOROPEN /* sensed door open */ 101 | 43 */ 44static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; 45 46#include "mcd.h" 47#if NMCD > 0 48#include "types.h" 49#include "param.h" 50#include "systm.h" --- 43 unchanged lines hidden (view full) --- 94#define MCDMBXBSY 0x0200 /* local mbx is busy */ 95 96/* status */ 97#define MCDAUDIOBSY MCD_ST_AUDIOBSY /* playing audio */ 98#define MCDDSKCHNG MCD_ST_DSKCHNG /* sensed change of disk */ 99#define MCDDSKIN MCD_ST_DSKIN /* sensed disk in drive */ 100#define MCDDOOROPEN MCD_ST_DOOROPEN /* sensed door open */ 101 |
102#define MCDEXISTS 0x0030 /* A real Mitsumi drive */ | 102/* These are apparently the different states a mitsumi can get up to */ 103#define MCDCDABSENT 0x0030 104#define MCDCDPRESENT 0x0020 105#define MCDSCLOSED 0x0080 106#define MCDSOPEN 0x00a0 |
103 104/* toc */ 105#define MCD_MAXTOCS 104 /* from the Linux driver */ 106#define MCD_LASTPLUS1 170 /* special toc entry */ 107 108struct mcd_mbx { 109 short unit; 110 short port; --- 488 unchanged lines hidden (view full) --- 599 } 600 601 /* Get status */ 602 outb(port+MCD_DATA, MCD_CMDGETSTAT); 603 if (!twiddle_thumbs(port, unit, 1000000, "getting status")) { 604 return 0; /* Timeout */ 605 } 606 status = inb(port+MCD_DATA); | 107 108/* toc */ 109#define MCD_MAXTOCS 104 /* from the Linux driver */ 110#define MCD_LASTPLUS1 170 /* special toc entry */ 111 112struct mcd_mbx { 113 short unit; 114 short port; --- 488 unchanged lines hidden (view full) --- 603 } 604 605 /* Get status */ 606 outb(port+MCD_DATA, MCD_CMDGETSTAT); 607 if (!twiddle_thumbs(port, unit, 1000000, "getting status")) { 608 return 0; /* Timeout */ 609 } 610 status = inb(port+MCD_DATA); |
607/* 0x20 == empty drive */ 608/* 0x30 == MCDEXISTS == drive closed with CDROM inserted */ 609/* 0x80 == drive pulled out but door closed */ 610/* 0xa0 == drive pulled out and door open */ 611 if (status != 0x20 && status != MCDEXISTS && status != 0x80 && 612 status != 0xa0) | 611 if (status != MCDCDABSENT && status != MCDCDPRESENT && 612 status != MCDSOPEN && status != MCDSCLOSED) |
613 return 0; /* Not actually a Mitsumi drive here */ 614 /* Get version information */ 615 outb(port+MCD_DATA, MCD_CMDCONTINFO); 616 for (j = 0; j < 3; j++) { 617 if (!twiddle_thumbs(port, unit, 3000, "getting version info")) { 618 return 0; 619 } 620 stbytes[j] = (inb(port+MCD_DATA) & 0xFF); --- 712 unchanged lines hidden --- | 613 return 0; /* Not actually a Mitsumi drive here */ 614 /* Get version information */ 615 outb(port+MCD_DATA, MCD_CMDCONTINFO); 616 for (j = 0; j < 3; j++) { 617 if (!twiddle_thumbs(port, unit, 3000, "getting version info")) { 618 return 0; 619 } 620 stbytes[j] = (inb(port+MCD_DATA) & 0xFF); --- 712 unchanged lines hidden --- |