diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/wmi.c')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/wmi.c | 48 |
1 files changed, 11 insertions, 37 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index 94df345d08c2..b921005ad7ee 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c | |||
@@ -619,8 +619,7 @@ static int ath6kl_wmi_rx_probe_req_event_rx(struct wmi *wmi, u8 *datap, int len, | |||
619 | dlen, freq, vif->probe_req_report); | 619 | dlen, freq, vif->probe_req_report); |
620 | 620 | ||
621 | if (vif->probe_req_report || vif->nw_type == AP_NETWORK) | 621 | if (vif->probe_req_report || vif->nw_type == AP_NETWORK) |
622 | cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0, | 622 | cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0); |
623 | GFP_ATOMIC); | ||
624 | 623 | ||
625 | return 0; | 624 | return 0; |
626 | } | 625 | } |
@@ -659,7 +658,7 @@ static int ath6kl_wmi_rx_action_event_rx(struct wmi *wmi, u8 *datap, int len, | |||
659 | return -EINVAL; | 658 | return -EINVAL; |
660 | } | 659 | } |
661 | ath6kl_dbg(ATH6KL_DBG_WMI, "rx_action: len=%u freq=%u\n", dlen, freq); | 660 | ath6kl_dbg(ATH6KL_DBG_WMI, "rx_action: len=%u freq=%u\n", dlen, freq); |
662 | cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0, GFP_ATOMIC); | 661 | cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0); |
663 | 662 | ||
664 | return 0; | 663 | return 0; |
665 | } | 664 | } |
@@ -1093,7 +1092,6 @@ static int ath6kl_wmi_bssinfo_event_rx(struct wmi *wmi, u8 *datap, int len, | |||
1093 | u8 *buf; | 1092 | u8 *buf; |
1094 | struct ieee80211_channel *channel; | 1093 | struct ieee80211_channel *channel; |
1095 | struct ath6kl *ar = wmi->parent_dev; | 1094 | struct ath6kl *ar = wmi->parent_dev; |
1096 | struct ieee80211_mgmt *mgmt; | ||
1097 | struct cfg80211_bss *bss; | 1095 | struct cfg80211_bss *bss; |
1098 | 1096 | ||
1099 | if (len <= sizeof(struct wmi_bss_info_hdr2)) | 1097 | if (len <= sizeof(struct wmi_bss_info_hdr2)) |
@@ -1139,39 +1137,15 @@ static int ath6kl_wmi_bssinfo_event_rx(struct wmi *wmi, u8 *datap, int len, | |||
1139 | } | 1137 | } |
1140 | } | 1138 | } |
1141 | 1139 | ||
1142 | /* | 1140 | bss = cfg80211_inform_bss(ar->wiphy, channel, |
1143 | * In theory, use of cfg80211_inform_bss() would be more natural here | 1141 | bih->frame_type == BEACON_FTYPE ? |
1144 | * since we do not have the full frame. However, at least for now, | 1142 | CFG80211_BSS_FTYPE_BEACON : |
1145 | * cfg80211 can only distinguish Beacon and Probe Response frames from | 1143 | CFG80211_BSS_FTYPE_PRESP, |
1146 | * each other when using cfg80211_inform_bss_frame(), so let's build a | 1144 | bih->bssid, get_unaligned_le64((__le64 *)buf), |
1147 | * fake IEEE 802.11 header to be able to take benefit of this. | 1145 | get_unaligned_le16(((__le16 *)buf) + 5), |
1148 | */ | 1146 | get_unaligned_le16(((__le16 *)buf) + 4), |
1149 | mgmt = kmalloc(24 + len, GFP_ATOMIC); | 1147 | buf + 8 + 2 + 2, len - 8 - 2 - 2, |
1150 | if (mgmt == NULL) | 1148 | (bih->snr - 95) * 100, GFP_ATOMIC); |
1151 | return -EINVAL; | ||
1152 | |||
1153 | if (bih->frame_type == BEACON_FTYPE) { | ||
1154 | mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | | ||
1155 | IEEE80211_STYPE_BEACON); | ||
1156 | memset(mgmt->da, 0xff, ETH_ALEN); | ||
1157 | } else { | ||
1158 | struct net_device *dev = vif->ndev; | ||
1159 | |||
1160 | mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | | ||
1161 | IEEE80211_STYPE_PROBE_RESP); | ||
1162 | memcpy(mgmt->da, dev->dev_addr, ETH_ALEN); | ||
1163 | } | ||
1164 | mgmt->duration = cpu_to_le16(0); | ||
1165 | memcpy(mgmt->sa, bih->bssid, ETH_ALEN); | ||
1166 | memcpy(mgmt->bssid, bih->bssid, ETH_ALEN); | ||
1167 | mgmt->seq_ctrl = cpu_to_le16(0); | ||
1168 | |||
1169 | memcpy(&mgmt->u.beacon, buf, len); | ||
1170 | |||
1171 | bss = cfg80211_inform_bss_frame(ar->wiphy, channel, mgmt, | ||
1172 | 24 + len, (bih->snr - 95) * 100, | ||
1173 | GFP_ATOMIC); | ||
1174 | kfree(mgmt); | ||
1175 | if (bss == NULL) | 1149 | if (bss == NULL) |
1176 | return -ENOMEM; | 1150 | return -ENOMEM; |
1177 | cfg80211_put_bss(ar->wiphy, bss); | 1151 | cfg80211_put_bss(ar->wiphy, bss); |