Commit 5face518 authored by Igor Mitsyanko's avatar Igor Mitsyanko Committed by Kalle Valo

qtnfmac: SCAN results: retreive frame type information from "IE set" TLV

"IE set" TLV carries the same information as
qlink_event_scan_result::frame_type. Convert the event to make use of
TLV and drop frame_type member.
While at it, make qlink_event_scan_result structure alignement-safe.
Signed-off-by: default avatarIgor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 18b7470f
...@@ -252,13 +252,12 @@ qtnf_event_handle_scan_results(struct qtnf_vif *vif, ...@@ -252,13 +252,12 @@ qtnf_event_handle_scan_results(struct qtnf_vif *vif,
struct cfg80211_bss *bss; struct cfg80211_bss *bss;
struct ieee80211_channel *channel; struct ieee80211_channel *channel;
struct wiphy *wiphy = priv_to_wiphy(vif->mac); struct wiphy *wiphy = priv_to_wiphy(vif->mac);
enum cfg80211_bss_frame_type frame_type; enum cfg80211_bss_frame_type frame_type = CFG80211_BSS_FTYPE_UNKNOWN;
size_t payload_len; size_t payload_len;
u16 tlv_type; u16 tlv_type;
u16 tlv_value_len; u16 tlv_value_len;
size_t tlv_full_len; size_t tlv_full_len;
const struct qlink_tlv_hdr *tlv; const struct qlink_tlv_hdr *tlv;
const u8 *ies = NULL; const u8 *ies = NULL;
size_t ies_len = 0; size_t ies_len = 0;
...@@ -275,17 +274,6 @@ qtnf_event_handle_scan_results(struct qtnf_vif *vif, ...@@ -275,17 +274,6 @@ qtnf_event_handle_scan_results(struct qtnf_vif *vif,
return -EINVAL; return -EINVAL;
} }
switch (sr->frame_type) {
case QLINK_BSS_FTYPE_BEACON:
frame_type = CFG80211_BSS_FTYPE_BEACON;
break;
case QLINK_BSS_FTYPE_PRESP:
frame_type = CFG80211_BSS_FTYPE_PRESP;
break;
default:
frame_type = CFG80211_BSS_FTYPE_UNKNOWN;
}
payload_len = len - sizeof(*sr); payload_len = len - sizeof(*sr);
tlv = (struct qlink_tlv_hdr *)sr->payload; tlv = (struct qlink_tlv_hdr *)sr->payload;
...@@ -308,6 +296,17 @@ qtnf_event_handle_scan_results(struct qtnf_vif *vif, ...@@ -308,6 +296,17 @@ qtnf_event_handle_scan_results(struct qtnf_vif *vif,
ie_len = tlv_value_len - ie_len = tlv_value_len -
(sizeof(*ie_set) - sizeof(ie_set->hdr)); (sizeof(*ie_set) - sizeof(ie_set->hdr));
switch (ie_set->type) {
case QLINK_IE_SET_BEACON_IES:
frame_type = CFG80211_BSS_FTYPE_BEACON;
break;
case QLINK_IE_SET_PROBE_RESP_IES:
frame_type = CFG80211_BSS_FTYPE_PRESP;
break;
default:
frame_type = CFG80211_BSS_FTYPE_UNKNOWN;
}
if (ie_len) { if (ie_len) {
ies = ie_set->ie_data; ies = ie_set->ie_data;
ies_len = ie_len; ies_len = ie_len;
......
...@@ -881,12 +881,6 @@ struct qlink_event_rxmgmt { ...@@ -881,12 +881,6 @@ struct qlink_event_rxmgmt {
u8 frame_data[0]; u8 frame_data[0];
} __packed; } __packed;
enum qlink_frame_type {
QLINK_BSS_FTYPE_UNKNOWN,
QLINK_BSS_FTYPE_BEACON,
QLINK_BSS_FTYPE_PRESP,
};
/** /**
* struct qlink_event_scan_result - data for QLINK_EVENT_SCAN_RESULTS event * struct qlink_event_scan_result - data for QLINK_EVENT_SCAN_RESULTS event
* *
...@@ -896,7 +890,6 @@ enum qlink_frame_type { ...@@ -896,7 +890,6 @@ enum qlink_frame_type {
* @capab: capabilities field. * @capab: capabilities field.
* @bintval: beacon interval announced by discovered BSS. * @bintval: beacon interval announced by discovered BSS.
* @signal: signal strength. * @signal: signal strength.
* @frame_type: frame type used to get scan result, see &enum qlink_frame_type.
* @bssid: BSSID announced by discovered BSS. * @bssid: BSSID announced by discovered BSS.
* @ssid_len: length of SSID announced by BSS. * @ssid_len: length of SSID announced by BSS.
* @ssid: SSID announced by discovered BSS. * @ssid: SSID announced by discovered BSS.
...@@ -909,10 +902,10 @@ struct qlink_event_scan_result { ...@@ -909,10 +902,10 @@ struct qlink_event_scan_result {
__le16 capab; __le16 capab;
__le16 bintval; __le16 bintval;
s8 signal; s8 signal;
u8 frame_type;
u8 bssid[ETH_ALEN];
u8 ssid_len; u8 ssid_len;
u8 ssid[IEEE80211_MAX_SSID_LEN]; u8 ssid[IEEE80211_MAX_SSID_LEN];
u8 bssid[ETH_ALEN];
u8 rsvd[2];
u8 payload[0]; u8 payload[0];
} __packed; } __packed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment