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>

index | next in thread | previous in thread | raw e-mail

Hi All,
I wanted to add a psuedo network driver can any one tell me what else needs 
to be done here to provide a simple psuedo interface 

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=(struct inet *)malloc(sizeof(struct ifnet),M_DEVBUF,M_WAITOK);

ip->if_dname="test";
ip->if_flags = IFF_UP| IFF_RUNNING| IFF_POINTOPOINT | IFF_MULTICAST | 
IFF_NEEDSGIANT;
ip->if_ioctl = test_sioctl;
ip->if_start = test_ifstart;
ip->if_watchdog = test_ifwatchdog;
ip->if_init = 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


help

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