• Home
  • Raw
  • Download

Lines Matching refs:prefix

35 static void create_key(const char *prefix, const char *postfix,  in create_key()  argument
38 if (prefix && postfix) in create_key()
39 snprintf(buf, len, "%s%s%s", prefix, name, postfix); in create_key()
40 else if (prefix) in create_key()
41 snprintf(buf, len, "%s%s", prefix, name); in create_key()
48 static int get_nvram_var(const char *prefix, const char *postfix, in get_nvram_var() argument
54 create_key(prefix, postfix, name, key, sizeof(key)); in get_nvram_var()
57 if (fallback && err == -ENOENT && prefix) { in get_nvram_var()
65 static void nvram_read_ ## type(const char *prefix, \
73 err = get_nvram_var(prefix, postfix, name, buf, sizeof(buf), \
80 prefix, name, postfix, buf, err); \
95 static void nvram_read_u32_2(const char *prefix, const char *name, in NVRAM_READ_VAL()
102 err = get_nvram_var(prefix, NULL, name, buf, sizeof(buf), fallback); in NVRAM_READ_VAL()
108 prefix, name, buf, err); in NVRAM_READ_VAL()
115 static void nvram_read_leddc(const char *prefix, const char *name, in nvram_read_leddc() argument
123 err = get_nvram_var(prefix, NULL, name, buf, sizeof(buf), fallback); in nvram_read_leddc()
129 prefix, name, buf, err); in nvram_read_leddc()
154 static void nvram_read_macaddr(const char *prefix, const char *name, in nvram_read_macaddr() argument
160 err = get_nvram_var(prefix, NULL, name, buf, sizeof(buf), fallback); in nvram_read_macaddr()
167 static void nvram_read_alpha2(const char *prefix, const char *name, in nvram_read_alpha2() argument
173 err = get_nvram_var(prefix, NULL, name, buf, sizeof(buf), fallback); in nvram_read_alpha2()
200 const char *prefix, bool fallback) in bcm47xx_sprom_fill_auto() argument
202 const char *pre = prefix; in bcm47xx_sprom_fill_auto()
421 const char *prefix, bool fallback) in bcm47xx_fill_sprom_path_r4589() argument
432 nvram_read_u8(prefix, postfix, "maxp2ga", in bcm47xx_fill_sprom_path_r4589()
434 nvram_read_u8(prefix, postfix, "itt2ga", in bcm47xx_fill_sprom_path_r4589()
436 nvram_read_u8(prefix, postfix, "itt5ga", in bcm47xx_fill_sprom_path_r4589()
438 nvram_read_u16(prefix, postfix, "pa2gw0a", in bcm47xx_fill_sprom_path_r4589()
440 nvram_read_u16(prefix, postfix, "pa2gw1a", in bcm47xx_fill_sprom_path_r4589()
442 nvram_read_u16(prefix, postfix, "pa2gw2a", in bcm47xx_fill_sprom_path_r4589()
444 nvram_read_u8(prefix, postfix, "maxp5ga", in bcm47xx_fill_sprom_path_r4589()
446 nvram_read_u8(prefix, postfix, "maxp5gha", in bcm47xx_fill_sprom_path_r4589()
448 nvram_read_u8(prefix, postfix, "maxp5gla", in bcm47xx_fill_sprom_path_r4589()
450 nvram_read_u16(prefix, postfix, "pa5gw0a", in bcm47xx_fill_sprom_path_r4589()
452 nvram_read_u16(prefix, postfix, "pa5gw1a", in bcm47xx_fill_sprom_path_r4589()
454 nvram_read_u16(prefix, postfix, "pa5gw2a", in bcm47xx_fill_sprom_path_r4589()
456 nvram_read_u16(prefix, postfix, "pa5glw0a", in bcm47xx_fill_sprom_path_r4589()
458 nvram_read_u16(prefix, postfix, "pa5glw1a", in bcm47xx_fill_sprom_path_r4589()
460 nvram_read_u16(prefix, postfix, "pa5glw2a", in bcm47xx_fill_sprom_path_r4589()
462 nvram_read_u16(prefix, postfix, "pa5ghw0a", in bcm47xx_fill_sprom_path_r4589()
464 nvram_read_u16(prefix, postfix, "pa5ghw1a", in bcm47xx_fill_sprom_path_r4589()
466 nvram_read_u16(prefix, postfix, "pa5ghw2a", in bcm47xx_fill_sprom_path_r4589()
472 const char *prefix, bool fallback) in bcm47xx_fill_sprom_path_r45() argument
483 nvram_read_u16(prefix, postfix, "pa2gw3a", in bcm47xx_fill_sprom_path_r45()
485 nvram_read_u16(prefix, postfix, "pa5gw3a", in bcm47xx_fill_sprom_path_r45()
487 nvram_read_u16(prefix, postfix, "pa5glw3a", in bcm47xx_fill_sprom_path_r45()
489 nvram_read_u16(prefix, postfix, "pa5ghw3a", in bcm47xx_fill_sprom_path_r45()
522 const char *prefix, bool fallback) in bcm47xx_fill_sprom_ethernet() argument
526 nvram_read_macaddr(prefix, "et0macaddr", sprom->et0mac, fallback); in bcm47xx_fill_sprom_ethernet()
527 nvram_read_u8(prefix, NULL, "et0mdcport", &sprom->et0mdcport, 0, in bcm47xx_fill_sprom_ethernet()
529 nvram_read_u8(prefix, NULL, "et0phyaddr", &sprom->et0phyaddr, 0, in bcm47xx_fill_sprom_ethernet()
532 nvram_read_macaddr(prefix, "et1macaddr", sprom->et1mac, fallback); in bcm47xx_fill_sprom_ethernet()
533 nvram_read_u8(prefix, NULL, "et1mdcport", &sprom->et1mdcport, 0, in bcm47xx_fill_sprom_ethernet()
535 nvram_read_u8(prefix, NULL, "et1phyaddr", &sprom->et1phyaddr, 0, in bcm47xx_fill_sprom_ethernet()
538 nvram_read_macaddr(prefix, "et2macaddr", sprom->et2mac, fb); in bcm47xx_fill_sprom_ethernet()
539 nvram_read_u8(prefix, NULL, "et2mdcport", &sprom->et2mdcport, 0, fb); in bcm47xx_fill_sprom_ethernet()
540 nvram_read_u8(prefix, NULL, "et2phyaddr", &sprom->et2phyaddr, 0, fb); in bcm47xx_fill_sprom_ethernet()
542 nvram_read_macaddr(prefix, "macaddr", sprom->il0mac, fallback); in bcm47xx_fill_sprom_ethernet()
543 nvram_read_macaddr(prefix, "il0macaddr", sprom->il0mac, fallback); in bcm47xx_fill_sprom_ethernet()
566 static void bcm47xx_fill_board_data(struct ssb_sprom *sprom, const char *prefix, in bcm47xx_fill_board_data() argument
569 nvram_read_u32_2(prefix, "boardflags", &sprom->boardflags_lo, in bcm47xx_fill_board_data()
571 nvram_read_u32_2(prefix, "boardflags2", &sprom->boardflags2_lo, in bcm47xx_fill_board_data()
575 void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix, in bcm47xx_fill_sprom() argument
578 bcm47xx_fill_sprom_ethernet(sprom, prefix, fallback); in bcm47xx_fill_sprom()
579 bcm47xx_fill_board_data(sprom, prefix, fallback); in bcm47xx_fill_sprom()
581 nvram_read_u8(prefix, NULL, "sromrev", &sprom->revision, 0, fallback); in bcm47xx_fill_sprom()
584 nvram_read_alpha2(prefix, "ccode", sprom->alpha2, fallback); in bcm47xx_fill_sprom()
586 nvram_read_leddc(prefix, "leddc", &sprom->leddc_on_time, in bcm47xx_fill_sprom()
592 bcm47xx_fill_sprom_path_r4589(sprom, prefix, fallback); in bcm47xx_fill_sprom()
593 bcm47xx_fill_sprom_path_r45(sprom, prefix, fallback); in bcm47xx_fill_sprom()
597 bcm47xx_fill_sprom_path_r4589(sprom, prefix, fallback); in bcm47xx_fill_sprom()
601 bcm47xx_sprom_fill_auto(sprom, prefix, fallback); in bcm47xx_fill_sprom()
607 char prefix[10]; in bcm47xx_get_sprom_ssb() local
615 snprintf(prefix, sizeof(prefix), "pci/%u/%u/", in bcm47xx_get_sprom_ssb()
618 bcm47xx_fill_sprom(out, prefix, false); in bcm47xx_get_sprom_ssb()
635 static void bcm47xx_sprom_apply_prefix_alias(char *prefix, size_t prefix_size) in bcm47xx_sprom_apply_prefix_alias() argument
637 size_t prefix_len = strlen(prefix); in bcm47xx_sprom_apply_prefix_alias()
644 if (prefix_len <= 0 || prefix[prefix_len - 1] != '/') in bcm47xx_sprom_apply_prefix_alias()
652 if (!strcmp(buf, prefix) || in bcm47xx_sprom_apply_prefix_alias()
653 (short_len && strlen(buf) == short_len && !strncmp(buf, prefix, short_len))) { in bcm47xx_sprom_apply_prefix_alias()
654 snprintf(prefix, prefix_size, "%d:", i); in bcm47xx_sprom_apply_prefix_alias()
665 char *prefix; in bcm47xx_get_sprom_bcma() local
681 prefix = buf; in bcm47xx_get_sprom_bcma()
689 prefix = buf; in bcm47xx_get_sprom_bcma()
692 prefix = NULL; in bcm47xx_get_sprom_bcma()
700 nvram_read_u16(prefix, NULL, "boardvendor", &binfo->vendor, 0, true); in bcm47xx_get_sprom_bcma()
703 nvram_read_u16(prefix, NULL, "boardtype", &binfo->type, 0, true); in bcm47xx_get_sprom_bcma()
705 bcm47xx_fill_sprom(out, prefix, fallback); in bcm47xx_get_sprom_bcma()