Page MenuHomeFreeBSD

D47432.diff
No OneTemporary

D47432.diff

diff --git a/sys/dev/firmware/arm/scmi_raw.c b/sys/dev/firmware/arm/scmi_raw.c
--- a/sys/dev/firmware/arm/scmi_raw.c
+++ b/sys/dev/firmware/arm/scmi_raw.c
@@ -45,6 +45,7 @@
#include <sys/refcount.h>
#include <sys/stat.h>
#include <sys/selinfo.h>
+#include <sys/sysctl.h>
#include <sys/types.h>
#include <sys/uio.h>
@@ -131,6 +132,7 @@
struct cdev *cdevs[RAW_DEV_MAX];
device_t dev;
struct scmi_raw_buf_queue *rbqs[RB_QUEUES_MAX];
+ struct sysctl_oid *sysctl_raw;
};
static d_read_t scmi_raw_device_read;
@@ -337,9 +339,19 @@
struct scmi_softc *sc;
sc = device_get_softc(raw->dev);
- for (int i = 0; i < RB_QUEUES_MAX; i++)
+ for (int i = 0; i < RB_QUEUES_MAX; i++) {
+ struct sysctl_oid *sysctl_rbq;
+
raw->rbqs[i] = scmi_raw_buf_queue_allocate(raw->dev, rbq_names[i],
SCMI_MAX_MSG(sc), SCMI_MAX_MSG_SIZE(sc));
+
+ sysctl_rbq = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(raw->sysctl_raw),
+ OID_AUTO, rbq_names[i], CTLFLAG_RD, 0, "SCMI RAW Queue properties");
+ SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(sysctl_rbq), OID_AUTO, "frees",
+ CTLFLAG_RD, &raw->rbqs[i]->cnt[Q_FREE], 0, "SCMI RAW per-queue free bufs");
+ SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(sysctl_rbq), OID_AUTO, "pending",
+ CTLFLAG_RD, &raw->rbqs[i]->cnt[Q_READ], 0, "SCMI RAW per-queue pending bufs");
+ }
}
static void
@@ -549,6 +561,9 @@
raw->coex = SCMI_RAW_COEX;
raw->dev = dev;
+ raw->sysctl_raw = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(sc->sysctl_root),
+ OID_AUTO, "raw", CTLFLAG_RD, 0, "SCMI RAW properties");
+
scmi_raw_buf_queues_init(raw);
for (int i = RAW_DEV_MESG; i < RAW_DEV_MAX; i++) {

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 7, 8:38 PM (22 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14462633
Default Alt Text
D47432.diff (1 KB)

Event Timeline