Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved reconnect issue #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
davewhitters marked this conversation as resolved.
Show resolved Hide resolved
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