You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/08/12 14:53:59 UTC

[GitHub] [incubator-nuttx] curuvar opened a new pull request, #6845: Added gSPI mode for Infineon CYW43439 WiFi chip.

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

   ## Summary
   
   Added gSPI mode for Infineon CYW43439 WiFi chip.
   
   ## Impact
   
   In preparation for adding support for the Pico W, NuttX required changes to the networking software. The existing BCMF chips use SDIO to communicate with the processor. The 43439 in the Pi W uses gSPI. In order to use as much common code as possible, I implemented bcmf_gspi.c to parallel bcmf_spio.c. I also added a file bcmf_interface.c that server as an abstraction layer between the two.
   
   Most files that used "struct bcmf_sdio_dev_s sbus" were changed to use "bcmf_interface_def_t ibus". The "sbus" name was kept in places specific to SDIO, where "gbus" is used in places specific to gSPI.
   
   ## Testing
   
   Have tested the Pico-W in general and the Pico-w WiFi access using telnet, telnetd, ping and renew.
   
   I do not have the hardware to test the existing SPIO code.
   
   ## Known Bugs
   
   DNS queries to don't currently work. See patch: https://github.com/apache/incubator-nuttx/pull/6841


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

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

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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6845: Added gSPI mode for Infineon CYW43439 WiFi chip.

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


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi.c:
##########
@@ -0,0 +1,1135 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi.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 <nuttx/config.h>
+#include <nuttx/compiler.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include <stdio.h>
+#include <debug.h>
+#include <errno.h>
+#include <assert.h>
+
+#include <nuttx/kmalloc.h>
+#include <nuttx/arch.h>
+#include <nuttx/kthread.h>
+#include <nuttx/wdog.h>
+#include <nuttx/signal.h>
+
+#include <nuttx/wireless/ieee80211/bcmf_board.h>
+
+#include "bcmf_gspi.h"
+#include "bcmf_gspi_f2_frame.h"
+#include "bcmf_core.h"
+#include "bcmf_sdpcm.h"
+#include "bcmf_utils.h"
+
+#include "bcmf_sdio_core.h"
+#include "bcmf_sdio_regs.h"

Review Comment:
   why include sdio specific header in gSPI?



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi_f2_frame.c:
##########
@@ -0,0 +1,394 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi_f2_frame.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 <nuttx/config.h>
+#include <nuttx/compiler.h>
+
+#include <debug.h>
+#include <errno.h>
+#include <assert.h>
+
+#include <nuttx/arch.h>
+
+#include <stddef.h>
+#include <string.h>
+
+#include "bcmf_core.h"
+#include "bcmf_sdpcm.h"
+#include "bcmf_cdc.h"
+#include "bcmf_bdc.h"
+#include "bcmf_utils.h"
+
+ #include "bcmf_netdev.h"
+
+#include "bcmf_sdio_regs.h"

