mwifiex: fix for p2p broken link
This patch fixes following issues in p2p code paths. 1) bss role, bss type and connection type was not set correctly for p2p GO and p2p client at couple of places. 2) Driver appends a proprietary header to management frames which will be parsed by our firmware. Later while informing TX status to cfg80211, modified frame buffer was passed to cfg80211_mgmt_tx_status() instead of original one. Signed-off-by: Aniket Nagarnaik <aniketn@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
e60ac9c7a4
commit
ae86c587b5
@ -831,10 +831,13 @@ mwifiex_init_new_priv_params(struct mwifiex_private *priv,
|
||||
priv->bss_type = MWIFIEX_BSS_TYPE_STA;
|
||||
break;
|
||||
case NL80211_IFTYPE_P2P_CLIENT:
|
||||
case NL80211_IFTYPE_P2P_GO:
|
||||
priv->bss_role = MWIFIEX_BSS_ROLE_STA;
|
||||
priv->bss_type = MWIFIEX_BSS_TYPE_P2P;
|
||||
break;
|
||||
case NL80211_IFTYPE_P2P_GO:
|
||||
priv->bss_role = MWIFIEX_BSS_ROLE_UAP;
|
||||
priv->bss_type = MWIFIEX_BSS_TYPE_P2P;
|
||||
break;
|
||||
case NL80211_IFTYPE_AP:
|
||||
priv->bss_type = MWIFIEX_BSS_TYPE_UAP;
|
||||
priv->bss_role = MWIFIEX_BSS_ROLE_UAP;
|
||||
|
@ -1997,10 +1997,12 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
|
||||
if (priv->bss_mode == NL80211_IFTYPE_ADHOC)
|
||||
cmd_ptr->params.bss_mode.con_type =
|
||||
CONNECTION_TYPE_ADHOC;
|
||||
else if (priv->bss_mode == NL80211_IFTYPE_STATION)
|
||||
else if (priv->bss_mode == NL80211_IFTYPE_STATION ||
|
||||
priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT)
|
||||
cmd_ptr->params.bss_mode.con_type =
|
||||
CONNECTION_TYPE_INFRA;
|
||||
else if (priv->bss_mode == NL80211_IFTYPE_AP)
|
||||
else if (priv->bss_mode == NL80211_IFTYPE_AP ||
|
||||
priv->bss_mode == NL80211_IFTYPE_P2P_GO)
|
||||
cmd_ptr->params.bss_mode.con_type = CONNECTION_TYPE_AP;
|
||||
cmd_ptr->size = cpu_to_le16(sizeof(struct
|
||||
host_cmd_ds_set_bss_mode) + S_DS_GEN);
|
||||
|
@ -370,8 +370,28 @@ void mwifiex_parse_tx_status_event(struct mwifiex_private *priv,
|
||||
/* consumes ack_skb */
|
||||
skb_complete_wifi_ack(ack_skb, !tx_status->status);
|
||||
} else {
|
||||
/* Remove broadcast address which was added by driver */
|
||||
memmove(ack_skb->data +
|
||||
sizeof(struct ieee80211_hdr_3addr) +
|
||||
MWIFIEX_MGMT_FRAME_HEADER_SIZE + sizeof(u16),
|
||||
ack_skb->data +
|
||||
sizeof(struct ieee80211_hdr_3addr) +
|
||||
MWIFIEX_MGMT_FRAME_HEADER_SIZE + sizeof(u16) +
|
||||
ETH_ALEN, ack_skb->len -
|
||||
(sizeof(struct ieee80211_hdr_3addr) +
|
||||
MWIFIEX_MGMT_FRAME_HEADER_SIZE + sizeof(u16) +
|
||||
ETH_ALEN));
|
||||
ack_skb->len = ack_skb->len - ETH_ALEN;
|
||||
/* Remove driver's proprietary header including 2 bytes
|
||||
* of packet length and pass actual management frame buffer
|
||||
* to cfg80211.
|
||||
*/
|
||||
cfg80211_mgmt_tx_status(&priv->wdev, tx_info->cookie,
|
||||
ack_skb->data, ack_skb->len,
|
||||
ack_skb->data +
|
||||
MWIFIEX_MGMT_FRAME_HEADER_SIZE +
|
||||
sizeof(u16), ack_skb->len -
|
||||
(MWIFIEX_MGMT_FRAME_HEADER_SIZE
|
||||
+ sizeof(u16)),
|
||||
!tx_status->status, GFP_ATOMIC);
|
||||
dev_kfree_skb_any(ack_skb);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user