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/20 15:50:42 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6488: wireless/bcm43xxx: add auto power saving support

pkarashchenko commented on code in PR #6488:
URL: https://github.com/apache/incubator-nuttx/pull/6488#discussion_r901812854


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c:
##########
@@ -426,6 +426,34 @@ int bcmf_driver_download_clm(FAR struct bcmf_dev_s *priv)
 #endif
 #endif /* CONFIG_IEEE80211_BROADCOM_HAVE_CLM */
 
+int bcmf_wl_set_pm(FAR struct bcmf_dev_s *priv, int mode)
+{
+  int interface = CHIP_STA_INTERFACE;
+  uint32_t out_len;
+  uint32_t value;
+  int ret;
+
+  /* Set default power save mode */
+
+#ifdef CONFIG_IEEE80211_BROADCOM_LOWPOWER
+  if (priv->lp_mode != mode)
+#endif
+    {
+      out_len = 4;
+      value   = mode;
+      ret = bcmf_cdc_ioctl(priv, interface, true, WLC_SET_PM,
+                           (uint8_t *)&value, &out_len);

Review Comment:
   I'm not sure if that matters in here, but `value = mode;` + `(uint8_t *)&value` will work for little-endian systems, but might not work for big endian.
   I'm not sure if we might have bcm43xx big-endian users, probably many places will be needed to be adapted.



-- 
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