[PATCH v3 0/2] rtw88: update regulatory settings

2019-10-22 Thread yhchuang
From: Yan-Hsuan Chuang Set regulatory according to hints from kernel, and allows to report WW country code, by wiphy_apply_custom_regulatory(). Also add a Kconfig to let user to config if NL80211_REGDOM_SET_BY_USER is allowed. Refer to the commit log for more details v2 -> v3 * split patch se

[PATCH v3 2/2] rtw88: support dynamic user regulatory setting

2019-10-22 Thread yhchuang
From: Tzu-En Huang Add support for regulatory set by NL80211_REGDOM_SET_BY_USER. This should only be enabled for distributions that need set Realtek's card regulatory from userspace. Signed-off-by: Tzu-En Huang Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/Kconfig | 1

[PATCH v3 1/2] rtw88: add regulatory process strategy for different chipset

2019-10-22 Thread yhchuang
From: Tzu-En Huang There are two kinds of country/regulatory efuse settings for Realtek's chipset, one is worldwide and the other is a specific country. For both settings, REGULATORY_STRICT_REG will be set, telling stack that devices original regulatory is the superset of any further settings. F

[PATCH v3 5/5] rtw88: add phy_info debugfs to show Tx/Rx physical status

2019-10-22 Thread yhchuang
From: Tsang-Shian Lin This commit adds several Tx/Rx physical information to phy_info debugfs for 8822B/8822C. By this debugfs, we can know physical information, such as Tx/Rx rate, RSSI, EVM,SNR, etc. The information is gotten from the packets of Tx/Rx path. It has no impact for the performance

[PATCH v3 2/5] rtw88: add power tracking support

2019-10-22 Thread yhchuang
From: Tzu-En Huang The temperature of the chip can affect the output power of the RF components. Hence driver requires to compensate the power by adjusting the power index recorded in the power swing table. And if the difference of current thermal value to the default thermal value exceeds a thr

[PATCH v3 4/5] rtw88: add set_bitrate_mask support

2019-10-22 Thread yhchuang
From: Tzu-En Huang Support setting bit rate from upper layer. After configuring the original rate control result in the driver, the result is then masked by the bit rate mask received from the ops set_bitrate_mask. Lastly, the masked result will be sent to firmware. Signed-off-by: Tzu-En Huang

[PATCH v3 1/5] rtw88: use macro to check the current band

2019-10-22 Thread yhchuang
From: Yan-Hsuan Chuang Add macros to see which band we are, based on the current channel. Signed-off-by: Yan-Hsuan Chuang --- v2 -> v3 * no change drivers/net/wireless/realtek/rtw88/mac.c | 2 +- drivers/net/wireless/realtek/rtw88/main.h | 13 ++ drivers/net/wireless/realtek/r

[PATCH v3 0/5] rtw88: minor throughput improvement

2019-10-22 Thread yhchuang
From: Yan-Hsuan Chuang This patchset mainly adds support for beamforming and power tracking. Power tracking can monitor the thermal value of the device and adjust corresponding power indexes, to make sure the RF output power is expected. And another thing is to add a debugfs for physical layer i

[PATCH v3 3/5] rtw88: Enable 802.11ac beamformee support

2019-10-22 Thread yhchuang
From: Tzu-En Huang Enable MU-MIMO transmit beamformee support for chipset 8822b and 8822c. If the driver is in station mode and associated with an AP, and the capabilities of both meet the requirement of beamforming, driver will run as a beamformee and the corresponding chip settings will be set

[PATCH v2 6/6] rtw88: add phy_info debugfs to show Tx/Rx physical status

2019-10-16 Thread yhchuang
From: Tsang-Shian Lin This commit adds several Tx/Rx physical information to phy_info debugfs for 8822B/8822C. By this debugfs, we can know physical information, such as Tx/Rx rate, RSSI, EVM,SNR, etc. The information is gotten from the packets of Tx/Rx path. It has no impact for the performance

[PATCH v2 5/6] rtw88: add set_bitrate_mask support

2019-10-16 Thread yhchuang
From: Tzu-En Huang Support setting bit rate from upper layer. After configuring the original rate control result in the driver, the result is then masked by the bit rate mask received from the ops set_bitrate_mask. Lastly, the masked result will be sent to firmware. Signed-off-by: Tzu-En Huang

[PATCH v2 4/6] rtw88: update regulatory settings implementaion

2019-10-16 Thread yhchuang
From: Tzu-En Huang There are two kinds of country/regulatory efuse settings for Realtek's chipset, one is worldwide and the other is a specific country. For the chipset with the country setting being a specific country, driver needs to ensure that the setting will not be modified when connecting

