Lines Matching refs:mac_cb

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