Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/lwfinger/rtl8723bu
Browse files Browse the repository at this point in the history
  • Loading branch information
re-l124c41plus committed Jan 16, 2021
2 parents fd36ef7 + 9ce1c38 commit 71a1e26
Show file tree
Hide file tree
Showing 43 changed files with 519 additions and 400 deletions.
26 changes: 17 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ CONFIG_PNO_SET_DEBUG = n
CONFIG_AP_WOWLAN = n
###################### Platform Related #######################
CONFIG_PLATFORM_I386_PC = y
CONFIG_PLATFORM_FS_MX61 = n
###############################################################

CONFIG_DRVEXT_MODULE = n
Expand Down Expand Up @@ -265,6 +266,16 @@ MODDESTDIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/kernel/drivers/net/wireles
INSTALL_PREFIX :=
endif

ifeq ($(CONFIG_PLATFORM_FS_MX61), y)
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211
EXTRA_CFLAGS += -DRTW_USE_CFG80211_STA_EVENT # only enable when kernel >= 3.2
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -Wno-error=date-time
ARCH := arm
KSRC ?= $(KERNEL_SRC)
MODDESTDIR := kernel/drivers/net/wireless/
LICENSE = "GPLv2"
endif

ifneq ($(USER_MODULE_NAME),)
MODULE_NAME := $(USER_MODULE_NAME)
Expand Down Expand Up @@ -312,12 +323,10 @@ $(MODULE_NAME)-y += $(_HAL_INTFS_FILES)
$(MODULE_NAME)-y += $(_OUTSRC_FILES)
$(MODULE_NAME)-y += $(_PLATFORM_FILES)

obj-$(CONFIG_RTL8723BU) := $(MODULE_NAME).o
obj-m := $(MODULE_NAME).o

else

export CONFIG_RTL8723BU = m

all: modules

modules:
Expand All @@ -328,13 +337,12 @@ strip:

install:
install -p -m 644 -D $(MODULE_NAME).ko $(MODDESTDIR)$(MODULE_NAME).ko
ifeq ($(INSTALL_MOD_PATH),)
$(DEPMOD) -a ${KVER}
else
$(DEPMOD) -b "$(INSTALL_MOD_PATH)" -a ${KVER}
endif
$(DEPMOD) -a ${KVER}
install rtl8723b_fw.bin -D $(FW_DIR)/rtl8723b_fw.bin

modules_install:
$(MAKE) INSTALL_MOD_DIR=$(MODDESTDIR) -C $(KSRC) M=$(shell pwd) modules_install

uninstall:
rm -f $(MODDESTDIR)$(MODULE_NAME).ko
$(DEPMOD) -a ${KVER}
Expand All @@ -354,6 +362,6 @@ clean:
cd platform ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
rm -fr Module.symvers ; rm -fr Module.markers ; rm -fr modules.order
rm -fr *.mod.c *.mod *.o .*.cmd *.ko *~
rm -fr .tmp_versions
rm -fr .tmp_versions .cache.mk
endif

56 changes: 40 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,59 @@
Driver for Realtek RTL8723BU Wireless Adapter with Hardware ID `0bda:b720`

# How to use?
## a. Concurrent Mode
If you want to operate the hardware as a station AND as an access point *simultaneously*, follow these instructions. This will show two devices when you run the `iwconfig` command.

Run the following commands in the Linux terminal.

## Get the source first.
Get it from Github repository with the following command in the Linux terminal.
```
git clone https://github.com/lwfinger/rtl8723bu.git
cd rtl8723bu
make
sudo make install
sudo modprobe -v 8723bu
```
Or get it as zip archive. Note: If you use the zip format, you will need to download the entire source EVERY time it is changed. By contrast,
a 'git pull' will get only the changed part. In addition, the git version will be able to access all branches, whereas the zip version only
handles one branch.
```
wget https://github.com/lwfinger/rtl8723bu/archive/master.zip
unzip master.zip && rm master.zip
cd rtl8723bu-master
...
Note: The code in branch v4.3.16 is better than that in master. Get that with
git clone https://github.com/lwfinger/rtl8723bu.git -b v4.3.16
```
## Concurrent or Non-Concurrent Mode
By default driver operates the hardware as a station AND as an access point *simultaneously*. This will show two devices when you run the `iwconfig` command.

## b. Non Concurrent Mode
If you do not want two devices (station and an access point) separately, then follow these instructions.
If you do not want two devices (station and an access point) *simultaneously*, then follow these instructions.

Step - 1: Run the following commands in the Linux terminal.
- Step 1: Run the following command in the Linux terminal.
```
git clone https://github.com/lwfinger/rtl8723bu.git
cd rtl8723bu
nano Makefile
```

Step - 2: Find the line that contains `EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE` and insert a `#` symbol at the beginning of that line. This comments that line and disables concurrent mode.
- Step 2: Find the line that contains `EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE` and insert a `#` symbol at the beginning of that line. This comments that line and disables concurrent mode.

Step - 3: Now, run the following commands in the same Linux terminal.

## Manual install
Run the following commands in the Linux terminal.

