Lines Matching refs:umdevice

47 	um_device_t *umdevice;  in bnx_m_start()  local
49 umdevice = (um_device_t *)arg; in bnx_m_start()
51 mutex_enter(&umdevice->os_param.gld_mutex); in bnx_m_start()
53 if (umdevice->dev_start == B_TRUE) { in bnx_m_start()
60 bnx_gld_link(umdevice, LINK_STATE_UNKNOWN); in bnx_m_start()
62 umdevice->link_updates_ok = B_TRUE; in bnx_m_start()
64 if (bnx_hdwr_acquire(umdevice)) { in bnx_m_start()
69 umdevice->dev_start = B_TRUE; in bnx_m_start()
74 mutex_exit(&umdevice->os_param.gld_mutex); in bnx_m_start()
93 um_device_t *umdevice; in bnx_m_stop() local
95 umdevice = (um_device_t *)arg; in bnx_m_stop()
97 mutex_enter(&umdevice->os_param.gld_mutex); in bnx_m_stop()
99 if (umdevice->dev_start == B_TRUE) { in bnx_m_stop()
100 umdevice->dev_start = B_FALSE; in bnx_m_stop()
101 umdevice->link_updates_ok = B_FALSE; in bnx_m_stop()
103 bnx_hdwr_release(umdevice); in bnx_m_stop()
106 bnx_gld_link(umdevice, LINK_STATE_UNKNOWN); in bnx_m_stop()
108 umdevice->dev_var.indLink = 0; in bnx_m_stop()
109 umdevice->dev_var.indMedium = 0; in bnx_m_stop()
112 mutex_exit(&umdevice->os_param.gld_mutex); in bnx_m_stop()
131 um_device_t *umdevice; in bnx_m_unicast() local
134 umdevice = (um_device_t *)arg; in bnx_m_unicast()
135 lmdevice = &(umdevice->lm_dev); in bnx_m_unicast()
137 mutex_enter(&umdevice->os_param.gld_mutex); in bnx_m_unicast()
142 "broadcast address as a MAC address.", umdevice->dev_name); in bnx_m_unicast()
147 if (umdevice->dev_start == B_TRUE) { in bnx_m_unicast()
151 umdevice->dev_name); in bnx_m_unicast()
162 mutex_exit(&umdevice->os_param.gld_mutex); in bnx_m_unicast()
168 bnx_mc_add(um_device_t *umdevice, const uint8_t *const mc_addr) in bnx_mc_add() argument
175 lmdevice = &(umdevice->lm_dev); in bnx_mc_add()
181 umdevice->dev_var.rx_filter_mask |= in bnx_mc_add()
196 bnx_mc_del(um_device_t *umdevice, const uint8_t *const mc_addr) in bnx_mc_del() argument
203 lmdevice = &(umdevice->lm_dev); in bnx_mc_del()
213 umdevice->dev_var.rx_filter_mask &= in bnx_mc_del()
244 um_device_t *umdevice; in bnx_m_multicast() local
247 umdevice = (um_device_t *)arg; in bnx_m_multicast()
249 mutex_enter(&umdevice->os_param.gld_mutex); in bnx_m_multicast()
251 if (umdevice->dev_start != B_TRUE) { in bnx_m_multicast()
258 rc = bnx_mc_add(umdevice, multicastaddr); in bnx_m_multicast()
262 rc = bnx_mc_del(umdevice, multicastaddr); in bnx_m_multicast()
271 mutex_exit(&umdevice->os_param.gld_mutex); in bnx_m_multicast()
299 um_device_t *umdevice; in bnx_m_promiscuous() local
301 umdevice = (um_device_t *)arg; in bnx_m_promiscuous()
303 mutex_enter(&umdevice->os_param.gld_mutex); in bnx_m_promiscuous()
305 if (umdevice->dev_start != B_TRUE) { in bnx_m_promiscuous()
312 umdevice->dev_var.rx_filter_mask |= in bnx_m_promiscuous()
317 umdevice->dev_var.rx_filter_mask &= in bnx_m_promiscuous()
326 (void) lm_set_rx_mask(&(umdevice->lm_dev), RX_FILTER_USER_IDX0, in bnx_m_promiscuous()
327 umdevice->dev_var.rx_filter_mask); in bnx_m_promiscuous()
332 mutex_exit(&umdevice->os_param.gld_mutex); in bnx_m_promiscuous()
343 um_device_t *umdevice; in bnx_m_tx() local
345 umdevice = (um_device_t *)arg; in bnx_m_tx()
347 rw_enter(&umdevice->os_param.gld_snd_mutex, RW_READER); in bnx_m_tx()
349 if (umdevice->dev_start != B_TRUE || in bnx_m_tx()
350 umdevice->nddcfg.link_speed == 0) { in bnx_m_tx()
363 rc = bnx_xmit_ring_xmit_mblk(umdevice, 0, mp); in bnx_m_tx()
379 rw_exit(&umdevice->os_param.gld_snd_mutex); in bnx_m_tx()
450 um_device_t *umdevice; in bnx_m_stats() local
454 umdevice = (um_device_t *)arg; in bnx_m_stats()
456 if (umdevice == NULL || val == NULL) { in bnx_m_stats()
460 lmdevice = &(umdevice->lm_dev); in bnx_m_stats()
464 if (umdevice->dev_var.isfiber) { in bnx_m_stats()
470 mutex_enter(&umdevice->os_param.gld_mutex); in bnx_m_stats()
472 if (umdevice->dev_start != B_TRUE) { in bnx_m_stats()
480 *val = umdevice->nddcfg.link_speed * 1000000ull; in bnx_m_stats()
612 *val = (uint64_t)bnx_um_to_media(umdevice); in bnx_m_stats()
647 *val = umdevice->curcfg.lnkcfg.param_1000fdx; in bnx_m_stats()
650 *val = umdevice->curcfg.lnkcfg.param_1000hdx; in bnx_m_stats()
653 *val = umdevice->curcfg.lnkcfg.param_100fdx; in bnx_m_stats()
656 *val = umdevice->curcfg.lnkcfg.param_100hdx; in bnx_m_stats()
659 *val = umdevice->curcfg.lnkcfg.param_10fdx; in bnx_m_stats()
662 *val = umdevice->curcfg.lnkcfg.param_10hdx; in bnx_m_stats()
671 *val = umdevice->curcfg.lnkcfg.link_autoneg; in bnx_m_stats()
679 *val = umdevice->remote.param_1000fdx; in bnx_m_stats()
682 *val = umdevice->remote.param_1000hdx; in bnx_m_stats()
685 *val = umdevice->remote.param_100fdx; in bnx_m_stats()
688 *val = umdevice->remote.param_100hdx; in bnx_m_stats()
691 *val = umdevice->remote.param_10fdx; in bnx_m_stats()
694 *val = umdevice->remote.param_10hdx; in bnx_m_stats()
703 *val = umdevice->remote.link_autoneg; in bnx_m_stats()
717 *val = umdevice->curcfg.lnkcfg.link_autoneg; in bnx_m_stats()
720 *val = umdevice->nddcfg.link_duplex == B_TRUE ? in bnx_m_stats()
730 mutex_exit(&umdevice->os_param.gld_mutex); in bnx_m_stats()
738 um_device_t *umdevice; in bnx_m_getcapab() local
740 umdevice = (um_device_t *)arg; in bnx_m_getcapab()
748 if (umdevice->dev_var.enabled_oflds & in bnx_m_getcapab()
753 if (umdevice->dev_var.enabled_oflds & in bnx_m_getcapab()
768 bnx_refresh_rx_tx_pkts(um_device_t *umdevice) in bnx_refresh_rx_tx_pkts() argument
770 if (umdevice->os_param.active_resc_flag & DRV_RESOURCE_HDWR_REGISTER) { in bnx_refresh_rx_tx_pkts()
771 bnx_hdwr_fini(umdevice); in bnx_refresh_rx_tx_pkts()
777 if (lm_init_resc(&(umdevice->lm_dev)) != LM_STATUS_SUCCESS) { in bnx_refresh_rx_tx_pkts()
781 if (bnx_txpkts_init(umdevice)) { in bnx_refresh_rx_tx_pkts()
785 if (bnx_rxpkts_init(umdevice)) { in bnx_refresh_rx_tx_pkts()
793 bnx_set_priv_prop(um_device_t *umdevice, const char *pr_name, in bnx_set_priv_prop() argument
801 if (lm_get_medium(&umdevice->lm_dev) != LM_MEDIUM_TYPE_FIBER) { in bnx_set_priv_prop()
810 if (umdevice->hwinit.lnkcfg.param_2500fdx != (uint32_t)result) { in bnx_set_priv_prop()
811 umdevice->hwinit.lnkcfg.param_2500fdx = in bnx_set_priv_prop()
813 umdevice->curcfg.lnkcfg.param_2500fdx = in bnx_set_priv_prop()
815 bnx_update_phy(umdevice); in bnx_set_priv_prop()
818 if (umdevice->dev_start == B_TRUE) { in bnx_set_priv_prop()
826 umdevice->dev_var.enabled_oflds = in bnx_set_priv_prop()
833 umdevice->dev_var.enabled_oflds = in bnx_set_priv_prop()
840 umdevice->dev_var.enabled_oflds = in bnx_set_priv_prop()
850 umdevice->dev_var.enabled_oflds = in bnx_set_priv_prop()
858 if (umdevice->dev_start == B_TRUE) { in bnx_set_priv_prop()
868 _TX_QINFO(umdevice, 0).desc_cnt = result; in bnx_set_priv_prop()
869 umdevice->lm_dev.params.l2_tx_bd_page_cnt[0] = in bnx_set_priv_prop()
872 umdevice->lm_dev.params.l2_tx_bd_page_cnt[0]++; in bnx_set_priv_prop()
874 if (umdevice->lm_dev.params.l2_tx_bd_page_cnt[0] > 127) { in bnx_set_priv_prop()
875 umdevice->lm_dev.params.l2_tx_bd_page_cnt[0] = 127; in bnx_set_priv_prop()
879 if (umdevice->dev_start == B_TRUE) { in bnx_set_priv_prop()
889 umdevice->lm_dev.params.l2_rx_desc_cnt[0] = result; in bnx_set_priv_prop()
891 umdevice->lm_dev.params.l2_rx_bd_page_cnt[0] = result; in bnx_set_priv_prop()
893 umdevice->lm_dev.params.l2_rx_bd_page_cnt[0]++; in bnx_set_priv_prop()
900 if (umdevice->dev_start == B_TRUE) { in bnx_set_priv_prop()
910 umdevice->lm_dev.params.tx_ticks = result; in bnx_set_priv_prop()
912 if (umdevice->dev_start == B_TRUE) { in bnx_set_priv_prop()
922 umdevice->lm_dev.params.tx_ticks_int = result; in bnx_set_priv_prop()
924 if (umdevice->dev_start == B_TRUE) { in bnx_set_priv_prop()
934 umdevice->lm_dev.params.rx_ticks = result; in bnx_set_priv_prop()
936 if (umdevice->dev_start == B_TRUE) { in bnx_set_priv_prop()
946 umdevice->lm_dev.params.rx_ticks_int = result; in bnx_set_priv_prop()
948 if (umdevice->dev_start == B_TRUE) { in bnx_set_priv_prop()
958 umdevice->lm_dev.params.tx_quick_cons_trip = result; in bnx_set_priv_prop()
960 if (umdevice->dev_start == B_TRUE) { in bnx_set_priv_prop()
970 umdevice->lm_dev.params.tx_quick_cons_trip_int = result; in bnx_set_priv_prop()
972 if (umdevice->dev_start == B_TRUE) { in bnx_set_priv_prop()
982 umdevice->lm_dev.params.rx_quick_cons_trip = result; in bnx_set_priv_prop()
984 if (umdevice->dev_start == B_TRUE) { in bnx_set_priv_prop()
994 umdevice->lm_dev.params.rx_quick_cons_trip_int = result; in bnx_set_priv_prop()
996 if (umdevice->dev_start == B_TRUE) { in bnx_set_priv_prop()
1006 umdevice->lm_dev.params.stats_ticks = result; in bnx_set_priv_prop()
1016 err = bnx_refresh_rx_tx_pkts(umdevice); in bnx_set_priv_prop()
1026 um_device_t *umdevice = arg; in bnx_m_setprop() local
1034 mutex_enter(&umdevice->os_param.gld_mutex); in bnx_m_setprop()
1036 if (lm_get_medium(&umdevice->lm_dev) == LM_MEDIUM_TYPE_FIBER) { in bnx_m_setprop()
1041 mutex_exit(&umdevice->os_param.gld_mutex); in bnx_m_setprop()
1067 if (umdevice->hwinit.lnkcfg.param != *(uint8_t *)pr_val) { \ in bnx_m_setprop()
1068 umdevice->hwinit.lnkcfg.param = *(uint8_t *)pr_val; \ in bnx_m_setprop()
1069 umdevice->curcfg.lnkcfg.param = *(uint8_t *)pr_val; \ in bnx_m_setprop()
1118 if (umdevice->hwinit.lnkcfg.param_tx_pause != in bnx_m_setprop()
1120 umdevice->hwinit.lnkcfg.param_rx_pause != in bnx_m_setprop()
1122 umdevice->hwinit.lnkcfg.param_tx_pause = in bnx_m_setprop()
1124 umdevice->hwinit.lnkcfg.param_rx_pause = in bnx_m_setprop()
1126 umdevice->curcfg.lnkcfg.param_tx_pause = in bnx_m_setprop()
1128 umdevice->curcfg.lnkcfg.param_rx_pause = in bnx_m_setprop()
1137 if (umdevice->dev_start == B_TRUE) { in bnx_m_setprop()
1150 if (umdevice->dev_var.mtu == mtu) { in bnx_m_setprop()
1154 umdevice->dev_var.mtu = mtu; in bnx_m_setprop()
1155 umdevice->lm_dev.params.mtu = umdevice->dev_var.mtu in bnx_m_setprop()
1158 if (bnx_refresh_rx_tx_pkts(umdevice) != 0) { in bnx_m_setprop()
1166 err = bnx_set_priv_prop(umdevice, pr_name, pr_valsize, in bnx_m_setprop()
1173 bnx_update_phy(umdevice); in bnx_m_setprop()
1176 mutex_exit(&umdevice->os_param.gld_mutex); in bnx_m_setprop()
1182 bnx_get_priv_prop(um_device_t *umdevice, const char *pr_name, in bnx_get_priv_prop() argument
1188 if (lm_get_medium(&umdevice->lm_dev) != in bnx_get_priv_prop()
1192 value = umdevice->curcfg.lnkcfg.param_2500fdx; in bnx_get_priv_prop()
1194 value = umdevice->dev_var.enabled_oflds; in bnx_get_priv_prop()
1196 value = _TX_QINFO(umdevice, 0).desc_cnt; in bnx_get_priv_prop()
1198 value = umdevice->lm_dev.params.l2_rx_desc_cnt[0]; in bnx_get_priv_prop()
1200 value = umdevice->lm_dev.params.tx_ticks; in bnx_get_priv_prop()
1202 value = umdevice->lm_dev.params.tx_ticks_int; in bnx_get_priv_prop()
1204 value = umdevice->lm_dev.params.rx_ticks; in bnx_get_priv_prop()
1206 value = umdevice->lm_dev.params.rx_ticks_int; in bnx_get_priv_prop()
1208 value = umdevice->lm_dev.params.tx_quick_cons_trip; in bnx_get_priv_prop()
1210 value = umdevice->lm_dev.params.tx_quick_cons_trip_int; in bnx_get_priv_prop()
1212 value = umdevice->lm_dev.params.rx_quick_cons_trip; in bnx_get_priv_prop()
1214 value = umdevice->lm_dev.params.rx_quick_cons_trip_int; in bnx_get_priv_prop()
1216 value = umdevice->lm_dev.params.stats_ticks; in bnx_get_priv_prop()
1218 value = umdevice->dev_var.disableMsix; in bnx_get_priv_prop()
1232 um_device_t *umdevice = arg; in bnx_m_getprop() local
1239 if (lm_get_medium(&umdevice->lm_dev) == LM_MEDIUM_TYPE_FIBER) { in bnx_m_getprop()
1250 link_duplex = umdevice->nddcfg.link_duplex == B_TRUE ? in bnx_m_getprop()
1259 link_speed = umdevice->nddcfg.link_speed * 1000000ull; in bnx_m_getprop()
1267 link_state = umdevice->nddcfg.link_speed ? in bnx_m_getprop()
1276 media = bnx_um_to_media(umdevice); in bnx_m_getprop()
1285 umdevice->curcfg.lnkcfg.link_autoneg; in bnx_m_getprop()
1292 umdevice->curcfg.lnkcfg.param_tx_pause; in bnx_m_getprop()
1294 umdevice->curcfg.lnkcfg.param_rx_pause; in bnx_m_getprop()
1313 umdevice->curcfg.lnkcfg.param_1000fdx; in bnx_m_getprop()
1318 umdevice->curcfg.lnkcfg.param_1000fdx; in bnx_m_getprop()
1323 umdevice->curcfg.lnkcfg.param_1000hdx; in bnx_m_getprop()
1328 umdevice->curcfg.lnkcfg.param_1000hdx; in bnx_m_getprop()
1333 umdevice->curcfg.lnkcfg.param_100fdx; in bnx_m_getprop()
1338 umdevice->curcfg.lnkcfg.param_100fdx; in bnx_m_getprop()
1343 umdevice->curcfg.lnkcfg.param_100hdx; in bnx_m_getprop()
1348 umdevice->curcfg.lnkcfg.param_100hdx; in bnx_m_getprop()
1353 umdevice->curcfg.lnkcfg.param_10fdx; in bnx_m_getprop()
1358 umdevice->curcfg.lnkcfg.param_10fdx; in bnx_m_getprop()
1363 umdevice->curcfg.lnkcfg.param_10hdx; in bnx_m_getprop()
1368 umdevice->curcfg.lnkcfg.param_10hdx; in bnx_m_getprop()
1372 return (bnx_get_priv_prop(umdevice, pr_name, pr_valsize, in bnx_m_getprop()
1386 bnx_priv_propinfo(um_device_t *umdevice, const char *pr_name, in bnx_priv_propinfo() argument
1393 if (lm_get_medium(&umdevice->lm_dev) != LM_MEDIUM_TYPE_FIBER) { in bnx_priv_propinfo()
1396 value = umdevice->curcfg.lnkcfg.param_2500fdx; in bnx_priv_propinfo()
1398 value = umdevice->dev_var.enabled_oflds; in bnx_priv_propinfo()
1400 value = _TX_QINFO(umdevice, 0).desc_cnt; in bnx_priv_propinfo()
1402 value = umdevice->lm_dev.params.l2_rx_desc_cnt[0]; in bnx_priv_propinfo()
1404 value = umdevice->lm_dev.params.tx_ticks; in bnx_priv_propinfo()
1406 value = umdevice->lm_dev.params.tx_ticks_int; in bnx_priv_propinfo()
1408 value = umdevice->lm_dev.params.rx_ticks; in bnx_priv_propinfo()
1410 value = umdevice->lm_dev.params.rx_ticks_int; in bnx_priv_propinfo()
1412 value = umdevice->lm_dev.params.tx_quick_cons_trip; in bnx_priv_propinfo()
1414 value = umdevice->lm_dev.params.tx_quick_cons_trip_int; in bnx_priv_propinfo()
1416 value = umdevice->lm_dev.params.rx_quick_cons_trip; in bnx_priv_propinfo()
1418 value = umdevice->lm_dev.params.rx_quick_cons_trip_int; in bnx_priv_propinfo()
1420 value = umdevice->lm_dev.params.stats_ticks; in bnx_priv_propinfo()
1422 value = umdevice->dev_var.disableMsix; in bnx_priv_propinfo()
1436 um_device_t *umdevice = arg; in bnx_m_propinfo() local
1438 if (lm_get_medium(&umdevice->lm_dev) == LM_MEDIUM_TYPE_FIBER) { in bnx_m_propinfo()
1476 if (lm_get_medium(&umdevice->lm_dev) == in bnx_m_propinfo()
1503 bnx_priv_propinfo(umdevice, pr_name, prh); in bnx_m_propinfo()
1543 bnx_gld_init(um_device_t *const umdevice) in bnx_gld_init() argument
1548 umdevice->dev_start = B_FALSE; in bnx_gld_init()
1550 mutex_init(&umdevice->os_param.gld_mutex, NULL, in bnx_gld_init()
1551 MUTEX_DRIVER, DDI_INTR_PRI(umdevice->intrPriority)); in bnx_gld_init()
1553 rw_init(&umdevice->os_param.gld_snd_mutex, NULL, RW_DRIVER, NULL); in bnx_gld_init()
1559 umdevice->dev_name); in bnx_gld_init()
1563 macp->m_driver = umdevice; in bnx_gld_init()
1564 macp->m_dip = umdevice->os_param.dip; in bnx_gld_init()
1568 macp->m_max_sdu = umdevice->dev_var.mtu; in bnx_gld_init()
1569 macp->m_src_addr = &(umdevice->lm_dev.params.mac_addr[0]); in bnx_gld_init()
1577 rc = mac_register(macp, &umdevice->os_param.macp); in bnx_gld_init()
1584 umdevice->dev_name); in bnx_gld_init()
1589 bnx_gld_link(umdevice, LINK_STATE_UNKNOWN); in bnx_gld_init()
1594 rw_destroy(&umdevice->os_param.gld_snd_mutex); in bnx_gld_init()
1595 mutex_destroy(&umdevice->os_param.gld_mutex); in bnx_gld_init()
1601 bnx_gld_link(um_device_t * const umdevice, const link_state_t linkup) in bnx_gld_link() argument
1603 mac_link_update(umdevice->os_param.macp, linkup); in bnx_gld_link()
1607 bnx_gld_fini(um_device_t * const umdevice) in bnx_gld_fini() argument
1609 if (umdevice->dev_start != B_FALSE) { in bnx_gld_fini()
1612 umdevice->dev_name); in bnx_gld_fini()
1616 if (mac_unregister(umdevice->os_param.macp)) { in bnx_gld_fini()
1619 umdevice->dev_name); in bnx_gld_fini()
1623 rw_destroy(&umdevice->os_param.gld_snd_mutex); in bnx_gld_fini()
1624 mutex_destroy(&umdevice->os_param.gld_mutex); in bnx_gld_fini()