9
0
Fork 0

net: add eth_unregister function

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2009-04-06 18:54:56 +02:00
parent cbb773d5d6
commit 2230eea29b
2 changed files with 19 additions and 1 deletions

View File

@ -78,7 +78,8 @@ struct eth_device {
struct device_d *dev;
};
int eth_register(struct eth_device* dev);/* Register network device */
int eth_register(struct eth_device* dev); /* Register network device */
void eth_unregister(struct eth_device* dev); /* Unregister network device */
int eth_open(void); /* open the device */
int eth_send(void *packet, int length); /* Send a packet */

View File

@ -148,3 +148,20 @@ int eth_register(struct eth_device *edev)
return 0;
}
void eth_unregister(struct eth_device *edev)
{
if (edev->param_ip.value)
free(edev->param_ip.value);
if (edev->param_ethaddr.value)
free(edev->param_ethaddr.value);
if (edev->param_gateway.value)
free(edev->param_gateway.value);
if (edev->param_netmask.value)
free(edev->param_netmask.value);
if (edev->param_serverip.value)
free(edev->param_serverip.value);
if (eth_current == edev)
eth_current = NULL;
}