1 /* 2 * Copyright (c) 2018 The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 #include "cfg_all.h" 20 #include "cfg_define.h" 21 #include "cfg_dispatcher.h" 22 #include "cfg_ucfg_api.h" 23 #include "i_cfg.h" 24 #include "i_cfg_objmgr.h" 25 #include "qdf_atomic.h" 26 #include "qdf_list.h" 27 #include "qdf_mem.h" 28 #include "qdf_module.h" 29 #include "qdf_parse.h" 30 #include "qdf_status.h" 31 #include "qdf_str.h" 32 #include "qdf_trace.h" 33 #include "qdf_types.h" 34 #include "wlan_objmgr_psoc_obj.h" 35 36 /** 37 * struct cfg_value_store - backing store for an ini file 38 * @path: file path of the ini file 39 * @node: internal list node for keeping track of all the allocated stores 40 * @users: number of references on the store 41 * @values: a values struct containing the parsed values from the ini file 42 */ 43 struct cfg_value_store { 44 char *path; 45 qdf_list_node_t node; 46 qdf_atomic_t users; 47 struct cfg_values values; 48 }; 49 50 /* define/populate dynamic metadata lookup table */ 51 52 /** 53 * struct cfg_meta - configuration item metadata for dynamic lookup during parse 54 * @name: name of the config item used in the ini file (i.e. "gScanDwellTime") 55 * @item_handler: parsing callback based on the type of the config item 56 * @min: minimum value for use in bounds checking (min_len for strings) 57 * @max: maximum value for use in bounds checking (max_len for strings) 58 * @fallback: the fallback behavior to use when configured values are invalid 59 */ 60 struct cfg_meta { 61 const char *name; 62 const uint32_t field_offset; 63 void (*const item_handler)(struct cfg_value_store *store, 64 const struct cfg_meta *meta, 65 const char *value); 66 const int32_t min; 67 const int32_t max; 68 const enum cfg_fallback_behavior fallback; 69 }; 70 71 /* ini item handler functions */ 72 73 #define cfg_value_ptr(store, meta) \ 74 ((void *)&(store)->values + (meta)->field_offset) 75 76 static __attribute__((unused)) void 77 cfg_int_item_handler(struct cfg_value_store *store, 78 const struct cfg_meta *meta, 79 const char *str_value) 80 { 81 QDF_STATUS status; 82 int32_t *store_value = cfg_value_ptr(store, meta); 83 int32_t value; 84 85 status = qdf_int32_parse(str_value, &value); 86 if (QDF_IS_STATUS_ERROR(status)) { 87 cfg_err("%s=%s - Invalid format (status %d); Using default %d", 88 meta->name, str_value, status, *store_value); 89 return; 90 } 91 92 QDF_BUG(meta->min <= meta->max); 93 if (meta->min > meta->max) { 94 cfg_err("Invalid config item meta for %s", meta->name); 95 return; 96 } 97 98 if (value >= meta->min && value <= meta->max) { 99 *store_value = value; 100 return; 101 } 102 103 switch (meta->fallback) { 104 default: 105 QDF_DEBUG_PANIC("Unknown fallback method %d for cfg item '%s'", 106 meta->fallback, meta->name); 107 /* fall through */ 108 case CFG_VALUE_OR_DEFAULT: 109 /* store already contains default */ 110 break; 111 case CFG_VALUE_OR_CLAMP: 112 *store_value = __cfg_clamp(value, meta->min, meta->max); 113 break; 114 } 115 116 cfg_err("%s=%d - Out of range [%d, %d]; Using %d", 117 meta->name, value, meta->min, meta->max, *store_value); 118 } 119 120 static __attribute__((unused)) void 121 cfg_uint_item_handler(struct cfg_value_store *store, 122 const struct cfg_meta *meta, 123 const char *str_value) 124 { 125 QDF_STATUS status; 126 uint32_t *store_value = cfg_value_ptr(store, meta); 127 uint32_t value; 128 uint32_t min; 129 uint32_t max; 130 131 /** 132 * Since meta min and max are of type int32_t 133 * We need explicit type casting to avoid 134 * implicit wrap around for uint32_t type cfg data. 135 */ 136 min = (uint32_t)meta->min; 137 max = (uint32_t)meta->max; 138 139 status = qdf_uint32_parse(str_value, &value); 140 if (QDF_IS_STATUS_ERROR(status)) { 141 cfg_err("%s=%s - Invalid format (status %d); Using default %u", 142 meta->name, str_value, status, *store_value); 143 return; 144 } 145 146 QDF_BUG(min <= max); 147 if (min > max) { 148 cfg_err("Invalid config item meta for %s", meta->name); 149 return; 150 } 151 152 if (value >= min && value <= max) { 153 *store_value = value; 154 return; 155 } 156 157 switch (meta->fallback) { 158 default: 159 QDF_DEBUG_PANIC("Unknown fallback method %d for cfg item '%s'", 160 meta->fallback, meta->name); 161 /* fall through */ 162 case CFG_VALUE_OR_DEFAULT: 163 /* store already contains default */ 164 break; 165 case CFG_VALUE_OR_CLAMP: 166 *store_value = __cfg_clamp(value, min, max); 167 break; 168 } 169 170 cfg_err("%s=%u - Out of range [%d, %d]; Using %u", 171 meta->name, value, min, max, *store_value); 172 } 173 174 static __attribute__((unused)) void 175 cfg_bool_item_handler(struct cfg_value_store *store, 176 const struct cfg_meta *meta, 177 const char *str_value) 178 { 179 QDF_STATUS status; 180 bool *store_value = cfg_value_ptr(store, meta); 181 182 status = qdf_bool_parse(str_value, store_value); 183 if (QDF_IS_STATUS_SUCCESS(status)) 184 return; 185 186 cfg_err("%s=%s - Invalid format (status %d); Using default '%s'", 187 meta->name, str_value, status, *store_value ? "true" : "false"); 188 } 189 190 static __attribute__((unused)) void 191 cfg_string_item_handler(struct cfg_value_store *store, 192 const struct cfg_meta *meta, 193 const char *str_value) 194 { 195 char *store_value = cfg_value_ptr(store, meta); 196 qdf_size_t len; 197 198 QDF_BUG(meta->min >= 0); 199 QDF_BUG(meta->min <= meta->max); 200 if (meta->min < 0 || meta->min > meta->max) { 201 cfg_err("Invalid config item meta for %s", meta->name); 202 return; 203 } 204 205 /* ensure min length */ 206 len = qdf_str_nlen(str_value, meta->min); 207 if (len < meta->min) { 208 cfg_err("%s=%s - Too short; Using default '%s'", 209 meta->name, str_value, store_value); 210 return; 211 } 212 213 /* check max length */ 214 len += qdf_str_nlen(str_value + meta->min, meta->max - meta->min + 1); 215 if (len > meta->max) { 216 cfg_err("%s=%s - Too long; Using default '%s'", 217 meta->name, str_value, store_value); 218 return; 219 } 220 221 qdf_str_lcopy(store_value, str_value, meta->max + 1); 222 } 223 224 static __attribute__((unused)) void 225 cfg_mac_item_handler(struct cfg_value_store *store, 226 const struct cfg_meta *meta, 227 const char *str_value) 228 { 229 QDF_STATUS status; 230 struct qdf_mac_addr *store_value = cfg_value_ptr(store, meta); 231 232 status = qdf_mac_parse(str_value, store_value); 233 if (QDF_IS_STATUS_SUCCESS(status)) 234 return; 235 236 cfg_err("%s=%s - Invalid format (status %d); Using default " 237 QDF_MAC_ADDR_STR, meta->name, str_value, status, 238 QDF_MAC_ADDR_ARRAY(store_value->bytes)); 239 } 240 241 static __attribute__((unused)) void 242 cfg_ipv4_item_handler(struct cfg_value_store *store, 243 const struct cfg_meta *meta, 244 const char *str_value) 245 { 246 QDF_STATUS status; 247 struct qdf_ipv4_addr *store_value = cfg_value_ptr(store, meta); 248 249 status = qdf_ipv4_parse(str_value, store_value); 250 if (QDF_IS_STATUS_SUCCESS(status)) 251 return; 252 253 cfg_err("%s=%s - Invalid format (status %d); Using default " 254 QDF_IPV4_ADDR_STR, meta->name, str_value, status, 255 QDF_IPV4_ADDR_ARRAY(store_value->bytes)); 256 } 257 258 static __attribute__((unused)) void 259 cfg_ipv6_item_handler(struct cfg_value_store *store, 260 const struct cfg_meta *meta, 261 const char *str_value) 262 { 263 QDF_STATUS status; 264 struct qdf_ipv6_addr *store_value = cfg_value_ptr(store, meta); 265 266 status = qdf_ipv6_parse(str_value, store_value); 267 if (QDF_IS_STATUS_SUCCESS(status)) 268 return; 269 270 cfg_err("%s=%s - Invalid format (status %d); Using default " 271 QDF_IPV6_ADDR_STR, meta->name, str_value, status, 272 QDF_IPV6_ADDR_ARRAY(store_value->bytes)); 273 } 274 275 /* populate metadata lookup table */ 276 #undef __CFG_INI 277 #define __CFG_INI(_id, _mtype, _ctype, _name, _min, _max, _fallback, ...) \ 278 { \ 279 .name = _name, \ 280 .field_offset = qdf_offsetof(struct cfg_values, _id##_internal), \ 281 .item_handler = cfg_ ## _mtype ## _item_handler, \ 282 .min = _min, \ 283 .max = _max, \ 284 .fallback = _fallback, \ 285 }, 286 287 #define cfg_INT_item_handler cfg_int_item_handler 288 #define cfg_UINT_item_handler cfg_uint_item_handler 289 #define cfg_BOOL_item_handler cfg_bool_item_handler 290 #define cfg_STRING_item_handler cfg_string_item_handler 291 #define cfg_MAC_item_handler cfg_mac_item_handler 292 #define cfg_IPV4_item_handler cfg_ipv4_item_handler 293 #define cfg_IPV6_item_handler cfg_ipv6_item_handler 294 295 static const struct cfg_meta cfg_meta_lookup_table[] = { 296 CFG_ALL 297 }; 298 299 /* default store initializer */ 300 301 static void cfg_store_set_defaults(struct cfg_value_store *store) 302 { 303 #undef __CFG_INI 304 #define __CFG_INI(id, mtype, ctype, name, min, max, fallback, desc, def...) \ 305 ctype id = def; 306 307 CFG_ALL 308 309 #undef __CFG_INI_STRING 310 #define __CFG_INI_STRING(id, mtype, ctype, name, min_len, max_len, ...) \ 311 qdf_str_lcopy((char *)&store->values.id##_internal, id, (max_len) + 1); 312 #undef __CFG_INI 313 #define __CFG_INI(id, mtype, ctype, name, min, max, fallback, desc, def...) \ 314 *(ctype *)&store->values.id##_internal = id; 315 316 CFG_ALL 317 } 318 319 static const struct cfg_meta *cfg_lookup_meta(const char *name) 320 { 321 int i; 322 323 QDF_BUG(name); 324 if (!name) 325 return NULL; 326 327 /* linear search for now; optimize in the future if needed */ 328 for (i = 0; i < QDF_ARRAY_SIZE(cfg_meta_lookup_table); i++) { 329 const struct cfg_meta *meta = &cfg_meta_lookup_table[i]; 330 331 if (qdf_str_eq(name, meta->name)) 332 return meta; 333 } 334 335 return NULL; 336 } 337 338 static QDF_STATUS 339 cfg_ini_item_handler(void *context, const char *key, const char *value) 340 { 341 struct cfg_value_store *store = context; 342 const struct cfg_meta *meta; 343 344 meta = cfg_lookup_meta(key); 345 if (!meta) { 346 /* TODO: promote to 'err' or 'warn' once legacy is ported */ 347 cfg_debug("Unknown config item '%s'", key); 348 return QDF_STATUS_SUCCESS; 349 } 350 351 QDF_BUG(meta->item_handler); 352 if (!meta->item_handler) 353 return QDF_STATUS_SUCCESS; 354 355 meta->item_handler(store, meta, value); 356 357 return QDF_STATUS_SUCCESS; 358 } 359 360 static QDF_STATUS cfg_ini_section_handler(void *context, const char *name) 361 { 362 cfg_err("Unexpected section '%s'. Sections are not supported.", name); 363 364 return QDF_STATUS_SUCCESS; 365 } 366 367 #define cfg_assert_success(expr) \ 368 do { \ 369 QDF_STATUS __assert_status = (expr); \ 370 QDF_BUG(QDF_IS_STATUS_SUCCESS(__assert_status)); \ 371 } while (0) 372 373 static bool __cfg_is_init; 374 static struct cfg_value_store *__cfg_global_store; 375 static qdf_list_t __cfg_stores_list; 376 static qdf_spinlock_t __cfg_stores_lock; 377 378 struct cfg_psoc_ctx { 379 struct cfg_value_store *store; 380 }; 381 382 static QDF_STATUS 383 cfg_store_alloc(const char *path, struct cfg_value_store **out_store) 384 { 385 QDF_STATUS status; 386 struct cfg_value_store *store; 387 388 cfg_enter(); 389 390 store = qdf_mem_malloc(sizeof(*store)); 391 if (!store) { 392 cfg_err("Out of memory"); 393 return QDF_STATUS_E_NOMEM; 394 } 395 396 status = qdf_str_dup(&store->path, path); 397 if (QDF_IS_STATUS_ERROR(status)) 398 goto free_store; 399 400 status = qdf_atomic_init(&store->users); 401 if (QDF_IS_STATUS_ERROR(status)) 402 goto free_path; 403 qdf_atomic_inc(&store->users); 404 405 qdf_spin_lock_bh(&__cfg_stores_lock); 406 status = qdf_list_insert_back(&__cfg_stores_list, &store->node); 407 qdf_spin_unlock_bh(&__cfg_stores_lock); 408 if (QDF_IS_STATUS_ERROR(status)) 409 goto free_path; 410 411 *out_store = store; 412 413 return QDF_STATUS_SUCCESS; 414 415 free_path: 416 qdf_mem_free(store->path); 417 418 free_store: 419 qdf_mem_free(store); 420 421 return status; 422 } 423 424 static void cfg_store_free(struct cfg_value_store *store) 425 { 426 QDF_STATUS status; 427 428 cfg_enter(); 429 430 qdf_spin_lock_bh(&__cfg_stores_lock); 431 status = qdf_list_remove_node(&__cfg_stores_list, &store->node); 432 qdf_spin_unlock_bh(&__cfg_stores_lock); 433 if (QDF_IS_STATUS_ERROR(status)) 434 QDF_DEBUG_PANIC("Failed config store list removal; status:%d", 435 status); 436 437 qdf_mem_free(store->path); 438 qdf_mem_free(store); 439 } 440 441 static QDF_STATUS 442 cfg_store_get(const char *path, struct cfg_value_store **out_store) 443 { 444 QDF_STATUS status; 445 qdf_list_node_t *node; 446 447 *out_store = NULL; 448 449 qdf_spin_lock_bh(&__cfg_stores_lock); 450 status = qdf_list_peek_front(&__cfg_stores_list, &node); 451 while (QDF_IS_STATUS_SUCCESS(status)) { 452 struct cfg_value_store *store = 453 qdf_container_of(node, struct cfg_value_store, node); 454 455 if (qdf_str_eq(path, store->path)) { 456 qdf_atomic_inc(&store->users); 457 *out_store = store; 458 break; 459 } 460 461 status = qdf_list_peek_next(&__cfg_stores_list, node, &node); 462 } 463 qdf_spin_unlock_bh(&__cfg_stores_lock); 464 465 return status; 466 } 467 468 static void cfg_store_put(struct cfg_value_store *store) 469 { 470 if (qdf_atomic_dec_and_test(&store->users)) 471 cfg_store_free(store); 472 } 473 474 static struct cfg_psoc_ctx *cfg_psoc_get_ctx(struct wlan_objmgr_psoc *psoc) 475 { 476 struct cfg_psoc_ctx *psoc_ctx; 477 478 psoc_ctx = cfg_psoc_get_priv(psoc); 479 QDF_BUG(psoc_ctx); 480 481 return psoc_ctx; 482 } 483 484 struct cfg_values *cfg_psoc_get_values(struct wlan_objmgr_psoc *psoc) 485 { 486 return &cfg_psoc_get_ctx(psoc)->store->values; 487 } 488 qdf_export_symbol(cfg_psoc_get_values); 489 490 static QDF_STATUS 491 cfg_ini_parse_to_store(const char *path, struct cfg_value_store *store) 492 { 493 QDF_STATUS status; 494 495 status = qdf_ini_parse(path, store, cfg_ini_item_handler, 496 cfg_ini_section_handler); 497 if (QDF_IS_STATUS_ERROR(status)) 498 cfg_err("Failed to parse *.ini file @ %s; status:%d", 499 path, status); 500 501 return status; 502 } 503 504 QDF_STATUS cfg_parse_to_psoc_store(struct wlan_objmgr_psoc *psoc, 505 const char *path) 506 { 507 return cfg_ini_parse_to_store(path, cfg_psoc_get_ctx(psoc)->store); 508 } 509 510 qdf_export_symbol(cfg_parse_to_psoc_store); 511 512 QDF_STATUS cfg_parse_to_global_store(const char *path) 513 { 514 if (!__cfg_global_store) { 515 cfg_err("Global INI store is not valid"); 516 return QDF_STATUS_E_NOMEM; 517 } 518 519 return cfg_ini_parse_to_store(path, __cfg_global_store); 520 } 521 522 qdf_export_symbol(cfg_parse_to_global_store); 523 524 static void cfg_init(void) 525 { 526 qdf_list_create(&__cfg_stores_list, 0); 527 qdf_spinlock_create(&__cfg_stores_lock); 528 } 529 530 static void cfg_deinit(void) 531 { 532 qdf_spinlock_destroy(&__cfg_stores_lock); 533 qdf_list_destroy(&__cfg_stores_list); 534 } 535 536 static void cfg_try_deinit(void) 537 { 538 bool empty; 539 540 qdf_spin_lock_bh(&__cfg_stores_lock); 541 empty = qdf_list_empty(&__cfg_stores_list); 542 qdf_spin_unlock_bh(&__cfg_stores_lock); 543 544 if (empty) 545 cfg_deinit(); 546 } 547 548 static QDF_STATUS 549 cfg_on_psoc_create(struct wlan_objmgr_psoc *psoc, void *context) 550 { 551 QDF_STATUS status; 552 struct cfg_psoc_ctx *psoc_ctx; 553 554 cfg_enter(); 555 556 QDF_BUG(__cfg_global_store); 557 if (!__cfg_global_store) 558 return QDF_STATUS_E_FAILURE; 559 560 psoc_ctx = qdf_mem_malloc(sizeof(*psoc_ctx)); 561 if (!psoc_ctx) { 562 cfg_err("Out of memory"); 563 return QDF_STATUS_E_NOMEM; 564 } 565 566 qdf_atomic_inc(&__cfg_global_store->users); 567 psoc_ctx->store = __cfg_global_store; 568 569 status = cfg_psoc_set_priv(psoc, psoc_ctx); 570 if (QDF_IS_STATUS_ERROR(status)) 571 goto put_store; 572 573 return QDF_STATUS_SUCCESS; 574 575 put_store: 576 cfg_store_put(__cfg_global_store); 577 qdf_mem_free(psoc_ctx); 578 579 return status; 580 } 581 582 static QDF_STATUS 583 cfg_on_psoc_destroy(struct wlan_objmgr_psoc *psoc, void *context) 584 { 585 QDF_STATUS status; 586 struct cfg_psoc_ctx *psoc_ctx; 587 588 cfg_enter(); 589 590 psoc_ctx = cfg_psoc_get_ctx(psoc); 591 status = cfg_psoc_unset_priv(psoc, psoc_ctx); 592 593 cfg_store_put(psoc_ctx->store); 594 qdf_mem_free(psoc_ctx); 595 596 return status; 597 } 598 599 QDF_STATUS cfg_dispatcher_init(void) 600 { 601 QDF_STATUS status; 602 603 cfg_enter(); 604 605 QDF_BUG(!__cfg_is_init); 606 if (__cfg_is_init) 607 return QDF_STATUS_E_INVAL; 608 609 status = cfg_psoc_register_create(cfg_on_psoc_create); 610 if (QDF_IS_STATUS_ERROR(status)) 611 return status; 612 613 status = cfg_psoc_register_destroy(cfg_on_psoc_destroy); 614 if (QDF_IS_STATUS_ERROR(status)) 615 goto unreg_create; 616 617 __cfg_is_init = true; 618 619 return QDF_STATUS_SUCCESS; 620 621 unreg_create: 622 cfg_assert_success(cfg_psoc_unregister_create(cfg_on_psoc_create)); 623 624 return status; 625 } 626 627 QDF_STATUS cfg_dispatcher_deinit(void) 628 { 629 cfg_enter(); 630 631 QDF_BUG(__cfg_is_init); 632 if (!__cfg_is_init) 633 return QDF_STATUS_E_INVAL; 634 635 __cfg_is_init = false; 636 637 cfg_assert_success(cfg_psoc_unregister_create(cfg_on_psoc_create)); 638 cfg_assert_success(cfg_psoc_unregister_destroy(cfg_on_psoc_destroy)); 639 640 cfg_try_deinit(); 641 642 return QDF_STATUS_SUCCESS; 643 } 644 645 QDF_STATUS cfg_parse(const char *path) 646 { 647 QDF_STATUS status; 648 struct cfg_value_store *store; 649 650 cfg_enter(); 651 652 QDF_BUG(!__cfg_global_store); 653 if (__cfg_global_store) 654 return QDF_STATUS_E_INVAL; 655 656 cfg_init(); 657 658 status = cfg_store_alloc(path, &store); 659 if (QDF_IS_STATUS_ERROR(status)) 660 goto deinit; 661 662 cfg_store_set_defaults(store); 663 664 status = cfg_ini_parse_to_store(path, store); 665 if (QDF_IS_STATUS_ERROR(status)) 666 goto free_store; 667 668 __cfg_global_store = store; 669 670 return QDF_STATUS_SUCCESS; 671 672 free_store: 673 cfg_store_free(store); 674 675 deinit: 676 cfg_deinit(); 677 678 return status; 679 } 680 681 void cfg_release(void) 682 { 683 cfg_enter(); 684 685 QDF_BUG(__cfg_global_store); 686 if (!__cfg_global_store) 687 return; 688 689 cfg_store_put(__cfg_global_store); 690 __cfg_global_store = NULL; 691 692 cfg_try_deinit(); 693 } 694 695 QDF_STATUS cfg_psoc_parse(struct wlan_objmgr_psoc *psoc, const char *path) 696 { 697 QDF_STATUS status; 698 struct cfg_value_store *store; 699 struct cfg_psoc_ctx *psoc_ctx; 700 701 cfg_enter(); 702 703 QDF_BUG(__cfg_global_store); 704 if (!__cfg_global_store) 705 return QDF_STATUS_E_INVAL; 706 707 QDF_BUG(__cfg_is_init); 708 if (!__cfg_is_init) 709 return QDF_STATUS_E_INVAL; 710 711 QDF_BUG(psoc); 712 if (!psoc) 713 return QDF_STATUS_E_INVAL; 714 715 QDF_BUG(path); 716 if (!path) 717 return QDF_STATUS_E_INVAL; 718 719 psoc_ctx = cfg_psoc_get_ctx(psoc); 720 721 QDF_BUG(psoc_ctx->store == __cfg_global_store); 722 if (psoc_ctx->store != __cfg_global_store) 723 return QDF_STATUS_SUCCESS; 724 725 /* check if @path has been parsed before */ 726 status = cfg_store_get(path, &store); 727 if (QDF_IS_STATUS_ERROR(status)) { 728 status = cfg_store_alloc(path, &store); 729 if (QDF_IS_STATUS_ERROR(status)) 730 return status; 731 732 /* inherit global configuration */ 733 qdf_mem_copy(&store->values, &__cfg_global_store->values, 734 sizeof(store->values)); 735 736 status = cfg_ini_parse_to_store(path, store); 737 if (QDF_IS_STATUS_ERROR(status)) 738 goto put_store; 739 } 740 741 psoc_ctx->store = store; 742 cfg_store_put(__cfg_global_store); 743 744 return QDF_STATUS_SUCCESS; 745 746 put_store: 747 cfg_store_put(store); 748 749 return status; 750 } 751 752 qdf_export_symbol(cfg_psoc_parse); 753 754