wireless/bcm43xxx: replace all busy delay to nxsig_usleep

Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an 2022-06-16 20:16:32 +08:00 committed by Xiang Xiao
parent 591942f69b
commit 29dd12283c
2 changed files with 15 additions and 13 deletions

View File

@ -37,6 +37,7 @@
#include <nuttx/arch.h>
#include <nuttx/kmalloc.h>
#include <nuttx/signal.h>
#include "bcmf_core.h"
#include "bcmf_sdio.h"
@ -567,7 +568,7 @@ int bcmf_core_upload_firmware(FAR struct bcmf_sdio_dev_s *sbus)
DEBUGASSERT(false);
}
up_mdelay(50);
nxsig_usleep(50 * 1000);
/* Flash chip firmware */
@ -612,12 +613,12 @@ int bcmf_core_upload_firmware(FAR struct bcmf_sdio_dev_s *sbus)
case SDIO_DEVICE_ID_BROADCOM_43013:
case SDIO_DEVICE_ID_BROADCOM_43362:
case SDIO_DEVICE_ID_BROADCOM_43430:
up_mdelay(10);
nxsig_usleep(10 * 1000);
bcmf_core_reset(sbus, WLAN_ARMCM3_CORE_ID, 0, 0, 0);
/* Check ARMCM3 core is running */
up_mdelay(10);
nxsig_usleep(10 * 1000);
if (!bcmf_core_isup(sbus, WLAN_ARMCM3_CORE_ID))
{
wlerr("Cannot start ARMCM3 core\n");
@ -656,7 +657,7 @@ int bcmf_core_upload_firmware(FAR struct bcmf_sdio_dev_s *sbus)
/* Check ARMCR4 core is running */
up_mdelay(10);
nxsig_usleep(10 * 1000);
if (!bcmf_core_isup(sbus, WLAN_ARMCR4_CORE_ID))
{
wlerr("Cannot start ARMCR4 core\n");
@ -725,7 +726,7 @@ void bcmf_core_disable(FAR struct bcmf_sdio_dev_s *sbus,
/* Ensure no backplane operation is pending */
up_mdelay(10);
nxsig_usleep(10 * 1000);
bcmf_write_sbregw(sbus,
base + BCMA_IOCTL,

View File

@ -38,6 +38,7 @@
#include <nuttx/kthread.h>
#include <nuttx/wdog.h>
#include <nuttx/sdio.h>
#include <nuttx/signal.h>
#include <nuttx/wireless/ieee80211/bcmf_sdio.h>
#include <nuttx/wireless/ieee80211/bcmf_board.h>
@ -179,7 +180,7 @@ int bcmf_sdio_bus_sleep(FAR struct bcmf_sdio_dev_s *sbus, bool sleep)
/* Wait for High Throughput clock */
up_mdelay(100);
nxsig_usleep(100 * 1000);
ret = bcmf_read_reg(sbus, 1, SBSDIO_FUNC1_CHIPCLKCSR, &value);
if (ret != OK)
@ -286,7 +287,7 @@ int bcmf_probe(FAR struct bcmf_sdio_dev_s *sbus)
#endif
SDIO_CLOCK(sbus->sdio_dev, CLOCK_SD_TRANSFER_4BIT);
up_mdelay(BCMF_CLOCK_SETUP_DELAY_MS);
nxsig_usleep(BCMF_CLOCK_SETUP_DELAY_MS * 1000);
/* Enable bus FN1 */
@ -329,7 +330,7 @@ int bcmf_businitialize(FAR struct bcmf_sdio_dev_s *sbus)
loops = 10;
while (--loops > 0)
{
up_mdelay(10);
nxsig_usleep(10 * 1000);
ret = bcmf_read_reg(sbus, 1, SBSDIO_FUNC1_CHIPCLKCSR, &value);
if (ret != OK)
@ -474,12 +475,12 @@ int bcmf_hwinitialize(FAR struct bcmf_sdio_dev_s *sbus)
bcmf_board_reset(sbus->minor, true);
bcmf_board_power(sbus->minor, true);
up_mdelay(BCMF_DEVICE_RESET_DELAY_MS);
nxsig_usleep(BCMF_DEVICE_RESET_DELAY_MS * 1000);
bcmf_board_reset(sbus->minor, false);
/* Wait for device to start */
up_mdelay(BCMF_DEVICE_START_DELAY_MS);
nxsig_usleep(BCMF_DEVICE_START_DELAY_MS * 1000);
return OK;
}
@ -742,7 +743,7 @@ int bcmf_bus_sdio_initialize(FAR struct bcmf_dev_s *priv,
goto exit_uninit_hw;
}
up_mdelay(100);
nxsig_usleep(100 * 1000);
sbus->ready = true;
@ -875,7 +876,7 @@ int bcmf_sdio_thread(int argc, char **argv)
/* FIXME wait for the chip to be ready to receive commands */
up_mdelay(50);
nxsig_usleep(50 * 1000);
while (sbus->ready)
{
@ -1008,7 +1009,7 @@ struct bcmf_sdio_frame *bcmf_sdio_allocate_frame(FAR struct bcmf_dev_s *priv,
/* TODO use signaling semaphore */
wlinfo("alloc failed %d\n", tx);
up_mdelay(100);
nxsig_usleep(100 * 1000);
continue;
}