xiaoxiang781216 commented on code in PR #6471:
URL: https://github.com/apache/incubator-nuttx/pull/6471#discussion_r901043128


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c:
##########
@@ -433,21 +433,27 @@ int bcmf_driver_download_clm(FAR struct bcmf_dev_s *priv)
 #endif
 #endif /* CONFIG_IEEE80211_BROADCOM_HAVE_CLM */
 
-int bcmf_driver_initialize(FAR struct bcmf_dev_s *priv)
+int bcmf_wl_active(FAR struct bcmf_dev_s *priv, bool active)
 {
-  int ret;
+  int interface = CHIP_STA_INTERFACE;
+  uint8_t tmp_buf[64];
   uint32_t out_len;
   uint32_t value;
-  uint8_t tmp_buf[64];
-  int interface = CHIP_STA_INTERFACE;
+  int ret;
+
+  ret = bcmf_bus_sdio_active(priv, active);
+  if (ret != OK || !active)
+    {
+      return ret;
+    }
 
 #ifdef CONFIG_IEEE80211_BROADCOM_HAVE_CLM
   /* Download CLM blob if needed */
 
   ret = bcmf_driver_download_clm(priv);
   if (ret != OK)
     {
-      return -EIO;
+      return ret;

Review Comment:
   should we call bcmf_bus_sdio_active(false) in case of fail?



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c:
##########
@@ -650,6 +650,68 @@ int bcmf_write_reg(FAR struct bcmf_sdio_dev_s *sbus, 
uint8_t function,
   return bcmf_transfer_bytes(sbus, true, function, address, &reg, 1);
 }
 
+/****************************************************************************
+ * Name: bcmf_bus_sdio_active
+ ****************************************************************************/
+
+int bcmf_bus_sdio_active(FAR struct bcmf_dev_s *priv, bool active)
+{
+  FAR struct bcmf_sdio_dev_s *sbus = (FAR struct bcmf_sdio_dev_s *)priv->bus;
+  int ret;
+
+  if (!active)
+    {
+      ret = OK;

Review Comment:
   merge into tline 660



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c:
##########
@@ -718,55 +780,10 @@ int bcmf_bus_sdio_initialize(FAR struct bcmf_dev_s *priv,
       goto exit_free_bus;
     }
 
-  /* Initialize device hardware */
-
-  ret = bcmf_hwinitialize(sbus);
-  if (ret != OK)
-    {
-      goto exit_free_bus;
-    }
-
-  /* Probe device */
-
-  ret = bcmf_probe(sbus);
-  if (ret != OK)
-    {
-      goto exit_uninit_hw;
-    }
-
-  /* Initialize device bus */
-
-  ret = bcmf_businitialize(sbus);
-  if (ret != OK)
-    {
-      goto exit_uninit_hw;
-    }
-
-  nxsig_usleep(100 * 1000);
-
-  sbus->ready = true;
-
-  ret = bcmf_bus_setup_interrupts(sbus);
-  if (ret != OK)
-    {
-      goto exit_uninit_hw;
-    }
-
-  ret = bcmf_sdio_sr_init(sbus);
-  if (ret != OK)
-    {
-      goto exit_uninit_hw;
-    }
-
   /* Register sdio bus */
 
   priv->bus = &sbus->bus;
 
-  /* Start the waitdog timer */
-
-  wd_start(&sbus->waitdog, BCMF_WAITDOG_TIMEOUT_TICK,

Review Comment:
   where you call wd_start again?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to