aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/firewire/fwcam.c
Commit message (Collapse)AuthorAgeFilesLines
* fwcam: release the IR DMA channel when starting the stream failsAbdelkader Boudih2026-08-091-0/+3
| | | | | | | | Disabled the IR DMA channel on the error path, which clears the flag and frees the descriptor blocks before the chunks go away. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58502
* fwcam: convert to video(4) frameworkAbdelkader Boudih2026-08-091-277/+510
| | | | | | | | Replaced the monolithic cdevsw implementation with the video(4) framework. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58369
* firewire: add warn-only CRC validation for CSR ROM directoriesAbdelkader Boudih2026-07-201-0/+5
| | | | | | | | | | | | Implemented crom_crc_valid() helper to validate IEEE 1394 config ROM CRC-16 checksums. Skipped root header CRC validation since csrhdr.crc_len cover the entire ROM body which is not fully read at header parse time. Per-directory CRC checks below catch corruption where it needed. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58307
* fwcam: match unit directories, defer probe to first openAbdelkader Boudih2026-07-171-102/+98
| | | | | | | Migrated fwcam to use per-unit-directory child device Differential Revision: https://reviews.freebsd.org/D58202 Reviewed by: adrian
* fwcam: retry ISO enable after re-powering cameraAbdelkader Boudih2026-07-091-1/+16
| | | | | | | | | Some IIDC cameras power down the sensor when inactive (e.g. lens cover closed) and reject ISO enable with EIO. Re-power the camera and retry once before failing. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58101
* fwcam: defer ISO streaming to first readAbdelkader Boudih2026-07-091-14/+10
| | | | | | | | | | | Moved ISO start to first usage. Opening the device now only validates state and increments the open count, allowing info queries and mode changes without starting the camera. ISO streaming begins on demand when userland first reads frame data. This avoid the camera led to turn-on at attach. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58100
* fwcamctl: add control utility for fwcam(4) IIDC FireWire camerasAbdelkader Boudih2026-07-081-21/+0
| | | | | | | | | | | | | | | | | | fwcamctl provides userland access to /dev/fwcam0. Supported subcommands: info (camera state, format, mode, rate, features), snap (capture a frame as PPM), mode (set format/mode/rate), and feat (get/set camera feature registers). snap converts YUV422, YUV411, YUV444, RGB8, and Mono8 pixel formats to RGB24 PPM with no external dependencies. A configurable frame skip (default 5) allows auto-exposure and auto-white-balance to settle before capture. (from adrian - yes, I've successfully captured images from an Apple isight camera on firewire with this tool and in-tree support.) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57914
* fwcam: write video mode registers before enabling ISO streamingAbdelkader Boudih2026-07-081-3/+37
| | | | | | | | | | | The IIDC spec (s3.1) requires the video mode to be programmed before ISO enable. Without this, cameras that power up with invalid default mode/rate combinations reject the ISO_EN write. This can happen when the firmware of teh camera is outdated or vendor never updated it. Differential Revision: https://reviews.freebsd.org/D58092
* fwcam: set ISO speed from device link speedAbdelkader Boudih2026-07-081-0/+1
| | | | | | | | | | iso_speed was never initialized, defaulting to S100 regardless of the camera's actual link speed. Some cameras firmwares reject ISO_EN when the speed field in the ISO_CHANNEL register does not match their capabilities. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58091
* fwcam: add dynamic resolution and frame rate supportAbdelkader Boudih2026-07-081-3/+30
| | | | | | | | | | | | | | Read V_MODE_INQ and V_RATE_INQ registers for all supported formats during probe, caching the camera's actual capabilities. Use these to validate SMODE ioctl requests before writing to the camera. Writing an unsupported combination caused the camera to stop responding, requiring a physical power cycle. Tested with: Apple iSight (external FireWire) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58090
* fwcam: add IIDC 1394 FireWire camera driverAbdelkader Boudih2026-06-251-0/+1051
Add fwcam(4), a driver for IIDC v1.30 (TA Document 1999023) digital cameras over IEEE 1394. Supports Format_0 (VGA) video modes with isochronous receive DMA, feature control (brightness, exposure, gain, shutter, white balance, focus, etc.), poll/kqueue, and hot-plug via bus reset handling. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57685