[PATCH v2 2/6] rtw88: add power tracking support

2019-10-16 Thread yhchuang
From: Tzu-En Huang The temperature of the chip can affect the output power of the RF components. Hence driver requires to compensate the power by adjusting the power index recorded in the power swing table. And if the difference of current thermal value to the default thermal value exceeds a thr

[PATCH v2 3/6] rtw88: Enable 802.11ac beamformee support

2019-10-16 Thread yhchuang
From: Tzu-En Huang Enable MU-MIMO transmit beamformee support for chipset 8822b and 8822c. If the driver is in station mode and associated with an AP, and the capabilities of both meet the requirement of beamforming, driver will run as a beamformee and the corresponding chip settings will be set

[PATCH v2 0/6] rtw88: minor throughput improvement

2019-10-16 Thread yhchuang
From: Yan-Hsuan Chuang This patchset mainly adds support for beamforming and power tracking. Power tracking can monitor the thermal value of the device and adjust corresponding power indexes, to make sure the RF output power is expected. And another thing is to add a debugfs for physical layer i

[PATCH v2 1/6] rtw88: use macro to check the current band

2019-10-16 Thread yhchuang
From: Yan-Hsuan Chuang Add macros to see which band we are, based on the current channel. Signed-off-by: Yan-Hsuan Chuang --- v1 -> v2 * Add this patch for checking current band, also used for power tracking drivers/net/wireless/realtek/rtw88/mac.c | 2 +- drivers/net/wireless/re

[PATCH 02/10] rtw88: Enable 802.11ac beamformee support

2019-10-08 Thread yhchuang
From: Tzu-En Huang Enable MU-MIMO transmit beamformee support for chipset 8822b and 8822c. If the rtw88 is in station mode and associated with an AP, and the capabilities of both meet the requirement of beamforming, driver will run as a beamformee and the corresponding chip settings will be set.

[PATCH 10/10] rtw88: add phy_info debugfs to show Tx/Rx physical status

2019-10-08 Thread yhchuang
From: Tsang-Shian Lin This commit adds several Tx/Rx physical information to phy_info debugfs for 8822B/8822C. By this debugfs, we can know physical information, such as Tx/Rx rate, RSSI, EVM,SNR, etc. The information is gotten from the packets of Tx/Rx path. It has no impact for the performance

[PATCH 04/10] rtw88: add set_bitrate_mask support

2019-10-08 Thread yhchuang
From: Tzu-En Huang Support setting bit rate from upper layer. After configuring the original rate control result in the driver, the result is then masked by the bit rate mask received from the ops set_bitrate_mask. Lastly, the masked result will be sent to firmware. Signed-off-by: Tzu-En Huang

[PATCH 08/10] rtw88: pci: config phy after chip info is setup

2019-10-08 Thread yhchuang
From: Yan-Hsuan Chuang Chip info such as cut_version is required to configure PCI phy. Move rtw_pci_phy_config after rtw_chip_info_setup. Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH 07/10] rtw88: Use rtw_write8_set to set SYS_FUNC

2019-10-08 Thread yhchuang
From: Yan-Hsuan Chuang rtw_write8 could modify the values that we do not want to change, use rtw_write8_set instead to only enable the bits of sys_func_en Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

[PATCH 09/10] rtw88: coex: Set 4 slot mode for A2DP

2019-10-08 Thread yhchuang
From: Ping-Ke Shih With shallow buffer size, certain BT devices have active A2DP flow control to fill buffer frequently. If the slot is not at BT side, data can't be sent successfully to BT devices, and will cause audio glitch. To resolve this issue, this commit splits TUs into 4-slots instead o

[PATCH 06/10] rtw88: add NL80211_EXT_FEATURE_CAN_REPLACE_PTK0 support

2019-10-08 Thread yhchuang
From: Tzu-En Huang Add support for NL80211_EXT_FEATURE_CAN_REPLACE_PTK0 feature. According to the "Hardware crypto acceleration" documentation section, when set_key() is called with %DISABLE_KEY command, for outgoing frames, we flush out frames in the queues with the old key; for incoming frames,

[PATCH 01/10] rtw88: add power tracking support

2019-10-08 Thread yhchuang
From: Tzu-En Huang The temperature of the chip can affect the output power of the RF components. Hence driver requires to compensate the power by adjusting the power index recorded in the power swing table. And if the difference of current thermal value to the default thermal value exceeds a thr

