Commit e44392a8 authored by Yu Zhang's avatar Yu Zhang Committed by JiangShui
Browse files

hns3 udma: support import and unimport jetty

driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I85R2F


CVE: NA

---------------------------------------------------------------------

In the kernel mode import_jetty, UDMA driver only needs to alloc memory
of the target jetty and return its pointer to the URMA.
In addition, unimport_jetty just free the memory of target jetty.

Signed-off-by: default avatarYu Zhang <zhangyu709@huawei.com>
parent ba75bc59
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -376,3 +376,23 @@ int udma_destroy_jetty(struct ubcore_jetty *jetty)

	return ret;
}

struct ubcore_tjetty *udma_import_jetty(struct ubcore_device *dev,
				   const struct ubcore_tjetty_cfg *cfg,
				   struct ubcore_udata *udata)
{
	struct ubcore_tjetty *tjetty;

	tjetty = kcalloc(1, sizeof(struct ubcore_tjetty), GFP_KERNEL);
	if (!tjetty)
		return NULL;

	return tjetty;
}

int udma_unimport_jetty(struct ubcore_tjetty *tjetty)
{
	kfree(tjetty);

	return 0;
}
+4 −0
Original line number Diff line number Diff line
@@ -56,5 +56,9 @@ struct ubcore_jetty *udma_create_jetty(struct ubcore_device *dev,
				  const struct ubcore_jetty_cfg *cfg,
				  struct ubcore_udata *udata);
int udma_destroy_jetty(struct ubcore_jetty *jetty);
struct ubcore_tjetty *udma_import_jetty(struct ubcore_device *dev,
				   const struct ubcore_tjetty_cfg *cfg,
				   struct ubcore_udata *udata);
int udma_unimport_jetty(struct ubcore_tjetty *tjetty);

#endif /* _UDMA_JETTY_H */
+2 −0
Original line number Diff line number Diff line
@@ -342,6 +342,8 @@ static struct ubcore_ops g_udma_dev_ops = {
	.unimport_jfr = udma_unimport_jfr,
	.create_jetty = udma_create_jetty,
	.destroy_jetty = udma_destroy_jetty,
	.import_jetty = udma_import_jetty,
	.unimport_jetty = udma_unimport_jetty,
	.create_tp = udma_create_tp,
	.modify_tp = udma_modify_tp,
	.destroy_tp = udma_destroy_tp,