Compare commits

..

104 Commits

Author SHA1 Message Date
RenanQueiroz
4e4088e990 softap: sdk: Add 'vendor.' prefix to wlan.driver.config
* In 126af66b04,
  the prop wlan.driver.config was renamed to vendor.wlan.driver.config.
  Therefore, make the same change on softap as well.

Change-Id: I696d851c8ecd35ec42cf680149c402b3b8044cfc
2020-10-28 18:03:09 +05:30
Erfan Abdi
a9826d3adb qsap: Suppress errors
Change-Id: I2809d3acd0e2ae402f9d15351bc9cb7a68f5be7a
2020-10-28 18:03:09 +05:30
Christopher N. Hesse
95aff2bc4e softap: sdk: Declare VNDK usage
Change-Id: I8d408c34947d9febf6afa95929bf9fb696d9d097
2020-10-28 18:02:59 +05:30
Arne Coucheron
275f1fa09d qsap: Fix missing log symbols
Add liblog to LOCAL_SHARED_LIBRARIES instead of using LOCAL_LDLIBS.

Change-Id: Iaf8fbc245babce372f047f73cb1400b19c54836d
2020-10-28 18:02:53 +05:30
Linux Build Service Account
701194c5a1 Merge 1b6053c5cd on remote branch
Change-Id: I62879cd722c4a9cbaf69538e4c9aab876125846c
2020-02-10 10:46:46 -08:00
Alexei Avshalom Lazar
1b6053c5cd QSAP: add support for setting EDMG configuration in hostapd
EDMG is disabled by default.
Add support for setting EDMG configuration for wigig softap.

Change-Id: I64ca5ae8dd4a837e658e07dda5a5ec6417020319
CRs-Fixed: 2567407
2019-12-01 00:52:38 -08:00
Dedy Lansky
a2dd08f8d4 QSAP: add support for setting ieee80211ax in hostapd
80211ax is enabled by default. allow disabling 80211ax for wigig
softap.
Also add support for creating a seperate config file for
wigig, to avoid conflicts with wifi APs.

Change-Id: If04f7da1695715aea037a01da11728c7350ed68c
2019-11-19 17:14:34 +02:00
Linux Build Service Account
b03a2ea9f4 Merge 59c014ff95 on remote branch
Change-Id: I7cd3744295ec99bf296247b73561d3d42b369394
2019-11-12 20:08:29 -08:00
Dedy Lansky
59c014ff95 QSAP: add support for HW_MODE_AD (Wigig)
Add "ad" to list of supported operating modes and add GCMP to the list
of valid pairwise ciphers.
For AD mode, disable HT capability as this is not relevant for Wigig.

Change-Id: Ia036859fe4d15b5f2fc9ff5b22c3b508fc8aae13
2019-08-08 09:58:36 +03:00
Hu Wang
62ae34e1a4 QSAP: Add support to set sae_require_mfp parameter
For SAE transtion mode, set sae_require_mfp to 1 to require MFP
for all associations using SAE.

CRs-Fixed: 2390790
Change-Id: I64bd35cbb77f6c9b64970c9a9db0a1bc3aeb2314
2019-03-21 10:33:18 -07:00
Abhishek Srivastava
2443024a1a wlan: Add default hostapd configuration file
If the hostapd configuration files are not present in /data/vendor/wifi,
copy it from the default file location /vendor/etc/hostapd
while starting softAP.

Change-Id: I3093e99cdd906d86035f9e8dbfdddb06ae9f7c80
CRs-Fixed: 2409527
2019-03-08 05:59:48 -08:00
Linux Build Service Account
e0c1c7780a Merge "QSAP: Enhance 'set' commmand to configure for OWE" 2019-01-02 18:28:14 -08:00
Hu Wang
d855500014 QSAP: Enhance 'set' commmand to configure for OWE
This creates a new hostapd_owe.conf if use below 'set' CMD:
  "softap qccmd set owe <args>"

CRs-Fixed: 2356574
Change-Id: I1ef4f11f7bdb3155dcfbc2c75fa106c8a3ecc61a
2018-12-06 18:15:48 +08:00
Hu Wang
aa4c6caf36 QSAP: Add support to set owe_transition_ifname parameter
CRs-Fixed: 2356574
Change-Id: Ib06fdc0e7120328e8cae07a4441ab23045e0c45c
2018-11-27 17:24:17 +08:00
Abhishek Srivastava
b44cdad94e QCSDK: Add support of wowlan_triggers, accept/deny_mac_file configuration.
This allows setting of following configs to hostapd.conf through QSAP:
wowlan_triggers accept_mac_file, deny_mac_file

CRs-Fixed: 2336537
Change-Id: If6a9e6a202e7aec86e1a3562bb392459a61287a2
2018-10-24 19:07:40 +05:30
Ajit Vaishya
996f2a81d8 Remove reading of ini file from wlan property
Remove reading of ini file from wlan.driver.config
property since it is not used anymore.
This would prevent unnecessary avc denial warning.

CRs-Fixed: 2314284
Change-Id: Idceaef0262bada69a2d69d3bae2d69cbeff4efcf
2018-09-12 21:45:21 +05:30
Srikanth Marepalli
71d1ddbe77 qsap: Add NULL check for soc & msg allocations in qsap_get_mode
Add appropriate checks to avoid NULL pointer dereferencing.

Change-Id: I9b96eeb1cf3b860416c950b5c689dc5858e194c6
CRs-Fixed: 2300013
2018-08-28 07:06:06 -07:00
Purushottam Kushwaha
68e72488ab QSAP: add support to set acs_exclude_dfs parameter.
acs_exclude_dfs is needed to avoid selection of DFS channels when
ACS (channel=0) is set for 5Ghz. This commit adds support for this
acs_exclude_dfs parameter.

Change-Id: If8a8777e7ec45bd37fd7e94e6f114852b2636b0c
CRs-Fixed: 2299524
2018-08-20 14:14:41 +05:30
Hu Wang
76d63aadc7 qsap: Convert SIOCGIWMODE to nl80211 for qsap_get_mode
Wireless extension is deprecated, hence convert SIOCGIWMODE to nl80211
for qsap_get_mode.

Change-Id: I30c3b4c2859b7c9c621f3f74d51e0e039837dcc9
CRs-Fixed: 2274099
2018-07-15 22:40:17 -07:00
Veerendranath Jakkam
bfad727b06 qsap: Add NULL check for getpwnam and getgrnam.
Add appropriate checks to avoid NULL pointer dereferencing.

Change-Id: I0961a8e55fea055ee731e20ae28c833c54c32e67
CRs-Fixed: 2263188
2018-06-19 16:38:02 +05:30
Purushottam Kushwaha
e4263cecd2 QSAP: Fixing LOCAL_MODULE flag to LOCAL_VENDOR_MODULE
CRs-Fixed: 2255114
Change-Id: I5d55ff31400cef3b4fcbb2ba37d373ed0de44c39
2018-06-06 14:39:35 +05:30
Purushottam Kushwaha
2ef0af2cb2 QSAP: Add support to set operating mode "any".
Currently softap sdk allows only following modes:
"b", "g", "n", "g-only", "n-only", "a".

This commit adds support for hw_mode "any" via QSAP.

CRs-Fixed: 2250379
Change-Id: I13de4c196c3cd752a902ef8bf3fed4a01f95eb6a
2018-05-31 19:06:12 +05:30
CNSS_WLAN Service
a087076b93 Merge "QSAP: Do not modify hw_mode when channel is set to 0 (for ACS)." into wlan-service.lnx.4.0 2018-05-25 07:26:54 -07:00
Purushottam Kushwaha
168beebc4e QSAP: Do not modify hw_mode when channel is set to 0 (for ACS).
Currently when channel value is less than 14, hw_mode is set to
g (or b). Application might want to run ACS by setting channel=0
in all possible hw modes.

This commit skip changing hw_mode, if channel is set to 0.

Change-Id: I0da492d70ec9c9455d79e4df33fb86a7313633ba
CRs-Fixed: 2245734
2018-05-21 07:58:24 -07:00
Purushottam Kushwaha
9283d3e375 QSAP: use vendor path for default hostapd files.
This redefines macros to use "/data/vendor/wifi/hostapd/" path for
read/write/update hostapd configuration parameters.

Additionaly, it creates libqsap_headers which other modules can use
to refer/include *.h files in this project.

Change-Id: Ice64e5a56a69882b001b2f3bcd99ba0f91ffc8a2
CRs-Fixed: 2244795
2018-05-18 20:19:42 +05:30
Veerendranath Jakkam
c613ebbc1c qsap: Fix VNDK compilation issues of libqsap.
- Removed "android_filesystem_config.h" references.
- Added cutils header library in Android.mk.
- Added required system headers explicitly.

Change-Id: I1213fc40335fba7ea52c4c296b28bc66cba72701
CRs-Fixed: 2244720
2018-05-18 18:42:03 +05:30
Veerendranath Jakkam
20f62e8554 softap: Make softap libs as vendor module libs.
- Make libqsap_sdk as vendor module.
- Remove "libQWiFiSoftApCfg" module.

