summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/modconf.c
diff options
context:
space:
mode:
authorllai1 <none@none>2006-08-25 17:24:25 -0700
committerllai1 <none@none>2006-08-25 17:24:25 -0700
commitfacf4a8d7b59fde89a8662b4f4c73a758e6c402c (patch)
tree4e0024c5508351006df1496ec4be6e7b564c3ce8 /usr/src/uts/common/os/modconf.c
parentadcafb0fe4c49c4d46c0b393dfba36d4e1b55c0e (diff)
downloadillumos-gate-facf4a8d7b59fde89a8662b4f4c73a758e6c402c.tar.gz
PSARC/2003/246 Filesystem Driven Device Naming
5050715 logical device names not created during early boot 6292952 devfsadm mishandles optarg 6362924 devfsadm secondary link generation is not zones aware 6413127 Integrate the Devname Project 6464196 bfu should remove pt_chmod, obsoleted by /dev filesystem --HG-- rename : usr/src/cmd/pt_chmod/Makefile => deleted_files/usr/src/cmd/pt_chmod/Makefile rename : usr/src/cmd/pt_chmod/pt_chmod.c => deleted_files/usr/src/cmd/pt_chmod/pt_chmod.c
Diffstat (limited to 'usr/src/uts/common/os/modconf.c')
-rw-r--r--usr/src/uts/common/os/modconf.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/usr/src/uts/common/os/modconf.c b/usr/src/uts/common/os/modconf.c
index 35eb1c6825..2992567207 100644
--- a/usr/src/uts/common/os/modconf.c
+++ b/usr/src/uts/common/os/modconf.c
@@ -57,6 +57,7 @@
#include <sys/kcpc.h>
#include <sys/cpc_pcbe.h>
#include <sys/kstat.h>
+#include <sys/fs/sdev_node.h>
extern int moddebug;
@@ -216,6 +217,17 @@ struct mod_ops mod_dacfops = {
};
/*
+ * /dev fs modules
+ */
+static int mod_infodev(struct modldev *, struct modlinkage *, int *);
+static int mod_installdev(struct modldev *, struct modlinkage *);
+static int mod_removedev(struct modldev *, struct modlinkage *);
+
+struct mod_ops mod_devfsops = {
+ mod_installdev, mod_removedev, mod_infodev
+};
+
+/*
* PCBE (Performance Counter BackEnd) modules.
*/
static int mod_installpcbe(struct modlpcbe *, struct modlinkage *);
@@ -483,6 +495,41 @@ mod_removepcbe(struct modlpcbe *modl, struct modlinkage *modlp)
return (EBUSY);
}
+/*
+ * manage /dev fs modules
+ */
+/*ARGSUSED*/
+static int
+mod_infodev(struct modldev *modl, struct modlinkage *modlp, int *p0)
+{
+ if (mod_getctl(modlp) == NULL) {
+ *p0 = -1;
+ return (0); /* module is not yet installed */
+ }
+
+ *p0 = 0;
+ return (0);
+}
+
+static int
+mod_installdev(struct modldev *modl, struct modlinkage *modlp)
+{
+ struct modctl *mcp;
+
+ if ((mcp = mod_getctl(modlp)) == NULL)
+ return (EINVAL);
+ return (sdev_module_register(mcp->mod_modname, modl->dev_ops));
+}
+
+/*
+ * /dev modules are not unloadable.
+ */
+/*ARGSUSED*/
+static int
+mod_removedev(struct modldev *modl, struct modlinkage *modlp)
+{
+ return (EBUSY);
+}
/*
* Install a new driver