gserial_connect(9)
π gserial_connect(9) π β Kernel API Manual
okay bestie, welcome to the Kernel API Manual page for gserial_connect(9) β the little function that tells the TTY I/O glue your USB link is alive and ready to slay β¨
πΈ NAME πΈ
gserial_connect β notify the TTY I/O glue that the USB link is active π
π SYNOPSIS π
int gserial_connect (struct gserial *gser , u8 port_num );
π ARGUMENTS π
gserβ the function, already set up with endpoints and descriptors π«Άport_numβ which port is active π
π¦ CONTEXT π¦
any (usually from irq) β so yeah, it can run in any context, and usually it's coming from an interrupt π
π DESCRIPTION π
Okay so this is the one that activates the endpoints and lets the TTY layer know the connection is active, kind of like βcarrier detectβ but make it USB β¨. It won't necessarily start the I/O queues; if no task is holding the TTY open, there would be no point anyway. But the endpoints will get activated so the USB host can perform I/O, subject to basic USB hardware flow control π.
Before you call this, caller, you need to have set up the endpoints and the USB function in dev, plus the appropriate (speed-specific) endpoint descriptors. You also need to have allocated port_num by calling gserial_alloc_line π«Ά.
It returns a negative errno or zero. On success, ep->driver_data will be overwritten β lowkey important, bestie π
.
π SEE ALSO π
Kernel file ./drivers/usb/gadget/function/u_serial.c, plus gs_start_io(9) and gserial_disconnect(9) π¦
xoxo π source/version: ./drivers/usb/gadget/function; date: October 2026 β that's the gserial_connect(9) page, bestie! byeee!
π¦ 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