xiewenxiang commented on a change in pull request #3543:
URL: https://github.com/apache/incubator-nuttx/pull/3543#discussion_r616396388



##########
File path: arch/risc-v/src/esp32c3/esp32c3_hcisocket_host.c
##########
@@ -0,0 +1,373 @@
+/****************************************************************************
+ * arch/risc-v/src/esp32c3/esp32c3_hcisocket_host.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>
+
+#ifdef CONFIG_ESP32C3_BLE
+
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "esp32c3_ttyhci.h"
+#include "esp32c3_hcisocket_host.h"
+
+#include <time.h>
+#include <sys/time.h>
+#include "esp32c3_ble_adapter.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define BTPROTO_HCI 1
+#define HCI_CHANNEL_RAW   0
+#define HCI_CHANNEL_USER  1
+#define HCIDEVDOWN  0x400448ca
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct sockaddr_hci
+{
+  sa_family_t     hci_family;
+  unsigned short  hci_dev;
+  unsigned short  hci_channel;
+};
+
+typedef struct
+{
+    uint8_t *q_data;
+    uint16_t q_data_len;
+} host_rcv_data_t;
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static void controller_rcv_pkt_ready(void);
+static int host_rcv_pkt(uint8_t *data, uint16_t len);
+
+/****************************************************************************
+ * Public Functions declaration
+ ****************************************************************************/
+
+int bthcisock_host_avail(int fd);
+int bthcisock_host_send(int fd, const void *data, size_t len);
+int bthcisock_host_read(int fd, void *data, size_t len);
+int bthcisock_host_open(int dev_idx);
+int bthcisock_host_close(int fd);
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static int32_t hci_queue_size = 0;
+static void * hci_queue = NULL;
+static esp_vhci_host_callback_t vhci_host_cb =
+{
+    controller_rcv_pkt_ready,
+    host_rcv_pkt
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: controller_rcv_pkt_ready
+ *
+ * Description:
+ *   If the controller could receive HCI comand will callback this function.
+ *
+ * Input Parameters:
+ *   None
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+static void controller_rcv_pkt_ready(void)
+{
+}

Review comment:
       Not used. but needs to be adapted.

##########
File path: arch/risc-v/src/esp32c3/esp32c3_wifi_adapter.c
##########
@@ -2428,6 +2428,10 @@ static void wifi_phy_enable(void)
       esp_phy_enable_clock();
       phy_set_wifi_mode_only(0);
       register_chipv7_phy(&phy_init_data, cal_data, PHY_RF_CAL_NONE);
+#ifdef CONFIG_ESP32C3_BLE
+      extern void coex_pti_v2(void);

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.

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


Reply via email to