9
0
Fork 0

net: register a 'net' device to store network specific variables

'nameserver' and 'domainname' should be globally available variables
specific to networking. Register a 'net' device to store these variables.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2012-04-15 16:03:41 +02:00
parent dbd4e1166e
commit 9058b01ebc
1 changed files with 9 additions and 0 deletions

View File

@ -666,6 +666,11 @@ out:
return ret;
}
static struct device_d net_device = {
.name = "net",
.id = DEVICE_ID_SINGLE,
};
static int net_init(void)
{
int i;
@ -673,6 +678,10 @@ static int net_init(void)
for (i = 0; i < PKTBUFSRX; i++)
NetRxPackets[i] = xmemalign(32, PKTSIZE);
register_device(&net_device);
dev_add_param(&net_device, "nameserver", NULL, NULL, 0);
dev_add_param(&net_device, "domainname", NULL, NULL, 0);
return 0;
}