dhd_sec_feature.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. /*
  2. * Customer HW 4 dependant file
  3. *
  4. * Copyright (C) 1999-2015, Broadcom Corporation
  5. *
  6. * Unless you and Broadcom execute a separate written software license
  7. * agreement governing use of this software, this software is licensed to you
  8. * under the terms of the GNU General Public License version 2 (the "GPL"),
  9. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  10. * following added to such license:
  11. *
  12. * As a special exception, the copyright holders of this software give you
  13. * permission to link this software with independent modules, and to copy and
  14. * distribute the resulting executable under terms of your choice, provided that
  15. * you also meet, for each linked independent module, the terms and conditions of
  16. * the license of that module. An independent module is a module which is not
  17. * derived from this software. The special exception does not apply to any
  18. * modifications of the software.
  19. *
  20. * Notwithstanding the above, under no circumstances may you combine this
  21. * software in any way with any other Broadcom software provided under a license
  22. * other than the GPL, without Broadcom's express prior written consent.
  23. *
  24. * $Id: dhd_sec_feature.h$
  25. */
  26. /*
  27. * ** Desciption ***
  28. * 1. Module vs COB
  29. * If your model's WIFI HW chip is COB type, you must add below feature
  30. * - #undef USE_CID_CHECK
  31. * - #define READ_MACADDR
  32. * Because COB type chip have not CID and Mac address.
  33. * So, you must add below feature to defconfig file.
  34. * - CONFIG_WIFI_BROADCOM_COB
  35. *
  36. * 2. PROJECTS
  37. * If you want add some feature only own Project, you can add it in 'PROJECTS' part.
  38. *
  39. * 3. Region code
  40. * If you want add some feature only own region model, you can use below code.
  41. * - 100 : EUR OPEN
  42. * - 101 : EUR ORG
  43. * - 200 : KOR OPEN
  44. * - 201 : KOR SKT
  45. * - 202 : KOR KTT
  46. * - 203 : KOR LGT
  47. * - 300 : CHN OPEN
  48. * - 400 : USA OPEN
  49. * - 401 : USA ATT
  50. * - 402 : USA TMO
  51. * - 403 : USA VZW
  52. * - 404 : USA SPR
  53. * - 405 : USA USC
  54. * You can refer how to using it below this file.
  55. * And, you can add more region code, too.
  56. */
  57. #ifndef _dhd_sec_feature_h_
  58. #define _dhd_sec_feature_h_
  59. #include <linuxver.h>
  60. /* For COB type feature */
  61. #ifdef CONFIG_WIFI_BROADCOM_COB
  62. #undef USE_CID_CHECK
  63. #define READ_MACADDR
  64. #endif /* CONFIG_WIFI_BROADCOM_COB */
  65. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) && (defined(CONFIG_BCM4334) || \
  66. defined(CONFIG_BCM4334_MODULE))
  67. #define RXFRAME_THREAD
  68. #endif /* (LINUX_VERSION >= VERSION(3, 4, 0)) && ( CONFIG_BCM4334 || CONFIG_BCM4334_MODULE) */
  69. /* PROJECTS START */
  70. #if defined(CONFIG_MACH_SAMSUNG_ESPRESSO) || defined(CONFIG_MACH_SAMSUNG_ESPRESSO_10)
  71. #define READ_MACADDR
  72. #define HW_OOB
  73. #endif /* CONFIG_MACH_SAMSUNG_ESPRESSO && CONFIG_MACH_SAMSUNG_ESPRESSO_10 */
  74. #if defined(CONFIG_MACH_UNIVERSAL5430) && !defined(CONFIG_BCM43455)
  75. #undef CUSTOM_SET_CPUCORE
  76. #define PRIMARY_CPUCORE 0
  77. #define DPC_CPUCORE 4
  78. #define RXF_CPUCORE 7
  79. #define ARGOS_CPU_SCHEDULER
  80. #elif defined(CONFIG_MACH_UNIVERSAL5430) && defined(CONFIG_BCM43455)
  81. #define CUSTOM_SET_CPUCORE
  82. #define PRIMARY_CPUCORE 0
  83. #define MAX_RETRY_SET_CPUCORE 5
  84. #define DPC_CPUCORE 0
  85. #define RXF_CPUCORE 4
  86. #elif defined(CONFIG_MACH_UNIVERSAL7580) && defined(CONFIG_BCM43455)
  87. #define CUSTOM_SET_CPUCORE
  88. #define PRIMARY_CPUCORE 0
  89. #define MAX_RETRY_SET_CPUCORE 5
  90. #define DPC_CPUCORE 1
  91. #define RXF_CPUCORE 2
  92. #elif defined(CONFIG_MACH_HL3G) || defined(CONFIG_MACH_HLLTE) || \
  93. defined(CONFIG_MACH_M2LTE) || \
  94. defined(CONFIG_MACH_UNIVERSAL5422)
  95. #define CUSTOM_SET_CPUCORE
  96. #define PRIMARY_CPUCORE 0
  97. #define MAX_RETRY_SET_CPUCORE 5
  98. #define DPC_CPUCORE 4
  99. #define RXF_CPUCORE 5
  100. #endif /* CONFIG_MACH_HL3G || CONFIG_MACH_HLLTE */
  101. /* Q1 also uses this feature */
  102. #if defined(CONFIG_MACH_U1) || defined(CONFIG_MACH_TRATS)
  103. #ifdef CONFIG_MACH_Q1_BD
  104. #define HW_OOB
  105. #endif /* CONFIG_MACH_Q1_BD */
  106. #define USE_CID_CHECK
  107. #define WRITE_MACADDR
  108. #endif /* CONFIG_MACH_U1 || CONFIG_MACH_TRATS */
  109. #ifdef CONFIG_ARCH_MSM7X30
  110. #define HW_OOB
  111. #define READ_MACADDR
  112. #endif /* CONFIG_ARCH_MSM7X30 */
  113. #if defined(CONFIG_MACH_VIENNA) || defined(CONFIG_MACH_V2)
  114. #define SUPPORT_MULTIPLE_CHIPS
  115. #undef USE_CID_CHECK
  116. #define READ_MACADDR
  117. #endif /* CONFIG_MACH_VIENNA || CONFIG_MACH_V2 */
  118. #if defined(CONFIG_MACH_GC1) || defined(CONFIG_MACH_U1_NA_SPR) || \
  119. defined(CONFIG_MACH_VIENNAEUR) || defined(CONFIG_MACH_LT03EUR) || \
  120. defined(CONFIG_MACH_LT03SKT) || defined(CONFIG_MACH_LT03KTT) || \
  121. defined(CONFIG_MACH_LT03LGT) || defined(CONFIG_V1A) || defined(CONFIG_N1A) || \
  122. defined(CONFIG_N2A) || defined(CONFIG_V2A) || defined(CONFIG_MACH_VIENNAEUR)
  123. #undef USE_CID_CHECK
  124. #define READ_MACADDR
  125. #endif /* CONFIG_MACH_GC1 || CONFIG_MACH_U1_NA_SPR || CONFIG_MACH_VIENNAEUR ||
  126. * CONFIG_MACH_LT03EUR || CONFIG_MACH_LT03SKT || CONFIG_MACH_LT03KTT ||
  127. * CONFIG_MACH_LT03LGT || CONFIG_V1A ||
  128. * CONFIG_N1A || CONFIG_N2A || CONFIG_V2A ||
  129. * CONFIG_MACH_VIENNAEUR
  130. */
  131. #if defined(CONFIG_MACH_CHAGALL) || defined(CONFIG_MACH_KLIMT)
  132. #if !defined(CONFIG_MACH_CHAGALL_KDI)
  133. #undef USE_CID_CHECK
  134. #define READ_MACADDR
  135. #endif
  136. #endif
  137. #ifdef CONFIG_MACH_P10
  138. #define READ_MACADDR
  139. #endif /* CONFIG_MACH_P10 */
  140. #ifdef CONFIG_ARCH_MSM8960
  141. #undef WIFI_TURNOFF_DELAY
  142. #define WIFI_TURNOFF_DELAY 200
  143. #endif /* CONFIG_ARCH_MSM8960 */
  144. /* PROJECTS END */
  145. /* REGION CODE START */
  146. #ifndef CONFIG_WLAN_REGION_CODE
  147. #define CONFIG_WLAN_REGION_CODE 100
  148. #endif /* CONFIG_WLAN_REGION_CODE */
  149. #if (CONFIG_WLAN_REGION_CODE >= 100) && (CONFIG_WLAN_REGION_CODE < 200) /* EUR */
  150. #if (CONFIG_WLAN_REGION_CODE == 101) /* EUR ORG */
  151. /* GAN LITE NAT KEEPALIVE FILTER */
  152. #define GAN_LITE_NAT_KEEPALIVE_FILTER
  153. #endif /* CONFIG_WLAN_REGION_CODE == 101 */
  154. #if (CONFIG_WLAN_REGION_CODE == 150) /* EUR FD(DualSIM) */
  155. #define SUPPORT_MULTIPLE_BOARD_REV_FROM_HW
  156. #endif /* CONFIG_WLAN_REGION_CODE == 150 */
  157. #endif /* CONFIG_WLAN_REGION_CODE >= 100 && CONFIG_WLAN_REGION_CODE < 200 */
  158. #if defined(CONFIG_V1A) || defined(CONFIG_V2A) || defined(CONFIG_MACH_VIENNAEUR)
  159. #define SUPPORT_MULTIPLE_CHIPS
  160. #endif /* CONFIG_V1A || CONFIG_V2A || CONFIG_MACH_VIENNAEUR */
  161. #if (CONFIG_WLAN_REGION_CODE >= 200) && (CONFIG_WLAN_REGION_CODE < 300) /* KOR */
  162. #undef USE_INITIAL_2G_SCAN
  163. #ifndef ROAM_ENABLE
  164. #define ROAM_ENABLE
  165. #endif /* ROAM_ENABLE */
  166. #ifndef ROAM_API
  167. #define ROAM_API
  168. #endif /* ROAM_API */
  169. #ifndef ROAM_CHANNEL_CACHE
  170. #define ROAM_CHANNEL_CACHE
  171. #endif /* ROAM_CHANNEL_CACHE */
  172. #ifndef OKC_SUPPORT
  173. #define OKC_SUPPORT
  174. #endif /* OKC_SUPPORT */
  175. #ifndef ROAM_AP_ENV_DETECTION
  176. #define ROAM_AP_ENV_DETECTION
  177. #endif /* ROAM_AP_ENV_DETECTION */
  178. #undef WRITE_MACADDR
  179. #ifndef READ_MACADDR
  180. #define READ_MACADDR
  181. #endif /* READ_MACADDR */
  182. #if (CONFIG_WLAN_REGION_CODE == 201) /* SKT */
  183. #ifdef CONFIG_MACH_UNIVERSAL5410
  184. /* Make CPU core clock 300MHz & assign dpc thread workqueue to CPU1 */
  185. #define FIX_CPU_MIN_CLOCK
  186. #endif /* CONFIG_MACH_UNIVERSAL5410 */
  187. #endif /* CONFIG_WLAN_REGION_CODE == 201 */
  188. #if (CONFIG_WLAN_REGION_CODE == 202) /* KTT */
  189. #define VLAN_MODE_OFF
  190. #define CUSTOM_KEEP_ALIVE_SETTING 30000
  191. #define FULL_ROAMING_SCAN_PERIOD_60_SEC
  192. #ifdef CONFIG_MACH_UNIVERSAL5410
  193. /* Make CPU core clock 300MHz & assign dpc thread workqueue to CPU1 */
  194. #define FIX_CPU_MIN_CLOCK
  195. #endif /* CONFIG_MACH_UNIVERSAL5410 */
  196. #endif /* CONFIG_WLAN_REGION_CODE == 202 */
  197. #if (CONFIG_WLAN_REGION_CODE == 203) /* LGT */
  198. #ifdef CONFIG_MACH_UNIVERSAL5410
  199. /* Make CPU core clock 300MHz & assign dpc thread workqueue to CPU1 */
  200. #define FIX_CPU_MIN_CLOCK
  201. #define FIX_BUS_MIN_CLOCK
  202. #endif /* CONFIG_MACH_UNIVERSAL5410 */
  203. #endif /* CONFIG_WLAN_REGION_CODE == 203 */
  204. #endif /* CONFIG_WLAN_REGION_CODE >= 200 && CONFIG_WLAN_REGION_CODE < 300 */
  205. #if (CONFIG_WLAN_REGION_CODE >= 300) && (CONFIG_WLAN_REGION_CODE < 400) /* CHN */
  206. #define BCMWAPI_WPI
  207. #define BCMWAPI_WAI
  208. #endif /* CONFIG_WLAN_REGION_CODE >= 300 && CONFIG_WLAN_REGION_CODE < 400 */
  209. #if (CONFIG_WLAN_REGION_CODE >= 400) && (CONFIG_WLAN_REGION_CODE < 500) /* USA */
  210. #if defined(CONFIG_SEC_K_PROJECT) || defined(CONFIG_SEC_KACTIVE_PROJECT) || defined(CONFIG_SEC_KSPORTS_PROJECT)
  211. /* TX Power control when Calling by Samsung */
  212. #define TX_POWER_CONTROL_CALLING
  213. /* TX Power control when Calling by Broadcom */
  214. #undef SARLIMIT_TX_CONTROL_NVRAM
  215. #else
  216. /* TX Power control when Calling by Samsung */
  217. #undef TX_POWER_CONTROL_CALLING
  218. /* TX Power control when Calling by Broadcom */
  219. #define SARLIMIT_TX_CONTROL_NVRAM
  220. #endif
  221. #define TX_CALLING_POWER -1
  222. #if (CONFIG_WLAN_REGION_CODE == 401) /* ATT */
  223. #undef TX_CALLING_POWER
  224. #define TX_CALLING_POWER 9
  225. #endif /* CONFIG_WLAN_REGION_CODE == 401 */
  226. #if (CONFIG_WLAN_REGION_CODE == 402) /* TMO */
  227. #undef CUSTOM_SUSPEND_BCN_LI_DTIM
  228. #define CUSTOM_SUSPEND_BCN_LI_DTIM 3
  229. #undef TX_CALLING_POWER
  230. #define TX_CALLING_POWER 9
  231. #endif /* CONFIG_WLAN_REGION_CODE == 402 */
  232. #if (CONFIG_WLAN_REGION_CODE == 403) /* VZW */
  233. #undef TX_CALLING_POWER
  234. #define TX_CALLING_POWER 7
  235. #endif /* CONFIG_WLAN_REGION_CODE == 403 */
  236. #if (CONFIG_WLAN_REGION_CODE == 404) /* SPR */
  237. #undef TX_CALLING_POWER
  238. #define TX_CALLING_POWER 7
  239. #endif /* CONFIG_WLAN_REGION_CODE == 404 */
  240. #if (CONFIG_WLAN_REGION_CODE == 405) /* USC */
  241. #undef TX_CALLING_POWER
  242. #define TX_CALLING_POWER 7
  243. #endif /* CONFIG_WLAN_REGION_CODE == 405 */
  244. #if (CONFIG_WLAN_REGION_CODE == 406) /* CAN */
  245. #undef TX_CALLING_POWER
  246. #define TX_CALLING_POWER 9
  247. #endif /* CONFIG_WLAN_REGION_CODE == 406 */
  248. #if (CONFIG_WLAN_REGION_CODE == 407) /* MPCS */
  249. #undef CUSTOM_SUSPEND_BCN_LI_DTIM
  250. #define CUSTOM_SUSPEND_BCN_LI_DTIM 3
  251. #undef TX_CALLING_POWER
  252. #define TX_CALLING_POWER 9
  253. #endif /* CONFIG_WLAN_REGION_CODE == 407 */
  254. #if (CONFIG_WLAN_REGION_CODE == 408) /* ACG */
  255. #undef TX_CALLING_POWER
  256. #define TX_CALLING_POWER 7
  257. #endif /* CONFIG_WLAN_REGION_CODE == 408 */
  258. #if (CONFIG_WLAN_REGION_CODE == 409) /* LRA */
  259. #undef TX_CALLING_POWER
  260. #define TX_CALLING_POWER 7
  261. #endif /* CONFIG_WLAN_REGION_CODE == 409 */
  262. #endif /* CONFIG_WLAN_REGION_CODE >= 400 && CONFIG_WLAN_REGION_CODE < 500 */
  263. /* REGION CODE END */
  264. #if !defined(READ_MACADDR) && !defined(WRITE_MACADDR) && !defined(RDWR_KORICS_MACADDR) \
  265. && !defined(RDWR_MACADDR)
  266. #define GET_MAC_FROM_OTP
  267. #define SHOW_NVRAM_TYPE
  268. #endif /* !READ_MACADDR && !WRITE_MACADDR && !RDWR_KORICS_MACADDR && !RDWR_MACADDR */
  269. #define WRITE_WLANINFO
  270. #if defined(CONFIG_MACH_KLTE_DCM) || defined(CONFIG_MACH_KACTIVELTE_DCM)
  271. #define CUSTOMER_BCN_TIMEOUT
  272. #define CUSTOMER_BCN_TIMEOUT_VALUE 4 // change value
  273. #else
  274. #define CUSTOMER_BCN_TIMEOUT_VALUE 8 // change value
  275. #endif
  276. #if defined(CONFIG_BCM4343) && defined(CONFIG_ARCH_SCX35)
  277. #undef DHD_FIRSTREAD
  278. #undef MAX_HDR_READ
  279. #define CUSTOM_DPC_CPUCORE 0
  280. #endif /* CONFIG_BCM4343 && CONFIG_ARCH_SCX35 */
  281. #if defined(CONFIG_MACH_KONA)
  282. #define DISABLE_FLOW_CONTROL
  283. #endif /* CONFIG_MACH_KONA */
  284. #endif /* _dhd_sec_feature_h_ */