You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/06/19 02:41:27 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6471: wireless/bcm43xxx: enable power saving on netdev up/down

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


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c:
##########
@@ -780,17 +791,16 @@ int bcmf_bus_sdio_initialize(FAR struct bcmf_dev_s *priv,
     {
       wlerr("Cannot spawn bcmf thread\n");
       ret = -EBADE;
-      goto exit_uninit_hw;

Review Comment:
   why remove goto?



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c:
##########
@@ -650,6 +650,62 @@ 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;
+
+  sbus->ready = active;
+  if (!active)
+    {
+      bcmf_hwuninitialize(sbus);
+      return OK;
+    }
+
+  /* Initialize device hardware */
+
+  ret = bcmf_hwinitialize(sbus);
+  if (ret != OK)
+    {
+      return ret;

Review Comment:
   sbus->ready is wrong in the fail case.



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c:
##########
@@ -780,17 +791,16 @@ int bcmf_bus_sdio_initialize(FAR struct bcmf_dev_s *priv,
     {
       wlerr("Cannot spawn bcmf thread\n");
       ret = -EBADE;
-      goto exit_uninit_hw;
     }
-
-  sbus->thread_id = (pid_t)ret;

Review Comment:
   don't need change?



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c:
##########
@@ -663,6 +698,17 @@ static int bcmf_ifup(FAR struct net_driver_s *dev)
   /* Enable the hardware interrupt */
 
   priv->bc_bifup = true;
+

Review Comment:
   let's goto errout_in_critical_section and remove the ret check at line 703



-- 
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-unsubscribe@nuttx.apache.org

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