[BACK]Return to aic.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / pc532 / dev

Annotation of src/sys/arch/pc532/dev/aic.c, Revision 1.10

1.10    ! lukem       1: /*     $NetBSD: aic.c,v 1.9 2003/04/02 02:24:14 thorpej Exp $  */
1.2       cgd         2:
1.1       phil        3: /* Written by Phil Nelson for the pc532.  Used source with the following
                      4:  * copyrights as a model.
                      5:  *
                      6:  *   aic.c: A Adaptec 6250 driver for the pc532.
                      7:  */
                      8: /*
                      9:  * (Mostly) Written by Julian Elischer (julian@tfs.com)
                     10:  * for TRW Financial Systems for use under the MACH(2.5) operating system.
                     11:  *
                     12:  * TRW Financial Systems, in accordance with their agreement with Carnegie
                     13:  * Mellon University, makes this software available to CMU to distribute
                     14:  * or use in any manner that they see fit as long as this message is kept with
                     15:  * the software. For this reason TFS also grants any other persons or
                     16:  * organisations permission to use or modify this software.
                     17:  *
                     18:  * TFS supplies this software to be publicly redistributed
                     19:  * on the understanding that TFS is not responsible for the correct
                     20:  * functioning of this software in any circumstances.
                     21:  */
                     22:
                     23: /*
                     24:  * a FEW lines in this driver come from a MACH adaptec-disk driver
                     25:  * so the copyright below is included:
                     26:  *
                     27:  * Copyright 1990 by Open Software Foundation,
                     28:  * Grenoble, FRANCE
                     29:  *
                     30:  *             All Rights Reserved
1.4       mycroft    31:  *
1.1       phil       32:  *   Permission to use, copy, modify, and distribute this software and
                     33:  * its documentation for any purpose and without fee is hereby granted,
                     34:  * provided that the above copyright notice appears in all copies and
                     35:  * that both the copyright notice and this permission notice appear in
                     36:  * supporting documentation, and that the name of OSF or Open Software
                     37:  * Foundation not be used in advertising or publicity pertaining to
                     38:  * distribution of the software without specific, written prior
                     39:  * permission.
1.4       mycroft    40:  *
1.1       phil       41:  *   OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
                     42:  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
                     43:  * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
                     44:  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
                     45:  * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
                     46:  * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
                     47:  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                     48:  *
                     49:  */
1.10    ! lukem      50:
        !            51: #include <sys/cdefs.h>
        !            52: __KERNEL_RCSID(0, "$NetBSD$");
1.1       phil       53:
1.5       mycroft    54: #include <sys/types.h>
                     55: #include <sys/param.h>
                     56: #include <sys/systm.h>
                     57: #include <sys/errno.h>
                     58: #include <sys/ioctl.h>
                     59: #include <sys/buf.h>
                     60: #include <machine/stdarg.h>
                     61: #include <sys/proc.h>
                     62: #include <sys/user.h>
                     63: #include <sys/dkbad.h>
                     64: #include <sys/disklabel.h>
1.9       thorpej    65:
                     66: #include <uvm/uvm_extern.h>
                     67:
1.8       bouyer     68: #include <dev/scsipi/scsi_all.h>
                     69: #include <dev/scsipi/scsipi_all.h>
                     70: #include <dev/scsipi/scsiconf.h>
1.1       phil       71:
1.5       mycroft    72: #include <sys/device.h>
1.1       phil       73:
                     74: /* Some constants (may need to be changed!) */
                     75: #define AIC_NSEG               16
                     76:
                     77: int aicprobe(struct pc532_device *);
                     78: int aicattach(struct pc532_device *);
1.8       bouyer     79: int aic_scsi_cmd(struct scsipi_xfer *);
1.4       mycroft    80: void aicminphys(struct buf *);
1.1       phil       81: long int aic_adapter_info(int);
                     82:
                     83: struct scsidevs *
                     84: scsi_probe(int masunit, struct scsi_switch *sw, int physid, int type, int want);
                     85:
                     86: struct pc532_driver aicdriver = {
                     87:        aicprobe, aicattach, "aic",
                     88: };
                     89:
                     90: struct scsi_switch dp_switch = {
                     91:        "aic",
                     92:        aic_scsi_cmd,
                     93:        aicminphys,
                     94:        0,
                     95:        0,
                     96:        aic_adapter_info,
                     97:        0, 0, 0
                     98: };
                     99:
                    100: int aicprobe(struct pc532_device *dvp)
                    101: {
                    102:   return (0);  /* All pc532s should have one, but it is not working now. */
                    103: }
                    104:
                    105:
                    106: int aicattach(struct pc532_device *dvp)
                    107: {
                    108:        int r;
                    109:
                    110:        r = scsi_attach(0, 7, &dp_switch,
                    111:                &dvp->pd_drive, &dvp->pd_unit, dvp->pd_flags);
                    112:
                    113:        return(r);
                    114: }
                    115:
1.4       mycroft   116: void aicminphys(struct buf *bp)
1.1       phil      117: {
1.4       mycroft   118:
1.9       thorpej   119:        if(bp->b_bcount > ((AIC_NSEG - 1) * PAGE_SIZE))
                    120:                bp->b_bcount = ((AIC_NSEG - 1) * PAGE_SIZE);
1.4       mycroft   121:        minphys(bp);
1.1       phil      122: }
                    123:
                    124: long int aic_adapter_info(int unit)
                    125: {
                    126:        return (1);    /* only 1 outstanding request. */
                    127: }
                    128:
                    129:
                    130: /* Do a scsi command. */
                    131:
1.8       bouyer    132: struct scsipi_xfer *cur_xs;
1.1       phil      133:
1.8       bouyer    134: int aic_scsi_cmd(struct scsipi_xfer *xs)
1.1       phil      135: {
1.7       christos  136: printf ("aic_scsi_cmd: ... \n");
1.1       phil      137:        cur_xs = xs;
                    138:
                    139:        return (HAD_ERROR);
                    140: }
                    141:
                    142: void aic_intr (struct intrframe frame)
                    143: {
                    144: }

CVSweb <webmaster@jp.NetBSD.org>