From 6a89e444a26a854e482b39b50d04f8e16aa01744 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Sat, 16 Feb 2019 04:26:53 +0200 Subject: meta-agl-profile-telematic: recipes-core: systemd: backport CANbus network support Backport changes to enable configuration of CANbus interfaces automatically on device detected, and on bootup. Bug-AGL: SPEC-2189 Change-Id: I837aa50038e25f32ec3143513067fc3eec69385d Signed-off-by: Matt Ranostay --- ...kd-link-link_up_can-move-function-upwards.patch | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 meta-agl-profile-telematics/recipes-core/systemd/files/0002-networkd-link-link_up_can-move-function-upwards.patch (limited to 'meta-agl-profile-telematics/recipes-core/systemd/files/0002-networkd-link-link_up_can-move-function-upwards.patch') diff --git a/meta-agl-profile-telematics/recipes-core/systemd/files/0002-networkd-link-link_up_can-move-function-upwards.patch b/meta-agl-profile-telematics/recipes-core/systemd/files/0002-networkd-link-link_up_can-move-function-upwards.patch new file mode 100644 index 000000000..6e2f4109c --- /dev/null +++ b/meta-agl-profile-telematics/recipes-core/systemd/files/0002-networkd-link-link_up_can-move-function-upwards.patch @@ -0,0 +1,82 @@ +From 833fbbe448fca5f7047708db2d0d91778aabbb93 Mon Sep 17 00:00:00 2001 +From: Marc Kleine-Budde +Date: Wed, 30 May 2018 16:31:59 +0200 +Subject: [PATCH 2/3] networkd-link: link_up_can(): move function upwards + +This patch is a preparation patch, to avoid forward declarations in the +next patch. +--- + src/network/networkd-link.c | 50 ++++++++++++++++++------------------- + 1 file changed, 25 insertions(+), 25 deletions(-) + +diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c +index c29ae30ef0..a736dc1a74 100644 +--- a/src/network/networkd-link.c ++++ b/src/network/networkd-link.c +@@ -1780,6 +1780,31 @@ int link_up(Link *link) { + return 0; + } + ++static int link_up_can(Link *link) { ++ _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL; ++ int r; ++ ++ assert(link); ++ ++ log_link_debug(link, "Bringing CAN link up"); ++ ++ r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_SETLINK, link->ifindex); ++ if (r < 0) ++ return log_link_error_errno(link, r, "Could not allocate RTM_SETLINK message: %m"); ++ ++ r = sd_rtnl_message_link_set_flags(req, IFF_UP, IFF_UP); ++ if (r < 0) ++ return log_link_error_errno(link, r, "Could not set link flags: %m"); ++ ++ r = sd_netlink_call_async(link->manager->rtnl, req, link_up_handler, link, 0, NULL); ++ if (r < 0) ++ return log_link_error_errno(link, r, "Could not send rtnetlink message: %m"); ++ ++ link_ref(link); ++ ++ return 0; ++} ++ + static int link_down_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) { + _cleanup_link_unref_ Link *link = userdata; + int r; +@@ -1824,31 +1849,6 @@ int link_down(Link *link) { + return 0; + } + +-static int link_up_can(Link *link) { +- _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL; +- int r; +- +- assert(link); +- +- log_link_debug(link, "Bringing CAN link up"); +- +- r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_SETLINK, link->ifindex); +- if (r < 0) +- return log_link_error_errno(link, r, "Could not allocate RTM_SETLINK message: %m"); +- +- r = sd_rtnl_message_link_set_flags(req, IFF_UP, IFF_UP); +- if (r < 0) +- return log_link_error_errno(link, r, "Could not set link flags: %m"); +- +- r = sd_netlink_call_async(link->manager->rtnl, req, link_up_handler, link, 0, NULL); +- if (r < 0) +- return log_link_error_errno(link, r, "Could not send rtnetlink message: %m"); +- +- link_ref(link); +- +- return 0; +-} +- + static int link_handle_bound_to_list(Link *link) { + Link *l; + Iterator i; +-- +2.17.1 + -- cgit 1.2.3-korg