[PATCH 00/10] rtw88: minor throughput improvement

2019-10-08 Thread yhchuang
From: Yan-Hsuan Chuang This patchset mainly adds support for beamforming and power tracking. Power tracking can monitor the thermal value of the device and adjust corresponding power indexes, to make sure the RF output power is expected. And another thing is to add a debugfs for physical layer i

[PATCH 03/10] rtw88: config 8822c multicast address in MAC init flow

2019-10-08 Thread yhchuang
From: Tzu-En Huang Multicast address should be congiured in the initialization flow. The value is created by a hashed calculation that is also implemented by the hardware for multicast address filtering. Signed-off-by: Tzu-En Huang Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/real

[PATCH 05/10] rtw88: update regulatory settings implementaion

2019-10-08 Thread yhchuang
From: Tzu-En Huang There are two kinds of country/regulatory efuse settings for Realtek's chipset, one is worldwide and the other is a specific country. For the chipset with the country setting being a specific country, driver needs to ensure that the setting will not be modified when connecting

[PATCH 14/14] rtw88: fix error handling when setup efuse info

2019-10-01 Thread yhchuang
From: Ping-Ke Shih Disable efuse if the efuse is enabled when we failed to setup the efuse information, otherwise the hardware will not turn off. Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver") Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/rea

[PATCH 11/14] rtw88: raise firmware version debug level

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang It's better to print firmware version at load time. But since we need to set debug_mask properly to default print rtw_dbg(), raise the debug level to rtw_info() instead. Also change the multiple line style to one line only, it will be easier for log analyzing. Signed-off-

[PATCH 08/14] rtw88: fix beaconing mode rsvd_page memory violation issue

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang When downloading the reserved page, the first page always contains a beacon for the firmware to reference. For non-beaconing modes such as station mode, also put a blank skb with length=1. And for the beaconing modes, driver will get a real beacon with a length approximate

[PATCH 12/14] rtw88: use struct rtw_fw_hdr to access firmware header

2019-10-01 Thread yhchuang
From: Ping-Ke Shih This commit doesn't change logic at all, just use struct rtw_fw_hdr to access fixed part of 64 bytes header. Since remaining part is variable length data of actual firmware, we don't define them within the struct. Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang -

[PATCH 05/14] rtw88: report tx rate to mac80211 stack

2019-10-01 Thread yhchuang
From: Tzu-En Huang Whenever the firmware increases/decreases the bit rate used to transmit to a peer, it sends an RA report through C2H to driver. Driver can then record the bit rate in the peer's struct rtw_sta_info, and report to mac80211 when it asks us for the statistics of the sta by ieee802

[PATCH 06/14] rtw88: add TX-AMSDU support

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang Based on the mac80211's TXQ implementation, TX-AMSDU can be used to get higher MAC efficiency. To make mac80211 aggregate MSDUs, low level driver just need to leave skbs in the TXQ, and mac80211 will try to aggregate them if possible. As driver will schedule a tasklet when

[PATCH 04/14] rtw88: take over rate control from mac80211

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang We can indicate IEEE80211_HW_HAS_RATE_CONTROL to mac80211 because the hardware has its own rate control algorithm. And what driver needs to do is to choose an RA mask according the peer's capabilities. But the hardware is not able to setup BA session by itself. So driver r

[PATCH 09/14] rtw88: Don't set RX_FLAG_DECRYPTED if packet has no encryption

2019-10-01 Thread yhchuang
From: Ping-Ke Shih The value of GET_RX_DESC_SWDEC() indicates that if this RX packet requires software decryption or not. And software decryption is required when the packet was encrypted and the hardware failed to decrypt it. So, GET_RX_DESC_SWDEC() is negative does not mean that this packet is

[PATCH 13/14] rtw88: fix NSS of hw_cap

2019-10-01 Thread yhchuang
From: Ping-Ke Shih 8822C is a 2x2 11ac chip, and then NSS must be less or equal to 2. However, current nss of hw cap is 3, likes hw cap: hci=0x0f, bw=0x07, ptcl=0x03, ant_num=7, nss=3 This commit adds constraint to make sure NSS <= rf_path_num, and result looks like hw cap: hci=0

[PATCH 10/14] rtw88: configure TX queue EDCA parameters

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang Set CWmax/CWmin, TXOP and AIFS according to ieee80211_tx_queue_params. Do note that hardware has only one group of EDCA[ac] registers, if more than one vif are added, the EDCA[ac] registers will contain value of params of the most recent set by ieee80211_ops::conf_tx(). A

