Files
@ bd21c8aa7237
Branch filter:
Location: vmkdrivers/vmkdrivers/src_9/drivers/net/nx_nic/nx_nic_vmk.h
bd21c8aa7237
3.6 KiB
text/x-chdr
ESXi-6.0.0b
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | /*
* Copyright (C) 2003 - 2009 NetXen, Inc.
* Copyright (C) 2009 - QLogic Corporation.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*
* The full GNU General Public License is included in this distribution
* in the file called LICENSE.
*
*/
#ifndef __NX_NIC_VMK_H__
#define __NX_NIC_VMK_H__
#if (defined(__VMKERNEL_MODULE__) || defined(__VMKLNX__) || defined (__CONFIG_VMNIX__))
#include <kernel_compatibility.h>
#include "vmklinux_dist.h"
#ifndef PCI_CAP_ID_MSIX
#define PCI_CAP_ID_MSIX 0x11
#endif
#undef CONFIG_FW_LOADER
#undef CONFIG_FW_LOADER_MODULE
#define UNM_NETIF_F_TSO
#define local_bh_enable()
#define local_bh_disable()
#define BOUNCE_LOCK(__lock, flags) spin_lock_irqsave((__lock),flags)
#define BOUNCE_UNLOCK(__lock, flags) spin_unlock_irqrestore((__lock),flags)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18))
#define ALLOC_SKB(adapter, size, flag) netdev_alloc_skb((adapter)->netdev, (size))
#else
#define ALLOC_SKB(adapter, size, flag) alloc_skb((size), (flag))
#endif
#define NX_ADJUST_SMALL_PKT_LEN(SKB) \
do { \
if(rarely((SKB)->len < ETH_ZLEN)) { \
skb_put(SKB, ETH_ZLEN - (SKB)->len); \
} \
} while(0)
#define PREPARE_TO_WAIT(WQ_HEAD, WQ_ENTRY, STATE) \
prepare_to_wait((WQ_HEAD), (WQ_ENTRY), (STATE))
#define SCHEDULE_TIMEOUT(EVENT, TIMEOUT, LOCK) \
schedule_timeout((TIMEOUT))
#define ESX_PHYS_TO_KMAP(MADDR, LEN) \
ioremap(MADDR, LEN)
#define ESX_PHYS_TO_KMAP_FREE(VADDR) \
iounmap(VADDR)
#define NETQ_MAX_RX_CONTEXTS 7
#define INVALID_INIT_NETQ_RX_CONTEXTS -1
#ifdef __VMKNETDDI_QUEUEOPS__
#define MULTICTX_IS_RX(type) ((type) == VMKNETDDI_QUEUEOPS_QUEUE_TYPE_RX)
#define MULTICTX_IS_TX(type) ((type) == VMKNETDDI_QUEUEOPS_QUEUE_TYPE_TX)
int nx_nic_netqueue_ops(vmknetddi_queueops_op_t op, void *args);
#define NX_SET_NETQ_OPS(DEV, OPS) \
VMKNETDDI_REGISTER_QUEUEOPS((DEV), (OPS))
#define nx_set_skb_queueid(SKB, RCTX) \
do { \
if(RCTX->this_id) { \
vmknetddi_queueops_set_skb_queueid(SKB, \
VMKNETDDI_QUEUEOPS_MK_RX_QUEUEID(RCTX->this_id)); \
} \
}while (0)
#endif
#define FREE_NETDEV(DEV) \
do { \
if((DEV)) { \
if((DEV)->outputList) { \
kfree((DEV)->outputList); \
} \
free_netdev((DEV)); \
} \
} while(0)
extern int vmklnx_netdev_high_dma_overflow(struct sk_buff *skb, short gb_limit);
extern struct sk_buff * vmklnx_netdev_high_dma_workaround(struct sk_buff *base);
#define NX_NIC_HANDLE_HIGHDMA_OVERFLOW(ADAPTER, SKB) \
do { \
if (SKB) { \
if (vmklnx_netdev_high_dma_overflow(SKB, \
(ADAPTER)->dma_mask)) {\
dev_kfree_skb_any(SKB); \
SKB = NULL; \
} \
} \
}while (0)
#endif
#endif
|