Lines Matching refs:prefix
36 static void create_key(const char *prefix, const char *postfix, in create_key() argument
39 if (prefix && postfix) in create_key()
40 snprintf(buf, len, "%s%s%s", prefix, name, postfix); in create_key()
41 else if (prefix) in create_key()
42 snprintf(buf, len, "%s%s", prefix, name); in create_key()
49 static int get_nvram_var(const char *prefix, const char *postfix, in get_nvram_var() argument
55 create_key(prefix, postfix, name, key, sizeof(key)); in get_nvram_var()
58 if (fallback && err == -ENOENT && prefix) { in get_nvram_var()
66 static void nvram_read_ ## type(const char *prefix, \
74 err = get_nvram_var(prefix, postfix, name, buf, sizeof(buf), \
81 prefix, name, postfix, buf, err); \
96 static void nvram_read_u32_2(const char *prefix, const char *name, in NVRAM_READ_VAL()
103 err = get_nvram_var(prefix, NULL, name, buf, sizeof(buf), fallback); in NVRAM_READ_VAL()
109 prefix, name, buf, err); in NVRAM_READ_VAL()
116 static void nvram_read_leddc(const char *prefix, const char *name, in nvram_read_leddc() argument
124 err = get_nvram_var(prefix, NULL, name, buf, sizeof(buf), fallback); in nvram_read_leddc()
130 prefix, name, buf, err); in nvram_read_leddc()
141 static void nvram_read_macaddr(const char *prefix, const char *name, in nvram_read_macaddr() argument
147 err = get_nvram_var(prefix, NULL, name, buf, sizeof(buf), fallback); in nvram_read_macaddr()
156 static void nvram_read_alpha2(const char *prefix, const char *name, in nvram_read_alpha2() argument
162 err = get_nvram_var(prefix, NULL, name, buf, sizeof(buf), fallback); in nvram_read_alpha2()
189 const char *prefix, bool fallback) in bcm47xx_sprom_fill_auto() argument
191 const char *pre = prefix; in bcm47xx_sprom_fill_auto()
410 const char *prefix, bool fallback) in bcm47xx_fill_sprom_path_r4589() argument
421 nvram_read_u8(prefix, postfix, "maxp2ga", in bcm47xx_fill_sprom_path_r4589()
423 nvram_read_u8(prefix, postfix, "itt2ga", in bcm47xx_fill_sprom_path_r4589()
425 nvram_read_u8(prefix, postfix, "itt5ga", in bcm47xx_fill_sprom_path_r4589()
427 nvram_read_u16(prefix, postfix, "pa2gw0a", in bcm47xx_fill_sprom_path_r4589()
429 nvram_read_u16(prefix, postfix, "pa2gw1a", in bcm47xx_fill_sprom_path_r4589()
431 nvram_read_u16(prefix, postfix, "pa2gw2a", in bcm47xx_fill_sprom_path_r4589()
433 nvram_read_u8(prefix, postfix, "maxp5ga", in bcm47xx_fill_sprom_path_r4589()
435 nvram_read_u8(prefix, postfix, "maxp5gha", in bcm47xx_fill_sprom_path_r4589()
437 nvram_read_u8(prefix, postfix, "maxp5gla", in bcm47xx_fill_sprom_path_r4589()
439 nvram_read_u16(prefix, postfix, "pa5gw0a", in bcm47xx_fill_sprom_path_r4589()
441 nvram_read_u16(prefix, postfix, "pa5gw1a", in bcm47xx_fill_sprom_path_r4589()
443 nvram_read_u16(prefix, postfix, "pa5gw2a", in bcm47xx_fill_sprom_path_r4589()
445 nvram_read_u16(prefix, postfix, "pa5glw0a", in bcm47xx_fill_sprom_path_r4589()
447 nvram_read_u16(prefix, postfix, "pa5glw1a", in bcm47xx_fill_sprom_path_r4589()
449 nvram_read_u16(prefix, postfix, "pa5glw2a", in bcm47xx_fill_sprom_path_r4589()
451 nvram_read_u16(prefix, postfix, "pa5ghw0a", in bcm47xx_fill_sprom_path_r4589()
453 nvram_read_u16(prefix, postfix, "pa5ghw1a", in bcm47xx_fill_sprom_path_r4589()
455 nvram_read_u16(prefix, postfix, "pa5ghw2a", in bcm47xx_fill_sprom_path_r4589()
461 const char *prefix, bool fallback) in bcm47xx_fill_sprom_path_r45() argument
472 nvram_read_u16(prefix, postfix, "pa2gw3a", in bcm47xx_fill_sprom_path_r45()
474 nvram_read_u16(prefix, postfix, "pa5gw3a", in bcm47xx_fill_sprom_path_r45()
476 nvram_read_u16(prefix, postfix, "pa5glw3a", in bcm47xx_fill_sprom_path_r45()
478 nvram_read_u16(prefix, postfix, "pa5ghw3a", in bcm47xx_fill_sprom_path_r45()
511 const char *prefix, bool fallback) in bcm47xx_fill_sprom_ethernet() argument
515 nvram_read_macaddr(prefix, "et0macaddr", sprom->et0mac, fallback); in bcm47xx_fill_sprom_ethernet()
516 nvram_read_u8(prefix, NULL, "et0mdcport", &sprom->et0mdcport, 0, in bcm47xx_fill_sprom_ethernet()
518 nvram_read_u8(prefix, NULL, "et0phyaddr", &sprom->et0phyaddr, 0, in bcm47xx_fill_sprom_ethernet()
521 nvram_read_macaddr(prefix, "et1macaddr", sprom->et1mac, fallback); in bcm47xx_fill_sprom_ethernet()
522 nvram_read_u8(prefix, NULL, "et1mdcport", &sprom->et1mdcport, 0, in bcm47xx_fill_sprom_ethernet()
524 nvram_read_u8(prefix, NULL, "et1phyaddr", &sprom->et1phyaddr, 0, in bcm47xx_fill_sprom_ethernet()
527 nvram_read_macaddr(prefix, "et2macaddr", sprom->et2mac, fb); in bcm47xx_fill_sprom_ethernet()
528 nvram_read_u8(prefix, NULL, "et2mdcport", &sprom->et2mdcport, 0, fb); in bcm47xx_fill_sprom_ethernet()
529 nvram_read_u8(prefix, NULL, "et2phyaddr", &sprom->et2phyaddr, 0, fb); in bcm47xx_fill_sprom_ethernet()
531 nvram_read_macaddr(prefix, "macaddr", sprom->il0mac, fallback); in bcm47xx_fill_sprom_ethernet()
532 nvram_read_macaddr(prefix, "il0macaddr", sprom->il0mac, fallback); in bcm47xx_fill_sprom_ethernet()
555 static void bcm47xx_fill_board_data(struct ssb_sprom *sprom, const char *prefix, in bcm47xx_fill_board_data() argument
558 nvram_read_u32_2(prefix, "boardflags", &sprom->boardflags_lo, in bcm47xx_fill_board_data()
560 nvram_read_u32_2(prefix, "boardflags2", &sprom->boardflags2_lo, in bcm47xx_fill_board_data()
564 void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix, in bcm47xx_fill_sprom() argument
567 bcm47xx_fill_sprom_ethernet(sprom, prefix, fallback); in bcm47xx_fill_sprom()
568 bcm47xx_fill_board_data(sprom, prefix, fallback); in bcm47xx_fill_sprom()
570 nvram_read_u8(prefix, NULL, "sromrev", &sprom->revision, 0, fallback); in bcm47xx_fill_sprom()
573 nvram_read_alpha2(prefix, "ccode", sprom->alpha2, fallback); in bcm47xx_fill_sprom()
575 nvram_read_leddc(prefix, "leddc", &sprom->leddc_on_time, in bcm47xx_fill_sprom()
581 bcm47xx_fill_sprom_path_r4589(sprom, prefix, fallback); in bcm47xx_fill_sprom()
582 bcm47xx_fill_sprom_path_r45(sprom, prefix, fallback); in bcm47xx_fill_sprom()
586 bcm47xx_fill_sprom_path_r4589(sprom, prefix, fallback); in bcm47xx_fill_sprom()
590 bcm47xx_sprom_fill_auto(sprom, prefix, fallback); in bcm47xx_fill_sprom()
596 char prefix[10]; in bcm47xx_get_sprom_ssb() local
604 snprintf(prefix, sizeof(prefix), "pci/%u/%u/", in bcm47xx_get_sprom_ssb()
607 bcm47xx_fill_sprom(out, prefix, false); in bcm47xx_get_sprom_ssb()
624 static void bcm47xx_sprom_apply_prefix_alias(char *prefix, size_t prefix_size) in bcm47xx_sprom_apply_prefix_alias() argument
626 size_t prefix_len = strlen(prefix); in bcm47xx_sprom_apply_prefix_alias()
633 if (prefix_len <= 0 || prefix[prefix_len - 1] != '/') in bcm47xx_sprom_apply_prefix_alias()
641 if (!strcmp(buf, prefix) || in bcm47xx_sprom_apply_prefix_alias()
642 (short_len && strlen(buf) == short_len && !strncmp(buf, prefix, short_len))) { in bcm47xx_sprom_apply_prefix_alias()
643 snprintf(prefix, prefix_size, "%d:", i); in bcm47xx_sprom_apply_prefix_alias()
654 char *prefix; in bcm47xx_get_sprom_bcma() local
670 prefix = buf; in bcm47xx_get_sprom_bcma()
678 prefix = buf; in bcm47xx_get_sprom_bcma()
681 prefix = NULL; in bcm47xx_get_sprom_bcma()
689 nvram_read_u16(prefix, NULL, "boardvendor", &binfo->vendor, 0, true); in bcm47xx_get_sprom_bcma()
692 nvram_read_u16(prefix, NULL, "boardtype", &binfo->type, 0, true); in bcm47xx_get_sprom_bcma()
694 bcm47xx_fill_sprom(out, prefix, fallback); in bcm47xx_get_sprom_bcma()