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 2020/11/13 16:01:25 UTC

[GitHub] [incubator-nuttx] acassis commented on a change in pull request #2294: [WIP] xtensa/esp32: Refactor ESP32 Wi-Fi driver

acassis commented on a change in pull request #2294:
URL: https://github.com/apache/incubator-nuttx/pull/2294#discussion_r523040315



##########
File path: arch/xtensa/src/esp32/Make.defs
##########
@@ -193,8 +193,7 @@ chip/$(WIRELESS_DRV_UNPACK): $(WIRELESS_DRV_ZIP)
 context:: chip/$(WIRELESS_DRV_UNPACK)
 
 clean_context::
-	$(call DELFILE, chip/$(WIRELESS_DRV_ZIP))

Review comment:
       @donghengqaz why you are not removing the downloaded files?

##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -2210,6 +2300,19 @@ void esp_phy_disable_clock(void)
   leave_critical_section(flags);
 }
 
+/****************************************************************************
+ * Name: esp_phy_update_country_info
+ *
+ * Description:
+ *   Don't support
+ *
+ ****************************************************************************/
+
+static int32_t esp_phy_update_country_info(const char *country)
+{
+  return 0;

Review comment:
       Here too: return OK;

##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -2210,6 +2300,19 @@ void esp_phy_disable_clock(void)
   leave_critical_section(flags);
 }
 
+/****************************************************************************
+ * Name: esp_phy_update_country_info
+ *
+ * Description:
+ *   Don't support
+ *
+ ****************************************************************************/
+
+static int32_t esp_phy_update_country_info(const char *country)

Review comment:
       I think it could be "int" instead of "int32_t", like you changed for coex_init_wrapper()

##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -4385,3 +4487,42 @@ int esp_wifi_connect_internal(void)
 
   return 0;
 }
+
+/****************************************************************************
+ * Name: esp_wifi_sta_register_tx_done_cb
+ *
+ * Description:
+ *   Register the txDone callback function of type wifi_tx_done_cb_t
+ *
+ * Input Parameters:
+ *   callback - The callback function
+ *
+ * Returned Value:
+ *   0 if success or -1 if fail
+ *
+ ****************************************************************************/
+
+int esp_wifi_sta_register_tx_done_cb(void *callback)
+{
+  return esp_wifi_set_tx_done_cb((wifi_tx_done_cb_t)callback);
+}
+
+/****************************************************************************
+ * Name: esp_mesh_send_event_internal
+ *
+ * Description:
+ *   Don't support
+ *
+ ****************************************************************************/
+
+int esp_mesh_send_event_internal(int32_t event_id,
+                                 void *event_data,
+                                 size_t event_data_size)
+{
+  return 0;

Review comment:
       return OK;

##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3413,261 +3534,240 @@ static void esp_wifi_delete_queue(void *queue)
 }
 
 /****************************************************************************
- * Name: esp_modem_enter_sleep
+ * Name: coex_init_wrapper
  *
  * Description:
- *   Let given module to enter sleep mode
- *
- * Input Parameters:
- *   module - hardware module ID
- *
- * Returned Value:
- *   0 if success or -1 if fail
+ *   Don't support
  *
  ****************************************************************************/
 
-static int32_t esp_modem_enter_sleep(uint32_t module)
+static int coex_init_wrapper(void)
 {
-  int ret = 0;
-  irqstate_t flags;
-  uint32_t bit;
-
-  if (module >= (uint32_t)MODEM_MODULE_COUNT)
-    {
-      return -1;
-    }
-
-  bit = 1 << module;
-
-  if (!(s_esp32_module_mask & bit))
-    {
-      return -1;
-    }
-
-  flags = enter_critical_section();
-
-  s_esp32_module_sleep |= bit;
-  if (!s_esp32_sleep && (s_esp32_module_sleep == s_esp32_module_mask))
-    {
-      ret = esp_phy_deinit_rf(PHY_MODEM_MODULE);
-      if (ret)
-        {
-          wlerr("ERROR: Failed to close RF\n");
-        }
-      else
-        {
-          s_esp32_sleep = true;
-        }
-    }
-
-  leave_critical_section(flags);
-
-  return ret;
+  return 0;
 }
 
 /****************************************************************************
- * Name: esp_modem_enter_sleep
+ * Name: coex_deinit_wrapper
  *
  * Description:
- *   Let given module to exit from sleep mode
- *
- * Input Parameters:
- *   module - hardware module ID
- *
- * Returned Value:
- *   0 if success or -1 if fail
+ *   Don't support
  *
  ****************************************************************************/
 
