3 #include <dngl_stats.h>
5 #include <linux/rfkill-wlan.h>
7 #ifdef CONFIG_MACH_ODROID_4210
9 #include <mach/regs-gpio.h>
10 #include <plat/gpio-cfg.h>
11 #include <plat/sdhci.h>
12 #include <plat/devs.h>
13 #define sdmmc_channel s3c_device_hsmmc0
16 struct wifi_platform_data dhd_wlan_control = {0};
19 uint bcm_wlan_get_oob_irq(void)
21 uint host_oob_irq = 0;
23 host_oob_irq = rockchip_wifi_get_oob_irq();
25 printf("host_oob_irq: %d \r\n", host_oob_irq);
30 uint bcm_wlan_get_oob_irq_flags(void)
32 uint host_oob_irq_flags = 0;
34 host_oob_irq_flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL | IORESOURCE_IRQ_SHAREABLE) & IRQF_TRIGGER_MASK;
35 printf("host_oob_irq_flags=%d\n", host_oob_irq_flags);
37 return host_oob_irq_flags;
41 int bcm_wlan_set_power(bool on)
46 printf("======== PULL WL_REG_ON HIGH! ========\n");
47 rockchip_wifi_power(1);
49 printf("======== PULL WL_REG_ON LOW! ========\n");
50 rockchip_wifi_power(0);
56 int bcm_wlan_set_carddetect(bool present)
61 printf("======== Card detection to detect SDIO card! ========\n");
62 rockchip_wifi_set_carddetect(1);
64 printf("======== Card detection to remove SDIO card! ========\n");
65 rockchip_wifi_set_carddetect(0);
71 int bcm_wlan_get_mac_address(unsigned char *buf)
75 printf("======== %s ========\n", __FUNCTION__);
76 #ifdef EXAMPLE_GET_MAC
79 struct ether_addr ea_example = {{0x00, 0x11, 0x22, 0x33, 0x44, 0xFF}};
80 bcopy((char *)&ea_example, buf, sizeof(struct ether_addr));
82 #endif /* EXAMPLE_GET_MAC */
83 err = rockchip_wifi_mac_addr(buf);
88 #ifdef CONFIG_DHD_USE_STATIC_BUF
89 extern void *bcmdhd_mem_prealloc(int section, unsigned long size);
90 void* bcm_wlan_prealloc(int section, unsigned long size)
92 void *alloc_ptr = NULL;
93 alloc_ptr = bcmdhd_mem_prealloc(section, size);
95 printf("success alloc section %d, size %ld\n", section, size);
97 bzero(alloc_ptr, size);
100 printf("can't alloc section %d\n", section);
105 int bcm_wlan_set_plat_data(void) {
106 printf("======== %s ========\n", __FUNCTION__);
107 dhd_wlan_control.set_power = bcm_wlan_set_power;
108 dhd_wlan_control.set_carddetect = bcm_wlan_set_carddetect;
109 dhd_wlan_control.get_mac_addr = bcm_wlan_get_mac_address;
110 #ifdef CONFIG_DHD_USE_STATIC_BUF
111 dhd_wlan_control.mem_prealloc = bcm_wlan_prealloc;