[PATCH 00/14] rtw88: add software TX queue support

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang This adds support for software TX queue that is provided by mac80211 stack. Also can take advantage of AMSDU, by letting it to aggregate the MSDUs in the TX queue. With software TX queue, driver can handle the rate control mechanism, by set/check the current state of the T

[PATCH 07/14] rtw88: flush hardware tx queues

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang Sometimes mac80211 will ask us to flush the hardware queues. To flush them, first we need to get the corresponding priority queues from the RQPN mapping table. Then we can check the available pages are equal to the originally reserved pages, which means the hardware has re

[PATCH 03/14] rtw88: add driver TX queue support

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang The mac80211 provides software TX queue for driver, as long as driver has hooked ieee80211_ops::wake_tx_queue. Each time a packet is queued onto the TX queue, that queue will be woken up the inform driver to serve the queue. Now driver only supports PCI interface ICs, ther

[PATCH 02/14] rtw88: allows to set RTS in TX descriptor

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang Allows driver to send RTS by filling tx descriptor. The user may want to set the rts threshold. But since we have not been taking over rate control from mac80211 to driver by setting flag IEEE80211_HW_HAS_RATE_CONTROL, there is nothing we can do about it. So here just stor

[PATCH 01/14] rtw88: check firmware leave lps successfully

2019-10-01 Thread yhchuang
From: Chin-Yen Lee Driver needs to wait for firmware to restore hardware setting to active mode after leaving lps. After getting H2C from driver for leaving lps, firmware will issue null packet without PS bit to inform AP driver is active, and then restore REG_TCR Register if AP has receiced nul

[PATCH v2 03/12] rtw88: not to enter or leave PS under IRQ

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang Remove PS related *_irqsafe functions to avoid entering/leaving PS under interrupt context. Instead, make PS decision in watch_dog. This could simplify the logic and make the code look clean. But it could have a little side-effect that if the driver is having heavy traffic

[PATCH v2 11/12] rtw88: add deep PS PG mode for 8822c

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang Compare with LCLK mode, PG mode saves more power, by turning off more circuits. Therefore, to recover from PG mode, driver needs to backup some information into rsvd page. Such as CAM entries, DPK results. As CAM entries can change, it is required to re-download CAM entrie

[PATCH v2 08/12] rtw88: add deep power save support

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang Deep power save allows firmware/hardware to operate in a lower power state. And the deep power save mode depends on LPS mode. So, before entering deep PS, driver must first enter LPS mode. Under Deep PS, most of hardware functions are shutdown, driver will not be able to r

[PATCH v2 10/12] rtw88: select deep PS mode when module is inserted

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang Add a module parameter to select deep PS mode. And the mode cannot be changed after the module has been inserted and probed. If anyone wants to change the deep mode, should change the mode and probe the device again to setup the changed deep mode. When the device is probed

[PATCH v2 06/12] rtw88: LPS enter/leave should be protected by lock

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang Protect LPS enter/leave routine with rtwdev->mutex. This helps to synchronize with driver's states correctly. Signed-off-by: Yan-Hsuan Chuang --- v1 -> v2 - rebase on top of wireless-drivers-next drivers/net/wireless/realtek/rtw88/mac80211.c | 4 ++-- drivers/net/wir

[PATCH v2 01/12] rtw88: remove redundant flag check helper function

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang These helper functions seems useless. And in some cases we want to use test_and_[set/clear]_bit, these helpers will make the code more complicated. So remove them. Signed-off-by: Yan-Hsuan Chuang --- v1 -> v2 - rebase on top of wireless-drivers-next drivers/net/wirel

[PATCH v2 09/12] rtw88: not to enter LPS by coex strategy

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang Sometimes LPS is not compatible with COEX's strategy, and COEX will not allow driver to enter it. Signed-off-by: Yan-Hsuan Chuang --- v1 -> v2 - rebase on top of wireless-drivers-next drivers/net/wireless/realtek/rtw88/ps.c | 3 +++ 1 file changed, 3 insertions(+) d

[PATCH v2 04/12] rtw88: not to control LPS by each vif

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang The original design of LPS enter/leave routines allows to control the LPS state by each interface. But the hardware cannot actually handle it that way. This means the hardware can only enter LPS once with an associated port, so there is no need to keep tracking the state of

[PATCH v2 02/12] rtw88: pci: reset H2C queue indexes in a single write

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang If the driver doesn't reset the host's and device's indexes in a single write, the indexes will become different in a short period. And it will confuse the DMA engine, make it start to process non-existed entries. Better to Write-1-to-reset the indexes, for the DMA engine

