mwifiex: store permanant mac address in adapter structure
authorAvinash Patil <patila@marvell.com>
Wed, 28 Jan 2015 10:12:01 +0000 (15:42 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 29 Jan 2015 08:20:11 +0000 (10:20 +0200)
This would be used to set mac address while changing virtual
interface to different types.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mwifiex/cfg80211.c
drivers/net/wireless/mwifiex/cmdevt.c
drivers/net/wireless/mwifiex/init.c
drivers/net/wireless/mwifiex/main.c
drivers/net/wireless/mwifiex/main.h

index 9710b23f65a9920561f19c5d9580211cd6b740bf..85f5019306b50a183bf1d9c28051a7c0a4ae9585 100644 (file)
@@ -2974,7 +2974,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
        wiphy->cipher_suites = mwifiex_cipher_suites;
        wiphy->n_cipher_suites = ARRAY_SIZE(mwifiex_cipher_suites);
 
-       memcpy(wiphy->perm_addr, priv->curr_addr, ETH_ALEN);
+       ether_addr_copy(wiphy->perm_addr, adapter->perm_addr);
        wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
        wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME |
                        WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD |
index 946a2f7a172f36d6f1b3c8642f7a9371959955be..00586b22c61a4fe98f64f9e307de715448faccda 100644 (file)
@@ -1582,9 +1582,7 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
                le16_to_cpu(hw_spec->hw_if_version),
                le16_to_cpu(hw_spec->version));
 
-       if (priv->curr_addr[0] == 0xff)
-               memmove(priv->curr_addr, hw_spec->permanent_addr, ETH_ALEN);
-
+       ether_addr_copy(priv->adapter->perm_addr, hw_spec->permanent_addr);
        adapter->region_code = le16_to_cpu(hw_spec->region_code);
 
        for (i = 0; i < MWIFIEX_MAX_REGION_CODE; i++)
index 8004d140ee013bc5e9a483baec3f054dc3a75cd7..44babc329fda55a82e6ce021e3d0defe6a01aaf6 100644 (file)
@@ -297,6 +297,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
        adapter->ext_scan = false;
        adapter->key_api_major_ver = 0;
        adapter->key_api_minor_ver = 0;
+       memset(adapter->perm_addr, 0xff, ETH_ALEN);
 
        setup_timer(&adapter->wakeup_timer, wakeup_timer_fn,
                    (unsigned long)adapter);
index 49dec6b4dc9603d1e6726dd756f46ea9f488a541..cb9cab2b0ec0a2990e9f3774e736bb93e4c167a6 100644 (file)
@@ -975,6 +975,7 @@ void mwifiex_init_priv_params(struct mwifiex_private *priv,
        priv->assocresp_idx = MWIFIEX_AUTO_IDX_MASK;
        priv->rsn_idx = MWIFIEX_AUTO_IDX_MASK;
        priv->num_tx_timeout = 0;
+       ether_addr_copy(priv->curr_addr, priv->adapter->perm_addr);
        memcpy(dev->dev_addr, priv->curr_addr, ETH_ALEN);
 
        if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA ||
index a560179cdb7bd01d4227e434ea04fc32898fc19c..45b40af9797be5720b2c42f0bc95ddf6887e714d 100644 (file)
@@ -737,6 +737,7 @@ struct mwifiex_adapter {
        int winner;
        struct device *dev;
        struct wiphy *wiphy;
+       u8 perm_addr[ETH_ALEN];
        bool surprise_removed;
        u32 fw_release_number;
        u16 init_wait_q_woken;