fix detection of unknown massbus devices, ok by matt

This commit is contained in:
hans 2008-10-16 12:47:22 +00:00
parent a162d50c30
commit 991c2cc9b0
3 changed files with 15 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mba.c,v 1.36 2008/03/11 05:34:02 matt Exp $ */
/* $NetBSD: mba.c,v 1.37 2008/10/16 12:47:22 hans Exp $ */
/*
* Copyright (c) 1994, 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mba.c,v 1.36 2008/03/11 05:34:02 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: mba.c,v 1.37 2008/10/16 12:47:22 hans Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -154,9 +154,8 @@ mbaattach(device_t parent, device_t self, void *aux)
continue;
/* We have a drive, ok. */
ma.ma_unit = i;
ma.ma_type = MBA_RCSR(MUREG(i, MU_DT)) & 0777;
j = 0;
while (mbaunit[j++].nr)
ma.ma_type = MBA_RCSR(MUREG(i, MU_DT)) & 0xf1ff;
for (j = 0; mbaunit[j].nr; j++)
if (mbaunit[j].nr == ma.ma_type)
break;
ma.ma_devtyp = mbaunit[j].devtyp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mbareg.h,v 1.4 2000/06/04 18:04:39 ragge Exp $ */
/* $NetBSD: mbareg.h,v 1.5 2008/10/16 12:47:22 hans Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden
* All rights reserved.
@ -110,13 +110,13 @@ struct mba_regs {
#define MBADS_DPR 0x100 /* Unit present */
/* Definitions in mba_device md_dt */
#define MBADT_RP04 0x10
#define MBADT_RP05 0x11
#define MBADT_RP06 0x12
#define MBADT_RP07 0x22
#define MBADT_RM02 0x15
#define MBADT_RM03 0x14
#define MBADT_RM05 0x17
#define MBADT_RM80 0x16
#define MBADT_RP04 0x2010
#define MBADT_RP05 0x2011
#define MBADT_RP06 0x2012
#define MBADT_RP07 0x2022
#define MBADT_RM02 0x2015
#define MBADT_RM03 0x2014
#define MBADT_RM05 0x2017
#define MBADT_RM80 0x2016
#define MBADT_DRQ 0x800 /* Dual ported */
#define MBADT_MOH 0x2000 /* Moving head device */

View File

@ -1,4 +1,4 @@
/* $NetBSD: mbavar.h,v 1.12 2008/03/11 05:34:02 matt Exp $ */
/* $NetBSD: mbavar.h,v 1.13 2008/10/16 12:47:22 hans Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden
* All rights reserved.
@ -52,6 +52,7 @@
* Devices that have different device drivers.
*/
enum mb_devices {
MB_UK, /* unknown */
MB_RP, /* RM/RP disk */
MB_TU, /* TM03 based tape, ex. TU45 or TU77 */
MB_MT /* TU78 tape */