Skip to content

Commits on Dec 1, 2022

  1. wifi: rtw89: add HE radiotap for monitor mode

    With basic HE radiotap, we can check data rate in sniffer data. To store
    the radiotap data, we reserve headroom of aligned 64 bytes, and then
    update HE radiotap in monitor mode, so it doesn't affect performance in
    normal mode.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20221125072416.94752-3-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Dec 1, 2022

Commits on Nov 9, 2022

  1. wifi: rtw89: 8852b: change debug mask of message of no TX resource

    8852B has smaller TX FIFO than others in WiFi chip, so it would be buffer
    full frequently, but it doesn't affect TX performance. However, it shows
    verbose debug messages with RTW89_DBG_UNEXP mask that is used to indicate
    abnormal behavior, so change debug mask to RTW89_DBG_TXRX for 8852B.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20221108014230.11068-1-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Nov 9, 2022

Commits on Nov 1, 2022

  1. wifi: rtw89: add WoWLAN function support

    WoWLAN is a feature which allows devices to be woken up from suspend
    state through WLAN events.
    
    When user enables WoWLAN feature and then let the device enter suspend
    state, WoWLAN firmware will be loaded by the driver and periodically
    monitors WiFi packets. Power consumption of WiFi chip will be reduced
    in this state.
    
    We now implement WoWLAN function in rtw8852ae and rtw8852ce chip.
    Currently supported WLAN events include receiving magic packet,
    rekey packet and deauth packet, and disconnecting from AP.
    
    Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20221027052707.14605-7-pkshih@realtek.com
    Chin-Yen Lee authored and Kalle Valo committed Nov 1, 2022

Commits on Sep 28, 2022

  1. wifi: rtw89: pci: set power cut closed for 8852be

    Entering LPS with PCIe APHY power cut closed would cause PCIe link issue.
    To avoid the combinational issue, keep PCIe APHY power cut always on.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220927062611.30484-7-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Sep 28, 2022
  2. wifi: rtw89: pci: add to do PCI auto calibration

    8852be needs this with n times calibration to correct hardware clock.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220927062611.30484-6-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Sep 28, 2022
  3. wifi: rtw89: add DMA busy checking bits to chip info

    8852B has less DMA channels, so its checking bits are different from other
    chips.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220927062611.30484-4-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Sep 28, 2022
  4. wifi: rtw89: pci: mask out unsupported TX channels

    8852BE doesn't support some TX channels, so mask them out, or it access
    undefined registers.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220927062611.30484-2-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Sep 28, 2022

Commits on Sep 19, 2022

  1. wifi: rtw89: pci: update LTR settings

    Modify PCI LTR control flow and LTR idle latency to improve power save
    efficiency.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220916033811.13862-4-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Sep 19, 2022
  2. wifi: rtw89: pci: concentrate control function of TX DMA channel

    Different chips use different register and mask for
    tx dma channels, so concentrate them.
    
    Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220912071706.13619-4-pkshih@realtek.com
    Chin-Yen Lee authored and Kalle Valo committed Sep 19, 2022
  3. wifi: rtw89: correct enable functions of HCI/PCI DMA

    Some PCI and MAC registers are changed for different
    chips and correct them accordingly. And HCI MAD functions
    belongs to MAC core, so move it to mac.h/.c.
    
    Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220912071706.13619-3-pkshih@realtek.com
    Chin-Yen Lee authored and Kalle Valo committed Sep 19, 2022
  4. wifi: rtw89: 8852c: L1 DMA reset has offloaded to FW

    For 8852C, rtw89_pci_lv1rst_stop_dma() and rtw89_pci_lv1rst_start_dma()
    are offloaded to FW L1 reset flow. So, driver no longer needs to do them.
    
    Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220912071706.13619-2-pkshih@realtek.com
    Zong-Zhe Yang authored and Kalle Valo committed Sep 19, 2022

