]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
iwlwifi: pcie: reset the NIC before the bring up
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 24 Jul 2013 07:19:06 +0000 (10:19 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 26 Jul 2013 08:05:25 +0000 (10:05 +0200)
This allows to clean all kinds of bad state it might be in.
This solves situation where HW RFkill was switched while
the NIC was offline.
Until now, we relied on the firmware to do clean the
interrupt, but new firmwares don't do that any more.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/pcie/trans.c

index 826c15602c469a524b857c135f7b38cb4e5782a1..96cfcdd390794060ee6c72c3951984f33da5ff38 100644 (file)
@@ -670,6 +670,11 @@ static int iwl_trans_pcie_start_hw(struct iwl_trans *trans)
                return err;
        }
 
+       /* Reset the entire device */
+       iwl_set_bit(trans, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
+
+       usleep_range(10, 15);
+
        iwl_pcie_apm_init(trans);
 
        /* From now on, the op_mode will be kept updated about RF kill state */