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