Commit fbad963a authored by Sergey Matyukevich's avatar Sergey Matyukevich Committed by Kalle Valo

qtnfmac: fix rssi data passed to wireless core

Fix RSSI values passed to wireless core by qtnfmac driver:
- fix RSSI values in scan results:
  driver registers wiphy with CFG80211_SIGNAL_TYPE_MBM signal type,
  so mBm should be passed using DBM_TO_MBM macro
- accompany firmware changes fixing RSSI values in received mgmt frames
  update qlink message format and pass correct signed values to core
Signed-off-by: default avatarSergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent e6e594af
...@@ -237,9 +237,8 @@ qtnf_event_handle_mgmt_received(struct qtnf_vif *vif, ...@@ -237,9 +237,8 @@ qtnf_event_handle_mgmt_received(struct qtnf_vif *vif,
pr_debug("%s LEN:%u FC:%.4X SA:%pM\n", vif->netdev->name, frame_len, pr_debug("%s LEN:%u FC:%.4X SA:%pM\n", vif->netdev->name, frame_len,
le16_to_cpu(frame->frame_control), frame->addr2); le16_to_cpu(frame->frame_control), frame->addr2);
cfg80211_rx_mgmt(&vif->wdev, le32_to_cpu(rxmgmt->freq), cfg80211_rx_mgmt(&vif->wdev, le32_to_cpu(rxmgmt->freq), rxmgmt->sig_dbm,
le32_to_cpu(rxmgmt->sig_dbm), rxmgmt->frame_data, rxmgmt->frame_data, frame_len, flags);
frame_len, flags);
return 0; return 0;
} }
...@@ -324,7 +323,7 @@ qtnf_event_handle_scan_results(struct qtnf_vif *vif, ...@@ -324,7 +323,7 @@ qtnf_event_handle_scan_results(struct qtnf_vif *vif,
sr->bssid, get_unaligned_le64(&sr->tsf), sr->bssid, get_unaligned_le64(&sr->tsf),
le16_to_cpu(sr->capab), le16_to_cpu(sr->capab),
le16_to_cpu(sr->bintval), ies, ies_len, le16_to_cpu(sr->bintval), ies, ies_len,
sr->signal, GFP_KERNEL); DBM_TO_MBM(sr->sig_dbm), GFP_KERNEL);
if (!bss) if (!bss)
return -ENOMEM; return -ENOMEM;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <linux/ieee80211.h> #include <linux/ieee80211.h>
#define QLINK_PROTO_VER 7 #define QLINK_PROTO_VER 8
#define QLINK_MACID_RSVD 0xFF #define QLINK_MACID_RSVD 0xFF
#define QLINK_VIFID_RSVD 0xFF #define QLINK_VIFID_RSVD 0xFF
...@@ -916,15 +916,16 @@ enum qlink_rxmgmt_flags { ...@@ -916,15 +916,16 @@ enum qlink_rxmgmt_flags {
* struct qlink_event_rxmgmt - data for QLINK_EVENT_MGMT_RECEIVED event * struct qlink_event_rxmgmt - data for QLINK_EVENT_MGMT_RECEIVED event
* *
* @freq: Frequency on which the frame was received in MHz. * @freq: Frequency on which the frame was received in MHz.
* @sig_dbm: signal strength in dBm.
* @flags: bitmap of &enum qlink_rxmgmt_flags. * @flags: bitmap of &enum qlink_rxmgmt_flags.
* @sig_dbm: signal strength in dBm.
* @frame_data: data of Rx'd frame itself. * @frame_data: data of Rx'd frame itself.
*/ */
struct qlink_event_rxmgmt { struct qlink_event_rxmgmt {
struct qlink_event ehdr; struct qlink_event ehdr;
__le32 freq; __le32 freq;
__le32 sig_dbm;
__le32 flags; __le32 flags;
s8 sig_dbm;
u8 rsvd[3];
u8 frame_data[0]; u8 frame_data[0];
} __packed; } __packed;
...@@ -936,7 +937,7 @@ struct qlink_event_rxmgmt { ...@@ -936,7 +937,7 @@ struct qlink_event_rxmgmt {
* event was generated was discovered. * event was generated was discovered.
* @capab: capabilities field. * @capab: capabilities field.
* @bintval: beacon interval announced by discovered BSS. * @bintval: beacon interval announced by discovered BSS.
* @signal: signal strength. * @sig_dbm: signal strength in dBm.
* @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.
...@@ -948,7 +949,7 @@ struct qlink_event_scan_result { ...@@ -948,7 +949,7 @@ struct qlink_event_scan_result {
__le16 freq; __le16 freq;
__le16 capab; __le16 capab;
__le16 bintval; __le16 bintval;
s8 signal; s8 sig_dbm;
u8 ssid_len; u8 ssid_len;
u8 ssid[IEEE80211_MAX_SSID_LEN]; u8 ssid[IEEE80211_MAX_SSID_LEN];
u8 bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
......
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