Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/platform/platform_aml_s905_sdio.c
1307 views
1
/******************************************************************************
2
*
3
* Copyright(c) 2016 - 2018 Realtek Corporation.
4
*
5
* This program is free software; you can redistribute it and/or modify it
6
* under the terms of version 2 of the GNU General Public License as
7
* published by the Free Software Foundation.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
*****************************************************************************/
15
#include <linux/printk.h> /* pr_info(() */
16
#include <linux/delay.h> /* msleep() */
17
#include "platform_aml_s905_sdio.h" /* sdio_reinit() and etc */
18
19
20
/*
21
* Return:
22
* 0: power on successfully
23
* others: power on failed
24
*/
25
int platform_wifi_power_on(void)
26
{
27
int ret = 0;
28
29
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
30
ret = wifi_setup_dt();
31
if (ret) {
32
pr_err("%s: setup dt failed!!(%d)\n", __func__, ret);
33
return -1;
34
}
35
#endif /* kernel < 3.14.0 */
36
37
#if 0 /* Seems redundancy? Already done before insert driver */
38
pr_info("######%s:\n", __func__);
39
extern_wifi_set_enable(0);
40
msleep(500);
41
extern_wifi_set_enable(1);
42
msleep(500);
43
sdio_reinit();
44
#endif
45
46
return ret;
47
}
48
49
void platform_wifi_power_off(void)
50
{
51
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
52
wifi_teardown_dt();
53
#endif /* kernel < 3.14.0 */
54
}
55
56