Home
last modified time | relevance | path

Searched refs:dsaf_dev (Results 1 – 13 of 13) sorted by relevance

/Linux-v5.10/drivers/net/ethernet/hisilicon/hns/
Dhns_dsaf_main.c41 static int hns_dsaf_get_cfg(struct dsaf_device *dsaf_dev) in hns_dsaf_get_cfg() argument
51 struct device_node *np = dsaf_dev->dev->of_node, *np_temp; in hns_dsaf_get_cfg()
52 struct platform_device *pdev = to_platform_device(dsaf_dev->dev); in hns_dsaf_get_cfg()
54 if (dev_of_node(dsaf_dev->dev)) { in hns_dsaf_get_cfg()
56 dsaf_dev->dsaf_ver = AE_VERSION_1; in hns_dsaf_get_cfg()
58 dsaf_dev->dsaf_ver = AE_VERSION_2; in hns_dsaf_get_cfg()
59 } else if (is_acpi_node(dsaf_dev->dev->fwnode)) { in hns_dsaf_get_cfg()
61 dsaf_dev->dsaf_ver = AE_VERSION_1; in hns_dsaf_get_cfg()
63 dsaf_dev->dsaf_ver = AE_VERSION_2; in hns_dsaf_get_cfg()
67 dev_err(dsaf_dev->dev, "cannot get cfg data from of or acpi\n"); in hns_dsaf_get_cfg()
[all …]
Dhns_dsaf_misc.c33 static void dsaf_write_sub(struct dsaf_device *dsaf_dev, u32 reg, u32 val) in dsaf_write_sub() argument
35 if (dsaf_dev->sub_ctrl) in dsaf_write_sub()
36 dsaf_write_syscon(dsaf_dev->sub_ctrl, reg, val); in dsaf_write_sub()
38 dsaf_write_reg(dsaf_dev->sc_base, reg, val); in dsaf_write_sub()
41 static u32 dsaf_read_sub(struct dsaf_device *dsaf_dev, u32 reg) in dsaf_read_sub() argument
46 if (dsaf_dev->sub_ctrl) { in dsaf_read_sub()
47 err = dsaf_read_syscon(dsaf_dev->sub_ctrl, reg, &ret); in dsaf_read_sub()
49 dev_err(dsaf_dev->dev, "dsaf_read_syscon error %d!\n", in dsaf_read_sub()
52 ret = dsaf_read_reg(dsaf_dev->sc_base, reg); in dsaf_read_sub()
250 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 …]
Dhns_dsaf_main.h212 struct dsaf_device *dsaf_dev; member
305 void (*dsaf_reset)(struct dsaf_device *dsaf_dev, bool dereset);
306 void (*xge_srst)(struct dsaf_device *dsaf_dev, u32 port, bool dereset);
307 void (*ge_srst)(struct dsaf_device *dsaf_dev, u32 port, bool dereset);
308 void (*ppe_srst)(struct dsaf_device *dsaf_dev, u32 port, bool dereset);
309 void (*ppe_comm_srst)(struct dsaf_device *dsaf_dev, bool dereset);
310 void (*hns_dsaf_srst_chns)(struct dsaf_device *dsaf_dev, u32 msk,
312 void (*hns_dsaf_roce_srst)(struct dsaf_device *dsaf_dev, bool dereset);
353 static inline void *hns_dsaf_dev_priv(const struct dsaf_device *dsaf_dev) in hns_dsaf_dev_priv() argument
355 return (void *)((u8 *)dsaf_dev + sizeof(*dsaf_dev)); in hns_dsaf_dev_priv()
[all …]
Dhns_dsaf_mac.c82 ret = mac_cb->dsaf_dev->misc_op->get_sfp_prsnt(mac_cb, in hns_mac_get_link_status()
149 mac_cb->dsaf_dev->ae_dev.name, in hns_mac_adjust_link()
169 if (mac_cb->dsaf_dev->dsaf_mode <= DSAF_MODE_ENABLE) { in hns_mac_get_inner_port_num()
173 mac_cb->dsaf_dev->ae_dev.name, in hns_mac_get_inner_port_num()
177 } else if (mac_cb->dsaf_dev->dsaf_mode < DSAF_MODE_MAX) { in hns_mac_get_inner_port_num()
181 mac_cb->dsaf_dev->ae_dev.name, in hns_mac_get_inner_port_num()
187 mac_cb->dsaf_dev->ae_dev.name, mac_cb->mac_id); in hns_mac_get_inner_port_num()
191 if (vmid >= mac_cb->dsaf_dev->rcb_common[0]->max_vfn) { in hns_mac_get_inner_port_num()
193 mac_cb->dsaf_dev->ae_dev.name, mac_cb->mac_id, vmid); in hns_mac_get_inner_port_num()
197 q_num_per_vf = mac_cb->dsaf_dev->rcb_common[0]->max_q_per_vf; in hns_mac_get_inner_port_num()
[all …]
Dhns_dsaf_ppe.c63 return ppe_common->dsaf_dev->ppe_base + PPE_COMMON_REG_OFFSET; in hns_ppe_common_get_ioaddr()
72 static int hns_ppe_common_get_cfg(struct dsaf_device *dsaf_dev, int comm_index) in hns_ppe_common_get_cfg() argument
77 if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) in hns_ppe_common_get_cfg()
82 ppe_common = devm_kzalloc(dsaf_dev->dev, in hns_ppe_common_get_cfg()
89 ppe_common->dsaf_dev = dsaf_dev; in hns_ppe_common_get_cfg()
91 if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) in hns_ppe_common_get_cfg()
95 ppe_common->dev = dsaf_dev->dev; in hns_ppe_common_get_cfg()
99 dsaf_dev->ppe_common[comm_index] = ppe_common; in hns_ppe_common_get_cfg()
105 hns_ppe_common_free_cfg(struct dsaf_device *dsaf_dev, u32 comm_index) in hns_ppe_common_free_cfg() argument
107 dsaf_dev->ppe_common[comm_index] = NULL; in hns_ppe_common_free_cfg()
[all …]
Dhns_ae_adapt.c34 ppe_comm = vf_cb->dsaf_dev->ppe_common[0]; in hns_get_ppe_cb()
41 struct dsaf_device *dsaf_dev, int port) in hns_ae_get_q_num_per_vf() argument
43 return dsaf_dev->rcb_common[0]->max_q_per_vf; in hns_ae_get_q_num_per_vf()
47 struct dsaf_device *dsaf_dev, int port) in hns_ae_get_vf_num_per_port() argument
49 return dsaf_dev->rcb_common[0]->max_vfn; in hns_ae_get_vf_num_per_port()
53 struct dsaf_device *dsaf_dev, int port) in hns_ae_get_base_ring_pair() argument
55 struct rcb_common_cb *rcb_comm = dsaf_dev->rcb_common[0]; in hns_ae_get_base_ring_pair()
73 struct dsaf_device *dsaf_dev; in hns_ae_get_handle() local
78 dsaf_dev = hns_ae_get_dsaf_dev(dev); in hns_ae_get_handle()
80 ring_pair_cb = hns_ae_get_base_ring_pair(dsaf_dev, port_id); in hns_ae_get_handle()
[all …]
Dhns_dsaf_rcb.c307 if (AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver)) { in hns_rcb_set_port_timeout()
310 } else if (!HNS_DSAF_IS_DEBUG(rcb_common->dsaf_dev)) { in hns_rcb_set_port_timeout()
332 if (!HNS_DSAF_IS_DEBUG(rcb_common->dsaf_dev)) in hns_rcb_common_get_port_num()
382 dev_err(rcb_common->dsaf_dev->dev, in hns_rcb_common_init_hw()
391 if (!AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver) && in hns_rcb_common_init_hw()
392 !HNS_DSAF_IS_DEBUG(rcb_common->dsaf_dev)) in hns_rcb_common_init_hw()
402 if (AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver)) { in hns_rcb_common_init_hw()
450 is_ver1 = AE_IS_VER1(ring_pair_cb->rcb_common->dsaf_dev->dsaf_ver); in hns_rcb_ring_get_cfg()
466 desc_num = rcb_common->dsaf_dev->desc_num; in hns_rcb_ring_get_cfg()
501 bool is_ver1 = AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver); in hns_rcb_get_base_irq_idx()
[all …]
Dhns_dsaf_ppe.h87 struct dsaf_device *dsaf_dev; member
100 int hns_ppe_init(struct dsaf_device *dsaf_dev);
102 void hns_ppe_uninit(struct dsaf_device *dsaf_dev);
104 void hns_ppe_reset_common(struct dsaf_device *dsaf_dev, u8 ppe_common_index);
Dhns_dsaf_rcb.h103 struct dsaf_device *dsaf_dev; member
116 int hns_rcb_common_get_cfg(struct dsaf_device *dsaf_dev, int comm_index);
117 void hns_rcb_common_free_cfg(struct dsaf_device *dsaf_dev, u32 comm_index);
Dhns_dsaf_gmac.c109 struct dsaf_device *dsaf_dev in hns_gmac_free() local
114 dsaf_dev->misc_op->ge_srst(dsaf_dev, mac_id, 0); in hns_gmac_free()
352 struct dsaf_device *dsaf_dev in hns_gmac_init() local
357 dsaf_dev->misc_op->ge_srst(dsaf_dev, port, 0); in hns_gmac_init()
359 dsaf_dev->misc_op->ge_srst(dsaf_dev, port, 1); in hns_gmac_init()
Dhns_dsaf_misc.h32 struct dsaf_misc_op *hns_misc_op_get(struct dsaf_device *dsaf_dev);
Dhns_dsaf_xgmac.c209 struct dsaf_device *dsaf_dev in hns_xgmac_init() local
213 dsaf_dev->misc_op->xge_srst(dsaf_dev, port, 0); in hns_xgmac_init()
215 dsaf_dev->misc_op->xge_srst(dsaf_dev, port, 1); in hns_xgmac_init()
425 struct dsaf_device *dsaf_dev in hns_xgmac_free() local
430 dsaf_dev->misc_op->xge_srst(dsaf_dev, mac_id, 0); in hns_xgmac_free()
Dhns_dsaf_mac.h305 struct dsaf_device *dsaf_dev; member
428 int hns_mac_init(struct dsaf_device *dsaf_dev);
438 void hns_mac_uninit(struct dsaf_device *dsaf_dev);