/Linux-v4.19/drivers/net/ethernet/hisilicon/hns/ |
D | hns_dsaf_main.c | 45 static int hns_dsaf_get_cfg(struct dsaf_device *dsaf_dev) in hns_dsaf_get_cfg() argument 55 struct device_node *np = dsaf_dev->dev->of_node, *np_temp; in hns_dsaf_get_cfg() 56 struct platform_device *pdev = to_platform_device(dsaf_dev->dev); in hns_dsaf_get_cfg() 58 if (dev_of_node(dsaf_dev->dev)) { in hns_dsaf_get_cfg() 60 dsaf_dev->dsaf_ver = AE_VERSION_1; in hns_dsaf_get_cfg() 62 dsaf_dev->dsaf_ver = AE_VERSION_2; in hns_dsaf_get_cfg() 63 } else if (is_acpi_node(dsaf_dev->dev->fwnode)) { in hns_dsaf_get_cfg() 65 dsaf_dev->dsaf_ver = AE_VERSION_1; in hns_dsaf_get_cfg() 67 dsaf_dev->dsaf_ver = AE_VERSION_2; in hns_dsaf_get_cfg() 71 dev_err(dsaf_dev->dev, "cannot get cfg data from of or acpi\n"); in hns_dsaf_get_cfg() [all …]
|
D | hns_dsaf_misc.c | 37 static void dsaf_write_sub(struct dsaf_device *dsaf_dev, u32 reg, u32 val) in dsaf_write_sub() argument 39 if (dsaf_dev->sub_ctrl) in dsaf_write_sub() 40 dsaf_write_syscon(dsaf_dev->sub_ctrl, reg, val); in dsaf_write_sub() 42 dsaf_write_reg(dsaf_dev->sc_base, reg, val); in dsaf_write_sub() 45 static u32 dsaf_read_sub(struct dsaf_device *dsaf_dev, u32 reg) in dsaf_read_sub() argument 50 if (dsaf_dev->sub_ctrl) { in dsaf_read_sub() 51 err = dsaf_read_syscon(dsaf_dev->sub_ctrl, reg, &ret); in dsaf_read_sub() 53 dev_err(dsaf_dev->dev, "dsaf_read_syscon error %d!\n", in dsaf_read_sub() 56 ret = dsaf_read_reg(dsaf_dev->sc_base, reg); in dsaf_read_sub() 254 static void hns_dsaf_acpi_srst_by_port(struct dsaf_device *dsaf_dev, u8 op_type, in hns_dsaf_acpi_srst_by_port() argument [all …]
|
D | hns_dsaf_main.h | 216 struct dsaf_device *dsaf_dev; member 309 void (*dsaf_reset)(struct dsaf_device *dsaf_dev, bool dereset); 310 void (*xge_srst)(struct dsaf_device *dsaf_dev, u32 port, bool dereset); 311 void (*ge_srst)(struct dsaf_device *dsaf_dev, u32 port, bool dereset); 312 void (*ppe_srst)(struct dsaf_device *dsaf_dev, u32 port, bool dereset); 313 void (*ppe_comm_srst)(struct dsaf_device *dsaf_dev, bool dereset); 314 void (*hns_dsaf_srst_chns)(struct dsaf_device *dsaf_dev, u32 msk, 316 void (*hns_dsaf_roce_srst)(struct dsaf_device *dsaf_dev, bool dereset); 357 static inline void *hns_dsaf_dev_priv(const struct dsaf_device *dsaf_dev) in hns_dsaf_dev_priv() argument 359 return (void *)((u8 *)dsaf_dev + sizeof(*dsaf_dev)); in hns_dsaf_dev_priv() [all …]
|
D | hns_dsaf_mac.c | 86 ret = mac_cb->dsaf_dev->misc_op->get_sfp_prsnt(mac_cb, in hns_mac_get_link_status() 153 mac_cb->dsaf_dev->ae_dev.name, in hns_mac_adjust_link() 173 if (mac_cb->dsaf_dev->dsaf_mode <= DSAF_MODE_ENABLE) { in hns_mac_get_inner_port_num() 177 mac_cb->dsaf_dev->ae_dev.name, in hns_mac_get_inner_port_num() 181 } else if (mac_cb->dsaf_dev->dsaf_mode < DSAF_MODE_MAX) { in hns_mac_get_inner_port_num() 185 mac_cb->dsaf_dev->ae_dev.name, in hns_mac_get_inner_port_num() 191 mac_cb->dsaf_dev->ae_dev.name, mac_cb->mac_id); in hns_mac_get_inner_port_num() 195 if (vmid >= mac_cb->dsaf_dev->rcb_common[0]->max_vfn) { in hns_mac_get_inner_port_num() 197 mac_cb->dsaf_dev->ae_dev.name, mac_cb->mac_id, vmid); in hns_mac_get_inner_port_num() 201 q_num_per_vf = mac_cb->dsaf_dev->rcb_common[0]->max_q_per_vf; in hns_mac_get_inner_port_num() [all …]
|
D | hns_dsaf_ppe.c | 67 return ppe_common->dsaf_dev->ppe_base + PPE_COMMON_REG_OFFSET; in hns_ppe_common_get_ioaddr() 76 static int hns_ppe_common_get_cfg(struct dsaf_device *dsaf_dev, int comm_index) in hns_ppe_common_get_cfg() argument 81 if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) in hns_ppe_common_get_cfg() 86 ppe_common = devm_kzalloc(dsaf_dev->dev, sizeof(*ppe_common) + in hns_ppe_common_get_cfg() 92 ppe_common->dsaf_dev = dsaf_dev; in hns_ppe_common_get_cfg() 94 if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) in hns_ppe_common_get_cfg() 98 ppe_common->dev = dsaf_dev->dev; in hns_ppe_common_get_cfg() 102 dsaf_dev->ppe_common[comm_index] = ppe_common; in hns_ppe_common_get_cfg() 108 hns_ppe_common_free_cfg(struct dsaf_device *dsaf_dev, u32 comm_index) in hns_ppe_common_free_cfg() argument 110 dsaf_dev->ppe_common[comm_index] = NULL; in hns_ppe_common_free_cfg() [all …]
|
D | hns_ae_adapt.c | 40 ppe_comm = vf_cb->dsaf_dev->ppe_common[0]; in hns_get_ppe_cb() 47 struct dsaf_device *dsaf_dev, int port) in hns_ae_get_q_num_per_vf() argument 49 return dsaf_dev->rcb_common[0]->max_q_per_vf; in hns_ae_get_q_num_per_vf() 53 struct dsaf_device *dsaf_dev, int port) in hns_ae_get_vf_num_per_port() argument 55 return dsaf_dev->rcb_common[0]->max_vfn; in hns_ae_get_vf_num_per_port() 59 struct dsaf_device *dsaf_dev, int port) in hns_ae_get_base_ring_pair() argument 61 struct rcb_common_cb *rcb_comm = dsaf_dev->rcb_common[0]; in hns_ae_get_base_ring_pair() 79 struct dsaf_device *dsaf_dev; in hns_ae_get_handle() local 84 dsaf_dev = hns_ae_get_dsaf_dev(dev); in hns_ae_get_handle() 86 ring_pair_cb = hns_ae_get_base_ring_pair(dsaf_dev, port_id); in hns_ae_get_handle() [all …]
|
D | hns_dsaf_rcb.c | 310 if (AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver)) { in hns_rcb_set_port_timeout() 313 } else if (!HNS_DSAF_IS_DEBUG(rcb_common->dsaf_dev)) { in hns_rcb_set_port_timeout() 335 if (!HNS_DSAF_IS_DEBUG(rcb_common->dsaf_dev)) in hns_rcb_common_get_port_num() 385 dev_err(rcb_common->dsaf_dev->dev, in hns_rcb_common_init_hw() 394 if (!AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver) && in hns_rcb_common_init_hw() 395 !HNS_DSAF_IS_DEBUG(rcb_common->dsaf_dev)) in hns_rcb_common_init_hw() 405 if (AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver)) { in hns_rcb_common_init_hw() 453 is_ver1 = AE_IS_VER1(ring_pair_cb->rcb_common->dsaf_dev->dsaf_ver); in hns_rcb_ring_get_cfg() 469 desc_num = rcb_common->dsaf_dev->desc_num; in hns_rcb_ring_get_cfg() 504 bool is_ver1 = AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver); in hns_rcb_get_base_irq_idx() [all …]
|
D | hns_dsaf_ppe.h | 91 struct dsaf_device *dsaf_dev; member 104 int hns_ppe_init(struct dsaf_device *dsaf_dev); 106 void hns_ppe_uninit(struct dsaf_device *dsaf_dev); 108 void hns_ppe_reset_common(struct dsaf_device *dsaf_dev, u8 ppe_common_index);
|
D | hns_dsaf_rcb.h | 107 struct dsaf_device *dsaf_dev; member 120 int hns_rcb_common_get_cfg(struct dsaf_device *dsaf_dev, int comm_index); 121 void hns_rcb_common_free_cfg(struct dsaf_device *dsaf_dev, u32 comm_index);
|
D | hns_dsaf_gmac.c | 107 struct dsaf_device *dsaf_dev in hns_gmac_free() local 112 dsaf_dev->misc_op->ge_srst(dsaf_dev, mac_id, 0); in hns_gmac_free() 350 struct dsaf_device *dsaf_dev in hns_gmac_init() local 355 dsaf_dev->misc_op->ge_srst(dsaf_dev, port, 0); in hns_gmac_init() 357 dsaf_dev->misc_op->ge_srst(dsaf_dev, port, 1); in hns_gmac_init()
|
D | hns_dsaf_misc.h | 36 struct dsaf_misc_op *hns_misc_op_get(struct dsaf_device *dsaf_dev);
|
D | hns_dsaf_xgmac.c | 213 struct dsaf_device *dsaf_dev in hns_xgmac_init() local 217 dsaf_dev->misc_op->xge_srst(dsaf_dev, port, 0); in hns_xgmac_init() 219 dsaf_dev->misc_op->xge_srst(dsaf_dev, port, 1); in hns_xgmac_init() 428 struct dsaf_device *dsaf_dev in hns_xgmac_free() local 433 dsaf_dev->misc_op->xge_srst(dsaf_dev, mac_id, 0); in hns_xgmac_free()
|
D | hns_dsaf_mac.h | 309 struct dsaf_device *dsaf_dev; member 432 int hns_mac_init(struct dsaf_device *dsaf_dev); 442 void hns_mac_uninit(struct dsaf_device *dsaf_dev);
|