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/21 14:23:07 UTC

[GitHub] [incubator-nuttx] anchao opened a new pull request, #6494: wireless/bcm43xxx: add set country code support

anchao opened a new pull request, #6494:
URL: https://github.com/apache/incubator-nuttx/pull/6494

   ## Summary
   
   wireless/bcm43xxx: add set country code support
   
   Signed-off-by: chao.an <an...@xiaomi.com>
   
   
   ## Impact
   
   N/A
   
   ## Testing
   
   bcm43013 country code test


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


[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #6494: wireless/bcm43xxx: add set country code support

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #6494:
URL: https://github.com/apache/incubator-nuttx/pull/6494


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


[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6494: wireless/bcm43xxx: add set country code support

Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #6494:
URL: https://github.com/apache/incubator-nuttx/pull/6494#discussion_r903823295


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c:
##########
@@ -1744,3 +1744,39 @@ int bcmf_wl_get_ssid(FAR struct bcmf_dev_s *priv, struct iwreq *iwr)
 
   return ret;
 }
+
+int bcmf_wl_set_country_code(FAR struct bcmf_dev_s *priv,
+                             int interface, FAR void *code)
+{
+  uint8_t country[4] =
+    {
+    };

Review Comment:
   Done



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.h:
##########
@@ -179,4 +182,6 @@ int bcmf_wl_get_rssi(FAR struct bcmf_dev_s *priv, struct iwreq *iwr);
 
 int bcmf_wl_get_iwrange(FAR struct bcmf_dev_s *priv, struct iwreq *iwr);
 
+int bcmf_wl_set_country(FAR struct bcmf_dev_s *priv, struct iwreq *iwr);

Review Comment:
   Done



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


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6494: wireless/bcm43xxx: add set country code support

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6494:
URL: https://github.com/apache/incubator-nuttx/pull/6494#discussion_r903665920


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.h:
##########
@@ -179,4 +182,6 @@ int bcmf_wl_get_rssi(FAR struct bcmf_dev_s *priv, struct iwreq *iwr);
 
 int bcmf_wl_get_iwrange(FAR struct bcmf_dev_s *priv, struct iwreq *iwr);
 
+int bcmf_wl_set_country(FAR struct bcmf_dev_s *priv, struct iwreq *iwr);

Review Comment:
   ```suggestion
   int bcmf_wl_set_country(FAR struct bcmf_dev_s *priv, FAR struct iwreq *iwr);
   ```



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c:
##########
@@ -1744,3 +1744,39 @@ int bcmf_wl_get_ssid(FAR struct bcmf_dev_s *priv, struct iwreq *iwr)
 
   return ret;
 }
+
+int bcmf_wl_set_country_code(FAR struct bcmf_dev_s *priv,
+                             int interface, FAR void *code)
+{
+  uint8_t country[4] =
+    {
+    };

Review Comment:
   ```suggestion
     uint8_t country[4] =
       {
         0
       };
   ```



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


[GitHub] [incubator-nuttx] acassis commented on a diff in pull request #6494: wireless/bcm43xxx: add set country code support

Posted by GitBox <gi...@apache.org>.
acassis commented on code in PR #6494:
URL: https://github.com/apache/incubator-nuttx/pull/6494#discussion_r902931010


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c:
##########
@@ -1744,3 +1744,39 @@ int bcmf_wl_get_ssid(FAR struct bcmf_dev_s *priv, struct iwreq *iwr)
 
   return ret;
 }
+
+int bcmf_wl_set_country_code(FAR struct bcmf_dev_s *priv,
+                             int interface, FAR void *code)
+{
+  uint8_t country[4] =
+    {
+    };
+
+  uint32_t out_len;
+
+  memcpy(country, code, 2);
+
+  /* Why out_len = 4 ? Padding bytes to ensure array is
+   * terminating with null byte
+   */
+
+  out_len = sizeof(country);
+
+  return bcmf_cdc_iovar_request(priv, interface, true,

Review Comment:
   Question: is the return of bcmf_cdc_iovar_request() compatible with POSIX error number? Otherwise I think it should be important to have some debug error/warning here to indicate the right failure, i.e.: unknown country code, etc...



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


[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6494: wireless/bcm43xxx: add set country code support

Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #6494:
URL: https://github.com/apache/incubator-nuttx/pull/6494#discussion_r903242639


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c:
##########
@@ -1744,3 +1744,39 @@ int bcmf_wl_get_ssid(FAR struct bcmf_dev_s *priv, struct iwreq *iwr)
 
   return ret;
 }
+
+int bcmf_wl_set_country_code(FAR struct bcmf_dev_s *priv,
+                             int interface, FAR void *code)
+{
+  uint8_t country[4] =
+    {
+    };
+
+  uint32_t out_len;
+
+  memcpy(country, code, 2);
+
+  /* Why out_len = 4 ? Padding bytes to ensure array is
+   * terminating with null byte
+   */
+
+  out_len = sizeof(country);
+
+  return bcmf_cdc_iovar_request(priv, interface, true,

Review Comment:
   Thanks for the question, at present implement, the control commands of cdc all use POSIX compatible errono return values. The private control state only log printed:
   
   ```
   cp> wapi country wlan0 TE
   ioctl(0x8b37): 22
   ERROR: Process command (country) failed.
   cp> [01/01 00:01:08.610412] [25] [cp] bcmf_cdc_control_request_unsafe: Invalid cdc status 0xfffffffe
   ```
   https://github.com/apache/incubator-nuttx/blob/master/drivers/wireless/ieee80211/bcm43xxx/bcmf_cdc.c#L230
   
   We will consider better mapping of driver errors into POSIX compatible ones in the next patch, as you mentioned, which will better help the user to understand what exactly happened in the driver
   



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