Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 82ba594a44 | |||
| 1a5d54a321 |
+3
-3
@@ -2,7 +2,7 @@ KERN_DIR = /lib/modules/$(KERNELRELEASE)/build
|
|||||||
# feature option
|
# feature option
|
||||||
BES2600 ?= m
|
BES2600 ?= m
|
||||||
|
|
||||||
CONFIG_BES2600_TESTMODE ?= y
|
CONFIG_BES2600_TESTMODE ?= n
|
||||||
|
|
||||||
CONFIG_BES2600_ENABLE_DEVEL_LOGS ?= n
|
CONFIG_BES2600_ENABLE_DEVEL_LOGS ?= n
|
||||||
|
|
||||||
@@ -65,8 +65,8 @@ BES2600_DRV_VERSION := bes2600_0.3.5_2024.0116
|
|||||||
|
|
||||||
ifeq ($(CONFIG_BES2600_CALIB_FROM_LINUX),y)
|
ifeq ($(CONFIG_BES2600_CALIB_FROM_LINUX),y)
|
||||||
FACTORY_CRC_CHECK ?= n
|
FACTORY_CRC_CHECK ?= n
|
||||||
STANDARD_FACTORY_EFUSE_FLAG ?= y
|
STANDARD_FACTORY_EFUSE_FLAG ?= n
|
||||||
FACTORY_PATH ?= /lib/firmware/bes2600_factory.txt
|
FACTORY_PATH ?= bes2600/bes2600_factory.txt
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# basic function
|
# basic function
|
||||||
|
|||||||
+14
-19
@@ -12,6 +12,7 @@
|
|||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
#include <linux/firmware.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
#include <linux/crc32.h>
|
#include <linux/crc32.h>
|
||||||
@@ -137,38 +138,32 @@ static int bes2600_factory_crc_check(struct factory_t *factory_data)
|
|||||||
*/
|
*/
|
||||||
static int factory_section_read_file(char *path, void *buffer)
|
static int factory_section_read_file(char *path, void *buffer)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
const struct firmware *fw;
|
||||||
struct file *fp;
|
int ret;
|
||||||
|
|
||||||
if (!path || !buffer) {
|
if (!path || !buffer) {
|
||||||
bes_err("%s NULL pointer err\n", __func__);
|
bes_err("%s NULL pointer err\n", __func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bes_devel("reading %s \n", path);
|
bes_devel("requesting firmware-class %s\n", path);
|
||||||
|
|
||||||
fp = filp_open(path, O_RDONLY, 0); //S_IRUSR
|
ret = request_firmware(&fw, path, NULL);
|
||||||
if (IS_ERR(fp)) {
|
if (ret) {
|
||||||
bes_devel("BES2600 : can't open %s\n",path);
|
bes_devel("BES2600: request_firmware(%s) failed: %d\n", path, ret);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fp->f_inode->i_size <= 0 || fp->f_inode->i_size > FACTORY_MAX_SIZE) {
|
if (fw->size == 0 || fw->size > FACTORY_MAX_SIZE) {
|
||||||
bes_err( "bes2600_factory.txt size check failed, read_size: %lld max_size: %d\n",
|
bes_err("bes2600_factory.txt size check failed, read_size: %zu max_size: %d\n",
|
||||||
fp->f_inode->i_size, FACTORY_MAX_SIZE);
|
fw->size, FACTORY_MAX_SIZE);
|
||||||
filp_close(fp, NULL);
|
release_firmware(fw);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = kernel_read(fp, buffer, fp->f_inode->i_size, &fp->f_pos);
|
memcpy(buffer, fw->data, fw->size);
|
||||||
|
ret = (int)fw->size;
|
||||||
filp_close(fp, NULL);
|
release_firmware(fw);
|
||||||
|
|
||||||
if (ret != fp->f_inode->i_size) {
|
|
||||||
bes_err("bes2600_factory.txt read fail\n");
|
|
||||||
ret = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,26 +8,3 @@ extern struct device *global_dev;
|
|||||||
#define bes_info(fmt, ...) dev_info(global_dev, fmt, ##__VA_ARGS__)
|
#define bes_info(fmt, ...) dev_info(global_dev, fmt, ##__VA_ARGS__)
|
||||||
#define bes_warn(fmt, ...) dev_warn(global_dev, fmt, ##__VA_ARGS__)
|
#define bes_warn(fmt, ...) dev_warn(global_dev, fmt, ##__VA_ARGS__)
|
||||||
#define bes_err(fmt, ...) dev_err(global_dev, fmt, ##__VA_ARGS__)
|
#define bes_err(fmt, ...) dev_err(global_dev, fmt, ##__VA_ARGS__)
|
||||||
|
|
||||||
/*
|
|
||||||
* Legacy debug-subsystem-tagged log macros. The per-subsystem filtering
|
|
||||||
* was never implemented in-tree; these shims let code paths gated by
|
|
||||||
* CONFIG_BES2600_TESTMODE / CONFIG_BES2600_ITP / BES2600_DETECTION_LOGIC
|
|
||||||
* build when their conditions are enabled. The first argument is
|
|
||||||
* currently unused; pick one of the BES2600_DBG_* constants below for
|
|
||||||
* documentation.
|
|
||||||
*/
|
|
||||||
#define BES2600_DBG_SBUS 0
|
|
||||||
#define BES2600_DBG_DOWNLOAD 0
|
|
||||||
#define BES2600_DBG_ITP 0
|
|
||||||
#define BES2600_DBG_TEST_MODE 0
|
|
||||||
|
|
||||||
#define bes2600_info(_dbg, fmt, ...) bes_info(fmt, ##__VA_ARGS__)
|
|
||||||
#define bes2600_err(_dbg, fmt, ...) bes_err(fmt, ##__VA_ARGS__)
|
|
||||||
#define bes2600_warn(_dbg, fmt, ...) bes_warn(fmt, ##__VA_ARGS__)
|
|
||||||
#define bes2600_dbg(_dbg, fmt, ...) bes_devel(fmt, ##__VA_ARGS__)
|
|
||||||
#define bes2600_err_with_cond(_cond, _dbg, fmt, ...) \
|
|
||||||
do { \
|
|
||||||
if (_cond) \
|
|
||||||
bes_err(fmt, ##__VA_ARGS__); \
|
|
||||||
} while (0)
|
|
||||||
|
|||||||
+3
-3
@@ -3633,7 +3633,7 @@ static int bes2600_set_power_save(struct ieee80211_hw *hw,
|
|||||||
*
|
*
|
||||||
* Returns: 0 on success or non zero value on failure
|
* Returns: 0 on success or non zero value on failure
|
||||||
*/
|
*/
|
||||||
static int bes2600_start_stop_tsm(struct ieee80211_hw *hw, void *data)
|
int bes2600_start_stop_tsm(struct ieee80211_hw *hw, void *data)
|
||||||
{
|
{
|
||||||
struct bes_msg_start_stop_tsm *start_stop_tsm =
|
struct bes_msg_start_stop_tsm *start_stop_tsm =
|
||||||
(struct bes_msg_start_stop_tsm *) data;
|
(struct bes_msg_start_stop_tsm *) data;
|
||||||
@@ -3663,7 +3663,7 @@ static int bes2600_start_stop_tsm(struct ieee80211_hw *hw, void *data)
|
|||||||
*
|
*
|
||||||
* Returns: TSM parameters collected
|
* Returns: TSM parameters collected
|
||||||
*/
|
*/
|
||||||
static int bes2600_get_tsm_params(struct ieee80211_hw *hw)
|
int bes2600_get_tsm_params(struct ieee80211_hw *hw)
|
||||||
{
|
{
|
||||||
struct bes2600_common *hw_priv = hw->priv;
|
struct bes2600_common *hw_priv = hw->priv;
|
||||||
struct bes_tsm_stats tsm_stats;
|
struct bes_tsm_stats tsm_stats;
|
||||||
@@ -3703,7 +3703,7 @@ static int bes2600_get_tsm_params(struct ieee80211_hw *hw)
|
|||||||
*
|
*
|
||||||
* Returns: Returns the last measured roam delay
|
* Returns: Returns the last measured roam delay
|
||||||
*/
|
*/
|
||||||
static int bes2600_get_roam_delay(struct ieee80211_hw *hw)
|
int bes2600_get_roam_delay(struct ieee80211_hw *hw)
|
||||||
{
|
{
|
||||||
struct bes2600_common *hw_priv = hw->priv;
|
struct bes2600_common *hw_priv = hw->priv;
|
||||||
u16 roam_delay = hw_priv->tsm_info.roam_delay / 1000;
|
u16 roam_delay = hw_priv->tsm_info.roam_delay / 1000;
|
||||||
|
|||||||
@@ -2236,7 +2236,5 @@ int wsm_cpu_usage_cmd(struct bes2600_common *hw_priv);
|
|||||||
|
|
||||||
int wsm_wifi_status_cmd(struct bes2600_common *hw_priv, uint32_t status);
|
int wsm_wifi_status_cmd(struct bes2600_common *hw_priv, uint32_t status);
|
||||||
|
|
||||||
#if defined(STANDARD_FACTORY_EFUSE_FLAG)
|
|
||||||
int wsm_save_factory_txt_to_mcu(struct bes2600_common *hw_priv, const u8 *data, int if_id, enum bes2600_rf_cmd_type cmd_type);
|
int wsm_save_factory_txt_to_mcu(struct bes2600_common *hw_priv, const u8 *data, int if_id, enum bes2600_rf_cmd_type cmd_type);
|
||||||
#endif
|
|
||||||
#endif /* BES2600_HWIO_H_INCLUDED */
|
#endif /* BES2600_HWIO_H_INCLUDED */
|
||||||
|
|||||||
Reference in New Issue
Block a user