/illumos-gate/usr/src/uts/common/io/mii/ |
H A D | mii.c | 193 _mii_error(mii_handle_t mh, int errno) in _mii_error() argument 199 if (mh->m_error != errno) { in _mii_error() 200 cmn_err(CE_WARN, "%s: %s", mh->m_name, mii_errors[errno]); in _mii_error() 201 mh->m_error = errno; in _mii_error() 227 mii_handle_t mh; in mii_alloc_instance() local 235 mh = kmem_zalloc(sizeof (*mh), KM_SLEEP); in mii_alloc_instance() 237 (void) snprintf(mh->m_name, sizeof (mh->m_name), "%s%d", in mii_alloc_instance() 243 mh->m_dip = dip; in mii_alloc_instance() 244 mh->m_ops = *ops; in mii_alloc_instance() 245 mh->m_private = private; in mii_alloc_instance() [all …]
|
/illumos-gate/usr/src/cmd/mdb/common/modules/genunix/ |
H A D | modhash.c | 117 mod_hash_t mh; in modhash_walk_step() local 123 if (mdb_vread(&mh, sizeof (mh), wsp->walk_addr) == -1) { in modhash_walk_step() 128 status = wsp->walk_callback(wsp->walk_addr, &mh, wsp->walk_cbdata); in modhash_walk_step() 130 wsp->walk_addr = (uintptr_t)mh.mh_next; in modhash_walk_step() 141 mod_hash_t mh; in modent_walk_init() local 150 if (mdb_vread(&mh, sizeof (mh), wsp->walk_addr) == -1) { in modent_walk_init() 155 if (mh.mh_nchains <= 1) { in modent_walk_init() 166 hwp = mdb_alloc(HW_SIZE(mh.mh_nchains), UM_NOSLEEP); in modent_walk_init() 169 HW_SIZE(mh.mh_nchains), wsp->walk_addr); in modent_walk_init() 173 (void) memcpy(&hwp->hwalk_hash, &mh, sizeof (hwp->hwalk_hash)); in modent_walk_init() [all …]
|
/illumos-gate/usr/src/uts/common/io/mac/ |
H A D | mac_client.c | 406 mac_close(mac_handle_t mh) in mac_close() argument 408 mac_impl_t *mip = (mac_impl_t *)mh; in mac_close() 433 mac_info(mac_handle_t mh) in mac_info() argument 435 return (&((mac_impl_t *)mh)->mi_info); in mac_info() 439 mac_devinfo_get(mac_handle_t mh) in mac_devinfo_get() argument 441 return (((mac_impl_t *)mh)->mi_dip); in mac_devinfo_get() 445 mac_driver(mac_handle_t mh) in mac_driver() argument 447 return (((mac_impl_t *)mh)->mi_driver); in mac_driver() 451 mac_name(mac_handle_t mh) in mac_name() argument 453 return (((mac_impl_t *)mh)->mi_name); in mac_name() [all …]
|
H A D | mac_provider.c | 127 mac_features_to_flags(mac_handle_t mh) in mac_features_to_flags() argument 133 if (mac_capab_get(mh, MAC_CAPAB_HCKSUM, &cap_sum)) { in mac_features_to_flags() 147 if (mac_capab_get(mh, MAC_CAPAB_LSO, &cap_lso)) in mac_features_to_flags() 554 mac_unregister(mac_handle_t mh) in mac_unregister() argument 557 mac_impl_t *mip = (mac_impl_t *)mh; in mac_unregister() 562 if ((err = mac_disable_nowait(mh)) != 0) in mac_unregister() 676 mac_rx_ring(mac_handle_t mh, mac_ring_handle_t mrh, mblk_t *mp_chain, in mac_rx_ring() argument 687 mac_rx(mh, (mac_resource_handle_t)mrh, mp_chain); in mac_rx_ring() 694 mac_rx(mac_handle_t mh, mac_resource_handle_t mrh, mblk_t *mp_chain) in mac_rx() argument 696 mac_impl_t *mip = (mac_impl_t *)mh; in mac_rx() [all …]
|
H A D | mac.c | 1031 mac_perim_held(mac_handle_t mh) in mac_perim_held() argument 1033 mac_impl_t *mip = (mac_impl_t *)mh; in mac_perim_held() 1052 mac_perim_enter_by_mh(mac_handle_t mh, mac_perim_handle_t *mphp) in mac_perim_enter_by_mh() argument 1054 mac_impl_t *mip = (mac_impl_t *)mh; in mac_perim_enter_by_mh() 1069 mac_handle_t mh; in mac_perim_enter_by_macname() local 1071 if ((err = mac_open(name, &mh)) != 0) in mac_perim_enter_by_macname() 1074 mac_perim_enter_by_mh(mh, mphp); in mac_perim_enter_by_macname() 1075 MAC_ENCODE_MPH(*mphp, mh, 1); in mac_perim_enter_by_macname() 1083 mac_handle_t mh; in mac_perim_enter_by_linkid() local 1085 if ((err = mac_open_by_linkid(linkid, &mh)) != 0) in mac_perim_enter_by_linkid() [all …]
|
H A D | mac_hio.c | 43 mac_share_capable(mac_handle_t mh) in mac_share_capable() argument 45 mac_impl_t *mip = (mac_impl_t *)mh; in mac_share_capable()
|
/illumos-gate/usr/src/uts/common/inet/sockmods/ |
H A D | sockmod_pfp.c | 588 mac_handle_t mh; in sdpfp_bind() local 600 error = pfp_open_index(addr_ll->sll_ifindex, &mh, &mch, cred); in sdpfp_bind() 609 pfp_close(mh, mch); in sdpfp_bind() 612 ps->ps_mh = mh; in sdpfp_bind() 742 mac_handle_t mh; in sdpfp_senduio() local 753 mh = ps->ps_mh; in sdpfp_senduio() 789 error = pfp_open_index(sol->sll_ifindex, &mh, &mch, in sdpfp_senduio() 795 mac_sdu_get(mh, NULL, &maxsdu); in sdpfp_senduio() 821 mp0 = mac_header(mh, sol->sll_addr, sol->sll_protocol, mp, 0); in sdpfp_senduio() 849 ASSERT(mh != ps->ps_mh); in sdpfp_senduio() [all …]
|
/illumos-gate/usr/src/uts/common/io/ |
H A D | gldutil.c | 146 struct ether_header *mh; in gld_interpret_ether() local 164 mh = (struct ether_header *)mp->b_rptr; in gld_interpret_ether() 165 pktinfo->ethertype = REF_NET_USHORT(mh->ether_type); in gld_interpret_ether() 166 pktinfo->isForMe = mac_eq(&mh->ether_dhost, in gld_interpret_ether() 194 mh = (struct ether_header *)mp->b_rptr; in gld_interpret_ether() 197 if (mac_eq(&mh->ether_dhost, ether_broadcast, macinfo->gldm_addrlen)) in gld_interpret_ether() 199 else if (mh->ether_dhost.ether_addr_octet[0] & 1) in gld_interpret_ether() 202 typelen = REF_NET_USHORT(mh->ether_type); in gld_interpret_ether() 255 mac_copy(&mh->ether_dhost, pktinfo->dhost, macinfo->gldm_addrlen); in gld_interpret_ether() 256 mac_copy(&mh->ether_shost, pktinfo->shost, macinfo->gldm_addrlen); in gld_interpret_ether() [all …]
|
H A D | bridge.c | 1148 mac_handle_t mh = blp->bl_mh; in link_shutdown() local 1166 mac_bridge_clear(mh, (mac_handle_t)blp); in link_shutdown() 1170 (void) mac_margin_remove(mh, blp->bl_margin); in link_shutdown() 1216 mac_close(mh); in link_shutdown() 2228 bridge_recv_cb(mac_handle_t mh, mac_resource_handle_t rsrc, mblk_t *mpnext) in bridge_recv_cb() argument 2231 bridge_link_t *blp = (bridge_link_t *)mh; in bridge_recv_cb() 2458 bridge_xmit_cb(mac_handle_t mh, mac_ring_handle_t rh, mblk_t *mpnext) in bridge_xmit_cb() argument 2460 bridge_link_t *blp = (bridge_link_t *)mh; in bridge_xmit_cb() 2705 bridge_ref_cb(mac_handle_t mh, boolean_t hold) in bridge_ref_cb() argument 2707 bridge_link_t *blp = (bridge_link_t *)mh; in bridge_ref_cb() [all …]
|
/illumos-gate/usr/src/cmd/sgs/libelf/common/ |
H A D | getarhdr.c | 40 Member * mh; in elf_getarhdr() local 46 if ((mh = elf->ed_armem) == 0) { in elf_getarhdr() 51 if (mh->m_err != 0) { in elf_getarhdr() 54 _elf_seterr((Msg)mh->m_err, 0); in elf_getarhdr()
|
H A D | begin.c | 52 Member *mh; in _elf_member() local 68 OK_YES) || ((mh = _elf_armem(ref, in _elf_member() 73 if (ref->ed_fsz - base < mh->m_hdr.ar_size) { in _elf_member() 85 elf->ed_armem = mh; in _elf_member() 86 elf->ed_fsz = mh->m_hdr.ar_size; in _elf_member() 88 elf->ed_memoff = base - mh->m_slide; in _elf_member() 95 elf->ed_ident = ref->ed_ident + base - mh->m_slide; in _elf_member()
|
/illumos-gate/usr/src/cmd/smbsrv/smbd/ |
H A D | smbd_authsvc.c | 654 const spnego_mech_handler_t *mh; in smbd_authsvc_esfirst() local 708 mh = mech_table; in smbd_authsvc_esfirst() 711 mh = &mech_table[idx]; in smbd_authsvc_esfirst() 713 for (; mh->mh_init != NULL; idx++, mh++) { in smbd_authsvc_esfirst() 716 mh->mh_oid, &pref) != 0) in smbd_authsvc_esfirst() 730 mh = &mech_table[best_mhidx]; in smbd_authsvc_esfirst() 731 ctx->ctx_mech_oid = mh->mh_oid; in smbd_authsvc_esfirst() 732 ctx->ctx_mh_work = mh->mh_work; in smbd_authsvc_esfirst() 733 ctx->ctx_mh_fini = mh->mh_fini; in smbd_authsvc_esfirst() 734 rc = mh->mh_init(ctx); in smbd_authsvc_esfirst() [all …]
|
/illumos-gate/usr/src/uts/common/io/rtls/ |
H A D | rtls.c | 384 mac_tx_update(rtlsp->mh); in rtls_attach() 537 if (mac_register(macp, &rtlsp->mh) != 0) { in rtls_attach() 601 if (mac_unregister(rtlsp->mh) != 0) { in rtls_detach() 984 mac_name(rtlsp->mh)); in rtls_send() 1001 mac_name(rtlsp->mh)); in rtls_send() 1037 "%s: rtls_send: need_sched", mac_name(rtlsp->mh)); in rtls_send() 1062 mac_name(rtlsp->mh), tx_status); in rtls_send() 1087 mac_name(rtlsp->mh), tx_status); in rtls_send() 1119 mac_name(rtlsp->mh), totlen); in rtls_send() 1230 mac_name(rtlsp->mh)); in rtls_receive() [all …]
|
/illumos-gate/usr/src/cmd/mdb/common/modules/mpt_sas/ |
H A D | mpt_sas.c | 253 refhash_t mh; in krefhash_first() local 258 mdb_vread(&mh, sizeof (mh), khp); in krefhash_first() 259 klp = klist_head(&mh.rh_objs, khp + offsetof(refhash_t, rh_objs)); in krefhash_first() 263 kop = klp - mh.rh_link_off; in krefhash_first() 266 rp = mdb_alloc(mh.rh_obj_size, UM_SLEEP); in krefhash_first() 267 mdb_vread(rp, mh.rh_obj_size, kop); in krefhash_first() 275 refhash_t mh; in krefhash_next() local 283 mdb_vread(&mh, sizeof (mh), khp); in krefhash_next() 285 lp = (refhash_link_t *)(((char *)(op)) + mh.rh_link_off); in krefhash_next() 287 while ((klp = klist_next(&mh.rh_objs, in krefhash_next() [all …]
|
/illumos-gate/usr/src/uts/common/io/dls/ |
H A D | dls_mgmt.c | 814 dls_devnet_set(mac_handle_t mh, datalink_id_t linkid, zoneid_t zoneid, in dls_devnet_set() argument 817 const char *macname = mac_name(mh); in dls_devnet_set() 937 (void) dls_devnet_unset(mh, &linkid, B_FALSE); in dls_devnet_set() 976 dls_devnet_unset(mac_handle_t mh, datalink_id_t *id, boolean_t wait) in dls_devnet_unset() argument 978 const char *macname = mac_name(mh); in dls_devnet_unset() 1107 ASSERT0(MAC_PERIM_HELD(mh)); in dls_devnet_unset() 1436 mac_handle_t mh; in dls_devnet_rename() local 1486 if ((err = mac_open(ddp->dd_mac, &mh)) != 0) in dls_devnet_rename() 1488 (void) mac_rename_primary(mh, link); in dls_devnet_rename() 1489 mac_close(mh); in dls_devnet_rename() [all …]
|
/illumos-gate/usr/src/uts/common/io/bpf/ |
H A D | bpf.c | 251 uintptr_t mh; in bpf_attachd() local 262 mh = 0; in bpf_attachd() 266 error = MBPF_OPEN(bpr, ifname, &mh, zone); in bpf_attachd() 269 error = MBPF_CLIENT_OPEN(bpr, mh, &mcip); in bpf_attachd() 272 error = MBPF_GET_DLT(bpr, mh, &nicdlt); in bpf_attachd() 282 error = MBPF_GET_ZONE(bpr, mh, &niczone); in bpf_attachd() 287 uintptr_t, mh, int, nicdlt, zoneid_t, niczone); in bpf_attachd() 299 if (mh != 0) { in bpf_attachd() 300 MBPF_CLOSE(bpr, mh); in bpf_attachd() 301 mh = 0; in bpf_attachd() [all …]
|
H A D | bpf_mod.c | 366 mac_handle_t mh; in bpf_provider_tickle() local 368 if (mac_open_by_linkid(id, &mh) == 0) { in bpf_provider_tickle() 369 mac_close(mh); in bpf_provider_tickle()
|
/illumos-gate/usr/src/uts/common/io/dld/ |
H A D | dld_drv.c | 433 mac_handle_t mh = NULL; in drv_ioc_hwgrpget() local 444 err = mac_open_by_linkid(hwgrpp->dih_linkid, &mh); in drv_ioc_hwgrpget() 452 rgrpnum = mac_hwgrp_num(mh, MAC_RING_TYPE_RX); in drv_ioc_hwgrpget() 461 bcopy(mac_name(mh), hwgrp.dhi_link_name, in drv_ioc_hwgrpget() 463 mac_get_hwrxgrp_info(mh, 0, &hwgrp.dhi_grp_num, in drv_ioc_hwgrpget() 477 tgrpnum = mac_hwgrp_num(mh, MAC_RING_TYPE_TX); in drv_ioc_hwgrpget() 486 bcopy(mac_name(mh), hwgrp.dhi_link_name, in drv_ioc_hwgrpget() 488 mac_get_hwtxgrp_info(mh, tgrpnum - 1, &hwgrp.dhi_grp_num, in drv_ioc_hwgrpget() 510 bcopy(mac_name(mh), hwgrp.dhi_link_name, in drv_ioc_hwgrpget() 512 mac_get_hwrxgrp_info(mh, i, &hwgrp.dhi_grp_num, in drv_ioc_hwgrpget() [all …]
|
/illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/snoop/ |
H A D | snoop_ether.c | 811 struct tr_header *mh; in interpret_tr() local 848 mh = (struct tr_header *)e; in interpret_tr() 849 rh = (struct tr_ri *)&mh->ri; in interpret_tr() 850 fc = mh->fc; in interpret_tr() 861 if (memcmp(&mh->dhost, ðer_broadcast, in interpret_tr() 864 else if (memcmp(&mh->dhost, &tokenbroadcastaddr2, in interpret_tr() 867 else if (mh->dhost.ether_addr_octet[0] & TR_FN_ADDR) in interpret_tr() 873 src_name = print_etherinfo(&mh->shost); in interpret_tr() 874 dst_name = print_etherinfo(&mh->dhost); in interpret_tr() 940 printether(&mh->dhost), in interpret_tr() [all …]
|
/illumos-gate/usr/src/uts/common/io/aggr/ |
H A D | aggr_port.c | 136 mac_handle_t mh; in aggr_port_create() local 153 if ((err = mac_open_by_linkid(linkid, &mh)) != 0) in aggr_port_create() 156 mip = mac_info(mh); in aggr_port_create() 167 note = mac_no_notification(mh); in aggr_port_create() 188 if ((err = mac_client_open(mh, &mch, client_name, in aggr_port_create() 203 if ((err = mac_margin_add(mh, &margin, B_TRUE)) != 0) { in aggr_port_create() 210 VERIFY3S(mac_margin_remove(mh, margin), ==, 0); in aggr_port_create() 219 port->lp_mh = mh; in aggr_port_create() 266 mac_close(mh); in aggr_port_create()
|
/illumos-gate/usr/src/uts/common/io/hxge/ |
H A D | hpi_txdma.c | 276 tdc_mbh_t mh; in hpi_txdma_mbox_config() local 286 mh.value = ml.value = 0; in hpi_txdma_mbox_config() 290 TXDMA_REG_READ64(handle, TDC_MBH, channel, &mh.value); in hpi_txdma_mbox_config() 293 *mbox_addr |= (mh.value << TDC_MBH_ADDR_SHIFT); in hpi_txdma_mbox_config() 300 mh.bits.mbaddr = ((*mbox_addr >> TDC_MBH_ADDR_SHIFT) & in hpi_txdma_mbox_config() 302 TXDMA_REG_WRITE64(handle, TDC_MBH, channel, mh.value); in hpi_txdma_mbox_config()
|
/illumos-gate/usr/src/uts/sun4v/io/ |
H A D | vsw_phys.c | 268 if (vswp->mh != NULL) { in vsw_mac_open() 278 if ((rv = mac_open_by_linkname(vswp->physname, &vswp->mh)) != 0) { in vsw_mac_open() 316 if (vswp->mh != NULL) { in vsw_mac_close() 324 mac_close(vswp->mh); in vsw_mac_close() 325 vswp->mh = NULL; in vsw_mac_close() 526 if (vswp->mh == NULL) { in vsw_maccl_open() 552 rv = mac_client_open(vswp->mh, mchp, mac_cl_name, flags); in vsw_maccl_open() 769 mac_unicast_primary_get(vswp->mh, primary_addr); in vsw_set_if_hw_addr() 1268 rv = mac_set_mtu(vswp->mh, mtu, &mtu_orig); in vsw_mac_set_mtu() 1294 note = mac_no_notification(vswp->mh); in vsw_notify_add() [all …]
|
H A D | vnet.c | 597 if (mac_disable(vnetp->mh) != 0) { in vnet_unattach() 658 VERIFY(mac_unregister(vnetp->mh) == 0); in vnet_unattach() 659 vnetp->mh = NULL; in vnet_unattach() 1127 err = mac_register(macp, &vnetp->mh); in vnet_mac_register() 1377 if ((vnetp == NULL) || (vnetp->mh == 0)) { in vnet_rx() 1383 mac_rx_ring(vnetp->mh, ringp->handle, mp, ringp->gen_num); in vnet_rx() 1395 if (vnetp == NULL || vnetp->mh == NULL) { in vnet_tx_update() 1423 mac_tx_ring_update(vnetp->mh, tx_ringp->handle); in vnet_tx_update() 1461 mac_tx_ring_update(vnetp->mh, tx_ringp->handle); in vnet_tx_notify_thread() 1503 if (vnetp == NULL || vnetp->mh == NULL) { in vnet_mtu_update() [all …]
|
H A D | dr_mem.c | 1146 memhandle_t mh; in mem_del() local 1155 if ((rv = kphysm_del_gethandle(&mh)) != KPHYSM_OK) { in mem_del() 1186 if ((rv = kphysm_del_span(mh, base, npgs)) != KPHYSM_OK) { in mem_del() 1216 if ((rv = kphysm_del_start(mh, del_done, (void *) &ms)) == KPHYSM_OK) { in mem_del() 1223 dr_mh = mh; in mem_del() 1233 (void) kphysm_del_cancel(mh); in mem_del() 1264 if ((err = kphysm_del_release(mh)) != KPHYSM_OK) in mem_del()
|
/illumos-gate/usr/src/uts/common/io/softmac/ |
H A D | softmac_main.c | 630 mac_handle_t mh; in softmac_create_task() local 638 if ((err = mac_open(softmac->smac_devname, &mh)) != 0) in softmac_create_task() 642 softmac->smac_media = (mac_info(mh))->mi_nativemedia; in softmac_create_task() 643 softmac->smac_mh = mh; in softmac_create_task() 652 mac_close(mh); in softmac_create_task() 1625 mac_handle_t mh; in softmac_hold() local 1633 if ((err = mac_open(mac, &mh)) != 0) in softmac_hold() 1636 softmac = (softmac_t *)mac_driver(mh); in softmac_hold() 1641 mac_close(mh); in softmac_hold()
|