New upstream version 18.02
[deb_dpdk.git] / drivers / net / bnx2x / bnx2x_ethdev.h
1 /*
2  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
3  *
4  * Copyright (c) 2015 QLogic Corporation.
5  * All rights reserved.
6  * www.qlogic.com
7  *
8  * See LICENSE.bnx2x_pmd for copyright and licensing details.
9  */
10
11 #ifndef PMD_BNX2X_ETHDEV_H
12 #define PMD_BNX2X_ETHDEV_H
13
14 #include <sys/queue.h>
15 #include <sys/param.h>
16 #include <sys/user.h>
17 #include <sys/stat.h>
18
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <errno.h>
22 #include <stdint.h>
23 #include <string.h>
24 #include <unistd.h>
25 #include <stdarg.h>
26 #include <inttypes.h>
27 #include <assert.h>
28
29 #include <rte_byteorder.h>
30 #include <rte_common.h>
31 #include <rte_cycles.h>
32 #include <rte_log.h>
33 #include <rte_debug.h>
34 #include <rte_pci.h>
35 #include <rte_malloc.h>
36 #include <rte_ethdev_driver.h>
37 #include <rte_spinlock.h>
38 #include <rte_eal.h>
39 #include <rte_mempool.h>
40 #include <rte_mbuf.h>
41
42 #include "bnx2x_rxtx.h"
43 #include "bnx2x_logs.h"
44
45 #define DELAY(x) rte_delay_us(x)
46 #define DELAY_MS(x) rte_delay_ms(x)
47 #define usec_delay(x) DELAY(x)
48 #define msec_delay(x) DELAY(1000*(x))
49
50 #define FALSE               0
51 #define TRUE                1
52
53 #define false               0
54 #define true                1
55 #define min(a,b)        RTE_MIN(a,b)
56
57 #define mb()    rte_mb()
58 #define wmb()   rte_wmb()
59 #define rmb()   rte_rmb()
60
61
62 #define MAX_QUEUES sysconf(_SC_NPROCESSORS_CONF)
63
64 #define BNX2X_MIN_RX_BUF_SIZE 1024
65 #define BNX2X_MAX_RX_PKT_LEN  15872
66 #define BNX2X_MAX_MAC_ADDRS   1
67
68 /* Hardware RX tick timer (usecs) */
69 #define BNX2X_RX_TICKS 25
70 /* Hardware TX tick timer (usecs) */
71 #define BNX2X_TX_TICKS 50
72 /* Maximum number of Rx packets to process at a time */
73 #define BNX2X_RX_BUDGET 0xffffffff
74
75 #endif
76
77 /* MAC address operations */
78 struct bnx2x_mac_ops {
79         void (*mac_addr_add)(struct rte_eth_dev *dev, struct ether_addr *addr,
80                         uint16_t index, uint32_t pool);                           /* not implemented yet */
81         void (*mac_addr_remove)(struct rte_eth_dev *dev, uint16_t index); /* not implemented yet */
82 };