e1000_osdep.h revision c124a83e09115de88ecccd4f689983f42a1d53bd
/*
* CDDL HEADER START
*
* Copyright(c) 2007-2009 Intel Corporation. All rights reserved.
* 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:
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When using or redistributing this file, you may do so under the
* License only. No other modification of this header is permitted.
*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms of the CDDL.
*/
#ifndef _IGB_OSDEP_H
#define _IGB_OSDEP_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/dditypes.h>
#include "igb_debug.h"
#define usec_delay(x) drv_usecwait(x)
#define usec_delay_irq usec_delay
#define msec_delay_irq msec_delay
#ifdef IGB_DEBUG
#else
#define DEBUGOUT(S)
#define DEBUGOUT1(S, A)
#define DEBUGOUT2(S, A, B)
#define DEBUGOUT3(S, A, B, C)
#endif
#define DEBUGFUNC(f)
#define false B_FALSE
#define true B_TRUE
#define FALSE false
#define TRUE true
#define PCI_COMMAND_REGISTER 0x04
#define PCI_EX_CONF_CAP 0xE0
/*
* Constants used in setting flow control thresholds
*/
#define E1000_PBA_MASK 0xffff
#define E1000_PBA_SHIFT 10
/* PHY Extended Status Register */
/* VMDq MODE supported by hardware */
#define E1000_VMDQ_OFF 0
#define E1000_VMDQ_MAC 1
#define E1000_VMDQ_MAC_RSS 2
/* VMDq based on packet destination MAC address */
#define E1000_MRQC_ENABLE_VMDQ_MAC_GROUP 0x00000003
/* VMDq based on packet destination MAC address and RSS */
#define E1000_MRQC_ENABLE_VMDQ_MAC_RSS_GROUP 0x00000005
/* The default queue in each VMDqs */
#define E1000_VMDQ_MAC_GROUP_DEFAULT_QUEUE 0x100
(value))
typedef boolean_t bool;
/*
* igb only uses the first two of the ddi_acc_handle_t, the latter end up coming
* from the common code for devices that igb doesn't support. For now, we end up
* bringing in those other two handles just for making life easier for sharin
* code.
*/
struct igb_osdep {
};
/* Shared Code Mutex Defines */
#define E1000_MUTEX kmutex_t
#ifdef __sparc /* on SPARC, use only memory-mapped routines */
#define E1000_WRITE_REG_IO E1000_WRITE_REG
#else /* on x86, use port io routines */
reg); \
val); \
}
#endif /* __sparc */
#ifdef __cplusplus
}
#endif
#endif /* _IGB_OSDEP_H */