show_filter(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… show_filter(9) β€” or, the lil sysfs callback that tells you your scancode filter πŸ’–

okay so real talk, this is a page from the Kernel API Manual (the (9) is your little "this is kernel internals bestie" badge) and it's all about show_filter. it's short, it's sweet, it slays, let's go ✨


🌸 NAME 🌸

show_filter β€” shows the current scancode filter value or mask. literally that's the whole job. icon behaviour honestly πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

ssize_t show_filter (struct device *device , struct device_attribute *attr , char *buf );

like, three args, one return, no drama πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • device β€” the device descriptor 🫢 (the thing that's like "hi i'm the device in question")
  • attr β€” the device attribute struct 🌸 (the sysfs attribute situation)
  • buf β€” a pointer to the output buffer ✨ (where the pretty hex string goes)

πŸ’– DESCRIPTION πŸ’–

so this routine is a callback routine to read a scancode filter value or mask. no cap, that's what it does.

it gets triggered when someone reads this path:

/sys/class/rc/rc?/[wakeup_]filter[_mask]

and then it does the cute part: it prints the current scancode filter value or mask β€” of the appropriate filter type β€” in hexadecimal into buf, and returns the size of the buffer. hex girlies rise 🧚


now for the actual logic, because this part matters bestie:

bits of the filter value that correspond to set bits in the filter mask get compared against input scancodes, and any non-matching scancodes are simply discarded. bye πŸ‘‹ not invited.


⚠️ also dev->lock is taken to guard against races between store_filter and show_filter. that's the vibes check so the two of them don't step on each other's toes πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

the kernel file lives at ./drivers/media/rc/rc-main.c and here's the whole friend group, no one left out 🫢:


and that's the whole page, bestie 🌈 this lil guy ships out of ./drivers/media/rc and it's dated October 2026 β€” yes, a future icon, we love to see it πŸ’œ periodt.

πŸ“¦ where this page comes from