2009年12月28日 星期一

Linux firmware

So it is required to bring up udev before using drivers that load its own firmware.

Documentation/firmware_class/README

request_firmware() hotplug interface:
------------------------------------

(..............)

High level behavior (mixed):
============================

kernel(driver): calls request_firmware(&fw_entry, $FIRMWARE, device)

userspace:
  • /sys/class/firmware/xxx/{loading,data} appear.
  • hotplug gets called with a firmware identifier in $FIRMWARE and the usual hotplug environment.
    • hotplug: echo 1 > /sys/class/firmware/xxx/loading

kernel: Discard any previous partial load.

userspace:
  • hotplug: cat appropriate_firmware_image > \
    /sys/class/firmware/xxx/data

kernel: grows a buffer in PAGE_SIZE increments to hold the image as it
comes in.

userspace:
  • hotplug: echo 0 > /sys/class/firmware/xxx/loading

kernel: request_firmware() returns and the driver has the firmware
image in fw_entry->{data,size}. If something went wrong
request_firmware() returns non-zero and fw_entry is set to
NULL.

kernel(driver): Driver code calls release_firmware(fw_entry) releasing
the firmware image and any related resource.

沒有留言: