Lines Matching refs:td

174 free_tom_data(struct tom_data *td)
176 KASSERT(TAILQ_EMPTY(&td->toep_list),
179 if (td->listen_mask != 0)
180 hashdestroy(td->listen_hash, M_CXGB, td->listen_mask);
182 if (mtx_initialized(&td->toep_list_lock))
183 mtx_destroy(&td->toep_list_lock);
184 if (mtx_initialized(&td->lctx_hash_lock))
185 mtx_destroy(&td->lctx_hash_lock);
186 if (mtx_initialized(&td->tid_release_lock))
187 mtx_destroy(&td->tid_release_lock);
188 if (td->l2t)
189 t3_free_l2t(td->l2t);
190 free_tid_tabs(&td->tid_maps);
191 free(td, M_CXGB);
201 struct tom_data *td;
210 td = malloc(sizeof(*td), M_CXGB, M_ZERO | M_NOWAIT);
211 if (td == NULL)
215 mtx_init(&td->toep_list_lock, "PCB list lock", NULL, MTX_DEF);
216 TAILQ_INIT(&td->toep_list);
219 mtx_init(&td->lctx_hash_lock, "lctx hash lock", NULL, MTX_DEF);
220 td->listen_hash = hashinit_flags(LISTEN_HASH_SIZE, M_CXGB,
221 &td->listen_mask, HASH_NOWAIT);
224 TASK_INIT(&td->tid_release_task, 0 , t3_process_tid_release_list, td);
225 mtx_init(&td->tid_release_lock, "tid release", NULL, MTX_DEF);
228 td->l2t = t3_init_l2t(L2T_SIZE);
229 if (td->l2t == NULL) {
238 rc = alloc_tid_tabs(&td->tid_maps, ntids, natids, mc5->nservers,
249 tod = &td->tod;
277 TOEDEV(sc->port[i].ifp) = &td->tod;
283 sc->tom_softc = td;
289 free_tom_data(td);
298 struct tom_data *td = sc->tom_softc;
302 if (td == NULL)
308 mtx_lock(&td->toep_list_lock);
309 if (!TAILQ_EMPTY(&td->toep_list))
311 mtx_unlock(&td->toep_list_lock);
313 mtx_lock(&td->lctx_hash_lock);
314 if (td->lctx_count > 0)
316 mtx_unlock(&td->lctx_hash_lock);
319 unregister_toedev(&td->tod);
321 free_tom_data(td);