```
make
sudo make install
sudo modprobe -v 8723bu
```
This driver can not work with the standard driver rtl8xxxu, thus you need to blacklist it. Run the following command
...
sudo nano /etc/modprobe.d/50-rtl8xxxu.conf
...
Add a single line: blacklist rtl8xxxu
...
## Automatic install using DKMS
If you don't want to worry about building/installing driver after kernel update, use this scenario. For Ubuntu/Debian install DKMS package using command `sudo apt install dkms`.

Then run following commands in terminal
```
source dkms.conf
sudo mkdir /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
sudo cp -r core hal include os_dep platform dkms.conf Makefile rtl8723b_fw.bin /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
sudo dkms add $PACKAGE_NAME/$PACKAGE_VERSION
sudo dkms autoinstall $PACKAGE_NAME/$PACKAGE_VERSION
```

2 changes: 1 addition & 1 deletion core/rtw_ap.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d
u8 bmatch = _FALSE;
u8 *pie = pnetwork->IEs;
u8 *p=NULL, *dst_ie=NULL, *premainder_ie=NULL, *pbackup_remainder_ie=NULL;
u32 i, offset, ielen, ie_offset, remainder_ielen = 0;
u32 i, offset, ielen = 0, ie_offset, remainder_ielen = 0;

for (i = sizeof(NDIS_802_11_FIXED_IEs); i < pnetwork->IELength;)
{
Expand Down
2 changes: 1 addition & 1 deletion core/rtw_btcoex.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ u8 rtw_btcoex_IsBtDisabled(PADAPTER padapter)
void rtw_btcoex_Handler(PADAPTER padapter)
{
#if defined(CONFIG_CONCURRENT_MODE)
if (padapter->adapter_type != PRIMARY_ADAPTER)
if (padapter->adapter_type != PRIMARYadapter)
return;
#endif

Expand Down
8 changes: 4 additions & 4 deletions core/rtw_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)

#ifdef CONFIG_CONCURRENT_MODE
//change pcmdpriv to primary's pcmdpriv
if (padapter->adapter_type != PRIMARY_ADAPTER && padapter->pbuddy_adapter)
if (padapter->adapter_type != PRIMARYadapter && padapter->pbuddy_adapter)
pcmdpriv = &(padapter->pbuddy_adapter->cmdpriv);
#endif

Expand Down Expand Up @@ -1900,7 +1900,7 @@ u8 rtw_dynamic_chk_wk_cmd(_adapter*padapter)
//only primary padapter does this cmd
/*
#ifdef CONFIG_CONCURRENT_MODE
if (padapter->adapter_type != PRIMARY_ADAPTER && padapter->pbuddy_adapter)
if (padapter->adapter_type != PRIMARYadapter && padapter->pbuddy_adapter)
pcmdpriv = &(padapter->pbuddy_adapter->cmdpriv);
#endif
*/
Expand Down Expand Up @@ -2178,7 +2178,7 @@ static void collect_traffic_statistics(_adapter *padapter)
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);

#ifdef CONFIG_CONCURRENT_MODE
if (padapter->adapter_type != PRIMARY_ADAPTER)
if (padapter->adapter_type != PRIMARYadapter)
return;
#endif

Expand Down Expand Up @@ -2939,7 +2939,7 @@ u8 rtw_ps_cmd(_adapter*padapter)


#ifdef CONFIG_CONCURRENT_MODE
if (padapter->adapter_type != PRIMARY_ADAPTER)
if (padapter->adapter_type != PRIMARYadapter)
goto exit;
#endif

Expand Down
8 changes: 6 additions & 2 deletions core/rtw_mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,11 @@ inline void rtw_indicate_scan_done( _adapter *padapter, bool aborted)
#ifdef CONFIG_IPS_CHECK_IN_WD
_set_timer(&padapter->mlmepriv.dynamic_chk_timer, 1);
#else // !CONFIG_IPS_CHECK_IN_WD
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_rtw_set_pwr_state_check_timer(pwrpriv, 1);
#else
_rtw_set_pwr_state_check_timer(padapter, 1);
#endif
#endif // !CONFIG_IPS_CHECK_IN_WD
}
#endif // CONFIG_IPS
Expand Down Expand Up @@ -3663,8 +3667,8 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
if (stbc_rx_enable)
ht_capie.cap_info |= cpu_to_le16(IEEE80211_HT_CAP_RX_STBC_1R);//RX STBC One spatial stream

set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_1R);
break;
set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_1R);
break;

case RF_2T2R:
case RF_1T2R:
Expand Down
2 changes: 1 addition & 1 deletion core/rtw_mlme_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
ptable->func = &OnAuth;
else
ptable->func = &OnAuthClient;
//pass through
__attribute__ ((__fallthrough__));/* FALL THRU */
case WIFI_ASSOCREQ:
case WIFI_REASSOCREQ:
_mgt_dispatcher(padapter, ptable, precv_frame);
Expand Down
Loading

1 comment on commit 71a1e26

@lwfinger
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your Makefile patch seems to be reversed.

Why is this necessary?

Please sign in to comment.