Change-Id: Ie9c5795faae1d08b580cb23fe5d1a57caf1b014a
CRs-Fixed: 2239628
2018-05-06 23:35:49 +05:30
Veerendranath Jakkam
f4f45de50c softap: Ensure VNDK compliance.
Replace LOCAL_COPY_HEADERS with LOCAL_EXPORT_C_INCLUDE_DIRS.

CRs-Fixed: 2221808
Change-Id: Ic35fef21a142b9dc76e435b3b0898e841ff76c75
2018-04-10 20:04:00 +05:30
Ajit Vaishya
3f87532c1e qsap: Support to configured Vendor IE elements in hostapd.conf.
With this commit, able to configured vendor_elements and
assocresp_elements in hostapd.conf file.
i.e
  qdc softap qccmd set vendor_elements=<Values>
  qdc softap qccmd set assocresp_elements=<Values>

Change-Id: Ib67413779a347c6567ab093bf84f87b1b63cc7db
CRs-Fixed: 2197458
2018-02-28 23:53:47 +05:30
Peng Xu
4d42a1d281 softap: Fix KW issue for array index out of bounds
Check the length of the buffer before using it calculate
the index of the data in the buffer to prevent index becoming
a negative value.

Change-Id: I3dc440dac2e4a5437e2ff70c39577876a3a97123
CRs-fixed: 2111307
2017-09-19 11:04:49 -07:00
Srinivas Dasari
a7f0080a40 qsap: Initialize setCmd to avoid uninitialized memory access
setCmd variable is used to prepare the command with the
arguments received. This can be initialized to the string "str"
to avoid possible uninitialized memory access.

Change-Id: I60cb4de5b01560e4bb079ed92e6c3bde6cfbf9c7
CRs-Fixed: 2098740
2017-09-18 12:24:26 +05:30
Abhishek Srivastava
80064989b2 qsap: Allow empty wpa_passphrase
With this commit, wpa_passphrase should follow below condition:
1. empty string (len = 0)
2. string with length >= 8 && length <= 64

Change-Id: I029ac7cc2b32b564b4e3d6b747cc584ba59e5fde
2017-09-04 04:26:38 -07:00
Ajit Vaishya
8c3357cbe4 qsap: Point the hostapd configuration location to /data/misc/wifi
1) This commit points the hostapd configuration location
   to /data/misc/wifi.
2) Aims to enable configure ctrl_interface via qsap command.

CRs-Fixed: 2091779
Change-Id: I8ebfdd4b5c359659272209ab2e0f7b92793e51c9
2017-08-14 22:47:42 +05:30
Purushottam Kushwaha
0e5ec067f7 qsap: Add API to get device mac address based on interface name.
This adds new API linux_get_ifhwaddr() which can be used to get
mac address of input interface. IOCTL SIOCGIFHWADDR is used to get
the interface address.

CRs-Fixed: 2080924
Change-Id: I1b825fb2c1f35280d2d57928be4f87d23d78decb
2017-07-27 20:49:56 -07:00
Purushottam Kushwaha
a7c3aa8a21 qsap: Modify qsapsetSoftap API to set dual2g/5g configurations.
This enhances qsapsetSoftap to take arguments for dual2g and dual5g
configurations while maintaining backward compatibility to set
config file in case of standalone sap.

Additionally enhance 'set' command to configure ssid2 and bridge
parameters which are needed for dual2g/dual5g. Also when setting
ssid2, disable ssid in config files (or vice-versa).

CRs-Fixed: 2080924
Change-Id: I60bf62e6b2ad0cde3ebdfff4814f2ab98aa24b92
2017-07-27 20:49:20 -07:00
Ajit Vaishya
a21d26579d qsap: Enhance 'set' command to configure for SAP + SAP.
This enhances existing 'set' command to allow configuration of dual
SAP. It will create/read/write/update to following configuration files:
CMD: "softap qccmd set channel=6" writes to hostapd.conf
CMD: "softap qccmd set dual2g channel=6" writes to hostapd_dual2g.conf
CMD: "softap qccmd set dual5g channel=6" writes to hostapd_dual5g.conf

Additionally enable LOG_TAG for logging APIs with TAG "QCSDK" and
modify default config file location.

CRs-Fixed: 2080924
Change-Id: I46c59de7fbd2ea273793406f0b82515df94e5c38
2017-07-27 20:48:41 -07:00
Ajit Vaishya
5d72c3af41 qsap: Add APIs to control and manage bridge interface.
This adds APIs to trigger create, delete, interface up and interface
down commands on bridge interface.
It uses following IOCTLs for sending command to linux kernel:
Add bridge iface: SIOCBRADDBR
Remove bridge iface: SIOCBRDELBR
Mark iface up/down: SIOCGIFFLAGS

CRs-Fixed: 2080924
Change-Id: I3d34dc16e9ca82dc4b550cbc83fa4120c80ad54c
2017-07-27 14:08:21 -07:00
Purushottam Kushwaha
a49496aea8 qsap: Remove support for wifi_fst from QSAP APIs
wifi_fst.h is no longer part of /hardware/libhardware_legacy/ ,
therefore, compilation of libqsap_sdk would fail. Remove dependencies
for wifi_fst from QSAP.

Additionally, skip calling 'chown' after changing configuration
parameters as QSAP is not changing ownership.

CRs-Fixed: 2069881
Change-Id: Iaadfa182270f22555e486dac24a5acafc247b943
2017-07-13 12:12:08 +05:30
Linux Build Service Account
f4e6d19070 Promotion of wlan-service.lnx.1.1-00019.
CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1017907 1044315   Ic8fcabf0ad514e5a73d5a9a9ebccb6ca52dcb9b4   Softap: Add support for STA+SoftAP Concurrency

Change-Id: I7eaeacea9a9d6b45dbf87b52c65313386c1897d4
CRs-Fixed: 1017907, 1044315
2016-07-25 08:11:51 -06:00
Nalla Kartheek
f4eef25c34 Softap: Add support for STA+SoftAP Concurrency
1. Add functions to create and remove softap interface using
   NL commands.
2. Write Softap interface into hostapd.conf.

Change-Id: Ic8fcabf0ad514e5a73d5a9a9ebccb6ca52dcb9b4
CRs-Fixed: 1044315
2016-07-22 13:15:28 -07:00
Linux Build Service Account
5cf4b594e9 Promotion of wlan-service.lnx.1.1-00018.
CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1014736   Ic2dd119b1fbfbf88b7b39000c1633792c8a628c2   qsap: add functions for calling FST manager start/stop

Change-Id: I319845b13411ff32ceea9c706d1ed1358989baff
CRs-Fixed: 1014736
2016-07-11 10:10:01 -06:00
Hamad Kadmany
421ce6f83e qsap: add functions for calling FST manager start/stop
FST manager start/stop need to be done in sync with start/stop
of softAP controller.
To support such functionality, added general functions that
can be used pre and post softAP start/stop operations.

Change-Id: Ic2dd119b1fbfbf88b7b39000c1633792c8a628c2
CRs-Fixed: 1014736
2016-06-16 12:43:56 +03:00
Linux Build Service Account
f70b065f22 Promotion of wlan-service.lnx.1.1-00008.
CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1025722   If284ce12b1141bde8d01bee7023ac9ae94d255b7   GTK: Decrease GTK rekey interval

Change-Id: Ic7a80bf0d046869f26f397ec03f80e03cc3be8f2
CRs-Fixed: 1025722
2016-06-14 12:26:21 -06:00
c_rrajiv
c160697b1f GTK: Decrease GTK rekey interval
GTK rekey interval is reduced to match with
standard values existing with commercial APs.
This further helps in testing the GTK rekeying
functionality and offload scenarios with SAP case.

CRs-Fixed: 1025722

Change-Id: If284ce12b1141bde8d01bee7023ac9ae94d255b7
2016-06-08 00:48:54 -07:00
Linux Build Service Account
6228c9263b Merge "Promotion of wlan-service.lnx.1.1-00003." 2016-05-24 03:22:27 -07:00
Linux Build Service Account
2a1b069ae0 Promotion of wlan-service.lnx.1.1-00003.
CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1016741   Idf747b74191de4904ca939601a263b9fb8f9e971   softap: support for starting/stopping Wigig soft AP

Change-Id: I6751c19f041b93fbd956e1e3f2626796c3557c8e
CRs-Fixed: 1016741
2016-05-23 20:33:06 -07:00
Linux Build Service Account
7cab567836 Promotion of wlan-service.lnx.1.1-00002.
CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1016741   Idf747b74191de4904ca939601a263b9fb8f9e971   softap: support for starting/stopping Wigig soft AP

