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

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

Reply via email to