BUS_GENERIC_NEW_PASS(9)

✨ BUS_GENERIC_NEW_PASS(9) ✨

okay so bestie, welcome to the BUS_GENERIC_NEW_PASS page from the Kernel Developer's Manual πŸ’– this is the one about the generic implementation of BUS_NEW_PASS for bus devices, and honestly? it's giving backstage-pass energy πŸ‘‘


πŸŽ€ NAME πŸŽ€

bus_generic_new_pass β€” the generic, one-size-fits-all implementation of BUS_NEW_PASS for bus devices. no cap, that's literally what it is πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <sys/param.h>
#include <sys/bus.h>

void
bus_generic_new_pass(device_t dev);

so you're pulling in <sys/param.h> and <sys/bus.h>, and the function itself is void, meaning it hands nothing back to you, it just does the thing. it takes one argument, device_t dev, and off it goes 🌸


πŸ’– DESCRIPTION πŸ’–

so here's the tea, bestie πŸ“ this function provides an implementation of the BUS_NEW_PASS(9) method, and it's specifically there for bus drivers to use. it's the generic version, so if you're a bus driver and you don't wanna write your own, this is your girl 🫢

and the way it works is so satisfying, let me walk you through it:

  1. first up, it invokes the DEVICE_IDENTIFY(9) method β€” but only for the drivers whose pass level is equal to the new pass level. not more, not less. equality. we're being precise here, periodt πŸ’…
  2. then it goes through every single child device. for each attached child device, it calls BUS_NEW_PASS(9) so those child buses get rescanned πŸ”₯
  3. and for each unattached child device, it calls device_probe_and_attach(9). probe 'em, attach 'em, slay ✨

that's the whole routine. identify, rescan, probe-and-attach. iconic behaviour honestly πŸ‘‘


🌈 SEE ALSO 🌈


and that's a wrap, bestie πŸŽ€ this lil page came to you from Debian, dated January 15, 2017 β€” shoutout to the kernel devs for keeping the pass levels in check so we don't have to πŸ’œ mwah, go read bus_set_pass(9) next, iykyk πŸŒΈπŸ’–βœ¨

πŸ“¦ where this page comes from