Lines Matching refs:mxfep

172 #define	KIOIP	KSTAT_INTR_PTR(mxfep->mxfe_intrstat)
304 mxfe_t *mxfep; in mxfe_attach() local
390 mxfep = kmem_zalloc(sizeof (mxfe_t), KM_SLEEP); in mxfe_attach()
391 ddi_set_driver_private(dip, mxfep); in mxfe_attach()
394 if (ddi_get_iblock_cookie(dip, 0, &mxfep->mxfe_icookie) in mxfe_attach()
398 kmem_free(mxfep, sizeof (mxfe_t)); in mxfe_attach()
402 mxfep->mxfe_dip = dip; in mxfe_attach()
403 mxfep->mxfe_cardp = cardp; in mxfe_attach()
404 mxfep->mxfe_phyaddr = -1; in mxfe_attach()
405 mxfep->mxfe_cachesize = cachesize; in mxfe_attach()
408 mxfep->mxfe_adv_aneg = ddi_prop_get_int(DDI_DEV_T_ANY, dip, 0, in mxfe_attach()
410 mxfep->mxfe_adv_100T4 = ddi_prop_get_int(DDI_DEV_T_ANY, dip, 0, in mxfe_attach()
412 mxfep->mxfe_adv_100fdx = ddi_prop_get_int(DDI_DEV_T_ANY, dip, 0, in mxfe_attach()
414 mxfep->mxfe_adv_100hdx = ddi_prop_get_int(DDI_DEV_T_ANY, dip, 0, in mxfe_attach()
416 mxfep->mxfe_adv_10fdx = ddi_prop_get_int(DDI_DEV_T_ANY, dip, 0, in mxfe_attach()
418 mxfep->mxfe_adv_10hdx = ddi_prop_get_int(DDI_DEV_T_ANY, dip, 0, in mxfe_attach()
428 mutex_init(&mxfep->mxfe_xmtlock, NULL, MUTEX_DRIVER, in mxfe_attach()
429 mxfep->mxfe_icookie); in mxfe_attach()
430 mutex_init(&mxfep->mxfe_intrlock, NULL, MUTEX_DRIVER, in mxfe_attach()
431 mxfep->mxfe_icookie); in mxfe_attach()
448 mxfep->mxfe_intrstat = kstat_create("mxfe", inst, "intr", "controller", in mxfe_attach()
450 if (mxfep->mxfe_intrstat == NULL) { in mxfe_attach()
454 kstat_install(mxfep->mxfe_intrstat); in mxfe_attach()
459 if (ddi_regs_map_setup(dip, 1, (caddr_t *)&mxfep->mxfe_regs, in mxfe_attach()
460 0, 0, &mxfe_devattr, &mxfep->mxfe_regshandle)) { in mxfe_attach()
468 if ((mxfe_allocrxring(mxfep) != DDI_SUCCESS) || in mxfe_attach()
469 (mxfe_alloctxring(mxfep) != DDI_SUCCESS)) { in mxfe_attach()
475 mutex_enter(&mxfep->mxfe_intrlock); in mxfe_attach()
476 mutex_enter(&mxfep->mxfe_xmtlock); in mxfe_attach()
477 if (!mxfe_initialize(mxfep)) { in mxfe_attach()
478 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_attach()
479 mutex_exit(&mxfep->mxfe_intrlock); in mxfe_attach()
482 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_attach()
483 mutex_exit(&mxfep->mxfe_intrlock); in mxfe_attach()
486 mxfep->mxfe_sromwidth = mxfe_sromwidth(mxfep); in mxfe_attach()
492 mxfe_getfactaddr(mxfep, mxfep->mxfe_curraddr); in mxfe_attach()
493 mxfep->mxfe_promisc = B_FALSE; in mxfe_attach()
498 if (ddi_add_intr(dip, 0, NULL, NULL, mxfe_intr, (caddr_t)mxfep) != in mxfe_attach()
512 macp->m_driver = mxfep; in mxfe_attach()
514 macp->m_src_addr = mxfep->mxfe_curraddr; in mxfe_attach()
520 if (mac_register(macp, &mxfep->mxfe_mh) == DDI_SUCCESS) { in mxfe_attach()
528 if (mxfep->mxfe_icookie != NULL) { in mxfe_attach()
529 ddi_remove_intr(dip, 0, mxfep->mxfe_icookie); in mxfe_attach()
531 if (mxfep->mxfe_intrstat) { in mxfe_attach()
532 kstat_delete(mxfep->mxfe_intrstat); in mxfe_attach()
534 mutex_destroy(&mxfep->mxfe_intrlock); in mxfe_attach()
535 mutex_destroy(&mxfep->mxfe_xmtlock); in mxfe_attach()
537 mxfe_freerxring(mxfep); in mxfe_attach()
538 mxfe_freetxring(mxfep); in mxfe_attach()
540 if (mxfep->mxfe_regshandle != NULL) { in mxfe_attach()
541 ddi_regs_map_free(&mxfep->mxfe_regshandle); in mxfe_attach()
543 kmem_free(mxfep, sizeof (mxfe_t)); in mxfe_attach()
550 mxfe_t *mxfep; in mxfe_detach() local
552 mxfep = ddi_get_driver_private(dip); in mxfe_detach()
553 if (mxfep == NULL) { in mxfe_detach()
561 if (mac_unregister(mxfep->mxfe_mh) != 0) { in mxfe_detach()
566 mutex_enter(&mxfep->mxfe_intrlock); in mxfe_detach()
567 mutex_enter(&mxfep->mxfe_xmtlock); in mxfe_detach()
568 mxfep->mxfe_flags &= ~MXFE_RUNNING; in mxfe_detach()
569 mxfe_stopall(mxfep); in mxfe_detach()
570 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_detach()
571 mutex_exit(&mxfep->mxfe_intrlock); in mxfe_detach()
574 ddi_remove_intr(dip, 0, mxfep->mxfe_icookie); in mxfe_detach()
577 kstat_delete(mxfep->mxfe_intrstat); in mxfe_detach()
582 mxfe_freerxring(mxfep); in mxfe_detach()
583 mxfe_freetxring(mxfep); in mxfe_detach()
585 ddi_regs_map_free(&mxfep->mxfe_regshandle); in mxfe_detach()
586 mutex_destroy(&mxfep->mxfe_intrlock); in mxfe_detach()
587 mutex_destroy(&mxfep->mxfe_xmtlock); in mxfe_detach()
589 kmem_free(mxfep, sizeof (mxfe_t)); in mxfe_detach()
594 mutex_enter(&mxfep->mxfe_intrlock); in mxfe_detach()
595 mutex_enter(&mxfep->mxfe_xmtlock); in mxfe_detach()
596 mxfep->mxfe_flags |= MXFE_SUSPENDED; in mxfe_detach()
597 mxfe_stopall(mxfep); in mxfe_detach()
598 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_detach()
599 mutex_exit(&mxfep->mxfe_intrlock); in mxfe_detach()
609 mxfe_t *mxfep; in mxfe_resume() local
611 if ((mxfep = ddi_get_driver_private(dip)) == NULL) { in mxfe_resume()
615 mutex_enter(&mxfep->mxfe_intrlock); in mxfe_resume()
616 mutex_enter(&mxfep->mxfe_xmtlock); in mxfe_resume()
618 mxfep->mxfe_flags &= ~MXFE_SUSPENDED; in mxfe_resume()
621 if (!mxfe_initialize(mxfep)) { in mxfe_resume()
622 mxfe_error(mxfep->mxfe_dip, "unable to resume chip!"); in mxfe_resume()
623 mxfep->mxfe_flags |= MXFE_SUSPENDED; in mxfe_resume()
624 mutex_exit(&mxfep->mxfe_intrlock); in mxfe_resume()
625 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_resume()
630 if (mxfep->mxfe_flags & MXFE_RUNNING) { in mxfe_resume()
631 mxfe_startall(mxfep); in mxfe_resume()
635 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_resume()
636 mutex_exit(&mxfep->mxfe_intrlock); in mxfe_resume()
644 mxfe_t *mxfep; in mxfe_quiesce() local
646 if ((mxfep = ddi_get_driver_private(dip)) == NULL) { in mxfe_quiesce()
651 SETBIT(mxfep, CSR_PAR, PAR_RESET); in mxfe_quiesce()
667 mxfe_t *mxfep = arg; in mxfe_m_promisc() local
670 mutex_enter(&mxfep->mxfe_intrlock); in mxfe_m_promisc()
671 mutex_enter(&mxfep->mxfe_xmtlock); in mxfe_m_promisc()
673 mxfep->mxfe_promisc = on; in mxfe_m_promisc()
675 if ((mxfep->mxfe_flags & (MXFE_RUNNING|MXFE_SUSPENDED)) == in mxfe_m_promisc()
678 SETBIT(mxfep, CSR_NAR, NAR_RX_PROMISC); in mxfe_m_promisc()
680 CLRBIT(mxfep, CSR_NAR, NAR_RX_PROMISC); in mxfe_m_promisc()
683 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_m_promisc()
684 mutex_exit(&mxfep->mxfe_intrlock); in mxfe_m_promisc()
692 mxfe_t *mxfep = arg; in mxfe_m_unicst() local
694 mutex_enter(&mxfep->mxfe_intrlock); in mxfe_m_unicst()
695 mutex_enter(&mxfep->mxfe_xmtlock); in mxfe_m_unicst()
696 bcopy(macaddr, mxfep->mxfe_curraddr, ETHERADDRL); in mxfe_m_unicst()
698 mxfe_resetall(mxfep); in mxfe_m_unicst()
700 mutex_exit(&mxfep->mxfe_intrlock); in mxfe_m_unicst()
701 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_m_unicst()
709 mxfe_t *mxfep = arg; in mxfe_m_tx() local
712 mutex_enter(&mxfep->mxfe_xmtlock); in mxfe_m_tx()
714 if (mxfep->mxfe_flags & MXFE_SUSPENDED) { in mxfe_m_tx()
715 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_m_tx()
723 if (!mxfe_send(mxfep, mp)) { in mxfe_m_tx()
729 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_m_tx()
738 mxfe_initialize(mxfe_t *mxfep) in mxfe_initialize() argument
744 ASSERT(mutex_owned(&mxfep->mxfe_intrlock)); in mxfe_initialize()
745 ASSERT(mutex_owned(&mxfep->mxfe_xmtlock)); in mxfe_initialize()
748 SETBIT(mxfep, CSR_PAR, PAR_RESET); in mxfe_initialize()
751 val = GETCSR(mxfep, CSR_PAR); in mxfe_initialize()
757 mxfe_error(mxfep->mxfe_dip, "timed out waiting for reset!"); in mxfe_initialize()
765 switch (mxfep->mxfe_cachesize) { in mxfe_initialize()
780 PUTCSR(mxfep, CSR_PAR, par); in mxfe_initialize()
782 mxfe_resetrings(mxfep); in mxfe_initialize()
785 (void) GETCSR(mxfep, CSR_LPC); in mxfe_initialize()
788 nar = GETCSR(mxfep, CSR_NAR); in mxfe_initialize()
794 if (mxfep->mxfe_promisc) { in mxfe_initialize()
799 PUTCSR(mxfep, CSR_NAR, nar); in mxfe_initialize()
801 mxfe_send_setup(mxfep); in mxfe_initialize()
811 mxfe_sromwidth(mxfe_t *mxfep) in mxfe_sromwidth() argument
819 PUTCSR(mxfep, CSR_SPR, eeread & ~SPR_SROM_CHIP); in mxfe_sromwidth()
821 PUTCSR(mxfep, CSR_SPR, eeread); in mxfe_sromwidth()
826 PUTCSR(mxfep, CSR_SPR, eeread | val); in mxfe_sromwidth()
828 PUTCSR(mxfep, CSR_SPR, eeread | val | SPR_SROM_CLOCK); in mxfe_sromwidth()
832 PUTCSR(mxfep, CSR_SPR, eeread); in mxfe_sromwidth()
835 PUTCSR(mxfep, CSR_SPR, eeread | SPR_SROM_CLOCK); in mxfe_sromwidth()
837 if (!(GETCSR(mxfep, CSR_SPR) & SPR_SROM_DOUT)) { in mxfe_sromwidth()
838 PUTCSR(mxfep, CSR_SPR, eeread); in mxfe_sromwidth()
842 PUTCSR(mxfep, CSR_SPR, eeread); in mxfe_sromwidth()
847 PUTCSR(mxfep, CSR_SPR, eeread &~ SPR_SROM_CHIP); in mxfe_sromwidth()
860 mxfe_readsromword(mxfe_t *mxfep, unsigned romaddr) in mxfe_readsromword() argument
871 addrlen = mxfep->mxfe_sromwidth; in mxfe_readsromword()
879 PUTCSR(mxfep, CSR_SPR, eeread & ~SPR_SROM_CHIP); in mxfe_readsromword()
880 PUTCSR(mxfep, CSR_SPR, eeread); in mxfe_readsromword()
885 PUTCSR(mxfep, CSR_SPR, eeread | val); in mxfe_readsromword()
887 PUTCSR(mxfep, CSR_SPR, eeread | val | SPR_SROM_CLOCK); in mxfe_readsromword()
891 PUTCSR(mxfep, CSR_SPR, eeread); in mxfe_readsromword()
894 PUTCSR(mxfep, CSR_SPR, eeread | SPR_SROM_CLOCK); in mxfe_readsromword()
897 if (GETCSR(mxfep, CSR_SPR) & SPR_SROM_DOUT) { in mxfe_readsromword()
900 PUTCSR(mxfep, CSR_SPR, eeread); in mxfe_readsromword()
905 PUTCSR(mxfep, CSR_SPR, eeread &~ SPR_SROM_CHIP); in mxfe_readsromword()
918 mxfe_readsrom(mxfe_t *mxfep, unsigned romaddr, unsigned len, void *dest) in mxfe_readsrom() argument
925 word = mxfe_readsromword(mxfep, romaddr + i); in mxfe_readsrom()
933 mxfe_getfactaddr(mxfe_t *mxfep, uchar_t *eaddr) in mxfe_getfactaddr() argument
939 word = mxfe_readsromword(mxfep, SROM_ENADDR / 2); in mxfe_getfactaddr()
944 mxfe_readsrom(mxfep, word / 2, ETHERADDRL / 2, eaddr); in mxfe_getfactaddr()
951 mxfe_startphy(mxfe_t *mxfep) in mxfe_startphy() argument
953 switch (MXFE_MODEL(mxfep)) { in mxfe_startphy()
955 mxfe_startphymii(mxfep); in mxfe_startphy()
958 mxfe_startphynway(mxfep); in mxfe_startphy()
964 mxfe_stopphy(mxfe_t *mxfep) in mxfe_stopphy() argument
970 PUTCSR(mxfep, CSR_TIMER, 0); in mxfe_stopphy()
972 switch (MXFE_MODEL(mxfep)) { in mxfe_stopphy()
975 mxfe_miiwrite(mxfep, mxfep->mxfe_phyaddr, MII_CONTROL, in mxfe_stopphy()
981 PUTCSR(mxfep, CSR_SIA, SIA_RESET); in mxfe_stopphy()
983 CLRBIT(mxfep, CSR_TCTL, TCTL_PWR | TCTL_ANE); in mxfe_stopphy()
984 nar = GETCSR(mxfep, CSR_NAR); in mxfe_stopphy()
987 PUTCSR(mxfep, CSR_NAR, nar); in mxfe_stopphy()
994 if (!mxfep->mxfe_resetting) { in mxfe_stopphy()
995 mxfep->mxfe_linkup = LINK_STATE_UNKNOWN; in mxfe_stopphy()
996 mxfep->mxfe_ifspeed = 0; in mxfe_stopphy()
997 mxfep->mxfe_duplex = LINK_DUPLEX_UNKNOWN; in mxfe_stopphy()
998 if (mxfep->mxfe_flags & MXFE_RUNNING) in mxfe_stopphy()
999 mxfe_reportlink(mxfep); in mxfe_stopphy()
1007 mxfe_startnway(mxfe_t *mxfep) in mxfe_startnway() argument
1014 if (mxfep->mxfe_nwaystate != MXFE_NOLINK) { in mxfe_startnway()
1016 mxfep->mxfe_nwaystate); in mxfe_startnway()
1020 if (mxfep->mxfe_adv_aneg == 0) { in mxfe_startnway()
1025 nar = GETCSR(mxfep, CSR_NAR); in mxfe_startnway()
1030 mxfe_stopmac(mxfep); in mxfe_startnway()
1035 tctl = GETCSR(mxfep, CSR_TCTL); in mxfe_startnway()
1038 if (mxfep->mxfe_adv_100fdx) { in mxfe_startnway()
1041 if (mxfep->mxfe_adv_100hdx) { in mxfe_startnway()
1044 if (mxfep->mxfe_adv_10fdx) { in mxfe_startnway()
1047 if (mxfep->mxfe_adv_10hdx) { in mxfe_startnway()
1054 PUTCSR(mxfep, CSR_NAR, nar); in mxfe_startnway()
1057 PUTCSR(mxfep, CSR_TCTL, tctl); in mxfe_startnway()
1061 PUTCSR(mxfep, CSR_TSTAT, TSTAT_ANS_START); in mxfe_startnway()
1065 mxfe_startmac(mxfep); in mxfe_startnway()
1068 PUTCSR(mxfep, CSR_MXMAGIC, 0x0b2c0000); in mxfe_startnway()
1069 PUTCSR(mxfep, CSR_ACOMP, 0x11000); in mxfe_startnway()
1071 mxfep->mxfe_nwaystate = MXFE_NWAYCHECK; in mxfe_startnway()
1075 mxfe_checklinknway(mxfe_t *mxfep) in mxfe_checklinknway() argument
1080 DBG(DPHY, "NWay check, state %x", mxfep->mxfe_nwaystate); in mxfe_checklinknway()
1081 tstat = GETCSR(mxfep, CSR_TSTAT); in mxfe_checklinknway()
1084 mxfep->mxfe_anlpar = lpar; in mxfe_checklinknway()
1086 mxfep->mxfe_aner |= MII_AN_EXP_LPCANAN; in mxfe_checklinknway()
1088 mxfep->mxfe_aner &= ~(MII_AN_EXP_LPCANAN); in mxfe_checklinknway()
1096 mxfep->mxfe_bmsr &= ~MII_STATUS_ANDONE; in mxfe_checklinknway()
1098 mxfep->mxfe_bmsr |= ~MII_STATUS_ANDONE; in mxfe_checklinknway()
1102 mxfep->mxfe_linkup = LINK_STATE_DOWN; in mxfe_checklinknway()
1103 mxfep->mxfe_ifspeed = 0; in mxfe_checklinknway()
1104 mxfep->mxfe_duplex = LINK_DUPLEX_UNKNOWN; in mxfe_checklinknway()
1105 mxfep->mxfe_nwaystate = MXFE_NOLINK; in mxfe_checklinknway()
1106 mxfe_reportlink(mxfep); in mxfe_checklinknway()
1107 mxfe_startnway(mxfep); in mxfe_checklinknway()
1115 if (mxfep->mxfe_adv_aneg) { in mxfe_checklinknway()
1119 mxfep->mxfe_linkup = LINK_STATE_UP; in mxfe_checklinknway()
1120 anlpar = mxfep->mxfe_anlpar; in mxfe_checklinknway()
1126 mxfep->mxfe_adv_100fdx) { in mxfe_checklinknway()
1127 mxfep->mxfe_ifspeed = 100000000; in mxfe_checklinknway()
1128 mxfep->mxfe_duplex = LINK_DUPLEX_FULL; in mxfe_checklinknway()
1130 mxfep->mxfe_adv_100hdx) { in mxfe_checklinknway()
1131 mxfep->mxfe_ifspeed = 100000000; in mxfe_checklinknway()
1132 mxfep->mxfe_duplex = LINK_DUPLEX_HALF; in mxfe_checklinknway()
1134 mxfep->mxfe_adv_10fdx) { in mxfe_checklinknway()
1135 mxfep->mxfe_ifspeed = 10000000; in mxfe_checklinknway()
1136 mxfep->mxfe_duplex = LINK_DUPLEX_FULL; in mxfe_checklinknway()
1138 mxfep->mxfe_adv_10hdx) { in mxfe_checklinknway()
1139 mxfep->mxfe_ifspeed = 10000000; in mxfe_checklinknway()
1140 mxfep->mxfe_duplex = LINK_DUPLEX_HALF; in mxfe_checklinknway()
1142 mxfep->mxfe_ifspeed = 0; in mxfe_checklinknway()
1147 mxfep->mxfe_duplex = LINK_DUPLEX_HALF; in mxfe_checklinknway()
1150 mxfep->mxfe_ifspeed = 100000000; in mxfe_checklinknway()
1152 mxfep->mxfe_ifspeed = 10000000; in mxfe_checklinknway()
1157 mxfep->mxfe_linkup = LINK_STATE_UP; in mxfe_checklinknway()
1158 if (mxfep->mxfe_adv_100fdx) { in mxfe_checklinknway()
1159 mxfep->mxfe_ifspeed = 100000000; in mxfe_checklinknway()
1160 mxfep->mxfe_duplex = LINK_DUPLEX_FULL; in mxfe_checklinknway()
1161 } else if (mxfep->mxfe_adv_100hdx) { in mxfe_checklinknway()
1162 mxfep->mxfe_ifspeed = 100000000; in mxfe_checklinknway()
1163 mxfep->mxfe_duplex = LINK_DUPLEX_HALF; in mxfe_checklinknway()
1164 } else if (mxfep->mxfe_adv_10fdx) { in mxfe_checklinknway()
1165 mxfep->mxfe_ifspeed = 10000000; in mxfe_checklinknway()
1166 mxfep->mxfe_duplex = LINK_DUPLEX_FULL; in mxfe_checklinknway()
1167 } else if (mxfep->mxfe_adv_10hdx) { in mxfe_checklinknway()
1168 mxfep->mxfe_ifspeed = 10000000; in mxfe_checklinknway()
1169 mxfep->mxfe_duplex = LINK_DUPLEX_HALF; in mxfe_checklinknway()
1171 mxfep->mxfe_ifspeed = 0; in mxfe_checklinknway()
1174 mxfe_reportlink(mxfep); in mxfe_checklinknway()
1175 mxfep->mxfe_nwaystate = MXFE_GOODLINK; in mxfe_checklinknway()
1179 mxfe_startphynway(mxfe_t *mxfep) in mxfe_startphynway() argument
1182 PUTCSR(mxfep, CSR_SIA, SIA_NRESET); in mxfe_startphynway()
1185 mxfep->mxfe_nwaystate = MXFE_NOLINK; in mxfe_startphynway()
1186 mxfep->mxfe_bmsr = MII_STATUS_CANAUTONEG | in mxfe_startphynway()
1189 mxfep->mxfe_cap_aneg = in mxfe_startphynway()
1190 mxfep->mxfe_cap_100fdx = mxfep->mxfe_cap_100hdx = in mxfe_startphynway()
1191 mxfep->mxfe_cap_10fdx = mxfep->mxfe_cap_10hdx = 1; in mxfe_startphynway()
1194 mxfep->mxfe_phyaddr = 0; in mxfe_startphynway()
1195 mxfep->mxfe_phyinuse = XCVR_100X; in mxfe_startphynway()
1196 mxfep->mxfe_phyid = 0; in mxfe_startphynway()
1199 mxfep->mxfe_adv_100T4 = 0; in mxfe_startphynway()
1200 mxfep->mxfe_cap_100T4 = 0; in mxfe_startphynway()
1203 if ((!mxfep->mxfe_adv_100fdx) && in mxfe_startphynway()
1204 (!mxfep->mxfe_adv_100hdx) && in mxfe_startphynway()
1205 (!mxfep->mxfe_adv_10fdx) && in mxfe_startphynway()
1206 (!mxfep->mxfe_adv_10hdx)) { in mxfe_startphynway()
1207 mxfe_error(mxfep->mxfe_dip, "No valid link mode selected."); in mxfe_startphynway()
1208 mxfe_error(mxfep->mxfe_dip, "Powering down PHY."); in mxfe_startphynway()
1209 mxfe_stopphy(mxfep); in mxfe_startphynway()
1210 mxfep->mxfe_linkup = LINK_STATE_DOWN; in mxfe_startphynway()
1211 if (mxfep->mxfe_flags & MXFE_RUNNING) in mxfe_startphynway()
1212 mxfe_reportlink(mxfep); in mxfe_startphynway()
1216 if (mxfep->mxfe_adv_aneg == 0) { in mxfe_startphynway()
1221 nar = GETCSR(mxfep, CSR_NAR); in mxfe_startphynway()
1222 tctl = GETCSR(mxfep, CSR_TCTL); in mxfe_startphynway()
1228 if (mxfep->mxfe_adv_100fdx) { in mxfe_startphynway()
1230 } else if (mxfep->mxfe_adv_100hdx) { in mxfe_startphynway()
1232 } else if (mxfep->mxfe_adv_10fdx) { in mxfe_startphynway()
1238 PUTCSR(mxfep, CSR_NAR, nar); in mxfe_startphynway()
1239 PUTCSR(mxfep, CSR_TCTL, tctl); in mxfe_startphynway()
1242 PUTCSR(mxfep, CSR_MXMAGIC, 0x0b2c0000); in mxfe_startphynway()
1243 PUTCSR(mxfep, CSR_ACOMP, 0x11000); in mxfe_startphynway()
1245 mxfe_startnway(mxfep); in mxfe_startphynway()
1247 PUTCSR(mxfep, CSR_TIMER, TIMER_LOOP | in mxfe_startphynway()
1255 mxfe_startphymii(mxfe_t *mxfep) in mxfe_startphymii() argument
1266 mxfep->mxfe_phyaddr = -1; in mxfe_startphymii()
1270 bmsr = mxfe_miiread(mxfep, phyaddr, MII_STATUS); in mxfe_startphymii()
1272 mxfep->mxfe_phyaddr = phyaddr; in mxfe_startphymii()
1277 phyidr1 = mxfe_miiread(mxfep, phyaddr, MII_PHYIDH); in mxfe_startphymii()
1278 phyidr2 = mxfe_miiread(mxfep, phyaddr, MII_PHYIDL); in mxfe_startphymii()
1279 mxfep->mxfe_phyid = (phyidr1 << 16) | (phyidr2); in mxfe_startphymii()
1291 mxfep->mxfe_phyinuse = XCVR_100T4; in mxfe_startphymii()
1293 mxfep->mxfe_phyinuse = XCVR_100X; in mxfe_startphymii()
1297 mxfep->mxfe_cap_aneg = mxfep->mxfe_cap_100T4 = in mxfe_startphymii()
1298 mxfep->mxfe_cap_100fdx = mxfep->mxfe_cap_100hdx = in mxfe_startphymii()
1299 mxfep->mxfe_cap_10fdx = mxfep->mxfe_cap_10hdx = 1; in mxfe_startphymii()
1302 DBG(DPHY, "bmsr = %x", mxfe_miiread(mxfep, in mxfe_startphymii()
1303 mxfep->mxfe_phyaddr, MII_STATUS)); in mxfe_startphymii()
1304 DBG(DPHY, "anar = %x", mxfe_miiread(mxfep, in mxfe_startphymii()
1305 mxfep->mxfe_phyaddr, MII_AN_ADVERT)); in mxfe_startphymii()
1306 DBG(DPHY, "anlpar = %x", mxfe_miiread(mxfep, in mxfe_startphymii()
1307 mxfep->mxfe_phyaddr, MII_AN_LPABLE)); in mxfe_startphymii()
1308 DBG(DPHY, "aner = %x", mxfe_miiread(mxfep, in mxfe_startphymii()
1309 mxfep->mxfe_phyaddr, MII_AN_EXPANSION)); in mxfe_startphymii()
1314 mxfe_miiwrite(mxfep, phyaddr, MII_CONTROL, MII_CONTROL_RESET); in mxfe_startphymii()
1321 if (mxfe_miiread(mxfep, phyaddr, MII_CONTROL) & in mxfe_startphymii()
1329 mxfe_error(mxfep->mxfe_dip, "timeout waiting on phy to reset"); in mxfe_startphymii()
1335 bmsr = mxfe_miiread(mxfep, phyaddr, MII_STATUS); in mxfe_startphymii()
1336 bmcr = mxfe_miiread(mxfep, phyaddr, MII_CONTROL); in mxfe_startphymii()
1337 anar = mxfe_miiread(mxfep, phyaddr, MII_AN_ADVERT); in mxfe_startphymii()
1345 mxfep->mxfe_adv_100T4 = 0; in mxfe_startphymii()
1346 mxfep->mxfe_cap_100T4 = 0; in mxfe_startphymii()
1349 mxfep->mxfe_adv_100fdx = 0; in mxfe_startphymii()
1350 mxfep->mxfe_cap_100fdx = 0; in mxfe_startphymii()
1353 mxfep->mxfe_adv_100hdx = 0; in mxfe_startphymii()
1354 mxfep->mxfe_cap_100hdx = 0; in mxfe_startphymii()
1357 mxfep->mxfe_adv_10fdx = 0; in mxfe_startphymii()
1358 mxfep->mxfe_cap_10fdx = 0; in mxfe_startphymii()
1361 mxfep->mxfe_adv_10hdx = 0; in mxfe_startphymii()
1362 mxfep->mxfe_cap_10hdx = 0; in mxfe_startphymii()
1365 mxfep->mxfe_adv_aneg = 0; in mxfe_startphymii()
1366 mxfep->mxfe_cap_aneg = 0; in mxfe_startphymii()
1370 if (mxfep->mxfe_adv_100T4) { in mxfe_startphymii()
1374 if (mxfep->mxfe_adv_100fdx) { in mxfe_startphymii()
1378 if (mxfep->mxfe_adv_100hdx) { in mxfe_startphymii()
1382 if (mxfep->mxfe_adv_10fdx) { in mxfe_startphymii()
1386 if (mxfep->mxfe_adv_10hdx) { in mxfe_startphymii()
1395 mxfe_error(mxfep->mxfe_dip, "No valid link mode selected."); in mxfe_startphymii()
1396 mxfe_error(mxfep->mxfe_dip, "Powering down PHY."); in mxfe_startphymii()
1397 mxfe_stopphy(mxfep); in mxfe_startphymii()
1398 mxfep->mxfe_linkup = LINK_STATE_DOWN; in mxfe_startphymii()
1399 if (mxfep->mxfe_flags & MXFE_RUNNING) in mxfe_startphymii()
1400 mxfe_reportlink(mxfep); in mxfe_startphymii()
1404 if ((mxfep->mxfe_adv_aneg) && (bmsr & MII_STATUS_CANAUTONEG)) { in mxfe_startphymii()
1409 if (mxfep->mxfe_adv_100fdx) { in mxfe_startphymii()
1411 } else if (mxfep->mxfe_adv_100hdx) { in mxfe_startphymii()
1413 } else if (mxfep->mxfe_adv_10fdx) { in mxfe_startphymii()
1422 mxfe_miiwrite(mxfep, phyaddr, MII_AN_ADVERT, anar); in mxfe_startphymii()
1424 mxfe_miiwrite(mxfep, phyaddr, MII_CONTROL, bmcr); in mxfe_startphymii()
1429 PUTCSR(mxfep, CSR_TIMER, TIMER_LOOP | in mxfe_startphymii()
1434 mxfe_reportlink(mxfe_t *mxfep) in mxfe_reportlink() argument
1438 if (mxfep->mxfe_ifspeed != mxfep->mxfe_lastifspeed) { in mxfe_reportlink()
1439 mxfep->mxfe_lastifspeed = mxfep->mxfe_ifspeed; in mxfe_reportlink()
1442 if (mxfep->mxfe_duplex != mxfep->mxfe_lastduplex) { in mxfe_reportlink()
1443 mxfep->mxfe_lastduplex = mxfep->mxfe_duplex; in mxfe_reportlink()
1446 if (mxfep->mxfe_linkup != mxfep->mxfe_lastlinkup) { in mxfe_reportlink()
1447 mxfep->mxfe_lastlinkup = mxfep->mxfe_linkup; in mxfe_reportlink()
1451 mac_link_update(mxfep->mxfe_mh, mxfep->mxfe_linkup); in mxfe_reportlink()
1455 mxfe_checklink(mxfe_t *mxfep) in mxfe_checklink() argument
1457 if ((mxfep->mxfe_flags & MXFE_RUNNING) == 0) in mxfe_checklink()
1460 if ((mxfep->mxfe_txstall_time != 0) && in mxfe_checklink()
1461 (gethrtime() > mxfep->mxfe_txstall_time) && in mxfe_checklink()
1462 (mxfep->mxfe_txavail != MXFE_TXRING)) { in mxfe_checklink()
1463 mxfep->mxfe_txstall_time = 0; in mxfe_checklink()
1464 mxfe_error(mxfep->mxfe_dip, "TX stall detected!"); in mxfe_checklink()
1465 mxfe_resetall(mxfep); in mxfe_checklink()
1469 switch (MXFE_MODEL(mxfep)) { in mxfe_checklink()
1471 mxfe_checklinkmii(mxfep); in mxfe_checklink()
1474 mxfe_checklinknway(mxfep); in mxfe_checklink()
1479 mxfe_checklinkmii(mxfe_t *mxfep) in mxfe_checklinkmii() argument
1489 bmsr = mxfe_miiread(mxfep, mxfep->mxfe_phyaddr, MII_STATUS); in mxfe_checklinkmii()
1490 bmsr = mxfe_miiread(mxfep, mxfep->mxfe_phyaddr, MII_STATUS); in mxfe_checklinkmii()
1491 bmcr = mxfe_miiread(mxfep, mxfep->mxfe_phyaddr, MII_CONTROL); in mxfe_checklinkmii()
1492 anar = mxfe_miiread(mxfep, mxfep->mxfe_phyaddr, MII_AN_ADVERT); in mxfe_checklinkmii()
1493 anlpar = mxfe_miiread(mxfep, mxfep->mxfe_phyaddr, MII_AN_LPABLE); in mxfe_checklinkmii()
1494 aner = mxfe_miiread(mxfep, mxfep->mxfe_phyaddr, MII_AN_EXPANSION); in mxfe_checklinkmii()
1496 mxfep->mxfe_bmsr = bmsr; in mxfe_checklinkmii()
1497 mxfep->mxfe_anlpar = anlpar; in mxfe_checklinkmii()
1498 mxfep->mxfe_aner = aner; in mxfe_checklinkmii()
1501 mxfe_error(mxfep->mxfe_dip, "Remote fault detected."); in mxfe_checklinkmii()
1504 mxfe_error(mxfep->mxfe_dip, "Jabber condition detected."); in mxfe_checklinkmii()
1508 mxfep->mxfe_ifspeed = 0; in mxfe_checklinkmii()
1509 mxfep->mxfe_duplex = LINK_DUPLEX_UNKNOWN; in mxfe_checklinkmii()
1510 mxfep->mxfe_linkup = LINK_STATE_DOWN; in mxfe_checklinkmii()
1511 mxfe_reportlink(mxfep); in mxfe_checklinkmii()
1516 mxfep->mxfe_linkup = LINK_STATE_UP; in mxfe_checklinkmii()
1521 mxfep->mxfe_ifspeed = 100000000; in mxfe_checklinkmii()
1523 mxfep->mxfe_ifspeed = 10000000; in mxfe_checklinkmii()
1526 mxfep->mxfe_duplex = LINK_DUPLEX_FULL; in mxfe_checklinkmii()
1528 mxfep->mxfe_duplex = LINK_DUPLEX_HALF; in mxfe_checklinkmii()
1532 mxfep->mxfe_ifspeed = 0; in mxfe_checklinkmii()
1533 mxfep->mxfe_duplex = LINK_DUPLEX_UNKNOWN; in mxfe_checklinkmii()
1535 mxfep->mxfe_ifspeed = 100000000; in mxfe_checklinkmii()
1536 mxfep->mxfe_duplex = LINK_DUPLEX_FULL; in mxfe_checklinkmii()
1538 mxfep->mxfe_ifspeed = 100000000; in mxfe_checklinkmii()
1539 mxfep->mxfe_duplex = LINK_DUPLEX_HALF; in mxfe_checklinkmii()
1541 mxfep->mxfe_ifspeed = 100000000; in mxfe_checklinkmii()
1542 mxfep->mxfe_duplex = LINK_DUPLEX_HALF; in mxfe_checklinkmii()
1544 mxfep->mxfe_ifspeed = 10000000; in mxfe_checklinkmii()
1545 mxfep->mxfe_duplex = LINK_DUPLEX_FULL; in mxfe_checklinkmii()
1547 mxfep->mxfe_ifspeed = 10000000; in mxfe_checklinkmii()
1548 mxfep->mxfe_duplex = LINK_DUPLEX_HALF; in mxfe_checklinkmii()
1550 mxfep->mxfe_ifspeed = 0; in mxfe_checklinkmii()
1551 mxfep->mxfe_duplex = LINK_DUPLEX_UNKNOWN; in mxfe_checklinkmii()
1554 mxfe_reportlink(mxfep); in mxfe_checklinkmii()
1558 mxfe_miitristate(mxfe_t *mxfep) in mxfe_miitristate() argument
1561 PUTCSR(mxfep, CSR_SPR, val); in mxfe_miitristate()
1563 PUTCSR(mxfep, CSR_SPR, val | SPR_MII_CLOCK); in mxfe_miitristate()
1568 mxfe_miiwritebit(mxfe_t *mxfep, uint8_t bit) in mxfe_miiwritebit() argument
1571 PUTCSR(mxfep, CSR_SPR, val); in mxfe_miiwritebit()
1573 PUTCSR(mxfep, CSR_SPR, val | SPR_MII_CLOCK); in mxfe_miiwritebit()
1578 mxfe_miireadbit(mxfe_t *mxfep) in mxfe_miireadbit() argument
1582 PUTCSR(mxfep, CSR_SPR, val); in mxfe_miireadbit()
1584 bit = (GETCSR(mxfep, CSR_SPR) & SPR_MII_DIN) ? 1 : 0; in mxfe_miireadbit()
1585 PUTCSR(mxfep, CSR_SPR, val | SPR_MII_CLOCK); in mxfe_miireadbit()
1591 mxfe_miiread(mxfe_t *mxfep, int phy, int reg) in mxfe_miiread() argument
1593 switch (MXFE_MODEL(mxfep)) { in mxfe_miiread()
1595 return (mxfe_miiread98713(mxfep, phy, reg)); in mxfe_miiread()
1602 mxfe_miireadgeneral(mxfe_t *mxfep, int phy, int reg) in mxfe_miireadgeneral() argument
1609 mxfe_miiwritebit(mxfep, 1); in mxfe_miireadgeneral()
1613 mxfe_miiwritebit(mxfep, 0); in mxfe_miireadgeneral()
1614 mxfe_miiwritebit(mxfep, 1); in mxfe_miireadgeneral()
1617 mxfe_miiwritebit(mxfep, 1); in mxfe_miireadgeneral()
1618 mxfe_miiwritebit(mxfep, 0); in mxfe_miireadgeneral()
1622 mxfe_miiwritebit(mxfep, (phy & i) ? 1 : 0); in mxfe_miireadgeneral()
1627 mxfe_miiwritebit(mxfep, (reg & i) ? 1 : 0); in mxfe_miireadgeneral()
1631 mxfe_miitristate(mxfep); in mxfe_miireadgeneral()
1632 mxfe_miiwritebit(mxfep, 0); in mxfe_miireadgeneral()
1637 value |= mxfe_miireadbit(mxfep); in mxfe_miireadgeneral()
1639 mxfe_miitristate(mxfep); in mxfe_miireadgeneral()
1644 mxfe_miiread98713(mxfe_t *mxfep, int phy, int reg) in mxfe_miiread98713() argument
1652 nar = GETCSR(mxfep, CSR_NAR); in mxfe_miiread98713()
1653 PUTCSR(mxfep, CSR_NAR, nar & ~NAR_PORTSEL); in mxfe_miiread98713()
1654 retval = mxfe_miireadgeneral(mxfep, phy, reg); in mxfe_miiread98713()
1655 PUTCSR(mxfep, CSR_NAR, nar); in mxfe_miiread98713()
1660 mxfe_miiwrite(mxfe_t *mxfep, int phy, int reg, uint16_t val) in mxfe_miiwrite() argument
1662 switch (MXFE_MODEL(mxfep)) { in mxfe_miiwrite()
1664 mxfe_miiwrite98713(mxfep, phy, reg, val); in mxfe_miiwrite()
1672 mxfe_miiwritegeneral(mxfe_t *mxfep, int phy, int reg, uint16_t val) in mxfe_miiwritegeneral() argument
1678 mxfe_miiwritebit(mxfep, 1); in mxfe_miiwritegeneral()
1682 mxfe_miiwritebit(mxfep, 0); in mxfe_miiwritegeneral()
1683 mxfe_miiwritebit(mxfep, 1); in mxfe_miiwritegeneral()
1686 mxfe_miiwritebit(mxfep, 0); in mxfe_miiwritegeneral()
1687 mxfe_miiwritebit(mxfep, 1); in mxfe_miiwritegeneral()
1691 mxfe_miiwritebit(mxfep, (phy & i) ? 1 : 0); in mxfe_miiwritegeneral()
1696 mxfe_miiwritebit(mxfep, (reg & i) ? 1 : 0); in mxfe_miiwritegeneral()
1700 mxfe_miitristate(mxfep); in mxfe_miiwritegeneral()
1701 mxfe_miiwritebit(mxfep, 0); in mxfe_miiwritegeneral()
1705 mxfe_miiwritebit(mxfep, (val & i) ? 1 : 0); in mxfe_miiwritegeneral()
1709 mxfe_miitristate(mxfep); in mxfe_miiwritegeneral()
1713 mxfe_miiwrite98713(mxfe_t *mxfep, int phy, int reg, uint16_t val) in mxfe_miiwrite98713() argument
1720 nar = GETCSR(mxfep, CSR_NAR); in mxfe_miiwrite98713()
1721 PUTCSR(mxfep, CSR_NAR, nar & ~NAR_PORTSEL); in mxfe_miiwrite98713()
1722 mxfe_miiwritegeneral(mxfep, phy, reg, val); in mxfe_miiwrite98713()
1723 PUTCSR(mxfep, CSR_NAR, nar); in mxfe_miiwrite98713()
1729 mxfe_t *mxfep = arg; in mxfe_m_start() local
1732 mutex_enter(&mxfep->mxfe_intrlock); in mxfe_m_start()
1733 mutex_enter(&mxfep->mxfe_xmtlock); in mxfe_m_start()
1735 mxfe_startall(mxfep); in mxfe_m_start()
1736 mxfep->mxfe_flags |= MXFE_RUNNING; in mxfe_m_start()
1738 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_m_start()
1739 mutex_exit(&mxfep->mxfe_intrlock); in mxfe_m_start()
1746 mxfe_t *mxfep = arg; in mxfe_m_stop() local
1749 mutex_enter(&mxfep->mxfe_intrlock); in mxfe_m_stop()
1750 mutex_enter(&mxfep->mxfe_xmtlock); in mxfe_m_stop()
1752 mxfe_stopall(mxfep); in mxfe_m_stop()
1753 mxfep->mxfe_flags &= ~MXFE_RUNNING; in mxfe_m_stop()
1755 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_m_stop()
1756 mutex_exit(&mxfep->mxfe_intrlock); in mxfe_m_stop()
1760 mxfe_startmac(mxfe_t *mxfep) in mxfe_startmac() argument
1763 ASSERT(mutex_owned(&mxfep->mxfe_intrlock)); in mxfe_startmac()
1764 ASSERT(mutex_owned(&mxfep->mxfe_xmtlock)); in mxfe_startmac()
1767 SETBIT(mxfep, CSR_NAR, NAR_TX_ENABLE | NAR_RX_ENABLE); in mxfe_startmac()
1769 if (mxfep->mxfe_txavail != MXFE_TXRING) in mxfe_startmac()
1770 PUTCSR(mxfep, CSR_TDR, 0); in mxfe_startmac()
1773 if (mxfep->mxfe_flags & MXFE_RUNNING) in mxfe_startmac()
1774 mac_tx_update(mxfep->mxfe_mh); in mxfe_startmac()
1778 mxfe_stopmac(mxfe_t *mxfep) in mxfe_stopmac() argument
1783 ASSERT(mutex_owned(&mxfep->mxfe_intrlock)); in mxfe_stopmac()
1784 ASSERT(mutex_owned(&mxfep->mxfe_xmtlock)); in mxfe_stopmac()
1786 CLRBIT(mxfep, CSR_NAR, NAR_TX_ENABLE | NAR_RX_ENABLE); in mxfe_stopmac()
1798 if ((GETCSR(mxfep, CSR_SR) & (SR_TX_STATE | SR_RX_STATE)) == 0) in mxfe_stopmac()
1804 PUTCSR(mxfep, CSR_SR, INT_RXSTOPPED | INT_TXSTOPPED); in mxfe_stopmac()
1808 mxfe_resetrings(mxfe_t *mxfep) in mxfe_resetrings() argument
1813 PUTCSR(mxfep, CSR_RDB, 0); in mxfe_resetrings()
1814 PUTCSR(mxfep, CSR_TDB, 0); in mxfe_resetrings()
1817 mxfep->mxfe_rxhead = 0; in mxfe_resetrings()
1818 mxfep->mxfe_txreclaim = 0; in mxfe_resetrings()
1819 mxfep->mxfe_txsend = 0; in mxfe_resetrings()
1820 mxfep->mxfe_txavail = MXFE_TXRING; in mxfe_resetrings()
1824 mxfe_desc_t *tmdp = &mxfep->mxfe_txdescp[i]; in mxfe_resetrings()
1829 PUTTXDESC(mxfep, tmdp->desc_status, 0); in mxfe_resetrings()
1830 PUTTXDESC(mxfep, tmdp->desc_control, control); in mxfe_resetrings()
1831 PUTTXDESC(mxfep, tmdp->desc_buffer1, 0); in mxfe_resetrings()
1832 PUTTXDESC(mxfep, tmdp->desc_buffer2, 0); in mxfe_resetrings()
1833 SYNCTXDESC(mxfep, i, DDI_DMA_SYNC_FORDEV); in mxfe_resetrings()
1835 PUTCSR(mxfep, CSR_TDB, mxfep->mxfe_txdesc_paddr); in mxfe_resetrings()
1839 mxfe_rxbuf_t *rxb = mxfep->mxfe_rxbufs[i]; in mxfe_resetrings()
1840 mxfe_desc_t *rmdp = &mxfep->mxfe_rxdescp[i]; in mxfe_resetrings()
1847 PUTRXDESC(mxfep, rmdp->desc_buffer1, rxb->rxb_paddr); in mxfe_resetrings()
1848 PUTRXDESC(mxfep, rmdp->desc_buffer2, 0); in mxfe_resetrings()
1849 PUTRXDESC(mxfep, rmdp->desc_control, control); in mxfe_resetrings()
1850 PUTRXDESC(mxfep, rmdp->desc_status, RXSTAT_OWN); in mxfe_resetrings()
1851 SYNCRXDESC(mxfep, i, DDI_DMA_SYNC_FORDEV); in mxfe_resetrings()
1853 PUTCSR(mxfep, CSR_RDB, mxfep->mxfe_rxdesc_paddr); in mxfe_resetrings()
1857 mxfe_stopall(mxfe_t *mxfep) in mxfe_stopall() argument
1859 mxfe_disableinterrupts(mxfep); in mxfe_stopall()
1861 mxfe_stopmac(mxfep); in mxfe_stopall()
1864 mxfe_stopphy(mxfep); in mxfe_stopall()
1868 mxfe_startall(mxfe_t *mxfep) in mxfe_startall() argument
1870 ASSERT(mutex_owned(&mxfep->mxfe_intrlock)); in mxfe_startall()
1871 ASSERT(mutex_owned(&mxfep->mxfe_xmtlock)); in mxfe_startall()
1874 mxfe_disableinterrupts(mxfep); in mxfe_startall()
1877 (void) mxfe_initialize(mxfep); in mxfe_startall()
1880 mxfe_enableinterrupts(mxfep); in mxfe_startall()
1883 mxfe_startphy(mxfep); in mxfe_startall()
1886 mxfe_startmac(mxfep); in mxfe_startall()
1890 mxfe_resetall(mxfe_t *mxfep) in mxfe_resetall() argument
1892 mxfep->mxfe_resetting = B_TRUE; in mxfe_resetall()
1893 mxfe_stopall(mxfep); in mxfe_resetall()
1894 mxfep->mxfe_resetting = B_FALSE; in mxfe_resetall()
1895 mxfe_startall(mxfep); in mxfe_resetall()
1899 mxfe_alloctxbuf(mxfe_t *mxfep) in mxfe_alloctxbuf() argument
1908 if (ddi_dma_alloc_handle(mxfep->mxfe_dip, &mxfe_dma_txattr, in mxfe_alloctxbuf()
1943 mxfe_allocrxbuf(mxfe_t *mxfep) in mxfe_allocrxbuf() argument
1952 if (ddi_dma_alloc_handle(mxfep->mxfe_dip, &mxfe_dma_attr, in mxfe_allocrxbuf()
1992 mxfe_allocrxring(mxfe_t *mxfep) in mxfe_allocrxring() argument
2004 rval = ddi_dma_alloc_handle(mxfep->mxfe_dip, &mxfe_dma_attr, in mxfe_allocrxring()
2005 DDI_DMA_SLEEP, NULL, &mxfep->mxfe_rxdesc_dmah); in mxfe_allocrxring()
2007 mxfe_error(mxfep->mxfe_dip, in mxfe_allocrxring()
2012 rval = ddi_dma_mem_alloc(mxfep->mxfe_rxdesc_dmah, size, &mxfe_devattr, in mxfe_allocrxring()
2014 &mxfep->mxfe_rxdesc_acch); in mxfe_allocrxring()
2016 mxfe_error(mxfep->mxfe_dip, in mxfe_allocrxring()
2021 rval = ddi_dma_addr_bind_handle(mxfep->mxfe_rxdesc_dmah, NULL, kaddr, in mxfe_allocrxring()
2025 mxfe_error(mxfep->mxfe_dip, in mxfe_allocrxring()
2034 mxfep->mxfe_rxdesc_paddr = dmac.dmac_address; in mxfe_allocrxring()
2035 mxfep->mxfe_rxdescp = (void *)kaddr; in mxfe_allocrxring()
2038 mxfep->mxfe_rxbufs = kmem_zalloc(MXFE_RXRING * sizeof (mxfe_rxbuf_t *), in mxfe_allocrxring()
2043 mxfe_rxbuf_t *rxb = mxfe_allocrxbuf(mxfep); in mxfe_allocrxring()
2046 mxfep->mxfe_rxbufs[i] = rxb; in mxfe_allocrxring()
2056 mxfe_alloctxring(mxfe_t *mxfep) in mxfe_alloctxring() argument
2068 rval = ddi_dma_alloc_handle(mxfep->mxfe_dip, &mxfe_dma_attr, in mxfe_alloctxring()
2069 DDI_DMA_SLEEP, NULL, &mxfep->mxfe_txdesc_dmah); in mxfe_alloctxring()
2071 mxfe_error(mxfep->mxfe_dip, in mxfe_alloctxring()
2076 rval = ddi_dma_mem_alloc(mxfep->mxfe_txdesc_dmah, size, &mxfe_devattr, in mxfe_alloctxring()
2078 &mxfep->mxfe_txdesc_acch); in mxfe_alloctxring()
2080 mxfe_error(mxfep->mxfe_dip, in mxfe_alloctxring()
2085 rval = ddi_dma_addr_bind_handle(mxfep->mxfe_txdesc_dmah, NULL, kaddr, in mxfe_alloctxring()
2089 mxfe_error(mxfep->mxfe_dip, in mxfe_alloctxring()
2098 mxfep->mxfe_txdesc_paddr = dmac.dmac_address; in mxfe_alloctxring()
2099 mxfep->mxfe_txdescp = (void *)kaddr; in mxfe_alloctxring()
2102 mxfep->mxfe_txbufs = kmem_zalloc(MXFE_TXRING * sizeof (mxfe_txbuf_t *), in mxfe_alloctxring()
2107 mxfe_txbuf_t *txb = mxfe_alloctxbuf(mxfep); in mxfe_alloctxring()
2111 mxfep->mxfe_txbufs[i] = txb; in mxfe_alloctxring()
2118 mxfe_freerxring(mxfe_t *mxfep) in mxfe_freerxring() argument
2122 if (mxfep->mxfe_rxbufs) { in mxfe_freerxring()
2124 mxfe_destroyrxbuf(mxfep->mxfe_rxbufs[i]); in mxfe_freerxring()
2127 kmem_free(mxfep->mxfe_rxbufs, in mxfe_freerxring()
2131 if (mxfep->mxfe_rxdesc_paddr) in mxfe_freerxring()
2132 (void) ddi_dma_unbind_handle(mxfep->mxfe_rxdesc_dmah); in mxfe_freerxring()
2133 if (mxfep->mxfe_rxdesc_acch) in mxfe_freerxring()
2134 ddi_dma_mem_free(&mxfep->mxfe_rxdesc_acch); in mxfe_freerxring()
2135 if (mxfep->mxfe_rxdesc_dmah) in mxfe_freerxring()
2136 ddi_dma_free_handle(&mxfep->mxfe_rxdesc_dmah); in mxfe_freerxring()
2140 mxfe_freetxring(mxfe_t *mxfep) in mxfe_freetxring() argument
2144 if (mxfep->mxfe_txbufs) { in mxfe_freetxring()
2146 mxfe_destroytxbuf(mxfep->mxfe_txbufs[i]); in mxfe_freetxring()
2149 kmem_free(mxfep->mxfe_txbufs, in mxfe_freetxring()
2152 if (mxfep->mxfe_txdesc_paddr) in mxfe_freetxring()
2153 (void) ddi_dma_unbind_handle(mxfep->mxfe_txdesc_dmah); in mxfe_freetxring()
2154 if (mxfep->mxfe_txdesc_acch) in mxfe_freetxring()
2155 ddi_dma_mem_free(&mxfep->mxfe_txdesc_acch); in mxfe_freetxring()
2156 if (mxfep->mxfe_txdesc_dmah) in mxfe_freetxring()
2157 ddi_dma_free_handle(&mxfep->mxfe_txdesc_dmah); in mxfe_freetxring()
2166 mxfe_t *mxfep = (void *)arg; in mxfe_intr() local
2171 mutex_enter(&mxfep->mxfe_intrlock); in mxfe_intr()
2173 if (mxfep->mxfe_flags & MXFE_SUSPENDED) { in mxfe_intr()
2175 mutex_exit(&mxfep->mxfe_intrlock); in mxfe_intr()
2180 status = GETCSR(mxfep, CSR_SR) & INT_ALL; in mxfe_intr()
2184 mutex_exit(&mxfep->mxfe_intrlock); in mxfe_intr()
2188 PUTCSR(mxfep, CSR_SR, status); in mxfe_intr()
2191 if (!(mxfep->mxfe_flags & MXFE_RUNNING)) { in mxfe_intr()
2193 mutex_exit(&mxfep->mxfe_intrlock); in mxfe_intr()
2199 if (mxfe_receive(mxfep, &mp)) { in mxfe_intr()
2206 mutex_enter(&mxfep->mxfe_xmtlock); in mxfe_intr()
2207 mxfe_reclaim(mxfep); in mxfe_intr()
2208 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_intr()
2212 ((mxfep->mxfe_linkup == LINK_STATE_UP) && in mxfe_intr()
2215 mutex_enter(&mxfep->mxfe_xmtlock); in mxfe_intr()
2216 mxfe_checklink(mxfep); in mxfe_intr()
2217 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_intr()
2224 mxfep->mxfe_jabber++; in mxfe_intr()
2233 mxfe_error(mxfep->mxfe_dip, "PCI parity error"); in mxfe_intr()
2236 mxfe_error(mxfep->mxfe_dip, "PCI target abort"); in mxfe_intr()
2239 mxfe_error(mxfep->mxfe_dip, "PCI master abort"); in mxfe_intr()
2242 mxfe_error(mxfep->mxfe_dip, "Unknown PCI error"); in mxfe_intr()
2251 mutex_enter(&mxfep->mxfe_xmtlock); in mxfe_intr()
2252 mxfe_resetall(mxfep); in mxfe_intr()
2253 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_intr()
2256 mutex_exit(&mxfep->mxfe_intrlock); in mxfe_intr()
2262 mac_rx(mxfep->mxfe_mh, NULL, mp); in mxfe_intr()
2269 mxfe_enableinterrupts(mxfe_t *mxfep) in mxfe_enableinterrupts() argument
2273 if (mxfep->mxfe_wantw) in mxfe_enableinterrupts()
2276 if (MXFE_MODEL(mxfep) != MXFE_98713A) in mxfe_enableinterrupts()
2280 PUTCSR(mxfep, CSR_IER, mask); in mxfe_enableinterrupts()
2284 mxfe_disableinterrupts(mxfe_t *mxfep) in mxfe_disableinterrupts() argument
2287 PUTCSR(mxfep, CSR_IER, 0); in mxfe_disableinterrupts()
2290 PUTCSR(mxfep, CSR_SR, INT_ALL); in mxfe_disableinterrupts()
2294 mxfe_send_setup(mxfe_t *mxfep) in mxfe_send_setup() argument
2299 ASSERT(mutex_owned(&mxfep->mxfe_xmtlock)); in mxfe_send_setup()
2302 ASSERT(mxfep->mxfe_txsend == 0); in mxfe_send_setup()
2304 txb = mxfep->mxfe_txbufs[0]; in mxfe_send_setup()
2305 tmdp = &mxfep->mxfe_txdescp[0]; in mxfe_send_setup()
2310 txb->txb_buf[156] = mxfep->mxfe_curraddr[0]; in mxfe_send_setup()
2311 txb->txb_buf[157] = mxfep->mxfe_curraddr[1]; in mxfe_send_setup()
2312 txb->txb_buf[160] = mxfep->mxfe_curraddr[2]; in mxfe_send_setup()
2313 txb->txb_buf[161] = mxfep->mxfe_curraddr[3]; in mxfe_send_setup()
2314 txb->txb_buf[164] = mxfep->mxfe_curraddr[4]; in mxfe_send_setup()
2315 txb->txb_buf[165] = mxfep->mxfe_curraddr[5]; in mxfe_send_setup()
2320 PUTTXDESC(mxfep, tmdp->desc_control, in mxfe_send_setup()
2324 PUTTXDESC(mxfep, tmdp->desc_buffer1, txb->txb_paddr); in mxfe_send_setup()
2325 PUTTXDESC(mxfep, tmdp->desc_buffer2, 0); in mxfe_send_setup()
2326 PUTTXDESC(mxfep, tmdp->desc_status, TXSTAT_OWN); in mxfe_send_setup()
2329 SYNCTXDESC(mxfep, 0, DDI_DMA_SYNC_FORDEV); in mxfe_send_setup()
2335 PUTCSR(mxfep, CSR_TDR, 0); in mxfe_send_setup()
2336 mxfep->mxfe_txsend++; in mxfe_send_setup()
2337 mxfep->mxfe_txavail--; in mxfe_send_setup()
2342 if (mxfep->mxfe_promisc) { in mxfe_send_setup()
2343 SETBIT(mxfep, CSR_NAR, NAR_RX_PROMISC); in mxfe_send_setup()
2345 CLRBIT(mxfep, CSR_NAR, NAR_RX_PROMISC); in mxfe_send_setup()
2350 mxfe_send(mxfe_t *mxfep, mblk_t *mp) in mxfe_send() argument
2358 ASSERT(mutex_owned(&mxfep->mxfe_xmtlock)); in mxfe_send()
2364 mxfep->mxfe_macxmt_errors++; in mxfe_send()
2369 if (mxfep->mxfe_txavail < MXFE_TXRECLAIM) in mxfe_send()
2370 mxfe_reclaim(mxfep); in mxfe_send()
2372 if (mxfep->mxfe_txavail == 0) { in mxfe_send()
2374 mxfep->mxfe_wantw = B_TRUE; in mxfe_send()
2376 mxfe_enableinterrupts(mxfep); in mxfe_send()
2380 txsend = mxfep->mxfe_txsend; in mxfe_send()
2387 txb = mxfep->mxfe_txbufs[txsend]; in mxfe_send()
2393 mxfep->mxfe_opackets++; in mxfe_send()
2394 mxfep->mxfe_obytes += len; in mxfe_send()
2397 mxfep->mxfe_multixmt++; in mxfe_send()
2399 mxfep->mxfe_brdcstxmt++; in mxfe_send()
2408 tmd = &mxfep->mxfe_txdescp[txsend]; in mxfe_send()
2411 PUTTXDESC(mxfep, tmd->desc_control, control); in mxfe_send()
2412 PUTTXDESC(mxfep, tmd->desc_buffer1, txb->txb_paddr); in mxfe_send()
2413 PUTTXDESC(mxfep, tmd->desc_buffer2, 0); in mxfe_send()
2414 PUTTXDESC(mxfep, tmd->desc_status, TXSTAT_OWN); in mxfe_send()
2416 SYNCTXDESC(mxfep, txsend, DDI_DMA_SYNC_FORDEV); in mxfe_send()
2421 mxfep->mxfe_txavail--; in mxfe_send()
2422 mxfep->mxfe_txsend = (txsend + 1) % MXFE_TXRING; in mxfe_send()
2428 mxfep->mxfe_txstall_time = gethrtime() + (5 * 1000000000ULL); in mxfe_send()
2434 PUTCSR(mxfep, CSR_TDR, 0); in mxfe_send()
2443 mxfe_reclaim(mxfe_t *mxfep) in mxfe_reclaim() argument
2447 while (mxfep->mxfe_txavail != MXFE_TXRING) { in mxfe_reclaim()
2450 int index = mxfep->mxfe_txreclaim; in mxfe_reclaim()
2452 tmdp = &mxfep->mxfe_txdescp[index]; in mxfe_reclaim()
2455 SYNCTXDESC(mxfep, index, DDI_DMA_SYNC_FORKERNEL); in mxfe_reclaim()
2457 control = GETTXDESC(mxfep, tmdp->desc_control); in mxfe_reclaim()
2458 status = GETTXDESC(mxfep, tmdp->desc_status); in mxfe_reclaim()
2465 mxfep->mxfe_txavail++; in mxfe_reclaim()
2466 mxfep->mxfe_txreclaim = (index + 1) % MXFE_TXRING; in mxfe_reclaim()
2479 mxfep->mxfe_errxmt++; in mxfe_reclaim()
2483 mxfep->mxfe_macxmt_errors++; in mxfe_reclaim()
2486 mxfep->mxfe_carrier_errors++; in mxfe_reclaim()
2489 mxfep->mxfe_underflow++; in mxfe_reclaim()
2492 mxfep->mxfe_tx_late_collisions++; in mxfe_reclaim()
2495 mxfep->mxfe_ex_collisions++; in mxfe_reclaim()
2496 mxfep->mxfe_collisions += 16; in mxfe_reclaim()
2501 mxfep->mxfe_defer_xmts++; in mxfe_reclaim()
2506 mxfep->mxfe_collisions++; in mxfe_reclaim()
2507 mxfep->mxfe_first_collisions++; in mxfe_reclaim()
2509 mxfep->mxfe_collisions += TXCOLLCNT(status); in mxfe_reclaim()
2510 mxfep->mxfe_multi_collisions += TXCOLLCNT(status); in mxfe_reclaim()
2514 if (mxfep->mxfe_txavail >= MXFE_TXRESCHED) { in mxfe_reclaim()
2515 if (mxfep->mxfe_wantw) { in mxfe_reclaim()
2520 mxfep->mxfe_wantw = B_FALSE; in mxfe_reclaim()
2521 mxfe_enableinterrupts(mxfep); in mxfe_reclaim()
2522 mac_tx_update(mxfep->mxfe_mh); in mxfe_reclaim()
2528 mxfe_receive(mxfe_t *mxfep, mblk_t **rxchain) in mxfe_receive() argument
2540 head = mxfep->mxfe_rxhead; in mxfe_receive()
2547 rmd = &mxfep->mxfe_rxdescp[head]; in mxfe_receive()
2548 rxb = mxfep->mxfe_rxbufs[head]; in mxfe_receive()
2550 SYNCRXDESC(mxfep, head, DDI_DMA_SYNC_FORKERNEL); in mxfe_receive()
2551 status = GETRXDESC(mxfep, rmd->desc_status); in mxfe_receive()
2565 mxfep->mxfe_errrcv++; in mxfe_receive()
2575 mxfep->mxfe_toolong_errors++; in mxfe_receive()
2579 mxfep->mxfe_macrcv_errors++; in mxfe_receive()
2583 mxfep->mxfe_runt++; in mxfe_receive()
2587 mxfep->mxfe_macrcv_errors++; in mxfe_receive()
2590 mxfep->mxfe_align_errors++; in mxfe_receive()
2593 mxfep->mxfe_fcs_errors++; in mxfe_receive()
2597 mxfep->mxfe_overflow++; in mxfe_receive()
2603 mxfep->mxfe_errrcv++; in mxfe_receive()
2604 mxfep->mxfe_toolong_errors++; in mxfe_receive()
2613 mxfep->mxfe_errrcv++; in mxfe_receive()
2614 mxfep->mxfe_norcvbuf++; in mxfe_receive()
2624 mxfep->mxfe_ipackets++; in mxfe_receive()
2625 mxfep->mxfe_rbytes += len; in mxfe_receive()
2629 mxfep->mxfe_brdcstrcv++; in mxfe_receive()
2631 mxfep->mxfe_multircv++; in mxfe_receive()
2639 PUTRXDESC(mxfep, rmd->desc_status, RXSTAT_OWN); in mxfe_receive()
2640 SYNCRXDESC(mxfep, head, DDI_DMA_SYNC_FORDEV); in mxfe_receive()
2646 mxfep->mxfe_rxhead = head; in mxfe_receive()
2655 mxfe_t *mxfep = arg; in mxfe_m_stat() local
2657 mutex_enter(&mxfep->mxfe_xmtlock); in mxfe_m_stat()
2658 if ((mxfep->mxfe_flags & (MXFE_RUNNING|MXFE_SUSPENDED)) == MXFE_RUNNING) in mxfe_m_stat()
2659 mxfe_reclaim(mxfep); in mxfe_m_stat()
2660 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_m_stat()
2664 *val = mxfep->mxfe_ifspeed; in mxfe_m_stat()
2668 *val = mxfep->mxfe_multircv; in mxfe_m_stat()
2672 *val = mxfep->mxfe_brdcstrcv; in mxfe_m_stat()
2676 *val = mxfep->mxfe_multixmt; in mxfe_m_stat()
2680 *val = mxfep->mxfe_brdcstxmt; in mxfe_m_stat()
2684 *val = mxfep->mxfe_ipackets; in mxfe_m_stat()
2688 *val = mxfep->mxfe_rbytes; in mxfe_m_stat()
2692 *val = mxfep->mxfe_opackets; in mxfe_m_stat()
2696 *val = mxfep->mxfe_obytes; in mxfe_m_stat()
2700 *val = mxfep->mxfe_norcvbuf; in mxfe_m_stat()
2704 *val = mxfep->mxfe_noxmtbuf; in mxfe_m_stat()
2708 *val = mxfep->mxfe_collisions; in mxfe_m_stat()
2712 *val = mxfep->mxfe_errrcv; in mxfe_m_stat()
2716 *val = mxfep->mxfe_errxmt; in mxfe_m_stat()
2720 *val = mxfep->mxfe_duplex; in mxfe_m_stat()
2724 *val = mxfep->mxfe_align_errors; in mxfe_m_stat()
2728 *val = mxfep->mxfe_fcs_errors; in mxfe_m_stat()
2732 *val = mxfep->mxfe_sqe_errors; in mxfe_m_stat()
2736 *val = mxfep->mxfe_defer_xmts; in mxfe_m_stat()
2740 *val = mxfep->mxfe_first_collisions; in mxfe_m_stat()
2744 *val = mxfep->mxfe_multi_collisions; in mxfe_m_stat()
2748 *val = mxfep->mxfe_tx_late_collisions; in mxfe_m_stat()
2752 *val = mxfep->mxfe_ex_collisions; in mxfe_m_stat()
2756 *val = mxfep->mxfe_macxmt_errors; in mxfe_m_stat()
2760 *val = mxfep->mxfe_carrier_errors; in mxfe_m_stat()
2764 *val = mxfep->mxfe_toolong_errors; in mxfe_m_stat()
2768 *val = mxfep->mxfe_macrcv_errors; in mxfe_m_stat()
2772 *val = mxfep->mxfe_overflow; in mxfe_m_stat()
2776 *val = mxfep->mxfe_underflow; in mxfe_m_stat()
2780 *val = mxfep->mxfe_runt; in mxfe_m_stat()
2784 *val = mxfep->mxfe_jabber; in mxfe_m_stat()
2788 *val = mxfep->mxfe_adv_100T4; in mxfe_m_stat()
2792 *val = (mxfep->mxfe_anlpar & MII_ABILITY_100BASE_T4) ? 1 : 0; in mxfe_m_stat()
2796 *val = mxfep->mxfe_cap_100T4; in mxfe_m_stat()
2800 *val = mxfep->mxfe_cap_100fdx; in mxfe_m_stat()
2804 *val = mxfep->mxfe_cap_100hdx; in mxfe_m_stat()
2808 *val = mxfep->mxfe_cap_10fdx; in mxfe_m_stat()
2812 *val = mxfep->mxfe_cap_10hdx; in mxfe_m_stat()
2816 *val = mxfep->mxfe_cap_aneg; in mxfe_m_stat()
2820 *val = ((mxfep->mxfe_adv_aneg != 0) && in mxfe_m_stat()
2821 ((mxfep->mxfe_aner & MII_AN_EXP_LPCANAN) != 0)); in mxfe_m_stat()
2825 *val = mxfep->mxfe_adv_100fdx; in mxfe_m_stat()
2829 *val = mxfep->mxfe_adv_100hdx; in mxfe_m_stat()
2833 *val = mxfep->mxfe_adv_10fdx; in mxfe_m_stat()
2837 *val = mxfep->mxfe_adv_10hdx; in mxfe_m_stat()
2841 *val = mxfep->mxfe_adv_aneg; in mxfe_m_stat()
2845 *val = (mxfep->mxfe_anlpar & MII_ABILITY_100BASE_TX_FD) ? 1 : 0; in mxfe_m_stat()
2849 *val = (mxfep->mxfe_anlpar & MII_ABILITY_100BASE_TX) ? 1 : 0; in mxfe_m_stat()
2853 *val = (mxfep->mxfe_anlpar & MII_ABILITY_10BASE_T_FD) ? 1 : 0; in mxfe_m_stat()
2857 *val = (mxfep->mxfe_anlpar & MII_ABILITY_10BASE_T) ? 1 : 0; in mxfe_m_stat()
2861 *val = (mxfep->mxfe_aner & MII_AN_EXP_LPCANAN) ? 1 : 0; in mxfe_m_stat()
2865 *val = mxfep->mxfe_phyaddr; in mxfe_m_stat()
2869 *val = mxfep->mxfe_phyid; in mxfe_m_stat()
2873 *val = mxfep->mxfe_phyinuse; in mxfe_m_stat()
2887 mxfe_t *mxfep = arg; in mxfe_m_getprop() local
2893 bcopy(&mxfep->mxfe_duplex, val, sizeof (link_duplex_t)); in mxfe_m_getprop()
2898 bcopy(&mxfep->mxfe_ifspeed, val, sizeof (uint64_t)); in mxfe_m_getprop()
2902 *(uint8_t *)val = mxfep->mxfe_adv_aneg; in mxfe_m_getprop()
2907 *(uint8_t *)val = mxfep->mxfe_adv_100fdx; in mxfe_m_getprop()
2912 *(uint8_t *)val = mxfep->mxfe_adv_100hdx; in mxfe_m_getprop()
2917 *(uint8_t *)val = mxfep->mxfe_adv_10fdx; in mxfe_m_getprop()
2922 *(uint8_t *)val = mxfep->mxfe_adv_10hdx; in mxfe_m_getprop()
2927 *(uint8_t *)val = mxfep->mxfe_adv_100T4; in mxfe_m_getprop()
2942 mxfe_t *mxfep = arg; in mxfe_m_setprop() local
2948 advp = &mxfep->mxfe_adv_100fdx; in mxfe_m_setprop()
2949 capp = &mxfep->mxfe_cap_100fdx; in mxfe_m_setprop()
2953 advp = &mxfep->mxfe_adv_100hdx; in mxfe_m_setprop()
2954 capp = &mxfep->mxfe_cap_100hdx; in mxfe_m_setprop()
2958 advp = &mxfep->mxfe_adv_10fdx; in mxfe_m_setprop()
2959 capp = &mxfep->mxfe_cap_10fdx; in mxfe_m_setprop()
2963 advp = &mxfep->mxfe_adv_10hdx; in mxfe_m_setprop()
2964 capp = &mxfep->mxfe_cap_10hdx; in mxfe_m_setprop()
2968 advp = &mxfep->mxfe_adv_100T4; in mxfe_m_setprop()
2969 capp = &mxfep->mxfe_cap_100T4; in mxfe_m_setprop()
2973 advp = &mxfep->mxfe_adv_aneg; in mxfe_m_setprop()
2974 capp = &mxfep->mxfe_cap_aneg; in mxfe_m_setprop()
2984 mutex_enter(&mxfep->mxfe_intrlock); in mxfe_m_setprop()
2985 mutex_enter(&mxfep->mxfe_xmtlock); in mxfe_m_setprop()
2990 if ((mxfep->mxfe_flags & (MXFE_RUNNING|MXFE_SUSPENDED)) == in mxfe_m_setprop()
2999 mxfe_resetall(mxfep); in mxfe_m_setprop()
3002 mutex_exit(&mxfep->mxfe_xmtlock); in mxfe_m_setprop()
3003 mutex_exit(&mxfep->mxfe_intrlock); in mxfe_m_setprop()
3012 mxfe_t *mxfep = arg; in mxfe_m_propinfo() local
3028 mac_prop_info_set_default_uint8(mph, mxfep->mxfe_cap_aneg); in mxfe_m_propinfo()
3032 mac_prop_info_set_default_uint8(mph, mxfep->mxfe_cap_100fdx); in mxfe_m_propinfo()
3036 mac_prop_info_set_default_uint8(mph, mxfep->mxfe_cap_100hdx); in mxfe_m_propinfo()
3040 mac_prop_info_set_default_uint8(mph, mxfep->mxfe_cap_10fdx); in mxfe_m_propinfo()
3044 mac_prop_info_set_default_uint8(mph, mxfep->mxfe_cap_10hdx); in mxfe_m_propinfo()
3048 mac_prop_info_set_default_uint8(mph, mxfep->mxfe_cap_100T4); in mxfe_m_propinfo()
3077 mxfe_dprintf(mxfe_t *mxfep, const char *func, int level, char *fmt, ...) in mxfe_dprintf() argument
3086 if (mxfep && mxfep->mxfe_dip) { in mxfe_dprintf()
3088 "%s%d", ddi_driver_name(mxfep->mxfe_dip), in mxfe_dprintf()
3089 ddi_get_instance(mxfep->mxfe_dip)); in mxfe_dprintf()