Lines Matching +full:te +full:- +full:source
2 * Copyright (c) 2006-2008 Chelsio, Inc. All rights reserved.
7 * COPYING in the main directory of this source tree, or the
10 * Redistribution and use in source and binary forms, with or
14 * - Redistributions of source code must retain the above
18 * - Redistributions in binary form must reproduce the above
74 return test_bit(OFFLOAD_DEVMAP_BIT, &adapter->open_device_map); in offload_activated()
78 * cxgb3_register_client - register an offload client
89 list_add_tail(&client->client_list, &client_list); in cxgb3_register_client()
91 if (client->add) { in cxgb3_register_client()
94 client->add(tdev); in cxgb3_register_client()
103 * cxgb3_unregister_client - unregister an offload client
114 list_del(&client->client_list); in cxgb3_unregister_client()
116 if (client->remove) { in cxgb3_unregister_client()
119 client->remove(tdev); in cxgb3_unregister_client()
128 * cxgb3_add_clients - activate registered clients for an offload device
139 if (client->add) in cxgb3_add_clients()
140 client->add(tdev); in cxgb3_add_clients()
146 * cxgb3_remove_clients - deactivates registered clients
158 if (client->remove) in cxgb3_remove_clients()
159 client->remove(tdev); in cxgb3_remove_clients()
170 if (client->event_handler) in cxgb3_event_notify()
171 client->event_handler(tdev, event, port); in cxgb3_event_notify()
183 struct net_device *dev = adapter->port[i]; in get_iff_from_mac()
185 if (ether_addr_equal(dev->dev_addr, mac)) { in get_iff_from_mac()
213 uiip->pdev = adapter->pdev; in cxgb_ulp_iscsi_ctl()
214 uiip->llimit = t3_read_reg(adapter, A_ULPRX_ISCSI_LLIMIT); in cxgb_ulp_iscsi_ctl()
215 uiip->ulimit = t3_read_reg(adapter, A_ULPRX_ISCSI_ULIMIT); in cxgb_ulp_iscsi_ctl()
216 uiip->tagmask = t3_read_reg(adapter, A_ULPRX_ISCSI_TAGMASK); in cxgb_ulp_iscsi_ctl()
220 uiip->pgsz_factor[i] = val & 0xFF; in cxgb_ulp_iscsi_ctl()
223 uiip->max_txsz = in cxgb_ulp_iscsi_ctl()
224 uiip->max_rxsz = min((val >> S_PMMAXXFERLEN0)&M_PMMAXXFERLEN0, in cxgb_ulp_iscsi_ctl()
230 val = min(adapter->params.tp.tx_pg_size, in cxgb_ulp_iscsi_ctl()
232 uiip->max_txsz = min(val, uiip->max_txsz); in cxgb_ulp_iscsi_ctl()
240 adapter->name, val); in cxgb_ulp_iscsi_ctl()
248 val = min(adapter->params.tp.rx_pg_size, in cxgb_ulp_iscsi_ctl()
251 uiip->max_rxsz = min(val, uiip->max_rxsz); in cxgb_ulp_iscsi_ctl()
254 t3_write_reg(adapter, A_ULPRX_ISCSI_TAGMASK, uiip->tagmask); in cxgb_ulp_iscsi_ctl()
257 val |= (uiip->pgsz_factor[i] & 0xF) << (8 * i); in cxgb_ulp_iscsi_ctl()
260 adapter->name, val, uiip->pgsz_factor[0], in cxgb_ulp_iscsi_ctl()
261 uiip->pgsz_factor[1], uiip->pgsz_factor[2], in cxgb_ulp_iscsi_ctl()
262 uiip->pgsz_factor[3]); in cxgb_ulp_iscsi_ctl()
267 ret = -EOPNOTSUPP; in cxgb_ulp_iscsi_ctl()
282 struct pci_dev *pdev = adapter->pdev; in cxgb_rdma_ctl()
284 rdma->udbell_physbase = pci_resource_start(pdev, 2); in cxgb_rdma_ctl()
285 rdma->udbell_len = pci_resource_len(pdev, 2); in cxgb_rdma_ctl()
286 rdma->tpt_base = in cxgb_rdma_ctl()
288 rdma->tpt_top = t3_read_reg(adapter, A_ULPTX_TPT_ULIMIT); in cxgb_rdma_ctl()
289 rdma->pbl_base = in cxgb_rdma_ctl()
291 rdma->pbl_top = t3_read_reg(adapter, A_ULPTX_PBL_ULIMIT); in cxgb_rdma_ctl()
292 rdma->rqt_base = t3_read_reg(adapter, A_ULPRX_RQ_LLIMIT); in cxgb_rdma_ctl()
293 rdma->rqt_top = t3_read_reg(adapter, A_ULPRX_RQ_ULIMIT); in cxgb_rdma_ctl()
294 rdma->kdb_addr = adapter->regs + A_SG_KDOORBELL; in cxgb_rdma_ctl()
295 rdma->pdev = pdev; in cxgb_rdma_ctl()
303 spin_lock_irqsave(&adapter->sge.reg_lock, flags); in cxgb_rdma_ctl()
304 ret = t3_sge_cqcntxt_op(adapter, rdma->id, rdma->op, in cxgb_rdma_ctl()
305 rdma->credits); in cxgb_rdma_ctl()
306 spin_unlock_irqrestore(&adapter->sge.reg_lock, flags); in cxgb_rdma_ctl()
313 if ((t->addr & 7) || (t->len & 7)) in cxgb_rdma_ctl()
314 return -EINVAL; in cxgb_rdma_ctl()
315 if (t->mem_id == MEM_CM) in cxgb_rdma_ctl()
316 mem = &adapter->cm; in cxgb_rdma_ctl()
317 else if (t->mem_id == MEM_PMRX) in cxgb_rdma_ctl()
318 mem = &adapter->pmrx; in cxgb_rdma_ctl()
319 else if (t->mem_id == MEM_PMTX) in cxgb_rdma_ctl()
320 mem = &adapter->pmtx; in cxgb_rdma_ctl()
322 return -EINVAL; in cxgb_rdma_ctl()
325 t3_mc7_bd_read(mem, t->addr / 8, t->len / 8, in cxgb_rdma_ctl()
326 (u64 *) t->buf); in cxgb_rdma_ctl()
334 spin_lock_irq(&adapter->sge.reg_lock); in cxgb_rdma_ctl()
336 t3_sge_init_cqcntxt(adapter, rdma->id, in cxgb_rdma_ctl()
337 rdma->base_addr, rdma->size, in cxgb_rdma_ctl()
339 rdma->ovfl_mode, rdma->credits, in cxgb_rdma_ctl()
340 rdma->credit_thres); in cxgb_rdma_ctl()
341 spin_unlock_irq(&adapter->sge.reg_lock); in cxgb_rdma_ctl()
345 spin_lock_irq(&adapter->sge.reg_lock); in cxgb_rdma_ctl()
347 spin_unlock_irq(&adapter->sge.reg_lock); in cxgb_rdma_ctl()
352 spin_lock_irq(&adapter->sge.reg_lock); in cxgb_rdma_ctl()
356 rdma->base_addr, rdma->size, in cxgb_rdma_ctl()
358 spin_unlock_irq(&adapter->sge.reg_lock); in cxgb_rdma_ctl()
362 spin_lock(&adapter->stats_lock); in cxgb_rdma_ctl()
364 spin_unlock(&adapter->stats_lock); in cxgb_rdma_ctl()
368 ret = -EOPNOTSUPP; in cxgb_rdma_ctl()
382 struct tp_params *tp = &adapter->params.tp; in cxgb_offload_ctl()
397 tid->num = t3_mc5_size(&adapter->mc5) - in cxgb_offload_ctl()
398 adapter->params.mc5.nroutes - in cxgb_offload_ctl()
399 adapter->params.mc5.nfilters - adapter->params.mc5.nservers; in cxgb_offload_ctl()
400 tid->base = 0; in cxgb_offload_ctl()
404 tid->num = adapter->params.mc5.nservers; in cxgb_offload_ctl()
405 tid->base = t3_mc5_size(&adapter->mc5) - tid->num - in cxgb_offload_ctl()
406 adapter->params.mc5.nfilters - adapter->params.mc5.nroutes; in cxgb_offload_ctl()
413 mtup->size = NMTUS; in cxgb_offload_ctl()
414 mtup->mtus = adapter->params.mtus; in cxgb_offload_ctl()
418 iffmacp->dev = get_iff_from_mac(adapter, iffmacp->mac_addr, in cxgb_offload_ctl()
419 iffmacp->vlan_tag & in cxgb_offload_ctl()
424 ddpp->llimit = t3_read_reg(adapter, A_ULPRX_TDDP_LLIMIT); in cxgb_offload_ctl()
425 ddpp->ulimit = t3_read_reg(adapter, A_ULPRX_TDDP_ULIMIT); in cxgb_offload_ctl()
426 ddpp->tag_mask = t3_read_reg(adapter, A_ULPRX_TDDP_TAGMASK); in cxgb_offload_ctl()
430 ports->nports = adapter->params.nports; in cxgb_offload_ctl()
432 ports->lldevs[i] = adapter->port[i]; in cxgb_offload_ctl()
437 return -EAGAIN; in cxgb_offload_ctl()
447 return -EAGAIN; in cxgb_offload_ctl()
451 rx_page_info->page_size = tp->rx_pg_size; in cxgb_offload_ctl()
452 rx_page_info->num = tp->rx_num_pgs; in cxgb_offload_ctl()
456 struct port_info *pi = netdev_priv(p->dev); in cxgb_offload_ctl()
457 p->ipv4addr = pi->iscsi_ipv4addr; in cxgb_offload_ctl()
463 spin_lock(&adapter->stats_lock); in cxgb_offload_ctl()
464 t3_get_fw_version(adapter, &e->fw_vers); in cxgb_offload_ctl()
465 t3_get_tp_version(adapter, &e->tp_vers); in cxgb_offload_ctl()
466 spin_unlock(&adapter->stats_lock); in cxgb_offload_ctl()
470 return -EOPNOTSUPP; in cxgb_offload_ctl()
483 while (n--) in rx_offload_blackhole()
494 dev->recv = rx_offload_blackhole; in cxgb3_set_dummy_ops()
495 dev->neigh_update = dummy_neigh_update; in cxgb3_set_dummy_ops()
499 * Free an active-open TID.
503 struct tid_info *t = &(T3C_DATA(tdev))->tid_maps; in cxgb3_free_atid()
505 void *ctx = p->t3c_tid.ctx; in cxgb3_free_atid()
507 spin_lock_bh(&t->atid_lock); in cxgb3_free_atid()
508 p->next = t->afree; in cxgb3_free_atid()
509 t->afree = p; in cxgb3_free_atid()
510 t->atids_in_use--; in cxgb3_free_atid()
511 spin_unlock_bh(&t->atid_lock); in cxgb3_free_atid()
521 struct tid_info *t = &(T3C_DATA(tdev))->tid_maps; in cxgb3_insert_tid()
523 t->tid_tab[tid].client = client; in cxgb3_insert_tid()
524 t->tid_tab[tid].ctx = ctx; in cxgb3_insert_tid()
525 atomic_inc(&t->tids_in_use); in cxgb3_insert_tid()
537 skb->priority = CPL_PRIORITY_SETUP; in mk_tid_release()
539 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); in mk_tid_release()
548 struct t3cdev *tdev = td->dev; in t3_process_tid_release_list()
551 spin_lock_bh(&td->tid_release_lock); in t3_process_tid_release_list()
552 while (td->tid_release_list) { in t3_process_tid_release_list()
553 struct t3c_tid_entry *p = td->tid_release_list; in t3_process_tid_release_list()
555 td->tid_release_list = p->ctx; in t3_process_tid_release_list()
556 spin_unlock_bh(&td->tid_release_lock); in t3_process_tid_release_list()
561 skb = td->nofail_skb; in t3_process_tid_release_list()
563 spin_lock_bh(&td->tid_release_lock); in t3_process_tid_release_list()
564 p->ctx = (void *)td->tid_release_list; in t3_process_tid_release_list()
565 td->tid_release_list = p; in t3_process_tid_release_list()
568 mk_tid_release(skb, p - td->tid_maps.tid_tab); in t3_process_tid_release_list()
570 p->ctx = NULL; in t3_process_tid_release_list()
571 if (skb == td->nofail_skb) in t3_process_tid_release_list()
572 td->nofail_skb = in t3_process_tid_release_list()
575 spin_lock_bh(&td->tid_release_lock); in t3_process_tid_release_list()
577 td->release_list_incomplete = (td->tid_release_list == NULL) ? 0 : 1; in t3_process_tid_release_list()
578 spin_unlock_bh(&td->tid_release_lock); in t3_process_tid_release_list()
580 if (!td->nofail_skb) in t3_process_tid_release_list()
581 td->nofail_skb = in t3_process_tid_release_list()
590 struct t3c_tid_entry *p = &td->tid_maps.tid_tab[tid]; in cxgb3_queue_tid_release()
592 spin_lock_bh(&td->tid_release_lock); in cxgb3_queue_tid_release()
593 p->ctx = (void *)td->tid_release_list; in cxgb3_queue_tid_release()
594 p->client = NULL; in cxgb3_queue_tid_release()
595 td->tid_release_list = p; in cxgb3_queue_tid_release()
596 if (!p->ctx || td->release_list_incomplete) in cxgb3_queue_tid_release()
597 schedule_work(&td->tid_release_task); in cxgb3_queue_tid_release()
598 spin_unlock_bh(&td->tid_release_lock); in cxgb3_queue_tid_release()
612 struct tid_info *t = &(T3C_DATA(tdev))->tid_maps; in cxgb3_remove_tid()
614 BUG_ON(tid >= t->ntids); in cxgb3_remove_tid()
615 if (tdev->type == T3A) in cxgb3_remove_tid()
616 (void)cmpxchg(&t->tid_tab[tid].ctx, ctx, NULL); in cxgb3_remove_tid()
624 t->tid_tab[tid].ctx = NULL; in cxgb3_remove_tid()
628 atomic_dec(&t->tids_in_use); in cxgb3_remove_tid()
636 int atid = -1; in cxgb3_alloc_atid()
637 struct tid_info *t = &(T3C_DATA(tdev))->tid_maps; in cxgb3_alloc_atid()
639 spin_lock_bh(&t->atid_lock); in cxgb3_alloc_atid()
640 if (t->afree && in cxgb3_alloc_atid()
641 t->atids_in_use + atomic_read(&t->tids_in_use) + MC5_MIN_TIDS <= in cxgb3_alloc_atid()
642 t->ntids) { in cxgb3_alloc_atid()
643 union active_open_entry *p = t->afree; in cxgb3_alloc_atid()
645 atid = (p - t->atid_tab) + t->atid_base; in cxgb3_alloc_atid()
646 t->afree = p->next; in cxgb3_alloc_atid()
647 p->t3c_tid.ctx = ctx; in cxgb3_alloc_atid()
648 p->t3c_tid.client = client; in cxgb3_alloc_atid()
649 t->atids_in_use++; in cxgb3_alloc_atid()
651 spin_unlock_bh(&t->atid_lock); in cxgb3_alloc_atid()
662 return (struct t3cdev *)pi->adapter; in dev2t3cdev()
671 if (rpl->status != CPL_ERR_NONE) in do_smt_write_rpl()
673 rpl->status, GET_TID(rpl)); in do_smt_write_rpl()
682 if (rpl->status != CPL_ERR_NONE) in do_l2t_write_rpl()
684 rpl->status, GET_TID(rpl)); in do_l2t_write_rpl()
693 if (rpl->status != CPL_ERR_NONE) in do_rte_write_rpl()
695 rpl->status, GET_TID(rpl)); in do_rte_write_rpl()
703 unsigned int atid = G_TID(ntohl(rpl->atid)); in do_act_open_rpl()
706 t3c_tid = lookup_atid(&(T3C_DATA(dev))->tid_maps, atid); in do_act_open_rpl()
707 if (t3c_tid && t3c_tid->ctx && t3c_tid->client && in do_act_open_rpl()
708 t3c_tid->client->handlers && in do_act_open_rpl()
709 t3c_tid->client->handlers[CPL_ACT_OPEN_RPL]) { in do_act_open_rpl()
710 return t3c_tid->client->handlers[CPL_ACT_OPEN_RPL] (dev, skb, in do_act_open_rpl()
711 t3c_tid-> in do_act_open_rpl()
715 dev->name, CPL_ACT_OPEN_RPL); in do_act_open_rpl()
723 unsigned int stid = G_TID(ntohl(p->opcode_tid)); in do_stid_rpl()
726 t3c_tid = lookup_stid(&(T3C_DATA(dev))->tid_maps, stid); in do_stid_rpl()
727 if (t3c_tid && t3c_tid->ctx && t3c_tid->client->handlers && in do_stid_rpl()
728 t3c_tid->client->handlers[p->opcode]) { in do_stid_rpl()
729 return t3c_tid->client->handlers[p->opcode] (dev, skb, in do_stid_rpl()
730 t3c_tid->ctx); in do_stid_rpl()
733 dev->name, p->opcode); in do_stid_rpl()
741 unsigned int hwtid = G_TID(ntohl(p->opcode_tid)); in do_hwtid_rpl()
744 t3c_tid = lookup_tid(&(T3C_DATA(dev))->tid_maps, hwtid); in do_hwtid_rpl()
745 if (t3c_tid && t3c_tid->ctx && t3c_tid->client->handlers && in do_hwtid_rpl()
746 t3c_tid->client->handlers[p->opcode]) { in do_hwtid_rpl()
747 return t3c_tid->client->handlers[p->opcode] in do_hwtid_rpl()
748 (dev, skb, t3c_tid->ctx); in do_hwtid_rpl()
751 dev->name, p->opcode); in do_hwtid_rpl()
759 unsigned int stid = G_PASS_OPEN_TID(ntohl(req->tos_tid)); in do_cr()
760 struct tid_info *t = &(T3C_DATA(dev))->tid_maps; in do_cr()
764 if (unlikely(tid >= t->ntids)) { in do_cr()
766 dev->name, tid); in do_cr()
772 if (t3c_tid && t3c_tid->ctx && t3c_tid->client->handlers && in do_cr()
773 t3c_tid->client->handlers[CPL_PASS_ACCEPT_REQ]) { in do_cr()
774 return t3c_tid->client->handlers[CPL_PASS_ACCEPT_REQ] in do_cr()
775 (dev, skb, t3c_tid->ctx); in do_cr()
778 dev->name, CPL_PASS_ACCEPT_REQ); in do_cr()
794 BUG_ON(skb->len < len); in cxgb3_get_cpl_reply_skb()
808 unsigned int hwtid = G_TID(ntohl(p->opcode_tid)); in do_abort_req_rss()
811 t3c_tid = lookup_tid(&(T3C_DATA(dev))->tid_maps, hwtid); in do_abort_req_rss()
812 if (t3c_tid && t3c_tid->ctx && t3c_tid->client->handlers && in do_abort_req_rss()
813 t3c_tid->client->handlers[p->opcode]) { in do_abort_req_rss()
814 return t3c_tid->client->handlers[p->opcode] in do_abort_req_rss()
815 (dev, skb, t3c_tid->ctx); in do_abort_req_rss()
821 u8 cmd = req->status; in do_abort_req_rss()
823 if (req->status == CPL_ERR_RTX_NEG_ADVICE || in do_abort_req_rss()
824 req->status == CPL_ERR_PERSIST_NEG_ADVICE) in do_abort_req_rss()
836 reply_skb->priority = CPL_PRIORITY_DATA; in do_abort_req_rss()
839 rpl->wr.wr_hi = in do_abort_req_rss()
841 rpl->wr.wr_lo = htonl(V_WR_TID(tid)); in do_abort_req_rss()
843 rpl->cmd = cmd; in do_abort_req_rss()
853 unsigned int atid = G_PASS_OPEN_TID(ntohl(req->tos_tid)); in do_act_establish()
854 struct tid_info *t = &(T3C_DATA(dev))->tid_maps; in do_act_establish()
858 if (unlikely(tid >= t->ntids)) { in do_act_establish()
860 dev->name, tid); in do_act_establish()
866 if (t3c_tid && t3c_tid->ctx && t3c_tid->client->handlers && in do_act_establish()
867 t3c_tid->client->handlers[CPL_ACT_ESTABLISH]) { in do_act_establish()
868 return t3c_tid->client->handlers[CPL_ACT_ESTABLISH] in do_act_establish()
869 (dev, skb, t3c_tid->ctx); in do_act_establish()
872 dev->name, CPL_ACT_ESTABLISH); in do_act_establish()
881 skb->protocol = htons(0xffff); in do_trace()
882 skb->dev = dev->lldev; in do_trace()
891 * ->priority and ->csum to carry our data. NB: if we get to per-arch
892 * ->csum, the things might get really interesting here.
897 return ntohl((__force __be32)skb->priority) >> 8 & 0xfffff; in get_hwtid()
902 return G_OPCODE(ntohl((__force __be32)skb->csum)); in get_opcode()
911 t3c_tid = lookup_tid(&(T3C_DATA(dev))->tid_maps, hwtid); in do_term()
912 if (t3c_tid && t3c_tid->ctx && t3c_tid->client->handlers && in do_term()
913 t3c_tid->client->handlers[opcode]) { in do_term()
914 return t3c_tid->client->handlers[opcode] (dev, skb, in do_term()
915 t3c_tid->ctx); in do_term()
918 dev->name, opcode); in do_term()
933 cxgb_redirect(nr->old, nr->new, nr->neigh, in nb_callback()
934 nr->daddr); in nb_callback()
935 cxgb_neigh_update(nr->neigh); in nb_callback()
953 pr_err("%s: received bad CPL command 0x%x\n", dev->name, *skb->data); in do_bad_cpl()
982 while (n--) { in process_rx()
992 dev->name, opcode, G_TID(ntohl(p->opcode_tid))); in process_rx()
1009 r = dev->send(dev, skb); in cxgb3_ofld_send()
1024 if (dev == adapter->port[i]) { in is_offloading()
1040 dev = neigh->dev; in cxgb_neigh_update()
1059 skb->priority = CPL_PRIORITY_CONTROL; in set_l2t_ix()
1061 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); in set_l2t_ix()
1063 req->reply = 0; in set_l2t_ix()
1064 req->cpu_idx = 0; in set_l2t_ix()
1065 req->word = htons(W_TCB_L2T_IX); in set_l2t_ix()
1066 req->mask = cpu_to_be64(V_TCB_L2T_IX(M_TCB_L2T_IX)); in set_l2t_ix()
1067 req->val = cpu_to_be64(V_TCB_L2T_IX(e->idx)); in set_l2t_ix()
1068 tdev->send(tdev, skb); in set_l2t_ix()
1081 struct t3c_tid_entry *te; in cxgb_redirect() local
1083 dev = neigh->dev; in cxgb_redirect()
1098 ti = &(T3C_DATA(tdev))->tid_maps; in cxgb_redirect()
1099 for (tid = 0; tid < ti->ntids; tid++) { in cxgb_redirect()
1100 te = lookup_tid(ti, tid); in cxgb_redirect()
1101 BUG_ON(!te); in cxgb_redirect()
1102 if (te && te->ctx && te->client && te->client->redirect) { in cxgb_redirect()
1103 update_tcb = te->client->redirect(te->ctx, old, new, e); in cxgb_redirect()
1122 unsigned long size = ntids * sizeof(*t->tid_tab) + in init_tid_tabs()
1123 natids * sizeof(*t->atid_tab) + nstids * sizeof(*t->stid_tab); in init_tid_tabs()
1125 t->tid_tab = kvzalloc(size, GFP_KERNEL); in init_tid_tabs()
1126 if (!t->tid_tab) in init_tid_tabs()
1127 return -ENOMEM; in init_tid_tabs()
1129 t->stid_tab = (union listen_entry *)&t->tid_tab[ntids]; in init_tid_tabs()
1130 t->atid_tab = (union active_open_entry *)&t->stid_tab[nstids]; in init_tid_tabs()
1131 t->ntids = ntids; in init_tid_tabs()
1132 t->nstids = nstids; in init_tid_tabs()
1133 t->stid_base = stid_base; in init_tid_tabs()
1134 t->sfree = NULL; in init_tid_tabs()
1135 t->natids = natids; in init_tid_tabs()
1136 t->atid_base = atid_base; in init_tid_tabs()
1137 t->afree = NULL; in init_tid_tabs()
1138 t->stids_in_use = t->atids_in_use = 0; in init_tid_tabs()
1139 atomic_set(&t->tids_in_use, 0); in init_tid_tabs()
1140 spin_lock_init(&t->stid_lock); in init_tid_tabs()
1141 spin_lock_init(&t->atid_lock); in init_tid_tabs()
1147 while (--nstids) in init_tid_tabs()
1148 t->stid_tab[nstids - 1].next = &t->stid_tab[nstids]; in init_tid_tabs()
1149 t->sfree = t->stid_tab; in init_tid_tabs()
1152 while (--natids) in init_tid_tabs()
1153 t->atid_tab[natids - 1].next = &t->atid_tab[natids]; in init_tid_tabs()
1154 t->afree = t->atid_tab; in init_tid_tabs()
1161 kvfree(t->tid_tab); in free_tid_maps()
1167 list_add_tail(&adap->adapter_list, &adapter_list); in add_adapter()
1174 list_del(&adap->adapter_list); in remove_adapter()
1180 struct t3cdev *dev = &adapter->tdev; in cxgb3_offload_activate()
1190 return -ENOMEM; in cxgb3_offload_activate()
1192 err = -EOPNOTSUPP; in cxgb3_offload_activate()
1193 if (dev->ctl(dev, GET_TX_MAX_CHUNK, &t->tx_max_chunk) < 0 || in cxgb3_offload_activate()
1194 dev->ctl(dev, GET_MAX_OUTSTANDING_WR, &t->max_wrs) < 0 || in cxgb3_offload_activate()
1195 dev->ctl(dev, GET_L2T_CAPACITY, &l2t_capacity) < 0 || in cxgb3_offload_activate()
1196 dev->ctl(dev, GET_MTUS, &mtutab) < 0 || in cxgb3_offload_activate()
1197 dev->ctl(dev, GET_TID_RANGE, &tid_range) < 0 || in cxgb3_offload_activate()
1198 dev->ctl(dev, GET_STID_RANGE, &stid_range) < 0) in cxgb3_offload_activate()
1201 err = -ENOMEM; in cxgb3_offload_activate()
1207 err = init_tid_tabs(&t->tid_maps, tid_range.num, natids, in cxgb3_offload_activate()
1212 t->mtus = mtutab.mtus; in cxgb3_offload_activate()
1213 t->nmtus = mtutab.size; in cxgb3_offload_activate()
1215 INIT_WORK(&t->tid_release_task, t3_process_tid_release_list); in cxgb3_offload_activate()
1216 spin_lock_init(&t->tid_release_lock); in cxgb3_offload_activate()
1217 INIT_LIST_HEAD(&t->list_node); in cxgb3_offload_activate()
1218 t->dev = dev; in cxgb3_offload_activate()
1220 RCU_INIT_POINTER(dev->l2opt, l2td); in cxgb3_offload_activate()
1222 dev->recv = process_rx; in cxgb3_offload_activate()
1223 dev->neigh_update = t3_l2t_update; in cxgb3_offload_activate()
1229 t->nofail_skb = alloc_skb(sizeof(struct cpl_tid_release), GFP_KERNEL); in cxgb3_offload_activate()
1230 t->release_list_incomplete = 0; in cxgb3_offload_activate()
1251 struct t3cdev *tdev = &adapter->tdev; in cxgb3_offload_deactivate()
1259 free_tid_maps(&t->tid_maps); in cxgb3_offload_deactivate()
1264 RCU_INIT_POINTER(tdev->l2opt, NULL); in cxgb3_offload_deactivate()
1265 call_rcu(&d->rcu_head, clean_l2_data); in cxgb3_offload_deactivate()
1266 kfree_skb(t->nofail_skb); in cxgb3_offload_deactivate()
1275 snprintf(tdev->name, sizeof(tdev->name), "ofld_dev%d", unit++); in register_tdev()
1276 list_add_tail(&tdev->ofld_dev_list, &ofld_dev_list); in register_tdev()
1283 list_del(&tdev->ofld_dev_list); in unregister_tdev()
1291 switch (adapter->params.rev) { in adap2type()
1308 struct t3cdev *tdev = &adapter->tdev; in cxgb3_adapter_ofld()
1310 INIT_LIST_HEAD(&tdev->ofld_dev_list); in cxgb3_adapter_ofld()
1313 tdev->send = t3_offload_tx; in cxgb3_adapter_ofld()
1314 tdev->ctl = cxgb_offload_ctl; in cxgb3_adapter_ofld()
1315 tdev->type = adap2type(adapter); in cxgb3_adapter_ofld()
1322 struct t3cdev *tdev = &adapter->tdev; in cxgb3_adapter_unofld()
1324 tdev->recv = NULL; in cxgb3_adapter_unofld()
1325 tdev->neigh_update = NULL; in cxgb3_adapter_unofld()