diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e4ff4fbcd3..1c453c002f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,8 +23,11 @@ check_version: - export HOSTED_NG_PATH=$PWD/esp_hosted_ng - .gitlab/ci/check_hosted_ng_version.sh rules: - - changes: - - esp_hosted_ng/esp/esp_driver/network_adapter/**/* + - when: always + tags: + - linux510 + #- changes: + # - esp_hosted_ng/**/* build_fw_esp32_sdio: stage: build diff --git a/esp_hosted_ng/host/esp_debugfs.c b/esp_hosted_ng/host/esp_debugfs.c index 9495173f8f..c96b717566 100644 --- a/esp_hosted_ng/host/esp_debugfs.c +++ b/esp_hosted_ng/host/esp_debugfs.c @@ -6,6 +6,7 @@ #define DEBUGFS_DIR_NAME "esp32" #define LOG_LEVEL "log_level" +#define VERSION "version" #define DEBUGFS_TODO 0 @@ -21,7 +22,7 @@ struct esp32_debugfs { struct dentry *debugfs_dir; struct dentry *log_level_file; /* log level for host dmesg */ - + struct dentry *version; #if DEBUGFS_TODO struct dentry *host_log_level_file; /* log level for host logs in debugfs logger */ struct dentry *host_log_file; /* debugfs host logger */ @@ -43,7 +44,10 @@ static char log_buffer[LOG_BUFFER_SIZE] = ""; static size_t log_length = 0; static size_t write_pos = 0; #endif - +#ifndef VERSION_BUFFER_SIZE +#define VERSION_BUFFER_SIZE 50 +#endif +extern char version_str[VERSION_BUFFER_SIZE]; // Read operation for the debugfs file static ssize_t log_level_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) @@ -56,6 +60,11 @@ static ssize_t log_level_read(struct file *file, char __user *buf, size_t count, return simple_read_from_buffer(buf, count, ppos, level_str, strlen(level_str)); } +static ssize_t version_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) +{ + return simple_read_from_buffer(buf, count, ppos, version_str, strlen(version_str)); +} + // Write operation for the debugfs file static ssize_t log_level_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { @@ -187,6 +196,10 @@ static const struct file_operations log_level_ops = { .write = log_level_write, }; +static const struct file_operations version_ops = { + .read = version_read, +}; + // Module initialization function int debugfs_init(void) { @@ -207,6 +220,12 @@ int debugfs_init(void) goto cleanup; } + debugfs->version = debugfs_create_file(VERSION, 0644, debugfs->debugfs_dir, NULL, &version_ops); + if (!debugfs->version) { + esp_err("Failed to create debugfs %s file\n", VERSION); + goto cleanup; + } + #if DEBUGFS_TODO debugfs->host_log_level_file = debugfs_create_file(DEBUGFS_LOG_LEVEL, 0644, debugfs_dir, NULL, &debugfs_log_level_ops); if (!debugfs->debugfs_log_level_file) { diff --git a/esp_hosted_ng/host/main.c b/esp_hosted_ng/host/main.c index 2b80ab059a..f6c9c7a54c 100644 --- a/esp_hosted_ng/host/main.c +++ b/esp_hosted_ng/host/main.c @@ -37,6 +37,9 @@ extern u8 ap_bssid[MAC_ADDR_LEN]; extern volatile u8 host_sleep; u32 raw_tp_mode = 0; int log_level = ESP_INFO; +#define VERSION_BUFFER_SIZE 50 +char version_str[VERSION_BUFFER_SIZE]; + module_param(resetpin, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(resetpin, "Host's GPIO pin number which is connected to ESP32's EN to reset ESP32 device"); @@ -231,12 +234,8 @@ void init_bt(struct esp_adapter *adapter) } } -#define VERSION_BUFFER_SIZE 50 - static int check_esp_version(struct fw_version *ver) { - char version_str[VERSION_BUFFER_SIZE] = {0}; - snprintf(version_str, VERSION_BUFFER_SIZE, "%s-%u.%u.%u.%u.%u", ver->project_name, ver->major1, ver->major2, ver->minor, ver->revision_patch_1, ver->revision_patch_2);