summaryrefslogtreecommitdiff
path: root/ANDROID_3.4.5/drivers/net/wireless/bcmdhd.1.88.45.x.cn/dhd_custom_gpio.c
diff options
context:
space:
mode:
authorSrikant Patnaik2015-01-11 12:28:04 +0530
committerSrikant Patnaik2015-01-11 12:28:04 +0530
commit871480933a1c28f8a9fed4c4d34d06c439a7a422 (patch)
tree8718f573808810c2a1e8cb8fb6ac469093ca2784 /ANDROID_3.4.5/drivers/net/wireless/bcmdhd.1.88.45.x.cn/dhd_custom_gpio.c
parent9d40ac5867b9aefe0722bc1f110b965ff294d30d (diff)
downloadFOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.gz
FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.bz2
FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.zip
Moved, renamed, and deleted files
The original directory structure was scattered and unorganized. Changes are basically to make it look like kernel structure.
Diffstat (limited to 'ANDROID_3.4.5/drivers/net/wireless/bcmdhd.1.88.45.x.cn/dhd_custom_gpio.c')
-rwxr-xr-xANDROID_3.4.5/drivers/net/wireless/bcmdhd.1.88.45.x.cn/dhd_custom_gpio.c289
1 files changed, 0 insertions, 289 deletions
diff --git a/ANDROID_3.4.5/drivers/net/wireless/bcmdhd.1.88.45.x.cn/dhd_custom_gpio.c b/ANDROID_3.4.5/drivers/net/wireless/bcmdhd.1.88.45.x.cn/dhd_custom_gpio.c
deleted file mode 100755
index 6cd7df66..00000000
--- a/ANDROID_3.4.5/drivers/net/wireless/bcmdhd.1.88.45.x.cn/dhd_custom_gpio.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
-* Customer code to add GPIO control during WLAN start/stop
-* $Copyright Open Broadcom Corporation$
-*
-* $Id: dhd_custom_gpio.c 417465 2013-08-09 11:47:27Z $
-*/
-
-#include <typedefs.h>
-#include <linuxver.h>
-#include <osl.h>
-#include <bcmutils.h>
-
-#include <dngl_stats.h>
-#include <dhd.h>
-
-#include <wlioctl.h>
-#include <wl_iw.h>
-
-#define WL_ERROR(x) printf x
-#define WL_TRACE(x)
-
-#ifdef CUSTOMER_HW
-#if defined(CUSTOMER_OOB)
-extern int bcm_wlan_get_oob_irq(void);
-#endif
-extern void bcm_wlan_power_off(int);
-extern void bcm_wlan_power_on(int);
-#endif /* CUSTOMER_HW */
-#if defined(CUSTOMER_HW2)
-
-#if defined(PLATFORM_MPS)
-int __attribute__ ((weak)) wifi_get_fw_nv_path(char *fw, char *nv) { return 0;};
-#endif
-
-#ifdef CONFIG_WIFI_CONTROL_FUNC
-int wifi_set_power(int on, unsigned long msec);
-int wifi_get_irq_number(unsigned long *irq_flags_ptr);
-int wifi_get_mac_addr(unsigned char *buf);
-void *wifi_get_country_code(char *ccode);
-#else
-int wifi_set_power(int on, unsigned long msec) { return -1; }
-int wifi_get_irq_number(unsigned long *irq_flags_ptr) { return -1; }
-int wifi_get_mac_addr(unsigned char *buf) { return -1; }
-void *wifi_get_country_code(char *ccode) { return NULL; }
-#endif /* CONFIG_WIFI_CONTROL_FUNC */
-#endif
-
-#if defined(OOB_INTR_ONLY)
-
-#if defined(BCMLXSDMMC)
-extern int sdioh_mmc_irq(int irq);
-#endif /* (BCMLXSDMMC) */
-
-#if defined(CUSTOMER_HW3) || defined(PLATFORM_MPS)
-#include <mach/gpio.h>
-#endif
-
-/* Customer specific Host GPIO defintion */
-static int dhd_oob_gpio_num = -1;
-
-module_param(dhd_oob_gpio_num, int, 0644);
-MODULE_PARM_DESC(dhd_oob_gpio_num, "DHD oob gpio number");
-
-/* This function will return:
- * 1) return : Host gpio interrupt number per customer platform
- * 2) irq_flags_ptr : Type of Host interrupt as Level or Edge
- *
- * NOTE :
- * Customer should check his platform definitions
- * and his Host Interrupt spec
- * to figure out the proper setting for his platform.
- * Broadcom provides just reference settings as example.
- *
- */
-int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr)
-{
- int host_oob_irq = 0;
-
-#if defined(CUSTOMER_HW2) && !defined(PLATFORM_MPS)
- host_oob_irq = wifi_get_irq_number(irq_flags_ptr);
-
-#elif defined(CUSTOMER_OOB)
- host_oob_irq = bcm_wlan_get_oob_irq();
-
-#else
-#if defined(CUSTOM_OOB_GPIO_NUM)
- if (dhd_oob_gpio_num < 0) {
- dhd_oob_gpio_num = CUSTOM_OOB_GPIO_NUM;
- }
-#endif /* CUSTOMER_OOB_GPIO_NUM */
-
- if (dhd_oob_gpio_num < 0) {
- WL_ERROR(("%s: ERROR customer specific Host GPIO is NOT defined \n",
- __FUNCTION__));
- return (dhd_oob_gpio_num);
- }
-
- WL_ERROR(("%s: customer specific Host GPIO number is (%d)\n",
- __FUNCTION__, dhd_oob_gpio_num));
-
-#if defined CUSTOMER_HW
- host_oob_irq = MSM_GPIO_TO_INT(dhd_oob_gpio_num);
-#elif defined CUSTOMER_HW3 || defined(PLATFORM_MPS)
- gpio_request(dhd_oob_gpio_num, "oob irq");
- host_oob_irq = gpio_to_irq(dhd_oob_gpio_num);
- gpio_direction_input(dhd_oob_gpio_num);
-#endif /* CUSTOMER_HW */
-#endif
-
- return (host_oob_irq);
-}
-#endif
-
-/* Customer function to control hw specific wlan gpios */
-void
-dhd_customer_gpio_wlan_ctrl(int onoff)
-{
- switch (onoff) {
- case WLAN_RESET_OFF:
- WL_TRACE(("%s: call customer specific GPIO to insert WLAN RESET\n",
- __FUNCTION__));
-#ifdef CUSTOMER_HW
- bcm_wlan_power_off(2);
-#endif /* CUSTOMER_HW */
-#if defined(CUSTOMER_HW2)
- wifi_set_power(0, WIFI_TURNOFF_DELAY);
-#endif
- WL_ERROR(("=========== WLAN placed in RESET ========\n"));
- break;
-
- case WLAN_RESET_ON:
- WL_TRACE(("%s: call customer specific GPIO to remove WLAN RESET\n",
- __FUNCTION__));
-#ifdef CUSTOMER_HW
- bcm_wlan_power_on(2);
- OSL_DELAY(200);
-#endif /* CUSTOMER_HW */
-#if defined(CUSTOMER_HW2)
- wifi_set_power(1, 200);
-#endif
- WL_ERROR(("=========== WLAN going back to live ========\n"));
- break;
-
- case WLAN_POWER_OFF:
- WL_TRACE(("%s: call customer specific GPIO to turn off WL_REG_ON\n",
- __FUNCTION__));
-#ifdef CUSTOMER_HW
- bcm_wlan_power_off(1);
-#endif /* CUSTOMER_HW */
- WL_ERROR(("=========== WLAN placed in POWER OFF ========\n"));
- break;
-
- case WLAN_POWER_ON:
- WL_TRACE(("%s: call customer specific GPIO to turn on WL_REG_ON\n",
- __FUNCTION__));
-#ifdef CUSTOMER_HW
- bcm_wlan_power_on(1);
-#endif /* CUSTOMER_HW */
- /* Lets customer power to get stable */
- OSL_DELAY(200);
- WL_ERROR(("=========== WLAN placed in POWER ON ========\n"));
- break;
- }
-}
-
-#ifdef GET_CUSTOM_MAC_ENABLE
-/* Function to get custom MAC address */
-int
-dhd_custom_get_mac_address(unsigned char *buf)
-{
- int ret = 0;
-
- WL_TRACE(("%s Enter\n", __FUNCTION__));
- if (!buf)
- return -EINVAL;
-
- /* Customer access to MAC address stored outside of DHD driver */
-#if defined(CUSTOMER_HW2) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
- ret = wifi_get_mac_addr(buf);
-#endif
-
-#ifdef EXAMPLE_GET_MAC
- /* EXAMPLE code */
- {
- struct ether_addr ea_example = {{0x00, 0x11, 0x22, 0x33, 0x44, 0xFF}};
- bcopy((char *)&ea_example, buf, sizeof(struct ether_addr));
- }
-#endif /* EXAMPLE_GET_MAC */
-
- return ret;
-}
-#endif /* GET_CUSTOM_MAC_ENABLE */
-
-/* Customized Locale table : OPTIONAL feature */
-const struct cntry_locales_custom translate_custom_table[] = {
-/* Table should be filled out based on custom platform regulatory requirement */
-#ifdef EXAMPLE_TABLE
- {"", "XY", 4}, /* Universal if Country code is unknown or empty */
- {"US", "US", 69}, /* input ISO "US" to : US regrev 69 */
- {"CA", "US", 69}, /* input ISO "CA" to : US regrev 69 */
- {"EU", "EU", 5}, /* European union countries to : EU regrev 05 */
- {"AT", "EU", 5},
- {"BE", "EU", 5},
- {"BG", "EU", 5},
- {"CY", "EU", 5},
- {"CZ", "EU", 5},
- {"DK", "EU", 5},
- {"EE", "EU", 5},
- {"FI", "EU", 5},
- {"FR", "EU", 5},
- {"DE", "EU", 5},
- {"GR", "EU", 5},
- {"HU", "EU", 5},
- {"IE", "EU", 5},
- {"IT", "EU", 5},
- {"LV", "EU", 5},
- {"LI", "EU", 5},
- {"LT", "EU", 5},
- {"LU", "EU", 5},
- {"MT", "EU", 5},
- {"NL", "EU", 5},
- {"PL", "EU", 5},
- {"PT", "EU", 5},
- {"RO", "EU", 5},
- {"SK", "EU", 5},
- {"SI", "EU", 5},
- {"ES", "EU", 5},
- {"SE", "EU", 5},
- {"GB", "EU", 5},
- {"KR", "XY", 3},
- {"AU", "XY", 3},
- {"CN", "XY", 3}, /* input ISO "CN" to : XY regrev 03 */
- {"TW", "XY", 3},
- {"AR", "XY", 3},
- {"MX", "XY", 3},
- {"IL", "IL", 0},
- {"CH", "CH", 0},
- {"TR", "TR", 0},
- {"NO", "NO", 0},
-#endif /* EXMAPLE_TABLE */
-};
-
-
-/* Customized Locale convertor
-* input : ISO 3166-1 country abbreviation
-* output: customized cspec
-*/
-void get_customized_country_code(char *country_iso_code, wl_country_t *cspec)
-{
-#if defined(CUSTOMER_HW2) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
-
- struct cntry_locales_custom *cloc_ptr;
-
- if (!cspec)
- return;
-
- cloc_ptr = wifi_get_country_code(country_iso_code);
- if (cloc_ptr) {
- strlcpy(cspec->ccode, cloc_ptr->custom_locale, WLC_CNTRY_BUF_SZ);
- cspec->rev = cloc_ptr->custom_locale_rev;
- }
- return;
-#else
- int size, i;
-
- size = ARRAYSIZE(translate_custom_table);
-
- if (cspec == 0)
- return;
-
- if (size == 0)
- return;
-
- for (i = 0; i < size; i++) {
- if (strcmp(country_iso_code, translate_custom_table[i].iso_abbrev) == 0) {
- memcpy(cspec->ccode,
- translate_custom_table[i].custom_locale, WLC_CNTRY_BUF_SZ);
- cspec->rev = translate_custom_table[i].custom_locale_rev;
- return;
- }
- }
-#ifdef EXAMPLE_TABLE
- /* if no country code matched return first universal code from translate_custom_table */
- memcpy(cspec->ccode, translate_custom_table[0].custom_locale, WLC_CNTRY_BUF_SZ);
- cspec->rev = translate_custom_table[0].custom_locale_rev;
-#endif /* EXMAPLE_TABLE */
- return;
-#endif /* defined(CUSTOMER_HW2) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)) */
-}