Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.o
*.ko
*.mod.c
*.cmd
modules.order
Module.symvers
.*.swp
.tmp_versions
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
EXTRA_CFLAGS += -O1
EXTRA_CFLAGS += -O3
#EXTRA_CFLAGS += -O3
#EXTRA_CFLAGS += -Wall
#EXTRA_CFLAGS += -Wextra
Expand All @@ -14,7 +14,7 @@ EXTRA_CFLAGS += -Wno-unused-parameter
EXTRA_CFLAGS += -Wno-unused-function
EXTRA_CFLAGS += -Wno-unused
#EXTRA_CFLAGS += -Wno-uninitialized
#EXTRA_CFLAGS += -Wno-error=date-time # Fix compile error on gcc 4.9 and later
EXTRA_CFLAGS += -Wno-error=date-time # Fix compile error on gcc 4.9 and later

EXTRA_CFLAGS += -I$(src)/include
EXTRA_CFLAGS += -I$(src)/hal/phydm
Expand Down Expand Up @@ -919,7 +919,7 @@ ARCH ?= $(SUBARCH)
CROSS_COMPILE ?=
KVER := $(shell uname -r)
KSRC := /lib/modules/$(KVER)/build
MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/rtl8723bs/
INSTALL_PREFIX :=
endif

Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
# Realtek 8723bs Linux WIFI driver
# Realtek 8723bs Linux WIFI driver with Support for Baytrail Tablets

tested on Trekstor Surftab Wintron 10.1

To cross-compile for ARM (eg. for a @NextThing CHIP), do something like this:

````
make CONFIG_PLATFORM_ARM_SUNXI=y ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /path/to/kernel_compile_O_dir M=$PWD CONFIG_RTL8723BS=m -j$(nproc)
make CONFIG_PLATFORM_ARM_SUNXI=y ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /path/to/kernel_compile_O_dir M=$PWD CONFIG_RTL8723BS=m INSTALL_MOD_PATH=/tmp/chiplinux modules_install
```

To compile for the host, do something like this:

```
sudo apt-get install build-essential linux-headers-generic git
git clone https://github.com/muhviehstah/rtl8723bs.git
cd rtl8723bs
make
sudo make install
sudo depmod -a
sudo modprobe 8723bs
```
4 changes: 2 additions & 2 deletions include/autoconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
/*
* Debug Related Config
*/
#define CONFIG_DEBUG
#undef CONFIG_DEBUG

#ifdef CONFIG_DEBUG
#define DBG 1 // for ODM & BTCOEX debug
Expand All @@ -303,4 +303,4 @@
#define DBG_CHECK_FW_PS_STATE
#define DBG_CHECK_FW_PS_STATE_H2C
//#define CONFIG_FW_C2H_DEBUG
/* #define CONFIG_GPIO_API */
/* #define CONFIG_GPIO_API */
5 changes: 5 additions & 0 deletions include/osdep_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
#define BIT(x) ( 1 << (x))
#endif

#include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
#include <linux/sched/signal.h>
#endif

#define BIT0 0x00000001
#define BIT1 0x00000002
#define BIT2 0x00000004
Expand Down
7 changes: 7 additions & 0 deletions include/rtw_wifi_regd.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
#ifndef __RTW_WIFI_REGD_H__
#define __RTW_WIFI_REGD_H__

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
#define ieee80211_band nl80211_band
#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
#define IEEE80211_BAND_5GHZ NL80211_BAND_5GHZ
#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
#endif

struct country_code_to_enum_rd {
u16 countrycode;
const char *iso_name;
Expand Down
9 changes: 9 additions & 0 deletions os_dep/linux/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -2036,6 +2036,11 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
void rtw_cfg80211_indicate_scan_done(_adapter *adapter, bool aborted)
{
struct rtw_wdev_priv *pwdev_priv = adapter_wdev_data(adapter);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
struct cfg80211_scan_info info = {
.aborted = aborted
};
#endif
_irqL irqL;

_enter_critical_bh(&pwdev_priv->scan_req_lock, &irqL);
Expand All @@ -2051,7 +2056,11 @@ void rtw_cfg80211_indicate_scan_done(_adapter *adapter, bool aborted)
}
else
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
cfg80211_scan_done(pwdev_priv->scan_request, &info);
#else
cfg80211_scan_done(pwdev_priv->scan_request, aborted);
#endif
}

pwdev_priv->scan_request = NULL;
Expand Down
2 changes: 1 addition & 1 deletion os_dep/linux/ioctl_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -13855,7 +13855,7 @@ static int rtw_ioctl_standard_wext_private(struct net_device *dev, struct ifreq
static int rtw_ioctl_wext_private(struct net_device *dev, struct ifreq *rq)
{
#ifdef CONFIG_COMPAT
if(is_compat_task())
if(in_compat_syscall())
return rtw_ioctl_compat_wext_private( dev, rq );
else
#endif // CONFIG_COMPAT
Expand Down
2 changes: 1 addition & 1 deletion os_dep/linux/rtw_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
goto exit;
}
#ifdef CONFIG_COMPAT
if (is_compat_task()) {
if (in_compat_syscall()) {
/* User space is 32-bit, use compat ioctl */
compat_android_wifi_priv_cmd compat_priv_cmd;

Expand Down
Binary file added rtl8723bs_ap_wowlan.bin
Binary file not shown.
Binary file added rtl8723bs_bt.bin
Binary file not shown.
Binary file added rtl8723bs_nic.bin
Binary file not shown.
Binary file added rtl8723bs_wowlan.bin
Binary file not shown.