[PATCH net-next 2/3] netdevsim: psp: handle the new crypt-offset and spi-threshold get/set operations

Akhilesh Samineni
2026-04-06T22:23:36Z

Implement the crypt-offset and spi-threshold get/set in netdevsim PSP.

Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
Reviewed-by: Kiran Kella <kiran.kella@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/netdevsim/netdevsim.h | 2 ++
drivers/net/netdevsim/psp.c | 6 ++++++
2 files changed, 8 insertions(+)

diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h
index c904e14f6b3f..3ad7d42391c0 100644
--- a/drivers/net/netdevsim/netdevsim.h
+++ b/drivers/net/netdevsim/netdevsim.h
@@ -117,6 +117,8 @@ struct netdevsim {
struct psp_dev *dev;
u32 spi;
u32 assoc_cnt;
+ u8 crypt_offset;
+ u32 spi_threshold;
} psp;

struct nsim_bus_dev *nsim_bus_dev;
diff --git a/drivers/net/netdevsim/psp.c b/drivers/net/netdevsim/psp.c
index 0b4d717253b0..9098edf00c5c 100644
--- a/drivers/net/netdevsim/psp.c
+++ b/drivers/net/netdevsim/psp.c
@@ -122,6 +122,11 @@ static int
nsim_psp_set_config(struct psp_dev *psd, struct psp_dev_config *conf,
struct netlink_ext_ack *extack)
{
+ struct netdevsim *ns = psd->drv_priv;
+
+ ns->psp.crypt_offset = conf->crypt_offset;
+ ns->psp.spi_threshold = conf->spi_threshold;
+
return 0;
}

@@ -249,6 +254,7 @@ int nsim_psp_init(struct netdevsim *ns)
if (err)
return err;

+ ns->psp.spi_threshold = PSP_SPI_THRESHOLD_DEFAULT;
debugfs_create_file("psp_rereg", 0200, ddir, ns, &nsim_psp_rereg_fops);
return 0;
}
--
2.45.4