[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6430: wireless/bcm430xx: rename chip minor id to 'x'
xiaoxiang781216 commented on code in PR #6430: URL: https://github.com/apache/incubator-nuttx/pull/6430#discussion_r896465864 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -483,6 +481,25 @@ int bcmf_core_upload_firmware(FAR struct bcmf_sdio_dev_s *sbus) #endif default: +#ifdef CONFIG_IEEE80211_BROADCOM_BCM4301X +if (sbus->cur_chip_id >= SDIO_DEVICE_ID_BROADCOM_43011 && Review Comment: should we list in case instead if? ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -585,6 +600,20 @@ int bcmf_core_upload_firmware(FAR struct bcmf_sdio_dev_s *sbus) #endif default: +#ifdef CONFIG_IEEE80211_BROADCOM_BCM4301X +if (sbus->cur_chip_id >= SDIO_DEVICE_ID_BROADCOM_43011 && Review Comment: ditto -- 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
[incubator-nuttx] 01/02: sched/env: Fix the return value of unsetenv()
This is an automated email from the ASF dual-hosted git repository. pkarashchenko pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git commit 1b32fc1642a163b6860c7b2eb9c5a8f60a3b9963 Author: Ville Juven AuthorDate: Mon Jun 13 15:00:44 2022 +0300 sched/env: Fix the return value of unsetenv() If the environment variable does not exist, the function succeeds, as defined by POSIX. --- sched/environ/env_unsetenv.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sched/environ/env_unsetenv.c b/sched/environ/env_unsetenv.c index 6d227d0d37..be491474c4 100644 --- a/sched/environ/env_unsetenv.c +++ b/sched/environ/env_unsetenv.c @@ -61,23 +61,22 @@ int unsetenv(FAR const char *name) { FAR struct tcb_s *rtcb = this_task(); FAR struct task_group_s *group = rtcb->group; - int ret = OK; + int idx; DEBUGASSERT(name && group); /* Check if the variable exists */ sched_lock(); - if (group && (ret = env_findvar(group, name)) >= 0) + if (group && (idx = env_findvar(group, name)) >= 0) { /* It does! Remove the name=value pair from the environment. */ - env_removevar(group, ret); - ret = OK; + env_removevar(group, idx); } sched_unlock(); - return ret; + return OK; } #endif /* CONFIG_DISABLE_ENVIRON */
[GitHub] [incubator-nuttx] pkarashchenko merged pull request #6423: sched/env: Fix the return value of unsetenv()
pkarashchenko merged PR #6423: URL: https://github.com/apache/incubator-nuttx/pull/6423 -- 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
[incubator-nuttx] branch master updated (cf91b403c9 -> dc2b2dcb3f)
This is an automated email from the ASF dual-hosted git repository. pkarashchenko pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git from cf91b403c9 arch: imx6: Enable imx_idle.c to reduce CPU load new 1b32fc1642 sched/env: Fix the return value of unsetenv() new dc2b2dcb3f sched/env: Check for incoming parameter validity in unsetenv() The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: sched/environ/env_unsetenv.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-)
[incubator-nuttx] 02/02: sched/env: Check for incoming parameter validity in unsetenv()
This is an automated email from the ASF dual-hosted git repository. pkarashchenko pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git commit dc2b2dcb3f7f4561f880fbbbaa60fab90984ffa4 Author: Ville Juven AuthorDate: Mon Jun 13 15:51:12 2022 +0300 sched/env: Check for incoming parameter validity in unsetenv() Something the function did not do, check the incoming parameter is vlaid --- sched/environ/env_unsetenv.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sched/environ/env_unsetenv.c b/sched/environ/env_unsetenv.c index be491474c4..62f9fd8a99 100644 --- a/sched/environ/env_unsetenv.c +++ b/sched/environ/env_unsetenv.c @@ -63,7 +63,15 @@ int unsetenv(FAR const char *name) FAR struct task_group_s *group = rtcb->group; int idx; - DEBUGASSERT(name && group); + DEBUGASSERT(group); + + /* Check the incoming parameter */ + + if (name == NULL || *name == '\0' || strchr(name, '=') != NULL) +{ + set_errno(EINVAL); + return ERROR; +} /* Check if the variable exists */
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6427: wireless/bcm43xxx: load nvram from file system
xiaoxiang781216 commented on code in PR #6427: URL: https://github.com/apache/incubator-nuttx/pull/6427#discussion_r896469823 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; + struct file finfo; + struct stat sbuf; + FAR uint8_t *buf; + bool bskipline; + int i; + + nvram_buf = NULL; + nvram_sz = 0; Review Comment: merge into line 334-335 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; + struct file finfo; + struct stat sbuf; Review Comment: sbuf->stat ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; + struct file finfo; + struct stat sbuf; + FAR uint8_t *buf; + bool bskipline; + int i; + + nvram_buf = NULL; + nvram_sz = 0; + + if (strlen(nvfile) <= 0) +{ + goto out_ramload; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out_ramload; +} + + ret = file_fstat(&finfo, &sbuf); + if (ret < 0 || sbuf.st_size <= 0) +{ + goto out_ramload_with_file; +} + + /* Round up the ram buffer size */ + + sbuf.st_size = (sbuf.st_size + 63) & (-64); + + nvram_buf = buf = (FAR uint8_t *)kmm_malloc(sbuf.st_size); + if (nvram_buf == NULL) +{ + goto out_ramload_with_file; +} + + bskipline = false; + + /* Convert text pattern: + * 1. Remove the comment line (Prefix with '#') + * 2. Convert LF('\n') to NULL'\0' + */ + + while ((ret = file_read(&finfo, swap, sizeof(swap))) > 0) +{ + for (i = 0; i < ret; i++) +{ + if (swap[i] == '\n') +{ + if (buf != nvram_buf && *(buf - 1) != '\0') +{ + *buf++ = '\0'; +} + + bskipline = false; +} + else if (bskipline) Review Comment: remove ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; + struct file finfo; Review Comment: finfo->file ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; + struct file finfo; + struct stat sbuf; + FAR uint8_t *buf; + bool bskipline; + int i; + + nvram_buf = NULL; + nvram_sz = 0; + + if (strlen(nvfile) <= 0) +{ + goto out_ramload; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out_ramload; +} + + ret = file_fstat(&finfo, &sbuf); + if (ret < 0 || sbuf.st_size <= 0) +{ + goto out_ramload_with_file; +} + + /* Round up the ram buffer size */ + + sbuf.st_size = (sbuf.st_size + 63) & (-64); + + nvram_buf = buf = (FAR uint8_t *)kmm_malloc(sbuf.st_size); + if (nvram_buf == NULL) +{ + goto out_ramload_with_file; +} + + bskipline = false; Review Comment: merge into line 345 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6426: stm32wl5: add flash progmem driver support
xiaoxiang781216 commented on code in PR #6426: URL: https://github.com/apache/incubator-nuttx/pull/6426#discussion_r896501160 ## arch/arm/src/stm32wl5/stm32wl5_flash.c: ## @@ -359,6 +343,31 @@ ssize_t up_progmem_eraseblock(size_t block) } } +ssize_t up_progmem_ispageerased(size_t page) Review Comment: OK -- 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
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6427: wireless/bcm43xxx: load nvram from file system
anchao commented on code in PR #6427: URL: https://github.com/apache/incubator-nuttx/pull/6427#discussion_r896531681 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; + struct file finfo; + struct stat sbuf; Review Comment: Done ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; + struct file finfo; + struct stat sbuf; + FAR uint8_t *buf; + bool bskipline; + int i; + + nvram_buf = NULL; + nvram_sz = 0; 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6427: wireless/bcm43xxx: load nvram from file system
anchao commented on code in PR #6427: URL: https://github.com/apache/incubator-nuttx/pull/6427#discussion_r896532186 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; + struct file finfo; + struct stat sbuf; + FAR uint8_t *buf; + bool bskipline; 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6427: wireless/bcm43xxx: load nvram from file system
anchao commented on code in PR #6427: URL: https://github.com/apache/incubator-nuttx/pull/6427#discussion_r896534268 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; + struct file finfo; + struct stat sbuf; + FAR uint8_t *buf; + bool bskipline; + int i; + + nvram_buf = NULL; + nvram_sz = 0; + + if (strlen(nvfile) <= 0) +{ + goto out_ramload; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out_ramload; +} + + ret = file_fstat(&finfo, &sbuf); + if (ret < 0 || sbuf.st_size <= 0) +{ + goto out_ramload_with_file; +} + + /* Round up the ram buffer size */ + + sbuf.st_size = (sbuf.st_size + 63) & (-64); + + nvram_buf = buf = (FAR uint8_t *)kmm_malloc(sbuf.st_size); + if (nvram_buf == NULL) +{ + goto out_ramload_with_file; +} + + bskipline = false; + + /* Convert text pattern: + * 1. Remove the comment line (Prefix with '#') + * 2. Convert LF('\n') to NULL'\0' + */ + + while ((ret = file_read(&finfo, swap, sizeof(swap))) > 0) +{ + for (i = 0; i < ret; i++) +{ + if (swap[i] == '\n') +{ + if (buf != nvram_buf && *(buf - 1) != '\0') +{ + *buf++ = '\0'; +} + + bskipline = false; +} + else if (bskipline) +{ +} + else if (swap[i] == '#') +{ + bskipline = true; +} + else 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6427: wireless/bcm43xxx: load nvram from file system
anchao commented on code in PR #6427: URL: https://github.com/apache/incubator-nuttx/pull/6427#discussion_r896535318 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6427: wireless/bcm43xxx: load nvram from file system
anchao commented on code in PR #6427: URL: https://github.com/apache/incubator-nuttx/pull/6427#discussion_r896536326 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; + struct file finfo; Review Comment: style same with bcmf_upload_file ``` int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, FAR const char *path) { struct file finfo; ``` -- 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
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6427: wireless/bcm43xxx: load nvram from file system
anchao commented on code in PR #6427: URL: https://github.com/apache/incubator-nuttx/pull/6427#discussion_r896539021 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; + struct file finfo; + struct stat sbuf; + FAR uint8_t *buf; + bool bskipline; + int i; + + nvram_buf = NULL; + nvram_sz = 0; + + if (strlen(nvfile) <= 0) +{ + goto out_ramload; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out_ramload; +} + + ret = file_fstat(&finfo, &sbuf); + if (ret < 0 || sbuf.st_size <= 0) +{ + goto out_ramload_with_file; +} + + /* Round up the ram buffer size */ + + sbuf.st_size = (sbuf.st_size + 63) & (-64); + + nvram_buf = buf = (FAR uint8_t *)kmm_malloc(sbuf.st_size); + if (nvram_buf == NULL) +{ + goto out_ramload_with_file; +} + + bskipline = false; + + /* Convert text pattern: + * 1. Remove the comment line (Prefix with '#') + * 2. Convert LF('\n') to NULL'\0' + */ + + while ((ret = file_read(&finfo, swap, sizeof(swap))) > 0) +{ + for (i = 0; i < ret; i++) +{ + if (swap[i] == '\n') +{ + if (buf != nvram_buf && *(buf - 1) != '\0') +{ + *buf++ = '\0'; +} + + bskipline = false; +} + else if (bskipline) +{ +} + else if (swap[i] == '#') +{ + bskipline = true; +} + else +{ + *buf++ = swap[i]; +} +} +} + + nvram_sz = buf - nvram_buf; + +out_ramload_with_file: + file_close(&finfo); +out_ramload: + if (nvram_buf == NULL || nvram_sz == 0) Review Comment: Done ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; + struct file finfo; + struct stat sbuf; + FAR uint8_t *buf; + bool bskipline; + int i; + + nvram_buf = NULL; + nvram_sz = 0; + + if (strlen(nvfile) <= 0) +{ + goto out_ramload; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out_ramload; +} + + ret = file_fstat(&finfo, &sbuf); + if (ret < 0 || sbuf.st_size <= 0) +{ + goto out_ramload_with_file; +} + + /* Round up the ram buffer size */ + + sbuf.st_size = (sbuf.st_size + 63) & (-64); + + nvram_buf = buf = (FAR uint8_t *)kmm_malloc(sbuf.st_size); + if (nvram_buf == NULL) +{ + goto out_ramload_with_file; +} + + bskipline = false; + + /* Convert text pattern: + * 1. Remove the comment line (Prefix with '#') + * 2. Convert LF('\n') to NULL'\0' + */ + + while ((ret = file_read(&finfo, swap, sizeof(swap))) > 0) +{ + for (i = 0; i < ret; i++) +{ + if (swap[i] == '\n') +{ + if (buf != nvram_buf && *(buf - 1) != '\0') +{ + *buf++ = '\0'; +} + + bskipline = false; +} + else if (bskipline) +{ +} + else if (swap[i] == '#') +{ + bskipline = true; +} + else +{ + *buf++ = swap[i]; +} +} +} + + nvram_sz = buf - nvram_buf; + +out_ramload_with_file: + file_close(&finfo); +out_ramload: + if (nvram_buf == NULL || nvram_sz == 0) +#endif +{ + nvram_buf = sbus->chip->nvram_image; 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6427: wireless/bcm43xxx: load nvram from file system
anchao commented on code in PR #6427: URL: https://github.com/apache/incubator-nuttx/pull/6427#discussion_r896539801 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; + struct file finfo; + struct stat sbuf; + FAR uint8_t *buf; + bool bskipline; + int i; + + nvram_buf = NULL; + nvram_sz = 0; + + if (strlen(nvfile) <= 0) +{ + goto out_ramload; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out_ramload; +} + + ret = file_fstat(&finfo, &sbuf); + if (ret < 0 || sbuf.st_size <= 0) +{ + goto out_ramload_with_file; +} + + /* Round up the ram buffer size */ + + sbuf.st_size = (sbuf.st_size + 63) & (-64); Review Comment: allocated buffer need align to the 64 for upload binary request -- 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
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6427: wireless/bcm43xxx: load nvram from file system
anchao commented on code in PR #6427: URL: https://github.com/apache/incubator-nuttx/pull/6427#discussion_r896540264 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; + struct file finfo; + struct stat sbuf; + FAR uint8_t *buf; + bool bskipline; + int i; + + nvram_buf = NULL; + nvram_sz = 0; + + if (strlen(nvfile) <= 0) +{ + goto out_ramload; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out_ramload; +} + + ret = file_fstat(&finfo, &sbuf); + if (ret < 0 || sbuf.st_size <= 0) +{ + goto out_ramload_with_file; +} + + /* Round up the ram buffer size */ + + sbuf.st_size = (sbuf.st_size + 63) & (-64); + + nvram_buf = buf = (FAR uint8_t *)kmm_malloc(sbuf.st_size); + if (nvram_buf == NULL) +{ + goto out_ramload_with_file; +} + + bskipline = false; Review Comment: Done ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,114 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; + FAR uint8_t *nvram_buf; uint32_t nvram_sz; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char swap[32]; + struct file finfo; + struct stat sbuf; + FAR uint8_t *buf; + bool bskipline; + int i; + + nvram_buf = NULL; + nvram_sz = 0; + + if (strlen(nvfile) <= 0) +{ + goto out_ramload; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out_ramload; +} + + ret = file_fstat(&finfo, &sbuf); + if (ret < 0 || sbuf.st_size <= 0) +{ + goto out_ramload_with_file; +} + + /* Round up the ram buffer size */ + + sbuf.st_size = (sbuf.st_size + 63) & (-64); + + nvram_buf = buf = (FAR uint8_t *)kmm_malloc(sbuf.st_size); + if (nvram_buf == NULL) +{ + goto out_ramload_with_file; +} + + bskipline = false; + + /* Convert text pattern: + * 1. Remove the comment line (Prefix with '#') + * 2. Convert LF('\n') to NULL'\0' + */ + + while ((ret = file_read(&finfo, swap, sizeof(swap))) > 0) +{ + for (i = 0; i < ret; i++) +{ + if (swap[i] == '\n') +{ + if (buf != nvram_buf && *(buf - 1) != '\0') +{ + *buf++ = '\0'; +} + + bskipline = false; +} + else if (bskipline) 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-nuttx-apps] cwespressif opened a new pull request, #1197: testing/irtest: Fix issue of failure to open multiple IR devices
cwespressif opened a new pull request, #1197: URL: https://github.com/apache/incubator-nuttx-apps/pull/1197 ## Summary Fix issue of failure to open multiple IR devices. ## Impact ## Testing `irtest` -- 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
[GitHub] [incubator-nuttx] onegray commented on pull request #6426: stm32wl5: add flash progmem driver support
onegray commented on PR #6426: URL: https://github.com/apache/incubator-nuttx/pull/6426#issuecomment-1154897429 I'm working on [adding a new chip stm32wb](https://github.com/apache/incubator-nuttx/pull/6422), which is similar in some things. So I think it might be helpful to compare our results to highlight possible issues. @mlyszczek feel free to comment anything in my branch if you found it questionable or we can do it in more uniform way. On my side I am planning to review your related PRs. -- 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
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6430: wireless/bcm430xx: rename chip minor id to 'x'
anchao commented on code in PR #6430: URL: https://github.com/apache/incubator-nuttx/pull/6430#discussion_r896581354 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -483,6 +481,25 @@ int bcmf_core_upload_firmware(FAR struct bcmf_sdio_dev_s *sbus) #endif default: +#ifdef CONFIG_IEEE80211_BROADCOM_BCM4301X +if (sbus->cur_chip_id >= SDIO_DEVICE_ID_BROADCOM_43011 && Review Comment: Done ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -585,6 +600,20 @@ int bcmf_core_upload_firmware(FAR struct bcmf_sdio_dev_s *sbus) #endif default: +#ifdef CONFIG_IEEE80211_BROADCOM_BCM4301X +if (sbus->cur_chip_id >= SDIO_DEVICE_ID_BROADCOM_43011 && 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-nuttx] anchao opened a new pull request, #6431: wirless/sdio: frame length should with guard bound
anchao opened a new pull request, #6431: URL: https://github.com/apache/incubator-nuttx/pull/6431 ## Summary wirless/sdio: frame length should with guard bound some SDIO device will return the larger frames out of bound error log: bcmf_sdpcm_readframe: Frame is too large, cancel 1544 1536 bcmf_sdpcm_readframe: Frame is too large, cancel 1544 1536 bcmf_sdpcm_readframe: Frame is too large, cancel 1544 1536 Signed-off-by: chao.an ## Impact N/A ## Testing bcm43012 -- 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
[GitHub] [incubator-nuttx] anchao opened a new pull request, #6432: wireless/bcm43xxx: add extended join parameters
anchao opened a new pull request, #6432: URL: https://github.com/apache/incubator-nuttx/pull/6432 ## Summary wireless/bcm43xxx: add extended join parameters ## Impact N/A ## Testing ci-check -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on issue #1027: Remove errno accesses from the OS
pkarashchenko commented on issue #1027: URL: https://github.com/apache/incubator-nuttx/issues/1027#issuecomment-1155170735 I'm not sure if https://github.com/apache/incubator-nuttx/pull/6433 is contradicting to what is proposed here. Maybe we can discuss what is the best solution. -- 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
[GitHub] [incubator-nuttx-apps] Ouss4 merged pull request #1197: testing/irtest: Fix issue of failure to open multiple IR devices
Ouss4 merged PR #1197: URL: https://github.com/apache/incubator-nuttx-apps/pull/1197 -- 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
[incubator-nuttx-apps] branch master updated: testing/irtest: Fix issue of failure to open multiple IR devices
This is an automated email from the ASF dual-hosted git repository. aguettouche pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git The following commit(s) were added to refs/heads/master by this push: new 068905d07 testing/irtest: Fix issue of failure to open multiple IR devices 068905d07 is described below commit 068905d07b756d7e429f673ff4bcb9c7e56d28b7 Author: chen...@espressif.com AuthorDate: Tue Jun 14 16:36:11 2022 +0800 testing/irtest: Fix issue of failure to open multiple IR devices Signed-off-by: chen...@espressif.com --- testing/irtest/cmd.cxx | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/testing/irtest/cmd.cxx b/testing/irtest/cmd.cxx index 99bb4938a..c52cb4ff2 100644 --- a/testing/irtest/cmd.cxx +++ b/testing/irtest/cmd.cxx @@ -189,11 +189,13 @@ CMD1(open_device, const char *, file_name) } int index = 0; - for (; index < CONFIG_TESTING_IRTEST_MAX_NIRDEV && - g_irdevs[index] == -1; index++) + for (; index < CONFIG_TESTING_IRTEST_MAX_NIRDEV; index++) { - g_irdevs[index] = irdev; - break; + if (g_irdevs[index] == -1) +{ + g_irdevs[index] = irdev; + break; +} } if (index == CONFIG_TESTING_IRTEST_MAX_NIRDEV)
[GitHub] [incubator-nuttx] pkarashchenko opened a new pull request, #6433: sched: expose nxsched_ set/get APIs as system calls
pkarashchenko opened a new pull request, #6433: URL: https://github.com/apache/incubator-nuttx/pull/6433 ## Summary - expose nxsched_ set/get APIs as syscalls - move corresponding sched_ and pthread_ set/get APIs to libc - remove _SCHED_ macro based interface - reduce number of system calls - use nxsched_ set/get APIs in kernel code - remove libc stubs for `task_testcancel()` and `task_setcanceltype` ## Impact Should be none. Refactoring only ## Testing Pass CI -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on issue #1027: Remove errno accesses from the OS
pkarashchenko commented on issue #1027: URL: https://github.com/apache/incubator-nuttx/issues/1027#issuecomment-1155275788 I expect that this proposal assumes that POSIX APIs are a system calls, however such approach introduce the implicit cancellation point support. For example the some of libc rely on `sem_wait` and that makes the users of `sem_wait` to become a cancellation points implicitly. That is not good. We need to have a system call layer that is agnostic to cancellation points and does not use `errno`. There are not much of such cases, so maybe having two variants of semaphore system call APIs may be a solution (like `nxsem_wait` and `nxsem_wait_cancellable()`) or making one more generic system call API in the middle like `nxsem_wait_proxy(FAR sem_t *sem, int oflags);` where `oflags` will be `CANCELABLE`, `BLOCK`, etc., so `nxsem_wait`, `nxsem_trywait`, `sem_wait` and `sem_trywait` can be implemented calling a proxy. I'm not sure what is the best strategy. -- 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
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6432: wireless/bcm43xxx: add extended join parameters
anchao commented on code in PR #6432: URL: https://github.com/apache/incubator-nuttx/pull/6432#discussion_r896948471 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_ioctl.h: ## @@ -236,6 +239,40 @@ typedef struct wl_join_scan_params * between channel scans */ } wl_join_scan_params_t; +/** used for association with a specific BSSID and chanspec list */ + +typedef struct wl_assoc_params +{ + struct ether_addr bssid;/* 00:00:00:00:00:00: broadcast scan */ + uint16_t bssid_cnt;/* 0: use chanspec_num, and the single bssid, + * otherwise count of chanspecs in chanspec_list + * AND paired bssids following chanspec_list + * also, chanspec_num has to be set to zero + * for bssid list to be used + */ + int32_t chanspec_num; /* 0: all available channels, + * otherwise count of chanspecs in chanspec_list */ + chanspec_tchanspec_list[1]; /* list of chanspecs */ +} wl_assoc_params_t; + +/** used for association to a specific BSSID and channel */ + +typedef wl_assoc_params_t wl_join_assoc_params_t; + +/** extended join params */ + +typedef struct wl_extjoin_params +{ + wlc_ssid_t ssid; /* {0, ""}: wildcard scan */ + wl_join_scan_params_t scan; + wl_join_assoc_params_t assoc; /* optional field, but it must include the fixed portion + * of the wl_join_assoc_params_t struct when it does + * present. */ +} wl_extjoin_params_t; + +#define WL_EXTJOIN_PARAMS_FIXED_SIZE (sizeof(wl_extjoin_params_t, assoc) + \ 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6432: wireless/bcm43xxx: add extended join parameters
xiaoxiang781216 commented on code in PR #6432: URL: https://github.com/apache/incubator-nuttx/pull/6432#discussion_r896938676 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_ioctl.h: ## @@ -236,6 +239,40 @@ typedef struct wl_join_scan_params * between channel scans */ } wl_join_scan_params_t; +/** used for association with a specific BSSID and chanspec list */ + +typedef struct wl_assoc_params +{ + struct ether_addr bssid;/* 00:00:00:00:00:00: broadcast scan */ + uint16_t bssid_cnt;/* 0: use chanspec_num, and the single bssid, + * otherwise count of chanspecs in chanspec_list + * AND paired bssids following chanspec_list + * also, chanspec_num has to be set to zero + * for bssid list to be used + */ + int32_t chanspec_num; /* 0: all available channels, + * otherwise count of chanspecs in chanspec_list */ + chanspec_tchanspec_list[1]; /* list of chanspecs */ +} wl_assoc_params_t; + +/** used for association to a specific BSSID and channel */ + +typedef wl_assoc_params_t wl_join_assoc_params_t; + +/** extended join params */ + +typedef struct wl_extjoin_params +{ + wlc_ssid_t ssid; /* {0, ""}: wildcard scan */ + wl_join_scan_params_t scan; + wl_join_assoc_params_t assoc; /* optional field, but it must include the fixed portion + * of the wl_join_assoc_params_t struct when it does + * present. */ +} wl_extjoin_params_t; + +#define WL_EXTJOIN_PARAMS_FIXED_SIZE (sizeof(wl_extjoin_params_t, assoc) + \ Review Comment: offset -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6418: Eps32 Lilygo t5v2 BSP
pkarashchenko commented on code in PR #6418: URL: https://github.com/apache/incubator-nuttx/pull/6418#discussion_r896972478 ## boards/xtensa/esp32/ttgo_eink5_v2/src/esp32_bringup.c: ## @@ -0,0 +1,539 @@ +/ + * boards/xtensa/esp32/ttgo_eink5_v2/src/esp32_bringup.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + / + +/ + * Included Files + / + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#if defined(CONFIG_VIDEO_FB) && defined(CONFIG_LCD_FRAMEBUFFER) +#include +#endif + +#if defined(CONFIG_ESP32_EFUSE) +#include +#endif +#include +#include + +#if defined(CONFIG_ESP32_EFUSE) +#include "esp32_efuse.h" Review Comment: ```suggestion # include "esp32_efuse.h" ``` ## boards/xtensa/esp32/ttgo_eink5_v2/src/esp32_bringup.c: ## @@ -0,0 +1,539 @@ +/ + * boards/xtensa/esp32/ttgo_eink5_v2/src/esp32_bringup.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + / + +/ + * Included Files + / + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#if defined(CONFIG_VIDEO_FB) && defined(CONFIG_LCD_FRAMEBUFFER) +#include +#endif + +#if defined(CONFIG_ESP32_EFUSE) +#include Review Comment: can be merged to `#if defined(CONFIG_ESP32_EFUSE)` below -- 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
[GitHub] [incubator-nuttx] pkarashchenko merged pull request #6431: wirless/sdio: frame length should with guard bound
pkarashchenko merged PR #6431: URL: https://github.com/apache/incubator-nuttx/pull/6431 -- 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
[incubator-nuttx] branch master updated: wirless/sdio: frame length should with guard bound
This is an automated email from the ASF dual-hosted git repository. pkarashchenko pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git The following commit(s) were added to refs/heads/master by this push: new 28b46bd381 wirless/sdio: frame length should with guard bound 28b46bd381 is described below commit 28b46bd381b38fc76a683e0d2edbc60479c75988 Author: chao.an AuthorDate: Tue Jun 14 18:40:53 2022 +0800 wirless/sdio: frame length should with guard bound some SDIO device will return the larger frames out of bound error log: bcmf_sdpcm_readframe: Frame is too large, cancel 1544 1536 bcmf_sdpcm_readframe: Frame is too large, cancel 1544 1536 bcmf_sdpcm_readframe: Frame is too large, cancel 1544 1536 Signed-off-by: chao.an --- drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c b/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c index e4a6023387..ec11996c44 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c +++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c @@ -1016,7 +1016,8 @@ struct bcmf_sdio_frame *bcmf_sdio_allocate_frame(FAR struct bcmf_dev_s *priv, sframe = container_of(entry, struct bcmf_sdio_frame, list_entry); - sframe->header.len = HEADER_SIZE + MAX_NETDEV_PKTSIZE; + sframe->header.len = HEADER_SIZE + MAX_NETDEV_PKTSIZE + +CONFIG_NET_GUARDSIZE; sframe->header.base = sframe->data; sframe->header.data = sframe->data; sframe->tx = tx;
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6430: wireless/bcm430xx: rename chip minor id to 'x'
pkarashchenko commented on code in PR #6430: URL: https://github.com/apache/incubator-nuttx/pull/6430#discussion_r896980537 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c: ## @@ -844,7 +837,16 @@ int bcmf_chipinitialize(FAR struct bcmf_sdio_dev_s *sbus) break; #endif +#ifdef CONFIG_IEEE80211_BROADCOM_BCM4301X + case SDIO_DEVICE_ID_BROADCOM_43012: + case SDIO_DEVICE_ID_BROADCOM_43013: +wlinfo("bcm%d chip detected\n", chipid); +sbus->chip = (struct bcmf_sdio_chip *)&bcmf_4301x_config_sdio; +break; +#endif + default: + Review Comment: ```suggestion ``` -- 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
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6430: wireless/bcm430xx: rename chip minor id to 'x'
xiaoxiang781216 commented on code in PR #6430: URL: https://github.com/apache/incubator-nuttx/pull/6430#discussion_r896984106 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c: ## @@ -844,7 +837,16 @@ int bcmf_chipinitialize(FAR struct bcmf_sdio_dev_s *sbus) break; #endif +#ifdef CONFIG_IEEE80211_BROADCOM_BCM4301X Review Comment: move to first -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6427: wireless/bcm43xxx: load nvram from file system
pkarashchenko commented on code in PR #6427: URL: https://github.com/apache/incubator-nuttx/pull/6427#discussion_r896984526 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,111 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; - uint32_t nvram_sz; + FAR uint8_t *nvram_buf = NULL; + uint32_t nvram_sz = 0; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char tmp[128]; + bool skipline = false; + struct file finfo; + struct stat stat; + FAR uint8_t *buf; + int i; + + if (strlen(nvfile) <= 0) +{ + goto out_ramload; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out_ramload; +} + + ret = file_fstat(&finfo, &stat); + if (ret < 0 || stat.st_size <= 0) +{ + goto out_ramload_with_file; +} + + /* Round up the ram buffer size */ + + stat.st_size = (stat.st_size + 63) & (-64); Review Comment: Should this work? ```suggestion stat.st_size = (stat.st_size + 63) & (~63); ``` ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,111 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; - uint32_t nvram_sz; + FAR uint8_t *nvram_buf = NULL; + uint32_t nvram_sz = 0; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; Review Comment: ```suggestion FAR const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; ``` ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,111 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; - uint32_t nvram_sz; + FAR uint8_t *nvram_buf = NULL; + uint32_t nvram_sz = 0; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char tmp[128]; + bool skipline = false; + struct file finfo; + struct stat stat; + FAR uint8_t *buf; + int i; + + if (strlen(nvfile) <= 0) +{ + goto out_ramload; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out_ramload; +} + + ret = file_fstat(&finfo, &stat); + if (ret < 0 || stat.st_size <= 0) +{ + goto out_ramload_with_file; +} + + /* Round up the ram buffer size */ + + stat.st_size = (stat.st_size + 63) & (-64); + + nvram_buf = buf = (FAR uint8_t *)kmm_malloc(stat.st_size); + if (nvram_buf == NULL) +{ + goto out_ramload_with_file; +} + + /* Convert text pattern: + * 1. Remove the comment line (Prefix with '#') + * 2. Convert LF('\n') to NULL'\0' + */ + + while ((ret = file_read(&finfo, tmp, sizeof(tmp))) > 0) +{ + for (i = 0; i < ret; i++) +{ + if (tmp[i] == '\n') +{ + if (buf != nvram_buf && *(buf - 1) != '\0') +{ + *buf++ = '\0'; +} + + skipline = false; +} + else if (tmp[i] == '#') +{ + skipline = true; +} + else if (!skipline) +{ + *buf++ = tmp[i]; +} +} +} + + nvram_sz = buf - nvram_buf; + +out_ramload_with_file: + file_close(&finfo); +out_ramload: + if (nvram_sz == 0) +#endif +{ + if (nvram_buf) +{ + kmm_free(nvram_buf); +} + + nvram_buf = sbus->chip->nvram_image; + nvram_sz = *sbus->chip->nvram_image_size; +} /* Round up the size of the image */ - nvram_sz = (*sbus->chip->nvram_image_size + 63) & (-64); + nvram_sz = (nvram_sz + 63) & (-64); Review Comment: ditto -- 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
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6430: wireless/bcm430xx: rename chip minor id to 'x'
anchao commented on code in PR #6430: URL: https://github.com/apache/incubator-nuttx/pull/6430#discussion_r896988419 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c: ## @@ -844,7 +837,16 @@ int bcmf_chipinitialize(FAR struct bcmf_sdio_dev_s *sbus) break; #endif +#ifdef CONFIG_IEEE80211_BROADCOM_BCM4301X Review Comment: Done ## drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c: ## @@ -844,7 +837,16 @@ int bcmf_chipinitialize(FAR struct bcmf_sdio_dev_s *sbus) break; #endif +#ifdef CONFIG_IEEE80211_BROADCOM_BCM4301X + case SDIO_DEVICE_ID_BROADCOM_43012: + case SDIO_DEVICE_ID_BROADCOM_43013: +wlinfo("bcm%d chip detected\n", chipid); +sbus->chip = (struct bcmf_sdio_chip *)&bcmf_4301x_config_sdio; +break; +#endif + default: + 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6427: wireless/bcm43xxx: load nvram from file system
anchao commented on code in PR #6427: URL: https://github.com/apache/incubator-nuttx/pull/6427#discussion_r896992246 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,111 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; - uint32_t nvram_sz; + FAR uint8_t *nvram_buf = NULL; + uint32_t nvram_sz = 0; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char tmp[128]; + bool skipline = false; + struct file finfo; + struct stat stat; + FAR uint8_t *buf; + int i; + + if (strlen(nvfile) <= 0) +{ + goto out_ramload; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out_ramload; +} + + ret = file_fstat(&finfo, &stat); + if (ret < 0 || stat.st_size <= 0) +{ + goto out_ramload_with_file; +} + + /* Round up the ram buffer size */ + + stat.st_size = (stat.st_size + 63) & (-64); Review Comment: Done ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,111 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; - uint32_t nvram_sz; + FAR uint8_t *nvram_buf = NULL; + uint32_t nvram_sz = 0; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char tmp[128]; + bool skipline = false; + struct file finfo; + struct stat stat; + FAR uint8_t *buf; + int i; + + if (strlen(nvfile) <= 0) +{ + goto out_ramload; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out_ramload; +} + + ret = file_fstat(&finfo, &stat); + if (ret < 0 || stat.st_size <= 0) +{ + goto out_ramload_with_file; +} + + /* Round up the ram buffer size */ + + stat.st_size = (stat.st_size + 63) & (-64); + + nvram_buf = buf = (FAR uint8_t *)kmm_malloc(stat.st_size); + if (nvram_buf == NULL) +{ + goto out_ramload_with_file; +} + + /* Convert text pattern: + * 1. Remove the comment line (Prefix with '#') + * 2. Convert LF('\n') to NULL'\0' + */ + + while ((ret = file_read(&finfo, tmp, sizeof(tmp))) > 0) +{ + for (i = 0; i < ret; i++) +{ + if (tmp[i] == '\n') +{ + if (buf != nvram_buf && *(buf - 1) != '\0') +{ + *buf++ = '\0'; +} + + skipline = false; +} + else if (tmp[i] == '#') +{ + skipline = true; +} + else if (!skipline) +{ + *buf++ = tmp[i]; +} +} +} + + nvram_sz = buf - nvram_buf; + +out_ramload_with_file: + file_close(&finfo); +out_ramload: + if (nvram_sz == 0) +#endif +{ + if (nvram_buf) +{ + kmm_free(nvram_buf); +} + + nvram_buf = sbus->chip->nvram_image; + nvram_sz = *sbus->chip->nvram_image_size; +} /* Round up the size of the image */ - nvram_sz = (*sbus->chip->nvram_image_size + 63) & (-64); + nvram_sz = (nvram_sz + 63) & (-64); Review Comment: Done ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,111 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; - uint32_t nvram_sz; + FAR uint8_t *nvram_buf = NULL; + uint32_t nvram_sz = 0; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6427: wireless/bcm43xxx: load nvram from file system
anchao commented on code in PR #6427: URL: https://github.com/apache/incubator-nuttx/pull/6427#discussion_r897017423 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,111 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; - uint32_t nvram_sz; + FAR uint8_t *nvram_buf = NULL; + uint32_t nvram_sz = 0; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + FAR const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char tmp[128]; 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on issue #1027: Remove errno accesses from the OS
pkarashchenko commented on issue #1027: URL: https://github.com/apache/incubator-nuttx/issues/1027#issuecomment-1155408495 For the most of the cases when API is not a cancellation point it is easy to make NX API as a system call and create a libc wrapper that will handle `errno` correctly. The real problem is cancellation point APIs (the APIs that pend). The cancellation point enter/leave should be executed n kernel mode, so I do not see any other option that creating a two variants of the same API that differ only with cancellation point management and expose both as system calls. Again that contradicts assumption that only POSIX APIs are a system calls. Anyway we already have many NX APIs as system calls, so I think we can make whatever is convenient to be used. -- 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
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6427: wireless/bcm43xxx: load nvram from file system
xiaoxiang781216 commented on code in PR #6427: URL: https://github.com/apache/incubator-nuttx/pull/6427#discussion_r897015976 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,111 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; - uint32_t nvram_sz; + FAR uint8_t *nvram_buf = NULL; + uint32_t nvram_sz = 0; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + FAR const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + unsigned char tmp[128]; Review Comment: tmp can be removed -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6428: net/tcp: d_appdata should remove the tcp specific option field
pkarashchenko commented on code in PR #6428: URL: https://github.com/apache/incubator-nuttx/pull/6428#discussion_r897039891 ## net/tcp/tcp_input.c: ## @@ -629,6 +629,17 @@ static void tcp_input(FAR struct net_driver_s *dev, uint8_t domain, dev->d_len -= (len + iplen); + /* d_appdata should remove the tcp specific option field. */ + + if ((tcp->tcpoffset & 0xf0) > 0x50) +{ + len = ((tcp->tcpoffset >> 4) - 5) << 2; + if (len > 0 && dev->d_len >= len) Review Comment: I think `len` is always `> 0` if we are reaching here. -- 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
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #6426: stm32wl5: add flash progmem driver support
xiaoxiang781216 commented on PR #6426: URL: https://github.com/apache/incubator-nuttx/pull/6426#issuecomment-1155456792 @onegray do you want we wait you finish review before merging? -- 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
[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #6432: wireless/bcm43xxx: add extended join parameters
xiaoxiang781216 merged PR #6432: URL: https://github.com/apache/incubator-nuttx/pull/6432 -- 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
[incubator-nuttx] branch master updated: wireless/bcm43xxx: add extended join parameters
This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git The following commit(s) were added to refs/heads/master by this push: new 4659e00fac wireless/bcm43xxx: add extended join parameters 4659e00fac is described below commit 4659e00facfdccbe68ddd1091de52c3c490afb93 Author: chao.an AuthorDate: Tue Jun 14 20:32:33 2022 +0800 wireless/bcm43xxx: add extended join parameters Signed-off-by: chao.an --- drivers/wireless/ieee80211/bcm43xxx/bcmf_ioctl.h | 38 1 file changed, 38 insertions(+) diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_ioctl.h b/drivers/wireless/ieee80211/bcm43xxx/bcmf_ioctl.h index 80fd7fda48..d57b463598 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_ioctl.h +++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_ioctl.h @@ -224,9 +224,12 @@ typedef struct wl_uint32_list uint32_t element[1]; } wl_uint32_list_t; +/* scan params for extended join */ + typedef struct wl_join_scan_params { uint8_t scan_type;/* 0 use default, active or passive scan */ + uint8_t pad[3]; int32_t nprobes; /* -1 use default, number of probes per channel */ int32_t active_time; /* -1 use default, dwell time per channel for * active scanning */ @@ -236,6 +239,40 @@ typedef struct wl_join_scan_params * between channel scans */ } wl_join_scan_params_t; +/** used for association with a specific BSSID and chanspec list */ + +typedef struct wl_assoc_params +{ + struct ether_addr bssid;/* 00:00:00:00:00:00: broadcast scan */ + uint16_t bssid_cnt;/* 0: use chanspec_num, and the single bssid, + * otherwise count of chanspecs in chanspec_list + * AND paired bssids following chanspec_list + * also, chanspec_num has to be set to zero + * for bssid list to be used + */ + int32_t chanspec_num; /* 0: all available channels, + * otherwise count of chanspecs in chanspec_list */ + chanspec_tchanspec_list[1]; /* list of chanspecs */ +} wl_assoc_params_t; + +/** used for association to a specific BSSID and channel */ + +typedef wl_assoc_params_t wl_join_assoc_params_t; + +/** extended join params */ + +typedef struct wl_extjoin_params +{ + wlc_ssid_t ssid; /* {0, ""}: wildcard scan */ + wl_join_scan_params_t scan; + wl_join_assoc_params_t assoc; /* optional field, but it must include the fixed portion + * of the wl_join_assoc_params_t struct when it does + * present. */ +} wl_extjoin_params_t; + +#define WL_EXTJOIN_PARAMS_FIXED_SIZE \ + (offset(wl_extjoin_params_t, assoc) + WL_JOIN_ASSOC_PARAMS_FIXED_SIZE) + #define NRATE_MCS_INUSE(0x0080) #define NRATE_RATE_MASK (0x007f) #define NRATE_STF_MASK(0xff00) @@ -724,6 +761,7 @@ typedef struct wlc_iov_trx_s #define IOVAR_STR_AMPDU_RX_FACTOR"ampdu_rx_factor" #define IOVAR_STR_MIMO_BW_CAP"mimo_bw_cap" #define IOVAR_STR_CLMLOAD"clmload" +#define IOVAR_STR_JOIN "join" #define WLC_IOCTL_MAGIC( 0x14e46c77 ) #define WLC_IOCTL_VERSION ( 1 )
[GitHub] [incubator-nuttx] onegray commented on a diff in pull request #6426: stm32wl5: add flash progmem driver support
onegray commented on code in PR #6426: URL: https://github.com/apache/incubator-nuttx/pull/6426#discussion_r896523732 ## arch/arm/src/stm32wl5/hardware/stm32wl5_flash.h: ## @@ -131,174 +129,174 @@ /* Register Addresses ***/ -#define STM32WL5_FLASH_ACR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_ACR_OFFSET) -#define STM32WL5_FLASH_ACR2 (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_ACR2_OFFSET) -#define STM32WL5_FLASH_KEYR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_KEYR_OFFSET) -#define STM32WL5_FLASH_OPTKEYR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_OPTKEYR_OFFSET) -#define STM32WL5_FLASH_SR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_SR_OFFSET) -#define STM32WL5_FLASH_CR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_CR_OFFSET) -#define STM32WL5_FLASH_ECCR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_ECCR_OFFSET) -#define STM32WL5_FLASH_OPTR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_OPTR_OFFSET) -#define STM32WL5_FLASH_PCROP1ASR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1ASR_OFFSET) -#define STM32WL5_FLASH_PCROP1AER (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1AER_OFFSET) -#define STM32WL5_FLASH_WRP1AR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_WRP1AR_OFFSET) -#define STM32WL5_FLASH_WRP1BR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_WRP1BR_OFFSET) -#define STM32WL5_FLASH_PCROP1BSR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1BSR_OFFSET) -#define STM32WL5_FLASH_PCROP1BER (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1BER_OFFSET) -#define STM32WL5_FLASH_IPCCBR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_IPCCBR_OFFSET) -#define STM32WL5_FLASH_C2ACR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_C2ACR_OFFSET) -#define STM32WL5_FLASH_C2SR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_C2SR_OFFSET) -#define STM32WL5_FLASH_C2CR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_C2CR_OFFSET) -#define STM32WL5_FLASH_SFR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_SFR_OFFSET) -#define STM32WL5_FLASH_SRRVR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_SRRVR_OFFSET) +#define STM32WL5_FLASH_ACR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_ACR_OFFSET) +#define STM32WL5_FLASH_ACR2 (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_ACR2_OFFSET) +#define STM32WL5_FLASH_KEYR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_KEYR_OFFSET) +#define STM32WL5_FLASH_OPTKEYR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_OPTKEYR_OFFSET) +#define STM32WL5_FLASH_SR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_SR_OFFSET) +#define STM32WL5_FLASH_CR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_CR_OFFSET) +#define STM32WL5_FLASH_ECCR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_ECCR_OFFSET) +#define STM32WL5_FLASH_OPTR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_OPTR_OFFSET) +#define STM32WL5_FLASH_PCROP1ASR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1ASR_OFFSET) +#define STM32WL5_FLASH_PCROP1AER (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1AER_OFFSET) +#define STM32WL5_FLASH_WRP1AR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_WRP1AR_OFFSET) +#define STM32WL5_FLASH_WRP1BR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_WRP1BR_OFFSET) +#define STM32WL5_FLASH_PCROP1BSR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1BSR_OFFSET) +#define STM32WL5_FLASH_PCROP1BER (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1BER_OFFSET) +#define STM32WL5_FLASH_IPCCBR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_IPCCBR_OFFSET) +#define STM32WL5_FLASH_C2ACR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_C2ACR_OFFSET) +#define STM32WL5_FLASH_C2SR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_C2SR_OFFSET) +#define STM32WL5_FLASH_C2CR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_C2CR_OFFSET) +#define STM32WL5_FLASH_SFR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_SFR_OFFSET) +#define STM32WL5_FLASH_SRRVR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_SRRVR_OFFSET) /* Register Bitfield Definitions / /* Flash Access Control Register (ACR) */ -#define FLASH_ACR_LATENCY_SHIFT (0) -#define FLASH_ACR_LATENCY_MASK (7 << FLASH_ACR_LATENCY_SHIFT) -# define FLASH_ACR_LATENCY(n) ((n) << FLASH_ACR_LATENCY_SHIFT) /* n wait states, for Vcore range 1 and 2. */ -# define FLASH_ACR_LATENCY_0 (0 << FLASH_ACR_LATENCY_SHIFT)/* 000: Zero wait states */ -# define FLASH_ACR_LATENCY_1 (1 << FLASH_ACR_LATENCY_SHIFT)/* 001: One wait state*/ -# define FLASH_ACR_LATENCY_2 (2 << FLASH_ACR_LATENCY_SHIFT)/* 010: Two wait states */ - -#define FLASH_ACR_PRFTEN(1 << 8) /* Bit 8: Prefetch enable */ -#define FLASH_ACR_ICEN (1 << 9) /* Bit 9: Instruction cache enable */ -#define FLASH_ACR_DCEN (1 << 10) /* Bit 10: Data cache enable */ -#define FLASH_ACR_ICRST (1 << 11) /* Bit 11: Instruction cache reset */ -#define FLASH_ACR_DCRST (1 << 12) /* Bit 12: Data cache reset */ -#define FLASH_ACR_PES (1 << 15) /* Bit 15: Suspend flash progra
[GitHub] [incubator-nuttx] onegray commented on a diff in pull request #6426: stm32wl5: add flash progmem driver support
onegray commented on code in PR #6426: URL: https://github.com/apache/incubator-nuttx/pull/6426#discussion_r897095057 ## arch/arm/src/stm32wl5/hardware/stm32wl5_flash.h: ## @@ -131,174 +129,174 @@ /* Register Addresses ***/ -#define STM32WL5_FLASH_ACR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_ACR_OFFSET) -#define STM32WL5_FLASH_ACR2 (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_ACR2_OFFSET) -#define STM32WL5_FLASH_KEYR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_KEYR_OFFSET) -#define STM32WL5_FLASH_OPTKEYR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_OPTKEYR_OFFSET) -#define STM32WL5_FLASH_SR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_SR_OFFSET) -#define STM32WL5_FLASH_CR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_CR_OFFSET) -#define STM32WL5_FLASH_ECCR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_ECCR_OFFSET) -#define STM32WL5_FLASH_OPTR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_OPTR_OFFSET) -#define STM32WL5_FLASH_PCROP1ASR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1ASR_OFFSET) -#define STM32WL5_FLASH_PCROP1AER (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1AER_OFFSET) -#define STM32WL5_FLASH_WRP1AR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_WRP1AR_OFFSET) -#define STM32WL5_FLASH_WRP1BR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_WRP1BR_OFFSET) -#define STM32WL5_FLASH_PCROP1BSR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1BSR_OFFSET) -#define STM32WL5_FLASH_PCROP1BER (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1BER_OFFSET) -#define STM32WL5_FLASH_IPCCBR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_IPCCBR_OFFSET) -#define STM32WL5_FLASH_C2ACR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_C2ACR_OFFSET) -#define STM32WL5_FLASH_C2SR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_C2SR_OFFSET) -#define STM32WL5_FLASH_C2CR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_C2CR_OFFSET) -#define STM32WL5_FLASH_SFR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_SFR_OFFSET) -#define STM32WL5_FLASH_SRRVR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_SRRVR_OFFSET) +#define STM32WL5_FLASH_ACR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_ACR_OFFSET) +#define STM32WL5_FLASH_ACR2 (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_ACR2_OFFSET) +#define STM32WL5_FLASH_KEYR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_KEYR_OFFSET) +#define STM32WL5_FLASH_OPTKEYR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_OPTKEYR_OFFSET) +#define STM32WL5_FLASH_SR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_SR_OFFSET) +#define STM32WL5_FLASH_CR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_CR_OFFSET) +#define STM32WL5_FLASH_ECCR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_ECCR_OFFSET) +#define STM32WL5_FLASH_OPTR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_OPTR_OFFSET) +#define STM32WL5_FLASH_PCROP1ASR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1ASR_OFFSET) +#define STM32WL5_FLASH_PCROP1AER (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1AER_OFFSET) +#define STM32WL5_FLASH_WRP1AR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_WRP1AR_OFFSET) +#define STM32WL5_FLASH_WRP1BR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_WRP1BR_OFFSET) +#define STM32WL5_FLASH_PCROP1BSR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1BSR_OFFSET) +#define STM32WL5_FLASH_PCROP1BER (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_PCROP1BER_OFFSET) +#define STM32WL5_FLASH_IPCCBR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_IPCCBR_OFFSET) +#define STM32WL5_FLASH_C2ACR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_C2ACR_OFFSET) +#define STM32WL5_FLASH_C2SR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_C2SR_OFFSET) +#define STM32WL5_FLASH_C2CR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_C2CR_OFFSET) +#define STM32WL5_FLASH_SFR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_SFR_OFFSET) +#define STM32WL5_FLASH_SRRVR (STM32WL5_FLASHIF_BASE+STM32WL5_FLASH_SRRVR_OFFSET) /* Register Bitfield Definitions / /* Flash Access Control Register (ACR) */ -#define FLASH_ACR_LATENCY_SHIFT (0) -#define FLASH_ACR_LATENCY_MASK (7 << FLASH_ACR_LATENCY_SHIFT) -# define FLASH_ACR_LATENCY(n) ((n) << FLASH_ACR_LATENCY_SHIFT) /* n wait states, for Vcore range 1 and 2. */ -# define FLASH_ACR_LATENCY_0 (0 << FLASH_ACR_LATENCY_SHIFT)/* 000: Zero wait states */ -# define FLASH_ACR_LATENCY_1 (1 << FLASH_ACR_LATENCY_SHIFT)/* 001: One wait state*/ -# define FLASH_ACR_LATENCY_2 (2 << FLASH_ACR_LATENCY_SHIFT)/* 010: Two wait states */ - -#define FLASH_ACR_PRFTEN(1 << 8) /* Bit 8: Prefetch enable */ -#define FLASH_ACR_ICEN (1 << 9) /* Bit 9: Instruction cache enable */ -#define FLASH_ACR_DCEN (1 << 10) /* Bit 10: Data cache enable */ -#define FLASH_ACR_ICRST (1 << 11) /* Bit 11: Instruction cache reset */ -#define FLASH_ACR_DCRST (1 << 12) /* Bit 12: Data cache reset */ -#define FLASH_ACR_PES (1 << 15) /* Bit 15: Suspend flash progra
[GitHub] [incubator-nuttx] onegray commented on pull request #6426: stm32wl5: add flash progmem driver support
onegray commented on PR #6426: URL: https://github.com/apache/incubator-nuttx/pull/6426#issuecomment-1155483551 > do you want we wait you finish review before merging? @xiaoxiang781216 I've finished and have proposed minor changes. I just forget to submit my review, thanks. -- 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
[incubator-nuttx] branch master updated: wireless/bcm430xx: rename chip minor id to 'x'
This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git The following commit(s) were added to refs/heads/master by this push: new f6b8cc1407 wireless/bcm430xx: rename chip minor id to 'x' f6b8cc1407 is described below commit f6b8cc140752c1ea35a9e10d32824eb701956ffe Author: chao.an AuthorDate: Tue Jun 14 14:36:58 2022 +0800 wireless/bcm430xx: rename chip minor id to 'x' rename 4301x chip minor id to 'x' to compatible more versions of variant of bcm430xx Signed-off-by: chao.an --- drivers/wireless/ieee80211/bcm43xxx/Kconfig | 6 +++--- drivers/wireless/ieee80211/bcm43xxx/Make.defs| 4 ++-- .../{bcmf_chip_43013.c => bcmf_chip_4301x.c} | 20 ++-- drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c | 10 ++ drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c | 11 ++- drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio_core.h | 3 ++- 6 files changed, 29 insertions(+), 25 deletions(-) diff --git a/drivers/wireless/ieee80211/bcm43xxx/Kconfig b/drivers/wireless/ieee80211/bcm43xxx/Kconfig index 53b76b52c0..768a59d4b9 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/Kconfig +++ b/drivers/wireless/ieee80211/bcm43xxx/Kconfig @@ -11,8 +11,8 @@ config IEEE80211_BROADCOM_HAVE_CLM bool default n -config IEEE80211_BROADCOM_BCM43013 - bool "Broadcom 43013 chip support" +config IEEE80211_BROADCOM_BCM4301X + bool "Broadcom 4301x chip support" depends on IEEE80211_BROADCOM_FULLMAC default n select IEEE80211_BROADCOM_HAVE_CLM @@ -37,7 +37,7 @@ config IEEE80211_BROADCOM_BCM43455 config IEEE80211_BROADCOM_FWFILES bool "Firmware files" default y - depends on IEEE80211_BROADCOM_BCM43013 || \ + depends on IEEE80211_BROADCOM_BCM4301X || \ IEEE80211_BROADCOM_BCM43362 || \ IEEE80211_BROADCOM_BCM43438 || \ IEEE80211_BROADCOM_BCM43455 diff --git a/drivers/wireless/ieee80211/bcm43xxx/Make.defs b/drivers/wireless/ieee80211/bcm43xxx/Make.defs index b2632c5c23..42e345e912 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/Make.defs +++ b/drivers/wireless/ieee80211/bcm43xxx/Make.defs @@ -33,8 +33,8 @@ ifeq ($(CONFIG_IEEE80211_BROADCOM_FULLMAC_SDIO),y) CSRCS += bcmf_sdpcm.c endif -ifeq ($(CONFIG_IEEE80211_BROADCOM_BCM43013),y) -CSRCS += bcmf_chip_43013.c +ifeq ($(CONFIG_IEEE80211_BROADCOM_BCM4301X),y) +CSRCS += bcmf_chip_4301x.c endif ifeq ($(CONFIG_IEEE80211_BROADCOM_BCM43362),y) diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_43013.c b/drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_4301x.c similarity index 82% rename from drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_43013.c rename to drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_4301x.c index 90133d7d78..7fdbea81ef 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_43013.c +++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_4301x.c @@ -1,5 +1,5 @@ / - * drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_43013.c + * drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_4301x.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -37,15 +37,15 @@ * Public Data / -extern const char bcm43013_nvram_image[]; -extern const unsigned int bcm43013_nvram_image_len; +extern const char bcm4301x_nvram_image[]; +extern const unsigned int bcm4301x_nvram_image_len; #ifndef CONFIG_IEEE80211_BROADCOM_FWFILES -extern const uint8_t bcm43013_firmware_image[]; -extern const unsigned int bcm43013_firmware_image_len; +extern const uint8_t bcm4301x_firmware_image[]; +extern const unsigned int bcm4301x_firmware_image_len; #endif -const struct bcmf_sdio_chip bcmf_43013_config_sdio = +const struct bcmf_sdio_chip bcmf_4301x_config_sdio = { /* General chip stats */ @@ -69,12 +69,12 @@ const struct bcmf_sdio_chip bcmf_43013_config_sdio = /* TODO find something smarter than using image_len references */ - .nvram_image = (FAR uint8_t *)bcm43013_nvram_image, - .nvram_image_size= (FAR unsigned int *)&bcm43013_nvram_image_len, + .nvram_image = (FAR uint8_t *)bcm4301x_nvram_image, + .nvram_image_size= (FAR unsigned int *)&bcm4301x_nvram_image_len, #ifndef CONFIG_IEEE80211_BROADCOM_FWFILES - .firmware_image = (FAR uint8_t *)bcm43013_firmware_image, - .firmware_image_size = (FAR unsigned int *)&bcm43013_firmware_image_len, + .firmware_image = (FAR uint8_t *)bcm4301x_firmware_image, + .firmware_image_size = (FAR unsigned int *)&bcm4301x_firmware_image_len, #endif }; diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c b/drivers/wireless/ieee80
[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #6430: wireless/bcm430xx: rename chip minor id to 'x'
xiaoxiang781216 merged PR #6430: URL: https://github.com/apache/incubator-nuttx/pull/6430 -- 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
[GitHub] [incubator-nuttx] mlyszczek commented on pull request #6426: stm32wl5: add flash progmem driver support
mlyszczek commented on PR #6426: URL: https://github.com/apache/incubator-nuttx/pull/6426#issuecomment-1155530316 @onegray Thank you for your review. Good findings! How familliar are you with both of stm32wl and stm32wb chips? If they are similar maybe we could think about merging these two chips into single stm32wx? I see that stm32wl5 is mostly similar to stm32l4 chip. -- 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
[GitHub] [incubator-nuttx] onegray commented on pull request #6426: stm32wl5: add flash progmem driver support
onegray commented on PR #6426: URL: https://github.com/apache/incubator-nuttx/pull/6426#issuecomment-1155582100 > How familliar are you with both of stm32wl and stm32wb chips? If they are similar maybe we could think about merging these two chips into single stm32wx? I have no experience with stm32wl and studying stm32wb during last year. I think WB and WL should have separate implementations. > I see that stm32wl5 is mostly similar to stm32l4 chip stm32wb is very close to L4 as well, but there are still enough differences. -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6427: wireless/bcm43xxx: load nvram from file system
pkarashchenko commented on code in PR #6427: URL: https://github.com/apache/incubator-nuttx/pull/6427#discussion_r897208843 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,107 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; - uint32_t nvram_sz; + FAR uint8_t *nvram_buf = sbus->chip->nvram_image; + uint32_t nvram_sz = *sbus->chip->nvram_image_size; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + FAR const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + bool skipline = false; + struct file finfo; + struct stat stat; + FAR uint8_t *buf; + int i; + + if (strlen(nvfile) <= 0) +{ + goto out; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out; +} + + ret = file_fstat(&finfo, &stat); + if (ret < 0 || stat.st_size <= 0) +{ + goto out; +} + + /* Round up the ram buffer size */ + + stat.st_size = (stat.st_size + 63) & (-63); Review Comment: ```suggestion stat.st_size = (stat.st_size + 63) & (~63); ``` ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,107 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; - uint32_t nvram_sz; + FAR uint8_t *nvram_buf = sbus->chip->nvram_image; + uint32_t nvram_sz = *sbus->chip->nvram_image_size; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + FAR const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + bool skipline = false; + struct file finfo; + struct stat stat; + FAR uint8_t *buf; + int i; + + if (strlen(nvfile) <= 0) +{ + goto out; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out; +} + + ret = file_fstat(&finfo, &stat); + if (ret < 0 || stat.st_size <= 0) +{ + goto out; +} + + /* Round up the ram buffer size */ + + stat.st_size = (stat.st_size + 63) & (-63); + + buf = (FAR uint8_t *)kmm_malloc(stat.st_size); + if (buf == NULL) +{ + goto out; +} + + /* Convert text pattern: + * 1. Remove the comment line (Prefix with '#') + * 2. Convert LF('\n') to NULL'\0' + */ + + ret = file_read(&finfo, buf, stat.st_size); + if (ret <= 0) +{ + kmm_free(buf); + goto out; +} + + nvram_buf = buf; + + for (i = 0; i < ret; i++) +{ + if (nvram_buf[i] == '\n') +{ + if (buf != nvram_buf && *(buf - 1) != '\0') +{ + *buf++ = '\0'; +} + + skipline = false; +} + else if (nvram_buf[i] == '#') +{ + skipline = true; +} + else if (!skipline && (nvram_buf + i) != buf) +{ + *buf++ = nvram_buf[i]; +} +} + + nvram_sz = buf - nvram_buf; + +out: + file_close(&finfo); +#endif /* Round up the size of the image */ - nvram_sz = (*sbus->chip->nvram_image_size + 63) & (-64); + nvram_sz = (nvram_sz + 63) & (-63); Review Comment: ```suggestion nvram_sz = (nvram_sz + 63) & (~63); ``` -- 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
[GitHub] [incubator-nuttx] mlyszczek commented on pull request #6426: stm32wl5: add flash progmem driver support
mlyszczek commented on PR #6426: URL: https://github.com/apache/incubator-nuttx/pull/6426#issuecomment-1155597332 > > How familliar are you with both of stm32wl and stm32wb chips? If they are similar maybe we could think about merging these two chips into single stm32wx? > > I have no experience with stm32wl and studying stm32wb during last year. I think WB and WL should have separate implementations. I see, ok, fine by me. > > I see that stm32wl5 is mostly similar to stm32l4 chip > > stm32wb is very close to L4 as well, but there are still enough differences. In that case, expect from me to steal from your code :) -- 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
[GitHub] [incubator-nuttx] onegray commented on pull request #6426: stm32wl5: add flash progmem driver support
onegray commented on PR #6426: URL: https://github.com/apache/incubator-nuttx/pull/6426#issuecomment-1155610086 > In that case, expect from me to steal from your code :) Hahaha, you are welcome :) I think the common parts belong to L4. -- 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
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6433: sched: expose nxsched_ set/get APIs as system calls
xiaoxiang781216 commented on code in PR #6433: URL: https://github.com/apache/incubator-nuttx/pull/6433#discussion_r897222929 ## include/sys/syscall_lookup.h: ## @@ -33,13 +33,13 @@ SYSCALL_LOOKUP(gettid, 0) SYSCALL_LOOKUP(getppid, 0) #endif -SYSCALL_LOOKUP(sched_getparam, 2) -SYSCALL_LOOKUP(sched_getscheduler, 1) +SYSCALL_LOOKUP(nxsched_get_param, 2) +SYSCALL_LOOKUP(nxsched_get_scheduler, 1) SYSCALL_LOOKUP(sched_lock, 0) Review Comment: what' rule to add or not add the nx prefix? ## include/cxx/csched: ## @@ -44,6 +44,12 @@ namespace std using ::sched_get_priority_max; using ::sched_get_priority_min; using ::sched_rr_get_interval; +#ifdef CONFIG_SMP Review Comment: But, csched is never a standard c++ header. It's better to let C++ code include sched.h directly. -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6433: sched: expose nxsched_ set/get APIs as system calls
pkarashchenko commented on code in PR #6433: URL: https://github.com/apache/incubator-nuttx/pull/6433#discussion_r897230196 ## include/cxx/csched: ## @@ -44,6 +44,12 @@ namespace std using ::sched_get_priority_max; using ::sched_get_priority_min; using ::sched_rr_get_interval; +#ifdef CONFIG_SMP Review Comment: I just extended existing functionality. Do you recommend removing this file at all? -- 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
[GitHub] [incubator-nuttx] acassis commented on a diff in pull request #6433: sched: expose nxsched_ set/get APIs as system calls
acassis commented on code in PR #6433: URL: https://github.com/apache/incubator-nuttx/pull/6433#discussion_r897231328 ## arch/arm/src/cxd56xx/cxd56_farapi.c: ## @@ -196,14 +196,14 @@ void farapi_main(int id, void *arg, struct modulelist_s *mlist) { /* Save the current cpuset */ - sched_getaffinity(getpid(), sizeof(cpu_set_t), &cpuset0); + nxsched_get_affinity(getpid(), sizeof(cpu_set_t), &cpuset0); Review Comment: @pkarashchenko since the POSIX API name is sched_getaffinity/setaffinity, shouldn't be better to create nxsched_getaffinity/setaffinity? -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6433: sched: expose nxsched_ set/get APIs as system calls
pkarashchenko commented on code in PR #6433: URL: https://github.com/apache/incubator-nuttx/pull/6433#discussion_r897232384 ## include/sys/syscall_lookup.h: ## @@ -33,13 +33,13 @@ SYSCALL_LOOKUP(gettid, 0) SYSCALL_LOOKUP(getppid, 0) #endif -SYSCALL_LOOKUP(sched_getparam, 2) -SYSCALL_LOOKUP(sched_getscheduler, 1) +SYSCALL_LOOKUP(nxsched_get_param, 2) +SYSCALL_LOOKUP(nxsched_get_scheduler, 1) SYSCALL_LOOKUP(sched_lock, 0) Review Comment: I think there is no explicit rule. If I understand correctly there was an idea to have a POSIX interface as a syscall layer. But looking into syscall list seems that it is not possible. I'll convert this PR to draft to keep discussion here. -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6433: sched: expose nxsched_ set/get APIs as system calls
pkarashchenko commented on code in PR #6433: URL: https://github.com/apache/incubator-nuttx/pull/6433#discussion_r897233022 ## arch/arm/src/cxd56xx/cxd56_farapi.c: ## @@ -196,14 +196,14 @@ void farapi_main(int id, void *arg, struct modulelist_s *mlist) { /* Save the current cpuset */ - sched_getaffinity(getpid(), sizeof(cpu_set_t), &cpuset0); + nxsched_get_affinity(getpid(), sizeof(cpu_set_t), &cpuset0); Review Comment: I do not create a new API and just move things around in this PR -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6433: sched: expose nxsched_ set/get APIs as system calls
pkarashchenko commented on code in PR #6433: URL: https://github.com/apache/incubator-nuttx/pull/6433#discussion_r897235287 ## arch/arm/src/cxd56xx/cxd56_farapi.c: ## @@ -196,14 +196,14 @@ void farapi_main(int id, void *arg, struct modulelist_s *mlist) { /* Save the current cpuset */ - sched_getaffinity(getpid(), sizeof(cpu_set_t), &cpuset0); + nxsched_get_affinity(getpid(), sizeof(cpu_set_t), &cpuset0); Review Comment: POSIX sched_getaffinity/setaffinity is kept unchanged, but just moved to libc -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6433: sched: expose nxsched_ set/get APIs as system calls
pkarashchenko commented on code in PR #6433: URL: https://github.com/apache/incubator-nuttx/pull/6433#discussion_r897235697 ## arch/arm/src/cxd56xx/cxd56_farapi.c: ## @@ -196,14 +196,14 @@ void farapi_main(int id, void *arg, struct modulelist_s *mlist) { /* Save the current cpuset */ - sched_getaffinity(getpid(), sizeof(cpu_set_t), &cpuset0); + nxsched_get_affinity(getpid(), sizeof(cpu_set_t), &cpuset0); Review Comment: This is a kernel code. No need to call user space APIs here -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6433: sched: expose nxsched_ set/get APIs as system calls
pkarashchenko commented on code in PR #6433: URL: https://github.com/apache/incubator-nuttx/pull/6433#discussion_r897249956 ## include/sys/syscall_lookup.h: ## @@ -33,13 +33,13 @@ SYSCALL_LOOKUP(gettid, 0) SYSCALL_LOOKUP(getppid, 0) #endif -SYSCALL_LOOKUP(sched_getparam, 2) -SYSCALL_LOOKUP(sched_getscheduler, 1) +SYSCALL_LOOKUP(nxsched_get_param, 2) +SYSCALL_LOOKUP(nxsched_get_scheduler, 1) SYSCALL_LOOKUP(sched_lock, 0) Review Comment: I mean that I'm open to any rules if they are serving common sense and are accepted by others. -- 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
[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request, #6434: include/cxx: Remove all non standard c++ header files
xiaoxiang781216 opened a new pull request, #6434: URL: https://github.com/apache/incubator-nuttx/pull/6434 ## Summary All standard header files can check here: https://en.cppreference.com/w/cpp/header ## Impact ## Testing -- 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
[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request, #6435: drivers/syslog: reuse rmutex_t for the recursive check
xiaoxiang781216 opened a new pull request, #6435: URL: https://github.com/apache/incubator-nuttx/pull/6435 ## Summary ## Impact ## Testing -- 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
[GitHub] [incubator-nuttx] davids5 commented on pull request #6434: include/cxx: Remove all non standard c++ header files
davids5 commented on PR #6434: URL: https://github.com/apache/incubator-nuttx/pull/6434#issuecomment-1155689067 Where will ::close be defined? -- 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
[incubator-nuttx-website] branch asf-site updated: Publishing web: 42e9e27963415ec1359277228669d6b9c71c48d1 docs: f6b8cc140752c1ea35a9e10d32824eb701956ffe
This is an automated email from the ASF dual-hosted git repository. github-bot pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-website.git The following commit(s) were added to refs/heads/asf-site by this push: new 1c5d247 Publishing web: 42e9e27963415ec1359277228669d6b9c71c48d1 docs: f6b8cc140752c1ea35a9e10d32824eb701956ffe 1c5d247 is described below commit 1c5d2478b1f8b213d74ae509fbd8c9487a6defcf Author: Alin AuthorDate: Wed Jun 15 00:15:10 2022 + Publishing web: 42e9e27963415ec1359277228669d6b9c71c48d1 docs: f6b8cc140752c1ea35a9e10d32824eb701956ffe --- content/docs/10.0.0/index.html | 2 +- content/docs/10.0.1/index.html | 2 +- content/docs/10.1.0/index.html | 2 +- content/docs/10.2.0/index.html | 2 +- content/docs/10.3.0/index.html | 2 +- content/docs/latest/index.html | 2 +- content/feed.xml | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/content/docs/10.0.0/index.html b/content/docs/10.0.0/index.html index c69b0d9..c87373d 100644 --- a/content/docs/10.0.0/index.html +++ b/content/docs/10.0.0/index.html @@ -207,7 +207,7 @@ by following these NuttX Documentation¶ NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 32-bit microcontroller environments, the primary governing standards in NuttX are Posix and ANSI standards. Additional standard APIs from Unix and other common RTOS’s (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()). -Last Updated: 14 June 22 at 00:11 +Last Updated: 15 June 22 at 00:11 Table of Contents diff --git a/content/docs/10.0.1/index.html b/content/docs/10.0.1/index.html index f3c2cbd..31547a8 100644 --- a/content/docs/10.0.1/index.html +++ b/content/docs/10.0.1/index.html @@ -217,7 +217,7 @@ by following these NuttX Documentation¶ NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 32-bit microcontroller environments, the primary governing standards in NuttX are Posix and ANSI standards. Additional standard APIs from Unix and other common RTOS’s (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()). -Last Updated: 14 June 22 at 00:11 +Last Updated: 15 June 22 at 00:11 Table of Contents diff --git a/content/docs/10.1.0/index.html b/content/docs/10.1.0/index.html index 2d3bc0f..5c9179c 100644 --- a/content/docs/10.1.0/index.html +++ b/content/docs/10.1.0/index.html @@ -217,7 +217,7 @@ by following these NuttX Documentation¶ NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 64-bit microcontroller environments, the primary governing standards in NuttX are POSIX and ANSI standards. Additional standard APIs from Unix and other common RTOS’s (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()). -Last Updated: 14 June 22 at 00:12 +Last Updated: 15 June 22 at 00:12 Table of Contents diff --git a/content/docs/10.2.0/index.html b/content/docs/10.2.0/index.html index 79b4364..6956c52 100644 --- a/content/docs/10.2.0/index.html +++ b/content/docs/10.2.0/index.html @@ -218,7 +218,7 @@ by following these NuttX Documentation¶ NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 64-bit microcontroller environments, the primary governing standards in NuttX are POSIX and ANSI standards. Additional standard APIs from Unix and other common RTOS’s (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()). -Last Updated: 14 June 22 at 00:12 +Last Updated: 15 June 22 at 00:12 Table of Contents diff --git a/content/docs/10.3.0/index.html b/content/docs/10.3.0/index.html index 79b4364..82ab970 100644 --- a/content/docs/10.3.0/index.html +++ b/content/docs/10.3.0/index.html @@ -218,7 +218,7 @@ by following these NuttX Documentation¶ NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 64-bit microcontroller environments, the primary governing standards in NuttX are POSIX and ANSI standards. Additional standard APIs from Unix and other common RTOS’s (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()). -Last Updated: 14 June 2
[GitHub] [incubator-nuttx-apps] yamt opened a new pull request, #1198: webclient: Allow users to specify extra headers for proxy
yamt opened a new pull request, #1198: URL: https://github.com/apache/incubator-nuttx-apps/pull/1198 ## Summary My primary motivation at this point is to use it for basic proxy auth. (specify "Proxy-Authorization" header) But there can be other use cases for proxy-specific extra headers. If/when we want to support other non-trivial auth methods, probably a callback-based mechanism will be necessary. But at this point, this serves my purpose well. ## Impact ## Testing tested with my app + squid -- 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
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #6434: include/cxx: Remove all non standard c++ header files
xiaoxiang781216 commented on PR #6434: URL: https://github.com/apache/incubator-nuttx/pull/6434#issuecomment-1155938024 > Where will ::close be defined? unistd.h. -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6435: drivers/syslog: reuse rmutex_t for the recursive check
pkarashchenko commented on code in PR #6435: URL: https://github.com/apache/incubator-nuttx/pull/6435#discussion_r897499348 ## include/nuttx/mutex.h: ## @@ -419,7 +419,7 @@ static inline int nxrmutex_trylock(FAR rmutex_t *rmutex) static inline bool nxrmutex_is_locked(FAR rmutex_t *rmutex) { - return rmutex->count > 0; + return rmutex->holder == gettid(); Review Comment: This does not implement "is locked" functionality, but rather "is holder". -- 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
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6433: sched: expose nxsched_ set/get APIs as system calls
xiaoxiang781216 commented on code in PR #6433: URL: https://github.com/apache/incubator-nuttx/pull/6433#discussion_r897504364 ## include/cxx/csched: ## @@ -44,6 +44,12 @@ namespace std using ::sched_get_priority_max; using ::sched_get_priority_min; using ::sched_rr_get_interval; +#ifdef CONFIG_SMP Review Comment: Yes, here is the patch: https://github.com/apache/incubator-nuttx/pull/6434 -- 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
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6435: drivers/syslog: reuse rmutex_t for the recursive check
xiaoxiang781216 commented on code in PR #6435: URL: https://github.com/apache/incubator-nuttx/pull/6435#discussion_r897507834 ## include/nuttx/mutex.h: ## @@ -419,7 +419,7 @@ static inline int nxrmutex_trylock(FAR rmutex_t *rmutex) static inline bool nxrmutex_is_locked(FAR rmutex_t *rmutex) { - return rmutex->count > 0; + return rmutex->holder == gettid(); Review Comment: Ok, change to nxrmutex_is_hold -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6435: drivers/syslog: reuse rmutex_t for the recursive check
pkarashchenko commented on code in PR #6435: URL: https://github.com/apache/incubator-nuttx/pull/6435#discussion_r897512045 ## drivers/syslog/syslog_device.c: ## @@ -169,15 +150,7 @@ static inline int syslog_dev_takesem(FAR struct syslog_dev_s *syslog_dev) static inline void syslog_dev_givesem(FAR struct syslog_dev_s *syslog_dev) { -#ifdef CONFIG_DEBUG_ASSERTIONS - pid_t me = getpid(); - DEBUGASSERT(syslog_dev->sl_holder == me); Review Comment: Do we need to keep debug assertion here? ## drivers/syslog/syslog_device.c: ## @@ -83,8 +79,7 @@ struct syslog_dev_s uint8_t sl_state;/* See enum syslog_dev_state */ uint8_t sl_oflags; /* Saved open mode (for re-open) */ uint16_t sl_mode; /* Saved open flags (for re-open) */ - sem_tsl_sem; /* Enforces mutually exclusive access */ - pid_tsl_holder; /* PID of the thread that holds the semaphore */ + rmutex_t sl_lock; /* Enforces mutually exclusive access */ Review Comment: I understand your intention to get the changes back asap, but `sl_lock` is not a recursive mutex by it's nature. It is a regular mutex + holder checking for error. We can reuse recursive mutex in this place, but for me it is an odd design decision. -- 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
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6435: drivers/syslog: reuse rmutex_t for the recursive check
xiaoxiang781216 commented on code in PR #6435: URL: https://github.com/apache/incubator-nuttx/pull/6435#discussion_r897530173 ## drivers/syslog/syslog_device.c: ## @@ -169,15 +150,7 @@ static inline int syslog_dev_takesem(FAR struct syslog_dev_s *syslog_dev) static inline void syslog_dev_givesem(FAR struct syslog_dev_s *syslog_dev) { -#ifdef CONFIG_DEBUG_ASSERTIONS - pid_t me = getpid(); - DEBUGASSERT(syslog_dev->sl_holder == me); Review Comment: it's better to add to mutex.h -- 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
[GitHub] [incubator-nuttx-apps] xiaoxiang781216 opened a new pull request, #1199: Remove the non standard c++ header file inclusion
xiaoxiang781216 opened a new pull request, #1199: URL: https://github.com/apache/incubator-nuttx-apps/pull/1199 ## Summary Found by https://github.com/apache/incubator-nuttx/pull/6434 ## Impact ## Testing -- 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
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6435: drivers/syslog: reuse rmutex_t for the recursive check
xiaoxiang781216 commented on code in PR #6435: URL: https://github.com/apache/incubator-nuttx/pull/6435#discussion_r897532084 ## drivers/syslog/syslog_device.c: ## @@ -83,8 +79,7 @@ struct syslog_dev_s uint8_t sl_state;/* See enum syslog_dev_state */ uint8_t sl_oflags; /* Saved open mode (for re-open) */ uint16_t sl_mode; /* Saved open flags (for re-open) */ - sem_tsl_sem; /* Enforces mutually exclusive access */ - pid_tsl_holder; /* PID of the thread that holds the semaphore */ + rmutex_t sl_lock; /* Enforces mutually exclusive access */ Review Comment: Done in nxrmutex_unlock -- 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
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6435: drivers/syslog: reuse rmutex_t for the recursive check
xiaoxiang781216 commented on code in PR #6435: URL: https://github.com/apache/incubator-nuttx/pull/6435#discussion_r897532084 ## drivers/syslog/syslog_device.c: ## @@ -83,8 +79,7 @@ struct syslog_dev_s uint8_t sl_state;/* See enum syslog_dev_state */ uint8_t sl_oflags; /* Saved open mode (for re-open) */ uint16_t sl_mode; /* Saved open flags (for re-open) */ - sem_tsl_sem; /* Enforces mutually exclusive access */ - pid_tsl_holder; /* PID of the thread that holds the semaphore */ + rmutex_t sl_lock; /* Enforces mutually exclusive access */ Review Comment: Yes, but the recursive mutex can achieve the functionality more simpler than sem/mutex. -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6435: drivers/syslog: reuse rmutex_t for the recursive check
pkarashchenko commented on code in PR #6435: URL: https://github.com/apache/incubator-nuttx/pull/6435#discussion_r897533709 ## drivers/syslog/syslog_device.c: ## @@ -169,15 +150,7 @@ static inline int syslog_dev_takesem(FAR struct syslog_dev_s *syslog_dev) static inline void syslog_dev_givesem(FAR struct syslog_dev_s *syslog_dev) { -#ifdef CONFIG_DEBUG_ASSERTIONS - pid_t me = getpid(); - DEBUGASSERT(syslog_dev->sl_holder == me); Review Comment: The other option was to use `DEBUGVERIFY(nxrmutex_unlock(&syslog_dev->sl_lock));` -- 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
[GitHub] [incubator-nuttx] pkarashchenko commented on pull request #6434: include/cxx: Remove all non standard c++ header files
pkarashchenko commented on PR #6434: URL: https://github.com/apache/incubator-nuttx/pull/6434#issuecomment-1155986803 ``` ./src/cwidgetcontrol.cxx:30:10: fatal error: csched: No such file or directory 30 | #include ``` -- 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
[GitHub] [incubator-nuttx-apps] pkarashchenko commented on pull request #1199: Remove the non standard c++ header file inclusion
pkarashchenko commented on PR #1199: URL: https://github.com/apache/incubator-nuttx-apps/pull/1199#issuecomment-1155987391 Please remove Gerrit Change-ID -- 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
[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on pull request #1199: Remove the non standard c++ header file inclusion
xiaoxiang781216 commented on PR #1199: URL: https://github.com/apache/incubator-nuttx-apps/pull/1199#issuecomment-1156007939 > Please remove Gerrit Change-ID 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6427: wireless/bcm43xxx: load nvram from file system
anchao commented on code in PR #6427: URL: https://github.com/apache/incubator-nuttx/pull/6427#discussion_r897562992 ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,107 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; - uint32_t nvram_sz; + FAR uint8_t *nvram_buf = sbus->chip->nvram_image; + uint32_t nvram_sz = *sbus->chip->nvram_image_size; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + FAR const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + bool skipline = false; + struct file finfo; + struct stat stat; + FAR uint8_t *buf; + int i; + + if (strlen(nvfile) <= 0) +{ + goto out; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out; +} + + ret = file_fstat(&finfo, &stat); + if (ret < 0 || stat.st_size <= 0) +{ + goto out; +} + + /* Round up the ram buffer size */ + + stat.st_size = (stat.st_size + 63) & (-63); Review Comment: Done ## drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c: ## @@ -328,24 +331,107 @@ int bcmf_upload_file(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address, int bcmf_upload_nvram(FAR struct bcmf_sdio_dev_s *sbus) { - int ret; - uint32_t nvram_sz; + FAR uint8_t *nvram_buf = sbus->chip->nvram_image; + uint32_t nvram_sz = *sbus->chip->nvram_image_size; uint32_t token; + int ret; + +#ifdef CONFIG_IEEE80211_BROADCOM_FWFILES + FAR const char *nvfile = CONFIG_IEEE80211_BROADCOM_NVFILENAME; + bool skipline = false; + struct file finfo; + struct stat stat; + FAR uint8_t *buf; + int i; + + if (strlen(nvfile) <= 0) +{ + goto out; +} + + ret = file_open(&finfo, nvfile, O_RDONLY); + if (ret < 0) +{ + goto out; +} + + ret = file_fstat(&finfo, &stat); + if (ret < 0 || stat.st_size <= 0) +{ + goto out; +} + + /* Round up the ram buffer size */ + + stat.st_size = (stat.st_size + 63) & (-63); + + buf = (FAR uint8_t *)kmm_malloc(stat.st_size); + if (buf == NULL) +{ + goto out; +} + + /* Convert text pattern: + * 1. Remove the comment line (Prefix with '#') + * 2. Convert LF('\n') to NULL'\0' + */ + + ret = file_read(&finfo, buf, stat.st_size); + if (ret <= 0) +{ + kmm_free(buf); + goto out; +} + + nvram_buf = buf; + + for (i = 0; i < ret; i++) +{ + if (nvram_buf[i] == '\n') +{ + if (buf != nvram_buf && *(buf - 1) != '\0') +{ + *buf++ = '\0'; +} + + skipline = false; +} + else if (nvram_buf[i] == '#') +{ + skipline = true; +} + else if (!skipline && (nvram_buf + i) != buf) +{ + *buf++ = nvram_buf[i]; +} +} + + nvram_sz = buf - nvram_buf; + +out: + file_close(&finfo); +#endif /* Round up the size of the image */ - nvram_sz = (*sbus->chip->nvram_image_size + 63) & (-64); + nvram_sz = (nvram_sz + 63) & (-63); 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-nuttx-apps] pkarashchenko commented on pull request #1199: Remove the non standard c++ header file inclusion
pkarashchenko commented on PR #1199: URL: https://github.com/apache/incubator-nuttx-apps/pull/1199#issuecomment-1156051491 Seems like we need some more changes: ``` src/ctouchscreen.cxx: In destructor 'NxWM::CTouchscreen::~CTouchscreen()': Error: src/ctouchscreen.cxx:105:12: error: 'close' is not a member of 'std'; did you mean 'close'? 105 | std::close(m_touchFd); |^ In file included from /github/workspace/sources/nuttx/include/pthread.h:34, from src/ctouchscreen.cxx:33: /github/workspace/sources/nuttx/include/unistd.h:327:9: note: 'close' declared here 327 | int close(int fd); ``` -- 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