Commit 8750ab62 authored by Xinming Hu's avatar Xinming Hu Committed by Kalle Valo

mwifiex: get rid of mwifiex_do_flr wrapper

This patch gets rid of mwifiex_do_flr. We will call
mwifiex_shutdown_sw() and mwifiex_reinit_sw() directly.
These two general purpose functions will be useful for
sdio card reset handler.
Signed-off-by: default avatarXinming Hu <huxm@marvell.com>
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent c0e6aa42
...@@ -1348,7 +1348,7 @@ static void mwifiex_main_work_queue(struct work_struct *work) ...@@ -1348,7 +1348,7 @@ static void mwifiex_main_work_queue(struct work_struct *work)
* This function gets called during PCIe function level reset. Required * This function gets called during PCIe function level reset. Required
* code is extracted from mwifiex_remove_card() * code is extracted from mwifiex_remove_card()
*/ */
static int int
mwifiex_shutdown_sw(struct mwifiex_adapter *adapter) mwifiex_shutdown_sw(struct mwifiex_adapter *adapter)
{ {
struct mwifiex_private *priv; struct mwifiex_private *priv;
...@@ -1417,13 +1417,13 @@ mwifiex_shutdown_sw(struct mwifiex_adapter *adapter) ...@@ -1417,13 +1417,13 @@ mwifiex_shutdown_sw(struct mwifiex_adapter *adapter)
exit_return: exit_return:
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(mwifiex_shutdown_sw);
/* This function gets called during PCIe function level reset. Required /* This function gets called during PCIe function level reset. Required
* code is extracted from mwifiex_add_card() * code is extracted from mwifiex_add_card()
*/ */
static int int
mwifiex_reinit_sw(struct mwifiex_adapter *adapter, struct completion *fw_done, mwifiex_reinit_sw(struct mwifiex_adapter *adapter)
struct mwifiex_if_ops *if_ops, u8 iface_type)
{ {
char fw_name[32]; char fw_name[32];
struct pcie_service_card *card = adapter->card; struct pcie_service_card *card = adapter->card;
...@@ -1432,9 +1432,6 @@ mwifiex_reinit_sw(struct mwifiex_adapter *adapter, struct completion *fw_done, ...@@ -1432,9 +1432,6 @@ mwifiex_reinit_sw(struct mwifiex_adapter *adapter, struct completion *fw_done,
if (adapter->if_ops.up_dev) if (adapter->if_ops.up_dev)
adapter->if_ops.up_dev(adapter); adapter->if_ops.up_dev(adapter);
adapter->iface_type = iface_type;
adapter->fw_done = fw_done;
adapter->hw_status = MWIFIEX_HW_STATUS_INITIALIZING; adapter->hw_status = MWIFIEX_HW_STATUS_INITIALIZING;
adapter->surprise_removed = false; adapter->surprise_removed = false;
init_waitqueue_head(&adapter->init_wait_q); init_waitqueue_head(&adapter->init_wait_q);
...@@ -1507,25 +1504,7 @@ mwifiex_reinit_sw(struct mwifiex_adapter *adapter, struct completion *fw_done, ...@@ -1507,25 +1504,7 @@ mwifiex_reinit_sw(struct mwifiex_adapter *adapter, struct completion *fw_done,
return -1; return -1;
} }
EXPORT_SYMBOL_GPL(mwifiex_reinit_sw);
/* This function processes pre and post PCIe function level resets.
* It performs software cleanup without touching PCIe specific code.
* Also, during initialization PCIe stuff is skipped.
*/
void mwifiex_do_flr(struct mwifiex_adapter *adapter, bool prepare)
{
struct mwifiex_if_ops if_ops;
if (!prepare) {
mwifiex_reinit_sw(adapter, adapter->fw_done, &if_ops,
adapter->iface_type);
} else {
memcpy(&if_ops, &adapter->if_ops,
sizeof(struct mwifiex_if_ops));
mwifiex_shutdown_sw(adapter);
}
}
EXPORT_SYMBOL_GPL(mwifiex_do_flr);
static irqreturn_t mwifiex_irq_wakeup_handler(int irq, void *priv) static irqreturn_t mwifiex_irq_wakeup_handler(int irq, void *priv)
{ {
......
...@@ -1666,5 +1666,6 @@ void mwifiex_debugfs_remove(void); ...@@ -1666,5 +1666,6 @@ void mwifiex_debugfs_remove(void);
void mwifiex_dev_debugfs_init(struct mwifiex_private *priv); void mwifiex_dev_debugfs_init(struct mwifiex_private *priv);
void mwifiex_dev_debugfs_remove(struct mwifiex_private *priv); void mwifiex_dev_debugfs_remove(struct mwifiex_private *priv);
#endif #endif
void mwifiex_do_flr(struct mwifiex_adapter *adapter, bool prepare); int mwifiex_reinit_sw(struct mwifiex_adapter *adapter);
int mwifiex_shutdown_sw(struct mwifiex_adapter *adapter);
#endif /* !_MWIFIEX_MAIN_H_ */ #endif /* !_MWIFIEX_MAIN_H_ */
...@@ -375,7 +375,7 @@ static void mwifiex_pcie_reset_notify(struct pci_dev *pdev, bool prepare) ...@@ -375,7 +375,7 @@ static void mwifiex_pcie_reset_notify(struct pci_dev *pdev, bool prepare)
* Cleanup all software without cleaning anything related to * Cleanup all software without cleaning anything related to
* PCIe and HW. * PCIe and HW.
*/ */
mwifiex_do_flr(adapter, prepare); mwifiex_shutdown_sw(adapter);
adapter->surprise_removed = true; adapter->surprise_removed = true;
} else { } else {
/* Kernel stores and restores PCIe function context before and /* Kernel stores and restores PCIe function context before and
...@@ -383,7 +383,7 @@ static void mwifiex_pcie_reset_notify(struct pci_dev *pdev, bool prepare) ...@@ -383,7 +383,7 @@ static void mwifiex_pcie_reset_notify(struct pci_dev *pdev, bool prepare)
* and firmware including firmware redownload * and firmware including firmware redownload
*/ */
adapter->surprise_removed = false; adapter->surprise_removed = false;
mwifiex_do_flr(adapter, prepare); mwifiex_reinit_sw(adapter);
} }
mwifiex_dbg(adapter, INFO, "%s, successful\n", __func__); mwifiex_dbg(adapter, INFO, "%s, successful\n", __func__);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment