xref: /illumos-gate/usr/src/uts/common/io/ntxn/unm_nic_ioctl.h (revision 257873cfc1dd3337766407f80397db60a56f2f5a)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 NetXen, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 #ifndef __UNM_NIC_IOCTL_H__
26 #define	__UNM_NIC_IOCTL_H__
27 
28 /* ioctl's dealing with PCI read/writes */
29 #define	UNM_CMD_START 0
30 #define	UNM_NIC_CMD  (UNM_CMD_START + 1)
31 #define	UNM_NIC_NAME (UNM_CMD_START + 2)
32 
33 typedef enum {
34 		unm_nic_cmd_none = 0,
35 		unm_nic_cmd_pci_read,
36 		unm_nic_cmd_pci_write,
37 		unm_nic_cmd_pci_mem_read,
38 		unm_nic_cmd_pci_mem_write,
39 		unm_nic_cmd_pci_config_read,
40 		unm_nic_cmd_pci_config_write,
41 		unm_nic_cmd_get_stats,
42 		unm_nic_cmd_clear_stats,
43 		unm_nic_cmd_get_version,
44 		unm_nic_cmd_get_phy_type,
45 		unm_nic_cmd_efuse_chip_id,
46 
47 		unm_nic_cmd_flash_read = 50,
48 		unm_nic_cmd_flash_write,
49 		unm_nic_cmd_flash_se
50 } unm_nic_ioctl_cmd_t;
51 
52 #pragma pack(1)
53 
54 typedef struct {
55 		__uint32_t cmd;
56 		__uint32_t unused1;
57 		__uint64_t off;
58 		__uint32_t size;
59 		__uint32_t rv;
60 		char uabc[64];
61 		void *ptr;
62 } unm_nic_ioctl_data_t;
63 
64 struct unm_statistics {
65 	__uint64_t rx_packets;
66 	__uint64_t tx_packets;
67 	__uint64_t rx_bytes;
68 	__uint64_t rx_errors;
69 	__uint64_t tx_bytes;
70 	__uint64_t tx_errors;
71 	__uint64_t rx_CRC_errors;
72 	__uint64_t rx_short_length_error;
73 	__uint64_t rx_long_length_error;
74 	__uint64_t rx_MAC_errors;
75 };
76 
77 #pragma pack()
78 
79 #endif /* !__UNM_NIC_IOCTL_H__ */
80