int fnum, ret;
if (mSock < 0) {
- LOGE("Softap start - failed to open socket");
+ LOGE("Softap driver start - failed to open socket");
return -1;
}
if (!iface || (iface[0] == '\0')) {
- LOGD("Softap start - wrong interface");
+ LOGD("Softap driver start - wrong interface");
iface = mIface;
}
fnum = getPrivFuncNum(iface, "START");
if (fnum < 0) {
- LOGE("Softap start - function not supported");
+ LOGE("Softap driver start - function not supported");
return -1;
}
strncpy(wrq.ifr_name, iface, sizeof(wrq.ifr_name));
wrq.u.data.pointer = mBuf;
wrq.u.data.flags = 0;
ret = ioctl(mSock, fnum, &wrq);
- LOGD("Softap start: %d", ret);
+ usleep(AP_DRIVER_START_DELAY);
+ LOGD("Softap driver start: %d", ret);
return ret;
}
int fnum, ret;
if (mSock < 0) {
- LOGE("Softap stop - failed to open socket");
+ LOGE("Softap driver stop - failed to open socket");
return -1;
}
if (!iface || (iface[0] == '\0')) {
- LOGD("Softap start - wrong interface");
+ LOGD("Softap driver stop - wrong interface");
iface = mIface;
}
fnum = getPrivFuncNum(iface, "STOP");
if (fnum < 0) {
- LOGE("Softap stop - function not supported");
+ LOGE("Softap driver stop - function not supported");
return -1;
}
strncpy(wrq.ifr_name, iface, sizeof(wrq.ifr_name));
wrq.u.data.pointer = mBuf;
wrq.u.data.flags = 0;
ret = ioctl(mSock, fnum, &wrq);
- LOGD("Softap stop: %d", ret);
+ LOGD("Softap driver stop: %d", ret);
return ret;
}
if (mPid) {
LOGE("Softap already started");
- errno = EBUSY;
- return -1;
+ return 0;
}
if (mSock < 0) {
LOGE("Softap startap - failed to open socket");
#include <utils/List.h>
#define SOFTAP_MAX_BUFFER_SIZE 4096
-#define AP_BSS_START_DELAY 500000
+#define AP_BSS_START_DELAY 200000
#define AP_BSS_STOP_DELAY 500000
#define AP_SET_CFG_DELAY 500000
+#define AP_DRIVER_START_DELAY 400000
class SoftapController {
char mBuf[SOFTAP_MAX_BUFFER_SIZE];