diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2015-01-13 09:30:11 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2015-01-15 05:30:33 -0500 |
commit | 369242b4e3f9d29ddead61895f97a3118484f2f1 (patch) | |
tree | 1098fba5c24262d4badc2dc2f348f2cac07b1dbd /drivers/net/wireless/ath | |
parent | 4c4955fe4f879fb0bd3bf8630ba23a9811617b59 (diff) |
ath10k: implement p2p bcn ie command
Along beacon template host is expected to setup
p2p information elements as well. Implement wmi
interface for it.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi-ops.h | 17 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi-tlv.c | 41 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi-tlv.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.c | 3 |
4 files changed, 66 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h index 7084096c0f62..0dd49a7a89f0 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h | |||
@@ -135,6 +135,8 @@ struct wmi_ops { | |||
135 | void *prb_ies, size_t prb_ies_len); | 135 | void *prb_ies, size_t prb_ies_len); |
136 | struct sk_buff *(*gen_prb_tmpl)(struct ath10k *ar, u32 vdev_id, | 136 | struct sk_buff *(*gen_prb_tmpl)(struct ath10k *ar, u32 vdev_id, |
137 | struct sk_buff *bcn); | 137 | struct sk_buff *bcn); |
138 | struct sk_buff *(*gen_p2p_go_bcn_ie)(struct ath10k *ar, u32 vdev_id, | ||
139 | const u8 *p2p_ie); | ||
138 | }; | 140 | }; |
139 | 141 | ||
140 | int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id); | 142 | int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id); |
@@ -975,4 +977,19 @@ ath10k_wmi_prb_tmpl(struct ath10k *ar, u32 vdev_id, struct sk_buff *prb) | |||
975 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->prb_tmpl_cmdid); | 977 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->prb_tmpl_cmdid); |
976 | } | 978 | } |
977 | 979 | ||
980 | static inline int | ||
981 | ath10k_wmi_p2p_go_bcn_ie(struct ath10k *ar, u32 vdev_id, const u8 *p2p_ie) | ||
982 | { | ||
983 | struct sk_buff *skb; | ||
984 | |||
985 | if (!ar->wmi.ops->gen_p2p_go_bcn_ie) | ||
986 | return -EOPNOTSUPP; | ||
987 | |||
988 | skb = ar->wmi.ops->gen_p2p_go_bcn_ie(ar, vdev_id, p2p_ie); | ||
989 | if (IS_ERR(skb)) | ||
990 | return PTR_ERR(skb); | ||
991 | |||
992 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->p2p_go_set_beacon_ie); | ||
993 | } | ||
994 | |||
978 | #endif | 995 | #endif |
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 29dc0941cf08..6f34fc7d663e 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c | |||
@@ -2085,6 +2085,46 @@ ath10k_wmi_tlv_op_gen_prb_tmpl(struct ath10k *ar, u32 vdev_id, | |||
2085 | return skb; | 2085 | return skb; |
2086 | } | 2086 | } |
2087 | 2087 | ||
2088 | static struct sk_buff * | ||
2089 | ath10k_wmi_tlv_op_gen_p2p_go_bcn_ie(struct ath10k *ar, u32 vdev_id, | ||
2090 | const u8 *p2p_ie) | ||
2091 | { | ||
2092 | struct wmi_tlv_p2p_go_bcn_ie *cmd; | ||
2093 | struct wmi_tlv *tlv; | ||
2094 | struct sk_buff *skb; | ||
2095 | void *ptr; | ||
2096 | size_t len; | ||
2097 | |||
2098 | len = sizeof(*tlv) + sizeof(*cmd) + | ||
2099 | sizeof(*tlv) + roundup(p2p_ie[1] + 2, 4); | ||
2100 | skb = ath10k_wmi_alloc_skb(ar, len); | ||
2101 | if (!skb) | ||
2102 | return ERR_PTR(-ENOMEM); | ||
2103 | |||
2104 | ptr = (void *)skb->data; | ||
2105 | tlv = ptr; | ||
2106 | tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_P2P_GO_SET_BEACON_IE); | ||
2107 | tlv->len = __cpu_to_le16(sizeof(*cmd)); | ||
2108 | cmd = (void *)tlv->value; | ||
2109 | cmd->vdev_id = __cpu_to_le32(vdev_id); | ||
2110 | cmd->ie_len = __cpu_to_le32(p2p_ie[1] + 2); | ||
2111 | |||
2112 | ptr += sizeof(*tlv); | ||
2113 | ptr += sizeof(*cmd); | ||
2114 | |||
2115 | tlv = ptr; | ||
2116 | tlv->tag = __cpu_to_le16(WMI_TLV_TAG_ARRAY_BYTE); | ||
2117 | tlv->len = __cpu_to_le16(roundup(p2p_ie[1] + 2, 4)); | ||
2118 | memcpy(tlv->value, p2p_ie, p2p_ie[1] + 2); | ||
2119 | |||
2120 | ptr += sizeof(*tlv); | ||
2121 | ptr += roundup(p2p_ie[1] + 2, 4); | ||
2122 | |||
2123 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv p2p go bcn ie for vdev %i\n", | ||
2124 | vdev_id); | ||
2125 | return skb; | ||
2126 | } | ||
2127 | |||
2088 | /****************/ | 2128 | /****************/ |
2089 | /* TLV mappings */ | 2129 | /* TLV mappings */ |
2090 | /****************/ | 2130 | /****************/ |
@@ -2376,6 +2416,7 @@ static const struct wmi_ops wmi_tlv_ops = { | |||
2376 | /* .gen_delba_send not implemented */ | 2416 | /* .gen_delba_send not implemented */ |
2377 | .gen_bcn_tmpl = ath10k_wmi_tlv_op_gen_bcn_tmpl, | 2417 | .gen_bcn_tmpl = ath10k_wmi_tlv_op_gen_bcn_tmpl, |
2378 | .gen_prb_tmpl = ath10k_wmi_tlv_op_gen_prb_tmpl, | 2418 | .gen_prb_tmpl = ath10k_wmi_tlv_op_gen_prb_tmpl, |
2419 | .gen_p2p_go_bcn_ie = ath10k_wmi_tlv_op_gen_p2p_go_bcn_ie, | ||
2379 | }; | 2420 | }; |
2380 | 2421 | ||
2381 | /************/ | 2422 | /************/ |
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.h b/drivers/net/wireless/ath/ath10k/wmi-tlv.h index 577251955c04..eb02290075a7 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.h +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.h | |||
@@ -1404,6 +1404,11 @@ struct wmi_tlv_prb_tmpl_cmd { | |||
1404 | __le32 buf_len; | 1404 | __le32 buf_len; |
1405 | } __packed; | 1405 | } __packed; |
1406 | 1406 | ||
1407 | struct wmi_tlv_p2p_go_bcn_ie { | ||
1408 | __le32 vdev_id; | ||
1409 | __le32 ie_len; | ||
1410 | } __packed; | ||
1411 | |||
1407 | void ath10k_wmi_tlv_attach(struct ath10k *ar); | 1412 | void ath10k_wmi_tlv_attach(struct ath10k *ar); |
1408 | 1413 | ||
1409 | #endif | 1414 | #endif |
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index bfa38628cdd0..5fe17e80bc6b 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c | |||
@@ -5040,6 +5040,7 @@ static const struct wmi_ops wmi_ops = { | |||
5040 | .gen_delba_send = ath10k_wmi_op_gen_delba_send, | 5040 | .gen_delba_send = ath10k_wmi_op_gen_delba_send, |
5041 | /* .gen_bcn_tmpl not implemented */ | 5041 | /* .gen_bcn_tmpl not implemented */ |
5042 | /* .gen_prb_tmpl not implemented */ | 5042 | /* .gen_prb_tmpl not implemented */ |
5043 | /* .gen_p2p_go_bcn_ie not implemented */ | ||
5043 | }; | 5044 | }; |
5044 | 5045 | ||
5045 | static const struct wmi_ops wmi_10_1_ops = { | 5046 | static const struct wmi_ops wmi_10_1_ops = { |
@@ -5100,6 +5101,7 @@ static const struct wmi_ops wmi_10_1_ops = { | |||
5100 | .gen_delba_send = ath10k_wmi_op_gen_delba_send, | 5101 | .gen_delba_send = ath10k_wmi_op_gen_delba_send, |
5101 | /* .gen_bcn_tmpl not implemented */ | 5102 | /* .gen_bcn_tmpl not implemented */ |
5102 | /* .gen_prb_tmpl not implemented */ | 5103 | /* .gen_prb_tmpl not implemented */ |
5104 | /* .gen_p2p_go_bcn_ie not implemented */ | ||
5103 | }; | 5105 | }; |
5104 | 5106 | ||
5105 | static const struct wmi_ops wmi_10_2_ops = { | 5107 | static const struct wmi_ops wmi_10_2_ops = { |
@@ -5220,6 +5222,7 @@ static const struct wmi_ops wmi_10_2_4_ops = { | |||
5220 | .gen_delba_send = ath10k_wmi_op_gen_delba_send, | 5222 | .gen_delba_send = ath10k_wmi_op_gen_delba_send, |
5221 | /* .gen_bcn_tmpl not implemented */ | 5223 | /* .gen_bcn_tmpl not implemented */ |
5222 | /* .gen_prb_tmpl not implemented */ | 5224 | /* .gen_prb_tmpl not implemented */ |
5225 | /* .gen_p2p_go_bcn_ie not implemented */ | ||
5223 | }; | 5226 | }; |
5224 | 5227 | ||
5225 | int ath10k_wmi_attach(struct ath10k *ar) | 5228 | int ath10k_wmi_attach(struct ath10k *ar) |