diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-01-22 18:43:36 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-01-22 18:43:36 +0100 |
commit | 91fa29a0d17b40963f67f08e740ca0a07365db90 (patch) | |
tree | 606753219fe2321062f660ba6f1017183455f9ce /device.c | |
parent | c85a502081ef76aef0a9e9fb9af65257c2e415a2 (diff) |
move device settings to a separate struct
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -178,30 +178,31 @@ static const struct device_type alias_device_type = { void device_init_settings(struct device *dev, struct blob_attr **tb) { + struct device_settings *s = &dev->settings; struct blob_attr *cur; struct ether_addr *ea; - dev->flags = 0; + s->flags = 0; dev->disabled = false; if ((cur = tb[DEV_ATTR_ENABLED])) device_set_disabled(dev, !blobmsg_get_bool(cur)); if ((cur = tb[DEV_ATTR_MTU])) { - dev->mtu = blobmsg_get_u32(cur); - dev->flags |= DEV_OPT_MTU; + s->mtu = blobmsg_get_u32(cur); + s->flags |= DEV_OPT_MTU; } if ((cur = tb[DEV_ATTR_TXQUEUELEN])) { - dev->txqueuelen = blobmsg_get_u32(cur); - dev->flags |= DEV_OPT_TXQUEUELEN; + s->txqueuelen = blobmsg_get_u32(cur); + s->flags |= DEV_OPT_TXQUEUELEN; } if ((cur = tb[DEV_ATTR_MACADDR])) { ea = ether_aton(blob_data(cur)); if (ea) { - memcpy(dev->macaddr, ea, sizeof(dev->macaddr)); - dev->flags |= DEV_OPT_MACADDR; + memcpy(s->macaddr, ea, 6); + s->flags |= DEV_OPT_MACADDR; } } } |