summaryrefslogtreecommitdiff
path: root/vlandev.c
Commit message (Collapse)AuthorAgeFilesLines
* vlandev: propagate topology changesFelix Fietkau2022-12-301-0/+4
| | | | | | Same as vlan Signed-off-by: Felix Fietkau <nbd@nbd.name>
* bridge: allow adding/removing VLANs to configured member ports via hotplugFelix Fietkau2021-06-041-9/+12
| | | | | | | This is useful for a dynamic VLAN setup, where extra tags need to be created on the trunking port on demand Signed-off-by: Felix Fietkau <nbd@nbd.name>
* netifd: fix a typo in vlandev hotplug supportFelix Fietkau2020-12-141-1/+1
| | | | | | Need to check the type of the vlan device, not the underlying device Signed-off-by: Felix Fietkau <nbd@nbd.name>
* vlandev: support bridge-vlan aliases in the vid config parameterFelix Fietkau2020-11-261-5/+31
| | | | | | | | This can be used to generate default network configurations that define the lan/wan interfaces as vlandevs with custom names and specify the actual VLAN ID only in the bridge-vlan section without repeating it elsewhere Signed-off-by: Felix Fietkau <nbd@nbd.name>
* vlandev: dump vlan id in device statusFelix Fietkau2020-11-261-0/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* wireless: fix passing bridge name for vlan hotplug pass-throughFelix Fietkau2020-11-181-2/+2
| | | | | | | When preparing the interface for hotplug add, pass the bridge device back to the caller, since it may not match the original device Signed-off-by: Felix Fietkau <nbd@nbd.name>
* vlandev: add pass-through hotplug ops that pass the VLAN info to the bridgeFelix Fietkau2020-10-281-0/+66
| | | | | | Only used for 802.1q devices Signed-off-by: Felix Fietkau <nbd@nbd.name>
* vlandev: support setting ingress/egress QoS mappingsPau Espin Pedrol2020-05-211-0/+72
| | | | | | | | | | | | | | | | | It allows setting mappings for instance this way: """ config device option name 'vlan41' option type '8021q' option vid '41' option ifname 'eth1' list ingress_qos_mapping '1:2' list ingress_qos_mapping '2:5' list egress_qos_mapping '0:3' """ Signed-off-by: Pau Espin Pedrol <pespin.shar@gmail.com> Tested-by: Pedro <pedrowrt@cas.cat>
* device: gracefully handle device names exceeding IFNAMESIZHans Dedecker2018-08-141-1/+7
| | | | | | | | | | | | Instead of truncating the device name when it exceeds IFNAMSIZ length; let device_set_ifname return an error code and do not add the device to the device list. This avoids possible issues with device names becoming identical due the truncation and as a result unexpected behavior. Further let the different device types gracefully handle the error code returned by device_init Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* vlandev: Rework 8021ad/8021q detection based on vlandevice typeHans Dedecker2016-09-261-9/+4
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* vlandev: Register 8021ad and 8021q s device typesHans Dedecker2016-09-261-3/+14
| | | | | | Fixes creation of vlan 8021ad/8021q devices by UCI due to device handlers rework Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* device: Move the different device type registrations to the device type fileHans Dedecker2016-09-261-1/+6
| | | | | | While at it; make device_types static if only used in the device type file Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* device: prepare for adding device handlers dynamicallyArne Kappen2016-08-261-3/+4
| | | | | | | | - remove const from device handler struct - pass device handler type to create function Signed-off-by: Arne Kappen <akappen@inet.tu-berlin.de> Signed-off-by: Felix Fietkau <nbd@nbd.name> [cleanup]
* device: Don't process link events anymore in device user specific callback ↵Hans Dedecker2015-11-041-8/+0
| | | | | | | | | | | | | | | handlers Set link_state for all device types via the device_set_link API as all devices are registered in the device tree list making it possible to always get the device via device_get. The decice link state parameter will now actually reflect the corresponding kernel device carrier state in all cases. Before this change a vlan/macvlan device could still have link_state enabled if an interface was brought down; this was the case when the parent vlan/macvlan device was still enabled as the netlink link_state event would be dropped for vlan/macvlan devices due to keep_link_state in the function cb_rtnl_event. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Keep reference to a config copy in device type specific reload ↵Hans Dedecker2015-02-171-0/+3
| | | | | | | | | handler as the original config pointer might go stale Fixes random observed crashes in blobmsg_parse when device type specific config data is parsed. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* device: make link status detection optional for vlan devicesFelix Fietkau2014-10-201-0/+1
| | | | | | | Fixes a race condition that triggers endless link loss / detect calls when VLAN devices are created. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* Add vlan 802.1q/802.1ad support as netifd devicesGioacchino Mazzurco2014-06-111-0/+255
At moment netifd supports just 802.1q vlan, you can configure them using a concise but "hacky" syntax using an interface config section, with this patch netifd acquire the capability of configuring 802.1ad and 802.1q vlan using config device sections, so you can define a vlan device plus interface with something like this: config device 'test' option type '8021ad' option name 'test' option ifname 'eth0' option vid '1000' config interface 'testif' option ifname 'test' option proto 'none' option auto '1' old syntax for 802.1q keeps working so no retrocompatibility problems, to keep retrocompatibility means also that user must not use name/ifname like eth0.2 for devices declared with the new style because this would trigger the "old style" when interface config section is parsed Signed-off-by: Gioacchino Mazzurco <gmazzurco89@gmail.com>