lkml.org 
[lkml]   [2021]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.15 205/917] mwifiex: Properly initialize private structure on interface type changes
    Date
    From: Jonas Dreßler <verdre@v0yd.nl>

    [ Upstream commit c606008b70627a2fc485732a53cc22f0f66d0981 ]

    When creating a new virtual interface in mwifiex_add_virtual_intf(), we
    update our internal driver states like bss_type, bss_priority, bss_role
    and bss_mode to reflect the mode the firmware will be set to.

    When switching virtual interface mode using
    mwifiex_init_new_priv_params() though, we currently only update bss_mode
    and bss_role. In order for the interface mode switch to actually work,
    we also need to update bss_type to its proper value, so do that.

    This fixes a crash of the firmware (because the driver tries to execute
    commands that are invalid in AP mode) when switching from station mode
    to AP mode.

    Signed-off-by: Jonas Dreßler <verdre@v0yd.nl>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210914195909.36035-9-verdre@v0yd.nl
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/net/wireless/marvell/mwifiex/cfg80211.c | 10 +++++++---
    1 file changed, 7 insertions(+), 3 deletions(-)

    diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
    index 93eb5f109949f..97f0f39364d67 100644
    --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
    +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
    @@ -908,16 +908,20 @@ mwifiex_init_new_priv_params(struct mwifiex_private *priv,
    switch (type) {
    case NL80211_IFTYPE_STATION:
    case NL80211_IFTYPE_ADHOC:
    - priv->bss_role = MWIFIEX_BSS_ROLE_STA;
    + priv->bss_role = MWIFIEX_BSS_ROLE_STA;
    + priv->bss_type = MWIFIEX_BSS_TYPE_STA;
    break;
    case NL80211_IFTYPE_P2P_CLIENT:
    - priv->bss_role = MWIFIEX_BSS_ROLE_STA;
    + 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_role = MWIFIEX_BSS_ROLE_UAP;
    + priv->bss_type = MWIFIEX_BSS_TYPE_P2P;
    break;
    case NL80211_IFTYPE_AP:
    priv->bss_role = MWIFIEX_BSS_ROLE_UAP;
    + priv->bss_type = MWIFIEX_BSS_TYPE_UAP;
    break;
    default:
    mwifiex_dbg(adapter, ERROR,
    --
    2.33.0


    \
     
     \ /
      Last update: 2021-11-16 02:11    [W:4.022 / U:0.236 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site