lan78xx_con..._flowcontrol(9)
๐
lan78xx_configure_flowcontrol โ the Kernel API Manual glow-up ๐
okay so bestie, welcome to the LAN78xx flow control page โจ this is from the Kernel API Manual and it's literally all about telling the chip when to send pause frames and when to chill. stay with me, it's giving hardware tea โ
โจ NAME โจ
lan78xx_configure_flowcontrol โ set MAC and FIFO flow control configuration ๐ฆ
๐ธ SYNOPSIS ๐ธ
int lan78xx_configure_flowcontrol (struct lan78xx_net *dev , bool
tx_pause , bool rx_pause );
๐ง ARGUMENTS ๐ง
devโ pointer to the LAN78xx device structure. that's your main character right there ๐tx_pauseโ enable transmission of pause frames (yes, we're sending them ๐ค)rx_pauseโ enable reception of pause frames (and yes, we're receiving them ๐ฅ)
๐ฅ DESCRIPTION ๐ฅ
So this function configures the LAN78xx flow control settings by writing to the FLOW and FCT_FLOW registers. no cap, that's the whole job ๐
The pause time is set to the maximum allowed value (65535 quanta). FIFO thresholds are selected based on USB speed. slay.
The Pause Time field is measured in units of 512-bit times (quanta):
- At 1 Gbps: 1 quanta = 512 ns โ max ~33.6 ms pause โก
- At 100 Mbps: 1 quanta = 5.12 ยตs โ max ~335 ms pause ๐ธ
- At 10 Mbps: 1 quanta = 51.2 ยตs โ max ~3.3 s pause ๐ข
Flow control thresholds (FCT_FLOW) are used to trigger pause/resume:
RXUSEDis the number of bytes used in the RX FIFO- Flow is turned ON when
RXUSEDโฅFLOW_ONthreshold ๐ข - Flow is turned OFF when
RXUSEDโคFLOW_OFFthreshold ๐ด - Both thresholds are encoded in units of 512 bytes (rounded up) ๐งฎ
Thresholds differ by USB speed because available USB bandwidth affects how fast packets can be drained from the RX FIFO:
- USB 3.x (SuperSpeed):
FLOW_ON= 9216 bytes โ 18 units,FLOW_OFF= 4096 bytes โ 8 units ๐ - USB 2.0 (High-Speed):
FLOW_ON= 8704 bytes โ 17 units,FLOW_OFF= 1024 bytes โ 2 units ๐
๐ NOTE ๐
TheFCT_FLOWregister must be configured before enabling TX pause (i.e., before settingFLOW_CR_TX_FCEN_), as required by the hardware. like, the hardware said what it said and we are NOT arguing ๐ do it in that order, fr fr.
โญ RETURN โญ
0 on success or a negative error code on failure. that's it, that's the vibe check โ
๐ SEE ALSO ๐
Kernel file ./drivers/net/usb/lan78xx.c, plus these icons:
lan78xx_phy_int_ack(9)lan78xx_configure_usb(9)lan78xx_mac_eee_enable(9)lan78xx_set_fixed_link(9)lan78xx_get_phy(9)lan78xx_mac_prepare_for_phy(9)lan78xx_configure_leds_from_dt(9)
go read them, iykyk ๐ซถ
and that's the whole page, bestie ๐ this lil' icon lives in ./drivers/net/usb, dated October 2026 โ go off, periodt ๐
โจ
๐ฆ 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