Skip to contentSkip to conversation

backports: Add time64_to_tm and ipv6_mc_check_mld

PATCH In review Shay Bar 2 participants 3 messages Nov 10, 2020 – Nov 15, 2020

lore
Share & tools
lore

Shay Bar

author
#0 lore raw

PATCH 1/1 backports: Add time64_to_tm and ipv6_mc_check_mld

ipv6_mc_check_mld() was added in kernel version 4.2.0. The 2nd parameter was removed in kernel version 5.1.0.

time64_to_tm() was added in kernel version 4.8.0.

---
 backport/backport-include/linux/time.h   |  8 ++++++++
 backport/backport-include/net/addrconf.h | 15 +++++++++++++++
 2 files changed, 23 insertions(+)
backport/backport-include/linux/time.h +8 -0
index 3191047d..ce8a1b03 100644
@@ -4,4 +4,12 @@
 
 #include <linux/time64.h>
 
+#if LINUX_VERSION_IS_LESS(4,8,0)
+static inline void time64_to_tm(time64_t totalsecs, int offset,
+				struct tm *result)
+{
+	time_to_tm((time_t)totalsecs, 0, result);
+}
+#endif
+
 #endif /* __BACKPORT_LINUX_TIME_H */
backport/backport-include/net/addrconf.h +15 -0
index f1e8e627..67d44e19 100644
@@ -22,4 +22,19 @@ static inline bool ipv6_addr_is_solict_mult(const struct in6_addr *addr)
 }
 #endif /* LINUX_VERSION_IS_LESS(3,9,0) */
 
+#if LINUX_VERSION_IS_LESS(4,2,0)
+static inline int ipv6_mc_check_mld(struct sk_buff *skb)
+{
+	WARN_ON(1);
+
+	return -1;
+}
+#elif LINUX_VERSION_IS_LESS(5,1,0)
+static inline int backport_ipv6_mc_check_mld(struct sk_buff *skb)
+{
+	return ipv6_mc_check_mld(skb, NULL);
+}
+#define ipv6_mc_check_mld LINUX_BACKPORT(ipv6_mc_check_mld)
+#endif
+
 #endif	/* _BACKPORT_NET_ADDRCONF_H */
Signature · 4 lines
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in
#1 lore raw
Quoted 6 lines · Shay Bar

ipv6_mc_check_mld() was added in kernel version 4.2.0. The 2nd parameter was removed in kernel version 5.1.0.

time64_to_tm() was added in kernel version 4.8.0.

Hi Shay,

Where are these functions used? I can not find ayn wifi driver in kernel 5.10 using it.

Hauke

author
#2 lore raw

Hi Hauke,

Indeed, no wifi driver is currently using them, but we plan to commit our new driver (that uses it) to the kernel.

Should I ping this patch again once we upstream or can you already accept it now ?

Thanks,
Shay.
--
To unsubscribe from this list: send the line "unsubscribe backports" in