1227064Sbz/* 2250340Sdavidcs * Copyright (c) 2011-2013 Qlogic Corporation 3227064Sbz * All rights reserved. 4227064Sbz * 5227064Sbz * Redistribution and use in source and binary forms, with or without 6227064Sbz * modification, are permitted provided that the following conditions 7227064Sbz * are met: 8227064Sbz * 9227064Sbz * 1. Redistributions of source code must retain the above copyright 10227064Sbz * notice, this list of conditions and the following disclaimer. 11227064Sbz * 2. Redistributions in binary form must reproduce the above copyright 12227064Sbz * notice, this list of conditions and the following disclaimer in the 13227064Sbz * documentation and/or other materials provided with the distribution. 14227064Sbz * 15227064Sbz * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16227064Sbz * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17227064Sbz * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18227064Sbz * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19227064Sbz * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20227064Sbz * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21227064Sbz * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22227064Sbz * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23227064Sbz * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24227064Sbz * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25227064Sbz * POSSIBILITY OF SUCH DAMAGE. 26227064Sbz * 27227064Sbz * $FreeBSD: releng/10.2/sys/dev/qlxgb/qla_ioctl.h 250340 2013-05-07 22:58:42Z davidcs $ 28227064Sbz */ 29227064Sbz/* 30227064Sbz * File: qla_ioctl.h 31227064Sbz * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656. 32227064Sbz */ 33227064Sbz 34227064Sbz#ifndef _QLA_IOCTL_H_ 35227064Sbz#define _QLA_IOCTL_H_ 36227064Sbz 37227064Sbz#include <sys/ioccom.h> 38227064Sbz 39227064Sbzstruct qla_reg_val { 40227064Sbz uint16_t rd; 41227064Sbz uint16_t direct; 42227064Sbz uint32_t reg; 43227064Sbz uint32_t val; 44227064Sbz}; 45227064Sbztypedef struct qla_reg_val qla_reg_val_t; 46227064Sbz 47227064Sbzstruct qla_rd_flash { 48227064Sbz uint32_t off; 49227064Sbz uint32_t data; 50227064Sbz}; 51227064Sbztypedef struct qla_rd_flash qla_rd_flash_t; 52227064Sbz 53250340Sdavidcsstruct qla_wr_flash { 54250340Sdavidcs uint32_t off; 55250340Sdavidcs uint32_t size; 56250340Sdavidcs void *buffer; 57250340Sdavidcs uint32_t pattern; 58250340Sdavidcs}; 59250340Sdavidcstypedef struct qla_wr_flash qla_wr_flash_t; 60227064Sbz 61250340Sdavidcsstruct qla_erase_flash { 62250340Sdavidcs uint32_t off; 63250340Sdavidcs uint32_t size; 64250340Sdavidcs}; 65250340Sdavidcstypedef struct qla_erase_flash qla_erase_flash_t; 66250340Sdavidcs 67250340Sdavidcsstruct qla_rd_pci_ids { 68250340Sdavidcs uint16_t ven_id; 69250340Sdavidcs uint16_t dev_id; 70250340Sdavidcs uint16_t subsys_ven_id; 71250340Sdavidcs uint16_t subsys_dev_id; 72250340Sdavidcs uint8_t rev_id; 73250340Sdavidcs}; 74250340Sdavidcstypedef struct qla_rd_pci_ids qla_rd_pci_ids_t; 75250340Sdavidcs 76227064Sbz/* 77227064Sbz * Read/Write Register 78227064Sbz */ 79227064Sbz#define QLA_RDWR_REG _IOWR('q', 1, qla_reg_val_t) 80227064Sbz 81227064Sbz/* 82227064Sbz * Read Flash 83227064Sbz */ 84227064Sbz#define QLA_RD_FLASH _IOWR('q', 2, qla_rd_flash_t) 85227064Sbz 86250340Sdavidcs/* 87250340Sdavidcs * Write Flash 88250340Sdavidcs */ 89250340Sdavidcs#define QLA_WR_FLASH _IOWR('q', 3, qla_wr_flash_t) 90250340Sdavidcs 91250340Sdavidcs/* 92250340Sdavidcs * Erase Flash 93250340Sdavidcs */ 94250340Sdavidcs#define QLA_ERASE_FLASH _IOWR('q', 5, qla_erase_flash_t) 95250340Sdavidcs 96250340Sdavidcs/* 97250340Sdavidcs * Read PCI IDs 98250340Sdavidcs */ 99250340Sdavidcs#define QLA_RD_PCI_IDS _IOWR('q', 6, qla_rd_pci_ids_t) 100250340Sdavidcs 101227064Sbz#endif /* #ifndef _QLA_IOCTL_H_ */ 102