2016-01-27 19:01:40

by Peter Oh

[permalink] [raw]
Subject: [PATCH 0/4] ath10k: rename mesh and add abstraction layer

Split Mesh service to 11s Mesh and non-11s Mesh according to
firmware service bit to help users distinguish 11s Mesh from
non 11s Mesh.
And add abstraction layer for vdev subtype to solve subtype mismatch
and to give flexible compatibility among different firmware revisions.

Peter Oh (4):
ath10k: rename Mesh related service names
ath10k: update 10.4 WMI service map
ath10k: use vif->type and vif->p2p for P2P_GO check
ath10k: add abstraction layer for vdev subtype

drivers/net/wireless/ath/ath10k/mac.c | 25 +++++------
drivers/net/wireless/ath/ath10k/wmi-ops.h | 11 +++++
drivers/net/wireless/ath/ath10k/wmi-tlv.c | 1 +
drivers/net/wireless/ath/ath10k/wmi.c | 72 ++++++++++++++++++++++++++++++-
drivers/net/wireless/ath/ath10k/wmi.h | 69 +++++++++++++++++++++++------
5 files changed, 153 insertions(+), 25 deletions(-)

--
1.9.1



2016-01-28 05:15:12

by Peter Oh

[permalink] [raw]
Subject: Re: [PATCH 0/4] ath10k: rename mesh and add abstraction layer


On 01/27/2016 06:04 PM, Yeoh Chun-Yeow wrote:
> On Thu, Jan 28, 2016 at 5:53 AM, Peter Oh <[email protected]> wrote:
>> On 01/27/2016 11:39 AM, Bob Copeland wrote:
>>> On Wed, Jan 27, 2016 at 10:55:53AM -0800, Peter Oh wrote:
>>>> Split Mesh service to 11s Mesh and non-11s Mesh according to
>>>> firmware service bit to help users distinguish 11s Mesh from
>>>> non 11s Mesh.
>>>> And add abstraction layer for vdev subtype to solve subtype mismatch
>>>> and to give flexible compatibility among different firmware revisions.
>>> Out of curiosity, which non-11s mesh, if you can share?
>> non-11s Mesh can be anything, but 11s Mesh such as meraki mesh.
>>
> I thought that non-11s mesh is for meraki mesh since it is not 802.11s
> implementation.
>
> WMI_10_4_SERVICE_MESH_NON_11S for non IEEE802.11s Mesh
> WMI_SERVICE_MESH_11S and WMI_VDEV_SUBTYPE_MESH for IEEE 802.11s Mesh
>
> Correct me if I am wrong.
You're correct. WMI_VDEV_SUBTYPE_MESH -> WMI_VDEV_SUBTYPE_MESH_11S
>
> Thanks
>
> ----
> Chun-Yeow
>
> _______________________________________________
> ath10k mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/ath10k


2016-01-27 19:11:02

by Ben Greear

[permalink] [raw]
Subject: Re: [PATCH 4/4] ath10k: add abstraction layer for vdev subtype

On 01/27/2016 10:55 AM, Peter Oh wrote:
> Abstraction layer for vdev subtype is added to solve
> subtype mismatch and to give flexible compatibility
> among different firmware revisions.
>
> For instance, 10.2 and 10.4 firmware has different
> definition of their vdev subtypes for Mesh.
> 10.4 defined subtype 6 for 802.11s Mesh while 10.2 uses 5.
> Hence use the abstraction API to get right subtype to use.
>
> Signed-off-by: Peter Oh <[email protected]>
> ---
> drivers/net/wireless/ath/ath10k/mac.c | 15 ++++---
> drivers/net/wireless/ath/ath10k/wmi-ops.h | 11 +++++
> drivers/net/wireless/ath/ath10k/wmi-tlv.c | 1 +
> drivers/net/wireless/ath/ath10k/wmi.c | 70 +++++++++++++++++++++++++++++++
> drivers/net/wireless/ath/ath10k/wmi.h | 42 ++++++++++++++++---
> 5 files changed, 128 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
> index 2940b00..c9a39ab 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -4345,25 +4345,29 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
> bit, ar->free_vdev_map);
>
> arvif->vdev_id = bit;
> - arvif->vdev_subtype = WMI_VDEV_SUBTYPE_NONE;
> + arvif->vdev_subtype =
> + ath10k_wmi_get_vdev_subtype(ar, WMI_VDEV_SUBTYPE_NONE);
>
> switch (vif->type) {
> case NL80211_IFTYPE_P2P_DEVICE:
> arvif->vdev_type = WMI_VDEV_TYPE_STA;
> - arvif->vdev_subtype = WMI_VDEV_SUBTYPE_P2P_DEVICE;
> + arvif->vdev_subtype = ath10k_wmi_get_vdev_subtype
> + (ar, WMI_VDEV_SUBTYPE_P2P_DEVICE);

Would it maybe be simpler code to just assign these types to the ar struct at
firmware init time. And then do something like:

arvif->vdev_subtype = ar->p2p_subtype;

Or even maybe:

arvif->vdev_subtype = ar->subtype_for_viftype[vif->type];

I'm not sure how much it matters, but in general I find the abstraction in
ath10k makes it hard to read through the code.

Thanks,
Ben

--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com


2016-01-28 08:51:23

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 0/4] ath10k: rename mesh and add abstraction layer

