FreeBSD kernel BXE device code
bxe_ioctl.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015-2016 Qlogic Corporation
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
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.
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, 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.
26 */
27
28#ifndef _BXE_IOCTL_H_
29#define _BXE_IOCTL_H_
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD$");
33
34#include <sys/ioccom.h>
35
36
38 uint16_t pci_func;
39 uint32_t grcdump_size;
40 void *grcdump;
42};
44
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
50
56 uint32_t eeprom_dump_len; /* in bytes */
57 uint32_t reg_dump_len; /* in bytes */
59};
61
63
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 */
71};
73
75 void *reg_buf;
76 uint32_t reg_buf_len;
77};
79
80#define BXE_EEPROM_MAX_DATA_LEN 524288
81
82struct bxe_eeprom {
83 uint32_t eeprom_cmd;
84#define BXE_EEPROM_CMD_SET_EEPROM 0x01
85#define BXE_EEPROM_CMD_GET_EEPROM 0x02
86
88 uint32_t eeprom_offset;
90 uint32_t eeprom_magic;
91};
92typedef struct bxe_eeprom bxe_eeprom_t;
93
95 uint32_t reg_cmd;
96#define BXE_READ_REG_CMD 0x01
97#define BXE_WRITE_REG_CMD 0x02
98
99 uint32_t reg_id;
100 uint32_t reg_val;
102#define BXE_REG_ACCESS_DIRECT 0x01
103#define BXE_REG_ACCESS_INDIRECT 0x02
104};
105
107
109 uint32_t cfg_cmd;
110#define BXE_READ_PCICFG 0x01
111#define BXE_WRITE_PCICFG 0x01
112 uint32_t cfg_id;
113 uint32_t cfg_val;
114 uint32_t cfg_width;
115};
116
118
120 char mac_addr_str[32];
121};
122
124
125
126/*
127 * Read grcdump size
128 */
129#define BXE_GRC_DUMP_SIZE _IOWR('e', 1, bxe_grcdump_t)
130
131/*
132 * Read grcdump
133 */
134#define BXE_GRC_DUMP _IOWR('e', 2, bxe_grcdump_t)
135
136/*
137 * Read driver info
138 */
139#define BXE_DRV_INFO _IOR('e', 3, bxe_drvinfo_t)
140
141/*
142 * Read Device Setting
143 */
144#define BXE_DEV_SETTING _IOR('e', 4, bxe_dev_setting_t)
145
146/*
147 * Get Registers
148 */
149#define BXE_GET_REGS _IOR('e', 5, bxe_get_regs_t)
150
151/*
152 * Get/Set EEPROM
153 */
154#define BXE_EEPROM _IOWR('e', 6, bxe_eeprom_t)
155
156/*
157 * read/write a register
158 */
159#define BXE_RDW_REG _IOWR('e', 7, bxe_reg_rdw_t)
160
161/*
162 * read/write PCIcfg
163 */
164#define BXE_RDW_PCICFG _IOWR('e', 8, bxe_reg_rdw_t)
165
166/*
167 * get permanent mac address
168 */
169
170#define BXE_MAC_ADDR _IOWR('e', 9, bxe_perm_mac_addr_t)
171
172
173#endif /* #ifndef _QLNX_IOCTL_H_ */
#define BXE_DRV_NAME_LENGTH
Definition: bxe_ioctl.h:45
#define BXE_MFW_VERSION_LENGTH
Definition: bxe_ioctl.h:47
#define BXE_BUS_INFO_LENGTH
Definition: bxe_ioctl.h:49
#define BXE_STORMFW_VERSION_LENGTH
Definition: bxe_ioctl.h:48
#define BXE_DRV_VERSION_LENGTH
Definition: bxe_ioctl.h:46
__FBSDID("$FreeBSD$")
uint32_t phy_address
Definition: bxe_ioctl.h:69
uint32_t port
Definition: bxe_ioctl.h:68
uint32_t duplex
Definition: bxe_ioctl.h:67
uint32_t speed
Definition: bxe_ioctl.h:66
uint32_t advertising
Definition: bxe_ioctl.h:65
uint32_t supported
Definition: bxe_ioctl.h:64
uint32_t autoneg
Definition: bxe_ioctl.h:70
uint32_t reg_dump_len
Definition: bxe_ioctl.h:57
uint32_t eeprom_dump_len
Definition: bxe_ioctl.h:56
char drv_version[BXE_DRV_VERSION_LENGTH]
Definition: bxe_ioctl.h:53
char mfw_version[BXE_MFW_VERSION_LENGTH]
Definition: bxe_ioctl.h:54
char drv_name[BXE_DRV_NAME_LENGTH]
Definition: bxe_ioctl.h:52
char stormfw_version[BXE_STORMFW_VERSION_LENGTH]
Definition: bxe_ioctl.h:55
char bus_info[BXE_BUS_INFO_LENGTH]
Definition: bxe_ioctl.h:58
uint32_t eeprom_magic
Definition: bxe_ioctl.h:90
uint32_t eeprom_data_len
Definition: bxe_ioctl.h:89
uint32_t eeprom_offset
Definition: bxe_ioctl.h:88
void * eeprom_data
Definition: bxe_ioctl.h:87
uint32_t eeprom_cmd
Definition: bxe_ioctl.h:83
void * reg_buf
Definition: bxe_ioctl.h:75
uint32_t reg_buf_len
Definition: bxe_ioctl.h:76
uint16_t pci_func
Definition: bxe_ioctl.h:38
uint32_t grcdump_size
Definition: bxe_ioctl.h:39
void * grcdump
Definition: bxe_ioctl.h:40
uint32_t grcdump_dwords
Definition: bxe_ioctl.h:41
uint32_t cfg_id
Definition: bxe_ioctl.h:112
uint32_t cfg_cmd
Definition: bxe_ioctl.h:109
uint32_t cfg_val
Definition: bxe_ioctl.h:113
uint32_t cfg_width
Definition: bxe_ioctl.h:114
char mac_addr_str[32]
Definition: bxe_ioctl.h:120
uint32_t reg_val
Definition: bxe_ioctl.h:100
uint32_t reg_id
Definition: bxe_ioctl.h:99
uint32_t reg_cmd
Definition: bxe_ioctl.h:95
uint32_t reg_access_type
Definition: bxe_ioctl.h:101