Lines Matching refs:t
166 static inline void *lookup_tid(const struct tid_info *t, unsigned int tid) in lookup_tid() argument
168 tid -= t->tid_base; in lookup_tid()
169 return tid < t->ntids ? t->tid_tab[tid] : NULL; in lookup_tid()
172 static inline bool tid_out_of_range(const struct tid_info *t, unsigned int tid) in tid_out_of_range() argument
174 return ((tid - t->tid_base) >= t->ntids); in tid_out_of_range()
177 static inline void *lookup_atid(const struct tid_info *t, unsigned int atid) in lookup_atid() argument
179 return atid < t->natids ? t->atid_tab[atid].data : NULL; in lookup_atid()
182 static inline void *lookup_stid(const struct tid_info *t, unsigned int stid) in lookup_stid() argument
185 if (t->nsftids && (stid >= t->sftid_base)) { in lookup_stid()
186 stid -= t->sftid_base; in lookup_stid()
187 stid += t->nstids; in lookup_stid()
189 stid -= t->stid_base; in lookup_stid()
192 return stid < (t->nstids + t->nsftids) ? t->stid_tab[stid].data : NULL; in lookup_stid()
195 static inline void cxgb4_insert_tid(struct tid_info *t, void *data, in cxgb4_insert_tid() argument
198 t->tid_tab[tid - t->tid_base] = data; in cxgb4_insert_tid()
199 if (t->hash_base && (tid >= t->hash_base)) { in cxgb4_insert_tid()
201 atomic_add(2, &t->hash_tids_in_use); in cxgb4_insert_tid()
203 atomic_inc(&t->hash_tids_in_use); in cxgb4_insert_tid()
206 atomic_add(2, &t->tids_in_use); in cxgb4_insert_tid()
208 atomic_inc(&t->tids_in_use); in cxgb4_insert_tid()
210 atomic_inc(&t->conns_in_use); in cxgb4_insert_tid()
213 static inline struct eotid_entry *cxgb4_lookup_eotid(struct tid_info *t, in cxgb4_lookup_eotid() argument
216 return eotid < t->neotids ? &t->eotid_tab[eotid] : NULL; in cxgb4_lookup_eotid()
219 static inline int cxgb4_get_free_eotid(struct tid_info *t) in cxgb4_get_free_eotid() argument
223 eotid = find_first_zero_bit(t->eotid_bmap, t->neotids); in cxgb4_get_free_eotid()
224 if (eotid >= t->neotids) in cxgb4_get_free_eotid()
230 static inline void cxgb4_alloc_eotid(struct tid_info *t, u32 eotid, void *data) in cxgb4_alloc_eotid() argument
232 set_bit(eotid, t->eotid_bmap); in cxgb4_alloc_eotid()
233 t->eotid_tab[eotid].data = data; in cxgb4_alloc_eotid()
234 atomic_inc(&t->eotids_in_use); in cxgb4_alloc_eotid()
237 static inline void cxgb4_free_eotid(struct tid_info *t, u32 eotid) in cxgb4_free_eotid() argument
239 clear_bit(eotid, t->eotid_bmap); in cxgb4_free_eotid()
240 t->eotid_tab[eotid].data = NULL; in cxgb4_free_eotid()
241 atomic_dec(&t->eotids_in_use); in cxgb4_free_eotid()
244 int cxgb4_alloc_atid(struct tid_info *t, void *data);
245 int cxgb4_alloc_stid(struct tid_info *t, int family, void *data);
246 int cxgb4_alloc_sftid(struct tid_info *t, int family, void *data);
247 void cxgb4_free_atid(struct tid_info *t, unsigned int atid);
248 void cxgb4_free_stid(struct tid_info *t, unsigned int stid, int family);
249 void cxgb4_remove_tid(struct tid_info *t, unsigned int qid, unsigned int tid,