Home | History | Annotate | Line # | Download | only in ofw
wdc_ofisa_machdep.c revision 1.2
      1 /*	$NetBSD: wdc_ofisa_machdep.c,v 1.2 2003/06/23 11:01:38 martin Exp $	*/
      2 
      3 /*
      4  * Copyright 1998
      5  * Digital Equipment Corporation. All rights reserved.
      6  *
      7  * This software is furnished under license and may be used and
      8  * copied only in accordance with the following terms and conditions.
      9  * Subject to these conditions, you may download, copy, install,
     10  * use, modify and distribute this software in source and/or binary
     11  * form. No title or ownership is transferred hereby.
     12  *
     13  * 1) Any source code used, modified or distributed must reproduce
     14  *    and retain this copyright notice and list of conditions as
     15  *    they appear in the source file.
     16  *
     17  * 2) No right is granted to use any trade name, trademark, or logo of
     18  *    Digital Equipment Corporation. Neither the "Digital Equipment
     19  *    Corporation" name nor any trademark or logo of Digital Equipment
     20  *    Corporation may be used to endorse or promote products derived
     21  *    from this software without the prior written permission of
     22  *    Digital Equipment Corporation.
     23  *
     24  * 3) This software is provided "AS-IS" and any express or implied
     25  *    warranties, including but not limited to, any implied warranties
     26  *    of merchantability, fitness for a particular purpose, or
     27  *    non-infringement are disclaimed. In no event shall DIGITAL be
     28  *    liable for any damages whatsoever, and in particular, DIGITAL
     29  *    shall not be liable for special, indirect, consequential, or
     30  *    incidental damages or damages for lost profits, loss of
     31  *    revenue or loss of use, whether such damages arise in contract,
     32  *    negligence, tort, under statute, in equity, at law or otherwise,
     33  *    even if advised of the possibility of such damage.
     34  */
     35 
     36 #include "opt_compat_old_ofw.h"
     37 
     38 #include <sys/param.h>
     39 #include <sys/device.h>
     40 #include <sys/systm.h>
     41 #include <machine/bus.h>
     42 #include <machine/intr.h>
     43 
     44 #include <dev/ofw/openfirm.h>
     45 #include <dev/isa/isavar.h>
     46 #include <dev/ofisa/ofisavar.h>
     47 
     48 #ifdef COMPAT_OLD_OFW
     49 
     50 int
     51 wdc_ofisa_md_match(parent, cf, aux)
     52 	struct device *parent;
     53 	struct cfdata *cf;
     54 	void *aux;
     55 {
     56 	struct ofisa_attach_args *aa = aux;
     57 	char type[8];
     58 	char name[8];
     59 	int rv;
     60 
     61 	rv = 0;
     62 	if (1) {		/* XXX old firmware compat enabled */
     63 		/* match type and name properties */
     64 		if (OF_getprop(aa->oba.oba_phandle, "device_type",
     65 		      type, sizeof(type)) > 0 &&
     66 		    strcmp(type, "ide") == 0 &&
     67 		    OF_getprop(aa->oba.oba_phandle, "name", name,
     68 		      sizeof(name)) > 0 &&
     69 		    strcmp(name, "ide") == 0)
     70 			rv = 4;
     71 	}
     72 	return (rv);
     73 }
     74 
     75 int
     76 wdc_ofisa_md_intr_fixup(parent, self, aux, descp, ndescs, ndescsfilled)
     77 	struct device *parent, *self;
     78 	void *aux;
     79 	struct ofisa_intr_desc *descp;
     80 	int ndescs, ndescsfilled;
     81 {
     82 
     83 	if (1)			/* XXX old firmware compat enabled */
     84 	if (ndescs > 0 && ndescsfilled > 0)
     85                 descp[0].share = IST_LEVEL;
     86 	return (ndescsfilled);
     87 }
     88 
     89 #endif /* COMPAT_OLD_OFW */
     90