/* Find a network profile through its' profile index. */
WIFI_MGR_NETWORK_PROFILE* WifiMgrGetProfileByProfileIndex(IN UINT32 ProfileIndex, IN LIST_ENTRY *ProfileList)
/* Find a network profile through its' profile index. */
WIFI_MGR_NETWORK_PROFILE* WifiMgrGetProfileByProfileIndex(IN UINT32 ProfileIndex, IN LIST_ENTRY *ProfileList)
{
  WIFI_MGR_NETWORK_PROFILE  *Profile;
  LIST_ENTRY                *Entry;
  if (ProfileList == NULL) {
    return NULL;
  }
  NET_LIST_FOR_EACH (Entry, ProfileList) {
    Profile = NET_LIST_USER_STRUCT_S (
                Entry,
                WIFI_MGR_NETWORK_PROFILE,
                Link,
                WIFI_MGR_PROFILE_SIGNATURE
                );
    if (Profile->ProfileIndex == ProfileIndex) {
      return Profile;
    }
  }
  return NULL;
}