Lines Matching refs:mac_drv

61 static void hns_gmac_enable(void *mac_drv, enum mac_commom_mode mode)  in hns_gmac_enable()  argument
63 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_enable()
76 static void hns_gmac_disable(void *mac_drv, enum mac_commom_mode mode) in hns_gmac_disable() argument
78 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_disable()
96 static void hns_gmac_get_en(void *mac_drv, u32 *rx, u32 *tx) in hns_gmac_get_en() argument
98 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_get_en()
106 static void hns_gmac_free(void *mac_drv) in hns_gmac_free() argument
108 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_free()
117 static void hns_gmac_set_tx_auto_pause_frames(void *mac_drv, u16 newval) in hns_gmac_set_tx_auto_pause_frames() argument
119 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_set_tx_auto_pause_frames()
125 static void hns_gmac_get_tx_auto_pause_frames(void *mac_drv, u16 *newval) in hns_gmac_get_tx_auto_pause_frames() argument
127 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_get_tx_auto_pause_frames()
133 static void hns_gmac_config_max_frame_length(void *mac_drv, u16 newval) in hns_gmac_config_max_frame_length() argument
135 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_config_max_frame_length()
144 static void hns_gmac_config_pad_and_crc(void *mac_drv, u8 newval) in hns_gmac_config_pad_and_crc() argument
147 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_config_pad_and_crc()
155 static void hns_gmac_config_an_mode(void *mac_drv, u8 newval) in hns_gmac_config_an_mode() argument
157 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_config_an_mode()
163 static void hns_gmac_tx_loop_pkt_dis(void *mac_drv) in hns_gmac_tx_loop_pkt_dis() argument
166 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_tx_loop_pkt_dis()
174 static void hns_gmac_get_duplex_type(void *mac_drv, in hns_gmac_get_duplex_type() argument
177 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_get_duplex_type()
183 static void hns_gmac_get_port_mode(void *mac_drv, enum hns_port_mode *port_mode) in hns_gmac_get_port_mode() argument
185 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_get_port_mode()
191 static void hns_gmac_port_mode_get(void *mac_drv, in hns_gmac_port_mode_get() argument
196 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_port_mode_get()
222 static void hns_gmac_pause_frm_cfg(void *mac_drv, u32 rx_pause_en, in hns_gmac_pause_frm_cfg() argument
226 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_pause_frm_cfg()
234 static void hns_gmac_get_pausefrm_cfg(void *mac_drv, u32 *rx_pause_en, in hns_gmac_get_pausefrm_cfg() argument
238 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_get_pausefrm_cfg()
246 static bool hns_gmac_need_adjust_link(void *mac_drv, enum mac_speed speed, in hns_gmac_need_adjust_link() argument
249 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_need_adjust_link()
256 static int hns_gmac_adjust_link(void *mac_drv, enum mac_speed speed, in hns_gmac_adjust_link() argument
259 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_adjust_link()
290 static void hns_gmac_set_uc_match(void *mac_drv, u16 en) in hns_gmac_set_uc_match() argument
292 struct mac_driver *drv = mac_drv; in hns_gmac_set_uc_match()
300 static void hns_gmac_set_promisc(void *mac_drv, u8 en) in hns_gmac_set_promisc() argument
302 struct mac_driver *drv = mac_drv; in hns_gmac_set_promisc()
305 hns_gmac_set_uc_match(mac_drv, en); in hns_gmac_set_promisc()
308 static int hns_gmac_wait_fifo_clean(void *mac_drv) in hns_gmac_wait_fifo_clean() argument
310 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_wait_fifo_clean()
332 static void hns_gmac_init(void *mac_drv) in hns_gmac_init() argument
335 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_init()
345 hns_gmac_disable(mac_drv, MAC_COMM_MODE_RX_AND_TX); in hns_gmac_init()
346 hns_gmac_tx_loop_pkt_dis(mac_drv); in hns_gmac_init()
348 hns_gmac_set_uc_match(mac_drv, 0); in hns_gmac_init()
350 hns_gmac_config_pad_and_crc(mac_drv, 1); in hns_gmac_init()
362 static void hns_gmac_update_stats(void *mac_drv) in hns_gmac_update_stats() argument
365 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_update_stats()
453 static void hns_gmac_set_mac_addr(void *mac_drv, const char *mac_addr) in hns_gmac_set_mac_addr() argument
455 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_set_mac_addr()
470 static int hns_gmac_config_loopback(void *mac_drv, enum hnae_loop loop_mode, in hns_gmac_config_loopback() argument
473 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_config_loopback()
488 static void hns_gmac_get_info(void *mac_drv, struct mac_info *mac_info) in hns_gmac_get_info() argument
499 hns_gmac_port_mode_get(mac_drv, &port_mode); in hns_gmac_get_info()
503 hns_gmac_get_tx_auto_pause_frames(mac_drv, &fc_tx_timer); in hns_gmac_get_info()
506 hns_gmac_get_en(mac_drv, &rx, &tx); in hns_gmac_get_info()
509 hns_gmac_get_duplex_type(mac_drv, &duplex); in hns_gmac_get_info()
512 hns_gmac_get_port_mode(mac_drv, &speed); in hns_gmac_get_info()
528 hns_gmac_get_pausefrm_cfg(mac_drv, &rx_pause, &tx_pause); in hns_gmac_get_info()
533 static void hns_gmac_autoneg_stat(void *mac_drv, u32 *enable) in hns_gmac_autoneg_stat() argument
535 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_autoneg_stat()
541 static void hns_gmac_get_link_status(void *mac_drv, u32 *link_stat) in hns_gmac_get_link_status() argument
543 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_get_link_status()
549 static void hns_gmac_get_regs(void *mac_drv, void *data) in hns_gmac_get_regs() argument
553 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_get_regs()
657 static void hns_gmac_get_stats(void *mac_drv, u64 *data) in hns_gmac_get_stats() argument
661 struct mac_driver *drv = (struct mac_driver *)mac_drv; in hns_gmac_get_stats()
699 struct mac_driver *mac_drv; in hns_gmac_config() local
701 mac_drv = devm_kzalloc(mac_cb->dev, sizeof(*mac_drv), GFP_KERNEL); in hns_gmac_config()
702 if (!mac_drv) in hns_gmac_config()
705 mac_drv->mac_init = hns_gmac_init; in hns_gmac_config()
706 mac_drv->mac_enable = hns_gmac_enable; in hns_gmac_config()
707 mac_drv->mac_disable = hns_gmac_disable; in hns_gmac_config()
708 mac_drv->mac_free = hns_gmac_free; in hns_gmac_config()
709 mac_drv->adjust_link = hns_gmac_adjust_link; in hns_gmac_config()
710 mac_drv->need_adjust_link = hns_gmac_need_adjust_link; in hns_gmac_config()
711 mac_drv->set_tx_auto_pause_frames = hns_gmac_set_tx_auto_pause_frames; in hns_gmac_config()
712 mac_drv->config_max_frame_length = hns_gmac_config_max_frame_length; in hns_gmac_config()
713 mac_drv->mac_pausefrm_cfg = hns_gmac_pause_frm_cfg; in hns_gmac_config()
715 mac_drv->mac_id = mac_param->mac_id; in hns_gmac_config()
716 mac_drv->mac_mode = mac_param->mac_mode; in hns_gmac_config()
717 mac_drv->io_base = mac_param->vaddr; in hns_gmac_config()
718 mac_drv->dev = mac_param->dev; in hns_gmac_config()
719 mac_drv->mac_cb = mac_cb; in hns_gmac_config()
721 mac_drv->set_mac_addr = hns_gmac_set_mac_addr; in hns_gmac_config()
722 mac_drv->set_an_mode = hns_gmac_config_an_mode; in hns_gmac_config()
723 mac_drv->config_loopback = hns_gmac_config_loopback; in hns_gmac_config()
724 mac_drv->config_pad_and_crc = hns_gmac_config_pad_and_crc; in hns_gmac_config()
725 mac_drv->get_info = hns_gmac_get_info; in hns_gmac_config()
726 mac_drv->autoneg_stat = hns_gmac_autoneg_stat; in hns_gmac_config()
727 mac_drv->get_pause_enable = hns_gmac_get_pausefrm_cfg; in hns_gmac_config()
728 mac_drv->get_link_status = hns_gmac_get_link_status; in hns_gmac_config()
729 mac_drv->get_regs = hns_gmac_get_regs; in hns_gmac_config()
730 mac_drv->get_regs_count = hns_gmac_get_regs_count; in hns_gmac_config()
731 mac_drv->get_ethtool_stats = hns_gmac_get_stats; in hns_gmac_config()
732 mac_drv->get_sset_count = hns_gmac_get_sset_count; in hns_gmac_config()
733 mac_drv->get_strings = hns_gmac_get_strings; in hns_gmac_config()
734 mac_drv->update_stats = hns_gmac_update_stats; in hns_gmac_config()
735 mac_drv->set_promiscuous = hns_gmac_set_promisc; in hns_gmac_config()
736 mac_drv->wait_fifo_clean = hns_gmac_wait_fifo_clean; in hns_gmac_config()
738 return (void *)mac_drv; in hns_gmac_config()