[PATCH v2 05/12] rtw88: remove unused lps state check helper

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang This is no more used, remove it. Signed-off-by: Yan-Hsuan Chuang --- v1 -> v2 - rebase on top of wireless-drivers-next drivers/net/wireless/realtek/rtw88/ps.c | 5 - drivers/net/wireless/realtek/rtw88/ps.h | 1 - 2 files changed, 6 deletions(-) diff --git a/driv

[PATCH v2 07/12] rtw88: leave PS state for dynamic mechanism

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang Dynamic mechanism requires BB/RF working to adjust hardware settings. But PS state periodically turns off BB/RF, could lead to wrong setting. So leave PS state before DM to make sure it works. And then check if we can enter PS state again. Signed-off-by: Yan-Hsuan Chuang

[PATCH v2 00/12] rtw88: Add support for deep PS mode

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang RTL8822B/RTL8822C series devices are capable of entering deep PS mode. In contrast to Leisure Power Save (LPS) which turns off RF components periodically between beacons, deep PS mode turns off more hardware circuits. But device should enter LPS before enter deep PS mode, o

[PATCH v2 12/12] rtw88: remove misleading module parameter rtw_fw_support_lps

2019-10-01 Thread yhchuang
From: Yan-Hsuan Chuang The module parameter rtw_fw_support_lps is misleading. It is not used to represent the firmware's property, but to determine if driver wants to ask firmware to enter LPS. However, driver should better enable/disable PS through cfg80211_ops::set_power_mgmt instead. For exam

[PATCH 5.4 v2] rtw88: configure firmware after HCI started

2019-09-22 Thread yhchuang
From: Yan-Hsuan Chuang After firmware has been downloaded, driver should send some information to it through H2C commands. Those H2C commands are transmitted through TX path. But before HCI has been started, the TX path is not working completely. Such as PCI interfaces, the interrupts are not en

[PATCH 06/15] rtw88: not to enter or leave PS under IRQ

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang Remove PS related *_irqsafe functions to avoid entering/leaving PS under interrupt context. Instead, make PS decision in watch_dog. This could simplify the logic and make the code look clean. But it could have a little side-effect that if the driver is having heavy traffic

[PATCH 03/15] rtw88: pci: reset H2C queue indexes in a single write

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang If the driver doesn't reset the host's and device's indexes in a single write, the indexes will become different in a short period. And it will confuse the DMA engine, make it start to process non-existed entries. Better to Write-1-to-reset the indexes, for the DMA engine

[PATCH 13/15] rtw88: select deep PS mode when module is inserted

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang Add a module parameter to select deep PS mode. And the mode cannot be changed after the module has been inserted and probed. If anyone wants to change the deep mode, should change the mode and probe the device again to setup the changed deep mode. When the device is probed

[PATCH 14/15] rtw88: add deep PS PG mode for 8822c

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang Compare with LCLK mode, PG mode saves more power, by turning off more circuits. Therefore, to recover from PG mode, driver needs to backup some information into rsvd page. Such as CAM entries, DPK results. As CAM entries can change, it is required to re-download CAM entrie

[PATCH 11/15] rtw88: add deep power save support

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang Deep power save allows firmware/hardware to operate in a lower power state. And the deep power save mode depends on LPS mode. So, before entering deep PS, driver must first enter LPS mode. Under Deep PS, most of hardware functions are shutdown, driver will not be able to r

[PATCH 15/15] rtw88: remove misleading module parameter rtw_fw_support_lps

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang The module parameter rtw_fw_support_lps is misleading. It is not used to represent the firmware's property, but to determine if driver wants to ask firmware to enter LPS. However, driver should better enable/disable PS through cfg80211_ops::set_power_mgmt instead. For exam

[PATCH 07/15] rtw88: not to control LPS by each vif

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang The original design of LPS enter/leave routines allows to control the LPS state by each interface. But the hardware cannot actually handle it that way. This means the hardware can only enter LPS once with an associated port, so there is no need to keep tracking the state of

[PATCH 00/15] rtw88: Add support for deep PS mode

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang RTL8822B/RTL8822C series devices are capable of entering deep PS mode. In contrast to Leisure Power Save (LPS) which turns off RF components periodically between beacons, deep PS mode turns off more hardware circuits. But device should enter LPS before enter deep PS mode, o

