Commit be69c4ef authored by Roland Vossen's avatar Roland Vossen Committed by John W. Linville

brcm80211: smac: removed redundant timer function parameters

Parameter 'wl' is already stored in struct brcms_timer, so the number of
function parameters could be decreased.
Reviewed-by: default avatarAlwin Beukers <alwin@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 55182e4a
......@@ -1478,12 +1478,12 @@ struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
*
* precondition: perimeter lock has been acquired
*/
void brcms_add_timer(struct brcms_info *wl, struct brcms_timer *t, uint ms,
void brcms_add_timer(struct brcms_timer *t, uint ms,
int periodic)
{
#ifdef BCMDBG
if (t->set)
wiphy_err(wl->wiphy, "%s: Already set. Name: %s, per %d\n",
wiphy_err(t->wl->wiphy, "%s: Already set. Name: %s, per %d\n",
__func__, t->name, periodic);
#endif
......@@ -1492,7 +1492,7 @@ void brcms_add_timer(struct brcms_info *wl, struct brcms_timer *t, uint ms,
t->set = true;
t->timer.expires = jiffies + ms * HZ / 1000;
atomic_inc(&wl->callbacks);
atomic_inc(&t->wl->callbacks);
add_timer(&t->timer);
}
......@@ -1501,14 +1501,14 @@ void brcms_add_timer(struct brcms_info *wl, struct brcms_timer *t, uint ms,
*
* precondition: perimeter lock has been acquired
*/
bool brcms_del_timer(struct brcms_info *wl, struct brcms_timer *t)
bool brcms_del_timer(struct brcms_timer *t)
{
if (t->set) {
t->set = false;
if (!del_timer(&t->timer))
return false;
atomic_dec(&wl->callbacks);
atomic_dec(&t->wl->callbacks);
}
return true;
......@@ -1517,12 +1517,13 @@ bool brcms_del_timer(struct brcms_info *wl, struct brcms_timer *t)
/*
* precondition: perimeter lock has been acquired
*/
void brcms_free_timer(struct brcms_info *wl, struct brcms_timer *t)
void brcms_free_timer(struct brcms_timer *t)
{
struct brcms_info *wl = t->wl;
struct brcms_timer *tmp;
/* delete the timer in case it is active */
brcms_del_timer(wl, t);
brcms_del_timer(t);
if (wl->timers == t) {
wl->timers = wl->timers->next;
......
......@@ -96,10 +96,9 @@ extern bool brcms_rfkill_set_hw_state(struct brcms_info *wl);
extern struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
void (*fn) (void *arg), void *arg,
const char *name);
extern void brcms_free_timer(struct brcms_info *wl, struct brcms_timer *timer);
extern void brcms_add_timer(struct brcms_info *wl, struct brcms_timer *timer,
uint ms, int periodic);
extern bool brcms_del_timer(struct brcms_info *wl, struct brcms_timer *timer);
extern void brcms_free_timer(struct brcms_timer *timer);
extern void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic);
extern bool brcms_del_timer(struct brcms_timer *timer);
extern void brcms_msleep(struct brcms_info *wl, uint ms);
extern void brcms_dpc(unsigned long data);
extern void brcms_timer(struct brcms_timer *t);
......
......@@ -4236,8 +4236,7 @@ static void brcms_c_radio_monitor_start(struct brcms_c_info *wlc)
wlc->radio_monitor = true;
brcms_b_pllreq(wlc->hw, true, BRCMS_PLLREQ_RADIO_MON);
brcms_add_timer(wlc->wl, wlc->radio_timer, TIMER_INTERVAL_RADIOCHK,
true);
brcms_add_timer(wlc->radio_timer, TIMER_INTERVAL_RADIOCHK, true);
}
void brcms_c_radio_disable(struct brcms_c_info *wlc)
......@@ -4269,7 +4268,7 @@ bool brcms_c_radio_monitor_stop(struct brcms_c_info *wlc)
wlc->radio_monitor = false;
brcms_b_pllreq(wlc->hw, false, BRCMS_PLLREQ_RADIO_MON);
return brcms_del_timer(wlc->wl, wlc->radio_timer);
return brcms_del_timer(wlc->radio_timer);
}
/* read hwdisable state and propagate to wlc flag */
......@@ -5221,11 +5220,11 @@ static void brcms_c_timers_deinit(struct brcms_c_info *wlc)
{
/* free timer state */
if (wlc->wdtimer) {
brcms_free_timer(wlc->wl, wlc->wdtimer);
brcms_free_timer(wlc->wdtimer);
wlc->wdtimer = NULL;
}
if (wlc->radio_timer) {
brcms_free_timer(wlc->wl, wlc->radio_timer);
brcms_free_timer(wlc->radio_timer);
wlc->radio_timer = NULL;
}
}
......@@ -5607,7 +5606,7 @@ int brcms_c_up(struct brcms_c_info *wlc)
brcms_c_wme_retries_write(wlc);
/* start one second watchdog timer */
brcms_add_timer(wlc->wl, wlc->wdtimer, TIMER_INTERVAL_WATCHDOG, true);
brcms_add_timer(wlc->wdtimer, TIMER_INTERVAL_WATCHDOG, true);
wlc->WDarmed = true;
/* ensure antenna config is up to date */
......@@ -5736,7 +5735,7 @@ uint brcms_c_down(struct brcms_c_info *wlc)
/* cancel the watchdog timer */
if (wlc->WDarmed) {
if (!brcms_del_timer(wlc->wl, wlc->wdtimer))
if (!brcms_del_timer(wlc->wdtimer))
callbacks++;
wlc->WDarmed = false;
}
......
......@@ -442,7 +442,7 @@ static void wlc_phy_timercb_phycal(struct brcms_phy *pi)
wlc_phy_cal_perical_mphase_restart(pi);
} else
wlc_phy_cal_perical_nphy_run(pi, PHY_PERICAL_AUTO);
wlapi_add_timer(pi->sh->physhim, pi->phycal_timer, delay, 0);
wlapi_add_timer(pi->phycal_timer, delay, 0);
return;
}
......@@ -625,7 +625,7 @@ void wlc_phy_detach(struct brcms_phy_pub *pih)
return;
if (pi->phycal_timer) {
wlapi_free_timer(pi->sh->physhim, pi->phycal_timer);
wlapi_free_timer(pi->phycal_timer);
pi->phycal_timer = NULL;
}
......@@ -852,7 +852,7 @@ int wlc_phy_down(struct brcms_phy_pub *pih)
int callbacks = 0;
if (pi->phycal_timer
&& !wlapi_del_timer(pi->sh->physhim, pi->phycal_timer))
&& !wlapi_del_timer(pi->phycal_timer))
callbacks++;
pi->nphy_iqcal_chanspec_2G = 0;
......@@ -2715,7 +2715,7 @@ wlc_phy_papd_decode_epsilon(u32 epsilon, s32 *eps_real, s32 *eps_imag)
void wlc_phy_cal_perical_mphase_reset(struct brcms_phy *pi)
{
wlapi_del_timer(pi->sh->physhim, pi->phycal_timer);
wlapi_del_timer(pi->phycal_timer);
pi->cal_type_override = PHY_PERICAL_AUTO;
pi->mphase_cal_phase_id = MPHASE_CAL_STATE_IDLE;
......@@ -2730,10 +2730,10 @@ wlc_phy_cal_perical_mphase_schedule(struct brcms_phy *pi, uint delay)
(pi->nphy_perical != PHY_PERICAL_MANUAL))
return;
wlapi_del_timer(pi->sh->physhim, pi->phycal_timer);
wlapi_del_timer(pi->phycal_timer);
pi->mphase_cal_phase_id = MPHASE_CAL_STATE_INIT;
wlapi_add_timer(pi->sh->physhim, pi->phycal_timer, delay, 0);
wlapi_add_timer(pi->phycal_timer, delay, 0);
}
void wlc_phy_cal_perical(struct brcms_phy_pub *pih, u8 reason)
......
......@@ -65,21 +65,20 @@ struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
arg, name);
}
void wlapi_free_timer(struct phy_shim_info *physhim, struct wlapi_timer *t)
void wlapi_free_timer(struct wlapi_timer *t)
{
brcms_free_timer(physhim->wl, (struct brcms_timer *)t);
brcms_free_timer((struct brcms_timer *)t);
}
void
wlapi_add_timer(struct phy_shim_info *physhim, struct wlapi_timer *t, uint ms,
int periodic)
wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic)
{
brcms_add_timer(physhim->wl, (struct brcms_timer *)t, ms, periodic);
brcms_add_timer((struct brcms_timer *)t, ms, periodic);
}
bool wlapi_del_timer(struct phy_shim_info *physhim, struct wlapi_timer *t)
bool wlapi_del_timer(struct wlapi_timer *t)
{
return brcms_del_timer(physhim->wl, (struct brcms_timer *)t);
return brcms_del_timer((struct brcms_timer *)t);
}
void wlapi_intrson(struct phy_shim_info *physhim)
......
......@@ -133,12 +133,9 @@ extern void wlc_phy_shim_detach(struct phy_shim_info *physhim);
extern struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
void (*fn) (struct brcms_phy *pi),
void *arg, const char *name);
extern void wlapi_free_timer(struct phy_shim_info *physhim,
struct wlapi_timer *t);
extern void wlapi_add_timer(struct phy_shim_info *physhim,
struct wlapi_timer *t, uint ms, int periodic);
extern bool wlapi_del_timer(struct phy_shim_info *physhim,
struct wlapi_timer *t);
extern void wlapi_free_timer(struct wlapi_timer *t);
extern void wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic);
extern bool wlapi_del_timer(struct wlapi_timer *t);
extern void wlapi_intrson(struct phy_shim_info *physhim);
extern u32 wlapi_intrsoff(struct phy_shim_info *physhim);
extern void wlapi_intrsrestore(struct phy_shim_info *physhim,
......
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