system/qcom: Add new SoftAP APIs to send new commands to driver

- Add SoftAP API to send initAP cmd to Driver
- Add SoftAP API to send exitAP cmd to Driver
- Add SoftAP API to update macaddr_acl value

CRs-fixed: 331343, 333643

Change-Id: I662b819a4055a652649748461e58b1ab50e0b01e
Acked-by:  Ramasundar Kara Venkata <nkaraven@qca.qualcomm.com>
This commit is contained in:
Sameer Thalappil
2012-01-30 16:56:29 -08:00
committed by Linux Build Service Account
parent baad0d7814
commit caf8792027
4 changed files with 104 additions and 5 deletions

View File

@@ -263,6 +263,63 @@ void qsap_send_module_down_indication(void)
}
}
s32 qsap_send_init_ap(void)
{
int s, ret;
struct iwreq wrq;
s32 status = eSUCCESS;
u32 *params = (u32 *)&wrq.u;
/* Equivalent to: iwpriv wlan0 initAP */
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) >= 0) {
strncpy(wrq.ifr_name, "wlan0", IFNAMSIZ);
wrq.u.data.length = 0; /* No Set arguments */
wrq.u.data.flags = 2; /* WE_INIT_AP sub-command */
ret = ioctl(s, (SIOCIWFIRSTPRIV + 6), &wrq);
if (ret < 0 ) {
LOGE("ioctl failed: %s", strerror(errno));
status = eERR_START_SAP;
}
close(s);
sched_yield();
}
else {
LOGE("Socket open failed: %s", strerror(errno));
status = eERR_START_SAP;
}
return status;
}
s32 qsap_send_exit_ap(void)
{
int s, ret;
struct iwreq wrq;
s32 status = eSUCCESS;
u32 *params = (u32 *)&wrq.u;
/* Equivalent to: iwpriv wlan0 exitAP */
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) >= 0) {
strncpy(wrq.ifr_name, "wlan0", IFNAMSIZ);
wrq.u.data.length = 0; /* No Set arguments */
wrq.u.data.flags = 3; /*WE_EXIT_AP sub-command */
ret = ioctl(s, (SIOCIWFIRSTPRIV + 6), &wrq);
if (ret < 0 ) {
LOGE("ioctl failed: %s", strerror(errno));
status = eERR_STOP_SAP;
}
close(s);
sched_yield();
}
else {
LOGE("Socket open failed: %s", strerror(errno));
status = eERR_STOP_SAP;
}
return status;
}
s32 wifi_qsap_unload_driver()
{
s32 ret = eSUCCESS;
@@ -434,6 +491,25 @@ s32 wifi_qsap_start_softap()
return eERR_START_SAP;
}
#ifdef QCOM_WLAN_CONCURRENCY
s32 wifi_qsap_start_softap_in_concurrency()
{
s32 status;
/*Send initAP IOCTL to Driver. Hostapd start is done by Netd.*/
status = qsap_send_init_ap();
return status;
}
s32 wifi_qsap_stop_softap_in_concurrency()
{
s32 status;
/*Send exitAP IOCTL to Driver. Hostapd stop is done by Netd.*/
status = qsap_send_exit_ap();
return status;
}
#endif
s32 wifi_qsap_stop_softap()
{
s32 ret = eSUCCESS;