Lines Matching refs:prefix
33 static void create_key(const char *prefix, const char *postfix, in create_key() argument
36 if (prefix && postfix) in create_key()
37 snprintf(buf, len, "%s%s%s", prefix, name, postfix); in create_key()
38 else if (prefix) in create_key()
39 snprintf(buf, len, "%s%s", prefix, name); in create_key()
46 static int get_nvram_var(const char *prefix, const char *postfix, in get_nvram_var() argument
52 create_key(prefix, postfix, name, key, sizeof(key)); in get_nvram_var()
55 if (fallback && err == -ENOENT && prefix) { in get_nvram_var()
63 static void nvram_read_ ## type(const char *prefix, \
71 err = get_nvram_var(prefix, postfix, name, buf, sizeof(buf), \
78 prefix, name, postfix, buf, err); \
93 static void nvram_read_u32_2(const char *prefix, const char *name, in NVRAM_READ_VAL()
100 err = get_nvram_var(prefix, NULL, name, buf, sizeof(buf), fallback); in NVRAM_READ_VAL()
106 prefix, name, buf, err); in NVRAM_READ_VAL()
113 static void nvram_read_leddc(const char *prefix, const char *name, in nvram_read_leddc() argument
121 err = get_nvram_var(prefix, NULL, name, buf, sizeof(buf), fallback); in nvram_read_leddc()
127 prefix, name, buf, err); in nvram_read_leddc()
152 static void nvram_read_macaddr(const char *prefix, const char *name, in nvram_read_macaddr() argument
158 err = get_nvram_var(prefix, NULL, name, buf, sizeof(buf), fallback); in nvram_read_macaddr()
165 static void nvram_read_alpha2(const char *prefix, const char *name, in nvram_read_alpha2() argument
171 err = get_nvram_var(prefix, NULL, name, buf, sizeof(buf), fallback); in nvram_read_alpha2()
198 const char *prefix, bool fallback) in bcm47xx_sprom_fill_auto() argument
200 const char *pre = prefix; in bcm47xx_sprom_fill_auto()
419 const char *prefix, bool fallback) in bcm47xx_fill_sprom_path_r4589() argument
430 nvram_read_u8(prefix, postfix, "maxp2ga", in bcm47xx_fill_sprom_path_r4589()
432 nvram_read_u8(prefix, postfix, "itt2ga", in bcm47xx_fill_sprom_path_r4589()
434 nvram_read_u8(prefix, postfix, "itt5ga", in bcm47xx_fill_sprom_path_r4589()
436 nvram_read_u16(prefix, postfix, "pa2gw0a", in bcm47xx_fill_sprom_path_r4589()
438 nvram_read_u16(prefix, postfix, "pa2gw1a", in bcm47xx_fill_sprom_path_r4589()
440 nvram_read_u16(prefix, postfix, "pa2gw2a", in bcm47xx_fill_sprom_path_r4589()
442 nvram_read_u8(prefix, postfix, "maxp5ga", in bcm47xx_fill_sprom_path_r4589()
444 nvram_read_u8(prefix, postfix, "maxp5gha", in bcm47xx_fill_sprom_path_r4589()
446 nvram_read_u8(prefix, postfix, "maxp5gla", in bcm47xx_fill_sprom_path_r4589()
448 nvram_read_u16(prefix, postfix, "pa5gw0a", in bcm47xx_fill_sprom_path_r4589()
450 nvram_read_u16(prefix, postfix, "pa5gw1a", in bcm47xx_fill_sprom_path_r4589()
452 nvram_read_u16(prefix, postfix, "pa5gw2a", in bcm47xx_fill_sprom_path_r4589()
454 nvram_read_u16(prefix, postfix, "pa5glw0a", in bcm47xx_fill_sprom_path_r4589()
456 nvram_read_u16(prefix, postfix, "pa5glw1a", in bcm47xx_fill_sprom_path_r4589()
458 nvram_read_u16(prefix, postfix, "pa5glw2a", in bcm47xx_fill_sprom_path_r4589()
460 nvram_read_u16(prefix, postfix, "pa5ghw0a", in bcm47xx_fill_sprom_path_r4589()
462 nvram_read_u16(prefix, postfix, "pa5ghw1a", in bcm47xx_fill_sprom_path_r4589()
464 nvram_read_u16(prefix, postfix, "pa5ghw2a", in bcm47xx_fill_sprom_path_r4589()
470 const char *prefix, bool fallback) in bcm47xx_fill_sprom_path_r45() argument
481 nvram_read_u16(prefix, postfix, "pa2gw3a", in bcm47xx_fill_sprom_path_r45()
483 nvram_read_u16(prefix, postfix, "pa5gw3a", in bcm47xx_fill_sprom_path_r45()
485 nvram_read_u16(prefix, postfix, "pa5glw3a", in bcm47xx_fill_sprom_path_r45()
487 nvram_read_u16(prefix, postfix, "pa5ghw3a", in bcm47xx_fill_sprom_path_r45()
520 const char *prefix, bool fallback) in bcm47xx_fill_sprom_ethernet() argument
524 nvram_read_macaddr(prefix, "et0macaddr", sprom->et0mac, fallback); in bcm47xx_fill_sprom_ethernet()
525 nvram_read_u8(prefix, NULL, "et0mdcport", &sprom->et0mdcport, 0, in bcm47xx_fill_sprom_ethernet()
527 nvram_read_u8(prefix, NULL, "et0phyaddr", &sprom->et0phyaddr, 0, in bcm47xx_fill_sprom_ethernet()
530 nvram_read_macaddr(prefix, "et1macaddr", sprom->et1mac, fallback); in bcm47xx_fill_sprom_ethernet()
531 nvram_read_u8(prefix, NULL, "et1mdcport", &sprom->et1mdcport, 0, in bcm47xx_fill_sprom_ethernet()
533 nvram_read_u8(prefix, NULL, "et1phyaddr", &sprom->et1phyaddr, 0, in bcm47xx_fill_sprom_ethernet()
536 nvram_read_macaddr(prefix, "et2macaddr", sprom->et2mac, fb); in bcm47xx_fill_sprom_ethernet()
537 nvram_read_u8(prefix, NULL, "et2mdcport", &sprom->et2mdcport, 0, fb); in bcm47xx_fill_sprom_ethernet()
538 nvram_read_u8(prefix, NULL, "et2phyaddr", &sprom->et2phyaddr, 0, fb); in bcm47xx_fill_sprom_ethernet()
540 nvram_read_macaddr(prefix, "macaddr", sprom->il0mac, fallback); in bcm47xx_fill_sprom_ethernet()
541 nvram_read_macaddr(prefix, "il0macaddr", sprom->il0mac, fallback); in bcm47xx_fill_sprom_ethernet()
564 static void bcm47xx_fill_board_data(struct ssb_sprom *sprom, const char *prefix, in bcm47xx_fill_board_data() argument
567 nvram_read_u32_2(prefix, "boardflags", &sprom->boardflags_lo, in bcm47xx_fill_board_data()
569 nvram_read_u32_2(prefix, "boardflags2", &sprom->boardflags2_lo, in bcm47xx_fill_board_data()
573 void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix, in bcm47xx_fill_sprom() argument
576 bcm47xx_fill_sprom_ethernet(sprom, prefix, fallback); in bcm47xx_fill_sprom()
577 bcm47xx_fill_board_data(sprom, prefix, fallback); in bcm47xx_fill_sprom()
579 nvram_read_u8(prefix, NULL, "sromrev", &sprom->revision, 0, fallback); in bcm47xx_fill_sprom()
582 nvram_read_alpha2(prefix, "ccode", sprom->alpha2, fallback); in bcm47xx_fill_sprom()
584 nvram_read_leddc(prefix, "leddc", &sprom->leddc_on_time, in bcm47xx_fill_sprom()
590 bcm47xx_fill_sprom_path_r4589(sprom, prefix, fallback); in bcm47xx_fill_sprom()
591 bcm47xx_fill_sprom_path_r45(sprom, prefix, fallback); in bcm47xx_fill_sprom()
595 bcm47xx_fill_sprom_path_r4589(sprom, prefix, fallback); in bcm47xx_fill_sprom()
599 bcm47xx_sprom_fill_auto(sprom, prefix, fallback); in bcm47xx_fill_sprom()
605 char prefix[10]; in bcm47xx_get_sprom_ssb() local
613 snprintf(prefix, sizeof(prefix), "pci/%u/%u/", in bcm47xx_get_sprom_ssb()
616 bcm47xx_fill_sprom(out, prefix, false); in bcm47xx_get_sprom_ssb()
633 static void bcm47xx_sprom_apply_prefix_alias(char *prefix, size_t prefix_size) in bcm47xx_sprom_apply_prefix_alias() argument
635 size_t prefix_len = strlen(prefix); in bcm47xx_sprom_apply_prefix_alias()
642 if (prefix_len <= 0 || prefix[prefix_len - 1] != '/') in bcm47xx_sprom_apply_prefix_alias()
650 if (!strcmp(buf, prefix) || in bcm47xx_sprom_apply_prefix_alias()
651 (short_len && strlen(buf) == short_len && !strncmp(buf, prefix, short_len))) { in bcm47xx_sprom_apply_prefix_alias()
652 snprintf(prefix, prefix_size, "%d:", i); in bcm47xx_sprom_apply_prefix_alias()
663 char *prefix; in bcm47xx_get_sprom_bcma() local
673 prefix = buf; in bcm47xx_get_sprom_bcma()
681 prefix = buf; in bcm47xx_get_sprom_bcma()
684 prefix = NULL; in bcm47xx_get_sprom_bcma()
692 nvram_read_u16(prefix, NULL, "boardvendor", &binfo->vendor, 0, true); in bcm47xx_get_sprom_bcma()
695 nvram_read_u16(prefix, NULL, "boardtype", &binfo->type, 0, true); in bcm47xx_get_sprom_bcma()
697 bcm47xx_fill_sprom(out, prefix, fallback); in bcm47xx_get_sprom_bcma()