Lines Matching refs:mac_cb
20 return vf_cb->mac_cb; in hns_get_mac_cb()
122 vf_cb->mac_cb = dsaf_dev->mac_cb[port_id]; in hns_ae_get_handle()
124 ae_handle->phy_if = vf_cb->mac_cb->phy_if; in hns_ae_get_handle()
125 ae_handle->phy_dev = vf_cb->mac_cb->phy_dev; in hns_ae_get_handle()
126 ae_handle->if_support = vf_cb->mac_cb->if_support; in hns_ae_get_handle()
127 ae_handle->port_type = vf_cb->mac_cb->mac_type; in hns_ae_get_handle()
128 ae_handle->media_type = vf_cb->mac_cb->media_type; in hns_ae_get_handle()
176 ret = hns_mac_wait_fifo_clean(vf_cb->mac_cb); in hns_ae_wait_flow_down()
205 if (vf_cb->mac_cb->mac_type == HNAE_PORT_SERVICE) in hns_ae_fini_queue()
212 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_set_mac_address() local
219 ret = hns_mac_change_vf_addr(mac_cb, handle->vf_id, p); in hns_ae_set_mac_address()
232 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_add_uc_address() local
234 if (mac_cb->mac_type != HNAE_PORT_SERVICE) in hns_ae_add_uc_address()
237 return hns_mac_add_uc_addr(mac_cb, handle->vf_id, addr); in hns_ae_add_uc_address()
243 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_rm_uc_address() local
245 if (mac_cb->mac_type != HNAE_PORT_SERVICE) in hns_ae_rm_uc_address()
248 return hns_mac_rm_uc_addr(mac_cb, handle->vf_id, addr); in hns_ae_rm_uc_address()
255 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_set_multicast_one() local
258 assert(mac_cb); in hns_ae_set_multicast_one()
260 if (mac_cb->mac_type != HNAE_PORT_SERVICE) in hns_ae_set_multicast_one()
263 ret = hns_mac_set_multi(mac_cb, mac_cb->mac_id, mac_addr, true); in hns_ae_set_multicast_one()
267 mac_addr, mac_cb->mac_id, ret); in hns_ae_set_multicast_one()
271 ret = hns_mac_get_inner_port_num(mac_cb, handle->vf_id, &port_num); in hns_ae_set_multicast_one()
275 ret = hns_mac_set_multi(mac_cb, port_num, mac_addr, true); in hns_ae_set_multicast_one()
286 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_clr_multicast() local
288 if (mac_cb->mac_type != HNAE_PORT_SERVICE) in hns_ae_clr_multicast()
291 return hns_mac_clr_multicast(mac_cb, handle->vf_id); in hns_ae_clr_multicast()
296 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_set_mtu() local
302 if (!AE_IS_VER1(mac_cb->dsaf_dev->dsaf_ver)) { in hns_ae_set_mtu()
308 rx_buf_size = mac_cb->dsaf_dev->buf_size; in hns_ae_set_mtu()
311 ret = hns_mac_set_mtu(mac_cb, new_mtu, rx_buf_size); in hns_ae_set_mtu()
336 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_start() local
338 ret = hns_mac_vm_config_bc_en(mac_cb, 0, true); in hns_ae_start()
343 if (AE_IS_VER1(mac_cb->dsaf_dev->dsaf_ver)) in hns_ae_start()
353 hns_mac_start(mac_cb); in hns_ae_start()
360 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_stop() local
367 hns_mac_stop(mac_cb); in hns_ae_stop()
376 (void)hns_mac_vm_config_bc_en(mac_cb, 0, false); in hns_ae_stop()
383 if (vf_cb->mac_cb->mac_type == HNAE_PORT_DEBUG) { in hns_ae_reset()
384 hns_mac_reset(vf_cb->mac_cb); in hns_ae_reset()
416 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_get_link_status() local
418 hns_mac_get_link_status(mac_cb, &link_status); in hns_ae_get_link_status()
426 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_get_mac_info() local
428 return hns_mac_get_port_info(mac_cb, auto_neg, speed, duplex); in hns_ae_get_mac_info()
434 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_need_adjust_link() local
436 return hns_mac_need_adjust_link(mac_cb, speed, duplex); in hns_ae_need_adjust_link()
442 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_adjust_link() local
444 switch (mac_cb->dsaf_dev->dsaf_ver) { in hns_ae_adjust_link()
446 hns_mac_adjust_link(mac_cb, speed, duplex); in hns_ae_adjust_link()
451 hns_mac_disable(mac_cb, MAC_COMM_MODE_RX); in hns_ae_adjust_link()
453 hns_mac_enable(mac_cb, MAC_COMM_MODE_RX); in hns_ae_adjust_link()
457 hns_mac_adjust_link(mac_cb, speed, duplex); in hns_ae_adjust_link()
458 hns_mac_enable(mac_cb, MAC_COMM_MODE_RX); in hns_ae_adjust_link()
475 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_get_pauseparam() local
476 struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev; in hns_ae_get_pauseparam()
478 hns_mac_get_autoneg(mac_cb, auto_neg); in hns_ae_get_pauseparam()
480 hns_mac_get_pauseparam(mac_cb, rx_en, tx_en); in hns_ae_get_pauseparam()
484 hns_dsaf_get_rx_mac_pause_en(dsaf_dev, mac_cb->mac_id, rx_en); in hns_ae_get_pauseparam()
489 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_set_promisc_mode() local
492 hns_mac_set_promisc(mac_cb, (u8)!!en); in hns_ae_set_promisc_mode()
498 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_set_pauseparam() local
499 struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev; in hns_ae_set_pauseparam()
502 ret = hns_mac_set_autoneg(mac_cb, autoneg); in hns_ae_set_pauseparam()
509 mac_cb->mac_id, rx_en); in hns_ae_set_pauseparam()
514 return hns_mac_set_pauseparam(mac_cb, rx_en, tx_en); in hns_ae_set_pauseparam()
624 struct hns_mac_cb *mac_cb; in hns_ae_update_stats() local
637 mac_cb = hns_get_mac_cb(handle); in hns_ae_update_stats()
658 if (mac_cb->mac_type == HNAE_PORT_SERVICE) { in hns_ae_update_stats()
676 hns_mac_update_stats(mac_cb); in hns_ae_update_stats()
677 rx_errors += mac_cb->hw_stats.rx_fifo_overrun_err; in hns_ae_update_stats()
679 tx_errors += mac_cb->hw_stats.tx_bad_pkts in hns_ae_update_stats()
680 + mac_cb->hw_stats.tx_fragment_err in hns_ae_update_stats()
681 + mac_cb->hw_stats.tx_jabber_err in hns_ae_update_stats()
682 + mac_cb->hw_stats.tx_underrun_err in hns_ae_update_stats()
683 + mac_cb->hw_stats.tx_crc_err; in hns_ae_update_stats()
694 net_stats->rx_crc_errors = mac_cb->hw_stats.rx_fcs_err; in hns_ae_update_stats()
695 net_stats->rx_frame_errors = mac_cb->hw_stats.rx_align_err; in hns_ae_update_stats()
696 net_stats->rx_fifo_errors = mac_cb->hw_stats.rx_fifo_overrun_err; in hns_ae_update_stats()
697 net_stats->rx_length_errors = mac_cb->hw_stats.rx_len_err; in hns_ae_update_stats()
698 net_stats->multicast = mac_cb->hw_stats.rx_mc_pkts; in hns_ae_update_stats()
704 struct hns_mac_cb *mac_cb; in hns_ae_get_stats() local
715 mac_cb = hns_get_mac_cb(handle); in hns_ae_get_stats()
726 hns_mac_get_stats(mac_cb, p); in hns_ae_get_stats()
727 p += hns_mac_get_sset_count(mac_cb, (int)ETH_SS_STATS); in hns_ae_get_stats()
729 if (mac_cb->mac_type == HNAE_PORT_SERVICE) in hns_ae_get_stats()
738 struct hns_mac_cb *mac_cb; in hns_ae_get_strings() local
748 mac_cb = hns_get_mac_cb(handle); in hns_ae_get_strings()
759 hns_mac_get_strings(mac_cb, stringset, p); in hns_ae_get_strings()
760 p += ETH_GSTRING_LEN * hns_mac_get_sset_count(mac_cb, stringset); in hns_ae_get_strings()
762 if (mac_cb->mac_type == HNAE_PORT_SERVICE) in hns_ae_get_strings()
769 struct hns_mac_cb *mac_cb; in hns_ae_get_sset_count() local
774 mac_cb = hns_get_mac_cb(handle); in hns_ae_get_sset_count()
778 sset_count += hns_mac_get_sset_count(mac_cb, stringset); in hns_ae_get_sset_count()
780 if (mac_cb->mac_type == HNAE_PORT_SERVICE) in hns_ae_get_sset_count()
791 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_config_loopback() local
792 struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev; in hns_ae_config_loopback()
799 ret = dsaf_dev->misc_op->cfg_serdes_loopback(vf_cb->mac_cb, in hns_ae_config_loopback()
803 ret = hns_mac_config_mac_loopback(vf_cb->mac_cb, loop, en); in hns_ae_config_loopback()
814 struct hns_mac_cb *mac_cb; in hns_ae_update_led_status() local
817 mac_cb = hns_get_mac_cb(handle); in hns_ae_update_led_status()
818 if (mac_cb->media_type != HNAE_MEDIA_TYPE_FIBER) in hns_ae_update_led_status()
821 hns_set_led_opt(mac_cb); in hns_ae_update_led_status()
827 struct hns_mac_cb *mac_cb; in hns_ae_cpld_set_led_id() local
831 mac_cb = hns_get_mac_cb(handle); in hns_ae_cpld_set_led_id()
833 return hns_cpld_led_set_id(mac_cb, status); in hns_ae_cpld_set_led_id()
854 hns_mac_get_regs(vf_cb->mac_cb, p); in hns_ae_get_regs()
855 p += hns_mac_get_regs_count(vf_cb->mac_cb); in hns_ae_get_regs()
857 if (vf_cb->mac_cb->mac_type == HNAE_PORT_SERVICE) in hns_ae_get_regs()
869 total_num += hns_mac_get_regs_count(vf_cb->mac_cb); in hns_ae_get_regs_len()
871 if (vf_cb->mac_cb->mac_type == HNAE_PORT_SERVICE) in hns_ae_get_regs_len()