Moved the management of the AP and Stations from nl80211 driver to generic wifi.

This commit is contained in:
vemax78
2014-04-21 23:16:56 +02:00
parent fbd717b779
commit 7668ab7c7c
16 changed files with 2195 additions and 2325 deletions

View File

@ -284,6 +284,38 @@ int ieee80211_is_broadcast_addr(const uint8_t* addr) {
return (((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)) ? 1 : 0);
}
/* */
const uint8_t* ieee80211_get_bssid_addr(const struct ieee80211_header* header) {
uint16_t framecontrol;
uint16_t framecontrol_type;
ASSERT(header);
/* Get type frame */
framecontrol = __le16_to_cpu(header->framecontrol);
framecontrol_type = IEEE80211_FRAME_CONTROL_GET_TYPE(framecontrol);
if (framecontrol_type == IEEE80211_FRAMECONTROL_TYPE_MGMT) {
return header->address3;
} else if (framecontrol_type == IEEE80211_FRAMECONTROL_TYPE_DATA) {
switch (framecontrol & (IEEE80211_FRAME_CONTROL_MASK_TODS | IEEE80211_FRAME_CONTROL_MASK_FROMDS)) {
case 0: {
return header->address3;
}
case IEEE80211_FRAME_CONTROL_MASK_TODS: {
return header->address1;
}
case IEEE80211_FRAME_CONTROL_MASK_FROMDS: {
return header->address2;
}
}
}
return NULL;
}
/* */
int ieee80211_is_valid_ssid(const char* ssid, struct ieee80211_ie_ssid* iessid, struct ieee80211_ie_ssid_list* isssidlist) {
int ssidlength;