Review Comment:
   ditto



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_gpio.c:
##########
@@ -0,0 +1,89 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_gpio.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 <stdbool.h>
+#include <errno.h>
+#include <stdio.h>
+
+#include <nuttx/wireless/ieee80211/bcmf_gpio.h>
+
+#include "bcmf_cdc.h"
+#include "bcmf_interface.h"
+#include "../../../../net/netdev/netdev.h"
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: bcmf_set_gpio
+ ****************************************************************************/
+
+int bcmf_set_gpio(FAR struct bcmf_dev_s *priv, int pin, bool value)
+{
+  struct
+    {
+      uint32_t mask;
+      uint32_t value;
+    } buffer;
+
+  uint32_t buf_len = sizeof (buffer);
+
+  if (!(((FAR bcmf_gspi_dev_t *)priv->bus)->ready)) return -EIO;

Review Comment:
   why has gspi specific code?



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_gpio.c:
##########
@@ -0,0 +1,89 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_gpio.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 <stdbool.h>
+#include <errno.h>
+#include <stdio.h>
+
+#include <nuttx/wireless/ieee80211/bcmf_gpio.h>
+
+#include "bcmf_cdc.h"
+#include "bcmf_interface.h"
+#include "../../../../net/netdev/netdev.h"
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: bcmf_set_gpio
+ ****************************************************************************/
+
+int bcmf_set_gpio(FAR struct bcmf_dev_s *priv, int pin, bool value)
+{
+  struct
+    {
+      uint32_t mask;
+      uint32_t value;
+    } buffer;
+
+  uint32_t buf_len = sizeof (buffer);

Review Comment:
   remove space before (



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c:
##########
@@ -40,8 +40,7 @@
 #include <nuttx/signal.h>
 
 #include "bcmf_core.h"
-#include "bcmf_sdio.h"
-
+#include "bcmf_interface.h"
 #include "bcmf_sdio_regs.h"

Review Comment:
   should we rename bcmf_sdio_regs.h to bcmf_core_regs.h



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_gpio.c:
##########
@@ -0,0 +1,89 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_gpio.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 <stdbool.h>
+#include <errno.h>
+#include <stdio.h>
+
+#include <nuttx/wireless/ieee80211/bcmf_gpio.h>
+
+#include "bcmf_cdc.h"
+#include "bcmf_interface.h"
+#include "../../../../net/netdev/netdev.h"
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: bcmf_set_gpio
+ ****************************************************************************/
+
+int bcmf_set_gpio(FAR struct bcmf_dev_s *priv, int pin, bool value)
+{
+  struct
+    {
+      uint32_t mask;
+      uint32_t value;
+    } buffer;
+
+  uint32_t buf_len = sizeof (buffer);
+
+  if (!(((FAR bcmf_gspi_dev_t *)priv->bus)->ready)) return -EIO;
+
+  buffer.mask  = 1 << pin;
+  buffer.value = value ? (1 << pin) : 0;
+
+  return bcmf_cdc_iovar_request(priv,
+                                CHIP_STA_INTERFACE,
+                                true,
+                                IOVAR_STR_GPIOOUT,
+                                (uint8_t *)&buffer,
+                                &buf_len);
+}
+
+/****************************************************************************
+ * Name: bcmf_get_gpio
+ ****************************************************************************/
+
+int bcmf_get_gpio(FAR struct bcmf_dev_s *priv, int pin, bool *value)
+{
+  uint8_t  buffer;
+  uint32_t buf_len = sizeof (buffer);
+  int      ret;
+
+  if (!(((FAR bcmf_gspi_dev_t *)priv->bus)->ready)) return -EIO;

Review Comment:
   ditto



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_data.h:
##########
@@ -0,0 +1,68 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_data.h
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_CHIP_DATA_H
+#define __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_CHIP_DATA_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include <nuttx/list.h>
+#include <nuttx/semaphore.h>
+#include <nuttx/wireless/ieee80211/bcmf_gspi.h>
+
+#include "bcmf_driver.h"
+#include "bcmf_sdio_core.h"
+

Review Comment:
   change the include to:
   #include <nuttx/config.h>
   
   #include <stdint.h>
   
   #include "bcmf_sdio_core.h"
   



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_gpio.c:
##########
@@ -0,0 +1,89 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_gpio.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 <stdbool.h>
+#include <errno.h>
+#include <stdio.h>
+
+#include <nuttx/wireless/ieee80211/bcmf_gpio.h>
+
+#include "bcmf_cdc.h"
+#include "bcmf_interface.h"
+#include "../../../../net/netdev/netdev.h"
+

Review Comment:
   remove the unused header files



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_data.h:
##########
@@ -0,0 +1,68 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_data.h
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_CHIP_DATA_H
+#define __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_CHIP_DATA_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include <nuttx/list.h>
+#include <nuttx/semaphore.h>
+#include <nuttx/wireless/ieee80211/bcmf_gspi.h>
+
+#include "bcmf_driver.h"
+#include "bcmf_sdio_core.h"
+

Review Comment:
   should we move MAX_CORE_ID to this file and skip to include bcmf_sdio_core.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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #6845: Added gSPI mode for Infineon CYW43439 WiFi chip.

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


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

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

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


[GitHub] [incubator-nuttx] curuvar commented on a diff in pull request #6845: Added gSPI mode for Infineon CYW43439 WiFi chip.

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


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi.c:
##########
@@ -0,0 +1,1135 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi.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 <nuttx/config.h>
+#include <nuttx/compiler.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include <stdio.h>
+#include <debug.h>
+#include <errno.h>
+#include <assert.h>
+
+#include <nuttx/kmalloc.h>
+#include <nuttx/arch.h>
+#include <nuttx/kthread.h>
+#include <nuttx/wdog.h>
+#include <nuttx/signal.h>
+
+#include <nuttx/wireless/ieee80211/bcmf_board.h>
+
+#include "bcmf_gspi.h"
+#include "bcmf_gspi_f2_frame.h"
+#include "bcmf_core.h"
+#include "bcmf_sdpcm.h"
+#include "bcmf_utils.h"
+
+#include "bcmf_sdio_core.h"
+#include "bcmf_sdio_regs.h"

Review Comment:
   I left these as sido because almost all of the #defines are SDIO...   Many of these constants are used to address the wifi processors core, even when communicating via gSPI.  It seemed easier to just accept them rather than renamiming everything or making a complete duplicate for gSPI.   I'm open to either.



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

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

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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6845: Added gSPI mode for Infineon CYW43439 WiFi chip.

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


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi.c:
##########
@@ -0,0 +1,1135 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi.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 <nuttx/config.h>
+#include <nuttx/compiler.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include <stdio.h>
+#include <debug.h>
+#include <errno.h>
+#include <assert.h>
+
+#include <nuttx/kmalloc.h>
+#include <nuttx/arch.h>
+#include <nuttx/kthread.h>
+#include <nuttx/wdog.h>
+#include <nuttx/signal.h>
+
+#include <nuttx/wireless/ieee80211/bcmf_board.h>
+
+#include "bcmf_gspi.h"
+#include "bcmf_gspi_f2_frame.h"
+#include "bcmf_core.h"
+#include "bcmf_sdpcm.h"
+#include "bcmf_utils.h"
+
+#include "bcmf_sdio_core.h"
+#include "bcmf_sdio_regs.h"

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

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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6845: Added gSPI mode for Infineon CYW43439 WiFi chip.

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


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi.h:
##########
@@ -0,0 +1,141 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi.h
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_GSPI_H
+#define __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_GSPI_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include <nuttx/list.h>
+#include <nuttx/semaphore.h>
+#include <nuttx/wireless/ieee80211/bcmf_gspi.h>
+
+#include "bcmf_driver.h"
+#include "bcmf_sdio_core.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define HEADER_SIZE          0x12 /* Default sdpcm + bdc header size */
+#define FIRST_WORD_SIZE      4
+#define FC_UPDATE_PKT_LENGTH 12
+
+#define BCMF_UPLOAD_TRANSFER_SIZE  64
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+/* SDIO chip configuration structure */
+
+struct bcmf_sdio_chip

Review Comment:
   ```suggestion
   struct bcmf_gspi_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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6845: Added gSPI mode for Infineon CYW43439 WiFi chip.

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


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_gpio.c:
##########
@@ -0,0 +1,103 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_gpio.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 <stdbool.h>
+#include <errno.h>
+#include <stdio.h>
+
+#include <nuttx/wireless/ieee80211/bcmf_gpio.h>
+
+#include "bcmf_cdc.h"
+#include "bcmf_interface.h"
+#include "../../../../net/netdev/netdev.h"
+
+/****************************************************************************
+ * Private Type Definitions
+ ****************************************************************************/
+
+typedef struct bcmf_dev_s bcmf_dev_t;
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: bcmf_set_gpio
+ ****************************************************************************/
+
+int bcmf_set_gpio(FAR const char *ifname, int pin, bool value)

Review Comment:
   why not use bcmf_dev_s as the first argument



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_data.h:
##########
@@ -0,0 +1,68 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_data.h
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_CHIP_H

Review Comment:
   ```suggestion
   #ifndef __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_CHIP_DATA_H
   ```



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_data.h:
##########
@@ -0,0 +1,68 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_data.h
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_CHIP_H
+#define __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_CHIP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include <nuttx/list.h>
+#include <nuttx/semaphore.h>
+#include <nuttx/wireless/ieee80211/bcmf_gspi.h>
+
+#include "bcmf_driver.h"
+#include "bcmf_sdio_core.h"
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+/* SDIO chip configuration structure */
+
+struct bcmf_chip_data
+{
+  uint32_t ram_base;
+  uint32_t ram_size;
+  uint32_t core_base[MAX_CORE_ID];
+
+  /* In-memory file images */
+
+  FAR uint8_t      *nvram_image;
+  FAR unsigned int *nvram_image_size;
+
+#ifndef CONFIG_IEEE80211_BROADCOM_FWFILES
+  FAR uint8_t      *firmware_image;
+  FAR unsigned int *firmware_image_size;
+
+#ifdef CONFIG_IEEE80211_BROADCOM_HAVE_CLM
+  FAR uint8_t      *clm_blob_image;
+  FAR unsigned int *clm_blob_image_size;
+#endif
+#endif
+};
+
+#endif

Review Comment:
   add new line



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

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

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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6845: Added gSPI mode for Infineon CYW43439 WiFi chip.

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


##########
drivers/wireless/ieee80211/bcm43xxx/Kconfig:
##########
@@ -118,8 +124,25 @@ config IEEE80211_BROADCOM_FULLMAC_SDIO
 		This selection enables support for broadcom
 		FullMAC-compliant devices using SDIO bus.
 
+config IEEE80211_BROADCOM_FULLMAC_GSPI
+	bool "Broadcom FullMAC driver on gSPI bus"
+	select IEEE80211_BROADCOM_FULLMAC
+	default n
+	---help---
+		This selection enables support for broadcom
+		FullMAC-compliant devices using SDIO bus.

Review Comment:
   ```suggestion
   		FullMAC-compliant devices using gSPI bus.
   ```



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_core.h:
##########
@@ -28,55 +28,57 @@
 #include <stdint.h>
 #include <stdbool.h>
 
-#include "bcmf_sdio.h"
+#include "bcmf_interface.h"
 
 /****************************************************************************
  * Public Functions Prototypes
  ****************************************************************************/
 
-int bcmf_read_sbreg(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address,
+int bcmf_read_sbreg(FAR bcmf_interface_dev_t *ibus, uint32_t address,
                           uint8_t *reg, unsigned int len);
 
-int bcmf_write_sbreg(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address,
+int bcmf_write_sbreg(FAR bcmf_interface_dev_t *ibus, uint32_t address,
                           uint8_t *reg, unsigned int len);
 
-bool bcmf_core_isup(FAR struct bcmf_sdio_dev_s *sbus, unsigned int core);
+bool bcmf_core_isup(FAR bcmf_interface_dev_t *ibus, unsigned int core);
 
-void bcmf_core_disable(FAR struct bcmf_sdio_dev_s *sbus,
+void bcmf_core_disable(FAR bcmf_interface_dev_t *ibus,
                        unsigned int core,
                        uint32_t prereset,
                        uint32_t reset);
 
-void bcmf_core_reset(FAR struct bcmf_sdio_dev_s *sbus,
+void bcmf_core_reset(FAR bcmf_interface_dev_t *ibus,
                      unsigned int core,
                      uint32_t prereset,
                      uint32_t reset,
                      uint32_t postreset);
 
-int bcmf_core_upload_firmware(FAR struct bcmf_sdio_dev_s *sbus);
+int bcmf_core_upload_firmware(FAR bcmf_interface_dev_t *ibus);
 
-static inline int bcmf_read_sbregb(FAR struct bcmf_sdio_dev_s *sbus,
-                                   uint32_t address, uint8_t *reg)
+static inline int bcmf_read_sbregb(FAR bcmf_interface_dev_t *bus,

Review Comment:
   ```suggestion
   static inline int bcmf_read_sbregb(FAR bcmf_interface_dev_t *ibus,
   ```



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c:
##########
@@ -252,7 +252,9 @@ static void bcmf_receive(FAR struct bcmf_dev_s *priv)
       priv->bc_dev.d_buf = frame->data;
       priv->bc_dev.d_len = frame->len - (frame->data - frame->base);
 
+#if 0 
       wlinfo("Got frame %p %d\n", frame, priv->bc_dev.d_len);

Review Comment:
   let's remove wlinfo or change to other macro instead #if 0



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_interface.c:
##########
@@ -0,0 +1,144 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_interface.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 <nuttx/config.h>
+
+#include <nuttx/signal.h>
+
+#include "bcmf_interface.h"
+#include "debug.h"
+#include "assert.h"
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static bcmf_interface_frame_t
+                  g_pktframes[CONFIG_IEEE80211_BROADCOM_FRAME_POOL_SIZE];
+
+static struct list_node free_interface_frames;     /* Queue of available frames */
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: bcmf_initialize_interface_frames
+ ****************************************************************************/
+
+void bcmf_initialize_interface_frames(void)
+{
+  int i;
+
+  list_initialize(&free_interface_frames);
+
+  for (i = 0; i < CONFIG_IEEE80211_BROADCOM_FRAME_POOL_SIZE; ++i)
+    {
+      list_add_tail(&free_interface_frames, &g_pktframes[i].list_entry);
+    }
+}
+
+/****************************************************************************
+ * Name: bcmf_interface_free_frame
+ ****************************************************************************/
+
+void bcmf_interface_free_frame(FAR struct bcmf_dev_s  *priv,
+                               bcmf_interface_frame_t *iframe)
+{
+  FAR bcmf_interface_dev_t *ibus = (FAR bcmf_interface_dev_t *) priv->bus;
+
+  if (nxsem_wait_uninterruptible(&ibus->queue_mutex) < 0)
+    {
+      DEBUGPANIC();
+    }
+
+  list_add_head(&free_interface_frames, &iframe->list_entry);
+
+  if (iframe->tx)
+    {
+      ibus->tx_queue_count--;
+    }
+
+  nxsem_post(&ibus->queue_mutex);
+}
+
+/****************************************************************************
+ * Name: bcmf_interface_allocate_frame
+ ****************************************************************************/
+
+bcmf_interface_frame_t
+         *bcmf_interface_allocate_frame(FAR struct bcmf_dev_s *priv,

Review Comment:
   remove the leading space



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi.c:
##########
@@ -0,0 +1,1101 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi.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 <nuttx/config.h>
+#include <nuttx/compiler.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include <stdio.h>
+#include <debug.h>
+#include <errno.h>
+#include <assert.h>
+
+#include <nuttx/kmalloc.h>
+#include <nuttx/arch.h>
+#include <nuttx/kthread.h>
+#include <nuttx/wdog.h>
+#include <nuttx/sdio.h>
+#include <nuttx/signal.h>
+
+#include <nuttx/wireless/ieee80211/bcmf_sdio.h>
+#include <nuttx/wireless/ieee80211/bcmf_board.h>
+
+#include "bcmf_gspi.h"
+#include "bcmf_gspi_f2_frame.h"
+#include "bcmf_core.h"
+#include "bcmf_sdpcm.h"
+#include "bcmf_utils.h"
+
+#include "bcmf_sdio_core.h"
+#include "bcmf_sdio_regs.h"
+#include "cyw_reg_def.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define BCMF_GSPI_READY_TRYS            10
+#define BCMF_GSPI_THREAD_NAME           "bcmf-gspi-thread"
+#define BCMF_GSPI_THREAD_STACK_SIZE     2048
+#define BCMF_GSPI_LOWPOWER_TIMEOUT_TICK SEC2TICK(2)
+
+#ifdef CONFIG_IEEE80211_INFINEON_CYW43439
+  extern const struct bcmf_sdio_chip cyw43439_config_sdio;

Review Comment:
   ```suggestion
   extern const struct bcmf_sdio_chip cyw43439_config_sdio;
   ```



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_interface.h:
##########
@@ -0,0 +1,141 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_interface.h
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_INTERFACE_H
+#define __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_INTERFACE_H
+
+/* ==== This file contains dispatch between the SDIO & gSPI interface. ==== */
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#if defined(CONFIG_IEEE80211_BROADCOM_FULLMAC_SDIO)
+#include "bcmf_sdio.h"
+#elif defined(CONFIG_IEEE80211_BROADCOM_FULLMAC_GSPI)
+#include "bcmf_gspi.h"
+#else
+#error Must define IEEE80211_BROADCOM_FULLMAC_SDIO or IEEE80211_BROADCOM_FULLMAC_GSPI
+#endif
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+struct bcmf_dev_s;
+
+#if defined(CONFIG_IEEE80211_BROADCOM_FULLMAC_SDIO)
+typedef struct bcmf_sdio_dev_s bcmf_interface_dev_t;
+#else
+typedef bcmf_gspi_dev_t bcmf_interface_dev_t;
+#endif
+
+/* Note:
+ * The structure referred to above must as its first item:
+ *
+ *  struct bcmf_bus_dev_s  bus;            --- Default bcmf bus structure
+ *
+ * The structure must also contain the following items:
+ *
+ *  int                    cur_chip_id;    --- Chip ID read from the card
+ *  struct bcmf_sdio_chip *chip;           --- Chip specific configuration
+ *
+ *  sem_t                  thread_signal;  --- Thread event semaphore
+ *
+ *  uint32_t       backplane_current_addr; --- Current F1 backplane base addr
+ *
+ *  uint8_t                max_seq;        --- Maximum TX sequence allowed
+ *  uint8_t                tx_seq;         --- TX sequence number (next)
+ *
+ *  sem_t                  queue_mutex;    --- Lock for TX/RX/free queues
+ *  struct list_node       tx_queue;       --- Queue of frames to transmit
+ *  struct list_node       rx_queue;       --- Queue of frames for receiving
+ *  volatile int           tx_queue_count; --- Count of items in TX queue
+ */
+
+/* Structure used to manage interface frames */
+
+typedef struct bcmf_interface_frame_s
+{
+  struct bcmf_frame_s header;
+  bool                tx;
+  struct list_node    list_entry;
+  uint8_t             pad[CONFIG_IEEE80211_BROADCOM_DMABUF_ALIGNMENT -
+                          FIRST_WORD_SIZE]
+  aligned_data(CONFIG_IEEE80211_BROADCOM_DMABUF_ALIGNMENT);
+
+  /* pad[] array is used and aligned in order to make the following data[]
+   * buffer aligned beginning from the offset of 4 bytes to the address
+   * boundary for SDIO DMA transfers.
+   * The first 4 bytes of data[] buffer are not directly used in DMA
+   * transfers. Instead, they are used as the initial phase just to get
+   * the length of the remaining long data to be read. Thus only
+   * the remaining part of data[] buffer beginning from the offset of 4 bytes
+   * is required to be aligned to the address boundary set by
+   * CONFIG_IEEE80211_BROADCOM_SDIO_DMA_BUF_ALIGNMENT parameter.
+   */
+
+  uint8_t             data[HEADER_SIZE + MAX_NETDEV_PKTSIZE +
+                           CONFIG_NET_GUARDSIZE];
+} bcmf_interface_frame_t;
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: bcmf_bus_interface_active
+ ****************************************************************************/
+
+static inline int bcmf_bus_interface_active(struct bcmf_dev_s *priv,
+                                            bool               active)
+{
+#if defined(CONFIG_IEEE80211_BROADCOM_FULLMAC_SDIO)
+  return bcmf_bus_sdio_active(priv, active);
+#else
+  return bcmf_bus_gspi_active(priv, active);
+#endif
+}
+
+/****************************************************************************
+ * Name: bcmf_initialize_interface_frames
+ ****************************************************************************/
+
+void bcmf_initialize_interface_frames(void);
+
+/****************************************************************************
+ * Name: bcmf_interface_free_frame
+ ****************************************************************************/
+
+void bcmf_interface_free_frame(FAR struct bcmf_dev_s  *priv,
+                               bcmf_interface_frame_t *iframe);
+
+/****************************************************************************
+ * Name: bcmf_interface_allocate_frame
+ ****************************************************************************/
+
+bcmf_interface_frame_t
+         *bcmf_interface_allocate_frame(FAR struct bcmf_dev_s *priv,

Review Comment:
   remove the leading space



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c:
##########
@@ -80,7 +79,11 @@
 
 /* Transfer size properties */
 
-#define BCMF_UPLOAD_TRANSFER_SIZE  (64 * 256)
+#ifdef CONFIG_IEEE80211_BROADCOM_FULLMAC_GSPI
+# define BCMF_UPLOAD_TRANSFER_SIZE  (64)

Review Comment:
   can we move to bcmf_stdio.h and bcmf_gspi.h



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi.c:
##########
@@ -0,0 +1,1101 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi.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 <nuttx/config.h>
+#include <nuttx/compiler.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include <stdio.h>
+#include <debug.h>
+#include <errno.h>
+#include <assert.h>
+
+#include <nuttx/kmalloc.h>
+#include <nuttx/arch.h>
+#include <nuttx/kthread.h>
+#include <nuttx/wdog.h>
+#include <nuttx/sdio.h>
+#include <nuttx/signal.h>
+
+#include <nuttx/wireless/ieee80211/bcmf_sdio.h>

Review Comment:
   why include sdio specific header file



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c:
##########
@@ -955,6 +1018,15 @@ int bcmf_wl_get_interface(FAR struct bcmf_dev_s *priv, struct iwreq *iwr)
  * Public Functions
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: bcmf_sdio_initialize
+ *
+ * Description:
+ *   Initialize the drive with a SDIO connection.
+ ****************************************************************************/
+
+#if defined(CONFIG_IEEE80211_BROADCOM_FULLMAC_SDIO)
+
 int bcmf_sdio_initialize(int minor, FAR struct sdio_dev_s *dev)

Review Comment:
   should we move to stdio specific source file



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_core.h:
##########
@@ -28,55 +28,57 @@
 #include <stdint.h>
 #include <stdbool.h>
 
-#include "bcmf_sdio.h"
+#include "bcmf_interface.h"
 
 /****************************************************************************
  * Public Functions Prototypes
  ****************************************************************************/
 
-int bcmf_read_sbreg(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address,
+int bcmf_read_sbreg(FAR bcmf_interface_dev_t *ibus, uint32_t address,
                           uint8_t *reg, unsigned int len);
 
-int bcmf_write_sbreg(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address,
+int bcmf_write_sbreg(FAR bcmf_interface_dev_t *ibus, uint32_t address,
                           uint8_t *reg, unsigned int len);
 
-bool bcmf_core_isup(FAR struct bcmf_sdio_dev_s *sbus, unsigned int core);
+bool bcmf_core_isup(FAR bcmf_interface_dev_t *ibus, unsigned int core);
 
-void bcmf_core_disable(FAR struct bcmf_sdio_dev_s *sbus,
+void bcmf_core_disable(FAR bcmf_interface_dev_t *ibus,
                        unsigned int core,
                        uint32_t prereset,
                        uint32_t reset);
 
-void bcmf_core_reset(FAR struct bcmf_sdio_dev_s *sbus,
+void bcmf_core_reset(FAR bcmf_interface_dev_t *ibus,
                      unsigned int core,
                      uint32_t prereset,
                      uint32_t reset,
                      uint32_t postreset);
 
-int bcmf_core_upload_firmware(FAR struct bcmf_sdio_dev_s *sbus);
+int bcmf_core_upload_firmware(FAR bcmf_interface_dev_t *ibus);
 
-static inline int bcmf_read_sbregb(FAR struct bcmf_sdio_dev_s *sbus,
-                                   uint32_t address, uint8_t *reg)
+static inline int bcmf_read_sbregb(FAR bcmf_interface_dev_t *bus,
+                                   uint32_t                  address,
+                                   uint8_t                  *value)
 {
-    return bcmf_read_sbreg(sbus, address, reg, 1);
+  return bcmf_read_sbreg(bus, address, value, 1);
 }
 
-static inline int bcmf_read_sbregw(FAR struct bcmf_sdio_dev_s *sbus,
-                                   uint32_t address, uint32_t *reg)
+static inline int bcmf_read_sbregw(FAR bcmf_interface_dev_t *bus,

Review Comment:
   ```suggestion
   static inline int bcmf_read_sbregw(FAR bcmf_interface_dev_t *ibus,
   ```



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi.c:
##########
@@ -0,0 +1,1101 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_gspi.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 <nuttx/config.h>
+#include <nuttx/compiler.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include <stdio.h>
+#include <debug.h>
+#include <errno.h>
+#include <assert.h>
+
+#include <nuttx/kmalloc.h>
+#include <nuttx/arch.h>
+#include <nuttx/kthread.h>
+#include <nuttx/wdog.h>
+#include <nuttx/sdio.h>
+#include <nuttx/signal.h>
+
+#include <nuttx/wireless/ieee80211/bcmf_sdio.h>
+#include <nuttx/wireless/ieee80211/bcmf_board.h>
+
+#include "bcmf_gspi.h"
+#include "bcmf_gspi_f2_frame.h"
+#include "bcmf_core.h"
+#include "bcmf_sdpcm.h"
+#include "bcmf_utils.h"
+
+#include "bcmf_sdio_core.h"
+#include "bcmf_sdio_regs.h"
+#include "cyw_reg_def.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define BCMF_GSPI_READY_TRYS            10
+#define BCMF_GSPI_THREAD_NAME           "bcmf-gspi-thread"
+#define BCMF_GSPI_THREAD_STACK_SIZE     2048
+#define BCMF_GSPI_LOWPOWER_TIMEOUT_TICK SEC2TICK(2)
+
+#ifdef CONFIG_IEEE80211_INFINEON_CYW43439
+  extern const struct bcmf_sdio_chip cyw43439_config_sdio;
+#endif
+
+#ifdef CONFIG_ARCH_CHIP_RP2040
+#  define REV16(x) __asm ("rev16 %0, %0" : "+l" (x) : :)

Review Comment:
   REV16 is only used during initialization, let's remove the assemble code instead



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c:
##########
@@ -986,6 +1058,54 @@ int bcmf_sdio_initialize(int minor, FAR struct sdio_dev_s *dev)
   return ret;
 }
 
+#endif
+
+/****************************************************************************
+ * Name: gspi_initialize
+ *
+ * Description:
+ *   Initialize the drive with a gSPI connection.
+ ****************************************************************************/
+
+#if defined(CONFIG_IEEE80211_BROADCOM_FULLMAC_GSPI)
+
+int gspi_initialize(FAR struct gspi_dev_s *gspi)

Review Comment:
   should we move to gspi specific source file



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_interface.c:
##########
@@ -0,0 +1,144 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_interface.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 <nuttx/config.h>
+
+#include <nuttx/signal.h>
+
+#include "bcmf_interface.h"
+#include "debug.h"
+#include "assert.h"
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static bcmf_interface_frame_t
+                  g_pktframes[CONFIG_IEEE80211_BROADCOM_FRAME_POOL_SIZE];

Review Comment:
   remove the leading space too



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

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

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