show_filter(9)
π 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.
β οΈ alsodev->lockis taken to guard against races betweenstore_filterandshow_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 π«Ά:
scancode_to_u64(9)ir_create_table(9)ir_free_table(9)ir_resize_table(9)ir_update_mapping(9)ir_establish_scancode(9)ir_setkeycode(9)ir_setkeytable(9)ir_lookup_by_scancode(9)ir_getkeycode(9)rc_g_keycode_from_table(9)ir_do_keyup(9)rc_keyup(9)ir_timer_keyup(9)ir_timer_repeat(9)rc_repeat(9)ir_do_keydown(9)rc_keydown(9)rc_keydown_notimeout(9)rc_validate_scancode(9)rc_validate_filter(9)struct rc_filter_attribute(9)show_protocols(9)parse_protocol_change(9)store_protocols(9)store_filter(9)show_wakeup_protocols(9)store_wakeup_protocols(9)
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
- 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