SMP_RD_BARRIER_DEPENDS(); \
while (dhd_mmc_suspend && retry++ != b) { \
SMP_RD_BARRIER_DEPENDS(); \
- wait_event_interruptible_timeout(a, !dhd_mmc_suspend, HZ/100); \
+ wait_event_interruptible_timeout(a, !dhd_mmc_suspend, 1); \
} \
} while (0)
#define DHD_PM_RESUME_WAIT(a) _DHD_PM_RESUME_WAIT(a, 200)
#define SPINWAIT_SLEEP(a, exp, us) do { \
uint countdown = (us) + 9999; \
while ((exp) && (countdown >= 10000)) { \
- wait_event_interruptible_timeout(a, FALSE, HZ/100); \
+ wait_event_interruptible_timeout(a, FALSE, 1); \
countdown -= 10000; \
} \
} while (0)
__FUNCTION__));
btcx_inf->bt_state = BT_DHCP_OPPR_WIN;
mod_timer(&btcx_inf->timer,
- jiffies + BT_DHCP_OPPR_WIN_TIME*HZ/1000);
+ jiffies + msecs_to_jiffies(BT_DHCP_OPPR_WIN_TIME));
btcx_inf->timer_on = 1;
break;
wl_cfg80211_bt_setflag(btcx_inf->dev, TRUE);
btcx_inf->bt_state = BT_DHCP_FLAG_FORCE_TIMEOUT;
mod_timer(&btcx_inf->timer,
- jiffies + BT_DHCP_FLAG_FORCE_TIME*HZ/1000);
+ jiffies + msecs_to_jiffies(BT_DHCP_FLAG_FORCE_TIME));
btcx_inf->timer_on = 1;
break;
tmo->limit = usec;
tmo->increment = 0;
tmo->elapsed = 0;
- tmo->tick = 1000000 / HZ;
+ tmo->tick = jiffies_to_usecs(1);
}
int
/* Reschedule the watchdog */
if (dhd->wd_timer_valid)
mod_timer(&dhd->timer,
- jiffies + dhd_watchdog_ms * HZ / 1000);
+ jiffies + msecs_to_jiffies(dhd_watchdog_ms));
dhd_os_spin_unlock(&dhd->pub, flags);
}
dhd_os_sdunlock(&dhd->pub);
/* Reschedule the watchdog */
if (dhd->wd_timer_valid)
- mod_timer(&dhd->timer, jiffies + dhd_watchdog_ms * HZ / 1000);
+ mod_timer(&dhd->timer, jiffies + msecs_to_jiffies(dhd_watchdog_ms));
dhd_os_spin_unlock(&dhd->pub, flags);
dhd_os_sdunlock(&dhd->pub);
DHD_OS_WAKE_UNLOCK(&dhd->pub);
dhd_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition, bool *pending)
{
dhd_info_t * dhd = (dhd_info_t *)(pub->info);
- int timeout = dhd_ioctl_timeout_msec;
+ int timeout;
/* Convert timeout in millsecond to jiffies */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
- timeout = msecs_to_jiffies(timeout);
-#else
- timeout = timeout * HZ / 1000;
-#endif
+ timeout = msecs_to_jiffies(dhd_ioctl_timeout_msec);
timeout = wait_event_timeout(dhd->ioctl_resp_wait, (*condition), timeout);
return timeout;
if (wdtick) {
dhd_watchdog_ms = (uint)wdtick;
/* Re arm the timer, at last watchdog period */
- mod_timer(&dhd->timer, jiffies + dhd_watchdog_ms * HZ / 1000);
+ mod_timer(&dhd->timer, jiffies + msecs_to_jiffies(dhd_watchdog_ms));
dhd->wd_timer_valid = TRUE;
}
dhd_os_spin_unlock(pub, flags);
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0))
struct dhd_info *dhdinfo = dhd->info;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
int timeout = msecs_to_jiffies(2000);
-#else
- int timeout = 2 * HZ;
-#endif
dhd_os_sdunlock(dhd);
wait_event_timeout(dhdinfo->ctrl_wait, (*lockvar == FALSE), timeout);
dhd_os_sdlock(dhd);
dhd_wait_pend8021x(struct net_device *dev)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
- int timeout = 10 * HZ / 1000;
+ int timeout = msecs_to_jiffies(10);
int ntimes = MAX_WAIT_FOR_8021X_TX;
int pend = dhd_get_pend_8021x_cnt(dhd);
-#define OSL_SYSUPTIME() ((uint32)jiffies * (1000 / HZ))
+#define OSL_SYSUPTIME() ((uint32)jiffies_to_msecs(jiffies))
#define printf(fmt, args...) printk(fmt , ## args)
#include <linux/kernel.h>
#include <linux/string.h>
}
wl->iscan_kickstart = true;
wl_run_iscan(iscan, request, WL_SCAN_ACTION_START);
- mod_timer(&iscan->timer, jiffies + iscan->timer_ms * HZ / 1000);
+ mod_timer(&iscan->timer, jiffies + msecs_to_jiffies(iscan->timer_ms));
iscan->timer_on = 1;
return err;
}
/* Arm scan timeout timer */
- mod_timer(&wl->scan_timeout, jiffies + WL_SCAN_TIMER_INTERVAL_MS * HZ / 1000);
+ mod_timer(&wl->scan_timeout, jiffies + msecs_to_jiffies(WL_SCAN_TIMER_INTERVAL_MS));
iscan_req = false;
wl->scan_request = request;
if (request) { /* scan bss */
s32 err = 0;
/* Reschedule the timer */
- mod_timer(&iscan->timer, jiffies + iscan->timer_ms * HZ / 1000);
+ mod_timer(&iscan->timer, jiffies + msecs_to_jiffies(iscan->timer_ms));
iscan->timer_on = 1;
return err;
wl_run_iscan(iscan, NULL, WL_SCAN_ACTION_CONTINUE);
mutex_unlock(&wl->usr_sync);
/* Reschedule the timer */
- mod_timer(&iscan->timer, jiffies + iscan->timer_ms * HZ / 1000);
+ mod_timer(&iscan->timer, jiffies + msecs_to_jiffies(iscan->timer_ms));
iscan->timer_on = 1;
return err;
static void wl_delay(u32 ms)
{
- if (in_atomic() || ms < 1000 / HZ) {
+ if (in_atomic() || (ms < jiffies_to_msecs(1))) {
mdelay(ms);
} else {
msleep(ms);
#endif
-#define JF2MS ((((jiffies / HZ) * 1000) + ((jiffies % HZ) * 1000) / HZ))
+#define JF2MS jiffies_to_msecs(jiffies)
#ifdef COEX_DBG
#define WL_TRACE_COEX(x) printf("TS:%lu ", JF2MS); \
rtnl_unlock();
#endif
- mod_timer(&iscan->timer, jiffies + iscan->timer_ms*HZ/1000);
+ mod_timer(&iscan->timer, jiffies + msecs_to_jiffies(iscan->timer_ms));
iscan->timer_on = 1;
break;
case WL_SCAN_RESULTS_SUCCESS:
case WL_SCAN_RESULTS_PENDING:
WL_TRACE(("iscanresults pending\n"));
- mod_timer(&iscan->timer, jiffies + iscan->timer_ms*HZ/1000);
+ mod_timer(&iscan->timer, jiffies + msecs_to_jiffies(iscan->timer_ms));
iscan->timer_on = 1;
break;
case WL_SCAN_RESULTS_ABORTED:
if (*timer) {
if (kick_off) {
#ifdef CONFIG_PRESCANNED
- (*timer)->expires = jiffies + 70000 * HZ / 1000;
+ (*timer)->expires = jiffies + msecs_to_jiffies(70000);
#else
- (*timer)->expires = jiffies + 30000 * HZ / 1000;
+ (*timer)->expires = jiffies + msecs_to_jiffies(30000);
#endif
add_timer(*timer);
WL_TRACE(("%s : timer starts \n", __FUNCTION__));
rtnl_unlock();
#endif
- mod_timer(&iscan->timer, jiffies + iscan->timer_ms*HZ/1000);
+ mod_timer(&iscan->timer, jiffies + msecs_to_jiffies(iscan->timer_ms));
iscan->timer_on = 1;
iscan->list_cur = iscan->list_hdr;
iscan->iscan_state = ISCAN_STATE_SCANING;
wl_iw_set_event_mask(dev);
- mod_timer(&iscan->timer, jiffies + iscan->timer_ms*HZ/1000);
+ mod_timer(&iscan->timer, jiffies + msecs_to_jiffies(iscan->timer_ms));
iscan->timer_on = 1;
WL_TRACE_COEX(("%s bt_dhcp stm: started \n", __FUNCTION__));
g_bt->bt_state = BT_DHCP_OPPORTUNITY_WINDOW;
mod_timer(&g_bt->timer,
- jiffies + BT_DHCP_OPPORTUNITY_WINDOW_TIME*HZ/1000);
+ jiffies + msecs_to_jiffies(BT_DHCP_OPPORTUNITY_WINDOW_TIME));
g_bt->timer_on = 1;
break;
if (g_bt->dev) wl_iw_bt_flag_set(g_bt->dev, TRUE);
g_bt->bt_state = BT_DHCP_FLAG_FORCE_TIMEOUT;
- mod_timer(&g_bt->timer, jiffies + BT_DHCP_FLAG_FORCE_TIME*HZ/1000);
+ mod_timer(&g_bt->timer, jiffies + msecs_to_jiffies(BT_DHCP_FLAG_FORCE_TIME));
g_bt->timer_on = 1;
break;