Lines Matching refs:e

64 } e;  variable
71 #define is_valid ((e.id[0] == 'N') || (e.id[1] == 'X') || \
72 (e.id[2] == 'I') || (e.id[3] == 'D'))
77 #define is_valid ((e.id[0] == 'C') || (e.id[1] == 'C') || \
78 (e.id[2] == 'I') || (e.id[3] == 'D'))
91 printf("ID: %c%c%c%c v%u\n", e.id[0], e.id[1], e.id[2], e.id[3], in show_eeprom()
92 be32_to_cpu(e.version)); in show_eeprom()
94 printf("ID: %c%c%c%c\n", e.id[0], e.id[1], e.id[2], e.id[3]); in show_eeprom()
98 printf("SN: %s\n", e.sn); in show_eeprom()
102 printf("Errata: %s\n", e.errata); in show_eeprom()
105 e.errata[0] ? e.errata[0] : '.', in show_eeprom()
106 e.errata[1] ? e.errata[1] : '.'); in show_eeprom()
111 e.date[0], e.date[1], e.date[2], in show_eeprom()
112 e.date[3] & 0x7F, e.date[4], e.date[5], in show_eeprom()
113 e.date[3] & 0x80 ? "PM" : ""); in show_eeprom()
116 for (i = 0; i < min(e.mac_count, (u8)MAX_NUM_PORTS); i++) { in show_eeprom()
118 u8 *p = e.mac[i]; in show_eeprom()
124 crc = crc32(0, (void *)&e, sizeof(e) - 4); in show_eeprom()
126 if (crc == be32_to_cpu(e.crc)) in show_eeprom()
127 printf("CRC: %08x\n", be32_to_cpu(e.crc)); in show_eeprom()
130 be32_to_cpu(e.crc), crc); in show_eeprom()
133 printf("EEPROM dump: (0x%x bytes)\n", sizeof(e)); in show_eeprom()
134 for (i = 0; i < sizeof(e); i++) { in show_eeprom()
137 printf("%02X ", ((u8 *)&e)[i]); in show_eeprom()
138 if (((i % 16) == 15) || (i == sizeof(e) - 1)) in show_eeprom()
163 (void *)&e, sizeof(e)); in read_eeprom()
188 crc = crc32(0, (void *)&e, sizeof(e) - 4); in update_crc()
189 e.crc = cpu_to_be32(crc); in update_crc()
206 e.res_0 = 0xFF; in prog_eeprom()
207 memset(e.res_1, 0xFF, sizeof(e.res_1)); in prog_eeprom()
209 memset(e.res_0, 0xFF, sizeof(e.res_0)); in prog_eeprom()
223 for (i = 0, p = &e; i < sizeof(e); i += 8, p += 8) { in prog_eeprom()
225 p, min((int)(sizeof(e) - i), 8)); in prog_eeprom()
237 if (!ret && memcmp(&e, &e2, sizeof(e))) in prog_eeprom()
292 e.date[i] = h2i(string[2 * i]) << 4 | h2i(string[2 * i + 1]); in set_date()
315 e.mac[index][i] = simple_strtoul(p, &p, 16); in set_mac_address()
341 memcpy(e.id, "NXID", sizeof(e.id)); in do_mac()
342 e.version = cpu_to_be32(NXID_VERSION); in do_mac()
344 memcpy(e.id, "CCID", sizeof(e.id)); in do_mac()
371 memset(e.sn, 0, sizeof(e.sn)); in do_mac()
372 strncpy((char *)e.sn, argv[2], sizeof(e.sn) - 1); in do_mac()
377 memset(e.errata, 0, 5); in do_mac()
378 strncpy((char *)e.errata, argv[2], 4); in do_mac()
380 e.errata[0] = argv[2][0]; in do_mac()
381 e.errata[1] = argv[2][1]; in do_mac()
389 e.mac_count = simple_strtoul(argv[2], NULL, 16); in do_mac()
433 e.id[0], e.id[1], e.id[2], e.id[3]); in mac_read_from_eeprom()
442 if (e.version == 0) in mac_read_from_eeprom()
446 crc = crc32(0, (void *)&e, crc_offset); in mac_read_from_eeprom()
447 crcp = (void *)&e + crc_offset; in mac_read_from_eeprom()
449 printf("CRC mismatch (%08x != %08x)\n", crc, be32_to_cpu(e.crc)); in mac_read_from_eeprom()
459 if (e.version == 0) in mac_read_from_eeprom()
460 memset(e.mac[8], 0xff, 6); in mac_read_from_eeprom()
463 for (i = 0; i < min(e.mac_count, (u8)MAX_NUM_PORTS); i++) { in mac_read_from_eeprom()
464 if (memcmp(&e.mac[i], "\0\0\0\0\0\0", 6) && in mac_read_from_eeprom()
465 memcmp(&e.mac[i], "\xFF\xFF\xFF\xFF\xFF\xFF", 6)) { in mac_read_from_eeprom()
470 e.mac[i][0], in mac_read_from_eeprom()
471 e.mac[i][1], in mac_read_from_eeprom()
472 e.mac[i][2], in mac_read_from_eeprom()
473 e.mac[i][3], in mac_read_from_eeprom()
474 e.mac[i][4], in mac_read_from_eeprom()
475 e.mac[i][5]); in mac_read_from_eeprom()
486 printf("%c%c%c%c v%u\n", e.id[0], e.id[1], e.id[2], e.id[3], in mac_read_from_eeprom()
487 be32_to_cpu(e.version)); in mac_read_from_eeprom()
489 printf("%c%c%c%c\n", e.id[0], e.id[1], e.id[2], e.id[3]); in mac_read_from_eeprom()
497 if (e.version == 0) { in mac_read_from_eeprom()
498 e.version = cpu_to_be32(NXID_VERSION); in mac_read_from_eeprom()