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

Commit 46f3b6ee authored by Arend van Spriel's avatar Arend van Spriel Committed by Kalle Valo
Browse files

brcmfmac: use brcmf_get_ifp() to map ifidx to struct brcmf_if instance



The knowledge on how to map the interface index to a struct brcmf_if
instance is in brcmf_get_ifp() so use that function when only the
interface index is known instead of accessing brcmf_pub::iflist
directly.

Reviewed-by: default avatarHante Meuleman <meuleman@broadcom.com>
Reviewed-by: default avatarFranky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent ddddfed2
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -149,7 +149,7 @@ static s32 brcmf_btcoex_params_read(struct brcmf_if *ifp, u32 addr, u32 *data)
static void brcmf_btcoex_boost_wifi(struct brcmf_btcoex_info *btci,
static void brcmf_btcoex_boost_wifi(struct brcmf_btcoex_info *btci,
				    bool trump_sco)
				    bool trump_sco)
{
{
	struct brcmf_if *ifp = btci->cfg->pub->iflist[0];
	struct brcmf_if *ifp = brcmf_get_ifp(btci->cfg->pub, 0);


	if (trump_sco && !btci->saved_regs_part2) {
	if (trump_sco && !btci->saved_regs_part2) {
		/* this should reduce eSCO agressive
		/* this should reduce eSCO agressive
@@ -468,7 +468,7 @@ int brcmf_btcoex_set_mode(struct brcmf_cfg80211_vif *vif,
{
{
	struct brcmf_cfg80211_info *cfg = wiphy_priv(vif->wdev.wiphy);
	struct brcmf_cfg80211_info *cfg = wiphy_priv(vif->wdev.wiphy);
	struct brcmf_btcoex_info *btci = cfg->btcoex;
	struct brcmf_btcoex_info *btci = cfg->btcoex;
	struct brcmf_if *ifp = cfg->pub->iflist[0];
	struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);


	switch (mode) {
	switch (mode) {
	case BRCMF_BTCOEX_DISABLED:
	case BRCMF_BTCOEX_DISABLED:
+1 −1
Original line number Original line Diff line number Diff line
@@ -6213,7 +6213,7 @@ static void brcmf_free_wiphy(struct wiphy *wiphy)
struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
						  struct device *busdev)
						  struct device *busdev)
{
{
	struct net_device *ndev = drvr->iflist[0]->ndev;
	struct net_device *ndev = brcmf_get_ifp(drvr, 0)->ndev;
	struct brcmf_cfg80211_info *cfg;
	struct brcmf_cfg80211_info *cfg;
	struct wiphy *wiphy;
	struct wiphy *wiphy;
	struct brcmf_cfg80211_vif *vif;
	struct brcmf_cfg80211_vif *vif;
+1 −1
Original line number Original line Diff line number Diff line
@@ -121,7 +121,7 @@ static void brcmf_feat_iovar_int_set(struct brcmf_if *ifp,


void brcmf_feat_attach(struct brcmf_pub *drvr)
void brcmf_feat_attach(struct brcmf_pub *drvr)
{
{
	struct brcmf_if *ifp = drvr->iflist[0];
	struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);


	brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_MCHAN, "mchan");
	brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_MCHAN, "mchan");
	brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_PNO, "pfn");
	brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_PNO, "pfn");
+1 −1
Original line number Original line Diff line number Diff line
@@ -221,7 +221,7 @@ static void brcmf_flowring_block(struct brcmf_flowring *flow, u8 flowid,


	bus_if = dev_get_drvdata(flow->dev);
	bus_if = dev_get_drvdata(flow->dev);
	drvr = bus_if->drvr;
	drvr = bus_if->drvr;
	ifp = drvr->iflist[ifidx];
	ifp = brcmf_get_ifp(drvr, ifidx);
	brcmf_txflowblock_if(ifp, BRCMF_NETIF_STOP_REASON_FLOW, blocked);
	brcmf_txflowblock_if(ifp, BRCMF_NETIF_STOP_REASON_FLOW, blocked);


	spin_unlock_irqrestore(&flow->block_lock, flags);
	spin_unlock_irqrestore(&flow->block_lock, flags);
+1 −1
Original line number Original line Diff line number Diff line
@@ -334,7 +334,7 @@ void brcmf_fweh_attach(struct brcmf_pub *drvr)
void brcmf_fweh_detach(struct brcmf_pub *drvr)
void brcmf_fweh_detach(struct brcmf_pub *drvr)
{
{
	struct brcmf_fweh_info *fweh = &drvr->fweh;
	struct brcmf_fweh_info *fweh = &drvr->fweh;
	struct brcmf_if *ifp = drvr->iflist[0];
	struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
	s8 eventmask[BRCMF_EVENTING_MASK_LEN];
	s8 eventmask[BRCMF_EVENTING_MASK_LEN];


	if (ifp) {
	if (ifp) {
Loading