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

Commit 96bc1f2a authored by Kees Cook's avatar Kees Cook Committed by Greg Kroah-Hartman
Browse files

staging: rtl8192e: 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Derek Robson <robsonde@gmail.com>
Cc: Suniel Mahesh <suniel.spartan@gmail.com>
Cc: Malcolm Priestley <tvboxspy@gmail.com>
Cc: Gargi Sharma <gs051095@gmail.com>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Johannes Berg <johannes.berg@intel.com>
Cc: Yamanappagouda Patil <goudapatilk@gmail.com>
Cc: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>
Cc: Colin Ian King <colin.king@canonical.com>
Cc: Baoyou Xie <baoyou.xie@linaro.org>
Cc: devel@driverdev.osuosl.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Derek Robson <robsonde@gmail.com>
Cc: Suniel Mahesh <suniel.spartan@gmail.com>
Cc: Malcolm Priestley <tvboxspy@gmail.com>
Cc: Gargi Sharma <gs051095@gmail.com>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Yamanappagouda Patil <goudapatilk@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Johannes Berg <johannes.berg@intel.com>
Cc: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>
Cc: Colin Ian King <colin.king@canonical.com>
Cc: Baoyou Xie <baoyou.xie@linaro.org>
Cc: devel@driverdev.osuosl.org
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d2e5af14
Loading
Loading
Loading
Loading
+11 −14
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ static struct pci_driver rtl8192_pci_driver = {

static short _rtl92e_is_tx_queue_empty(struct net_device *dev);
static void _rtl92e_watchdog_wq_cb(void *data);
static void _rtl92e_watchdog_timer_cb(unsigned long data);
static void _rtl92e_watchdog_timer_cb(struct timer_list *t);
static void _rtl92e_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
				   int rate);
static int _rtl92e_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);
@@ -766,12 +766,12 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset)
	priv->bfirst_init = false;

	if (priv->polling_timer_on == 0)
		rtl92e_check_rfctrl_gpio_timer((unsigned long)dev);
		rtl92e_check_rfctrl_gpio_timer(&priv->gpio_polling_timer);

	if (priv->rtllib->state != RTLLIB_LINKED)
		rtllib_softmac_start_protocol(priv->rtllib, 0);
	rtllib_reset_queue(priv->rtllib);
	_rtl92e_watchdog_timer_cb((unsigned long)dev);
	_rtl92e_watchdog_timer_cb(&priv->watch_dog_timer);

	if (!netif_queue_stopped(dev))
		netif_start_queue(dev);
@@ -1075,13 +1075,10 @@ static short _rtl92e_init(struct net_device *dev)

	rtl92e_dm_init(dev);

	setup_timer(&priv->watch_dog_timer,
		    _rtl92e_watchdog_timer_cb,
		    (unsigned long)dev);
	timer_setup(&priv->watch_dog_timer, _rtl92e_watchdog_timer_cb, 0);

	setup_timer(&priv->gpio_polling_timer,
		    rtl92e_check_rfctrl_gpio_timer,
		    (unsigned long)dev);
	timer_setup(&priv->gpio_polling_timer, rtl92e_check_rfctrl_gpio_timer,
		    0);

	rtl92e_irq_disable(dev);
	if (request_irq(dev->irq, _rtl92e_irq, IRQF_SHARED, dev->name, dev)) {
@@ -1531,9 +1528,9 @@ static void _rtl92e_watchdog_wq_cb(void *data)
	RT_TRACE(COMP_TRACE, " <==RtUsbCheckForHangWorkItemCallback()\n");
}