-static int32_t esp_modem_exit_sleep(uint32_t module)
+static void coex_deinit_wrapper(void)
 {
-  int ret = 0;
-  irqstate_t flags;
-  uint32_t bit;
-
-  if (module >= (uint32_t)MODEM_MODULE_COUNT)
-    {
-      return -1;
-    }
 
-  bit = 1 << module;
-
-  if (!(s_esp32_module_mask & bit))
-    {
-      return -1;
-    }
+}
 
-  flags = enter_critical_section();
+static int coex_enable_wrapper(void)
+{
+  return 0;
+}
 
-  s_esp32_module_sleep &= ~bit;
-  if (s_esp32_sleep)
-    {
-      ret = esp_phy_rf_init(NULL, PHY_RF_CAL_NONE,
-                            NULL, PHY_MODEM_MODULE);
-      if (ret)
-        {
-          wlerr("ERROR: Failed to open RF\n");
-        }
-      else
-        {
-          s_esp32_sleep = false;
-        }
-    }
+/****************************************************************************
+ * Name: coex_disable_wrapper
+ *
+ * Description:
+ *   Don't support
+ *
+ ****************************************************************************/
 
-  leave_critical_section(flags);
+static void coex_disable_wrapper(void)
+{
 
-  return ret;
 }
 
 /****************************************************************************
- * Name: esp_modem_register_sleep
+ * Name: esp_coex_status_get
  *
  * Description:
- *   Regitser given module so that it can enter sleep mode
- *
- * Input Parameters:
- *   module - hardware module ID
- *
- * Returned Value:
- *   0 if success or -1 if fail
+ *   Don't support
  *
  ****************************************************************************/
 
-static int32_t esp_modem_register_sleep(uint32_t module)
+static uint32_t esp_coex_status_get(void)
 {
-  irqstate_t flags;
-  uint32_t bit;
+  return 0;
+}
 
-  if (module >= (uint32_t)MODEM_MODULE_COUNT)
-    {
-      return -1;
-    }
+/****************************************************************************
+ * Name: esp_coex_condition_set
+ *
+ * Description:
+ *   Don't support
+ *
+ ****************************************************************************/
 
-  bit = 1 << module;
+static void esp_coex_condition_set(uint32_t type, bool dissatisfy)
+{
+}
 
-  flags = enter_critical_section();
+/****************************************************************************
+ * Name: esp_coex_wifi_request
+ *
+ * Description:
+ *   Don't support
+ *
+ ****************************************************************************/
 
-  if (s_esp32_module_mask & bit)
-    {
-      /* Has registered and return success */
+static int32_t esp_coex_wifi_request(uint32_t event, uint32_t latency,
+                                     uint32_t duration)
+{
+  return 0;
+}
 
-      return 0;
-    }
+/****************************************************************************
+ * Name: esp_coex_wifi_release
+ *
+ * Description:
+ *   Don't support
+ *
+ ****************************************************************************/
 
-  s_esp32_module_mask |= bit;
-  s_esp32_module_sleep |= bit;
+static int32_t esp_coex_wifi_release(uint32_t event)
+{
+  return 0;
+}
 
-  leave_critical_section(flags);
+/****************************************************************************
+ * Name: coex_wifi_channel_set_wrapper
+ *
+ * Description:
+ *   Don't support
+ *
+ ****************************************************************************/
 
+static int coex_wifi_channel_set_wrapper(uint8_t primary, uint8_t secondary)
+{
   return 0;
 }
 
 /****************************************************************************
- * Name: esp_modem_deregister_sleep
+ * Name: coex_event_duration_get_wrapper
  *
  * Description:
- *   Deregitser given module so that it can't enter sleep mode
+ *   Don't support
  *
- * Input Parameters:
- *   module - hardware module ID
+ ****************************************************************************/
+
+static IRAM_ATTR int coex_event_duration_get_wrapper(uint32_t event,
+                                                     uint32_t *duration)
+{
+  return 0;

Review comment:
       Return 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.

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