Commit 657c3e0c authored by Ashok Nagarajan's avatar Ashok Nagarajan Committed by John W. Linville

mac80211: Indicate basic rates when adding rate IEs

Basic rates are added with supported rates IE and extended supported
rates IE.
Signed-off-by: default avatarAshok Nagarajan <ashok@cozybit.com>
Signed-off-by: default avatarThomas Pedersen <thomas@cozybit.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d934f7d0
...@@ -3717,8 +3717,9 @@ void ieee80211_enable_rssi_reports(struct ieee80211_vif *vif, ...@@ -3717,8 +3717,9 @@ void ieee80211_enable_rssi_reports(struct ieee80211_vif *vif,
void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif); void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif);
int ieee80211_add_srates_ie(struct ieee80211_vif *vif, struct sk_buff *skb); int ieee80211_add_srates_ie(struct ieee80211_vif *vif,
struct sk_buff *skb, bool need_basic);
int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif, int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif,
struct sk_buff *skb); struct sk_buff *skb, bool need_basic);
#endif /* MAC80211_H */ #endif /* MAC80211_H */
...@@ -2358,8 +2358,8 @@ ieee80211_prep_tdls_encap_data(struct wiphy *wiphy, struct net_device *dev, ...@@ -2358,8 +2358,8 @@ ieee80211_prep_tdls_encap_data(struct wiphy *wiphy, struct net_device *dev,
tf->u.setup_req.capability = tf->u.setup_req.capability =
cpu_to_le16(ieee80211_get_tdls_sta_capab(sdata)); cpu_to_le16(ieee80211_get_tdls_sta_capab(sdata));
ieee80211_add_srates_ie(&sdata->vif, skb); ieee80211_add_srates_ie(&sdata->vif, skb, false);
ieee80211_add_ext_srates_ie(&sdata->vif, skb); ieee80211_add_ext_srates_ie(&sdata->vif, skb, false);
ieee80211_tdls_add_ext_capab(skb); ieee80211_tdls_add_ext_capab(skb);
break; break;
case WLAN_TDLS_SETUP_RESPONSE: case WLAN_TDLS_SETUP_RESPONSE:
...@@ -2372,8 +2372,8 @@ ieee80211_prep_tdls_encap_data(struct wiphy *wiphy, struct net_device *dev, ...@@ -2372,8 +2372,8 @@ ieee80211_prep_tdls_encap_data(struct wiphy *wiphy, struct net_device *dev,
tf->u.setup_resp.capability = tf->u.setup_resp.capability =
cpu_to_le16(ieee80211_get_tdls_sta_capab(sdata)); cpu_to_le16(ieee80211_get_tdls_sta_capab(sdata));
ieee80211_add_srates_ie(&sdata->vif, skb); ieee80211_add_srates_ie(&sdata->vif, skb, false);
ieee80211_add_ext_srates_ie(&sdata->vif, skb); ieee80211_add_ext_srates_ie(&sdata->vif, skb, false);
ieee80211_tdls_add_ext_capab(skb); ieee80211_tdls_add_ext_capab(skb);
break; break;
case WLAN_TDLS_SETUP_CONFIRM: case WLAN_TDLS_SETUP_CONFIRM:
...@@ -2433,8 +2433,8 @@ ieee80211_prep_tdls_direct(struct wiphy *wiphy, struct net_device *dev, ...@@ -2433,8 +2433,8 @@ ieee80211_prep_tdls_direct(struct wiphy *wiphy, struct net_device *dev,
mgmt->u.action.u.tdls_discover_resp.capability = mgmt->u.action.u.tdls_discover_resp.capability =
cpu_to_le16(ieee80211_get_tdls_sta_capab(sdata)); cpu_to_le16(ieee80211_get_tdls_sta_capab(sdata));
ieee80211_add_srates_ie(&sdata->vif, skb); ieee80211_add_srates_ie(&sdata->vif, skb, false);
ieee80211_add_ext_srates_ie(&sdata->vif, skb); ieee80211_add_ext_srates_ie(&sdata->vif, skb, false);
ieee80211_tdls_add_ext_capab(skb); ieee80211_tdls_add_ext_capab(skb);
break; break;
default: default:
......
...@@ -212,8 +212,8 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, ...@@ -212,8 +212,8 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
pos = skb_put(skb, 2); pos = skb_put(skb, 2);
memcpy(pos + 2, &plid, 2); memcpy(pos + 2, &plid, 2);
} }
if (ieee80211_add_srates_ie(&sdata->vif, skb) || if (ieee80211_add_srates_ie(&sdata->vif, skb, true) ||
ieee80211_add_ext_srates_ie(&sdata->vif, skb) || ieee80211_add_ext_srates_ie(&sdata->vif, skb, true) ||
mesh_add_rsn_ie(skb, sdata) || mesh_add_rsn_ie(skb, sdata) ||
mesh_add_meshid_ie(skb, sdata) || mesh_add_meshid_ie(skb, sdata) ||
mesh_add_meshconf_ie(skb, sdata)) mesh_add_meshconf_ie(skb, sdata))
......
...@@ -2418,9 +2418,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, ...@@ -2418,9 +2418,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
*pos++ = WLAN_EID_SSID; *pos++ = WLAN_EID_SSID;
*pos++ = 0x0; *pos++ = 0x0;
if (ieee80211_add_srates_ie(&sdata->vif, skb) || if (ieee80211_add_srates_ie(&sdata->vif, skb, true) ||
mesh_add_ds_params_ie(skb, sdata) || mesh_add_ds_params_ie(skb, sdata) ||
ieee80211_add_ext_srates_ie(&sdata->vif, skb) || ieee80211_add_ext_srates_ie(&sdata->vif, skb, true) ||
mesh_add_rsn_ie(skb, sdata) || mesh_add_rsn_ie(skb, sdata) ||
mesh_add_ht_cap_ie(skb, sdata) || mesh_add_ht_cap_ie(skb, sdata) ||
mesh_add_ht_oper_ie(skb, sdata) || mesh_add_ht_oper_ie(skb, sdata) ||
......
...@@ -1683,13 +1683,15 @@ ieee80211_ht_oper_to_channel_type(struct ieee80211_ht_operation *ht_oper) ...@@ -1683,13 +1683,15 @@ ieee80211_ht_oper_to_channel_type(struct ieee80211_ht_operation *ht_oper)
return channel_type; return channel_type;
} }
int ieee80211_add_srates_ie(struct ieee80211_vif *vif, struct sk_buff *skb) int ieee80211_add_srates_ie(struct ieee80211_vif *vif,
struct sk_buff *skb, bool need_basic)
{ {
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
int rate; int rate;
u8 i, rates, *pos; u8 i, rates, *pos;
u32 basic_rates = vif->bss_conf.basic_rates;
sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
rates = sband->n_bitrates; rates = sband->n_bitrates;
...@@ -1703,20 +1705,25 @@ int ieee80211_add_srates_ie(struct ieee80211_vif *vif, struct sk_buff *skb) ...@@ -1703,20 +1705,25 @@ int ieee80211_add_srates_ie(struct ieee80211_vif *vif, struct sk_buff *skb)
*pos++ = WLAN_EID_SUPP_RATES; *pos++ = WLAN_EID_SUPP_RATES;
*pos++ = rates; *pos++ = rates;
for (i = 0; i < rates; i++) { for (i = 0; i < rates; i++) {
u8 basic = 0;
if (need_basic && basic_rates & BIT(i))
basic = 0x80;
rate = sband->bitrates[i].bitrate; rate = sband->bitrates[i].bitrate;
*pos++ = (u8) (rate / 5); *pos++ = basic | (u8) (rate / 5);
} }
return 0; return 0;
} }
int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif, struct sk_buff *skb) int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif,
struct sk_buff *skb, bool need_basic)
{ {
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
int rate; int rate;
u8 i, exrates, *pos; u8 i, exrates, *pos;
u32 basic_rates = vif->bss_conf.basic_rates;
sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
exrates = sband->n_bitrates; exrates = sband->n_bitrates;
...@@ -1733,8 +1740,11 @@ int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif, struct sk_buff *skb) ...@@ -1733,8 +1740,11 @@ int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif, struct sk_buff *skb)
*pos++ = WLAN_EID_EXT_SUPP_RATES; *pos++ = WLAN_EID_EXT_SUPP_RATES;
*pos++ = exrates; *pos++ = exrates;
for (i = 8; i < sband->n_bitrates; i++) { for (i = 8; i < sband->n_bitrates; i++) {
u8 basic = 0;
if (need_basic && basic_rates & BIT(i))
basic = 0x80;
rate = sband->bitrates[i].bitrate; rate = sband->bitrates[i].bitrate;
*pos++ = (u8) (rate / 5); *pos++ = basic | (u8) (rate / 5);
} }
} }
return 0; return 0;
......
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