Skip to content

Commit

Permalink
Resolved reconnect issue
Browse files Browse the repository at this point in the history
  • Loading branch information
davewhitters committed Jan 13, 2022
1 parent dacac83 commit f4b694a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 29 deletions.
13 changes: 13 additions & 0 deletions host/linux/host_driver/esp32/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,11 +728,24 @@ static int __init esp_init(void)
deinit_adapter();
}

#ifdef CONFIG_SUPPORT_ESP_SERIAL
/* Create the char devices */
ret = esp_serial_init((void *)adapter);
if (ret != 0) {
printk(KERN_ERR "Error initialising serial char devices!\n");
return ret;
}
#endif

return ret;
}

static void __exit esp_exit(void)
{
#ifdef CONFIG_SUPPORT_ESP_SERIAL
/* Remove the char devices */
esp_serial_cleanup();
#endif
esp_deinit_interface_layer();
deinit_adapter();
if (resetpin != HOST_GPIO_PIN_INVALID) {
Expand Down
16 changes: 0 additions & 16 deletions host/linux/host_driver/esp32/sdio/esp_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
#include "esp_sdio_api.h"
#include "esp_api.h"
#include "esp_bt_api.h"
#ifdef CONFIG_SUPPORT_ESP_SERIAL
#include "esp_serial.h"
#endif
#include <linux/kthread.h>
#include <linux/printk.h>

Expand Down Expand Up @@ -261,10 +258,6 @@ static void esp_remove(struct sdio_func *func)

printk(KERN_INFO "%s -> Remove card", __func__);

#ifdef CONFIG_SUPPORT_ESP_SERIAL
esp_serial_cleanup();
#endif

#ifdef CONFIG_ENABLE_MONITOR_PROCESS
if (monitor_thread)
kthread_stop(monitor_thread);
Expand Down Expand Up @@ -714,15 +707,6 @@ static int esp_probe(struct sdio_func *func,
if (!tx_thread)
printk (KERN_ERR "Failed to create esp32_sdio TX thread\n");

#ifdef CONFIG_SUPPORT_ESP_SERIAL
ret = esp_serial_init((void *) context->adapter);
if (ret != 0) {
esp_remove(func);
printk(KERN_ERR "Error initialising serial interface\n");
return ret;
}
#endif

ret = esp_add_card(context->adapter);
if (ret) {
esp_remove(func);
Expand Down
13 changes: 0 additions & 13 deletions host/linux/host_driver/esp32/spi/esp_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
#include "esp_if.h"
#include "esp_api.h"
#include "esp_bt_api.h"
#ifdef CONFIG_SUPPORT_ESP_SERIAL
#include "esp_serial.h"
#endif

#define SPI_INITIAL_CLK_MHZ 10
#define NUMBER_1M 1000000
Expand Down Expand Up @@ -493,15 +490,6 @@ static int spi_init(void)
return status;
}

#ifdef CONFIG_SUPPORT_ESP_SERIAL
status = esp_serial_init((void *) spi_context.adapter);
if (status != 0) {
spi_exit();
printk(KERN_ERR "Error initialising serial interface\n");
return status;
}
#endif

status = esp_add_card(spi_context.adapter);
if (status) {
spi_exit();
Expand Down Expand Up @@ -530,7 +518,6 @@ static void spi_exit(void)
spi_context.spi_workqueue = NULL;
}

esp_serial_cleanup();
esp_remove_card(spi_context.adapter);

if (spi_context.adapter->hcidev)
Expand Down

0 comments on commit f4b694a

Please sign in to comment.