Lines Matching defs:iface

112      * Meta-info about every iface that is active.
125 /** Type of the iface: STA or AP */
131 /** External iface destroyed listener for the iface */
160 /** Integer to allocate for the next iface being created */
162 /** Map of the id to the iface structure */
165 /** Allocate a new iface for the given type */
167 Iface iface = new Iface(mNextId, type);
168 mIfaces.put(mNextId, iface);
170 return iface;
173 /** Remove the iface using the provided id */
178 /** Lookup the iface using the provided id */
183 /** Lookup the iface using the provided name */
185 for (Iface iface : mIfaces.values()) {
186 if (TextUtils.equals(iface.name, ifaceName)) {
187 return iface;
198 /** Checks if there are any iface active. */
203 /** Checks if there are any iface of the given type active. */
205 for (Iface iface : mIfaces.values()) {
206 if (iface.type == type) {
213 /** Checks if there are any iface of the given type active. */
215 for (Iface iface : mIfaces.values()) {
216 if (iface.type == type) {
217 return iface;
223 /** Checks if there are any STA iface active. */
228 /** Checks if there are any AP iface active. */
234 Iface iface = findAnyIfaceOfType(Iface.IFACE_TYPE_STA);
235 if (iface == null) {
238 return iface.name;
242 Iface iface = findAnyIfaceOfType(Iface.IFACE_TYPE_AP);
243 if (iface == null) {
246 return iface.name;
249 /** Removes the existing iface that does not match the provided id. */
392 /** Helper method invoked to teardown client iface and perform necessary cleanup */
393 private void onClientInterfaceDestroyed(@NonNull Iface iface) {
395 mWifiMonitor.stopMonitoring(iface.name);
396 if (!unregisterNetworkObserver(iface.networkObserver)) {
397 Log.e(TAG, "Failed to unregister network observer on " + iface);
399 if (!mSupplicantStaIfaceHal.teardownIface(iface.name)) {
400 Log.e(TAG, "Failed to teardown iface in supplicant on " + iface);
402 if (!mWificondControl.tearDownClientInterface(iface.name)) {
403 Log.e(TAG, "Failed to teardown iface in wificond on " + iface);
410 /** Helper method invoked to teardown softAp iface and perform necessary cleanup */
411 private void onSoftApInterfaceDestroyed(@NonNull Iface iface) {
413 if (!unregisterNetworkObserver(iface.networkObserver)) {
414 Log.e(TAG, "Failed to unregister network observer on " + iface);
416 if (!mHostapdHal.removeAccessPoint(iface.name)) {
417 Log.e(TAG, "Failed to remove access point on " + iface);
423 if (!mWificondControl.stopHostapd(iface.name)) {
424 Log.e(TAG, "Failed to stop hostapd on " + iface);
426 if (!mWificondControl.tearDownSoftApInterface(iface.name)) {
427 Log.e(TAG, "Failed to teardown iface in wificond on " + iface);
433 /** Helper method invoked to teardown iface and perform necessary cleanup */
434 private void onInterfaceDestroyed(@NonNull Iface iface) {
436 if (iface.type == Iface.IFACE_TYPE_STA) {
437 onClientInterfaceDestroyed(iface);
438 } else if (iface.type == Iface.IFACE_TYPE_AP) {
439 onSoftApInterfaceDestroyed(iface);
442 iface.externalListener.onDestroyed(iface.name);
461 final Iface iface = mIfaceMgr.removeIface(mInterfaceId);
462 if (iface == null) {
464 Log.v(TAG, "Received iface destroyed notification on an invalid iface="
469 onInterfaceDestroyed(iface);
470 Log.i(TAG, "Successfully torn down " + iface);
547 private void onInterfaceStateChanged(Iface iface, boolean isUp) {
550 if (isUp == iface.isUp) {
552 Log.v(TAG, "Interface status unchanged on " + iface + " from " + isUp
557 Log.i(TAG, "Interface state changed on " + iface + ", isUp=" + isUp);
559 iface.externalListener.onUp(iface.name);
561 iface.externalListener.onDown(iface.name);
562 if (iface.type == Iface.IFACE_TYPE_STA) {
564 } else if (iface.type == Iface.IFACE_TYPE_AP) {
568 iface.isUp = isUp;
599 Log.v(TAG, "Received iface link up/down notification on an invalid iface="
607 Log.v(TAG, "Received iface link up/down notification on an invalid iface="
668 * Helper function to handle creation of STA iface.
670 * teardown any existing iface.
672 private String createStaIface(@NonNull Iface iface, boolean lowPrioritySta) {
676 new InterfaceDestoyedListenerInternal(iface.id));
679 return handleIfaceCreationWhenVendorHalNotSupported(iface);
685 * Helper function to handle creation of AP iface.
687 * teardown any existing iface.
689 private String createApIface(@NonNull Iface iface) {
693 new InterfaceDestoyedListenerInternal(iface.id));
696 return handleIfaceCreationWhenVendorHalNotSupported(iface);
704 private boolean handleIfaceRemovalWhenVendorHalNotSupported(@NonNull Iface iface) {
706 mIfaceMgr.removeIface(iface.id);
707 onInterfaceDestroyed(iface);
708 Log.i(TAG, "Successfully torn down " + iface);
714 * Helper function to handle removal of STA iface.
716 * teardown any existing iface.
718 private boolean removeStaIface(@NonNull Iface iface) {
721 return mWifiVendorHal.removeStaIface(iface.name);
724 return handleIfaceRemovalWhenVendorHalNotSupported(iface);
730 * Helper function to handle removal of STA iface.
732 private boolean removeApIface(@NonNull Iface iface) {
735 return mWifiVendorHal.removeApIface(iface.name);
738 return handleIfaceRemovalWhenVendorHalNotSupported(iface);
794 * @param ifaceName Name of the iface.
801 * @param ifaceName Name of the iface.
808 * @param ifaceName Name of the iface.
844 * @param interfaceCallback Associated callback for notifying status changes for the iface.
860 Iface iface = mIfaceMgr.allocateIface(Iface.IFACE_TYPE_STA);
861 if (iface == null) {
862 Log.e(TAG, "Failed to allocate new STA iface");
865 iface.externalListener = interfaceCallback;
866 iface.name = createStaIface(iface, lowPrioritySta);
867 if (TextUtils.isEmpty(iface.name)) {
868 Log.e(TAG, "Failed to create STA iface in vendor HAL");
869 mIfaceMgr.removeIface(iface.id);
873 if (mWificondControl.setupInterfaceForClientMode(iface.name) == null) {
874 Log.e(TAG, "Failed to setup iface in wificond on " + iface);
875 teardownInterface(iface.name);
879 if (!mSupplicantStaIfaceHal.setupIface(iface.name)) {
880 Log.e(TAG, "Failed to setup iface in supplicant on " + iface);
881 teardownInterface(iface.name);
885 iface.networkObserver = new NetworkObserverInternal(iface.id);
886 if (!registerNetworkObserver(iface.networkObserver)) {
887 Log.e(TAG, "Failed to register network observer on " + iface);
888 teardownInterface(iface.name);
891 mWifiMonitor.startMonitoring(iface.name);
894 onInterfaceStateChanged(iface, isInterfaceUp(iface.name));
895 initializeNwParamsForClientInterface(iface.name);
896 Log.i(TAG, "Successfully setup " + iface);
897 return iface.name;
907 * @param interfaceCallback Associated callback for notifying status changes for the iface.
917 Iface iface = mIfaceMgr.allocateIface(Iface.IFACE_TYPE_AP);
918 if (iface == null) {
919 Log.e(TAG, "Failed to allocate new AP iface");
922 iface.externalListener = interfaceCallback;
923 iface.name = createApIface(iface);
924 if (TextUtils.isEmpty(iface.name)) {
925 Log.e(TAG, "Failed to create AP iface in vendor HAL");
926 mIfaceMgr.removeIface(iface.id);
930 if (mWificondControl.setupInterfaceForSoftApMode(iface.name) == null) {
931 Log.e(TAG, "Failed to setup iface in wificond on " + iface);
932 teardownInterface(iface.name);
936 iface.networkObserver = new NetworkObserverInternal(iface.id);
937 if (!registerNetworkObserver(iface.networkObserver)) {
938 Log.e(TAG, "Failed to register network observer on " + iface);
939 teardownInterface(iface.name);
944 onInterfaceStateChanged(iface, isInterfaceUp(iface.name));
945 Log.i(TAG, "Successfully setup " + iface);
946 return iface.name;
955 * @return true if iface is up, false if it's down or on error.
959 final Iface iface = mIfaceMgr.getIface(ifaceName);
960 if (iface == null) {
961 Log.e(TAG, "Trying to get iface state on invalid iface=" + ifaceName);
987 final Iface iface = mIfaceMgr.getIface(ifaceName);
988 if (iface == null) {
989 Log.e(TAG, "Trying to teardown an invalid iface=" + ifaceName);
992 // Trigger the iface removal from HAL. The rest of the cleanup will be triggered
994 if (iface.type == Iface.IFACE_TYPE_STA) {
995 if (!removeStaIface(iface)) {
996 Log.e(TAG, "Failed to remove iface in vendor HAL=" + ifaceName);
999 } else if (iface.type == Iface.IFACE_TYPE_AP) {
1000 if (!removeApIface(iface)) {
1001 Log.e(TAG, "Failed to remove iface in vendor HAL=" + ifaceName);
1005 Log.i(TAG, "Successfully initiated teardown for iface=" + ifaceName);
1020 Iface iface = mIfaceMgr.getIface(ifaceIdIter.next());
1022 onInterfaceDestroyed(iface);
1023 Log.i(TAG, "Successfully torn down " + iface);
1337 * Trigger a reconnection if the iface is disconnected.
1347 * Trigger a reassociation even if the iface is currently connected.
2272 * Installs an APF program on this iface, replacing any existing program.
2283 * Reads the APF program and data buffer for this iface.
2293 * Set country code for this AP iface.