Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e965dcc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wil6210: fix wiphy registration sequence"

parents decfc20e 0a3185fc
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -1502,14 +1502,8 @@ struct wireless_dev *wil_cfg80211_init(struct device *dev)
	set_wiphy_dev(wdev->wiphy, dev);
	wil_wiphy_init(wdev->wiphy);

	rc = wiphy_register(wdev->wiphy);
	if (rc < 0)
		goto out_failed_reg;

	return wdev;

out_failed_reg:
	wiphy_free(wdev->wiphy);
out:
	kfree(wdev);

@@ -1525,7 +1519,6 @@ void wil_wdev_free(struct wil6210_priv *wil)
	if (!wdev)
		return;

	wiphy_unregister(wdev->wiphy);
	wiphy_free(wdev->wiphy);
	kfree(wdev);
}
+3 −0
Original line number Diff line number Diff line
@@ -232,6 +232,9 @@ static void _wil6210_disconnect(struct wil6210_priv *wil, const u8 *bssid,
	struct net_device *ndev = wil_to_ndev(wil);
	struct wireless_dev *wdev = wil->wdev;

	if (unlikely(!ndev))
		return;

	might_sleep();
	wil_info(wil, "%s(bssid=%pM, reason=%d, ev%s)\n", __func__, bssid,
		 reason_code, from_event ? "+" : "-");
+23 −9
Original line number Diff line number Diff line
@@ -184,13 +184,6 @@ void *wil_if_alloc(struct device *dev)
	SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
	wdev->netdev = ndev;

	netif_napi_add(ndev, &wil->napi_rx, wil6210_netdev_poll_rx,
		       WIL6210_NAPI_BUDGET);
	netif_napi_add(ndev, &wil->napi_tx, wil6210_netdev_poll_tx,
		       WIL6210_NAPI_BUDGET);

	netif_tx_stop_all_queues(ndev);

	return wil;

 out_priv:
@@ -221,25 +214,46 @@ void wil_if_free(struct wil6210_priv *wil)

int wil_if_add(struct wil6210_priv *wil)
{
	struct wireless_dev *wdev = wil_to_wdev(wil);
	struct wiphy *wiphy = wdev->wiphy;
	struct net_device *ndev = wil_to_ndev(wil);
	int rc;

	wil_dbg_misc(wil, "%s()\n", __func__);
	wil_dbg_misc(wil, "entered");

	rc = wiphy_register(wiphy);
	if (rc < 0) {
		wil_err(wil, "failed to register wiphy, err %d\n", rc);
		return rc;
	}

	netif_napi_add(ndev, &wil->napi_rx, wil6210_netdev_poll_rx,
		       WIL6210_NAPI_BUDGET);
	netif_napi_add(ndev, &wil->napi_tx, wil6210_netdev_poll_tx,
		       WIL6210_NAPI_BUDGET);

	netif_tx_stop_all_queues(ndev);

	rc = register_netdev(ndev);
	if (rc < 0) {
		dev_err(&ndev->dev, "Failed to register netdev: %d\n", rc);
		return rc;
		goto out_wiphy;
	}

	return 0;

out_wiphy:
	wiphy_unregister(wdev->wiphy);
	return rc;
}

void wil_if_remove(struct wil6210_priv *wil)
{
	struct net_device *ndev = wil_to_ndev(wil);
	struct wireless_dev *wdev = wil_to_wdev(wil);

	wil_dbg_misc(wil, "%s()\n", __func__);

	unregister_netdev(ndev);
	wiphy_unregister(wdev->wiphy);
}