* [PATCH 1/2] nl80211/cfg80211: Set VHT Operating mode
@ 2013-11-21 13:28 Marek Kwaczynski
2013-11-21 13:28 ` [PATCH 2/2] mac80211: Update opmode during adding new station Marek Kwaczynski
2013-11-25 16:13 ` [PATCH 1/2] nl80211/cfg80211: Set VHT Operating mode Johannes Berg
0 siblings, 2 replies; 8+ messages in thread
From: Marek Kwaczynski @ 2013-11-21 13:28 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, Marek Kwaczynski
This attribuite is needed for setting VHT operating mode in AP mode
from User Space. This functionality is required when User Space
received Assoc Reqeust contains VHT Operation Mode Notification
element.
Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com>
---
include/net/cfg80211.h | 4 ++++
include/uapi/linux/nl80211.h | 5 +++++
net/wireless/nl80211.c | 6 ++++++
3 files changed, 15 insertions(+)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 3eae46c..da6b869 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -748,6 +748,8 @@ enum station_parameters_apply_mask {
* @supported_channels_len: number of supported channels
* @supported_oper_classes: supported oper classes in IEEE 802.11 format
* @supported_oper_classes_len: number of supported operating classes
+ * @vht_opmode: operating mode field
+ * @vht_opmode_used: information if operating mode is used
*/
struct station_parameters {
const u8 *supported_rates;
@@ -771,6 +773,8 @@ struct station_parameters {
u8 supported_channels_len;
const u8 *supported_oper_classes;
u8 supported_oper_classes_len;
+ u8 vht_opmode;
+ bool vht_opmode_used;
};
/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index f752e98..60174a2 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1508,6 +1508,9 @@ enum nl80211_commands {
* to react to radar events, e.g. initiate a channel switch or leave the
* IBSS network.
*
+ * @NL80211_ATTR_VHT_OPMODE: VHT Operating mode information element (from
+ * association request when used with NL80211_CMD_NEW_STATION)
+ *
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
@@ -1824,6 +1827,8 @@ enum nl80211_attrs {
NL80211_ATTR_HANDLE_DFS,
+ NL80211_ATTR_VHT_OPMODE,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index a7f4e79..ad0606c 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4125,6 +4125,12 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
params.vht_capa =
nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY]);
+ if (info->attrs[NL80211_ATTR_VHT_OPMODE]) {
+ params.vht_opmode_used = 1;
+ params.vht_opmode =
+ nla_get_u8(info->attrs[NL80211_ATTR_VHT_OPMODE]);
+ }
+
if (info->attrs[NL80211_ATTR_STA_PLINK_ACTION]) {
params.plink_action =
nla_get_u8(info->attrs[NL80211_ATTR_STA_PLINK_ACTION]);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] mac80211: Update opmode during adding new station
2013-11-21 13:28 [PATCH 1/2] nl80211/cfg80211: Set VHT Operating mode Marek Kwaczynski
@ 2013-11-21 13:28 ` Marek Kwaczynski
2013-11-25 16:14 ` Johannes Berg
2013-11-25 16:13 ` [PATCH 1/2] nl80211/cfg80211: Set VHT Operating mode Johannes Berg
1 sibling, 1 reply; 8+ messages in thread
From: Marek Kwaczynski @ 2013-11-21 13:28 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, Marek Kwaczynski
Update Operating mode is needed when User Space received Assoc
Request contains Operating mode notification element.
---
net/mac80211/cfg.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 95667b0..710b5d7 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1383,6 +1383,7 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
struct ieee80211_sub_if_data *sdata;
int err;
int layer2_update;
+ enum ieee80211_band band;
if (params->vlan) {
sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan);
@@ -1425,6 +1426,12 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
if (!test_sta_flag(sta, WLAN_STA_TDLS_PEER))
rate_control_rate_init(sta);
+ if (params->vht_opmode_used) {
+ band = ieee80211_get_sdata_band(sdata);
+ ieee80211_vht_handle_opmode(sdata, sta, params->vht_opmode,
+ band, 0);
+ }
+
layer2_update = sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
sdata->vif.type == NL80211_IFTYPE_AP;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] nl80211/cfg80211: Set VHT Operating mode
2013-11-21 13:28 [PATCH 1/2] nl80211/cfg80211: Set VHT Operating mode Marek Kwaczynski
2013-11-21 13:28 ` [PATCH 2/2] mac80211: Update opmode during adding new station Marek Kwaczynski
@ 2013-11-25 16:13 ` Johannes Berg
1 sibling, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2013-11-25 16:13 UTC (permalink / raw)
To: Marek Kwaczynski; +Cc: linux-wireless
On Thu, 2013-11-21 at 14:28 +0100, Marek Kwaczynski wrote:
> This attribuite is needed for setting VHT operating mode in AP mode
> from User Space. This functionality is required when User Space
> received Assoc Reqeust contains VHT Operation Mode Notification
> element.
The spec doesn't call this "VHT operating mode", it just calls it
"operating mode notification" and I believe it is valid even in HT
stations that are "operating mode notification capable". Shouldn't we
thus rename it all? Right now it's pretty obvious, but once VHT is
rolled into 802.11 "proper" it would be somewhat confusing like this, I
think.
> + if (info->attrs[NL80211_ATTR_VHT_OPMODE]) {
> + params.vht_opmode_used = 1;
true, not 1
johannes
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] mac80211: Update opmode during adding new station
2013-11-21 13:28 ` [PATCH 2/2] mac80211: Update opmode during adding new station Marek Kwaczynski
@ 2013-11-25 16:14 ` Johannes Berg
0 siblings, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2013-11-25 16:14 UTC (permalink / raw)
To: Marek Kwaczynski; +Cc: linux-wireless
On Thu, 2013-11-21 at 14:28 +0100, Marek Kwaczynski wrote:
> Update Operating mode is needed when User Space received Assoc
> Request contains Operating mode notification element.
> ---
Need signed-off-by, there are two spaces in the subject where it should
only be one.
> +++ b/net/mac80211/cfg.c
> @@ -1383,6 +1383,7 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
> struct ieee80211_sub_if_data *sdata;
> int err;
> int layer2_update;
> + enum ieee80211_band band;
>
> if (params->vlan) {
> sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan);
> @@ -1425,6 +1426,12 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
> if (!test_sta_flag(sta, WLAN_STA_TDLS_PEER))
> rate_control_rate_init(sta);
>
> + if (params->vht_opmode_used) {
> + band = ieee80211_get_sdata_band(sdata);
could declare band right here?
> + ieee80211_vht_handle_opmode(sdata, sta, params->vht_opmode,
> + band, 0);
> + }
Are you sure this should be at this place and not before moving the
station to ASSOC/initialising rate control?
johannes
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] mac80211: Update opmode during adding new station
2013-12-02 14:28 Marek Kwaczynski
@ 2013-12-02 14:28 ` Marek Kwaczynski
2013-12-02 14:39 ` Johannes Berg
2013-12-02 14:40 ` Johannes Berg
0 siblings, 2 replies; 8+ messages in thread
From: Marek Kwaczynski @ 2013-12-02 14:28 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, Marek Kwaczynski
Update Operating mode is needed when User Space received Assoc
Request contains Operating mode notification element.
Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com>
---
net/mac80211/cfg.c | 8 ++++++++
net/mac80211/ieee80211_i.h | 4 ++++
net/mac80211/vht.c | 29 ++++++++++++++++++++---------
3 files changed, 32 insertions(+), 9 deletions(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 95667b0..f8cd150 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1409,6 +1409,14 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
*/
if (!(params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))) {
sta_info_pre_move_state(sta, IEEE80211_STA_AUTH);
+ if (params->vht_opmode_used) {
+ u32 changed;
+ enum ieee80211_band band =
+ ieee80211_get_sdata_band(sdata);
+ ieee80211_vht_handle_recalc_opmode(sdata, sta,
+ params->vht_opmode,
+ band, 0, &changed);
+ }
sta_info_pre_move_state(sta, IEEE80211_STA_ASSOC);
}
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 29dc505..2231661 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1510,6 +1510,10 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
struct sta_info *sta);
enum ieee80211_sta_rx_bandwidth ieee80211_sta_cur_vht_bw(struct sta_info *sta);
void ieee80211_sta_set_rx_nss(struct sta_info *sta);
+void ieee80211_vht_recalc_opmode(struct ieee80211_sub_if_data *sdata,
+ struct sta_info *sta, u8 opmode,
+ enum ieee80211_band band, bool nss_only,
+ u32 *changed);
void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
struct sta_info *sta, u8 opmode,
enum ieee80211_band band, bool nss_only);
diff --git a/net/mac80211/vht.c b/net/mac80211/vht.c
index de01127..397ae2a 100644
--- a/net/mac80211/vht.c
+++ b/net/mac80211/vht.c
@@ -350,14 +350,14 @@ void ieee80211_sta_set_rx_nss(struct sta_info *sta)
sta->sta.rx_nss = max_t(u8, 1, ht_rx_nss);
}
-void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
+void ieee80211_vht_recalc_opmode(struct ieee80211_sub_if_data *sdata,
struct sta_info *sta, u8 opmode,
- enum ieee80211_band band, bool nss_only)
+ enum ieee80211_band band, bool nss_only,
+ u32 *changed)
{
struct ieee80211_local *local = sdata->local;
struct ieee80211_supported_band *sband;
enum ieee80211_sta_rx_bandwidth new_bw;
- u32 changed = 0;
u8 nss;
sband = local->hw.wiphy->bands[band];
@@ -372,11 +372,11 @@ void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
if (sta->sta.rx_nss != nss) {
sta->sta.rx_nss = nss;
- changed |= IEEE80211_RC_NSS_CHANGED;
+ *changed |= IEEE80211_RC_NSS_CHANGED;
}
if (nss_only)
- goto change;
+ return;
switch (opmode & IEEE80211_OPMODE_NOTIF_CHANWIDTH_MASK) {
case IEEE80211_OPMODE_NOTIF_CHANWIDTH_20MHZ:
@@ -396,10 +396,21 @@ void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
new_bw = ieee80211_sta_cur_vht_bw(sta);
if (new_bw != sta->sta.bandwidth) {
sta->sta.bandwidth = new_bw;
- changed |= IEEE80211_RC_BW_CHANGED;
+ *changed |= IEEE80211_RC_BW_CHANGED;
}
+}
+
- change:
- if (changed)
- rate_control_rate_update(local, sband, sta, changed);
+void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
+ struct sta_info *sta, u8 opmode,
+ enum ieee80211_band band, bool nss_only)
+{
+ u32 changed = 0;
+ ieee80211_vht_handle_recalc_opmode(sdata, sta, opmode, band, nss_only,
+ &changed);
+
+ if (changed) {
+ rate_control_rate_update(local, sband, sta, changed);
+
+ }
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] mac80211: Update opmode during adding new station
2013-12-02 14:28 ` [PATCH 2/2] mac80211: Update opmode during adding new station Marek Kwaczynski
@ 2013-12-02 14:39 ` Johannes Berg
2013-12-02 14:40 ` Johannes Berg
1 sibling, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2013-12-02 14:39 UTC (permalink / raw)
To: Marek Kwaczynski; +Cc: linux-wireless
On Mon, 2013-12-02 at 15:28 +0100, Marek Kwaczynski wrote:
> Update Operating mode is needed when User Space received Assoc
> Request contains Operating mode notification element.
Please fix coding style.
johannes
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] mac80211: Update opmode during adding new station
2013-12-02 14:28 ` [PATCH 2/2] mac80211: Update opmode during adding new station Marek Kwaczynski
2013-12-02 14:39 ` Johannes Berg
@ 2013-12-02 14:40 ` Johannes Berg
1 sibling, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2013-12-02 14:40 UTC (permalink / raw)
To: Marek Kwaczynski; +Cc: linux-wireless
On Mon, 2013-12-02 at 15:28 +0100, Marek Kwaczynski wrote:
> -void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
> +void ieee80211_vht_recalc_opmode(struct ieee80211_sub_if_data *sdata,
> struct sta_info *sta, u8 opmode,
> - enum ieee80211_band band, bool nss_only)
> + enum ieee80211_band band, bool nss_only,
> + u32 *changed)
Also - void return and u32 * argument is stupid.
johannes
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] mac80211: Update opmode during adding new station
2013-12-02 15:33 [PATCH 1/2] nl80211/cfg80211: Set VHT Operating mode Marek Kwaczynski
@ 2013-12-02 15:33 ` Marek Kwaczynski
0 siblings, 0 replies; 8+ messages in thread
From: Marek Kwaczynski @ 2013-12-02 15:33 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, Marek Kwaczynski
Update Operating mode is needed when User Space received Assoc
Request contains Operating mode notification element.
Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com>
---
net/mac80211/cfg.c | 7 +++++++
net/mac80211/ieee80211_i.h | 3 +++
net/mac80211/vht.c | 31 ++++++++++++++++++++-----------
3 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 95667b0..50f0841 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1409,6 +1409,13 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
*/
if (!(params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))) {
sta_info_pre_move_state(sta, IEEE80211_STA_AUTH);
+ if (params->vht_opmode_used) {
+ enum ieee80211_band band =
+ ieee80211_get_sdata_band(sdata);
+ ieee80211_vht_recalc_handle_opmode(sdata, sta,
+ params->vht_opmode,
+ band, 0);
+ }
sta_info_pre_move_state(sta, IEEE80211_STA_ASSOC);
}
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 29dc505..13965e1 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1510,6 +1510,9 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
struct sta_info *sta);
enum ieee80211_sta_rx_bandwidth ieee80211_sta_cur_vht_bw(struct sta_info *sta);
void ieee80211_sta_set_rx_nss(struct sta_info *sta);
+u32 ieee80211_vht_recalc_handle_opmode(struct ieee80211_sub_if_data *sdata,
+ struct sta_info *sta, u8 opmode,
+ enum ieee80211_band band, bool nss_only);
void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
struct sta_info *sta, u8 opmode,
enum ieee80211_band band, bool nss_only);
diff --git a/net/mac80211/vht.c b/net/mac80211/vht.c
index de01127..4a5174c 100644
--- a/net/mac80211/vht.c
+++ b/net/mac80211/vht.c
@@ -350,21 +350,17 @@ void ieee80211_sta_set_rx_nss(struct sta_info *sta)
sta->sta.rx_nss = max_t(u8, 1, ht_rx_nss);
}
-void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
- struct sta_info *sta, u8 opmode,
- enum ieee80211_band band, bool nss_only)
+u32 ieee80211_vht_recalc_handle_opmode(struct ieee80211_sub_if_data *sdata,
+ struct sta_info *sta, u8 opmode,
+ enum ieee80211_band band, bool nss_only)
{
- struct ieee80211_local *local = sdata->local;
- struct ieee80211_supported_band *sband;
enum ieee80211_sta_rx_bandwidth new_bw;
- u32 changed = 0;
u8 nss;
-
- sband = local->hw.wiphy->bands[band];
+ u32 changed = -1;
/* ignore - no support for BF yet */
if (opmode & IEEE80211_OPMODE_NOTIF_RX_NSS_TYPE_BF)
- return;
+ return -EOPNOTSUPP;
nss = opmode & IEEE80211_OPMODE_NOTIF_RX_NSS_MASK;
nss >>= IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT;
@@ -376,7 +372,7 @@ void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
}
if (nss_only)
- goto change;
+ return changed;
switch (opmode & IEEE80211_OPMODE_NOTIF_CHANWIDTH_MASK) {
case IEEE80211_OPMODE_NOTIF_CHANWIDTH_20MHZ:
@@ -398,8 +394,21 @@ void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
sta->sta.bandwidth = new_bw;
changed |= IEEE80211_RC_BW_CHANGED;
}
+ return changed;
+}
+
+void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
+ struct sta_info *sta, u8 opmode,
+ enum ieee80211_band band, bool nss_only)
+{
+ struct ieee80211_local *local = sdata->local;
+ struct ieee80211_supported_band *sband;
+ u32 changed = 0;
+
+ changed = ieee80211_vht_recalc_handle_opmode(sdata, sta, opmode, band,
+ nss_only);
+ sband = local->hw.wiphy->bands[band];
- change:
if (changed)
rate_control_rate_update(local, sband, sta, changed);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-12-02 15:34 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-21 13:28 [PATCH 1/2] nl80211/cfg80211: Set VHT Operating mode Marek Kwaczynski
2013-11-21 13:28 ` [PATCH 2/2] mac80211: Update opmode during adding new station Marek Kwaczynski
2013-11-25 16:14 ` Johannes Berg
2013-11-25 16:13 ` [PATCH 1/2] nl80211/cfg80211: Set VHT Operating mode Johannes Berg
-- strict thread matches above, loose matches on Subject: below --
2013-12-02 14:28 Marek Kwaczynski
2013-12-02 14:28 ` [PATCH 2/2] mac80211: Update opmode during adding new station Marek Kwaczynski
2013-12-02 14:39 ` Johannes Berg
2013-12-02 14:40 ` Johannes Berg
2013-12-02 15:33 [PATCH 1/2] nl80211/cfg80211: Set VHT Operating mode Marek Kwaczynski
2013-12-02 15:33 ` [PATCH 2/2] mac80211: Update opmode during adding new station Marek Kwaczynski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).