[PATCH 10/15] rtw88: leave PS state for dynamic mechanism

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang Dynamic mechanism requires BB/RF working to adjust hardware settings. But PS state periodically turns off BB/RF, could lead to wrong setting. So leave PS state before DM to make sure it works. And then check if we can enter PS state again. Signed-off-by: Yan-Hsuan Chuang

[PATCH 04/15] rtw88: pci: extract skbs free routine for trx rings

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang These skbs free routines could be used when driver wants to stop PCI bus, because some of the skbs remained in the queue may not have been returned via DMA interrupt. Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/pci.c | 36 ++

[PATCH 01/15] rtw88: remove redundant flag check helper function

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang These helper functions seems useless. And in some cases we want to use test_and_[set/clear]_bit, these helpers will make the code more complicated. So remove them. Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/coex.c | 4 ++-- drivers/net/wi

[PATCH 05/15] rtw88: pci: release tx skbs DMAed when stop

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang Interrupt is disabled to stop PCI, which means the skbs queued for each TX ring will not be released via DMA interrupt. To avoid those skbs remained being left in the skb queue until PCI has been removed, driver needs to release skbs by itself. Signed-off-by: Yan-Hsuan Chu

[PATCH 12/15] rtw88: not to enter LPS by coex strategy

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang Sometimes LPS is not compatible with COEX's strategy, and COEX will not allow driver to enter it. Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/ps.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/ps.c b

[PATCH 08/15] rtw88: remove unused lps state check helper

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang This is no more used, remove it. Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/ps.c | 5 - drivers/net/wireless/realtek/rtw88/ps.h | 1 - 2 files changed, 6 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/ps.c b/drivers/net/wir

[PATCH 09/15] rtw88: LPS enter/leave should be protected by lock

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang Protect LPS enter/leave routine with rtwdev->mutex. This helps to synchronize with driver's states correctly. Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/mac80211.c | 4 ++-- drivers/net/wireless/realtek/rtw88/main.c | 9 +++-- drivers/

[PATCH 02/15] rtw88: configure firmware after HCI started

2019-09-16 Thread yhchuang
From: Yan-Hsuan Chuang After firmware has been downloaded, driver should send some information to it through H2C commands. Those H2C commands are transmitted through TX path. But before HCI has been started, the TX path is not working completely. Such as PCI interfaces, the interrupts are not en

[PATCH] rtw88: 8822c: fix boolreturn.cocci warnings

2019-09-15 Thread yhchuang
From: Yan-Hsuan Chuang drivers/net/wireless/realtek/rtw88/rtw8822c.c:2606:9-10: WARNING: return of 0/1 in function 'rtw8822c_dpk_coef_iq_check' with return type bool Return statements in functions returning bool should use true/false instead of 1/0. Generated by: scripts/coccinelle/misc/boolretu

[PATCH 2/2] rtw88: report RX power for each antenna

2019-09-11 Thread yhchuang
From: Yan-Hsuan Chuang Report chains and chain_signal in ieee80211_rx_status. It is useful for program such as tcpdump to see if the antennas are well connected/placed. 8822C is able to receive CCK rates with 2 antennas, while 8822B can only use 1 antenna path to receive CCK rates. Signed-off-b

[PATCH 1/2] rtw88: fix wrong rx power calculation

2019-09-11 Thread yhchuang
From: Tsang-Shian Lin Fix the wrong RF path for CCK rx power calculation. Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver") Signed-off-by: Tsang-Shian Lin Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/rtw8822c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 de

[PATCH 0/2] rtw88: report RX signal strength for each antenna

2019-09-11 Thread yhchuang
From: Yan-Hsuan Chuang For some user-space programs such as tcpdump, they can parse the radiotap headers provided by the wireless device. And the signal strengths for each antenna are very helpful. They can tell us if the antennas are placed or connected properly. Tsang-Shian Lin (1): rtw88: f

[PATCH v2 5/8] rtw88: 8822c: add SW DPK support

2019-09-09 Thread yhchuang
From: Tzu-En Huang Power amplifiers are not linear components, and require DPK to reduce its nonlinearity. DPK is called Digital Pre-distortion Calibration, can be used to compensate the output of power. DPK tracking is in charge of tracking the thermal changes. And it then shifts the power curv

[PATCH v2 8/8] rtw88: allows to receive AMSDU in AMPDU

2019-09-09 Thread yhchuang
From: Yan-Hsuan Chuang The hardware has enough buffer to receive like 8K for an MPDU. So tell mac80211 that we can receive AMSDU in AMPDU. Signed-off-by: Yan-Hsuan Chuang --- v1 -> v2 * no change drivers/net/wireless/realtek/rtw88/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a

[PATCH v2 6/8] rtw88: move IQK/DPK into phy_calibration

2019-09-09 Thread yhchuang
From: Yan-Hsuan Chuang Since 8822c requires to do not only IQK, but also DPK. Move these calibrations that need to be done once the channel is determined, into phy_calibration. And note that the order of the calibrations matters, 8822c should do IQK first, then DPK. Signed-off-by: Yan-Hsuan Chu

[PATCH v2 2/8] rtw88: 8822c: update pwr_seq to v13

2019-09-09 Thread yhchuang
From: Chin-Yen Lee update sequence to v13 to reduce power consumption when MAC power off Signed-off-by: Chin-Yen Lee Signed-off-by: Yan-Hsuan Chuang --- v1 -> v2 * no change drivers/net/wireless/realtek/rtw88/rtw8822c.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/driv

[PATCH v2 1/8] rtw88: 8822c: update PHY parameter to v38

2019-09-09 Thread yhchuang
From: Yan-Hsuan Chuang Update PHY hardware parameters to v38. Signed-off-by: Yan-Hsuan Chuang --- v1 -> v2 * no change .../net/wireless/realtek/rtw88/rtw8822c_table.c| 3218 +--- 1 file changed, 2764 insertions(+), 454 deletions(-) diff --git a/drivers/net/wireless/re

[PATCH v2 4/8] rtw88: 8822c: add FW IQK support

2019-09-09 Thread yhchuang
From: Yan-Hsuan Chuang Add support for doing IQK in firmware Ideally the RF component's I/Q vectors should be orthogonal, but usually they are not. So we need to calibrate for the RF components, ex. PA/LNA, ADC/DAC. And if the I/Q vectors are more orthogonal, the mixed signal will have less dev

[PATCH v2 0/8] rtw88: enhance and stabilize T-Put performance

2019-09-09 Thread yhchuang
From: Yan-Hsuan Chuang This patch set could enhance and stabilize the throughput performance for rtw88, especially for RTL8822CE. The RFKs, such as IQK and DPK, can make sure the radio components works more reliable. They reduce the distortion and nonlinearity that the components inherently have

[PATCH v2 3/8] rtw88: 8822c: Enable interrupt migration

2019-09-09 Thread yhchuang
From: Tsang-Shian Lin Enable 8822C Tx/Rx interrupt migration. In some platforms, performance test may cause heavy cpu loading and get bad results. Interrupt migration can decrease the amount of interrupts, and lower cpu loading. Signed-off-by: Tsang-Shian Lin Signed-off-by: Yan-Hsuan Chuang --

[PATCH v2 7/8] rtw88: add dynamic cck pd mechanism

2019-09-09 Thread yhchuang
From: Tzu-En Huang This mechanism reduces the numbers of false alram in cck rate by dynamically adjusting the value of power threshold and cs_ratio. We determine the new value by three factors, which are rssi, false alarm count and igi. Based on these factors, we define the current condition into

[PATCH rebased 1/2] rtw88: pci: Move a mass of jobs in hw IRQ to soft IRQ

2019-09-03 Thread yhchuang
From: Jian-Hong Pan There is a mass of jobs between spin lock and unlock in the hardware IRQ which will occupy much time originally. To make system work more efficiently, this patch moves the jobs to the soft IRQ (bottom half) to reduce the time in hardware IRQ. Signed-off-by: Jian-Hong Pan Sig

[PATCH rebased 2/2] rtw88: pci: enable MSI interrupt

2019-09-03 Thread yhchuang
From: Yu-Yen Ting MSI interrupt should be enabled on certain platform. Add a module parameter disable_msi to disable MSI interrupt, driver will then use legacy interrupt instead. One could rebind the PCI device, probe() will pick up the new value of the module parameter. Such as: echo '000

[PATCH rebased 0/2] rtw88: pci: interrupt routine improvement

2019-09-03 Thread yhchuang
From: Yan-Hsuan Chuang This patch set includes two patches to improve PCI interrupt routine. One is to reduce HW IRQ time, the other is to enable MSI. The patches can be found at: https://patchwork.kernel.org/patch/4043/ https://patchwork.kernel.org/patch/11126007/ They were rebased properl

[PATCH v3] rtw88: pci: enable MSI interrupt

2019-09-02 Thread yhchuang
From: Yu-Yen Ting MSI interrupt should be enabled on certain platform. Add a module parameter disable_msi to disable MSI interrupt, driver will then use legacy interrupt instead. One could rebind the PCI device, probe() will pick up the new value of the module parameter. Such as: echo '000