Commits on Sep 2, 2022

  1. wifi: rtw89: pci: correct TX resource checking in low power mode

    Number of TX resource must be minimum of TX_BD and TX_WD. Only considering
    TX_BD could drop TX packets pulled from mac80211 if TX_WD is unavailable.
    
    Fixes: 52edbb9 ("rtw89: ps: access TX/RX rings via another registers in low power mode")
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220824063312.15784-2-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Sep 2, 2022
  2. wifi: rtw89: pci: fix interrupt stuck after leaving low power mode

    We turn off interrupt in ISR, and re-enable interrupt in threadfn or
    napi_poll according to the mode it stays. If we are turning off interrupt,
    rtwpci->running flag is unset and interrupt handler stop processing even
    if it was called, so disallow to re-enable interrupt in this situation.
    Or, wifi chip doesn't trigger interrupt events anymore because interrupt
    status (ISR) isn't clear by interrupt handler anymore.
    
    Fixes: c83dcd0 ("rtw89: pci: add a separate interrupt handler for low power mode")
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220824063312.15784-1-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Sep 2, 2022
  3. wifi: rtw89: pci: correct suspend/resume setting for variant chips

    We find that suspend/resume tests cause 8852CE lost, because some pci
    registers are changed for 8852CE. So, correct them accordingly.
    
    Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220819064811.37700-6-pkshih@realtek.com
    Chin-Yen Lee authored and Kalle Valo committed Sep 2, 2022
  4. wifi: rtw89: pci: enable CLK_REQ, ASPM, L1 and L1ss for 8852c

    8852CE controls CLKREQ, ASPM L1, L1ss via wifi registers
    instead, so change them accordingly.
    
    Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220819064811.37700-5-pkshih@realtek.com
    Chin-Yen Lee authored and Kalle Valo committed Sep 2, 2022
  5. wifi: rtw89: pci: fix PCI PHY auto adaption by using software restore

    There is chance that PCI PHY auto adaption fail. When first time boot up,
    software restore the right adaption value and close PHY auto adaption
    mechanism.
    
    Signed-off-by: Chia-Yuan Li <leo.li@realtek.com>
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220819064811.37700-4-pkshih@realtek.com
    Chia-Yuan Li authored and Kalle Valo committed Sep 2, 2022
  6. rtw89: 8852c: disable dma during mac init

    Without this patch, our hardware attempts to perform dma while device
    cpu restarts, and leads to iommu page faults caused by invalid requests.
    Some platforms show warning messages as below:
    rtw89_8852ce 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT
    domain=0x000a address=0x10000000004 flags=0x0030]
    
    Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220704023453.19935-2-pkshih@realtek.com
    Po-Hao Huang authored and Kalle Valo committed Sep 2, 2022
  7. wifi: rtw89: declare support for mac80211 chanctx ops by chip

    Some HW features are required if we hook chanctx ops to mac80211. With it,
    mac80211 would expect the HW-supported variant ops exists on some behavior,
    e.g. HW scan. But, HW features may depend on chip's FW or its development.
    Besides, how many chanctx can be supported also depends on chip design.
    We can neither decide whether to generally support chanctx ops nor how many
    chanctx can be supported.
    
    So, support_chanctx_num is added under chip info to deal with this by chip.
    For now, all chip configure support_chanctx_num as 0. We haven't really
    hook chanctx ops yet. So, chip can run without mac80211 chanctx as before.
    
    Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220809104952.61355-13-pkshih@realtek.com
    Zong-Zhe Yang authored and Kalle Valo committed Sep 2, 2022

Commits on Jul 29, 2022

  1. wifi: rtw89: 8852a: adjust IMR for SER L1

    SER (system error recovery) L1 (level 1) has a step-by-step handshake
    process with FW. These handshakes still rely on B_AX_HS0ISR_IND_INT_EN.
    So, even already during recovery, we enable this bit in IMR.
    
    Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220721074952.19676-1-pkshih@realtek.com
    Zong-Zhe Yang authored and Kalle Valo committed Jul 29, 2022

Commits on Jun 21, 2022

  1. wifi: rtw89: pci: fix PCI doesn't reclaim TX BD properly

    TX BD (TX ring index) and TX WD (WiFi descriptor buffer) are freed
    asynchronously. With burst packets, we free TX WD, but the corresponding
    TX BD couldn't be freed yet. Then, TX can possibly get stuck due to no
    more TX BD.
    
    To avoid this, ignore reclaiming TX BD only if TX WD is no free space,
    because at this moment TX BD must have some spaces. Otherwise, we reclaim
    TX BD to resolve TX stuck issue.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220610072610.27095-11-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Jun 21, 2022
  2. wifi: rtw89: add UNEXP debug mask to keep monitor messages unexpected…

    … to happen frequently
    
    Some warning messages could bother users. With proper handling, these
    situations don't really affect usage, but we still need to keep monitor
    these messages. If they happen frequently, we must review driver or
    hardware design to clarify.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220610072610.27095-8-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Jun 21, 2022

