BUS_NEW_PASS(9)

πŸ’– BUS_NEW_PASS β€” the kernel developer's manual, bestie edition πŸ’–

okay so literally the first thing you need to know is that this page lives in the Kernel Developer's Manual, section 9, and its whole name is BUS_NEW_PASS. yes it's shouty, that's just how kernel methods are, they're all in caps like they're screaming their own name at a party. we love that for them. πŸŽ€


✨ NAME ✨

BUS_NEW_PASS β€” notify a bus that the pass level has been changed

like, it's the lil messenger. the bus finds out the pass level changed, and this is the method that tells it. πŸ¦‹


🌸 SYNOPSIS 🌸

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

void
BUS_NEW_PASS(device_t dev);

no cap, that's the whole signature. takes one device_t dev and returns void, because it's a giver, not a taker. πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

The BUS_NEW_PASS() method gets called on every single bus device so the device tree can be rescanned once the pass level has been changed. it's giving "the group chat got the news, now everybody's gotta re-read it." πŸ“£

and here's the part that matters β€” this method is responsible for the following, so don't ghost these duties:

  • it's responsible for invoking BUS_NEW_PASS on child bus devices, so the rescan actually propagates down to the child devices. yes bestie, it's recursive energy, the rescan has to trickle allll the way down the tree. 🌳
  • it's also responsible for reprobing any unattached child devices β€” the ones just kinda standing there unclaimed πŸ™ˆ
  • and it's responsible for allowing drivers for the current pass to identify new children. new kids on the block, welcome to the family 🫢
and guess what β€” you don't even have to write this yourself if you don't want to, because a default implementation is provided by bus_generic_new_pass(9). iconic behaviour honestly. ⭐

πŸ”₯ SEE ALSO πŸ”₯

go read those too, they're all in the same friend group, iykyk πŸ’œ


and that's the whole page, periodt. this came from the Debian crew and it's dated June 8, 2009 β€” yeah it's an elder but it's still serving, and honestly? it ate. πŸŒˆπŸ’–βœ¨ bye bestie, go rescan something πŸ¦‹

πŸ“¦ where this page comes from