static void _rtl92e_watchdog_timer_cb(unsigned long data)
static void _rtl92e_watchdog_timer_cb(struct timer_list *t)
{
	struct r8192_priv *priv = rtllib_priv((struct net_device *)data);
	struct r8192_priv *priv = from_timer(priv, t, watch_dog_timer);

	schedule_delayed_work(&priv->watch_dog_wq, 0);
	mod_timer(&priv->watch_dog_timer, jiffies +
@@ -2535,7 +2532,7 @@ static int _rtl92e_pci_probe(struct pci_dev *pdev,
	RT_TRACE(COMP_INIT, "dev name: %s\n", dev->name);

	if (priv->polling_timer_on == 0)
		rtl92e_check_rfctrl_gpio_timer((unsigned long)dev);
		rtl92e_check_rfctrl_gpio_timer(&priv->gpio_polling_timer);

	RT_TRACE(COMP_INIT, "Driver probe completed\n");
	return 0;
@@ -2648,9 +2645,9 @@ bool rtl92e_disable_nic(struct net_device *dev)

module_pci_driver(rtl8192_pci_driver);

void rtl92e_check_rfctrl_gpio_timer(unsigned long data)
void rtl92e_check_rfctrl_gpio_timer(struct timer_list *t)
{
	struct r8192_priv *priv = rtllib_priv((struct net_device *)data);
	struct r8192_priv *priv = from_timer(priv, t, gpio_polling_timer);

	priv->polling_timer_on = 1;

+1 −1
Original line number Diff line number Diff line
@@ -587,7 +587,7 @@ void rtl92e_tx_enable(struct net_device *);
void rtl92e_hw_sleep_wq(void *data);
void rtl92e_commit(struct net_device *dev);

void rtl92e_check_rfctrl_gpio_timer(unsigned long data);
void rtl92e_check_rfctrl_gpio_timer(struct timer_list *t);

void rtl92e_hw_wakeup_wq(void *data);

+5 −6
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@ static void _rtl92e_dm_check_txrateandretrycount(struct net_device *dev);
static  void _rtl92e_dm_check_ac_dc_power(struct net_device *dev);
static void _rtl92e_dm_check_fsync(struct net_device *dev);
static void _rtl92e_dm_check_rf_ctrl_gpio(void *data);
static void _rtl92e_dm_fsync_timer_callback(unsigned long data);
static void _rtl92e_dm_fsync_timer_callback(struct timer_list *t);

/*---------------------Define local function prototype-----------------------*/

@@ -2125,8 +2125,7 @@ static void _rtl92e_dm_init_fsync(struct net_device *dev)
	priv->rtllib->fsync_state = Default_Fsync;
	priv->framesyncMonitor = 1;

	setup_timer(&priv->fsync_timer, _rtl92e_dm_fsync_timer_callback,
		    (unsigned long)dev);
	timer_setup(&priv->fsync_timer, _rtl92e_dm_fsync_timer_callback, 0);
}


@@ -2137,10 +2136,10 @@ static void _rtl92e_dm_deinit_fsync(struct net_device *dev)
	del_timer_sync(&priv->fsync_timer);
}

static void _rtl92e_dm_fsync_timer_callback(unsigned long data)
static void _rtl92e_dm_fsync_timer_callback(struct timer_list *t)
{
	struct net_device *dev = (struct net_device *)data;
	struct r8192_priv *priv = rtllib_priv((struct net_device *)data);
	struct r8192_priv *priv = from_timer(priv, t, fsync_timer);
	struct net_device *dev = priv->rtllib->dev;
	u32 rate_index, rate_count = 0, rate_count_diff = 0;
	bool		bSwitchFromCountDiff = false;
	bool		bDoubleTimeInterval = false;
+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ int rtl92e_resume(struct pci_dev *pdev)
	pci_enable_wake(pdev, PCI_D0, 0);

	if (priv->polling_timer_on == 0)
		rtl92e_check_rfctrl_gpio_timer((unsigned long)dev);
		rtl92e_check_rfctrl_gpio_timer(&priv->gpio_polling_timer);

	if (!netif_running(dev)) {
		netdev_info(dev,
+9 −6
Original line number Diff line number Diff line
@@ -528,18 +528,20 @@ void TsInitDelBA(struct rtllib_device *ieee,
	}
}

void BaSetupTimeOut(unsigned long data)
void BaSetupTimeOut(struct timer_list *t)
{
	struct tx_ts_record *pTxTs = (struct tx_ts_record *)data;
	struct tx_ts_record *pTxTs = from_timer(pTxTs, t,
					      TxPendingBARecord.Timer);

	pTxTs->bAddBaReqInProgress = false;
	pTxTs->bAddBaReqDelayed = true;
	pTxTs->TxPendingBARecord.bValid = false;
}

void TxBaInactTimeout(unsigned long data)
void TxBaInactTimeout(struct timer_list *t)
{
	struct tx_ts_record *pTxTs = (struct tx_ts_record *)data;
	struct tx_ts_record *pTxTs = from_timer(pTxTs, t,
					      TxAdmittedBARecord.Timer);
	struct rtllib_device *ieee = container_of(pTxTs, struct rtllib_device,
				     TxTsRecord[pTxTs->num]);
	TxTsDeleteBA(ieee, pTxTs);
@@ -548,9 +550,10 @@ void TxBaInactTimeout(unsigned long data)
			  DELBA_REASON_TIMEOUT);
}

void RxBaInactTimeout(unsigned long data)
void RxBaInactTimeout(struct timer_list *t)
{
	struct rx_ts_record *pRxTs = (struct rx_ts_record *)data;
	struct rx_ts_record *pRxTs = from_timer(pRxTs, t,
					      RxAdmittedBARecord.Timer);
	struct rtllib_device *ieee = container_of(pRxTs, struct rtllib_device,
				     RxTsRecord[pRxTs->num]);

Loading