old mode 100644new mode 100755| .. | .. |
|---|
| 1 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 2 | | - |
|---|
| 3 | 2 | #include <typedefs.h> |
|---|
| 4 | 3 | #include <osl.h> |
|---|
| 5 | 4 | |
|---|
| .. | .. |
|---|
| 68 | 67 | #define MAXSZ_BUF 4096 |
|---|
| 69 | 68 | #define MAXSZ_CONFIG 8192 |
|---|
| 70 | 69 | |
|---|
| 71 | | -extern uint wl_reassoc_support; |
|---|
| 72 | | -#ifdef BTC_WAR |
|---|
| 73 | | -extern int btc_war; |
|---|
| 74 | | -#endif /* BTC_WAR */ |
|---|
| 75 | 70 | #if defined(BCMSDIO) && defined(DYNAMIC_MAX_HDR_READ) |
|---|
| 76 | 71 | extern uint firstread; |
|---|
| 77 | 72 | #endif |
|---|
| .. | .. |
|---|
| 141 | 136 | {BCM43751_CHIP_ID, 1, DONT_CARE, "bcm43751a1_pcie_ag", ""}, |
|---|
| 142 | 137 | {BCM43751_CHIP_ID, 2, DONT_CARE, "bcm43751a2_pcie_ag", ""}, |
|---|
| 143 | 138 | {BCM43752_CHIP_ID, 1, DONT_CARE, "bcm43752a1_pcie_ag", ""}, |
|---|
| 144 | | - {BCM43752_CHIP_ID, 2, DONT_CARE, "bcm43752a2_pcie_ag", "ap6275p"}, |
|---|
| 139 | + {BCM43752_CHIP_ID, 2, DONT_CARE, "bcm43752a2_pcie_ag", "AP6275P"}, |
|---|
| 145 | 140 | {BCM4375_CHIP_ID, 5, DONT_CARE, "bcm4375b4_pcie_ag", ""}, |
|---|
| 146 | 141 | #endif |
|---|
| 147 | 142 | #ifdef BCMDBUS |
|---|
| 148 | | - {BCM43143_CHIP_ID, 2, DONT_CARE, "bcm43143b0", ""}, |
|---|
| 149 | | - {BCM43242_CHIP_ID, 1, DONT_CARE, "bcm43242a1_ag", ""}, |
|---|
| 150 | | - {BCM43569_CHIP_ID, 2, DONT_CARE, "bcm4358u_ag", ""}, |
|---|
| 143 | + {BCM43143_CHIP_ID, 2, DONT_CARE, "bcm43143b0", ""}, |
|---|
| 144 | + {BCM43242_CHIP_ID, 1, DONT_CARE, "bcm43242a1_ag", ""}, |
|---|
| 145 | + {BCM43569_CHIP_ID, 2, DONT_CARE, "bcm4358u_ag", ""}, |
|---|
| 151 | 146 | #endif |
|---|
| 152 | 147 | }; |
|---|
| 153 | 148 | |
|---|
| .. | .. |
|---|
| 216 | 211 | |
|---|
| 217 | 212 | #ifdef DHD_TPUT_PATCH |
|---|
| 218 | 213 | extern int dhd_change_mtu(dhd_pub_t *dhd, int new_mtu, int ifidx); |
|---|
| 219 | | -#endif |
|---|
| 220 | | - |
|---|
| 221 | | -#ifdef WL_CFG80211 |
|---|
| 222 | | -bool |
|---|
| 223 | | -dhd_conf_legacy_chip_check(dhd_pub_t *dhd) |
|---|
| 224 | | -{ |
|---|
| 225 | | - uint chip = dhd->conf->chip; |
|---|
| 226 | | - |
|---|
| 227 | | - if (chip == BCM43362_CHIP_ID || chip == BCM4330_CHIP_ID || |
|---|
| 228 | | - chip == BCM4334_CHIP_ID || chip == BCM43340_CHIP_ID || |
|---|
| 229 | | - chip == BCM43341_CHIP_ID || chip == BCM4324_CHIP_ID || |
|---|
| 230 | | - chip == BCM4335_CHIP_ID || chip == BCM4339_CHIP_ID || |
|---|
| 231 | | - chip == BCM4354_CHIP_ID || chip == BCM4356_CHIP_ID || |
|---|
| 232 | | - chip == BCM4371_CHIP_ID || |
|---|
| 233 | | - chip == BCM43430_CHIP_ID || |
|---|
| 234 | | - chip == BCM4345_CHIP_ID || chip == BCM43454_CHIP_ID || |
|---|
| 235 | | - chip == BCM4359_CHIP_ID || |
|---|
| 236 | | - chip == BCM43143_CHIP_ID || chip == BCM43242_CHIP_ID || |
|---|
| 237 | | - chip == BCM43569_CHIP_ID) { |
|---|
| 238 | | - return true; |
|---|
| 239 | | - } |
|---|
| 240 | | - |
|---|
| 241 | | - return false; |
|---|
| 242 | | -} |
|---|
| 243 | | - |
|---|
| 244 | | -bool |
|---|
| 245 | | -dhd_conf_new_chip_check(dhd_pub_t *dhd) |
|---|
| 246 | | -{ |
|---|
| 247 | | - uint chip = dhd->conf->chip; |
|---|
| 248 | | - |
|---|
| 249 | | - if (chip == BCM43362_CHIP_ID || chip == BCM4330_CHIP_ID || |
|---|
| 250 | | - chip == BCM4334_CHIP_ID || chip == BCM43340_CHIP_ID || |
|---|
| 251 | | - chip == BCM43341_CHIP_ID || chip == BCM4324_CHIP_ID || |
|---|
| 252 | | - chip == BCM4335_CHIP_ID || chip == BCM4339_CHIP_ID || |
|---|
| 253 | | - chip == BCM4354_CHIP_ID || chip == BCM4356_CHIP_ID || |
|---|
| 254 | | - chip == BCM4371_CHIP_ID || |
|---|
| 255 | | - chip == BCM43430_CHIP_ID || |
|---|
| 256 | | - chip == BCM4345_CHIP_ID || chip == BCM43454_CHIP_ID || |
|---|
| 257 | | - chip == BCM43143_CHIP_ID || chip == BCM43242_CHIP_ID || |
|---|
| 258 | | - chip == BCM43569_CHIP_ID) { |
|---|
| 259 | | - return false; |
|---|
| 260 | | - } |
|---|
| 261 | | - |
|---|
| 262 | | - return true; |
|---|
| 263 | | -} |
|---|
| 264 | | - |
|---|
| 265 | | -bool |
|---|
| 266 | | -dhd_conf_extsae_chip(dhd_pub_t *dhd) |
|---|
| 267 | | -{ |
|---|
| 268 | | - uint chip = dhd->conf->chip; |
|---|
| 269 | | - |
|---|
| 270 | | - if (chip == BCM43362_CHIP_ID || chip == BCM4330_CHIP_ID || |
|---|
| 271 | | - chip == BCM4334_CHIP_ID || chip == BCM43340_CHIP_ID || |
|---|
| 272 | | - chip == BCM43341_CHIP_ID || chip == BCM4324_CHIP_ID || |
|---|
| 273 | | - chip == BCM4335_CHIP_ID || chip == BCM4339_CHIP_ID || |
|---|
| 274 | | - chip == BCM43143_CHIP_ID || chip == BCM43242_CHIP_ID || |
|---|
| 275 | | - chip == BCM43569_CHIP_ID) { |
|---|
| 276 | | - return false; |
|---|
| 277 | | - } |
|---|
| 278 | | - |
|---|
| 279 | | - return true; |
|---|
| 280 | | -} |
|---|
| 281 | | -#endif |
|---|
| 282 | | - |
|---|
| 283 | | -#ifdef BCMSDIO |
|---|
| 284 | | -static void |
|---|
| 285 | | -dhd_conf_disable_slpauto(dhd_pub_t *dhd) |
|---|
| 286 | | -{ |
|---|
| 287 | | - uint chip = dhd->conf->chip; |
|---|
| 288 | | - |
|---|
| 289 | | - if (chip == BCM43362_CHIP_ID || chip == BCM4330_CHIP_ID || |
|---|
| 290 | | - chip == BCM4334_CHIP_ID || chip == BCM43340_CHIP_ID || |
|---|
| 291 | | - chip == BCM43341_CHIP_ID || chip == BCM4324_CHIP_ID || |
|---|
| 292 | | - chip == BCM4335_CHIP_ID || chip == BCM4339_CHIP_ID || |
|---|
| 293 | | - chip == BCM4354_CHIP_ID || chip == BCM4356_CHIP_ID || |
|---|
| 294 | | - chip == BCM4371_CHIP_ID || |
|---|
| 295 | | - chip == BCM43430_CHIP_ID || |
|---|
| 296 | | - chip == BCM4345_CHIP_ID || chip == BCM43454_CHIP_ID || |
|---|
| 297 | | - chip == BCM4359_CHIP_ID) { |
|---|
| 298 | | - dhd_slpauto = FALSE; |
|---|
| 299 | | - } |
|---|
| 300 | | - CONFIG_MSG("dhd_slpauto = %d\n", dhd_slpauto); |
|---|
| 301 | | -} |
|---|
| 302 | 214 | #endif |
|---|
| 303 | 215 | |
|---|
| 304 | 216 | void |
|---|
| .. | .. |
|---|
| 778 | 690 | chiprev = dhd->conf->chiprev; |
|---|
| 779 | 691 | |
|---|
| 780 | 692 | for (i=0; i<sizeof(chip_name_map)/sizeof(chip_name_map[0]); i++) { |
|---|
| 781 | | - const chip_name_map_t *row = &chip_name_map[i]; |
|---|
| 693 | + const chip_name_map_t* row = &chip_name_map[i]; |
|---|
| 782 | 694 | if (row->chip == chip && row->chiprev == chiprev && |
|---|
| 783 | 695 | (row->ag_type == ag_type || |
|---|
| 784 | 696 | ag_type == DONT_CARE || row->ag_type == DONT_CARE)) { |
|---|
| .. | .. |
|---|
| 811 | 723 | |
|---|
| 812 | 724 | #ifdef BCMSDIO |
|---|
| 813 | 725 | for (i=0; i<sizeof(module_name_map)/sizeof(module_name_map[0]); i++) { |
|---|
| 814 | | - const module_name_map_t *row = &module_name_map[i]; |
|---|
| 726 | + const module_name_map_t* row = &module_name_map[i]; |
|---|
| 815 | 727 | if (row->devid == devid && row->chip == chip && row->chiprev == chiprev && |
|---|
| 816 | 728 | !strcmp(row->module_name, dhd->conf->module_name)) { |
|---|
| 817 | 729 | return row; |
|---|
| .. | .. |
|---|
| 821 | 733 | |
|---|
| 822 | 734 | #ifdef BCMPCIE |
|---|
| 823 | 735 | for (i=0; i<sizeof(module_name_map)/sizeof(module_name_map[0]); i++) { |
|---|
| 824 | | - const module_name_map_t *row = &module_name_map[i]; |
|---|
| 736 | + const module_name_map_t* row = &module_name_map[i]; |
|---|
| 825 | 737 | if (row->devid == devid && row->chip == chip && row->chiprev == chiprev && |
|---|
| 826 | 738 | row->svid == svid && row->ssid == ssid) { |
|---|
| 827 | 739 | return row; |
|---|
| .. | .. |
|---|
| 833 | 745 | } |
|---|
| 834 | 746 | #endif |
|---|
| 835 | 747 | |
|---|
| 836 | | -char * |
|---|
| 837 | | -dhd_conf_get_chip_name(dhd_pub_t *dhd, int ag_type, bool *chip_map_v2) |
|---|
| 838 | | -{ |
|---|
| 839 | | -#ifdef UPDATE_MODULE_NAME |
|---|
| 840 | | - const module_name_map_t *row_module = NULL; |
|---|
| 841 | | -#endif |
|---|
| 842 | | - const chip_name_map_t *row_chip = NULL; |
|---|
| 843 | | - char *name = NULL; |
|---|
| 844 | | - |
|---|
| 845 | | - *chip_map_v2 = FALSE; |
|---|
| 846 | | -#ifdef UPDATE_MODULE_NAME |
|---|
| 847 | | - row_module = dhd_conf_match_module(dhd); |
|---|
| 848 | | - if (row_module && strlen(row_module->chip_name)) { |
|---|
| 849 | | - name = row_module->chip_name; |
|---|
| 850 | | - } else |
|---|
| 851 | | -#endif |
|---|
| 852 | | - { |
|---|
| 853 | | - row_chip = dhd_conf_match_chip(dhd, ag_type); |
|---|
| 854 | | - if (row_chip && strlen(row_chip->chip_name)) { |
|---|
| 855 | | - name = row_chip->chip_name; |
|---|
| 856 | | - } |
|---|
| 857 | | - } |
|---|
| 858 | | - |
|---|
| 859 | | - return name; |
|---|
| 860 | | -} |
|---|
| 861 | | - |
|---|
| 862 | | -char * |
|---|
| 863 | | -dhd_conf_get_module_name(dhd_pub_t *dhd, int ag_type) |
|---|
| 864 | | -{ |
|---|
| 865 | | -#if defined(BCMPCIE) && defined(UPDATE_MODULE_NAME) |
|---|
| 866 | | - const module_name_map_t *row_module = NULL; |
|---|
| 867 | | -#endif |
|---|
| 868 | | - const chip_name_map_t *row_chip = NULL; |
|---|
| 869 | | - char *name = NULL; |
|---|
| 870 | | - |
|---|
| 871 | | -#if defined(BCMPCIE) && defined(UPDATE_MODULE_NAME) |
|---|
| 872 | | - row_module = dhd_conf_match_module(dhd); |
|---|
| 873 | | - if (row_module && strlen(row_module->module_name)) { |
|---|
| 874 | | - name = row_module->module_name; |
|---|
| 875 | | - } else |
|---|
| 876 | | -#endif |
|---|
| 877 | | - { |
|---|
| 878 | | - row_chip = dhd_conf_match_chip(dhd, ag_type); |
|---|
| 879 | | - if (row_chip && strlen(row_chip->module_name)) { |
|---|
| 880 | | - name = row_chip->module_name; |
|---|
| 881 | | - } |
|---|
| 882 | | - } |
|---|
| 883 | | - |
|---|
| 884 | | - return name; |
|---|
| 885 | | -} |
|---|
| 886 | | - |
|---|
| 887 | 748 | int |
|---|
| 888 | 749 | dhd_conf_set_fw_name_by_chip(dhd_pub_t *dhd, char *fw_path) |
|---|
| 889 | 750 | { |
|---|
| 751 | +#ifdef UPDATE_MODULE_NAME |
|---|
| 752 | + const module_name_map_t* row_module = NULL; |
|---|
| 753 | +#endif |
|---|
| 754 | + const chip_name_map_t* row_chip = NULL; |
|---|
| 890 | 755 | int fw_type, ag_type; |
|---|
| 891 | | - char *name_ptr, *chip_name = NULL; |
|---|
| 892 | | - bool chip_map_v2; |
|---|
| 756 | + uint chip, chiprev; |
|---|
| 757 | + char *name_ptr; |
|---|
| 893 | 758 | int i; |
|---|
| 759 | + |
|---|
| 760 | + chip = dhd->conf->chip; |
|---|
| 761 | + chiprev = dhd->conf->chiprev; |
|---|
| 894 | 762 | |
|---|
| 895 | 763 | if (fw_path[0] == '\0') { |
|---|
| 896 | 764 | #ifdef CONFIG_BCMDHD_FW_PATH |
|---|
| .. | .. |
|---|
| 942 | 810 | fw_type = FW_TYPE_EZMESH; |
|---|
| 943 | 811 | #endif /* WLEASYMESH */ |
|---|
| 944 | 812 | |
|---|
| 945 | | - chip_name = dhd_conf_get_chip_name(dhd, ag_type, &chip_map_v2); |
|---|
| 946 | | - if (chip_name) { |
|---|
| 813 | + row_chip = dhd_conf_match_chip(dhd, ag_type); |
|---|
| 814 | + if (row_chip && strlen(row_chip->chip_name)) { |
|---|
| 947 | 815 | strcpy(name_ptr, "fw_"); |
|---|
| 948 | | - strcat(name_ptr, chip_name); |
|---|
| 816 | + strcat(name_ptr, row_chip->chip_name); |
|---|
| 949 | 817 | #ifdef BCMUSBDEV_COMPOSITE |
|---|
| 950 | 818 | strcat(name_ptr, "_cusb"); |
|---|
| 951 | 819 | #endif |
|---|
| .. | .. |
|---|
| 967 | 835 | strcat(name_ptr, ".bin"); |
|---|
| 968 | 836 | } |
|---|
| 969 | 837 | |
|---|
| 838 | +#ifdef UPDATE_MODULE_NAME |
|---|
| 839 | + row_module = dhd_conf_match_module(dhd); |
|---|
| 840 | + if (row_module && strlen(row_module->chip_name)) { |
|---|
| 841 | + strcpy(name_ptr, "fw_"); |
|---|
| 842 | + strcat(name_ptr, row_module->chip_name); |
|---|
| 843 | +#ifdef BCMUSBDEV_COMPOSITE |
|---|
| 844 | + strcat(name_ptr, "_cusb"); |
|---|
| 845 | +#endif |
|---|
| 846 | + if (fw_type == FW_TYPE_APSTA) |
|---|
| 847 | + strcat(name_ptr, "_apsta.bin"); |
|---|
| 848 | + else if (fw_type == FW_TYPE_P2P) |
|---|
| 849 | + strcat(name_ptr, "_p2p.bin"); |
|---|
| 850 | + else if (fw_type == FW_TYPE_MESH) |
|---|
| 851 | + strcat(name_ptr, "_mesh.bin"); |
|---|
| 852 | + else if (fw_type == FW_TYPE_EZMESH) |
|---|
| 853 | + strcat(name_ptr, "_ezmesh.bin"); |
|---|
| 854 | + else if (fw_type == FW_TYPE_ES) |
|---|
| 855 | + strcat(name_ptr, "_es.bin"); |
|---|
| 856 | + else if (fw_type == FW_TYPE_MFG) |
|---|
| 857 | + strcat(name_ptr, "_mfg.bin"); |
|---|
| 858 | + else if (fw_type == FW_TYPE_MINIME) |
|---|
| 859 | + strcat(name_ptr, "_minime.bin"); |
|---|
| 860 | + else |
|---|
| 861 | + strcat(name_ptr, ".bin"); |
|---|
| 862 | + } |
|---|
| 863 | +#endif |
|---|
| 864 | + |
|---|
| 970 | 865 | dhd->conf->fw_type = fw_type; |
|---|
| 971 | 866 | |
|---|
| 972 | 867 | #ifndef MINIME |
|---|
| .. | .. |
|---|
| 981 | 876 | void |
|---|
| 982 | 877 | dhd_conf_set_clm_name_by_chip(dhd_pub_t *dhd, char *clm_path, int ag_type) |
|---|
| 983 | 878 | { |
|---|
| 984 | | - char *name_ptr, *chip_name = NULL; |
|---|
| 985 | | - bool chip_map_v2; |
|---|
| 879 | +#ifdef UPDATE_MODULE_NAME |
|---|
| 880 | + const module_name_map_t* row_module = NULL; |
|---|
| 881 | +#endif |
|---|
| 882 | + const chip_name_map_t* row_chip = NULL; |
|---|
| 883 | + uint chip, chiprev; |
|---|
| 884 | + char *name_ptr; |
|---|
| 986 | 885 | int i; |
|---|
| 886 | + |
|---|
| 887 | + chip = dhd->conf->chip; |
|---|
| 888 | + chiprev = dhd->conf->chiprev; |
|---|
| 987 | 889 | |
|---|
| 988 | 890 | if (clm_path[0] == '\0') { |
|---|
| 989 | 891 | CONFIG_MSG("clm path is null\n"); |
|---|
| .. | .. |
|---|
| 1001 | 903 | } |
|---|
| 1002 | 904 | name_ptr = &clm_path[i]; |
|---|
| 1003 | 905 | |
|---|
| 1004 | | - chip_name = dhd_conf_get_chip_name(dhd, ag_type, &chip_map_v2); |
|---|
| 1005 | | - if (chip_name) { |
|---|
| 906 | + row_chip = dhd_conf_match_chip(dhd, ag_type); |
|---|
| 907 | + if (row_chip && strlen(row_chip->chip_name)) { |
|---|
| 1006 | 908 | strcpy(name_ptr, "clm_"); |
|---|
| 1007 | | - strcat(name_ptr, chip_name); |
|---|
| 909 | + strcat(name_ptr, row_chip->chip_name); |
|---|
| 1008 | 910 | strcat(name_ptr, ".blob"); |
|---|
| 1009 | 911 | } |
|---|
| 912 | + |
|---|
| 913 | +#ifdef UPDATE_MODULE_NAME |
|---|
| 914 | + row_module = dhd_conf_match_module(dhd); |
|---|
| 915 | + if (row_module && strlen(row_module->chip_name)) { |
|---|
| 916 | + strcpy(name_ptr, "clm_"); |
|---|
| 917 | + strcat(name_ptr, row_module->chip_name); |
|---|
| 918 | + strcat(name_ptr, ".blob"); |
|---|
| 919 | + } |
|---|
| 920 | +#endif |
|---|
| 1010 | 921 | |
|---|
| 1011 | 922 | CONFIG_TRACE("clm_path=%s\n", clm_path); |
|---|
| 1012 | 923 | } |
|---|
| .. | .. |
|---|
| 1014 | 925 | void |
|---|
| 1015 | 926 | dhd_conf_set_nv_name_by_chip(dhd_pub_t *dhd, char *nv_path, int ag_type) |
|---|
| 1016 | 927 | { |
|---|
| 928 | +#if defined(BCMPCIE) && defined(UPDATE_MODULE_NAME) |
|---|
| 929 | + const module_name_map_t* row_module = NULL; |
|---|
| 930 | +#endif |
|---|
| 931 | + const chip_name_map_t* row_chip = NULL; |
|---|
| 1017 | 932 | uint chip, chiprev; |
|---|
| 1018 | | - char *name_ptr, *module_name = NULL, nv_name[32]; |
|---|
| 933 | + char *name_ptr, nv_name[32]; |
|---|
| 1019 | 934 | int i; |
|---|
| 1020 | 935 | |
|---|
| 1021 | 936 | chip = dhd->conf->chip; |
|---|
| .. | .. |
|---|
| 1043 | 958 | } |
|---|
| 1044 | 959 | name_ptr = &nv_path[i]; |
|---|
| 1045 | 960 | |
|---|
| 1046 | | - module_name = dhd_conf_get_module_name(dhd, ag_type); |
|---|
| 1047 | | - if (module_name) { |
|---|
| 961 | + row_chip = dhd_conf_match_chip(dhd, ag_type); |
|---|
| 962 | + if (row_chip && strlen(row_chip->module_name)) { |
|---|
| 1048 | 963 | strcpy(name_ptr, "nvram_"); |
|---|
| 1049 | | - strcat(name_ptr, module_name); |
|---|
| 964 | + strcat(name_ptr, row_chip->module_name); |
|---|
| 1050 | 965 | #ifdef BCMUSBDEV_COMPOSITE |
|---|
| 1051 | 966 | strcat(name_ptr, "_cusb"); |
|---|
| 1052 | 967 | #endif |
|---|
| .. | .. |
|---|
| 1063 | 978 | if (dhd->conf->chip == BCM4359_CHIP_ID) { |
|---|
| 1064 | 979 | struct file *fp; |
|---|
| 1065 | 980 | // compatible for AP6398S and AP6398SA |
|---|
| 1066 | | - fp = dhd_filp_open(nv_path, O_RDONLY, 0); |
|---|
| 1067 | | - if (IS_ERR(fp) || (fp == NULL)) { |
|---|
| 981 | + fp = filp_open(nv_path, O_RDONLY, 0); |
|---|
| 982 | + if (IS_ERR(fp)) { |
|---|
| 1068 | 983 | strcpy(name_ptr, nv_name); |
|---|
| 1069 | 984 | } else { |
|---|
| 1070 | | - dhd_filp_close((struct file *)fp, NULL); |
|---|
| 985 | + filp_close((struct file *)fp, NULL); |
|---|
| 1071 | 986 | } |
|---|
| 1072 | 987 | } |
|---|
| 1073 | 988 | #endif |
|---|
| 989 | + } |
|---|
| 990 | +#endif |
|---|
| 991 | + |
|---|
| 992 | +#if defined(BCMPCIE) && defined(UPDATE_MODULE_NAME) |
|---|
| 993 | + row_module = dhd_conf_match_module(dhd); |
|---|
| 994 | + if (row_module && strlen(row_module->module_name)) { |
|---|
| 995 | + strcpy(name_ptr, "nvram_"); |
|---|
| 996 | + strcat(name_ptr, row_module->module_name); |
|---|
| 997 | + strcat(name_ptr, ".txt"); |
|---|
| 1074 | 998 | } |
|---|
| 1075 | 999 | #endif |
|---|
| 1076 | 1000 | |
|---|
| .. | .. |
|---|
| 1114 | 1038 | void |
|---|
| 1115 | 1039 | dhd_conf_set_conf_name_by_chip(dhd_pub_t *dhd, char *conf_path) |
|---|
| 1116 | 1040 | { |
|---|
| 1117 | | - char *name_ptr, *chip_name = NULL; |
|---|
| 1118 | | - bool chip_map_v2; |
|---|
| 1041 | +#ifdef UPDATE_MODULE_NAME |
|---|
| 1042 | + const module_name_map_t* row_module = NULL; |
|---|
| 1043 | +#endif |
|---|
| 1044 | + const chip_name_map_t* row_chip = NULL; |
|---|
| 1045 | + uint chip, chiprev; |
|---|
| 1046 | + char *name_ptr; |
|---|
| 1119 | 1047 | int i; |
|---|
| 1048 | + |
|---|
| 1049 | + chip = dhd->conf->chip; |
|---|
| 1050 | + chiprev = dhd->conf->chiprev; |
|---|
| 1120 | 1051 | |
|---|
| 1121 | 1052 | if (conf_path[0] == '\0') { |
|---|
| 1122 | 1053 | CONFIG_MSG("config path is null\n"); |
|---|
| .. | .. |
|---|
| 1134 | 1065 | } |
|---|
| 1135 | 1066 | name_ptr = &conf_path[i]; |
|---|
| 1136 | 1067 | |
|---|
| 1137 | | - chip_name = dhd_conf_get_chip_name(dhd, DONT_CARE, &chip_map_v2); |
|---|
| 1138 | | - if (chip_name) { |
|---|
| 1068 | + row_chip = dhd_conf_match_chip(dhd, DONT_CARE); |
|---|
| 1069 | + if (row_chip && strlen(row_chip->chip_name)) { |
|---|
| 1139 | 1070 | strcpy(name_ptr, "config_"); |
|---|
| 1140 | | - strcat(name_ptr, chip_name); |
|---|
| 1071 | + strcat(name_ptr, row_chip->chip_name); |
|---|
| 1141 | 1072 | strcat(name_ptr, ".txt"); |
|---|
| 1142 | 1073 | } |
|---|
| 1074 | + |
|---|
| 1075 | +#ifdef UPDATE_MODULE_NAME |
|---|
| 1076 | + row_module = dhd_conf_match_module(dhd); |
|---|
| 1077 | + if (row_module && strlen(row_module->chip_name)) { |
|---|
| 1078 | + strcpy(name_ptr, "config_"); |
|---|
| 1079 | + strcat(name_ptr, row_module->chip_name); |
|---|
| 1080 | + strcat(name_ptr, ".txt"); |
|---|
| 1081 | + } |
|---|
| 1082 | +#endif |
|---|
| 1143 | 1083 | |
|---|
| 1144 | 1084 | CONFIG_TRACE("config_path=%s\n", conf_path); |
|---|
| 1145 | 1085 | } |
|---|
| .. | .. |
|---|
| 1316 | 1256 | |
|---|
| 1317 | 1257 | #ifdef DHD_LINUX_STD_FW_API |
|---|
| 1318 | 1258 | #define FIRMWARE_CLASS_PATH "/sys/module/firmware_class/parameters/path" |
|---|
| 1259 | +static int |
|---|
| 1260 | +dhd_conf_get_fw_path(char *path, int len) |
|---|
| 1261 | +{ |
|---|
| 1262 | + char *pch; |
|---|
| 1263 | + int err, path_len = 0; |
|---|
| 1264 | + |
|---|
| 1265 | + err = dhd_read_file(FIRMWARE_CLASS_PATH, path, len); |
|---|
| 1266 | + if(err < 0){ |
|---|
| 1267 | + CONFIG_ERROR("firmware path can not read %d\n", err); |
|---|
| 1268 | + } else { |
|---|
| 1269 | + pch = strchr(path, '\n'); |
|---|
| 1270 | + if (pch) |
|---|
| 1271 | + *pch = '\0'; |
|---|
| 1272 | + CONFIG_TRACE("path = %s\n", path); |
|---|
| 1273 | + path_len = strlen(path); |
|---|
| 1274 | + } |
|---|
| 1275 | + |
|---|
| 1276 | + return path_len; |
|---|
| 1277 | +} |
|---|
| 1278 | + |
|---|
| 1319 | 1279 | static void |
|---|
| 1320 | 1280 | dhd_conf_get_filename(char *pFilename) |
|---|
| 1321 | 1281 | { |
|---|
| .. | .. |
|---|
| 1337 | 1297 | |
|---|
| 1338 | 1298 | if (pName) |
|---|
| 1339 | 1299 | strcpy(pFilename, pName); |
|---|
| 1340 | | - |
|---|
| 1341 | | - return; |
|---|
| 1342 | | -} |
|---|
| 1343 | | - |
|---|
| 1344 | | -static void |
|---|
| 1345 | | -dhd_conf_add_filepath(dhd_pub_t *dhd, char *pFilename) |
|---|
| 1346 | | -{ |
|---|
| 1347 | | - char path[WLC_IOCTL_SMLEN]; |
|---|
| 1348 | | - char *name_ptr, *module_name = NULL; |
|---|
| 1349 | | - |
|---|
| 1350 | | - if (strlen(pFilename)) { |
|---|
| 1351 | | - name_ptr = path; |
|---|
| 1352 | | - strcpy(name_ptr, ""); |
|---|
| 1353 | | -#ifdef FW_AMPAK_PATH |
|---|
| 1354 | | - strcat(name_ptr, "/"); |
|---|
| 1355 | | - strcat(name_ptr, FW_AMPAK_PATH); |
|---|
| 1356 | | -#endif |
|---|
| 1357 | | -#ifdef MODULE_PATH |
|---|
| 1358 | | -#if defined(BCMSDIO) && defined(GET_OTP_MODULE_NAME) |
|---|
| 1359 | | - if (strlen(dhd->conf->module_name)) |
|---|
| 1360 | | - module_name = dhd->conf->module_name; |
|---|
| 1361 | | - else |
|---|
| 1362 | | -#endif |
|---|
| 1363 | | - { |
|---|
| 1364 | | - module_name = dhd_conf_get_module_name(dhd, DONT_CARE); |
|---|
| 1365 | | - } |
|---|
| 1366 | | -#endif |
|---|
| 1367 | | - if (module_name) { |
|---|
| 1368 | | - strcat(name_ptr, "/"); |
|---|
| 1369 | | - strcat(name_ptr, module_name); |
|---|
| 1370 | | - } |
|---|
| 1371 | | - strcat(name_ptr, "/"); |
|---|
| 1372 | | - strcat(name_ptr, pFilename); |
|---|
| 1373 | | - strcpy(pFilename, path); |
|---|
| 1374 | | - } |
|---|
| 1375 | | - |
|---|
| 1376 | 1300 | return; |
|---|
| 1377 | 1301 | } |
|---|
| 1378 | 1302 | #endif /* DHD_LINUX_STD_FW_API */ |
|---|
| .. | .. |
|---|
| 1381 | 1305 | dhd_conf_set_path_params(dhd_pub_t *dhd, char *fw_path, char *nv_path) |
|---|
| 1382 | 1306 | { |
|---|
| 1383 | 1307 | int ag_type; |
|---|
| 1308 | +#ifdef DHD_LINUX_STD_FW_API |
|---|
| 1309 | + char path[WLC_IOCTL_SMLEN]; |
|---|
| 1310 | + int path_len; |
|---|
| 1311 | +#endif |
|---|
| 1384 | 1312 | |
|---|
| 1385 | 1313 | /* External conf takes precedence if specified */ |
|---|
| 1386 | 1314 | dhd_conf_preinit(dhd); |
|---|
| .. | .. |
|---|
| 1412 | 1340 | #endif |
|---|
| 1413 | 1341 | |
|---|
| 1414 | 1342 | #ifdef DHD_LINUX_STD_FW_API |
|---|
| 1415 | | - dhd_conf_add_filepath(dhd, fw_path); |
|---|
| 1416 | | - dhd_conf_add_filepath(dhd, nv_path); |
|---|
| 1417 | | - dhd_conf_add_filepath(dhd, dhd->clm_path); |
|---|
| 1418 | | - dhd_conf_add_filepath(dhd, dhd->conf_path); |
|---|
| 1419 | | -#endif |
|---|
| 1420 | | - |
|---|
| 1343 | + memset(path, 0, sizeof(path)); |
|---|
| 1344 | + path_len = dhd_conf_get_fw_path(path, sizeof(path)); |
|---|
| 1345 | + snprintf(path+path_len, WLC_IOCTL_SMLEN, "%s", fw_path); |
|---|
| 1346 | + CONFIG_MSG("Final fw_path=%s\n", path); |
|---|
| 1347 | + snprintf(path+path_len, WLC_IOCTL_SMLEN, "%s", nv_path); |
|---|
| 1348 | + CONFIG_MSG("Final nv_path=%s\n", path); |
|---|
| 1349 | + snprintf(path+path_len, WLC_IOCTL_SMLEN, "%s", dhd->clm_path); |
|---|
| 1350 | + CONFIG_MSG("Final clm_path=%s\n", path); |
|---|
| 1351 | + snprintf(path+path_len, WLC_IOCTL_SMLEN, "%s", dhd->conf_path); |
|---|
| 1352 | + CONFIG_MSG("Final conf_path=%s\n", path); |
|---|
| 1353 | +#else |
|---|
| 1421 | 1354 | CONFIG_MSG("Final fw_path=%s\n", fw_path); |
|---|
| 1422 | 1355 | CONFIG_MSG("Final nv_path=%s\n", nv_path); |
|---|
| 1423 | 1356 | CONFIG_MSG("Final clm_path=%s\n", dhd->clm_path); |
|---|
| 1424 | 1357 | CONFIG_MSG("Final conf_path=%s\n", dhd->conf_path); |
|---|
| 1358 | +#endif |
|---|
| 1425 | 1359 | |
|---|
| 1426 | 1360 | dhd_conf_read_config(dhd, dhd->conf_path); |
|---|
| 1427 | 1361 | #ifdef DHD_TPUT_PATCH |
|---|
| .. | .. |
|---|
| 1438 | 1372 | |
|---|
| 1439 | 1373 | if (val >= def) { |
|---|
| 1440 | 1374 | if (down) { |
|---|
| 1441 | | - if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_DOWN, NULL, 0, TRUE, ifidx)) < 0) |
|---|
| 1375 | + if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_DOWN, NULL, 0, TRUE, 0)) < 0) |
|---|
| 1442 | 1376 | CONFIG_ERROR("WLC_DOWN setting failed %d\n", ret); |
|---|
| 1443 | 1377 | } |
|---|
| 1444 | 1378 | if (cmd == WLC_SET_VAR) { |
|---|
| 1445 | 1379 | CONFIG_TRACE("set %s %d\n", name, val); |
|---|
| 1446 | 1380 | bcm_mkiovar(name, (char *)&val, sizeof(val), iovbuf, sizeof(iovbuf)); |
|---|
| 1447 | | - if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, ifidx)) < 0) |
|---|
| 1381 | + if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0)) < 0) |
|---|
| 1448 | 1382 | CONFIG_ERROR("%s setting failed %d\n", name, ret); |
|---|
| 1449 | 1383 | } else { |
|---|
| 1450 | 1384 | CONFIG_TRACE("set %s %d %d\n", name, cmd, val); |
|---|
| 1451 | | - if ((ret = dhd_wl_ioctl_cmd(dhd, cmd, &val, sizeof(val), TRUE, ifidx)) < 0) |
|---|
| 1385 | + if ((ret = dhd_wl_ioctl_cmd(dhd, cmd, &val, sizeof(val), TRUE, 0)) < 0) |
|---|
| 1452 | 1386 | CONFIG_ERROR("%s setting failed %d\n", name, ret); |
|---|
| 1453 | 1387 | } |
|---|
| 1454 | 1388 | } |
|---|
| .. | .. |
|---|
| 1551 | 1485 | } |
|---|
| 1552 | 1486 | |
|---|
| 1553 | 1487 | return ret; |
|---|
| 1554 | | -} |
|---|
| 1555 | | - |
|---|
| 1556 | | -static int |
|---|
| 1557 | | -dhd_conf_get_ioctl_ver(dhd_pub_t *dhd) |
|---|
| 1558 | | -{ |
|---|
| 1559 | | - int ret = 0; |
|---|
| 1560 | | - s32 val = 0; |
|---|
| 1561 | | - |
|---|
| 1562 | | - dhd->conf->ioctl_ver = WLC_IOCTL_VERSION; |
|---|
| 1563 | | - ret = dhd_conf_get_iovar(dhd, 0, WLC_GET_VERSION, "WLC_GET_VERSION", |
|---|
| 1564 | | - (char *)&val, sizeof(val)); |
|---|
| 1565 | | - if (ret) { |
|---|
| 1566 | | - return ret; |
|---|
| 1567 | | - } |
|---|
| 1568 | | - val = dtoh32(val); |
|---|
| 1569 | | - if (val != WLC_IOCTL_VERSION && val != 1) { |
|---|
| 1570 | | - CONFIG_ERROR("Version mismatch, please upgrade. Got %d, expected %d or 1\n", |
|---|
| 1571 | | - val, WLC_IOCTL_VERSION); |
|---|
| 1572 | | - return BCME_VERSION; |
|---|
| 1573 | | - } |
|---|
| 1574 | | - dhd->conf->ioctl_ver = val; |
|---|
| 1575 | | - CONFIG_TRACE("ioctl_ver=%d\n", dhd->conf->ioctl_ver); |
|---|
| 1576 | | - |
|---|
| 1577 | | - return ret; |
|---|
| 1578 | | -} |
|---|
| 1579 | | - |
|---|
| 1580 | | -int |
|---|
| 1581 | | -dhd_conf_get_country(dhd_pub_t *dhd, wl_country_t *cspec) |
|---|
| 1582 | | -{ |
|---|
| 1583 | | - int bcmerror = -1; |
|---|
| 1584 | | - |
|---|
| 1585 | | - memset(cspec, 0, sizeof(wl_country_t)); |
|---|
| 1586 | | - bcm_mkiovar("country", NULL, 0, (char*)cspec, sizeof(wl_country_t)); |
|---|
| 1587 | | - if ((bcmerror = dhd_wl_ioctl_cmd(dhd, WLC_GET_VAR, cspec, sizeof(wl_country_t), |
|---|
| 1588 | | - FALSE, 0)) < 0) |
|---|
| 1589 | | - CONFIG_ERROR("country code getting failed %d\n", bcmerror); |
|---|
| 1590 | | - |
|---|
| 1591 | | - return bcmerror; |
|---|
| 1592 | | -} |
|---|
| 1593 | | - |
|---|
| 1594 | | -int |
|---|
| 1595 | | -dhd_conf_map_country_list(dhd_pub_t *dhd, wl_country_t *cspec) |
|---|
| 1596 | | -{ |
|---|
| 1597 | | - int bcmerror = -1; |
|---|
| 1598 | | - struct dhd_conf *conf = dhd->conf; |
|---|
| 1599 | | - country_list_t *country = conf->country_head; |
|---|
| 1600 | | - |
|---|
| 1601 | | -#ifdef CCODE_LIST |
|---|
| 1602 | | - bcmerror = dhd_ccode_map_country_list(dhd, cspec); |
|---|
| 1603 | | -#endif |
|---|
| 1604 | | - // **:XZ/11 => return XZ/11 if not found |
|---|
| 1605 | | - // **:**/0 => return user specified ccode if not found, but set regrev 0 |
|---|
| 1606 | | - while (country != NULL) { |
|---|
| 1607 | | - if (!strncmp("**", country->cspec.country_abbrev, 2)) { |
|---|
| 1608 | | - if (!strncmp("**", country->cspec.ccode, 2)) { |
|---|
| 1609 | | - cspec->rev = 0; |
|---|
| 1610 | | - bcmerror = 0; |
|---|
| 1611 | | - break; |
|---|
| 1612 | | - } |
|---|
| 1613 | | - memcpy(cspec->ccode, country->cspec.ccode, WLC_CNTRY_BUF_SZ); |
|---|
| 1614 | | - cspec->rev = country->cspec.rev; |
|---|
| 1615 | | - bcmerror = 0; |
|---|
| 1616 | | - break; |
|---|
| 1617 | | - } else if (!strncmp(cspec->country_abbrev, |
|---|
| 1618 | | - country->cspec.country_abbrev, 2)) { |
|---|
| 1619 | | - memcpy(cspec->ccode, country->cspec.ccode, WLC_CNTRY_BUF_SZ); |
|---|
| 1620 | | - cspec->rev = country->cspec.rev; |
|---|
| 1621 | | - bcmerror = 0; |
|---|
| 1622 | | - break; |
|---|
| 1623 | | - } |
|---|
| 1624 | | - country = country->next; |
|---|
| 1625 | | - } |
|---|
| 1626 | | - |
|---|
| 1627 | | - if (!bcmerror) |
|---|
| 1628 | | - CONFIG_MSG("%s/%d\n", cspec->ccode, cspec->rev); |
|---|
| 1629 | | - |
|---|
| 1630 | | - return bcmerror; |
|---|
| 1631 | | -} |
|---|
| 1632 | | - |
|---|
| 1633 | | -int |
|---|
| 1634 | | -dhd_conf_set_country(dhd_pub_t *dhd, wl_country_t *cspec) |
|---|
| 1635 | | -{ |
|---|
| 1636 | | - int bcmerror = -1; |
|---|
| 1637 | | - |
|---|
| 1638 | | - memset(&dhd->dhd_cspec, 0, sizeof(wl_country_t)); |
|---|
| 1639 | | - |
|---|
| 1640 | | - CONFIG_MSG("set country %s, revision %d\n", cspec->ccode, cspec->rev); |
|---|
| 1641 | | - bcmerror = dhd_conf_set_bufiovar(dhd, 0, WLC_SET_VAR, "country", (char *)cspec, |
|---|
| 1642 | | - sizeof(wl_country_t), FALSE); |
|---|
| 1643 | | - dhd_conf_get_country(dhd, cspec); |
|---|
| 1644 | | - CONFIG_MSG("Country code: %s (%s/%d)\n", |
|---|
| 1645 | | - cspec->country_abbrev, cspec->ccode, cspec->rev); |
|---|
| 1646 | | - |
|---|
| 1647 | | - return bcmerror; |
|---|
| 1648 | | -} |
|---|
| 1649 | | - |
|---|
| 1650 | | -int |
|---|
| 1651 | | -dhd_conf_fix_country(dhd_pub_t *dhd) |
|---|
| 1652 | | -{ |
|---|
| 1653 | | - int bcmerror = -1; |
|---|
| 1654 | | - int band; |
|---|
| 1655 | | - wl_uint32_list_t *list; |
|---|
| 1656 | | - u8 valid_chan_list[sizeof(u32)*(WL_NUMCHANNELS + 1)]; |
|---|
| 1657 | | - wl_country_t cspec; |
|---|
| 1658 | | - |
|---|
| 1659 | | - if (!(dhd && dhd->conf)) { |
|---|
| 1660 | | - return bcmerror; |
|---|
| 1661 | | - } |
|---|
| 1662 | | - |
|---|
| 1663 | | - memset(valid_chan_list, 0, sizeof(valid_chan_list)); |
|---|
| 1664 | | - list = (wl_uint32_list_t *)(void *) valid_chan_list; |
|---|
| 1665 | | - list->count = htod32(WL_NUMCHANNELS); |
|---|
| 1666 | | - if ((bcmerror = dhd_wl_ioctl_cmd(dhd, WLC_GET_VALID_CHANNELS, valid_chan_list, |
|---|
| 1667 | | - sizeof(valid_chan_list), FALSE, 0)) < 0) { |
|---|
| 1668 | | - CONFIG_ERROR("get channels failed with %d\n", bcmerror); |
|---|
| 1669 | | - } |
|---|
| 1670 | | - |
|---|
| 1671 | | - band = dhd_conf_get_band(dhd); |
|---|
| 1672 | | - |
|---|
| 1673 | | - if (bcmerror || ((band==WLC_BAND_AUTO || band==WLC_BAND_2G || band==-1) && |
|---|
| 1674 | | - dtoh32(list->count)<11)) { |
|---|
| 1675 | | - CONFIG_ERROR("bcmerror=%d, # of channels %d\n", |
|---|
| 1676 | | - bcmerror, dtoh32(list->count)); |
|---|
| 1677 | | - dhd_conf_map_country_list(dhd, &dhd->conf->cspec); |
|---|
| 1678 | | - if ((bcmerror = dhd_conf_set_country(dhd, &dhd->conf->cspec)) < 0) { |
|---|
| 1679 | | - strcpy(cspec.country_abbrev, "US"); |
|---|
| 1680 | | - cspec.rev = 0; |
|---|
| 1681 | | - strcpy(cspec.ccode, "US"); |
|---|
| 1682 | | - dhd_conf_map_country_list(dhd, &cspec); |
|---|
| 1683 | | - dhd_conf_set_country(dhd, &cspec); |
|---|
| 1684 | | - } |
|---|
| 1685 | | - } |
|---|
| 1686 | | - |
|---|
| 1687 | | - return bcmerror; |
|---|
| 1688 | 1488 | } |
|---|
| 1689 | 1489 | |
|---|
| 1690 | 1490 | static int |
|---|
| .. | .. |
|---|
| 1894 | 1694 | } |
|---|
| 1895 | 1695 | #endif |
|---|
| 1896 | 1696 | |
|---|
| 1897 | | -int |
|---|
| 1898 | | -dhd_conf_country(dhd_pub_t *dhd, char *cmd, char *buf) |
|---|
| 1899 | | -{ |
|---|
| 1900 | | - wl_country_t cspec = {{0}, 0, {0}}; |
|---|
| 1901 | | - wl_country_t cur_cspec = {{0}, 0, {0}}; |
|---|
| 1902 | | - int err = 0; |
|---|
| 1903 | | - |
|---|
| 1904 | | - if (buf) { |
|---|
| 1905 | | - dhd_conf_get_country(dhd, &cur_cspec); |
|---|
| 1906 | | - strlcpy(cspec.country_abbrev, buf, WL_CCODE_LEN + 1); |
|---|
| 1907 | | - strlcpy(cspec.ccode, buf, WL_CCODE_LEN + 1); |
|---|
| 1908 | | - dhd_conf_map_country_list(dhd, &cspec); |
|---|
| 1909 | | - if (!memcmp(&cspec.ccode, &cur_cspec.ccode, WL_CCODE_LEN + 1) && |
|---|
| 1910 | | - (cspec.rev == cur_cspec.rev)) { |
|---|
| 1911 | | - CONFIG_MSG("country code = %s/%d is already configured\n", |
|---|
| 1912 | | - cspec.ccode, cspec.rev); |
|---|
| 1913 | | - return 0; |
|---|
| 1914 | | - } |
|---|
| 1915 | | - err = dhd_conf_set_country(dhd, &cspec); |
|---|
| 1916 | | - if (!err) { |
|---|
| 1917 | | - dhd_conf_fix_country(dhd); |
|---|
| 1918 | | - } |
|---|
| 1919 | | - dhd_conf_get_country(dhd, &dhd->dhd_cspec); |
|---|
| 1920 | | - } |
|---|
| 1921 | | - |
|---|
| 1922 | | - return err; |
|---|
| 1923 | | -} |
|---|
| 1924 | | - |
|---|
| 1925 | 1697 | typedef int (tpl_parse_t)(dhd_pub_t *dhd, char *name, char *buf); |
|---|
| 1926 | 1698 | |
|---|
| 1927 | 1699 | typedef struct iovar_tpl_t { |
|---|
| .. | .. |
|---|
| 1937 | 1709 | #ifndef SUPPORT_RANDOM_MAC_SCAN |
|---|
| 1938 | 1710 | {WLC_SET_VAR, "scanmac", dhd_conf_scan_mac}, |
|---|
| 1939 | 1711 | #endif |
|---|
| 1940 | | - {WLC_SET_VAR, "country", dhd_conf_country}, |
|---|
| 1941 | 1712 | }; |
|---|
| 1942 | 1713 | |
|---|
| 1943 | 1714 | static int iovar_tpl_parse(const iovar_tpl_t *tpl, int tpl_count, |
|---|
| .. | .. |
|---|
| 2028 | 1799 | return band; |
|---|
| 2029 | 1800 | } |
|---|
| 2030 | 1801 | |
|---|
| 1802 | +int |
|---|
| 1803 | +dhd_conf_get_country(dhd_pub_t *dhd, wl_country_t *cspec) |
|---|
| 1804 | +{ |
|---|
| 1805 | + int bcmerror = -1; |
|---|
| 1806 | + |
|---|
| 1807 | + memset(cspec, 0, sizeof(wl_country_t)); |
|---|
| 1808 | + bcm_mkiovar("country", NULL, 0, (char*)cspec, sizeof(wl_country_t)); |
|---|
| 1809 | + if ((bcmerror = dhd_wl_ioctl_cmd(dhd, WLC_GET_VAR, cspec, sizeof(wl_country_t), |
|---|
| 1810 | + FALSE, 0)) < 0) |
|---|
| 1811 | + CONFIG_ERROR("country code getting failed %d\n", bcmerror); |
|---|
| 1812 | + |
|---|
| 1813 | + return bcmerror; |
|---|
| 1814 | +} |
|---|
| 1815 | + |
|---|
| 1816 | +int |
|---|
| 1817 | +dhd_conf_map_country_list(dhd_pub_t *dhd, wl_country_t *cspec) |
|---|
| 1818 | +{ |
|---|
| 1819 | + int bcmerror = -1; |
|---|
| 1820 | + struct dhd_conf *conf = dhd->conf; |
|---|
| 1821 | + country_list_t *country = conf->country_head; |
|---|
| 1822 | + |
|---|
| 1823 | +#ifdef CCODE_LIST |
|---|
| 1824 | + bcmerror = dhd_ccode_map_country_list(dhd, cspec); |
|---|
| 1825 | +#endif |
|---|
| 1826 | + // **:XZ/11 => return XZ/11 if not found |
|---|
| 1827 | + // **:**/0 => return user specified ccode if not found, but set regrev 0 |
|---|
| 1828 | + while (country != NULL) { |
|---|
| 1829 | + if (!strncmp("**", country->cspec.country_abbrev, 2)) { |
|---|
| 1830 | + if (!strncmp("**", country->cspec.ccode, 2)) { |
|---|
| 1831 | + cspec->rev = 0; |
|---|
| 1832 | + bcmerror = 0; |
|---|
| 1833 | + break; |
|---|
| 1834 | + } |
|---|
| 1835 | + memcpy(cspec->ccode, country->cspec.ccode, WLC_CNTRY_BUF_SZ); |
|---|
| 1836 | + cspec->rev = country->cspec.rev; |
|---|
| 1837 | + bcmerror = 0; |
|---|
| 1838 | + break; |
|---|
| 1839 | + } else if (!strncmp(cspec->country_abbrev, |
|---|
| 1840 | + country->cspec.country_abbrev, 2)) { |
|---|
| 1841 | + memcpy(cspec->ccode, country->cspec.ccode, WLC_CNTRY_BUF_SZ); |
|---|
| 1842 | + cspec->rev = country->cspec.rev; |
|---|
| 1843 | + bcmerror = 0; |
|---|
| 1844 | + break; |
|---|
| 1845 | + } |
|---|
| 1846 | + country = country->next; |
|---|
| 1847 | + } |
|---|
| 1848 | + |
|---|
| 1849 | + if (!bcmerror) |
|---|
| 1850 | + CONFIG_MSG("%s/%d\n", cspec->ccode, cspec->rev); |
|---|
| 1851 | + |
|---|
| 1852 | + return bcmerror; |
|---|
| 1853 | +} |
|---|
| 1854 | + |
|---|
| 1855 | +int |
|---|
| 1856 | +dhd_conf_set_country(dhd_pub_t *dhd, wl_country_t *cspec) |
|---|
| 1857 | +{ |
|---|
| 1858 | + int bcmerror = -1; |
|---|
| 1859 | + |
|---|
| 1860 | + memset(&dhd->dhd_cspec, 0, sizeof(wl_country_t)); |
|---|
| 1861 | + |
|---|
| 1862 | + CONFIG_MSG("set country %s, revision %d\n", cspec->ccode, cspec->rev); |
|---|
| 1863 | + bcmerror = dhd_conf_set_bufiovar(dhd, 0, WLC_SET_VAR, "country", (char *)cspec, |
|---|
| 1864 | + sizeof(wl_country_t), FALSE); |
|---|
| 1865 | + dhd_conf_get_country(dhd, cspec); |
|---|
| 1866 | + CONFIG_MSG("Country code: %s (%s/%d)\n", |
|---|
| 1867 | + cspec->country_abbrev, cspec->ccode, cspec->rev); |
|---|
| 1868 | + |
|---|
| 1869 | + return bcmerror; |
|---|
| 1870 | +} |
|---|
| 1871 | + |
|---|
| 1872 | +int |
|---|
| 1873 | +dhd_conf_fix_country(dhd_pub_t *dhd) |
|---|
| 1874 | +{ |
|---|
| 1875 | + int bcmerror = -1; |
|---|
| 1876 | + int band; |
|---|
| 1877 | + wl_uint32_list_t *list; |
|---|
| 1878 | + u8 valid_chan_list[sizeof(u32)*(WL_NUMCHANNELS + 1)]; |
|---|
| 1879 | + wl_country_t cspec; |
|---|
| 1880 | + |
|---|
| 1881 | + if (!(dhd && dhd->conf)) { |
|---|
| 1882 | + return bcmerror; |
|---|
| 1883 | + } |
|---|
| 1884 | + |
|---|
| 1885 | + memset(valid_chan_list, 0, sizeof(valid_chan_list)); |
|---|
| 1886 | + list = (wl_uint32_list_t *)(void *) valid_chan_list; |
|---|
| 1887 | + list->count = htod32(WL_NUMCHANNELS); |
|---|
| 1888 | + if ((bcmerror = dhd_wl_ioctl_cmd(dhd, WLC_GET_VALID_CHANNELS, valid_chan_list, |
|---|
| 1889 | + sizeof(valid_chan_list), FALSE, 0)) < 0) { |
|---|
| 1890 | + CONFIG_ERROR("get channels failed with %d\n", bcmerror); |
|---|
| 1891 | + } |
|---|
| 1892 | + |
|---|
| 1893 | + band = dhd_conf_get_band(dhd); |
|---|
| 1894 | + |
|---|
| 1895 | + if (bcmerror || ((band==WLC_BAND_AUTO || band==WLC_BAND_2G || band==-1) && |
|---|
| 1896 | + dtoh32(list->count)<11)) { |
|---|
| 1897 | + CONFIG_ERROR("bcmerror=%d, # of channels %d\n", |
|---|
| 1898 | + bcmerror, dtoh32(list->count)); |
|---|
| 1899 | + dhd_conf_map_country_list(dhd, &dhd->conf->cspec); |
|---|
| 1900 | + if ((bcmerror = dhd_conf_set_country(dhd, &dhd->conf->cspec)) < 0) { |
|---|
| 1901 | + strcpy(cspec.country_abbrev, "US"); |
|---|
| 1902 | + cspec.rev = 0; |
|---|
| 1903 | + strcpy(cspec.ccode, "US"); |
|---|
| 1904 | + dhd_conf_map_country_list(dhd, &cspec); |
|---|
| 1905 | + dhd_conf_set_country(dhd, &cspec); |
|---|
| 1906 | + } |
|---|
| 1907 | + } |
|---|
| 1908 | + |
|---|
| 1909 | + return bcmerror; |
|---|
| 1910 | +} |
|---|
| 1911 | + |
|---|
| 2031 | 1912 | bool |
|---|
| 2032 | 1913 | dhd_conf_match_channel(dhd_pub_t *dhd, uint32 channel) |
|---|
| 2033 | 1914 | { |
|---|
| .. | .. |
|---|
| 2050 | 1931 | } |
|---|
| 2051 | 1932 | |
|---|
| 2052 | 1933 | int |
|---|
| 2053 | | -dhd_conf_set_roam(dhd_pub_t *dhd, int ifidx) |
|---|
| 1934 | +dhd_conf_set_roam(dhd_pub_t *dhd) |
|---|
| 2054 | 1935 | { |
|---|
| 2055 | 1936 | int bcmerror = -1; |
|---|
| 2056 | 1937 | struct dhd_conf *conf = dhd->conf; |
|---|
| 2057 | 1938 | uint wnm_bsstrans_resp = 0; |
|---|
| 2058 | 1939 | |
|---|
| 2059 | 1940 | if (dhd->conf->chip == BCM4359_CHIP_ID) { |
|---|
| 2060 | | - dhd_conf_get_iovar(dhd, ifidx, WLC_GET_VAR, "wnm_bsstrans_resp", |
|---|
| 1941 | + dhd_conf_get_iovar(dhd, 0, WLC_GET_VAR, "wnm_bsstrans_resp", |
|---|
| 2061 | 1942 | (char *)&wnm_bsstrans_resp, sizeof(wnm_bsstrans_resp)); |
|---|
| 2062 | 1943 | if (wnm_bsstrans_resp == WL_BSSTRANS_POLICY_PRODUCT) { |
|---|
| 2063 | 1944 | dhd->wbtext_policy = WL_BSSTRANS_POLICY_ROAM_ALWAYS; |
|---|
| 2064 | | - dhd_conf_set_intiovar(dhd, ifidx, WLC_SET_VAR, "wnm_bsstrans_resp", |
|---|
| 1945 | + dhd_conf_set_intiovar(dhd, 0, WLC_SET_VAR, "wnm_bsstrans_resp", |
|---|
| 2065 | 1946 | WL_BSSTRANS_POLICY_ROAM_ALWAYS, 0, FALSE); |
|---|
| 2066 | 1947 | } |
|---|
| 2067 | 1948 | } |
|---|
| 2068 | 1949 | |
|---|
| 2069 | 1950 | dhd_roam_disable = conf->roam_off; |
|---|
| 2070 | | - dhd_conf_set_intiovar(dhd, ifidx, WLC_SET_VAR, "roam_off", dhd->conf->roam_off, 0, FALSE); |
|---|
| 1951 | + dhd_conf_set_intiovar(dhd, 0, WLC_SET_VAR, "roam_off", dhd->conf->roam_off, 0, FALSE); |
|---|
| 2071 | 1952 | |
|---|
| 2072 | 1953 | if (!conf->roam_off || !conf->roam_off_suspend) { |
|---|
| 2073 | 1954 | CONFIG_MSG("set roam_trigger %d\n", conf->roam_trigger[0]); |
|---|
| 2074 | | - dhd_conf_set_bufiovar(dhd, ifidx, WLC_SET_ROAM_TRIGGER, "WLC_SET_ROAM_TRIGGER", |
|---|
| 1955 | + dhd_conf_set_bufiovar(dhd, 0, WLC_SET_ROAM_TRIGGER, "WLC_SET_ROAM_TRIGGER", |
|---|
| 2075 | 1956 | (char *)conf->roam_trigger, sizeof(conf->roam_trigger), FALSE); |
|---|
| 2076 | 1957 | |
|---|
| 2077 | 1958 | CONFIG_MSG("set roam_scan_period %d\n", conf->roam_scan_period[0]); |
|---|
| 2078 | | - dhd_conf_set_bufiovar(dhd, ifidx, WLC_SET_ROAM_SCAN_PERIOD, "WLC_SET_ROAM_SCAN_PERIOD", |
|---|
| 1959 | + dhd_conf_set_bufiovar(dhd, 0, WLC_SET_ROAM_SCAN_PERIOD, "WLC_SET_ROAM_SCAN_PERIOD", |
|---|
| 2079 | 1960 | (char *)conf->roam_scan_period, sizeof(conf->roam_scan_period), FALSE); |
|---|
| 2080 | 1961 | |
|---|
| 2081 | 1962 | CONFIG_MSG("set roam_delta %d\n", conf->roam_delta[0]); |
|---|
| 2082 | | - dhd_conf_set_bufiovar(dhd, ifidx, WLC_SET_ROAM_DELTA, "WLC_SET_ROAM_DELTA", |
|---|
| 1963 | + dhd_conf_set_bufiovar(dhd, 0, WLC_SET_ROAM_DELTA, "WLC_SET_ROAM_DELTA", |
|---|
| 2083 | 1964 | (char *)conf->roam_delta, sizeof(conf->roam_delta), FALSE); |
|---|
| 2084 | 1965 | |
|---|
| 2085 | | - dhd_conf_set_intiovar(dhd, ifidx, WLC_SET_VAR, "fullroamperiod", |
|---|
| 1966 | + dhd_conf_set_intiovar(dhd, 0, WLC_SET_VAR, "fullroamperiod", |
|---|
| 2086 | 1967 | dhd->conf->fullroamperiod, 1, FALSE); |
|---|
| 2087 | 1968 | } |
|---|
| 2088 | 1969 | |
|---|
| .. | .. |
|---|
| 2377 | 2258 | * Case 3: magic pkt and event wake up |
|---|
| 2378 | 2259 | * 1) dhd_master_mode=1 |
|---|
| 2379 | 2260 | * 2) pkt_filter_delete=100, 102, 103, 104, 105, 106, 107 |
|---|
| 2380 | | - * 3) magic_pkt_filter_add=141 0 1 12 |
|---|
| 2381 | | - * 4) rekey_offload=1 |
|---|
| 2261 | + * 3) pkt_filter_add=141 0 0 0 0xFFFFFFFFFFFF 0x000000000000 |
|---|
| 2262 | + * 4) magic_pkt_filter_add=141 0 1 12 |
|---|
| 2263 | + * 5) rekey_offload=1 |
|---|
| 2382 | 2264 | */ |
|---|
| 2383 | 2265 | for(i=0; i<dhd->conf->pkt_filter_add.count; i++) { |
|---|
| 2384 | 2266 | dhd->pktfilter[i+dhd->pktfilter_count] = dhd->conf->pkt_filter_add.filter[i]; |
|---|
| .. | .. |
|---|
| 2460 | 2342 | int *hostsleep_set, int *hostsleep_val, int *ret) |
|---|
| 2461 | 2343 | { |
|---|
| 2462 | 2344 | if (dhd->conf->insuspend & (NO_TXCTL_IN_SUSPEND | WOWL_IN_SUSPEND)) { |
|---|
| 2463 | | - int wowl_dngldown = 0; |
|---|
| 2464 | | -#ifdef WL_EXT_WOWL |
|---|
| 2465 | | - wowl_dngldown = dhd_conf_wowl_dngldown(dhd); |
|---|
| 2466 | | -#endif |
|---|
| 2467 | 2345 | if (cmd == WLC_SET_VAR) { |
|---|
| 2468 | 2346 | char *psleep = NULL; |
|---|
| 2469 | | - if (wowl_dngldown) { |
|---|
| 2470 | | - psleep = strstr(buf, "wowl_activate"); |
|---|
| 2471 | | - if (psleep) { |
|---|
| 2472 | | - *hostsleep_set = 1; |
|---|
| 2473 | | - memcpy(hostsleep_val, psleep+strlen("wowl_activate")+1, sizeof(int)); |
|---|
| 2474 | | - } |
|---|
| 2475 | | - } else { |
|---|
| 2476 | | - psleep = strstr(buf, "hostsleep"); |
|---|
| 2477 | | - if (psleep) { |
|---|
| 2478 | | - *hostsleep_set = 1; |
|---|
| 2479 | | - memcpy(hostsleep_val, psleep+strlen("hostsleep")+1, sizeof(int)); |
|---|
| 2480 | | - } |
|---|
| 2347 | + psleep = strstr(buf, "hostsleep"); |
|---|
| 2348 | + if (psleep) { |
|---|
| 2349 | + *hostsleep_set = 1; |
|---|
| 2350 | + memcpy(hostsleep_val, psleep+strlen("hostsleep")+1, sizeof(int)); |
|---|
| 2481 | 2351 | } |
|---|
| 2482 | 2352 | } |
|---|
| 2483 | 2353 | if (dhd->hostsleep && (!*hostsleep_set || *hostsleep_val)) { |
|---|
| .. | .. |
|---|
| 2719 | 2589 | |
|---|
| 2720 | 2590 | return ret; |
|---|
| 2721 | 2591 | } |
|---|
| 2722 | | - |
|---|
| 2723 | | -int |
|---|
| 2724 | | -dhd_conf_wowl_dngldown(dhd_pub_t *dhd) |
|---|
| 2725 | | -{ |
|---|
| 2726 | | - int wowl_dngldown = 0; |
|---|
| 2727 | | -#ifdef BCMDBUS |
|---|
| 2728 | | - uint insuspend = 0; |
|---|
| 2729 | | - insuspend = dhd_conf_get_insuspend(dhd, ALL_IN_SUSPEND); |
|---|
| 2730 | | - if ((insuspend & WOWL_IN_SUSPEND) && dhd_master_mode) { |
|---|
| 2731 | | - wowl_dngldown = dhd->conf->wowl_dngldown; |
|---|
| 2732 | | - } |
|---|
| 2733 | | -#endif |
|---|
| 2734 | | - |
|---|
| 2735 | | - return wowl_dngldown; |
|---|
| 2736 | | -} |
|---|
| 2737 | 2592 | #endif |
|---|
| 2738 | 2593 | |
|---|
| 2739 | 2594 | int |
|---|
| 2740 | 2595 | dhd_conf_mkeep_alive(dhd_pub_t *dhd, int ifidx, int id, int period, |
|---|
| 2741 | 2596 | char *packet, bool bcast) |
|---|
| 2742 | 2597 | { |
|---|
| 2743 | | - wl_mkeep_alive_pkt_v1_t *mkeep_alive_pktp; |
|---|
| 2598 | + wl_mkeep_alive_pkt_t *mkeep_alive_pktp; |
|---|
| 2744 | 2599 | int ret = 0, len_bytes=0, buf_len=0; |
|---|
| 2745 | 2600 | char *buf = NULL, *iovar_buf = NULL; |
|---|
| 2746 | 2601 | uint8 *pdata; |
|---|
| .. | .. |
|---|
| 2757 | 2612 | CONFIG_ERROR("Failed to allocate buffer of %d bytes\n", WLC_IOCTL_SMLEN); |
|---|
| 2758 | 2613 | goto exit; |
|---|
| 2759 | 2614 | } |
|---|
| 2760 | | - mkeep_alive_pktp = (wl_mkeep_alive_pkt_v1_t *)buf; |
|---|
| 2761 | | - mkeep_alive_pktp->version = htod16(WL_MKEEP_ALIVE_VERSION_1); |
|---|
| 2615 | + mkeep_alive_pktp = (wl_mkeep_alive_pkt_t *)buf; |
|---|
| 2616 | + mkeep_alive_pktp->version = htod16(WL_MKEEP_ALIVE_VERSION); |
|---|
| 2762 | 2617 | mkeep_alive_pktp->length = htod16(WL_MKEEP_ALIVE_FIXED_LEN); |
|---|
| 2763 | 2618 | mkeep_alive_pktp->keep_alive_id = id; |
|---|
| 2764 | 2619 | buf_len += WL_MKEEP_ALIVE_FIXED_LEN; |
|---|
| .. | .. |
|---|
| 2994 | 2849 | for(i=0; i<conf->pkt_filter_add.count; i++) { |
|---|
| 2995 | 2850 | dhd_conf_wowl_pattern(dhd, ifidx, TRUE, conf->pkt_filter_add.filter[i]); |
|---|
| 2996 | 2851 | } |
|---|
| 2997 | | - CONFIG_MSG("wowl = 0x%x\n", conf->wowl); |
|---|
| 2998 | 2852 | dhd_conf_set_intiovar(dhd, ifidx, WLC_SET_VAR, "wowl", conf->wowl, 0, FALSE); |
|---|
| 2999 | | -#ifdef BCMDBUS |
|---|
| 3000 | | - CONFIG_MSG("wowl_dngldown = %d\n", conf->wowl_dngldown); |
|---|
| 3001 | | - dhd_conf_set_intiovar(dhd, ifidx, WLC_SET_VAR, "wowl_dngldown", conf->wowl_dngldown, 1, FALSE); |
|---|
| 3002 | | -#endif |
|---|
| 2853 | + dhd_conf_set_intiovar(dhd, ifidx, WLC_SET_VAR, "wowl_activate", 1, 0, FALSE); |
|---|
| 3003 | 2854 | dhd_conf_wowl_wakeind(dhd, ifidx, TRUE); |
|---|
| 3004 | 2855 | } |
|---|
| 3005 | 2856 | #endif |
|---|
| 3006 | 2857 | } |
|---|
| 3007 | 2858 | else { |
|---|
| 3008 | | - dhd_conf_get_iovar(dhd, ifidx, WLC_GET_PM, "WLC_GET_PM", (char *)&pm, sizeof(pm)); |
|---|
| 2859 | + dhd_conf_get_iovar(dhd, 0, WLC_GET_PM, "WLC_GET_PM", (char *)&pm, sizeof(pm)); |
|---|
| 3009 | 2860 | CONFIG_TRACE("PM in suspend = %d\n", pm); |
|---|
| 3010 | 2861 | if (conf->pm >= 0) |
|---|
| 3011 | 2862 | pm = conf->pm; |
|---|
| .. | .. |
|---|
| 3015 | 2866 | #ifdef WL_EXT_WOWL |
|---|
| 3016 | 2867 | if (insuspend & WOWL_IN_SUSPEND) { |
|---|
| 3017 | 2868 | dhd_conf_wowl_wakeind(dhd, ifidx, FALSE); |
|---|
| 3018 | | -// dhd_conf_set_intiovar(dhd, ifidx, WLC_SET_VAR, "wowl_activate", 0, 0, FALSE); |
|---|
| 2869 | + dhd_conf_set_intiovar(dhd, ifidx, WLC_SET_VAR, "wowl_activate", 0, 0, FALSE); |
|---|
| 3019 | 2870 | dhd_conf_set_intiovar(dhd, ifidx, WLC_SET_VAR, "wowl", 0, 0, FALSE); |
|---|
| 3020 | 2871 | dhd_conf_wowl_pattern(dhd, ifidx, FALSE, "clr"); |
|---|
| 3021 | 2872 | } |
|---|
| .. | .. |
|---|
| 3065 | 2916 | |
|---|
| 3066 | 2917 | if (suspend) { |
|---|
| 3067 | 2918 | if (insuspend & (WOWL_IN_SUSPEND | NO_TXCTL_IN_SUSPEND)) { |
|---|
| 2919 | +#ifdef BCMSDIO |
|---|
| 3068 | 2920 | uint32 intstatus = 0; |
|---|
| 3069 | | - int ret = 0, hostsleep = 2, wowl_dngldown = 0; |
|---|
| 2921 | + int ret = 0; |
|---|
| 2922 | +#endif |
|---|
| 2923 | + int hostsleep = 2; |
|---|
| 3070 | 2924 | #ifdef WL_EXT_WOWL |
|---|
| 3071 | 2925 | hostsleep = 1; |
|---|
| 3072 | | - if ((insuspend & WOWL_IN_SUSPEND) && dhd_master_mode) { |
|---|
| 3073 | | - dhd_conf_set_intiovar(dhd, 0, WLC_SET_VAR, "wowl_activate", 1, 0, FALSE); |
|---|
| 3074 | | -#ifdef BCMDBUS |
|---|
| 3075 | | - wowl_dngldown = dhd->conf->wowl_dngldown; |
|---|
| 3076 | 2926 | #endif |
|---|
| 3077 | | - } |
|---|
| 3078 | | -#endif |
|---|
| 3079 | | - if (!wowl_dngldown) { |
|---|
| 3080 | | - dhd_conf_set_intiovar(dhd, 0, WLC_SET_VAR, "hostsleep", hostsleep, 0, FALSE); |
|---|
| 3081 | | - } |
|---|
| 2927 | + dhd_conf_set_intiovar(dhd, 0, WLC_SET_VAR, "hostsleep", hostsleep, 0, FALSE); |
|---|
| 3082 | 2928 | #ifdef BCMSDIO |
|---|
| 3083 | 2929 | ret = dhd_bus_sleep(dhd, TRUE, &intstatus); |
|---|
| 2930 | + CONFIG_TRACE("ret = %d, intstatus = 0x%x\n", ret, intstatus); |
|---|
| 3084 | 2931 | #endif |
|---|
| 3085 | | -#ifdef BCMPCIE |
|---|
| 3086 | | - ret = dhd_bus_sleep(dhd, TRUE, NULL); |
|---|
| 3087 | | -#endif |
|---|
| 3088 | | -#ifdef BCMDBUS |
|---|
| 3089 | | - if (wowl_dngldown) { |
|---|
| 3090 | | - ret = dhd_bus_sleep(dhd, TRUE, NULL); |
|---|
| 3091 | | - } |
|---|
| 3092 | | -#endif |
|---|
| 3093 | | - CONFIG_MSG("ret = %d, intstatus = 0x%x\n", ret, intstatus); |
|---|
| 3094 | 2932 | } |
|---|
| 3095 | 2933 | } else { |
|---|
| 3096 | 2934 | if (insuspend & (WOWL_IN_SUSPEND | NO_TXCTL_IN_SUSPEND)) { |
|---|
| .. | .. |
|---|
| 3668 | 3506 | else if (!strncmp("fullroamperiod=", full_param, len_param)) { |
|---|
| 3669 | 3507 | conf->fullroamperiod = (int)simple_strtol(data, NULL, 10); |
|---|
| 3670 | 3508 | CONFIG_MSG("fullroamperiod = %d\n", conf->fullroamperiod); |
|---|
| 3671 | | - } |
|---|
| 3672 | | - else if (!strncmp("wl_reassoc_support=", full_param, len_param)) { |
|---|
| 3673 | | - if (!strncmp(data, "0", 1)) |
|---|
| 3674 | | - wl_reassoc_support = FALSE; |
|---|
| 3675 | | - else |
|---|
| 3676 | | - wl_reassoc_support = TRUE; |
|---|
| 3677 | | - CONFIG_MSG("wl_reassoc_support = %d\n", wl_reassoc_support); |
|---|
| 3678 | | - } |
|---|
| 3679 | | - else |
|---|
| 3509 | + } else |
|---|
| 3680 | 3510 | return false; |
|---|
| 3681 | 3511 | |
|---|
| 3682 | 3512 | return true; |
|---|
| .. | .. |
|---|
| 4015 | 3845 | dhd_doflow = TRUE; |
|---|
| 4016 | 3846 | CONFIG_MSG("dhd_doflow = %d\n", dhd_doflow); |
|---|
| 4017 | 3847 | } |
|---|
| 4018 | | - else if (!strncmp("dhd_slpauto=", full_param, len_param)) { |
|---|
| 4019 | | - if (!strncmp(data, "0", 1)) { |
|---|
| 4020 | | - dhd_conf_disable_slpauto(dhd); |
|---|
| 4021 | | - } else |
|---|
| 3848 | + else if (!strncmp("dhd_slpauto=", full_param, len_param) || |
|---|
| 3849 | + !strncmp("kso_enable=", full_param, len_param)) { |
|---|
| 3850 | + if (!strncmp(data, "0", 1)) |
|---|
| 3851 | + dhd_slpauto = FALSE; |
|---|
| 3852 | + else |
|---|
| 4022 | 3853 | dhd_slpauto = TRUE; |
|---|
| 4023 | 3854 | CONFIG_MSG("dhd_slpauto = %d\n", dhd_slpauto); |
|---|
| 4024 | 3855 | } |
|---|
| .. | .. |
|---|
| 4190 | 4021 | conf->enq_hdr_pkt = (int)simple_strtol(data, NULL, 0); |
|---|
| 4191 | 4022 | CONFIG_MSG("enq_hdr_pkt = 0x%x\n", conf->enq_hdr_pkt); |
|---|
| 4192 | 4023 | } |
|---|
| 4193 | | - else if (!strncmp("aspm=", full_param, len_param)) { |
|---|
| 4194 | | - conf->aspm = (int)simple_strtol(data, NULL, 0); |
|---|
| 4195 | | - CONFIG_MSG("aspm = %d\n", conf->aspm); |
|---|
| 4196 | | - } |
|---|
| 4197 | | - else if (!strncmp("l1ss=", full_param, len_param)) { |
|---|
| 4198 | | - conf->l1ss = (int)simple_strtol(data, NULL, 0); |
|---|
| 4199 | | - CONFIG_MSG("l1ss = %d\n", conf->l1ss); |
|---|
| 4200 | | - } |
|---|
| 4201 | 4024 | else |
|---|
| 4202 | 4025 | return false; |
|---|
| 4203 | 4026 | |
|---|
| .. | .. |
|---|
| 4256 | 4079 | conf->wowl = (int)simple_strtol(data, NULL, 0); |
|---|
| 4257 | 4080 | CONFIG_MSG("wowl = 0x%x\n", conf->wowl); |
|---|
| 4258 | 4081 | } |
|---|
| 4259 | | -#ifdef BCMDBUS |
|---|
| 4260 | | - else if (!strncmp("wowl_dngldown=", full_param, len_param)) { |
|---|
| 4261 | | - conf->wowl_dngldown = (int)simple_strtol(data, NULL, 0); |
|---|
| 4262 | | - CONFIG_MSG("wowl_dngldown = 0x%x\n", conf->wowl_dngldown); |
|---|
| 4263 | | - } |
|---|
| 4264 | | -#endif |
|---|
| 4265 | 4082 | #endif |
|---|
| 4266 | 4083 | else if (!strncmp("rekey_offload=", full_param, len_param)) { |
|---|
| 4267 | 4084 | if (!strncmp(data, "1", 1)) |
|---|
| .. | .. |
|---|
| 4446 | 4263 | conf->in4way = (int)simple_strtol(data, NULL, 0); |
|---|
| 4447 | 4264 | CONFIG_MSG("in4way = 0x%x\n", conf->in4way); |
|---|
| 4448 | 4265 | } |
|---|
| 4449 | | -#ifdef BTC_WAR |
|---|
| 4450 | | - else if (!strncmp("btc_war=", full_param, len_param)) { |
|---|
| 4451 | | - btc_war = (int)simple_strtol(data, NULL, 0); |
|---|
| 4452 | | - CONFIG_MSG("btc_war = 0x%x\n", btc_war); |
|---|
| 4453 | | - } |
|---|
| 4454 | | -#endif /* BTC_WAR */ |
|---|
| 4455 | 4266 | else if (!strncmp("war=", full_param, len_param)) { |
|---|
| 4456 | 4267 | conf->war = (int)simple_strtol(data, NULL, 0); |
|---|
| 4457 | 4268 | CONFIG_MSG("war = 0x%x\n", conf->war); |
|---|
| .. | .. |
|---|
| 4873 | 4684 | } |
|---|
| 4874 | 4685 | |
|---|
| 4875 | 4686 | } |
|---|
| 4876 | | - |
|---|
| 4877 | | -static void |
|---|
| 4878 | | -dhd_conf_set_ampdu_mpdu(dhd_pub_t *dhd) |
|---|
| 4879 | | -{ |
|---|
| 4880 | | - uint chip = dhd->conf->chip; |
|---|
| 4881 | | - char ampdu_mpdu[32] = "ampdu_mpdu="; |
|---|
| 4882 | | - int val = -1; |
|---|
| 4883 | | - |
|---|
| 4884 | | - if (chip == BCM43362_CHIP_ID || chip == BCM4330_CHIP_ID || |
|---|
| 4885 | | - chip == BCM4334_CHIP_ID || chip == BCM43340_CHIP_ID || |
|---|
| 4886 | | - chip == BCM43341_CHIP_ID || chip == BCM4324_CHIP_ID || |
|---|
| 4887 | | - chip == BCM4335_CHIP_ID || chip == BCM4339_CHIP_ID || |
|---|
| 4888 | | - chip == BCM4354_CHIP_ID || chip == BCM4356_CHIP_ID || |
|---|
| 4889 | | - chip == BCM4371_CHIP_ID || |
|---|
| 4890 | | - chip == BCM43430_CHIP_ID || |
|---|
| 4891 | | - chip == BCM4345_CHIP_ID || chip == BCM43454_CHIP_ID || |
|---|
| 4892 | | - chip == BCM4359_CHIP_ID || chip == BCM43012_CHIP_ID) { |
|---|
| 4893 | | - val = 16; |
|---|
| 4894 | | - } else if (chip == BCM43751_CHIP_ID || chip == BCM43752_CHIP_ID) { |
|---|
| 4895 | | - val = 32; |
|---|
| 4896 | | - } |
|---|
| 4897 | | - |
|---|
| 4898 | | - if (val > 0) { |
|---|
| 4899 | | - snprintf(ampdu_mpdu+strlen(ampdu_mpdu), sizeof(ampdu_mpdu), "%d", val); |
|---|
| 4900 | | - dhd_conf_set_wl_cmd(dhd, ampdu_mpdu, TRUE); |
|---|
| 4901 | | - } |
|---|
| 4902 | | -} |
|---|
| 4903 | | - |
|---|
| 4904 | | -#if defined(SDIO_ISR_THREAD) |
|---|
| 4905 | | -static void |
|---|
| 4906 | | -dhd_conf_set_intr_extn(dhd_pub_t *dhd) |
|---|
| 4907 | | -{ |
|---|
| 4908 | | - uint chip = dhd->conf->chip; |
|---|
| 4909 | | - |
|---|
| 4910 | | - if (chip == BCM43012_CHIP_ID || |
|---|
| 4911 | | - chip == BCM4335_CHIP_ID || chip == BCM4339_CHIP_ID || |
|---|
| 4912 | | - chip == BCM43454_CHIP_ID || chip == BCM4345_CHIP_ID || |
|---|
| 4913 | | - chip == BCM4354_CHIP_ID || chip == BCM4356_CHIP_ID || |
|---|
| 4914 | | - chip == BCM4345_CHIP_ID || chip == BCM4371_CHIP_ID || |
|---|
| 4915 | | - chip == BCM4359_CHIP_ID || |
|---|
| 4916 | | - chip == BCM43751_CHIP_ID || chip == BCM43752_CHIP_ID || |
|---|
| 4917 | | - chip == BCM4375_CHIP_ID) { |
|---|
| 4918 | | - CONFIG_TRACE("enable intr_extn\n"); |
|---|
| 4919 | | - dhd->conf->intr_extn = TRUE; |
|---|
| 4920 | | - } |
|---|
| 4921 | | -} |
|---|
| 4922 | | -#endif /* SDIO_ISR_THREAD */ |
|---|
| 4923 | 4687 | #endif |
|---|
| 4924 | | - |
|---|
| 4925 | | -static void |
|---|
| 4926 | | -dhd_conf_set_txbf(dhd_pub_t *dhd) |
|---|
| 4927 | | -{ |
|---|
| 4928 | | - uint chip = dhd->conf->chip; |
|---|
| 4929 | | - |
|---|
| 4930 | | - if (chip == BCM4354_CHIP_ID || chip == BCM4356_CHIP_ID || |
|---|
| 4931 | | - chip == BCM4371_CHIP_ID || chip == BCM4359_CHIP_ID || |
|---|
| 4932 | | - chip == BCM43569_CHIP_ID || |
|---|
| 4933 | | - chip == BCM43751_CHIP_ID || chip == BCM43752_CHIP_ID || |
|---|
| 4934 | | - chip == BCM4375_CHIP_ID) { |
|---|
| 4935 | | - CONFIG_TRACE("enable txbf\n"); |
|---|
| 4936 | | - dhd_conf_set_intiovar(dhd, 0, WLC_SET_VAR, "txbf", 1, 0, FALSE); |
|---|
| 4937 | | - } |
|---|
| 4938 | | -} |
|---|
| 4939 | | - |
|---|
| 4940 | | -static void |
|---|
| 4941 | | -dhd_conf_tput_improve(dhd_pub_t *dhd) |
|---|
| 4942 | | -{ |
|---|
| 4943 | | - struct dhd_conf *conf = dhd->conf; |
|---|
| 4944 | | - uint chip = conf->chip; |
|---|
| 4945 | | - uint chiprev = conf->chiprev; |
|---|
| 4946 | | - |
|---|
| 4947 | | - if ((chip == BCM43430_CHIP_ID && chiprev == 2) || |
|---|
| 4948 | | - chip == BCM43012_CHIP_ID || |
|---|
| 4949 | | - chip == BCM4335_CHIP_ID || chip == BCM4339_CHIP_ID || |
|---|
| 4950 | | - chip == BCM43454_CHIP_ID || chip == BCM4345_CHIP_ID || |
|---|
| 4951 | | - chip == BCM4354_CHIP_ID || chip == BCM4356_CHIP_ID || |
|---|
| 4952 | | - chip == BCM4345_CHIP_ID || chip == BCM4371_CHIP_ID || |
|---|
| 4953 | | - chip == BCM43569_CHIP_ID || chip == BCM4359_CHIP_ID || |
|---|
| 4954 | | - chip == BCM43751_CHIP_ID || chip == BCM43752_CHIP_ID || |
|---|
| 4955 | | - chip == BCM4375_CHIP_ID) { |
|---|
| 4956 | | - CONFIG_TRACE("enable tput parameters\n"); |
|---|
| 4957 | | -#ifdef DHDTCPACK_SUPPRESS |
|---|
| 4958 | | -#ifdef BCMSDIO |
|---|
| 4959 | | - conf->tcpack_sup_mode = TCPACK_SUP_REPLACE; |
|---|
| 4960 | | -#endif |
|---|
| 4961 | | -#endif |
|---|
| 4962 | | -#if defined(BCMSDIO) || defined(BCMPCIE) |
|---|
| 4963 | | - dhd_rxbound = 128; |
|---|
| 4964 | | - dhd_txbound = 64; |
|---|
| 4965 | | -#endif |
|---|
| 4966 | | - conf->frameburst = 1; |
|---|
| 4967 | | -#ifdef BCMSDIO |
|---|
| 4968 | | - conf->dhd_txminmax = -1; |
|---|
| 4969 | | - conf->txinrx_thres = 128; |
|---|
| 4970 | | -#endif |
|---|
| 4971 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)) |
|---|
| 4972 | | - conf->orphan_move = 1; |
|---|
| 4973 | | -#else |
|---|
| 4974 | | - conf->orphan_move = 0; |
|---|
| 4975 | | -#endif |
|---|
| 4976 | | - } |
|---|
| 4977 | | -} |
|---|
| 4978 | 4688 | |
|---|
| 4979 | 4689 | #ifdef UPDATE_MODULE_NAME |
|---|
| 4980 | 4690 | #if defined(BCMSDIO) || defined(BCMPCIE) |
|---|
| .. | .. |
|---|
| 4992 | 4702 | int |
|---|
| 4993 | 4703 | dhd_conf_compat_func(dhd_pub_t *dhd) |
|---|
| 4994 | 4704 | { |
|---|
| 4995 | | - const module_name_map_t *row = NULL; |
|---|
| 4705 | + const module_name_map_t* row = NULL; |
|---|
| 4996 | 4706 | |
|---|
| 4997 | 4707 | row = dhd_conf_match_module(dhd); |
|---|
| 4998 | 4708 | if (row && row->compat_func) { |
|---|
| .. | .. |
|---|
| 5004 | 4714 | #endif |
|---|
| 5005 | 4715 | |
|---|
| 5006 | 4716 | void |
|---|
| 5007 | | -dhd_conf_preinit_ioctls_sta(dhd_pub_t *dhd, int ifidx) |
|---|
| 5008 | | -{ |
|---|
| 5009 | | - struct dhd_conf *conf = dhd->conf; |
|---|
| 5010 | | - int pm; |
|---|
| 5011 | | - |
|---|
| 5012 | | - dhd_conf_set_intiovar(dhd, ifidx, WLC_SET_VAR, "bcn_timeout", conf->bcn_timeout, 0, FALSE); |
|---|
| 5013 | | -#ifdef NO_POWER_SAVE |
|---|
| 5014 | | - pm = PM_OFF; |
|---|
| 5015 | | -#else |
|---|
| 5016 | | - if (conf->pm >= 0) |
|---|
| 5017 | | - pm = conf->pm; |
|---|
| 5018 | | - else |
|---|
| 5019 | | - pm = PM_FAST; |
|---|
| 5020 | | -#endif |
|---|
| 5021 | | - dhd_conf_set_intiovar(dhd, ifidx, WLC_SET_PM, "WLC_SET_PM", pm, 0, FALSE); |
|---|
| 5022 | | - dhd_conf_set_intiovar(dhd, ifidx, WLC_SET_VAR, "assoc_retry_max", 10, 0, FALSE); |
|---|
| 5023 | | - dhd_conf_set_roam(dhd, ifidx); |
|---|
| 5024 | | -} |
|---|
| 5025 | | - |
|---|
| 5026 | | -void |
|---|
| 5027 | 4717 | dhd_conf_postinit_ioctls(dhd_pub_t *dhd) |
|---|
| 5028 | 4718 | { |
|---|
| 5029 | 4719 | struct dhd_conf *conf = dhd->conf; |
|---|
| 5030 | | - char wl_preinit[] = ""; |
|---|
| 4720 | + char wl_preinit[] = "assoc_retry_max=10"; |
|---|
| 5031 | 4721 | #ifdef NO_POWER_SAVE |
|---|
| 5032 | 4722 | char wl_no_power_save[] = "mpc=0, 86=0"; |
|---|
| 5033 | 4723 | dhd_conf_set_wl_cmd(dhd, wl_no_power_save, FALSE); |
|---|
| 5034 | 4724 | #endif |
|---|
| 5035 | 4725 | |
|---|
| 5036 | | - dhd_conf_get_ioctl_ver(dhd); |
|---|
| 5037 | 4726 | dhd_conf_set_intiovar(dhd, 0, WLC_UP, "WLC_UP", 0, 0, FALSE); |
|---|
| 5038 | | - dhd_conf_country(dhd, "country", conf->cspec.country_abbrev); |
|---|
| 4727 | + dhd_conf_map_country_list(dhd, &conf->cspec); |
|---|
| 4728 | + dhd_conf_set_country(dhd, &conf->cspec); |
|---|
| 4729 | + dhd_conf_fix_country(dhd); |
|---|
| 4730 | + dhd_conf_get_country(dhd, &dhd->dhd_cspec); |
|---|
| 5039 | 4731 | |
|---|
| 5040 | 4732 | dhd_conf_set_intiovar(dhd, 0, WLC_SET_BAND, "WLC_SET_BAND", conf->band, 0, FALSE); |
|---|
| 4733 | + dhd_conf_set_intiovar(dhd, 0, WLC_SET_VAR, "bcn_timeout", conf->bcn_timeout, 0, FALSE); |
|---|
| 4734 | + dhd_conf_set_intiovar(dhd, 0, WLC_SET_PM, "WLC_SET_PM", conf->pm, 0, FALSE); |
|---|
| 5041 | 4735 | dhd_conf_set_intiovar(dhd, 0, WLC_SET_SRL, "WLC_SET_SRL", conf->srl, 0, FALSE); |
|---|
| 5042 | 4736 | dhd_conf_set_intiovar(dhd, 0, WLC_SET_LRL, "WLC_SET_LRL", conf->lrl, 0, FALSE); |
|---|
| 5043 | 4737 | dhd_conf_set_bw_cap(dhd); |
|---|
| 5044 | | - dhd_conf_set_roam(dhd, 0); |
|---|
| 4738 | + dhd_conf_set_roam(dhd); |
|---|
| 5045 | 4739 | |
|---|
| 5046 | 4740 | #if defined(BCMPCIE) |
|---|
| 5047 | 4741 | dhd_conf_set_intiovar(dhd, 0, WLC_SET_VAR, "bus:deepsleep_disable", |
|---|
| .. | .. |
|---|
| 5067 | 4761 | dhd_conf_set_intiovar(dhd, 0, WLC_SET_FAKEFRAG, "WLC_SET_FAKEFRAG", |
|---|
| 5068 | 4762 | conf->frameburst, 0, FALSE); |
|---|
| 5069 | 4763 | |
|---|
| 5070 | | - dhd_conf_preinit_ioctls_sta(dhd, 0); |
|---|
| 5071 | 4764 | dhd_conf_set_wl_cmd(dhd, wl_preinit, TRUE); |
|---|
| 5072 | 4765 | #if defined(BCMSDIO) |
|---|
| 5073 | | - dhd_conf_set_ampdu_mpdu(dhd); |
|---|
| 4766 | + if (conf->chip == BCM43751_CHIP_ID || conf->chip == BCM43752_CHIP_ID) { |
|---|
| 4767 | + char ampdu_mpdu[] = "ampdu_mpdu=32"; |
|---|
| 4768 | + dhd_conf_set_wl_cmd(dhd, ampdu_mpdu, TRUE); |
|---|
| 4769 | + } else { |
|---|
| 4770 | + char ampdu_mpdu[] = "ampdu_mpdu=16"; |
|---|
| 4771 | + dhd_conf_set_wl_cmd(dhd, ampdu_mpdu, TRUE); |
|---|
| 4772 | + } |
|---|
| 5074 | 4773 | #endif |
|---|
| 5075 | 4774 | |
|---|
| 5076 | 4775 | #ifdef DHD_TPUT_PATCH |
|---|
| 5077 | 4776 | if (dhd->conf->mtu) |
|---|
| 5078 | 4777 | dhd_change_mtu(dhd, dhd->conf->mtu, 0); |
|---|
| 5079 | 4778 | #endif |
|---|
| 5080 | | - dhd_conf_set_txbf(dhd); |
|---|
| 4779 | + if (conf->chip == BCM4354_CHIP_ID || conf->chip == BCM4356_CHIP_ID || |
|---|
| 4780 | + conf->chip == BCM4371_CHIP_ID || conf->chip == BCM4359_CHIP_ID || |
|---|
| 4781 | + conf->chip == BCM43569_CHIP_ID || |
|---|
| 4782 | + conf->chip == BCM43751_CHIP_ID || conf->chip == BCM43752_CHIP_ID || |
|---|
| 4783 | + conf->chip == BCM4375_CHIP_ID) { |
|---|
| 4784 | + dhd_conf_set_intiovar(dhd, 0, WLC_SET_VAR, "txbf", 1, 0, FALSE); |
|---|
| 4785 | + } |
|---|
| 5081 | 4786 | if (conf->chip == BCM4375_CHIP_ID) { |
|---|
| 5082 | 4787 | char he_cmd[] = "110=1, nmode=1, vhtmode=1, he=enab 1"; |
|---|
| 5083 | 4788 | dhd_conf_set_wl_cmd(dhd, he_cmd, TRUE); |
|---|
| .. | .. |
|---|
| 5131 | 4836 | |
|---|
| 5132 | 4837 | } |
|---|
| 5133 | 4838 | |
|---|
| 5134 | | -void |
|---|
| 5135 | | -dhd_conf_free_preinit(dhd_pub_t *dhd) |
|---|
| 4839 | +int |
|---|
| 4840 | +dhd_conf_preinit(dhd_pub_t *dhd) |
|---|
| 5136 | 4841 | { |
|---|
| 5137 | 4842 | struct dhd_conf *conf = dhd->conf; |
|---|
| 4843 | + |
|---|
| 4844 | + CONFIG_TRACE("Enter\n"); |
|---|
| 5138 | 4845 | |
|---|
| 5139 | 4846 | #ifdef SET_FWNV_BY_MAC |
|---|
| 5140 | 4847 | dhd_conf_free_mac_list(&conf->fw_by_mac); |
|---|
| .. | .. |
|---|
| 5165 | 4872 | kfree(conf->vndr_ie_assocreq); |
|---|
| 5166 | 4873 | conf->vndr_ie_assocreq = NULL; |
|---|
| 5167 | 4874 | } |
|---|
| 5168 | | -} |
|---|
| 5169 | | - |
|---|
| 5170 | | -int |
|---|
| 5171 | | -dhd_conf_preinit(dhd_pub_t *dhd) |
|---|
| 5172 | | -{ |
|---|
| 5173 | | - struct dhd_conf *conf = dhd->conf; |
|---|
| 5174 | | - |
|---|
| 5175 | | - CONFIG_TRACE("Enter\n"); |
|---|
| 5176 | | - |
|---|
| 5177 | | - dhd_conf_free_preinit(dhd); |
|---|
| 5178 | 4875 | conf->band = -1; |
|---|
| 5179 | 4876 | memset(&conf->bw_cap, -1, sizeof(conf->bw_cap)); |
|---|
| 5180 | 4877 | if (conf->chip == BCM43362_CHIP_ID || conf->chip == BCM4330_CHIP_ID) { |
|---|
| .. | .. |
|---|
| 5197 | 4894 | conf->cspec.rev = 0; |
|---|
| 5198 | 4895 | } |
|---|
| 5199 | 4896 | memset(&conf->channels, 0, sizeof(wl_channel_list_t)); |
|---|
| 5200 | | - conf->ioctl_ver = WLC_IOCTL_VERSION; |
|---|
| 5201 | 4897 | conf->roam_off = 1; |
|---|
| 5202 | 4898 | conf->roam_off_suspend = 1; |
|---|
| 5203 | 4899 | conf->roam_trigger[0] = -65; |
|---|
| .. | .. |
|---|
| 5258 | 4954 | #endif |
|---|
| 5259 | 4955 | #endif |
|---|
| 5260 | 4956 | #ifdef BCMPCIE |
|---|
| 5261 | | - conf->bus_deepsleep_disable = -1; |
|---|
| 4957 | + conf->bus_deepsleep_disable = 1; |
|---|
| 5262 | 4958 | conf->flow_ring_queue_threshold = FLOW_RING_QUEUE_THRESHOLD; |
|---|
| 5263 | 4959 | conf->d2h_intr_method = -1; |
|---|
| 5264 | 4960 | conf->d2h_intr_control = -1; |
|---|
| 5265 | | - conf->aspm = -1; |
|---|
| 5266 | | - conf->l1ss = -1; |
|---|
| 5267 | 4961 | conf->enq_hdr_pkt = 0; |
|---|
| 5268 | 4962 | #endif |
|---|
| 5269 | 4963 | conf->dpc_cpucore = -1; |
|---|
| .. | .. |
|---|
| 5280 | 4974 | #ifdef WL_EXT_WOWL |
|---|
| 5281 | 4975 | dhd_master_mode = TRUE; |
|---|
| 5282 | 4976 | conf->wowl = WL_WOWL_NET|WL_WOWL_DIS|WL_WOWL_BCN; |
|---|
| 5283 | | -#ifdef BCMDBUS |
|---|
| 5284 | | - conf->wowl_dngldown = 0; |
|---|
| 5285 | | -#endif |
|---|
| 5286 | 4977 | conf->insuspend |= (WOWL_IN_SUSPEND | NO_TXDATA_IN_SUSPEND); |
|---|
| 5287 | 4978 | #endif |
|---|
| 5288 | 4979 | if (conf->suspend_mode == PM_NOTIFIER || conf->suspend_mode == SUSPEND_MODE_2) |
|---|
| .. | .. |
|---|
| 5374 | 5065 | memset(conf->isam_enable, 0, sizeof(conf->isam_enable)); |
|---|
| 5375 | 5066 | #endif |
|---|
| 5376 | 5067 | #if defined(SDIO_ISR_THREAD) |
|---|
| 5377 | | - dhd_conf_set_intr_extn(dhd); |
|---|
| 5068 | + if (conf->chip == BCM43012_CHIP_ID || |
|---|
| 5069 | + conf->chip == BCM4335_CHIP_ID || conf->chip == BCM4339_CHIP_ID || |
|---|
| 5070 | + conf->chip == BCM43454_CHIP_ID || conf->chip == BCM4345_CHIP_ID || |
|---|
| 5071 | + conf->chip == BCM4354_CHIP_ID || conf->chip == BCM4356_CHIP_ID || |
|---|
| 5072 | + conf->chip == BCM4345_CHIP_ID || conf->chip == BCM4371_CHIP_ID || |
|---|
| 5073 | + conf->chip == BCM4359_CHIP_ID || |
|---|
| 5074 | + conf->chip == BCM43751_CHIP_ID || conf->chip == BCM43752_CHIP_ID || |
|---|
| 5075 | + conf->chip == BCM4375_CHIP_ID) { |
|---|
| 5076 | + conf->intr_extn = TRUE; |
|---|
| 5077 | + } |
|---|
| 5378 | 5078 | #endif |
|---|
| 5379 | | - dhd_conf_tput_improve(dhd); |
|---|
| 5079 | + if ((conf->chip == BCM43430_CHIP_ID && conf->chiprev == 2) || |
|---|
| 5080 | + conf->chip == BCM43012_CHIP_ID || |
|---|
| 5081 | + conf->chip == BCM4335_CHIP_ID || conf->chip == BCM4339_CHIP_ID || |
|---|
| 5082 | + conf->chip == BCM43454_CHIP_ID || conf->chip == BCM4345_CHIP_ID || |
|---|
| 5083 | + conf->chip == BCM4354_CHIP_ID || conf->chip == BCM4356_CHIP_ID || |
|---|
| 5084 | + conf->chip == BCM4345_CHIP_ID || conf->chip == BCM4371_CHIP_ID || |
|---|
| 5085 | + conf->chip == BCM43569_CHIP_ID || conf->chip == BCM4359_CHIP_ID || |
|---|
| 5086 | + conf->chip == BCM43751_CHIP_ID || conf->chip == BCM43752_CHIP_ID || |
|---|
| 5087 | + conf->chip == BCM4375_CHIP_ID) { |
|---|
| 5088 | +#ifdef DHDTCPACK_SUPPRESS |
|---|
| 5089 | +#ifdef BCMSDIO |
|---|
| 5090 | + conf->tcpack_sup_mode = TCPACK_SUP_REPLACE; |
|---|
| 5091 | +#endif |
|---|
| 5092 | +#endif |
|---|
| 5093 | +#if defined(BCMSDIO) || defined(BCMPCIE) |
|---|
| 5094 | + dhd_rxbound = 128; |
|---|
| 5095 | + dhd_txbound = 64; |
|---|
| 5096 | +#endif |
|---|
| 5097 | + conf->frameburst = 1; |
|---|
| 5098 | +#ifdef BCMSDIO |
|---|
| 5099 | + conf->dhd_txminmax = -1; |
|---|
| 5100 | + conf->txinrx_thres = 128; |
|---|
| 5101 | +#endif |
|---|
| 5102 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)) |
|---|
| 5103 | + conf->orphan_move = 1; |
|---|
| 5104 | +#else |
|---|
| 5105 | + conf->orphan_move = 0; |
|---|
| 5106 | +#endif |
|---|
| 5107 | + } |
|---|
| 5380 | 5108 | #ifdef DHD_TPUT_PATCH |
|---|
| 5381 | 5109 | if (conf->chip == BCM43751_CHIP_ID || conf->chip == BCM43752_CHIP_ID || |
|---|
| 5382 | 5110 | conf->chip == BCM4375_CHIP_ID) { |
|---|
| .. | .. |
|---|
| 5422 | 5150 | { |
|---|
| 5423 | 5151 | struct dhd_conf *conf = dhd->conf; |
|---|
| 5424 | 5152 | |
|---|
| 5425 | | - dhd_conf_free_preinit(dhd); |
|---|
| 5153 | +#ifdef SET_FWNV_BY_MAC |
|---|
| 5154 | + dhd_conf_free_mac_list(&conf->fw_by_mac); |
|---|
| 5155 | + dhd_conf_free_mac_list(&conf->nv_by_mac); |
|---|
| 5156 | +#endif |
|---|
| 5157 | + dhd_conf_free_chip_nv_path_list(&conf->nv_by_chip); |
|---|
| 5158 | + dhd_conf_free_country_list(conf); |
|---|
| 5159 | + dhd_conf_free_mchan_list(conf); |
|---|
| 5160 | +#ifdef PKT_FILTER_SUPPORT |
|---|
| 5161 | + if (conf->magic_pkt_filter_add) { |
|---|
| 5162 | + kfree(conf->magic_pkt_filter_add); |
|---|
| 5163 | + conf->magic_pkt_filter_add = NULL; |
|---|
| 5164 | + } |
|---|
| 5165 | +#endif |
|---|
| 5166 | + if (conf->wl_preinit) { |
|---|
| 5167 | + kfree(conf->wl_preinit); |
|---|
| 5168 | + conf->wl_preinit = NULL; |
|---|
| 5169 | + } |
|---|
| 5170 | + if (conf->wl_suspend) { |
|---|
| 5171 | + kfree(conf->wl_suspend); |
|---|
| 5172 | + conf->wl_suspend = NULL; |
|---|
| 5173 | + } |
|---|
| 5174 | + if (conf->wl_resume) { |
|---|
| 5175 | + kfree(conf->wl_resume); |
|---|
| 5176 | + conf->wl_resume = NULL; |
|---|
| 5177 | + } |
|---|
| 5178 | + if (conf->vndr_ie_assocreq) { |
|---|
| 5179 | + kfree(conf->vndr_ie_assocreq); |
|---|
| 5180 | + conf->vndr_ie_assocreq = NULL; |
|---|
| 5181 | + } |
|---|
| 5426 | 5182 | memset(conf, 0, sizeof(dhd_conf_t)); |
|---|
| 5427 | 5183 | return 0; |
|---|
| 5428 | 5184 | } |
|---|
| .. | .. |
|---|
| 5462 | 5218 | |
|---|
| 5463 | 5219 | CONFIG_TRACE("Enter\n"); |
|---|
| 5464 | 5220 | if (dhd->conf) { |
|---|
| 5465 | | - dhd_conf_free_preinit(dhd); |
|---|
| 5221 | +#ifdef SET_FWNV_BY_MAC |
|---|
| 5222 | + dhd_conf_free_mac_list(&conf->fw_by_mac); |
|---|
| 5223 | + dhd_conf_free_mac_list(&conf->nv_by_mac); |
|---|
| 5224 | +#endif |
|---|
| 5225 | + dhd_conf_free_chip_nv_path_list(&conf->nv_by_chip); |
|---|
| 5226 | + dhd_conf_free_country_list(conf); |
|---|
| 5227 | + dhd_conf_free_mchan_list(conf); |
|---|
| 5228 | +#ifdef PKT_FILTER_SUPPORT |
|---|
| 5229 | + if (conf->magic_pkt_filter_add) { |
|---|
| 5230 | + kfree(conf->magic_pkt_filter_add); |
|---|
| 5231 | + conf->magic_pkt_filter_add = NULL; |
|---|
| 5232 | + } |
|---|
| 5233 | +#endif |
|---|
| 5234 | + if (conf->wl_preinit) { |
|---|
| 5235 | + kfree(conf->wl_preinit); |
|---|
| 5236 | + conf->wl_preinit = NULL; |
|---|
| 5237 | + } |
|---|
| 5238 | + if (conf->wl_suspend) { |
|---|
| 5239 | + kfree(conf->wl_suspend); |
|---|
| 5240 | + conf->wl_suspend = NULL; |
|---|
| 5241 | + } |
|---|
| 5242 | + if (conf->wl_resume) { |
|---|
| 5243 | + kfree(conf->wl_resume); |
|---|
| 5244 | + conf->wl_resume = NULL; |
|---|
| 5245 | + } |
|---|
| 5246 | + if (conf->vndr_ie_assocreq) { |
|---|
| 5247 | + kfree(conf->vndr_ie_assocreq); |
|---|
| 5248 | + conf->vndr_ie_assocreq = NULL; |
|---|
| 5249 | + } |
|---|
| 5466 | 5250 | MFREE(dhd->osh, conf, sizeof(dhd_conf_t)); |
|---|
| 5467 | 5251 | } |
|---|
| 5468 | 5252 | dhd->conf = NULL; |
|---|