6 extern struct streamtab pppinfo;
10 static struct vdldrv vd = {
17 static struct cdevsw ppp_cdevsw = {
18 nodev, nodev, nodev, nodev, nodev, nodev, nodev, 0,
22 static struct cdevsw old_entry;
25 ppp_vdcmd(fun, vdp, vdi, vds)
31 static int majnum = -1;
37 * It seems like modload doesn't install the cdevsw entry
40 for (maj = 1; maj < nchrdev; ++maj)
41 if (cdevsw[maj].d_open == vd_unuseddev)
45 vd.Drv_charmajor = maj;
46 old_entry = cdevsw[maj];
47 cdevsw[maj] = ppp_cdevsw;
48 vd.Drv_cdevsw = &ppp_cdevsw;
49 vdp->vdd_vdtab = (struct vdlinkage *) &vd;
56 if (vd.Drv_charmajor > 0)
57 cdevsw[vd.Drv_charmajor] = old_entry;
62 * We have to fool the modstat command into thinking
63 * that this module is actually a driver! This is
64 * so that installation commands that use the -exec
65 * option of modload to run a shell script find out
66 * the block and/or char major numbers of the driver
67 * loaded (so that the shell script can go off to
68 * /dev and *MAKE* the bloody device nodes- remember
69 * they might change from one load to another if
70 * you don't hardwire the number!).
72 vds->vds_magic = VDMAGIC_DRV;
73 vds->vds_modinfo[0] = (char) 0;
74 vds->vds_modinfo[1] = (char) majnum;