Commits on May 30, 2022

  1. rtw89: pci: handle hardware watchdog timeout interrupt status

    This watchdog timeout status bit indicates hardware gets wrong, so run SER
    L2 flow that calls mac80211 to restart hardware.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220520071731.38563-4-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed May 30, 2022

Commits on May 17, 2022

  1. rtw89: pci: only mask out INT indicator register for disable interrup…

    …t v1
    
    The design of INT indicator register (R_AX_PCIE_HIMR00_V1) is to reduce IO
    during frequent interrupts, because it can stop chip sending interrupt to
    host if we just set this indicator to 0, not all IMR(s). This indicator
    register looks like a root interrupt controller of wifi chip.
    
    However, we can't set all other IMR(s) to 0 during we are running on
    interrupt service routine, or the indicator register can't reflect the
    status of certain interrupt happened during this period, and then miss
    some interrupts especially SER interrupt events.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220516005215.5878-7-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed May 17, 2022

Commits on Apr 24, 2022

  1. rtw89: pci: allow to process RPP prior to TX BD

    RPP is to report certain skb(s) can be freed, and TX BD indicates which
    TX descriptors can be freed. Normally, TX BD is happened before RPP.
    In low power mode, RPP can happen ahead, so change flow to handle this
    case.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220421120903.73715-8-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Apr 24, 2022
  2. rtw89: ps: access TX/RX rings via another registers in low power mode

    In low power mode, we need to pause PCI to configure IMR and PCI ring
    index registers accordingly, because the regular registers are power-off
    in this mode.
    
    In the transition moment named paused in code, we can't touch ring index,
    so don't kick off DMA immediately. Instead, queue them into pending queue,
    and kick off after the moment.
    
    There are three low power modes, which are RF off/clock gate/power gate,
    but PCI enter low power mode in later two modes only. So, add a mask
    to achieve this.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220421120903.73715-7-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Apr 24, 2022
  3. rtw89: ser: re-enable interrupt in threadfn if under_recovery

    Normally, we re-enable interrupt by napi_poll, but for this special
    situation, we must turn it on immediately because napi_poll isn't
    scheduled.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220421120903.73715-6-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Apr 24, 2022
  4. rtw89: pci: add a separate interrupt handler for low power mode

    In lower power mode, there are very low amount of RX, and it must process
    in a separated function instead of schedule_napi(), because the existing
    napi_poll does many things to optimize performance, but not all registers
    can access in low power mode. The simple way is to use threadfn to process
    the simple thing.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220421120903.73715-5-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Apr 24, 2022
  5. rtw89: pci: reclaim TX BD only if it really need

    To reclaim TX BD, we need to read hardware reading index to determine if
    any DMA is complete. Since this IO spends time, do this thing only if we
    really need it when TX BD has no free buffer corresponding to target skb.
    
    The experimental result shows that reading counter decreases from 26,000
    to 130 per second.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220421120903.73715-4-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Apr 24, 2022
  6. rtw89: pci: add variant RPWM/CPWM to enter low power mode

    RPWM/CPWM are registers that can set and check low power mode. Since chips
    use different address, add a field to access them in common flow.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220421120903.73715-3-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Apr 24, 2022
  7. rtw89: pci: add variant IMR/ISR and configure functions

    8852CE uses different but similar IMR/ISR registers, and its masks are also
    different in various states, so add config_intr_mask ops to configure masks
    according to under_recovery or low_power states.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220421120903.73715-2-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Apr 24, 2022

Commits on Apr 13, 2022

  1. rtw89: pci: correct return value handling of rtw89_write16_mdio_mask()

    Fix wrong checking statement. Fortunately, this wrong code doesn't affect
    existing chip.
    
    Fixes: 740c431 ("rtw89: pci: add register definition to rtw89_pci_info to generalize pci code")
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220413010804.8941-5-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Apr 13, 2022

Commits on Apr 6, 2022

  1. rtw89: pci: add L1 settings

    Configure L1 settings of enter and exit.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220325060055.58482-8-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Apr 6, 2022
  2. rtw89: pci: add deglitch setting

    Add setting to support 8852ce.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220325060055.58482-7-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Apr 6, 2022
  3. rtw89: pci: set address info registers depends on chips

    Address info registers are used to configure size of DMA address info to
    point skb->data. With different size, it can support different number of
    scatters.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220325060055.58482-6-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Apr 6, 2022
  4. rtw89: pci: add LTR setting for v1 chip

    Add LTR handle to PCI deinit as well.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220325060055.58482-5-pkshih@realtek.com
    Ping-Ke Shih authored and Kalle Valo committed Apr 6, 2022
Older