From patchwork Sat Feb 2 01:02:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Francesco Napoleoni X-Patchwork-Id: 10793943 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F1D98922 for ; Sat, 2 Feb 2019 01:18:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAEA433001 for ; Sat, 2 Feb 2019 01:18:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD25333008; Sat, 2 Feb 2019 01:18:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1125333001 for ; Sat, 2 Feb 2019 01:18:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726488AbfBBBR5 (ORCPT ); Fri, 1 Feb 2019 20:17:57 -0500 Received: from relaygw2-20.mclink.it ([195.78.211.234]:48828 "EHLO relaygw2-20.mclink.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726067AbfBBBR5 (ORCPT ); Fri, 1 Feb 2019 20:17:57 -0500 X-Greylist: delayed 900 seconds by postgrey-1.27 at vger.kernel.org; Fri, 01 Feb 2019 20:17:56 EST Received: from smtpoutgw2.mclink.it ([172.24.30.42] verified) by relaygw2-20.mclink.it (CommuniGate Pro SMTP 6.0.4) with ESMTP id 144375177 for linux-wireless@vger.kernel.org; Sat, 02 Feb 2019 02:02:53 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BPCwCi61Rc/0WQy9VkHQEBHwUBDAGBSIICgVgShCqIeZAolRyBZw2HfiM4EgEDAQECAQECbSiFdEhKIQIRAYQDggUBqHCBL4oSEw+MV4FAP4N1hRcLWoI8glcComcJgTNAglGCAIwLkkCbe4FdISiBLk2DYIInF44fQYsPgksBAQ Received: from adsl203-144-069.mclink.it (HELO afrodite.mst.cosmic-odyssey.net) ([213.203.144.69]) by smtpoutgw2.mclink.it with ESMTP/TLS/AES256-GCM-SHA384; 02 Feb 2019 02:02:52 +0100 From: Francesco Napoleoni To: linux-wireless@vger.kernel.org Subject: Compilation error in rtl8821ce driver and possible fix Date: Sat, 02 Feb 2019 02:02:46 +0100 Message-ID: <4491429.ZAENLmHWg6@afrodite.mst.cosmic-odyssey.net> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi A few days ago I downloaded rtl8821ce wireless network driver from endlessm/ linux repository (master branch), and I managed to build module for kernel 4.19.16 on my Linux laptop, a HP 15-DB0035NL with an AMD Ryzen 5 2500U CPU. When upgrading to kernel 4.20.5 I could not build the module anymore, the compilation stopped with an error about the use of get_monotonic_boottime() function, which apparently was deprecated and has been removed. I’m no expert in kernel development, however I discovered that such function has been superseded by ktime_get_boottime_ts64(), and so I tried to use it in place of get_monotonic_boottime(). The resulting code compiled correctly, and the module seems to load and work without problem. The code I changed is in the rtl8821ce/os_dep/linux/ioctl_cfg80211.c (lines 338-339), you can find a patchfile attached here. Sorry for any mistake I may have done in this report, this is the first time I do such a thing. greetings Francesco Napoleoni --- ioctl_cfg80211.c.old 2019-02-02 01:15:41.407123709 +0100 +++ ioctl_cfg80211.c 2019-02-02 01:16:18.459536625 +0100 @@ -335,8 +335,8 @@ static u64 rtw_get_systime_us(void) { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) - struct timespec ts; - get_monotonic_boottime(&ts); + struct timespec64 ts; + ktime_get_boottime_ts64(&ts); return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000; #else struct timeval tv;