STRUCT TB_MARGINING(9)
β¨ struct tb_margining(9) β¨
okay so bestie, welcome to the lane margining glow-up π
this is a page straight out of the Kernel API Manual, and it's all about struct tb_margining β the lane margining support struct. yes, margining. no, not the cocktail kind. π
π NAME π
struct tb_margining β lane margining support π literally the whole personality of this struct.
πΈ SYNOPSIS πΈ
here's the struct in all its main-character glory, copy-pasted exactly because we do not mess with code:
struct tb_margining {
struct tb_port *port;
enum usb4_sb_target target;
u8 index;
struct device *dev;
unsigned int gen;
bool asym_rx;
u32 caps[3];
u32 results[3];
enum usb4_margining_lane lanes;
unsigned int min_ber_level;
unsigned int max_ber_level;
unsigned int ber_level;
unsigned int voltage_steps;
unsigned int max_voltage_offset;
unsigned int voltage_steps_optional_range;
unsigned int max_voltage_offset_optional_range;
unsigned int time_steps;
unsigned int max_time_offset;
unsigned int voltage_time_offset;
unsigned int dwell_time;
enum usb4_margin_sw_error_counter error_counter;
bool optional_voltage_offset_range;
bool software;
bool time;
bool right_high;
bool upper_eye;
};
π¦ Members π¦
okay now the field-by-field tour, no cap π«Ά
portβ the USB4 port that the margining operations actually run through. it's giving "the doorway you walk through." πͺtargetβ the sideband target. iykyk.indexβ the retimer index, but only iftagetisUSB4_SB_TARGET_RETIMER. and yeah, "taget" is spelled like that in the original, not me being chaotic π keep the source's spelling, it's iconic in its own way.devβ pointer to the device that is the target (so: the USB4 port or the retimer). pointing at your fave β¨genβ link generation.asym_rxβtrue%if the port supports an asymmetric link with 3 Rx. (yes,true%. that's literally what it says. the percent sign said slay and stayed π)capsβ port lane margining capabilities.resultsβ the last lane margining results. receipts! π§Ύlanesβ0,1or7(all). that's the whole menu, bestie.min_ber_levelβ minimum supported BER level contour value.max_ber_levelβ maximum supported BER level contour value.ber_levelβ the current BER level contour value.voltage_stepsβ number of mandatory voltage steps.max_voltage_offsetβ maximum mandatory voltage offset (in mV).voltage_steps_optional_rangeβ number of voltage steps for the optional range.max_voltage_offset_optional_rangeβ maximum voltage offset for the optional range (in mV). (with a period, because she's thorough π )time_stepsβ number of time margin steps.max_time_offsetβ maximum time margin offset (in mUI).voltage_time_offsetβ offset for voltage / time for software margining.dwell_timeβ dwell time for software margining (in ms).error_counterβ error counter operation for software margining.optional_voltage_offset_rangeβ enable the optional extended voltage range. go off, extended range πsoftwareβtrueif software margining is used instead of hardware.timeβtrueif time margining is used instead of voltage.right_highβfalseif a left/low margin test is performed,trueif right/high.upper_eyeβfalseif the lower PAM3 eye is used,trueif the upper eye is used. ποΈ two eyes, one struct.
π₯ SEE ALSO π₯
go read these next, bestie, the lore continues:
- Kernel file
./drivers/thunderbolt/debugfs.c tb_switch_debugfs_init(9)tb_switch_debugfs_remove(9)tb_service_debugfs_init(9)tb_service_debugfs_remove(9)tb_retimer_debugfs_init(9)tb_retimer_debugfs_remove(9)
π friendly reminder: every field name, type, value and tiny weird spelling above is exactly as the manpage gave it. the vibes are new, the facts are untouched. periodt. π
and that's the whole page!! π sourced from ./drivers/thunderbolt, dated October 2026, and titled struct tb_margining(9) forever and always β mwah, go margin some lanes bestie π§π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms