summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/marvell/libertas_tf/main.c
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-02-20 13:58:38 +0300
committerKalle Valo <kvalo@codeaurora.org>2019-02-20 20:55:53 +0300
commitbe9d0d3fe1392cefd710a96101250d76d42f632c (patch)
treee8c06239d1d543e47b605ccb797530ddc06f9fb8 /drivers/net/wireless/marvell/libertas_tf/main.c
parente0a8ef4d7b4315bc4c1641fb3f3a7dfdfa6627b8 (diff)
downloadlinux-be9d0d3fe1392cefd710a96101250d76d42f632c.tar.xz
libertas_tf: move hardware callbacks to a separate structure
We'll need to talk to the firmware to get a hardware address before device is registered with ieee80211 subsystem at the end of lbtf_add_card(). Hooking the callbacks after that is too late. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell/libertas_tf/main.c')
-rw-r--r--drivers/net/wireless/marvell/libertas_tf/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/wireless/marvell/libertas_tf/main.c b/drivers/net/wireless/marvell/libertas_tf/main.c
index f048b57043c6..a9c04ca75ccc 100644
--- a/drivers/net/wireless/marvell/libertas_tf/main.c
+++ b/drivers/net/wireless/marvell/libertas_tf/main.c
@@ -281,7 +281,7 @@ static void lbtf_tx_work(struct work_struct *work)
BUG_ON(priv->tx_skb);
spin_lock_irq(&priv->driver_lock);
priv->tx_skb = skb;
- err = priv->hw_host_to_card(priv, MVMS_DAT, skb->data, skb->len);
+ err = priv->ops->hw_host_to_card(priv, MVMS_DAT, skb->data, skb->len);
spin_unlock_irq(&priv->driver_lock);
if (err) {
dev_kfree_skb_any(skb);
@@ -301,7 +301,7 @@ static int lbtf_op_start(struct ieee80211_hw *hw)
if (!priv->fw_ready)
/* Upload firmware */
- if (priv->hw_prog_firmware(card))
+ if (priv->ops->hw_prog_firmware(card))
goto err_prog_firmware;
/* poke the firmware */
@@ -322,7 +322,7 @@ static int lbtf_op_start(struct ieee80211_hw *hw)
return 0;
err_prog_firmware:
- priv->hw_reset_device(card);
+ priv->ops->hw_reset_device(card);
lbtf_deb_leave_args(LBTF_DEB_MACOPS, "error programming fw; ret=%d", ret);
return ret;
}
@@ -603,7 +603,8 @@ EXPORT_SYMBOL_GPL(lbtf_rx);
*
* Returns: pointer to struct lbtf_priv.
*/
-struct lbtf_private *lbtf_add_card(void *card, struct device *dmdev)
+struct lbtf_private *lbtf_add_card(void *card, struct device *dmdev,
+ const struct lbtf_ops *ops)
{
struct ieee80211_hw *hw;
struct lbtf_private *priv = NULL;
@@ -620,6 +621,7 @@ struct lbtf_private *lbtf_add_card(void *card, struct device *dmdev)
priv->hw = hw;
priv->card = card;
+ priv->ops = ops;
priv->tx_skb = NULL;
hw->queues = 1;