Skip to content

LATX, fix:Prevent HID ioctl handling from interfering with v4l2 ioctls#214

Merged
LaurenIsACoder merged 1 commit into
lat-opensource:masterfrom
lk-me:master
Dec 30, 2025
Merged

LATX, fix:Prevent HID ioctl handling from interfering with v4l2 ioctls#214
LaurenIsACoder merged 1 commit into
lat-opensource:masterfrom
lk-me:master

Conversation

@lk-me
Copy link
Copy Markdown
Contributor

@lk-me lk-me commented Dec 29, 2025

The HID ioctl handling code was incorrectly intercepting v4l2 ioctl commands
due to overlapping ioctl number (nr) values. Specifically, v4l2 commands with
nr=4 were matching HIDIOCGRAWNAME(0) which also has nr=4.

Changes:

  1. Added type checking before processing HID ioctls using TARGET_IOC_TYPE()
  2. Only process ioctls with type 'H' (0x48) in the HID-specific switch statement
  3. Non-HID ioctls now continue to the standard ioctl handling path

This ensures v4l2 ioctls (type='V'/0x56) are not incorrectly processed as HID
ioctls, fixing v4l2 device opening failures.

The HID ioctl handling code was incorrectly intercepting v4l2 ioctl commands
due to overlapping ioctl number (nr) values. Specifically, v4l2 commands with
nr=4 were matching HIDIOCGRAWNAME(0) which also has nr=4.
@LaurenIsACoder LaurenIsACoder merged commit 5097429 into lat-opensource:master Dec 30, 2025
10 checks passed
@zhaodongru
Copy link
Copy Markdown
Contributor

@lk-me After this commit, some fingerprint input devices became unrecognized.The issue has been fixed in this PR(https://github.com/lat-opensource/lat/pull/290). Please help review the PR to confirm whether it will impact the current PR.

@lk-me
Copy link
Copy Markdown
Contributor Author

lk-me commented May 9, 2026

@zhaodong This PR can be opened normally with the previous V4L2 camera.

@zhaodongru
Copy link
Copy Markdown
Contributor

@lk-me Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants