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#ifndef _CHELSIO_DEFS_H
33#define _CHELSIO_DEFS_H
34
35#include <linux/skbuff.h>
36#include <net/tcp.h>
37
38#include "t3cdev.h"
39
40#include "cxgb3_offload.h"
41
42#define VALIDATE_TID 1
43
44void *cxgb_alloc_mem(unsigned long size);
45void cxgb_free_mem(void *addr);
46void cxgb_neigh_update(struct neighbour *neigh);
47void cxgb_redirect(struct dst_entry *old, struct dst_entry *new);
48
49
50
51
52static inline union active_open_entry *atid2entry(const struct tid_info *t,
53 unsigned int atid)
54{
55 return &t->atid_tab[atid - t->atid_base];
56}
57
58static inline union listen_entry *stid2entry(const struct tid_info *t,
59 unsigned int stid)
60{
61 return &t->stid_tab[stid - t->stid_base];
62}
63
64
65
66
67static inline struct t3c_tid_entry *lookup_tid(const struct tid_info *t,
68 unsigned int tid)
69{
70 struct t3c_tid_entry *t3c_tid = tid < t->ntids ?
71 &(t->tid_tab[tid]) : NULL;
72
73 return (t3c_tid && t3c_tid->client) ? t3c_tid : NULL;
74}
75
76
77
78
79static inline struct t3c_tid_entry *lookup_stid(const struct tid_info *t,
80 unsigned int tid)
81{
82 union listen_entry *e;
83
84 if (tid < t->stid_base || tid >= t->stid_base + t->nstids)
85 return NULL;
86
87 e = stid2entry(t, tid);
88 if ((void *)e->next >= (void *)t->tid_tab &&
89 (void *)e->next < (void *)&t->atid_tab[t->natids])
90 return NULL;
91
92 return &e->t3c_tid;
93}
94
95
96
97
98static inline struct t3c_tid_entry *lookup_atid(const struct tid_info *t,
99 unsigned int tid)
100{
101 union active_open_entry *e;
102
103 if (tid < t->atid_base || tid >= t->atid_base + t->natids)
104 return NULL;
105
106 e = atid2entry(t, tid);
107 if ((void *)e->next >= (void *)t->tid_tab &&
108 (void *)e->next < (void *)&t->atid_tab[t->natids])
109 return NULL;
110
111 return &e->t3c_tid;
112}
113
114int process_rx(struct t3cdev *dev, struct sk_buff **skbs, int n);
115int attach_t3cdev(struct t3cdev *dev);
116void detach_t3cdev(struct t3cdev *dev);
117#endif
118