Peter Oh <[email protected]> writes:

> Split Mesh service to 11s Mesh and non-11s Mesh according to
> firmware service bit to help users distinguish 11s Mesh from
> non 11s Mesh.
> And add abstraction layer for vdev subtype to solve subtype mismatch
> and to give flexible compatibility among different firmware revisions.
>
> Peter Oh (4):
> ath10k: rename Mesh related service names
> ath10k: update 10.4 WMI service map
> ath10k: use vif->type and vif->p2p for P2P_GO check
> ath10k: add abstraction layer for vdev subtype

There are conflicts, please rebase.

Applying: ath10k: rename Mesh related service names
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging drivers/net/wireless/ath/ath10k/wmi.h
CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath10k/wmi.h
Auto-merging drivers/net/wireless/ath/ath10k/mac.c
Failed to merge in the changes.
Patch failed at 0001 ath10k: rename Mesh related service names

--
Kalle Valo

2016-01-27 21:56:10

by Peter Oh

[permalink] [raw]
Subject: Re: [PATCH 0/4] ath10k: rename mesh and add abstraction layer


On 01/27/2016 11:39 AM, Bob Copeland wrote:
> On Wed, Jan 27, 2016 at 10:55:53AM -0800, Peter Oh wrote:
>> Split Mesh service to 11s Mesh and non-11s Mesh according to
>> firmware service bit to help users distinguish 11s Mesh from
>> non 11s Mesh.
>> And add abstraction layer for vdev subtype to solve subtype mismatch
>> and to give flexible compatibility among different firmware revisions.
> Out of curiosity, which non-11s mesh, if you can share?
non-11s Mesh can be anything, but 11s Mesh such as meraki mesh.
>


2016-01-27 19:01:42

by Peter Oh

[permalink] [raw]
Subject: [PATCH 1/4] ath10k: rename Mesh related service names

WMI_10_4_SERVICE_MESH bit is for non IEEE802.11s Mesh.
Hence rename it to WMI_10_4_SERVICE_MESH_NON_11S.
Also add _11S as post-fix to each of WMI_SERVICE_MESH and
WMI_VDEV_SUBTYPE_MESH specifying the service is for 11s Mesh.
This will help users to distinguish 11s Mesh from non 11s Mesh.

