21 u32 l = va_arg (*args,
u32);
22 u8 *
v = va_arg (*args,
u8 *);
25 for (p = v + l - 1; p >= v && p[0] ==
' '; p--)
34 u32 id = va_arg (*args,
u32);
38 #define _(f) case SFP_ID_##f: t = #f; break; 42 return format (s,
"unknown 0x%x",
id);
44 return format (s,
"%s", t);
54 #define _(a,b,f) case SFP_COMPATIBILITY_##f: t = #f; break; 58 return format (s,
"unknown 0x%x", c);
60 return format (s,
"%s", t);
71 #define _(a,b,f) { .byte = a, .bit = b, }, 87 if (e->
id != SFP_ID_sfp)
90 s =
format (s,
"compatibility:");
95 s =
format (s,
"\n%Uvendor: %U, part %U",
101 format (s,
"\n%Urevision: %U, serial: %U, date code: %U",
static u8 * format_sfp_compatibility(u8 *s, va_list *args)
#define foreach_sfp_compatibility
static u8 * format_space_terminated(u8 *s, va_list *args)
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
u8 vendor_serial_number[16]
u8 vendor_part_number[16]
static u8 * format_sfp_id(u8 *s, va_list *args)
u32 sfp_is_comatible(sfp_eeprom_t *e, sfp_compatibility_t c)
u8 * format_sfp_eeprom(u8 *s, va_list *args)