All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Hartmann <andihartmann@freenet.de>
To: linux-wireless <linux-wireless@vger.kernel.org>
Subject: Modifications to RT5572_LinuxSTA_2.6.1.3_20121022 to get it working with actual kernels. Fix for Linux 4.1.
Date: Tue, 30 Jun 2015 19:40:37 +0200	[thread overview]
Message-ID: <5592D495.10603@maya.org> (raw)
In-Reply-To: <54CA3CC2.1080109@maya.org>

[-- Attachment #1: Type: text/plain, Size: 533 bytes --]

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


[-- Attachment #2: rt_linux_4,1.c.diff --]
[-- Type: text/x-patch, Size: 1161 bytes --]

--- 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,

           reply	other threads:[~2015-06-30 17:53 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <54CA3CC2.1080109@maya.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5592D495.10603@maya.org \
    --to=andihartmann@freenet.de \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.