/* $NetBSD: isp_ioctl.h,v 1.12 2015/09/06 06:01:00 dholland Exp $ */
/*
* Copyright (c) 2001-2007 by Matthew Jacob
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* ioctl definitions for Qlogic FC/SCSI HBA driver
*/
#include <sys/ioccom.h>
#define ISP_IOC (021) /* 'Ctrl-Q' */
/*
* This ioctl sets/retrieves the debugging level for this hba instance.
* Note that this is not a simple integer level- see ispvar.h for definitions.
*
* The arguments is a pointer to an integer with the new debugging level.
* The old value is written into this argument.
*/
#define ISP_SDBLEV _IOWR(ISP_IOC, 1, int)
/*
* This ioctl resets the HBA. Use with caution.
*/
#define ISP_RESETHBA _IO(ISP_IOC, 2)
/*
* This ioctl performs a fibre channel rescan.
*/
#define ISP_RESCAN _IO(ISP_IOC, 3)
/*
* This ioctl performs a reset and then will set the adapter to the
* role that was passed in (the old role will be returned). It almost
* goes w/o saying: use with caution.
*
* Channel selector stored in bits 8..32 as input to driver.
*/
#define ISP_SETROLE _IOWR(ISP_IOC, 4, int)
/*
* Initiate a LIP
*/
#define ISP_FC_LIP _IO(ISP_IOC, 8)
/*
* Return the Port Database structure for the named device, or ENODEV if none.
* Caller fills in virtual loopid (0..255), aka 'target'. The driver returns
* ENODEV (if nothing valid there) or the actual loopid (for local loop devices
* only), 24 bit Port ID and Node and Port WWNs.
*/
struct isp_fc_device {
uint32_t loopid; /* 0..255 */
uint32_t
chan : 6,
role : 2,
portid : 24; /* 24 bit Port ID */
uint64_t node_wwn;
uint64_t port_wwn;
};
#define ISP_FC_GETDINFO _IOWR(ISP_IOC, 9, struct isp_fc_device)