Home | History | Annotate | Line # | Download | only in ic
isp_ioctl.h revision 1.2
      1 /* $NetBSD: isp_ioctl.h,v 1.2 2002/01/03 21:45:07 mjacob Exp $ */
      2 /*
      3  * Copyright (c) 2001 by Matthew Jacob
      4  *
      5  * Redistribution and use in source and binary forms, with or without
      6  * modification, are permitted provided that the following conditions
      7  * are met:
      8  *
      9  * 1. Redistributions of source code must retain the above copyright
     10  *    notice, this list of conditions and the following disclaimer.
     11  * 2. Redistributions in binary form must reproduce the above copyright
     12  *    notice, this list of conditions and the following disclaimer in the
     13  *    documentation and/or other materials provided with the distribution.
     14  *
     15  * Alternatively, this software may be distributed under the terms of the
     16  * the GNU Public License ("GPL", Library, Version 2).
     17  *
     18  *
     19  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
     20  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     21  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     22  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     23  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     24  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     28  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     29  *
     30  * Matthew Jacob <mjacob (at) feral.com)
     31  *
     32  */
     33 /*
     34  * ioctl definitions for Qlogic FC/SCSI HBA driver
     35  */
     36 #define	ISP_IOC		(021)	/* 'Ctrl-Q' */
     37 
     38 /*
     39  * This ioctl sets/retrieves the debugging level for this hba instance.
     40  * Note that this is not a simple integer level- see ispvar.h for definitions.
     41  *
     42  * The arguments is a pointer to an integer with the new debugging level.
     43  * The old value is written into this argument.
     44  */
     45 
     46 #define	ISP_SDBLEV	_IOWR(ISP_IOC, 0, int)
     47 
     48 /*
     49  * This ioctl resets the HBA. Use with caution.
     50  */
     51 #define	ISP_RESETHBA	_IO(ISP_IOC, 1)
     52 
     53 /*
     54  * This ioctl performs a fibre chanel rescan.
     55  */
     56 #define	ISP_FC_RESCAN	_IO(ISP_IOC, 2)
     57 
     58 /*
     59  * Initiate a LIP
     60  */
     61 #define	ISP_FC_LIP	_IO(ISP_IOC, 3)
     62 
     63 /*
     64  * Return the Port Database structure for the named device, or ENODEV if none.
     65  * Caller fills in virtual loopid (0..255), aka 'target'. The driver returns
     66  * ENODEV (if nothing valid there) or the actual loopid (for local loop devices
     67  * only), 24 bit Port ID and Node and Port WWNs.
     68  */
     69 struct isp_fc_device {
     70 	u_int32_t	loopid;	/* 0..255 */
     71 	u_int32_t	portid;	/* 24 bit Port ID */
     72 	u_int64_t	node_wwn;
     73 	u_int64_t	port_wwn;
     74 };
     75 #define	ISP_FC_GETDINFO	_IOWR(ISP_IOC, 4, struct isp_fc_device)
     76 
     77 /*
     78  * Get/Clear Stats
     79  */
     80 #define	ISP_STATS_VERSION	0
     81 typedef struct {
     82 	uint8_t		isp_stat_version;
     83 	uint8_t		isp_type;		/* (ro) reflects chip type */
     84 	uint8_t		isp_revision;		/* (ro) reflects chip version */
     85 	uint8_t		unused1;
     86 	uint32_t	unused2;
     87 	/*
     88 	 * Statistics Counters
     89 	 */
     90 #define	ISP_NSTATS	16
     91 #define	ISP_INTCNT	0
     92 #define	ISP_INTBOGUS	1
     93 #define	ISP_INTMBOXC	2
     94 #define	ISP_INGOASYNC	3
     95 #define	ISP_RSLTCCMPLT	4
     96 #define	ISP_FPHCCMCPLT	5
     97 #define	ISP_RSCCHIWAT	6
     98 #define	ISP_FPCCHIWAT	7
     99 	uint64_t	isp_stats[ISP_NSTATS];
    100 } isp_stats_t;
    101 
    102 #define	ISP_GET_STATS	_IOR(ISP_IOC, 6, isp_stats_t)
    103 #define	ISP_CLR_STATS	_IO(ISP_IOC, 7)
    104