Re: [PATCH v4 5/6] ath10k: add wmi support for tdls
Marek Puzyniak marek.puzyn...@tieto.com writes: On 23 March 2015 at 11:53, Kalle Valo kv...@qca.qualcomm.com wrote: Marek Puzyniak marek.puzyn...@tieto.com writes: As a part of tdls implementation introduce tdls related wmi data structures, constant values and functions. Signed-off-by: Marek Puzyniak marek.puzyn...@tieto.com This patch had non-trivial conflicts, please check carefully my resolution in the pending branch. CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath10k/wmi.h CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath10k/wmi-tlv.h CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath10k/wmi-tlv.c CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath10k/wmi-ops.h -- Kalle Valo It looks OK, but there is one small thing in file drivers/net/wireless/ath/ath10k/wmi-tlv.c. There are two new lines between functions ath10k_wmi_tlv_op_gen_tdls_peer_update and ath10k_wmi_tlv_op_gen_wow_enable. Thanks, fixed now. -- Kalle Valo -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 5/6] ath10k: add wmi support for tdls
On 23 March 2015 at 11:53, Kalle Valo kv...@qca.qualcomm.com wrote: Marek Puzyniak marek.puzyn...@tieto.com writes: As a part of tdls implementation introduce tdls related wmi data structures, constant values and functions. Signed-off-by: Marek Puzyniak marek.puzyn...@tieto.com This patch had non-trivial conflicts, please check carefully my resolution in the pending branch. CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath10k/wmi.h CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath10k/wmi-tlv.h CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath10k/wmi-tlv.c CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath10k/wmi-ops.h -- Kalle Valo It looks OK, but there is one small thing in file drivers/net/wireless/ath/ath10k/wmi-tlv.c. There are two new lines between functions ath10k_wmi_tlv_op_gen_tdls_peer_update and ath10k_wmi_tlv_op_gen_wow_enable. Thanks, Marek -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 5/6] ath10k: add wmi support for tdls
On 22 March 2015 at 08:49, Arik Nemtsov a...@wizery.com wrote: On Fri, Mar 20, 2015 at 1:02 PM, Marek Puzyniak marek.puzyn...@tieto.com wrote: As a part of tdls implementation introduce tdls related wmi data structures, constant values and functions. Signed-off-by: Marek Puzyniak marek.puzyn...@tieto.com --- drivers/net/wireless/ath/ath10k/wmi-ops.h | 42 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 153 ++ drivers/net/wireless/ath/ath10k/wmi-tlv.h | 53 +++ drivers/net/wireless/ath/ath10k/wmi.h | 37 4 files changed, 285 insertions(+) [...] + + cmd = (void *)tlv-value; + cmd-vdev_id = __cpu_to_le32(vdev_id); + cmd-state = __cpu_to_le32(state); + cmd-notification_interval_ms = __cpu_to_le32(5000); + cmd-tx_discovery_threshold = __cpu_to_le32(100); + cmd-tx_teardown_threshold = __cpu_to_le32(5); + cmd-rssi_teardown_threshold = __cpu_to_le32(-75); + cmd-rssi_delta = __cpu_to_le32(-20); + cmd-tdls_options = __cpu_to_le32(options); + cmd-tdls_peer_traffic_ind_window = __cpu_to_le32(2); + cmd-tdls_peer_traffic_response_timeout_ms = __cpu_to_le32(5000); + cmd-tdls_puapsd_mask = __cpu_to_le32(0xf); + cmd-tdls_puapsd_inactivity_time_ms = __cpu_to_le32(0); + cmd-tdls_puapsd_rx_frame_threshold = __cpu_to_le32(10); Do the above lines assume all TDLS peers support TDLS buffer-sta (which is required for peer UAPSD)? Especially the value of tdls_puapsd_mask. I can assure you not all peers support this :) For instance iwlwifi does not (for now). But I might be misinterpreting this - perhaps there some other code in the driver/FW that checks the peer's extended-capabilities IE for buffer-sta support (bit 28)? That would be the best option. ath10k doesn't support buffer-sta as well. Firmware requires additional tdls_options flags (WMI_TLV_TDLS_BUFFER_STA_EN and WMI_TLV_TDLS_SLEEP_STA_EN) to be set before it considers these values. Michał -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 5/6] ath10k: add wmi support for tdls
Marek Puzyniak marek.puzyn...@tieto.com writes: As a part of tdls implementation introduce tdls related wmi data structures, constant values and functions. Signed-off-by: Marek Puzyniak marek.puzyn...@tieto.com This patch had non-trivial conflicts, please check carefully my resolution in the pending branch. CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath10k/wmi.h CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath10k/wmi-tlv.h CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath10k/wmi-tlv.c CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath10k/wmi-ops.h -- Kalle Valo -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 5/6] ath10k: add wmi support for tdls
On 23 March 2015 at 09:09, Michal Kazior michal.kaz...@tieto.com wrote: On 22 March 2015 at 08:49, Arik Nemtsov a...@wizery.com wrote: On Fri, Mar 20, 2015 at 1:02 PM, Marek Puzyniak marek.puzyn...@tieto.com wrote: As a part of tdls implementation introduce tdls related wmi data structures, constant values and functions. Signed-off-by: Marek Puzyniak marek.puzyn...@tieto.com --- drivers/net/wireless/ath/ath10k/wmi-ops.h | 42 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 153 ++ drivers/net/wireless/ath/ath10k/wmi-tlv.h | 53 +++ drivers/net/wireless/ath/ath10k/wmi.h | 37 4 files changed, 285 insertions(+) [...] + + cmd = (void *)tlv-value; + cmd-vdev_id = __cpu_to_le32(vdev_id); + cmd-state = __cpu_to_le32(state); + cmd-notification_interval_ms = __cpu_to_le32(5000); + cmd-tx_discovery_threshold = __cpu_to_le32(100); + cmd-tx_teardown_threshold = __cpu_to_le32(5); + cmd-rssi_teardown_threshold = __cpu_to_le32(-75); + cmd-rssi_delta = __cpu_to_le32(-20); + cmd-tdls_options = __cpu_to_le32(options); + cmd-tdls_peer_traffic_ind_window = __cpu_to_le32(2); + cmd-tdls_peer_traffic_response_timeout_ms = __cpu_to_le32(5000); + cmd-tdls_puapsd_mask = __cpu_to_le32(0xf); + cmd-tdls_puapsd_inactivity_time_ms = __cpu_to_le32(0); + cmd-tdls_puapsd_rx_frame_threshold = __cpu_to_le32(10); Do the above lines assume all TDLS peers support TDLS buffer-sta (which is required for peer UAPSD)? Especially the value of tdls_puapsd_mask. No. The function you reffer to configures device itself not TDLS peers. Currently tdls peer uapsd buffer sta is not implemented as Michał wrote. I can assure you not all peers support this :) For instance iwlwifi does not (for now). But I might be misinterpreting this - perhaps there some other code in the driver/FW that checks the peer's extended-capabilities IE for buffer-sta support (bit 28)? That would be the best option. Currently ath10k tdls device also has this bit not set. During tdls setup phase ath10k creates data structures for tdls peer sta but also there support for tdls peer sta power save is disabled. I think there is no information about tdls peer sta power save from mac80211 that's why ath10k assumes no power save support by tdls peer sta. So bit 28 in extended capabilities IE is even not checked. ath10k doesn't support buffer-sta as well. Firmware requires additional tdls_options flags (WMI_TLV_TDLS_BUFFER_STA_EN and WMI_TLV_TDLS_SLEEP_STA_EN) to be set before it considers these values. Michał Marek -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 5/6] ath10k: add wmi support for tdls
On Fri, Mar 20, 2015 at 1:02 PM, Marek Puzyniak marek.puzyn...@tieto.com wrote: As a part of tdls implementation introduce tdls related wmi data structures, constant values and functions. Signed-off-by: Marek Puzyniak marek.puzyn...@tieto.com --- drivers/net/wireless/ath/ath10k/wmi-ops.h | 42 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 153 ++ drivers/net/wireless/ath/ath10k/wmi-tlv.h | 53 +++ drivers/net/wireless/ath/ath10k/wmi.h | 37 4 files changed, 285 insertions(+) [...] + + cmd = (void *)tlv-value; + cmd-vdev_id = __cpu_to_le32(vdev_id); + cmd-state = __cpu_to_le32(state); + cmd-notification_interval_ms = __cpu_to_le32(5000); + cmd-tx_discovery_threshold = __cpu_to_le32(100); + cmd-tx_teardown_threshold = __cpu_to_le32(5); + cmd-rssi_teardown_threshold = __cpu_to_le32(-75); + cmd-rssi_delta = __cpu_to_le32(-20); + cmd-tdls_options = __cpu_to_le32(options); + cmd-tdls_peer_traffic_ind_window = __cpu_to_le32(2); + cmd-tdls_peer_traffic_response_timeout_ms = __cpu_to_le32(5000); + cmd-tdls_puapsd_mask = __cpu_to_le32(0xf); + cmd-tdls_puapsd_inactivity_time_ms = __cpu_to_le32(0); + cmd-tdls_puapsd_rx_frame_threshold = __cpu_to_le32(10); Do the above lines assume all TDLS peers support TDLS buffer-sta (which is required for peer UAPSD)? Especially the value of tdls_puapsd_mask. I can assure you not all peers support this :) For instance iwlwifi does not (for now). But I might be misinterpreting this - perhaps there some other code in the driver/FW that checks the peer's extended-capabilities IE for buffer-sta support (bit 28)? That would be the best option. Arik -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 5/6] ath10k: add wmi support for tdls
As a part of tdls implementation introduce tdls related wmi data structures, constant values and functions. Signed-off-by: Marek Puzyniak marek.puzyn...@tieto.com --- drivers/net/wireless/ath/ath10k/wmi-ops.h | 42 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 153 ++ drivers/net/wireless/ath/ath10k/wmi-tlv.h | 53 +++ drivers/net/wireless/ath/ath10k/wmi.h | 37 4 files changed, 285 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h index 28d042c..1e444a0 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h @@ -151,6 +151,13 @@ struct wmi_ops { u32 num_ac); struct sk_buff *(*gen_sta_keepalive)(struct ath10k *ar, const struct wmi_sta_keepalive_arg *arg); + struct sk_buff *(*gen_update_fw_tdls_state)(struct ath10k *ar, + u32 vdev_id, + enum wmi_tdls_state state); + struct sk_buff *(*gen_tdls_peer_update)(struct ath10k *ar, + const struct wmi_tdls_peer_update_cmd_arg *arg, + const struct wmi_tdls_peer_capab_arg *cap, + const struct wmi_channel_arg *chan); }; int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id); @@ -1074,4 +1081,39 @@ ath10k_wmi_sta_keepalive(struct ath10k *ar, return ath10k_wmi_cmd_send(ar, skb, cmd_id); } +static inline int +ath10k_wmi_update_fw_tdls_state(struct ath10k *ar, u32 vdev_id, + enum wmi_tdls_state state) +{ + struct sk_buff *skb; + + if (!ar-wmi.ops-gen_update_fw_tdls_state) + return -EOPNOTSUPP; + + skb = ar-wmi.ops-gen_update_fw_tdls_state(ar, vdev_id, state); + if (IS_ERR(skb)) + return PTR_ERR(skb); + + return ath10k_wmi_cmd_send(ar, skb, ar-wmi.cmd-tdls_set_state_cmdid); +} + +static inline int +ath10k_wmi_tdls_peer_update(struct ath10k *ar, + const struct wmi_tdls_peer_update_cmd_arg *arg, + const struct wmi_tdls_peer_capab_arg *cap, + const struct wmi_channel_arg *chan) +{ + struct sk_buff *skb; + + if (!ar-wmi.ops-gen_tdls_peer_update) + return -EOPNOTSUPP; + + skb = ar-wmi.ops-gen_tdls_peer_update(ar, arg, cap, chan); + if (IS_ERR(skb)) + return PTR_ERR(skb); + + return ath10k_wmi_cmd_send(ar, skb, + ar-wmi.cmd-tdls_peer_update_cmdid); +} + #endif diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 80e882b..7b62f0d 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -2564,6 +2564,155 @@ ath10k_wmi_tlv_op_gen_p2p_go_bcn_ie(struct ath10k *ar, u32 vdev_id, return skb; } +static struct sk_buff * +ath10k_wmi_tlv_op_gen_update_fw_tdls_state(struct ath10k *ar, u32 vdev_id, + enum wmi_tdls_state state) +{ + struct wmi_tdls_set_state_cmd *cmd; + struct wmi_tlv *tlv; + struct sk_buff *skb; + void *ptr; + size_t len; + /* Set to options from wmi_tlv_tdls_options, +* for now none of them are enabled. +*/ + u32 options = 0; + + len = sizeof(*tlv) + sizeof(*cmd); + skb = ath10k_wmi_alloc_skb(ar, len); + if (!skb) + return ERR_PTR(-ENOMEM); + + ptr = (void *)skb-data; + tlv = ptr; + tlv-tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_TDLS_SET_STATE_CMD); + tlv-len = __cpu_to_le16(sizeof(*cmd)); + + cmd = (void *)tlv-value; + cmd-vdev_id = __cpu_to_le32(vdev_id); + cmd-state = __cpu_to_le32(state); + cmd-notification_interval_ms = __cpu_to_le32(5000); + cmd-tx_discovery_threshold = __cpu_to_le32(100); + cmd-tx_teardown_threshold = __cpu_to_le32(5); + cmd-rssi_teardown_threshold = __cpu_to_le32(-75); + cmd-rssi_delta = __cpu_to_le32(-20); + cmd-tdls_options = __cpu_to_le32(options); + cmd-tdls_peer_traffic_ind_window = __cpu_to_le32(2); + cmd-tdls_peer_traffic_response_timeout_ms = __cpu_to_le32(5000); + cmd-tdls_puapsd_mask = __cpu_to_le32(0xf); + cmd-tdls_puapsd_inactivity_time_ms = __cpu_to_le32(0); + cmd-tdls_puapsd_rx_frame_threshold = __cpu_to_le32(10); + + ptr += sizeof(*tlv); + ptr += sizeof(*cmd); + + ath10k_dbg(ar, ATH10K_DBG_WMI, wmi tlv update fw tdls state %d for vdev %i\n, + state, vdev_id); + return skb; +} + +static u32 ath10k_wmi_tlv_prepare_peer_qos(u8 uapsd_queues, u8 sp) +{