Commit 08c2eb8e authored by Kees Cook's avatar Kees Cook Committed by Kalle Valo
Browse files

mwifiex: Convert timers to use timer_setup()



In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Amitkumar Karwar <amitkarwar@gmail.com>
Cc: Nishant Sarmukadam <nishants@marvell.com>
Cc: Ganapathi Bhat <gbhat@marvell.com>
Cc: Xinming Hu <huxm@marvell.com>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Johannes Berg <johannes.berg@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andrew Zaborowski <andrew.zaborowski@intel.com>
Cc: libertas-dev@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent dfefb9f8
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -312,10 +312,10 @@ mwifiex_11n_find_last_seq_num(struct reorder_tmr_cnxt *ctx)
 * them and then dumps the Rx reordering table.
 */
static void
mwifiex_flush_data(unsigned long context)
mwifiex_flush_data(struct timer_list *t)
{
	struct reorder_tmr_cnxt *ctx =
		(struct reorder_tmr_cnxt *) context;
		from_timer(ctx, t, timer);
	int start_win, seq_num;

	ctx->timer_is_set = false;
@@ -412,8 +412,7 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
	new_node->timer_context.priv = priv;
	new_node->timer_context.timer_is_set = false;

	setup_timer(&new_node->timer_context.timer, mwifiex_flush_data,
		    (unsigned long)&new_node->timer_context);
	timer_setup(&new_node->timer_context.timer, mwifiex_flush_data, 0);

	for (i = 0; i < win_size; ++i)
		new_node->rx_reorder_ptr[i] = NULL;
+2 −3
Original line number Diff line number Diff line
@@ -920,10 +920,9 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
 * It will re-send the same command again.
 */
void
mwifiex_cmd_timeout_func(unsigned long function_context)
mwifiex_cmd_timeout_func(struct timer_list *t)
{
	struct mwifiex_adapter *adapter =
		(struct mwifiex_adapter *) function_context;
	struct mwifiex_adapter *adapter = from_timer(adapter, t, cmd_timer);
	struct cmd_ctrl_node *cmd_node;

	adapter->is_cmd_timedout = 1;
+3 −4
Original line number Diff line number Diff line
@@ -52,9 +52,9 @@ static int mwifiex_add_bss_prio_tbl(struct mwifiex_private *priv)
	return 0;
}

static void wakeup_timer_fn(unsigned long data)
static void wakeup_timer_fn(struct timer_list *t)
{
	struct mwifiex_adapter *adapter = (struct mwifiex_adapter *)data;
	struct mwifiex_adapter *adapter = from_timer(adapter, t, wakeup_timer);

	mwifiex_dbg(adapter, ERROR, "Firmware wakeup failed\n");
	adapter->hw_status = MWIFIEX_HW_STATUS_RESET;
@@ -313,8 +313,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
	adapter->iface_limit.uap_intf = MWIFIEX_MAX_UAP_NUM;
	adapter->iface_limit.p2p_intf = MWIFIEX_MAX_P2P_NUM;
	adapter->active_scan_triggered = false;
	setup_timer(&adapter->wakeup_timer, wakeup_timer_fn,
		    (unsigned long)adapter);
	timer_setup(&adapter->wakeup_timer, wakeup_timer_fn, 0);
}

/*
+1 −2
Original line number Diff line number Diff line
@@ -100,8 +100,7 @@ static int mwifiex_register(void *card, struct device *dev,
	}
	mwifiex_init_lock_list(adapter);

	setup_timer(&adapter->cmd_timer, mwifiex_cmd_timeout_func,
		    (unsigned long)adapter);
	timer_setup(&adapter->cmd_timer, mwifiex_cmd_timeout_func, 0);

	return 0;

+2 −2
Original line number Diff line number Diff line
@@ -1072,7 +1072,7 @@ int mwifiex_complete_cmd(struct mwifiex_adapter *adapter,
int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no,
		     u16 cmd_action, u32 cmd_oid, void *data_buf, bool sync);

void mwifiex_cmd_timeout_func(unsigned long function_context);
void mwifiex_cmd_timeout_func(struct timer_list *t);

int mwifiex_get_debug_info(struct mwifiex_private *,
			   struct mwifiex_debug_info *);
@@ -1617,7 +1617,7 @@ void mwifiex_auto_tdls_update_peer_status(struct mwifiex_private *priv,
					  const u8 *mac, u8 link_status);
void mwifiex_auto_tdls_update_peer_signal(struct mwifiex_private *priv,
					  u8 *mac, s8 snr, s8 nflr);
void mwifiex_check_auto_tdls(unsigned long context);
void mwifiex_check_auto_tdls(struct timer_list *t);
void mwifiex_add_auto_tdls_peer(struct mwifiex_private *priv, const u8 *mac);
void mwifiex_setup_auto_tdls_timer(struct mwifiex_private *priv);
void mwifiex_clean_auto_tdls(struct mwifiex_private *priv);
Loading