I'm developing a linux kernel module for an embedded system.
The system contains programmable logic (PL), which needs to be accessed from userspace processes.
configfs is not a replacement for
sysfs. In fact, it can be viewed as an opposite to
sysfs provides a view of kernel's objects though the filesystem interface. It can be used to change things in or cause some actions on those objects, but it was not meant for that. The major point here is that each object that is represented in
sysfs is created and destroyed in kernel. The kernel controls the lifecycle of the sysfs representation, and sysfs is just a window on all this.
configfs, on the other hand, provides a way to create or change kernel objects through the filesystem interface. That's a fundamental difference. A user-space process can create directories within
configfs. That action will cause a callback execution within the kernel and the creation of the corresponding kernel object. The files in the directory would represent states of various object's components.
I suspect that due to the nature of data exchange between the kernel and a user space process in these two cases it was deemed unnecessary to have mmap support in
Without seeing the design/architecture of your system it's difficult to say something definitive in your case. From your description is appears that
sysfs may be what you need to satisfy the desired goals. All objects that you need access to are created, modified, and destroyed from the kernel. Limited settings/changes to existing kernel structures/objects in your module can be done through
sysfs interface. Then again, it may well be that you would want to have both
configfs interfaces in your module, each for its specific purpose. There's nothing bad in that if it makes things cleaner and clearer.