Exemplo n.º 1
0
void android_module_exit(void)
{
#ifdef CONFIG_HAS_EARLYSUSPEND
    unregister_early_suspend(&ar6k_early_suspend);
#endif
#ifdef CONFIG_HAS_WAKELOCK
    wake_lock_destroy(&ar6k_init_wake_lock);
#endif
    ar6000_enable_mmchost_detect_change(1);
    /* disable polling again after we remove our wlan card */
    ar6000_enable_mmchost_detect_change(0);
}
Exemplo n.º 2
0
void android_module_init(OSDRV_CALLBACKS *osdrvCallbacks)
{
    bmienable = 1;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    if (ifname[0] == '\0') {
       if (strlcpy(ifname, def_ifname, sizeof(ifname)) >= sizeof(ifname)) {
           AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("strlcpy: def_ifname %s\n", def_ifname));
           return;
        }
    }
#endif 
#ifdef CONFIG_HAS_WAKELOCK
    wake_lock_init(&ar6k_init_wake_lock, WAKE_LOCK_SUSPEND, "ar6k_init");
#endif
#ifdef CONFIG_HAS_EARLYSUSPEND
    ar6k_early_suspend.suspend = android_early_suspend;
    ar6k_early_suspend.resume  = android_late_resume;
    ar6k_early_suspend.level   = EARLY_SUSPEND_LEVEL_BLANK_SCREEN;
    register_early_suspend(&ar6k_early_suspend);
#endif

    ar6000_avail_ev_p = osdrvCallbacks->deviceInsertedHandler;
    osdrvCallbacks->deviceInsertedHandler = ar6000_android_avail_ev;

    ar6000_enable_mmchost_detect_change(1);
}
Exemplo n.º 3
0
static A_STATUS ar6000_android_avail_ev(void *context, void *hif_handle)
{
    A_STATUS ret;    
    wake_lock(&ar6k_init_wake_lock);
    ar6000_enable_mmchost_detect_change(0);
    ret = ar6000_avail_ev_p(context, hif_handle);
    wake_unlock(&ar6k_init_wake_lock);
    return ret;
}
Exemplo n.º 4
0
static A_STATUS ar6000_android_avail_ev(void *context, void *hif_handle)
{
    A_STATUS ret;    
#ifdef CONFIG_HAS_WAKELOCK
    wake_lock(&ar6k_init_wake_lock);
#endif
    ar6000_enable_mmchost_detect_change(0);
    ret = ar6000_avail_ev_p(context, hif_handle);
#ifdef CONFIG_HAS_WAKELOCK
    wake_unlock(&ar6k_init_wake_lock);
#endif
    return ret;
}
Exemplo n.º 5
0
void android_module_exit(void)
{
#ifdef CONFIG_HAS_EARLYSUSPEND
    unregister_early_suspend(&ar6k_early_suspend);
#endif
    wake_lock_destroy(&ar6k_wow_wake_lock);
    wake_lock_destroy(&ar6k_init_wake_lock);

#ifdef CONFIG_PM
    platform_driver_unregister(&ar6000_pm_device);
#endif
    ar6000_enable_mmchost_detect_change(1);
}
Exemplo n.º 6
0
void android_module_init(OSDRV_CALLBACKS *osdrvCallbacks)
{
    bmienable = 1;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    if (ifname[0] == '\0')
        strcpy(ifname, def_ifname);
#endif 
    if (wow2mode!=WLAN_PWR_CTRL_CUT_PWR && wow2mode!=WLAN_PWR_CTRL_DEEP_SLEEP) {
        wow2mode=WLAN_PWR_CTRL_CUT_PWR;
    }

    wake_lock_init(&ar6k_init_wake_lock, WAKE_LOCK_SUSPEND, "ar6k_init");
    wake_lock_init(&ar6k_wow_wake_lock, WAKE_LOCK_SUSPEND, "ar6k_wow");

#ifdef CONFIG_HAS_EARLYSUSPEND
    ar6k_early_suspend.suspend = android_early_suspend;
    ar6k_early_suspend.resume  = android_late_resume;
    ar6k_early_suspend.level   = EARLY_SUSPEND_LEVEL_BLANK_SCREEN;
    register_early_suspend(&ar6k_early_suspend);
#endif

#if defined(CONFIG_PM)
    osdrvCallbacks->deviceSuspendHandler = ar6000_suspend_ev;
    osdrvCallbacks->deviceResumeHandler = ar6000_resume_ev;
#endif
    ar6000_avail_ev_p = osdrvCallbacks->deviceInsertedHandler;
    osdrvCallbacks->deviceInsertedHandler = ar6000_android_avail_ev;

#if defined(CONFIG_PM)
    /* Register ar6000_pm_device into system.
     * We should also add platform_device into the first item of array devices[] in
     * file arch/xxx/mach-xxx/board-xxxx.c
     * Otherwise, WoW may not work properly since we may trigger WoW GPIO before system suspend
     */
    if (platform_driver_register(&ar6000_pm_device))
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000: fail to register the power control driver.\n"));
#endif

    ar6000_enable_mmchost_detect_change(1);
}