[PATCH v3 2/3] rtw88: RTL8822C: add WoW firmware v7.3

2019-08-08 Thread yhchuang
From: Yan-Hsuan Chuang Add WoW firmware to support entering Wake on WirelessLAN mode Signed-off-by: Yan-Hsuan Chuang --- WHENCE| 1 + rtw88/rtw8822c_wow_fw.bin | Bin 0 -> 138720 bytes 2 files changed, 1 insertion(+) create mode 100755 rtw88/rtw8822c_wow_fw.bin diff --g

[PATCH v3 0/3] rtw88: update 8822c firmware files

2019-08-08 Thread yhchuang
From: Yan-Hsuan Chuang Update 8822c firmware image, and add wowlan firmware. Also add a README to describe its usage. Yan-Hsuan Chuang (3): rtw88: RTL8822C: update rtw8822c_fw.bin to v7.3 rtw88: RTL8822C: add WoW firmware v7.3 rtw88: add a README file WHENCE| 1 + r

[PATCH v3 3/3] rtw88: add a README file

2019-08-08 Thread yhchuang
From: Yan-Hsuan Chuang Add a README to describe the firmware usage, and support status Signed-off-by: Yan-Hsuan Chuang --- rtw88/README | 28 1 file changed, 28 insertions(+) create mode 100644 rtw88/README diff --git a/rtw88/README b/rtw88/README new file mode 1

[PATCH 6/8] rtw88: move IQK/DPK into phy_calibration

2019-08-07 Thread yhchuang
From: Yan-Hsuan Chuang Since 8822c requires to do not only IQK, but also DPK. Move these calibrations that need to be done once the channel is determined, into phy_calibration. And note that the order of the calibrations matters, 8822c should do IQK first, then DPK. Signed-off-by: Yan-Hsuan Chu

[PATCH 1/8] rtw88: 8822c: update PHY parameter to v38

2019-08-07 Thread yhchuang
From: Yan-Hsuan Chuang Update PHY hardware parameters to v38. Signed-off-by: Yan-Hsuan Chuang --- .../net/wireless/realtek/rtw88/rtw8822c_table.c| 3218 +--- 1 file changed, 2764 insertions(+), 454 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c_table

[PATCH 8/8] rtw88: allows to receive AMSDU in AMPDU

2019-08-07 Thread yhchuang
From: Yan-Hsuan Chuang The hardware has enough buffer to receive like 8K for an MPDU. So tell mac80211 that we can receive AMSDU in AMPDU. Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/real

[PATCH 0/8] rtw88: enhance and stabilize T-Put performance

2019-08-07 Thread yhchuang
From: Yan-Hsuan Chuang This patch set could enhance and stabilize the throughput performance for rtw88, especially for RTL8822CE. The RFKs, such as IQK and DPK, can make sure the radio components works more reliable. They reduce the distortion and nonlinearity that the components inherently have

[PATCH 4/8] rtw88: 8822c: add FW IQK support

2019-08-07 Thread yhchuang
From: Yan-Hsuan Chuang Add support for doing IQK in firmware Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/rtw8822c.c | 16 drivers/net/wireless/realtek/rtw88/rtw8822c.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/drivers/net/wireless/real

[PATCH 3/8] rtw88: 8822c: Enable interrupt migration

2019-08-07 Thread yhchuang
From: Tsang-Shian Lin Enable 8822C Tx/Rx interrupt migration. In some platforms, performance test may cause heavy cpu loading and get bad results. Interrupt migration can decrease the amount of interrupts, and lower cpu loading. Signed-off-by: Tsang-Shian Lin Signed-off-by: Yan-Hsuan Chuang --

[PATCH 7/8] rtw88: add dynamic cck pd mechanism

2019-08-07 Thread yhchuang
From: Tzu-En Huang This mechanism reduces the numbers of false alram in cck rate by dynamically adjusting the value of power threshold and cs_ratio. We determine the new value by three factors, which are rssi, false alarm count and igi. Based on these factors, we define the current condition into

[PATCH 5/8] rtw88: 8822c: add SW DPK support

2019-08-07 Thread yhchuang
From: Tzu-En Huang Power amplifiers are not linear components, and require DPK to reduce its nonlinearity. DPK is called Digital Pre-distortion Calibration, can be used to compensate the output of power. DPK tracking is in charge of tracking the thermal changes. And it then shifts the power curv

  1   2   3   4   >