I was looking for an example of a set_mac_address method for
my VLAN code....
wavelan was at the bottom of the grep, so I took a look:
static int wavelan_set_mac_address(device * dev, void *addr)
{
struct sockaddr *mac = addr;
/* Copy the address. */
memcpy(dev->dev_addr, mac->sa_data, WAVELAN_ADDR_SIZE);
/* Reconfigure the beast. */
wv_82586_reconfig(dev);
return 0;
}
#endif /* SET_MAC_ADDRESS */
Everything should be using net_device, not device, right?
Also, some of the examples I look at cast addr to a sockaddr (ie wavelan),
but others treat addr as the MAC. I'm guessing that both work, but can
someone explain the more 'correct' way of doing things?
Thanks,
Ben
--
Ben Greear (greearb@xxxxxxxxxxxxxxx) http://www.candelatech.com
Author of ScryMUD: scry.wanfear.com 4444 (Released under GPL)
http://scry.wanfear.com http://scry.wanfear.com/~greear
|