From 1ae92418ba8002c6eb77eda34cc0f998fc9ef094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20En=C3=9Flin?= Date: Tue, 16 Jun 2020 12:04:46 +0200 Subject: [PATCH] let core reject the unsupported coalescing parameters (#5) Set ethtool_ops->supported_coalesce_params to let the core reject unsupported coalescing parameters. Required for Linux 5.7 support; otherwise, driver initialization will fail with 'couldn't register device' (errno 22). See upstream kernel commit id 9000edb71ab29d184aa33f5a77fa6e52d8812bb9 for more pieces of info. --- r8152.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/r8152.c b/r8152.c index 1037849..e706c35 100644 --- a/r8152.c +++ b/r8152.c @@ -17134,6 +17134,9 @@ static int rtl8152_set_ringparam(struct net_device *netdev, } static const struct ethtool_ops ops = { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) + .supported_coalesce_params = ETHTOOL_COALESCE_USECS, +#endif .get_drvinfo = rtl8152_get_drvinfo, #if LINUX_VERSION_CODE < KERNEL_VERSION(4,20,0) .get_settings = rtl8152_get_settings,