/* Check firmware get the power requset and ack via cpwm register */
ret = read_poll_timeout_atomic(rtw_read8, polling,
(polling ^ confirm) & BIT_RPWM_TOGGLE,
100, 15000, true, rtwdev,
rtwdev->hci.cpwm_addr); if (ret) { /* Hit here means that driver failed to get an ack from firmware. * The reason could be that hardware is locked at Deep sleep, * so most of the hardware circuits are not working, even * register read/write; or firmware is locked in some state and * cannot get the request. It should be treated as fatal error * and requires an entire analysis about the firmware/hardware.
*/
WARN(1, "firmware failed to ack driver for %s Deep Power mode\n",
enter ? "entering" : "leaving");
rtw_fw_dump_dbg_info(rtwdev);
}
}
EXPORT_SYMBOL(rtw_power_mode_change);
staticint __rtw_fw_leave_lps_check_reg(struct rtw_dev *rtwdev)
{ int i;
/* Driver needs to wait for firmware to leave LPS state * successfully. Firmware will send null packet to inform AP, * and see if AP sends an ACK back, then firmware will restore * the REG_TCR register. * * If driver does not wait for firmware, null packet with * PS bit could be sent due to incorrect REG_TCR setting. * * In our test, 100ms should be enough for firmware to finish * the flow. If REG_TCR Register is still incorrect after 100ms, * just modify it directly, and throw a warn message.
*/ for (i = 0 ; i < LEAVE_LPS_TRY_CNT; i++) { if (rtw_read32_mask(rtwdev, REG_TCR, BIT_PWRMGT_HWDATA_EN) == 0) return 0;
msleep(20);
}
if (test_and_clear_bit(RTW_FLAG_LEISURE_PS_DEEP, rtwdev->flags)) {
rtw_dbg(rtwdev, RTW_DBG_PS, "Should leave deep PS before leaving LPS\n");
__rtw_leave_lps_deep(rtwdev);
}
if (!test_bit(RTW_FLAG_LEISURE_PS, rtwdev->flags)) return;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.