-diff --git a/packaging/wl12xx-compat-build.sh b/packaging/wl12xx-compat-build.sh
-index dd33741..22ee7dd 100755
---- a/packaging/wl12xx-compat-build.sh
-+++ b/packaging/wl12xx-compat-build.sh
-@@ -39,19 +39,20 @@ _preserve_kernel_config=""
+diff -uNr a/wl12xx-compat-build.sh b/wl12xx-compat-build.sh
+--- a/packaging/wl12xx-compat-build.sh 2013-01-23 18:03:14.602741237 +0800
++++ b/packaging/wl12xx-compat-build.sh 2013-01-23 18:02:46.118740560 +0800
+@@ -39,19 +39,20 @@
_menuconfig="false"
_config_file_type=android
_regdom="00"
if [ -z "$CROSS_COMPILE" ];then
export CROSS_COMPILE="`basename ${TARGET_TOOLS_PREFIX}`"
fi
-@@ -60,7 +61,7 @@ init_variables() {
+@@ -60,7 +61,7 @@
export CROSS_COMPILE="ccache $CROSS_COMPILE"
fi
export ARCH=i386
echo >&3 "ARCH: $ARCH"
echo >&3 "CROSS_COMPILE: $CROSS_COMPILE"
echo >&3 "PATH: $PATH"
-@@ -86,32 +87,33 @@ init_variables() {
+@@ -86,32 +87,39 @@
esac
PRODUCT_OUT=${TOP}/out/target/product/${BOARD}
+ local MODULE_DEST_TMP=${INSTALL_MOD_PATH}
+ cd ${COMPAT_SRC_DIR}
+ make ARCH=${ARCH} KLIB=${MODULE_DEST_TMP} KLIB_BUILD=${KERNEL_BUILD_DIR} install-modules
++ cd $TOP/ti-wlan/calibrator/
++ make
++ mkdir -p ${MODULE_DEST_TMP}/usr/sbin/ && cp -f ./calibrator ${MODULE_DEST_TMP}/usr/sbin/
++ cd $TOP/ti-wlan/wlan_prov/
++ make
++ cp -f ./wlan_prov ${MODULE_DEST_TMP}/usr/sbin/
exit_on_error $? quiet
cd ${TOP}
-@@ -134,7 +136,7 @@ usage() {
+@@ -134,7 +142,7 @@
main() {
local custom_board_list="vbox mfld_cdk mfld_pr2 mfld_gi mfld_dv10 mfld_tablet_evx ctp_pr0 ctp_pr1 mrfl_vp mrfl_hvp mrfl_sle"
do
case "${opt}" in
K)
-@@ -180,6 +182,9 @@ main() {
+@@ -180,6 +188,9 @@
r)
_regdom=$OPTARG
;;
?)
echo "Unknown option"
usage
-@@ -190,11 +195,18 @@ main() {
+@@ -190,11 +201,18 @@
for custom_board in $custom_board_list
do
* limitations under the License.
*/
-#define LOG_TAG "wlan_prov"
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <errno.h>
#include <fcntl.h>
-#include <cutils/log.h>
-#include <cutils/misc.h>
-#include <cutils/android_reboot.h>
#include <string.h>
#include <sys/types.h>
#include <dirent.h>
const unsigned char NullMacAddr[MAC_ADDRESS_LEN] = { 0, 0, 0, 0, 0, 0 };
#define WIFI_PATH "/data/misc/wifi"
-const char NVS_file_name[] = "/factory/wifi/wl1271-nvs.bin";
+const char NVS_file_name[] = "/lib/firmware/ti-connectivity/wl1271-nvs.bin";
const char Default_NVS_file_name[] = "/system/etc/wifi/wl1271-nvs.bin";
const char WLAN_SDIO_BUS_PATH[] = "/sys/bus/sdio/drivers/wl1271_sdio/";
#define WLAN_DRV_SDIO_NAME "wl1271_sdio"
file = fopen(path, "r");
if (!file) {
- LOGE("%s: %s file not found\n", __func__, path);
+ /* LOGE("%s: %s file not found\n", __func__, path); */
goto out;
}
char *uevent_entry = NULL;
char sub_entry[256];
if (!sdio_path) {
- LOGE("Cannot open directory, ret with %d\n", errno);
+ /* LOGE("Cannot open directory, ret with %d\n", errno); */
ret = -EINVAL;
goto exit;
}
file_path = (char *) malloc(n+1);
if (!file_path) {
- LOGE("Not enough space\n");
+ /* LOGE("Not enough space\n"); */
ret = -ENOMEM;
goto fail;
}
file = fopen(file_path, "w");
if (!file) {
- LOGE("Unable to open file %s in write mode", file_path);
+ /* LOGE("Unable to open file %s in write mode", file_path); */
ret = -EIO;
goto open_fail;
}
fprintf(file,"%s", driver_id);
if (fclose(file)) {
- LOGE("Unable to close file");
+ /* LOGE("Unable to close file"); */
ret = -EIO;
}
ChaabiMacAddr = (unsigned char *) malloc(MAC_ADDRESS_LEN);
memcpy(ChaabiMacAddr, NullMacAddr, MAC_ADDRESS_LEN);
- LOGW("MAC not found");
+ /* LOGW("MAC not found"); */
#ifdef BUILD_WITH_CHAABI_SUPPORT
}
#endif
nvsBinFile = fopen(NVS_file_name, "rb");
if (!nvsBinFile) {
- LOGI("run calibration");
+ /* LOGI("run calibration"); */
if (wifi_calibration()) {
res = -2;
goto end;
/* NVS file already exist but chaabi read error */
/* exit here to avoid randomize new MAC address */
/* at each boot */
- res = 0;
- goto end;
+ /* res = 0;
+ * goto end;
+ * we need to randomize new MAC address because we can't read
+ * chaabi and we have the same nvs file for all devices
+ */
}
}
ChaabiMacAddr[3] = (unsigned char) (rand() & 0xff);
ChaabiMacAddr[4] = (unsigned char) (rand() & 0xff);
ChaabiMacAddr[5] = (unsigned char) (rand() & 0xff);
- LOGI("MAC randomized");
+ /* LOGI("MAC randomized"); */
}
/* Chaabi MAC @ shall be write in NVS file ? */
return res;
fatal:
sync();
- android_reboot(ANDROID_RB_RESTART, 0, 0);
+ /* android_reboot(ANDROID_RB_RESTART, 0, 0); */
return res;
}
int err = 0;
char system_cmd[500];
- snprintf(system_cmd, sizeof(system_cmd), "/system/bin/calibrator set nvs_mac"
+ snprintf(system_cmd, sizeof(system_cmd), "/usr/sbin/calibrator set nvs_mac"
" %s %02x:%02x:%02x:%02x:%02x:%02x",
NVS_file_name,
MacAddr[0], MacAddr[1], MacAddr[2],
MacAddr[3], MacAddr[4], MacAddr[5]);
- if (debug)
+ /* if (debug)
LOGI("cmd: %s",system_cmd);
+ */
err = system(system_cmd);
- if (err)
+ /* if (err)
LOGE("NVS update with new MAC error= %d",err);
+ */
return err;
}
int module_is_loaded = 0;
/* start calibration & nvs update */
- snprintf(system_cmd, sizeof(system_cmd), "/system/bin/calibrator plt autocalibrate wlan0"
+ snprintf(system_cmd, sizeof(system_cmd), "/usr/sbin/calibrator plt autocalibrate wlan0"
" /lib/modules/wl12xx_sdio.ko %s %s %s",
TQS_FILE,
NVS_file_name,
(unsigned char *)"08:00:28:DE:AD:00");
- if (debug)
+ /* if (debug)
LOGI("cmd: %s",system_cmd);
+ */
err = system(system_cmd);
- if (err)
+ /* if (err)
LOGE("Calibration error= %d",err);
+ */
return err;
}