Path: blob/main/sys/dev/bnxt/bnxt_en/bnxt_ioctl.h
105261 views
/*-1* Broadcom NetXtreme-C/E network driver.2*3* Copyright (c) 2016 Broadcom, All Rights Reserved.4* The term Broadcom refers to Broadcom Limited and/or its subsidiaries5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'16* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS19* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR20* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF21* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS22* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN23* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)24* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF25* THE POSSIBILITY OF SUCH DAMAGE.26*/2728#include <sys/cdefs.h>29#ifndef _BNXT_IOCTL_H30#define _BNXT_IOCTL_H3132enum bnxt_ioctl_type {33BNXT_HWRM_NVM_FIND_DIR_ENTRY,34BNXT_HWRM_NVM_READ,35BNXT_HWRM_FW_RESET,36BNXT_HWRM_FW_QSTATUS,37BNXT_HWRM_NVM_WRITE,38BNXT_HWRM_NVM_ERASE_DIR_ENTRY,39BNXT_HWRM_NVM_GET_DIR_INFO,40BNXT_HWRM_NVM_GET_DIR_ENTRIES,41BNXT_HWRM_NVM_MODIFY,42BNXT_HWRM_NVM_VERIFY_UPDATE,43BNXT_HWRM_NVM_INSTALL_UPDATE,44BNXT_HWRM_FW_GET_TIME,45BNXT_HWRM_FW_SET_TIME,46};4748struct bnxt_ioctl_header {49enum bnxt_ioctl_type type;50int rc;51};5253struct bnxt_ioctl_hwrm_nvm_find_dir_entry {54struct bnxt_ioctl_header hdr;55uint32_t data_length;56uint32_t fw_ver;57uint32_t item_length;58uint16_t ext;59uint16_t index;60uint16_t ordinal;61uint16_t type;62uint8_t search_opt;63bool use_index;64};6566struct bnxt_ioctl_hwrm_nvm_read {67struct bnxt_ioctl_header hdr;68uint8_t *data;69uint32_t length;70uint32_t offset;71uint16_t index;72};7374struct bnxt_ioctl_hwrm_fw_reset {75struct bnxt_ioctl_header hdr;76uint8_t processor;77uint8_t selfreset;78};7980struct bnxt_ioctl_hwrm_fw_qstatus {81struct bnxt_ioctl_header hdr;82uint8_t processor;83uint8_t selfreset;84};8586struct bnxt_ioctl_hwrm_nvm_write {87struct bnxt_ioctl_header hdr;88uint8_t *data;89uint32_t data_length;90uint32_t item_length;91uint16_t attr;92uint16_t ext;93uint16_t index;94uint16_t option;95uint16_t ordinal;96uint16_t type;97bool keep;98};99100struct bnxt_ioctl_hwrm_nvm_erase_dir_entry {101struct bnxt_ioctl_header hdr;102enum bnxt_ioctl_type type;103int rc;104uint16_t index;105};106107struct bnxt_ioctl_hwrm_nvm_get_dir_info {108struct bnxt_ioctl_header hdr;109uint32_t entries;110uint32_t entry_length;111};112113struct bnxt_ioctl_hwrm_nvm_get_dir_entries {114struct bnxt_ioctl_header hdr;115uint8_t *data;116size_t max_size;117uint32_t entries;118uint32_t entry_length;119};120121struct bnxt_ioctl_hwrm_nvm_install_update {122struct bnxt_ioctl_header hdr;123uint64_t installed_items;124uint32_t install_type;125uint8_t problem_item;126uint8_t reset_required;127uint8_t result;128};129130struct bnxt_ioctl_hwrm_nvm_verify_update {131struct bnxt_ioctl_header hdr;132uint16_t ext;133uint16_t ordinal;134uint16_t type;135};136137struct bnxt_ioctl_hwrm_nvm_modify {138struct bnxt_ioctl_header hdr;139uint8_t *data;140uint32_t length;141uint32_t offset;142uint16_t index;143};144145struct bnxt_ioctl_hwrm_fw_get_time {146struct bnxt_ioctl_header hdr;147uint16_t millisecond;148uint16_t year;149uint16_t zone;150uint8_t day;151uint8_t hour;152uint8_t minute;153uint8_t month;154uint8_t second;155};156157struct bnxt_ioctl_hwrm_fw_set_time {158struct bnxt_ioctl_header hdr;159uint16_t millisecond;160uint16_t year;161uint16_t zone;162uint8_t day;163uint8_t hour;164uint8_t minute;165uint8_t month;166uint8_t second;167};168169/* IOCTL interface */170struct bnxt_ioctl_data {171union {172struct bnxt_ioctl_header hdr;173struct bnxt_ioctl_hwrm_nvm_find_dir_entry find;174struct bnxt_ioctl_hwrm_nvm_read read;175struct bnxt_ioctl_hwrm_fw_reset reset;176struct bnxt_ioctl_hwrm_fw_qstatus status;177struct bnxt_ioctl_hwrm_nvm_write write;178struct bnxt_ioctl_hwrm_nvm_erase_dir_entry erase;179struct bnxt_ioctl_hwrm_nvm_get_dir_info dir_info;180struct bnxt_ioctl_hwrm_nvm_get_dir_entries dir_entries;181struct bnxt_ioctl_hwrm_nvm_install_update install;182struct bnxt_ioctl_hwrm_nvm_verify_update verify;183struct bnxt_ioctl_hwrm_nvm_modify modify;184struct bnxt_ioctl_hwrm_fw_get_time get_time;185struct bnxt_ioctl_hwrm_fw_set_time set_time;186};187};188189#endif190191192