Signed-off-by: Peter Oh <[email protected]>
---
drivers/net/wireless/ath/ath10k/mac.c | 4 ++--
drivers/net/wireless/ath/ath10k/wmi.h | 16 +++++++++-------
2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 6146a29..6bf5c91 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -4366,8 +4366,8 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
arvif->vdev_type = WMI_VDEV_TYPE_IBSS;
break;
case NL80211_IFTYPE_MESH_POINT:
- if (test_bit(WMI_SERVICE_MESH, ar->wmi.svc_map)) {
- arvif->vdev_subtype = WMI_VDEV_SUBTYPE_MESH;
+ if (test_bit(WMI_SERVICE_MESH_11S, ar->wmi.svc_map)) {
+ arvif->vdev_subtype = WMI_VDEV_SUBTYPE_MESH_11S;
} else if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags)) {
ret = -EINVAL;
ath10k_warn(ar, "must load driver with rawmode=1 to add mesh interfaces\n");
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index d85ad78..26a1bb9 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -176,7 +176,8 @@ enum wmi_service {
WMI_SERVICE_AUX_CHAN_LOAD_INTF,
WMI_SERVICE_BSS_CHANNEL_INFO_64,
WMI_SERVICE_EXT_RES_CFG_SUPPORT,
- WMI_SERVICE_MESH,
+ WMI_SERVICE_MESH_11S,
+ WMI_SERVICE_MESH_NON_11S,

/* keep last */
WMI_SERVICE_MAX,
@@ -294,7 +295,7 @@ enum wmi_10_4_service {
WMI_10_4_SERVICE_AUX_CHAN_LOAD_INTF,
WMI_10_4_SERVICE_BSS_CHANNEL_INFO_64,
WMI_10_4_SERVICE_EXT_RES_CFG_SUPPORT,
- WMI_10_4_SERVICE_MESH,
+ WMI_10_4_SERVICE_MESH_NON_11S,
};

static inline char *wmi_service_name(int service_id)
@@ -385,7 +386,8 @@ static inline char *wmi_service_name(int service_id)
SVCSTR(WMI_SERVICE_AUX_CHAN_LOAD_INTF);
SVCSTR(WMI_SERVICE_BSS_CHANNEL_INFO_64);
SVCSTR(WMI_SERVICE_EXT_RES_CFG_SUPPORT);
- SVCSTR(WMI_SERVICE_MESH);
+ SVCSTR(WMI_SERVICE_MESH_11S);
+ SVCSTR(WMI_SERVICE_MESH_NON_11S);
default:
return NULL;
}
@@ -460,7 +462,7 @@ static inline void wmi_10x_svc_map(const __le32 *in, unsigned long *out,
SVCMAP(WMI_10X_SERVICE_BSS_CHANNEL_INFO_64,
WMI_SERVICE_BSS_CHANNEL_INFO_64, len);
SVCMAP(WMI_10X_SERVICE_MESH,
- WMI_SERVICE_MESH, len);
+ WMI_SERVICE_MESH_11S, len);
SVCMAP(WMI_10X_SERVICE_EXT_RES_CFG_SUPPORT,
WMI_SERVICE_EXT_RES_CFG_SUPPORT, len);
}
@@ -623,8 +625,8 @@ static inline void wmi_10_4_svc_map(const __le32 *in, unsigned long *out,
WMI_SERVICE_BSS_CHANNEL_INFO_64, len);
SVCMAP(WMI_10_4_SERVICE_EXT_RES_CFG_SUPPORT,
WMI_SERVICE_EXT_RES_CFG_SUPPORT, len);
- SVCMAP(WMI_10_4_SERVICE_MESH,
- WMI_SERVICE_MESH, len);
+ SVCMAP(WMI_10_4_SERVICE_MESH_NON_11S,
+ WMI_SERVICE_MESH_NON_11S, len);
}

#undef SVCMAP
@@ -4275,7 +4277,7 @@ enum wmi_vdev_subtype {
WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
WMI_VDEV_SUBTYPE_P2P_GO = 3,
WMI_VDEV_SUBTYPE_PROXY_STA = 4,
- WMI_VDEV_SUBTYPE_MESH = 5,
+ WMI_VDEV_SUBTYPE_MESH_11S = 5,
};

/* values for vdev_subtype */
--
1.9.1


2016-01-27 18:58:56

by Peter Oh

[permalink] [raw]
Subject: [PATCH 3/4] ath10k: use vif->type and vif->p2p for P2P_GO check

Interface type P2P_GO can be checked by either arvif->vdev_type
and arvif->vdev_subtype or vif->type and vif->p2p.
Use later one to avoid more cpu consumption that could happen
when subtype abstraction layer change is introduced.

