ap6212 softap support
This commit is contained in:
parent
73a04365cb
commit
6e8b520dcb
7 changed files with 13 additions and 10 deletions
|
@ -44,8 +44,8 @@ bool DriverTool::TakeOwnershipOfFirmwareReload() {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool DriverTool::LoadDriver() {
|
||||
return ::wifi_load_driver() == 0;
|
||||
bool DriverTool::LoadDriver(int mode) {
|
||||
return ::wifi_load_driver(mode) == 0;
|
||||
}
|
||||
|
||||
bool DriverTool::UnloadDriver() {
|
||||
|
|
|
@ -27,7 +27,7 @@ extern "C"
|
|||
*
|
||||
* @return 0 on success, < 0 on failure.
|
||||
*/
|
||||
int wifi_load_driver();
|
||||
int wifi_load_driver(int mode);
|
||||
|
||||
/**
|
||||
* Unload the Wi-Fi driver.
|
||||
|
|
|
@ -36,7 +36,7 @@ class DriverTool {
|
|||
|
||||
// These methods allow manipulation of the WiFi driver.
|
||||
// They all return true on success, and false otherwise.
|
||||
virtual bool LoadDriver();
|
||||
virtual bool LoadDriver(int mode);
|
||||
virtual bool UnloadDriver();
|
||||
virtual bool IsDriverLoaded();
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ int is_wifi_driver_loaded(const char* wifi_driver_name) {
|
|||
#endif
|
||||
}
|
||||
|
||||
int wifi_load_driver() {
|
||||
int wifi_load_driver(int mode) {
|
||||
#ifdef WIFI_DRIVER_MODULE_PATH
|
||||
char module_path[128] = {0};
|
||||
char module_arg[128] = {0};
|
||||
|
@ -149,7 +149,7 @@ int wifi_load_driver() {
|
|||
return 0;
|
||||
}
|
||||
LOG(ERROR) << "wifi_load_driver: Start to insmod " << wifi_driver_name << ".ko";
|
||||
get_driver_module_arg(module_arg);
|
||||
get_driver_module_arg(module_arg, mode);
|
||||
LOG(ERROR) << "module_arg= " << module_arg;
|
||||
if (!strstr(WIFI_DRIVER_MODULE_PATH, ".ko")) {
|
||||
snprintf(module_path, sizeof(module_path), "%s%s.ko", WIFI_DRIVER_MODULE_PATH, wifi_driver_name);
|
||||
|
|
|
@ -60,7 +60,7 @@ bool WifiModeController::isFirmwareModeChangeNeeded(IfaceType type) {
|
|||
}
|
||||
|
||||
bool WifiModeController::changeFirmwareMode(IfaceType type) {
|
||||
if (!driver_tool_->LoadDriver()) {
|
||||
if (!driver_tool_->LoadDriver(convertIfaceTypeToFirmwareMode(type))) {
|
||||
LOG(ERROR) << "Failed to load WiFi driver";
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ const char *get_wifi_driver_name();
|
|||
const char *get_fw_path_sta();
|
||||
const char *get_fw_path_ap();
|
||||
const char *get_fw_path_p2p();
|
||||
void get_driver_module_arg(char* arg);
|
||||
void get_driver_module_arg(char* arg, int mode);
|
||||
const char *get_supplicant_para(int set_p2p_supported);
|
||||
|
||||
#if __cplusplus
|
||||
|
|
|
@ -705,18 +705,21 @@ const char *get_fw_path_p2p()
|
|||
return selected_wifi.fw_path_p2p;
|
||||
}
|
||||
|
||||
void get_driver_module_arg(char* arg)
|
||||
void get_driver_module_arg(char* arg, int mode)
|
||||
{
|
||||
char module_arg[256] = {0};
|
||||
const char *vendor_name = get_wifi_vendor_name();
|
||||
|
||||
ALOGE("get_driver_module_arg mode=%d", mode);
|
||||
|
||||
if(strcmp(vendor_name, "realtek") == 0) {
|
||||
const char *driver_module_arg = "ifname=wlan0 if2name=p2p0";
|
||||
snprintf(module_arg, sizeof(module_arg), "%s", driver_module_arg);
|
||||
} else if(strcmp(vendor_name, "broadcom") == 0) {
|
||||
const char *nvram_path = "nvram_path=/system/vendor/modules/nvram";
|
||||
const char *config_path = "config_path=/system/vendor/modules/config";
|
||||
snprintf(module_arg, sizeof(module_arg), "%s_%s.txt %s_%s.txt",
|
||||
snprintf(module_arg, sizeof(module_arg), "%s %s_%s.txt %s_%s.txt",
|
||||
(mode == 1) ? "op_mode=2" : "",
|
||||
nvram_path, get_wifi_module_name(), config_path, get_wifi_module_name());
|
||||
}else if(strcmp(get_wifi_vendor_name(), "xradio") == 0) {
|
||||
const char *driver_module_arg = "";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue