2 * Copyright (c) 2015-2016 Qlogic Corporation
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
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.
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, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
31 #include <sys/cdefs.h>
32 __FBSDID("$FreeBSD$");
34 #include <sys/ioccom.h>
39 uint32_t grcdump_size;
41 uint32_t grcdump_dwords;
43 typedef struct bxe_grcdump bxe_grcdump_t;
45 #define BXE_DRV_NAME_LENGTH 32
46 #define BXE_DRV_VERSION_LENGTH 32
47 #define BXE_MFW_VERSION_LENGTH 32
48 #define BXE_STORMFW_VERSION_LENGTH 32
49 #define BXE_BUS_INFO_LENGTH 32
52 char drv_name[BXE_DRV_NAME_LENGTH];
53 char drv_version[BXE_DRV_VERSION_LENGTH];
54 char mfw_version[BXE_MFW_VERSION_LENGTH];
55 char stormfw_version[BXE_STORMFW_VERSION_LENGTH];
56 uint32_t eeprom_dump_len; /* in bytes */
57 uint32_t reg_dump_len; /* in bytes */
58 char bus_info[BXE_BUS_INFO_LENGTH];
60 typedef struct bxe_drvinfo bxe_drvinfo_t;
62 struct bxe_dev_setting {
64 uint32_t supported; /* Features this interface supports */
65 uint32_t advertising;/* Features this interface advertises */
66 uint32_t speed; /* The forced speed, 10Mb, 100Mb, gigabit */
67 uint32_t duplex; /* Duplex, half or full */
68 uint32_t port; /* Which connector port */
69 uint32_t phy_address;/* port number*/
70 uint32_t autoneg; /* Enable or disable autonegotiation */
72 typedef struct bxe_dev_setting bxe_dev_setting_t;
78 typedef struct bxe_get_regs bxe_get_regs_t;
80 #define BXE_EEPROM_MAX_DATA_LEN 524288
84 #define BXE_EEPROM_CMD_SET_EEPROM 0x01
85 #define BXE_EEPROM_CMD_GET_EEPROM 0x02
88 uint32_t eeprom_offset;
89 uint32_t eeprom_data_len;
90 uint32_t eeprom_magic;
92 typedef struct bxe_eeprom bxe_eeprom_t;
96 #define BXE_READ_REG_CMD 0x01
97 #define BXE_WRITE_REG_CMD 0x02
101 uint32_t reg_access_type;
102 #define BXE_REG_ACCESS_DIRECT 0x01
103 #define BXE_REG_ACCESS_INDIRECT 0x02
106 typedef struct bxe_reg_rdw bxe_reg_rdw_t;
108 struct bxe_pcicfg_rdw {
110 #define BXE_READ_PCICFG 0x01
111 #define BXE_WRITE_PCICFG 0x01
117 typedef struct bxe_pcicfg_rdw bxe_pcicfg_rdw_t;
119 struct bxe_perm_mac_addr {
120 char mac_addr_str[32];
123 typedef struct bxe_perm_mac_addr bxe_perm_mac_addr_t;
129 #define BXE_GRC_DUMP_SIZE _IOWR('e', 1, bxe_grcdump_t)
134 #define BXE_GRC_DUMP _IOWR('e', 2, bxe_grcdump_t)
139 #define BXE_DRV_INFO _IOR('e', 3, bxe_drvinfo_t)
142 * Read Device Setting
144 #define BXE_DEV_SETTING _IOR('e', 4, bxe_dev_setting_t)
149 #define BXE_GET_REGS _IOR('e', 5, bxe_get_regs_t)
154 #define BXE_EEPROM _IOWR('e', 6, bxe_eeprom_t)
157 * read/write a register
159 #define BXE_RDW_REG _IOWR('e', 7, bxe_reg_rdw_t)
164 #define BXE_RDW_PCICFG _IOWR('e', 8, bxe_reg_rdw_t)
167 * get permanent mac address
170 #define BXE_MAC_ADDR _IOWR('e', 9, bxe_perm_mac_addr_t)
173 #endif /* #ifndef _QLNX_IOCTL_H_ */