diff options
-rw-r--r-- | include/net/cfg80211.h | 2 | ||||
-rw-r--r-- | net/mac80211/cfg.c | 1 | ||||
-rw-r--r-- | net/mac80211/mesh.c | 4 | ||||
-rw-r--r-- | net/wireless/mesh.c | 10 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 17 |
5 files changed, 30 insertions, 4 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 31ca11672ca8..6a43c34ce96f 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -1176,6 +1176,7 @@ struct mesh_config { | |||
1176 | * @dtim_period: DTIM period to use | 1176 | * @dtim_period: DTIM period to use |
1177 | * @beacon_interval: beacon interval to use | 1177 | * @beacon_interval: beacon interval to use |
1178 | * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a] | 1178 | * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a] |
1179 | * @basic_rates: basic rates to use when creating the mesh | ||
1179 | * | 1180 | * |
1180 | * These parameters are fixed when the mesh is created. | 1181 | * These parameters are fixed when the mesh is created. |
1181 | */ | 1182 | */ |
@@ -1195,6 +1196,7 @@ struct mesh_setup { | |||
1195 | u8 dtim_period; | 1196 | u8 dtim_period; |
1196 | u16 beacon_interval; | 1197 | u16 beacon_interval; |
1197 | int mcast_rate[IEEE80211_NUM_BANDS]; | 1198 | int mcast_rate[IEEE80211_NUM_BANDS]; |
1199 | u32 basic_rates; | ||
1198 | }; | 1200 | }; |
1199 | 1201 | ||
1200 | /** | 1202 | /** |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 344a57968079..cd6f35f6e714 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1759,6 +1759,7 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh, | |||
1759 | /* mcast rate setting in Mesh Node */ | 1759 | /* mcast rate setting in Mesh Node */ |
1760 | memcpy(sdata->vif.bss_conf.mcast_rate, setup->mcast_rate, | 1760 | memcpy(sdata->vif.bss_conf.mcast_rate, setup->mcast_rate, |
1761 | sizeof(setup->mcast_rate)); | 1761 | sizeof(setup->mcast_rate)); |
1762 | sdata->vif.bss_conf.basic_rates = setup->basic_rates; | ||
1762 | 1763 | ||
1763 | sdata->vif.bss_conf.beacon_int = setup->beacon_interval; | 1764 | sdata->vif.bss_conf.beacon_int = setup->beacon_interval; |
1764 | sdata->vif.bss_conf.dtim_period = setup->dtim_period; | 1765 | sdata->vif.bss_conf.dtim_period = setup->dtim_period; |
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 4ee527f78677..6c33af482df4 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -738,9 +738,6 @@ int ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata) | |||
738 | BSS_CHANGED_HT | | 738 | BSS_CHANGED_HT | |
739 | BSS_CHANGED_BASIC_RATES | | 739 | BSS_CHANGED_BASIC_RATES | |
740 | BSS_CHANGED_BEACON_INT; | 740 | BSS_CHANGED_BEACON_INT; |
741 | enum ieee80211_band band = ieee80211_get_sdata_band(sdata); | ||
742 | struct ieee80211_supported_band *sband = | ||
743 | sdata->local->hw.wiphy->bands[band]; | ||
744 | 741 | ||
745 | local->fif_other_bss++; | 742 | local->fif_other_bss++; |
746 | /* mesh ifaces must set allmulti to forward mcast traffic */ | 743 | /* mesh ifaces must set allmulti to forward mcast traffic */ |
@@ -758,7 +755,6 @@ int ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata) | |||
758 | sdata->vif.bss_conf.ht_operation_mode = | 755 | sdata->vif.bss_conf.ht_operation_mode = |
759 | ifmsh->mshcfg.ht_opmode; | 756 | ifmsh->mshcfg.ht_opmode; |
760 | sdata->vif.bss_conf.enable_beacon = true; | 757 | sdata->vif.bss_conf.enable_beacon = true; |
761 | sdata->vif.bss_conf.basic_rates = ieee80211_mandatory_rates(sband); | ||
762 | 758 | ||
763 | changed |= ieee80211_mps_local_status_update(sdata); | 759 | changed |= ieee80211_mps_local_status_update(sdata); |
764 | 760 | ||
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c index 0daaf72e1b81..30c49202ee4d 100644 --- a/net/wireless/mesh.c +++ b/net/wireless/mesh.c | |||
@@ -162,6 +162,16 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, | |||
162 | setup->chandef.center_freq1 = setup->chandef.chan->center_freq; | 162 | setup->chandef.center_freq1 = setup->chandef.chan->center_freq; |
163 | } | 163 | } |
164 | 164 | ||
165 | /* | ||
166 | * check if basic rates are available otherwise use mandatory rates as | ||
167 | * basic rates | ||
168 | */ | ||
169 | if (!setup->basic_rates) { | ||
170 | struct ieee80211_supported_band *sband = | ||
171 | rdev->wiphy.bands[setup->chandef.chan->band]; | ||
172 | setup->basic_rates = ieee80211_mandatory_rates(sband); | ||
173 | } | ||
174 | |||
165 | if (!cfg80211_reg_can_beacon(&rdev->wiphy, &setup->chandef)) | 175 | if (!cfg80211_reg_can_beacon(&rdev->wiphy, &setup->chandef)) |
166 | return -EINVAL; | 176 | return -EINVAL; |
167 | 177 | ||
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 8aa83c04d4eb..687cb6497598 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -7487,6 +7487,23 @@ static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info) | |||
7487 | setup.chandef.chan = NULL; | 7487 | setup.chandef.chan = NULL; |
7488 | } | 7488 | } |
7489 | 7489 | ||
7490 | if (info->attrs[NL80211_ATTR_BSS_BASIC_RATES]) { | ||
7491 | u8 *rates = nla_data(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]); | ||
7492 | int n_rates = | ||
7493 | nla_len(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]); | ||
7494 | struct ieee80211_supported_band *sband; | ||
7495 | |||
7496 | if (!setup.chandef.chan) | ||
7497 | return -EINVAL; | ||
7498 | |||
7499 | sband = rdev->wiphy.bands[setup.chandef.chan->band]; | ||
7500 | |||
7501 | err = ieee80211_get_ratemask(sband, rates, n_rates, | ||
7502 | &setup.basic_rates); | ||
7503 | if (err) | ||
7504 | return err; | ||
7505 | } | ||
7506 | |||
7490 | return cfg80211_join_mesh(rdev, dev, &setup, &cfg); | 7507 | return cfg80211_join_mesh(rdev, dev, &setup, &cfg); |
7491 | } | 7508 | } |
7492 | 7509 | ||