Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Sep 2005 10:16:17 +0530
From:      rashmi ns <nsrashmi@gmail.com>
To:        bugi@lists.redbrick.dcu.ie, freebsd-hackers@freebsd.org
Subject:   Re: Porting from linux to freebsd help needed
Message-ID:  <9f99931605091221463addc8a4@mail.gmail.com>
In-Reply-To: <9f99931605091200085048847a@mail.gmail.com>
References:  <9f99931605091200085048847a@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi All,
I wanted to add a psuedo network driver can any one tell me what else needs=
=20
to be done here to provide a simple psuedo interface=20

test_modevent(module_t mod, int type, void *data)
{
switch (type) {
case MOD_LOAD:
uprintf("The psuedo driver loaded\n");
//attach a ifnet structure
ip=3D(struct inet *)malloc(sizeof(struct ifnet),M_DEVBUF,M_WAITOK);

ip->if_dname=3D"test";
ip->if_flags =3D IFF_UP| IFF_RUNNING| IFF_POINTOPOINT | IFF_MULTICAST |=20
IFF_NEEDSGIANT;
ip->if_ioctl =3D test_sioctl;
ip->if_start =3D test_ifstart;
ip->if_watchdog =3D test_ifwatchdog;
ip->if_init =3D test_initialize;
strlcpy(ip->if_xname, "test",5);
if_attach (ip);
break;
case MOD_UNLOAD:
uprintf("test_ps module unload - not possible for this module type\n");
if_detach (ip);
free(ip,M_DEVBUF);
return EINVAL;
default:
return EOPNOTSUPP;
}
return 0;
}
Thanks and Regards,
Rashmi.N.S



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9f99931605091221463addc8a4>