Lines Matching refs:dsaf_dev

103 		ret = mac_cb->dsaf_dev->misc_op->get_sfp_prsnt(mac_cb,  in hns_mac_get_link_status()
178 mac_cb->dsaf_dev->ae_dev.name, in hns_mac_adjust_link()
198 if (mac_cb->dsaf_dev->dsaf_mode <= DSAF_MODE_ENABLE) { in hns_mac_get_inner_port_num()
202 mac_cb->dsaf_dev->ae_dev.name, in hns_mac_get_inner_port_num()
206 } else if (mac_cb->dsaf_dev->dsaf_mode < DSAF_MODE_MAX) { in hns_mac_get_inner_port_num()
210 mac_cb->dsaf_dev->ae_dev.name, in hns_mac_get_inner_port_num()
216 mac_cb->dsaf_dev->ae_dev.name, mac_cb->mac_id); in hns_mac_get_inner_port_num()
220 if (vmid >= mac_cb->dsaf_dev->rcb_common[0]->max_vfn) { in hns_mac_get_inner_port_num()
222 mac_cb->dsaf_dev->ae_dev.name, mac_cb->mac_id, vmid); in hns_mac_get_inner_port_num()
226 q_num_per_vf = mac_cb->dsaf_dev->rcb_common[0]->max_q_per_vf; in hns_mac_get_inner_port_num()
227 vf_num_per_port = mac_cb->dsaf_dev->rcb_common[0]->max_vfn; in hns_mac_get_inner_port_num()
232 switch (mac_cb->dsaf_dev->dsaf_mode) { in hns_mac_get_inner_port_num()
255 mac_cb->dsaf_dev->ae_dev.name, mac_cb->mac_id); in hns_mac_get_inner_port_num()
276 struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev; in hns_mac_change_vf_addr() local
281 if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) { in hns_mac_change_vf_addr()
293 ret = hns_dsaf_del_mac_entry(dsaf_dev, in hns_mac_change_vf_addr()
301 ret = hns_dsaf_set_mac_uc_entry(dsaf_dev, &mac_entry); in hns_mac_change_vf_addr()
317 struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev; in hns_mac_add_uc_addr() local
321 if (HNS_DSAF_IS_DEBUG(dsaf_dev)) in hns_mac_add_uc_addr()
331 return hns_dsaf_set_mac_uc_entry(dsaf_dev, &mac_entry); in hns_mac_add_uc_addr()
337 struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev; in hns_mac_rm_uc_addr() local
341 if (HNS_DSAF_IS_DEBUG(dsaf_dev)) in hns_mac_rm_uc_addr()
351 return hns_dsaf_rm_mac_addr(dsaf_dev, &mac_entry); in hns_mac_rm_uc_addr()
358 struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev; in hns_mac_set_multi() local
361 if (!HNS_DSAF_IS_DEBUG(dsaf_dev) && addr) { in hns_mac_set_multi()
368 ret = hns_dsaf_del_mac_mc_port(dsaf_dev, &mac_entry); in hns_mac_set_multi()
370 ret = hns_dsaf_add_mac_mc_port(dsaf_dev, &mac_entry); in hns_mac_set_multi()
372 dev_err(dsaf_dev->dev, in hns_mac_set_multi()
374 mac_cb->dsaf_dev->ae_dev.name, in hns_mac_set_multi()
385 struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev; in hns_mac_clr_multicast() local
392 return hns_dsaf_clr_mac_mc_port(dsaf_dev, mac_cb->mac_id, port_num); in hns_mac_clr_multicast()
417 struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev; in hns_mac_port_config_bc_en() local
424 if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) { in hns_mac_port_config_bc_en()
431 ret = hns_dsaf_del_mac_mc_port(dsaf_dev, &mac_entry); in hns_mac_port_config_bc_en()
433 ret = hns_dsaf_add_mac_mc_port(dsaf_dev, &mac_entry); in hns_mac_port_config_bc_en()
450 struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev; in hns_mac_vm_config_bc_en() local
460 if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) { in hns_mac_vm_config_bc_en()
470 ret = hns_dsaf_del_mac_mc_port(dsaf_dev, &mac_entry); in hns_mac_vm_config_bc_en()
472 ret = hns_dsaf_add_mac_mc_port(dsaf_dev, &mac_entry); in hns_mac_vm_config_bc_en()
492 bool is_ver1 = AE_IS_VER1(mac_cb->dsaf_dev->dsaf_ver); in hns_mac_reset()
569 mac_cb->dsaf_dev->misc_op->cpld_reset_led(mac_cb); in hns_mac_stop()
638 bool is_ver1 = AE_IS_VER1(mac_cb->dsaf_dev->dsaf_ver); in hns_mac_set_pauseparam()
998 hns_mac_get_vaddr(struct dsaf_device *dsaf_dev, in hns_mac_get_vaddr() argument
1001 u8 __iomem *base = dsaf_dev->io_base; in hns_mac_get_vaddr()
1008 return dsaf_dev->ppe_base + 0x1000; in hns_mac_get_vaddr()
1018 hns_mac_get_cfg(struct dsaf_device *dsaf_dev, struct hns_mac_cb *mac_cb) in hns_mac_get_cfg() argument
1023 mac_cb->dsaf_dev = dsaf_dev; in hns_mac_get_cfg()
1024 mac_cb->dev = dsaf_dev->dev; in hns_mac_get_cfg()
1026 mac_cb->sys_ctl_vaddr = dsaf_dev->sc_base; in hns_mac_get_cfg()
1027 mac_cb->serdes_vaddr = dsaf_dev->sds_base; in hns_mac_get_cfg()
1033 if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) in hns_mac_get_cfg()
1038 mac_cb->phy_if = dsaf_dev->misc_op->get_phy_if(mac_cb); in hns_mac_get_cfg()
1042 dev_err(dsaf_dev->dev, in hns_mac_get_cfg()
1053 mac_cb->dsaf_dev->misc_op->cpld_reset_led(mac_cb); in hns_mac_get_cfg()
1054 mac_cb->vaddr = hns_mac_get_vaddr(dsaf_dev, mac_cb, mac_mode_idx); in hns_mac_get_cfg()
1059 static int hns_mac_get_max_port_num(struct dsaf_device *dsaf_dev) in hns_mac_get_max_port_num() argument
1061 if (HNS_DSAF_IS_DEBUG(dsaf_dev)) in hns_mac_get_max_port_num()
1086 int hns_mac_init(struct dsaf_device *dsaf_dev) in hns_mac_init() argument
1091 int max_port_num = hns_mac_get_max_port_num(dsaf_dev); in hns_mac_init()
1095 device_for_each_child_node(dsaf_dev->dev, child) { in hns_mac_init()
1099 dev_err(dsaf_dev->dev, in hns_mac_init()
1105 dev_err(dsaf_dev->dev, in hns_mac_init()
1109 mac_cb = devm_kzalloc(dsaf_dev->dev, sizeof(*mac_cb), in hns_mac_init()
1117 dsaf_dev->mac_cb[port_id] = mac_cb; in hns_mac_init()
1126 mac_cb = devm_kzalloc(dsaf_dev->dev, sizeof(*mac_cb), in hns_mac_init()
1132 dsaf_dev->mac_cb[port_id] = mac_cb; in hns_mac_init()
1138 mac_cb = dsaf_dev->mac_cb[port_id]; in hns_mac_init()
1142 ret = hns_mac_get_cfg(dsaf_dev, mac_cb); in hns_mac_init()
1154 void hns_mac_uninit(struct dsaf_device *dsaf_dev) in hns_mac_uninit() argument
1157 int max_port_num = hns_mac_get_max_port_num(dsaf_dev); in hns_mac_uninit()
1160 if (!dsaf_dev->mac_cb[i]) in hns_mac_uninit()
1163 dsaf_dev->misc_op->cpld_reset_led(dsaf_dev->mac_cb[i]); in hns_mac_uninit()
1164 hns_mac_remove_phydev(dsaf_dev->mac_cb[i]); in hns_mac_uninit()
1165 dsaf_dev->mac_cb[i] = NULL; in hns_mac_uninit()
1216 hns_dsaf_set_promisc_tcam(mac_cb->dsaf_dev, mac_cb->mac_id, !!en); in hns_mac_set_promisc()
1249 mac_cb->dsaf_dev->misc_op->cpld_set_led(mac_cb, (int)mac_cb->link, in hns_set_led_opt()
1259 return mac_cb->dsaf_dev->misc_op->cpld_set_led_id(mac_cb, status); in hns_cpld_led_set_id()