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

@ -311,25 +311,23 @@ static void ac_ieee80211_mgmt_packet(struct ac_session_data_t* sessiondata, uint
}
/* */
void ac_ieee80211_packet(struct ac_session_data_t* sessiondata, uint8_t radioid, const uint8_t* buffer, int length) {
const struct ieee80211_header* header;
void ac_ieee80211_packet(struct ac_session_data_t* sessiondata, uint8_t radioid, const struct ieee80211_header* header, int length) {
uint16_t framecontrol;
uint16_t framecontrol_type;
uint16_t framecontrol_subtype;
ASSERT(sessiondata != NULL);
ASSERT(IS_VALID_RADIOID(radioid));
ASSERT(buffer != NULL);
ASSERT(header != NULL);
ASSERT(length >= sizeof(struct ieee80211_header));
/* Get type frame */
header = (const struct ieee80211_header*)buffer;
framecontrol = __le16_to_cpu(header->framecontrol);
framecontrol_type = IEEE80211_FRAME_CONTROL_GET_TYPE(framecontrol);
framecontrol_subtype = IEEE80211_FRAME_CONTROL_GET_SUBTYPE(framecontrol);
/* Parsing frame */
if (framecontrol_type == IEEE80211_FRAMECONTROL_TYPE_MGMT) {
ac_ieee80211_mgmt_packet(sessiondata, radioid, (const struct ieee80211_header_mgmt*)buffer, length, framecontrol_subtype);
ac_ieee80211_mgmt_packet(sessiondata, radioid, (const struct ieee80211_header_mgmt*)header, length, framecontrol_subtype);
}
}

View File

@ -5,6 +5,7 @@
#include "capwap_event.h"
#include "capwap_lock.h"
#include "ac_soap.h"
#include "ieee80211.h"
/* AC packet */
struct ac_packet {
@ -210,7 +211,7 @@ void ac_session_data_release_reference(struct ac_session_data_t* sessiondata);
void ac_session_data_send_data_packet(struct ac_session_data_t* sessiondata, uint8_t radioid, uint8_t wlanid, const uint8_t* data, int length, int leavenativeframe);
/* IEEE802.11 Packet */
void ac_ieee80211_packet(struct ac_session_data_t* sessiondata, uint8_t radioid, const uint8_t* buffer, int length);
void ac_ieee80211_packet(struct ac_session_data_t* sessiondata, uint8_t radioid, const struct ieee80211_header* header, int length);
/* */
int ac_has_sessionid(struct capwap_sessionid_element* sessionid);

View File

@ -442,7 +442,7 @@ static void ac_session_data_run(struct ac_session_data_t* sessiondata) {
radioid = GET_RID_HEADER(sessiondata->rxmngpacket->header);
binding = GET_WBID_HEADER(sessiondata->rxmngpacket->header);
if ((binding == CAPWAP_WIRELESS_BINDING_IEEE80211) && (bodypacketlength >= sizeof(struct ieee80211_header))) {
ac_ieee80211_packet(sessiondata, radioid, bodypacket, bodypacketlength);
ac_ieee80211_packet(sessiondata, radioid, (struct ieee80211_header*)bodypacket, bodypacketlength);
}
}
}