2021-01-15 19:22:20 +05:30
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
/* Copyright (C) 2020 Marvell. */
|
|
|
|
|
|
|
|
#include "otx2_cpt_common.h"
|
2021-01-15 19:22:23 +05:30
|
|
|
#include "otx2_cptlf.h"
|
2021-01-15 19:22:20 +05:30
|
|
|
|
|
|
|
int otx2_cpt_send_mbox_msg(struct otx2_mbox *mbox, struct pci_dev *pdev)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
otx2_mbox_msg_send(mbox, 0);
|
|
|
|
ret = otx2_mbox_wait_for_rsp(mbox, 0);
|
|
|
|
if (ret == -EIO) {
|
|
|
|
dev_err(&pdev->dev, "RVU MBOX timeout.\n");
|
|
|
|
return ret;
|
|
|
|
} else if (ret) {
|
|
|
|
dev_err(&pdev->dev, "RVU MBOX error: %d.\n", ret);
|
|
|
|
return -EFAULT;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 15:59:47 +01:00
|
|
|
EXPORT_SYMBOL_NS_GPL(otx2_cpt_send_mbox_msg, "CRYPTO_DEV_OCTEONTX2_CPT");
|
2021-01-15 19:22:20 +05:30
|
|
|
|
|
|
|
int otx2_cpt_send_ready_msg(struct otx2_mbox *mbox, struct pci_dev *pdev)
|
|
|
|
{
|
|
|
|
struct mbox_msghdr *req;
|
|
|
|
|
|
|
|
req = otx2_mbox_alloc_msg_rsp(mbox, 0, sizeof(*req),
|
|
|
|
sizeof(struct ready_msg_rsp));
|
|
|
|
if (req == NULL) {
|
|
|
|
dev_err(&pdev->dev, "RVU MBOX failed to get message.\n");
|
|
|
|
return -EFAULT;
|
|
|
|
}
|
|
|
|
req->id = MBOX_MSG_READY;
|
|
|
|
req->sig = OTX2_MBOX_REQ_SIG;
|
|
|
|
req->pcifunc = 0;
|
|
|
|
|
|
|
|
return otx2_cpt_send_mbox_msg(mbox, pdev);
|
|
|
|
}
|
module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 15:59:47 +01:00
|
|
|
EXPORT_SYMBOL_NS_GPL(otx2_cpt_send_ready_msg, "CRYPTO_DEV_OCTEONTX2_CPT");
|
2021-01-15 19:22:22 +05:30
|
|
|
|
|
|
|
int otx2_cpt_send_af_reg_requests(struct otx2_mbox *mbox, struct pci_dev *pdev)
|
|
|
|
{
|
|
|
|
return otx2_cpt_send_mbox_msg(mbox, pdev);
|
|
|
|
}
|
module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 15:59:47 +01:00
|
|
|
EXPORT_SYMBOL_NS_GPL(otx2_cpt_send_af_reg_requests, "CRYPTO_DEV_OCTEONTX2_CPT");
|
2021-01-15 19:22:22 +05:30
|
|
|
|
2023-02-06 13:18:50 +08:00
|
|
|
static int otx2_cpt_add_read_af_reg(struct otx2_mbox *mbox,
|
|
|
|
struct pci_dev *pdev, u64 reg,
|
|
|
|
u64 *val, int blkaddr)
|
2021-01-15 19:22:22 +05:30
|
|
|
{
|
|
|
|
struct cpt_rd_wr_reg_msg *reg_msg;
|
|
|
|
|
|
|
|
reg_msg = (struct cpt_rd_wr_reg_msg *)
|
|
|
|
otx2_mbox_alloc_msg_rsp(mbox, 0, sizeof(*reg_msg),
|
|
|
|
sizeof(*reg_msg));
|
|
|
|
if (reg_msg == NULL) {
|
|
|
|
dev_err(&pdev->dev, "RVU MBOX failed to get message.\n");
|
|
|
|
return -EFAULT;
|
|
|
|
}
|
|
|
|
|
|
|
|
reg_msg->hdr.id = MBOX_MSG_CPT_RD_WR_REGISTER;
|
|
|
|
reg_msg->hdr.sig = OTX2_MBOX_REQ_SIG;
|
|
|
|
reg_msg->hdr.pcifunc = 0;
|
|
|
|
|
|
|
|
reg_msg->is_write = 0;
|
|
|
|
reg_msg->reg_offset = reg;
|
|
|
|
reg_msg->ret_val = val;
|
2021-04-15 17:58:37 +05:30
|
|
|
reg_msg->blkaddr = blkaddr;
|
2021-01-15 19:22:22 +05:30
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int otx2_cpt_add_write_af_reg(struct otx2_mbox *mbox, struct pci_dev *pdev,
|
2021-04-15 17:58:37 +05:30
|
|
|
u64 reg, u64 val, int blkaddr)
|
2021-01-15 19:22:22 +05:30
|
|
|
{
|
|
|
|
struct cpt_rd_wr_reg_msg *reg_msg;
|
|
|
|
|
|
|
|
reg_msg = (struct cpt_rd_wr_reg_msg *)
|
|
|
|
otx2_mbox_alloc_msg_rsp(mbox, 0, sizeof(*reg_msg),
|
|
|
|
sizeof(*reg_msg));
|
|
|
|
if (reg_msg == NULL) {
|
|
|
|
dev_err(&pdev->dev, "RVU MBOX failed to get message.\n");
|
|
|
|
return -EFAULT;
|
|
|
|
}
|
|
|
|
|
|
|
|
reg_msg->hdr.id = MBOX_MSG_CPT_RD_WR_REGISTER;
|
|
|
|
reg_msg->hdr.sig = OTX2_MBOX_REQ_SIG;
|
|
|
|
reg_msg->hdr.pcifunc = 0;
|
|
|
|
|
|
|
|
reg_msg->is_write = 1;
|
|
|
|
reg_msg->reg_offset = reg;
|
|
|
|
reg_msg->val = val;
|
2021-04-15 17:58:37 +05:30
|
|
|
reg_msg->blkaddr = blkaddr;
|
2021-01-15 19:22:22 +05:30
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 15:59:47 +01:00
|
|
|
EXPORT_SYMBOL_NS_GPL(otx2_cpt_add_write_af_reg, "CRYPTO_DEV_OCTEONTX2_CPT");
|
2021-01-15 19:22:22 +05:30
|
|
|
|
|
|
|
int otx2_cpt_read_af_reg(struct otx2_mbox *mbox, struct pci_dev *pdev,
|
2021-04-15 17:58:37 +05:30
|
|
|
u64 reg, u64 *val, int blkaddr)
|
2021-01-15 19:22:22 +05:30
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
2021-04-15 17:58:37 +05:30
|
|
|
ret = otx2_cpt_add_read_af_reg(mbox, pdev, reg, val, blkaddr);
|
2021-01-15 19:22:22 +05:30
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
return otx2_cpt_send_mbox_msg(mbox, pdev);
|
|
|
|
}
|
module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 15:59:47 +01:00
|
|
|
EXPORT_SYMBOL_NS_GPL(otx2_cpt_read_af_reg, "CRYPTO_DEV_OCTEONTX2_CPT");
|
2021-01-15 19:22:22 +05:30
|
|
|
|
|
|
|
int otx2_cpt_write_af_reg(struct otx2_mbox *mbox, struct pci_dev *pdev,
|
2021-04-15 17:58:37 +05:30
|
|
|
u64 reg, u64 val, int blkaddr)
|
2021-01-15 19:22:22 +05:30
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
2021-04-15 17:58:37 +05:30
|
|
|
ret = otx2_cpt_add_write_af_reg(mbox, pdev, reg, val, blkaddr);
|
2021-01-15 19:22:22 +05:30
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
return otx2_cpt_send_mbox_msg(mbox, pdev);
|
|
|
|
}
|
module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 15:59:47 +01:00
|
|
|
EXPORT_SYMBOL_NS_GPL(otx2_cpt_write_af_reg, "CRYPTO_DEV_OCTEONTX2_CPT");
|
2021-01-15 19:22:23 +05:30
|
|
|
|
|
|
|
int otx2_cpt_attach_rscrs_msg(struct otx2_cptlfs_info *lfs)
|
|
|
|
{
|
|
|
|
struct otx2_mbox *mbox = lfs->mbox;
|
|
|
|
struct rsrc_attach *req;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
req = (struct rsrc_attach *)
|
|
|
|
otx2_mbox_alloc_msg_rsp(mbox, 0, sizeof(*req),
|
|
|
|
sizeof(struct msg_rsp));
|
|
|
|
if (req == NULL) {
|
|
|
|
dev_err(&lfs->pdev->dev, "RVU MBOX failed to get message.\n");
|
|
|
|
return -EFAULT;
|
|
|
|
}
|
|
|
|
|
|
|
|
req->hdr.id = MBOX_MSG_ATTACH_RESOURCES;
|
|
|
|
req->hdr.sig = OTX2_MBOX_REQ_SIG;
|
|
|
|
req->hdr.pcifunc = 0;
|
|
|
|
req->cptlfs = lfs->lfs_num;
|
2023-04-25 19:36:20 +05:30
|
|
|
req->cpt_blkaddr = lfs->blkaddr;
|
|
|
|
req->modify = 1;
|
2021-01-15 19:22:23 +05:30
|
|
|
ret = otx2_cpt_send_mbox_msg(mbox, lfs->pdev);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
if (!lfs->are_lfs_attached)
|
|
|
|
ret = -EINVAL;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
int otx2_cpt_detach_rsrcs_msg(struct otx2_cptlfs_info *lfs)
|
|
|
|
{
|
|
|
|
struct otx2_mbox *mbox = lfs->mbox;
|
|
|
|
struct rsrc_detach *req;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
req = (struct rsrc_detach *)
|
|
|
|
otx2_mbox_alloc_msg_rsp(mbox, 0, sizeof(*req),
|
|
|
|
sizeof(struct msg_rsp));
|
|
|
|
if (req == NULL) {
|
|
|
|
dev_err(&lfs->pdev->dev, "RVU MBOX failed to get message.\n");
|
|
|
|
return -EFAULT;
|
|
|
|
}
|
|
|
|
|
|
|
|
req->hdr.id = MBOX_MSG_DETACH_RESOURCES;
|
|
|
|
req->hdr.sig = OTX2_MBOX_REQ_SIG;
|
|
|
|
req->hdr.pcifunc = 0;
|
2023-04-25 19:36:20 +05:30
|
|
|
req->cptlfs = 1;
|
2021-01-15 19:22:23 +05:30
|
|
|
ret = otx2_cpt_send_mbox_msg(mbox, lfs->pdev);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
if (lfs->are_lfs_attached)
|
|
|
|
ret = -EINVAL;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 15:59:47 +01:00
|
|
|
EXPORT_SYMBOL_NS_GPL(otx2_cpt_detach_rsrcs_msg, "CRYPTO_DEV_OCTEONTX2_CPT");
|
2021-01-15 19:22:25 +05:30
|
|
|
|
|
|
|
int otx2_cpt_msix_offset_msg(struct otx2_cptlfs_info *lfs)
|
|
|
|
{
|
|
|
|
struct otx2_mbox *mbox = lfs->mbox;
|
|
|
|
struct pci_dev *pdev = lfs->pdev;
|
|
|
|
struct mbox_msghdr *req;
|
|
|
|
int ret, i;
|
|
|
|
|
|
|
|
req = otx2_mbox_alloc_msg_rsp(mbox, 0, sizeof(*req),
|
|
|
|
sizeof(struct msix_offset_rsp));
|
|
|
|
if (req == NULL) {
|
|
|
|
dev_err(&pdev->dev, "RVU MBOX failed to get message.\n");
|
|
|
|
return -EFAULT;
|
|
|
|
}
|
|
|
|
|
|
|
|
req->id = MBOX_MSG_MSIX_OFFSET;
|
|
|
|
req->sig = OTX2_MBOX_REQ_SIG;
|
|
|
|
req->pcifunc = 0;
|
|
|
|
ret = otx2_cpt_send_mbox_msg(mbox, pdev);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
for (i = 0; i < lfs->lfs_num; i++) {
|
|
|
|
if (lfs->lf[i].msix_offset == MSIX_VECTOR_INVALID) {
|
|
|
|
dev_err(&pdev->dev,
|
|
|
|
"Invalid msix offset %d for LF %d\n",
|
|
|
|
lfs->lf[i].msix_offset, i);
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 15:59:47 +01:00
|
|
|
EXPORT_SYMBOL_NS_GPL(otx2_cpt_msix_offset_msg, "CRYPTO_DEV_OCTEONTX2_CPT");
|
2022-02-04 18:16:01 +05:30
|
|
|
|
|
|
|
int otx2_cpt_sync_mbox_msg(struct otx2_mbox *mbox)
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
|
|
|
|
if (!otx2_mbox_nonempty(mbox, 0))
|
|
|
|
return 0;
|
|
|
|
otx2_mbox_msg_send(mbox, 0);
|
|
|
|
err = otx2_mbox_wait_for_rsp(mbox, 0);
|
|
|
|
if (err)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
return otx2_mbox_check_rsp_msgs(mbox, 0);
|
|
|
|
}
|
module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 15:59:47 +01:00
|
|
|
EXPORT_SYMBOL_NS_GPL(otx2_cpt_sync_mbox_msg, "CRYPTO_DEV_OCTEONTX2_CPT");
|
2023-12-13 13:00:51 +05:30
|
|
|
|
|
|
|
int otx2_cpt_lf_reset_msg(struct otx2_cptlfs_info *lfs, int slot)
|
|
|
|
{
|
|
|
|
struct otx2_mbox *mbox = lfs->mbox;
|
|
|
|
struct pci_dev *pdev = lfs->pdev;
|
|
|
|
struct cpt_lf_rst_req *req;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
req = (struct cpt_lf_rst_req *)otx2_mbox_alloc_msg_rsp(mbox, 0, sizeof(*req),
|
|
|
|
sizeof(struct msg_rsp));
|
|
|
|
if (!req) {
|
|
|
|
dev_err(&pdev->dev, "RVU MBOX failed to get message.\n");
|
|
|
|
return -EFAULT;
|
|
|
|
}
|
|
|
|
|
|
|
|
req->hdr.id = MBOX_MSG_CPT_LF_RESET;
|
|
|
|
req->hdr.sig = OTX2_MBOX_REQ_SIG;
|
|
|
|
req->hdr.pcifunc = 0;
|
|
|
|
req->slot = slot;
|
|
|
|
ret = otx2_cpt_send_mbox_msg(mbox, pdev);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 15:59:47 +01:00
|
|
|
EXPORT_SYMBOL_NS_GPL(otx2_cpt_lf_reset_msg, "CRYPTO_DEV_OCTEONTX2_CPT");
|
2025-05-16 14:14:41 +05:30
|
|
|
|
|
|
|
int otx2_cpt_lmtst_tbl_setup_msg(struct otx2_cptlfs_info *lfs)
|
|
|
|
{
|
|
|
|
struct otx2_mbox *mbox = lfs->mbox;
|
|
|
|
struct pci_dev *pdev = lfs->pdev;
|
|
|
|
struct lmtst_tbl_setup_req *req;
|
|
|
|
|
|
|
|
req = (struct lmtst_tbl_setup_req *)
|
|
|
|
otx2_mbox_alloc_msg_rsp(mbox, 0, sizeof(*req),
|
|
|
|
sizeof(struct msg_rsp));
|
|
|
|
if (!req) {
|
|
|
|
dev_err(&pdev->dev, "RVU MBOX failed to alloc message.\n");
|
|
|
|
return -EFAULT;
|
|
|
|
}
|
|
|
|
|
|
|
|
req->hdr.id = MBOX_MSG_LMTST_TBL_SETUP;
|
|
|
|
req->hdr.sig = OTX2_MBOX_REQ_SIG;
|
|
|
|
req->hdr.pcifunc = 0;
|
|
|
|
|
|
|
|
req->use_local_lmt_region = true;
|
|
|
|
req->lmt_iova = lfs->lmt_info.iova;
|
|
|
|
|
|
|
|
return otx2_cpt_send_mbox_msg(mbox, pdev);
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL_NS_GPL(otx2_cpt_lmtst_tbl_setup_msg, "CRYPTO_DEV_OCTEONTX2_CPT");
|