ixgbe_stub.h 8.29 KB
Newer Older
1
2
3
#ifndef IXGBE_STUB_H
#define IXGBE_STUB_H

4
void napi_disable(struct napi_struct *n) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }
5

6
void napi_complete_done(struct napi_struct *n, int work_done) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }
7
8
9

int pci_enable_msi_range(struct pci_dev *dev, int minvec,
				       int maxvec)
10
{ LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return -ENOSYS; }
11

12
void pci_disable_msi(struct pci_dev *dev) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }
13
14
15
16
17

int __must_check
request_threaded_irq(unsigned int irq, irq_handler_t handler,
		     irq_handler_t thread_fn,
		     unsigned long flags, const char *name, void *dev)
18
19
{ LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }

20
21

int call_netdevice_notifiers(unsigned long val, struct net_device *dev)
22
{ LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }
23

24
bool cancel_work_sync(struct work_struct *work) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return true; }
25

26
27
28
29
/* ASSERT_RTNL macro checks if rtnl_lock is held by the caller
 * during certain API calls. Inside LCDs we don't hold this lock,
 * just make the assert macro happy by faking that we did.
 */
30
int rtnl_is_locked(void) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 1; }
31

32
void synchronize_irq(unsigned int irq) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }
33
34


35
void napi_gro_flush(struct napi_struct *napi, bool flush_old) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }
36

37
void free_irq(unsigned int a, void *p) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }
38
39
40

unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
{
41
	LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return (char*) skb;
42
43
}

44
int skb_pad(struct sk_buff *skb, int pad) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }
45

46
int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }
47

48
int skb_checksum_help(struct sk_buff *skb) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }
49
50

void skb_tstamp_tx(struct sk_buff *orig_skb,
51
		   struct skb_shared_hwtstamps *hwtstamps) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }
52

53
int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }
54

55
unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return (char*)skb; }
56
57

void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off,
58
		     int size, unsigned int truesize) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }
59

60
void netdev_rss_key_fill(void *buffer, size_t len) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }
61

Vikram Narayanan's avatar
Vikram Narayanan committed
62
63
64
65
66
67
68
69
70
71
72
73
74
unsigned long dev_trans_start(struct net_device *dev)
{
	LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__);
	return 0ul;
}

void init_timer_key(struct timer_list *timer, unsigned int flags,
		    const char *name, struct lock_class_key *key)
{
	LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__);
	return;
}

75
76
int del_timer(struct timer_list * timer) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }
int mod_timer(struct timer_list *timer, unsigned long expires) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }
77
78

struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev,
79
						     struct list_head **iter) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return NULL; }
80
81

struct sk_buff *__napi_alloc_skb(struct napi_struct *napi,
82
				 unsigned int length, gfp_t gfp_mask) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return NULL; }
83

84
unsigned long msleep_interruptible(unsigned int msecs) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0ul; }
85
86

struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
87
					struct rtnl_link_stats64 *storage) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return storage; }
88

89
void __dev_kfree_skb_any(struct sk_buff *skb, enum skb_free_reason reason) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); };
90

91
92
u32 ethtool_op_get_link(struct net_device *dev) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }
int ethtool_op_get_ts_info(struct net_device *dev, struct ethtool_ts_info *eti) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }
93

94
__be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }
95
96

struct sk_buff *__alloc_skb(unsigned int size, gfp_t priority, int flags,
97
			    int node) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return NULL; }
98
99

int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, int target,
100
		  unsigned short *fragoff, int *fragflg) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }
101

102
void __local_bh_enable_ip(unsigned long ip, unsigned int cnt) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }
103

104
void kfree_skb(struct sk_buff *skb) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }
105
106
107
108
109

unsigned long volatile __jiffy_data jiffies;

struct pglist_data contig_page_data;

110
void pci_restore_state(struct pci_dev *dev) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }
111

112
void __napi_schedule_irqoff(struct napi_struct *n) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }
113
114
115

int mdio_mii_ioctl(const struct mdio_if_info *mdio,
			struct mii_ioctl_data *mii_data, int cmd)
116
{ LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }
117
118
119
120
121
122
123
124

int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
				   struct net_device *dev, u16 mode,
				   u32 flags, u32 mask, int nlflags,
				   u32 filter_mask,
				   int (*vlan_fill)(struct sk_buff *skb,
						    struct net_device *dev,
						    u32 filter_mask))
125
{ LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }
126
127
128
129
130
131
132

int ndo_dflt_fdb_add(struct ndmsg *ndm,
			    struct nlattr *tb[],
			    struct net_device *dev,
			    const unsigned char *addr,
			    u16 vid,
			    u16 flags)
133
{ LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }
134
135

struct nlattr *nla_find(const struct nlattr *head, int len, int attrtype)
136
{ LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return NULL; }
137

138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/* TODO: Move this to a common header, say arch/x86/include/asm/udelay.h
 * As of now, lpj is passed by boot module to LCD. Devise a way to retrieve
 * this during vtx container creation so that arch module can handle this
 * seamlessly
 */
extern unsigned long loops_per_jiffy;

static void delay_loop(unsigned long loops)
{
	asm volatile(
		"	test %0,%0	\n"
		"	jz 3f		\n"
		"	jmp 1f		\n"

		".align 16		\n"
		"1:	jmp 2f		\n"

		".align 16		\n"
		"2:	dec %0		\n"
		"	jnz 2b		\n"
		"3:	dec %0		\n"

		: /* we don't need output */
		:"a" (loops)
	);
}

void __const_udelay(unsigned long xloops)
{
	int d0;

	xloops *= 4;
	asm("mull %%edx"
		:"=d" (xloops), "=&a" (d0)
		:"1" (xloops), "0" (loops_per_jiffy * (HZ/4)));

	delay_loop(++xloops);
}

/* XXX: Huh? Yeah, a tight loop for msleep is *ugly*. There is
 * no way to enable timers inside LCD. Replace this with a real
 * timer when such a support is added to LCDs.
 */
void msleep(unsigned int msecs)
{
	udelay(msecs * 1000);
}

void __udelay(unsigned long usecs)
{
	__const_udelay(usecs * 0x000010c7); /* 2**32 / 1000000 (rounded up) */
}

Vikram Narayanan's avatar
Vikram Narayanan committed
191
192
193
194
195
void usleep_range(unsigned long min, unsigned long max)
{
	udelay((max + min) >> 1);
}

196
197
198
199
200
201
202
void netif_napi_add(struct net_device *dev, struct napi_struct *napi,
		    int (*poll)(struct napi_struct *, int), int weight) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }

void netif_napi_del(struct napi_struct *napi) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }

bool napi_hash_del(struct napi_struct *napi) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return true; }

203
#endif /* IXGBE_STUB_H */