Commit 40a23296 authored by Hante Meuleman's avatar Hante Meuleman Committed by John W. Linville

brcmfmac: Update init code routines from interface up.

On interface up dongle gets inialized. Move UP command to common
routine and update these common init routines using ifp.
Reviewed-by: default avatarArend Van Spriel <arend@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarHante Meuleman <meuleman@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 88d1239a
...@@ -585,14 +585,9 @@ static int brcmf_netdev_open(struct net_device *ndev) ...@@ -585,14 +585,9 @@ static int brcmf_netdev_open(struct net_device *ndev)
/* Get current TOE mode from dongle */ /* Get current TOE mode from dongle */
if (brcmf_fil_iovar_int_get(ifp, "toe_ol", &toe_ol) >= 0 if (brcmf_fil_iovar_int_get(ifp, "toe_ol", &toe_ol) >= 0
&& (toe_ol & TOE_TX_CSUM_OL) != 0) && (toe_ol & TOE_TX_CSUM_OL) != 0)
drvr->iflist[ifp->idx]->ndev->features |= ndev->features |= NETIF_F_IP_CSUM;
NETIF_F_IP_CSUM;
else else
drvr->iflist[ifp->idx]->ndev->features &= ndev->features &= ~NETIF_F_IP_CSUM;
~NETIF_F_IP_CSUM;
/* make sure RF is ready for work */
brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 0);
/* Allow transmit calls */ /* Allow transmit calls */
netif_start_queue(ndev); netif_start_queue(ndev);
......
...@@ -4265,9 +4265,8 @@ void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg) ...@@ -4265,9 +4265,8 @@ void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg)
} }
static s32 static s32
brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout) brcmf_dongle_roam(struct brcmf_if *ifp, u32 roamvar, u32 bcn_timeout)
{ {
struct brcmf_if *ifp = netdev_priv(ndev);
s32 err = 0; s32 err = 0;
__le32 roamtrigger[2]; __le32 roamtrigger[2];
__le32 roam_delta[2]; __le32 roam_delta[2];
...@@ -4318,10 +4317,9 @@ brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout) ...@@ -4318,10 +4317,9 @@ brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
} }
static s32 static s32
brcmf_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time, brcmf_dongle_scantime(struct brcmf_if *ifp, s32 scan_assoc_time,
s32 scan_unassoc_time, s32 scan_passive_time) s32 scan_unassoc_time, s32 scan_passive_time)
{ {
struct brcmf_if *ifp = netdev_priv(ndev);
s32 err = 0; s32 err = 0;
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME, err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME,
...@@ -4391,6 +4389,7 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) ...@@ -4391,6 +4389,7 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
{ {
struct net_device *ndev; struct net_device *ndev;
struct wireless_dev *wdev; struct wireless_dev *wdev;
struct brcmf_if *ifp;
s32 power_mode; s32 power_mode;
s32 err = 0; s32 err = 0;
...@@ -4399,35 +4398,34 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) ...@@ -4399,35 +4398,34 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
ndev = cfg_to_ndev(cfg); ndev = cfg_to_ndev(cfg);
wdev = ndev->ieee80211_ptr; wdev = ndev->ieee80211_ptr;
ifp = netdev_priv(ndev);
/* make sure RF is ready for work */
brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 0);
brcmf_dongle_scantime(ndev, WL_SCAN_CHANNEL_TIME, brcmf_dongle_scantime(ifp, WL_SCAN_CHANNEL_TIME,
WL_SCAN_UNASSOC_TIME, WL_SCAN_PASSIVE_TIME); WL_SCAN_UNASSOC_TIME, WL_SCAN_PASSIVE_TIME);
power_mode = cfg->pwr_save ? PM_FAST : PM_OFF; power_mode = cfg->pwr_save ? PM_FAST : PM_OFF;
err = brcmf_fil_cmd_int_set(netdev_priv(ndev), BRCMF_C_SET_PM, err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, power_mode);
power_mode);
if (err) if (err)
goto default_conf_out; goto default_conf_out;
brcmf_dbg(INFO, "power save set to %s\n", brcmf_dbg(INFO, "power save set to %s\n",
(power_mode ? "enabled" : "disabled")); (power_mode ? "enabled" : "disabled"));
err = brcmf_dongle_roam(ndev, (cfg->roam_on ? 0 : 1), err = brcmf_dongle_roam(ifp, (cfg->roam_on ? 0 : 1), WL_BEACON_TIMEOUT);
WL_BEACON_TIMEOUT);
if (err) if (err)
goto default_conf_out; goto default_conf_out;
err = brcmf_cfg80211_change_iface(wdev->wiphy, ndev, wdev->iftype, err = brcmf_cfg80211_change_iface(wdev->wiphy, ndev, wdev->iftype,
NULL, NULL); NULL, NULL);
if (err && err != -EINPROGRESS) if (err)
goto default_conf_out; goto default_conf_out;
err = brcmf_dongle_probecap(cfg); err = brcmf_dongle_probecap(cfg);
if (err) if (err)
goto default_conf_out; goto default_conf_out;
/* -EINPROGRESS: Call commit handler */
default_conf_out:
cfg->dongle_up = true; cfg->dongle_up = true;
default_conf_out:
return err; return err;
...@@ -4436,8 +4434,6 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) ...@@ -4436,8 +4434,6 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
static s32 __brcmf_cfg80211_up(struct brcmf_if *ifp) static s32 __brcmf_cfg80211_up(struct brcmf_if *ifp)
{ {
set_bit(BRCMF_VIF_STATUS_READY, &ifp->vif->sme_state); set_bit(BRCMF_VIF_STATUS_READY, &ifp->vif->sme_state);
if (ifp->idx)
return 0;
return brcmf_config_dongle(ifp->drvr->config); return brcmf_config_dongle(ifp->drvr->config);
} }
......
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