Lines Matching refs:sp

48 sfxge_gld_link_update(sfxge_t *sp)  in sfxge_gld_link_update()  argument
50 sfxge_mac_t *smp = &(sp->s_mac); in sfxge_gld_link_update()
64 mac_link_update(sp->s_mh, link); in sfxge_gld_link_update()
68 sfxge_gld_mtu_update(sfxge_t *sp) in sfxge_gld_mtu_update() argument
71 (void) mac_maxsdu_update(sp->s_mh, sp->s_mtu); in sfxge_gld_mtu_update()
73 _NOTE(ARGUNUSED(sp)); in sfxge_gld_mtu_update()
78 sfxge_gld_rx_post(sfxge_t *sp, unsigned int index, mblk_t *mp) in sfxge_gld_rx_post() argument
82 mac_rx(sp->s_mh, NULL, mp); in sfxge_gld_rx_post()
87 sfxge_gld_rx_push(sfxge_t *sp) in sfxge_gld_rx_push() argument
89 _NOTE(ARGUNUSED(sp)) in sfxge_gld_rx_push()
94 sfxge_phy_dfl_cap_test64(sfxge_t *sp, uint32_t field) in sfxge_phy_dfl_cap_test64() argument
96 return (sfxge_phy_cap_test(sp, EFX_PHY_CAP_DEFAULT, field, NULL) ? in sfxge_phy_dfl_cap_test64()
102 sfxge_phy_cur_cap_test64(sfxge_t *sp, uint32_t field) in sfxge_phy_cur_cap_test64() argument
104 return (sfxge_phy_cap_test(sp, EFX_PHY_CAP_CURRENT, field, NULL) ? in sfxge_phy_cur_cap_test64()
109 sfxge_phy_lp_cap_test64(sfxge_t *sp, uint32_t field) in sfxge_phy_lp_cap_test64() argument
111 return (sfxge_phy_lp_cap_test(sp, field) ? 1ull : 0ull); in sfxge_phy_lp_cap_test64()
117 sfxge_t *sp = arg; in sfxge_gld_getstat() local
118 efx_nic_t *enp = sp->s_enp; in sfxge_gld_getstat()
121 if (sp->s_mac.sm_state != SFXGE_MAC_STARTED) { in sfxge_gld_getstat()
130 sfxge_mac_link_speed_get(sp, &speed); in sfxge_gld_getstat()
138 sfxge_mac_link_duplex_get(sp, &duplex); in sfxge_gld_getstat()
161 *valp = sfxge_phy_dfl_cap_test64(sp, EFX_PHY_CAP_40000FDX); in sfxge_gld_getstat()
164 *valp = sfxge_phy_dfl_cap_test64(sp, EFX_PHY_CAP_10000FDX); in sfxge_gld_getstat()
167 *valp = sfxge_phy_dfl_cap_test64(sp, EFX_PHY_CAP_1000FDX); in sfxge_gld_getstat()
170 *valp = sfxge_phy_dfl_cap_test64(sp, EFX_PHY_CAP_1000HDX); in sfxge_gld_getstat()
173 *valp = sfxge_phy_dfl_cap_test64(sp, EFX_PHY_CAP_100FDX); in sfxge_gld_getstat()
176 *valp = sfxge_phy_dfl_cap_test64(sp, EFX_PHY_CAP_100HDX); in sfxge_gld_getstat()
179 *valp = sfxge_phy_dfl_cap_test64(sp, EFX_PHY_CAP_10FDX); in sfxge_gld_getstat()
182 *valp = sfxge_phy_dfl_cap_test64(sp, EFX_PHY_CAP_10HDX); in sfxge_gld_getstat()
185 *valp = sfxge_phy_dfl_cap_test64(sp, EFX_PHY_CAP_ASYM); in sfxge_gld_getstat()
188 *valp = sfxge_phy_dfl_cap_test64(sp, EFX_PHY_CAP_PAUSE); in sfxge_gld_getstat()
191 *valp = sfxge_phy_dfl_cap_test64(sp, EFX_PHY_CAP_AN); in sfxge_gld_getstat()
194 *valp = sfxge_phy_cur_cap_test64(sp, EFX_PHY_CAP_40000FDX); in sfxge_gld_getstat()
197 *valp = sfxge_phy_cur_cap_test64(sp, EFX_PHY_CAP_10000FDX); in sfxge_gld_getstat()
200 *valp = sfxge_phy_cur_cap_test64(sp, EFX_PHY_CAP_1000FDX); in sfxge_gld_getstat()
203 *valp = sfxge_phy_cur_cap_test64(sp, EFX_PHY_CAP_1000HDX); in sfxge_gld_getstat()
206 *valp = sfxge_phy_cur_cap_test64(sp, EFX_PHY_CAP_100FDX); in sfxge_gld_getstat()
209 *valp = sfxge_phy_cur_cap_test64(sp, EFX_PHY_CAP_100HDX); in sfxge_gld_getstat()
212 *valp = sfxge_phy_cur_cap_test64(sp, EFX_PHY_CAP_10FDX); in sfxge_gld_getstat()
215 *valp = sfxge_phy_cur_cap_test64(sp, EFX_PHY_CAP_10HDX); in sfxge_gld_getstat()
218 *valp = sfxge_phy_cur_cap_test64(sp, EFX_PHY_CAP_ASYM); in sfxge_gld_getstat()
221 *valp = sfxge_phy_cur_cap_test64(sp, EFX_PHY_CAP_PAUSE); in sfxge_gld_getstat()
224 *valp = sfxge_phy_cur_cap_test64(sp, EFX_PHY_CAP_AN); in sfxge_gld_getstat()
227 *valp = sfxge_phy_lp_cap_test64(sp, EFX_PHY_CAP_40000FDX); in sfxge_gld_getstat()
230 *valp = sfxge_phy_lp_cap_test64(sp, EFX_PHY_CAP_10000FDX); in sfxge_gld_getstat()
233 *valp = sfxge_phy_lp_cap_test64(sp, EFX_PHY_CAP_1000FDX); in sfxge_gld_getstat()
236 *valp = sfxge_phy_lp_cap_test64(sp, EFX_PHY_CAP_1000HDX); in sfxge_gld_getstat()
239 *valp = sfxge_phy_lp_cap_test64(sp, EFX_PHY_CAP_100FDX); in sfxge_gld_getstat()
242 *valp = sfxge_phy_lp_cap_test64(sp, EFX_PHY_CAP_100HDX); in sfxge_gld_getstat()
245 *valp = sfxge_phy_lp_cap_test64(sp, EFX_PHY_CAP_10FDX); in sfxge_gld_getstat()
248 *valp = sfxge_phy_lp_cap_test64(sp, EFX_PHY_CAP_10HDX); in sfxge_gld_getstat()
251 *valp = sfxge_phy_lp_cap_test64(sp, EFX_PHY_CAP_ASYM); in sfxge_gld_getstat()
254 *valp = sfxge_phy_lp_cap_test64(sp, EFX_PHY_CAP_PAUSE); in sfxge_gld_getstat()
257 *valp = sfxge_phy_lp_cap_test64(sp, EFX_PHY_CAP_AN); in sfxge_gld_getstat()
268 if ((rc = efx_phy_oui_get(sp->s_enp, &oui)) != 0) in sfxge_gld_getstat()
274 sfxge_mac_stat_get(sp, EFX_MAC_RX_MULTICST_PKTS, valp); in sfxge_gld_getstat()
278 sfxge_mac_stat_get(sp, EFX_MAC_RX_BRDCST_PKTS, valp); in sfxge_gld_getstat()
282 sfxge_mac_stat_get(sp, EFX_MAC_TX_MULTICST_PKTS, valp); in sfxge_gld_getstat()
286 sfxge_mac_stat_get(sp, EFX_MAC_TX_BRDCST_PKTS, valp); in sfxge_gld_getstat()
290 sfxge_mac_stat_get(sp, EFX_MAC_RX_ERRORS, valp); in sfxge_gld_getstat()
294 sfxge_mac_stat_get(sp, EFX_MAC_TX_ERRORS, valp); in sfxge_gld_getstat()
298 sfxge_mac_stat_get(sp, EFX_MAC_RX_OCTETS, valp); in sfxge_gld_getstat()
302 sfxge_mac_stat_get(sp, EFX_MAC_RX_PKTS, valp); in sfxge_gld_getstat()
306 sfxge_mac_stat_get(sp, EFX_MAC_TX_OCTETS, valp); in sfxge_gld_getstat()
310 sfxge_mac_stat_get(sp, EFX_MAC_TX_PKTS, valp); in sfxge_gld_getstat()
314 sfxge_mac_stat_get(sp, EFX_MAC_RX_DROP_EVENTS, valp); in sfxge_gld_getstat()
318 sfxge_mac_stat_get(sp, EFX_MAC_RX_FCS_ERRORS, valp); in sfxge_gld_getstat()
340 sfxge_t *sp = arg; in sfxge_gld_start() local
343 if ((rc = sfxge_start(sp, B_FALSE)) != 0) in sfxge_gld_start()
357 sfxge_t *sp = arg; in sfxge_gld_stop() local
359 sfxge_stop(sp); in sfxge_gld_stop()
365 sfxge_t *sp = arg; in sfxge_gld_setpromisc() local
367 return sfxge_mac_promisc_set(sp, in sfxge_gld_setpromisc()
374 sfxge_t *sp = arg; in sfxge_gld_multicst() local
378 if ((rc = sfxge_mac_multicst_add(sp, addr)) != 0) in sfxge_gld_multicst()
381 if ((rc = sfxge_mac_multicst_remove(sp, addr)) != 0) in sfxge_gld_multicst()
397 sfxge_t *sp = arg; in sfxge_gld_unicst() local
400 if ((rc = sfxge_mac_unicst_set(sp, (uint8_t *)addr)) != 0) in sfxge_gld_unicst()
414 sfxge_t *sp = arg; in sfxge_gld_ioctl() local
416 sfxge_ioctl(sp, wq, mp); in sfxge_gld_ioctl()
423 sfxge_t *sp = arg; in sfxge_gld_tx() local
436 if (sfxge_tx_packet_add(sp, mp) == ENOSPC) { in sfxge_gld_tx()
507 sfxge_gld_priv_prop_info(sfxge_t *sp, const char *name, in sfxge_gld_priv_prop_info() argument
520 (uint32_t)sp->s_intr.si_nalloc); in sfxge_gld_priv_prop_info()
529 0, efx_nic_cfg_get(sp->s_enp)->enc_evq_timer_max_us); in sfxge_gld_priv_prop_info()
552 sfxge_gld_priv_prop_get(sfxge_t *sp, const char *name, in sfxge_gld_priv_prop_get() argument
561 sfxge_rx_coalesce_mode_get(sp, &mode); in sfxge_gld_priv_prop_get()
570 if (sfxge_rx_scale_count_get(sp, &count) != 0) in sfxge_gld_priv_prop_get()
580 sfxge_ev_moderation_get(sp, &us); in sfxge_gld_priv_prop_get()
587 val = (long)sp->s_mon.sm_polling; in sfxge_gld_priv_prop_get()
593 val = (long)sp->s_mcdi_logging; in sfxge_gld_priv_prop_get()
614 sfxge_gld_priv_prop_set(sfxge_t *sp, const char *name, unsigned int size, in sfxge_gld_priv_prop_set() argument
625 if ((rc = sfxge_rx_coalesce_mode_set(sp, in sfxge_gld_priv_prop_set()
633 if ((rc = sfxge_rx_scale_count_set(sp, (unsigned int)val)) != 0) in sfxge_gld_priv_prop_set()
640 if ((rc = sfxge_ev_moderation_set(sp, (unsigned int) val)) != 0) in sfxge_gld_priv_prop_set()
647 sp->s_mon.sm_polling = (int)val; in sfxge_gld_priv_prop_set()
653 sp->s_mcdi_logging = (int)val; in sfxge_gld_priv_prop_set()
679 sfxge_gld_priv_prop_init(sfxge_t *sp) in sfxge_gld_priv_prop_init() argument
688 sp->s_mac_priv_props_alloc = SFXGE_N_NAMED_PROPS + 1; in sfxge_gld_priv_prop_init()
689 sp->s_mac_priv_props = kmem_zalloc(sizeof (sfxge_mac_priv_prop_t) * in sfxge_gld_priv_prop_init()
690 sp->s_mac_priv_props_alloc, in sfxge_gld_priv_prop_init()
698 mac_priv_props = sp->s_mac_priv_props; in sfxge_gld_priv_prop_init()
726 ASSERT3U((nprops + 1), ==, sp->s_mac_priv_props_alloc); in sfxge_gld_priv_prop_init()
733 sfxge_gld_priv_prop_fini(sfxge_t *sp) in sfxge_gld_priv_prop_fini() argument
738 mac_priv_props = sp->s_mac_priv_props; in sfxge_gld_priv_prop_fini()
745 kmem_free(sp->s_mac_priv_props, sizeof (sfxge_mac_priv_prop_t) * in sfxge_gld_priv_prop_fini()
746 sp->s_mac_priv_props_alloc); in sfxge_gld_priv_prop_fini()
747 sp->s_mac_priv_props = NULL; in sfxge_gld_priv_prop_fini()
755 sfxge_t *sp = arg; in sfxge_gld_getprop() local
822 sfxge_mac_link_duplex_get(sp, &duplex); in sfxge_gld_getprop()
847 sfxge_mac_link_speed_get(sp, &speed); in sfxge_gld_getprop()
856 sfxge_mac_link_check(sp, &up); in sfxge_gld_getprop()
865 *v8 = sfxge_phy_cap_test(sp, flag, EFX_PHY_CAP_AN, NULL); in sfxge_gld_getprop()
869 *v8 = sfxge_phy_cap_test(sp, flag, EFX_PHY_CAP_40000FDX, NULL); in sfxge_gld_getprop()
873 *v8 = sfxge_phy_cap_test(sp, flag, EFX_PHY_CAP_10000FDX, NULL); in sfxge_gld_getprop()
877 *v8 = sfxge_phy_cap_test(sp, flag, EFX_PHY_CAP_1000FDX, NULL); in sfxge_gld_getprop()
881 *v8 = sfxge_phy_cap_test(sp, flag, EFX_PHY_CAP_1000HDX, NULL); in sfxge_gld_getprop()
885 *v8 = sfxge_phy_cap_test(sp, flag, EFX_PHY_CAP_100FDX, NULL); in sfxge_gld_getprop()
889 *v8 = sfxge_phy_cap_test(sp, flag, EFX_PHY_CAP_100HDX, NULL); in sfxge_gld_getprop()
893 *v8 = sfxge_phy_cap_test(sp, flag, EFX_PHY_CAP_10FDX, NULL); in sfxge_gld_getprop()
897 *v8 = sfxge_phy_cap_test(sp, flag, EFX_PHY_CAP_10HDX, NULL); in sfxge_gld_getprop()
900 *((uint32_t *)valp) = (uint32_t)(sp->s_mtu); in sfxge_gld_getprop()
906 sfxge_mac_fcntl_get(sp, &fcntl); in sfxge_gld_getprop()
932 if ((rc = sfxge_gld_priv_prop_get(sp, name, size, valp)) != 0) in sfxge_gld_getprop()
959 sfxge_t *sp = arg; in sfxge_gld_setprop() local
1013 if ((rc = sfxge_phy_cap_set(sp, EFX_PHY_CAP_AN, v8)) != 0) in sfxge_gld_setprop()
1017 if ((rc = sfxge_phy_cap_set(sp, EFX_PHY_CAP_40000FDX, v8)) != 0) in sfxge_gld_setprop()
1021 if ((rc = sfxge_phy_cap_set(sp, EFX_PHY_CAP_10000FDX, v8)) != 0) in sfxge_gld_setprop()
1026 if ((rc = sfxge_phy_cap_set(sp, EFX_PHY_CAP_1000FDX, v8)) != 0) in sfxge_gld_setprop()
1031 if ((rc = sfxge_phy_cap_set(sp, EFX_PHY_CAP_1000HDX, v8)) != 0) in sfxge_gld_setprop()
1036 if ((rc = sfxge_phy_cap_set(sp, EFX_PHY_CAP_100FDX, v8)) != 0) in sfxge_gld_setprop()
1041 if ((rc = sfxge_phy_cap_set(sp, EFX_PHY_CAP_100HDX, v8)) != 0) in sfxge_gld_setprop()
1046 if ((rc = sfxge_phy_cap_set(sp, EFX_PHY_CAP_10FDX, v8)) != 0) in sfxge_gld_setprop()
1051 if ((rc = sfxge_phy_cap_set(sp, EFX_PHY_CAP_10HDX, v8)) != 0) in sfxge_gld_setprop()
1063 sp->s_mtu = mtu; in sfxge_gld_setprop()
1066 (void) sfxge_restart_dispatch(sp, DDI_SLEEP, SFXGE_HW_OK, in sfxge_gld_setprop()
1096 if ((rc = sfxge_mac_fcntl_set(sp, fcntl)) != 0) in sfxge_gld_setprop()
1102 if ((rc = sfxge_gld_priv_prop_set(sp, name, size, valp)) != 0) in sfxge_gld_setprop()
1135 sfxge_t *sp = arg; in sfxge_gld_propinfo() local
1156 sp->s_dip, DDI_PROP_DONTPASS, "mtu", ETHERMTU); in sfxge_gld_propinfo()
1161 sfxge_gld_priv_prop_info(sp, name, handle); in sfxge_gld_propinfo()
1202 cap_default = sfxge_phy_cap_test(sp, EFX_PHY_CAP_DEFAULT, in sfxge_gld_propinfo()
1213 sfxge_gld_register(sfxge_t *sp) in sfxge_gld_register() argument
1227 mrp->m_driver = sp; in sfxge_gld_register()
1228 mrp->m_dip = sp->s_dip; in sfxge_gld_register()
1231 mcp = &(sp->s_mc); in sfxge_gld_register()
1261 if ((rc = sfxge_mac_unicst_get(sp, SFXGE_UNICST_BIA, in sfxge_gld_register()
1266 mrp->m_max_sdu = sp->s_mtu; in sfxge_gld_register()
1272 mrp->m_priv_props = sp->s_mac_priv_props; in sfxge_gld_register()
1273 sfxge_gld_priv_prop_init(sp); in sfxge_gld_register()
1285 sp->s_mh = mh; in sfxge_gld_register()
1297 sfxge_gld_priv_prop_fini(sp); in sfxge_gld_register()
1300 bzero(&(sp->s_mc), sizeof (mac_callbacks_t)); in sfxge_gld_register()
1309 sfxge_gld_unregister(sfxge_t *sp) in sfxge_gld_unregister() argument
1311 mac_handle_t mh = sp->s_mh; in sfxge_gld_unregister()
1317 sp->s_mh = NULL; in sfxge_gld_unregister()
1320 sfxge_gld_priv_prop_fini(sp); in sfxge_gld_unregister()
1323 bzero(&(sp->s_mc), sizeof (mac_callbacks_t)); in sfxge_gld_unregister()