Change-Id: I17dcde26ac9275cacc600ae92fb332f89c146935
CRs-Fixed: 1016741
2016-05-22 23:36:13 -06:00
Dedy Lansky
350c353182 softap: support for starting/stopping Wigig soft AP
Support new command: eCMD_ENABLE_WIGIG_SOFTAP.

Change-Id: Idf747b74191de4904ca939601a263b9fb8f9e971
CRs-Fixed: 1016741
2016-05-17 02:14:25 -07:00
Linux Build Service Account
4d6c04aa73 Promotion of wlan-service.lnx.1.0-00014.
CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
943343 943343   I37d8927f2973f90772ab46cc767fdea1ac9cfc6b   wlan: Add support for ieee80211h hostapd config

Change-Id: I5ce5eff98aa7188b654c69a702af16406d87921a
CRs-Fixed: 943343
2016-02-03 01:23:39 -08:00
Pradeep Reddy POTTETI
5c1a3abaf0 wlan: Add support for ieee80211h hostapd config
Support for configuring ieee80211h parameter in
hostapd configuration file through soft AP SDK.

Change-Id: I37d8927f2973f90772ab46cc767fdea1ac9cfc6b
CRs-Fixed: 943343
2016-01-07 20:03:13 +05:30
Ashwini Sukhadev Patil
1e2073ebaf Softap: Avoid possible array index out-of-bounds access.
Return value of snprintf can be more than size value when output
is truncated, so copying the '\0' at return value may cause array
index out-of-bound access. And as snprintf function takes care of
terminating the string with '\0', its redundant to copy '\0' at
return value.

CRs-Fixed: 947966
Change-Id: Ic5dab6d9aa57db5000f23c82e2a22924e0154c40
2015-12-07 12:11:48 +05:30
Linux Build Service Account
c46bf72725 Merge "Modify NDC commands to write to hostapd.conf" 2015-09-22 20:58:29 -07:00
Linux Build Service Account
bb81a3fc87 Merge "wlan: Add support for 11AC, ACS hostapd config" 2015-09-22 20:58:29 -07:00
Pradeep Reddy POTTETI
a1c6f1dbe5 Provide read/write access on accept/deny files to hostapd
This commit provides read/write access on accept/deny files
to hostapd similar to hostapd.conf.

Change-Id: I1c3cda056a4067d48484cb336e748f04804b68e3
CRs-fixed: 910398
2015-09-18 20:20:16 +05:30
Ashwini Sukhadev Patil
cc16315997 Modify NDC commands to write to hostapd.conf
Provision to configure rts_threshold, fragm_threshold and
wmm_enabled in hostapd.conf through NDC commands.

CRs-Fixed: 889979
Change-Id: I94e4486573b562fbe48c641423bf1c1389d0c744
2015-09-11 19:14:22 +05:30
Manikandan Mohan
e1bfb737ad wlan: Add support for 11AC, ACS hostapd config
Support for configuring 11ac and ACS channel list parameters in
hostapd configuration file through soft AP SDK.

Change-Id: I45c4f4285357701299c44f31243dea5107b0fabb
CRs-Fixed: 892713
2015-09-09 17:38:47 -07:00
Linux Build Service Account
cddacfa293 Merge 650d036038 on remote branch
Change-Id: I622541a7fac02a2db2d869da97a513b062955b4a
2015-08-16 23:56:06 -06:00
c_rrajiv
e629e82bc8 wlan: Add softap support through ndc commands.
Changes required to support the softap commands
through ndc cli. This new support as part of the
64bit enablement and ndc is used for cli automation
in softap testcases.
Change-Id: I460a3785c3b4a44656281c7243ebdf921fe20f91
CRs-Fixed: 710050
2015-07-20 16:39:08 +05:30
Bala Krishna Bhamidipati
650d036038 Invoke qsap_set_ini_filename to set the fIni (if NULL)
If WIFI_DRIVER_CONF_FILE is not defined fIni is set to null and
hence all the set/get_cfg SAP commands fail. Thus, Invoke
qsap_set_ini_filename explicitly if fINI is NULL.

Change-Id: I9df1f95d7f4b884602cc501fe9e75ff4c26e400c
CRs-Fixed: 865432
2015-07-06 15:33:57 +05:30
Changzhi Deng
fddc6bed07 Hotspot: Set maximun client connections number
This function is for end user to set maximun client
connections number and apply this to hostapd module

Change-Id: I6150b376d22756e8c04ebabe666d81cf3af8fc87
2015-06-09 18:23:27 -07:00
Linux Build Service Account
4659de289b Merge "qcom-softap: Replace strcat & strcpy with strlcat & strlcpy" 2015-03-28 09:49:54 -07:00
Naresh Jayaram
71846207cc qcom-softap: Replace strcat & strcpy with strlcat & strlcpy
strcpy and strcat are not safe, instead use strlcpy and strlcat
which have control over the number of bytes to be written to
the output str or buffer.

CRs-Fixed: 802872
Change-Id: I7b6748946633dda551a1015678d41846c19adeb2
2015-03-24 10:28:18 +05:30
Linux Build Service Account
120aeacf0f Merge "Merge d98f57876f on remote branch" 2014-12-09 03:11:03 -08:00
Linux Build Service Account
64f15fc591 Merge d98f57876f on remote branch
Change-Id: I539218e4d40ef020b4913e1540ab8acbf7db1d88
2014-12-08 00:06:00 -07:00
Linux Build Service Account
d98f57876f Merge "framework: Fix for making SAP sdk code 64 bit compliant" 2014-12-06 12:18:56 -08:00
Linux Build Service Account
e9159df711 Merge "Merge 04a6a9712e on remote branch" 2014-12-05 02:45:36 -08:00
Ravi Joshi
5620bb1611 framework: Fix for making SAP sdk code 64 bit compliant
Fix for making SAP SDK code 64 bit compliant. The typedefs
were incorrect on an LP64 architecture since a long int will
be 64-bits.

Change-Id: I4c9f5f2fb2b820193fbe03fdf8e2307c281ea014
CRs-Fixed: 640894
2014-12-04 11:18:00 -08:00
Linux Build Service Account
a9fe9d38bd Merge "wlan: Change location of hostapd files." 2014-12-04 08:27:25 -08:00
Linux Build Service Account
e601816b24 Merge 04a6a9712e on remote branch
Change-Id: Icb0d8a1efb21abd2c03a539c8c2af5a2da39f4f6
2014-12-03 19:36:53 -07:00
Linux Build Service Account
04a6a9712e Merge "framework: Fix for making SAP sdk code 64 bit compliant" 2014-11-30 11:38:37 -08:00
Linux Build Service Account
56710aac73 Merge "wlan: Change location of hostapd files." 2014-11-26 19:20:37 -08:00
Ravi Joshi
9b8ed11141 framework: Fix for making SAP sdk code 64 bit compliant
Fix for making SAP SDK code 64 bit compliant. The typedefs
were incorrect on an LP64 architecture since a long int will
be 64-bits.

Change-Id: I4c9f5f2fb2b820193fbe03fdf8e2307c281ea014
CRs-Fixed: 640894
2014-11-23 22:05:50 -08:00
Linux Build Service Account
92dd0a5d38 Merge "wlan: Fix for OSS build compilation issue" 2014-11-20 07:38:22 -08:00
Linux Build Service Account
f5fecdcc36 Merge "wlan: Change location of hostapd files." 2014-11-20 00:34:55 -08:00
Neelansh Mittal
587b8b3d67 wlan: Change location of hostapd files.
Change location of hostapd accept and deny files
from /data/hostapd to /data/misc/wifi because
SElinux does not allow netd and hostapd to access
/data/hostapd directory.

Change-Id: I61e8521b3a4b6aab759d3b7cbc04acd3da3c8cf3
CRs-Fixed: 756614
2014-11-19 17:59:02 +05:30
Mahesh A Saptasagar
8e9475b346 wlan: Fix for OSS build compilation issue
Do not include "wpa_ctrl.h" in qsap.c file to avoid compilation
errors on OSS builds.

Change-Id: Ie3afa0bc564a5b2d9c2245b85f4681b83c1d1644
CRs-Fixed: 758764
2014-11-18 20:11:25 +05:30
Linux Build Service Account
00e8d69b78 Merge "wlan: Read ieee80211d param from hostapd.conf file" 2014-10-01 02:11:32 -07:00
Vinay Krishna Eranna
c4bcc0d420 wlan: Read ieee80211d param from hostapd.conf file
Read ieee80211d param from hostapd.conf file instead of reading it
from ini file.

Change-Id: I3773652bc91e2f166111704e70231af6845c5ffc
CRs-Fixed: 727043
2014-09-30 01:14:04 -07:00
Linux Build Service Account
005a67d5ca Merge "wlan:ndc command support." 2014-08-02 01:31:51 -07:00
Subhani Shaik
62ada8bd10 wlan:ndc command support.
Copying the softap sdk include files to TARGET obj
so its easy for other modules to include them.
This is required for system/netd/server/Android.mk
file

