0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 #ifndef _CHELSIO_DEFS_H
0033 #define _CHELSIO_DEFS_H
0034
0035 #include <linux/skbuff.h>
0036 #include <net/tcp.h>
0037
0038 #include "t3cdev.h"
0039
0040 #include "cxgb3_offload.h"
0041
0042 #define VALIDATE_TID 1
0043
0044
0045
0046
0047 static inline union active_open_entry *atid2entry(const struct tid_info *t,
0048 unsigned int atid)
0049 {
0050 return &t->atid_tab[atid - t->atid_base];
0051 }
0052
0053 static inline union listen_entry *stid2entry(const struct tid_info *t,
0054 unsigned int stid)
0055 {
0056 return &t->stid_tab[stid - t->stid_base];
0057 }
0058
0059
0060
0061
0062 static inline struct t3c_tid_entry *lookup_tid(const struct tid_info *t,
0063 unsigned int tid)
0064 {
0065 struct t3c_tid_entry *t3c_tid = tid < t->ntids ?
0066 &(t->tid_tab[tid]) : NULL;
0067
0068 return (t3c_tid && t3c_tid->client) ? t3c_tid : NULL;
0069 }
0070
0071
0072
0073
0074 static inline struct t3c_tid_entry *lookup_stid(const struct tid_info *t,
0075 unsigned int tid)
0076 {
0077 union listen_entry *e;
0078
0079 if (tid < t->stid_base || tid >= t->stid_base + t->nstids)
0080 return NULL;
0081
0082 e = stid2entry(t, tid);
0083 if ((void *)e->next >= (void *)t->tid_tab &&
0084 (void *)e->next < (void *)&t->atid_tab[t->natids])
0085 return NULL;
0086
0087 return &e->t3c_tid;
0088 }
0089
0090
0091
0092
0093 static inline struct t3c_tid_entry *lookup_atid(const struct tid_info *t,
0094 unsigned int tid)
0095 {
0096 union active_open_entry *e;
0097
0098 if (tid < t->atid_base || tid >= t->atid_base + t->natids)
0099 return NULL;
0100
0101 e = atid2entry(t, tid);
0102 if ((void *)e->next >= (void *)t->tid_tab &&
0103 (void *)e->next < (void *)&t->atid_tab[t->natids])
0104 return NULL;
0105
0106 return &e->t3c_tid;
0107 }
0108
0109 int attach_t3cdev(struct t3cdev *dev);
0110 void detach_t3cdev(struct t3cdev *dev);
0111 #endif