15af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt/* 25af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * Copyright (C) 2008 The Android Open Source Project 35af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * 45af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * Licensed under the Apache License, Version 2.0 (the "License"); 55af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * you may not use this file except in compliance with the License. 65af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * You may obtain a copy of the License at 75af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * 85af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * http://www.apache.org/licenses/LICENSE-2.0 95af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * 105af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * Unless required by applicable law or agreed to in writing, software 115af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * distributed under the License is distributed on an "AS IS" BASIS, 125af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 135af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * See the License for the specific language governing permissions and 145af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * limitations under the License. 155af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt */ 165af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt 175af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt#ifndef _SOFTAP_CONTROLLER_H 185af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt#define _SOFTAP_CONTROLLER_H 195af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt 205af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt#include <linux/in.h> 2184c65a62fe7b053fed7f20274ca7379627a87b79Dmitry Shmidt#include <net/if.h> 225af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt 2384c65a62fe7b053fed7f20274ca7379627a87b79Dmitry Shmidt#define SOFTAP_MAX_BUFFER_SIZE 4096 24a165913421c5bed00a1f0b8e79e35e55b82aebbeDmitry Shmidt#define AP_BSS_START_DELAY 200000 253df450af1c2e35d854768a508b6905c6794f7a74Dmitry Shmidt#define AP_BSS_STOP_DELAY 500000 263df450af1c2e35d854768a508b6905c6794f7a74Dmitry Shmidt#define AP_SET_CFG_DELAY 500000 27587d6232b604ee383d893362f37f9843f5ac2162Dmitry Shmidt#define AP_DRIVER_START_DELAY 800000 2885e6c5f00bef0e23f81904bc8a430498a545f4f6Dmitry Shmidt#define AP_CHANNEL_DEFAULT 6 2984c65a62fe7b053fed7f20274ca7379627a87b79Dmitry Shmidt 305af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidtclass SoftapController { 315af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidtpublic: 325af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt SoftapController(); 335af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt virtual ~SoftapController(); 345af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt 355af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt int startSoftap(); 365af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt int stopSoftap(); 375af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt bool isSoftapStarted(); 385af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt int setSoftap(int argc, char *argv[]); 3931fd6c5f3e9c39a13b028718dba5921a4300988cDmitry Shmidt int fwReloadSoftap(int argc, char *argv[]); 4025753d500d9ef6ee04dad43ffa27287a6dc959acSasha Levitskiyprivate: 4125753d500d9ef6ee04dad43ffa27287a6dc959acSasha Levitskiy pid_t mPid; 4225753d500d9ef6ee04dad43ffa27287a6dc959acSasha Levitskiy void generatePsk(char *ssid, char *passphrase, char *psk); 435af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt}; 445af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt 455af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt#endif 46