Change-Id: Ia581cf93b1849866e22ea3f93350906bc4fb8c71
2014-08-01 10:40:56 -07:00
Subhani Shaik
e42000db1a framework: softap enablement through ndc commands.
The softap libraries were missing for the 64bit enablement
through ndc commands. Makefile change required to point to
right kernel include files.

Change-Id: I03cdd609c2fa18f9926de7d67a2c7d5957a81317
2014-07-24 18:01:09 -07:00
Linux Build Service Account
bcc62d3cca Merge "wlan: Add support for configuration of AKM suite" 2014-04-18 01:20:41 -07:00
Linux Build Service Account
45c32d6e64 Merge "framework: Fix for 64-bit unsafe QCSAP_IOCTL_ASSOC_STA_MACADDR handling" 2014-04-08 12:16:34 -07:00
Ravi Joshi
124fb55d96 framework: Fix for 64-bit unsafe QCSAP_IOCTL_ASSOC_STA_MACADDR handling
Fixes for making SAP SDK 64 bit compliant for QCSAP_IOCTL_ASSOC_STA_MACADDR
ioctl

Change-Id: I161ac3113c01752f627bd876f85342d5a9b20ede
CRs-Fixed: 639046
2014-04-02 16:18:12 -07:00
Linux Build Service Account
1e7bd66054 Merge "softap: Fix for hostapd.conf corruption" 2014-03-08 23:37:26 -08:00
Ravi Joshi
8b0be84bab softap: Fix for hostapd.conf corruption
SoftAP fails to load the default hostapd.conf file
which was left behind as part of failed attempt to
start the softAP. The default hostapd.conf is required
to be copied in case of accidental corruption of
hostapd.conf

Change-Id: I4e6ab7a6bc67fcdcfe225e7e1a811fafe402ebc7
CRs-Fixed: 626022
2014-03-07 15:58:23 -08:00
Linux Build Service Account
083d51563a Merge "Updated string banned functions strncpy and memcpy" 2014-01-25 04:21:15 -08:00
Hanumantha Reddy Pothula
87d01a1158 Updated string banned functions strncpy and memcpy
Banned call strncpy has been updated
with strlcpy

Change-Id: I992c2d3580dce24981a4ec9fd9d50ecca109c044
CRs-Fixed: 554334
2014-01-17 11:56:22 +05:30
Linux Build Service Account
e976b492fe Merge "Revert "wlan: Don't overwrite the channel configured in hostapd.conf"" 2014-01-09 15:54:41 -08:00
Linux Build Service Account
0ecf7a3d93 Merge "Revert "wlan: Don't overwrite the channel configured in hostapd.conf"" 2014-01-07 12:04:43 -08:00
Linux Build Service Account
549156b81d Merge "SAP: Make QSAP SDK compatible w.r.t Android framework." 2013-12-18 09:22:59 -08:00
Mahesh A Saptasagar
4a7a459864 Revert "wlan: Don't overwrite the channel configured in hostapd.conf"
This reverts commit 2addd175cc.

Change-Id: I1b4a145bc1b491d65f49dfc0f5990e52de8a4f37
CRs-Fixed: 589261
2013-12-16 13:48:46 +05:30
Mahesh A Saptasagar
d289ef3449 SAP: Make QSAP SDK compatible w.r.t Android framework.
SAP parameter ignore_broadcast_ssid always set to
"broadcast" due to improper handling of SAP parameters
at SAP SDK.

To mitigate this issue update the ignore_broadcast_ssid
parameter based on the value configured in the framework.

Change-Id: Ia1a35a38464710088921b94269b624d8b1910abc
CRs-Fixed: 588560
2013-12-16 11:50:56 +05:30
Linux Build Service Account
396a3fe49d Merge "wlan: Don't overwrite the channel configured in hostapd.conf" 2013-12-05 09:42:26 -08:00
Mahesh A Saptasagar
2addd175cc wlan: Don't overwrite the channel configured in hostapd.conf
When SAP is turned on through GUI, hostapd.conf file
will be overwritten by the framework parameters.Since
in Kit-Kat framework,channel value is hard coded to 6,
same is getting over written whenever we turn on SAP
through GUI, this will cause SAP to come up always on
channel 6.
To mitigate this issue, avoid overwriting the channel
parameter in hostap.conf file by ignoring the channel
parameter from the framework.

Change-Id: I4d87cf70868ad705f63211b2bd10ac2a67646d09
CRs-Fixed: 584112
2013-12-03 13:32:30 -08:00
Linux Build Service Account
fc7138812d Merge "qcom: softap: Fix potential string null termination and buffer overflow" 2013-11-29 13:30:37 -08:00
Linux Build Service Account
4533339d61 Merge "softap: sscanf sanity check for SoftAP service" 2013-11-26 13:29:20 -08:00
Mingcheng Zhu
69b91cc907 qcom: softap: Fix potential string null termination and buffer overflow
Fix potential string null termination and buffer overflow

Change-Id: I05e28b30a4e3134625d20fb5591b239ea4b9f3a4
CRs-fixed: 554078
2013-11-26 12:23:43 -08:00
Shake M Subhani
ff6440b26f softap: sscanf sanity check for SoftAP service
The sscanf return value is verified whether the three channel
variables, i.e. start channel, end channel and channel band,
are properly updated. If malformed input is given to sscanf, then
these variables may not properly updated. To provide validation
of input,  verifying that sscanf returned a correct value of 3.

Change-Id: Ibd185e7a0ffcf5803927990531fc33f0e8977cc9
CRs-fixed: 554349
2013-11-26 12:06:14 +05:30
Linux Build Service Account
31088846f0 Merge "wlan: make qsap compatible w.r.t ndc implementation." 2013-11-21 23:15:12 -08:00
Mahesh A Saptasagar
41f17f12e4 wlan: make qsap compatible w.r.t ndc implementation.
changes to make qsap compatible w.r.t ndc implementation by
correcting argument mismatch.

Change-Id: I6722ce3fdcf2b4bc45c44d82d56f2c5a14435d7c
CRs-Fixed: 436332
2013-11-21 11:27:03 -08:00
Linux Build Service Account
bd4051d8ff Merge "Fix: SIGPIPE issue while querying softap enabled status" 2013-10-18 00:48:18 -07:00
Vinay Krishna Eranna
1c4304379e Fix: SIGPIPE issue while querying softap enabled status
Before downloading commands to driver through softap SDK we are
checking if SoftAP is enabled are not by running ps in popen.
This sometime throws SIGPIPE error (signal) which is not handled,
due to this we were facing application crash. To fix this we modify
to check the operation mode of the driver through ioctl.

Change-Id: Ia0703ff343d401801655d3b666ade66107a4789e
CRs-Fixed: 535340
2013-10-01 20:14:57 +05:30
Chet Lanctot
7a2827f169 wlan: Add support for configuration of AKM suite
Changes to allow setting the configuration item for
AKM suite (wpa_key_mgmt) in hostapd
configuration file.  This is needed for PMF
(802.11w) to add SHA256 to the list when
necessary.

Change-Id: Ia6fd4976241fb11525f4be6c11801b9c471d4427
CRs-Fixed: 523705
2013-09-09 17:48:58 -07:00
8 changed files with 1066 additions and 862 deletions

View File

@@ -1,20 +0,0 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PRELINK_MODULE := false
LOCAL_SRC_FILES := QWiFiSoftApCfg.c
LOCAL_MODULE := libQWiFiSoftApCfg
LOCAL_MODULE_TAGS := optional
LOCAL_C_INCLUDES := $(KERNEL_HEADERS) \
$(JNI_H_INCLUDE)
LOCAL_SHARED_LIBRARIES := libsysutils libcutils libnetutils libcrypto
include $(BUILD_SHARED_LIBRARY)

View File

@@ -1,410 +0,0 @@
/*
* Copyright (c) 2010, The Linux Foundation. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "QWiFiSoftApCfg.h"
#define UPDATE_ERROR_CODE(msg, code) \
{ \
int rc; \
rc = snprintf(resp, sizeof(resp), "failure %s:%s",msg, code); \
if ( rc == sizeof(resp)) resp[sizeof(resp)-1] = 0; \
ALOGE("%s",resp); \
}
static struct sockaddr_nl rtnl_local;
static int rtnl_fd = -1;
static char evt_buf[MAX_EVT_BUF_SIZE];
static int evt_len;
static void softap_handle_custom_event(char * buf, int len)
{
if (strncmp(buf, "AUTO-SHUT.indication ", strlen("AUTO-SHUT.indication ")) == 0)
{
ALOGD("EVENT: Custom Event\n");
snprintf(evt_buf, sizeof(evt_buf), "105 AP Shutdown");
}
}
static void softap_handle_associated_event(char *mac_addr)
{
snprintf(evt_buf, sizeof(evt_buf), "102 Station " HWA_FORM " Associated",
HWA_ARG(mac_addr));
}
static void softap_handle_disassociated_event(char *mac_addr)
{
snprintf(evt_buf, sizeof(evt_buf), "103 Station " HWA_FORM " Disassociated",
HWA_ARG(mac_addr));
}
static void softap_handle_wireless_event(char *atr, int atrlen)
{
int len = 0;
struct iw_event iwe;
char *buffer = atr + RTA_ALIGN(RTATTRLEN);
atrlen -= RTA_ALIGN(RTATTRLEN);
while ((len + (int)IW_EV_LCP_LEN) < atrlen) {
memcpy((char *)&iwe, buffer + len, sizeof(struct iw_event));
if (iwe.len <= IW_EV_LCP_LEN)
break;
ALOGD("Received Wireless Event: cmd=0x%x len=%d", iwe.cmd, iwe.len);
switch (iwe.cmd) {
case IWEVEXPIRED:
ALOGD("EVENT: IWEVEXPIRED\n");
softap_handle_disassociated_event(iwe.u.addr.sa_data);
break;
case IWEVREGISTERED:
ALOGD("EVENT: IWEVREGISTERED\n");
softap_handle_associated_event(iwe.u.addr.sa_data);
break;
case IWEVCUSTOM:
ALOGD("EVENT: Custom Event\n");
softap_handle_custom_event(buffer + len + IW_EV_POINT_LEN, iwe.u.data.length);
break;
default:
break;
}
len += iwe.len;
}
return;
}
void softap_handle_rtm_link_event(struct nlmsghdr *hdr)
{
char *ptr = (char *)NLMSG_DATA(hdr);
struct rtattr *atr;
int atr_len;
if ((hdr->nlmsg_len - MSGHDRLEN) < IFINFOLEN) {
ALOGD("Message Length Problem1");
return;
}
if ((atr_len = hdr->nlmsg_len - NLMSG_ALIGN(IFINFOLEN)) < 0) {
ALOGD("Message Length Problem2");
return;
}
ptr += NLMSG_ALIGN(IFINFOLEN);
atr = (struct rtattr *)ptr;
while (RTA_OK(atr, atr_len)) {
switch (atr->rta_type) {
case IFLA_WIRELESS:
softap_handle_wireless_event((char *)atr,
atr->rta_len);
break;
default:
break;
}
atr = RTA_NEXT(atr, atr_len);
}
return;
}
static void softap_handle_iface_event(void)
{
int cnt, mlen = 0;
char *ptr, buffer[MAX_RECV_BUF_SIZE];
socklen_t slen;
struct nlmsghdr * hdr;
while (1) {
cnt = recvfrom(rtnl_fd, buffer, sizeof(buffer),
MSG_DONTWAIT,
(struct sockaddr *)&rtnl_local, &slen);
if (cnt <= 0) {
buffer[0] = '\0';
ALOGD("recvfrom failed");
return;
}
ptr = buffer;
while (cnt >= MSGHDRLEN) {
hdr = (struct nlmsghdr *)ptr;
mlen = hdr->nlmsg_len;
if ((mlen > cnt) || ((mlen - MSGHDRLEN) < 0)) {
break;
}
switch (hdr->nlmsg_type) {
case RTM_NEWLINK:
case RTM_DELLINK:
softap_handle_rtm_link_event(hdr);
break;
}
mlen = NLMSG_ALIGN(hdr->nlmsg_len);
cnt -= mlen;
ptr += mlen;
}
}
return;
}
static inline int softap_rtnl_wait(void)
{
fd_set fds;
int oldfd, ret;
if (rtnl_fd < 0) {
ALOGD("Netlink Socket Not Available");
return -1;
}
/* Initialize fds */
FD_ZERO(&fds);
FD_SET(rtnl_fd, &fds);
oldfd = rtnl_fd;
/* Wait for some trigger event */
ret = select(oldfd + 1, &fds, NULL, NULL, NULL);
if (ret < 0) {
/* Error Occurred */
ALOGD("Select on Netlink Socket Failed");
return ret;
} else if (!ret) {
ALOGD("Select on Netlink Socket Timed Out");
/* Timeout Occurred */
return -1;
}
/* Check if any event is available for us */
if (FD_ISSET(rtnl_fd, &fds)) {
softap_handle_iface_event();
}
return 0;
}
static void softap_rtnl_close(void)
{
close(rtnl_fd);
}
static int softap_rtnl_open(void)
{
int addr_len;
rtnl_fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if (rtnl_fd < 0) {
ALOGE("open netlink socket failed");
return -1;
}
memset(&rtnl_local, 0, sizeof(rtnl_local));
rtnl_local.nl_family = AF_NETLINK;
rtnl_local.nl_groups = RTMGRP_LINK;
if (bind(rtnl_fd, (struct sockaddr*)&rtnl_local,
sizeof(rtnl_local)) < 0) {
ALOGE("bind netlink socket failed");
return -1;
}
addr_len = sizeof(rtnl_local);
if (getsockname(rtnl_fd, (struct sockaddr*)&rtnl_local,
(socklen_t *) &addr_len) < 0) {
ALOGE("getsockname failed");
return -1;
}
if (addr_len != sizeof(rtnl_local)) {
ALOGE("Wrong address length %d\n", addr_len);
return -1;
}
if (rtnl_local.nl_family != AF_NETLINK) {
ALOGE("Wrong address family %d\n", rtnl_local.nl_family);
return -1;
}
return 0;
}
JNIEXPORT void JNICALL
Java_com_qualcomm_wifi_softap_QWiFiSoftApCfg_SapCloseNetlink
(JNIEnv *env, jobject obj)
{
softap_rtnl_close();
return;
}
JNIEXPORT jstring JNICALL
Java_com_qualcomm_wifi_softap_QWiFiSoftApCfg_SapWaitForEvent
(JNIEnv *env, jobject obj)
{
int ret;
do {
evt_len = 0;
memset(evt_buf, 0, sizeof(evt_buf));
ret = softap_rtnl_wait();
} while (!strlen(evt_buf));
return (*env)->NewStringUTF(env, evt_buf);
}
JNIEXPORT jboolean JNICALL
Java_com_qualcomm_wifi_softap_QWiFiSoftApCfg_SapOpenNetlink
(JNIEnv *env, jobject obj)
{
if (softap_rtnl_open() != 0) {
ALOGD("Netlink Open Fail");
return JNI_FALSE;
}
return JNI_TRUE;
}
JNIEXPORT jstring JNICALL
Java_com_qualcomm_wifi_softap_QWiFiSoftApCfg_SapSendCommand
(JNIEnv *env, jobject obj, jstring jcmd)
{
const char *pcmd;
char cmd[MAX_CMD_SIZE];
char resp[MAX_RESP_SIZE];
int sock = -1;
int rc;
int done = 0;
char code[32] = {0};
int connect_retry;
strncpy(cmd, "softap qccmd ", sizeof(cmd));
pcmd = (char *) ((*env)->GetStringUTFChars(env, jcmd, NULL));
if ( pcmd == NULL ) {
UPDATE_ERROR_CODE("Command not handled","");
goto end;
}
ALOGD("Received Command: %s\n", pcmd);
if ((strlen(cmd) + strlen(pcmd)) > sizeof(cmd)) {
UPDATE_ERROR_CODE("Command length is larger than MAX_CMD_SIZE", "");
goto end;
}
strcat(cmd, pcmd);
connect_retry = 0;
while ( 1 ) {
if ((sock = socket_local_client("netd",
ANDROID_SOCKET_NAMESPACE_RESERVED,
SOCK_STREAM)) < 0) {
if (connect_retry > 3) {
UPDATE_ERROR_CODE("Error connecting",
strerror(errno));
goto end;
}
ALOGW("Unable to connect to netd, retrying ...\n");
sleep(1);
} else {
break;
}
connect_retry++;
}
if (write(sock, cmd, strlen(cmd) + 1) < 0) {
UPDATE_ERROR_CODE("Error Writing to socket", strerror(errno));
goto end;
}
while (!done) {
int i;
if ((rc = read(sock, resp, sizeof(resp))) <= 0) {
if (rc == 0) {
UPDATE_ERROR_CODE("Lost connection to Netd",
strerror(errno));
} else {
UPDATE_ERROR_CODE("Error reading data",
strerror(errno));
}
done = 1;
} else {
/* skip broadcase messages */
i = 0;
while(resp[i] && (i<(int)(sizeof(code)-1)) &&
(resp[i] != ' ') && (resp[i] != '\t')) {
code[i] = resp[i];
i++;
}
code[i] = '\0';
if ( (!strcmp(code, "success")) ||
(!strcmp(code, "failure")) ) {
done=1;
} else {
ALOGW("Code(%s)\n", code);
ALOGW("Ignore messages : %s\n", resp);
}
}
}
end:
(*env)->ReleaseStringUTFChars(env, jcmd, pcmd);
if( sock >= 0 ){
close(sock);
sock = -1;
}
return (*env)->NewStringUTF(env, resp);
}

View File

@@ -1,87 +0,0 @@
/*
* Copyright (c) 2010, The Linux Foundation. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __QWIFISOFTAPCFG
#define __QWIFISOFTAPCFG
#define LOG_TAG "QWIFIAPCFG"
#include "jni.h"
#include <utils/Log.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <errno.h>
#include <fcntl.h>
#include <ctype.h>
#include <sys/ioctl.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/un.h>
#include <linux/if.h>
#include <linux/if_arp.h>
#include <linux/if_ether.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/wireless.h>
#include <cutils/sockets.h>
#include <private/android_filesystem_config.h>
typedef unsigned char u8;
#define HWA_FORM "%02X:%02X:%02X:%02X:%02X:%02X"
#define HWA_ARG(x) *(((u8 *)x + 0)), *(((u8 *)x + 1)), \
*(((u8 *)x + 2)), *(((u8 *)x + 3)), \
*(((u8 *)x + 4)), *(((u8 *)x + 5))
#define MAX_RESP_SIZE 256
#define MAX_CMD_SIZE 256
#define MAX_EVT_BUF_SIZE 256
#define MAX_RECV_BUF_SIZE 256
#define MSGHDRLEN ((int)(sizeof(struct nlmsghdr)))
#define IFINFOLEN ((int)(sizeof(struct ifinfomsg)))
#define RTATTRLEN ((int)(sizeof(struct rtattr)))
#ifndef IFLA_WIRELESS
#define IFLA_WIRELESS (IFLA_MASTER + 1)
#endif
#endif

31
softap/sdk/Android.mk Normal file → Executable file
View File

@@ -4,14 +4,23 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_C_INCLUDES := LOCAL_C_INCLUDES := $(TOP)/hardware/libhardware_legacy/wifi $(TOP)/external/libnl/include $(TOP)/external/wpa_supplicant_8/wpa_supplicant/src/drivers
LOCAL_MODULE:= libqsap_sdk LOCAL_MODULE:= libqsap_sdk
LOCAL_MODULE_TAGS := optional LOCAL_MODULE_TAGS := optional
ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED), true)
LOCAL_VENDOR_MODULE := true
endif
LOCAL_CFLAGS += -DSDK_VERSION=\"0.0.1.0\" LOCAL_CFLAGS += -DSDK_VERSION=\"0.0.1.0\"
LOCAL_USE_VNDK := true
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/qsap_api.h \
$(LOCAL_PATH)/qsap.h
ifdef WIFI_DRIVER_MODULE_PATH ifdef WIFI_DRIVER_MODULE_PATH
LOCAL_CFLAGS += -DWIFI_DRIVER_MODULE_PATH=\"$(WIFI_DRIVER_MODULE_PATH)\" LOCAL_CFLAGS += -DWIFI_DRIVER_MODULE_PATH=\"$(WIFI_DRIVER_MODULE_PATH)\"
endif endif
@@ -52,12 +61,30 @@ ifdef WIFI_DRIVER_DEF_CONF_FILE
LOCAL_CFLAGS += -DWIFI_DRIVER_DEF_CONF_FILE=\"$(WIFI_DRIVER_DEF_CONF_FILE)\" LOCAL_CFLAGS += -DWIFI_DRIVER_DEF_CONF_FILE=\"$(WIFI_DRIVER_DEF_CONF_FILE)\"
endif endif
LOCAL_CFLAGS += \
-Wall \
-Werror \
-Wno-unused-variable \
-Wno-unused-value \
-Wno-format \
-Wno-sometimes-uninitialized \
-Wno-enum-conversion \
-Wno-unused-parameter \
-Wno-implicit-function-declaration
LOCAL_SRC_FILES := qsap_api.c \ LOCAL_SRC_FILES := qsap_api.c \
qsap.c qsap.c
LOCAL_PRELINK_MODULE := false LOCAL_PRELINK_MODULE := false
LOCAL_SHARED_LIBRARIES := libnetutils libutils libbinder libcutils LOCAL_SHARED_LIBRARIES := libnetutils libutils libbinder libcutils libhardware_legacy libnl liblog
LOCAL_HEADER_LIBRARIES := libcutils_headers
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libqsap_headers
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_VENDOR_MODULE := true
include $(BUILD_HEADER_LIBRARY)

169
softap/sdk/qsap.c Executable file → Normal file
View File

@@ -33,6 +33,8 @@
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h>
#include <sched.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <linux/if.h> #include <linux/if.h>
@@ -46,15 +48,15 @@
#define LOG_TAG "QCLDR-" #define LOG_TAG "QCLDR-"
#include "cutils/log.h" #include <cutils/log.h>
#include "cutils/memory.h" #include <cutils/memory.h>
#include "cutils/misc.h" #include <cutils/misc.h>
#include "cutils/properties.h" #include <cutils/properties.h>
#include "private/android_filesystem_config.h" #include <grp.h>
#include <pwd.h>
#include "qsap_api.h" #include "qsap_api.h"
#include "qsap.h" #include "qsap.h"
#include "libwpa_client/wpa_ctrl.h"
#include <sys/system_properties.h> #include <sys/system_properties.h>
@@ -266,12 +268,12 @@ void qsap_send_module_down_indication(void)
/* Equivalent to: iwpriv wlan0 sendModuleInd */ /* Equivalent to: iwpriv wlan0 sendModuleInd */
if ((s = socket(PF_INET, SOCK_DGRAM, 0)) >= 0) { if ((s = socket(PF_INET, SOCK_DGRAM, 0)) >= 0) {
strncpy(wrq.ifr_name, "wlan0", IFNAMSIZ); strlcpy(wrq.ifr_name, "wlan0", IFNAMSIZ);
wrq.u.data.length = 0; /* No Set arguments */ wrq.u.data.length = 0; /* No Set arguments */
wrq.u.mode = 5; /* WE_MODULE_DOWN_IND sub-command */ wrq.u.mode = 5; /* WE_MODULE_DOWN_IND sub-command */
ret = ioctl(s, (SIOCIWFIRSTPRIV + 1), &wrq); ret = ioctl(s, (SIOCIWFIRSTPRIV + 1), &wrq);
if (ret < 0 ) { if (ret < 0 ) {
strncpy(wrq.ifr_name, "softap.0", IFNAMSIZ); strlcpy(wrq.ifr_name, "softap.0", IFNAMSIZ);
ret = ioctl(s, (SIOCIWFIRSTPRIV + 1), &wrq); ret = ioctl(s, (SIOCIWFIRSTPRIV + 1), &wrq);
if (ret < 0 ) { if (ret < 0 ) {
ALOGE("ioctl failed: %s", strerror(errno)); ALOGE("ioctl failed: %s", strerror(errno));
@@ -295,7 +297,7 @@ s32 qsap_send_init_ap(void)
/* Equivalent to: iwpriv wlan0 initAP */ /* Equivalent to: iwpriv wlan0 initAP */
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) >= 0) { if ((s = socket(AF_INET, SOCK_DGRAM, 0)) >= 0) {
strncpy(wrq.ifr_name, "wlan0", IFNAMSIZ); strlcpy(wrq.ifr_name, "wlan0", IFNAMSIZ);
wrq.u.data.length = 0; /* No Set arguments */ wrq.u.data.length = 0; /* No Set arguments */
wrq.u.data.flags = 2; /* WE_INIT_AP sub-command */ wrq.u.data.flags = 2; /* WE_INIT_AP sub-command */
ret = ioctl(s, (SIOCIWFIRSTPRIV + 6), &wrq); ret = ioctl(s, (SIOCIWFIRSTPRIV + 6), &wrq);
@@ -323,7 +325,7 @@ s32 qsap_send_exit_ap(void)
/* Equivalent to: iwpriv wlan0 exitAP */ /* Equivalent to: iwpriv wlan0 exitAP */
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) >= 0) { if ((s = socket(AF_INET, SOCK_DGRAM, 0)) >= 0) {
strncpy(wrq.ifr_name, "wlan0", IFNAMSIZ); strlcpy(wrq.ifr_name, "wlan0", IFNAMSIZ);
wrq.u.data.length = 0; /* No Set arguments */ wrq.u.data.length = 0; /* No Set arguments */
wrq.u.data.flags = 3; /*WE_EXIT_AP sub-command */ wrq.u.data.flags = 3; /*WE_EXIT_AP sub-command */
@@ -409,7 +411,7 @@ s32 wifi_qsap_stop_bss(void)
return eERR_STOP_BSS; return eERR_STOP_BSS;
} }
strncpy(wrq.ifr_name, iface, sizeof(wrq.ifr_name)); strlcpy(wrq.ifr_name, iface, sizeof(wrq.ifr_name));
wrq.u.data.length = sizeof(cmd); wrq.u.data.length = sizeof(cmd);
wrq.u.data.pointer = cmd; wrq.u.data.pointer = cmd;
wrq.u.data.flags = 0; wrq.u.data.flags = 0;
@@ -434,26 +436,22 @@ s32 wifi_qsap_stop_bss(void)
s32 is_softap_enabled(void) s32 is_softap_enabled(void)
{ {
FILE *fp; s32 mode = 0;
char buf[1024]; int ret;
fp = popen("ps", "r"); ret = qsap_get_mode(&mode);
if (fp == NULL) { if (eSUCCESS != ret) {
ALOGE("Failed to open file"); ALOGD("Failed to get the mode of operation\n");
return eERR_UNKNOWN; return eERR_UNKNOWN;
} }
while (fgets(buf, sizeof(buf)-1, fp) != NULL) { if (mode == IW_MODE_MASTER) {
if(NULL !=(strstr(buf,"hostapd"))) ALOGD("HOSTAPD Enabled\n");
{ return ENABLE;
pclose(fp);
ALOGD("HOSTAPD enabled\n");
return ENABLE;
}
} }
ALOGD("HOSTAPD disabled\n"); ALOGD("HOSTAPD Disabled\n");
pclose(fp);
return DISABLE; return DISABLE;
} }
@@ -589,3 +587,124 @@ s32 wifi_qsap_reload_softap()
return eSUCCESS; return eSUCCESS;
} }
static pid_t wigigSoftApPid = 0;
static const char WIGIG_ENTROPY_FILE[] = "/data/misc/wifi/wigig_entropy.bin";
static unsigned char dummy_key[21] = { 0x02, 0x11, 0xbe, 0x33, 0x43, 0x35,
0x68, 0x47, 0x84, 0x99, 0xa9, 0x2b,
0x1c, 0xd3, 0xee, 0xff, 0xf1, 0xe2,
0xf3, 0xf4, 0xf5 };
static const char HOSTAPD_BIN_FILE[] = "/system/bin/hostapd";
static const char WIGIG_HOSTAPD_CONF_FILE[] = "/data/misc/wifi/wigig_hostapd.conf";
#define AP_BSS_START_DELAY 200000
#define AP_BSS_STOP_DELAY 500000
int wigig_ensure_entropy_file_exists()
{
int ret;
int destfd;
struct passwd *pw;
struct group *gr;
ret = access(WIGIG_ENTROPY_FILE, R_OK|W_OK);
if ((ret == 0) || (errno == EACCES)) {
if ((ret != 0) &&
(chmod(WIGIG_ENTROPY_FILE, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) != 0)) {
ALOGE("Cannot set RW to \"%s\": %s", WIGIG_ENTROPY_FILE, strerror(errno));
return -1;
}
return 0;
}
destfd = TEMP_FAILURE_RETRY(open(WIGIG_ENTROPY_FILE, O_CREAT|O_RDWR, 0660));
if (destfd < 0) {
ALOGE("Cannot create \"%s\": %s", WIGIG_ENTROPY_FILE, strerror(errno));
return -1;
}
if (TEMP_FAILURE_RETRY(write(destfd, dummy_key, sizeof(dummy_key))) != sizeof(dummy_key)) {
ALOGE("Error writing \"%s\": %s", WIGIG_ENTROPY_FILE, strerror(errno));
close(destfd);
return -1;
}
close(destfd);
/* chmod is needed because open() didn't set permisions properly */
if (chmod(WIGIG_ENTROPY_FILE, 0660) < 0) {
ALOGE("Error changing permissions of %s to 0660: %s",
WIGIG_ENTROPY_FILE, strerror(errno));
unlink(WIGIG_ENTROPY_FILE);
return -1;
}
pw = getpwnam("system");
gr = getgrnam("wifi");
if (pw && gr) {
if (chown(WIGIG_ENTROPY_FILE, pw->pw_uid, gr->gr_gid) < 0) {
ALOGE("Error changing group ownership of %s to %d: %s",
WIGIG_ENTROPY_FILE, gr->gr_gid, strerror(errno));
unlink(WIGIG_ENTROPY_FILE);
return -1;
}
} else {
ALOGE("Cannot get pw_uid or gr_gid : %s", strerror(errno));
unlink(WIGIG_ENTROPY_FILE);
return -1;
}
return 0;
}
s32 wifi_qsap_start_wigig_softap(void)
{
pid_t pid = 1;
ALOGD("%s", __func__);
if (wigigSoftApPid) {
ALOGE("Wigig SoftAP is already running");
return eERR_START_SAP;
}
if (wigig_ensure_entropy_file_exists() < 0) {
ALOGE("Wigig entropy file was not created");
}
if ((pid = fork()) < 0) {
ALOGE("fork failed (%s)", strerror(errno));
return eERR_START_SAP;
}
if (!pid) {
if (execl(HOSTAPD_BIN_FILE, HOSTAPD_BIN_FILE,
"-e", WIGIG_ENTROPY_FILE, "-dd",
WIGIG_HOSTAPD_CONF_FILE, (char *) NULL)) {
ALOGE("execl failed (%s)", strerror(errno));
}
ALOGE("Wigig SoftAP failed to start. Exiting child process...");
exit(-1);
}
wigigSoftApPid = pid;
ALOGD("Wigig SoftAP started successfully");
usleep(AP_BSS_START_DELAY);
return eSUCCESS;
}
s32 wifi_qsap_stop_wigig_softap(void)
{
ALOGD("%s", __func__);
if (wigigSoftApPid == 0) {
ALOGE("Wigig SoftAP is not running");
return eSUCCESS;
}
ALOGD("Stopping the Wigig SoftAP...");
kill(wigigSoftApPid, SIGTERM);
waitpid(wigigSoftApPid, NULL, 0);
wigigSoftApPid = 0;
ALOGD("Wigig SoftAP stopped successfully");
usleep(AP_BSS_STOP_DELAY);
return eSUCCESS;
}

View File

@@ -44,6 +44,8 @@ s32 commit(void);
s32 is_softap_enabled(void); s32 is_softap_enabled(void);
s32 wifi_qsap_start_softap(void); s32 wifi_qsap_start_softap(void);
s32 wifi_qsap_stop_softap(void); s32 wifi_qsap_stop_softap(void);
s32 wifi_qsap_start_wigig_softap(void);
s32 wifi_qsap_stop_wigig_softap(void);
s32 wifi_qsap_reload_softap(void); s32 wifi_qsap_reload_softap(void);
s32 wifi_qsap_unload_wifi_sta_driver(void); s32 wifi_qsap_unload_wifi_sta_driver(void);

992
softap/sdk/qsap_api.c Executable file → Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -34,13 +34,13 @@
#if __cplusplus #if __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <android/log.h>
typedef unsigned char u8; typedef unsigned char u8;
typedef char s8; typedef char s8;
typedef unsigned short int u16; typedef unsigned short int u16;
typedef signed short int s16; typedef signed short int s16;
typedef unsigned long int u32; typedef unsigned int u32;
typedef signed long int s32; typedef signed int s32;
/** Success and error messages */ /** Success and error messages */
#define SUCCESS "success" #define SUCCESS "success"
@@ -88,29 +88,37 @@ enum error_val {
#define WIFI_DRIVER_DEF_CONF_FILE NULL #define WIFI_DRIVER_DEF_CONF_FILE NULL
#endif #endif
/** Configuration file name for SAP+SAP*/
#define CONFIG_FILE_2G "/data/vendor/wifi/hostapd/hostapd_dual2g.conf"
#define CONFIG_FILE_5G "/data/vendor/wifi/hostapd/hostapd_dual5g.conf"
#define CONFIG_FILE_60G "/data/vendor/wifi/hostapd/hostapd_60g.conf"
/** Configuration file name for OWE-transition */
#define CONFIG_FILE_OWE "/data/vendor/wifi/hostapd/hostapd_owe.conf"
/** Configuration file name */ /** Configuration file name */
#define CONFIG_FILE "/data/misc/wifi/hostapd.conf" #define CONFIG_FILE "/data/vendor/wifi/hostapd/hostapd.conf"
/** Default configuration file path */ /** Default configuration file path */
#define DEFAULT_CONFIG_FILE_PATH "/system/etc/hostapd/hostapd_default.conf" #define DEFAULT_CONFIG_FILE_PATH "/vendor/etc/hostapd/hostapd_default.conf"
/** Default Accept list file name */ /** Default Accept list file name */
#define DEFAULT_ACCEPT_LIST_FILE_PATH "/system/etc/hostapd/hostapd.accept" #define DEFAULT_ACCEPT_LIST_FILE_PATH "/vendor/etc/hostapd/hostapd.accept"
/** Accept list file name */ /** Accept list file name */
#define ACCEPT_LIST_FILE "/data/hostapd/hostapd.accept" #define ACCEPT_LIST_FILE "/data/vendor/wifi/hostapd/hostapd.accept"
/** Default Deny list file name */ /** Default Deny list file name */
#define DEFAULT_DENY_LIST_FILE_PATH "/system/etc/hostapd/hostapd.deny" #define DEFAULT_DENY_LIST_FILE_PATH "/vendor/etc/hostapd/hostapd.deny"
/** Deny list file name */ /** Deny list file name */
#define DENY_LIST_FILE "/data/hostapd/hostapd.deny" #define DENY_LIST_FILE "/data/vendor/wifi/hostapd/hostapd.deny"
/** Default Ini file */ /** Default Ini file */
#define DEFAULT_INI_FILE "/persist/qcom/softap/qcom_cfg_default.ini" #define DEFAULT_INI_FILE "/persist/qcom/softap/qcom_cfg_default.ini"
/** SDK control interface path */ /** SDK control interface path */
#define SDK_CTRL_IF "/data/hostapd/softap_sdk_ctrl" #define SDK_CTRL_IF "/data/vendor/wifi/hostapd/ctrl/softap_sdk_ctrl"
/** Maximum length of the line in the configuration file */ /** Maximum length of the line in the configuration file */
#define MAX_CONF_LINE_LEN (156) #define MAX_CONF_LINE_LEN (156)
@@ -207,7 +215,7 @@ enum error_val {
#define MIN_UPC_LEN (1) #define MIN_UPC_LEN (1)
#define MAX_UPC_LEN (128) #define MAX_UPC_LEN (128)
#define GTK_MIN (600) #define GTK_MIN (30)
#define MAX_INT_STR (8) #define MAX_INT_STR (8)
@@ -244,6 +252,16 @@ enum eCmd_req {
eCMD_REQ_LAST eCMD_REQ_LAST
}; };
/** config request index - in the array Conf_req[] */
enum eConf_req {
CONF_2g = 0,
CONF_5g = 1,
CONF_owe = 2,
CONF_60g = 3,
CONF_REQ_LAST
};
/** /**
* Command numbers, these numbers form the index into the array of * Command numbers, these numbers form the index into the array of
* command names stored in the 'cmd_list'. * command names stored in the 'cmd_list'.
@@ -323,6 +341,32 @@ typedef enum esap_cmd {
eCMD_SET_CHANNEL_RANGE = 62, eCMD_SET_CHANNEL_RANGE = 62,
eCMD_GET_AUTO_CHANNEL = 63, eCMD_GET_AUTO_CHANNEL = 63,
eCMD_IEEE80211W = 64, eCMD_IEEE80211W = 64,
eCMD_WPA_KEY_MGMT = 65,
eCMD_SET_MAX_CLIENTS = 66,
eCMD_IEEE80211AC = 67,
eCMD_VHT_OPER_CH_WIDTH = 68,
eCMD_ACS_CHAN_LIST = 69,
eCMD_HT_CAPAB = 70,
eCMD_IEEE80211H = 71,
eCMD_ENABLE_WIGIG_SOFTAP = 72,
eCMD_INTERFACE = 73,
eCMD_SSID2 = 74,
eCMD_BRIDGE = 75,
eCMD_CTRL_INTERFACE = 76,
eCMD_VENDOR_ELEMENT = 77,
eCMD_ASSOCRESP_ELEMENT = 78,
eCMD_ACS_EXCLUDE_DFS = 79,
eCMD_WOWLAN_TRIGGERS = 80,
eCMD_ACCEPT_MAC_FILE = 81,
eCMD_DENY_MAC_FILE = 82,
eCMD_OWE_TRANS_IFNAME = 83,
eCMD_SAE_REQUIRE_MPF = 84,
eCMD_IEEE80211AX = 85,
eCMD_ENABLE_EDMG = 86,
eCMD_EDMG_CHANNEL = 87,
eCMD_LAST /** New command numbers should be added above this */ eCMD_LAST /** New command numbers should be added above this */
} esap_cmd_t; } esap_cmd_t;
@@ -387,6 +431,8 @@ enum oper_mode {
HW_MODE_G_ONLY = 3, HW_MODE_G_ONLY = 3,
HW_MODE_N_ONLY = 4, HW_MODE_N_ONLY = 4,
HW_MODE_A = 5, HW_MODE_A = 5,
HW_MODE_ANY = 6,
HW_MODE_AD = 7,
HW_MODE_UNKNOWN HW_MODE_UNKNOWN
}; };
@@ -484,7 +530,7 @@ typedef struct sap_auto_channel_info {
#define IS_VALID_BSSID(x) (((value == ENABLE) || (value == DISABLE)) ? TRUE: FALSE) #define IS_VALID_BSSID(x) (((value == ENABLE) || (value == DISABLE)) ? TRUE: FALSE)
/** Validate the length of the passphrase */ /** Validate the length of the passphrase */
#define IS_VALID_PASSPHRASE_LEN(x) (((x >= PASSPHRASE_MIN) && (x <= PASSPHRASE_MAX)) ? TRUE: FALSE) #define IS_VALID_PASSPHRASE_LEN(x) ((((x >= PASSPHRASE_MIN) && (x <= PASSPHRASE_MAX)) || (x == 0)) ? TRUE: FALSE)
/** Validate the beacon interval */ /** Validate the beacon interval */
#define IS_VALID_BEACON(x) (((x >= BCN_INTERVAL_MIN) && (x <= BCN_INTERVAL_MAX)) ? TRUE: FALSE) #define IS_VALID_BEACON(x) (((x >= BCN_INTERVAL_MIN) && (x <= BCN_INTERVAL_MAX)) ? TRUE: FALSE)
@@ -497,7 +543,7 @@ typedef struct sap_auto_channel_info {
/** Validate the pairwise encryption */ /** Validate the pairwise encryption */
#define IS_VALID_PAIRWISE(x) (((!strcmp(x, "TKIP")) || (!strcmp(x, "CCMP")) || \ #define IS_VALID_PAIRWISE(x) (((!strcmp(x, "TKIP")) || (!strcmp(x, "CCMP")) || \
(!strcmp(x, "TKIP CCMP")) || (!strcmp(x, "CCMP TKIP"))) ? TRUE : FALSE) (!strcmp(x, "TKIP CCMP")) || (!strcmp(x, "CCMP TKIP")) || (!strcmp(x, "GCMP"))) ? TRUE : FALSE)
/** Validate the WMM status */ /** Validate the WMM status */
#define IS_VALID_WMM_STATE(x) (((x >= WMM_AUTO_IN_INI) && (x <= WMM_DISABLED_IN_INI)) ? TRUE: FALSE) #define IS_VALID_WMM_STATE(x) (((x >= WMM_AUTO_IN_INI) && (x <= WMM_DISABLED_IN_INI)) ? TRUE: FALSE)
@@ -574,16 +620,27 @@ typedef struct sap_auto_channel_info {
/** Validate the AP shutoff time */ /** Validate the AP shutoff time */
#define IS_VALID_ENERGY_DETECT_TH(x) ((((x >= AP_ENERGY_DETECT_TH_MIN) && (x <= AP_ENERGY_DETECT_TH_MAX)) ||( x == 128)) ? TRUE : FALSE) #define IS_VALID_ENERGY_DETECT_TH(x) ((((x >= AP_ENERGY_DETECT_TH_MIN) && (x <= AP_ENERGY_DETECT_TH_MAX)) ||( x == 128)) ? TRUE : FALSE)
/** Validate the 802dot11h state */
#define IS_VALID_DFS_STATE(x) (((x == ENABLE) || (x == DISABLE)) ? TRUE: FALSE)
/** Function declartion */ /** Function declartion */
int qsap_hostd_exec(int argc, char ** argv);
void qsap_hostd_exec_cmd(s8 *pcmd, s8 *presp, u32 *plen); void qsap_hostd_exec_cmd(s8 *pcmd, s8 *presp, u32 *plen);
s8 *qsap_get_config_value(s8 *pfile, struct Command *pcmd, s8 *pbuf, u32 *plen); s8 *qsap_get_config_value(s8 *pfile, struct Command *pcmd, s8 *pbuf, u32 *plen);
int qsapsetSoftap(int argc, char *argv[]); int qsapsetSoftap(int argc, char *argv[]);
int qsap_add_or_remove_interface(const char *iface_name, int create_iface);
void qsap_del_ctrl_iface(void); void qsap_del_ctrl_iface(void);
s16 wifi_qsap_reset_to_default(s8 *pcfgfile, s8 *pdefault); s16 wifi_qsap_reset_to_default(s8 *pcfgfile, s8 *pdefault);
void check_for_configuration_files(void); void check_for_configuration_files(void);
void qsap_set_ini_filename(void); void qsap_set_ini_filename(void);
int qsap_set_channel_range(s8 * cmd); int qsap_set_channel_range(s8 * cmd);
int qsap_get_sap_auto_channel_slection(s32 *pautochan); int qsap_get_sap_auto_channel_slection(s32 *pautochan);
int qsap_get_mode(s32 *pmode);
int qsap_prepare_softap(void);
int qsap_unprepare_softap(void);
int qsap_is_fst_enabled(void);
int qsap_control_bridge(int argc, char ** argv);
int linux_get_ifhwaddr(const char *ifname, char *addr);
#if __cplusplus #if __cplusplus
}; // extern "C" }; // extern "C"