From patchwork Tue Jun 30 17:40:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Hartmann X-Patchwork-Id: 6697801 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E33C99F1C1 for ; Tue, 30 Jun 2015 17:53:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1B5852062A for ; Tue, 30 Jun 2015 17:53:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D82982063F for ; Tue, 30 Jun 2015 17:53:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751591AbbF3Rxq (ORCPT ); Tue, 30 Jun 2015 13:53:46 -0400 Received: from mout1.freenet.de ([195.4.92.91]:59137 "EHLO mout1.freenet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753185AbbF3Rxf (ORCPT ); Tue, 30 Jun 2015 13:53:35 -0400 X-Greylist: delayed 585 seconds by postgrey-1.27 at vger.kernel.org; Tue, 30 Jun 2015 13:53:35 EDT Received: from [195.4.92.142] (helo=mjail2.freenet.de) by mout1.freenet.de with esmtpa (ID andihartmann@freenet.de) (port 25) (Exim 4.85 #1) id 1Z9zZU-0003vz-8w for linux-wireless@vger.kernel.org; Tue, 30 Jun 2015 19:43:48 +0200 Received: from localhost ([::1]:41191 helo=mjail2.freenet.de) by mjail2.freenet.de with esmtpa (ID andihartmann@freenet.de) (Exim 4.85 #1) id 1Z9zZT-0001cM-V1 for linux-wireless@vger.kernel.org; Tue, 30 Jun 2015 19:43:48 +0200 Received: from mx11.freenet.de ([195.4.92.21]:49843) by mjail2.freenet.de with esmtpa (ID andihartmann@freenet.de) (Exim 4.85 #1) id 1Z9zWS-0005GE-Ch for linux-wireless@vger.kernel.org; Tue, 30 Jun 2015 19:40:40 +0200 Received: from pd9eaeadb.dip0.t-ipconnect.de ([217.234.234.219]:50915 helo=mail.maya.org) by mx11.freenet.de with esmtpsa (ID andihartmann@freenet.de) (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (port 587) (Exim 4.85 #1) id 1Z9zWS-000374-4v for linux-wireless@vger.kernel.org; Tue, 30 Jun 2015 19:40:40 +0200 Received: from [192.168.1.6] (dualc.maya.org [192.168.1.6]) by mail.maya.org (8.14.7/8.13.8) with ESMTP id t5UHcmiE008050 for ; Tue, 30 Jun 2015 19:38:48 +0200 Message-ID: <5592D495.10603@maya.org> Date: Tue, 30 Jun 2015 19:40:37 +0200 From: Andreas Hartmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: linux-wireless Subject: Modifications to RT5572_LinuxSTA_2.6.1.3_20121022 to get it working with actual kernels. Fix for Linux 4.1. References: <54B627E3.6040707@maya.org> <54B629C7.6020601@maya.org> <54BE37F6.2090604@maya.org> <54CA3CC2.1080109@maya.org> In-Reply-To: <54CA3CC2.1080109@maya.org> X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_TVD_MIME_EPI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Originated-At: 217.234.234.219!50915 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, this patch fixes RT5572_LinuxSTA_2.6.1.3_20121022 to get it working with Linux 4.1. W/o this patch, the driver can't read /etc/Wireless/RT2870STA/RT2870STA.dat anymore and therefore the driver defaults to 802.11g e.g. Reason: After commit 5d5d56897530 ("make new_sync_{read,write}() static") ->read() cannot be called directly any more. Here you can find all old existing patches for other kernel versions: [1] Regards, Andreas [1] http://news.gmane.org/find-root.php?group=gmane.linux.drivers.rt2x00.user&article=2670 --- a/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/rt_linux.c 2015-01-29 14:40:35.891324646 +0100 +++ b/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/rt_linux.c 2015-06-28 08:10:18.556116310 +0200 @@ -1126,22 +1126,33 @@ int RtmpOSFileRead(RTMP_OS_FD osfd, char *pDataPtr, int readLen) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) /* The object must have a read method */ if (osfd->f_op && osfd->f_op->read) { return osfd->f_op->read(osfd, pDataPtr, readLen, &osfd->f_pos); } else { DBGPRINT(RT_DEBUG_ERROR, ("no file read method\n")); +#else + if (osfd && osfd->f_mode & FMODE_CAN_READ) { + return __vfs_read(osfd, pDataPtr, readLen, &osfd->f_pos); + } else { + DBGPRINT(RT_DEBUG_ERROR, ("no file read method\n")); +#endif return -1; } } int RtmpOSFileWrite(RTMP_OS_FD osfd, char *pDataPtr, int writeLen) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) return osfd->f_op->write(osfd, pDataPtr, ( size_t) writeLen, &osfd->f_pos); +#else + return __vfs_write(osfd, pDataPtr, (size_t) writeLen, &osfd->f_pos); +#endif } static inline void __RtmpOSFSInfoChange(OS_FS_INFO * pOSFSInfo,