/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright(c) 2007-2010 Intel Corporation. All rights reserved.
*/
/*
* Copyright (c) 2013 Saso Kiselkov. All rights reserved.
* Copyright 2016 OmniTI Computer Consulting, Inc. All rights reserved.
*/
#ifndef _IXGBE_SW_H
#define _IXGBE_SW_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/mac_provider.h>
#include <sys/mac_ether.h>
#include <sys/ethernet.h>
#include "ixgbe_api.h"
#define IXGBE_INTR_NONE 0
/*
* MAX_xx_QUEUE_NUM and MAX_INTR_VECTOR values need to be the maximum of all
* supported silicon types.
*/
/*
* Maximum values for user configurable parameters
*/
/*
* Minimum values for user configurable parameters
*/
#define MIN_TX_COPY_THRESHOLD 0
#define MIN_RX_COPY_THRESHOLD 0
/*
* Default values for user configurable parameters
*/
/*
* Extra register bit masks for 82598
*/
/*
* Defined for IP header alignment.
*/
/*
* Bit flags for attach_progress
*/
#define IXGBE_LB_NONE 0
/*
* capability/feature flags
* Flags named _CAPABLE are set when the NIC hardware is capable of the feature.
* Separately, the flag named _ENABLED is set when the feature is enabled.
*/
/*
* Classification mode
*/
#define IXGBE_CLASSIFY_NONE 0
/* adapter-specific info for each supported device type */
typedef struct adapter_info {
/*
* Interrupt throttling is in unit of 256 nsec
*/
/* bits representing all interrupt types other than tx & rx */
enum ioc_reply {
};
0, 0, (flag)))
/*
* Defined for ring index operations
* ASSERT(index < limit)
* ASSERT(step < limit)
* ASSERT(index1 < limit)
* ASSERT(index2 < limit)
*/
{ \
} \
}
} else { \
} \
typedef struct single_link {
typedef struct link_list {
} link_list_t;
/*
* Property lookups
*/
DDI_PROP_DONTPASS, (n))
DDI_PROP_DONTPASS, (n), -1)
typedef union ixgbe_ether_addr {
struct {
} reg;
struct {
} mac;
typedef enum {
} tx_type_t;
typedef struct ixgbe_tx_context {
/*
*/
typedef struct sw_desc {
} sw_desc_t;
/*
* Handles and addresses of DMA buffer
*/
typedef struct dma_buffer {
} dma_buffer_t;
/*
* Tx Control Block
*/
typedef struct tx_control_block {
/*
* RX Control Block
*/
typedef struct rx_control_block {
/*
* Software Data Structure for Tx Ring
*/
typedef struct ixgbe_tx_ring {
/*
* Mutexes
*/
/*
* Tx descriptor ring definitions
*/
/*
* Tx control block list definitions
*/
/*
* and LSO.
*/
/*
* Tx ring settings and status
*/
#ifdef IXGBE_DEBUG
/*
* Debug statistics
*/
#endif
/*
* Pointer to the ixgbe struct
*/
/*
* Software Receive Ring
*/
typedef struct ixgbe_rx_data {
/*
* Rx descriptor ring definitions
*/
/*
* Rx control block list definitions
*/
/*
* Rx sw ring settings and status
*/
/*
* Software Data Structure for Rx Ring
*/
typedef struct ixgbe_rx_ring {
#ifdef IXGBE_DEBUG
/*
* Debug statistics
*/
#endif
/*
* Software Receive Ring Group
*/
typedef struct ixgbe_rx_group {
/*
* structure to map interrupt cleanup to msi-x vector
*/
typedef struct ixgbe_intr_vector {
/*
* Software adapter state
*/
typedef struct ixgbe {
int instance;
/*
* Each msi-x vector: map vector to interrupt cleanup
*/
/*
* Receive Rings
*/
/*
* Receive Groups
*/
/*
* Transmit Rings
*/
int intr_type;
int intr_cnt;
int intr_cap;
/*
* Kstat definitions
*/
} ixgbe_t;
typedef struct ixgbe_stat {
} ixgbe_stat_t;
/*
* Function prototypes in ixgbe_buf.c
*/
int ixgbe_alloc_dma(ixgbe_t *);
void ixgbe_free_dma(ixgbe_t *);
void ixgbe_set_fma_flags(int);
void ixgbe_free_dma_buffer(dma_buffer_t *);
/*
* Function prototypes in ixgbe_main.c
*/
void ixgbe_enable_watchdog_timer(ixgbe_t *);
void ixgbe_disable_watchdog_timer(ixgbe_t *);
void ixgbe_fm_ereport(ixgbe_t *, char *);
void ixgbe_fill_ring(void *, mac_ring_type_t, const int, const int,
/*
* Function prototypes in ixgbe_gld.c
*/
int ixgbe_m_start(void *);
void ixgbe_m_stop(void *);
int ixgbe_m_promisc(void *, boolean_t);
void ixgbe_m_resources(void *);
void ixgbe_m_propinfo(void *, const char *, mac_prop_id_t,
/*
* Function prototypes in ixgbe_rx.c
*/
mblk_t *ixgbe_ring_rx_poll(void *, int);
/*
* Function prototypes in ixgbe_tx.c
*/
void ixgbe_free_tcb(tx_control_block_t *);
/*
* Function prototypes in ixgbe_log.c
*/
void ixgbe_notice(void *, const char *, ...);
void ixgbe_log(void *, const char *, ...);
void ixgbe_error(void *, const char *, ...);
/*
* Function prototypes in ixgbe_stat.c
*/
int ixgbe_init_stats(ixgbe_t *);
#ifdef __cplusplus
}
#endif
#endif /* _IXGBE_SW_H */