X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=sunos4%2Fppp_vdcmd.c;h=68095c92ec7cf9de6a4a8729954dc9ee58c6cb95;hp=eeaa03984dc4684017a03dce27f94750139fc846;hb=5ba9d88b943e9d5a3ababdadf1d2e246581dfdc6;hpb=bb0891f628e55fbdb149671d0e6344bc84983ec7 diff --git a/sunos4/ppp_vdcmd.c b/sunos4/ppp_vdcmd.c index eeaa039..68095c9 100644 --- a/sunos4/ppp_vdcmd.c +++ b/sunos4/ppp_vdcmd.c @@ -28,6 +28,7 @@ ppp_vdcmd(fun, vdp, vdi, vds) addr_t vdi; struct vdstat *vds; { + static int majnum = -1; int n, maj; switch (fun) { @@ -37,7 +38,7 @@ ppp_vdcmd(fun, vdp, vdi, vds) * for us. Oh well... */ for (maj = 1; maj < nchrdev; ++maj) - if (cdevsw[maj].d_open == &vd_unuseddev) + if (cdevsw[maj].d_open == vd_unuseddev) break; if (maj >= nchrdev) return ENODEV; @@ -46,6 +47,7 @@ ppp_vdcmd(fun, vdp, vdi, vds) cdevsw[maj] = ppp_cdevsw; vd.Drv_cdevsw = &ppp_cdevsw; vdp->vdd_vdtab = (struct vdlinkage *) &vd; + majnum = maj; break; case VDUNLOAD: @@ -56,6 +58,20 @@ ppp_vdcmd(fun, vdp, vdi, vds) break; case VDSTAT: + /* + * We have to fool the modstat command into thinking + * that this module is actually a driver! This is + * so that installation commands that use the -exec + * option of modload to run a shell script find out + * the block and/or char major numbers of the driver + * loaded (so that the shell script can go off to + * /dev and *MAKE* the bloody device nodes- remember + * they might change from one load to another if + * you don't hardwire the number!). + */ + vds->vds_magic = VDMAGIC_DRV; + vds->vds_modinfo[0] = (char) 0; + vds->vds_modinfo[1] = (char) majnum; break; default: