From 3ba070e5e44b641ad77454239402ca34e5f4adc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Mon, 17 Apr 2023 16:52:37 +0200 Subject: [PATCH] pc_wifi: implement __crypto_xor generated dummy This function is called when decrypting RX frames on the CPU on 32 bit platforms. Since the frames are normally decrypted by the wireless LAN device and this code path is triggered rather infrequently the byte-wise implementation should not pose a performance risk. So far it was only encounter with a 7260 device when running netperf. Issue #4861. --- repos/pc/src/lib/pc_wifi/dummies.c | 14 ++++++++++++++ repos/pc/src/lib/pc_wifi/generated_dummies.c | 8 -------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/repos/pc/src/lib/pc_wifi/dummies.c b/repos/pc/src/lib/pc_wifi/dummies.c index 43d90ca827..5db7f94186 100644 --- a/repos/pc/src/lib/pc_wifi/dummies.c +++ b/repos/pc/src/lib/pc_wifi/dummies.c @@ -538,3 +538,17 @@ void cdev_init(struct cdev * cdev,const struct file_operations * fops) { lx_emul_trace(__func__); } + + +#include + +/* + * For the moment implement here as the it will otherwise clash with + * older kernel versions, 5.14.x on the PinePhone, where it is implmented + * in 'crypto/algapi.c. + */ +void __crypto_xor(u8 *dst, const u8 *src1, const u8 *src2, unsigned int len) +{ + while (len--) + *dst++ = *src1++ ^ *src2++; +} diff --git a/repos/pc/src/lib/pc_wifi/generated_dummies.c b/repos/pc/src/lib/pc_wifi/generated_dummies.c index a2a841fe8b..940e997c2a 100644 --- a/repos/pc/src/lib/pc_wifi/generated_dummies.c +++ b/repos/pc/src/lib/pc_wifi/generated_dummies.c @@ -20,14 +20,6 @@ int ___ratelimit(struct ratelimit_state * rs,const char * func) struct cpumask __cpu_active_mask; -#include - -void __crypto_xor(u8 * dst,const u8 * src1,const u8 * src2,unsigned int len) -{ - lx_emul_trace_and_stop(__func__); -} - - #include int __ethtool_get_link_ksettings(struct net_device * dev,struct ethtool_link_ksettings * link_ksettings)