Lines Matching +full:x +full:- +full:rc
1 /*-
57 * XXX: Add a TUNABLE and possible per-device sysctl for this?
61 uint16_t intr_type; /* MSI, or MSI-X */
71 {0x4800, "Chelsio T440-dbg VF"},
72 {0x4801, "Chelsio T420-CR VF"},
73 {0x4802, "Chelsio T422-CR VF"},
74 {0x4803, "Chelsio T440-CR VF"},
75 {0x4804, "Chelsio T420-BCH VF"},
76 {0x4805, "Chelsio T440-BCH VF"},
77 {0x4806, "Chelsio T440-CH VF"},
78 {0x4807, "Chelsio T420-SO VF"},
79 {0x4808, "Chelsio T420-CX VF"},
80 {0x4809, "Chelsio T420-BT VF"},
81 {0x480a, "Chelsio T404-BT VF"},
82 {0x480e, "Chelsio T440-LP-CR VF"},
84 {0x5800, "Chelsio T580-dbg VF"},
85 {0x5801, "Chelsio T520-CR VF"}, /* 2 x 10G */
86 {0x5802, "Chelsio T522-CR VF"}, /* 2 x 10G, 2 X 1G */
87 {0x5803, "Chelsio T540-CR VF"}, /* 4 x 10G */
88 {0x5807, "Chelsio T520-SO VF"}, /* 2 x 10G, nomem */
89 {0x5809, "Chelsio T520-BT VF"}, /* 2 x 10GBaseT */
90 {0x580a, "Chelsio T504-BT VF"}, /* 4 x 1G */
91 {0x580d, "Chelsio T580-CR VF"}, /* 2 x 40G */
92 {0x580e, "Chelsio T540-LP-CR VF"}, /* 4 x 10G */
93 {0x5810, "Chelsio T580-LP-CR VF"}, /* 2 x 40G */
94 {0x5811, "Chelsio T520-LL-CR VF"}, /* 2 x 10G */
95 {0x5812, "Chelsio T560-CR VF"}, /* 1 x 40G, 2 x 10G */
96 {0x5814, "Chelsio T580-LP-SO-CR VF"}, /* 2 x 40G, nomem */
97 {0x5815, "Chelsio T502-BT VF"}, /* 2 x 1G */
98 {0x5818, "Chelsio T540-BT VF"}, /* 4 x 10GBaseT */
99 {0x5819, "Chelsio T540-LP-BT VF"}, /* 4 x 10GBaseT */
100 {0x581a, "Chelsio T540-SO-BT VF"}, /* 4 x 10GBaseT, nomem */
101 {0x581b, "Chelsio T540-SO-CR VF"}, /* 4 x 10G, nomem */
103 {0x6800, "Chelsio T6-DBG-25 VF"}, /* 2 x 10/25G, debug */
104 {0x6801, "Chelsio T6225-CR VF"}, /* 2 x 10/25G */
105 {0x6802, "Chelsio T6225-SO-CR VF"}, /* 2 x 10/25G, nomem */
106 {0x6803, "Chelsio T6425-CR VF"}, /* 4 x 10/25G */
107 {0x6804, "Chelsio T6425-SO-CR VF"}, /* 4 x 10/25G, nomem */
108 {0x6805, "Chelsio T6225-SO-OCP3 VF"}, /* 2 x 10/25G, nomem */
109 {0x6806, "Chelsio T6225-OCP3 VF"}, /* 2 x 10/25G */
110 {0x6807, "Chelsio T62100-LP-CR VF"}, /* 2 x 40/50/100G */
111 {0x6808, "Chelsio T62100-SO-CR VF"}, /* 2 x 40/50/100G, nomem */
112 {0x6809, "Chelsio T6210-BT VF"}, /* 2 x 10GBASE-T */
113 {0x680d, "Chelsio T62100-CR VF"}, /* 2 x 40/50/100G */
114 {0x6810, "Chelsio T6-DBG-100 VF"}, /* 2 x 40/50/100G, debug */
115 {0x6811, "Chelsio T6225-LL-CR VF"}, /* 2 x 10/25G */
116 {0x6814, "Chelsio T62100-SO-OCP3 VF"}, /* 2 x 40/50/100G, nomem */
117 {0x6815, "Chelsio T6201-BT VF"}, /* 2 x 1000BASE-T */
122 {0x6882, "Chelsio T6225-CR 82 VF"},
123 {0x6883, "Chelsio T62100-CR 83 VF"},
124 {0x6884, "Chelsio T64100-CR 84 VF"},
125 {0x6885, "Chelsio T6240-SO 85 VF"},
126 {0x6886, "Chelsio T6225-SO-CR 86 VF"},
127 {0x6887, "Chelsio T6225-CR 87 VF"},
196 int rc; in get_params__pre_init() local
202 rc = -t4vf_query_params(sc, nitems(param), param, val); in get_params__pre_init()
203 if (rc != 0) { in get_params__pre_init()
204 device_printf(sc->dev, in get_params__pre_init()
205 "failed to query parameters (pre_init): %d.\n", rc); in get_params__pre_init()
206 return (rc); in get_params__pre_init()
209 sc->params.fw_vers = val[0]; in get_params__pre_init()
210 sc->params.tp_vers = val[1]; in get_params__pre_init()
211 sc->params.vpd.cclk = val[2]; in get_params__pre_init()
213 snprintf(sc->fw_version, sizeof(sc->fw_version), "%u.%u.%u.%u", in get_params__pre_init()
214 G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers), in get_params__pre_init()
215 G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers), in get_params__pre_init()
216 G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers), in get_params__pre_init()
217 G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers)); in get_params__pre_init()
219 snprintf(sc->tp_version, sizeof(sc->tp_version), "%u.%u.%u.%u", in get_params__pre_init()
220 G_FW_HDR_FW_VER_MAJOR(sc->params.tp_vers), in get_params__pre_init()
221 G_FW_HDR_FW_VER_MINOR(sc->params.tp_vers), in get_params__pre_init()
222 G_FW_HDR_FW_VER_MICRO(sc->params.tp_vers), in get_params__pre_init()
223 G_FW_HDR_FW_VER_BUILD(sc->params.tp_vers)); in get_params__pre_init()
231 int rc; in get_params__post_init() local
234 rc = -t4vf_get_sge_params(sc); in get_params__post_init()
235 if (rc != 0) { in get_params__post_init()
236 device_printf(sc->dev, in get_params__post_init()
237 "unable to retrieve adapter SGE parameters: %d\n", rc); in get_params__post_init()
238 return (rc); in get_params__post_init()
241 rc = -t4vf_get_rss_glb_config(sc); in get_params__post_init()
242 if (rc != 0) { in get_params__post_init()
243 device_printf(sc->dev, in get_params__post_init()
244 "unable to retrieve adapter RSS parameters: %d\n", rc); in get_params__post_init()
245 return (rc); in get_params__post_init()
247 if (sc->params.rss.mode != FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL) { in get_params__post_init()
248 device_printf(sc->dev, in get_params__post_init()
250 sc->params.rss.mode); in get_params__post_init()
259 rc = -t4vf_get_vfres(sc); in get_params__post_init()
260 if (rc != 0) { in get_params__post_init()
261 device_printf(sc->dev, in get_params__post_init()
262 "unable to get virtual interface resources: %d\n", rc); in get_params__post_init()
263 return (rc); in get_params__post_init()
269 if (sc->params.vfres.pmask == 0) { in get_params__post_init()
270 device_printf(sc->dev, "no port access configured/usable!\n"); in get_params__post_init()
273 if (sc->params.vfres.nvi == 0) { in get_params__post_init()
274 device_printf(sc->dev, in get_params__post_init()
278 sc->params.portvec = sc->params.vfres.pmask; in get_params__post_init()
281 rc = -t4vf_query_params(sc, 1, ¶m, &val); in get_params__post_init()
282 if (rc == 0) in get_params__post_init()
283 sc->params.max_pkts_per_eth_tx_pkts_wr = val; in get_params__post_init()
285 sc->params.max_pkts_per_eth_tx_pkts_wr = 14; in get_params__post_init()
287 rc = t4_verify_chip_settings(sc); in get_params__post_init()
288 if (rc != 0) in get_params__post_init()
289 return (rc); in get_params__post_init()
309 sc->params.port_caps32 = 1; in set_params__post_init()
322 int itype, iq_avail, navail, rc; in cfg_itype_and_nqueues() local
328 vfres = &sc->params.vfres; in cfg_itype_and_nqueues()
329 nports = sc->params.nports; in cfg_itype_and_nqueues()
337 navail = pci_msix_count(sc->dev); in cfg_itype_and_nqueues()
339 navail = pci_msi_count(sc->dev); in cfg_itype_and_nqueues()
344 iaq->intr_type = itype; in cfg_itype_and_nqueues()
348 * forwarded interrupts when using MSI (but not MSI-X). in cfg_itype_and_nqueues()
359 iaq->nirq = T4VF_EXTRA_INTR; in cfg_itype_and_nqueues()
366 iq_avail = vfres->niqflint - iaq->nirq; in cfg_itype_and_nqueues()
368 device_printf(sc->dev, in cfg_itype_and_nqueues()
370 vfres->niqflint, nports); in cfg_itype_and_nqueues()
380 if (iaq->nirq + nports <= navail) { in cfg_itype_and_nqueues()
381 if (iq_avail > navail - iaq->nirq) in cfg_itype_and_nqueues()
382 iq_avail = navail - iaq->nirq; in cfg_itype_and_nqueues()
398 if (vfres->nethctrl < nports) { in cfg_itype_and_nqueues()
399 device_printf(sc->dev, in cfg_itype_and_nqueues()
401 vfres->nethctrl, nports); in cfg_itype_and_nqueues()
406 if (ntxq > vfres->nethctrl) { in cfg_itype_and_nqueues()
410 ntxq = (vfres->nethctrl / nports) * nports; in cfg_itype_and_nqueues()
412 KASSERT(ntxq <= vfres->nethctrl, ("too many ETH queues")); in cfg_itype_and_nqueues()
417 if (vfres->neq < nports * 2) { in cfg_itype_and_nqueues()
418 device_printf(sc->dev, in cfg_itype_and_nqueues()
420 vfres->neq, nports); in cfg_itype_and_nqueues()
423 if (nrxq + ntxq > vfres->neq) { in cfg_itype_and_nqueues()
428 KASSERT(ntxq <= vfres->nethctrl, ("too many ETH queues")); in cfg_itype_and_nqueues()
429 KASSERT(nrxq + ntxq <= vfres->neq, ("too many egress queues")); in cfg_itype_and_nqueues()
435 iaq->nirq += nrxq; in cfg_itype_and_nqueues()
436 iaq->ntxq = ntxq; in cfg_itype_and_nqueues()
437 iaq->nrxq = nrxq; in cfg_itype_and_nqueues()
438 if (iaq->nirq <= navail && in cfg_itype_and_nqueues()
439 (itype != INTR_MSI || powerof2(iaq->nirq))) { in cfg_itype_and_nqueues()
440 navail = iaq->nirq; in cfg_itype_and_nqueues()
442 rc = pci_alloc_msix(sc->dev, &navail); in cfg_itype_and_nqueues()
444 rc = pci_alloc_msi(sc->dev, &navail); in cfg_itype_and_nqueues()
445 if (rc != 0) { in cfg_itype_and_nqueues()
446 device_printf(sc->dev, in cfg_itype_and_nqueues()
448 itype, rc, iaq->nirq, navail); in cfg_itype_and_nqueues()
449 return (rc); in cfg_itype_and_nqueues()
451 if (navail == iaq->nirq) { in cfg_itype_and_nqueues()
454 pci_release_msi(sc->dev); in cfg_itype_and_nqueues()
458 iaq->nirq = 1; in cfg_itype_and_nqueues()
459 navail = iaq->nirq; in cfg_itype_and_nqueues()
461 rc = pci_alloc_msix(sc->dev, &navail); in cfg_itype_and_nqueues()
463 rc = pci_alloc_msi(sc->dev, &navail); in cfg_itype_and_nqueues()
464 if (rc != 0) in cfg_itype_and_nqueues()
465 device_printf(sc->dev, in cfg_itype_and_nqueues()
467 itype, rc, iaq->nirq, navail); in cfg_itype_and_nqueues()
468 return (rc); in cfg_itype_and_nqueues()
471 device_printf(sc->dev, in cfg_itype_and_nqueues()
473 "allowed=%d, msi-x=%d, msi=%d, intx=1", t4_intr_types, in cfg_itype_and_nqueues()
474 pci_msix_count(sc->dev), pci_msi_count(sc->dev)); in cfg_itype_and_nqueues()
483 int rc = 0, i, j, rqidx, tqidx, n, p, pmask; in t4vf_attach() local
489 sc->dev = dev; in t4vf_attach()
490 sysctl_ctx_init(&sc->ctx); in t4vf_attach()
493 sc->params.pci.mps = pci_get_max_payload(dev); in t4vf_attach()
495 sc->flags |= IS_VF; in t4vf_attach()
496 TUNABLE_INT_FETCH("hw.cxgbe.dflags", &sc->debug_flags); in t4vf_attach()
498 sc->sge_gts_reg = VF_SGE_REG(A_SGE_VF_GTS); in t4vf_attach()
499 sc->sge_kdoorbell_reg = VF_SGE_REG(A_SGE_VF_KDOORBELL); in t4vf_attach()
500 snprintf(sc->lockname, sizeof(sc->lockname), "%s", in t4vf_attach()
502 mtx_init(&sc->sc_lock, sc->lockname, 0, MTX_DEF); in t4vf_attach()
505 mtx_init(&sc->sfl_lock, "starving freelists", 0, MTX_DEF); in t4vf_attach()
506 TAILQ_INIT(&sc->sfl); in t4vf_attach()
507 callout_init_mtx(&sc->sfl_callout, &sc->sfl_lock, 0); in t4vf_attach()
509 mtx_init(&sc->reg_lock, "indirect register access", 0, MTX_DEF); in t4vf_attach()
511 rc = t4_map_bars_0_and_4(sc); in t4vf_attach()
512 if (rc != 0) in t4vf_attach()
515 rc = -t4vf_prep_adapter(sc); in t4vf_attach()
516 if (rc != 0) in t4vf_attach()
520 if (sc->names == NULL) { in t4vf_attach()
521 rc = ENOTSUP; in t4vf_attach()
531 memset(sc->chan_map, 0xff, sizeof(sc->chan_map)); in t4vf_attach()
539 rc = make_dev_s(&mda, &sc->cdev, "%s", device_get_nameunit(dev)); in t4vf_attach()
540 if (rc != 0) in t4vf_attach()
542 rc); in t4vf_attach()
547 rc = ENOTSUP; in t4vf_attach()
553 * Some environments do not properly handle PCIE FLRs -- e.g. in Linux in t4vf_attach()
555 * issue an FLR because of a self- deadlock on the device semaphore. in t4vf_attach()
557 * cases where they're needed -- for instance, some versions of KVM in t4vf_attach()
562 rc = -t4vf_fw_reset(sc); in t4vf_attach()
563 if (rc != 0) { in t4vf_attach()
564 device_printf(dev, "FW reset failed: %d\n", rc); in t4vf_attach()
567 sc->flags |= FW_OK; in t4vf_attach()
577 rc = get_params__pre_init(sc); in t4vf_attach()
578 if (rc != 0) in t4vf_attach()
580 rc = get_params__post_init(sc); in t4vf_attach()
581 if (rc != 0) in t4vf_attach()
584 rc = set_params__post_init(sc); in t4vf_attach()
585 if (rc != 0) in t4vf_attach()
588 rc = t4_map_bar_2(sc); in t4vf_attach()
589 if (rc != 0) in t4vf_attach()
592 rc = t4_adj_doorbells(sc); in t4vf_attach()
593 if (rc != 0) in t4vf_attach()
596 rc = t4_create_dma_tag(sc); in t4vf_attach()
597 if (rc != 0) in t4vf_attach()
604 sc->params.nports = imin(sc->params.vfres.nvi, MAX_NPORTS); in t4vf_attach()
611 sc->params.nports = imin(sc->params.nports, in t4vf_attach()
612 bitcount32(sc->params.vfres.pmask)); in t4vf_attach()
622 * First pass over all the ports - allocate VIs and initialize some in t4vf_attach()
625 pmask = sc->params.vfres.pmask; in t4vf_attach()
631 sc->port[i] = pi; in t4vf_attach()
634 pi->adapter = sc; in t4vf_attach()
635 pi->port_id = i; in t4vf_attach()
636 pi->nvi = 1; in t4vf_attach()
637 pi->vi = malloc(sizeof(struct vi_info) * pi->nvi, M_CXGBE, in t4vf_attach()
644 rc = -t4_port_init(sc, sc->mbox, sc->pf, 0, i); in t4vf_attach()
645 if (rc != 0) { in t4vf_attach()
647 i, rc); in t4vf_attach()
648 free(pi->vi, M_CXGBE); in t4vf_attach()
650 sc->port[i] = NULL; in t4vf_attach()
656 p = ffs(pmask) - 1; in t4vf_attach()
658 rc = t4vf_get_vf_mac(sc, p, &n, mac); in t4vf_attach()
659 if (rc == 0 && n == 1) in t4vf_attach()
663 sc->vlan_id = t4vf_get_vf_vlan(sc); in t4vf_attach()
667 snprintf(pi->lockname, sizeof(pi->lockname), "%sp%d", in t4vf_attach()
669 mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF); in t4vf_attach()
670 sc->chan_map[pi->tx_chan] = i; in t4vf_attach()
673 ifmedia_init(&pi->media, IFM_IMASK, cxgbe_media_change, in t4vf_attach()
676 pi->dev = device_add_child(dev, sc->names->vf_ifnet_name, DEVICE_UNIT_ANY); in t4vf_attach()
677 if (pi->dev == NULL) { in t4vf_attach()
680 rc = ENXIO; in t4vf_attach()
683 pi->vi[0].dev = pi->dev; in t4vf_attach()
684 device_set_softc(pi->dev, pi); in t4vf_attach()
690 rc = cfg_itype_and_nqueues(sc, &iaq); in t4vf_attach()
691 if (rc != 0) in t4vf_attach()
694 sc->intr_type = iaq.intr_type; in t4vf_attach()
695 sc->intr_count = iaq.nirq; in t4vf_attach()
697 s = &sc->sge; in t4vf_attach()
698 s->nrxq = sc->params.nports * iaq.nrxq; in t4vf_attach()
699 s->ntxq = sc->params.nports * iaq.ntxq; in t4vf_attach()
700 s->neq = s->ntxq + s->nrxq; /* the free list in an rxq is an eq */ in t4vf_attach()
701 s->neq += sc->params.nports; /* ctrl queues: 1 per port */ in t4vf_attach()
702 s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */ in t4vf_attach()
704 s->iqmap_sz = s->niq; in t4vf_attach()
705 s->eqmap_sz = s->neq; in t4vf_attach()
707 s->rxq = malloc(s->nrxq * sizeof(struct sge_rxq), M_CXGBE, in t4vf_attach()
709 s->txq = malloc(s->ntxq * sizeof(struct sge_txq), M_CXGBE, in t4vf_attach()
711 s->iqmap = malloc(s->iqmap_sz * sizeof(struct sge_iq *), M_CXGBE, in t4vf_attach()
713 s->eqmap = malloc(s->eqmap_sz * sizeof(struct sge_eq *), M_CXGBE, in t4vf_attach()
716 sc->irq = malloc(sc->intr_count * sizeof(struct irq), M_CXGBE, in t4vf_attach()
725 struct port_info *pi = sc->port[i]; in t4vf_attach()
732 vi->pi = pi; in t4vf_attach()
733 vi->adapter = sc; in t4vf_attach()
734 vi->qsize_rxq = t4_qsize_rxq; in t4vf_attach()
735 vi->qsize_txq = t4_qsize_txq; in t4vf_attach()
737 vi->first_rxq = rqidx; in t4vf_attach()
738 vi->first_txq = tqidx; in t4vf_attach()
739 vi->tmr_idx = t4_tmr_idx; in t4vf_attach()
740 vi->pktc_idx = t4_pktc_idx; in t4vf_attach()
741 vi->nrxq = j == 0 ? iaq.nrxq: 1; in t4vf_attach()
742 vi->ntxq = j == 0 ? iaq.ntxq: 1; in t4vf_attach()
744 rqidx += vi->nrxq; in t4vf_attach()
745 tqidx += vi->ntxq; in t4vf_attach()
747 vi->rsrv_noflowq = 0; in t4vf_attach()
751 rc = t4_setup_intr_handlers(sc); in t4vf_attach()
752 if (rc != 0) { in t4vf_attach()
754 "failed to setup interrupt handlers: %d\n", rc); in t4vf_attach()
762 sc->params.nports, sc->intr_count, sc->intr_type == INTR_MSIX ? in t4vf_attach()
763 "MSI-X" : "MSI", sc->intr_count > 1 ? "s" : "", sc->sge.neq, in t4vf_attach()
764 sc->sge.niq); in t4vf_attach()
767 if (rc != 0) in t4vf_attach()
772 return (rc); in t4vf_attach()
780 regs->version = chip_id(sc) | (0x3f << 10); in get_regs()
781 t4_get_regs(sc, buf, regs->len); in get_regs()
798 int rc; in t4vf_ioctl() local
799 struct adapter *sc = dev->si_drv1; in t4vf_ioctl()
801 rc = priv_check(td, PRIV_DRIVER); in t4vf_ioctl()
802 if (rc != 0) in t4vf_ioctl()
803 return (rc); in t4vf_ioctl()
809 if ((edata->addr & 0x3) != 0 || edata->addr >= sc->mmio_len) in t4vf_ioctl()
812 if (edata->size == 4) in t4vf_ioctl()
813 edata->val = t4_read_reg(sc, edata->addr); in t4vf_ioctl()
814 else if (edata->size == 8) in t4vf_ioctl()
815 edata->val = t4_read_reg64(sc, edata->addr); in t4vf_ioctl()
824 if ((edata->addr & 0x3) != 0 || edata->addr >= sc->mmio_len) in t4vf_ioctl()
827 if (edata->size == 4) { in t4vf_ioctl()
828 if (edata->val & 0xffffffff00000000) in t4vf_ioctl()
830 t4_write_reg(sc, edata->addr, (uint32_t) edata->val); in t4vf_ioctl()
831 } else if (edata->size == 8) in t4vf_ioctl()
832 t4_write_reg64(sc, edata->addr, edata->val); in t4vf_ioctl()
842 if (regs->len < reglen) { in t4vf_ioctl()
843 regs->len = reglen; /* hint to the caller */ in t4vf_ioctl()
847 regs->len = reglen; in t4vf_ioctl()
850 rc = copyout(buf, regs->data, reglen); in t4vf_ioctl()
860 if (port_id >= sc->params.nports) in t4vf_ioctl()
862 pi = sc->port[port_id]; in t4vf_ioctl()
865 pi->tx_parse_error = 0; in t4vf_ioctl()
873 if (vi->flags & VI_INIT_DONE) { in t4vf_ioctl()
879 rxq->lro.lro_queued = 0; in t4vf_ioctl()
880 rxq->lro.lro_flushed = 0; in t4vf_ioctl()
882 rxq->rxcsum = 0; in t4vf_ioctl()
883 rxq->vlan_extraction = 0; in t4vf_ioctl()
887 txq->txcsum = 0; in t4vf_ioctl()
888 txq->tso_wrs = 0; in t4vf_ioctl()
889 txq->vlan_insertion = 0; in t4vf_ioctl()
890 txq->imm_wrs = 0; in t4vf_ioctl()
891 txq->sgl_wrs = 0; in t4vf_ioctl()
892 txq->txpkt_wrs = 0; in t4vf_ioctl()
893 txq->txpkts0_wrs = 0; in t4vf_ioctl()
894 txq->txpkts1_wrs = 0; in t4vf_ioctl()
895 txq->txpkts0_pkts = 0; in t4vf_ioctl()
896 txq->txpkts1_pkts = 0; in t4vf_ioctl()
897 txq->txpkts_flush = 0; in t4vf_ioctl()
898 mp_ring_reset_stats(txq->r); in t4vf_ioctl()
905 rc = t4_set_sched_class(sc, (struct t4_sched_params *)data); in t4vf_ioctl()
908 rc = t4_set_sched_queue(sc, (struct t4_sched_queue *)data); in t4vf_ioctl()
911 rc = ENOTTY; in t4vf_ioctl()
914 return (rc); in t4vf_ioctl()