[Bug 204521] [new driver] [request] Port rtsx from OpenBSD to FreeBSD

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Jun 14 09:33:40 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204521

gnikl at justmail.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gnikl at justmail.de

--- Comment #217 from gnikl at justmail.de ---
(In reply to commit-hook from comment #202)

Build fails on 11.3. With the following patch the build succeeds:

--cut--
--- rtsx.c~     2020-06-11 16:47:01.000000000 +0200
+++ rtsx.c      2020-06-14 10:51:27.873097000 +0200
@@ -37,10 +37,12 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");

+#include <sys/types.h>
 #include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
 #include <sys/module.h>
 #include <sys/errno.h>
-#include <sys/kernel.h>
 #include <sys/bus.h>
 #include <sys/endian.h>
 #include <machine/bus.h>
--cut--

Note: The missing piece is "#include <sys/systm.h>". The other includes and the
reordering are gleaned from other kernel sources referencing eg. bootverbose. I
have no idea if there is a preferred include order.

Now the more interesting part: the driver works successfully with this device
in a Fujitsu H730 laptop:

rtsx0 at pci0:4:0:0:       class=0xff0000 card=0x187f10cf chip=0x522710ec rev=0x01
hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTS5227 PCI Express Card Reader'

The card status is detected properly, the inversion switch is not required.
Reading from a msdosfs formatted 2GB card worked fine. Writing and
suspend/resume was not tested yet.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list