Home | History | Annotate | Download | only in ntxn
      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 /*
     23  * Copyright 2008 NetXen, Inc.  All rights reserved.
     24  * Use is subject to license terms.
     25  */
     26 
     27 #ifndef __UNM_NIC_IOCTL_H__
     28 #define	__UNM_NIC_IOCTL_H__
     29 
     30 #ifdef __cplusplus
     31 extern "C" {
     32 #endif
     33 
     34 /* ioctl's dealing with PCI read/writes */
     35 #define	UNM_CMD_START 0
     36 #define	UNM_NIC_CMD  (UNM_CMD_START + 1)
     37 #define	UNM_NIC_NAME (UNM_CMD_START + 2)
     38 
     39 typedef enum {
     40 		unm_nic_cmd_none = 0,
     41 		unm_nic_cmd_pci_read,
     42 		unm_nic_cmd_pci_write,
     43 		unm_nic_cmd_pci_mem_read,
     44 		unm_nic_cmd_pci_mem_write,
     45 		unm_nic_cmd_pci_config_read,
     46 		unm_nic_cmd_pci_config_write,
     47 		unm_nic_cmd_get_stats,
     48 		unm_nic_cmd_clear_stats,
     49 		unm_nic_cmd_get_version,
     50 		unm_nic_cmd_get_phy_type,
     51 		unm_nic_cmd_efuse_chip_id,
     52 
     53 		unm_nic_cmd_flash_read = 50,
     54 		unm_nic_cmd_flash_write,
     55 		unm_nic_cmd_flash_se
     56 } unm_nic_ioctl_cmd_t;
     57 
     58 #pragma pack(1)
     59 
     60 typedef struct {
     61 		__uint32_t cmd;
     62 		__uint32_t unused1;
     63 		__uint64_t off;
     64 		__uint32_t size;
     65 		__uint32_t rv;
     66 		char uabc[64];
     67 		void *ptr;
     68 } unm_nic_ioctl_data_t;
     69 
     70 struct unm_statistics {
     71 	__uint64_t rx_packets;
     72 	__uint64_t tx_packets;
     73 	__uint64_t rx_bytes;
     74 	__uint64_t rx_errors;
     75 	__uint64_t tx_bytes;
     76 	__uint64_t tx_errors;
     77 	__uint64_t rx_CRC_errors;
     78 	__uint64_t rx_short_length_error;
     79 	__uint64_t rx_long_length_error;
     80 	__uint64_t rx_MAC_errors;
     81 };
     82 
     83 #pragma pack()
     84 
     85 #ifdef __cplusplus
     86 }
     87 #endif
     88 
     89 #endif /* !__UNM_NIC_IOCTL_H__ */
     90