Signed-off-by: Peter Oh <[email protected]>
---
drivers/net/wireless/ath/ath10k/mac.c | 8 ++------
drivers/net/wireless/ath/ath10k/wmi.c | 2 +-
2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 6bf5c91..2940b00 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1358,10 +1358,7 @@ static int ath10k_mac_setup_bcn_p2p_ie(struct ath10k_vif *arvif,
const u8 *p2p_ie;
int ret;

- if (arvif->vdev_type != WMI_VDEV_TYPE_AP)
- return 0;
-
- if (arvif->vdev_subtype != WMI_VDEV_SUBTYPE_P2P_GO)
+ if (arvif->vif->type != NL80211_IFTYPE_AP || !arvif->vif->p2p)
return 0;

mgmt = (void *)bcn->data;
@@ -3259,8 +3256,7 @@ static void ath10k_tx_h_add_p2p_noa_ie(struct ath10k *ar,
struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);

/* This is case only for P2P_GO */
- if (arvif->vdev_type != WMI_VDEV_TYPE_AP ||
- arvif->vdev_subtype != WMI_VDEV_SUBTYPE_P2P_GO)
+ if (vif->type != NL80211_IFTYPE_AP || !vif->p2p)
return;

if (unlikely(ieee80211_is_probe_resp(hdr->frame_control))) {
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index a7c3d29..723fb9bc 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -3184,7 +3184,7 @@ static void ath10k_wmi_update_noa(struct ath10k *ar, struct ath10k_vif *arvif,
struct sk_buff *bcn,
const struct wmi_p2p_noa_info *noa)
{
- if (arvif->vdev_subtype != WMI_VDEV_SUBTYPE_P2P_GO)
+ if (!arvif->vif->p2p)
return;

ath10k_dbg(ar, ATH10K_DBG_MGMT, "noa changed: %d\n", noa->changed);
--
1.9.1


2016-01-27 21:47:27

by Peter Oh

[permalink] [raw]
Subject: Re: [PATCH 4/4] ath10k: add abstraction layer for vdev subtype


On 01/27/2016 11:11 AM, Ben Greear wrote:
> On 01/27/2016 10:55 AM, Peter Oh wrote:
>> Abstraction layer for vdev subtype is added to solve
>> subtype mismatch and to give flexible compatibility
>> among different firmware revisions.
>>
>> For instance, 10.2 and 10.4 firmware has different
>> definition of their vdev subtypes for Mesh.
>> 10.4 defined subtype 6 for 802.11s Mesh while 10.2 uses 5.
>> Hence use the abstraction API to get right subtype to use.
>>
>> Signed-off-by: Peter Oh <[email protected]>
>> ---
>> drivers/net/wireless/ath/ath10k/mac.c | 15 ++++---
>> drivers/net/wireless/ath/ath10k/wmi-ops.h | 11 +++++
>> drivers/net/wireless/ath/ath10k/wmi-tlv.c | 1 +
>> drivers/net/wireless/ath/ath10k/wmi.c | 70
> +++++++++++++++++++++++++++++++
>> drivers/net/wireless/ath/ath10k/wmi.h | 42 ++++++++++++++++---
>> 5 files changed, 128 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath10k/mac.c
> b/drivers/net/wireless/ath/ath10k/mac.c
>> index 2940b00..c9a39ab 100644
>> --- a/drivers/net/wireless/ath/ath10k/mac.c
>> +++ b/drivers/net/wireless/ath/ath10k/mac.c
>> @@ -4345,25 +4345,29 @@ static int ath10k_add_interface(struct
> ieee80211_hw *hw,
>> bit, ar->free_vdev_map);
>>
>> arvif->vdev_id = bit;
>> - arvif->vdev_subtype = WMI_VDEV_SUBTYPE_NONE;
>> + arvif->vdev_subtype =
>> + ath10k_wmi_get_vdev_subtype(ar, WMI_VDEV_SUBTYPE_NONE);
>>
>> switch (vif->type) {
>> case NL80211_IFTYPE_P2P_DEVICE:
>> arvif->vdev_type = WMI_VDEV_TYPE_STA;
>> - arvif->vdev_subtype = WMI_VDEV_SUBTYPE_P2P_DEVICE;
>> + arvif->vdev_subtype = ath10k_wmi_get_vdev_subtype
>> + (ar, WMI_VDEV_SUBTYPE_P2P_DEVICE);
>
> Would it maybe be simpler code to just assign these types to the ar
> struct
> at
> firmware init time. And then do something like:
>
> arvif->vdev_subtype = ar->p2p_subtype;
Maintaining a variable per subtype doesn't look good since a variable
can cover subtypes.
>
> Or even maybe:
>
> arvif->vdev_subtype = ar->subtype_for_viftype[vif->type];
if you take a look the abstraction layer, there is different index
indicating the same subtype.
In that case, your suggestion also needs to maintaining different array
per FW version which is the same amount of work as this patch.
>
> I'm not sure how much it matters, but in general I find the
> abstraction in
> ath10k makes it hard to read through the code.
It cannot help avoiding use it since ath10k supports different chipsets
and firmware IMO.
>
> Thanks,
> Ben
>


2016-01-27 18:58:56

by Peter Oh

[permalink] [raw]
Subject: [PATCH 4/4] ath10k: add abstraction layer for vdev subtype

Abstraction layer for vdev subtype is added to solve
subtype mismatch and to give flexible compatibility
among different firmware revisions.

For instance, 10.2 and 10.4 firmware has different
definition of their vdev subtypes for Mesh.
10.4 defined subtype 6 for 802.11s Mesh while 10.2 uses 5.
Hence use the abstraction API to get right subtype to use.

Signed-off-by: Peter Oh <[email protected]>
---
drivers/net/wireless/ath/ath10k/mac.c | 15 ++++---
drivers/net/wireless/ath/ath10k/wmi-ops.h | 11 +++++
drivers/net/wireless/ath/ath10k/wmi-tlv.c | 1 +
drivers/net/wireless/ath/ath10k/wmi.c | 70 +++++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath10k/wmi.h | 42 ++++++++++++++++---
5 files changed, 128 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 2940b00..c9a39ab 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -4345,25 +4345,29 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
bit, ar->free_vdev_map);

arvif->vdev_id = bit;
- arvif->vdev_subtype = WMI_VDEV_SUBTYPE_NONE;
+ arvif->vdev_subtype =
+ ath10k_wmi_get_vdev_subtype(ar, WMI_VDEV_SUBTYPE_NONE);

switch (vif->type) {
case NL80211_IFTYPE_P2P_DEVICE:
arvif->vdev_type = WMI_VDEV_TYPE_STA;
- arvif->vdev_subtype = WMI_VDEV_SUBTYPE_P2P_DEVICE;
+ arvif->vdev_subtype = ath10k_wmi_get_vdev_subtype
+ (ar, WMI_VDEV_SUBTYPE_P2P_DEVICE);
break;
case NL80211_IFTYPE_UNSPECIFIED:
case NL80211_IFTYPE_STATION:
arvif->vdev_type = WMI_VDEV_TYPE_STA;
if (vif->p2p)
- arvif->vdev_subtype = WMI_VDEV_SUBTYPE_P2P_CLIENT;
+ arvif->vdev_subtype = ath10k_wmi_get_vdev_subtype
+ (ar, WMI_VDEV_SUBTYPE_P2P_CLIENT);
break;
case NL80211_IFTYPE_ADHOC:
arvif->vdev_type = WMI_VDEV_TYPE_IBSS;
break;
case NL80211_IFTYPE_MESH_POINT:
if (test_bit(WMI_SERVICE_MESH_11S, ar->wmi.svc_map)) {
- arvif->vdev_subtype = WMI_VDEV_SUBTYPE_MESH_11S;
+ arvif->vdev_subtype = ath10k_wmi_get_vdev_subtype
+ (ar, WMI_VDEV_SUBTYPE_MESH_11S);
} else if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags)) {
ret = -EINVAL;
ath10k_warn(ar, "must load driver with rawmode=1 to add mesh interfaces\n");
@@ -4375,7 +4379,8 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
arvif->vdev_type = WMI_VDEV_TYPE_AP;

if (vif->p2p)
- arvif->vdev_subtype = WMI_VDEV_SUBTYPE_P2P_GO;
+ arvif->vdev_subtype = ath10k_wmi_get_vdev_subtype
+ (ar, WMI_VDEV_SUBTYPE_P2P_GO);
break;
case NL80211_IFTYPE_MONITOR:
arvif->vdev_type = WMI_VDEV_TYPE_MONITOR;
diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h
index 8f4f6a8..32ab34e 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
@@ -186,6 +186,8 @@ struct wmi_ops {
u8 enable,
u32 detect_level,
u32 detect_margin);
+ int (*get_vdev_subtype)(struct ath10k *ar,
+ enum wmi_vdev_subtype subtype);
};

int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -1327,4 +1329,13 @@ ath10k_wmi_pdev_enable_adaptive_cca(struct ath10k *ar, u8 enable,
ar->wmi.cmd->pdev_enable_adaptive_cca_cmdid);
}

+static inline int
+ath10k_wmi_get_vdev_subtype(struct ath10k *ar, enum wmi_vdev_subtype subtype)
+{
+ if (!ar->wmi.ops->get_vdev_subtype)
+ return -EOPNOTSUPP;
+
+ return ar->wmi.ops->get_vdev_subtype(ar, subtype);
+}
+
#endif
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 3b3a27b..1085932 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -3483,6 +3483,7 @@ static const struct wmi_ops wmi_tlv_ops = {
.gen_tdls_peer_update = ath10k_wmi_tlv_op_gen_tdls_peer_update,
.gen_adaptive_qcs = ath10k_wmi_tlv_op_gen_adaptive_qcs,
.fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
+ .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
};

static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = {
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 723fb9bc..f14b9e5 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -7351,6 +7351,71 @@ unlock:
buf[len] = 0;
}

+int ath10k_wmi_op_get_vdev_subtype(struct ath10k *ar,
+ enum wmi_vdev_subtype subtype)
+{
+ switch (subtype) {
+ case WMI_VDEV_SUBTYPE_NONE:
+ return WMI_VDEV_SUBTYPE_LEGACY_NONE;
+ case WMI_VDEV_SUBTYPE_P2P_DEVICE:
+ return WMI_VDEV_SUBTYPE_LEGACY_P2P_DEV;
+ case WMI_VDEV_SUBTYPE_P2P_CLIENT:
+ return WMI_VDEV_SUBTYPE_LEGACY_P2P_CLI;
+ case WMI_VDEV_SUBTYPE_P2P_GO:
+ return WMI_VDEV_SUBTYPE_LEGACY_P2P_GO;
+ case WMI_VDEV_SUBTYPE_PROXY_STA:
+ return WMI_VDEV_SUBTYPE_LEGACY_PROXY_STA;
+ case WMI_VDEV_SUBTYPE_MESH_11S:
+ case WMI_VDEV_SUBTYPE_MESH_NON_11S:
+ return -ENOTSUPP;
+ }
+ return -ENOTSUPP;
+}
+
+static int ath10k_wmi_10_2_4_op_get_vdev_subtype(struct ath10k *ar,
+ enum wmi_vdev_subtype subtype)
+{
+ switch (subtype) {
+ case WMI_VDEV_SUBTYPE_NONE:
+ return WMI_VDEV_SUBTYPE_10_2_4_NONE;
+ case WMI_VDEV_SUBTYPE_P2P_DEVICE:
+ return WMI_VDEV_SUBTYPE_10_2_4_P2P_DEV;
+ case WMI_VDEV_SUBTYPE_P2P_CLIENT:
+ return WMI_VDEV_SUBTYPE_10_2_4_P2P_CLI;
+ case WMI_VDEV_SUBTYPE_P2P_GO:
+ return WMI_VDEV_SUBTYPE_10_2_4_P2P_GO;
+ case WMI_VDEV_SUBTYPE_PROXY_STA:
+ return WMI_VDEV_SUBTYPE_10_2_4_PROXY_STA;
+ case WMI_VDEV_SUBTYPE_MESH_11S:
+ return WMI_VDEV_SUBTYPE_10_2_4_MESH_11S;
+ case WMI_VDEV_SUBTYPE_MESH_NON_11S:
+ return -ENOTSUPP;
+ }
+ return -ENOTSUPP;
+}
+
+static int ath10k_wmi_10_4_op_get_vdev_subtype(struct ath10k *ar,
+ enum wmi_vdev_subtype subtype)
+{
+ switch (subtype) {
+ case WMI_VDEV_SUBTYPE_NONE:
+ return WMI_VDEV_SUBTYPE_10_4_NONE;
+ case WMI_VDEV_SUBTYPE_P2P_DEVICE:
+ return WMI_VDEV_SUBTYPE_10_4_P2P_DEV;
+ case WMI_VDEV_SUBTYPE_P2P_CLIENT:
+ return WMI_VDEV_SUBTYPE_10_4_P2P_CLI;
+ case WMI_VDEV_SUBTYPE_P2P_GO:
+ return WMI_VDEV_SUBTYPE_10_4_P2P_GO;
+ case WMI_VDEV_SUBTYPE_PROXY_STA:
+ return WMI_VDEV_SUBTYPE_10_4_PROXY_STA;
+ case WMI_VDEV_SUBTYPE_MESH_11S:
+ return WMI_VDEV_SUBTYPE_10_4_MESH_11S;
+ case WMI_VDEV_SUBTYPE_MESH_NON_11S:
+ return WMI_VDEV_SUBTYPE_10_4_MESH_NON_11S;
+ }
+ return -ENOTSUPP;
+}
+
static const struct wmi_ops wmi_ops = {
.rx = ath10k_wmi_op_rx,
.map_svc = wmi_main_svc_map,
@@ -7410,6 +7475,7 @@ static const struct wmi_ops wmi_ops = {
.gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
.gen_delba_send = ath10k_wmi_op_gen_delba_send,
.fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
+ .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
@@ -7477,6 +7543,7 @@ static const struct wmi_ops wmi_10_1_ops = {
.gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
.gen_delba_send = ath10k_wmi_op_gen_delba_send,
.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
+ .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
@@ -7545,6 +7612,7 @@ static const struct wmi_ops wmi_10_2_ops = {
.gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
.gen_delba_send = ath10k_wmi_op_gen_delba_send,
.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
+ .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
/* .gen_pdev_enable_adaptive_cca not implemented */
};

@@ -7611,6 +7679,7 @@ static const struct wmi_ops wmi_10_2_4_ops = {
.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
.gen_pdev_enable_adaptive_cca =
ath10k_wmi_op_gen_pdev_enable_adaptive_cca,
+ .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype,
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
@@ -7677,6 +7746,7 @@ static const struct wmi_ops wmi_10_4_ops = {
/* shared with 10.2 */
.gen_request_stats = ath10k_wmi_op_gen_request_stats,
.gen_pdev_get_temperature = ath10k_wmi_10_2_op_gen_pdev_get_temperature,
+ .get_vdev_subtype = ath10k_wmi_10_4_op_get_vdev_subtype,
};

int ath10k_wmi_attach(struct ath10k *ar)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 90b6581..68be0b7 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -4285,12 +4285,40 @@ enum wmi_vdev_type {
};

enum wmi_vdev_subtype {
- WMI_VDEV_SUBTYPE_NONE = 0,
- WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
- WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
- WMI_VDEV_SUBTYPE_P2P_GO = 3,
- WMI_VDEV_SUBTYPE_PROXY_STA = 4,
- WMI_VDEV_SUBTYPE_MESH_11S = 5,
+ WMI_VDEV_SUBTYPE_NONE,
+ WMI_VDEV_SUBTYPE_P2P_DEVICE,
+ WMI_VDEV_SUBTYPE_P2P_CLIENT,
+ WMI_VDEV_SUBTYPE_P2P_GO,
+ WMI_VDEV_SUBTYPE_PROXY_STA,
+ WMI_VDEV_SUBTYPE_MESH_11S,
+ WMI_VDEV_SUBTYPE_MESH_NON_11S,
+};
+
+enum wmi_vdev_subtype_legacy {
+ WMI_VDEV_SUBTYPE_LEGACY_NONE = 0,
+ WMI_VDEV_SUBTYPE_LEGACY_P2P_DEV = 1,
+ WMI_VDEV_SUBTYPE_LEGACY_P2P_CLI = 2,
+ WMI_VDEV_SUBTYPE_LEGACY_P2P_GO = 3,
+ WMI_VDEV_SUBTYPE_LEGACY_PROXY_STA = 4,
+};
+
+enum wmi_vdev_subtype_10_2_4 {
+ WMI_VDEV_SUBTYPE_10_2_4_NONE = 0,
+ WMI_VDEV_SUBTYPE_10_2_4_P2P_DEV = 1,
+ WMI_VDEV_SUBTYPE_10_2_4_P2P_CLI = 2,
+ WMI_VDEV_SUBTYPE_10_2_4_P2P_GO = 3,
+ WMI_VDEV_SUBTYPE_10_2_4_PROXY_STA = 4,
+ WMI_VDEV_SUBTYPE_10_2_4_MESH_11S = 5,
+};
+
+enum wmi_vdev_subtype_10_4 {
+ WMI_VDEV_SUBTYPE_10_4_NONE = 0,
+ WMI_VDEV_SUBTYPE_10_4_P2P_DEV = 1,
+ WMI_VDEV_SUBTYPE_10_4_P2P_CLI = 2,
+ WMI_VDEV_SUBTYPE_10_4_P2P_GO = 3,
+ WMI_VDEV_SUBTYPE_10_4_PROXY_STA = 4,
+ WMI_VDEV_SUBTYPE_10_4_MESH_NON_11S = 5,
+ WMI_VDEV_SUBTYPE_10_4_MESH_11S = 6,
};

/* values for vdev_subtype */
@@ -6451,5 +6479,7 @@ size_t ath10k_wmi_fw_stats_num_vdevs(struct list_head *head);
void ath10k_wmi_10_4_op_fw_stats_fill(struct ath10k *ar,
struct ath10k_fw_stats *fw_stats,
char *buf);
+int ath10k_wmi_op_get_vdev_subtype(struct ath10k *ar,
+ enum wmi_vdev_subtype subtype);

#endif /* _WMI_H_ */
--
1.9.1


2016-01-28 02:04:41

by Chun-Yeow Yeoh

[permalink] [raw]
Subject: Re: [PATCH 0/4] ath10k: rename mesh and add abstraction layer

On Thu, Jan 28, 2016 at 5:53 AM, Peter Oh <[email protected]> wrote:
>
> On 01/27/2016 11:39 AM, Bob Copeland wrote:
>>
>> On Wed, Jan 27, 2016 at 10:55:53AM -0800, Peter Oh wrote:
>>>
>>> Split Mesh service to 11s Mesh and non-11s Mesh according to
>>> firmware service bit to help users distinguish 11s Mesh from
>>> non 11s Mesh.
>>> And add abstraction layer for vdev subtype to solve subtype mismatch
>>> and to give flexible compatibility among different firmware revisions.
>>
>> Out of curiosity, which non-11s mesh, if you can share?
>
> non-11s Mesh can be anything, but 11s Mesh such as meraki mesh.
>

I thought that non-11s mesh is for meraki mesh since it is not 802.11s
implementation.

WMI_10_4_SERVICE_MESH_NON_11S for non IEEE802.11s Mesh
WMI_SERVICE_MESH_11S and WMI_VDEV_SUBTYPE_MESH for IEEE 802.11s Mesh

Correct me if I am wrong.

Thanks

----
Chun-Yeow

2016-01-27 18:58:52

by Peter Oh

[permalink] [raw]
Subject: [PATCH 2/4] ath10k: update 10.4 WMI service map

Update 10.4 WMI service map to sync to the latest 10.4 firmware
as of 1/20/2016.

Signed-off-by: Peter Oh <[email protected]>
---
drivers/net/wireless/ath/ath10k/wmi.h | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 26a1bb9..90b6581 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -178,6 +178,8 @@ enum wmi_service {
WMI_SERVICE_EXT_RES_CFG_SUPPORT,
WMI_SERVICE_MESH_11S,
WMI_SERVICE_MESH_NON_11S,
+ WMI_SERVICE_RESTRT_CHNL_SUPPORT,
+ WMI_SERVICE_PEER_STATS,

/* keep last */
WMI_SERVICE_MAX,
@@ -296,6 +298,9 @@ enum wmi_10_4_service {
WMI_10_4_SERVICE_BSS_CHANNEL_INFO_64,
WMI_10_4_SERVICE_EXT_RES_CFG_SUPPORT,
WMI_10_4_SERVICE_MESH_NON_11S,
+ WMI_10_4_SERVICE_RESTRT_CHNL_SUPPORT,
+ WMI_10_4_SERVICE_PEER_STATS,
+ WMI_10_4_SERVICE_MESH_11S,
};

static inline char *wmi_service_name(int service_id)
@@ -388,6 +393,8 @@ static inline char *wmi_service_name(int service_id)
SVCSTR(WMI_SERVICE_EXT_RES_CFG_SUPPORT);
SVCSTR(WMI_SERVICE_MESH_11S);
SVCSTR(WMI_SERVICE_MESH_NON_11S);
+ SVCSTR(WMI_SERVICE_RESTRT_CHNL_SUPPORT);
+ SVCSTR(WMI_SERVICE_PEER_STATS);
default:
return NULL;
}
@@ -627,6 +634,12 @@ static inline void wmi_10_4_svc_map(const __le32 *in, unsigned long *out,
WMI_SERVICE_EXT_RES_CFG_SUPPORT, len);
SVCMAP(WMI_10_4_SERVICE_MESH_NON_11S,
WMI_SERVICE_MESH_NON_11S, len);
+ SVCMAP(WMI_10_4_SERVICE_RESTRT_CHNL_SUPPORT,
+ WMI_SERVICE_RESTRT_CHNL_SUPPORT, len);
+ SVCMAP(WMI_10_4_SERVICE_PEER_STATS,
+ WMI_SERVICE_PEER_STATS, len);
+ SVCMAP(WMI_10_4_SERVICE_MESH_11S,
+ WMI_SERVICE_MESH_11S, len);
}

#undef SVCMAP
--
1.9.1


2016-01-27 19:40:03

by Bob Copeland

[permalink] [raw]
Subject: Re: [PATCH 0/4] ath10k: rename mesh and add abstraction layer

On Wed, Jan 27, 2016 at 10:55:53AM -0800, Peter Oh wrote:
> Split Mesh service to 11s Mesh and non-11s Mesh according to
> firmware service bit to help users distinguish 11s Mesh from
> non 11s Mesh.
> And add abstraction layer for vdev subtype to solve subtype mismatch
> and to give flexible compatibility among different firmware revisions.

Out of curiosity, which non-11s mesh, if you can share?

--
Bob Copeland %% http://bobcopeland.com/