aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/00-INDEX16
-rw-r--r--Documentation/ABI/obsolete/dv13949
-rw-r--r--Documentation/ABI/obsolete/proc-pid-oom_adj22
-rw-r--r--Documentation/ABI/obsolete/sysfs-driver-hid-roccat-koneplus10
-rw-r--r--Documentation/ABI/removed/dv139414
-rw-r--r--Documentation/ABI/removed/o2cb (renamed from Documentation/ABI/obsolete/o2cb)9
-rw-r--r--Documentation/ABI/removed/raw139415
-rw-r--r--Documentation/ABI/removed/raw1394_legacy_isochronous16
-rw-r--r--Documentation/ABI/removed/video139416
-rw-r--r--Documentation/ABI/stable/sysfs-class-backlight20
-rw-r--r--Documentation/ABI/stable/sysfs-firmware-efi-vars75
-rw-r--r--Documentation/ABI/stable/thermal-notification4
-rw-r--r--Documentation/ABI/testing/configfs-spear-pcie-gadget31
-rw-r--r--Documentation/ABI/testing/pstore41
-rw-r--r--Documentation/ABI/testing/sysfs-ata99
-rw-r--r--Documentation/ABI/testing/sysfs-block64
-rw-r--r--Documentation/ABI/testing/sysfs-block-zram99
-rw-r--r--Documentation/ABI/testing/sysfs-bus-bcma31
-rw-r--r--Documentation/ABI/testing/sysfs-bus-css2
-rw-r--r--Documentation/ABI/testing/sysfs-bus-media6
-rw-r--r--Documentation/ABI/testing/sysfs-bus-pci40
-rw-r--r--Documentation/ABI/testing/sysfs-bus-pci-devices-cciss12
-rw-r--r--Documentation/ABI/testing/sysfs-bus-rbd83
-rw-r--r--Documentation/ABI/testing/sysfs-class-backlight-driver-adp887056
-rw-r--r--Documentation/ABI/testing/sysfs-class-led9
-rw-r--r--Documentation/ABI/testing/sysfs-class-net-batman-adv14
-rw-r--r--Documentation/ABI/testing/sysfs-class-net-mesh69
-rw-r--r--Documentation/ABI/testing/sysfs-devices-mmc21
-rw-r--r--Documentation/ABI/testing/sysfs-devices-power94
-rw-r--r--Documentation/ABI/testing/sysfs-devices-system-cpu34
-rw-r--r--Documentation/ABI/testing/sysfs-devices-system-ibm-rtl22
-rw-r--r--Documentation/ABI/testing/sysfs-driver-hid10
-rw-r--r--Documentation/ABI/testing/sysfs-driver-hid-roccat-arvo53
-rw-r--r--Documentation/ABI/testing/sysfs-driver-hid-roccat-kone26
-rw-r--r--Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus112
-rw-r--r--Documentation/ABI/testing/sysfs-driver-hid-roccat-kovaplus100
-rw-r--r--Documentation/ABI/testing/sysfs-driver-hid-roccat-pyra107
-rw-r--r--Documentation/ABI/testing/sysfs-driver-samsung-laptop19
-rw-r--r--Documentation/ABI/testing/sysfs-firmware-dmi110
-rw-r--r--Documentation/ABI/testing/sysfs-firmware-gsmi58
-rw-r--r--Documentation/ABI/testing/sysfs-firmware-log7
-rw-r--r--Documentation/ABI/testing/sysfs-fs-ext413
-rw-r--r--Documentation/ABI/testing/sysfs-kernel-fscaps8
-rw-r--r--Documentation/ABI/testing/sysfs-kernel-mm-cleancache11
-rw-r--r--Documentation/ABI/testing/sysfs-module12
-rw-r--r--Documentation/ABI/testing/sysfs-platform-asus-laptop18
-rw-r--r--Documentation/ABI/testing/sysfs-platform-asus-wmi31
-rw-r--r--Documentation/ABI/testing/sysfs-platform-at9125
-rw-r--r--Documentation/ABI/testing/sysfs-platform-ideapad-laptop6
-rw-r--r--Documentation/ABI/testing/sysfs-platform-kim48
-rw-r--r--Documentation/ABI/testing/sysfs-power43
-rw-r--r--Documentation/ABI/testing/sysfs-ptp98
-rw-r--r--Documentation/ABI/testing/sysfs-tty19
-rw-r--r--Documentation/Changes51
-rw-r--r--Documentation/CodingStyle16
-rw-r--r--Documentation/DocBook/.gitignore1
-rw-r--r--Documentation/DocBook/80211.tmpl574
-rw-r--r--Documentation/DocBook/Makefile8
-rw-r--r--Documentation/DocBook/device-drivers.tmpl19
-rw-r--r--Documentation/DocBook/drm.tmpl7
-rw-r--r--Documentation/DocBook/dvb/dvbapi.xml10
-rw-r--r--Documentation/DocBook/dvb/dvbproperty.xml408
-rw-r--r--Documentation/DocBook/dvb/frontend.h.xml20
-rw-r--r--Documentation/DocBook/dvb/frontend.xml2
-rw-r--r--Documentation/DocBook/filesystems.tmpl5
-rw-r--r--Documentation/DocBook/genericirq.tmpl144
-rw-r--r--Documentation/DocBook/kernel-api.tmpl9
-rw-r--r--Documentation/DocBook/kernel-locking.tmpl16
-rw-r--r--Documentation/DocBook/kgdb.tmpl13
-rw-r--r--Documentation/DocBook/libata.tmpl10
-rw-r--r--Documentation/DocBook/mac80211.tmpl337
-rw-r--r--Documentation/DocBook/media-entities.tmpl69
-rw-r--r--Documentation/DocBook/media.tmpl7
-rw-r--r--Documentation/DocBook/mtdnand.tmpl17
-rw-r--r--Documentation/DocBook/rapidio.tmpl1
-rw-r--r--Documentation/DocBook/regulator.tmpl4
-rw-r--r--Documentation/DocBook/sh.tmpl4
-rw-r--r--Documentation/DocBook/uio-howto.tmpl8
-rw-r--r--Documentation/DocBook/usb.tmpl2
-rw-r--r--Documentation/DocBook/v4l/bayer.pdfbin0 -> 12116 bytes
-rw-r--r--Documentation/DocBook/v4l/bayer.pngbin0 -> 9725 bytes
-rw-r--r--Documentation/DocBook/v4l/common.xml4
-rw-r--r--Documentation/DocBook/v4l/compat.xml50
-rw-r--r--Documentation/DocBook/v4l/controls.xml14
-rw-r--r--Documentation/DocBook/v4l/dev-capture.xml13
-rw-r--r--Documentation/DocBook/v4l/dev-output.xml13
-rw-r--r--Documentation/DocBook/v4l/dev-rds.xml74
-rw-r--r--Documentation/DocBook/v4l/dev-subdev.xml313
-rw-r--r--Documentation/DocBook/v4l/dev-teletext.xml29
-rw-r--r--Documentation/DocBook/v4l/func-ioctl.xml5
-rw-r--r--Documentation/DocBook/v4l/func-mmap.xml10
-rw-r--r--Documentation/DocBook/v4l/func-munmap.xml3
-rw-r--r--Documentation/DocBook/v4l/io.xml283
-rw-r--r--Documentation/DocBook/v4l/libv4l.xml2
-rw-r--r--Documentation/DocBook/v4l/lirc_device_interface.xml2
-rw-r--r--Documentation/DocBook/v4l/media-controller.xml89
-rw-r--r--Documentation/DocBook/v4l/media-func-close.xml59
-rw-r--r--Documentation/DocBook/v4l/media-func-ioctl.xml116
-rw-r--r--Documentation/DocBook/v4l/media-func-open.xml94
-rw-r--r--Documentation/DocBook/v4l/media-ioc-device-info.xml133
-rw-r--r--Documentation/DocBook/v4l/media-ioc-enum-entities.xml308
-rw-r--r--Documentation/DocBook/v4l/media-ioc-enum-links.xml207
-rw-r--r--Documentation/DocBook/v4l/media-ioc-setup-link.xml93
-rw-r--r--Documentation/DocBook/v4l/nv12mt.gifbin0 -> 2108 bytes
-rw-r--r--Documentation/DocBook/v4l/nv12mt_example.gifbin0 -> 6858 bytes
-rw-r--r--Documentation/DocBook/v4l/pipeline.pdfbin0 -> 20276 bytes
-rw-r--r--Documentation/DocBook/v4l/pipeline.pngbin0 -> 12130 bytes
-rw-r--r--Documentation/DocBook/v4l/pixfmt-m420.xml147
-rw-r--r--Documentation/DocBook/v4l/pixfmt-nv12m.xml154
-rw-r--r--Documentation/DocBook/v4l/pixfmt-nv12mt.xml74
-rw-r--r--Documentation/DocBook/v4l/pixfmt-packed-rgb.xml2
-rw-r--r--Documentation/DocBook/v4l/pixfmt-srggb10.xml90
-rw-r--r--Documentation/DocBook/v4l/pixfmt-srggb12.xml90
-rw-r--r--Documentation/DocBook/v4l/pixfmt-srggb8.xml67
-rw-r--r--Documentation/DocBook/v4l/pixfmt-y10.xml79
-rw-r--r--Documentation/DocBook/v4l/pixfmt-y10b.xml43
-rw-r--r--Documentation/DocBook/v4l/pixfmt-y12.xml79
-rw-r--r--Documentation/DocBook/v4l/pixfmt-yuv420m.xml162
-rw-r--r--Documentation/DocBook/v4l/pixfmt.xml151
-rw-r--r--Documentation/DocBook/v4l/planar-apis.xml62
-rw-r--r--Documentation/DocBook/v4l/remote_controllers.xml2
-rw-r--r--Documentation/DocBook/v4l/subdev-formats.xml2572
-rw-r--r--Documentation/DocBook/v4l/v4l2.xml41
-rw-r--r--Documentation/DocBook/v4l/videodev2.h.xml249
-rw-r--r--Documentation/DocBook/v4l/vidioc-enum-fmt.xml2
-rw-r--r--Documentation/DocBook/v4l/vidioc-g-dv-preset.xml3
-rw-r--r--Documentation/DocBook/v4l/vidioc-g-dv-timings.xml3
-rw-r--r--Documentation/DocBook/v4l/vidioc-g-fmt.xml15
-rw-r--r--Documentation/DocBook/v4l/vidioc-qbuf.xml24
-rw-r--r--Documentation/DocBook/v4l/vidioc-query-dv-preset.xml2
-rw-r--r--Documentation/DocBook/v4l/vidioc-querybuf.xml14
-rw-r--r--Documentation/DocBook/v4l/vidioc-querycap.xml25
-rw-r--r--Documentation/DocBook/v4l/vidioc-queryctrl.xml18
-rw-r--r--Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml10
-rw-r--r--Documentation/DocBook/v4l/vidioc-streamon.xml9
-rw-r--r--Documentation/DocBook/v4l/vidioc-subdev-enum-frame-interval.xml152
-rw-r--r--Documentation/DocBook/v4l/vidioc-subdev-enum-frame-size.xml154
-rw-r--r--Documentation/DocBook/v4l/vidioc-subdev-enum-mbus-code.xml119
-rw-r--r--Documentation/DocBook/v4l/vidioc-subdev-g-crop.xml155
-rw-r--r--Documentation/DocBook/v4l/vidioc-subdev-g-fmt.xml180
-rw-r--r--Documentation/DocBook/v4l/vidioc-subdev-g-frame-interval.xml141
-rw-r--r--Documentation/DocBook/writing-an-alsa-driver.tmpl2
-rw-r--r--Documentation/HOWTO2
-rw-r--r--Documentation/IPMI.txt27
-rw-r--r--Documentation/IRQ-affinity.txt17
-rw-r--r--Documentation/Makefile2
-rw-r--r--Documentation/PCI/MSI-HOWTO.txt4
-rw-r--r--Documentation/RCU/00-INDEX2
-rw-r--r--Documentation/RCU/checklist.txt46
-rw-r--r--Documentation/RCU/stallwarn.txt41
-rw-r--r--Documentation/RCU/trace.txt440
-rw-r--r--Documentation/RCU/whatisRCU.txt31
-rw-r--r--Documentation/SecurityBugs2
-rw-r--r--Documentation/SubmittingDrivers2
-rw-r--r--Documentation/SubmittingPatches11
-rw-r--r--Documentation/accounting/cgroupstats.txt4
-rw-r--r--Documentation/accounting/getdelays.c77
-rw-r--r--Documentation/acpi/apei/output_format.txt147
-rw-r--r--Documentation/acpi/method-customizing.txt5
-rw-r--r--Documentation/arm/00-INDEX4
-rw-r--r--Documentation/arm/Booting33
-rw-r--r--Documentation/arm/IXP4xx4
-rw-r--r--Documentation/arm/OMAP/DSS7
-rw-r--r--Documentation/arm/OMAP/omap_pm25
-rw-r--r--Documentation/arm/SA1100/FreeBird4
-rw-r--r--Documentation/arm/SH-Mobile/Makefile8
-rw-r--r--Documentation/arm/SH-Mobile/vrl4.c169
-rw-r--r--Documentation/arm/SH-Mobile/zboot-rom-mmcif.txt29
-rw-r--r--Documentation/arm/Samsung-S3C24XX/Suspend.txt2
-rw-r--r--Documentation/arm/Samsung/GPIO.txt2
-rw-r--r--Documentation/arm/Samsung/Overview.txt2
-rw-r--r--Documentation/arm/Sharp-LH/ADC-LH7-Touchscreen61
-rw-r--r--Documentation/arm/Sharp-LH/CompactFlash32
-rw-r--r--Documentation/arm/Sharp-LH/IOBarrier45
-rw-r--r--Documentation/arm/Sharp-LH/KEV7A4008
-rw-r--r--Documentation/arm/Sharp-LH/LCDPanels59
-rw-r--r--Documentation/arm/Sharp-LH/LPD7A40015
-rw-r--r--Documentation/arm/Sharp-LH/LPD7A40X16
-rw-r--r--Documentation/arm/Sharp-LH/SDRAM51
-rw-r--r--Documentation/arm/Sharp-LH/VectoredInterruptController80
-rw-r--r--Documentation/arm/msm/gpiomux.txt176
-rw-r--r--Documentation/arm/swp_emulation27
-rw-r--r--Documentation/atomic_ops.txt2
-rw-r--r--Documentation/block/00-INDEX4
-rw-r--r--Documentation/block/barrier.txt261
-rw-r--r--Documentation/block/biodoc.txt9
-rw-r--r--Documentation/block/switching-sched.txt8
-rw-r--r--Documentation/block/writeback_cache_control.txt86
-rw-r--r--Documentation/blockdev/cciss.txt15
-rw-r--r--Documentation/cachetlb.txt2
-rw-r--r--Documentation/cgroups/blkio-controller.txt186
-rw-r--r--Documentation/cgroups/cgroup_event_listener.c2
-rw-r--r--Documentation/cgroups/cgroups.txt143
-rw-r--r--Documentation/cgroups/cpuacct.txt21
-rw-r--r--Documentation/cgroups/cpusets.txt45
-rw-r--r--Documentation/cgroups/devices.txt6
-rw-r--r--Documentation/cgroups/freezer-subsystem.txt20
-rw-r--r--Documentation/cgroups/memcg_test.txt2
-rw-r--r--Documentation/cgroups/memory.txt78
-rw-r--r--Documentation/coccinelle.txt54
-rw-r--r--Documentation/cpu-freq/governors.txt11
-rw-r--r--Documentation/cpu-hotplug.txt2
-rw-r--r--Documentation/cputopology.txt23
-rw-r--r--Documentation/dell_rbu.txt2
-rw-r--r--Documentation/development-process/1.Intro18
-rw-r--r--Documentation/development-process/2.Process188
-rw-r--r--Documentation/development-process/3.Early-stage31
-rw-r--r--Documentation/development-process/4.Coding21
-rw-r--r--Documentation/development-process/5.Posting28
-rw-r--r--Documentation/development-process/6.Followthrough16
-rw-r--r--Documentation/development-process/7.AdvancedTopics4
-rw-r--r--Documentation/device-mapper/dm-crypt.txt9
-rw-r--r--Documentation/device-mapper/dm-flakey.txt17
-rw-r--r--Documentation/device-mapper/dm-raid.txt70
-rw-r--r--Documentation/device-mapper/dm-service-time.txt2
-rw-r--r--Documentation/devices.txt15
-rw-r--r--Documentation/devicetree/00-INDEX10
-rw-r--r--Documentation/devicetree/bindings/ata/fsl-sata.txt (renamed from Documentation/powerpc/dts-bindings/fsl/sata.txt)0
-rw-r--r--Documentation/devicetree/bindings/crypto/fsl-sec4.txt397
-rw-r--r--Documentation/devicetree/bindings/eeprom.txt28
-rw-r--r--Documentation/devicetree/bindings/fb/sm501fb.txt34
-rw-r--r--Documentation/devicetree/bindings/gpio/8xxx_gpio.txt (renamed from Documentation/powerpc/dts-bindings/fsl/8xxx_gpio.txt)0
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio.txt (renamed from Documentation/powerpc/dts-bindings/gpio/gpio.txt)0
-rw-r--r--Documentation/devicetree/bindings/gpio/led.txt (renamed from Documentation/powerpc/dts-bindings/gpio/led.txt)0
-rw-r--r--Documentation/devicetree/bindings/hwmon/ads1015.txt73
-rw-r--r--Documentation/devicetree/bindings/i2c/ce4100-i2c.txt93
-rw-r--r--Documentation/devicetree/bindings/i2c/fsl-i2c.txt (renamed from Documentation/powerpc/dts-bindings/fsl/i2c.txt)0
-rw-r--r--Documentation/devicetree/bindings/marvell.txt (renamed from Documentation/powerpc/dts-bindings/marvell.txt)0
-rw-r--r--Documentation/devicetree/bindings/mmc/fsl-esdhc.txt (renamed from Documentation/powerpc/dts-bindings/fsl/esdhc.txt)0
-rw-r--r--Documentation/devicetree/bindings/mmc/mmc-spi-slot.txt (renamed from Documentation/powerpc/dts-bindings/mmc-spi-slot.txt)9
-rw-r--r--Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt (renamed from Documentation/powerpc/dts-bindings/fsl/upm-nand.txt)2
-rw-r--r--Documentation/devicetree/bindings/mtd/mtd-physmap.txt (renamed from Documentation/powerpc/dts-bindings/mtd-physmap.txt)0
-rwxr-xr-xDocumentation/devicetree/bindings/net/can/fsl-flexcan.txt61
-rw-r--r--Documentation/devicetree/bindings/net/can/mpc5xxx-mscan.txt (renamed from Documentation/powerpc/dts-bindings/fsl/can.txt)0
-rw-r--r--Documentation/devicetree/bindings/net/can/sja1000.txt (renamed from Documentation/powerpc/dts-bindings/can/sja1000.txt)2
-rw-r--r--Documentation/devicetree/bindings/net/fsl-tsec-phy.txt (renamed from Documentation/powerpc/dts-bindings/fsl/tsec.txt)54
-rw-r--r--Documentation/devicetree/bindings/net/mdio-gpio.txt (renamed from Documentation/powerpc/dts-bindings/gpio/mdio.txt)0
-rw-r--r--Documentation/devicetree/bindings/net/phy.txt (renamed from Documentation/powerpc/dts-bindings/phy.txt)0
-rw-r--r--Documentation/devicetree/bindings/open-pic.txt98
-rw-r--r--Documentation/devicetree/bindings/pci/83xx-512x-pci.txt (renamed from Documentation/powerpc/dts-bindings/fsl/83xx-512x-pci.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/4xx/cpm.txt52
-rw-r--r--Documentation/devicetree/bindings/powerpc/4xx/emac.txt (renamed from Documentation/powerpc/dts-bindings/4xx/emac.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/4xx/ndfc.txt (renamed from Documentation/powerpc/dts-bindings/4xx/ndfc.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/4xx/ppc440spe-adma.txt (renamed from Documentation/powerpc/dts-bindings/4xx/ppc440spe-adma.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/4xx/reboot.txt (renamed from Documentation/powerpc/dts-bindings/4xx/reboot.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/board.txt (renamed from Documentation/powerpc/dts-bindings/fsl/board.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/cache_sram.txt20
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/brg.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/brg.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/i2c.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/i2c.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/pic.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/pic.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/usb.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/usb.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/gpio.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/network.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/network.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/firmware.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/firmware.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/par_io.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/par_io.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/pincfg.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/pincfg.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/ucc.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/ucc.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/usb.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/serial.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/diu.txt (renamed from Documentation/powerpc/dts-bindings/fsl/diu.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/dma.txt (renamed from Documentation/powerpc/dts-bindings/fsl/dma.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/ecm.txt (renamed from Documentation/powerpc/dts-bindings/ecm.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/gtm.txt (renamed from Documentation/powerpc/dts-bindings/fsl/gtm.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/guts.txt (renamed from Documentation/powerpc/dts-bindings/fsl/guts.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/ifc.txt76
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/lbc.txt (renamed from Documentation/powerpc/dts-bindings/fsl/lbc.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/mcm.txt (renamed from Documentation/powerpc/dts-bindings/fsl/mcm.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/mcu-mpc8349emitx.txt (renamed from Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/mpc5121-psc.txt (renamed from Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/mpc5200.txt (renamed from Documentation/powerpc/dts-bindings/fsl/mpc5200.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/mpic-timer.txt38
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/mpic.txt211
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/msi-pic.txt (renamed from Documentation/powerpc/dts-bindings/fsl/msi-pic.txt)9
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/pmc.txt (renamed from Documentation/powerpc/dts-bindings/fsl/pmc.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/sec.txt (renamed from Documentation/powerpc/dts-bindings/fsl/sec.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/ssi.txt (renamed from Documentation/powerpc/dts-bindings/fsl/ssi.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/nintendo/gamecube.txt (renamed from Documentation/powerpc/dts-bindings/nintendo/gamecube.txt)0
-rw-r--r--Documentation/devicetree/bindings/powerpc/nintendo/wii.txt (renamed from Documentation/powerpc/dts-bindings/nintendo/wii.txt)2
-rw-r--r--Documentation/devicetree/bindings/rtc/rtc-cmos.txt28
-rw-r--r--Documentation/devicetree/bindings/serial/altera_jtaguart.txt4
-rw-r--r--Documentation/devicetree/bindings/serial/altera_uart.txt7
-rw-r--r--Documentation/devicetree/bindings/serio/altera_ps2.txt4
-rw-r--r--Documentation/devicetree/bindings/spi/fsl-spi.txt (renamed from Documentation/powerpc/dts-bindings/fsl/spi.txt)24
-rw-r--r--Documentation/devicetree/bindings/spi/spi-bus.txt (renamed from Documentation/powerpc/dts-bindings/spi-bus.txt)0
-rw-r--r--Documentation/devicetree/bindings/spi/spi_altera.txt4
-rw-r--r--Documentation/devicetree/bindings/spi/spi_oc_tiny.txt12
-rw-r--r--Documentation/devicetree/bindings/usb/fsl-usb.txt (renamed from Documentation/powerpc/dts-bindings/fsl/usb.txt)22
-rw-r--r--Documentation/devicetree/bindings/usb/usb-ehci.txt (renamed from Documentation/powerpc/dts-bindings/usb-ehci.txt)0
-rw-r--r--Documentation/devicetree/bindings/x86/ce4100.txt38
-rw-r--r--Documentation/devicetree/bindings/x86/interrupt.txt26
-rw-r--r--Documentation/devicetree/bindings/x86/timer.txt6
-rw-r--r--Documentation/devicetree/bindings/xilinx.txt (renamed from Documentation/powerpc/dts-bindings/xilinx.txt)0
-rw-r--r--Documentation/devicetree/booting-without-of.txt (renamed from Documentation/powerpc/booting-without-of.txt)235
-rw-r--r--Documentation/dmaengine.txt97
-rw-r--r--Documentation/dontdiff76
-rw-r--r--Documentation/driver-model/bus.txt19
-rw-r--r--Documentation/driver-model/class.txt17
-rw-r--r--Documentation/driver-model/device.txt91
-rw-r--r--Documentation/driver-model/driver.txt18
-rw-r--r--Documentation/driver-model/interface.txt129
-rw-r--r--Documentation/dvb/README.dvb-usb2
-rw-r--r--Documentation/dvb/ci.txt2
-rw-r--r--Documentation/dvb/faq.txt2
-rw-r--r--Documentation/dvb/get_dvb_firmware54
-rw-r--r--Documentation/dvb/lmedm04.txt70
-rw-r--r--Documentation/dvb/udev.txt2
-rw-r--r--Documentation/dynamic-debug-howto.txt38
-rw-r--r--Documentation/edac.txt12
-rw-r--r--Documentation/eisa.txt2
-rw-r--r--Documentation/email-clients.txt50
-rw-r--r--Documentation/fb/00-INDEX32
-rw-r--r--Documentation/fb/sm501.txt10
-rw-r--r--Documentation/fb/udlfb.txt144
-rw-r--r--Documentation/fb/viafb.txt48
-rw-r--r--Documentation/feature-removal-schedule.txt323
-rw-r--r--Documentation/filesystems/00-INDEX2
-rw-r--r--Documentation/filesystems/9p.txt33
-rw-r--r--Documentation/filesystems/Locking270
-rw-r--r--Documentation/filesystems/adfs.txt18
-rw-r--r--Documentation/filesystems/autofs4-mount-control.txt2
-rw-r--r--Documentation/filesystems/caching/netfs-api.txt34
-rw-r--r--Documentation/filesystems/configfs/configfs.txt2
-rw-r--r--Documentation/filesystems/configfs/configfs_example_explicit.c8
-rw-r--r--Documentation/filesystems/configfs/configfs_example_macros.c6
-rw-r--r--Documentation/filesystems/dentry-locking.txt174
-rw-r--r--Documentation/filesystems/exofs.txt10
-rw-r--r--Documentation/filesystems/ext4.txt229
-rw-r--r--Documentation/filesystems/gfs2-uevents.txt2
-rw-r--r--Documentation/filesystems/gfs2.txt2
-rw-r--r--Documentation/filesystems/nfs/00-INDEX4
-rw-r--r--Documentation/filesystems/nfs/idmapper.txt67
-rw-r--r--Documentation/filesystems/nfs/nfsroot.txt22
-rw-r--r--Documentation/filesystems/nfs/pnfs.txt55
-rw-r--r--Documentation/filesystems/nilfs2.txt1
-rw-r--r--Documentation/filesystems/ntfs.txt7
-rw-r--r--Documentation/filesystems/ocfs2.txt17
-rw-r--r--Documentation/filesystems/path-lookup.txt382
-rw-r--r--Documentation/filesystems/pohmelfs/network_protocol.txt2
-rw-r--r--Documentation/filesystems/porting101
-rw-r--r--Documentation/filesystems/proc.txt73
-rw-r--r--Documentation/filesystems/romfs.txt3
-rw-r--r--Documentation/filesystems/sharedsubtree.txt4
-rw-r--r--Documentation/filesystems/smbfs.txt8
-rw-r--r--Documentation/filesystems/squashfs.txt30
-rw-r--r--Documentation/filesystems/sysfs.txt18
-rw-r--r--Documentation/filesystems/ubifs.txt30
-rw-r--r--Documentation/filesystems/vfs.txt189
-rw-r--r--Documentation/filesystems/xfs-delayed-logging-design.txt26
-rw-r--r--Documentation/filesystems/xfs.txt6
-rw-r--r--Documentation/flexible-arrays.txt4
-rw-r--r--Documentation/gpio.txt10
-rw-r--r--Documentation/hid/hiddev.txt (renamed from Documentation/usb/hiddev.txt)0
-rw-r--r--Documentation/hid/hidraw.txt119
-rw-r--r--Documentation/hwmon/abituguru2
-rw-r--r--Documentation/hwmon/abituguru-datasheet8
-rw-r--r--Documentation/hwmon/abituguru32
-rw-r--r--Documentation/hwmon/adm102136
-rw-r--r--Documentation/hwmon/adm127560
-rw-r--r--Documentation/hwmon/adm92402
-rw-r--r--Documentation/hwmon/ads101572
-rw-r--r--Documentation/hwmon/ads78282
-rw-r--r--Documentation/hwmon/coretemp21
-rw-r--r--Documentation/hwmon/dme173712
-rw-r--r--Documentation/hwmon/ds62034
-rw-r--r--Documentation/hwmon/emc6w20142
-rw-r--r--Documentation/hwmon/f71882fg43
-rw-r--r--Documentation/hwmon/fam15h_power37
-rw-r--r--Documentation/hwmon/it8728
-rw-r--r--Documentation/hwmon/jc4221
-rw-r--r--Documentation/hwmon/k10temp13
-rw-r--r--Documentation/hwmon/lineage-pem77
-rw-r--r--Documentation/hwmon/lm755
-rw-r--r--Documentation/hwmon/lm8572
-rw-r--r--Documentation/hwmon/lm9071
-rw-r--r--Documentation/hwmon/lm939
-rw-r--r--Documentation/hwmon/ltc415147
-rw-r--r--Documentation/hwmon/ltc426163
-rw-r--r--Documentation/hwmon/max1606462
-rw-r--r--Documentation/hwmon/max1606598
-rw-r--r--Documentation/hwmon/max3444079
-rw-r--r--Documentation/hwmon/max663949
-rw-r--r--Documentation/hwmon/max664221
-rw-r--r--Documentation/hwmon/max665023
-rw-r--r--Documentation/hwmon/max868869
-rw-r--r--Documentation/hwmon/pcf859118
-rw-r--r--Documentation/hwmon/pkgtemp36
-rw-r--r--Documentation/hwmon/pmbus197
-rw-r--r--Documentation/hwmon/sch562722
-rw-r--r--Documentation/hwmon/sht1574
-rw-r--r--Documentation/hwmon/sht2149
-rw-r--r--Documentation/hwmon/smm6658
-rw-r--r--Documentation/hwmon/submitting-patches109
-rw-r--r--Documentation/hwmon/sysfs-interface77
-rw-r--r--Documentation/hwmon/twl4030-madc-hwmon45
-rw-r--r--Documentation/hwmon/ucd9000110
-rw-r--r--Documentation/hwmon/ucd9200112
-rw-r--r--Documentation/hwmon/w83627ehf60
-rw-r--r--Documentation/hwmon/w83627hf22
-rw-r--r--Documentation/hwmon/w83781d2
-rw-r--r--Documentation/hwmon/w83791d2
-rw-r--r--Documentation/hwmon/w837932
-rw-r--r--Documentation/hwmon/w83795127
-rw-r--r--Documentation/hwspinlock.txt293
-rw-r--r--Documentation/i2c/busses/i2c-diolan-u2c26
-rw-r--r--Documentation/i2c/busses/i2c-i80110
-rw-r--r--Documentation/i2c/busses/i2c-parport-light2
-rw-r--r--Documentation/i2c/busses/i2c-sis96x2
-rw-r--r--Documentation/i2c/busses/i2c-taos-evm2
-rw-r--r--Documentation/i2c/instantiating-devices2
-rw-r--r--Documentation/i2c/muxes/gpio-i2cmux65
-rw-r--r--Documentation/i2c/upgrading-clients18
-rw-r--r--Documentation/i2c/writing-clients2
-rw-r--r--Documentation/i2o/README2
-rw-r--r--Documentation/ia64/aliasing-test.c2
-rw-r--r--Documentation/input/cma3000_d0x.txt115
-rw-r--r--Documentation/input/elantech.txt123
-rw-r--r--Documentation/input/event-codes.txt262
-rw-r--r--Documentation/input/ff.txt4
-rw-r--r--Documentation/input/joystick-parport.txt2
-rw-r--r--Documentation/input/multi-touch-protocol.txt53
-rw-r--r--Documentation/input/ntrig.txt126
-rw-r--r--Documentation/input/rotary-encoder.txt15
-rw-r--r--Documentation/input/walkera0701.txt2
-rw-r--r--Documentation/ioctl/ioctl-number.txt16
-rw-r--r--Documentation/iostats.txt19
-rw-r--r--Documentation/irqflags-tracing.txt2
-rw-r--r--Documentation/isdn/INTERFACE.CAPI2
-rw-r--r--Documentation/ja_JP/HOWTO129
-rw-r--r--Documentation/kbuild/kbuild.txt36
-rw-r--r--Documentation/kbuild/kconfig-language.txt42
-rw-r--r--Documentation/kbuild/kconfig.txt5
-rw-r--r--Documentation/kbuild/makefiles.txt78
-rw-r--r--Documentation/kbuild/modules.txt733
-rw-r--r--Documentation/kdump/kdump.txt15
-rw-r--r--Documentation/kernel-docs.txt27
-rw-r--r--Documentation/kernel-parameters.txt191
-rw-r--r--Documentation/kmemleak.txt6
-rw-r--r--Documentation/ko_KR/HOWTO4
-rw-r--r--Documentation/kprobes.txt10
-rw-r--r--Documentation/kref.txt2
-rw-r--r--Documentation/laptops/acer-wmi.txt184
-rw-r--r--Documentation/laptops/asus-laptop.txt4
-rw-r--r--Documentation/laptops/hpfall.c (renamed from Documentation/hwmon/hpfall.c)0
-rw-r--r--Documentation/laptops/sony-laptop.txt37
-rw-r--r--Documentation/laptops/thinkpad-acpi.txt5
-rw-r--r--Documentation/leds/00-INDEX8
-rw-r--r--Documentation/leds/leds-class.txt (renamed from Documentation/leds-class.txt)20
-rw-r--r--Documentation/leds/leds-lp3944.txt (renamed from Documentation/leds-lp3944.txt)0
-rw-r--r--Documentation/leds/leds-lp5521.txt88
-rw-r--r--Documentation/leds/leds-lp5523.txt83
-rw-r--r--Documentation/lockstat.txt38
-rw-r--r--Documentation/magic-number.txt2
-rw-r--r--Documentation/make/headers_install.txt5
-rw-r--r--Documentation/md.txt10
-rw-r--r--Documentation/media-framework.txt353
-rw-r--r--Documentation/memory-barriers.txt58
-rw-r--r--Documentation/memory-hotplug.txt47
-rw-r--r--Documentation/mips/AU1xxx_IDE.README4
-rw-r--r--Documentation/misc-devices/apds990x.txt111
-rw-r--r--Documentation/misc-devices/bh1770glc.txt116
-rw-r--r--Documentation/misc-devices/ics932s4012
-rw-r--r--Documentation/misc-devices/lis3lv02d (renamed from Documentation/hwmon/lis3lv02d)4
-rw-r--r--Documentation/misc-devices/spear-pcie-gadget.txt130
-rw-r--r--Documentation/mmc/00-INDEX2
-rw-r--r--Documentation/mmc/mmc-dev-attrs.txt10
-rw-r--r--Documentation/mmc/mmc-dev-parts.txt27
-rw-r--r--Documentation/networking/00-INDEX6
-rw-r--r--Documentation/networking/3c359.txt2
-rw-r--r--Documentation/networking/LICENSE.qlcnic327
-rw-r--r--Documentation/networking/Makefile2
-rw-r--r--Documentation/networking/README.ipw22002
-rw-r--r--Documentation/networking/batman-adv.txt241
-rw-r--r--Documentation/networking/bonding.txt160
-rw-r--r--Documentation/networking/bridge.txt4
-rw-r--r--Documentation/networking/caif/Linux-CAIF.txt2
-rw-r--r--Documentation/networking/caif/spi_porting.txt4
-rw-r--r--Documentation/networking/can.txt14
-rw-r--r--Documentation/networking/dccp.txt52
-rw-r--r--Documentation/networking/dns_resolver.txt13
-rw-r--r--Documentation/networking/e100.txt19
-rw-r--r--Documentation/networking/e1000.txt16
-rw-r--r--Documentation/networking/e1000e.txt52
-rw-r--r--Documentation/networking/generic_netlink.txt2
-rw-r--r--Documentation/networking/ieee802154.txt2
-rw-r--r--Documentation/networking/igb.txt46
-rw-r--r--Documentation/networking/igbvf.txt6
-rw-r--r--Documentation/networking/ip-sysctl.txt80
-rw-r--r--Documentation/networking/ixgb.txt10
-rw-r--r--Documentation/networking/ixgbe.txt213
-rw-r--r--Documentation/networking/ixgbevf.txt4
-rw-r--r--Documentation/networking/olympic.txt2
-rw-r--r--Documentation/networking/packet_mmap.txt2
-rw-r--r--Documentation/networking/phonet.txt45
-rw-r--r--Documentation/networking/phy.txt18
-rw-r--r--Documentation/networking/s2io.txt4
-rw-r--r--Documentation/networking/stmmac.txt48
-rw-r--r--Documentation/networking/tc-actions-env-rules.txt4
-rw-r--r--Documentation/networking/timestamping.txt22
-rw-r--r--Documentation/nfc/nfc-pn544.txt114
-rw-r--r--Documentation/pcmcia/driver-changes.txt25
-rw-r--r--Documentation/power/00-INDEX2
-rw-r--r--Documentation/power/devices.txt119
-rw-r--r--Documentation/power/drivers-testing.txt8
-rw-r--r--Documentation/power/interface.txt2
-rw-r--r--Documentation/power/notifiers.txt53
-rw-r--r--Documentation/power/opp.txt378
-rw-r--r--Documentation/power/regulator/machine.txt4
-rw-r--r--Documentation/power/runtime_pm.txt306
-rw-r--r--Documentation/power/s2ram.txt7
-rw-r--r--Documentation/power/states.txt12
-rw-r--r--Documentation/power/swsusp.txt7
-rw-r--r--Documentation/power/userland-swsusp.txt6
-rw-r--r--Documentation/powerpc/00-INDEX4
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/mpic.txt42
-rw-r--r--Documentation/powerpc/hvcs.txt2
-rw-r--r--Documentation/pps/pps.txt46
-rw-r--r--Documentation/printk-formats.txt119
-rw-r--r--Documentation/pti/pti_intel_mid.txt99
-rw-r--r--Documentation/ptp/ptp.txt89
-rw-r--r--Documentation/ptp/testptp.c381
-rw-r--r--Documentation/ptp/testptp.mk33
-rw-r--r--Documentation/rapidio/rapidio.txt173
-rw-r--r--Documentation/rapidio/sysfs.txt90
-rw-r--r--Documentation/rbtree.txt4
-rw-r--r--Documentation/rtc.txt29
-rw-r--r--Documentation/s390/Debugging390.txt2
-rw-r--r--Documentation/scheduler/00-INDEX2
-rw-r--r--Documentation/scheduler/sched-design-CFS.txt14
-rw-r--r--Documentation/scheduler/sched-domains.txt32
-rw-r--r--Documentation/scheduler/sched-rt-group.txt7
-rw-r--r--Documentation/scheduler/sched-stats.txt33
-rw-r--r--Documentation/scsi/ChangeLog.lpfc20
-rw-r--r--Documentation/scsi/ChangeLog.megaraid2
-rw-r--r--Documentation/scsi/ChangeLog.megaraid_sas106
-rw-r--r--Documentation/scsi/ChangeLog.ncr53c8xx2
-rw-r--r--Documentation/scsi/ChangeLog.sym53c8xx2
-rw-r--r--Documentation/scsi/LICENSE.qla2xxx292
-rw-r--r--Documentation/scsi/aha152x.txt2
-rw-r--r--Documentation/scsi/aic79xx.txt12
-rw-r--r--Documentation/scsi/hpsa.txt23
-rw-r--r--Documentation/scsi/ibmmca.txt4
-rw-r--r--Documentation/scsi/scsi-changer.txt2
-rw-r--r--Documentation/scsi/scsi_eh.txt2
-rw-r--r--Documentation/scsi/scsi_fc_transport.txt2
-rw-r--r--Documentation/scsi/scsi_mid_low_api.txt73
-rw-r--r--Documentation/scsi/st.txt15
-rw-r--r--Documentation/scsi/sym53c8xx_2.txt2
-rw-r--r--Documentation/security/00-INDEX18
-rw-r--r--Documentation/security/SELinux.txt (renamed from Documentation/SELinux.txt)0
-rw-r--r--Documentation/security/Smack.txt (renamed from Documentation/Smack.txt)0
-rw-r--r--Documentation/security/apparmor.txt (renamed from Documentation/apparmor.txt)0
-rw-r--r--Documentation/security/credentials.txt (renamed from Documentation/credentials.txt)2
-rw-r--r--Documentation/security/keys-request-key.txt (renamed from Documentation/keys-request-key.txt)13
-rw-r--r--Documentation/security/keys-trusted-encrypted.txt145
-rw-r--r--Documentation/security/keys.txt (renamed from Documentation/keys.txt)32
-rw-r--r--Documentation/security/tomoyo.txt (renamed from Documentation/tomoyo.txt)0
-rw-r--r--Documentation/serial/00-INDEX2
-rw-r--r--Documentation/serial/moxa-smartio2
-rw-r--r--Documentation/serial/n_gsm.txt89
-rw-r--r--Documentation/serial/serial-rs485.txt120
-rw-r--r--Documentation/serial/tty.txt2
-rw-r--r--Documentation/sh/clk.txt32
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt111
-rw-r--r--Documentation/sound/alsa/HD-Audio-Models.txt4
-rw-r--r--Documentation/sound/alsa/HD-Audio.txt8
-rw-r--r--Documentation/sound/alsa/SB-Live-mixer.txt6
-rw-r--r--Documentation/sound/alsa/soc/codec.txt45
-rw-r--r--Documentation/sound/alsa/soc/machine.txt38
-rw-r--r--Documentation/sound/alsa/soc/platform.txt12
-rw-r--r--Documentation/sound/oss/AudioExcelDSP166
-rw-r--r--Documentation/sound/oss/README.OSS2
-rw-r--r--Documentation/sound/oss/README.ymfsb2
-rw-r--r--Documentation/spi/pxa2xx6
-rw-r--r--Documentation/spi/spi-lm70llp2
-rw-r--r--Documentation/spinlocks.txt69
-rw-r--r--Documentation/stable_api_nonsense.txt2
-rw-r--r--Documentation/sysctl/00-INDEX2
-rw-r--r--Documentation/sysctl/fs.txt24
-rw-r--r--Documentation/sysctl/kernel.txt33
-rw-r--r--Documentation/sysctl/net.txt11
-rw-r--r--Documentation/sysctl/vm.txt16
-rw-r--r--Documentation/sysrq.txt7
-rwxr-xr-xDocumentation/target/tcm_mod_builder.py1094
-rw-r--r--Documentation/target/tcm_mod_builder.txt145
-rw-r--r--Documentation/telephony/ixj.txt2
-rw-r--r--Documentation/thermal/sysfs-api.txt12
-rw-r--r--Documentation/timers/hpet_example.c27
-rw-r--r--Documentation/timers/timer_stats.txt2
-rw-r--r--Documentation/timers/timers-howto.txt2
-rw-r--r--Documentation/trace/events-power.txt90
-rw-r--r--Documentation/trace/events.txt8
-rw-r--r--Documentation/trace/ftrace-design.txt7
-rw-r--r--Documentation/trace/ftrace.txt151
-rw-r--r--Documentation/trace/kprobetrace.txt17
-rw-r--r--Documentation/trace/postprocess/trace-vmscan-postprocess.pl50
-rw-r--r--Documentation/trace/ring-buffer-design.txt2
-rw-r--r--Documentation/usb/callbacks.txt8
-rw-r--r--Documentation/usb/error-codes.txt9
-rw-r--r--Documentation/usb/linux-cdc-acm.inf4
-rw-r--r--Documentation/usb/linux.inf6
-rw-r--r--Documentation/usb/power-management.txt113
-rw-r--r--Documentation/usb/proc_usb_info.txt34
-rw-r--r--Documentation/usb/usbmon.txt42
-rw-r--r--Documentation/vgaarbiter.txt20
-rw-r--r--Documentation/video4linux/CARDLIST.cx881
-rw-r--r--Documentation/video4linux/CARDLIST.em28xx11
-rw-r--r--Documentation/video4linux/CARDLIST.saa71344
-rw-r--r--Documentation/video4linux/Makefile8
-rw-r--r--Documentation/video4linux/README.cpia191
-rw-r--r--Documentation/video4linux/README.ivtv3
-rw-r--r--Documentation/video4linux/README.pvrusb22
-rw-r--r--Documentation/video4linux/Zoran75
-rw-r--r--Documentation/video4linux/bttv/Cards4
-rw-r--r--Documentation/video4linux/bttv/Insmod-options2
-rw-r--r--Documentation/video4linux/bttv/MAKEDEV1
-rw-r--r--Documentation/video4linux/bttv/README2
-rw-r--r--Documentation/video4linux/bttv/README.freeze2
-rw-r--r--Documentation/video4linux/bttv/Sound-FAQ4
-rw-r--r--Documentation/video4linux/et61x251.txt4
-rw-r--r--Documentation/video4linux/gspca.txt14
-rw-r--r--Documentation/video4linux/meye.txt10
-rw-r--r--Documentation/video4linux/omap3isp.txt278
-rw-r--r--Documentation/video4linux/pxa_camera.txt8
-rw-r--r--Documentation/video4linux/sh_mobile_ceu_camera.txt6
-rw-r--r--Documentation/video4linux/sn9c102.txt4
-rw-r--r--Documentation/video4linux/uvcvideo.txt239
-rw-r--r--Documentation/video4linux/v4l2-controls.txt12
-rw-r--r--Documentation/video4linux/v4l2-framework.txt304
-rw-r--r--Documentation/video4linux/v4lgrab.c201
-rw-r--r--Documentation/video4linux/videobuf7
-rw-r--r--Documentation/video4linux/w9968cf.txt2
-rw-r--r--Documentation/video4linux/zc0301.txt6
-rw-r--r--Documentation/virtual/00-INDEX10
-rw-r--r--Documentation/virtual/kvm/api.txt (renamed from Documentation/kvm/api.txt)355
-rw-r--r--Documentation/virtual/kvm/cpuid.txt (renamed from Documentation/kvm/cpuid.txt)3
-rw-r--r--Documentation/virtual/kvm/locking.txt25
-rw-r--r--Documentation/virtual/kvm/mmu.txt (renamed from Documentation/kvm/mmu.txt)2
-rw-r--r--Documentation/virtual/kvm/msr.txt (renamed from Documentation/kvm/msr.txt)36
-rw-r--r--Documentation/virtual/kvm/ppc-pv.txt196
-rw-r--r--Documentation/virtual/kvm/review-checklist.txt (renamed from Documentation/kvm/review-checklist.txt)2
-rw-r--r--Documentation/virtual/kvm/timekeeping.txt612
-rw-r--r--Documentation/virtual/lguest/.gitignore (renamed from Documentation/lguest/.gitignore)0
-rw-r--r--Documentation/virtual/lguest/Makefile (renamed from Documentation/lguest/Makefile)2
-rw-r--r--Documentation/virtual/lguest/extract (renamed from Documentation/lguest/extract)0
-rw-r--r--Documentation/virtual/lguest/lguest.c (renamed from Documentation/lguest/lguest.c)124
-rw-r--r--Documentation/virtual/lguest/lguest.txt (renamed from Documentation/lguest/lguest.txt)15
-rw-r--r--Documentation/virtual/uml/UserModeLinux-HOWTO.txt (renamed from Documentation/uml/UserModeLinux-HOWTO.txt)10
-rw-r--r--Documentation/vm/Makefile2
-rw-r--r--Documentation/vm/active_mm.txt2
-rw-r--r--Documentation/vm/cleancache.txt278
-rw-r--r--Documentation/vm/highmem.txt162
-rw-r--r--Documentation/vm/hugetlbpage.txt2
-rw-r--r--Documentation/vm/hwpoison.txt6
-rw-r--r--Documentation/vm/locking2
-rw-r--r--Documentation/vm/numa_memory_policy.txt2
-rw-r--r--Documentation/vm/overcommit-accounting2
-rw-r--r--Documentation/vm/page-types.c105
-rw-r--r--Documentation/vm/slabinfo.c1364
-rw-r--r--Documentation/vm/transhuge.txt298
-rw-r--r--Documentation/vm/unevictable-lru.txt3
-rw-r--r--Documentation/w1/slaves/00-INDEX2
-rw-r--r--Documentation/w1/slaves/w1_ds242347
-rw-r--r--Documentation/w1/w1.netlink2
-rw-r--r--Documentation/watchdog/hpwdt.txt2
-rw-r--r--Documentation/workqueue.txt73
-rw-r--r--Documentation/x86/boot.txt9
-rw-r--r--Documentation/x86/x86_64/boot-options.txt21
-rw-r--r--Documentation/x86/x86_64/kernel-stacks6
-rw-r--r--Documentation/xz.txt121
-rw-r--r--Documentation/zh_CN/HOWTO4
-rw-r--r--Documentation/zh_CN/SecurityBugs50
-rw-r--r--Documentation/zh_CN/SubmitChecklist109
-rw-r--r--Documentation/zh_CN/SubmittingDrivers2
-rw-r--r--Documentation/zh_CN/SubmittingPatches4
-rw-r--r--Documentation/zh_CN/email-clients.txt210
-rw-r--r--Documentation/zh_CN/magic-number.txt167
678 files changed, 30330 insertions, 7268 deletions
diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX
index 8dfc6708a257..1f89424c36a6 100644
--- a/Documentation/00-INDEX
+++ b/Documentation/00-INDEX
@@ -192,10 +192,6 @@ kernel-docs.txt
192 - listing of various WWW + books that document kernel internals. 192 - listing of various WWW + books that document kernel internals.
193kernel-parameters.txt 193kernel-parameters.txt
194 - summary listing of command line / boot prompt args for the kernel. 194 - summary listing of command line / boot prompt args for the kernel.
195keys-request-key.txt
196 - description of the kernel key request service.
197keys.txt
198 - description of the kernel key retention service.
199kobject.txt 195kobject.txt
200 - info of the kobject infrastructure of the Linux kernel. 196 - info of the kobject infrastructure of the Linux kernel.
201kprobes.txt 197kprobes.txt
@@ -206,8 +202,8 @@ laptops/
206 - directory with laptop related info and laptop driver documentation. 202 - directory with laptop related info and laptop driver documentation.
207ldm.txt 203ldm.txt
208 - a brief description of LDM (Windows Dynamic Disks). 204 - a brief description of LDM (Windows Dynamic Disks).
209leds-class.txt 205leds/
210 - documents LED handling under Linux. 206 - directory with info about LED handling under Linux.
211local_ops.txt 207local_ops.txt
212 - semantics and behavior of local atomic operations. 208 - semantics and behavior of local atomic operations.
213lockdep-design.txt 209lockdep-design.txt
@@ -294,6 +290,8 @@ scheduler/
294 - directory with info on the scheduler. 290 - directory with info on the scheduler.
295scsi/ 291scsi/
296 - directory with info on Linux scsi support. 292 - directory with info on Linux scsi support.
293security/
294 - directory that contains security-related info
297serial/ 295serial/
298 - directory with info on the low level serial API. 296 - directory with info on the low level serial API.
299serial-console.txt 297serial-console.txt
@@ -328,10 +326,6 @@ sysrq.txt
328 - info on the magic SysRq key. 326 - info on the magic SysRq key.
329telephony/ 327telephony/
330 - directory with info on telephony (e.g. voice over IP) support. 328 - directory with info on telephony (e.g. voice over IP) support.
331time_interpolators.txt
332 - info on time interpolators.
333uml/
334 - directory with information about User Mode Linux.
335unicode.txt 329unicode.txt
336 - info on the Unicode character/font mapping used in Linux. 330 - info on the Unicode character/font mapping used in Linux.
337unshare.txt 331unshare.txt
@@ -346,8 +340,6 @@ vm/
346 - directory with info on the Linux vm code. 340 - directory with info on the Linux vm code.
347volatile-considered-harmful.txt 341volatile-considered-harmful.txt
348 - Why the "volatile" type class should not be used 342 - Why the "volatile" type class should not be used
349voyager.txt
350 - guide to running Linux on the Voyager architecture.
351w1/ 343w1/
352 - directory with documents regarding the 1-wire (w1) subsystem. 344 - directory with documents regarding the 1-wire (w1) subsystem.
353watchdog/ 345watchdog/
diff --git a/Documentation/ABI/obsolete/dv1394 b/Documentation/ABI/obsolete/dv1394
deleted file mode 100644
index 2ee36864ca10..000000000000
--- a/Documentation/ABI/obsolete/dv1394
+++ /dev/null
@@ -1,9 +0,0 @@
1What: dv1394 (a.k.a. "OHCI-DV I/O support" for FireWire)
2Contact: linux1394-devel@lists.sourceforge.net
3Description:
4 New application development should use raw1394 + userspace libraries
5 instead, notably libiec61883 which is functionally equivalent.
6
7Users:
8 ffmpeg/libavformat (used by a variety of media players)
9 dvgrab v1.x (replaced by dvgrab2 on top of raw1394 and resp. libraries)
diff --git a/Documentation/ABI/obsolete/proc-pid-oom_adj b/Documentation/ABI/obsolete/proc-pid-oom_adj
new file mode 100644
index 000000000000..cf63f264ce0f
--- /dev/null
+++ b/Documentation/ABI/obsolete/proc-pid-oom_adj
@@ -0,0 +1,22 @@
1What: /proc/<pid>/oom_adj
2When: August 2012
3Why: /proc/<pid>/oom_adj allows userspace to influence the oom killer's
4 badness heuristic used to determine which task to kill when the kernel
5 is out of memory.
6
7 The badness heuristic has since been rewritten since the introduction of
8 this tunable such that its meaning is deprecated. The value was
9 implemented as a bitshift on a score generated by the badness()
10 function that did not have any precise units of measure. With the
11 rewrite, the score is given as a proportion of available memory to the
12 task allocating pages, so using a bitshift which grows the score
13 exponentially is, thus, impossible to tune with fine granularity.
14
15 A much more powerful interface, /proc/<pid>/oom_score_adj, was
16 introduced with the oom killer rewrite that allows users to increase or
17 decrease the badness() score linearly. This interface will replace
18 /proc/<pid>/oom_adj.
19
20 A warning will be emitted to the kernel log if an application uses this
21 deprecated interface. After it is printed once, future warnings will be
22 suppressed until the kernel is rebooted.
diff --git a/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-koneplus b/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-koneplus
new file mode 100644
index 000000000000..c2a270b45b03
--- /dev/null
+++ b/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-koneplus
@@ -0,0 +1,10 @@
1What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/startup_profile
2Date: October 2010
3Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
4Description: The integer value of this attribute ranges from 0-4.
5 When read, this attribute returns the number of the actual
6 profile. This value is persistent, so its equivalent to the
7 profile that's active when the mouse is powered on next time.
8 When written, this file sets the number of the startup profile
9 and the mouse activates this profile immediately.
10 Please use actual_profile, it does the same thing.
diff --git a/Documentation/ABI/removed/dv1394 b/Documentation/ABI/removed/dv1394
new file mode 100644
index 000000000000..c2310b6676f4
--- /dev/null
+++ b/Documentation/ABI/removed/dv1394
@@ -0,0 +1,14 @@
1What: dv1394 (a.k.a. "OHCI-DV I/O support" for FireWire)
2Date: May 2010 (scheduled), finally removed in kernel v2.6.37
3Contact: linux1394-devel@lists.sourceforge.net
4Description:
5 /dev/dv1394/* were character device files, one for each FireWire
6 controller and for NTSC and PAL respectively, from which DV data
7 could be received by read() or transmitted by write(). A few
8 ioctl()s allowed limited control.
9 This special-purpose interface has been superseded by libraw1394 +
10 libiec61883 which are functionally equivalent, support HDV, and
11 transparently work on top of the newer firewire kernel drivers.
12
13Users:
14 ffmpeg/libavformat (if configured for DV1394)
diff --git a/Documentation/ABI/obsolete/o2cb b/Documentation/ABI/removed/o2cb
index 9c49d8e6c0cc..7f5daa465093 100644
--- a/Documentation/ABI/obsolete/o2cb
+++ b/Documentation/ABI/removed/o2cb
@@ -1,11 +1,10 @@
1What: /sys/o2cb symlink 1What: /sys/o2cb symlink
2Date: Dec 2005 2Date: May 2011
3KernelVersion: 2.6.16 3KernelVersion: 2.6.40
4Contact: ocfs2-devel@oss.oracle.com 4Contact: ocfs2-devel@oss.oracle.com
5Description: This is a symlink: /sys/o2cb to /sys/fs/o2cb. The symlink will 5Description: This is a symlink: /sys/o2cb to /sys/fs/o2cb. The symlink is
6 be removed when new versions of ocfs2-tools which know to look 6 removed when new versions of ocfs2-tools which know to look
7 in /sys/fs/o2cb are sufficiently prevalent. Don't code new 7 in /sys/fs/o2cb are sufficiently prevalent. Don't code new
8 software to look here, it should try /sys/fs/o2cb instead. 8 software to look here, it should try /sys/fs/o2cb instead.
9 See Documentation/ABI/stable/o2cb for more information on usage.
10Users: ocfs2-tools. It's sufficient to mail proposed changes to 9Users: ocfs2-tools. It's sufficient to mail proposed changes to
11 ocfs2-devel@oss.oracle.com. 10 ocfs2-devel@oss.oracle.com.
diff --git a/Documentation/ABI/removed/raw1394 b/Documentation/ABI/removed/raw1394
new file mode 100644
index 000000000000..490aa1efc4ae
--- /dev/null
+++ b/Documentation/ABI/removed/raw1394
@@ -0,0 +1,15 @@
1What: raw1394 (a.k.a. "Raw IEEE1394 I/O support" for FireWire)
2Date: May 2010 (scheduled), finally removed in kernel v2.6.37
3Contact: linux1394-devel@lists.sourceforge.net
4Description:
5 /dev/raw1394 was a character device file that allowed low-level
6 access to FireWire buses. Its major drawbacks were its inability
7 to implement sensible device security policies, and its low level
8 of abstraction that required userspace clients do duplicate much
9 of the kernel's ieee1394 core functionality.
10 Replaced by /dev/fw*, i.e. the <linux/firewire-cdev.h> ABI of
11 firewire-core.
12
13Users:
14 libraw1394 (works with firewire-cdev too, transparent to library ABI
15 users)
diff --git a/Documentation/ABI/removed/raw1394_legacy_isochronous b/Documentation/ABI/removed/raw1394_legacy_isochronous
deleted file mode 100644
index 1b629622d883..000000000000
--- a/Documentation/ABI/removed/raw1394_legacy_isochronous
+++ /dev/null
@@ -1,16 +0,0 @@
1What: legacy isochronous ABI of raw1394 (1st generation iso ABI)
2Date: June 2007 (scheduled), removed in kernel v2.6.23
3Contact: linux1394-devel@lists.sourceforge.net
4Description:
5 The two request types RAW1394_REQ_ISO_SEND, RAW1394_REQ_ISO_LISTEN have
6 been deprecated for quite some time. They are very inefficient as they
7 come with high interrupt load and several layers of callbacks for each
8 packet. Because of these deficiencies, the video1394 and dv1394 drivers
9 and the 3rd-generation isochronous ABI in raw1394 (rawiso) were created.
10
11Users:
12 libraw1394 users via the long deprecated API raw1394_iso_write,
13 raw1394_start_iso_write, raw1394_start_iso_rcv, raw1394_stop_iso_rcv
14
15 libdc1394, which optionally uses these old libraw1394 calls
16 alternatively to the more efficient video1394 ABI
diff --git a/Documentation/ABI/removed/video1394 b/Documentation/ABI/removed/video1394
new file mode 100644
index 000000000000..c39c25aee77b
--- /dev/null
+++ b/Documentation/ABI/removed/video1394
@@ -0,0 +1,16 @@
1What: video1394 (a.k.a. "OHCI-1394 Video support" for FireWire)
2Date: May 2010 (scheduled), finally removed in kernel v2.6.37
3Contact: linux1394-devel@lists.sourceforge.net
4Description:
5 /dev/video1394/* were character device files, one for each FireWire
6 controller, which were used for isochronous I/O. It was added as an
7 alternative to raw1394's isochronous I/O functionality which had
8 performance issues in its first generation. Any video1394 user had
9 to use raw1394 + libraw1394 too because video1394 did not provide
10 asynchronous I/O for device discovery and configuration.
11 Replaced by /dev/fw*, i.e. the <linux/firewire-cdev.h> ABI of
12 firewire-core.
13
14Users:
15 libdc1394 (works with firewire-cdev too, transparent to library ABI
16 users)
diff --git a/Documentation/ABI/stable/sysfs-class-backlight b/Documentation/ABI/stable/sysfs-class-backlight
index 4d637e1c4ff7..70302f370e7e 100644
--- a/Documentation/ABI/stable/sysfs-class-backlight
+++ b/Documentation/ABI/stable/sysfs-class-backlight
@@ -34,3 +34,23 @@ Contact: Richard Purdie <rpurdie@rpsys.net>
34Description: 34Description:
35 Maximum brightness for <backlight>. 35 Maximum brightness for <backlight>.
36Users: HAL 36Users: HAL
37
38What: /sys/class/backlight/<backlight>/type
39Date: September 2010
40KernelVersion: 2.6.37
41Contact: Matthew Garrett <mjg@redhat.com>
42Description:
43 The type of interface controlled by <backlight>.
44 "firmware": The driver uses a standard firmware interface
45 "platform": The driver uses a platform-specific interface
46 "raw": The driver controls hardware registers directly
47
48 In the general case, when multiple backlight
49 interfaces are available for a single device, firmware
50 control should be preferred to platform control should
51 be preferred to raw control. Using a firmware
52 interface reduces the probability of confusion with
53 the hardware and the OS independently updating the
54 backlight state. Platform interfaces are mostly a
55 holdover from pre-standardisation of firmware
56 interfaces.
diff --git a/Documentation/ABI/stable/sysfs-firmware-efi-vars b/Documentation/ABI/stable/sysfs-firmware-efi-vars
new file mode 100644
index 000000000000..5def20b9019e
--- /dev/null
+++ b/Documentation/ABI/stable/sysfs-firmware-efi-vars
@@ -0,0 +1,75 @@
1What: /sys/firmware/efi/vars
2Date: April 2004
3Contact: Matt Domsch <Matt_Domsch@dell.com>
4Description:
5 This directory exposes interfaces for interactive with
6 EFI variables. For more information on EFI variables,
7 see 'Variable Services' in the UEFI specification
8 (section 7.2 in specification version 2.3 Errata D).
9
10 In summary, EFI variables are named, and are classified
11 into separate namespaces through the use of a vendor
12 GUID. They also have an arbitrary binary value
13 associated with them.
14
15 The efivars module enumerates these variables and
16 creates a separate directory for each one found. Each
17 directory has a name of the form "<key>-<vendor guid>"
18 and contains the following files:
19
20 attributes: A read-only text file enumerating the
21 EFI variable flags. Potential values
22 include:
23
24 EFI_VARIABLE_NON_VOLATILE
25 EFI_VARIABLE_BOOTSERVICE_ACCESS
26 EFI_VARIABLE_RUNTIME_ACCESS
27 EFI_VARIABLE_HARDWARE_ERROR_RECORD
28 EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
29
30 See the EFI documentation for an
31 explanation of each of these variables.
32
33 data: A read-only binary file that can be read
34 to attain the value of the EFI variable
35
36 guid: The vendor GUID of the variable. This
37 should always match the GUID in the
38 variable's name.
39
40 raw_var: A binary file that can be read to obtain
41 a structure that contains everything
42 there is to know about the variable.
43 For structure definition see "struct
44 efi_variable" in the kernel sources.
45
46 This file can also be written to in
47 order to update the value of a variable.
48 For this to work however, all fields of
49 the "struct efi_variable" passed must
50 match byte for byte with the structure
51 read out of the file, save for the value
52 portion.
53
54 **Note** the efi_variable structure
55 read/written with this file contains a
56 'long' type that may change widths
57 depending on your underlying
58 architecture.
59
60 size: As ASCII representation of the size of
61 the variable's value.
62
63
64 In addition, two other magic binary files are provided
65 in the top-level directory and are used for adding and
66 removing variables:
67
68 new_var: Takes a "struct efi_variable" and
69 instructs the EFI firmware to create a
70 new variable.
71
72 del_var: Takes a "struct efi_variable" and
73 instructs the EFI firmware to remove any
74 variable that has a matching vendor GUID
75 and variable key name.
diff --git a/Documentation/ABI/stable/thermal-notification b/Documentation/ABI/stable/thermal-notification
new file mode 100644
index 000000000000..9723e8b7aeb3
--- /dev/null
+++ b/Documentation/ABI/stable/thermal-notification
@@ -0,0 +1,4 @@
1What: A notification mechanism for thermal related events
2Description:
3 This interface enables notification for thermal related events.
4 The notification is in the form of a netlink event.
diff --git a/Documentation/ABI/testing/configfs-spear-pcie-gadget b/Documentation/ABI/testing/configfs-spear-pcie-gadget
new file mode 100644
index 000000000000..875988146a63
--- /dev/null
+++ b/Documentation/ABI/testing/configfs-spear-pcie-gadget
@@ -0,0 +1,31 @@
1What: /config/pcie-gadget
2Date: Feb 2011
3KernelVersion: 2.6.37
4Contact: Pratyush Anand <pratyush.anand@st.com>
5Description:
6
7 Interface is used to configure selected dual mode PCIe controller
8 as device and then program its various registers to configure it
9 as a particular device type.
10 This interfaces can be used to show spear's PCIe device capability.
11
12 Nodes are only visible when configfs is mounted. To mount configfs
13 in /config directory use:
14 # mount -t configfs none /config/
15
16 For nth PCIe Device Controller
17 /config/pcie-gadget.n/
18 link ... used to enable ltssm and read its status.
19 int_type ...used to configure and read type of supported
20 interrupt
21 no_of_msi ... used to configure number of MSI vector needed and
22 to read no of MSI granted.
23 inta ... write 1 to assert INTA and 0 to de-assert.
24 send_msi ... write MSI vector to be sent.
25 vendor_id ... used to write and read vendor id (hex)
26 device_id ... used to write and read device id (hex)
27 bar0_size ... used to write and read bar0_size
28 bar0_address ... used to write and read bar0 mapped area in hex.
29 bar0_rw_offset ... used to write and read offset of bar0 where
30 bar0_data will be written or read.
31 bar0_data ... used to write and read data at bar0_rw_offset.
diff --git a/Documentation/ABI/testing/pstore b/Documentation/ABI/testing/pstore
new file mode 100644
index 000000000000..ddf451ee2a08
--- /dev/null
+++ b/Documentation/ABI/testing/pstore
@@ -0,0 +1,41 @@
1Where: /dev/pstore/...
2Date: March 2011
3Kernel Version: 2.6.39
4Contact: tony.luck@intel.com
5Description: Generic interface to platform dependent persistent storage.
6
7 Platforms that provide a mechanism to preserve some data
8 across system reboots can register with this driver to
9 provide a generic interface to show records captured in
10 the dying moments. In the case of a panic the last part
11 of the console log is captured, but other interesting
12 data can also be saved.
13
14 # mount -t pstore -o kmsg_bytes=8000 - /dev/pstore
15
16 $ ls -l /dev/pstore
17 total 0
18 -r--r--r-- 1 root root 7896 Nov 30 15:38 dmesg-erst-1
19
20 Different users of this interface will result in different
21 filename prefixes. Currently two are defined:
22
23 "dmesg" - saved console log
24 "mce" - architecture dependent data from fatal h/w error
25
26 Once the information in a file has been read, removing
27 the file will signal to the underlying persistent storage
28 device that it can reclaim the space for later re-use.
29
30 $ rm /dev/pstore/dmesg-erst-1
31
32 The expectation is that all files in /dev/pstore
33 will be saved elsewhere and erased from persistent store
34 soon after boot to free up space ready for the next
35 catastrophe.
36
37 The 'kmsg_bytes' mount option changes the target amount of
38 data saved on each oops/panic. Pstore saves (possibly
39 multiple) files based on the record size of the underlying
40 persistent storage until at least this amount is reached.
41 Default is 10 Kbytes.
diff --git a/Documentation/ABI/testing/sysfs-ata b/Documentation/ABI/testing/sysfs-ata
new file mode 100644
index 000000000000..0a932155cbba
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-ata
@@ -0,0 +1,99 @@
1What: /sys/class/ata_...
2Date: August 2008
3Contact: Gwendal Grignou<gwendal@google.com>
4Description:
5
6Provide a place in sysfs for storing the ATA topology of the system. This allows
7retrieving various information about ATA objects.
8
9Files under /sys/class/ata_port
10-------------------------------
11
12 For each port, a directory ataX is created where X is the ata_port_id of
13 the port. The device parent is the ata host device.
14
15idle_irq (read)
16
17 Number of IRQ received by the port while idle [some ata HBA only].
18
19nr_pmp_links (read)
20
21 If a SATA Port Multiplier (PM) is connected, number of link behind it.
22
23Files under /sys/class/ata_link
24-------------------------------
25
26 Behind each port, there is a ata_link. If there is a SATA PM in the
27 topology, 15 ata_link objects are created.
28
29 If a link is behind a port, the directory name is linkX, where X is
30 ata_port_id of the port.
31 If a link is behind a PM, its name is linkX.Y where X is ata_port_id
32 of the parent port and Y the PM port.
33
34hw_sata_spd_limit
35
36 Maximum speed supported by the connected SATA device.
37
38sata_spd_limit
39
40 Maximum speed imposed by libata.
41
42sata_spd
43
44 Current speed of the link [1.5, 3Gps,...].
45
46Files under /sys/class/ata_device
47---------------------------------
48
49 Behind each link, up to two ata device are created.
50 The name of the directory is devX[.Y].Z where:
51 - X is ata_port_id of the port where the device is connected,
52 - Y the port of the PM if any, and
53 - Z the device id: for PATA, there is usually 2 devices [0,1],
54 only 1 for SATA.
55
56class
57 Device class. Can be "ata" for disk, "atapi" for packet device,
58 "pmp" for PM, or "none" if no device was found behind the link.
59
60dma_mode
61
62 Transfer modes supported by the device when in DMA mode.
63 Mostly used by PATA device.
64
65pio_mode
66
67 Transfer modes supported by the device when in PIO mode.
68 Mostly used by PATA device.
69
70xfer_mode
71
72 Current transfer mode.
73
74id
75
76 Cached result of IDENTIFY command, as described in ATA8 7.16 and 7.17.
77 Only valid if the device is not a PM.
78
79gscr
80
81 Cached result of the dump of PM GSCR register.
82 Valid registers are:
83 0: SATA_PMP_GSCR_PROD_ID,
84 1: SATA_PMP_GSCR_REV,
85 2: SATA_PMP_GSCR_PORT_INFO,
86 32: SATA_PMP_GSCR_ERROR,
87 33: SATA_PMP_GSCR_ERROR_EN,
88 64: SATA_PMP_GSCR_FEAT,
89 96: SATA_PMP_GSCR_FEAT_EN,
90 130: SATA_PMP_GSCR_SII_GPIO
91 Only valid if the device is a PM.
92
93spdn_cnt
94
95 Number of time libata decided to lower the speed of link due to errors.
96
97ering
98
99 Formatted output of the error ring of the device.
diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI/testing/sysfs-block
index 4873c759d535..c1eb41cb9876 100644
--- a/Documentation/ABI/testing/sysfs-block
+++ b/Documentation/ABI/testing/sysfs-block
@@ -142,3 +142,67 @@ Description:
142 with the previous I/O request are enabled. When set to 2, 142 with the previous I/O request are enabled. When set to 2,
143 all merge tries are disabled. The default value is 0 - 143 all merge tries are disabled. The default value is 0 -
144 which enables all types of merge tries. 144 which enables all types of merge tries.
145
146What: /sys/block/<disk>/discard_alignment
147Date: May 2011
148Contact: Martin K. Petersen <martin.petersen@oracle.com>
149Description:
150 Devices that support discard functionality may
151 internally allocate space in units that are bigger than
152 the exported logical block size. The discard_alignment
153 parameter indicates how many bytes the beginning of the
154 device is offset from the internal allocation unit's
155 natural alignment.
156
157What: /sys/block/<disk>/<partition>/discard_alignment
158Date: May 2011
159Contact: Martin K. Petersen <martin.petersen@oracle.com>
160Description:
161 Devices that support discard functionality may
162 internally allocate space in units that are bigger than
163 the exported logical block size. The discard_alignment
164 parameter indicates how many bytes the beginning of the
165 partition is offset from the internal allocation unit's
166 natural alignment.
167
168What: /sys/block/<disk>/queue/discard_granularity
169Date: May 2011
170Contact: Martin K. Petersen <martin.petersen@oracle.com>
171Description:
172 Devices that support discard functionality may
173 internally allocate space using units that are bigger
174 than the logical block size. The discard_granularity
175 parameter indicates the size of the internal allocation
176 unit in bytes if reported by the device. Otherwise the
177 discard_granularity will be set to match the device's
178 physical block size. A discard_granularity of 0 means
179 that the device does not support discard functionality.
180
181What: /sys/block/<disk>/queue/discard_max_bytes
182Date: May 2011
183Contact: Martin K. Petersen <martin.petersen@oracle.com>
184Description:
185 Devices that support discard functionality may have
186 internal limits on the number of bytes that can be
187 trimmed or unmapped in a single operation. Some storage
188 protocols also have inherent limits on the number of
189 blocks that can be described in a single command. The
190 discard_max_bytes parameter is set by the device driver
191 to the maximum number of bytes that can be discarded in
192 a single operation. Discard requests issued to the
193 device must not exceed this limit. A discard_max_bytes
194 value of 0 means that the device does not support
195 discard functionality.
196
197What: /sys/block/<disk>/queue/discard_zeroes_data
198Date: May 2011
199Contact: Martin K. Petersen <martin.petersen@oracle.com>
200Description:
201 Devices that support discard functionality may return
202 stale or random data when a previously discarded block
203 is read back. This can cause problems if the filesystem
204 expects discarded blocks to be explicitly cleared. If a
205 device reports that it deterministically returns zeroes
206 when a discarded area is read the discard_zeroes_data
207 parameter will be set to one. Otherwise it will be 0 and
208 the result of reading a discarded area is undefined.
diff --git a/Documentation/ABI/testing/sysfs-block-zram b/Documentation/ABI/testing/sysfs-block-zram
new file mode 100644
index 000000000000..c8b3b48ec62c
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-block-zram
@@ -0,0 +1,99 @@
1What: /sys/block/zram<id>/disksize
2Date: August 2010
3Contact: Nitin Gupta <ngupta@vflare.org>
4Description:
5 The disksize file is read-write and specifies the disk size
6 which represents the limit on the *uncompressed* worth of data
7 that can be stored in this disk.
8
9What: /sys/block/zram<id>/initstate
10Date: August 2010
11Contact: Nitin Gupta <ngupta@vflare.org>
12Description:
13 The disksize file is read-only and shows the initialization
14 state of the device.
15
16What: /sys/block/zram<id>/reset
17Date: August 2010
18Contact: Nitin Gupta <ngupta@vflare.org>
19Description:
20 The disksize file is write-only and allows resetting the
21 device. The reset operation frees all the memory assocaited
22 with this device.
23
24What: /sys/block/zram<id>/num_reads
25Date: August 2010
26Contact: Nitin Gupta <ngupta@vflare.org>
27Description:
28 The num_reads file is read-only and specifies the number of
29 reads (failed or successful) done on this device.
30
31What: /sys/block/zram<id>/num_writes
32Date: August 2010
33Contact: Nitin Gupta <ngupta@vflare.org>
34Description:
35 The num_writes file is read-only and specifies the number of
36 writes (failed or successful) done on this device.
37
38What: /sys/block/zram<id>/invalid_io
39Date: August 2010
40Contact: Nitin Gupta <ngupta@vflare.org>
41Description:
42 The invalid_io file is read-only and specifies the number of
43 non-page-size-aligned I/O requests issued to this device.
44
45What: /sys/block/zram<id>/notify_free
46Date: August 2010
47Contact: Nitin Gupta <ngupta@vflare.org>
48Description:
49 The notify_free file is read-only and specifies the number of
50 swap slot free notifications received by this device. These
51 notifications are send to a swap block device when a swap slot
52 is freed. This statistic is applicable only when this disk is
53 being used as a swap disk.
54
55What: /sys/block/zram<id>/discard
56Date: August 2010
57Contact: Nitin Gupta <ngupta@vflare.org>
58Description:
59 The discard file is read-only and specifies the number of
60 discard requests received by this device. These requests
61 provide information to block device regarding blocks which are
62 no longer used by filesystem.
63
64What: /sys/block/zram<id>/zero_pages
65Date: August 2010
66Contact: Nitin Gupta <ngupta@vflare.org>
67Description:
68 The zero_pages file is read-only and specifies number of zero
69 filled pages written to this disk. No memory is allocated for
70 such pages.
71
72What: /sys/block/zram<id>/orig_data_size
73Date: August 2010
74Contact: Nitin Gupta <ngupta@vflare.org>
75Description:
76 The orig_data_size file is read-only and specifies uncompressed
77 size of data stored in this disk. This excludes zero-filled
78 pages (zero_pages) since no memory is allocated for them.
79 Unit: bytes
80
81What: /sys/block/zram<id>/compr_data_size
82Date: August 2010
83Contact: Nitin Gupta <ngupta@vflare.org>
84Description:
85 The compr_data_size file is read-only and specifies compressed
86 size of data stored in this disk. So, compression ratio can be
87 calculated using orig_data_size and this statistic.
88 Unit: bytes
89
90What: /sys/block/zram<id>/mem_used_total
91Date: August 2010
92Contact: Nitin Gupta <ngupta@vflare.org>
93Description:
94 The mem_used_total file is read-only and specifies the amount
95 of memory, including allocator fragmentation and metadata
96 overhead, allocated for this disk. So, allocator space
97 efficiency can be calculated using compr_data_size and this
98 statistic.
99 Unit: bytes \ No newline at end of file
diff --git a/Documentation/ABI/testing/sysfs-bus-bcma b/Documentation/ABI/testing/sysfs-bus-bcma
new file mode 100644
index 000000000000..06b62badddd1
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-bcma
@@ -0,0 +1,31 @@
1What: /sys/bus/bcma/devices/.../manuf
2Date: May 2011
3KernelVersion: 2.6.40
4Contact: Rafał Miłecki <zajec5@gmail.com>
5Description:
6 Each BCMA core has it's manufacturer id. See
7 include/linux/bcma/bcma.h for possible values.
8
9What: /sys/bus/bcma/devices/.../id
10Date: May 2011
11KernelVersion: 2.6.40
12Contact: Rafał Miłecki <zajec5@gmail.com>
13Description:
14 There are a few types of BCMA cores, they can be identified by
15 id field.
16
17What: /sys/bus/bcma/devices/.../rev
18Date: May 2011
19KernelVersion: 2.6.40
20Contact: Rafał Miłecki <zajec5@gmail.com>
21Description:
22 BCMA cores of the same type can still slightly differ depending
23 on their revision. Use it for detailed programming.
24
25What: /sys/bus/bcma/devices/.../class
26Date: May 2011
27KernelVersion: 2.6.40
28Contact: Rafał Miłecki <zajec5@gmail.com>
29Description:
30 Each BCMA core is identified by few fields, including class it
31 belongs to. See include/linux/bcma/bcma.h for possible values.
diff --git a/Documentation/ABI/testing/sysfs-bus-css b/Documentation/ABI/testing/sysfs-bus-css
index b585ec258a08..2979c40c10e9 100644
--- a/Documentation/ABI/testing/sysfs-bus-css
+++ b/Documentation/ABI/testing/sysfs-bus-css
@@ -29,7 +29,7 @@ Contact: Cornelia Huck <cornelia.huck@de.ibm.com>
29 linux-s390@vger.kernel.org 29 linux-s390@vger.kernel.org
30Description: Contains the PIM/PAM/POM values, as reported by the 30Description: Contains the PIM/PAM/POM values, as reported by the
31 channel subsystem when last queried by the common I/O 31 channel subsystem when last queried by the common I/O
32 layer (this implies that this attribute is not neccessarily 32 layer (this implies that this attribute is not necessarily
33 in sync with the values current in the channel subsystem). 33 in sync with the values current in the channel subsystem).
34 Note: This is an I/O-subchannel specific attribute. 34 Note: This is an I/O-subchannel specific attribute.
35Users: s390-tools, HAL 35Users: s390-tools, HAL
diff --git a/Documentation/ABI/testing/sysfs-bus-media b/Documentation/ABI/testing/sysfs-bus-media
new file mode 100644
index 000000000000..7057e574154a
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-media
@@ -0,0 +1,6 @@
1What: /sys/bus/media/devices/.../model
2Date: January 2011
3Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
4 linux-media@vger.kernel.org
5Description: Contains the device model name in UTF-8. The device version is
6 is not be appended to the model name.
diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci
index f979d825d112..349ecf26ce10 100644
--- a/Documentation/ABI/testing/sysfs-bus-pci
+++ b/Documentation/ABI/testing/sysfs-bus-pci
@@ -74,6 +74,15 @@ Description:
74 hot-remove the PCI device and any of its children. 74 hot-remove the PCI device and any of its children.
75 Depends on CONFIG_HOTPLUG. 75 Depends on CONFIG_HOTPLUG.
76 76
77What: /sys/bus/pci/devices/.../pci_bus/.../rescan
78Date: May 2011
79Contact: Linux PCI developers <linux-pci@vger.kernel.org>
80Description:
81 Writing a non-zero value to this attribute will
82 force a rescan of the bus and all child buses,
83 and re-discover devices removed earlier from this
84 part of the device tree. Depends on CONFIG_HOTPLUG.
85
77What: /sys/bus/pci/devices/.../rescan 86What: /sys/bus/pci/devices/.../rescan
78Date: January 2009 87Date: January 2009
79Contact: Linux PCI developers <linux-pci@vger.kernel.org> 88Contact: Linux PCI developers <linux-pci@vger.kernel.org>
@@ -145,9 +154,11 @@ Date: July 2010
145Contact: Narendra K <narendra_k@dell.com>, linux-bugs@dell.com 154Contact: Narendra K <narendra_k@dell.com>, linux-bugs@dell.com
146Description: 155Description:
147 Reading this attribute will provide the firmware 156 Reading this attribute will provide the firmware
148 given name(SMBIOS type 41 string) of the PCI device. 157 given name (SMBIOS type 41 string or ACPI _DSM string) of
149 The attribute will be created only if the firmware 158 the PCI device. The attribute will be created only
150 has given a name to the PCI device. 159 if the firmware has given a name to the PCI device.
160 ACPI _DSM string name will be given priority if the
161 system firmware provides SMBIOS type 41 string also.
151Users: 162Users:
152 Userspace applications interested in knowing the 163 Userspace applications interested in knowing the
153 firmware assigned name of the PCI device. 164 firmware assigned name of the PCI device.
@@ -157,12 +168,27 @@ Date: July 2010
157Contact: Narendra K <narendra_k@dell.com>, linux-bugs@dell.com 168Contact: Narendra K <narendra_k@dell.com>, linux-bugs@dell.com
158Description: 169Description:
159 Reading this attribute will provide the firmware 170 Reading this attribute will provide the firmware
160 given instance(SMBIOS type 41 device type instance) 171 given instance (SMBIOS type 41 device type instance) of the
161 of the PCI device. The attribute will be created 172 PCI device. The attribute will be created only if the firmware
162 only if the firmware has given a device type instance 173 has given an instance number to the PCI device.
163 to the PCI device.
164Users: 174Users:
165 Userspace applications interested in knowing the 175 Userspace applications interested in knowing the
166 firmware assigned device type instance of the PCI 176 firmware assigned device type instance of the PCI
167 device that can help in understanding the firmware 177 device that can help in understanding the firmware
168 intended order of the PCI device. 178 intended order of the PCI device.
179
180What: /sys/bus/pci/devices/.../acpi_index
181Date: July 2010
182Contact: Narendra K <narendra_k@dell.com>, linux-bugs@dell.com
183Description:
184 Reading this attribute will provide the firmware
185 given instance (ACPI _DSM instance number) of the PCI device.
186 The attribute will be created only if the firmware has given
187 an instance number to the PCI device. ACPI _DSM instance number
188 will be given priority if the system firmware provides SMBIOS
189 type 41 device type instance also.
190Users:
191 Userspace applications interested in knowing the
192 firmware assigned instance number of the PCI
193 device that can help in understanding the firmware
194 intended order of the PCI device.
diff --git a/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss b/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss
index 4f29e5f1ebfa..f5bb0a3bb8c0 100644
--- a/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss
+++ b/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss
@@ -59,3 +59,15 @@ Kernel Version: 2.6.31
59Contact: iss_storagedev@hp.com 59Contact: iss_storagedev@hp.com
60Description: Displays the usage count (number of opens) of logical drive Y 60Description: Displays the usage count (number of opens) of logical drive Y
61 of controller X. 61 of controller X.
62
63Where: /sys/bus/pci/devices/<dev>/ccissX/resettable
64Date: February 2011
65Kernel Version: 2.6.38
66Contact: iss_storagedev@hp.com
67Description: Value of 1 indicates the controller can honor the reset_devices
68 kernel parameter. Value of 0 indicates reset_devices cannot be
69 honored. This is to allow, for example, kexec tools to be able
70 to warn the user if they designate an unresettable device as
71 a dump device, as kdump requires resetting the device in order
72 to work reliably.
73
diff --git a/Documentation/ABI/testing/sysfs-bus-rbd b/Documentation/ABI/testing/sysfs-bus-rbd
new file mode 100644
index 000000000000..fa72ccb2282e
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-rbd
@@ -0,0 +1,83 @@
1What: /sys/bus/rbd/
2Date: November 2010
3Contact: Yehuda Sadeh <yehuda@newdream.net>,
4 Sage Weil <sage@newdream.net>
5Description:
6
7Being used for adding and removing rbd block devices.
8
9Usage: <mon ip addr> <options> <pool name> <rbd image name> [snap name]
10
11 $ echo "192.168.0.1 name=admin rbd foo" > /sys/bus/rbd/add
12
13The snapshot name can be "-" or omitted to map the image read/write. A <dev-id>
14will be assigned for any registered block device. If snapshot is used, it will
15be mapped read-only.
16
17Removal of a device:
18
19 $ echo <dev-id> > /sys/bus/rbd/remove
20
21Entries under /sys/bus/rbd/devices/<dev-id>/
22--------------------------------------------
23
24client_id
25
26 The ceph unique client id that was assigned for this specific session.
27
28major
29
30 The block device major number.
31
32name
33
34 The name of the rbd image.
35
36pool
37
38 The pool where this rbd image resides. The pool-name pair is unique
39 per rados system.
40
41size
42
43 The size (in bytes) of the mapped block device.
44
45refresh
46
47 Writing to this file will reread the image header data and set
48 all relevant datastructures accordingly.
49
50current_snap
51
52 The current snapshot for which the device is mapped.
53
54create_snap
55
56 Create a snapshot:
57
58 $ echo <snap-name> > /sys/bus/rbd/devices/<dev-id>/snap_create
59
60rollback_snap
61
62 Rolls back data to the specified snapshot. This goes over the entire
63 list of rados blocks and sends a rollback command to each.
64
65 $ echo <snap-name> > /sys/bus/rbd/devices/<dev-id>/snap_rollback
66
67snap_*
68
69 A directory per each snapshot
70
71
72Entries under /sys/bus/rbd/devices/<dev-id>/snap_<snap-name>
73-------------------------------------------------------------
74
75id
76
77 The rados internal snapshot id assigned for this snapshot
78
79size
80
81 The size of the image when this snapshot was taken.
82
83
diff --git a/Documentation/ABI/testing/sysfs-class-backlight-driver-adp8870 b/Documentation/ABI/testing/sysfs-class-backlight-driver-adp8870
new file mode 100644
index 000000000000..aa11dbdd794b
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-backlight-driver-adp8870
@@ -0,0 +1,56 @@
1What: /sys/class/backlight/<backlight>/<ambient light zone>_max
2What: /sys/class/backlight/<backlight>/l1_daylight_max
3What: /sys/class/backlight/<backlight>/l2_bright_max
4What: /sys/class/backlight/<backlight>/l3_office_max
5What: /sys/class/backlight/<backlight>/l4_indoor_max
6What: /sys/class/backlight/<backlight>/l5_dark_max
7Date: Mai 2011
8KernelVersion: 2.6.40
9Contact: device-drivers-devel@blackfin.uclinux.org
10Description:
11 Control the maximum brightness for <ambient light zone>
12 on this <backlight>. Values are between 0 and 127. This file
13 will also show the brightness level stored for this
14 <ambient light zone>.
15
16What: /sys/class/backlight/<backlight>/<ambient light zone>_dim
17What: /sys/class/backlight/<backlight>/l2_bright_dim
18What: /sys/class/backlight/<backlight>/l3_office_dim
19What: /sys/class/backlight/<backlight>/l4_indoor_dim
20What: /sys/class/backlight/<backlight>/l5_dark_dim
21Date: Mai 2011
22KernelVersion: 2.6.40
23Contact: device-drivers-devel@blackfin.uclinux.org
24Description:
25 Control the dim brightness for <ambient light zone>
26 on this <backlight>. Values are between 0 and 127, typically
27 set to 0. Full off when the backlight is disabled.
28 This file will also show the dim brightness level stored for
29 this <ambient light zone>.
30
31What: /sys/class/backlight/<backlight>/ambient_light_level
32Date: Mai 2011
33KernelVersion: 2.6.40
34Contact: device-drivers-devel@blackfin.uclinux.org
35Description:
36 Get conversion value of the light sensor.
37 This value is updated every 80 ms (when the light sensor
38 is enabled). Returns integer between 0 (dark) and
39 8000 (max ambient brightness)
40
41What: /sys/class/backlight/<backlight>/ambient_light_zone
42Date: Mai 2011
43KernelVersion: 2.6.40
44Contact: device-drivers-devel@blackfin.uclinux.org
45Description:
46 Get/Set current ambient light zone. Reading returns
47 integer between 1..5 (1 = daylight, 2 = bright, ..., 5 = dark).
48 Writing a value between 1..5 forces the backlight controller
49 to enter the corresponding ambient light zone.
50 Writing 0 returns to normal/automatic ambient light level
51 operation. The ambient light sensing feature on these devices
52 is an extension to the API documented in
53 Documentation/ABI/stable/sysfs-class-backlight.
54 It can be enabled by writing the value stored in
55 /sys/class/backlight/<backlight>/max_brightness to
56 /sys/class/backlight/<backlight>/brightness. \ No newline at end of file
diff --git a/Documentation/ABI/testing/sysfs-class-led b/Documentation/ABI/testing/sysfs-class-led
index 9e4541d71cb6..3646ec85d513 100644
--- a/Documentation/ABI/testing/sysfs-class-led
+++ b/Documentation/ABI/testing/sysfs-class-led
@@ -26,3 +26,12 @@ Description:
26 scheduler is chosen. Trigger specific parameters can appear in 26 scheduler is chosen. Trigger specific parameters can appear in
27 /sys/class/leds/<led> once a given trigger is selected. 27 /sys/class/leds/<led> once a given trigger is selected.
28 28
29What: /sys/class/leds/<led>/inverted
30Date: January 2011
31KernelVersion: 2.6.38
32Contact: Richard Purdie <rpurdie@rpsys.net>
33Description:
34 Invert the LED on/off state. This parameter is specific to
35 gpio and backlight triggers. In case of the backlight trigger,
36 it is useful when driving a LED which is intended to indicate
37 a device in a standby like state.
diff --git a/Documentation/ABI/testing/sysfs-class-net-batman-adv b/Documentation/ABI/testing/sysfs-class-net-batman-adv
new file mode 100644
index 000000000000..38dd762def4b
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-net-batman-adv
@@ -0,0 +1,14 @@
1
2What: /sys/class/net/<iface>/batman-adv/mesh_iface
3Date: May 2010
4Contact: Marek Lindner <lindner_marek@yahoo.de>
5Description:
6 The /sys/class/net/<iface>/batman-adv/mesh_iface file
7 displays the batman mesh interface this <iface>
8 currently is associated with.
9
10What: /sys/class/net/<iface>/batman-adv/iface_status
11Date: May 2010
12Contact: Marek Lindner <lindner_marek@yahoo.de>
13Description:
14 Indicates the status of <iface> as it is seen by batman.
diff --git a/Documentation/ABI/testing/sysfs-class-net-mesh b/Documentation/ABI/testing/sysfs-class-net-mesh
new file mode 100644
index 000000000000..748fe1701d25
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-net-mesh
@@ -0,0 +1,69 @@
1
2What: /sys/class/net/<mesh_iface>/mesh/aggregated_ogms
3Date: May 2010
4Contact: Marek Lindner <lindner_marek@yahoo.de>
5Description:
6 Indicates whether the batman protocol messages of the
7 mesh <mesh_iface> shall be aggregated or not.
8
9What: /sys/class/net/<mesh_iface>/mesh/bonding
10Date: June 2010
11Contact: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
12Description:
13 Indicates whether the data traffic going through the
14 mesh will be sent using multiple interfaces at the
15 same time (if available).
16
17What: /sys/class/net/<mesh_iface>/mesh/fragmentation
18Date: October 2010
19Contact: Andreas Langer <an.langer@gmx.de>
20Description:
21 Indicates whether the data traffic going through the
22 mesh will be fragmented or silently discarded if the
23 packet size exceeds the outgoing interface MTU.
24
25What: /sys/class/net/<mesh_iface>/mesh/gw_bandwidth
26Date: October 2010
27Contact: Marek Lindner <lindner_marek@yahoo.de>
28Description:
29 Defines the bandwidth which is propagated by this
30 node if gw_mode was set to 'server'.
31
32What: /sys/class/net/<mesh_iface>/mesh/gw_mode
33Date: October 2010
34Contact: Marek Lindner <lindner_marek@yahoo.de>
35Description:
36 Defines the state of the gateway features. Can be
37 either 'off', 'client' or 'server'.
38
39What: /sys/class/net/<mesh_iface>/mesh/gw_sel_class
40Date: October 2010
41Contact: Marek Lindner <lindner_marek@yahoo.de>
42Description:
43 Defines the selection criteria this node will use
44 to choose a gateway if gw_mode was set to 'client'.
45
46What: /sys/class/net/<mesh_iface>/mesh/orig_interval
47Date: May 2010
48Contact: Marek Lindner <lindner_marek@yahoo.de>
49Description:
50 Defines the interval in milliseconds in which batman
51 sends its protocol messages.
52
53What: /sys/class/net/<mesh_iface>/mesh/hop_penalty
54Date: Oct 2010
55Contact: Linus Lüssing <linus.luessing@web.de>
56Description:
57 Defines the penalty which will be applied to an
58 originator message's tq-field on every hop.
59
60What: /sys/class/net/<mesh_iface>/mesh/vis_mode
61Date: May 2010
62Contact: Marek Lindner <lindner_marek@yahoo.de>
63Description:
64 Each batman node only maintains information about its
65 own local neighborhood, therefore generating graphs
66 showing the topology of the entire mesh is not easily
67 feasible without having a central instance to collect
68 the local topologies from all nodes. This file allows
69 to activate the collecting (server) mode.
diff --git a/Documentation/ABI/testing/sysfs-devices-mmc b/Documentation/ABI/testing/sysfs-devices-mmc
new file mode 100644
index 000000000000..5a50ab655843
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-devices-mmc
@@ -0,0 +1,21 @@
1What: /sys/devices/.../mmc_host/mmcX/mmcX:XXXX/enhanced_area_offset
2Date: January 2011
3Contact: Chuanxiao Dong <chuanxiao.dong@intel.com>
4Description:
5 Enhanced area is a new feature defined in eMMC4.4 standard.
6 eMMC4.4 or later card can support such feature. This kind of
7 area can help to improve the card performance. If the feature
8 is enabled, this attribute will indicate the start address of
9 enhanced data area. If not, this attribute will be -EINVAL.
10 Unit Byte. Format decimal.
11
12What: /sys/devices/.../mmc_host/mmcX/mmcX:XXXX/enhanced_area_size
13Date: January 2011
14Contact: Chuanxiao Dong <chuanxiao.dong@intel.com>
15Description:
16 Enhanced area is a new feature defined in eMMC4.4 standard.
17 eMMC4.4 or later card can support such feature. This kind of
18 area can help to improve the card performance. If the feature
19 is enabled, this attribute will indicate the size of enhanced
20 data area. If not, this attribute will be -EINVAL.
21 Unit KByte. Format decimal.
diff --git a/Documentation/ABI/testing/sysfs-devices-power b/Documentation/ABI/testing/sysfs-devices-power
index 6123c523bfd7..8ffbc25376a0 100644
--- a/Documentation/ABI/testing/sysfs-devices-power
+++ b/Documentation/ABI/testing/sysfs-devices-power
@@ -29,9 +29,8 @@ Description:
29 "disabled" to it. 29 "disabled" to it.
30 30
31 For the devices that are not capable of generating system wakeup 31 For the devices that are not capable of generating system wakeup
32 events this file contains "\n". In that cases the user space 32 events this file is not present. In that case the device cannot
33 cannot modify the contents of this file and the device cannot be 33 be enabled to wake up the system from sleep states.
34 enabled to wake up the system.
35 34
36What: /sys/devices/.../power/control 35What: /sys/devices/.../power/control
37Date: January 2009 36Date: January 2009
@@ -77,3 +76,92 @@ Description:
77 devices this attribute is set to "enabled" by bus type code or 76 devices this attribute is set to "enabled" by bus type code or
78 device drivers and in that cases it should be safe to leave the 77 device drivers and in that cases it should be safe to leave the
79 default value. 78 default value.
79
80What: /sys/devices/.../power/wakeup_count
81Date: September 2010
82Contact: Rafael J. Wysocki <rjw@sisk.pl>
83Description:
84 The /sys/devices/.../wakeup_count attribute contains the number
85 of signaled wakeup events associated with the device. This
86 attribute is read-only. If the device is not enabled to wake up
87 the system from sleep states, this attribute is not present.
88
89What: /sys/devices/.../power/wakeup_active_count
90Date: September 2010
91Contact: Rafael J. Wysocki <rjw@sisk.pl>
92Description:
93 The /sys/devices/.../wakeup_active_count attribute contains the
94 number of times the processing of wakeup events associated with
95 the device was completed (at the kernel level). This attribute
96 is read-only. If the device is not enabled to wake up the
97 system from sleep states, this attribute is not present.
98
99What: /sys/devices/.../power/wakeup_hit_count
100Date: September 2010
101Contact: Rafael J. Wysocki <rjw@sisk.pl>
102Description:
103 The /sys/devices/.../wakeup_hit_count attribute contains the
104 number of times the processing of a wakeup event associated with
105 the device might prevent the system from entering a sleep state.
106 This attribute is read-only. If the device is not enabled to
107 wake up the system from sleep states, this attribute is not
108 present.
109
110What: /sys/devices/.../power/wakeup_active
111Date: September 2010
112Contact: Rafael J. Wysocki <rjw@sisk.pl>
113Description:
114 The /sys/devices/.../wakeup_active attribute contains either 1,
115 or 0, depending on whether or not a wakeup event associated with
116 the device is being processed (1). This attribute is read-only.
117 If the device is not enabled to wake up the system from sleep
118 states, this attribute is not present.
119
120What: /sys/devices/.../power/wakeup_total_time_ms
121Date: September 2010
122Contact: Rafael J. Wysocki <rjw@sisk.pl>
123Description:
124 The /sys/devices/.../wakeup_total_time_ms attribute contains
125 the total time of processing wakeup events associated with the
126 device, in milliseconds. This attribute is read-only. If the
127 device is not enabled to wake up the system from sleep states,
128 this attribute is not present.
129
130What: /sys/devices/.../power/wakeup_max_time_ms
131Date: September 2010
132Contact: Rafael J. Wysocki <rjw@sisk.pl>
133Description:
134 The /sys/devices/.../wakeup_max_time_ms attribute contains
135 the maximum time of processing a single wakeup event associated
136 with the device, in milliseconds. This attribute is read-only.
137 If the device is not enabled to wake up the system from sleep
138 states, this attribute is not present.
139
140What: /sys/devices/.../power/wakeup_last_time_ms
141Date: September 2010
142Contact: Rafael J. Wysocki <rjw@sisk.pl>
143Description:
144 The /sys/devices/.../wakeup_last_time_ms attribute contains
145 the value of the monotonic clock corresponding to the time of
146 signaling the last wakeup event associated with the device, in
147 milliseconds. This attribute is read-only. If the device is
148 not enabled to wake up the system from sleep states, this
149 attribute is not present.
150
151What: /sys/devices/.../power/autosuspend_delay_ms
152Date: September 2010
153Contact: Alan Stern <stern@rowland.harvard.edu>
154Description:
155 The /sys/devices/.../power/autosuspend_delay_ms attribute
156 contains the autosuspend delay value (in milliseconds). Some
157 drivers do not want their device to suspend as soon as it
158 becomes idle at run time; they want the device to remain
159 inactive for a certain minimum period of time first. That
160 period is called the autosuspend delay. Negative values will
161 prevent the device from being suspended at run time (similar
162 to writing "on" to the power/control attribute). Values >=
163 1000 will cause the autosuspend timer expiration to be rounded
164 up to the nearest second.
165
166 Not all drivers support this attribute. If it isn't supported,
167 attempts to read or write it will yield I/O errors.
diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu
index 7564e88bfa43..e7be75b96e4b 100644
--- a/Documentation/ABI/testing/sysfs-devices-system-cpu
+++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
@@ -183,21 +183,21 @@ Description: Discover and change clock speed of CPUs
183 to learn how to control the knobs. 183 to learn how to control the knobs.
184 184
185 185
186What: /sys/devices/system/cpu/cpu*/cache/index*/cache_disable_X 186What: /sys/devices/system/cpu/cpu*/cache/index3/cache_disable_{0,1}
187Date: August 2008 187Date: August 2008
188KernelVersion: 2.6.27 188KernelVersion: 2.6.27
189Contact: mark.langsdorf@amd.com 189Contact: discuss@x86-64.org
190Description: These files exist in every cpu's cache index directories. 190Description: Disable L3 cache indices
191 There are currently 2 cache_disable_# files in each 191
192 directory. Reading from these files on a supported 192 These files exist in every CPU's cache/index3 directory. Each
193 processor will return that cache disable index value 193 cache_disable_{0,1} file corresponds to one disable slot which
194 for that processor and node. Writing to one of these 194 can be used to disable a cache index. Reading from these files
195 files will cause the specificed cache index to be disabled. 195 on a processor with this functionality will return the currently
196 196 disabled index for that node. There is one L3 structure per
197 Currently, only AMD Family 10h Processors support cache index 197 node, or per internal node on MCM machines. Writing a valid
198 disable, and only for their L3 caches. See the BIOS and 198 index to one of these files will cause the specificed cache
199 Kernel Developer's Guide at 199 index to be disabled.
200 http://support.amd.com/us/Embedded_TechDocs/31116-Public-GH-BKDG_3-28_5-28-09.pdf 200
201 for formatting information and other details on the 201 All AMD processors with L3 caches provide this functionality.
202 cache index disable. 202 For details, see BKDGs at
203Users: joachim.deguara@amd.com 203 http://developer.amd.com/documentation/guides/Pages/default.aspx
diff --git a/Documentation/ABI/testing/sysfs-devices-system-ibm-rtl b/Documentation/ABI/testing/sysfs-devices-system-ibm-rtl
new file mode 100644
index 000000000000..b82deeaec314
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-devices-system-ibm-rtl
@@ -0,0 +1,22 @@
1What: state
2Date: Sep 2010
3KernelVersion: 2.6.37
4Contact: Vernon Mauery <vernux@us.ibm.com>
5Description: The state file allows a means by which to change in and
6 out of Premium Real-Time Mode (PRTM), as well as the
7 ability to query the current state.
8 0 => PRTM off
9 1 => PRTM enabled
10Users: The ibm-prtm userspace daemon uses this interface.
11
12
13What: version
14Date: Sep 2010
15KernelVersion: 2.6.37
16Contact: Vernon Mauery <vernux@us.ibm.com>
17Description: The version file provides a means by which to query
18 the RTL table version that lives in the Extended
19 BIOS Data Area (EBDA).
20Users: The ibm-prtm userspace daemon uses this interface.
21
22
diff --git a/Documentation/ABI/testing/sysfs-driver-hid b/Documentation/ABI/testing/sysfs-driver-hid
new file mode 100644
index 000000000000..b6490e14fe83
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-hid
@@ -0,0 +1,10 @@
1What: For USB devices : /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/report_descriptor
2 For BT devices : /sys/class/bluetooth/hci<addr>/<hid-bus>:<vendor-id>:<product-id>.<num>/report_descriptor
3 Symlink : /sys/class/hidraw/hidraw<num>/device/report_descriptor
4Date: Jan 2011
5KernelVersion: 2.0.39
6Contact: Alan Ott <alan@signal11.us>
7Description: When read, this file returns the device's raw binary HID
8 report descriptor.
9 This file cannot be written.
10Users: HIDAPI library (http://www.signal11.us/oss/hidapi)
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-arvo b/Documentation/ABI/testing/sysfs-driver-hid-roccat-arvo
new file mode 100644
index 000000000000..55e281b0071a
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-hid-roccat-arvo
@@ -0,0 +1,53 @@
1What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/arvo/roccatarvo<minor>/actual_profile
2Date: Januar 2011
3Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
4Description: The integer value of this attribute ranges from 1-5.
5 When read, this attribute returns the number of the actual
6 profile which is also the profile that's active on device startup.
7 When written this attribute activates the selected profile
8 immediately.
9Users: http://roccat.sourceforge.net
10
11What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/arvo/roccatarvo<minor>/button
12Date: Januar 2011
13Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
14Description: The keyboard can store short macros with consist of 1 button with
15 several modifier keys internally.
16 When written, this file lets one set the sequence for a specific
17 button for a specific profile. Button and profile numbers are
18 included in written data. The data has to be 24 bytes long.
19 This file is writeonly.
20Users: http://roccat.sourceforge.net
21
22What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/arvo/roccatarvo<minor>/info
23Date: Januar 2011
24Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
25Description: When read, this file returns some info about the device like the
26 installed firmware version.
27 The size of the data is 8 bytes in size.
28 This file is readonly.
29Users: http://roccat.sourceforge.net
30
31What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/arvo/roccatarvo<minor>/key_mask
32Date: Januar 2011
33Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
34Description: The keyboard lets the user deactivate 5 certain keys like the
35 windows and application keys, to protect the user from the outcome
36 of accidentally pressing them.
37 The integer value of this attribute has bits 0-4 set depending
38 on the state of the corresponding key.
39 When read, this file returns the current state of the buttons.
40 When written, the given buttons are activated/deactivated
41 immediately.
42Users: http://roccat.sourceforge.net
43
44What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/arvo/roccatarvo<minor>/mode_key
45Date: Januar 2011
46Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
47Description: The keyboard has a condensed layout without num-lock key.
48 Instead it uses a mode-key which activates a gaming mode where
49 the assignment of the number block changes.
50 The integer value of this attribute ranges from 0 (OFF) to 1 (ON).
51 When read, this file returns the actual state of the key.
52 When written, the key is activated/deactivated immediately.
53Users: http://roccat.sourceforge.net
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-kone b/Documentation/ABI/testing/sysfs-driver-hid-roccat-kone
index 063bda7fe707..3ca3971109bf 100644
--- a/Documentation/ABI/testing/sysfs-driver-hid-roccat-kone
+++ b/Documentation/ABI/testing/sysfs-driver-hid-roccat-kone
@@ -1,4 +1,4 @@
1What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/actual_dpi 1What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kone/roccatkone<minor>/actual_dpi
2Date: March 2010 2Date: March 2010
3Contact: Stefan Achatz <erazor_de@users.sourceforge.net> 3Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
4Description: It is possible to switch the dpi setting of the mouse with the 4Description: It is possible to switch the dpi setting of the mouse with the
@@ -16,14 +16,16 @@ Description: It is possible to switch the dpi setting of the mouse with the
16 6 3200 16 6 3200
17 17
18 This file is readonly. 18 This file is readonly.
19Users: http://roccat.sourceforge.net
19 20
20What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/actual_profile 21What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kone/roccatkone<minor>/actual_profile
21Date: March 2010 22Date: March 2010
22Contact: Stefan Achatz <erazor_de@users.sourceforge.net> 23Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
23Description: When read, this file returns the number of the actual profile. 24Description: When read, this file returns the number of the actual profile.
24 This file is readonly. 25 This file is readonly.
26Users: http://roccat.sourceforge.net
25 27
26What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/firmware_version 28What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kone/roccatkone<minor>/firmware_version
27Date: March 2010 29Date: March 2010
28Contact: Stefan Achatz <erazor_de@users.sourceforge.net> 30Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
29Description: When read, this file returns the raw integer version number of the 31Description: When read, this file returns the raw integer version number of the
@@ -32,12 +34,13 @@ Description: When read, this file returns the raw integer version number of the
32 number the decimal point has to be shifted 2 positions to the 34 number the decimal point has to be shifted 2 positions to the
33 left. E.g. a returned value of 138 means 1.38 35 left. E.g. a returned value of 138 means 1.38
34 This file is readonly. 36 This file is readonly.
37Users: http://roccat.sourceforge.net
35 38
36What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/profile[1-5] 39What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kone/roccatkone<minor>/profile[1-5]
37Date: March 2010 40Date: March 2010
38Contact: Stefan Achatz <erazor_de@users.sourceforge.net> 41Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
39Description: The mouse can store 5 profiles which can be switched by the 42Description: The mouse can store 5 profiles which can be switched by the
40 press of a button. A profile holds informations like button 43 press of a button. A profile holds information like button
41 mappings, sensitivity, the colors of the 5 leds and light 44 mappings, sensitivity, the colors of the 5 leds and light
42 effects. 45 effects.
43 When read, these files return the respective profile. The 46 When read, these files return the respective profile. The
@@ -47,8 +50,9 @@ Description: The mouse can store 5 profiles which can be switched by the
47 The mouse will reject invalid data, whereas the profile number 50 The mouse will reject invalid data, whereas the profile number
48 stored in the profile doesn't need to fit the number of the 51 stored in the profile doesn't need to fit the number of the
49 store. 52 store.
53Users: http://roccat.sourceforge.net
50 54
51What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/settings 55What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kone/roccatkone<minor>/settings
52Date: March 2010 56Date: March 2010
53Contact: Stefan Achatz <erazor_de@users.sourceforge.net> 57Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
54Description: When read, this file returns the settings stored in the mouse. 58Description: When read, this file returns the settings stored in the mouse.
@@ -57,8 +61,9 @@ Description: When read, this file returns the settings stored in the mouse.
57 When written, this file lets write settings back to the mouse. 61 When written, this file lets write settings back to the mouse.
58 The data has to be 36 bytes long. The mouse will reject invalid 62 The data has to be 36 bytes long. The mouse will reject invalid
59 data. 63 data.
64Users: http://roccat.sourceforge.net
60 65
61What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/startup_profile 66What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kone/roccatkone<minor>/startup_profile
62Date: March 2010 67Date: March 2010
63Contact: Stefan Achatz <erazor_de@users.sourceforge.net> 68Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
64Description: The integer value of this attribute ranges from 1 to 5. 69Description: The integer value of this attribute ranges from 1 to 5.
@@ -66,8 +71,9 @@ Description: The integer value of this attribute ranges from 1 to 5.
66 that's active when the mouse is powered on. 71 that's active when the mouse is powered on.
67 When written, this file sets the number of the startup profile 72 When written, this file sets the number of the startup profile
68 and the mouse activates this profile immediately. 73 and the mouse activates this profile immediately.
74Users: http://roccat.sourceforge.net
69 75
70What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/tcu 76What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kone/roccatkone<minor>/tcu
71Date: March 2010 77Date: March 2010
72Contact: Stefan Achatz <erazor_de@users.sourceforge.net> 78Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
73Description: The mouse has a "Tracking Control Unit" which lets the user 79Description: The mouse has a "Tracking Control Unit" which lets the user
@@ -77,8 +83,9 @@ Description: The mouse has a "Tracking Control Unit" which lets the user
77 Writing 0 in this file will switch the TCU off. 83 Writing 0 in this file will switch the TCU off.
78 Writing 1 in this file will start the calibration which takes 84 Writing 1 in this file will start the calibration which takes
79 around 6 seconds to complete and activates the TCU. 85 around 6 seconds to complete and activates the TCU.
86Users: http://roccat.sourceforge.net
80 87
81What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/weight 88What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kone/roccatkone<minor>/weight
82Date: March 2010 89Date: March 2010
83Contact: Stefan Achatz <erazor_de@users.sourceforge.net> 90Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
84Description: The mouse can be equipped with one of four supplied weights 91Description: The mouse can be equipped with one of four supplied weights
@@ -96,3 +103,4 @@ Description: The mouse can be equipped with one of four supplied weights
96 4 20g 103 4 20g
97 104
98 This file is readonly. 105 This file is readonly.
106Users: http://roccat.sourceforge.net
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus b/Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus
new file mode 100644
index 000000000000..c1b53b8bc2ae
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus
@@ -0,0 +1,112 @@
1What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/actual_profile
2Date: October 2010
3Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
4Description: The integer value of this attribute ranges from 0-4.
5 When read, this attribute returns the number of the actual
6 profile. This value is persistent, so its equivalent to the
7 profile that's active when the mouse is powered on next time.
8 When written, this file sets the number of the startup profile
9 and the mouse activates this profile immediately.
10Users: http://roccat.sourceforge.net
11
12What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/firmware_version
13Date: October 2010
14Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
15Description: When read, this file returns the raw integer version number of the
16 firmware reported by the mouse. Using the integer value eases
17 further usage in other programs. To receive the real version
18 number the decimal point has to be shifted 2 positions to the
19 left. E.g. a returned value of 121 means 1.21
20 This file is readonly.
21Users: http://roccat.sourceforge.net
22
23What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/macro
24Date: October 2010
25Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
26Description: The mouse can store a macro with max 500 key/button strokes
27 internally.
28 When written, this file lets one set the sequence for a specific
29 button for a specific profile. Button and profile numbers are
30 included in written data. The data has to be 2082 bytes long.
31 This file is writeonly.
32Users: http://roccat.sourceforge.net
33
34What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/profile_buttons
35Date: August 2010
36Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
37Description: The mouse can store 5 profiles which can be switched by the
38 press of a button. A profile is split in settings and buttons.
39 profile_buttons holds information about button layout.
40 When written, this file lets one write the respective profile
41 buttons back to the mouse. The data has to be 77 bytes long.
42 The mouse will reject invalid data.
43 Which profile to write is determined by the profile number
44 contained in the data.
45 This file is writeonly.
46Users: http://roccat.sourceforge.net
47
48What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/profile[1-5]_buttons
49Date: August 2010
50Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
51Description: The mouse can store 5 profiles which can be switched by the
52 press of a button. A profile is split in settings and buttons.
53 profile_buttons holds information about button layout.
54 When read, these files return the respective profile buttons.
55 The returned data is 77 bytes in size.
56 This file is readonly.
57Users: http://roccat.sourceforge.net
58
59What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/profile_settings
60Date: October 2010
61Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
62Description: The mouse can store 5 profiles which can be switched by the
63 press of a button. A profile is split in settings and buttons.
64 profile_settings holds information like resolution, sensitivity
65 and light effects.
66 When written, this file lets one write the respective profile
67 settings back to the mouse. The data has to be 43 bytes long.
68 The mouse will reject invalid data.
69 Which profile to write is determined by the profile number
70 contained in the data.
71 This file is writeonly.
72Users: http://roccat.sourceforge.net
73
74What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/profile[1-5]_settings
75Date: August 2010
76Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
77Description: The mouse can store 5 profiles which can be switched by the
78 press of a button. A profile is split in settings and buttons.
79 profile_settings holds information like resolution, sensitivity
80 and light effects.
81 When read, these files return the respective profile settings.
82 The returned data is 43 bytes in size.
83 This file is readonly.
84Users: http://roccat.sourceforge.net
85
86What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/sensor
87Date: October 2010
88Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
89Description: The mouse has a tracking- and a distance-control-unit. These
90 can be activated/deactivated and the lift-off distance can be
91 set. The data has to be 6 bytes long.
92 This file is writeonly.
93Users: http://roccat.sourceforge.net
94
95What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/tcu
96Date: October 2010
97Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
98Description: When written a calibration process for the tracking control unit
99 can be initiated/cancelled.
100 The data has to be 3 bytes long.
101 This file is writeonly.
102Users: http://roccat.sourceforge.net
103
104What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/tcu_image
105Date: October 2010
106Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
107Description: When read the mouse returns a 30x30 pixel image of the
108 sampled underground. This works only in the course of a
109 calibration process initiated with tcu.
110 The returned data is 1028 bytes in size.
111 This file is readonly.
112Users: http://roccat.sourceforge.net
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-kovaplus b/Documentation/ABI/testing/sysfs-driver-hid-roccat-kovaplus
new file mode 100644
index 000000000000..20f937c9d84f
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-hid-roccat-kovaplus
@@ -0,0 +1,100 @@
1What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/actual_cpi
2Date: January 2011
3Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
4Description: The integer value of this attribute ranges from 1-4.
5 When read, this attribute returns the number of the active
6 cpi level.
7 This file is readonly.
8Users: http://roccat.sourceforge.net
9
10What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/actual_profile
11Date: January 2011
12Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
13Description: The integer value of this attribute ranges from 0-4.
14 When read, this attribute returns the number of the active
15 profile.
16 When written, the mouse activates this profile immediately.
17 The profile that's active when powered down is the same that's
18 active when the mouse is powered on.
19Users: http://roccat.sourceforge.net
20
21What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/actual_sensitivity_x
22Date: January 2011
23Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
24Description: The integer value of this attribute ranges from 1-10.
25 When read, this attribute returns the number of the actual
26 sensitivity in x direction.
27 This file is readonly.
28Users: http://roccat.sourceforge.net
29
30What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/actual_sensitivity_y
31Date: January 2011
32Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
33Description: The integer value of this attribute ranges from 1-10.
34 When read, this attribute returns the number of the actual
35 sensitivity in y direction.
36 This file is readonly.
37Users: http://roccat.sourceforge.net
38
39What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/firmware_version
40Date: January 2011
41Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
42Description: When read, this file returns the raw integer version number of the
43 firmware reported by the mouse. Using the integer value eases
44 further usage in other programs. To receive the real version
45 number the decimal point has to be shifted 2 positions to the
46 left. E.g. a returned value of 121 means 1.21
47 This file is readonly.
48Users: http://roccat.sourceforge.net
49
50What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/profile_buttons
51Date: January 2011
52Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
53Description: The mouse can store 5 profiles which can be switched by the
54 press of a button. A profile is split in settings and buttons.
55 profile_buttons holds information about button layout.
56 When written, this file lets one write the respective profile
57 buttons back to the mouse. The data has to be 23 bytes long.
58 The mouse will reject invalid data.
59 Which profile to write is determined by the profile number
60 contained in the data.
61 This file is writeonly.
62Users: http://roccat.sourceforge.net
63
64What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/profile[1-5]_buttons
65Date: January 2011
66Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
67Description: The mouse can store 5 profiles which can be switched by the
68 press of a button. A profile is split in settings and buttons.
69 profile_buttons holds information about button layout.
70 When read, these files return the respective profile buttons.
71 The returned data is 23 bytes in size.
72 This file is readonly.
73Users: http://roccat.sourceforge.net
74
75What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/profile_settings
76Date: January 2011
77Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
78Description: The mouse can store 5 profiles which can be switched by the
79 press of a button. A profile is split in settings and buttons.
80 profile_settings holds information like resolution, sensitivity
81 and light effects.
82 When written, this file lets one write the respective profile
83 settings back to the mouse. The data has to be 16 bytes long.
84 The mouse will reject invalid data.
85 Which profile to write is determined by the profile number
86 contained in the data.
87 This file is writeonly.
88Users: http://roccat.sourceforge.net
89
90What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/profile[1-5]_settings
91Date: January 2011
92Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
93Description: The mouse can store 5 profiles which can be switched by the
94 press of a button. A profile is split in settings and buttons.
95 profile_settings holds information like resolution, sensitivity
96 and light effects.
97 When read, these files return the respective profile settings.
98 The returned data is 16 bytes in size.
99 This file is readonly.
100Users: http://roccat.sourceforge.net
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-pyra b/Documentation/ABI/testing/sysfs-driver-hid-roccat-pyra
new file mode 100644
index 000000000000..3f8de50e4ff1
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-hid-roccat-pyra
@@ -0,0 +1,107 @@
1What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/actual_cpi
2Date: August 2010
3Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
4Description: It is possible to switch the cpi setting of the mouse with the
5 press of a button.
6 When read, this file returns the raw number of the actual cpi
7 setting reported by the mouse. This number has to be further
8 processed to receive the real dpi value.
9
10 VALUE DPI
11 1 400
12 2 800
13 4 1600
14
15 This file is readonly.
16Users: http://roccat.sourceforge.net
17
18What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/actual_profile
19Date: August 2010
20Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
21Description: When read, this file returns the number of the actual profile in
22 range 0-4.
23 This file is readonly.
24Users: http://roccat.sourceforge.net
25
26What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/firmware_version
27Date: August 2010
28Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
29Description: When read, this file returns the raw integer version number of the
30 firmware reported by the mouse. Using the integer value eases
31 further usage in other programs. To receive the real version
32 number the decimal point has to be shifted 2 positions to the
33 left. E.g. a returned value of 138 means 1.38
34 This file is readonly.
35Users: http://roccat.sourceforge.net
36
37What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/profile_settings
38Date: August 2010
39Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
40Description: The mouse can store 5 profiles which can be switched by the
41 press of a button. A profile is split in settings and buttons.
42 profile_settings holds information like resolution, sensitivity
43 and light effects.
44 When written, this file lets one write the respective profile
45 settings back to the mouse. The data has to be 13 bytes long.
46 The mouse will reject invalid data.
47 Which profile to write is determined by the profile number
48 contained in the data.
49 This file is writeonly.
50Users: http://roccat.sourceforge.net
51
52What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/profile[1-5]_settings
53Date: August 2010
54Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
55Description: The mouse can store 5 profiles which can be switched by the
56 press of a button. A profile is split in settings and buttons.
57 profile_settings holds information like resolution, sensitivity
58 and light effects.
59 When read, these files return the respective profile settings.
60 The returned data is 13 bytes in size.
61 This file is readonly.
62Users: http://roccat.sourceforge.net
63
64What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/profile_buttons
65Date: August 2010
66Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
67Description: The mouse can store 5 profiles which can be switched by the
68 press of a button. A profile is split in settings and buttons.
69 profile_buttons holds information about button layout.
70 When written, this file lets one write the respective profile
71 buttons back to the mouse. The data has to be 19 bytes long.
72 The mouse will reject invalid data.
73 Which profile to write is determined by the profile number
74 contained in the data.
75 This file is writeonly.
76Users: http://roccat.sourceforge.net
77
78What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/profile[1-5]_buttons
79Date: August 2010
80Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
81Description: The mouse can store 5 profiles which can be switched by the
82 press of a button. A profile is split in settings and buttons.
83 profile_buttons holds information about button layout.
84 When read, these files return the respective profile buttons.
85 The returned data is 19 bytes in size.
86 This file is readonly.
87Users: http://roccat.sourceforge.net
88
89What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/startup_profile
90Date: August 2010
91Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
92Description: The integer value of this attribute ranges from 0-4.
93 When read, this attribute returns the number of the profile
94 that's active when the mouse is powered on.
95 This file is readonly.
96Users: http://roccat.sourceforge.net
97
98What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/settings
99Date: August 2010
100Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
101Description: When read, this file returns the settings stored in the mouse.
102 The size of the data is 3 bytes and holds information on the
103 startup_profile.
104 When written, this file lets write settings back to the mouse.
105 The data has to be 3 bytes long. The mouse will reject invalid
106 data.
107Users: http://roccat.sourceforge.net
diff --git a/Documentation/ABI/testing/sysfs-driver-samsung-laptop b/Documentation/ABI/testing/sysfs-driver-samsung-laptop
new file mode 100644
index 000000000000..0a810231aad4
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-samsung-laptop
@@ -0,0 +1,19 @@
1What: /sys/devices/platform/samsung/performance_level
2Date: January 1, 2010
3KernelVersion: 2.6.33
4Contact: Greg Kroah-Hartman <gregkh@suse.de>
5Description: Some Samsung laptops have different "performance levels"
6 that are can be modified by a function key, and by this
7 sysfs file. These values don't always make a whole lot
8 of sense, but some users like to modify them to keep
9 their fans quiet at all costs. Reading from this file
10 will show the current performance level. Writing to the
11 file can change this value.
12 Valid options:
13 "silent"
14 "normal"
15 "overclock"
16 Note that not all laptops support all of these options.
17 Specifically, not all support the "overclock" option,
18 and it's still unknown if this value even changes
19 anything, other than making the user feel a bit better.
diff --git a/Documentation/ABI/testing/sysfs-firmware-dmi b/Documentation/ABI/testing/sysfs-firmware-dmi
new file mode 100644
index 000000000000..c78f9ab01e56
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-firmware-dmi
@@ -0,0 +1,110 @@
1What: /sys/firmware/dmi/
2Date: February 2011
3Contact: Mike Waychison <mikew@google.com>
4Description:
5 Many machines' firmware (x86 and ia64) export DMI /
6 SMBIOS tables to the operating system. Getting at this
7 information is often valuable to userland, especially in
8 cases where there are OEM extensions used.
9
10 The kernel itself does not rely on the majority of the
11 information in these tables being correct. It equally
12 cannot ensure that the data as exported to userland is
13 without error either.
14
15 DMI is structured as a large table of entries, where
16 each entry has a common header indicating the type and
17 length of the entry, as well as a firmware-provided
18 'handle' that is supposed to be unique amongst all
19 entries.
20
21 Some entries are required by the specification, but many
22 others are optional. In general though, users should
23 never expect to find a specific entry type on their
24 system unless they know for certain what their firmware
25 is doing. Machine to machine experiences will vary.
26
27 Multiple entries of the same type are allowed. In order
28 to handle these duplicate entry types, each entry is
29 assigned by the operating system an 'instance', which is
30 derived from an entry type's ordinal position. That is
31 to say, if there are 'N' multiple entries with the same type
32 'T' in the DMI tables (adjacent or spread apart, it
33 doesn't matter), they will be represented in sysfs as
34 entries "T-0" through "T-(N-1)":
35
36 Example entry directories:
37
38 /sys/firmware/dmi/entries/17-0
39 /sys/firmware/dmi/entries/17-1
40 /sys/firmware/dmi/entries/17-2
41 /sys/firmware/dmi/entries/17-3
42 ...
43
44 Instance numbers are used in lieu of the firmware
45 assigned entry handles as the kernel itself makes no
46 guarantees that handles as exported are unique, and
47 there are likely firmware images that get this wrong in
48 the wild.
49
50 Each DMI entry in sysfs has the common header values
51 exported as attributes:
52
53 handle : The 16bit 'handle' that is assigned to this
54 entry by the firmware. This handle may be
55 referred to by other entries.
56 length : The length of the entry, as presented in the
57 entry itself. Note that this is _not the
58 total count of bytes associated with the
59 entry_. This value represents the length of
60 the "formatted" portion of the entry. This
61 "formatted" region is sometimes followed by
62 the "unformatted" region composed of nul
63 terminated strings, with termination signalled
64 by a two nul characters in series.
65 raw : The raw bytes of the entry. This includes the
66 "formatted" portion of the entry, the
67 "unformatted" strings portion of the entry,
68 and the two terminating nul characters.
69 type : The type of the entry. This value is the same
70 as found in the directory name. It indicates
71 how the rest of the entry should be interpreted.
72 instance: The instance ordinal of the entry for the
73 given type. This value is the same as found
74 in the parent directory name.
75 position: The ordinal position (zero-based) of the entry
76 within the entirety of the DMI entry table.
77
78 === Entry Specialization ===
79
80 Some entry types may have other information available in
81 sysfs. Not all types are specialized.
82
83 --- Type 15 - System Event Log ---
84
85 This entry allows the firmware to export a log of
86 events the system has taken. This information is
87 typically backed by nvram, but the implementation
88 details are abstracted by this table. This entry's data
89 is exported in the directory:
90
91 /sys/firmware/dmi/entries/15-0/system_event_log
92
93 and has the following attributes (documented in the
94 SMBIOS / DMI specification under "System Event Log (Type 15)":
95
96 area_length
97 header_start_offset
98 data_start_offset
99 access_method
100 status
101 change_token
102 access_method_address
103 header_format
104 per_log_type_descriptor_length
105 type_descriptors_supported_count
106
107 As well, the kernel exports the binary attribute:
108
109 raw_event_log : The raw binary bits of the event log
110 as described by the DMI entry.
diff --git a/Documentation/ABI/testing/sysfs-firmware-gsmi b/Documentation/ABI/testing/sysfs-firmware-gsmi
new file mode 100644
index 000000000000..0faa0aaf4b6a
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-firmware-gsmi
@@ -0,0 +1,58 @@
1What: /sys/firmware/gsmi
2Date: March 2011
3Contact: Mike Waychison <mikew@google.com>
4Description:
5 Some servers used internally at Google have firmware
6 that provides callback functionality via explicit SMI
7 triggers. Some of the callbacks are similar to those
8 provided by the EFI runtime services page, but due to
9 historical reasons this different entry-point has been
10 used.
11
12 The gsmi driver implements the kernel's abstraction for
13 these firmware callbacks. Currently, this functionality
14 is limited to handling the system event log and getting
15 access to EFI-style variables stored in nvram.
16
17 Layout:
18
19 /sys/firmware/gsmi/vars:
20
21 This directory has the same layout (and
22 underlying implementation as /sys/firmware/efi/vars.
23 See Documentation/ABI/*/sysfs-firmware-efi-vars
24 for more information on how to interact with
25 this structure.
26
27 /sys/firmware/gsmi/append_to_eventlog - write-only:
28
29 This file takes a binary blob and passes it onto
30 the firmware to be timestamped and appended to
31 the system eventlog. The binary format is
32 interpreted by the firmware and may change from
33 platform to platform. The only kernel-enforced
34 requirement is that the blob be prefixed with a
35 32bit host-endian type used as part of the
36 firmware call.
37
38 /sys/firmware/gsmi/clear_config - write-only:
39
40 Writing any value to this file will cause the
41 entire firmware configuration to be reset to
42 "factory defaults". Callers should assume that
43 a reboot is required for the configuration to be
44 cleared.
45
46 /sys/firmware/gsmi/clear_eventlog - write-only:
47
48 This file is used to clear out a portion/the
49 whole of the system event log. Values written
50 should be values between 1 and 100 inclusive (in
51 ASCII) representing the fraction of the log to
52 clear. Not all platforms support fractional
53 clearing though, and this writes to this file
54 will error out if the firmware doesn't like your
55 submitted fraction.
56
57 Callers should assume that a reboot is needed
58 for this operation to complete.
diff --git a/Documentation/ABI/testing/sysfs-firmware-log b/Documentation/ABI/testing/sysfs-firmware-log
new file mode 100644
index 000000000000..9b58e7c5365f
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-firmware-log
@@ -0,0 +1,7 @@
1What: /sys/firmware/log
2Date: February 2011
3Contact: Mike Waychison <mikew@google.com>
4Description:
5 The /sys/firmware/log is a binary file that represents a
6 read-only copy of the firmware's log if one is
7 available.
diff --git a/Documentation/ABI/testing/sysfs-fs-ext4 b/Documentation/ABI/testing/sysfs-fs-ext4
index 5fb709997d96..f22ac0872ae8 100644
--- a/Documentation/ABI/testing/sysfs-fs-ext4
+++ b/Documentation/ABI/testing/sysfs-fs-ext4
@@ -48,7 +48,7 @@ Description:
48 will have its blocks allocated out of its own unique 48 will have its blocks allocated out of its own unique
49 preallocation pool. 49 preallocation pool.
50 50
51What: /sys/fs/ext4/<disk>/inode_readahead 51What: /sys/fs/ext4/<disk>/inode_readahead_blks
52Date: March 2008 52Date: March 2008
53Contact: "Theodore Ts'o" <tytso@mit.edu> 53Contact: "Theodore Ts'o" <tytso@mit.edu>
54Description: 54Description:
@@ -85,7 +85,14 @@ Date: June 2008
85Contact: "Theodore Ts'o" <tytso@mit.edu> 85Contact: "Theodore Ts'o" <tytso@mit.edu>
86Description: 86Description:
87 Tuning parameter which (if non-zero) controls the goal 87 Tuning parameter which (if non-zero) controls the goal
88 inode used by the inode allocator in p0reference to 88 inode used by the inode allocator in preference to
89 all other allocation hueristics. This is intended for 89 all other allocation heuristics. This is intended for
90 debugging use only, and should be 0 on production 90 debugging use only, and should be 0 on production
91 systems. 91 systems.
92
93What: /sys/fs/ext4/<disk>/max_writeback_mb_bump
94Date: September 2009
95Contact: "Theodore Ts'o" <tytso@mit.edu>
96Description:
97 The maximum number of megabytes the writeback code will
98 try to write out before move on to another inode.
diff --git a/Documentation/ABI/testing/sysfs-kernel-fscaps b/Documentation/ABI/testing/sysfs-kernel-fscaps
new file mode 100644
index 000000000000..50a3033b5e15
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-kernel-fscaps
@@ -0,0 +1,8 @@
1What: /sys/kernel/fscaps
2Date: February 2011
3KernelVersion: 2.6.38
4Contact: Ludwig Nussel <ludwig.nussel@suse.de>
5Description
6 Shows whether file system capabilities are honored
7 when executing a binary
8
diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-cleancache b/Documentation/ABI/testing/sysfs-kernel-mm-cleancache
new file mode 100644
index 000000000000..662ae646ea12
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-kernel-mm-cleancache
@@ -0,0 +1,11 @@
1What: /sys/kernel/mm/cleancache/
2Date: April 2011
3Contact: Dan Magenheimer <dan.magenheimer@oracle.com>
4Description:
5 /sys/kernel/mm/cleancache/ contains a number of files which
6 record a count of various cleancache operations
7 (sum across all filesystems):
8 succ_gets
9 failed_gets
10 puts
11 flushes
diff --git a/Documentation/ABI/testing/sysfs-module b/Documentation/ABI/testing/sysfs-module
new file mode 100644
index 000000000000..cfcec3bffc0a
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-module
@@ -0,0 +1,12 @@
1What: /sys/module/pch_phub/drivers/.../pch_mac
2Date: August 2010
3KernelVersion: 2.6.35
4Contact: masa-korg@dsn.okisemi.com
5Description: Write/read GbE MAC address.
6
7What: /sys/module/pch_phub/drivers/.../pch_firmware
8Date: August 2010
9KernelVersion: 2.6.35
10Contact: masa-korg@dsn.okisemi.com
11Description: Write/read Option ROM data.
12
diff --git a/Documentation/ABI/testing/sysfs-platform-asus-laptop b/Documentation/ABI/testing/sysfs-platform-asus-laptop
index 1d775390e856..cd9d667c3da2 100644
--- a/Documentation/ABI/testing/sysfs-platform-asus-laptop
+++ b/Documentation/ABI/testing/sysfs-platform-asus-laptop
@@ -27,7 +27,7 @@ KernelVersion: 2.6.20
27Contact: "Corentin Chary" <corentincj@iksaif.net> 27Contact: "Corentin Chary" <corentincj@iksaif.net>
28Description: 28Description:
29 Some models like the W1N have a LED display that can be 29 Some models like the W1N have a LED display that can be
30 used to display several informations. 30 used to display several items of information.
31 To control the LED display, use the following : 31 To control the LED display, use the following :
32 echo 0x0T000DDD > /sys/devices/platform/asus_laptop/ 32 echo 0x0T000DDD > /sys/devices/platform/asus_laptop/
33 where T control the 3 letters display, and DDD the 3 digits display. 33 where T control the 3 letters display, and DDD the 3 digits display.
@@ -47,6 +47,20 @@ Date: January 2007
47KernelVersion: 2.6.20 47KernelVersion: 2.6.20
48Contact: "Corentin Chary" <corentincj@iksaif.net> 48Contact: "Corentin Chary" <corentincj@iksaif.net>
49Description: 49Description:
50 Control the bluetooth device. 1 means on, 0 means off. 50 Control the wlan device. 1 means on, 0 means off.
51 This may control the led, the device or both. 51 This may control the led, the device or both.
52Users: Lapsus 52Users: Lapsus
53
54What: /sys/devices/platform/asus_laptop/wimax
55Date: October 2010
56KernelVersion: 2.6.37
57Contact: "Corentin Chary" <corentincj@iksaif.net>
58Description:
59 Control the wimax device. 1 means on, 0 means off.
60
61What: /sys/devices/platform/asus_laptop/wwan
62Date: October 2010
63KernelVersion: 2.6.37
64Contact: "Corentin Chary" <corentincj@iksaif.net>
65Description:
66 Control the wwan (3G) device. 1 means on, 0 means off.
diff --git a/Documentation/ABI/testing/sysfs-platform-asus-wmi b/Documentation/ABI/testing/sysfs-platform-asus-wmi
new file mode 100644
index 000000000000..2e7df91620de
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-platform-asus-wmi
@@ -0,0 +1,31 @@
1What: /sys/devices/platform/<platform>/cpufv
2Date: Oct 2010
3KernelVersion: 2.6.37
4Contact: "Corentin Chary" <corentincj@iksaif.net>
5Description:
6 Change CPU clock configuration (write-only).
7 There are three available clock configuration:
8 * 0 -> Super Performance Mode
9 * 1 -> High Performance Mode
10 * 2 -> Power Saving Mode
11
12What: /sys/devices/platform/<platform>/camera
13Date: Jan 2010
14KernelVersion: 2.6.39
15Contact: "Corentin Chary" <corentincj@iksaif.net>
16Description:
17 Control the camera. 1 means on, 0 means off.
18
19What: /sys/devices/platform/<platform>/cardr
20Date: Jan 2010
21KernelVersion: 2.6.39
22Contact: "Corentin Chary" <corentincj@iksaif.net>
23Description:
24 Control the card reader. 1 means on, 0 means off.
25
26What: /sys/devices/platform/<platform>/touchpad
27Date: Jan 2010
28KernelVersion: 2.6.39
29Contact: "Corentin Chary" <corentincj@iksaif.net>
30Description:
31 Control the card touchpad. 1 means on, 0 means off.
diff --git a/Documentation/ABI/testing/sysfs-platform-at91 b/Documentation/ABI/testing/sysfs-platform-at91
new file mode 100644
index 000000000000..4cc6a865ae66
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-platform-at91
@@ -0,0 +1,25 @@
1What: /sys/devices/platform/at91_can/net/<iface>/mb0_id
2Date: January 2011
3KernelVersion: 2.6.38
4Contact: Marc Kleine-Budde <kernel@pengutronix.de>
5Description:
6 Value representing the can_id of mailbox 0.
7
8 Default: 0x7ff (standard frame)
9
10 Due to a chip bug (errata 50.2.6.3 & 50.3.5.3 in
11 "AT91SAM9263 Preliminary 6249H-ATARM-27-Jul-09") the
12 contents of mailbox 0 may be send under certain
13 conditions (even if disabled or in rx mode).
14
15 The workaround in the errata suggests not to use the
16 mailbox and load it with an unused identifier.
17
18 In order to use an extended can_id add the
19 CAN_EFF_FLAG (0x80000000U) to the can_id. Example:
20
21 - standard id 0x7ff:
22 echo 0x7ff > /sys/class/net/can0/mb0_id
23
24 - extended id 0x1fffffff:
25 echo 0x9fffffff > /sys/class/net/can0/mb0_id
diff --git a/Documentation/ABI/testing/sysfs-platform-ideapad-laptop b/Documentation/ABI/testing/sysfs-platform-ideapad-laptop
new file mode 100644
index 000000000000..807fca2ae2a4
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-platform-ideapad-laptop
@@ -0,0 +1,6 @@
1What: /sys/devices/platform/ideapad/camera_power
2Date: Dec 2010
3KernelVersion: 2.6.37
4Contact: "Ike Panhc <ike.pan@canonical.com>"
5Description:
6 Control the power of camera module. 1 means on, 0 means off.
diff --git a/Documentation/ABI/testing/sysfs-platform-kim b/Documentation/ABI/testing/sysfs-platform-kim
new file mode 100644
index 000000000000..c1653271872a
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-platform-kim
@@ -0,0 +1,48 @@
1What: /sys/devices/platform/kim/dev_name
2Date: January 2010
3KernelVersion: 2.6.38
4Contact: "Pavan Savoy" <pavan_savoy@ti.com>
5Description:
6 Name of the UART device at which the WL128x chip
7 is connected. example: "/dev/ttyS0".
8 The device name flows down to architecture specific board
9 initialization file from the SFI/ATAGS bootloader
10 firmware. The name exposed is read from the user-space
11 dameon and opens the device when install is requested.
12
13What: /sys/devices/platform/kim/baud_rate
14Date: January 2010
15KernelVersion: 2.6.38
16Contact: "Pavan Savoy" <pavan_savoy@ti.com>
17Description:
18 The maximum reliable baud-rate the host can support.
19 Different platforms tend to have different high-speed
20 UART configurations, so the baud-rate needs to be set
21 locally and also sent across to the WL128x via a HCI-VS
22 command. The entry is read and made use by the user-space
23 daemon when the ldisc install is requested.
24
25What: /sys/devices/platform/kim/flow_cntrl
26Date: January 2010
27KernelVersion: 2.6.38
28Contact: "Pavan Savoy" <pavan_savoy@ti.com>
29Description:
30 The WL128x makes use of flow control mechanism, and this
31 entry most often should be 1, the host's UART is required
32 to have the capability of flow-control, or else this
33 entry can be made use of for exceptions.
34
35What: /sys/devices/platform/kim/install
36Date: January 2010
37KernelVersion: 2.6.38
38Contact: "Pavan Savoy" <pavan_savoy@ti.com>
39Description:
40 When one of the protocols Bluetooth, FM or GPS wants to make
41 use of the shared UART transport, it registers to the shared
42 transport driver, which will signal the user-space for opening,
43 configuring baud and install line discipline via this sysfs
44 entry. This entry would be polled upon by the user-space
45 daemon managing the UART, and is notified about the change
46 by the sysfs_notify. The value would be '1' when UART needs
47 to be opened/ldisc installed, and would be '0' when UART
48 is no more required and needs to be closed.
diff --git a/Documentation/ABI/testing/sysfs-power b/Documentation/ABI/testing/sysfs-power
index 2875f1f74a07..b464d12761ba 100644
--- a/Documentation/ABI/testing/sysfs-power
+++ b/Documentation/ABI/testing/sysfs-power
@@ -99,9 +99,38 @@ Description:
99 99
100 dmesg -s 1000000 | grep 'hash matches' 100 dmesg -s 1000000 | grep 'hash matches'
101 101
102 If you do not get any matches (or they appear to be false
103 positives), it is possible that the last PM event point
104 referred to a device created by a loadable kernel module. In
105 this case cat /sys/power/pm_trace_dev_match (see below) after
106 your system is started up and the kernel modules are loaded.
107
102 CAUTION: Using it will cause your machine's real-time (CMOS) 108 CAUTION: Using it will cause your machine's real-time (CMOS)
103 clock to be set to a random invalid time after a resume. 109 clock to be set to a random invalid time after a resume.
104 110
111What; /sys/power/pm_trace_dev_match
112Date: October 2010
113Contact: James Hogan <james@albanarts.com>
114Description:
115 The /sys/power/pm_trace_dev_match file contains the name of the
116 device associated with the last PM event point saved in the RTC
117 across reboots when pm_trace has been used. More precisely it
118 contains the list of current devices (including those
119 registered by loadable kernel modules since boot) which match
120 the device hash in the RTC at boot, with a newline after each
121 one.
122
123 The advantage of this file over the hash matches printed to the
124 kernel log (see /sys/power/pm_trace), is that it includes
125 devices created after boot by loadable kernel modules.
126
127 Due to the small hash size necessary to fit in the RTC, it is
128 possible that more than one device matches the hash, in which
129 case further investigation is required to determine which
130 device is causing the problem. Note that genuine RTC clock
131 values (such as when pm_trace has not been used), can still
132 match a device and output it's name here.
133
105What: /sys/power/pm_async 134What: /sys/power/pm_async
106Date: January 2009 135Date: January 2009
107Contact: Rafael J. Wysocki <rjw@sisk.pl> 136Contact: Rafael J. Wysocki <rjw@sisk.pl>
@@ -129,3 +158,17 @@ Description:
129 successful, will make the kernel abort a subsequent transition 158 successful, will make the kernel abort a subsequent transition
130 to a sleep state if any wakeup events are reported after the 159 to a sleep state if any wakeup events are reported after the
131 write has returned. 160 write has returned.
161
162What: /sys/power/reserved_size
163Date: May 2011
164Contact: Rafael J. Wysocki <rjw@sisk.pl>
165Description:
166 The /sys/power/reserved_size file allows user space to control
167 the amount of memory reserved for allocations made by device
168 drivers during the "device freeze" stage of hibernation. It can
169 be written a string representing a non-negative integer that
170 will be used as the amount of memory to reserve for allocations
171 made by device drivers' "freeze" callbacks, in bytes.
172
173 Reading from this file will display the current value, which is
174 set to 1 MB by default.
diff --git a/Documentation/ABI/testing/sysfs-ptp b/Documentation/ABI/testing/sysfs-ptp
new file mode 100644
index 000000000000..d40d2b550502
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-ptp
@@ -0,0 +1,98 @@
1What: /sys/class/ptp/
2Date: September 2010
3Contact: Richard Cochran <richardcochran@gmail.com>
4Description:
5 This directory contains files and directories
6 providing a standardized interface to the ancillary
7 features of PTP hardware clocks.
8
9What: /sys/class/ptp/ptpN/
10Date: September 2010
11Contact: Richard Cochran <richardcochran@gmail.com>
12Description:
13 This directory contains the attributes of the Nth PTP
14 hardware clock registered into the PTP class driver
15 subsystem.
16
17What: /sys/class/ptp/ptpN/clock_name
18Date: September 2010
19Contact: Richard Cochran <richardcochran@gmail.com>
20Description:
21 This file contains the name of the PTP hardware clock
22 as a human readable string.
23
24What: /sys/class/ptp/ptpN/max_adjustment
25Date: September 2010
26Contact: Richard Cochran <richardcochran@gmail.com>
27Description:
28 This file contains the PTP hardware clock's maximum
29 frequency adjustment value (a positive integer) in
30 parts per billion.
31
32What: /sys/class/ptp/ptpN/n_alarms
33Date: September 2010
34Contact: Richard Cochran <richardcochran@gmail.com>
35Description:
36 This file contains the number of periodic or one shot
37 alarms offer by the PTP hardware clock.
38
39What: /sys/class/ptp/ptpN/n_external_timestamps
40Date: September 2010
41Contact: Richard Cochran <richardcochran@gmail.com>
42Description:
43 This file contains the number of external timestamp
44 channels offered by the PTP hardware clock.
45
46What: /sys/class/ptp/ptpN/n_periodic_outputs
47Date: September 2010
48Contact: Richard Cochran <richardcochran@gmail.com>
49Description:
50 This file contains the number of programmable periodic
51 output channels offered by the PTP hardware clock.
52
53What: /sys/class/ptp/ptpN/pps_avaiable
54Date: September 2010
55Contact: Richard Cochran <richardcochran@gmail.com>
56Description:
57 This file indicates whether the PTP hardware clock
58 supports a Pulse Per Second to the host CPU. Reading
59 "1" means that the PPS is supported, while "0" means
60 not supported.
61
62What: /sys/class/ptp/ptpN/extts_enable
63Date: September 2010
64Contact: Richard Cochran <richardcochran@gmail.com>
65Description:
66 This write-only file enables or disables external
67 timestamps. To enable external timestamps, write the
68 channel index followed by a "1" into the file.
69 To disable external timestamps, write the channel
70 index followed by a "0" into the file.
71
72What: /sys/class/ptp/ptpN/fifo
73Date: September 2010
74Contact: Richard Cochran <richardcochran@gmail.com>
75Description:
76 This file provides timestamps on external events, in
77 the form of three integers: channel index, seconds,
78 and nanoseconds.
79
80What: /sys/class/ptp/ptpN/period
81Date: September 2010
82Contact: Richard Cochran <richardcochran@gmail.com>
83Description:
84 This write-only file enables or disables periodic
85 outputs. To enable a periodic output, write five
86 integers into the file: channel index, start time
87 seconds, start time nanoseconds, period seconds, and
88 period nanoseconds. To disable a periodic output, set
89 all the seconds and nanoseconds values to zero.
90
91What: /sys/class/ptp/ptpN/pps_enable
92Date: September 2010
93Contact: Richard Cochran <richardcochran@gmail.com>
94Description:
95 This write-only file enables or disables delivery of
96 PPS events to the Linux PPS subsystem. To enable PPS
97 events, write a "1" into the file. To disable events,
98 write a "0" into the file.
diff --git a/Documentation/ABI/testing/sysfs-tty b/Documentation/ABI/testing/sysfs-tty
new file mode 100644
index 000000000000..b138b663bf54
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-tty
@@ -0,0 +1,19 @@
1What: /sys/class/tty/console/active
2Date: Nov 2010
3Contact: Kay Sievers <kay.sievers@vrfy.org>
4Description:
5 Shows the list of currently configured
6 console devices, like 'tty1 ttyS0'.
7 The last entry in the file is the active
8 device connected to /dev/console.
9 The file supports poll() to detect virtual
10 console switches.
11
12What: /sys/class/tty/tty0/active
13Date: Nov 2010
14Contact: Kay Sievers <kay.sievers@vrfy.org>
15Description:
16 Shows the currently active virtual console
17 device, like 'tty1'.
18 The file supports poll() to detect virtual
19 console switches.
diff --git a/Documentation/Changes b/Documentation/Changes
index 4fb88f15f2ef..b17580885273 100644
--- a/Documentation/Changes
+++ b/Documentation/Changes
@@ -2,13 +2,7 @@ Intro
2===== 2=====
3 3
4This document is designed to provide a list of the minimum levels of 4This document is designed to provide a list of the minimum levels of
5software necessary to run the 2.6 kernels, as well as provide brief 5software necessary to run the 3.0 kernels.
6instructions regarding any other "Gotchas" users may encounter when
7trying life on the Bleeding Edge. If upgrading from a pre-2.4.x
8kernel, please consult the Changes file included with 2.4.x kernels for
9additional information; most of that information will not be repeated
10here. Basically, this document assumes that your system is already
11functional and running at least 2.4.x kernels.
12 6
13This document is originally based on my "Changes" file for 2.0.x kernels 7This document is originally based on my "Changes" file for 2.0.x kernels
14and therefore owes credit to the same people as that file (Jared Mauch, 8and therefore owes credit to the same people as that file (Jared Mauch,
@@ -22,11 +16,10 @@ Upgrade to at *least* these software revisions before thinking you've
22encountered a bug! If you're unsure what version you're currently 16encountered a bug! If you're unsure what version you're currently
23running, the suggested command should tell you. 17running, the suggested command should tell you.
24 18
25Again, keep in mind that this list assumes you are already 19Again, keep in mind that this list assumes you are already functionally
26functionally running a Linux 2.4 kernel. Also, not all tools are 20running a Linux kernel. Also, not all tools are necessary on all
27necessary on all systems; obviously, if you don't have any ISDN 21systems; obviously, if you don't have any ISDN hardware, for example,
28hardware, for example, you probably needn't concern yourself with 22you probably needn't concern yourself with isdn4k-utils.
29isdn4k-utils.
30 23
31o Gnu C 3.2 # gcc --version 24o Gnu C 3.2 # gcc --version
32o Gnu make 3.80 # make --version 25o Gnu make 3.80 # make --version
@@ -35,7 +28,7 @@ o util-linux 2.10o # fdformat --version
35o module-init-tools 0.9.10 # depmod -V 28o module-init-tools 0.9.10 # depmod -V
36o e2fsprogs 1.41.4 # e2fsck -V 29o e2fsprogs 1.41.4 # e2fsck -V
37o jfsutils 1.1.3 # fsck.jfs -V 30o jfsutils 1.1.3 # fsck.jfs -V
38o reiserfsprogs 3.6.3 # reiserfsck -V 2>&1|grep reiserfsprogs 31o reiserfsprogs 3.6.3 # reiserfsck -V
39o xfsprogs 2.6.0 # xfs_db -V 32o xfsprogs 2.6.0 # xfs_db -V
40o squashfs-tools 4.0 # mksquashfs -version 33o squashfs-tools 4.0 # mksquashfs -version
41o btrfs-progs 0.18 # btrfsck 34o btrfs-progs 0.18 # btrfsck
@@ -46,9 +39,9 @@ o isdn4k-utils 3.1pre1 # isdnctrl 2>&1|grep version
46o nfs-utils 1.0.5 # showmount --version 39o nfs-utils 1.0.5 # showmount --version
47o procps 3.2.0 # ps --version 40o procps 3.2.0 # ps --version
48o oprofile 0.9 # oprofiled --version 41o oprofile 0.9 # oprofiled --version
49o udev 081 # udevinfo -V 42o udev 081 # udevd --version
50o grub 0.93 # grub --version 43o grub 0.93 # grub --version || grub-install --version
51o mcelog 0.6 44o mcelog 0.6 # mcelog --version
52o iptables 1.4.2 # iptables -V 45o iptables 1.4.2 # iptables -V
53 46
54 47
@@ -114,12 +107,12 @@ Ksymoops
114 107
115If the unthinkable happens and your kernel oopses, you may need the 108If the unthinkable happens and your kernel oopses, you may need the
116ksymoops tool to decode it, but in most cases you don't. 109ksymoops tool to decode it, but in most cases you don't.
117In the 2.6 kernel it is generally preferred to build the kernel with 110It is generally preferred to build the kernel with CONFIG_KALLSYMS so
118CONFIG_KALLSYMS so that it produces readable dumps that can be used as-is 111that it produces readable dumps that can be used as-is (this also
119(this also produces better output than ksymoops). 112produces better output than ksymoops). If for some reason your kernel
120If for some reason your kernel is not build with CONFIG_KALLSYMS and 113is not build with CONFIG_KALLSYMS and you have no way to rebuild and
121you have no way to rebuild and reproduce the Oops with that option, then 114reproduce the Oops with that option, then you can still decode that Oops
122you can still decode that Oops with ksymoops. 115with ksymoops.
123 116
124Module-Init-Tools 117Module-Init-Tools
125----------------- 118-----------------
@@ -261,8 +254,8 @@ needs to be recompiled or (preferably) upgraded.
261NFS-utils 254NFS-utils
262--------- 255---------
263 256
264In 2.4 and earlier kernels, the nfs server needed to know about any 257In ancient (2.4 and earlier) kernels, the nfs server needed to know
265client that expected to be able to access files via NFS. This 258about any client that expected to be able to access files via NFS. This
266information would be given to the kernel by "mountd" when the client 259information would be given to the kernel by "mountd" when the client
267mounted the filesystem, or by "exportfs" at system startup. exportfs 260mounted the filesystem, or by "exportfs" at system startup. exportfs
268would take information about active clients from /var/lib/nfs/rmtab. 261would take information about active clients from /var/lib/nfs/rmtab.
@@ -272,11 +265,11 @@ which is not always easy, particularly when trying to implement
272fail-over. Even when the system is working well, rmtab suffers from 265fail-over. Even when the system is working well, rmtab suffers from
273getting lots of old entries that never get removed. 266getting lots of old entries that never get removed.
274 267
275With 2.6 we have the option of having the kernel tell mountd when it 268With modern kernels we have the option of having the kernel tell mountd
276gets a request from an unknown host, and mountd can give appropriate 269when it gets a request from an unknown host, and mountd can give
277export information to the kernel. This removes the dependency on 270appropriate export information to the kernel. This removes the
278rmtab and means that the kernel only needs to know about currently 271dependency on rmtab and means that the kernel only needs to know about
279active clients. 272currently active clients.
280 273
281To enable this new functionality, you need to: 274To enable this new functionality, you need to:
282 275
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index 8bb37237ebd2..fa6e25b94a54 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -168,6 +168,13 @@ Do not unnecessarily use braces where a single statement will do.
168if (condition) 168if (condition)
169 action(); 169 action();
170 170
171and
172
173if (condition)
174 do_this();
175else
176 do_that();
177
171This does not apply if one branch of a conditional statement is a single 178This does not apply if one branch of a conditional statement is a single
172statement. Use braces in both branches. 179statement. Use braces in both branches.
173 180
@@ -659,7 +666,7 @@ There are a number of driver model diagnostic macros in <linux/device.h>
659which you should use to make sure messages are matched to the right device 666which you should use to make sure messages are matched to the right device
660and driver, and are tagged with the right level: dev_err(), dev_warn(), 667and driver, and are tagged with the right level: dev_err(), dev_warn(),
661dev_info(), and so forth. For messages that aren't associated with a 668dev_info(), and so forth. For messages that aren't associated with a
662particular device, <linux/kernel.h> defines pr_debug() and pr_info(). 669particular device, <linux/printk.h> defines pr_debug() and pr_info().
663 670
664Coming up with good debugging messages can be quite a challenge; and once 671Coming up with good debugging messages can be quite a challenge; and once
665you have them, they can be a huge help for remote troubleshooting. Such 672you have them, they can be a huge help for remote troubleshooting. Such
@@ -673,8 +680,8 @@ ones already enabled by DEBUG.
673 Chapter 14: Allocating memory 680 Chapter 14: Allocating memory
674 681
675The kernel provides the following general purpose memory allocators: 682The kernel provides the following general purpose memory allocators:
676kmalloc(), kzalloc(), kcalloc(), and vmalloc(). Please refer to the API 683kmalloc(), kzalloc(), kcalloc(), vmalloc(), and vzalloc(). Please refer to
677documentation for further information about them. 684the API documentation for further information about them.
678 685
679The preferred form for passing a size of a struct is the following: 686The preferred form for passing a size of a struct is the following:
680 687
@@ -819,6 +826,3 @@ language C, URL: http://www.open-std.org/JTC1/SC22/WG14/
819Kernel CodingStyle, by greg@kroah.com at OLS 2002: 826Kernel CodingStyle, by greg@kroah.com at OLS 2002:
820http://www.kroah.com/linux/talks/ols_2002_kernel_codingstyle_talk/html/ 827http://www.kroah.com/linux/talks/ols_2002_kernel_codingstyle_talk/html/
821 828
822--
823Last updated on 2007-July-13.
824
diff --git a/Documentation/DocBook/.gitignore b/Documentation/DocBook/.gitignore
index c6def352fe39..679034cbd686 100644
--- a/Documentation/DocBook/.gitignore
+++ b/Documentation/DocBook/.gitignore
@@ -8,3 +8,4 @@
8*.dvi 8*.dvi
9*.log 9*.log
10*.out 10*.out
11media/
diff --git a/Documentation/DocBook/80211.tmpl b/Documentation/DocBook/80211.tmpl
new file mode 100644
index 000000000000..8906648f962b
--- /dev/null
+++ b/Documentation/DocBook/80211.tmpl
@@ -0,0 +1,574 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE set PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
4<set>
5 <setinfo>
6 <title>The 802.11 subsystems &ndash; for kernel developers</title>
7 <subtitle>
8 Explaining wireless 802.11 networking in the Linux kernel
9 </subtitle>
10
11 <copyright>
12 <year>2007-2009</year>
13 <holder>Johannes Berg</holder>
14 </copyright>
15
16 <authorgroup>
17 <author>
18 <firstname>Johannes</firstname>
19 <surname>Berg</surname>
20 <affiliation>
21 <address><email>johannes@sipsolutions.net</email></address>
22 </affiliation>
23 </author>
24 </authorgroup>
25
26 <legalnotice>
27 <para>
28 This documentation is free software; you can redistribute
29 it and/or modify it under the terms of the GNU General Public
30 License version 2 as published by the Free Software Foundation.
31 </para>
32 <para>
33 This documentation is distributed in the hope that it will be
34 useful, but WITHOUT ANY WARRANTY; without even the implied
35 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
36 See the GNU General Public License for more details.
37 </para>
38 <para>
39 You should have received a copy of the GNU General Public
40 License along with this documentation; if not, write to the Free
41 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
42 MA 02111-1307 USA
43 </para>
44 <para>
45 For more details see the file COPYING in the source
46 distribution of Linux.
47 </para>
48 </legalnotice>
49
50 <abstract>
51 <para>
52 These books attempt to give a description of the
53 various subsystems that play a role in 802.11 wireless
54 networking in Linux. Since these books are for kernel
55 developers they attempts to document the structures
56 and functions used in the kernel as well as giving a
57 higher-level overview.
58 </para>
59 <para>
60 The reader is expected to be familiar with the 802.11
61 standard as published by the IEEE in 802.11-2007 (or
62 possibly later versions). References to this standard
63 will be given as "802.11-2007 8.1.5".
64 </para>
65 </abstract>
66 </setinfo>
67 <book id="cfg80211-developers-guide">
68 <bookinfo>
69 <title>The cfg80211 subsystem</title>
70
71 <abstract>
72!Pinclude/net/cfg80211.h Introduction
73 </abstract>
74 </bookinfo>
75 <chapter>
76 <title>Device registration</title>
77!Pinclude/net/cfg80211.h Device registration
78!Finclude/net/cfg80211.h ieee80211_band
79!Finclude/net/cfg80211.h ieee80211_channel_flags
80!Finclude/net/cfg80211.h ieee80211_channel
81!Finclude/net/cfg80211.h ieee80211_rate_flags
82!Finclude/net/cfg80211.h ieee80211_rate
83!Finclude/net/cfg80211.h ieee80211_sta_ht_cap
84!Finclude/net/cfg80211.h ieee80211_supported_band
85!Finclude/net/cfg80211.h cfg80211_signal_type
86!Finclude/net/cfg80211.h wiphy_params_flags
87!Finclude/net/cfg80211.h wiphy_flags
88!Finclude/net/cfg80211.h wiphy
89!Finclude/net/cfg80211.h wireless_dev
90!Finclude/net/cfg80211.h wiphy_new
91!Finclude/net/cfg80211.h wiphy_register
92!Finclude/net/cfg80211.h wiphy_unregister
93!Finclude/net/cfg80211.h wiphy_free
94
95!Finclude/net/cfg80211.h wiphy_name
96!Finclude/net/cfg80211.h wiphy_dev
97!Finclude/net/cfg80211.h wiphy_priv
98!Finclude/net/cfg80211.h priv_to_wiphy
99!Finclude/net/cfg80211.h set_wiphy_dev
100!Finclude/net/cfg80211.h wdev_priv
101 </chapter>
102 <chapter>
103 <title>Actions and configuration</title>
104!Pinclude/net/cfg80211.h Actions and configuration
105!Finclude/net/cfg80211.h cfg80211_ops
106!Finclude/net/cfg80211.h vif_params
107!Finclude/net/cfg80211.h key_params
108!Finclude/net/cfg80211.h survey_info_flags
109!Finclude/net/cfg80211.h survey_info
110!Finclude/net/cfg80211.h beacon_parameters
111!Finclude/net/cfg80211.h plink_actions
112!Finclude/net/cfg80211.h station_parameters
113!Finclude/net/cfg80211.h station_info_flags
114!Finclude/net/cfg80211.h rate_info_flags
115!Finclude/net/cfg80211.h rate_info
116!Finclude/net/cfg80211.h station_info
117!Finclude/net/cfg80211.h monitor_flags
118!Finclude/net/cfg80211.h mpath_info_flags
119!Finclude/net/cfg80211.h mpath_info
120!Finclude/net/cfg80211.h bss_parameters
121!Finclude/net/cfg80211.h ieee80211_txq_params
122!Finclude/net/cfg80211.h cfg80211_crypto_settings
123!Finclude/net/cfg80211.h cfg80211_auth_request
124!Finclude/net/cfg80211.h cfg80211_assoc_request
125!Finclude/net/cfg80211.h cfg80211_deauth_request
126!Finclude/net/cfg80211.h cfg80211_disassoc_request
127!Finclude/net/cfg80211.h cfg80211_ibss_params
128!Finclude/net/cfg80211.h cfg80211_connect_params
129!Finclude/net/cfg80211.h cfg80211_pmksa
130!Finclude/net/cfg80211.h cfg80211_send_rx_auth
131!Finclude/net/cfg80211.h cfg80211_send_auth_timeout
132!Finclude/net/cfg80211.h __cfg80211_auth_canceled
133!Finclude/net/cfg80211.h cfg80211_send_rx_assoc
134!Finclude/net/cfg80211.h cfg80211_send_assoc_timeout
135!Finclude/net/cfg80211.h cfg80211_send_deauth
136!Finclude/net/cfg80211.h __cfg80211_send_deauth
137!Finclude/net/cfg80211.h cfg80211_send_disassoc
138!Finclude/net/cfg80211.h __cfg80211_send_disassoc
139!Finclude/net/cfg80211.h cfg80211_ibss_joined
140!Finclude/net/cfg80211.h cfg80211_connect_result
141!Finclude/net/cfg80211.h cfg80211_roamed
142!Finclude/net/cfg80211.h cfg80211_disconnected
143!Finclude/net/cfg80211.h cfg80211_ready_on_channel
144!Finclude/net/cfg80211.h cfg80211_remain_on_channel_expired
145!Finclude/net/cfg80211.h cfg80211_new_sta
146!Finclude/net/cfg80211.h cfg80211_rx_mgmt
147!Finclude/net/cfg80211.h cfg80211_mgmt_tx_status
148!Finclude/net/cfg80211.h cfg80211_cqm_rssi_notify
149!Finclude/net/cfg80211.h cfg80211_cqm_pktloss_notify
150!Finclude/net/cfg80211.h cfg80211_michael_mic_failure
151 </chapter>
152 <chapter>
153 <title>Scanning and BSS list handling</title>
154!Pinclude/net/cfg80211.h Scanning and BSS list handling
155!Finclude/net/cfg80211.h cfg80211_ssid
156!Finclude/net/cfg80211.h cfg80211_scan_request
157!Finclude/net/cfg80211.h cfg80211_scan_done
158!Finclude/net/cfg80211.h cfg80211_bss
159!Finclude/net/cfg80211.h cfg80211_inform_bss_frame
160!Finclude/net/cfg80211.h cfg80211_inform_bss
161!Finclude/net/cfg80211.h cfg80211_unlink_bss
162!Finclude/net/cfg80211.h cfg80211_find_ie
163!Finclude/net/cfg80211.h ieee80211_bss_get_ie
164 </chapter>
165 <chapter>
166 <title>Utility functions</title>
167!Pinclude/net/cfg80211.h Utility functions
168!Finclude/net/cfg80211.h ieee80211_channel_to_frequency
169!Finclude/net/cfg80211.h ieee80211_frequency_to_channel
170!Finclude/net/cfg80211.h ieee80211_get_channel
171!Finclude/net/cfg80211.h ieee80211_get_response_rate
172!Finclude/net/cfg80211.h ieee80211_hdrlen
173!Finclude/net/cfg80211.h ieee80211_get_hdrlen_from_skb
174!Finclude/net/cfg80211.h ieee80211_radiotap_iterator
175 </chapter>
176 <chapter>
177 <title>Data path helpers</title>
178!Pinclude/net/cfg80211.h Data path helpers
179!Finclude/net/cfg80211.h ieee80211_data_to_8023
180!Finclude/net/cfg80211.h ieee80211_data_from_8023
181!Finclude/net/cfg80211.h ieee80211_amsdu_to_8023s
182!Finclude/net/cfg80211.h cfg80211_classify8021d
183 </chapter>
184 <chapter>
185 <title>Regulatory enforcement infrastructure</title>
186!Pinclude/net/cfg80211.h Regulatory enforcement infrastructure
187!Finclude/net/cfg80211.h regulatory_hint
188!Finclude/net/cfg80211.h wiphy_apply_custom_regulatory
189!Finclude/net/cfg80211.h freq_reg_info
190 </chapter>
191 <chapter>
192 <title>RFkill integration</title>
193!Pinclude/net/cfg80211.h RFkill integration
194!Finclude/net/cfg80211.h wiphy_rfkill_set_hw_state
195!Finclude/net/cfg80211.h wiphy_rfkill_start_polling
196!Finclude/net/cfg80211.h wiphy_rfkill_stop_polling
197 </chapter>
198 <chapter>
199 <title>Test mode</title>
200!Pinclude/net/cfg80211.h Test mode
201!Finclude/net/cfg80211.h cfg80211_testmode_alloc_reply_skb
202!Finclude/net/cfg80211.h cfg80211_testmode_reply
203!Finclude/net/cfg80211.h cfg80211_testmode_alloc_event_skb
204!Finclude/net/cfg80211.h cfg80211_testmode_event
205 </chapter>
206 </book>
207 <book id="mac80211-developers-guide">
208 <bookinfo>
209 <title>The mac80211 subsystem</title>
210 <abstract>
211!Pinclude/net/mac80211.h Introduction
212!Pinclude/net/mac80211.h Warning
213 </abstract>
214 </bookinfo>
215
216 <toc></toc>
217
218 <!--
219 Generally, this document shall be ordered by increasing complexity.
220 It is important to note that readers should be able to read only
221 the first few sections to get a working driver and only advanced
222 usage should require reading the full document.
223 -->
224
225 <part>
226 <title>The basic mac80211 driver interface</title>
227 <partintro>
228 <para>
229 You should read and understand the information contained
230 within this part of the book while implementing a driver.
231 In some chapters, advanced usage is noted, that may be
232 skipped at first.
233 </para>
234 <para>
235 This part of the book only covers station and monitor mode
236 functionality, additional information required to implement
237 the other modes is covered in the second part of the book.
238 </para>
239 </partintro>
240
241 <chapter id="basics">
242 <title>Basic hardware handling</title>
243 <para>TBD</para>
244 <para>
245 This chapter shall contain information on getting a hw
246 struct allocated and registered with mac80211.
247 </para>
248 <para>
249 Since it is required to allocate rates/modes before registering
250 a hw struct, this chapter shall also contain information on setting
251 up the rate/mode structs.
252 </para>
253 <para>
254 Additionally, some discussion about the callbacks and
255 the general programming model should be in here, including
256 the definition of ieee80211_ops which will be referred to
257 a lot.
258 </para>
259 <para>
260 Finally, a discussion of hardware capabilities should be done
261 with references to other parts of the book.
262 </para>
263 <!-- intentionally multiple !F lines to get proper order -->
264!Finclude/net/mac80211.h ieee80211_hw
265!Finclude/net/mac80211.h ieee80211_hw_flags
266!Finclude/net/mac80211.h SET_IEEE80211_DEV
267!Finclude/net/mac80211.h SET_IEEE80211_PERM_ADDR
268!Finclude/net/mac80211.h ieee80211_ops
269!Finclude/net/mac80211.h ieee80211_alloc_hw
270!Finclude/net/mac80211.h ieee80211_register_hw
271!Finclude/net/mac80211.h ieee80211_unregister_hw
272!Finclude/net/mac80211.h ieee80211_free_hw
273 </chapter>
274
275 <chapter id="phy-handling">
276 <title>PHY configuration</title>
277 <para>TBD</para>
278 <para>
279 This chapter should describe PHY handling including
280 start/stop callbacks and the various structures used.
281 </para>
282!Finclude/net/mac80211.h ieee80211_conf
283!Finclude/net/mac80211.h ieee80211_conf_flags
284 </chapter>
285
286 <chapter id="iface-handling">
287 <title>Virtual interfaces</title>
288 <para>TBD</para>
289 <para>
290 This chapter should describe virtual interface basics
291 that are relevant to the driver (VLANs, MGMT etc are not.)
292 It should explain the use of the add_iface/remove_iface
293 callbacks as well as the interface configuration callbacks.
294 </para>
295 <para>Things related to AP mode should be discussed there.</para>
296 <para>
297 Things related to supporting multiple interfaces should be
298 in the appropriate chapter, a BIG FAT note should be here about
299 this though and the recommendation to allow only a single
300 interface in STA mode at first!
301 </para>
302!Finclude/net/mac80211.h ieee80211_vif
303 </chapter>
304
305 <chapter id="rx-tx">
306 <title>Receive and transmit processing</title>
307 <sect1>
308 <title>what should be here</title>
309 <para>TBD</para>
310 <para>
311 This should describe the receive and transmit
312 paths in mac80211/the drivers as well as
313 transmit status handling.
314 </para>
315 </sect1>
316 <sect1>
317 <title>Frame format</title>
318!Pinclude/net/mac80211.h Frame format
319 </sect1>
320 <sect1>
321 <title>Packet alignment</title>
322!Pnet/mac80211/rx.c Packet alignment
323 </sect1>
324 <sect1>
325 <title>Calling into mac80211 from interrupts</title>
326!Pinclude/net/mac80211.h Calling mac80211 from interrupts
327 </sect1>
328 <sect1>
329 <title>functions/definitions</title>
330!Finclude/net/mac80211.h ieee80211_rx_status
331!Finclude/net/mac80211.h mac80211_rx_flags
332!Finclude/net/mac80211.h mac80211_tx_control_flags
333!Finclude/net/mac80211.h mac80211_rate_control_flags
334!Finclude/net/mac80211.h ieee80211_tx_rate
335!Finclude/net/mac80211.h ieee80211_tx_info
336!Finclude/net/mac80211.h ieee80211_tx_info_clear_status
337!Finclude/net/mac80211.h ieee80211_rx
338!Finclude/net/mac80211.h ieee80211_rx_ni
339!Finclude/net/mac80211.h ieee80211_rx_irqsafe
340!Finclude/net/mac80211.h ieee80211_tx_status
341!Finclude/net/mac80211.h ieee80211_tx_status_ni
342!Finclude/net/mac80211.h ieee80211_tx_status_irqsafe
343!Finclude/net/mac80211.h ieee80211_rts_get
344!Finclude/net/mac80211.h ieee80211_rts_duration
345!Finclude/net/mac80211.h ieee80211_ctstoself_get
346!Finclude/net/mac80211.h ieee80211_ctstoself_duration
347!Finclude/net/mac80211.h ieee80211_generic_frame_duration
348!Finclude/net/mac80211.h ieee80211_wake_queue
349!Finclude/net/mac80211.h ieee80211_stop_queue
350!Finclude/net/mac80211.h ieee80211_wake_queues
351!Finclude/net/mac80211.h ieee80211_stop_queues
352!Finclude/net/mac80211.h ieee80211_queue_stopped
353 </sect1>
354 </chapter>
355
356 <chapter id="filters">
357 <title>Frame filtering</title>
358!Pinclude/net/mac80211.h Frame filtering
359!Finclude/net/mac80211.h ieee80211_filter_flags
360 </chapter>
361
362 <chapter id="workqueue">
363 <title>The mac80211 workqueue</title>
364!Pinclude/net/mac80211.h mac80211 workqueue
365!Finclude/net/mac80211.h ieee80211_queue_work
366!Finclude/net/mac80211.h ieee80211_queue_delayed_work
367 </chapter>
368 </part>
369
370 <part id="advanced">
371 <title>Advanced driver interface</title>
372 <partintro>
373 <para>
374 Information contained within this part of the book is
375 of interest only for advanced interaction of mac80211
376 with drivers to exploit more hardware capabilities and
377 improve performance.
378 </para>
379 </partintro>
380
381 <chapter id="led-support">
382 <title>LED support</title>
383 <para>
384 Mac80211 supports various ways of blinking LEDs. Wherever possible,
385 device LEDs should be exposed as LED class devices and hooked up to
386 the appropriate trigger, which will then be triggered appropriately
387 by mac80211.
388 </para>
389!Finclude/net/mac80211.h ieee80211_get_tx_led_name
390!Finclude/net/mac80211.h ieee80211_get_rx_led_name
391!Finclude/net/mac80211.h ieee80211_get_assoc_led_name
392!Finclude/net/mac80211.h ieee80211_get_radio_led_name
393!Finclude/net/mac80211.h ieee80211_tpt_blink
394!Finclude/net/mac80211.h ieee80211_tpt_led_trigger_flags
395!Finclude/net/mac80211.h ieee80211_create_tpt_led_trigger
396 </chapter>
397
398 <chapter id="hardware-crypto-offload">
399 <title>Hardware crypto acceleration</title>
400!Pinclude/net/mac80211.h Hardware crypto acceleration
401 <!-- intentionally multiple !F lines to get proper order -->
402!Finclude/net/mac80211.h set_key_cmd
403!Finclude/net/mac80211.h ieee80211_key_conf
404!Finclude/net/mac80211.h ieee80211_key_flags
405!Finclude/net/mac80211.h ieee80211_tkip_key_type
406!Finclude/net/mac80211.h ieee80211_get_tkip_key
407!Finclude/net/mac80211.h ieee80211_key_removed
408 </chapter>
409
410 <chapter id="powersave">
411 <title>Powersave support</title>
412!Pinclude/net/mac80211.h Powersave support
413 </chapter>
414
415 <chapter id="beacon-filter">
416 <title>Beacon filter support</title>
417!Pinclude/net/mac80211.h Beacon filter support
418!Finclude/net/mac80211.h ieee80211_beacon_loss
419 </chapter>
420
421 <chapter id="qos">
422 <title>Multiple queues and QoS support</title>
423 <para>TBD</para>
424!Finclude/net/mac80211.h ieee80211_tx_queue_params
425 </chapter>
426
427 <chapter id="AP">
428 <title>Access point mode support</title>
429 <para>TBD</para>
430 <para>Some parts of the if_conf should be discussed here instead</para>
431 <para>
432 Insert notes about VLAN interfaces with hw crypto here or
433 in the hw crypto chapter.
434 </para>
435!Finclude/net/mac80211.h ieee80211_get_buffered_bc
436!Finclude/net/mac80211.h ieee80211_beacon_get
437 </chapter>
438
439 <chapter id="multi-iface">
440 <title>Supporting multiple virtual interfaces</title>
441 <para>TBD</para>
442 <para>
443 Note: WDS with identical MAC address should almost always be OK
444 </para>
445 <para>
446 Insert notes about having multiple virtual interfaces with
447 different MAC addresses here, note which configurations are
448 supported by mac80211, add notes about supporting hw crypto
449 with it.
450 </para>
451!Finclude/net/mac80211.h ieee80211_iterate_active_interfaces
452!Finclude/net/mac80211.h ieee80211_iterate_active_interfaces_atomic
453 </chapter>
454
455 <chapter id="station-handling">
456 <title>Station handling</title>
457 <para>TODO</para>
458!Finclude/net/mac80211.h ieee80211_sta
459!Finclude/net/mac80211.h sta_notify_cmd
460!Finclude/net/mac80211.h ieee80211_find_sta
461!Finclude/net/mac80211.h ieee80211_find_sta_by_ifaddr
462!Finclude/net/mac80211.h ieee80211_sta_block_awake
463 </chapter>
464
465 <chapter id="hardware-scan-offload">
466 <title>Hardware scan offload</title>
467 <para>TBD</para>
468!Finclude/net/mac80211.h ieee80211_scan_completed
469 </chapter>
470
471 <chapter id="aggregation">
472 <title>Aggregation</title>
473 <sect1>
474 <title>TX A-MPDU aggregation</title>
475!Pnet/mac80211/agg-tx.c TX A-MPDU aggregation
476!Cnet/mac80211/agg-tx.c
477 </sect1>
478 <sect1>
479 <title>RX A-MPDU aggregation</title>
480!Pnet/mac80211/agg-rx.c RX A-MPDU aggregation
481!Cnet/mac80211/agg-rx.c
482 </sect1>
483!Finclude/net/mac80211.h ieee80211_ampdu_mlme_action
484 </chapter>
485
486 <chapter id="smps">
487 <title>Spatial Multiplexing Powersave (SMPS)</title>
488!Pinclude/net/mac80211.h Spatial multiplexing power save
489!Finclude/net/mac80211.h ieee80211_request_smps
490!Finclude/net/mac80211.h ieee80211_smps_mode
491 </chapter>
492 </part>
493
494 <part id="rate-control">
495 <title>Rate control interface</title>
496 <partintro>
497 <para>TBD</para>
498 <para>
499 This part of the book describes the rate control algorithm
500 interface and how it relates to mac80211 and drivers.
501 </para>
502 </partintro>
503 <chapter id="ratecontrol-api">
504 <title>Rate Control API</title>
505 <para>TBD</para>
506!Finclude/net/mac80211.h ieee80211_start_tx_ba_session
507!Finclude/net/mac80211.h ieee80211_start_tx_ba_cb_irqsafe
508!Finclude/net/mac80211.h ieee80211_stop_tx_ba_session
509!Finclude/net/mac80211.h ieee80211_stop_tx_ba_cb_irqsafe
510!Finclude/net/mac80211.h rate_control_changed
511!Finclude/net/mac80211.h ieee80211_tx_rate_control
512!Finclude/net/mac80211.h rate_control_send_low
513 </chapter>
514 </part>
515
516 <part id="internal">
517 <title>Internals</title>
518 <partintro>
519 <para>TBD</para>
520 <para>
521 This part of the book describes mac80211 internals.
522 </para>
523 </partintro>
524
525 <chapter id="key-handling">
526 <title>Key handling</title>
527 <sect1>
528 <title>Key handling basics</title>
529!Pnet/mac80211/key.c Key handling basics
530 </sect1>
531 <sect1>
532 <title>MORE TBD</title>
533 <para>TBD</para>
534 </sect1>
535 </chapter>
536
537 <chapter id="rx-processing">
538 <title>Receive processing</title>
539 <para>TBD</para>
540 </chapter>
541
542 <chapter id="tx-processing">
543 <title>Transmit processing</title>
544 <para>TBD</para>
545 </chapter>
546
547 <chapter id="sta-info">
548 <title>Station info handling</title>
549 <sect1>
550 <title>Programming information</title>
551!Fnet/mac80211/sta_info.h sta_info
552!Fnet/mac80211/sta_info.h ieee80211_sta_info_flags
553 </sect1>
554 <sect1>
555 <title>STA information lifetime rules</title>
556!Pnet/mac80211/sta_info.c STA information lifetime rules
557 </sect1>
558 </chapter>
559
560 <chapter id="aggregation-internals">
561 <title>Aggregation</title>
562!Fnet/mac80211/sta_info.h sta_ampdu_mlme
563!Fnet/mac80211/sta_info.h tid_ampdu_tx
564!Fnet/mac80211/sta_info.h tid_ampdu_rx
565 </chapter>
566
567 <chapter id="synchronisation">
568 <title>Synchronisation</title>
569 <para>TBD</para>
570 <para>Locking, lots of RCU</para>
571 </chapter>
572 </part>
573 </book>
574</set>
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index 34929f24c284..3cebfa0d1611 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -12,7 +12,7 @@ DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \
12 kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ 12 kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \
13 gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ 13 gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
14 genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ 14 genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
15 mac80211.xml debugobjects.xml sh.xml regulator.xml \ 15 80211.xml debugobjects.xml sh.xml regulator.xml \
16 alsa-driver-api.xml writing-an-alsa-driver.xml \ 16 alsa-driver-api.xml writing-an-alsa-driver.xml \
17 tracepoint.xml media.xml drm.xml 17 tracepoint.xml media.xml drm.xml
18 18
@@ -53,7 +53,9 @@ MAN := $(patsubst %.xml, %.9, $(BOOKS))
53mandocs: $(MAN) 53mandocs: $(MAN)
54 54
55build_images = mkdir -p $(objtree)/Documentation/DocBook/media/ && \ 55build_images = mkdir -p $(objtree)/Documentation/DocBook/media/ && \
56 cp $(srctree)/Documentation/DocBook/dvb/*.png $(srctree)/Documentation/DocBook/v4l/*.gif $(objtree)/Documentation/DocBook/media/ 56 cp $(srctree)/Documentation/DocBook/dvb/*.png \
57 $(srctree)/Documentation/DocBook/v4l/*.gif \
58 $(objtree)/Documentation/DocBook/media/
57 59
58xmldoclinks: 60xmldoclinks:
59ifneq ($(objtree),$(srctree)) 61ifneq ($(objtree),$(srctree))
@@ -71,7 +73,7 @@ installmandocs: mandocs
71### 73###
72#External programs used 74#External programs used
73KERNELDOC = $(srctree)/scripts/kernel-doc 75KERNELDOC = $(srctree)/scripts/kernel-doc
74DOCPROC = $(objtree)/scripts/basic/docproc 76DOCPROC = $(objtree)/scripts/docproc
75 77
76XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl 78XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl
77XMLTOFLAGS += --skip-validation 79XMLTOFLAGS += --skip-validation
diff --git a/Documentation/DocBook/device-drivers.tmpl b/Documentation/DocBook/device-drivers.tmpl
index feca0758391e..b638e50cf8f6 100644
--- a/Documentation/DocBook/device-drivers.tmpl
+++ b/Documentation/DocBook/device-drivers.tmpl
@@ -51,8 +51,13 @@
51 <sect1><title>Delaying, scheduling, and timer routines</title> 51 <sect1><title>Delaying, scheduling, and timer routines</title>
52!Iinclude/linux/sched.h 52!Iinclude/linux/sched.h
53!Ekernel/sched.c 53!Ekernel/sched.c
54!Iinclude/linux/completion.h
54!Ekernel/timer.c 55!Ekernel/timer.c
55 </sect1> 56 </sect1>
57 <sect1><title>Wait queues and Wake events</title>
58!Iinclude/linux/wait.h
59!Ekernel/wait.c
60 </sect1>
56 <sect1><title>High-resolution timers</title> 61 <sect1><title>High-resolution timers</title>
57!Iinclude/linux/ktime.h 62!Iinclude/linux/ktime.h
58!Iinclude/linux/hrtimer.h 63!Iinclude/linux/hrtimer.h
@@ -91,10 +96,10 @@ X!Iinclude/linux/kobject.h
91 96
92 <chapter id="devdrivers"> 97 <chapter id="devdrivers">
93 <title>Device drivers infrastructure</title> 98 <title>Device drivers infrastructure</title>
99 <sect1><title>The Basic Device Driver-Model Structures </title>
100!Iinclude/linux/device.h
101 </sect1>
94 <sect1><title>Device Drivers Base</title> 102 <sect1><title>Device Drivers Base</title>
95<!--
96X!Iinclude/linux/device.h
97-->
98!Edrivers/base/driver.c 103!Edrivers/base/driver.c
99!Edrivers/base/core.c 104!Edrivers/base/core.c
100!Edrivers/base/class.c 105!Edrivers/base/class.c
@@ -212,8 +217,8 @@ X!Isound/sound_firmware.c
212 <chapter id="uart16x50"> 217 <chapter id="uart16x50">
213 <title>16x50 UART Driver</title> 218 <title>16x50 UART Driver</title>
214!Iinclude/linux/serial_core.h 219!Iinclude/linux/serial_core.h
215!Edrivers/serial/serial_core.c 220!Edrivers/tty/serial/serial_core.c
216!Edrivers/serial/8250.c 221!Edrivers/tty/serial/8250.c
217 </chapter> 222 </chapter>
218 223
219 <chapter id="fbdev"> 224 <chapter id="fbdev">
@@ -299,6 +304,10 @@ X!Idrivers/video/console/fonts.c
299!Edrivers/input/ff-core.c 304!Edrivers/input/ff-core.c
300!Edrivers/input/ff-memless.c 305!Edrivers/input/ff-memless.c
301 </sect1> 306 </sect1>
307 <sect1><title>Multitouch Library</title>
308!Iinclude/linux/input/mt.h
309!Edrivers/input/input-mt.c
310 </sect1>
302 <sect1><title>Polled input devices</title> 311 <sect1><title>Polled input devices</title>
303!Iinclude/linux/input-polldev.h 312!Iinclude/linux/input-polldev.h
304!Edrivers/input/input-polldev.c 313!Edrivers/input/input-polldev.c
diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl
index 910c923a9b86..c27915893974 100644
--- a/Documentation/DocBook/drm.tmpl
+++ b/Documentation/DocBook/drm.tmpl
@@ -73,8 +73,8 @@
73 services. 73 services.
74 </para> 74 </para>
75 <para> 75 <para>
76 The core of every DRM driver is struct drm_device. Drivers 76 The core of every DRM driver is struct drm_driver. Drivers
77 will typically statically initialize a drm_device structure, 77 will typically statically initialize a drm_driver structure,
78 then pass it to drm_init() at load time. 78 then pass it to drm_init() at load time.
79 </para> 79 </para>
80 80
@@ -84,7 +84,7 @@
84 <title>Driver initialization</title> 84 <title>Driver initialization</title>
85 <para> 85 <para>
86 Before calling the DRM initialization routines, the driver must 86 Before calling the DRM initialization routines, the driver must
87 first create and fill out a struct drm_device structure. 87 first create and fill out a struct drm_driver structure.
88 </para> 88 </para>
89 <programlisting> 89 <programlisting>
90 static struct drm_driver driver = { 90 static struct drm_driver driver = {
@@ -136,6 +136,7 @@
136#ifdef CONFIG_COMPAT 136#ifdef CONFIG_COMPAT
137 .compat_ioctl = i915_compat_ioctl, 137 .compat_ioctl = i915_compat_ioctl,
138#endif 138#endif
139 .llseek = noop_llseek,
139 }, 140 },
140 .pci_driver = { 141 .pci_driver = {
141 .name = DRIVER_NAME, 142 .name = DRIVER_NAME,
diff --git a/Documentation/DocBook/dvb/dvbapi.xml b/Documentation/DocBook/dvb/dvbapi.xml
index e3a97fdd62a6..9fad86ce7f5e 100644
--- a/Documentation/DocBook/dvb/dvbapi.xml
+++ b/Documentation/DocBook/dvb/dvbapi.xml
@@ -28,13 +28,21 @@
28 <holder>Convergence GmbH</holder> 28 <holder>Convergence GmbH</holder>
29</copyright> 29</copyright>
30<copyright> 30<copyright>
31 <year>2009-2010</year> 31 <year>2009-2011</year>
32 <holder>Mauro Carvalho Chehab</holder> 32 <holder>Mauro Carvalho Chehab</holder>
33</copyright> 33</copyright>
34 34
35<revhistory> 35<revhistory>
36<!-- Put document revisions here, newest first. --> 36<!-- Put document revisions here, newest first. -->
37<revision> 37<revision>
38 <revnumber>2.0.4</revnumber>
39 <date>2011-05-06</date>
40 <authorinitials>mcc</authorinitials>
41 <revremark>
42 Add more information about DVB APIv5, better describing the frontend GET/SET props ioctl's.
43 </revremark>
44</revision>
45<revision>
38 <revnumber>2.0.3</revnumber> 46 <revnumber>2.0.3</revnumber>
39 <date>2010-07-03</date> 47 <date>2010-07-03</date>
40 <authorinitials>mcc</authorinitials> 48 <authorinitials>mcc</authorinitials>
diff --git a/Documentation/DocBook/dvb/dvbproperty.xml b/Documentation/DocBook/dvb/dvbproperty.xml
index 5f57c7ccd4ba..b5365f61d69b 100644
--- a/Documentation/DocBook/dvb/dvbproperty.xml
+++ b/Documentation/DocBook/dvb/dvbproperty.xml
@@ -1,6 +1,330 @@
1<section id="FE_GET_PROPERTY"> 1<section id="FE_GET_SET_PROPERTY">
2<title>FE_GET_PROPERTY/FE_SET_PROPERTY</title> 2<title>FE_GET_PROPERTY/FE_SET_PROPERTY</title>
3 3
4<programlisting>
5/* Reserved fields should be set to 0 */
6struct dtv_property {
7 __u32 cmd;
8 union {
9 __u32 data;
10 struct {
11 __u8 data[32];
12 __u32 len;
13 __u32 reserved1[3];
14 void *reserved2;
15 } buffer;
16 } u;
17 int result;
18} __attribute__ ((packed));
19
20/* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */
21#define DTV_IOCTL_MAX_MSGS 64
22
23struct dtv_properties {
24 __u32 num;
25 struct dtv_property *props;
26};
27</programlisting>
28
29<section id="FE_GET_PROPERTY">
30<title>FE_GET_PROPERTY</title>
31<para>DESCRIPTION
32</para>
33<informaltable><tgroup cols="1"><tbody><row><entry
34 align="char">
35<para>This ioctl call returns one or more frontend properties. This call only
36 requires read-only access to the device.</para>
37</entry>
38 </row></tbody></tgroup></informaltable>
39<para>SYNOPSIS
40</para>
41<informaltable><tgroup cols="1"><tbody><row><entry
42 align="char">
43<para>int ioctl(int fd, int request = <link linkend="FE_GET_PROPERTY">FE_GET_PROPERTY</link>,
44 dtv_properties &#x22C6;props);</para>
45</entry>
46 </row></tbody></tgroup></informaltable>
47<para>PARAMETERS
48</para>
49<informaltable><tgroup cols="2"><tbody><row><entry align="char">
50<para>int fd</para>
51</entry><entry
52 align="char">
53<para>File descriptor returned by a previous call to open().</para>
54</entry>
55 </row><row><entry
56 align="char">
57<para>int num</para>
58</entry><entry
59 align="char">
60<para>Equals <link linkend="FE_GET_PROPERTY">FE_GET_PROPERTY</link> for this command.</para>
61</entry>
62 </row><row><entry
63 align="char">
64<para>struct dtv_property *props</para>
65</entry><entry
66 align="char">
67<para>Points to the location where the front-end property commands are stored.</para>
68</entry>
69 </row></tbody></tgroup></informaltable>
70<para>ERRORS</para>
71<informaltable><tgroup cols="2"><tbody><row>
72 <entry align="char"><para>EINVAL</para></entry>
73 <entry align="char"><para>Invalid parameter(s) received or number of parameters out of the range.</para></entry>
74 </row><row>
75 <entry align="char"><para>ENOMEM</para></entry>
76 <entry align="char"><para>Out of memory.</para></entry>
77 </row><row>
78 <entry align="char"><para>EFAULT</para></entry>
79 <entry align="char"><para>Failure while copying data from/to userspace.</para></entry>
80 </row><row>
81 <entry align="char"><para>EOPNOTSUPP</para></entry>
82 <entry align="char"><para>Property type not supported.</para></entry>
83 </row></tbody></tgroup></informaltable>
84</section>
85
86<section id="FE_SET_PROPERTY">
87<title>FE_SET_PROPERTY</title>
88<para>DESCRIPTION
89</para>
90<informaltable><tgroup cols="1"><tbody><row><entry
91 align="char">
92<para>This ioctl call sets one or more frontend properties. This call only
93 requires read-only access to the device.</para>
94</entry>
95 </row></tbody></tgroup></informaltable>
96<para>SYNOPSIS
97</para>
98<informaltable><tgroup cols="1"><tbody><row><entry
99 align="char">
100<para>int ioctl(int fd, int request = <link linkend="FE_SET_PROPERTY">FE_SET_PROPERTY</link>,
101 dtv_properties &#x22C6;props);</para>
102</entry>
103 </row></tbody></tgroup></informaltable>
104<para>PARAMETERS
105</para>
106<informaltable><tgroup cols="2"><tbody><row><entry align="char">
107<para>int fd</para>
108</entry><entry
109 align="char">
110<para>File descriptor returned by a previous call to open().</para>
111</entry>
112 </row><row><entry
113 align="char">
114<para>int num</para>
115</entry><entry
116 align="char">
117<para>Equals <link linkend="FE_SET_PROPERTY">FE_SET_PROPERTY</link> for this command.</para>
118</entry>
119 </row><row><entry
120 align="char">
121<para>struct dtv_property *props</para>
122</entry><entry
123 align="char">
124<para>Points to the location where the front-end property commands are stored.</para>
125</entry>
126 </row></tbody></tgroup></informaltable>
127<para>ERRORS
128</para>
129<informaltable><tgroup cols="2"><tbody><row>
130 <entry align="char"><para>EINVAL</para></entry>
131 <entry align="char"><para>Invalid parameter(s) received or number of parameters out of the range.</para></entry>
132 </row><row>
133 <entry align="char"><para>ENOMEM</para></entry>
134 <entry align="char"><para>Out of memory.</para></entry>
135 </row><row>
136 <entry align="char"><para>EFAULT</para></entry>
137 <entry align="char"><para>Failure while copying data from/to userspace.</para></entry>
138 </row><row>
139 <entry align="char"><para>EOPNOTSUPP</para></entry>
140 <entry align="char"><para>Property type not supported.</para></entry>
141 </row></tbody></tgroup></informaltable>
142</section>
143
144<section>
145 <title>Property types</title>
146<para>
147On <link linkend="FE_GET_PROPERTY">FE_GET_PROPERTY</link>/<link linkend="FE_SET_PROPERTY">FE_SET_PROPERTY</link>,
148the actual action is determined by the dtv_property cmd/data pairs. With one single ioctl, is possible to
149get/set up to 64 properties. The actual meaning of each property is described on the next sections.
150</para>
151
152<para>The available frontend property types are:</para>
153<programlisting>
154#define DTV_UNDEFINED 0
155#define DTV_TUNE 1
156#define DTV_CLEAR 2
157#define DTV_FREQUENCY 3
158#define DTV_MODULATION 4
159#define DTV_BANDWIDTH_HZ 5
160#define DTV_INVERSION 6
161#define DTV_DISEQC_MASTER 7
162#define DTV_SYMBOL_RATE 8
163#define DTV_INNER_FEC 9
164#define DTV_VOLTAGE 10
165#define DTV_TONE 11
166#define DTV_PILOT 12
167#define DTV_ROLLOFF 13
168#define DTV_DISEQC_SLAVE_REPLY 14
169#define DTV_FE_CAPABILITY_COUNT 15
170#define DTV_FE_CAPABILITY 16
171#define DTV_DELIVERY_SYSTEM 17
172#define DTV_ISDBT_PARTIAL_RECEPTION 18
173#define DTV_ISDBT_SOUND_BROADCASTING 19
174#define DTV_ISDBT_SB_SUBCHANNEL_ID 20
175#define DTV_ISDBT_SB_SEGMENT_IDX 21
176#define DTV_ISDBT_SB_SEGMENT_COUNT 22
177#define DTV_ISDBT_LAYERA_FEC 23
178#define DTV_ISDBT_LAYERA_MODULATION 24
179#define DTV_ISDBT_LAYERA_SEGMENT_COUNT 25
180#define DTV_ISDBT_LAYERA_TIME_INTERLEAVING 26
181#define DTV_ISDBT_LAYERB_FEC 27
182#define DTV_ISDBT_LAYERB_MODULATION 28
183#define DTV_ISDBT_LAYERB_SEGMENT_COUNT 29
184#define DTV_ISDBT_LAYERB_TIME_INTERLEAVING 30
185#define DTV_ISDBT_LAYERC_FEC 31
186#define DTV_ISDBT_LAYERC_MODULATION 32
187#define DTV_ISDBT_LAYERC_SEGMENT_COUNT 33
188#define DTV_ISDBT_LAYERC_TIME_INTERLEAVING 34
189#define DTV_API_VERSION 35
190#define DTV_CODE_RATE_HP 36
191#define DTV_CODE_RATE_LP 37
192#define DTV_GUARD_INTERVAL 38
193#define DTV_TRANSMISSION_MODE 39
194#define DTV_HIERARCHY 40
195#define DTV_ISDBT_LAYER_ENABLED 41
196#define DTV_ISDBS_TS_ID 42
197</programlisting>
198</section>
199
200<section id="fe_property_common">
201 <title>Parameters that are common to all Digital TV standards</title>
202 <section id="DTV_FREQUENCY">
203 <title><constant>DTV_FREQUENCY</constant></title>
204
205 <para>Central frequency of the channel, in HZ.</para>
206
207 <para>Notes:</para>
208 <para>1)For ISDB-T, the channels are usually transmitted with an offset of 143kHz.
209 E.g. a valid frequncy could be 474143 kHz. The stepping is bound to the bandwidth of
210 the channel which is 6MHz.</para>
211
212 <para>2)As in ISDB-Tsb the channel consists of only one or three segments the
213 frequency step is 429kHz, 3*429 respectively. As for ISDB-T the
214 central frequency of the channel is expected.</para>
215 </section>
216
217 <section id="DTV_BANDWIDTH_HZ">
218 <title><constant>DTV_BANDWIDTH_HZ</constant></title>
219
220 <para>Bandwidth for the channel, in HZ.</para>
221
222 <para>Possible values:
223 <constant>1712000</constant>,
224 <constant>5000000</constant>,
225 <constant>6000000</constant>,
226 <constant>7000000</constant>,
227 <constant>8000000</constant>,
228 <constant>10000000</constant>.
229 </para>
230
231 <para>Notes:</para>
232
233 <para>1) For ISDB-T it should be always 6000000Hz (6MHz)</para>
234 <para>2) For ISDB-Tsb it can vary depending on the number of connected segments</para>
235 <para>3) Bandwidth doesn't apply for DVB-C transmissions, as the bandwidth
236 for DVB-C depends on the symbol rate</para>
237 <para>4) Bandwidth in ISDB-T is fixed (6MHz) or can be easily derived from
238 other parameters (DTV_ISDBT_SB_SEGMENT_IDX,
239 DTV_ISDBT_SB_SEGMENT_COUNT).</para>
240 <para>5) DVB-T supports 6, 7 and 8MHz.</para>
241 <para>6) In addition, DVB-T2 supports 1.172, 5 and 10MHz.</para>
242 </section>
243
244 <section id="DTV_DELIVERY_SYSTEM">
245 <title><constant>DTV_DELIVERY_SYSTEM</constant></title>
246
247 <para>Specifies the type of Delivery system</para>
248
249 <para>Possible values: </para>
250<programlisting>
251typedef enum fe_delivery_system {
252 SYS_UNDEFINED,
253 SYS_DVBC_ANNEX_AC,
254 SYS_DVBC_ANNEX_B,
255 SYS_DVBT,
256 SYS_DSS,
257 SYS_DVBS,
258 SYS_DVBS2,
259 SYS_DVBH,
260 SYS_ISDBT,
261 SYS_ISDBS,
262 SYS_ISDBC,
263 SYS_ATSC,
264 SYS_ATSCMH,
265 SYS_DMBTH,
266 SYS_CMMB,
267 SYS_DAB,
268 SYS_DVBT2,
269} fe_delivery_system_t;
270</programlisting>
271
272 </section>
273
274 <section id="DTV_TRANSMISSION_MODE">
275 <title><constant>DTV_TRANSMISSION_MODE</constant></title>
276
277 <para>Specifies the number of carriers used by the standard</para>
278
279 <para>Possible values are:</para>
280<programlisting>
281typedef enum fe_transmit_mode {
282 TRANSMISSION_MODE_2K,
283 TRANSMISSION_MODE_8K,
284 TRANSMISSION_MODE_AUTO,
285 TRANSMISSION_MODE_4K,
286 TRANSMISSION_MODE_1K,
287 TRANSMISSION_MODE_16K,
288 TRANSMISSION_MODE_32K,
289} fe_transmit_mode_t;
290</programlisting>
291
292 <para>Notes:</para>
293 <para>1) ISDB-T supports three carrier/symbol-size: 8K, 4K, 2K. It is called
294 'mode' in the standard: Mode 1 is 2K, mode 2 is 4K, mode 3 is 8K</para>
295
296 <para>2) If <constant>DTV_TRANSMISSION_MODE</constant> is set the <constant>TRANSMISSION_MODE_AUTO</constant> the
297 hardware will try to find the correct FFT-size (if capable) and will
298 use TMCC to fill in the missing parameters.</para>
299 <para>3) DVB-T specifies 2K and 8K as valid sizes.</para>
300 <para>4) DVB-T2 specifies 1K, 2K, 4K, 8K, 16K and 32K.</para>
301 </section>
302
303 <section id="DTV_GUARD_INTERVAL">
304 <title><constant>DTV_GUARD_INTERVAL</constant></title>
305
306 <para>Possible values are:</para>
307<programlisting>
308typedef enum fe_guard_interval {
309 GUARD_INTERVAL_1_32,
310 GUARD_INTERVAL_1_16,
311 GUARD_INTERVAL_1_8,
312 GUARD_INTERVAL_1_4,
313 GUARD_INTERVAL_AUTO,
314 GUARD_INTERVAL_1_128,
315 GUARD_INTERVAL_19_128,
316 GUARD_INTERVAL_19_256,
317} fe_guard_interval_t;
318</programlisting>
319
320 <para>Notes:</para>
321 <para>1) If <constant>DTV_GUARD_INTERVAL</constant> is set the <constant>GUARD_INTERVAL_AUTO</constant> the hardware will
322 try to find the correct guard interval (if capable) and will use TMCC to fill
323 in the missing parameters.</para>
324 <para>2) Intervals 1/128, 19/128 and 19/256 are used only for DVB-T2 at present</para>
325 </section>
326</section>
327
4<section id="isdbt"> 328<section id="isdbt">
5 <title>ISDB-T frontend</title> 329 <title>ISDB-T frontend</title>
6 <para>This section describes shortly what are the possible parameters in the Linux 330 <para>This section describes shortly what are the possible parameters in the Linux
@@ -32,73 +356,6 @@
32 356
33 <para>Parameters used by ISDB-T and ISDB-Tsb.</para> 357 <para>Parameters used by ISDB-T and ISDB-Tsb.</para>
34 358
35 <section id="isdbt-parms">
36 <title>Parameters that are common with DVB-T and ATSC</title>
37
38 <section id="isdbt-freq">
39 <title><constant>DTV_FREQUENCY</constant></title>
40
41 <para>Central frequency of the channel.</para>
42
43 <para>For ISDB-T the channels are usally transmitted with an offset of 143kHz. E.g. a
44 valid frequncy could be 474143 kHz. The stepping is bound to the bandwidth of
45 the channel which is 6MHz.</para>
46
47 <para>As in ISDB-Tsb the channel consists of only one or three segments the
48 frequency step is 429kHz, 3*429 respectively. As for ISDB-T the
49 central frequency of the channel is expected.</para>
50 </section>
51
52 <section id="isdbt-bw">
53 <title><constant>DTV_BANDWIDTH_HZ</constant> (optional)</title>
54
55 <para>Possible values:</para>
56
57 <para>For ISDB-T it should be always 6000000Hz (6MHz)</para>
58 <para>For ISDB-Tsb it can vary depending on the number of connected segments</para>
59
60 <para>Note: Hardware specific values might be given here, but standard
61 applications should not bother to set a value to this field as
62 standard demods are ignoring it anyway.</para>
63
64 <para>Bandwidth in ISDB-T is fixed (6MHz) or can be easily derived from
65 other parameters (DTV_ISDBT_SB_SEGMENT_IDX,
66 DTV_ISDBT_SB_SEGMENT_COUNT).</para>
67 </section>
68
69 <section id="isdbt-delivery-sys">
70 <title><constant>DTV_DELIVERY_SYSTEM</constant></title>
71
72 <para>Possible values: <constant>SYS_ISDBT</constant></para>
73 </section>
74
75 <section id="isdbt-tx-mode">
76 <title><constant>DTV_TRANSMISSION_MODE</constant></title>
77
78 <para>ISDB-T supports three carrier/symbol-size: 8K, 4K, 2K. It is called
79 'mode' in the standard: Mode 1 is 2K, mode 2 is 4K, mode 3 is 8K</para>
80
81 <para>Possible values: <constant>TRANSMISSION_MODE_2K</constant>, <constant>TRANSMISSION_MODE_8K</constant>,
82 <constant>TRANSMISSION_MODE_AUTO</constant>, <constant>TRANSMISSION_MODE_4K</constant></para>
83
84 <para>If <constant>DTV_TRANSMISSION_MODE</constant> is set the <constant>TRANSMISSION_MODE_AUTO</constant> the
85 hardware will try to find the correct FFT-size (if capable) and will
86 use TMCC to fill in the missing parameters.</para>
87
88 <para><constant>TRANSMISSION_MODE_4K</constant> is added at the same time as the other new parameters.</para>
89 </section>
90
91 <section id="isdbt-guard-interval">
92 <title><constant>DTV_GUARD_INTERVAL</constant></title>
93
94 <para>Possible values: <constant>GUARD_INTERVAL_1_32</constant>, <constant>GUARD_INTERVAL_1_16</constant>, <constant>GUARD_INTERVAL_1_8</constant>,
95 <constant>GUARD_INTERVAL_1_4</constant>, <constant>GUARD_INTERVAL_AUTO</constant></para>
96
97 <para>If <constant>DTV_GUARD_INTERVAL</constant> is set the <constant>GUARD_INTERVAL_AUTO</constant> the hardware will
98 try to find the correct guard interval (if capable) and will use TMCC to fill
99 in the missing parameters.</para>
100 </section>
101 </section>
102 <section id="isdbt-new-parms"> 359 <section id="isdbt-new-parms">
103 <title>ISDB-T only parameters</title> 360 <title>ISDB-T only parameters</title>
104 361
@@ -314,5 +571,20 @@
314 </section> 571 </section>
315 </section> 572 </section>
316 </section> 573 </section>
574 <section id="dvbt2-params">
575 <title>DVB-T2 parameters</title>
576
577 <para>This section covers parameters that apply only to the DVB-T2 delivery method. DVB-T2
578 support is currently in the early stages development so expect this section to grow
579 and become more detailed with time.</para>
580
581 <section id="dvbt2-plp-id">
582 <title><constant>DTV_DVBT2_PLP_ID</constant></title>
583
584 <para>DVB-T2 supports Physical Layer Pipes (PLP) to allow transmission of
585 many data types via a single multiplex. The API will soon support this
586 at which point this section will be expanded.</para>
587 </section>
588 </section>
317</section> 589</section>
318</section> 590</section>
diff --git a/Documentation/DocBook/dvb/frontend.h.xml b/Documentation/DocBook/dvb/frontend.h.xml
index d08e0d401418..d792f789ad3b 100644
--- a/Documentation/DocBook/dvb/frontend.h.xml
+++ b/Documentation/DocBook/dvb/frontend.h.xml
@@ -176,14 +176,20 @@ typedef enum fe_transmit_mode {
176 TRANSMISSION_MODE_2K, 176 TRANSMISSION_MODE_2K,
177 TRANSMISSION_MODE_8K, 177 TRANSMISSION_MODE_8K,
178 TRANSMISSION_MODE_AUTO, 178 TRANSMISSION_MODE_AUTO,
179 TRANSMISSION_MODE_4K 179 TRANSMISSION_MODE_4K,
180 TRANSMISSION_MODE_1K,
181 TRANSMISSION_MODE_16K,
182 TRANSMISSION_MODE_32K,
180} fe_transmit_mode_t; 183} fe_transmit_mode_t;
181 184
182typedef enum fe_bandwidth { 185typedef enum fe_bandwidth {
183 BANDWIDTH_8_MHZ, 186 BANDWIDTH_8_MHZ,
184 BANDWIDTH_7_MHZ, 187 BANDWIDTH_7_MHZ,
185 BANDWIDTH_6_MHZ, 188 BANDWIDTH_6_MHZ,
186 BANDWIDTH_AUTO 189 BANDWIDTH_AUTO,
190 BANDWIDTH_5_MHZ,
191 BANDWIDTH_10_MHZ,
192 BANDWIDTH_1_712_MHZ,
187} fe_bandwidth_t; 193} fe_bandwidth_t;
188 194
189 195
@@ -192,7 +198,10 @@ typedef enum fe_guard_interval {
192 GUARD_INTERVAL_1_16, 198 GUARD_INTERVAL_1_16,
193 GUARD_INTERVAL_1_8, 199 GUARD_INTERVAL_1_8,
194 GUARD_INTERVAL_1_4, 200 GUARD_INTERVAL_1_4,
195 GUARD_INTERVAL_AUTO 201 GUARD_INTERVAL_AUTO,
202 GUARD_INTERVAL_1_128,
203 GUARD_INTERVAL_19_128,
204 GUARD_INTERVAL_19_256,
196} fe_guard_interval_t; 205} fe_guard_interval_t;
197 206
198 207
@@ -306,7 +315,9 @@ struct dvb_frontend_event {
306 315
307#define DTV_ISDBS_TS_ID 42 316#define DTV_ISDBS_TS_ID 42
308 317
309#define DTV_MAX_COMMAND DTV_ISDBS_TS_ID 318#define DTV_DVBT2_PLP_ID 43
319
320#define DTV_MAX_COMMAND DTV_DVBT2_PLP_ID
310 321
311typedef enum fe_pilot { 322typedef enum fe_pilot {
312 PILOT_ON, 323 PILOT_ON,
@@ -338,6 +349,7 @@ typedef enum fe_delivery_system {
338 SYS_DMBTH, 349 SYS_DMBTH,
339 SYS_CMMB, 350 SYS_CMMB,
340 SYS_DAB, 351 SYS_DAB,
352 SYS_DVBT2,
341} fe_delivery_system_t; 353} fe_delivery_system_t;
342 354
343struct dtv_cmds_h { 355struct dtv_cmds_h {
diff --git a/Documentation/DocBook/dvb/frontend.xml b/Documentation/DocBook/dvb/frontend.xml
index 78d756de5906..60c6976fb311 100644
--- a/Documentation/DocBook/dvb/frontend.xml
+++ b/Documentation/DocBook/dvb/frontend.xml
@@ -139,7 +139,7 @@ consistently to the DiSEqC commands as described in the DiSEqC spec.</para>
139<section id="frontend_sec_tone"> 139<section id="frontend_sec_tone">
140<title>SEC continuous tone</title> 140<title>SEC continuous tone</title>
141 141
142<para>The continous 22KHz tone is usually used with non-DiSEqC capable LNBs to switch the 142<para>The continuous 22KHz tone is usually used with non-DiSEqC capable LNBs to switch the
143high/low band of a dual-band LNB. When using DiSEqC epuipment this voltage has to 143high/low band of a dual-band LNB. When using DiSEqC epuipment this voltage has to
144be switched consistently to the DiSEqC commands as described in the DiSEqC 144be switched consistently to the DiSEqC commands as described in the DiSEqC
145spec.</para> 145spec.</para>
diff --git a/Documentation/DocBook/filesystems.tmpl b/Documentation/DocBook/filesystems.tmpl
index 5e87ad58c0b5..f51f28531b8d 100644
--- a/Documentation/DocBook/filesystems.tmpl
+++ b/Documentation/DocBook/filesystems.tmpl
@@ -82,6 +82,11 @@
82 </sect1> 82 </sect1>
83 </chapter> 83 </chapter>
84 84
85 <chapter id="fs_events">
86 <title>Events based on file descriptors</title>
87!Efs/eventfd.c
88 </chapter>
89
85 <chapter id="sysfs"> 90 <chapter id="sysfs">
86 <title>The Filesystem for Exporting Kernel Objects</title> 91 <title>The Filesystem for Exporting Kernel Objects</title>
87!Efs/sysfs/file.c 92!Efs/sysfs/file.c
diff --git a/Documentation/DocBook/genericirq.tmpl b/Documentation/DocBook/genericirq.tmpl
index 1448b33fd222..b3422341d65c 100644
--- a/Documentation/DocBook/genericirq.tmpl
+++ b/Documentation/DocBook/genericirq.tmpl
@@ -28,7 +28,7 @@
28 </authorgroup> 28 </authorgroup>
29 29
30 <copyright> 30 <copyright>
31 <year>2005-2006</year> 31 <year>2005-2010</year>
32 <holder>Thomas Gleixner</holder> 32 <holder>Thomas Gleixner</holder>
33 </copyright> 33 </copyright>
34 <copyright> 34 <copyright>
@@ -100,6 +100,10 @@
100 <listitem><para>Edge type</para></listitem> 100 <listitem><para>Edge type</para></listitem>
101 <listitem><para>Simple type</para></listitem> 101 <listitem><para>Simple type</para></listitem>
102 </itemizedlist> 102 </itemizedlist>
103 During the implementation we identified another type:
104 <itemizedlist>
105 <listitem><para>Fast EOI type</para></listitem>
106 </itemizedlist>
103 In the SMP world of the __do_IRQ() super-handler another type 107 In the SMP world of the __do_IRQ() super-handler another type
104 was identified: 108 was identified:
105 <itemizedlist> 109 <itemizedlist>
@@ -153,6 +157,7 @@
153 is still available. This leads to a kind of duality for the time 157 is still available. This leads to a kind of duality for the time
154 being. Over time the new model should be used in more and more 158 being. Over time the new model should be used in more and more
155 architectures, as it enables smaller and cleaner IRQ subsystems. 159 architectures, as it enables smaller and cleaner IRQ subsystems.
160 It's deprecated for three years now and about to be removed.
156 </para> 161 </para>
157 </chapter> 162 </chapter>
158 <chapter id="bugs"> 163 <chapter id="bugs">
@@ -186,8 +191,8 @@
186 <para> 191 <para>
187 Whenever an interrupt triggers, the lowlevel arch code calls into 192 Whenever an interrupt triggers, the lowlevel arch code calls into
188 the generic interrupt code by calling desc->handle_irq(). 193 the generic interrupt code by calling desc->handle_irq().
189 This highlevel IRQ handling function only uses desc->chip primitives 194 This highlevel IRQ handling function only uses desc->irq_data.chip
190 referenced by the assigned chip descriptor structure. 195 primitives referenced by the assigned chip descriptor structure.
191 </para> 196 </para>
192 </sect1> 197 </sect1>
193 <sect1 id="Highlevel_Driver_API"> 198 <sect1 id="Highlevel_Driver_API">
@@ -201,11 +206,11 @@
201 <listitem><para>enable_irq()</para></listitem> 206 <listitem><para>enable_irq()</para></listitem>
202 <listitem><para>disable_irq_nosync() (SMP only)</para></listitem> 207 <listitem><para>disable_irq_nosync() (SMP only)</para></listitem>
203 <listitem><para>synchronize_irq() (SMP only)</para></listitem> 208 <listitem><para>synchronize_irq() (SMP only)</para></listitem>
204 <listitem><para>set_irq_type()</para></listitem> 209 <listitem><para>irq_set_irq_type()</para></listitem>
205 <listitem><para>set_irq_wake()</para></listitem> 210 <listitem><para>irq_set_irq_wake()</para></listitem>
206 <listitem><para>set_irq_data()</para></listitem> 211 <listitem><para>irq_set_handler_data()</para></listitem>
207 <listitem><para>set_irq_chip()</para></listitem> 212 <listitem><para>irq_set_chip()</para></listitem>
208 <listitem><para>set_irq_chip_data()</para></listitem> 213 <listitem><para>irq_set_chip_data()</para></listitem>
209 </itemizedlist> 214 </itemizedlist>
210 See the autogenerated function documentation for details. 215 See the autogenerated function documentation for details.
211 </para> 216 </para>
@@ -217,8 +222,11 @@
217 <itemizedlist> 222 <itemizedlist>
218 <listitem><para>handle_level_irq</para></listitem> 223 <listitem><para>handle_level_irq</para></listitem>
219 <listitem><para>handle_edge_irq</para></listitem> 224 <listitem><para>handle_edge_irq</para></listitem>
225 <listitem><para>handle_fasteoi_irq</para></listitem>
220 <listitem><para>handle_simple_irq</para></listitem> 226 <listitem><para>handle_simple_irq</para></listitem>
221 <listitem><para>handle_percpu_irq</para></listitem> 227 <listitem><para>handle_percpu_irq</para></listitem>
228 <listitem><para>handle_edge_eoi_irq</para></listitem>
229 <listitem><para>handle_bad_irq</para></listitem>
222 </itemizedlist> 230 </itemizedlist>
223 The interrupt flow handlers (either predefined or architecture 231 The interrupt flow handlers (either predefined or architecture
224 specific) are assigned to specific interrupts by the architecture 232 specific) are assigned to specific interrupts by the architecture
@@ -233,33 +241,33 @@
233 are used by the default flow implementations. 241 are used by the default flow implementations.
234 The following helper functions are implemented (simplified excerpt): 242 The following helper functions are implemented (simplified excerpt):
235 <programlisting> 243 <programlisting>
236default_enable(irq) 244default_enable(struct irq_data *data)
237{ 245{
238 desc->chip->unmask(irq); 246 desc->irq_data.chip->irq_unmask(data);
239} 247}
240 248
241default_disable(irq) 249default_disable(struct irq_data *data)
242{ 250{
243 if (!delay_disable(irq)) 251 if (!delay_disable(data))
244 desc->chip->mask(irq); 252 desc->irq_data.chip->irq_mask(data);
245} 253}
246 254
247default_ack(irq) 255default_ack(struct irq_data *data)
248{ 256{
249 chip->ack(irq); 257 chip->irq_ack(data);
250} 258}
251 259
252default_mask_ack(irq) 260default_mask_ack(struct irq_data *data)
253{ 261{
254 if (chip->mask_ack) { 262 if (chip->irq_mask_ack) {
255 chip->mask_ack(irq); 263 chip->irq_mask_ack(data);
256 } else { 264 } else {
257 chip->mask(irq); 265 chip->irq_mask(data);
258 chip->ack(irq); 266 chip->irq_ack(data);
259 } 267 }
260} 268}
261 269
262noop(irq) 270noop(struct irq_data *data))
263{ 271{
264} 272}
265 273
@@ -278,12 +286,27 @@ noop(irq)
278 <para> 286 <para>
279 The following control flow is implemented (simplified excerpt): 287 The following control flow is implemented (simplified excerpt):
280 <programlisting> 288 <programlisting>
281desc->chip->start(); 289desc->irq_data.chip->irq_mask_ack();
282handle_IRQ_event(desc->action); 290handle_irq_event(desc->action);
283desc->chip->end(); 291desc->irq_data.chip->irq_unmask();
284 </programlisting> 292 </programlisting>
285 </para> 293 </para>
286 </sect3> 294 </sect3>
295 <sect3 id="Default_FASTEOI_IRQ_flow_handler">
296 <title>Default Fast EOI IRQ flow handler</title>
297 <para>
298 handle_fasteoi_irq provides a generic implementation
299 for interrupts, which only need an EOI at the end of
300 the handler
301 </para>
302 <para>
303 The following control flow is implemented (simplified excerpt):
304 <programlisting>
305handle_irq_event(desc->action);
306desc->irq_data.chip->irq_eoi();
307 </programlisting>
308 </para>
309 </sect3>
287 <sect3 id="Default_Edge_IRQ_flow_handler"> 310 <sect3 id="Default_Edge_IRQ_flow_handler">
288 <title>Default Edge IRQ flow handler</title> 311 <title>Default Edge IRQ flow handler</title>
289 <para> 312 <para>
@@ -294,20 +317,19 @@ desc->chip->end();
294 The following control flow is implemented (simplified excerpt): 317 The following control flow is implemented (simplified excerpt):
295 <programlisting> 318 <programlisting>
296if (desc->status &amp; running) { 319if (desc->status &amp; running) {
297 desc->chip->hold(); 320 desc->irq_data.chip->irq_mask_ack();
298 desc->status |= pending | masked; 321 desc->status |= pending | masked;
299 return; 322 return;
300} 323}
301desc->chip->start(); 324desc->irq_data.chip->irq_ack();
302desc->status |= running; 325desc->status |= running;
303do { 326do {
304 if (desc->status &amp; masked) 327 if (desc->status &amp; masked)
305 desc->chip->enable(); 328 desc->irq_data.chip->irq_unmask();
306 desc->status &amp;= ~pending; 329 desc->status &amp;= ~pending;
307 handle_IRQ_event(desc->action); 330 handle_irq_event(desc->action);
308} while (status &amp; pending); 331} while (status &amp; pending);
309desc->status &amp;= ~running; 332desc->status &amp;= ~running;
310desc->chip->end();
311 </programlisting> 333 </programlisting>
312 </para> 334 </para>
313 </sect3> 335 </sect3>
@@ -324,7 +346,7 @@ desc->chip->end();
324 <para> 346 <para>
325 The following control flow is implemented (simplified excerpt): 347 The following control flow is implemented (simplified excerpt):
326 <programlisting> 348 <programlisting>
327handle_IRQ_event(desc->action); 349handle_irq_event(desc->action);
328 </programlisting> 350 </programlisting>
329 </para> 351 </para>
330 </sect3> 352 </sect3>
@@ -342,12 +364,29 @@ handle_IRQ_event(desc->action);
342 <para> 364 <para>
343 The following control flow is implemented (simplified excerpt): 365 The following control flow is implemented (simplified excerpt):
344 <programlisting> 366 <programlisting>
345desc->chip->start(); 367if (desc->irq_data.chip->irq_ack)
346handle_IRQ_event(desc->action); 368 desc->irq_data.chip->irq_ack();
347desc->chip->end(); 369handle_irq_event(desc->action);
370if (desc->irq_data.chip->irq_eoi)
371 desc->irq_data.chip->irq_eoi();
348 </programlisting> 372 </programlisting>
349 </para> 373 </para>
350 </sect3> 374 </sect3>
375 <sect3 id="EOI_Edge_IRQ_flow_handler">
376 <title>EOI Edge IRQ flow handler</title>
377 <para>
378 handle_edge_eoi_irq provides an abnomination of the edge
379 handler which is solely used to tame a badly wreckaged
380 irq controller on powerpc/cell.
381 </para>
382 </sect3>
383 <sect3 id="BAD_IRQ_flow_handler">
384 <title>Bad IRQ flow handler</title>
385 <para>
386 handle_bad_irq is used for spurious interrupts which
387 have no real handler assigned..
388 </para>
389 </sect3>
351 </sect2> 390 </sect2>
352 <sect2 id="Quirks_and_optimizations"> 391 <sect2 id="Quirks_and_optimizations">
353 <title>Quirks and optimizations</title> 392 <title>Quirks and optimizations</title>
@@ -375,8 +414,7 @@ desc->chip->end();
375 mechanism. (It's necessary to enable CONFIG_HARDIRQS_SW_RESEND when 414 mechanism. (It's necessary to enable CONFIG_HARDIRQS_SW_RESEND when
376 you want to use the delayed interrupt disable feature and your 415 you want to use the delayed interrupt disable feature and your
377 hardware is not capable of retriggering an interrupt.) 416 hardware is not capable of retriggering an interrupt.)
378 The delayed interrupt disable can be runtime enabled, per interrupt, 417 The delayed interrupt disable is not configurable.
379 by setting the IRQ_DELAYED_DISABLE flag in the irq_desc status field.
380 </para> 418 </para>
381 </sect2> 419 </sect2>
382 </sect1> 420 </sect1>
@@ -387,13 +425,14 @@ desc->chip->end();
387 contains all the direct chip relevant functions, which 425 contains all the direct chip relevant functions, which
388 can be utilized by the irq flow implementations. 426 can be utilized by the irq flow implementations.
389 <itemizedlist> 427 <itemizedlist>
390 <listitem><para>ack()</para></listitem> 428 <listitem><para>irq_ack()</para></listitem>
391 <listitem><para>mask_ack() - Optional, recommended for performance</para></listitem> 429 <listitem><para>irq_mask_ack() - Optional, recommended for performance</para></listitem>
392 <listitem><para>mask()</para></listitem> 430 <listitem><para>irq_mask()</para></listitem>
393 <listitem><para>unmask()</para></listitem> 431 <listitem><para>irq_unmask()</para></listitem>
394 <listitem><para>retrigger() - Optional</para></listitem> 432 <listitem><para>irq_eoi() - Optional, required for eoi flow handlers</para></listitem>
395 <listitem><para>set_type() - Optional</para></listitem> 433 <listitem><para>irq_retrigger() - Optional</para></listitem>
396 <listitem><para>set_wake() - Optional</para></listitem> 434 <listitem><para>irq_set_type() - Optional</para></listitem>
435 <listitem><para>irq_set_wake() - Optional</para></listitem>
397 </itemizedlist> 436 </itemizedlist>
398 These primitives are strictly intended to mean what they say: ack means 437 These primitives are strictly intended to mean what they say: ack means
399 ACK, masking means masking of an IRQ line, etc. It is up to the flow 438 ACK, masking means masking of an IRQ line, etc. It is up to the flow
@@ -405,32 +444,24 @@ desc->chip->end();
405 <chapter id="doirq"> 444 <chapter id="doirq">
406 <title>__do_IRQ entry point</title> 445 <title>__do_IRQ entry point</title>
407 <para> 446 <para>
408 The original implementation __do_IRQ() is an alternative entry 447 The original implementation __do_IRQ() was an alternative entry
409 point for all types of interrupts. 448 point for all types of interrupts. It not longer exists.
410 </para> 449 </para>
411 <para> 450 <para>
412 This handler turned out to be not suitable for all 451 This handler turned out to be not suitable for all
413 interrupt hardware and was therefore reimplemented with split 452 interrupt hardware and was therefore reimplemented with split
414 functionality for egde/level/simple/percpu interrupts. This is not 453 functionality for edge/level/simple/percpu interrupts. This is not
415 only a functional optimization. It also shortens code paths for 454 only a functional optimization. It also shortens code paths for
416 interrupts. 455 interrupts.
417 </para> 456 </para>
418 <para>
419 To make use of the split implementation, replace the call to
420 __do_IRQ by a call to desc->handle_irq() and associate
421 the appropriate handler function to desc->handle_irq().
422 In most cases the generic handler implementations should
423 be sufficient.
424 </para>
425 </chapter> 457 </chapter>
426 458
427 <chapter id="locking"> 459 <chapter id="locking">
428 <title>Locking on SMP</title> 460 <title>Locking on SMP</title>
429 <para> 461 <para>
430 The locking of chip registers is up to the architecture that 462 The locking of chip registers is up to the architecture that
431 defines the chip primitives. There is a chip->lock field that can be used 463 defines the chip primitives. The per-irq structure is
432 for serialization, but the generic layer does not touch it. The per-irq 464 protected via desc->lock, by the generic layer.
433 structure is protected via desc->lock, by the generic layer.
434 </para> 465 </para>
435 </chapter> 466 </chapter>
436 <chapter id="structs"> 467 <chapter id="structs">
@@ -458,6 +489,7 @@ desc->chip->end();
458 <para> 489 <para>
459 This chapter contains the autogenerated documentation of the internal functions. 490 This chapter contains the autogenerated documentation of the internal functions.
460 </para> 491 </para>
492!Ikernel/irq/irqdesc.c
461!Ikernel/irq/handle.c 493!Ikernel/irq/handle.c
462!Ikernel/irq/chip.c 494!Ikernel/irq/chip.c
463 </chapter> 495 </chapter>
diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl
index 6899f471fb15..7160652a8736 100644
--- a/Documentation/DocBook/kernel-api.tmpl
+++ b/Documentation/DocBook/kernel-api.tmpl
@@ -93,6 +93,12 @@ X!Ilib/string.c
93!Elib/crc32.c 93!Elib/crc32.c
94!Elib/crc-ccitt.c 94!Elib/crc-ccitt.c
95 </sect1> 95 </sect1>
96
97 <sect1 id="idr"><title>idr/ida Functions</title>
98!Pinclude/linux/idr.h idr sync
99!Plib/idr.c IDA description
100!Elib/idr.c
101 </sect1>
96 </chapter> 102 </chapter>
97 103
98 <chapter id="mm"> 104 <chapter id="mm">
@@ -257,7 +263,8 @@ X!Earch/x86/kernel/mca_32.c
257!Iblock/blk-sysfs.c 263!Iblock/blk-sysfs.c
258!Eblock/blk-settings.c 264!Eblock/blk-settings.c
259!Eblock/blk-exec.c 265!Eblock/blk-exec.c
260!Eblock/blk-barrier.c 266!Eblock/blk-flush.c
267!Eblock/blk-lib.c
261!Eblock/blk-tag.c 268!Eblock/blk-tag.c
262!Iblock/blk-tag.c 269!Iblock/blk-tag.c
263!Eblock/blk-integrity.c 270!Eblock/blk-integrity.c
diff --git a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl
index a0d479d1e1dd..67e7ab41c0a6 100644
--- a/Documentation/DocBook/kernel-locking.tmpl
+++ b/Documentation/DocBook/kernel-locking.tmpl
@@ -1645,7 +1645,9 @@ the amount of locking which needs to be done.
1645 all the readers who were traversing the list when we deleted the 1645 all the readers who were traversing the list when we deleted the
1646 element are finished. We use <function>call_rcu()</function> to 1646 element are finished. We use <function>call_rcu()</function> to
1647 register a callback which will actually destroy the object once 1647 register a callback which will actually destroy the object once
1648 the readers are finished. 1648 all pre-existing readers are finished. Alternatively,
1649 <function>synchronize_rcu()</function> may be used to block until
1650 all pre-existing are finished.
1649 </para> 1651 </para>
1650 <para> 1652 <para>
1651 But how does Read Copy Update know when the readers are 1653 But how does Read Copy Update know when the readers are
@@ -1714,7 +1716,7 @@ the amount of locking which needs to be done.
1714- object_put(obj); 1716- object_put(obj);
1715+ list_del_rcu(&amp;obj-&gt;list); 1717+ list_del_rcu(&amp;obj-&gt;list);
1716 cache_num--; 1718 cache_num--;
1717+ call_rcu(&amp;obj-&gt;rcu, cache_delete_rcu, obj); 1719+ call_rcu(&amp;obj-&gt;rcu, cache_delete_rcu);
1718 } 1720 }
1719 1721
1720 /* Must be holding cache_lock */ 1722 /* Must be holding cache_lock */
@@ -1725,14 +1727,6 @@ the amount of locking which needs to be done.
1725 if (++cache_num > MAX_CACHE_SIZE) { 1727 if (++cache_num > MAX_CACHE_SIZE) {
1726 struct object *i, *outcast = NULL; 1728 struct object *i, *outcast = NULL;
1727 list_for_each_entry(i, &amp;cache, list) { 1729 list_for_each_entry(i, &amp;cache, list) {
1728@@ -85,6 +94,7 @@
1729 obj-&gt;popularity = 0;
1730 atomic_set(&amp;obj-&gt;refcnt, 1); /* The cache holds a reference */
1731 spin_lock_init(&amp;obj-&gt;lock);
1732+ INIT_RCU_HEAD(&amp;obj-&gt;rcu);
1733
1734 spin_lock_irqsave(&amp;cache_lock, flags);
1735 __cache_add(obj);
1736@@ -104,12 +114,11 @@ 1730@@ -104,12 +114,11 @@
1737 struct object *cache_find(int id) 1731 struct object *cache_find(int id)
1738 { 1732 {
@@ -1769,7 +1763,7 @@ as it would be on UP.
1769There is a furthur optimization possible here: remember our original 1763There is a furthur optimization possible here: remember our original
1770cache code, where there were no reference counts and the caller simply 1764cache code, where there were no reference counts and the caller simply
1771held the lock whenever using the object? This is still possible: if 1765held the lock whenever using the object? This is still possible: if
1772you hold the lock, noone can delete the object, so you don't need to 1766you hold the lock, no one can delete the object, so you don't need to
1773get and put the reference count. 1767get and put the reference count.
1774</para> 1768</para>
1775 1769
diff --git a/Documentation/DocBook/kgdb.tmpl b/Documentation/DocBook/kgdb.tmpl
index 490d862c5f0d..d71b57fcf116 100644
--- a/Documentation/DocBook/kgdb.tmpl
+++ b/Documentation/DocBook/kgdb.tmpl
@@ -710,7 +710,18 @@ Task Addr Pid Parent [*] cpu State Thread Command
710 <listitem><para>A simple shell</para></listitem> 710 <listitem><para>A simple shell</para></listitem>
711 <listitem><para>The kdb core command set</para></listitem> 711 <listitem><para>The kdb core command set</para></listitem>
712 <listitem><para>A registration API to register additional kdb shell commands.</para> 712 <listitem><para>A registration API to register additional kdb shell commands.</para>
713 <para>A good example of a self-contained kdb module is the "ftdump" command for dumping the ftrace buffer. See: kernel/trace/trace_kdb.c</para></listitem> 713 <itemizedlist>
714 <listitem><para>A good example of a self-contained kdb module
715 is the "ftdump" command for dumping the ftrace buffer. See:
716 kernel/trace/trace_kdb.c</para></listitem>
717 <listitem><para>For an example of how to dynamically register
718 a new kdb command you can build the kdb_hello.ko kernel module
719 from samples/kdb/kdb_hello.c. To build this example you can
720 set CONFIG_SAMPLES=y and CONFIG_SAMPLE_KDB=m in your kernel
721 config. Later run "modprobe kdb_hello" and the next time you
722 enter the kdb shell, you can run the "hello"
723 command.</para></listitem>
724 </itemizedlist></listitem>
714 <listitem><para>The implementation for kdb_printf() which 725 <listitem><para>The implementation for kdb_printf() which
715 emits messages directly to I/O drivers, bypassing the kernel 726 emits messages directly to I/O drivers, bypassing the kernel
716 log.</para></listitem> 727 log.</para></listitem>
diff --git a/Documentation/DocBook/libata.tmpl b/Documentation/DocBook/libata.tmpl
index 8c5411cfeaf0..cdd1bb9aac0d 100644
--- a/Documentation/DocBook/libata.tmpl
+++ b/Documentation/DocBook/libata.tmpl
@@ -1032,7 +1032,7 @@ and other resources, etc.
1032 <listitem> 1032 <listitem>
1033 <para> 1033 <para>
1034 This is indicated by ICRC bit in the ERROR register and 1034 This is indicated by ICRC bit in the ERROR register and
1035 means that corruption occurred during data transfer. Upto 1035 means that corruption occurred during data transfer. Up to
1036 ATA/ATAPI-7, the standard specifies that this bit is only 1036 ATA/ATAPI-7, the standard specifies that this bit is only
1037 applicable to UDMA transfers but ATA/ATAPI-8 draft revision 1037 applicable to UDMA transfers but ATA/ATAPI-8 draft revision
1038 1f says that the bit may be applicable to multiword DMA and 1038 1f says that the bit may be applicable to multiword DMA and
@@ -1045,10 +1045,10 @@ and other resources, etc.
1045 <term>ABRT error during data transfer or on completion</term> 1045 <term>ABRT error during data transfer or on completion</term>
1046 <listitem> 1046 <listitem>
1047 <para> 1047 <para>
1048 Upto ATA/ATAPI-7, the standard specifies that ABRT could be 1048 Up to ATA/ATAPI-7, the standard specifies that ABRT could be
1049 set on ICRC errors and on cases where a device is not able 1049 set on ICRC errors and on cases where a device is not able
1050 to complete a command. Combined with the fact that MWDMA 1050 to complete a command. Combined with the fact that MWDMA
1051 and PIO transfer errors aren't allowed to use ICRC bit upto 1051 and PIO transfer errors aren't allowed to use ICRC bit up to
1052 ATA/ATAPI-7, it seems to imply that ABRT bit alone could 1052 ATA/ATAPI-7, it seems to imply that ABRT bit alone could
1053 indicate tranfer errors. 1053 indicate tranfer errors.
1054 </para> 1054 </para>
@@ -1122,7 +1122,7 @@ and other resources, etc.
1122 <para> 1122 <para>
1123 Depending on commands, not all STATUS/ERROR bits are 1123 Depending on commands, not all STATUS/ERROR bits are
1124 applicable. These non-applicable bits are marked with 1124 applicable. These non-applicable bits are marked with
1125 &quot;na&quot; in the output descriptions but upto ATA/ATAPI-7 1125 &quot;na&quot; in the output descriptions but up to ATA/ATAPI-7
1126 no definition of &quot;na&quot; can be found. However, 1126 no definition of &quot;na&quot; can be found. However,
1127 ATA/ATAPI-8 draft revision 1f describes &quot;N/A&quot; as 1127 ATA/ATAPI-8 draft revision 1f describes &quot;N/A&quot; as
1128 follows. 1128 follows.
@@ -1507,7 +1507,7 @@ and other resources, etc.
1507 1507
1508 <listitem> 1508 <listitem>
1509 <para> 1509 <para>
1510 CHS set up with INITIALIZE DEVICE PARAMETERS (seldomly used) 1510 CHS set up with INITIALIZE DEVICE PARAMETERS (seldom used)
1511 </para> 1511 </para>
1512 </listitem> 1512 </listitem>
1513 1513
diff --git a/Documentation/DocBook/mac80211.tmpl b/Documentation/DocBook/mac80211.tmpl
deleted file mode 100644
index affb15a344a1..000000000000
--- a/Documentation/DocBook/mac80211.tmpl
+++ /dev/null
@@ -1,337 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
4
5<book id="mac80211-developers-guide">
6 <bookinfo>
7 <title>The mac80211 subsystem for kernel developers</title>
8
9 <authorgroup>
10 <author>
11 <firstname>Johannes</firstname>
12 <surname>Berg</surname>
13 <affiliation>
14 <address><email>johannes@sipsolutions.net</email></address>
15 </affiliation>
16 </author>
17 </authorgroup>
18
19 <copyright>
20 <year>2007-2009</year>
21 <holder>Johannes Berg</holder>
22 </copyright>
23
24 <legalnotice>
25 <para>
26 This documentation is free software; you can redistribute
27 it and/or modify it under the terms of the GNU General Public
28 License version 2 as published by the Free Software Foundation.
29 </para>
30
31 <para>
32 This documentation is distributed in the hope that it will be
33 useful, but WITHOUT ANY WARRANTY; without even the implied
34 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
35 See the GNU General Public License for more details.
36 </para>
37
38 <para>
39 You should have received a copy of the GNU General Public
40 License along with this documentation; if not, write to the Free
41 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
42 MA 02111-1307 USA
43 </para>
44
45 <para>
46 For more details see the file COPYING in the source
47 distribution of Linux.
48 </para>
49 </legalnotice>
50
51 <abstract>
52!Pinclude/net/mac80211.h Introduction
53!Pinclude/net/mac80211.h Warning
54 </abstract>
55 </bookinfo>
56
57 <toc></toc>
58
59<!--
60Generally, this document shall be ordered by increasing complexity.
61It is important to note that readers should be able to read only
62the first few sections to get a working driver and only advanced
63usage should require reading the full document.
64-->
65
66 <part>
67 <title>The basic mac80211 driver interface</title>
68 <partintro>
69 <para>
70 You should read and understand the information contained
71 within this part of the book while implementing a driver.
72 In some chapters, advanced usage is noted, that may be
73 skipped at first.
74 </para>
75 <para>
76 This part of the book only covers station and monitor mode
77 functionality, additional information required to implement
78 the other modes is covered in the second part of the book.
79 </para>
80 </partintro>
81
82 <chapter id="basics">
83 <title>Basic hardware handling</title>
84 <para>TBD</para>
85 <para>
86 This chapter shall contain information on getting a hw
87 struct allocated and registered with mac80211.
88 </para>
89 <para>
90 Since it is required to allocate rates/modes before registering
91 a hw struct, this chapter shall also contain information on setting
92 up the rate/mode structs.
93 </para>
94 <para>
95 Additionally, some discussion about the callbacks and
96 the general programming model should be in here, including
97 the definition of ieee80211_ops which will be referred to
98 a lot.
99 </para>
100 <para>
101 Finally, a discussion of hardware capabilities should be done
102 with references to other parts of the book.
103 </para>
104<!-- intentionally multiple !F lines to get proper order -->
105!Finclude/net/mac80211.h ieee80211_hw
106!Finclude/net/mac80211.h ieee80211_hw_flags
107!Finclude/net/mac80211.h SET_IEEE80211_DEV
108!Finclude/net/mac80211.h SET_IEEE80211_PERM_ADDR
109!Finclude/net/mac80211.h ieee80211_ops
110!Finclude/net/mac80211.h ieee80211_alloc_hw
111!Finclude/net/mac80211.h ieee80211_register_hw
112!Finclude/net/mac80211.h ieee80211_get_tx_led_name
113!Finclude/net/mac80211.h ieee80211_get_rx_led_name
114!Finclude/net/mac80211.h ieee80211_get_assoc_led_name
115!Finclude/net/mac80211.h ieee80211_get_radio_led_name
116!Finclude/net/mac80211.h ieee80211_unregister_hw
117!Finclude/net/mac80211.h ieee80211_free_hw
118 </chapter>
119
120 <chapter id="phy-handling">
121 <title>PHY configuration</title>
122 <para>TBD</para>
123 <para>
124 This chapter should describe PHY handling including
125 start/stop callbacks and the various structures used.
126 </para>
127!Finclude/net/mac80211.h ieee80211_conf
128!Finclude/net/mac80211.h ieee80211_conf_flags
129 </chapter>
130
131 <chapter id="iface-handling">
132 <title>Virtual interfaces</title>
133 <para>TBD</para>
134 <para>
135 This chapter should describe virtual interface basics
136 that are relevant to the driver (VLANs, MGMT etc are not.)
137 It should explain the use of the add_iface/remove_iface
138 callbacks as well as the interface configuration callbacks.
139 </para>
140 <para>Things related to AP mode should be discussed there.</para>
141 <para>
142 Things related to supporting multiple interfaces should be
143 in the appropriate chapter, a BIG FAT note should be here about
144 this though and the recommendation to allow only a single
145 interface in STA mode at first!
146 </para>
147!Finclude/net/mac80211.h ieee80211_vif
148 </chapter>
149
150 <chapter id="rx-tx">
151 <title>Receive and transmit processing</title>
152 <sect1>
153 <title>what should be here</title>
154 <para>TBD</para>
155 <para>
156 This should describe the receive and transmit
157 paths in mac80211/the drivers as well as
158 transmit status handling.
159 </para>
160 </sect1>
161 <sect1>
162 <title>Frame format</title>
163!Pinclude/net/mac80211.h Frame format
164 </sect1>
165 <sect1>
166 <title>Packet alignment</title>
167!Pnet/mac80211/rx.c Packet alignment
168 </sect1>
169 <sect1>
170 <title>Calling into mac80211 from interrupts</title>
171!Pinclude/net/mac80211.h Calling mac80211 from interrupts
172 </sect1>
173 <sect1>
174 <title>functions/definitions</title>
175!Finclude/net/mac80211.h ieee80211_rx_status
176!Finclude/net/mac80211.h mac80211_rx_flags
177!Finclude/net/mac80211.h ieee80211_tx_info
178!Finclude/net/mac80211.h ieee80211_rx
179!Finclude/net/mac80211.h ieee80211_rx_irqsafe
180!Finclude/net/mac80211.h ieee80211_tx_status
181!Finclude/net/mac80211.h ieee80211_tx_status_irqsafe
182!Finclude/net/mac80211.h ieee80211_rts_get
183!Finclude/net/mac80211.h ieee80211_rts_duration
184!Finclude/net/mac80211.h ieee80211_ctstoself_get
185!Finclude/net/mac80211.h ieee80211_ctstoself_duration
186!Finclude/net/mac80211.h ieee80211_generic_frame_duration
187!Finclude/net/mac80211.h ieee80211_wake_queue
188!Finclude/net/mac80211.h ieee80211_stop_queue
189!Finclude/net/mac80211.h ieee80211_wake_queues
190!Finclude/net/mac80211.h ieee80211_stop_queues
191 </sect1>
192 </chapter>
193
194 <chapter id="filters">
195 <title>Frame filtering</title>
196!Pinclude/net/mac80211.h Frame filtering
197!Finclude/net/mac80211.h ieee80211_filter_flags
198 </chapter>
199 </part>
200
201 <part id="advanced">
202 <title>Advanced driver interface</title>
203 <partintro>
204 <para>
205 Information contained within this part of the book is
206 of interest only for advanced interaction of mac80211
207 with drivers to exploit more hardware capabilities and
208 improve performance.
209 </para>
210 </partintro>
211
212 <chapter id="hardware-crypto-offload">
213 <title>Hardware crypto acceleration</title>
214!Pinclude/net/mac80211.h Hardware crypto acceleration
215<!-- intentionally multiple !F lines to get proper order -->
216!Finclude/net/mac80211.h set_key_cmd
217!Finclude/net/mac80211.h ieee80211_key_conf
218!Finclude/net/mac80211.h ieee80211_key_alg
219!Finclude/net/mac80211.h ieee80211_key_flags
220 </chapter>
221
222 <chapter id="powersave">
223 <title>Powersave support</title>
224!Pinclude/net/mac80211.h Powersave support
225 </chapter>
226
227 <chapter id="beacon-filter">
228 <title>Beacon filter support</title>
229!Pinclude/net/mac80211.h Beacon filter support
230!Finclude/net/mac80211.h ieee80211_beacon_loss
231 </chapter>
232
233 <chapter id="qos">
234 <title>Multiple queues and QoS support</title>
235 <para>TBD</para>
236!Finclude/net/mac80211.h ieee80211_tx_queue_params
237 </chapter>
238
239 <chapter id="AP">
240 <title>Access point mode support</title>
241 <para>TBD</para>
242 <para>Some parts of the if_conf should be discussed here instead</para>
243 <para>
244 Insert notes about VLAN interfaces with hw crypto here or
245 in the hw crypto chapter.
246 </para>
247!Finclude/net/mac80211.h ieee80211_get_buffered_bc
248!Finclude/net/mac80211.h ieee80211_beacon_get
249 </chapter>
250
251 <chapter id="multi-iface">
252 <title>Supporting multiple virtual interfaces</title>
253 <para>TBD</para>
254 <para>
255 Note: WDS with identical MAC address should almost always be OK
256 </para>
257 <para>
258 Insert notes about having multiple virtual interfaces with
259 different MAC addresses here, note which configurations are
260 supported by mac80211, add notes about supporting hw crypto
261 with it.
262 </para>
263 </chapter>
264
265 <chapter id="hardware-scan-offload">
266 <title>Hardware scan offload</title>
267 <para>TBD</para>
268!Finclude/net/mac80211.h ieee80211_scan_completed
269 </chapter>
270 </part>
271
272 <part id="rate-control">
273 <title>Rate control interface</title>
274 <partintro>
275 <para>TBD</para>
276 <para>
277 This part of the book describes the rate control algorithm
278 interface and how it relates to mac80211 and drivers.
279 </para>
280 </partintro>
281 <chapter id="dummy">
282 <title>dummy chapter</title>
283 <para>TBD</para>
284 </chapter>
285 </part>
286
287 <part id="internal">
288 <title>Internals</title>
289 <partintro>
290 <para>TBD</para>
291 <para>
292 This part of the book describes mac80211 internals.
293 </para>
294 </partintro>
295
296 <chapter id="key-handling">
297 <title>Key handling</title>
298 <sect1>
299 <title>Key handling basics</title>
300!Pnet/mac80211/key.c Key handling basics
301 </sect1>
302 <sect1>
303 <title>MORE TBD</title>
304 <para>TBD</para>
305 </sect1>
306 </chapter>
307
308 <chapter id="rx-processing">
309 <title>Receive processing</title>
310 <para>TBD</para>
311 </chapter>
312
313 <chapter id="tx-processing">
314 <title>Transmit processing</title>
315 <para>TBD</para>
316 </chapter>
317
318 <chapter id="sta-info">
319 <title>Station info handling</title>
320 <sect1>
321 <title>Programming information</title>
322!Fnet/mac80211/sta_info.h sta_info
323!Fnet/mac80211/sta_info.h ieee80211_sta_info_flags
324 </sect1>
325 <sect1>
326 <title>STA information lifetime rules</title>
327!Pnet/mac80211/sta_info.c STA information lifetime rules
328 </sect1>
329 </chapter>
330
331 <chapter id="synchronisation">
332 <title>Synchronisation</title>
333 <para>TBD</para>
334 <para>Locking, lots of RCU</para>
335 </chapter>
336 </part>
337</book>
diff --git a/Documentation/DocBook/media-entities.tmpl b/Documentation/DocBook/media-entities.tmpl
index 6ae97157b1c7..e5fe09430fd9 100644
--- a/Documentation/DocBook/media-entities.tmpl
+++ b/Documentation/DocBook/media-entities.tmpl
@@ -11,6 +11,10 @@
11<!ENTITY func-select "<link linkend='func-select'><function>select()</function></link>"> 11<!ENTITY func-select "<link linkend='func-select'><function>select()</function></link>">
12<!ENTITY func-write "<link linkend='func-write'><function>write()</function></link>"> 12<!ENTITY func-write "<link linkend='func-write'><function>write()</function></link>">
13 13
14<!ENTITY media-func-close "<link linkend='media-func-close'><function>close()</function></link>">
15<!ENTITY media-func-ioctl "<link linkend='media-func-ioctl'><function>ioctl()</function></link>">
16<!ENTITY media-func-open "<link linkend='media-func-open'><function>open()</function></link>">
17
14<!-- Ioctls --> 18<!-- Ioctls -->
15<!ENTITY VIDIOC-CROPCAP "<link linkend='vidioc-cropcap'><constant>VIDIOC_CROPCAP</constant></link>"> 19<!ENTITY VIDIOC-CROPCAP "<link linkend='vidioc-cropcap'><constant>VIDIOC_CROPCAP</constant></link>">
16<!ENTITY VIDIOC-DBG-G-CHIP-IDENT "<link linkend='vidioc-dbg-g-chip-ident'><constant>VIDIOC_DBG_G_CHIP_IDENT</constant></link>"> 20<!ENTITY VIDIOC-DBG-G-CHIP-IDENT "<link linkend='vidioc-dbg-g-chip-ident'><constant>VIDIOC_DBG_G_CHIP_IDENT</constant></link>">
@@ -82,11 +86,24 @@
82<!ENTITY VIDIOC-S-PRIORITY "<link linkend='vidioc-g-priority'><constant>VIDIOC_S_PRIORITY</constant></link>"> 86<!ENTITY VIDIOC-S-PRIORITY "<link linkend='vidioc-g-priority'><constant>VIDIOC_S_PRIORITY</constant></link>">
83<!ENTITY VIDIOC-S-STD "<link linkend='vidioc-g-std'><constant>VIDIOC_S_STD</constant></link>"> 87<!ENTITY VIDIOC-S-STD "<link linkend='vidioc-g-std'><constant>VIDIOC_S_STD</constant></link>">
84<!ENTITY VIDIOC-S-TUNER "<link linkend='vidioc-g-tuner'><constant>VIDIOC_S_TUNER</constant></link>"> 88<!ENTITY VIDIOC-S-TUNER "<link linkend='vidioc-g-tuner'><constant>VIDIOC_S_TUNER</constant></link>">
89<!ENTITY VIDIOC-SUBDEV-ENUM-FRAME-SIZE "<link linkend='vidioc-subdev-enum-frame-size'><constant>VIDIOC_SUBDEV_ENUM_FRAME_SIZE</constant></link>">
90<!ENTITY VIDIOC-SUBDEV-ENUM-MBUS-CODE "<link linkend='vidioc-subdev-enum-mbus-code'><constant>VIDIOC_SUBDEV_ENUM_MBUS_CODE</constant></link>">
91<!ENTITY VIDIOC-SUBDEV-G-CROP "<link linkend='vidioc-subdev-g-crop'><constant>VIDIOC_SUBDEV_G_CROP</constant></link>">
92<!ENTITY VIDIOC-SUBDEV-G-FMT "<link linkend='vidioc-subdev-g-fmt'><constant>VIDIOC_SUBDEV_G_FMT</constant></link>">
93<!ENTITY VIDIOC-SUBDEV-G-FRAME-INTERVAL "<link linkend='vidioc-subdev-g-frame-interval'><constant>VIDIOC_SUBDEV_G_FRAME_INTERVAL</constant></link>">
94<!ENTITY VIDIOC-SUBDEV-S-CROP "<link linkend='vidioc-subdev-g-crop'><constant>VIDIOC_SUBDEV_S_CROP</constant></link>">
95<!ENTITY VIDIOC-SUBDEV-S-FMT "<link linkend='vidioc-subdev-g-fmt'><constant>VIDIOC_SUBDEV_S_FMT</constant></link>">
96<!ENTITY VIDIOC-SUBDEV-S-FRAME-INTERVAL "<link linkend='vidioc-subdev-g-frame-interval'><constant>VIDIOC_SUBDEV_S_FRAME_INTERVAL</constant></link>">
85<!ENTITY VIDIOC-TRY-ENCODER-CMD "<link linkend='vidioc-encoder-cmd'><constant>VIDIOC_TRY_ENCODER_CMD</constant></link>"> 97<!ENTITY VIDIOC-TRY-ENCODER-CMD "<link linkend='vidioc-encoder-cmd'><constant>VIDIOC_TRY_ENCODER_CMD</constant></link>">
86<!ENTITY VIDIOC-TRY-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_TRY_EXT_CTRLS</constant></link>"> 98<!ENTITY VIDIOC-TRY-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_TRY_EXT_CTRLS</constant></link>">
87<!ENTITY VIDIOC-TRY-FMT "<link linkend='vidioc-g-fmt'><constant>VIDIOC_TRY_FMT</constant></link>"> 99<!ENTITY VIDIOC-TRY-FMT "<link linkend='vidioc-g-fmt'><constant>VIDIOC_TRY_FMT</constant></link>">
88<!ENTITY VIDIOC-UNSUBSCRIBE-EVENT "<link linkend='vidioc-subscribe-event'><constant>VIDIOC_UNSUBSCRIBE_EVENT</constant></link>"> 100<!ENTITY VIDIOC-UNSUBSCRIBE-EVENT "<link linkend='vidioc-subscribe-event'><constant>VIDIOC_UNSUBSCRIBE_EVENT</constant></link>">
89 101
102<!ENTITY MEDIA-IOC-DEVICE-INFO "<link linkend='media-ioc-device-info'><constant>MEDIA_IOC_DEVICE_INFO</constant></link>">
103<!ENTITY MEDIA-IOC-ENUM-ENTITIES "<link linkend='media-ioc-enum-entities'><constant>MEDIA_IOC_ENUM_ENTITIES</constant></link>">
104<!ENTITY MEDIA-IOC-ENUM-LINKS "<link linkend='media-ioc-enum-links'><constant>MEDIA_IOC_ENUM_LINKS</constant></link>">
105<!ENTITY MEDIA-IOC-SETUP-LINK "<link linkend='media-ioc-setup-link'><constant>MEDIA_IOC_SETUP_LINK</constant></link>">
106
90<!-- Types --> 107<!-- Types -->
91<!ENTITY v4l2-std-id "<link linkend='v4l2-std-id'>v4l2_std_id</link>"> 108<!ENTITY v4l2-std-id "<link linkend='v4l2-std-id'>v4l2_std_id</link>">
92 109
@@ -98,6 +115,7 @@
98<!ENTITY v4l2-field "enum&nbsp;<link linkend='v4l2-field'>v4l2_field</link>"> 115<!ENTITY v4l2-field "enum&nbsp;<link linkend='v4l2-field'>v4l2_field</link>">
99<!ENTITY v4l2-frmivaltypes "enum&nbsp;<link linkend='v4l2-frmivaltypes'>v4l2_frmivaltypes</link>"> 116<!ENTITY v4l2-frmivaltypes "enum&nbsp;<link linkend='v4l2-frmivaltypes'>v4l2_frmivaltypes</link>">
100<!ENTITY v4l2-frmsizetypes "enum&nbsp;<link linkend='v4l2-frmsizetypes'>v4l2_frmsizetypes</link>"> 117<!ENTITY v4l2-frmsizetypes "enum&nbsp;<link linkend='v4l2-frmsizetypes'>v4l2_frmsizetypes</link>">
118<!ENTITY v4l2-mbus-pixelcode "enum&nbsp;<link linkend='v4l2-mbus-pixelcode'>v4l2_mbus_pixelcode</link>">
101<!ENTITY v4l2-memory "enum&nbsp;<link linkend='v4l2-memory'>v4l2_memory</link>"> 119<!ENTITY v4l2-memory "enum&nbsp;<link linkend='v4l2-memory'>v4l2_memory</link>">
102<!ENTITY v4l2-mpeg-audio-ac3-bitrate "enum&nbsp;<link linkend='v4l2-mpeg-audio-ac3-bitrate'>v4l2_mpeg_audio_ac3_bitrate</link>"> 120<!ENTITY v4l2-mpeg-audio-ac3-bitrate "enum&nbsp;<link linkend='v4l2-mpeg-audio-ac3-bitrate'>v4l2_mpeg_audio_ac3_bitrate</link>">
103<!ENTITY v4l2-mpeg-audio-crc "enum&nbsp;<link linkend='v4l2-mpeg-audio-crc'>v4l2_mpeg_audio_crc</link>"> 121<!ENTITY v4l2-mpeg-audio-crc "enum&nbsp;<link linkend='v4l2-mpeg-audio-crc'>v4l2_mpeg_audio_crc</link>">
@@ -121,6 +139,7 @@
121<!ENTITY v4l2-mpeg-video-encoding "enum&nbsp;<link linkend='v4l2-mpeg-video-encoding'>v4l2_mpeg_video_encoding</link>"> 139<!ENTITY v4l2-mpeg-video-encoding "enum&nbsp;<link linkend='v4l2-mpeg-video-encoding'>v4l2_mpeg_video_encoding</link>">
122<!ENTITY v4l2-power-line-frequency "enum&nbsp;<link linkend='v4l2-power-line-frequency'>v4l2_power_line_frequency</link>"> 140<!ENTITY v4l2-power-line-frequency "enum&nbsp;<link linkend='v4l2-power-line-frequency'>v4l2_power_line_frequency</link>">
123<!ENTITY v4l2-priority "enum&nbsp;<link linkend='v4l2-priority'>v4l2_priority</link>"> 141<!ENTITY v4l2-priority "enum&nbsp;<link linkend='v4l2-priority'>v4l2_priority</link>">
142<!ENTITY v4l2-subdev-format-whence "enum&nbsp;<link linkend='v4l2-subdev-format-whence'>v4l2_subdev_format_whence</link>">
124<!ENTITY v4l2-tuner-type "enum&nbsp;<link linkend='v4l2-tuner-type'>v4l2_tuner_type</link>"> 143<!ENTITY v4l2-tuner-type "enum&nbsp;<link linkend='v4l2-tuner-type'>v4l2_tuner_type</link>">
125<!ENTITY v4l2-preemphasis "enum&nbsp;<link linkend='v4l2-preemphasis'>v4l2_preemphasis</link>"> 144<!ENTITY v4l2-preemphasis "enum&nbsp;<link linkend='v4l2-preemphasis'>v4l2_preemphasis</link>">
126 145
@@ -129,6 +148,7 @@
129<!ENTITY v4l2-audioout "struct&nbsp;<link linkend='v4l2-audioout'>v4l2_audioout</link>"> 148<!ENTITY v4l2-audioout "struct&nbsp;<link linkend='v4l2-audioout'>v4l2_audioout</link>">
130<!ENTITY v4l2-bt-timings "struct&nbsp;<link linkend='v4l2-bt-timings'>v4l2_bt_timings</link>"> 149<!ENTITY v4l2-bt-timings "struct&nbsp;<link linkend='v4l2-bt-timings'>v4l2_bt_timings</link>">
131<!ENTITY v4l2-buffer "struct&nbsp;<link linkend='v4l2-buffer'>v4l2_buffer</link>"> 150<!ENTITY v4l2-buffer "struct&nbsp;<link linkend='v4l2-buffer'>v4l2_buffer</link>">
151<!ENTITY v4l2-plane "struct&nbsp;<link linkend='v4l2-plane'>v4l2_plane</link>">
132<!ENTITY v4l2-capability "struct&nbsp;<link linkend='v4l2-capability'>v4l2_capability</link>"> 152<!ENTITY v4l2-capability "struct&nbsp;<link linkend='v4l2-capability'>v4l2_capability</link>">
133<!ENTITY v4l2-captureparm "struct&nbsp;<link linkend='v4l2-captureparm'>v4l2_captureparm</link>"> 153<!ENTITY v4l2-captureparm "struct&nbsp;<link linkend='v4l2-captureparm'>v4l2_captureparm</link>">
134<!ENTITY v4l2-clip "struct&nbsp;<link linkend='v4l2-clip'>v4l2_clip</link>"> 154<!ENTITY v4l2-clip "struct&nbsp;<link linkend='v4l2-clip'>v4l2_clip</link>">
@@ -162,11 +182,14 @@
162<!ENTITY v4l2-hw-freq-seek "struct&nbsp;<link linkend='v4l2-hw-freq-seek'>v4l2_hw_freq_seek</link>"> 182<!ENTITY v4l2-hw-freq-seek "struct&nbsp;<link linkend='v4l2-hw-freq-seek'>v4l2_hw_freq_seek</link>">
163<!ENTITY v4l2-input "struct&nbsp;<link linkend='v4l2-input'>v4l2_input</link>"> 183<!ENTITY v4l2-input "struct&nbsp;<link linkend='v4l2-input'>v4l2_input</link>">
164<!ENTITY v4l2-jpegcompression "struct&nbsp;<link linkend='v4l2-jpegcompression'>v4l2_jpegcompression</link>"> 184<!ENTITY v4l2-jpegcompression "struct&nbsp;<link linkend='v4l2-jpegcompression'>v4l2_jpegcompression</link>">
185<!ENTITY v4l2-mbus-framefmt "struct&nbsp;<link linkend='v4l2-mbus-framefmt'>v4l2_mbus_framefmt</link>">
165<!ENTITY v4l2-modulator "struct&nbsp;<link linkend='v4l2-modulator'>v4l2_modulator</link>"> 186<!ENTITY v4l2-modulator "struct&nbsp;<link linkend='v4l2-modulator'>v4l2_modulator</link>">
166<!ENTITY v4l2-mpeg-vbi-fmt-ivtv "struct&nbsp;<link linkend='v4l2-mpeg-vbi-fmt-ivtv'>v4l2_mpeg_vbi_fmt_ivtv</link>"> 187<!ENTITY v4l2-mpeg-vbi-fmt-ivtv "struct&nbsp;<link linkend='v4l2-mpeg-vbi-fmt-ivtv'>v4l2_mpeg_vbi_fmt_ivtv</link>">
167<!ENTITY v4l2-output "struct&nbsp;<link linkend='v4l2-output'>v4l2_output</link>"> 188<!ENTITY v4l2-output "struct&nbsp;<link linkend='v4l2-output'>v4l2_output</link>">
168<!ENTITY v4l2-outputparm "struct&nbsp;<link linkend='v4l2-outputparm'>v4l2_outputparm</link>"> 189<!ENTITY v4l2-outputparm "struct&nbsp;<link linkend='v4l2-outputparm'>v4l2_outputparm</link>">
169<!ENTITY v4l2-pix-format "struct&nbsp;<link linkend='v4l2-pix-format'>v4l2_pix_format</link>"> 190<!ENTITY v4l2-pix-format "struct&nbsp;<link linkend='v4l2-pix-format'>v4l2_pix_format</link>">
191<!ENTITY v4l2-pix-format-mplane "struct&nbsp;<link linkend='v4l2-pix-format-mplane'>v4l2_pix_format_mplane</link>">
192<!ENTITY v4l2-plane-pix-format "struct&nbsp;<link linkend='v4l2-plane-pix-format'>v4l2_plane_pix_format</link>">
170<!ENTITY v4l2-queryctrl "struct&nbsp;<link linkend='v4l2-queryctrl'>v4l2_queryctrl</link>"> 193<!ENTITY v4l2-queryctrl "struct&nbsp;<link linkend='v4l2-queryctrl'>v4l2_queryctrl</link>">
171<!ENTITY v4l2-querymenu "struct&nbsp;<link linkend='v4l2-querymenu'>v4l2_querymenu</link>"> 194<!ENTITY v4l2-querymenu "struct&nbsp;<link linkend='v4l2-querymenu'>v4l2_querymenu</link>">
172<!ENTITY v4l2-rect "struct&nbsp;<link linkend='v4l2-rect'>v4l2_rect</link>"> 195<!ENTITY v4l2-rect "struct&nbsp;<link linkend='v4l2-rect'>v4l2_rect</link>">
@@ -174,6 +197,12 @@
174<!ENTITY v4l2-sliced-vbi-cap "struct&nbsp;<link linkend='v4l2-sliced-vbi-cap'>v4l2_sliced_vbi_cap</link>"> 197<!ENTITY v4l2-sliced-vbi-cap "struct&nbsp;<link linkend='v4l2-sliced-vbi-cap'>v4l2_sliced_vbi_cap</link>">
175<!ENTITY v4l2-sliced-vbi-data "struct&nbsp;<link linkend='v4l2-sliced-vbi-data'>v4l2_sliced_vbi_data</link>"> 198<!ENTITY v4l2-sliced-vbi-data "struct&nbsp;<link linkend='v4l2-sliced-vbi-data'>v4l2_sliced_vbi_data</link>">
176<!ENTITY v4l2-sliced-vbi-format "struct&nbsp;<link linkend='v4l2-sliced-vbi-format'>v4l2_sliced_vbi_format</link>"> 199<!ENTITY v4l2-sliced-vbi-format "struct&nbsp;<link linkend='v4l2-sliced-vbi-format'>v4l2_sliced_vbi_format</link>">
200<!ENTITY v4l2-subdev-frame-interval "struct&nbsp;<link linkend='v4l2-subdev-frame-interval'>v4l2_subdev_frame_interval</link>">
201<!ENTITY v4l2-subdev-frame-interval-enum "struct&nbsp;<link linkend='v4l2-subdev-frame-interval-enum'>v4l2_subdev_frame_interval_enum</link>">
202<!ENTITY v4l2-subdev-frame-size-enum "struct&nbsp;<link linkend='v4l2-subdev-frame-size-enum'>v4l2_subdev_frame_size_enum</link>">
203<!ENTITY v4l2-subdev-crop "struct&nbsp;<link linkend='v4l2-subdev-crop'>v4l2_subdev_crop</link>">
204<!ENTITY v4l2-subdev-format "struct&nbsp;<link linkend='v4l2-subdev-format'>v4l2_subdev_format</link>">
205<!ENTITY v4l2-subdev-mbus-code-enum "struct&nbsp;<link linkend='v4l2-subdev-mbus-code-enum'>v4l2_subdev_mbus_code_enum</link>">
177<!ENTITY v4l2-standard "struct&nbsp;<link linkend='v4l2-standard'>v4l2_standard</link>"> 206<!ENTITY v4l2-standard "struct&nbsp;<link linkend='v4l2-standard'>v4l2_standard</link>">
178<!ENTITY v4l2-streamparm "struct&nbsp;<link linkend='v4l2-streamparm'>v4l2_streamparm</link>"> 207<!ENTITY v4l2-streamparm "struct&nbsp;<link linkend='v4l2-streamparm'>v4l2_streamparm</link>">
179<!ENTITY v4l2-timecode "struct&nbsp;<link linkend='v4l2-timecode'>v4l2_timecode</link>"> 208<!ENTITY v4l2-timecode "struct&nbsp;<link linkend='v4l2-timecode'>v4l2_timecode</link>">
@@ -181,6 +210,12 @@
181<!ENTITY v4l2-vbi-format "struct&nbsp;<link linkend='v4l2-vbi-format'>v4l2_vbi_format</link>"> 210<!ENTITY v4l2-vbi-format "struct&nbsp;<link linkend='v4l2-vbi-format'>v4l2_vbi_format</link>">
182<!ENTITY v4l2-window "struct&nbsp;<link linkend='v4l2-window'>v4l2_window</link>"> 211<!ENTITY v4l2-window "struct&nbsp;<link linkend='v4l2-window'>v4l2_window</link>">
183 212
213<!ENTITY media-device-info "struct&nbsp;<link linkend='media-device-info'>media_device_info</link>">
214<!ENTITY media-entity-desc "struct&nbsp;<link linkend='media-entity-desc'>media_entity_desc</link>">
215<!ENTITY media-links-enum "struct&nbsp;<link linkend='media-links-enum'>media_links_enum</link>">
216<!ENTITY media-pad-desc "struct&nbsp;<link linkend='media-pad-desc'>media_pad_desc</link>">
217<!ENTITY media-link-desc "struct&nbsp;<link linkend='media-link-desc'>media_link_desc</link>">
218
184<!-- Error Codes --> 219<!-- Error Codes -->
185<!ENTITY EACCES "<errorcode>EACCES</errorcode> error code"> 220<!ENTITY EACCES "<errorcode>EACCES</errorcode> error code">
186<!ENTITY EAGAIN "<errorcode>EAGAIN</errorcode> error code"> 221<!ENTITY EAGAIN "<errorcode>EAGAIN</errorcode> error code">
@@ -197,11 +232,13 @@
197<!ENTITY ENXIO "<errorcode>ENXIO</errorcode> error code"> 232<!ENTITY ENXIO "<errorcode>ENXIO</errorcode> error code">
198<!ENTITY EMFILE "<errorcode>EMFILE</errorcode> error code"> 233<!ENTITY EMFILE "<errorcode>EMFILE</errorcode> error code">
199<!ENTITY EPERM "<errorcode>EPERM</errorcode> error code"> 234<!ENTITY EPERM "<errorcode>EPERM</errorcode> error code">
235<!ENTITY EPIPE "<errorcode>EPIPE</errorcode> error code">
200<!ENTITY ERANGE "<errorcode>ERANGE</errorcode> error code"> 236<!ENTITY ERANGE "<errorcode>ERANGE</errorcode> error code">
201 237
202<!-- Subsections --> 238<!-- Subsections -->
203<!ENTITY sub-biblio SYSTEM "v4l/biblio.xml"> 239<!ENTITY sub-biblio SYSTEM "v4l/biblio.xml">
204<!ENTITY sub-common SYSTEM "v4l/common.xml"> 240<!ENTITY sub-common SYSTEM "v4l/common.xml">
241<!ENTITY sub-planar-apis SYSTEM "v4l/planar-apis.xml">
205<!ENTITY sub-compat SYSTEM "v4l/compat.xml"> 242<!ENTITY sub-compat SYSTEM "v4l/compat.xml">
206<!ENTITY sub-controls SYSTEM "v4l/controls.xml"> 243<!ENTITY sub-controls SYSTEM "v4l/controls.xml">
207<!ENTITY sub-dev-capture SYSTEM "v4l/dev-capture.xml"> 244<!ENTITY sub-dev-capture SYSTEM "v4l/dev-capture.xml">
@@ -215,6 +252,7 @@
215<!ENTITY sub-dev-raw-vbi SYSTEM "v4l/dev-raw-vbi.xml"> 252<!ENTITY sub-dev-raw-vbi SYSTEM "v4l/dev-raw-vbi.xml">
216<!ENTITY sub-dev-rds SYSTEM "v4l/dev-rds.xml"> 253<!ENTITY sub-dev-rds SYSTEM "v4l/dev-rds.xml">
217<!ENTITY sub-dev-sliced-vbi SYSTEM "v4l/dev-sliced-vbi.xml"> 254<!ENTITY sub-dev-sliced-vbi SYSTEM "v4l/dev-sliced-vbi.xml">
255<!ENTITY sub-dev-subdev SYSTEM "v4l/dev-subdev.xml">
218<!ENTITY sub-dev-teletext SYSTEM "v4l/dev-teletext.xml"> 256<!ENTITY sub-dev-teletext SYSTEM "v4l/dev-teletext.xml">
219<!ENTITY sub-driver SYSTEM "v4l/driver.xml"> 257<!ENTITY sub-driver SYSTEM "v4l/driver.xml">
220<!ENTITY sub-libv4l SYSTEM "v4l/libv4l.xml"> 258<!ENTITY sub-libv4l SYSTEM "v4l/libv4l.xml">
@@ -232,7 +270,10 @@
232<!ENTITY sub-write SYSTEM "v4l/func-write.xml"> 270<!ENTITY sub-write SYSTEM "v4l/func-write.xml">
233<!ENTITY sub-io SYSTEM "v4l/io.xml"> 271<!ENTITY sub-io SYSTEM "v4l/io.xml">
234<!ENTITY sub-grey SYSTEM "v4l/pixfmt-grey.xml"> 272<!ENTITY sub-grey SYSTEM "v4l/pixfmt-grey.xml">
273<!ENTITY sub-m420 SYSTEM "v4l/pixfmt-m420.xml">
235<!ENTITY sub-nv12 SYSTEM "v4l/pixfmt-nv12.xml"> 274<!ENTITY sub-nv12 SYSTEM "v4l/pixfmt-nv12.xml">
275<!ENTITY sub-nv12m SYSTEM "v4l/pixfmt-nv12m.xml">
276<!ENTITY sub-nv12mt SYSTEM "v4l/pixfmt-nv12mt.xml">
236<!ENTITY sub-nv16 SYSTEM "v4l/pixfmt-nv16.xml"> 277<!ENTITY sub-nv16 SYSTEM "v4l/pixfmt-nv16.xml">
237<!ENTITY sub-packed-rgb SYSTEM "v4l/pixfmt-packed-rgb.xml"> 278<!ENTITY sub-packed-rgb SYSTEM "v4l/pixfmt-packed-rgb.xml">
238<!ENTITY sub-packed-yuv SYSTEM "v4l/pixfmt-packed-yuv.xml"> 279<!ENTITY sub-packed-yuv SYSTEM "v4l/pixfmt-packed-yuv.xml">
@@ -247,9 +288,16 @@
247<!ENTITY sub-yuv410 SYSTEM "v4l/pixfmt-yuv410.xml"> 288<!ENTITY sub-yuv410 SYSTEM "v4l/pixfmt-yuv410.xml">
248<!ENTITY sub-yuv411p SYSTEM "v4l/pixfmt-yuv411p.xml"> 289<!ENTITY sub-yuv411p SYSTEM "v4l/pixfmt-yuv411p.xml">
249<!ENTITY sub-yuv420 SYSTEM "v4l/pixfmt-yuv420.xml"> 290<!ENTITY sub-yuv420 SYSTEM "v4l/pixfmt-yuv420.xml">
291<!ENTITY sub-yuv420m SYSTEM "v4l/pixfmt-yuv420m.xml">
250<!ENTITY sub-yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml"> 292<!ENTITY sub-yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml">
251<!ENTITY sub-yuyv SYSTEM "v4l/pixfmt-yuyv.xml"> 293<!ENTITY sub-yuyv SYSTEM "v4l/pixfmt-yuyv.xml">
252<!ENTITY sub-yvyu SYSTEM "v4l/pixfmt-yvyu.xml"> 294<!ENTITY sub-yvyu SYSTEM "v4l/pixfmt-yvyu.xml">
295<!ENTITY sub-srggb10 SYSTEM "v4l/pixfmt-srggb10.xml">
296<!ENTITY sub-srggb12 SYSTEM "v4l/pixfmt-srggb12.xml">
297<!ENTITY sub-srggb8 SYSTEM "v4l/pixfmt-srggb8.xml">
298<!ENTITY sub-y10 SYSTEM "v4l/pixfmt-y10.xml">
299<!ENTITY sub-y12 SYSTEM "v4l/pixfmt-y12.xml">
300<!ENTITY sub-y10b SYSTEM "v4l/pixfmt-y10b.xml">
253<!ENTITY sub-pixfmt SYSTEM "v4l/pixfmt.xml"> 301<!ENTITY sub-pixfmt SYSTEM "v4l/pixfmt.xml">
254<!ENTITY sub-cropcap SYSTEM "v4l/vidioc-cropcap.xml"> 302<!ENTITY sub-cropcap SYSTEM "v4l/vidioc-cropcap.xml">
255<!ENTITY sub-dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml"> 303<!ENTITY sub-dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml">
@@ -295,6 +343,13 @@
295<!ENTITY sub-reqbufs SYSTEM "v4l/vidioc-reqbufs.xml"> 343<!ENTITY sub-reqbufs SYSTEM "v4l/vidioc-reqbufs.xml">
296<!ENTITY sub-s-hw-freq-seek SYSTEM "v4l/vidioc-s-hw-freq-seek.xml"> 344<!ENTITY sub-s-hw-freq-seek SYSTEM "v4l/vidioc-s-hw-freq-seek.xml">
297<!ENTITY sub-streamon SYSTEM "v4l/vidioc-streamon.xml"> 345<!ENTITY sub-streamon SYSTEM "v4l/vidioc-streamon.xml">
346<!ENTITY sub-subdev-enum-frame-interval SYSTEM "v4l/vidioc-subdev-enum-frame-interval.xml">
347<!ENTITY sub-subdev-enum-frame-size SYSTEM "v4l/vidioc-subdev-enum-frame-size.xml">
348<!ENTITY sub-subdev-enum-mbus-code SYSTEM "v4l/vidioc-subdev-enum-mbus-code.xml">
349<!ENTITY sub-subdev-formats SYSTEM "v4l/subdev-formats.xml">
350<!ENTITY sub-subdev-g-crop SYSTEM "v4l/vidioc-subdev-g-crop.xml">
351<!ENTITY sub-subdev-g-fmt SYSTEM "v4l/vidioc-subdev-g-fmt.xml">
352<!ENTITY sub-subdev-g-frame-interval SYSTEM "v4l/vidioc-subdev-g-frame-interval.xml">
298<!ENTITY sub-capture-c SYSTEM "v4l/capture.c.xml"> 353<!ENTITY sub-capture-c SYSTEM "v4l/capture.c.xml">
299<!ENTITY sub-keytable-c SYSTEM "v4l/keytable.c.xml"> 354<!ENTITY sub-keytable-c SYSTEM "v4l/keytable.c.xml">
300<!ENTITY sub-v4l2grab-c SYSTEM "v4l/v4l2grab.c.xml"> 355<!ENTITY sub-v4l2grab-c SYSTEM "v4l/v4l2grab.c.xml">
@@ -318,6 +373,15 @@
318<!ENTITY sub-media-entities SYSTEM "media-entities.tmpl"> 373<!ENTITY sub-media-entities SYSTEM "media-entities.tmpl">
319<!ENTITY sub-media-indices SYSTEM "media-indices.tmpl"> 374<!ENTITY sub-media-indices SYSTEM "media-indices.tmpl">
320 375
376<!ENTITY sub-media-controller SYSTEM "v4l/media-controller.xml">
377<!ENTITY sub-media-func-open SYSTEM "v4l/media-func-open.xml">
378<!ENTITY sub-media-func-close SYSTEM "v4l/media-func-close.xml">
379<!ENTITY sub-media-func-ioctl SYSTEM "v4l/media-func-ioctl.xml">
380<!ENTITY sub-media-ioc-device-info SYSTEM "v4l/media-ioc-device-info.xml">
381<!ENTITY sub-media-ioc-enum-entities SYSTEM "v4l/media-ioc-enum-entities.xml">
382<!ENTITY sub-media-ioc-enum-links SYSTEM "v4l/media-ioc-enum-links.xml">
383<!ENTITY sub-media-ioc-setup-link SYSTEM "v4l/media-ioc-setup-link.xml">
384
321<!-- Function Reference --> 385<!-- Function Reference -->
322<!ENTITY close SYSTEM "v4l/func-close.xml"> 386<!ENTITY close SYSTEM "v4l/func-close.xml">
323<!ENTITY ioctl SYSTEM "v4l/func-ioctl.xml"> 387<!ENTITY ioctl SYSTEM "v4l/func-ioctl.xml">
@@ -330,6 +394,7 @@
330<!ENTITY write SYSTEM "v4l/func-write.xml"> 394<!ENTITY write SYSTEM "v4l/func-write.xml">
331<!ENTITY grey SYSTEM "v4l/pixfmt-grey.xml"> 395<!ENTITY grey SYSTEM "v4l/pixfmt-grey.xml">
332<!ENTITY nv12 SYSTEM "v4l/pixfmt-nv12.xml"> 396<!ENTITY nv12 SYSTEM "v4l/pixfmt-nv12.xml">
397<!ENTITY nv12m SYSTEM "v4l/pixfmt-nv12m.xml">
333<!ENTITY nv16 SYSTEM "v4l/pixfmt-nv16.xml"> 398<!ENTITY nv16 SYSTEM "v4l/pixfmt-nv16.xml">
334<!ENTITY packed-rgb SYSTEM "v4l/pixfmt-packed-rgb.xml"> 399<!ENTITY packed-rgb SYSTEM "v4l/pixfmt-packed-rgb.xml">
335<!ENTITY packed-yuv SYSTEM "v4l/pixfmt-packed-yuv.xml"> 400<!ENTITY packed-yuv SYSTEM "v4l/pixfmt-packed-yuv.xml">
@@ -344,9 +409,13 @@
344<!ENTITY yuv410 SYSTEM "v4l/pixfmt-yuv410.xml"> 409<!ENTITY yuv410 SYSTEM "v4l/pixfmt-yuv410.xml">
345<!ENTITY yuv411p SYSTEM "v4l/pixfmt-yuv411p.xml"> 410<!ENTITY yuv411p SYSTEM "v4l/pixfmt-yuv411p.xml">
346<!ENTITY yuv420 SYSTEM "v4l/pixfmt-yuv420.xml"> 411<!ENTITY yuv420 SYSTEM "v4l/pixfmt-yuv420.xml">
412<!ENTITY yuv420m SYSTEM "v4l/pixfmt-yuv420m.xml">
347<!ENTITY yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml"> 413<!ENTITY yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml">
348<!ENTITY yuyv SYSTEM "v4l/pixfmt-yuyv.xml"> 414<!ENTITY yuyv SYSTEM "v4l/pixfmt-yuyv.xml">
349<!ENTITY yvyu SYSTEM "v4l/pixfmt-yvyu.xml"> 415<!ENTITY yvyu SYSTEM "v4l/pixfmt-yvyu.xml">
416<!ENTITY srggb10 SYSTEM "v4l/pixfmt-srggb10.xml">
417<!ENTITY srggb8 SYSTEM "v4l/pixfmt-srggb8.xml">
418<!ENTITY y10 SYSTEM "v4l/pixfmt-y10.xml">
350<!ENTITY cropcap SYSTEM "v4l/vidioc-cropcap.xml"> 419<!ENTITY cropcap SYSTEM "v4l/vidioc-cropcap.xml">
351<!ENTITY dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml"> 420<!ENTITY dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml">
352<!ENTITY encoder-cmd SYSTEM "v4l/vidioc-encoder-cmd.xml"> 421<!ENTITY encoder-cmd SYSTEM "v4l/vidioc-encoder-cmd.xml">
diff --git a/Documentation/DocBook/media.tmpl b/Documentation/DocBook/media.tmpl
index f11048d4053f..88f2cc680cc2 100644
--- a/Documentation/DocBook/media.tmpl
+++ b/Documentation/DocBook/media.tmpl
@@ -28,7 +28,7 @@
28<title>LINUX MEDIA INFRASTRUCTURE API</title> 28<title>LINUX MEDIA INFRASTRUCTURE API</title>
29 29
30<copyright> 30<copyright>
31 <year>2009-2010</year> 31 <year>2009-2011</year>
32 <holder>LinuxTV Developers</holder> 32 <holder>LinuxTV Developers</holder>
33</copyright> 33</copyright>
34 34
@@ -86,7 +86,7 @@ Foundation. A copy of the license is included in the chapter entitled
86</author> 86</author>
87</authorgroup> 87</authorgroup>
88<copyright> 88<copyright>
89 <year>2009-2010</year> 89 <year>2009-2011</year>
90 <holder>Mauro Carvalho Chehab</holder> 90 <holder>Mauro Carvalho Chehab</holder>
91</copyright> 91</copyright>
92 92
@@ -106,6 +106,9 @@ Foundation. A copy of the license is included in the chapter entitled
106&sub-remote_controllers; 106&sub-remote_controllers;
107</chapter> 107</chapter>
108</part> 108</part>
109<part id="media_common">
110&sub-media-controller;
111</part>
109 112
110&sub-fdl-appendix; 113&sub-fdl-appendix;
111 114
diff --git a/Documentation/DocBook/mtdnand.tmpl b/Documentation/DocBook/mtdnand.tmpl
index 020ac80d4682..17910e2052ad 100644
--- a/Documentation/DocBook/mtdnand.tmpl
+++ b/Documentation/DocBook/mtdnand.tmpl
@@ -189,8 +189,7 @@ static void __iomem *baseaddr;
189 <title>Partition defines</title> 189 <title>Partition defines</title>
190 <para> 190 <para>
191 If you want to divide your device into partitions, then 191 If you want to divide your device into partitions, then
192 enable the configuration switch CONFIG_MTD_PARTITIONS and define 192 define a partitioning scheme suitable to your board.
193 a partitioning scheme suitable to your board.
194 </para> 193 </para>
195 <programlisting> 194 <programlisting>
196#define NUM_PARTITIONS 2 195#define NUM_PARTITIONS 2
@@ -250,7 +249,7 @@ static void board_hwcontrol(struct mtd_info *mtd, int cmd)
250 <title>Device ready function</title> 249 <title>Device ready function</title>
251 <para> 250 <para>
252 If the hardware interface has the ready busy pin of the NAND chip connected to a 251 If the hardware interface has the ready busy pin of the NAND chip connected to a
253 GPIO or other accesible I/O pin, this function is used to read back the state of the 252 GPIO or other accessible I/O pin, this function is used to read back the state of the
254 pin. The function has no arguments and should return 0, if the device is busy (R/B pin 253 pin. The function has no arguments and should return 0, if the device is busy (R/B pin
255 is low) and 1, if the device is ready (R/B pin is high). 254 is low) and 1, if the device is ready (R/B pin is high).
256 If the hardware interface does not give access to the ready busy pin, then 255 If the hardware interface does not give access to the ready busy pin, then
@@ -485,7 +484,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
485 Reed-Solomon library. 484 Reed-Solomon library.
486 </para> 485 </para>
487 <para> 486 <para>
488 The ECC bytes must be placed immidiately after the data 487 The ECC bytes must be placed immediately after the data
489 bytes in order to make the syndrome generator work. This 488 bytes in order to make the syndrome generator work. This
490 is contrary to the usual layout used by software ECC. The 489 is contrary to the usual layout used by software ECC. The
491 separation of data and out of band area is not longer 490 separation of data and out of band area is not longer
@@ -629,7 +628,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
629 holds the bad block table. Store a pointer to the pattern 628 holds the bad block table. Store a pointer to the pattern
630 in the pattern field. Further the length of the pattern has to be 629 in the pattern field. Further the length of the pattern has to be
631 stored in len and the offset in the spare area must be given 630 stored in len and the offset in the spare area must be given
632 in the offs member of the nand_bbt_descr stucture. For mirrored 631 in the offs member of the nand_bbt_descr structure. For mirrored
633 bad block tables different patterns are mandatory.</para></listitem> 632 bad block tables different patterns are mandatory.</para></listitem>
634 <listitem><para>Table creation</para> 633 <listitem><para>Table creation</para>
635 <para>Set the option NAND_BBT_CREATE to enable the table creation 634 <para>Set the option NAND_BBT_CREATE to enable the table creation
@@ -648,7 +647,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
648 <listitem><para>Table version control</para> 647 <listitem><para>Table version control</para>
649 <para>Set the option NAND_BBT_VERSION to enable the table version control. 648 <para>Set the option NAND_BBT_VERSION to enable the table version control.
650 It's highly recommended to enable this for mirrored tables with write 649 It's highly recommended to enable this for mirrored tables with write
651 support. It makes sure that the risk of loosing the bad block 650 support. It makes sure that the risk of losing the bad block
652 table information is reduced to the loss of the information about the 651 table information is reduced to the loss of the information about the
653 one worn out block which should be marked bad. The version is stored in 652 one worn out block which should be marked bad. The version is stored in
654 4 consecutive bytes in the spare area of the device. The position of 653 4 consecutive bytes in the spare area of the device. The position of
@@ -1060,19 +1059,19 @@ data in this page</entry>
1060<row> 1059<row>
1061<entry>0x3D</entry> 1060<entry>0x3D</entry>
1062<entry>ECC byte 21</entry> 1061<entry>ECC byte 21</entry>
1063<entry>Error correction code byte 0 of the eigth 256 Bytes of data 1062<entry>Error correction code byte 0 of the eighth 256 Bytes of data
1064in this page</entry> 1063in this page</entry>
1065</row> 1064</row>
1066<row> 1065<row>
1067<entry>0x3E</entry> 1066<entry>0x3E</entry>
1068<entry>ECC byte 22</entry> 1067<entry>ECC byte 22</entry>
1069<entry>Error correction code byte 1 of the eigth 256 Bytes of data 1068<entry>Error correction code byte 1 of the eighth 256 Bytes of data
1070in this page</entry> 1069in this page</entry>
1071</row> 1070</row>
1072<row> 1071<row>
1073<entry>0x3F</entry> 1072<entry>0x3F</entry>
1074<entry>ECC byte 23</entry> 1073<entry>ECC byte 23</entry>
1075<entry>Error correction code byte 2 of the eigth 256 Bytes of data 1074<entry>Error correction code byte 2 of the eighth 256 Bytes of data
1076in this page</entry> 1075in this page</entry>
1077</row> 1076</row>
1078</tbody></tgroup></informaltable> 1077</tbody></tgroup></informaltable>
diff --git a/Documentation/DocBook/rapidio.tmpl b/Documentation/DocBook/rapidio.tmpl
index 54eb26b57372..50479360d845 100644
--- a/Documentation/DocBook/rapidio.tmpl
+++ b/Documentation/DocBook/rapidio.tmpl
@@ -133,7 +133,6 @@
133!Idrivers/rapidio/rio-sysfs.c 133!Idrivers/rapidio/rio-sysfs.c
134 </sect1> 134 </sect1>
135 <sect1 id="PPC32_support"><title>PPC32 support</title> 135 <sect1 id="PPC32_support"><title>PPC32 support</title>
136!Earch/powerpc/sysdev/fsl_rio.c
137!Iarch/powerpc/sysdev/fsl_rio.c 136!Iarch/powerpc/sysdev/fsl_rio.c
138 </sect1> 137 </sect1>
139 </chapter> 138 </chapter>
diff --git a/Documentation/DocBook/regulator.tmpl b/Documentation/DocBook/regulator.tmpl
index 53f4f8d3b810..346e552fa2cc 100644
--- a/Documentation/DocBook/regulator.tmpl
+++ b/Documentation/DocBook/regulator.tmpl
@@ -267,8 +267,8 @@
267 <sect1 id="machine-constraint"> 267 <sect1 id="machine-constraint">
268 <title>Constraints</title> 268 <title>Constraints</title>
269 <para> 269 <para>
270 As well as definining the connections the machine interface 270 As well as defining the connections the machine interface
271 also provides constraints definining the operations that 271 also provides constraints defining the operations that
272 clients are allowed to perform and the parameters that may be 272 clients are allowed to perform and the parameters that may be
273 set. This is required since generally regulator devices will 273 set. This is required since generally regulator devices will
274 offer more flexibility than it is safe to use on a given 274 offer more flexibility than it is safe to use on a given
diff --git a/Documentation/DocBook/sh.tmpl b/Documentation/DocBook/sh.tmpl
index d858d92cf6d9..4a38f604fa66 100644
--- a/Documentation/DocBook/sh.tmpl
+++ b/Documentation/DocBook/sh.tmpl
@@ -79,10 +79,6 @@
79 </sect2> 79 </sect2>
80 </sect1> 80 </sect1>
81 </chapter> 81 </chapter>
82 <chapter id="clk">
83 <title>Clock Framework Extensions</title>
84!Iinclude/linux/sh_clk.h
85 </chapter>
86 <chapter id="mach"> 82 <chapter id="mach">
87 <title>Machine Specific Interfaces</title> 83 <title>Machine Specific Interfaces</title>
88 <sect1 id="dreamcast"> 84 <sect1 id="dreamcast">
diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl
index 4d4ce0e61e42..7c4b514d62b1 100644
--- a/Documentation/DocBook/uio-howto.tmpl
+++ b/Documentation/DocBook/uio-howto.tmpl
@@ -16,7 +16,7 @@
16 </orgname> 16 </orgname>
17 17
18 <address> 18 <address>
19 <email>hjk@linutronix.de</email> 19 <email>hjk@hansjkoch.de</email>
20 </address> 20 </address>
21 </affiliation> 21 </affiliation>
22</author> 22</author>
@@ -114,7 +114,7 @@ GPL version 2.
114 114
115<para>If you know of any translations for this document, or you are 115<para>If you know of any translations for this document, or you are
116interested in translating it, please email me 116interested in translating it, please email me
117<email>hjk@linutronix.de</email>. 117<email>hjk@hansjkoch.de</email>.
118</para> 118</para>
119</sect1> 119</sect1>
120 120
@@ -171,7 +171,7 @@ interested in translating it, please email me
171<title>Feedback</title> 171<title>Feedback</title>
172 <para>Find something wrong with this document? (Or perhaps something 172 <para>Find something wrong with this document? (Or perhaps something
173 right?) I would love to hear from you. Please email me at 173 right?) I would love to hear from you. Please email me at
174 <email>hjk@linutronix.de</email>.</para> 174 <email>hjk@hansjkoch.de</email>.</para>
175</sect1> 175</sect1>
176</chapter> 176</chapter>
177 177
@@ -797,7 +797,7 @@ framework to set up sysfs files for this region. Simply leave it alone.
797 perform some initialization. After that, your hardware 797 perform some initialization. After that, your hardware
798 starts working and will generate an interrupt as soon 798 starts working and will generate an interrupt as soon
799 as it's finished, has some data available, or needs your 799 as it's finished, has some data available, or needs your
800 attention because an error occured. 800 attention because an error occurred.
801 </para> 801 </para>
802 <para> 802 <para>
803 <filename>/dev/uioX</filename> is a read-only file. A 803 <filename>/dev/uioX</filename> is a read-only file. A
diff --git a/Documentation/DocBook/usb.tmpl b/Documentation/DocBook/usb.tmpl
index af293606fbe3..8d57c1888dca 100644
--- a/Documentation/DocBook/usb.tmpl
+++ b/Documentation/DocBook/usb.tmpl
@@ -690,7 +690,7 @@ usbdev_ioctl (int fd, int ifno, unsigned request, void *param)
690 </para><para> 690 </para><para>
691 This request lets kernel drivers talk to user mode code 691 This request lets kernel drivers talk to user mode code
692 through filesystem operations even when they don't create 692 through filesystem operations even when they don't create
693 a charactor or block special device. 693 a character or block special device.
694 It's also been used to do things like ask devices what 694 It's also been used to do things like ask devices what
695 device special file should be used. 695 device special file should be used.
696 Two pre-defined ioctls are used 696 Two pre-defined ioctls are used
diff --git a/Documentation/DocBook/v4l/bayer.pdf b/Documentation/DocBook/v4l/bayer.pdf
new file mode 100644
index 000000000000..905e60e6cd42
--- /dev/null
+++ b/Documentation/DocBook/v4l/bayer.pdf
Binary files differ
diff --git a/Documentation/DocBook/v4l/bayer.png b/Documentation/DocBook/v4l/bayer.png
new file mode 100644
index 000000000000..9b15fb22e817
--- /dev/null
+++ b/Documentation/DocBook/v4l/bayer.png
Binary files differ
diff --git a/Documentation/DocBook/v4l/common.xml b/Documentation/DocBook/v4l/common.xml
index cea23e1c4fc6..9028721438dc 100644
--- a/Documentation/DocBook/v4l/common.xml
+++ b/Documentation/DocBook/v4l/common.xml
@@ -100,7 +100,7 @@ linux-kernel@vger.kernel.org, 2002-11-20. --></para>
100 100
101 <para>By convention system administrators create various 101 <para>By convention system administrators create various
102character device special files with these major and minor numbers in 102character device special files with these major and minor numbers in
103the <filename>/dev</filename> directory. The names recomended for the 103the <filename>/dev</filename> directory. The names recommended for the
104different V4L2 device types are listed in <xref linkend="devices" />. 104different V4L2 device types are listed in <xref linkend="devices" />.
105</para> 105</para>
106 106
@@ -846,6 +846,8 @@ conversion routine or library for integration into applications.</para>
846 </section> 846 </section>
847 </section> 847 </section>
848 848
849 &sub-planar-apis;
850
849 <section id="crop"> 851 <section id="crop">
850 <title>Image Cropping, Insertion and Scaling</title> 852 <title>Image Cropping, Insertion and Scaling</title>
851 853
diff --git a/Documentation/DocBook/v4l/compat.xml b/Documentation/DocBook/v4l/compat.xml
index 54447f0d0784..9f7cd4f25792 100644
--- a/Documentation/DocBook/v4l/compat.xml
+++ b/Documentation/DocBook/v4l/compat.xml
@@ -21,11 +21,15 @@ API.</para>
21 <title>Opening and Closing Devices</title> 21 <title>Opening and Closing Devices</title>
22 22
23 <para>For compatibility reasons the character device file names 23 <para>For compatibility reasons the character device file names
24recommended for V4L2 video capture, overlay, radio, teletext and raw 24recommended for V4L2 video capture, overlay, radio and raw
25vbi capture devices did not change from those used by V4L. They are 25vbi capture devices did not change from those used by V4L. They are
26listed in <xref linkend="devices" /> and below in <xref 26listed in <xref linkend="devices" /> and below in <xref
27 linkend="v4l-dev" />.</para> 27 linkend="v4l-dev" />.</para>
28 28
29 <para>The teletext devices (minor range 192-223) have been removed in
30V4L2 and no longer exist. There is no hardware available anymore for handling
31pure teletext. Instead raw or sliced VBI is used.</para>
32
29 <para>The V4L <filename>videodev</filename> module automatically 33 <para>The V4L <filename>videodev</filename> module automatically
30assigns minor numbers to drivers in load order, depending on the 34assigns minor numbers to drivers in load order, depending on the
31registered device type. We recommend that V4L2 drivers by default 35registered device type. We recommend that V4L2 drivers by default
@@ -66,13 +70,6 @@ not compatible with V4L or V4L2.</para> </footnote>,
66 <entry>64-127</entry> 70 <entry>64-127</entry>
67 </row> 71 </row>
68 <row> 72 <row>
69 <entry>Teletext decoder</entry>
70 <entry><para><filename>/dev/vtx</filename>,
71<filename>/dev/vtx0</filename> to
72<filename>/dev/vtx31</filename></para></entry>
73 <entry>192-223</entry>
74 </row>
75 <row>
76 <entry>Raw VBI capture</entry> 73 <entry>Raw VBI capture</entry>
77 <entry><para><filename>/dev/vbi</filename>, 74 <entry><para><filename>/dev/vbi</filename>,
78<filename>/dev/vbi0</filename> to 75<filename>/dev/vbi0</filename> to
@@ -1714,8 +1711,8 @@ ioctl would enumerate the available audio inputs. An ioctl to
1714determine the current audio input, if more than one combines with the 1711determine the current audio input, if more than one combines with the
1715current video input, did not exist. So 1712current video input, did not exist. So
1716<constant>VIDIOC_G_AUDIO</constant> was renamed to 1713<constant>VIDIOC_G_AUDIO</constant> was renamed to
1717<constant>VIDIOC_G_AUDIO_OLD</constant>, this ioctl will be removed in 1714<constant>VIDIOC_G_AUDIO_OLD</constant>, this ioctl was removed on
1718the future. The &VIDIOC-ENUMAUDIO; ioctl was added to enumerate 1715Kernel 2.6.39. The &VIDIOC-ENUMAUDIO; ioctl was added to enumerate
1719audio inputs, while &VIDIOC-G-AUDIO; now reports the current audio 1716audio inputs, while &VIDIOC-G-AUDIO; now reports the current audio
1720input.</para> 1717input.</para>
1721 <para>The same changes were made to &VIDIOC-G-AUDOUT; and 1718 <para>The same changes were made to &VIDIOC-G-AUDOUT; and
@@ -1729,7 +1726,7 @@ must be updated to successfully compile again.</para>
1729 <para>The &VIDIOC-OVERLAY; ioctl was incorrectly defined with 1726 <para>The &VIDIOC-OVERLAY; ioctl was incorrectly defined with
1730write-read parameter. It was changed to write-only, while the write-read 1727write-read parameter. It was changed to write-only, while the write-read
1731version was renamed to <constant>VIDIOC_OVERLAY_OLD</constant>. The old 1728version was renamed to <constant>VIDIOC_OVERLAY_OLD</constant>. The old
1732ioctl will be removed in the future. Until further the "videodev" 1729ioctl was removed on Kernel 2.6.39. Until further the "videodev"
1733kernel module will automatically translate to the new version, so drivers 1730kernel module will automatically translate to the new version, so drivers
1734must be recompiled, but not applications.</para> 1731must be recompiled, but not applications.</para>
1735 </listitem> 1732 </listitem>
@@ -1747,7 +1744,7 @@ surface can be seen.</para>
1747defined with write-only parameter, inconsistent with other ioctls 1744defined with write-only parameter, inconsistent with other ioctls
1748modifying their argument. They were changed to write-read, while a 1745modifying their argument. They were changed to write-read, while a
1749<constant>_OLD</constant> suffix was added to the write-only versions. 1746<constant>_OLD</constant> suffix was added to the write-only versions.
1750The old ioctls will be removed in the future. Drivers and 1747The old ioctls were removed on Kernel 2.6.39. Drivers and
1751applications assuming a constant parameter need an update.</para> 1748applications assuming a constant parameter need an update.</para>
1752 </listitem> 1749 </listitem>
1753 </orderedlist> 1750 </orderedlist>
@@ -1818,8 +1815,8 @@ yet to be addressed, for details see <xref
1818 <para>The &VIDIOC-CROPCAP; ioctl was incorrectly defined 1815 <para>The &VIDIOC-CROPCAP; ioctl was incorrectly defined
1819with read-only parameter. It is now defined as write-read ioctl, while 1816with read-only parameter. It is now defined as write-read ioctl, while
1820the read-only version was renamed to 1817the read-only version was renamed to
1821<constant>VIDIOC_CROPCAP_OLD</constant>. The old ioctl will be removed 1818<constant>VIDIOC_CROPCAP_OLD</constant>. The old ioctl was removed
1822in the future.</para> 1819on Kernel 2.6.39.</para>
1823 </listitem> 1820 </listitem>
1824 </orderedlist> 1821 </orderedlist>
1825 </section> 1822 </section>
@@ -2345,6 +2342,31 @@ more information.</para>
2345 </listitem> 2342 </listitem>
2346 </orderedlist> 2343 </orderedlist>
2347 </section> 2344 </section>
2345 <section>
2346 <title>V4L2 in Linux 2.6.37</title>
2347 <orderedlist>
2348 <listitem>
2349 <para>Remove the vtx (videotext/teletext) API. This API was no longer
2350used and no hardware exists to verify the API. Nor were any userspace applications found
2351that used it. It was originally scheduled for removal in 2.6.35.
2352 </para>
2353 </listitem>
2354 </orderedlist>
2355 </section>
2356 <section>
2357 <title>V4L2 in Linux 2.6.39</title>
2358 <orderedlist>
2359 <listitem>
2360 <para>The old VIDIOC_*_OLD symbols and V4L1 support were removed.</para>
2361 </listitem>
2362 <listitem>
2363 <para>Multi-planar API added. Does not affect the compatibility of
2364 current drivers and applications. See
2365 <link linkend="planar-apis">multi-planar API</link>
2366 for details.</para>
2367 </listitem>
2368 </orderedlist>
2369 </section>
2348 2370
2349 <section id="other"> 2371 <section id="other">
2350 <title>Relation of V4L2 to other Linux multimedia APIs</title> 2372 <title>Relation of V4L2 to other Linux multimedia APIs</title>
diff --git a/Documentation/DocBook/v4l/controls.xml b/Documentation/DocBook/v4l/controls.xml
index 8408caaee276..a920ee80f640 100644
--- a/Documentation/DocBook/v4l/controls.xml
+++ b/Documentation/DocBook/v4l/controls.xml
@@ -312,10 +312,17 @@ minimum value disables backlight compensation.</entry>
312 information and bits 24-31 must be zero.</entry> 312 information and bits 24-31 must be zero.</entry>
313 </row> 313 </row>
314 <row> 314 <row>
315 <entry><constant>V4L2_CID_ILLUMINATORS_1</constant>
316 <constant>V4L2_CID_ILLUMINATORS_2</constant></entry>
317 <entry>boolean</entry>
318 <entry>Switch on or off the illuminator 1 or 2 of the device
319 (usually a microscope).</entry>
320 </row>
321 <row>
315 <entry><constant>V4L2_CID_LASTP1</constant></entry> 322 <entry><constant>V4L2_CID_LASTP1</constant></entry>
316 <entry></entry> 323 <entry></entry>
317 <entry>End of the predefined control IDs (currently 324 <entry>End of the predefined control IDs (currently
318<constant>V4L2_CID_BG_COLOR</constant> + 1).</entry> 325<constant>V4L2_CID_ILLUMINATORS_2</constant> + 1).</entry>
319 </row> 326 </row>
320 <row> 327 <row>
321 <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry> 328 <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry>
@@ -357,9 +364,6 @@ enumerate_menu (void)
357 querymenu.index++) { 364 querymenu.index++) {
358 if (0 == ioctl (fd, &VIDIOC-QUERYMENU;, &amp;querymenu)) { 365 if (0 == ioctl (fd, &VIDIOC-QUERYMENU;, &amp;querymenu)) {
359 printf (" %s\n", querymenu.name); 366 printf (" %s\n", querymenu.name);
360 } else {
361 perror ("VIDIOC_QUERYMENU");
362 exit (EXIT_FAILURE);
363 } 367 }
364 } 368 }
365} 369}
@@ -1239,7 +1243,7 @@ values are:</entry>
1239 </row><row><entry spanname="descr">Mutes the audio when 1243 </row><row><entry spanname="descr">Mutes the audio when
1240capturing. This is not done by muting audio hardware, which can still 1244capturing. This is not done by muting audio hardware, which can still
1241produce a slight hiss, but in the encoder itself, guaranteeing a fixed 1245produce a slight hiss, but in the encoder itself, guaranteeing a fixed
1242and reproducable audio bitstream. 0 = unmuted, 1 = muted.</entry> 1246and reproducible audio bitstream. 0 = unmuted, 1 = muted.</entry>
1243 </row> 1247 </row>
1244 <row><entry></entry></row> 1248 <row><entry></entry></row>
1245 <row id="v4l2-mpeg-video-encoding"> 1249 <row id="v4l2-mpeg-video-encoding">
diff --git a/Documentation/DocBook/v4l/dev-capture.xml b/Documentation/DocBook/v4l/dev-capture.xml
index 32807e43f170..2237c661f26a 100644
--- a/Documentation/DocBook/v4l/dev-capture.xml
+++ b/Documentation/DocBook/v4l/dev-capture.xml
@@ -18,7 +18,8 @@ files are used for video output devices.</para>
18 <title>Querying Capabilities</title> 18 <title>Querying Capabilities</title>
19 19
20 <para>Devices supporting the video capture interface set the 20 <para>Devices supporting the video capture interface set the
21<constant>V4L2_CAP_VIDEO_CAPTURE</constant> flag in the 21<constant>V4L2_CAP_VIDEO_CAPTURE</constant> or
22<constant>V4L2_CAP_VIDEO_CAPTURE_MPLANE</constant> flag in the
22<structfield>capabilities</structfield> field of &v4l2-capability; 23<structfield>capabilities</structfield> field of &v4l2-capability;
23returned by the &VIDIOC-QUERYCAP; ioctl. As secondary device functions 24returned by the &VIDIOC-QUERYCAP; ioctl. As secondary device functions
24they may also support the <link linkend="overlay">video overlay</link> 25they may also support the <link linkend="overlay">video overlay</link>
@@ -64,9 +65,11 @@ linkend="crop" />.</para>
64 65
65 <para>To query the current image format applications set the 66 <para>To query the current image format applications set the
66<structfield>type</structfield> field of a &v4l2-format; to 67<structfield>type</structfield> field of a &v4l2-format; to
67<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant> and call the 68<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant> or
69<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant> and call the
68&VIDIOC-G-FMT; ioctl with a pointer to this structure. Drivers fill 70&VIDIOC-G-FMT; ioctl with a pointer to this structure. Drivers fill
69the &v4l2-pix-format; <structfield>pix</structfield> member of the 71the &v4l2-pix-format; <structfield>pix</structfield> or the
72&v4l2-pix-format-mplane; <structfield>pix_mp</structfield> member of the
70<structfield>fmt</structfield> union.</para> 73<structfield>fmt</structfield> union.</para>
71 74
72 <para>To request different parameters applications set the 75 <para>To request different parameters applications set the
@@ -84,8 +87,8 @@ adjust the parameters and finally return the actual parameters as
84without disabling I/O or possibly time consuming hardware 87without disabling I/O or possibly time consuming hardware
85preparations.</para> 88preparations.</para>
86 89
87 <para>The contents of &v4l2-pix-format; are discussed in <xref 90 <para>The contents of &v4l2-pix-format; and &v4l2-pix-format-mplane;
88linkend="pixfmt" />. See also the specification of the 91are discussed in <xref linkend="pixfmt" />. See also the specification of the
89<constant>VIDIOC_G_FMT</constant>, <constant>VIDIOC_S_FMT</constant> 92<constant>VIDIOC_G_FMT</constant>, <constant>VIDIOC_S_FMT</constant>
90and <constant>VIDIOC_TRY_FMT</constant> ioctls for details. Video 93and <constant>VIDIOC_TRY_FMT</constant> ioctls for details. Video
91capture devices must implement both the 94capture devices must implement both the
diff --git a/Documentation/DocBook/v4l/dev-output.xml b/Documentation/DocBook/v4l/dev-output.xml
index 63c3c20e5a72..919e22c53854 100644
--- a/Documentation/DocBook/v4l/dev-output.xml
+++ b/Documentation/DocBook/v4l/dev-output.xml
@@ -17,7 +17,8 @@ files are used for video capture devices.</para>
17 <title>Querying Capabilities</title> 17 <title>Querying Capabilities</title>
18 18
19 <para>Devices supporting the video output interface set the 19 <para>Devices supporting the video output interface set the
20<constant>V4L2_CAP_VIDEO_OUTPUT</constant> flag in the 20<constant>V4L2_CAP_VIDEO_OUTPUT</constant> or
21<constant>V4L2_CAP_VIDEO_OUTPUT_MPLANE</constant> flag in the
21<structfield>capabilities</structfield> field of &v4l2-capability; 22<structfield>capabilities</structfield> field of &v4l2-capability;
22returned by the &VIDIOC-QUERYCAP; ioctl. As secondary device functions 23returned by the &VIDIOC-QUERYCAP; ioctl. As secondary device functions
23they may also support the <link linkend="raw-vbi">raw VBI 24they may also support the <link linkend="raw-vbi">raw VBI
@@ -60,9 +61,11 @@ linkend="crop" />.</para>
60 61
61 <para>To query the current image format applications set the 62 <para>To query the current image format applications set the
62<structfield>type</structfield> field of a &v4l2-format; to 63<structfield>type</structfield> field of a &v4l2-format; to
63<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant> and call the 64<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant> or
65<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant> and call the
64&VIDIOC-G-FMT; ioctl with a pointer to this structure. Drivers fill 66&VIDIOC-G-FMT; ioctl with a pointer to this structure. Drivers fill
65the &v4l2-pix-format; <structfield>pix</structfield> member of the 67the &v4l2-pix-format; <structfield>pix</structfield> or the
68&v4l2-pix-format-mplane; <structfield>pix_mp</structfield> member of the
66<structfield>fmt</structfield> union.</para> 69<structfield>fmt</structfield> union.</para>
67 70
68 <para>To request different parameters applications set the 71 <para>To request different parameters applications set the
@@ -80,8 +83,8 @@ adjust the parameters and finally return the actual parameters as
80without disabling I/O or possibly time consuming hardware 83without disabling I/O or possibly time consuming hardware
81preparations.</para> 84preparations.</para>
82 85
83 <para>The contents of &v4l2-pix-format; are discussed in <xref 86 <para>The contents of &v4l2-pix-format; and &v4l2-pix-format-mplane;
84linkend="pixfmt" />. See also the specification of the 87are discussed in <xref linkend="pixfmt" />. See also the specification of the
85<constant>VIDIOC_G_FMT</constant>, <constant>VIDIOC_S_FMT</constant> 88<constant>VIDIOC_G_FMT</constant>, <constant>VIDIOC_S_FMT</constant>
86and <constant>VIDIOC_TRY_FMT</constant> ioctls for details. Video 89and <constant>VIDIOC_TRY_FMT</constant> ioctls for details. Video
87output devices must implement both the 90output devices must implement both the
diff --git a/Documentation/DocBook/v4l/dev-rds.xml b/Documentation/DocBook/v4l/dev-rds.xml
index 0869d701b1e5..2427f54397e7 100644
--- a/Documentation/DocBook/v4l/dev-rds.xml
+++ b/Documentation/DocBook/v4l/dev-rds.xml
@@ -3,15 +3,16 @@
3 <para>The Radio Data System transmits supplementary 3 <para>The Radio Data System transmits supplementary
4information in binary format, for example the station name or travel 4information in binary format, for example the station name or travel
5information, on an inaudible audio subcarrier of a radio program. This 5information, on an inaudible audio subcarrier of a radio program. This
6interface is aimed at devices capable of receiving and decoding RDS 6interface is aimed at devices capable of receiving and/or transmitting RDS
7information.</para> 7information.</para>
8 8
9 <para>For more information see the core RDS standard <xref linkend="en50067" /> 9 <para>For more information see the core RDS standard <xref linkend="en50067" />
10and the RBDS standard <xref linkend="nrsc4" />.</para> 10and the RBDS standard <xref linkend="nrsc4" />.</para>
11 11
12 <para>Note that the RBDS standard as is used in the USA is almost identical 12 <para>Note that the RBDS standard as is used in the USA is almost identical
13to the RDS standard. Any RDS decoder can also handle RBDS. Only some of the fields 13to the RDS standard. Any RDS decoder/encoder can also handle RBDS. Only some of the
14have slightly different meanings. See the RBDS standard for more information.</para> 14fields have slightly different meanings. See the RBDS standard for more
15information.</para>
15 16
16 <para>The RBDS standard also specifies support for MMBS (Modified Mobile Search). 17 <para>The RBDS standard also specifies support for MMBS (Modified Mobile Search).
17This is a proprietary format which seems to be discontinued. The RDS interface does not 18This is a proprietary format which seems to be discontinued. The RDS interface does not
@@ -21,16 +22,25 @@ be needed, then please contact the linux-media mailing list: &v4l-ml;.</para>
21 <section> 22 <section>
22 <title>Querying Capabilities</title> 23 <title>Querying Capabilities</title>
23 24
24 <para>Devices supporting the RDS capturing API 25 <para>Devices supporting the RDS capturing API set
25set the <constant>V4L2_CAP_RDS_CAPTURE</constant> flag in 26the <constant>V4L2_CAP_RDS_CAPTURE</constant> flag in
26the <structfield>capabilities</structfield> field of &v4l2-capability; 27the <structfield>capabilities</structfield> field of &v4l2-capability;
27returned by the &VIDIOC-QUERYCAP; ioctl. 28returned by the &VIDIOC-QUERYCAP; ioctl. Any tuner that supports RDS
28Any tuner that supports RDS will set the 29will set the <constant>V4L2_TUNER_CAP_RDS</constant> flag in
29<constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield> 30the <structfield>capability</structfield> field of &v4l2-tuner;. If
30field of &v4l2-tuner;. 31the driver only passes RDS blocks without interpreting the data
31Whether an RDS signal is present can be detected by looking at 32the <constant>V4L2_TUNER_SUB_RDS_BLOCK_IO</constant> flag has to be
32the <structfield>rxsubchans</structfield> field of &v4l2-tuner;: the 33set, see <link linkend="reading-rds-data">Reading RDS data</link>.
33<constant>V4L2_TUNER_SUB_RDS</constant> will be set if RDS data was detected.</para> 34For future use the
35flag <constant>V4L2_TUNER_SUB_RDS_CONTROLS</constant> has also been
36defined. However, a driver for a radio tuner with this capability does
37not yet exist, so if you are planning to write such a driver you
38should discuss this on the linux-media mailing list: &v4l-ml;.</para>
39
40 <para> Whether an RDS signal is present can be detected by looking
41at the <structfield>rxsubchans</structfield> field of &v4l2-tuner;:
42the <constant>V4L2_TUNER_SUB_RDS</constant> will be set if RDS data
43was detected.</para>
34 44
35 <para>Devices supporting the RDS output API 45 <para>Devices supporting the RDS output API
36set the <constant>V4L2_CAP_RDS_OUTPUT</constant> flag in 46set the <constant>V4L2_CAP_RDS_OUTPUT</constant> flag in
@@ -40,16 +50,32 @@ Any modulator that supports RDS will set the
40<constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield> 50<constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield>
41field of &v4l2-modulator;. 51field of &v4l2-modulator;.
42In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant> 52In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant>
43bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;.</para> 53bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;.
44 54If the driver only passes RDS blocks without interpreting the data
55the <constant>V4L2_TUNER_SUB_RDS_BLOCK_IO</constant> flag has to be set. If the
56tuner is capable of handling RDS entities like program identification codes and radio
57text, the flag <constant>V4L2_TUNER_SUB_RDS_CONTROLS</constant> should be set,
58see <link linkend="writing-rds-data">Writing RDS data</link> and
59<link linkend="fm-tx-controls">FM Transmitter Control Reference</link>.</para>
45 </section> 60 </section>
46 61
47 <section> 62 <section id="reading-rds-data">
48 <title>Reading RDS data</title> 63 <title>Reading RDS data</title>
49 64
50 <para>RDS data can be read from the radio device 65 <para>RDS data can be read from the radio device
51with the &func-read; function. The data is packed in groups of three bytes, 66with the &func-read; function. The data is packed in groups of three bytes.</para>
67 </section>
68
69 <section id="writing-rds-data">
70 <title>Writing RDS data</title>
71
72 <para>RDS data can be written to the radio device
73with the &func-write; function. The data is packed in groups of three bytes,
52as follows:</para> 74as follows:</para>
75 </section>
76
77 <section>
78 <title>RDS datastructures</title>
53 <table frame="none" pgwide="1" id="v4l2-rds-data"> 79 <table frame="none" pgwide="1" id="v4l2-rds-data">
54 <title>struct 80 <title>struct
55<structname>v4l2_rds_data</structname></title> 81<structname>v4l2_rds_data</structname></title>
@@ -104,55 +130,65 @@ as follows:</para>
104 130
105 <table frame="none" pgwide="1" id="v4l2-rds-block-codes"> 131 <table frame="none" pgwide="1" id="v4l2-rds-block-codes">
106 <title>Block defines</title> 132 <title>Block defines</title>
107 <tgroup cols="3"> 133 <tgroup cols="4">
108 <colspec colname="c1" colwidth="1*" /> 134 <colspec colname="c1" colwidth="1*" />
109 <colspec colname="c2" colwidth="1*" /> 135 <colspec colname="c2" colwidth="1*" />
110 <colspec colname="c3" colwidth="5*" /> 136 <colspec colname="c3" colwidth="1*" />
137 <colspec colname="c4" colwidth="5*" />
111 <tbody valign="top"> 138 <tbody valign="top">
112 <row> 139 <row>
113 <entry>V4L2_RDS_BLOCK_MSK</entry> 140 <entry>V4L2_RDS_BLOCK_MSK</entry>
141 <entry> </entry>
114 <entry>7</entry> 142 <entry>7</entry>
115 <entry>Mask for bits 0-2 to get the block ID.</entry> 143 <entry>Mask for bits 0-2 to get the block ID.</entry>
116 </row> 144 </row>
117 <row> 145 <row>
118 <entry>V4L2_RDS_BLOCK_A</entry> 146 <entry>V4L2_RDS_BLOCK_A</entry>
147 <entry> </entry>
119 <entry>0</entry> 148 <entry>0</entry>
120 <entry>Block A.</entry> 149 <entry>Block A.</entry>
121 </row> 150 </row>
122 <row> 151 <row>
123 <entry>V4L2_RDS_BLOCK_B</entry> 152 <entry>V4L2_RDS_BLOCK_B</entry>
153 <entry> </entry>
124 <entry>1</entry> 154 <entry>1</entry>
125 <entry>Block B.</entry> 155 <entry>Block B.</entry>
126 </row> 156 </row>
127 <row> 157 <row>
128 <entry>V4L2_RDS_BLOCK_C</entry> 158 <entry>V4L2_RDS_BLOCK_C</entry>
159 <entry> </entry>
129 <entry>2</entry> 160 <entry>2</entry>
130 <entry>Block C.</entry> 161 <entry>Block C.</entry>
131 </row> 162 </row>
132 <row> 163 <row>
133 <entry>V4L2_RDS_BLOCK_D</entry> 164 <entry>V4L2_RDS_BLOCK_D</entry>
165 <entry> </entry>
134 <entry>3</entry> 166 <entry>3</entry>
135 <entry>Block D.</entry> 167 <entry>Block D.</entry>
136 </row> 168 </row>
137 <row> 169 <row>
138 <entry>V4L2_RDS_BLOCK_C_ALT</entry> 170 <entry>V4L2_RDS_BLOCK_C_ALT</entry>
171 <entry> </entry>
139 <entry>4</entry> 172 <entry>4</entry>
140 <entry>Block C'.</entry> 173 <entry>Block C'.</entry>
141 </row> 174 </row>
142 <row> 175 <row>
143 <entry>V4L2_RDS_BLOCK_INVALID</entry> 176 <entry>V4L2_RDS_BLOCK_INVALID</entry>
177 <entry>read-only</entry>
144 <entry>7</entry> 178 <entry>7</entry>
145 <entry>An invalid block.</entry> 179 <entry>An invalid block.</entry>
146 </row> 180 </row>
147 <row> 181 <row>
148 <entry>V4L2_RDS_BLOCK_CORRECTED</entry> 182 <entry>V4L2_RDS_BLOCK_CORRECTED</entry>
183 <entry>read-only</entry>
149 <entry>0x40</entry> 184 <entry>0x40</entry>
150 <entry>A bit error was detected but corrected.</entry> 185 <entry>A bit error was detected but corrected.</entry>
151 </row> 186 </row>
152 <row> 187 <row>
153 <entry>V4L2_RDS_BLOCK_ERROR</entry> 188 <entry>V4L2_RDS_BLOCK_ERROR</entry>
189 <entry>read-only</entry>
154 <entry>0x80</entry> 190 <entry>0x80</entry>
155 <entry>An incorrectable error occurred.</entry> 191 <entry>An uncorrectable error occurred.</entry>
156 </row> 192 </row>
157 </tbody> 193 </tbody>
158 </tgroup> 194 </tgroup>
diff --git a/Documentation/DocBook/v4l/dev-subdev.xml b/Documentation/DocBook/v4l/dev-subdev.xml
new file mode 100644
index 000000000000..05c8fefcbcbe
--- /dev/null
+++ b/Documentation/DocBook/v4l/dev-subdev.xml
@@ -0,0 +1,313 @@
1 <title>Sub-device Interface</title>
2
3 <note>
4 <title>Experimental</title>
5 <para>This is an <link linkend="experimental">experimental</link>
6 interface and may change in the future.</para>
7 </note>
8
9 <para>The complex nature of V4L2 devices, where hardware is often made of
10 several integrated circuits that need to interact with each other in a
11 controlled way, leads to complex V4L2 drivers. The drivers usually reflect
12 the hardware model in software, and model the different hardware components
13 as software blocks called sub-devices.</para>
14
15 <para>V4L2 sub-devices are usually kernel-only objects. If the V4L2 driver
16 implements the media device API, they will automatically inherit from media
17 entities. Applications will be able to enumerate the sub-devices and discover
18 the hardware topology using the media entities, pads and links enumeration
19 API.</para>
20
21 <para>In addition to make sub-devices discoverable, drivers can also choose
22 to make them directly configurable by applications. When both the sub-device
23 driver and the V4L2 device driver support this, sub-devices will feature a
24 character device node on which ioctls can be called to
25 <itemizedlist>
26 <listitem><para>query, read and write sub-devices controls</para></listitem>
27 <listitem><para>subscribe and unsubscribe to events and retrieve them</para></listitem>
28 <listitem><para>negotiate image formats on individual pads</para></listitem>
29 </itemizedlist>
30 </para>
31
32 <para>Sub-device character device nodes, conventionally named
33 <filename>/dev/v4l-subdev*</filename>, use major number 81.</para>
34
35 <section>
36 <title>Controls</title>
37 <para>Most V4L2 controls are implemented by sub-device hardware. Drivers
38 usually merge all controls and expose them through video device nodes.
39 Applications can control all sub-devices through a single interface.</para>
40
41 <para>Complex devices sometimes implement the same control in different
42 pieces of hardware. This situation is common in embedded platforms, where
43 both sensors and image processing hardware implement identical functions,
44 such as contrast adjustment, white balance or faulty pixels correction. As
45 the V4L2 controls API doesn't support several identical controls in a single
46 device, all but one of the identical controls are hidden.</para>
47
48 <para>Applications can access those hidden controls through the sub-device
49 node with the V4L2 control API described in <xref linkend="control" />. The
50 ioctls behave identically as when issued on V4L2 device nodes, with the
51 exception that they deal only with controls implemented in the sub-device.
52 </para>
53
54 <para>Depending on the driver, those controls might also be exposed through
55 one (or several) V4L2 device nodes.</para>
56 </section>
57
58 <section>
59 <title>Events</title>
60 <para>V4L2 sub-devices can notify applications of events as described in
61 <xref linkend="event" />. The API behaves identically as when used on V4L2
62 device nodes, with the exception that it only deals with events generated by
63 the sub-device. Depending on the driver, those events might also be reported
64 on one (or several) V4L2 device nodes.</para>
65 </section>
66
67 <section id="pad-level-formats">
68 <title>Pad-level Formats</title>
69
70 <warning><para>Pad-level formats are only applicable to very complex device that
71 need to expose low-level format configuration to user space. Generic V4L2
72 applications do <emphasis>not</emphasis> need to use the API described in
73 this section.</para></warning>
74
75 <note><para>For the purpose of this section, the term
76 <wordasword>format</wordasword> means the combination of media bus data
77 format, frame width and frame height.</para></note>
78
79 <para>Image formats are typically negotiated on video capture and output
80 devices using the <link linkend="crop">cropping and scaling</link> ioctls.
81 The driver is responsible for configuring every block in the video pipeline
82 according to the requested format at the pipeline input and/or
83 output.</para>
84
85 <para>For complex devices, such as often found in embedded systems,
86 identical image sizes at the output of a pipeline can be achieved using
87 different hardware configurations. One such example is shown on
88 <xref linkend="pipeline-scaling" />, where
89 image scaling can be performed on both the video sensor and the host image
90 processing hardware.</para>
91
92 <figure id="pipeline-scaling">
93 <title>Image Format Negotiation on Pipelines</title>
94 <mediaobject>
95 <imageobject>
96 <imagedata fileref="pipeline.pdf" format="PS" />
97 </imageobject>
98 <imageobject>
99 <imagedata fileref="pipeline.png" format="PNG" />
100 </imageobject>
101 <textobject>
102 <phrase>High quality and high speed pipeline configuration</phrase>
103 </textobject>
104 </mediaobject>
105 </figure>
106
107 <para>The sensor scaler is usually of less quality than the host scaler, but
108 scaling on the sensor is required to achieve higher frame rates. Depending
109 on the use case (quality vs. speed), the pipeline must be configured
110 differently. Applications need to configure the formats at every point in
111 the pipeline explicitly.</para>
112
113 <para>Drivers that implement the <link linkend="media-controller-intro">media
114 API</link> can expose pad-level image format configuration to applications.
115 When they do, applications can use the &VIDIOC-SUBDEV-G-FMT; and
116 &VIDIOC-SUBDEV-S-FMT; ioctls. to negotiate formats on a per-pad basis.</para>
117
118 <para>Applications are responsible for configuring coherent parameters on
119 the whole pipeline and making sure that connected pads have compatible
120 formats. The pipeline is checked for formats mismatch at &VIDIOC-STREAMON;
121 time, and an &EPIPE; is then returned if the configuration is
122 invalid.</para>
123
124 <para>Pad-level image format configuration support can be tested by calling
125 the &VIDIOC-SUBDEV-G-FMT; ioctl on pad 0. If the driver returns an &EINVAL;
126 pad-level format configuration is not supported by the sub-device.</para>
127
128 <section>
129 <title>Format Negotiation</title>
130
131 <para>Acceptable formats on pads can (and usually do) depend on a number
132 of external parameters, such as formats on other pads, active links, or
133 even controls. Finding a combination of formats on all pads in a video
134 pipeline, acceptable to both application and driver, can't rely on formats
135 enumeration only. A format negotiation mechanism is required.</para>
136
137 <para>Central to the format negotiation mechanism are the get/set format
138 operations. When called with the <structfield>which</structfield> argument
139 set to <constant>V4L2_SUBDEV_FORMAT_TRY</constant>, the
140 &VIDIOC-SUBDEV-G-FMT; and &VIDIOC-SUBDEV-S-FMT; ioctls operate on a set of
141 formats parameters that are not connected to the hardware configuration.
142 Modifying those 'try' formats leaves the device state untouched (this
143 applies to both the software state stored in the driver and the hardware
144 state stored in the device itself).</para>
145
146 <para>While not kept as part of the device state, try formats are stored
147 in the sub-device file handles. A &VIDIOC-SUBDEV-G-FMT; call will return
148 the last try format set <emphasis>on the same sub-device file
149 handle</emphasis>. Several applications querying the same sub-device at
150 the same time will thus not interact with each other.</para>
151
152 <para>To find out whether a particular format is supported by the device,
153 applications use the &VIDIOC-SUBDEV-S-FMT; ioctl. Drivers verify and, if
154 needed, change the requested <structfield>format</structfield> based on
155 device requirements and return the possibly modified value. Applications
156 can then choose to try a different format or accept the returned value and
157 continue.</para>
158
159 <para>Formats returned by the driver during a negotiation iteration are
160 guaranteed to be supported by the device. In particular, drivers guarantee
161 that a returned format will not be further changed if passed to an
162 &VIDIOC-SUBDEV-S-FMT; call as-is (as long as external parameters, such as
163 formats on other pads or links' configuration are not changed).</para>
164
165 <para>Drivers automatically propagate formats inside sub-devices. When a
166 try or active format is set on a pad, corresponding formats on other pads
167 of the same sub-device can be modified by the driver. Drivers are free to
168 modify formats as required by the device. However, they should comply with
169 the following rules when possible:
170 <itemizedlist>
171 <listitem><para>Formats should be propagated from sink pads to source pads.
172 Modifying a format on a source pad should not modify the format on any
173 sink pad.</para></listitem>
174 <listitem><para>Sub-devices that scale frames using variable scaling factors
175 should reset the scale factors to default values when sink pads formats
176 are modified. If the 1:1 scaling ratio is supported, this means that
177 source pads formats should be reset to the sink pads formats.</para></listitem>
178 </itemizedlist>
179 </para>
180
181 <para>Formats are not propagated across links, as that would involve
182 propagating them from one sub-device file handle to another. Applications
183 must then take care to configure both ends of every link explicitly with
184 compatible formats. Identical formats on the two ends of a link are
185 guaranteed to be compatible. Drivers are free to accept different formats
186 matching device requirements as being compatible.</para>
187
188 <para><xref linkend="sample-pipeline-config" />
189 shows a sample configuration sequence for the pipeline described in
190 <xref linkend="pipeline-scaling" /> (table
191 columns list entity names and pad numbers).</para>
192
193 <table pgwide="0" frame="none" id="sample-pipeline-config">
194 <title>Sample Pipeline Configuration</title>
195 <tgroup cols="3">
196 <colspec colname="what"/>
197 <colspec colname="sensor-0" />
198 <colspec colname="frontend-0" />
199 <colspec colname="frontend-1" />
200 <colspec colname="scaler-0" />
201 <colspec colname="scaler-1" />
202 <thead>
203 <row>
204 <entry></entry>
205 <entry>Sensor/0</entry>
206 <entry>Frontend/0</entry>
207 <entry>Frontend/1</entry>
208 <entry>Scaler/0</entry>
209 <entry>Scaler/1</entry>
210 </row>
211 </thead>
212 <tbody valign="top">
213 <row>
214 <entry>Initial state</entry>
215 <entry>2048x1536</entry>
216 <entry>-</entry>
217 <entry>-</entry>
218 <entry>-</entry>
219 <entry>-</entry>
220 </row>
221 <row>
222 <entry>Configure frontend input</entry>
223 <entry>2048x1536</entry>
224 <entry><emphasis>2048x1536</emphasis></entry>
225 <entry><emphasis>2046x1534</emphasis></entry>
226 <entry>-</entry>
227 <entry>-</entry>
228 </row>
229 <row>
230 <entry>Configure scaler input</entry>
231 <entry>2048x1536</entry>
232 <entry>2048x1536</entry>
233 <entry>2046x1534</entry>
234 <entry><emphasis>2046x1534</emphasis></entry>
235 <entry><emphasis>2046x1534</emphasis></entry>
236 </row>
237 <row>
238 <entry>Configure scaler output</entry>
239 <entry>2048x1536</entry>
240 <entry>2048x1536</entry>
241 <entry>2046x1534</entry>
242 <entry>2046x1534</entry>
243 <entry><emphasis>1280x960</emphasis></entry>
244 </row>
245 </tbody>
246 </tgroup>
247 </table>
248
249 <para>
250 <orderedlist>
251 <listitem><para>Initial state. The sensor output is set to its native 3MP
252 resolution. Resolutions on the host frontend and scaler input and output
253 pads are undefined.</para></listitem>
254 <listitem><para>The application configures the frontend input pad resolution to
255 2048x1536. The driver propagates the format to the frontend output pad.
256 Note that the propagated output format can be different, as in this case,
257 than the input format, as the hardware might need to crop pixels (for
258 instance when converting a Bayer filter pattern to RGB or YUV).</para></listitem>
259 <listitem><para>The application configures the scaler input pad resolution to
260 2046x1534 to match the frontend output resolution. The driver propagates
261 the format to the scaler output pad.</para></listitem>
262 <listitem><para>The application configures the scaler output pad resolution to
263 1280x960.</para></listitem>
264 </orderedlist>
265 </para>
266
267 <para>When satisfied with the try results, applications can set the active
268 formats by setting the <structfield>which</structfield> argument to
269 <constant>V4L2_SUBDEV_FORMAT_TRY</constant>. Active formats are changed
270 exactly as try formats by drivers. To avoid modifying the hardware state
271 during format negotiation, applications should negotiate try formats first
272 and then modify the active settings using the try formats returned during
273 the last negotiation iteration. This guarantees that the active format
274 will be applied as-is by the driver without being modified.
275 </para>
276 </section>
277
278 <section>
279 <title>Cropping and scaling</title>
280
281 <para>Many sub-devices support cropping frames on their input or output
282 pads (or possible even on both). Cropping is used to select the area of
283 interest in an image, typically on a video sensor or video decoder. It can
284 also be used as part of digital zoom implementations to select the area of
285 the image that will be scaled up.</para>
286
287 <para>Crop settings are defined by a crop rectangle and represented in a
288 &v4l2-rect; by the coordinates of the top left corner and the rectangle
289 size. Both the coordinates and sizes are expressed in pixels.</para>
290
291 <para>The crop rectangle is retrieved and set using the
292 &VIDIOC-SUBDEV-G-CROP; and &VIDIOC-SUBDEV-S-CROP; ioctls. Like for pad
293 formats, drivers store try and active crop rectangles. The format
294 negotiation mechanism applies to crop settings as well.</para>
295
296 <para>On input pads, cropping is applied relatively to the current pad
297 format. The pad format represents the image size as received by the
298 sub-device from the previous block in the pipeline, and the crop rectangle
299 represents the sub-image that will be transmitted further inside the
300 sub-device for processing. The crop rectangle be entirely containted
301 inside the input image size.</para>
302
303 <para>Input crop rectangle are reset to their default value when the input
304 image format is modified. Drivers should use the input image size as the
305 crop rectangle default value, but hardware requirements may prevent this.
306 </para>
307
308 <para>Cropping behaviour on output pads is not defined.</para>
309
310 </section>
311 </section>
312
313 &sub-subdev-formats;
diff --git a/Documentation/DocBook/v4l/dev-teletext.xml b/Documentation/DocBook/v4l/dev-teletext.xml
index 76184e8ed618..414b1cfff9f4 100644
--- a/Documentation/DocBook/v4l/dev-teletext.xml
+++ b/Documentation/DocBook/v4l/dev-teletext.xml
@@ -1,35 +1,32 @@
1 <title>Teletext Interface</title> 1 <title>Teletext Interface</title>
2 2
3 <para>This interface aims at devices receiving and demodulating 3 <para>This interface was aimed at devices receiving and demodulating
4Teletext data [<xref linkend="ets300706" />, <xref linkend="itu653" />], evaluating the 4Teletext data [<xref linkend="ets300706" />, <xref linkend="itu653" />], evaluating the
5Teletext packages and storing formatted pages in cache memory. Such 5Teletext packages and storing formatted pages in cache memory. Such
6devices are usually implemented as microcontrollers with serial 6devices are usually implemented as microcontrollers with serial
7interface (I<superscript>2</superscript>C) and can be found on older 7interface (I<superscript>2</superscript>C) and could be found on old
8TV cards, dedicated Teletext decoding cards and home-brew devices 8TV cards, dedicated Teletext decoding cards and home-brew devices
9connected to the PC parallel port.</para> 9connected to the PC parallel port.</para>
10 10
11 <para>The Teletext API was designed by Martin Buck. It is defined in 11 <para>The Teletext API was designed by Martin Buck. It was defined in
12the kernel header file <filename>linux/videotext.h</filename>, the 12the kernel header file <filename>linux/videotext.h</filename>, the
13specification is available from <ulink url="ftp://ftp.gwdg.de/pub/linux/misc/videotext/"> 13specification is available from <ulink url="ftp://ftp.gwdg.de/pub/linux/misc/videotext/">
14ftp://ftp.gwdg.de/pub/linux/misc/videotext/</ulink>. (Videotext is the name of 14ftp://ftp.gwdg.de/pub/linux/misc/videotext/</ulink>. (Videotext is the name of
15the German public television Teletext service.) Conventional character 15the German public television Teletext service.)</para>
16device file names are <filename>/dev/vtx</filename> and
17<filename>/dev/vttuner</filename>, with device number 83, 0 and 83, 16
18respectively. A similar interface exists for the Philips SAA5249
19Teletext decoder [specification?] with character device file names
20<filename>/dev/tlkN</filename>, device number 102, N.</para>
21 16
22 <para>Eventually the Teletext API was integrated into the V4L API 17 <para>Eventually the Teletext API was integrated into the V4L API
23with character device file names <filename>/dev/vtx0</filename> to 18with character device file names <filename>/dev/vtx0</filename> to
24<filename>/dev/vtx31</filename>, device major number 81, minor numbers 19<filename>/dev/vtx31</filename>, device major number 81, minor numbers
25192 to 223. For reference the V4L Teletext API specification is 20192 to 223.</para>
26reproduced here in full: "Teletext interfaces talk the existing VTX
27API." Teletext devices with major number 83 and 102 will be removed in
28Linux 2.6.</para>
29 21
30 <para>There are no plans to replace the Teletext API or to integrate 22 <para>However, teletext decoders were quickly replaced by more
31it into V4L2. Please write to the linux-media mailing list: &v4l-ml; 23generic VBI demodulators and those dedicated teletext decoders no longer exist.
32when the need arises.</para> 24For many years the vtx devices were still around, even though nobody used
25them. So the decision was made to finally remove support for the Teletext API in
26kernel 2.6.37.</para>
27
28 <para>Modern devices all use the <link linkend="raw-vbi">raw</link> or
29<link linkend="sliced">sliced</link> VBI API.</para>
33 30
34 <!-- 31 <!--
35Local Variables: 32Local Variables:
diff --git a/Documentation/DocBook/v4l/func-ioctl.xml b/Documentation/DocBook/v4l/func-ioctl.xml
index 00f9690e1c28..b60fd37a6295 100644
--- a/Documentation/DocBook/v4l/func-ioctl.xml
+++ b/Documentation/DocBook/v4l/func-ioctl.xml
@@ -34,8 +34,7 @@
34 <varlistentry> 34 <varlistentry>
35 <term><parameter>request</parameter></term> 35 <term><parameter>request</parameter></term>
36 <listitem> 36 <listitem>
37 <para>V4L2 ioctl request code as defined in the <link 37 <para>V4L2 ioctl request code as defined in the <filename>videodev2.h</filename> header file, for example
38linkend="videodev">videodev.h</link> header file, for example
39VIDIOC_QUERYCAP.</para> 38VIDIOC_QUERYCAP.</para>
40 </listitem> 39 </listitem>
41 </varlistentry> 40 </varlistentry>
@@ -57,7 +56,7 @@ file descriptor. An ioctl <parameter>request</parameter> has encoded
57in it whether the argument is an input, output or read/write 56in it whether the argument is an input, output or read/write
58parameter, and the size of the argument <parameter>argp</parameter> in 57parameter, and the size of the argument <parameter>argp</parameter> in
59bytes. Macros and defines specifying V4L2 ioctl requests are located 58bytes. Macros and defines specifying V4L2 ioctl requests are located
60in the <link linkend="videodev">videodev.h</link> header file. 59in the <filename>videodev2.h</filename> header file.
61Applications should use their own copy, not include the version in the 60Applications should use their own copy, not include the version in the
62kernel sources on the system they compile on. All V4L2 ioctl requests, 61kernel sources on the system they compile on. All V4L2 ioctl requests,
63their respective function and parameters are specified in <xref 62their respective function and parameters are specified in <xref
diff --git a/Documentation/DocBook/v4l/func-mmap.xml b/Documentation/DocBook/v4l/func-mmap.xml
index 2e2fc3933aea..786732b64bbd 100644
--- a/Documentation/DocBook/v4l/func-mmap.xml
+++ b/Documentation/DocBook/v4l/func-mmap.xml
@@ -45,7 +45,10 @@ just specify a <constant>NULL</constant> pointer here.</para>
45 <listitem> 45 <listitem>
46 <para>Length of the memory area to map. This must be the 46 <para>Length of the memory area to map. This must be the
47same value as returned by the driver in the &v4l2-buffer; 47same value as returned by the driver in the &v4l2-buffer;
48<structfield>length</structfield> field.</para> 48<structfield>length</structfield> field for the
49single-planar API, and the same value as returned by the driver
50in the &v4l2-plane; <structfield>length</structfield> field for the
51multi-planar API.</para>
49 </listitem> 52 </listitem>
50 </varlistentry> 53 </varlistentry>
51 <varlistentry> 54 <varlistentry>
@@ -106,7 +109,10 @@ flag.</para>
106 <listitem> 109 <listitem>
107 <para>Offset of the buffer in device memory. This must be the 110 <para>Offset of the buffer in device memory. This must be the
108same value as returned by the driver in the &v4l2-buffer; 111same value as returned by the driver in the &v4l2-buffer;
109<structfield>m</structfield> union <structfield>offset</structfield> field.</para> 112<structfield>m</structfield> union <structfield>offset</structfield> field for
113the single-planar API, and the same value as returned by the driver
114in the &v4l2-plane; <structfield>m</structfield> union
115<structfield>mem_offset</structfield> field for the multi-planar API.</para>
110 </listitem> 116 </listitem>
111 </varlistentry> 117 </varlistentry>
112 </variablelist> 118 </variablelist>
diff --git a/Documentation/DocBook/v4l/func-munmap.xml b/Documentation/DocBook/v4l/func-munmap.xml
index 502ed49323b0..e2c4190f9bb6 100644
--- a/Documentation/DocBook/v4l/func-munmap.xml
+++ b/Documentation/DocBook/v4l/func-munmap.xml
@@ -37,7 +37,8 @@
37 <para>Length of the mapped buffer. This must be the same 37 <para>Length of the mapped buffer. This must be the same
38value as given to <function>mmap()</function> and returned by the 38value as given to <function>mmap()</function> and returned by the
39driver in the &v4l2-buffer; <structfield>length</structfield> 39driver in the &v4l2-buffer; <structfield>length</structfield>
40field.</para> 40field for the single-planar API and in the &v4l2-plane;
41<structfield>length</structfield> field for the multi-planar API.</para>
41 </listitem> 42 </listitem>
42 </varlistentry> 43 </varlistentry>
43 </variablelist> 44 </variablelist>
diff --git a/Documentation/DocBook/v4l/io.xml b/Documentation/DocBook/v4l/io.xml
index d424886beda0..227e7ac45a06 100644
--- a/Documentation/DocBook/v4l/io.xml
+++ b/Documentation/DocBook/v4l/io.xml
@@ -121,18 +121,22 @@ mapped.</para>
121 <para>Before applications can access the buffers they must map 121 <para>Before applications can access the buffers they must map
122them into their address space with the &func-mmap; function. The 122them into their address space with the &func-mmap; function. The
123location of the buffers in device memory can be determined with the 123location of the buffers in device memory can be determined with the
124&VIDIOC-QUERYBUF; ioctl. The <structfield>m.offset</structfield> and 124&VIDIOC-QUERYBUF; ioctl. In the single-planar API case, the
125<structfield>length</structfield> returned in a &v4l2-buffer; are 125<structfield>m.offset</structfield> and <structfield>length</structfield>
126passed as sixth and second parameter to the 126returned in a &v4l2-buffer; are passed as sixth and second parameter to the
127<function>mmap()</function> function. The offset and length values 127<function>mmap()</function> function. When using the multi-planar API,
128must not be modified. Remember the buffers are allocated in physical 128struct &v4l2-buffer; contains an array of &v4l2-plane; structures, each
129memory, as opposed to virtual memory which can be swapped out to disk. 129containing its own <structfield>m.offset</structfield> and
130Applications should free the buffers as soon as possible with the 130<structfield>length</structfield>. When using the multi-planar API, every
131&func-munmap; function.</para> 131plane of every buffer has to be mapped separately, so the number of
132calls to &func-mmap; should be equal to number of buffers times number of
133planes in each buffer. The offset and length values must not be modified.
134Remember, the buffers are allocated in physical memory, as opposed to virtual
135memory, which can be swapped out to disk. Applications should free the buffers
136as soon as possible with the &func-munmap; function.</para>
132 137
133 <example> 138 <example>
134 <title>Mapping buffers</title> 139 <title>Mapping buffers in the single-planar API</title>
135
136 <programlisting> 140 <programlisting>
137&v4l2-requestbuffers; reqbuf; 141&v4l2-requestbuffers; reqbuf;
138struct { 142struct {
@@ -141,63 +145,145 @@ struct {
141} *buffers; 145} *buffers;
142unsigned int i; 146unsigned int i;
143 147
144memset (&amp;reqbuf, 0, sizeof (reqbuf)); 148memset(&amp;reqbuf, 0, sizeof(reqbuf));
145reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 149reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
146reqbuf.memory = V4L2_MEMORY_MMAP; 150reqbuf.memory = V4L2_MEMORY_MMAP;
147reqbuf.count = 20; 151reqbuf.count = 20;
148 152
149if (-1 == ioctl (fd, &VIDIOC-REQBUFS;, &amp;reqbuf)) { 153if (-1 == ioctl (fd, &VIDIOC-REQBUFS;, &amp;reqbuf)) {
150 if (errno == EINVAL) 154 if (errno == EINVAL)
151 printf ("Video capturing or mmap-streaming is not supported\n"); 155 printf("Video capturing or mmap-streaming is not supported\n");
152 else 156 else
153 perror ("VIDIOC_REQBUFS"); 157 perror("VIDIOC_REQBUFS");
154 158
155 exit (EXIT_FAILURE); 159 exit(EXIT_FAILURE);
156} 160}
157 161
158/* We want at least five buffers. */ 162/* We want at least five buffers. */
159 163
160if (reqbuf.count &lt; 5) { 164if (reqbuf.count &lt; 5) {
161 /* You may need to free the buffers here. */ 165 /* You may need to free the buffers here. */
162 printf ("Not enough buffer memory\n"); 166 printf("Not enough buffer memory\n");
163 exit (EXIT_FAILURE); 167 exit(EXIT_FAILURE);
164} 168}
165 169
166buffers = calloc (reqbuf.count, sizeof (*buffers)); 170buffers = calloc(reqbuf.count, sizeof(*buffers));
167assert (buffers != NULL); 171assert(buffers != NULL);
168 172
169for (i = 0; i &lt; reqbuf.count; i++) { 173for (i = 0; i &lt; reqbuf.count; i++) {
170 &v4l2-buffer; buffer; 174 &v4l2-buffer; buffer;
171 175
172 memset (&amp;buffer, 0, sizeof (buffer)); 176 memset(&amp;buffer, 0, sizeof(buffer));
173 buffer.type = reqbuf.type; 177 buffer.type = reqbuf.type;
174 buffer.memory = V4L2_MEMORY_MMAP; 178 buffer.memory = V4L2_MEMORY_MMAP;
175 buffer.index = i; 179 buffer.index = i;
176 180
177 if (-1 == ioctl (fd, &VIDIOC-QUERYBUF;, &amp;buffer)) { 181 if (-1 == ioctl (fd, &VIDIOC-QUERYBUF;, &amp;buffer)) {
178 perror ("VIDIOC_QUERYBUF"); 182 perror("VIDIOC_QUERYBUF");
179 exit (EXIT_FAILURE); 183 exit(EXIT_FAILURE);
180 } 184 }
181 185
182 buffers[i].length = buffer.length; /* remember for munmap() */ 186 buffers[i].length = buffer.length; /* remember for munmap() */
183 187
184 buffers[i].start = mmap (NULL, buffer.length, 188 buffers[i].start = mmap(NULL, buffer.length,
185 PROT_READ | PROT_WRITE, /* recommended */ 189 PROT_READ | PROT_WRITE, /* recommended */
186 MAP_SHARED, /* recommended */ 190 MAP_SHARED, /* recommended */
187 fd, buffer.m.offset); 191 fd, buffer.m.offset);
188 192
189 if (MAP_FAILED == buffers[i].start) { 193 if (MAP_FAILED == buffers[i].start) {
190 /* If you do not exit here you should unmap() and free() 194 /* If you do not exit here you should unmap() and free()
191 the buffers mapped so far. */ 195 the buffers mapped so far. */
192 perror ("mmap"); 196 perror("mmap");
193 exit (EXIT_FAILURE); 197 exit(EXIT_FAILURE);
198 }
199}
200
201/* Cleanup. */
202
203for (i = 0; i &lt; reqbuf.count; i++)
204 munmap(buffers[i].start, buffers[i].length);
205 </programlisting>
206 </example>
207
208 <example>
209 <title>Mapping buffers in the multi-planar API</title>
210 <programlisting>
211&v4l2-requestbuffers; reqbuf;
212/* Our current format uses 3 planes per buffer */
213#define FMT_NUM_PLANES = 3;
214
215struct {
216 void *start[FMT_NUM_PLANES];
217 size_t length[FMT_NUM_PLANES];
218} *buffers;
219unsigned int i, j;
220
221memset(&amp;reqbuf, 0, sizeof(reqbuf));
222reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
223reqbuf.memory = V4L2_MEMORY_MMAP;
224reqbuf.count = 20;
225
226if (ioctl(fd, &VIDIOC-REQBUFS;, &amp;reqbuf) &lt; 0) {
227 if (errno == EINVAL)
228 printf("Video capturing or mmap-streaming is not supported\n");
229 else
230 perror("VIDIOC_REQBUFS");
231
232 exit(EXIT_FAILURE);
233}
234
235/* We want at least five buffers. */
236
237if (reqbuf.count &lt; 5) {
238 /* You may need to free the buffers here. */
239 printf("Not enough buffer memory\n");
240 exit(EXIT_FAILURE);
241}
242
243buffers = calloc(reqbuf.count, sizeof(*buffers));
244assert(buffers != NULL);
245
246for (i = 0; i &lt; reqbuf.count; i++) {
247 &v4l2-buffer; buffer;
248 &v4l2-plane; planes[FMT_NUM_PLANES];
249
250 memset(&amp;buffer, 0, sizeof(buffer));
251 buffer.type = reqbuf.type;
252 buffer.memory = V4L2_MEMORY_MMAP;
253 buffer.index = i;
254 /* length in struct v4l2_buffer in multi-planar API stores the size
255 * of planes array. */
256 buffer.length = FMT_NUM_PLANES;
257 buffer.m.planes = planes;
258
259 if (ioctl(fd, &VIDIOC-QUERYBUF;, &amp;buffer) &lt; 0) {
260 perror("VIDIOC_QUERYBUF");
261 exit(EXIT_FAILURE);
262 }
263
264 /* Every plane has to be mapped separately */
265 for (j = 0; j &lt; FMT_NUM_PLANES; j++) {
266 buffers[i].length[j] = buffer.m.planes[j].length; /* remember for munmap() */
267
268 buffers[i].start[j] = mmap(NULL, buffer.m.planes[j].length,
269 PROT_READ | PROT_WRITE, /* recommended */
270 MAP_SHARED, /* recommended */
271 fd, buffer.m.planes[j].m.offset);
272
273 if (MAP_FAILED == buffers[i].start[j]) {
274 /* If you do not exit here you should unmap() and free()
275 the buffers and planes mapped so far. */
276 perror("mmap");
277 exit(EXIT_FAILURE);
278 }
194 } 279 }
195} 280}
196 281
197/* Cleanup. */ 282/* Cleanup. */
198 283
199for (i = 0; i &lt; reqbuf.count; i++) 284for (i = 0; i &lt; reqbuf.count; i++)
200 munmap (buffers[i].start, buffers[i].length); 285 for (j = 0; j &lt; FMT_NUM_PLANES; j++)
286 munmap(buffers[i].start[j], buffers[i].length[j]);
201 </programlisting> 287 </programlisting>
202 </example> 288 </example>
203 289
@@ -286,13 +372,13 @@ pointer method (not only memory mapping) is supported must be
286determined by calling the &VIDIOC-REQBUFS; ioctl.</para> 372determined by calling the &VIDIOC-REQBUFS; ioctl.</para>
287 373
288 <para>This I/O method combines advantages of the read/write and 374 <para>This I/O method combines advantages of the read/write and
289memory mapping methods. Buffers are allocated by the application 375memory mapping methods. Buffers (planes) are allocated by the application
290itself, and can reside for example in virtual or shared memory. Only 376itself, and can reside for example in virtual or shared memory. Only
291pointers to data are exchanged, these pointers and meta-information 377pointers to data are exchanged, these pointers and meta-information
292are passed in &v4l2-buffer;. The driver must be switched 378are passed in &v4l2-buffer; (or in &v4l2-plane; in the multi-planar API case).
293into user pointer I/O mode by calling the &VIDIOC-REQBUFS; with the 379The driver must be switched into user pointer I/O mode by calling the
294desired buffer type. No buffers are allocated beforehands, 380&VIDIOC-REQBUFS; with the desired buffer type. No buffers (planes) are allocated
295consequently they are not indexed and cannot be queried like mapped 381beforehand, consequently they are not indexed and cannot be queried like mapped
296buffers with the <constant>VIDIOC_QUERYBUF</constant> ioctl.</para> 382buffers with the <constant>VIDIOC_QUERYBUF</constant> ioctl.</para>
297 383
298 <example> 384 <example>
@@ -316,7 +402,7 @@ if (ioctl (fd, &VIDIOC-REQBUFS;, &amp;reqbuf) == -1) {
316 </programlisting> 402 </programlisting>
317 </example> 403 </example>
318 404
319 <para>Buffer addresses and sizes are passed on the fly with the 405 <para>Buffer (plane) addresses and sizes are passed on the fly with the
320&VIDIOC-QBUF; ioctl. Although buffers are commonly cycled, 406&VIDIOC-QBUF; ioctl. Although buffers are commonly cycled,
321applications can pass different addresses and sizes at each 407applications can pass different addresses and sizes at each
322<constant>VIDIOC_QBUF</constant> call. If required by the hardware the 408<constant>VIDIOC_QBUF</constant> call. If required by the hardware the
@@ -396,11 +482,18 @@ rest should be evident.</para>
396 <title>Buffers</title> 482 <title>Buffers</title>
397 483
398 <para>A buffer contains data exchanged by application and 484 <para>A buffer contains data exchanged by application and
399driver using one of the Streaming I/O methods. Only pointers to 485driver using one of the Streaming I/O methods. In the multi-planar API, the
400buffers are exchanged, the data itself is not copied. These pointers, 486data is held in planes, while the buffer structure acts as a container
401together with meta-information like timestamps or field parity, are 487for the planes. Only pointers to buffers (planes) are exchanged, the data
402stored in a struct <structname>v4l2_buffer</structname>, argument to 488itself is not copied. These pointers, together with meta-information like
403the &VIDIOC-QUERYBUF;, &VIDIOC-QBUF; and &VIDIOC-DQBUF; ioctl.</para> 489timestamps or field parity, are stored in a struct
490<structname>v4l2_buffer</structname>, argument to
491the &VIDIOC-QUERYBUF;, &VIDIOC-QBUF; and &VIDIOC-DQBUF; ioctl.
492In the multi-planar API, some plane-specific members of struct
493<structname>v4l2_buffer</structname>, such as pointers and sizes for each
494plane, are stored in struct <structname>v4l2_plane</structname> instead.
495In that case, struct <structname>v4l2_buffer</structname> contains an array of
496plane structures.</para>
404 497
405 <para>Nominally timestamps refer to the first data byte transmitted. 498 <para>Nominally timestamps refer to the first data byte transmitted.
406In practice however the wide range of hardware covered by the V4L2 API 499In practice however the wide range of hardware covered by the V4L2 API
@@ -551,26 +644,40 @@ in accordance with the selected I/O method.</entry>
551 <entry></entry> 644 <entry></entry>
552 <entry>__u32</entry> 645 <entry>__u32</entry>
553 <entry><structfield>offset</structfield></entry> 646 <entry><structfield>offset</structfield></entry>
554 <entry>When <structfield>memory</structfield> is 647 <entry>For the single-planar API and when
555<constant>V4L2_MEMORY_MMAP</constant> this is the offset of the buffer 648<structfield>memory</structfield> is <constant>V4L2_MEMORY_MMAP</constant> this
556from the start of the device memory. The value is returned by the 649is the offset of the buffer from the start of the device memory. The value is
557driver and apart of serving as parameter to the &func-mmap; function 650returned by the driver and apart of serving as parameter to the &func-mmap;
558not useful for applications. See <xref linkend="mmap" /> for details.</entry> 651function not useful for applications. See <xref linkend="mmap" /> for details
652 </entry>
559 </row> 653 </row>
560 <row> 654 <row>
561 <entry></entry> 655 <entry></entry>
562 <entry>unsigned long</entry> 656 <entry>unsigned long</entry>
563 <entry><structfield>userptr</structfield></entry> 657 <entry><structfield>userptr</structfield></entry>
564 <entry>When <structfield>memory</structfield> is 658 <entry>For the single-planar API and when
565<constant>V4L2_MEMORY_USERPTR</constant> this is a pointer to the 659<structfield>memory</structfield> is <constant>V4L2_MEMORY_USERPTR</constant>
566buffer (casted to unsigned long type) in virtual memory, set by the 660this is a pointer to the buffer (casted to unsigned long type) in virtual
567application. See <xref linkend="userp" /> for details.</entry> 661memory, set by the application. See <xref linkend="userp" /> for details.
662 </entry>
663 </row>
664 <row>
665 <entry></entry>
666 <entry>struct v4l2_plane</entry>
667 <entry><structfield>*planes</structfield></entry>
668 <entry>When using the multi-planar API, contains a userspace pointer
669 to an array of &v4l2-plane;. The size of the array should be put
670 in the <structfield>length</structfield> field of this
671 <structname>v4l2_buffer</structname> structure.</entry>
568 </row> 672 </row>
569 <row> 673 <row>
570 <entry>__u32</entry> 674 <entry>__u32</entry>
571 <entry><structfield>length</structfield></entry> 675 <entry><structfield>length</structfield></entry>
572 <entry></entry> 676 <entry></entry>
573 <entry>Size of the buffer (not the payload) in bytes.</entry> 677 <entry>Size of the buffer (not the payload) in bytes for the
678 single-planar API. For the multi-planar API should contain the
679 number of elements in the <structfield>planes</structfield> array.
680 </entry>
574 </row> 681 </row>
575 <row> 682 <row>
576 <entry>__u32</entry> 683 <entry>__u32</entry>
@@ -596,6 +703,66 @@ should set this to 0.</entry>
596 </tgroup> 703 </tgroup>
597 </table> 704 </table>
598 705
706 <table frame="none" pgwide="1" id="v4l2-plane">
707 <title>struct <structname>v4l2_plane</structname></title>
708 <tgroup cols="4">
709 &cs-ustr;
710 <tbody valign="top">
711 <row>
712 <entry>__u32</entry>
713 <entry><structfield>bytesused</structfield></entry>
714 <entry></entry>
715 <entry>The number of bytes occupied by data in the plane
716 (its payload).</entry>
717 </row>
718 <row>
719 <entry>__u32</entry>
720 <entry><structfield>length</structfield></entry>
721 <entry></entry>
722 <entry>Size in bytes of the plane (not its payload).</entry>
723 </row>
724 <row>
725 <entry>union</entry>
726 <entry><structfield>m</structfield></entry>
727 <entry></entry>
728 <entry></entry>
729 </row>
730 <row>
731 <entry></entry>
732 <entry>__u32</entry>
733 <entry><structfield>mem_offset</structfield></entry>
734 <entry>When the memory type in the containing &v4l2-buffer; is
735 <constant>V4L2_MEMORY_MMAP</constant>, this is the value that
736 should be passed to &func-mmap;, similar to the
737 <structfield>offset</structfield> field in &v4l2-buffer;.</entry>
738 </row>
739 <row>
740 <entry></entry>
741 <entry>__unsigned long</entry>
742 <entry><structfield>userptr</structfield></entry>
743 <entry>When the memory type in the containing &v4l2-buffer; is
744 <constant>V4L2_MEMORY_USERPTR</constant>, this is a userspace
745 pointer to the memory allocated for this plane by an application.
746 </entry>
747 </row>
748 <row>
749 <entry>__u32</entry>
750 <entry><structfield>data_offset</structfield></entry>
751 <entry></entry>
752 <entry>Offset in bytes to video data in the plane, if applicable.
753 </entry>
754 </row>
755 <row>
756 <entry>__u32</entry>
757 <entry><structfield>reserved[11]</structfield></entry>
758 <entry></entry>
759 <entry>Reserved for future use. Should be zeroed by an
760 application.</entry>
761 </row>
762 </tbody>
763 </tgroup>
764 </table>
765
599 <table frame="none" pgwide="1" id="v4l2-buf-type"> 766 <table frame="none" pgwide="1" id="v4l2-buf-type">
600 <title>enum v4l2_buf_type</title> 767 <title>enum v4l2_buf_type</title>
601 <tgroup cols="3"> 768 <tgroup cols="3">
@@ -604,13 +771,27 @@ should set this to 0.</entry>
604 <row> 771 <row>
605 <entry><constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant></entry> 772 <entry><constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant></entry>
606 <entry>1</entry> 773 <entry>1</entry>
607 <entry>Buffer of a video capture stream, see <xref 774 <entry>Buffer of a single-planar video capture stream, see <xref
775 linkend="capture" />.</entry>
776 </row>
777 <row>
778 <entry><constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant>
779 </entry>
780 <entry>9</entry>
781 <entry>Buffer of a multi-planar video capture stream, see <xref
608 linkend="capture" />.</entry> 782 linkend="capture" />.</entry>
609 </row> 783 </row>
610 <row> 784 <row>
611 <entry><constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant></entry> 785 <entry><constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant></entry>
612 <entry>2</entry> 786 <entry>2</entry>
613 <entry>Buffer of a video output stream, see <xref 787 <entry>Buffer of a single-planar video output stream, see <xref
788 linkend="output" />.</entry>
789 </row>
790 <row>
791 <entry><constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant>
792 </entry>
793 <entry>10</entry>
794 <entry>Buffer of a multi-planar video output stream, see <xref
614 linkend="output" />.</entry> 795 linkend="output" />.</entry>
615 </row> 796 </row>
616 <row> 797 <row>
diff --git a/Documentation/DocBook/v4l/libv4l.xml b/Documentation/DocBook/v4l/libv4l.xml
index c14fc3db2a81..3cb10ec51929 100644
--- a/Documentation/DocBook/v4l/libv4l.xml
+++ b/Documentation/DocBook/v4l/libv4l.xml
@@ -140,7 +140,7 @@ and is not locked sets the cid to the scaled value.
140 <para>int v4l2_get_control(int fd, int cid) - 140 <para>int v4l2_get_control(int fd, int cid) -
141This function returns a value of 0 - 65535, scaled to from the actual range 141This function returns a value of 0 - 65535, scaled to from the actual range
142of the given v4l control id. when the cid does not exist, could not be 142of the given v4l control id. when the cid does not exist, could not be
143accessed for some reason, or some error occured 0 is returned. 143accessed for some reason, or some error occurred 0 is returned.
144</para></listitem> 144</para></listitem>
145</itemizedlist> 145</itemizedlist>
146 </section> 146 </section>
diff --git a/Documentation/DocBook/v4l/lirc_device_interface.xml b/Documentation/DocBook/v4l/lirc_device_interface.xml
index 68134c0ab4d1..0e0453f39e73 100644
--- a/Documentation/DocBook/v4l/lirc_device_interface.xml
+++ b/Documentation/DocBook/v4l/lirc_device_interface.xml
@@ -45,7 +45,7 @@ describing an IR signal are read from the chardev.</para>
45<para>The data written to the chardev is a pulse/space sequence of integer 45<para>The data written to the chardev is a pulse/space sequence of integer
46values. Pulses and spaces are only marked implicitly by their position. The 46values. Pulses and spaces are only marked implicitly by their position. The
47data must start and end with a pulse, therefore, the data must always include 47data must start and end with a pulse, therefore, the data must always include
48an unevent number of samples. The write function must block until the data has 48an uneven number of samples. The write function must block until the data has
49been transmitted by the hardware.</para> 49been transmitted by the hardware.</para>
50</section> 50</section>
51 51
diff --git a/Documentation/DocBook/v4l/media-controller.xml b/Documentation/DocBook/v4l/media-controller.xml
new file mode 100644
index 000000000000..873ac3a621f0
--- /dev/null
+++ b/Documentation/DocBook/v4l/media-controller.xml
@@ -0,0 +1,89 @@
1<partinfo>
2 <authorgroup>
3 <author>
4 <firstname>Laurent</firstname>
5 <surname>Pinchart</surname>
6 <affiliation><address><email>laurent.pinchart@ideasonboard.com</email></address></affiliation>
7 <contrib>Initial version.</contrib>
8 </author>
9 </authorgroup>
10 <copyright>
11 <year>2010</year>
12 <holder>Laurent Pinchart</holder>
13 </copyright>
14
15 <revhistory>
16 <!-- Put document revisions here, newest first. -->
17 <revision>
18 <revnumber>1.0.0</revnumber>
19 <date>2010-11-10</date>
20 <authorinitials>lp</authorinitials>
21 <revremark>Initial revision</revremark>
22 </revision>
23 </revhistory>
24</partinfo>
25
26<title>Media Controller API</title>
27
28<chapter id="media_controller">
29 <title>Media Controller</title>
30
31 <section id="media-controller-intro">
32 <title>Introduction</title>
33 <para>Media devices increasingly handle multiple related functions. Many USB
34 cameras include microphones, video capture hardware can also output video,
35 or SoC camera interfaces also perform memory-to-memory operations similar to
36 video codecs.</para>
37 <para>Independent functions, even when implemented in the same hardware, can
38 be modelled as separate devices. A USB camera with a microphone will be
39 presented to userspace applications as V4L2 and ALSA capture devices. The
40 devices' relationships (when using a webcam, end-users shouldn't have to
41 manually select the associated USB microphone), while not made available
42 directly to applications by the drivers, can usually be retrieved from
43 sysfs.</para>
44 <para>With more and more advanced SoC devices being introduced, the current
45 approach will not scale. Device topologies are getting increasingly complex
46 and can't always be represented by a tree structure. Hardware blocks are
47 shared between different functions, creating dependencies between seemingly
48 unrelated devices.</para>
49 <para>Kernel abstraction APIs such as V4L2 and ALSA provide means for
50 applications to access hardware parameters. As newer hardware expose an
51 increasingly high number of those parameters, drivers need to guess what
52 applications really require based on limited information, thereby
53 implementing policies that belong to userspace.</para>
54 <para>The media controller API aims at solving those problems.</para>
55 </section>
56
57 <section id="media-controller-model">
58 <title>Media device model</title>
59 <para>Discovering a device internal topology, and configuring it at runtime,
60 is one of the goals of the media controller API. To achieve this, hardware
61 devices are modelled as an oriented graph of building blocks called entities
62 connected through pads.</para>
63 <para>An entity is a basic media hardware or software building block. It can
64 correspond to a large variety of logical blocks such as physical hardware
65 devices (CMOS sensor for instance), logical hardware devices (a building
66 block in a System-on-Chip image processing pipeline), DMA channels or
67 physical connectors.</para>
68 <para>A pad is a connection endpoint through which an entity can interact
69 with other entities. Data (not restricted to video) produced by an entity
70 flows from the entity's output to one or more entity inputs. Pads should not
71 be confused with physical pins at chip boundaries.</para>
72 <para>A link is a point-to-point oriented connection between two pads,
73 either on the same entity or on different entities. Data flows from a source
74 pad to a sink pad.</para>
75 </section>
76</chapter>
77
78<appendix id="media-user-func">
79 <title>Function Reference</title>
80 <!-- Keep this alphabetically sorted. -->
81 &sub-media-func-open;
82 &sub-media-func-close;
83 &sub-media-func-ioctl;
84 <!-- All ioctls go here. -->
85 &sub-media-ioc-device-info;
86 &sub-media-ioc-enum-entities;
87 &sub-media-ioc-enum-links;
88 &sub-media-ioc-setup-link;
89</appendix>
diff --git a/Documentation/DocBook/v4l/media-func-close.xml b/Documentation/DocBook/v4l/media-func-close.xml
new file mode 100644
index 000000000000..be149c802aeb
--- /dev/null
+++ b/Documentation/DocBook/v4l/media-func-close.xml
@@ -0,0 +1,59 @@
1<refentry id="media-func-close">
2 <refmeta>
3 <refentrytitle>media close()</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>media-close</refname>
9 <refpurpose>Close a media device</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcsynopsisinfo>#include &lt;unistd.h&gt;</funcsynopsisinfo>
15 <funcprototype>
16 <funcdef>int <function>close</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 </funcprototype>
19 </funcsynopsis>
20 </refsynopsisdiv>
21
22 <refsect1>
23 <title>Arguments</title>
24
25 <variablelist>
26 <varlistentry>
27 <term><parameter>fd</parameter></term>
28 <listitem>
29 <para>&fd;</para>
30 </listitem>
31 </varlistentry>
32 </variablelist>
33 </refsect1>
34
35 <refsect1>
36 <title>Description</title>
37
38 <para>Closes the media device. Resources associated with the file descriptor
39 are freed. The device configuration remain unchanged.</para>
40 </refsect1>
41
42 <refsect1>
43 <title>Return Value</title>
44
45 <para><function>close</function> returns 0 on success. On error, -1 is
46 returned, and <varname>errno</varname> is set appropriately. Possible error
47 codes are:</para>
48
49 <variablelist>
50 <varlistentry>
51 <term><errorcode>EBADF</errorcode></term>
52 <listitem>
53 <para><parameter>fd</parameter> is not a valid open file descriptor.
54 </para>
55 </listitem>
56 </varlistentry>
57 </variablelist>
58 </refsect1>
59</refentry>
diff --git a/Documentation/DocBook/v4l/media-func-ioctl.xml b/Documentation/DocBook/v4l/media-func-ioctl.xml
new file mode 100644
index 000000000000..bda8604de15c
--- /dev/null
+++ b/Documentation/DocBook/v4l/media-func-ioctl.xml
@@ -0,0 +1,116 @@
1<refentry id="media-func-ioctl">
2 <refmeta>
3 <refentrytitle>media ioctl()</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>media-ioctl</refname>
9 <refpurpose>Control a media device</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcsynopsisinfo>#include &lt;sys/ioctl.h&gt;</funcsynopsisinfo>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>void *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>Media ioctl request code as defined in the media.h header file,
38 for example MEDIA_IOC_SETUP_LINK.</para>
39 </listitem>
40 </varlistentry>
41 <varlistentry>
42 <term><parameter>argp</parameter></term>
43 <listitem>
44 <para>Pointer to a request-specific structure.</para>
45 </listitem>
46 </varlistentry>
47 </variablelist>
48 </refsect1>
49
50 <refsect1>
51 <title>Description</title>
52 <para>The <function>ioctl()</function> function manipulates media device
53 parameters. The argument <parameter>fd</parameter> must be an open file
54 descriptor.</para>
55 <para>The ioctl <parameter>request</parameter> code specifies the media
56 function to be called. It has encoded in it whether the argument is an
57 input, output or read/write parameter, and the size of the argument
58 <parameter>argp</parameter> in bytes.</para>
59 <para>Macros and structures definitions specifying media ioctl requests and
60 their parameters are located in the media.h header file. All media ioctl
61 requests, their respective function and parameters are specified in
62 <xref linkend="media-user-func" />.</para>
63 </refsect1>
64
65 <refsect1>
66 <title>Return Value</title>
67
68 <para><function>ioctl()</function> returns <returnvalue>0</returnvalue> on
69 success. On failure, <returnvalue>-1</returnvalue> is returned, and the
70 <varname>errno</varname> variable is set appropriately. Generic error codes
71 are listed below, and request-specific error codes are listed in the
72 individual requests descriptions.</para>
73 <para>When an ioctl that takes an output or read/write parameter fails,
74 the parameter remains unmodified.</para>
75
76 <variablelist>
77 <varlistentry>
78 <term><errorcode>EBADF</errorcode></term>
79 <listitem>
80 <para><parameter>fd</parameter> is not a valid open file descriptor.
81 </para>
82 </listitem>
83 </varlistentry>
84 <varlistentry>
85 <term><errorcode>EFAULT</errorcode></term>
86 <listitem>
87 <para><parameter>argp</parameter> references an inaccessible memory
88 area.</para>
89 </listitem>
90 </varlistentry>
91 <varlistentry>
92 <term><errorcode>EINVAL</errorcode></term>
93 <listitem>
94 <para>The <parameter>request</parameter> or the data pointed to by
95 <parameter>argp</parameter> is not valid. This is a very common error
96 code, see the individual ioctl requests listed in
97 <xref linkend="media-user-func" /> for actual causes.</para>
98 </listitem>
99 </varlistentry>
100 <varlistentry>
101 <term><errorcode>ENOMEM</errorcode></term>
102 <listitem>
103 <para>Insufficient kernel memory was available to complete the
104 request.</para>
105 </listitem>
106 </varlistentry>
107 <varlistentry>
108 <term><errorcode>ENOTTY</errorcode></term>
109 <listitem>
110 <para><parameter>fd</parameter> is not associated with a character
111 special device.</para>
112 </listitem>
113 </varlistentry>
114 </variablelist>
115 </refsect1>
116</refentry>
diff --git a/Documentation/DocBook/v4l/media-func-open.xml b/Documentation/DocBook/v4l/media-func-open.xml
new file mode 100644
index 000000000000..f7df034dc9ed
--- /dev/null
+++ b/Documentation/DocBook/v4l/media-func-open.xml
@@ -0,0 +1,94 @@
1<refentry id="media-func-open">
2 <refmeta>
3 <refentrytitle>media open()</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>media-open</refname>
9 <refpurpose>Open a media device</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcsynopsisinfo>#include &lt;fcntl.h&gt;</funcsynopsisinfo>
15 <funcprototype>
16 <funcdef>int <function>open</function></funcdef>
17 <paramdef>const char *<parameter>device_name</parameter></paramdef>
18 <paramdef>int <parameter>flags</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>device_name</parameter></term>
29 <listitem>
30 <para>Device to be opened.</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>flags</parameter></term>
35 <listitem>
36 <para>Open flags. Access mode must be either <constant>O_RDONLY</constant>
37 or <constant>O_RDWR</constant>. Other flags have no effect.</para>
38 </listitem>
39 </varlistentry>
40 </variablelist>
41 </refsect1>
42 <refsect1>
43 <title>Description</title>
44 <para>To open a media device applications call <function>open()</function>
45 with the desired device name. The function has no side effects; the device
46 configuration remain unchanged.</para>
47 <para>When the device is opened in read-only mode, attemps to modify its
48 configuration will result in an error, and <varname>errno</varname> will be
49 set to <errorcode>EBADF</errorcode>.</para>
50 </refsect1>
51 <refsect1>
52 <title>Return Value</title>
53
54 <para><function>open</function> returns the new file descriptor on success.
55 On error, -1 is returned, and <varname>errno</varname> is set appropriately.
56 Possible error codes are:</para>
57
58 <variablelist>
59 <varlistentry>
60 <term><errorcode>EACCES</errorcode></term>
61 <listitem>
62 <para>The requested access to the file is not allowed.</para>
63 </listitem>
64 </varlistentry>
65 <varlistentry>
66 <term><errorcode>EMFILE</errorcode></term>
67 <listitem>
68 <para>The process already has the maximum number of files open.
69 </para>
70 </listitem>
71 </varlistentry>
72 <varlistentry>
73 <term><errorcode>ENFILE</errorcode></term>
74 <listitem>
75 <para>The system limit on the total number of open files has been
76 reached.</para>
77 </listitem>
78 </varlistentry>
79 <varlistentry>
80 <term><errorcode>ENOMEM</errorcode></term>
81 <listitem>
82 <para>Insufficient kernel memory was available.</para>
83 </listitem>
84 </varlistentry>
85 <varlistentry>
86 <term><errorcode>ENXIO</errorcode></term>
87 <listitem>
88 <para>No device corresponding to this device special file exists.
89 </para>
90 </listitem>
91 </varlistentry>
92 </variablelist>
93 </refsect1>
94</refentry>
diff --git a/Documentation/DocBook/v4l/media-ioc-device-info.xml b/Documentation/DocBook/v4l/media-ioc-device-info.xml
new file mode 100644
index 000000000000..1f3237351bba
--- /dev/null
+++ b/Documentation/DocBook/v4l/media-ioc-device-info.xml
@@ -0,0 +1,133 @@
1<refentry id="media-ioc-device-info">
2 <refmeta>
3 <refentrytitle>ioctl MEDIA_IOC_DEVICE_INFO</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>MEDIA_IOC_DEVICE_INFO</refname>
9 <refpurpose>Query device information</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct media_device_info *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>File descriptor returned by
31 <link linkend='media-func-open'><function>open()</function></link>.</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>MEDIA_IOC_DEVICE_INFO</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>All media devices must support the <constant>MEDIA_IOC_DEVICE_INFO</constant>
53 ioctl. To query device information, applications call the ioctl with a
54 pointer to a &media-device-info;. The driver fills the structure and returns
55 the information to the application.
56 The ioctl never fails.</para>
57
58 <table pgwide="1" frame="none" id="media-device-info">
59 <title>struct <structname>media_device_info</structname></title>
60 <tgroup cols="3">
61 &cs-str;
62 <tbody valign="top">
63 <row>
64 <entry>char</entry>
65 <entry><structfield>driver</structfield>[16]</entry>
66 <entry><para>Name of the driver implementing the media API as a
67 NUL-terminated ASCII string. The driver version is stored in the
68 <structfield>driver_version</structfield> field.</para>
69 <para>Driver specific applications can use this information to
70 verify the driver identity. It is also useful to work around
71 known bugs, or to identify drivers in error reports.</para></entry>
72 </row>
73 <row>
74 <entry>char</entry>
75 <entry><structfield>model</structfield>[32]</entry>
76 <entry>Device model name as a NUL-terminated UTF-8 string. The
77 device version is stored in the <structfield>device_version</structfield>
78 field and is not be appended to the model name.</entry>
79 </row>
80 <row>
81 <entry>char</entry>
82 <entry><structfield>serial</structfield>[40]</entry>
83 <entry>Serial number as a NUL-terminated ASCII string.</entry>
84 </row>
85 <row>
86 <entry>char</entry>
87 <entry><structfield>bus_info</structfield>[32]</entry>
88 <entry>Location of the device in the system as a NUL-terminated
89 ASCII string. This includes the bus type name (PCI, USB, ...) and a
90 bus-specific identifier.</entry>
91 </row>
92 <row>
93 <entry>__u32</entry>
94 <entry><structfield>media_version</structfield></entry>
95 <entry>Media API version, formatted with the
96 <constant>KERNEL_VERSION()</constant> macro.</entry>
97 </row>
98 <row>
99 <entry>__u32</entry>
100 <entry><structfield>hw_revision</structfield></entry>
101 <entry>Hardware device revision in a driver-specific format.</entry>
102 </row>
103 <row>
104 <entry>__u32</entry>
105 <entry><structfield>media_version</structfield></entry>
106 <entry>Media device driver version, formatted with the
107 <constant>KERNEL_VERSION()</constant> macro. Together with the
108 <structfield>driver</structfield> field this identifies a particular
109 driver.</entry>
110 </row>
111 <row>
112 <entry>__u32</entry>
113 <entry><structfield>reserved</structfield>[31]</entry>
114 <entry>Reserved for future extensions. Drivers and applications must
115 set this array to zero.</entry>
116 </row>
117 </tbody>
118 </tgroup>
119 </table>
120 <para>The <structfield>serial</structfield> and <structfield>bus_info</structfield>
121 fields can be used to distinguish between multiple instances of otherwise
122 identical hardware. The serial number takes precedence when provided and can
123 be assumed to be unique. If the serial number is an empty string, the
124 <structfield>bus_info</structfield> field can be used instead. The
125 <structfield>bus_info</structfield> field is guaranteed to be unique, but
126 can vary across reboots or device unplug/replug.</para>
127 </refsect1>
128
129 <refsect1>
130 <title>Return value</title>
131 <para>This function doesn't return specific error codes.</para>
132 </refsect1>
133</refentry>
diff --git a/Documentation/DocBook/v4l/media-ioc-enum-entities.xml b/Documentation/DocBook/v4l/media-ioc-enum-entities.xml
new file mode 100644
index 000000000000..576b68b33f2c
--- /dev/null
+++ b/Documentation/DocBook/v4l/media-ioc-enum-entities.xml
@@ -0,0 +1,308 @@
1<refentry id="media-ioc-enum-entities">
2 <refmeta>
3 <refentrytitle>ioctl MEDIA_IOC_ENUM_ENTITIES</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>MEDIA_IOC_ENUM_ENTITIES</refname>
9 <refpurpose>Enumerate entities and their properties</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct media_entity_desc *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>File descriptor returned by
31 <link linkend='media-func-open'><function>open()</function></link>.</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>MEDIA_IOC_ENUM_ENTITIES</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51 <para>To query the attributes of an entity, applications set the id field
52 of a &media-entity-desc; structure and call the MEDIA_IOC_ENUM_ENTITIES
53 ioctl with a pointer to this structure. The driver fills the rest of the
54 structure or returns an &EINVAL; when the id is invalid.</para>
55 <para>Entities can be enumerated by or'ing the id with the
56 <constant>MEDIA_ENT_ID_FLAG_NEXT</constant> flag. The driver will return
57 information about the entity with the smallest id strictly larger than the
58 requested one ('next entity'), or the &EINVAL; if there is none.</para>
59 <para>Entity IDs can be non-contiguous. Applications must
60 <emphasis>not</emphasis> try to enumerate entities by calling
61 MEDIA_IOC_ENUM_ENTITIES with increasing id's until they get an error.</para>
62 <para>Two or more entities that share a common non-zero
63 <structfield>group_id</structfield> value are considered as logically
64 grouped. Groups are used to report
65 <itemizedlist>
66 <listitem><para>ALSA, VBI and video nodes that carry the same media
67 stream</para></listitem>
68 <listitem><para>lens and flash controllers associated with a sensor</para></listitem>
69 </itemizedlist>
70 </para>
71
72 <table pgwide="1" frame="none" id="media-entity-desc">
73 <title>struct <structname>media_entity_desc</structname></title>
74 <tgroup cols="5">
75 <colspec colname="c1" />
76 <colspec colname="c2" />
77 <colspec colname="c3" />
78 <colspec colname="c4" />
79 <colspec colname="c5" />
80 <tbody valign="top">
81 <row>
82 <entry>__u32</entry>
83 <entry><structfield>id</structfield></entry>
84 <entry></entry>
85 <entry></entry>
86 <entry>Entity id, set by the application. When the id is or'ed with
87 <constant>MEDIA_ENT_ID_FLAG_NEXT</constant>, the driver clears the
88 flag and returns the first entity with a larger id.</entry>
89 </row>
90 <row>
91 <entry>char</entry>
92 <entry><structfield>name</structfield>[32]</entry>
93 <entry></entry>
94 <entry></entry>
95 <entry>Entity name as an UTF-8 NULL-terminated string.</entry>
96 </row>
97 <row>
98 <entry>__u32</entry>
99 <entry><structfield>type</structfield></entry>
100 <entry></entry>
101 <entry></entry>
102 <entry>Entity type, see <xref linkend="media-entity-type" /> for details.</entry>
103 </row>
104 <row>
105 <entry>__u32</entry>
106 <entry><structfield>revision</structfield></entry>
107 <entry></entry>
108 <entry></entry>
109 <entry>Entity revision in a driver/hardware specific format.</entry>
110 </row>
111 <row>
112 <entry>__u32</entry>
113 <entry><structfield>flags</structfield></entry>
114 <entry></entry>
115 <entry></entry>
116 <entry>Entity flags, see <xref linkend="media-entity-flag" /> for details.</entry>
117 </row>
118 <row>
119 <entry>__u32</entry>
120 <entry><structfield>group_id</structfield></entry>
121 <entry></entry>
122 <entry></entry>
123 <entry>Entity group ID</entry>
124 </row>
125 <row>
126 <entry>__u16</entry>
127 <entry><structfield>pads</structfield></entry>
128 <entry></entry>
129 <entry></entry>
130 <entry>Number of pads</entry>
131 </row>
132 <row>
133 <entry>__u16</entry>
134 <entry><structfield>links</structfield></entry>
135 <entry></entry>
136 <entry></entry>
137 <entry>Total number of outbound links. Inbound links are not counted
138 in this field.</entry>
139 </row>
140 <row>
141 <entry>union</entry>
142 </row>
143 <row>
144 <entry></entry>
145 <entry>struct</entry>
146 <entry><structfield>v4l</structfield></entry>
147 <entry></entry>
148 <entry>Valid for V4L sub-devices and nodes only.</entry>
149 </row>
150 <row>
151 <entry></entry>
152 <entry></entry>
153 <entry>__u32</entry>
154 <entry><structfield>major</structfield></entry>
155 <entry>V4L device node major number. For V4L sub-devices with no
156 device node, set by the driver to 0.</entry>
157 </row>
158 <row>
159 <entry></entry>
160 <entry></entry>
161 <entry>__u32</entry>
162 <entry><structfield>minor</structfield></entry>
163 <entry>V4L device node minor number. For V4L sub-devices with no
164 device node, set by the driver to 0.</entry>
165 </row>
166 <row>
167 <entry></entry>
168 <entry>struct</entry>
169 <entry><structfield>fb</structfield></entry>
170 <entry></entry>
171 <entry>Valid for frame buffer nodes only.</entry>
172 </row>
173 <row>
174 <entry></entry>
175 <entry></entry>
176 <entry>__u32</entry>
177 <entry><structfield>major</structfield></entry>
178 <entry>Frame buffer device node major number.</entry>
179 </row>
180 <row>
181 <entry></entry>
182 <entry></entry>
183 <entry>__u32</entry>
184 <entry><structfield>minor</structfield></entry>
185 <entry>Frame buffer device node minor number.</entry>
186 </row>
187 <row>
188 <entry></entry>
189 <entry>struct</entry>
190 <entry><structfield>alsa</structfield></entry>
191 <entry></entry>
192 <entry>Valid for ALSA devices only.</entry>
193 </row>
194 <row>
195 <entry></entry>
196 <entry></entry>
197 <entry>__u32</entry>
198 <entry><structfield>card</structfield></entry>
199 <entry>ALSA card number</entry>
200 </row>
201 <row>
202 <entry></entry>
203 <entry></entry>
204 <entry>__u32</entry>
205 <entry><structfield>device</structfield></entry>
206 <entry>ALSA device number</entry>
207 </row>
208 <row>
209 <entry></entry>
210 <entry></entry>
211 <entry>__u32</entry>
212 <entry><structfield>subdevice</structfield></entry>
213 <entry>ALSA sub-device number</entry>
214 </row>
215 <row>
216 <entry></entry>
217 <entry>int</entry>
218 <entry><structfield>dvb</structfield></entry>
219 <entry></entry>
220 <entry>DVB card number</entry>
221 </row>
222 <row>
223 <entry></entry>
224 <entry>__u8</entry>
225 <entry><structfield>raw</structfield>[180]</entry>
226 <entry></entry>
227 <entry></entry>
228 </row>
229 </tbody>
230 </tgroup>
231 </table>
232
233 <table frame="none" pgwide="1" id="media-entity-type">
234 <title>Media entity types</title>
235 <tgroup cols="2">
236 <colspec colname="c1"/>
237 <colspec colname="c2"/>
238 <tbody valign="top">
239 <row>
240 <entry><constant>MEDIA_ENT_T_DEVNODE</constant></entry>
241 <entry>Unknown device node</entry>
242 </row>
243 <row>
244 <entry><constant>MEDIA_ENT_T_DEVNODE_V4L</constant></entry>
245 <entry>V4L video, radio or vbi device node</entry>
246 </row>
247 <row>
248 <entry><constant>MEDIA_ENT_T_DEVNODE_FB</constant></entry>
249 <entry>Frame buffer device node</entry>
250 </row>
251 <row>
252 <entry><constant>MEDIA_ENT_T_DEVNODE_ALSA</constant></entry>
253 <entry>ALSA card</entry>
254 </row>
255 <row>
256 <entry><constant>MEDIA_ENT_T_DEVNODE_DVB</constant></entry>
257 <entry>DVB card</entry>
258 </row>
259 <row>
260 <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV</constant></entry>
261 <entry>Unknown V4L sub-device</entry>
262 </row>
263 <row>
264 <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_SENSOR</constant></entry>
265 <entry>Video sensor</entry>
266 </row>
267 <row>
268 <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_FLASH</constant></entry>
269 <entry>Flash controller</entry>
270 </row>
271 <row>
272 <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_LENS</constant></entry>
273 <entry>Lens controller</entry>
274 </row>
275 </tbody>
276 </tgroup>
277 </table>
278
279 <table frame="none" pgwide="1" id="media-entity-flag">
280 <title>Media entity flags</title>
281 <tgroup cols="2">
282 <colspec colname="c1"/>
283 <colspec colname="c2"/>
284 <tbody valign="top">
285 <row>
286 <entry><constant>MEDIA_ENT_FL_DEFAULT</constant></entry>
287 <entry>Default entity for its type. Used to discover the default
288 audio, VBI and video devices, the default camera sensor, ...</entry>
289 </row>
290 </tbody>
291 </tgroup>
292 </table>
293 </refsect1>
294
295 <refsect1>
296 &return-value;
297
298 <variablelist>
299 <varlistentry>
300 <term><errorcode>EINVAL</errorcode></term>
301 <listitem>
302 <para>The &media-entity-desc; <structfield>id</structfield> references
303 a non-existing entity.</para>
304 </listitem>
305 </varlistentry>
306 </variablelist>
307 </refsect1>
308</refentry>
diff --git a/Documentation/DocBook/v4l/media-ioc-enum-links.xml b/Documentation/DocBook/v4l/media-ioc-enum-links.xml
new file mode 100644
index 000000000000..d2fc73ef8d56
--- /dev/null
+++ b/Documentation/DocBook/v4l/media-ioc-enum-links.xml
@@ -0,0 +1,207 @@
1<refentry id="media-ioc-enum-links">
2 <refmeta>
3 <refentrytitle>ioctl MEDIA_IOC_ENUM_LINKS</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>MEDIA_IOC_ENUM_LINKS</refname>
9 <refpurpose>Enumerate all pads and links for a given entity</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct media_links_enum *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>File descriptor returned by
31 <link linkend='media-func-open'><function>open()</function></link>.</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>MEDIA_IOC_ENUM_LINKS</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>To enumerate pads and/or links for a given entity, applications set
53 the entity field of a &media-links-enum; structure and initialize the
54 &media-pad-desc; and &media-link-desc; structure arrays pointed by the
55 <structfield>pads</structfield> and <structfield>links</structfield> fields.
56 They then call the MEDIA_IOC_ENUM_LINKS ioctl with a pointer to this
57 structure.</para>
58 <para>If the <structfield>pads</structfield> field is not NULL, the driver
59 fills the <structfield>pads</structfield> array with information about the
60 entity's pads. The array must have enough room to store all the entity's
61 pads. The number of pads can be retrieved with the &MEDIA-IOC-ENUM-ENTITIES;
62 ioctl.</para>
63 <para>If the <structfield>links</structfield> field is not NULL, the driver
64 fills the <structfield>links</structfield> array with information about the
65 entity's outbound links. The array must have enough room to store all the
66 entity's outbound links. The number of outbound links can be retrieved with
67 the &MEDIA-IOC-ENUM-ENTITIES; ioctl.</para>
68 <para>Only forward links that originate at one of the entity's source pads
69 are returned during the enumeration process.</para>
70
71 <table pgwide="1" frame="none" id="media-links-enum">
72 <title>struct <structname>media_links_enum</structname></title>
73 <tgroup cols="3">
74 &cs-str;
75 <tbody valign="top">
76 <row>
77 <entry>__u32</entry>
78 <entry><structfield>entity</structfield></entry>
79 <entry>Entity id, set by the application.</entry>
80 </row>
81 <row>
82 <entry>struct &media-pad-desc;</entry>
83 <entry>*<structfield>pads</structfield></entry>
84 <entry>Pointer to a pads array allocated by the application. Ignored
85 if NULL.</entry>
86 </row>
87 <row>
88 <entry>struct &media-link-desc;</entry>
89 <entry>*<structfield>links</structfield></entry>
90 <entry>Pointer to a links array allocated by the application. Ignored
91 if NULL.</entry>
92 </row>
93 </tbody>
94 </tgroup>
95 </table>
96
97 <table pgwide="1" frame="none" id="media-pad-desc">
98 <title>struct <structname>media_pad_desc</structname></title>
99 <tgroup cols="3">
100 &cs-str;
101 <tbody valign="top">
102 <row>
103 <entry>__u32</entry>
104 <entry><structfield>entity</structfield></entry>
105 <entry>ID of the entity this pad belongs to.</entry>
106 </row>
107 <row>
108 <entry>__u16</entry>
109 <entry><structfield>index</structfield></entry>
110 <entry>0-based pad index.</entry>
111 </row>
112 <row>
113 <entry>__u32</entry>
114 <entry><structfield>flags</structfield></entry>
115 <entry>Pad flags, see <xref linkend="media-pad-flag" /> for more details.</entry>
116 </row>
117 </tbody>
118 </tgroup>
119 </table>
120
121 <table frame="none" pgwide="1" id="media-pad-flag">
122 <title>Media pad flags</title>
123 <tgroup cols="2">
124 <colspec colname="c1"/>
125 <colspec colname="c2"/>
126 <tbody valign="top">
127 <row>
128 <entry><constant>MEDIA_PAD_FL_SINK</constant></entry>
129 <entry>Input pad, relative to the entity. Input pads sink data and
130 are targets of links.</entry>
131 </row>
132 <row>
133 <entry><constant>MEDIA_PAD_FL_SOURCE</constant></entry>
134 <entry>Output pad, relative to the entity. Output pads source data
135 and are origins of links.</entry>
136 </row>
137 </tbody>
138 </tgroup>
139 </table>
140
141 <table pgwide="1" frame="none" id="media-link-desc">
142 <title>struct <structname>media_links_desc</structname></title>
143 <tgroup cols="3">
144 &cs-str;
145 <tbody valign="top">
146 <row>
147 <entry>struct &media-pad-desc;</entry>
148 <entry><structfield>source</structfield></entry>
149 <entry>Pad at the origin of this link.</entry>
150 </row>
151 <row>
152 <entry>struct &media-pad-desc;</entry>
153 <entry><structfield>sink</structfield></entry>
154 <entry>Pad at the target of this link.</entry>
155 </row>
156 <row>
157 <entry>__u32</entry>
158 <entry><structfield>flags</structfield></entry>
159 <entry>Link flags, see <xref linkend="media-link-flag" /> for more details.</entry>
160 </row>
161 </tbody>
162 </tgroup>
163 </table>
164
165 <table frame="none" pgwide="1" id="media-link-flag">
166 <title>Media link flags</title>
167 <tgroup cols="2">
168 <colspec colname="c1"/>
169 <colspec colname="c2"/>
170 <tbody valign="top">
171 <row>
172 <entry><constant>MEDIA_LNK_FL_ENABLED</constant></entry>
173 <entry>The link is enabled and can be used to transfer media data.
174 When two or more links target a sink pad, only one of them can be
175 enabled at a time.</entry>
176 </row>
177 <row>
178 <entry><constant>MEDIA_LNK_FL_IMMUTABLE</constant></entry>
179 <entry>The link enabled state can't be modified at runtime. An
180 immutable link is always enabled.</entry>
181 </row>
182 <row>
183 <entry><constant>MEDIA_LNK_FL_DYNAMIC</constant></entry>
184 <entry>The link enabled state can be modified during streaming. This
185 flag is set by drivers and is read-only for applications.</entry>
186 </row>
187 </tbody>
188 </tgroup>
189 </table>
190 <para>One and only one of <constant>MEDIA_PAD_FL_SINK</constant> and
191 <constant>MEDIA_PAD_FL_SOURCE</constant> must be set for every pad.</para>
192 </refsect1>
193
194 <refsect1>
195 &return-value;
196
197 <variablelist>
198 <varlistentry>
199 <term><errorcode>EINVAL</errorcode></term>
200 <listitem>
201 <para>The &media-links-enum; <structfield>id</structfield> references
202 a non-existing entity.</para>
203 </listitem>
204 </varlistentry>
205 </variablelist>
206 </refsect1>
207</refentry>
diff --git a/Documentation/DocBook/v4l/media-ioc-setup-link.xml b/Documentation/DocBook/v4l/media-ioc-setup-link.xml
new file mode 100644
index 000000000000..cec97af4dab4
--- /dev/null
+++ b/Documentation/DocBook/v4l/media-ioc-setup-link.xml
@@ -0,0 +1,93 @@
1<refentry id="media-ioc-setup-link">
2 <refmeta>
3 <refentrytitle>ioctl MEDIA_IOC_SETUP_LINK</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>MEDIA_IOC_SETUP_LINK</refname>
9 <refpurpose>Modify the properties of a link</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct media_link_desc *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>File descriptor returned by
31 <link linkend='media-func-open'><function>open()</function></link>.</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>MEDIA_IOC_SETUP_LINK</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>To change link properties applications fill a &media-link-desc; with
53 link identification information (source and sink pad) and the new requested
54 link flags. They then call the MEDIA_IOC_SETUP_LINK ioctl with a pointer to
55 that structure.</para>
56 <para>The only configurable property is the <constant>ENABLED</constant>
57 link flag to enable/disable a link. Links marked with the
58 <constant>IMMUTABLE</constant> link flag can not be enabled or disabled.
59 </para>
60 <para>Link configuration has no side effect on other links. If an enabled
61 link at the sink pad prevents the link from being enabled, the driver
62 returns with an &EBUSY;.</para>
63 <para>Only links marked with the <constant>DYNAMIC</constant> link flag can
64 be enabled/disabled while streaming media data. Attempting to enable or
65 disable a streaming non-dynamic link will return an &EBUSY;.</para>
66 <para>If the specified link can't be found the driver returns with an
67 &EINVAL;.</para>
68 </refsect1>
69
70 <refsect1>
71 &return-value;
72
73 <variablelist>
74 <varlistentry>
75 <term><errorcode>EBUSY</errorcode></term>
76 <listitem>
77 <para>The link properties can't be changed because the link is
78 currently busy. This can be caused, for instance, by an active media
79 stream (audio or video) on the link. The ioctl shouldn't be retried if
80 no other action is performed before to fix the problem.</para>
81 </listitem>
82 </varlistentry>
83 <varlistentry>
84 <term><errorcode>EINVAL</errorcode></term>
85 <listitem>
86 <para>The &media-link-desc; references a non-existing link, or the
87 link is immutable and an attempt to modify its configuration was made.
88 </para>
89 </listitem>
90 </varlistentry>
91 </variablelist>
92 </refsect1>
93</refentry>
diff --git a/Documentation/DocBook/v4l/nv12mt.gif b/Documentation/DocBook/v4l/nv12mt.gif
new file mode 100644
index 000000000000..ef2d4cf8367b
--- /dev/null
+++ b/Documentation/DocBook/v4l/nv12mt.gif
Binary files differ
diff --git a/Documentation/DocBook/v4l/nv12mt_example.gif b/Documentation/DocBook/v4l/nv12mt_example.gif
new file mode 100644
index 000000000000..df81d68108ee
--- /dev/null
+++ b/Documentation/DocBook/v4l/nv12mt_example.gif
Binary files differ
diff --git a/Documentation/DocBook/v4l/pipeline.pdf b/Documentation/DocBook/v4l/pipeline.pdf
new file mode 100644
index 000000000000..ee3e37f04b6a
--- /dev/null
+++ b/Documentation/DocBook/v4l/pipeline.pdf
Binary files differ
diff --git a/Documentation/DocBook/v4l/pipeline.png b/Documentation/DocBook/v4l/pipeline.png
new file mode 100644
index 000000000000..f19b86c2c24d
--- /dev/null
+++ b/Documentation/DocBook/v4l/pipeline.png
Binary files differ
diff --git a/Documentation/DocBook/v4l/pixfmt-m420.xml b/Documentation/DocBook/v4l/pixfmt-m420.xml
new file mode 100644
index 000000000000..ce4bc019e5c0
--- /dev/null
+++ b/Documentation/DocBook/v4l/pixfmt-m420.xml
@@ -0,0 +1,147 @@
1 <refentry id="V4L2-PIX-FMT-M420">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_M420 ('M420')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_M420</constant></refname>
8 <refpurpose>Format with &frac12; horizontal and vertical chroma
9 resolution, also known as YUV 4:2:0. Hybrid plane line-interleaved
10 layout.</refpurpose>
11 </refnamediv>
12 <refsect1>
13 <title>Description</title>
14
15 <para>M420 is a YUV format with &frac12; horizontal and vertical chroma
16 subsampling (YUV 4:2:0). Pixels are organized as interleaved luma and
17 chroma planes. Two lines of luma data are followed by one line of chroma
18 data.</para>
19 <para>The luma plane has one byte per pixel. The chroma plane contains
20 interleaved CbCr pixels subsampled by &frac12; in the horizontal and
21 vertical directions. Each CbCr pair belongs to four pixels. For example,
22Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to
23Y'<subscript>00</subscript>, Y'<subscript>01</subscript>,
24Y'<subscript>10</subscript>, Y'<subscript>11</subscript>.</para>
25
26 <para>All line lengths are identical: if the Y lines include pad bytes
27 so do the CbCr lines.</para>
28
29 <example>
30 <title><constant>V4L2_PIX_FMT_M420</constant> 4 &times; 4
31pixel image</title>
32
33 <formalpara>
34 <title>Byte Order.</title>
35 <para>Each cell is one byte.
36 <informaltable frame="none">
37 <tgroup cols="5" align="center">
38 <colspec align="left" colwidth="2*" />
39 <tbody valign="top">
40 <row>
41 <entry>start&nbsp;+&nbsp;0:</entry>
42 <entry>Y'<subscript>00</subscript></entry>
43 <entry>Y'<subscript>01</subscript></entry>
44 <entry>Y'<subscript>02</subscript></entry>
45 <entry>Y'<subscript>03</subscript></entry>
46 </row>
47 <row>
48 <entry>start&nbsp;+&nbsp;4:</entry>
49 <entry>Y'<subscript>10</subscript></entry>
50 <entry>Y'<subscript>11</subscript></entry>
51 <entry>Y'<subscript>12</subscript></entry>
52 <entry>Y'<subscript>13</subscript></entry>
53 </row>
54 <row>
55 <entry>start&nbsp;+&nbsp;8:</entry>
56 <entry>Cb<subscript>00</subscript></entry>
57 <entry>Cr<subscript>00</subscript></entry>
58 <entry>Cb<subscript>01</subscript></entry>
59 <entry>Cr<subscript>01</subscript></entry>
60 </row>
61 <row>
62 <entry>start&nbsp;+&nbsp;16:</entry>
63 <entry>Y'<subscript>20</subscript></entry>
64 <entry>Y'<subscript>21</subscript></entry>
65 <entry>Y'<subscript>22</subscript></entry>
66 <entry>Y'<subscript>23</subscript></entry>
67 </row>
68 <row>
69 <entry>start&nbsp;+&nbsp;20:</entry>
70 <entry>Y'<subscript>30</subscript></entry>
71 <entry>Y'<subscript>31</subscript></entry>
72 <entry>Y'<subscript>32</subscript></entry>
73 <entry>Y'<subscript>33</subscript></entry>
74 </row>
75 <row>
76 <entry>start&nbsp;+&nbsp;24:</entry>
77 <entry>Cb<subscript>10</subscript></entry>
78 <entry>Cr<subscript>10</subscript></entry>
79 <entry>Cb<subscript>11</subscript></entry>
80 <entry>Cr<subscript>11</subscript></entry>
81 </row>
82 </tbody>
83 </tgroup>
84 </informaltable>
85 </para>
86 </formalpara>
87
88 <formalpara>
89 <title>Color Sample Location.</title>
90 <para>
91 <informaltable frame="none">
92 <tgroup cols="7" align="center">
93 <tbody valign="top">
94 <row>
95 <entry></entry>
96 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
97 <entry>2</entry><entry></entry><entry>3</entry>
98 </row>
99 <row>
100 <entry>0</entry>
101 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
102 <entry>Y</entry><entry></entry><entry>Y</entry>
103 </row>
104 <row>
105 <entry></entry>
106 <entry></entry><entry>C</entry><entry></entry><entry></entry>
107 <entry></entry><entry>C</entry><entry></entry>
108 </row>
109 <row>
110 <entry>1</entry>
111 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
112 <entry>Y</entry><entry></entry><entry>Y</entry>
113 </row>
114 <row>
115 <entry></entry>
116 </row>
117 <row>
118 <entry>2</entry>
119 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
120 <entry>Y</entry><entry></entry><entry>Y</entry>
121 </row>
122 <row>
123 <entry></entry>
124 <entry></entry><entry>C</entry><entry></entry><entry></entry>
125 <entry></entry><entry>C</entry><entry></entry>
126 </row>
127 <row>
128 <entry>3</entry>
129 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
130 <entry>Y</entry><entry></entry><entry>Y</entry>
131 </row>
132 </tbody>
133 </tgroup>
134 </informaltable>
135 </para>
136 </formalpara>
137 </example>
138 </refsect1>
139 </refentry>
140
141 <!--
142Local Variables:
143mode: sgml
144sgml-parent-document: "pixfmt.sgml"
145indent-tabs-mode: nil
146End:
147 -->
diff --git a/Documentation/DocBook/v4l/pixfmt-nv12m.xml b/Documentation/DocBook/v4l/pixfmt-nv12m.xml
new file mode 100644
index 000000000000..c9e166d9ded8
--- /dev/null
+++ b/Documentation/DocBook/v4l/pixfmt-nv12m.xml
@@ -0,0 +1,154 @@
1 <refentry id="V4L2-PIX-FMT-NV12M">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_NV12M ('NV12M')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname> <constant>V4L2_PIX_FMT_NV12M</constant></refname>
8 <refpurpose>Variation of <constant>V4L2_PIX_FMT_NV12</constant> with planes
9 non contiguous in memory. </refpurpose>
10 </refnamediv>
11 <refsect1>
12 <title>Description</title>
13
14 <para>This is a multi-planar, two-plane version of the YUV 4:2:0 format.
15The three components are separated into two sub-images or planes.
16<constant>V4L2_PIX_FMT_NV12M</constant> differs from <constant>V4L2_PIX_FMT_NV12
17</constant> in that the two planes are non-contiguous in memory, i.e. the chroma
18plane do not necessarily immediately follows the luma plane.
19The luminance data occupies the first plane. The Y plane has one byte per pixel.
20In the second plane there is a chrominance data with alternating chroma samples.
21The CbCr plane is the same width, in bytes, as the Y plane (and of the image),
22but is half as tall in pixels. Each CbCr pair belongs to four pixels. For example,
23Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to
24Y'<subscript>00</subscript>, Y'<subscript>01</subscript>,
25Y'<subscript>10</subscript>, Y'<subscript>11</subscript>. </para>
26
27 <para><constant>V4L2_PIX_FMT_NV12M</constant> is intended to be
28used only in drivers and applications that support the multi-planar API,
29described in <xref linkend="planar-apis"/>. </para>
30
31 <para>If the Y plane has pad bytes after each row, then the
32CbCr plane has as many pad bytes after its rows.</para>
33
34 <example>
35 <title><constant>V4L2_PIX_FMT_NV12M</constant> 4 &times; 4 pixel image</title>
36
37 <formalpara>
38 <title>Byte Order.</title>
39 <para>Each cell is one byte.
40 <informaltable frame="none">
41 <tgroup cols="5" align="center">
42 <colspec align="left" colwidth="2*" />
43 <tbody valign="top">
44 <row>
45 <entry>start0&nbsp;+&nbsp;0:</entry>
46 <entry>Y'<subscript>00</subscript></entry>
47 <entry>Y'<subscript>01</subscript></entry>
48 <entry>Y'<subscript>02</subscript></entry>
49 <entry>Y'<subscript>03</subscript></entry>
50 </row>
51 <row>
52 <entry>start0&nbsp;+&nbsp;4:</entry>
53 <entry>Y'<subscript>10</subscript></entry>
54 <entry>Y'<subscript>11</subscript></entry>
55 <entry>Y'<subscript>12</subscript></entry>
56 <entry>Y'<subscript>13</subscript></entry>
57 </row>
58 <row>
59 <entry>start0&nbsp;+&nbsp;8:</entry>
60 <entry>Y'<subscript>20</subscript></entry>
61 <entry>Y'<subscript>21</subscript></entry>
62 <entry>Y'<subscript>22</subscript></entry>
63 <entry>Y'<subscript>23</subscript></entry>
64 </row>
65 <row>
66 <entry>start0&nbsp;+&nbsp;12:</entry>
67 <entry>Y'<subscript>30</subscript></entry>
68 <entry>Y'<subscript>31</subscript></entry>
69 <entry>Y'<subscript>32</subscript></entry>
70 <entry>Y'<subscript>33</subscript></entry>
71 </row>
72 <row>
73 <entry></entry>
74 </row>
75 <row>
76 <entry>start1&nbsp;+&nbsp;0:</entry>
77 <entry>Cb<subscript>00</subscript></entry>
78 <entry>Cr<subscript>00</subscript></entry>
79 <entry>Cb<subscript>01</subscript></entry>
80 <entry>Cr<subscript>01</subscript></entry>
81 </row>
82 <row>
83 <entry>start1&nbsp;+&nbsp;4:</entry>
84 <entry>Cb<subscript>10</subscript></entry>
85 <entry>Cr<subscript>10</subscript></entry>
86 <entry>Cb<subscript>11</subscript></entry>
87 <entry>Cr<subscript>11</subscript></entry>
88 </row>
89 </tbody>
90 </tgroup>
91 </informaltable>
92 </para>
93 </formalpara>
94
95 <formalpara>
96 <title>Color Sample Location.</title>
97 <para>
98 <informaltable frame="none">
99 <tgroup cols="7" align="center">
100 <tbody valign="top">
101 <row>
102 <entry></entry>
103 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
104 <entry>2</entry><entry></entry><entry>3</entry>
105 </row>
106 <row>
107 <entry>0</entry>
108 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
109 <entry>Y</entry><entry></entry><entry>Y</entry>
110 </row>
111 <row>
112 <entry></entry>
113 <entry></entry><entry>C</entry><entry></entry><entry></entry>
114 <entry></entry><entry>C</entry><entry></entry>
115 </row>
116 <row>
117 <entry>1</entry>
118 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
119 <entry>Y</entry><entry></entry><entry>Y</entry>
120 </row>
121 <row>
122 <entry></entry>
123 </row>
124 <row>
125 <entry>2</entry>
126 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
127 <entry>Y</entry><entry></entry><entry>Y</entry>
128 </row>
129 <row>
130 <entry></entry>
131 <entry></entry><entry>C</entry><entry></entry><entry></entry>
132 <entry></entry><entry>C</entry><entry></entry>
133 </row>
134 <row>
135 <entry>3</entry>
136 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
137 <entry>Y</entry><entry></entry><entry>Y</entry>
138 </row>
139 </tbody>
140 </tgroup>
141 </informaltable>
142 </para>
143 </formalpara>
144 </example>
145 </refsect1>
146 </refentry>
147
148 <!--
149Local Variables:
150mode: sgml
151sgml-parent-document: "pixfmt.sgml"
152indent-tabs-mode: nil
153End:
154 -->
diff --git a/Documentation/DocBook/v4l/pixfmt-nv12mt.xml b/Documentation/DocBook/v4l/pixfmt-nv12mt.xml
new file mode 100644
index 000000000000..7a2855a526c1
--- /dev/null
+++ b/Documentation/DocBook/v4l/pixfmt-nv12mt.xml
@@ -0,0 +1,74 @@
1 <refentry>
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_NV12MT ('TM12')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname id="V4L2-PIX-FMT-NV12MT"><constant>V4L2_PIX_FMT_NV12MT
8</constant></refname>
9 <refpurpose>Formats with &frac12; horizontal and vertical
10chroma resolution. This format has two planes - one for luminance and one for
11chrominance. Chroma samples are interleaved. The difference to
12<constant>V4L2_PIX_FMT_NV12</constant> is the memory layout. Pixels are
13grouped in macroblocks of 64x32 size. The order of macroblocks in memory is
14also not standard.
15 </refpurpose>
16 </refnamediv>
17 <refsect1>
18 <title>Description</title>
19
20 <para>This is the two-plane versions of the YUV 4:2:0 format where data
21is grouped into 64x32 macroblocks. The three components are separated into two
22sub-images or planes. The Y plane has one byte per pixel and pixels are grouped
23into 64x32 macroblocks. The CbCr plane has the same width, in bytes, as the Y
24plane (and the image), but is half as tall in pixels. The chroma plane is also
25grouped into 64x32 macroblocks.</para>
26 <para>Width of the buffer has to be aligned to the multiple of 128, and
27height alignment is 32. Every four adjactent buffers - two horizontally and two
28vertically are grouped together and are located in memory in Z or flipped Z
29order. </para>
30 <para>Layout of macroblocks in memory is presented in the following
31figure.</para>
32 <para><figure id="nv12mt">
33 <title><constant>V4L2_PIX_FMT_NV12MT</constant> macroblock Z shape
34memory layout</title>
35 <mediaobject>
36 <imageobject>
37 <imagedata fileref="nv12mt.gif" format="GIF" />
38 </imageobject>
39 </mediaobject>
40 </figure>
41 The requirement that width is multiple of 128 is implemented because,
42the Z shape cannot be cut in half horizontally. In case the vertical resolution
43of macroblocks is odd then the last row of macroblocks is arranged in a linear
44order. </para>
45 <para>In case of chroma the layout is identical. Cb and Cr samples are
46interleaved. Height of the buffer is aligned to 32.
47 </para>
48 <example>
49 <title>Memory layout of macroblocks in <constant>V4L2_PIX_FMT_NV12
50</constant> format pixel image - extreme case</title>
51 <para>
52 <figure id="nv12mt_ex">
53 <title>Example <constant>V4L2_PIX_FMT_NV12MT</constant> memory
54layout of macroblocks</title>
55 <mediaobject>
56 <imageobject>
57 <imagedata fileref="nv12mt_example.gif" format="GIF" />
58 </imageobject>
59 </mediaobject>
60 </figure>
61 Memory layout of macroblocks of <constant>V4L2_PIX_FMT_NV12MT
62</constant> format in most extreme case.
63 </para>
64 </example>
65 </refsect1>
66 </refentry>
67
68 <!--
69Local Variables:
70mode: sgml
71sgml-parent-document: "pixfmt.sgml"
72indent-tabs-mode: nil
73End:
74 -->
diff --git a/Documentation/DocBook/v4l/pixfmt-packed-rgb.xml b/Documentation/DocBook/v4l/pixfmt-packed-rgb.xml
index 26e879231088..4db272b8a0d3 100644
--- a/Documentation/DocBook/v4l/pixfmt-packed-rgb.xml
+++ b/Documentation/DocBook/v4l/pixfmt-packed-rgb.xml
@@ -739,7 +739,7 @@ defined in error. Drivers may interpret them as in <xref
739 <entry>b<subscript>1</subscript></entry> 739 <entry>b<subscript>1</subscript></entry>
740 <entry>b<subscript>0</subscript></entry> 740 <entry>b<subscript>0</subscript></entry>
741 </row> 741 </row>
742 <row id="V4L2-PIX-FMT-BGR666"> 742 <row><!-- id="V4L2-PIX-FMT-BGR666" -->
743 <entry><constant>V4L2_PIX_FMT_BGR666</constant></entry> 743 <entry><constant>V4L2_PIX_FMT_BGR666</constant></entry>
744 <entry>'BGRH'</entry> 744 <entry>'BGRH'</entry>
745 <entry></entry> 745 <entry></entry>
diff --git a/Documentation/DocBook/v4l/pixfmt-srggb10.xml b/Documentation/DocBook/v4l/pixfmt-srggb10.xml
new file mode 100644
index 000000000000..7b274092e60c
--- /dev/null
+++ b/Documentation/DocBook/v4l/pixfmt-srggb10.xml
@@ -0,0 +1,90 @@
1 <refentry>
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_SRGGB10 ('RG10'),
4 V4L2_PIX_FMT_SGRBG10 ('BA10'),
5 V4L2_PIX_FMT_SGBRG10 ('GB10'),
6 V4L2_PIX_FMT_SBGGR10 ('BG10'),
7 </refentrytitle>
8 &manvol;
9 </refmeta>
10 <refnamediv>
11 <refname id="V4L2-PIX-FMT-SRGGB10"><constant>V4L2_PIX_FMT_SRGGB10</constant></refname>
12 <refname id="V4L2-PIX-FMT-SGRBG10"><constant>V4L2_PIX_FMT_SGRBG10</constant></refname>
13 <refname id="V4L2-PIX-FMT-SGBRG10"><constant>V4L2_PIX_FMT_SGBRG10</constant></refname>
14 <refname id="V4L2-PIX-FMT-SBGGR10"><constant>V4L2_PIX_FMT_SBGGR10</constant></refname>
15 <refpurpose>10-bit Bayer formats expanded to 16 bits</refpurpose>
16 </refnamediv>
17 <refsect1>
18 <title>Description</title>
19
20 <para>The following four pixel formats are raw sRGB / Bayer formats with
2110 bits per colour. Each colour component is stored in a 16-bit word, with 6
22unused high bits filled with zeros. Each n-pixel row contains n/2 green samples
23and n/2 blue or red samples, with alternating red and blue rows. Bytes are
24stored in memory in little endian order. They are conventionally described
25as GRGR... BGBG..., RGRG... GBGB..., etc. Below is an example of one of these
26formats</para>
27
28 <example>
29 <title><constant>V4L2_PIX_FMT_SBGGR10</constant> 4 &times; 4
30pixel image</title>
31
32 <formalpara>
33 <title>Byte Order.</title>
34 <para>Each cell is one byte, high 6 bits in high bytes are 0.
35 <informaltable frame="none">
36 <tgroup cols="5" align="center">
37 <colspec align="left" colwidth="2*" />
38 <tbody valign="top">
39 <row>
40 <entry>start&nbsp;+&nbsp;0:</entry>
41 <entry>B<subscript>00low</subscript></entry>
42 <entry>B<subscript>00high</subscript></entry>
43 <entry>G<subscript>01low</subscript></entry>
44 <entry>G<subscript>01high</subscript></entry>
45 <entry>B<subscript>02low</subscript></entry>
46 <entry>B<subscript>02high</subscript></entry>
47 <entry>G<subscript>03low</subscript></entry>
48 <entry>G<subscript>03high</subscript></entry>
49 </row>
50 <row>
51 <entry>start&nbsp;+&nbsp;8:</entry>
52 <entry>G<subscript>10low</subscript></entry>
53 <entry>G<subscript>10high</subscript></entry>
54 <entry>R<subscript>11low</subscript></entry>
55 <entry>R<subscript>11high</subscript></entry>
56 <entry>G<subscript>12low</subscript></entry>
57 <entry>G<subscript>12high</subscript></entry>
58 <entry>R<subscript>13low</subscript></entry>
59 <entry>R<subscript>13high</subscript></entry>
60 </row>
61 <row>
62 <entry>start&nbsp;+&nbsp;16:</entry>
63 <entry>B<subscript>20low</subscript></entry>
64 <entry>B<subscript>20high</subscript></entry>
65 <entry>G<subscript>21low</subscript></entry>
66 <entry>G<subscript>21high</subscript></entry>
67 <entry>B<subscript>22low</subscript></entry>
68 <entry>B<subscript>22high</subscript></entry>
69 <entry>G<subscript>23low</subscript></entry>
70 <entry>G<subscript>23high</subscript></entry>
71 </row>
72 <row>
73 <entry>start&nbsp;+&nbsp;24:</entry>
74 <entry>G<subscript>30low</subscript></entry>
75 <entry>G<subscript>30high</subscript></entry>
76 <entry>R<subscript>31low</subscript></entry>
77 <entry>R<subscript>31high</subscript></entry>
78 <entry>G<subscript>32low</subscript></entry>
79 <entry>G<subscript>32high</subscript></entry>
80 <entry>R<subscript>33low</subscript></entry>
81 <entry>R<subscript>33high</subscript></entry>
82 </row>
83 </tbody>
84 </tgroup>
85 </informaltable>
86 </para>
87 </formalpara>
88 </example>
89 </refsect1>
90</refentry>
diff --git a/Documentation/DocBook/v4l/pixfmt-srggb12.xml b/Documentation/DocBook/v4l/pixfmt-srggb12.xml
new file mode 100644
index 000000000000..9ba4fb690bc0
--- /dev/null
+++ b/Documentation/DocBook/v4l/pixfmt-srggb12.xml
@@ -0,0 +1,90 @@
1 <refentry>
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_SRGGB12 ('RG12'),
4 V4L2_PIX_FMT_SGRBG12 ('BA12'),
5 V4L2_PIX_FMT_SGBRG12 ('GB12'),
6 V4L2_PIX_FMT_SBGGR12 ('BG12'),
7 </refentrytitle>
8 &manvol;
9 </refmeta>
10 <refnamediv>
11 <refname id="V4L2-PIX-FMT-SRGGB12"><constant>V4L2_PIX_FMT_SRGGB12</constant></refname>
12 <refname id="V4L2-PIX-FMT-SGRBG12"><constant>V4L2_PIX_FMT_SGRBG12</constant></refname>
13 <refname id="V4L2-PIX-FMT-SGBRG12"><constant>V4L2_PIX_FMT_SGBRG12</constant></refname>
14 <refname id="V4L2-PIX-FMT-SBGGR12"><constant>V4L2_PIX_FMT_SBGGR12</constant></refname>
15 <refpurpose>12-bit Bayer formats expanded to 16 bits</refpurpose>
16 </refnamediv>
17 <refsect1>
18 <title>Description</title>
19
20 <para>The following four pixel formats are raw sRGB / Bayer formats with
2112 bits per colour. Each colour component is stored in a 16-bit word, with 6
22unused high bits filled with zeros. Each n-pixel row contains n/2 green samples
23and n/2 blue or red samples, with alternating red and blue rows. Bytes are
24stored in memory in little endian order. They are conventionally described
25as GRGR... BGBG..., RGRG... GBGB..., etc. Below is an example of one of these
26formats</para>
27
28 <example>
29 <title><constant>V4L2_PIX_FMT_SBGGR12</constant> 4 &times; 4
30pixel image</title>
31
32 <formalpara>
33 <title>Byte Order.</title>
34 <para>Each cell is one byte, high 6 bits in high bytes are 0.
35 <informaltable frame="none">
36 <tgroup cols="5" align="center">
37 <colspec align="left" colwidth="2*" />
38 <tbody valign="top">
39 <row>
40 <entry>start&nbsp;+&nbsp;0:</entry>
41 <entry>B<subscript>00low</subscript></entry>
42 <entry>B<subscript>00high</subscript></entry>
43 <entry>G<subscript>01low</subscript></entry>
44 <entry>G<subscript>01high</subscript></entry>
45 <entry>B<subscript>02low</subscript></entry>
46 <entry>B<subscript>02high</subscript></entry>
47 <entry>G<subscript>03low</subscript></entry>
48 <entry>G<subscript>03high</subscript></entry>
49 </row>
50 <row>
51 <entry>start&nbsp;+&nbsp;8:</entry>
52 <entry>G<subscript>10low</subscript></entry>
53 <entry>G<subscript>10high</subscript></entry>
54 <entry>R<subscript>11low</subscript></entry>
55 <entry>R<subscript>11high</subscript></entry>
56 <entry>G<subscript>12low</subscript></entry>
57 <entry>G<subscript>12high</subscript></entry>
58 <entry>R<subscript>13low</subscript></entry>
59 <entry>R<subscript>13high</subscript></entry>
60 </row>
61 <row>
62 <entry>start&nbsp;+&nbsp;16:</entry>
63 <entry>B<subscript>20low</subscript></entry>
64 <entry>B<subscript>20high</subscript></entry>
65 <entry>G<subscript>21low</subscript></entry>
66 <entry>G<subscript>21high</subscript></entry>
67 <entry>B<subscript>22low</subscript></entry>
68 <entry>B<subscript>22high</subscript></entry>
69 <entry>G<subscript>23low</subscript></entry>
70 <entry>G<subscript>23high</subscript></entry>
71 </row>
72 <row>
73 <entry>start&nbsp;+&nbsp;24:</entry>
74 <entry>G<subscript>30low</subscript></entry>
75 <entry>G<subscript>30high</subscript></entry>
76 <entry>R<subscript>31low</subscript></entry>
77 <entry>R<subscript>31high</subscript></entry>
78 <entry>G<subscript>32low</subscript></entry>
79 <entry>G<subscript>32high</subscript></entry>
80 <entry>R<subscript>33low</subscript></entry>
81 <entry>R<subscript>33high</subscript></entry>
82 </row>
83 </tbody>
84 </tgroup>
85 </informaltable>
86 </para>
87 </formalpara>
88 </example>
89 </refsect1>
90</refentry>
diff --git a/Documentation/DocBook/v4l/pixfmt-srggb8.xml b/Documentation/DocBook/v4l/pixfmt-srggb8.xml
new file mode 100644
index 000000000000..2570e3be3cf1
--- /dev/null
+++ b/Documentation/DocBook/v4l/pixfmt-srggb8.xml
@@ -0,0 +1,67 @@
1 <refentry id="V4L2-PIX-FMT-SRGGB8">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_SRGGB8 ('RGGB')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_SRGGB8</constant></refname>
8 <refpurpose>Bayer RGB format</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This is commonly the native format of digital cameras,
14reflecting the arrangement of sensors on the CCD device. Only one red,
15green or blue value is given for each pixel. Missing components must
16be interpolated from neighbouring pixels. From left to right the first
17row consists of a red and green value, the second row of a green and
18blue value. This scheme repeats to the right and down for every two
19columns and rows.</para>
20
21 <example>
22 <title><constant>V4L2_PIX_FMT_SRGGB8</constant> 4 &times; 4
23pixel image</title>
24
25 <formalpara>
26 <title>Byte Order.</title>
27 <para>Each cell is one byte.
28 <informaltable frame="none">
29 <tgroup cols="5" align="center">
30 <colspec align="left" colwidth="2*" />
31 <tbody valign="top">
32 <row>
33 <entry>start&nbsp;+&nbsp;0:</entry>
34 <entry>R<subscript>00</subscript></entry>
35 <entry>G<subscript>01</subscript></entry>
36 <entry>R<subscript>02</subscript></entry>
37 <entry>G<subscript>03</subscript></entry>
38 </row>
39 <row>
40 <entry>start&nbsp;+&nbsp;4:</entry>
41 <entry>G<subscript>10</subscript></entry>
42 <entry>B<subscript>11</subscript></entry>
43 <entry>G<subscript>12</subscript></entry>
44 <entry>B<subscript>13</subscript></entry>
45 </row>
46 <row>
47 <entry>start&nbsp;+&nbsp;8:</entry>
48 <entry>R<subscript>20</subscript></entry>
49 <entry>G<subscript>21</subscript></entry>
50 <entry>R<subscript>22</subscript></entry>
51 <entry>G<subscript>23</subscript></entry>
52 </row>
53 <row>
54 <entry>start&nbsp;+&nbsp;12:</entry>
55 <entry>G<subscript>30</subscript></entry>
56 <entry>B<subscript>31</subscript></entry>
57 <entry>G<subscript>32</subscript></entry>
58 <entry>B<subscript>33</subscript></entry>
59 </row>
60 </tbody>
61 </tgroup>
62 </informaltable>
63 </para>
64 </formalpara>
65 </example>
66 </refsect1>
67 </refentry>
diff --git a/Documentation/DocBook/v4l/pixfmt-y10.xml b/Documentation/DocBook/v4l/pixfmt-y10.xml
new file mode 100644
index 000000000000..d065043db8d8
--- /dev/null
+++ b/Documentation/DocBook/v4l/pixfmt-y10.xml
@@ -0,0 +1,79 @@
1<refentry id="V4L2-PIX-FMT-Y10">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_Y10 ('Y10 ')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_Y10</constant></refname>
8 <refpurpose>Grey-scale image</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This is a grey-scale image with a depth of 10 bits per pixel. Pixels
14are stored in 16-bit words with unused high bits padded with 0. The least
15significant byte is stored at lower memory addresses (little-endian).</para>
16
17 <example>
18 <title><constant>V4L2_PIX_FMT_Y10</constant> 4 &times; 4
19pixel image</title>
20
21 <formalpara>
22 <title>Byte Order.</title>
23 <para>Each cell is one byte.
24 <informaltable frame="none">
25 <tgroup cols="9" align="center">
26 <colspec align="left" colwidth="2*" />
27 <tbody valign="top">
28 <row>
29 <entry>start&nbsp;+&nbsp;0:</entry>
30 <entry>Y'<subscript>00low</subscript></entry>
31 <entry>Y'<subscript>00high</subscript></entry>
32 <entry>Y'<subscript>01low</subscript></entry>
33 <entry>Y'<subscript>01high</subscript></entry>
34 <entry>Y'<subscript>02low</subscript></entry>
35 <entry>Y'<subscript>02high</subscript></entry>
36 <entry>Y'<subscript>03low</subscript></entry>
37 <entry>Y'<subscript>03high</subscript></entry>
38 </row>
39 <row>
40 <entry>start&nbsp;+&nbsp;8:</entry>
41 <entry>Y'<subscript>10low</subscript></entry>
42 <entry>Y'<subscript>10high</subscript></entry>
43 <entry>Y'<subscript>11low</subscript></entry>
44 <entry>Y'<subscript>11high</subscript></entry>
45 <entry>Y'<subscript>12low</subscript></entry>
46 <entry>Y'<subscript>12high</subscript></entry>
47 <entry>Y'<subscript>13low</subscript></entry>
48 <entry>Y'<subscript>13high</subscript></entry>
49 </row>
50 <row>
51 <entry>start&nbsp;+&nbsp;16:</entry>
52 <entry>Y'<subscript>20low</subscript></entry>
53 <entry>Y'<subscript>20high</subscript></entry>
54 <entry>Y'<subscript>21low</subscript></entry>
55 <entry>Y'<subscript>21high</subscript></entry>
56 <entry>Y'<subscript>22low</subscript></entry>
57 <entry>Y'<subscript>22high</subscript></entry>
58 <entry>Y'<subscript>23low</subscript></entry>
59 <entry>Y'<subscript>23high</subscript></entry>
60 </row>
61 <row>
62 <entry>start&nbsp;+&nbsp;24:</entry>
63 <entry>Y'<subscript>30low</subscript></entry>
64 <entry>Y'<subscript>30high</subscript></entry>
65 <entry>Y'<subscript>31low</subscript></entry>
66 <entry>Y'<subscript>31high</subscript></entry>
67 <entry>Y'<subscript>32low</subscript></entry>
68 <entry>Y'<subscript>32high</subscript></entry>
69 <entry>Y'<subscript>33low</subscript></entry>
70 <entry>Y'<subscript>33high</subscript></entry>
71 </row>
72 </tbody>
73 </tgroup>
74 </informaltable>
75 </para>
76 </formalpara>
77 </example>
78 </refsect1>
79</refentry>
diff --git a/Documentation/DocBook/v4l/pixfmt-y10b.xml b/Documentation/DocBook/v4l/pixfmt-y10b.xml
new file mode 100644
index 000000000000..adb0ad808c93
--- /dev/null
+++ b/Documentation/DocBook/v4l/pixfmt-y10b.xml
@@ -0,0 +1,43 @@
1<refentry id="V4L2-PIX-FMT-Y10BPACK">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_Y10BPACK ('Y10B')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_Y10BPACK</constant></refname>
8 <refpurpose>Grey-scale image as a bit-packed array</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This is a packed grey-scale image format with a depth of 10 bits per
14 pixel. Pixels are stored in a bit-packed array of 10bit bits per pixel,
15 with no padding between them and with the most significant bits coming
16 first from the left.</para>
17
18 <example>
19 <title><constant>V4L2_PIX_FMT_Y10BPACK</constant> 4 pixel data stream taking 5 bytes</title>
20
21 <formalpara>
22 <title>Bit-packed representation</title>
23 <para>pixels cross the byte boundary and have a ratio of 5 bytes for each 4
24 pixels.
25 <informaltable frame="all">
26 <tgroup cols="5" align="center">
27 <colspec align="left" colwidth="2*" />
28 <tbody valign="top">
29 <row>
30 <entry>Y'<subscript>00[9:2]</subscript></entry>
31 <entry>Y'<subscript>00[1:0]</subscript>Y'<subscript>01[9:4]</subscript></entry>
32 <entry>Y'<subscript>01[3:0]</subscript>Y'<subscript>02[9:6]</subscript></entry>
33 <entry>Y'<subscript>02[5:0]</subscript>Y'<subscript>03[9:8]</subscript></entry>
34 <entry>Y'<subscript>03[7:0]</subscript></entry>
35 </row>
36 </tbody>
37 </tgroup>
38 </informaltable>
39 </para>
40 </formalpara>
41 </example>
42 </refsect1>
43</refentry>
diff --git a/Documentation/DocBook/v4l/pixfmt-y12.xml b/Documentation/DocBook/v4l/pixfmt-y12.xml
new file mode 100644
index 000000000000..ff417b858cc9
--- /dev/null
+++ b/Documentation/DocBook/v4l/pixfmt-y12.xml
@@ -0,0 +1,79 @@
1<refentry id="V4L2-PIX-FMT-Y12">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_Y12 ('Y12 ')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_Y12</constant></refname>
8 <refpurpose>Grey-scale image</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This is a grey-scale image with a depth of 12 bits per pixel. Pixels
14are stored in 16-bit words with unused high bits padded with 0. The least
15significant byte is stored at lower memory addresses (little-endian).</para>
16
17 <example>
18 <title><constant>V4L2_PIX_FMT_Y12</constant> 4 &times; 4
19pixel image</title>
20
21 <formalpara>
22 <title>Byte Order.</title>
23 <para>Each cell is one byte.
24 <informaltable frame="none">
25 <tgroup cols="9" align="center">
26 <colspec align="left" colwidth="2*" />
27 <tbody valign="top">
28 <row>
29 <entry>start&nbsp;+&nbsp;0:</entry>
30 <entry>Y'<subscript>00low</subscript></entry>
31 <entry>Y'<subscript>00high</subscript></entry>
32 <entry>Y'<subscript>01low</subscript></entry>
33 <entry>Y'<subscript>01high</subscript></entry>
34 <entry>Y'<subscript>02low</subscript></entry>
35 <entry>Y'<subscript>02high</subscript></entry>
36 <entry>Y'<subscript>03low</subscript></entry>
37 <entry>Y'<subscript>03high</subscript></entry>
38 </row>
39 <row>
40 <entry>start&nbsp;+&nbsp;8:</entry>
41 <entry>Y'<subscript>10low</subscript></entry>
42 <entry>Y'<subscript>10high</subscript></entry>
43 <entry>Y'<subscript>11low</subscript></entry>
44 <entry>Y'<subscript>11high</subscript></entry>
45 <entry>Y'<subscript>12low</subscript></entry>
46 <entry>Y'<subscript>12high</subscript></entry>
47 <entry>Y'<subscript>13low</subscript></entry>
48 <entry>Y'<subscript>13high</subscript></entry>
49 </row>
50 <row>
51 <entry>start&nbsp;+&nbsp;16:</entry>
52 <entry>Y'<subscript>20low</subscript></entry>
53 <entry>Y'<subscript>20high</subscript></entry>
54 <entry>Y'<subscript>21low</subscript></entry>
55 <entry>Y'<subscript>21high</subscript></entry>
56 <entry>Y'<subscript>22low</subscript></entry>
57 <entry>Y'<subscript>22high</subscript></entry>
58 <entry>Y'<subscript>23low</subscript></entry>
59 <entry>Y'<subscript>23high</subscript></entry>
60 </row>
61 <row>
62 <entry>start&nbsp;+&nbsp;24:</entry>
63 <entry>Y'<subscript>30low</subscript></entry>
64 <entry>Y'<subscript>30high</subscript></entry>
65 <entry>Y'<subscript>31low</subscript></entry>
66 <entry>Y'<subscript>31high</subscript></entry>
67 <entry>Y'<subscript>32low</subscript></entry>
68 <entry>Y'<subscript>32high</subscript></entry>
69 <entry>Y'<subscript>33low</subscript></entry>
70 <entry>Y'<subscript>33high</subscript></entry>
71 </row>
72 </tbody>
73 </tgroup>
74 </informaltable>
75 </para>
76 </formalpara>
77 </example>
78 </refsect1>
79</refentry>
diff --git a/Documentation/DocBook/v4l/pixfmt-yuv420m.xml b/Documentation/DocBook/v4l/pixfmt-yuv420m.xml
new file mode 100644
index 000000000000..f5d8f57495c8
--- /dev/null
+++ b/Documentation/DocBook/v4l/pixfmt-yuv420m.xml
@@ -0,0 +1,162 @@
1 <refentry id="V4L2-PIX-FMT-YUV420M">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_YUV420M ('YU12M')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname> <constant>V4L2_PIX_FMT_YUV420M</constant></refname>
8 <refpurpose>Variation of <constant>V4L2_PIX_FMT_YUV420</constant>
9 with planes non contiguous in memory. </refpurpose>
10 </refnamediv>
11
12 <refsect1>
13 <title>Description</title>
14
15 <para>This is a multi-planar format, as opposed to a packed format.
16The three components are separated into three sub- images or planes.
17
18The Y plane is first. The Y plane has one byte per pixel. The Cb data
19constitutes the second plane which is half the width and half
20the height of the Y plane (and of the image). Each Cb belongs to four
21pixels, a two-by-two square of the image. For example,
22Cb<subscript>0</subscript> belongs to Y'<subscript>00</subscript>,
23Y'<subscript>01</subscript>, Y'<subscript>10</subscript>, and
24Y'<subscript>11</subscript>. The Cr data, just like the Cb plane, is
25in the third plane. </para>
26
27 <para>If the Y plane has pad bytes after each row, then the Cb
28and Cr planes have half as many pad bytes after their rows. In other
29words, two Cx rows (including padding) is exactly as long as one Y row
30(including padding).</para>
31
32 <para><constant>V4L2_PIX_FMT_NV12M</constant> is intended to be
33used only in drivers and applications that support the multi-planar API,
34described in <xref linkend="planar-apis"/>. </para>
35
36 <example>
37 <title><constant>V4L2_PIX_FMT_YVU420M</constant> 4 &times; 4
38pixel image</title>
39
40 <formalpara>
41 <title>Byte Order.</title>
42 <para>Each cell is one byte.
43 <informaltable frame="none">
44 <tgroup cols="5" align="center">
45 <colspec align="left" colwidth="2*" />
46 <tbody valign="top">
47 <row>
48 <entry>start0&nbsp;+&nbsp;0:</entry>
49 <entry>Y'<subscript>00</subscript></entry>
50 <entry>Y'<subscript>01</subscript></entry>
51 <entry>Y'<subscript>02</subscript></entry>
52 <entry>Y'<subscript>03</subscript></entry>
53 </row>
54 <row>
55 <entry>start0&nbsp;+&nbsp;4:</entry>
56 <entry>Y'<subscript>10</subscript></entry>
57 <entry>Y'<subscript>11</subscript></entry>
58 <entry>Y'<subscript>12</subscript></entry>
59 <entry>Y'<subscript>13</subscript></entry>
60 </row>
61 <row>
62 <entry>start0&nbsp;+&nbsp;8:</entry>
63 <entry>Y'<subscript>20</subscript></entry>
64 <entry>Y'<subscript>21</subscript></entry>
65 <entry>Y'<subscript>22</subscript></entry>
66 <entry>Y'<subscript>23</subscript></entry>
67 </row>
68 <row>
69 <entry>start0&nbsp;+&nbsp;12:</entry>
70 <entry>Y'<subscript>30</subscript></entry>
71 <entry>Y'<subscript>31</subscript></entry>
72 <entry>Y'<subscript>32</subscript></entry>
73 <entry>Y'<subscript>33</subscript></entry>
74 </row>
75 <row><entry></entry></row>
76 <row>
77 <entry>start1&nbsp;+&nbsp;0:</entry>
78 <entry>Cb<subscript>00</subscript></entry>
79 <entry>Cb<subscript>01</subscript></entry>
80 </row>
81 <row>
82 <entry>start1&nbsp;+&nbsp;2:</entry>
83 <entry>Cb<subscript>10</subscript></entry>
84 <entry>Cb<subscript>11</subscript></entry>
85 </row>
86 <row><entry></entry></row>
87 <row>
88 <entry>start2&nbsp;+&nbsp;0:</entry>
89 <entry>Cr<subscript>00</subscript></entry>
90 <entry>Cr<subscript>01</subscript></entry>
91 </row>
92 <row>
93 <entry>start2&nbsp;+&nbsp;2:</entry>
94 <entry>Cr<subscript>10</subscript></entry>
95 <entry>Cr<subscript>11</subscript></entry>
96 </row>
97 </tbody>
98 </tgroup>
99 </informaltable>
100 </para>
101 </formalpara>
102
103 <formalpara>
104 <title>Color Sample Location.</title>
105 <para>
106 <informaltable frame="none">
107 <tgroup cols="7" align="center">
108 <tbody valign="top">
109 <row>
110 <entry></entry>
111 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
112 <entry>2</entry><entry></entry><entry>3</entry>
113 </row>
114 <row>
115 <entry>0</entry>
116 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
117 <entry>Y</entry><entry></entry><entry>Y</entry>
118 </row>
119 <row>
120 <entry></entry>
121 <entry></entry><entry>C</entry><entry></entry><entry></entry>
122 <entry></entry><entry>C</entry><entry></entry>
123 </row>
124 <row>
125 <entry>1</entry>
126 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
127 <entry>Y</entry><entry></entry><entry>Y</entry>
128 </row>
129 <row>
130 <entry></entry>
131 </row>
132 <row>
133 <entry>2</entry>
134 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
135 <entry>Y</entry><entry></entry><entry>Y</entry>
136 </row>
137 <row>
138 <entry></entry>
139 <entry></entry><entry>C</entry><entry></entry><entry></entry>
140 <entry></entry><entry>C</entry><entry></entry>
141 </row>
142 <row>
143 <entry>3</entry>
144 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
145 <entry>Y</entry><entry></entry><entry>Y</entry>
146 </row>
147 </tbody>
148 </tgroup>
149 </informaltable>
150 </para>
151 </formalpara>
152 </example>
153 </refsect1>
154 </refentry>
155
156 <!--
157Local Variables:
158mode: sgml
159sgml-parent-document: "pixfmt.sgml"
160indent-tabs-mode: nil
161End:
162 -->
diff --git a/Documentation/DocBook/v4l/pixfmt.xml b/Documentation/DocBook/v4l/pixfmt.xml
index c4ad0a8e42dc..deb660207f94 100644
--- a/Documentation/DocBook/v4l/pixfmt.xml
+++ b/Documentation/DocBook/v4l/pixfmt.xml
@@ -2,12 +2,16 @@
2 2
3 <para>The V4L2 API was primarily designed for devices exchanging 3 <para>The V4L2 API was primarily designed for devices exchanging
4image data with applications. The 4image data with applications. The
5<structname>v4l2_pix_format</structname> structure defines the format 5<structname>v4l2_pix_format</structname> and <structname>v4l2_pix_format_mplane
6and layout of an image in memory. Image formats are negotiated with 6</structname> structures define the format and layout of an image in memory.
7the &VIDIOC-S-FMT; ioctl. (The explanations here focus on video 7The former is used with the single-planar API, while the latter is used with the
8multi-planar version (see <xref linkend="planar-apis"/>). Image formats are
9negotiated with the &VIDIOC-S-FMT; ioctl. (The explanations here focus on video
8capturing and output, for overlay frame buffer formats see also 10capturing and output, for overlay frame buffer formats see also
9&VIDIOC-G-FBUF;.)</para> 11&VIDIOC-G-FBUF;.)</para>
10 12
13<section>
14 <title>Single-planar format structure</title>
11 <table pgwide="1" frame="none" id="v4l2-pix-format"> 15 <table pgwide="1" frame="none" id="v4l2-pix-format">
12 <title>struct <structname>v4l2_pix_format</structname></title> 16 <title>struct <structname>v4l2_pix_format</structname></title>
13 <tgroup cols="3"> 17 <tgroup cols="3">
@@ -106,6 +110,98 @@ set this field to zero.</entry>
106 </tbody> 110 </tbody>
107 </tgroup> 111 </tgroup>
108 </table> 112 </table>
113</section>
114
115<section>
116 <title>Multi-planar format structures</title>
117 <para>The <structname>v4l2_plane_pix_format</structname> structures define
118 size and layout for each of the planes in a multi-planar format.
119 The <structname>v4l2_pix_format_mplane</structname> structure contains
120 information common to all planes (such as image width and height) and
121 an array of <structname>v4l2_plane_pix_format</structname> structures,
122 describing all planes of that format.</para>
123 <table pgwide="1" frame="none" id="v4l2-plane-pix-format">
124 <title>struct <structname>vl42_plane_pix_format</structname></title>
125 <tgroup cols="3">
126 &cs-str;
127 <tbody valign="top">
128 <row>
129 <entry>__u32</entry>
130 <entry><structfield>sizeimage</structfield></entry>
131 <entry>Maximum size in bytes required for image data in this plane.
132 </entry>
133 </row>
134 <row>
135 <entry>__u16</entry>
136 <entry><structfield>bytesperline</structfield></entry>
137 <entry>Distance in bytes between the leftmost pixels in two adjacent
138 lines.</entry>
139 </row>
140 <row>
141 <entry>__u16</entry>
142 <entry><structfield>reserved[7]</structfield></entry>
143 <entry>Reserved for future extensions. Should be zeroed by the
144 application.</entry>
145 </row>
146 </tbody>
147 </tgroup>
148 </table>
149 <table pgwide="1" frame="none" id="v4l2-pix-format-mplane">
150 <title>struct <structname>v4l2_pix_format_mplane</structname></title>
151 <tgroup cols="3">
152 &cs-str;
153 <tbody valign="top">
154 <row>
155 <entry>__u32</entry>
156 <entry><structfield>width</structfield></entry>
157 <entry>Image width in pixels.</entry>
158 </row>
159 <row>
160 <entry>__u32</entry>
161 <entry><structfield>height</structfield></entry>
162 <entry>Image height in pixels.</entry>
163 </row>
164 <row>
165 <entry>__u32</entry>
166 <entry><structfield>pixelformat</structfield></entry>
167 <entry>The pixel format. Both single- and multi-planar four character
168codes can be used.</entry>
169 </row>
170 <row>
171 <entry>&v4l2-field;</entry>
172 <entry><structfield>field</structfield></entry>
173 <entry>See &v4l2-pix-format;.</entry>
174 </row>
175 <row>
176 <entry>&v4l2-colorspace;</entry>
177 <entry><structfield>colorspace</structfield></entry>
178 <entry>See &v4l2-pix-format;.</entry>
179 </row>
180 <row>
181 <entry>&v4l2-plane-pix-format;</entry>
182 <entry><structfield>plane_fmt[VIDEO_MAX_PLANES]</structfield></entry>
183 <entry>An array of structures describing format of each plane this
184 pixel format consists of. The number of valid entries in this array
185 has to be put in the <structfield>num_planes</structfield>
186 field.</entry>
187 </row>
188 <row>
189 <entry>__u8</entry>
190 <entry><structfield>num_planes</structfield></entry>
191 <entry>Number of planes (i.e. separate memory buffers) for this format
192 and the number of valid entries in the
193 <structfield>plane_fmt</structfield> array.</entry>
194 </row>
195 <row>
196 <entry>__u8</entry>
197 <entry><structfield>reserved[11]</structfield></entry>
198 <entry>Reserved for future extensions. Should be zeroed by the
199 application.</entry>
200 </row>
201 </tbody>
202 </tgroup>
203 </table>
204</section>
109 205
110 <section> 206 <section>
111 <title>Standard Image Formats</title> 207 <title>Standard Image Formats</title>
@@ -144,9 +240,17 @@ has just as many pad bytes after it as the other rows.</para>
144 <para>In V4L2 each format has an identifier which looks like 240 <para>In V4L2 each format has an identifier which looks like
145<constant>PIX_FMT_XXX</constant>, defined in the <link 241<constant>PIX_FMT_XXX</constant>, defined in the <link
146linkend="videodev">videodev.h</link> header file. These identifiers 242linkend="videodev">videodev.h</link> header file. These identifiers
147represent <link linkend="v4l2-fourcc">four character codes</link> 243represent <link linkend="v4l2-fourcc">four character (FourCC) codes</link>
148which are also listed below, however they are not the same as those 244which are also listed below, however they are not the same as those
149used in the Windows world.</para> 245used in the Windows world.</para>
246
247 <para>For some formats, data is stored in separate, discontiguous
248memory buffers. Those formats are identified by a separate set of FourCC codes
249and are referred to as "multi-planar formats". For example, a YUV422 frame is
250normally stored in one memory buffer, but it can also be placed in two or three
251separate buffers, with Y component in one buffer and CbCr components in another
252in the 2-planar version or with each component in its own buffer in the
2533-planar case. Those sub-buffers are referred to as "planes".</para>
150 </section> 254 </section>
151 255
152 <section id="colorspaces"> 256 <section id="colorspaces">
@@ -566,7 +670,10 @@ access the palette, this must be done with ioctls of the Linux framebuffer API.<
566 &sub-sbggr8; 670 &sub-sbggr8;
567 &sub-sgbrg8; 671 &sub-sgbrg8;
568 &sub-sgrbg8; 672 &sub-sgrbg8;
673 &sub-srggb8;
569 &sub-sbggr16; 674 &sub-sbggr16;
675 &sub-srggb10;
676 &sub-srggb12;
570 </section> 677 </section>
571 678
572 <section id="yuv-formats"> 679 <section id="yuv-formats">
@@ -589,6 +696,9 @@ information.</para>
589 696
590 &sub-packed-yuv; 697 &sub-packed-yuv;
591 &sub-grey; 698 &sub-grey;
699 &sub-y10;
700 &sub-y12;
701 &sub-y10b;
592 &sub-y16; 702 &sub-y16;
593 &sub-yuyv; 703 &sub-yuyv;
594 &sub-uyvy; 704 &sub-uyvy;
@@ -596,11 +706,15 @@ information.</para>
596 &sub-vyuy; 706 &sub-vyuy;
597 &sub-y41p; 707 &sub-y41p;
598 &sub-yuv420; 708 &sub-yuv420;
709 &sub-yuv420m;
599 &sub-yuv410; 710 &sub-yuv410;
600 &sub-yuv422p; 711 &sub-yuv422p;
601 &sub-yuv411p; 712 &sub-yuv411p;
602 &sub-nv12; 713 &sub-nv12;
714 &sub-nv12m;
715 &sub-nv12mt;
603 &sub-nv16; 716 &sub-nv16;
717 &sub-m420;
604 </section> 718 </section>
605 719
606 <section> 720 <section>
@@ -685,6 +799,11 @@ http://www.ivtvdriver.org/</ulink></para><para>The format is documented in the
685kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm12</filename> 799kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm12</filename>
686</para></entry> 800</para></entry>
687 </row> 801 </row>
802 <row id="V4L2-PIX-FMT-CPIA1">
803 <entry><constant>V4L2_PIX_FMT_CPIA1</constant></entry>
804 <entry>'CPIA'</entry>
805 <entry>YUV format used by the gspca cpia1 driver.</entry>
806 </row>
688 <row id="V4L2-PIX-FMT-SPCA501"> 807 <row id="V4L2-PIX-FMT-SPCA501">
689 <entry><constant>V4L2_PIX_FMT_SPCA501</constant></entry> 808 <entry><constant>V4L2_PIX_FMT_SPCA501</constant></entry>
690 <entry>'S501'</entry> 809 <entry>'S501'</entry>
@@ -705,11 +824,6 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm
705 <entry>'S561'</entry> 824 <entry>'S561'</entry>
706 <entry>Compressed GBRG Bayer format used by the gspca driver.</entry> 825 <entry>Compressed GBRG Bayer format used by the gspca driver.</entry>
707 </row> 826 </row>
708 <row id="V4L2-PIX-FMT-SGRBG10">
709 <entry><constant>V4L2_PIX_FMT_SGRBG10</constant></entry>
710 <entry>'DA10'</entry>
711 <entry>10 bit raw Bayer, expanded to 16 bits.</entry>
712 </row>
713 <row id="V4L2-PIX-FMT-SGRBG10DPCM8"> 827 <row id="V4L2-PIX-FMT-SGRBG10DPCM8">
714 <entry><constant>V4L2_PIX_FMT_SGRBG10DPCM8</constant></entry> 828 <entry><constant>V4L2_PIX_FMT_SGRBG10DPCM8</constant></entry>
715 <entry>'DB10'</entry> 829 <entry>'DB10'</entry>
@@ -770,6 +884,11 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm
770 <entry>'S920'</entry> 884 <entry>'S920'</entry>
771 <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry> 885 <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry>
772 </row> 886 </row>
887 <row id="V4L2-PIX-FMT-SN9C2028">
888 <entry><constant>V4L2_PIX_FMT_SN9C2028</constant></entry>
889 <entry>'SONX'</entry>
890 <entry>Compressed GBRG bayer format of the gspca sn9c2028 driver.</entry>
891 </row>
773 <row id="V4L2-PIX-FMT-STV0680"> 892 <row id="V4L2-PIX-FMT-STV0680">
774 <entry><constant>V4L2_PIX_FMT_STV0680</constant></entry> 893 <entry><constant>V4L2_PIX_FMT_STV0680</constant></entry>
775 <entry>'S680'</entry> 894 <entry>'S680'</entry>
@@ -787,6 +906,20 @@ http://www.thedirks.org/winnov/</ulink></para></entry>
787 <entry>'TM60'</entry> 906 <entry>'TM60'</entry>
788 <entry><para>Used by Trident tm6000</para></entry> 907 <entry><para>Used by Trident tm6000</para></entry>
789 </row> 908 </row>
909 <row id="V4L2-PIX-FMT-CIT-YYVYUY">
910 <entry><constant>V4L2_PIX_FMT_CIT_YYVYUY</constant></entry>
911 <entry>'CITV'</entry>
912 <entry><para>Used by xirlink CIT, found at IBM webcams.</para>
913 <para>Uses one line of Y then 1 line of VYUY</para>
914 </entry>
915 </row>
916 <row id="V4L2-PIX-FMT-KONICA420">
917 <entry><constant>V4L2_PIX_FMT_KONICA420</constant></entry>
918 <entry>'KONI'</entry>
919 <entry><para>Used by Konica webcams.</para>
920 <para>YUV420 planar in blocks of 256 pixels.</para>
921 </entry>
922 </row>
790 <row id="V4L2-PIX-FMT-YYUV"> 923 <row id="V4L2-PIX-FMT-YYUV">
791 <entry><constant>V4L2_PIX_FMT_YYUV</constant></entry> 924 <entry><constant>V4L2_PIX_FMT_YYUV</constant></entry>
792 <entry>'YYUV'</entry> 925 <entry>'YYUV'</entry>
diff --git a/Documentation/DocBook/v4l/planar-apis.xml b/Documentation/DocBook/v4l/planar-apis.xml
new file mode 100644
index 000000000000..878ce2040488
--- /dev/null
+++ b/Documentation/DocBook/v4l/planar-apis.xml
@@ -0,0 +1,62 @@
1<section id="planar-apis">
2 <title>Single- and multi-planar APIs</title>
3
4 <para>Some devices require data for each input or output video frame
5 to be placed in discontiguous memory buffers. In such cases, one
6 video frame has to be addressed using more than one memory address, i.e. one
7 pointer per "plane". A plane is a sub-buffer of the current frame. For
8 examples of such formats see <xref linkend="pixfmt" />.</para>
9
10 <para>Initially, V4L2 API did not support multi-planar buffers and a set of
11 extensions has been introduced to handle them. Those extensions constitute
12 what is being referred to as the "multi-planar API".</para>
13
14 <para>Some of the V4L2 API calls and structures are interpreted differently,
15 depending on whether single- or multi-planar API is being used. An application
16 can choose whether to use one or the other by passing a corresponding buffer
17 type to its ioctl calls. Multi-planar versions of buffer types are suffixed
18 with an `_MPLANE' string. For a list of available multi-planar buffer types
19 see &v4l2-buf-type;.
20 </para>
21
22 <section>
23 <title>Multi-planar formats</title>
24 <para>Multi-planar API introduces new multi-planar formats. Those formats
25 use a separate set of FourCC codes. It is important to distinguish between
26 the multi-planar API and a multi-planar format. Multi-planar API calls can
27 handle all single-planar formats as well (as long as they are passed in
28 multi-planar API structures), while the single-planar API cannot
29 handle multi-planar formats.</para>
30 </section>
31
32 <section>
33 <title>Calls that distinguish between single and multi-planar APIs</title>
34 <variablelist>
35 <varlistentry>
36 <term>&VIDIOC-QUERYCAP;</term>
37 <listitem><para>Two additional multi-planar capabilities are added. They can
38 be set together with non-multi-planar ones for devices that handle
39 both single- and multi-planar formats.</para></listitem>
40 </varlistentry>
41 <varlistentry>
42 <term>&VIDIOC-G-FMT;, &VIDIOC-S-FMT;, &VIDIOC-TRY-FMT;</term>
43 <listitem><para>New structures for describing multi-planar formats are added:
44 &v4l2-pix-format-mplane; and &v4l2-plane-pix-format;. Drivers may
45 define new multi-planar formats, which have distinct FourCC codes from
46 the existing single-planar ones.</para>
47 </listitem>
48 </varlistentry>
49 <varlistentry>
50 <term>&VIDIOC-QBUF;, &VIDIOC-DQBUF;, &VIDIOC-QUERYBUF;</term>
51 <listitem><para>A new &v4l2-plane; structure for describing planes is added.
52 Arrays of this structure are passed in the new
53 <structfield>m.planes</structfield> field of &v4l2-buffer;.</para>
54 </listitem>
55 </varlistentry>
56 <varlistentry>
57 <term>&VIDIOC-REQBUFS;</term>
58 <listitem><para>Will allocate multi-planar buffers as requested.</para></listitem>
59 </varlistentry>
60 </variablelist>
61 </section>
62</section>
diff --git a/Documentation/DocBook/v4l/remote_controllers.xml b/Documentation/DocBook/v4l/remote_controllers.xml
index 3c3b667b28e7..160e464d44b7 100644
--- a/Documentation/DocBook/v4l/remote_controllers.xml
+++ b/Documentation/DocBook/v4l/remote_controllers.xml
@@ -133,7 +133,7 @@ different IR's. Due to that, V4L2 API now specifies a standard for mapping Media
133<row><entry><constant>KEY_LEFT</constant></entry><entry>Left key</entry><entry>LEFT</entry></row> 133<row><entry><constant>KEY_LEFT</constant></entry><entry>Left key</entry><entry>LEFT</entry></row>
134<row><entry><constant>KEY_RIGHT</constant></entry><entry>Right key</entry><entry>RIGHT</entry></row> 134<row><entry><constant>KEY_RIGHT</constant></entry><entry>Right key</entry><entry>RIGHT</entry></row>
135 135
136<row><entry><emphasis role="bold">Miscelaneous keys</emphasis></entry></row> 136<row><entry><emphasis role="bold">Miscellaneous keys</emphasis></entry></row>
137 137
138<row><entry><constant>KEY_DOT</constant></entry><entry>Return a dot</entry><entry>.</entry></row> 138<row><entry><constant>KEY_DOT</constant></entry><entry>Return a dot</entry><entry>.</entry></row>
139<row><entry><constant>KEY_FN</constant></entry><entry>Select a function</entry><entry>FUNCTION</entry></row> 139<row><entry><constant>KEY_FN</constant></entry><entry>Select a function</entry><entry>FUNCTION</entry></row>
diff --git a/Documentation/DocBook/v4l/subdev-formats.xml b/Documentation/DocBook/v4l/subdev-formats.xml
new file mode 100644
index 000000000000..8d3409d2c632
--- /dev/null
+++ b/Documentation/DocBook/v4l/subdev-formats.xml
@@ -0,0 +1,2572 @@
1<section id="v4l2-mbus-format">
2 <title>Media Bus Formats</title>
3
4 <table pgwide="1" frame="none" id="v4l2-mbus-framefmt">
5 <title>struct <structname>v4l2_mbus_framefmt</structname></title>
6 <tgroup cols="3">
7 &cs-str;
8 <tbody valign="top">
9 <row>
10 <entry>__u32</entry>
11 <entry><structfield>width</structfield></entry>
12 <entry>Image width, in pixels.</entry>
13 </row>
14 <row>
15 <entry>__u32</entry>
16 <entry><structfield>height</structfield></entry>
17 <entry>Image height, in pixels.</entry>
18 </row>
19 <row>
20 <entry>__u32</entry>
21 <entry><structfield>code</structfield></entry>
22 <entry>Format code, from &v4l2-mbus-pixelcode;.</entry>
23 </row>
24 <row>
25 <entry>__u32</entry>
26 <entry><structfield>field</structfield></entry>
27 <entry>Field order, from &v4l2-field;. See
28 <xref linkend="field-order" /> for details.</entry>
29 </row>
30 <row>
31 <entry>__u32</entry>
32 <entry><structfield>colorspace</structfield></entry>
33 <entry>Image colorspace, from &v4l2-colorspace;. See
34 <xref linkend="colorspaces" /> for details.</entry>
35 </row>
36 <row>
37 <entry>__u32</entry>
38 <entry><structfield>reserved</structfield>[7]</entry>
39 <entry>Reserved for future extensions. Applications and drivers must
40 set the array to zero.</entry>
41 </row>
42 </tbody>
43 </tgroup>
44 </table>
45
46 <section id="v4l2-mbus-pixelcode">
47 <title>Media Bus Pixel Codes</title>
48
49 <para>The media bus pixel codes describe image formats as flowing over
50 physical busses (both between separate physical components and inside SoC
51 devices). This should not be confused with the V4L2 pixel formats that
52 describe, using four character codes, image formats as stored in memory.
53 </para>
54
55 <para>While there is a relationship between image formats on busses and
56 image formats in memory (a raw Bayer image won't be magically converted to
57 JPEG just by storing it to memory), there is no one-to-one correspondance
58 between them.</para>
59
60 <section>
61 <title>Packed RGB Formats</title>
62
63 <para>Those formats transfer pixel data as red, green and blue components.
64 The format code is made of the following information.
65 <itemizedlist>
66 <listitem><para>The red, green and blue components order code, as encoded in a
67 pixel sample. Possible values are RGB and BGR.</para></listitem>
68 <listitem><para>The number of bits per component, for each component. The values
69 can be different for all components. Common values are 555 and 565.</para>
70 </listitem>
71 <listitem><para>The number of bus samples per pixel. Pixels that are wider than
72 the bus width must be transferred in multiple samples. Common values are
73 1 and 2.</para></listitem>
74 <listitem><para>The bus width.</para></listitem>
75 <listitem><para>For formats where the total number of bits per pixel is smaller
76 than the number of bus samples per pixel times the bus width, a padding
77 value stating if the bytes are padded in their most high order bits
78 (PADHI) or low order bits (PADLO).</para></listitem>
79 <listitem><para>For formats where the number of bus samples per pixel is larger
80 than 1, an endianness value stating if the pixel is transferred MSB first
81 (BE) or LSB first (LE).</para></listitem>
82 </itemizedlist>
83 </para>
84
85 <para>For instance, a format where pixels are encoded as 5-bits red, 5-bits
86 green and 5-bit blue values padded on the high bit, transferred as 2 8-bit
87 samples per pixel with the most significant bits (padding, red and half of
88 the green value) transferred first will be named
89 <constant>V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE</constant>.
90 </para>
91
92 <para>The following tables list existing packet RGB formats.</para>
93
94 <table pgwide="0" frame="none" id="v4l2-mbus-pixelcode-rgb">
95 <title>RGB formats</title>
96 <tgroup cols="11">
97 <colspec colname="id" align="left" />
98 <colspec colname="code" align="center"/>
99 <colspec colname="bit" />
100 <colspec colnum="4" colname="b07" align="center" />
101 <colspec colnum="5" colname="b06" align="center" />
102 <colspec colnum="6" colname="b05" align="center" />
103 <colspec colnum="7" colname="b04" align="center" />
104 <colspec colnum="8" colname="b03" align="center" />
105 <colspec colnum="9" colname="b02" align="center" />
106 <colspec colnum="10" colname="b01" align="center" />
107 <colspec colnum="11" colname="b00" align="center" />
108 <spanspec namest="b07" nameend="b00" spanname="b0" />
109 <thead>
110 <row>
111 <entry>Identifier</entry>
112 <entry>Code</entry>
113 <entry></entry>
114 <entry spanname="b0">Data organization</entry>
115 </row>
116 <row>
117 <entry></entry>
118 <entry></entry>
119 <entry>Bit</entry>
120 <entry>7</entry>
121 <entry>6</entry>
122 <entry>5</entry>
123 <entry>4</entry>
124 <entry>3</entry>
125 <entry>2</entry>
126 <entry>1</entry>
127 <entry>0</entry>
128 </row>
129 </thead>
130 <tbody valign="top">
131 <row id="V4L2-MBUS-FMT-RGB444-2X8-PADHI-BE">
132 <entry>V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE</entry>
133 <entry>0x1001</entry>
134 <entry></entry>
135 <entry>0</entry>
136 <entry>0</entry>
137 <entry>0</entry>
138 <entry>0</entry>
139 <entry>r<subscript>3</subscript></entry>
140 <entry>r<subscript>2</subscript></entry>
141 <entry>r<subscript>1</subscript></entry>
142 <entry>r<subscript>0</subscript></entry>
143 </row>
144 <row>
145 <entry></entry>
146 <entry></entry>
147 <entry></entry>
148 <entry>g<subscript>3</subscript></entry>
149 <entry>g<subscript>2</subscript></entry>
150 <entry>g<subscript>1</subscript></entry>
151 <entry>g<subscript>0</subscript></entry>
152 <entry>b<subscript>3</subscript></entry>
153 <entry>b<subscript>2</subscript></entry>
154 <entry>b<subscript>1</subscript></entry>
155 <entry>b<subscript>0</subscript></entry>
156 </row>
157 <row id="V4L2-MBUS-FMT-RGB444-2X8-PADHI-LE">
158 <entry>V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE</entry>
159 <entry>0x1002</entry>
160 <entry></entry>
161 <entry>g<subscript>3</subscript></entry>
162 <entry>g<subscript>2</subscript></entry>
163 <entry>g<subscript>1</subscript></entry>
164 <entry>g<subscript>0</subscript></entry>
165 <entry>b<subscript>3</subscript></entry>
166 <entry>b<subscript>2</subscript></entry>
167 <entry>b<subscript>1</subscript></entry>
168 <entry>b<subscript>0</subscript></entry>
169 </row>
170 <row>
171 <entry></entry>
172 <entry></entry>
173 <entry></entry>
174 <entry>0</entry>
175 <entry>0</entry>
176 <entry>0</entry>
177 <entry>0</entry>
178 <entry>r<subscript>3</subscript></entry>
179 <entry>r<subscript>2</subscript></entry>
180 <entry>r<subscript>1</subscript></entry>
181 <entry>r<subscript>0</subscript></entry>
182 </row>
183 <row id="V4L2-MBUS-FMT-RGB555-2X8-PADHI-BE">
184 <entry>V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE</entry>
185 <entry>0x1003</entry>
186 <entry></entry>
187 <entry>0</entry>
188 <entry>r<subscript>4</subscript></entry>
189 <entry>r<subscript>3</subscript></entry>
190 <entry>r<subscript>2</subscript></entry>
191 <entry>r<subscript>1</subscript></entry>
192 <entry>r<subscript>0</subscript></entry>
193 <entry>g<subscript>4</subscript></entry>
194 <entry>g<subscript>3</subscript></entry>
195 </row>
196 <row>
197 <entry></entry>
198 <entry></entry>
199 <entry></entry>
200 <entry>g<subscript>2</subscript></entry>
201 <entry>g<subscript>1</subscript></entry>
202 <entry>g<subscript>0</subscript></entry>
203 <entry>b<subscript>4</subscript></entry>
204 <entry>b<subscript>3</subscript></entry>
205 <entry>b<subscript>2</subscript></entry>
206 <entry>b<subscript>1</subscript></entry>
207 <entry>b<subscript>0</subscript></entry>
208 </row>
209 <row id="V4L2-MBUS-FMT-RGB555-2X8-PADHI-LE">
210 <entry>V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE</entry>
211 <entry>0x1004</entry>
212 <entry></entry>
213 <entry>g<subscript>2</subscript></entry>
214 <entry>g<subscript>1</subscript></entry>
215 <entry>g<subscript>0</subscript></entry>
216 <entry>b<subscript>4</subscript></entry>
217 <entry>b<subscript>3</subscript></entry>
218 <entry>b<subscript>2</subscript></entry>
219 <entry>b<subscript>1</subscript></entry>
220 <entry>b<subscript>0</subscript></entry>
221 </row>
222 <row>
223 <entry></entry>
224 <entry></entry>
225 <entry></entry>
226 <entry>0</entry>
227 <entry>r<subscript>4</subscript></entry>
228 <entry>r<subscript>3</subscript></entry>
229 <entry>r<subscript>2</subscript></entry>
230 <entry>r<subscript>1</subscript></entry>
231 <entry>r<subscript>0</subscript></entry>
232 <entry>g<subscript>4</subscript></entry>
233 <entry>g<subscript>3</subscript></entry>
234 </row>
235 <row id="V4L2-MBUS-FMT-BGR565-2X8-BE">
236 <entry>V4L2_MBUS_FMT_BGR565_2X8_BE</entry>
237 <entry>0x1005</entry>
238 <entry></entry>
239 <entry>b<subscript>4</subscript></entry>
240 <entry>b<subscript>3</subscript></entry>
241 <entry>b<subscript>2</subscript></entry>
242 <entry>b<subscript>1</subscript></entry>
243 <entry>b<subscript>0</subscript></entry>
244 <entry>g<subscript>5</subscript></entry>
245 <entry>g<subscript>4</subscript></entry>
246 <entry>g<subscript>3</subscript></entry>
247 </row>
248 <row>
249 <entry></entry>
250 <entry></entry>
251 <entry></entry>
252 <entry>g<subscript>2</subscript></entry>
253 <entry>g<subscript>1</subscript></entry>
254 <entry>g<subscript>0</subscript></entry>
255 <entry>r<subscript>4</subscript></entry>
256 <entry>r<subscript>3</subscript></entry>
257 <entry>r<subscript>2</subscript></entry>
258 <entry>r<subscript>1</subscript></entry>
259 <entry>r<subscript>0</subscript></entry>
260 </row>
261 <row id="V4L2-MBUS-FMT-BGR565-2X8-LE">
262 <entry>V4L2_MBUS_FMT_BGR565_2X8_LE</entry>
263 <entry>0x1006</entry>
264 <entry></entry>
265 <entry>g<subscript>2</subscript></entry>
266 <entry>g<subscript>1</subscript></entry>
267 <entry>g<subscript>0</subscript></entry>
268 <entry>r<subscript>4</subscript></entry>
269 <entry>r<subscript>3</subscript></entry>
270 <entry>r<subscript>2</subscript></entry>
271 <entry>r<subscript>1</subscript></entry>
272 <entry>r<subscript>0</subscript></entry>
273 </row>
274 <row>
275 <entry></entry>
276 <entry></entry>
277 <entry></entry>
278 <entry>b<subscript>4</subscript></entry>
279 <entry>b<subscript>3</subscript></entry>
280 <entry>b<subscript>2</subscript></entry>
281 <entry>b<subscript>1</subscript></entry>
282 <entry>b<subscript>0</subscript></entry>
283 <entry>g<subscript>5</subscript></entry>
284 <entry>g<subscript>4</subscript></entry>
285 <entry>g<subscript>3</subscript></entry>
286 </row>
287 <row id="V4L2-MBUS-FMT-RGB565-2X8-BE">
288 <entry>V4L2_MBUS_FMT_RGB565_2X8_BE</entry>
289 <entry>0x1007</entry>
290 <entry></entry>
291 <entry>r<subscript>4</subscript></entry>
292 <entry>r<subscript>3</subscript></entry>
293 <entry>r<subscript>2</subscript></entry>
294 <entry>r<subscript>1</subscript></entry>
295 <entry>r<subscript>0</subscript></entry>
296 <entry>g<subscript>5</subscript></entry>
297 <entry>g<subscript>4</subscript></entry>
298 <entry>g<subscript>3</subscript></entry>
299 </row>
300 <row>
301 <entry></entry>
302 <entry></entry>
303 <entry></entry>
304 <entry>g<subscript>2</subscript></entry>
305 <entry>g<subscript>1</subscript></entry>
306 <entry>g<subscript>0</subscript></entry>
307 <entry>b<subscript>4</subscript></entry>
308 <entry>b<subscript>3</subscript></entry>
309 <entry>b<subscript>2</subscript></entry>
310 <entry>b<subscript>1</subscript></entry>
311 <entry>b<subscript>0</subscript></entry>
312 </row>
313 <row id="V4L2-MBUS-FMT-RGB565-2X8-LE">
314 <entry>V4L2_MBUS_FMT_RGB565_2X8_LE</entry>
315 <entry>0x1008</entry>
316 <entry></entry>
317 <entry>g<subscript>2</subscript></entry>
318 <entry>g<subscript>1</subscript></entry>
319 <entry>g<subscript>0</subscript></entry>
320 <entry>b<subscript>4</subscript></entry>
321 <entry>b<subscript>3</subscript></entry>
322 <entry>b<subscript>2</subscript></entry>
323 <entry>b<subscript>1</subscript></entry>
324 <entry>b<subscript>0</subscript></entry>
325 </row>
326 <row>
327 <entry></entry>
328 <entry></entry>
329 <entry></entry>
330 <entry>r<subscript>4</subscript></entry>
331 <entry>r<subscript>3</subscript></entry>
332 <entry>r<subscript>2</subscript></entry>
333 <entry>r<subscript>1</subscript></entry>
334 <entry>r<subscript>0</subscript></entry>
335 <entry>g<subscript>5</subscript></entry>
336 <entry>g<subscript>4</subscript></entry>
337 <entry>g<subscript>3</subscript></entry>
338 </row>
339 </tbody>
340 </tgroup>
341 </table>
342 </section>
343
344 <section>
345 <title>Bayer Formats</title>
346
347 <para>Those formats transfer pixel data as red, green and blue components.
348 The format code is made of the following information.
349 <itemizedlist>
350 <listitem><para>The red, green and blue components order code, as encoded in a
351 pixel sample. The possible values are shown in <xref
352 linkend="bayer-patterns" />.</para></listitem>
353 <listitem><para>The number of bits per pixel component. All components are
354 transferred on the same number of bits. Common values are 8, 10 and 12.</para>
355 </listitem>
356 <listitem><para>If the pixel components are DPCM-compressed, a mention of the
357 DPCM compression and the number of bits per compressed pixel component.</para>
358 </listitem>
359 <listitem><para>The number of bus samples per pixel. Pixels that are wider than
360 the bus width must be transferred in multiple samples. Common values are
361 1 and 2.</para></listitem>
362 <listitem><para>The bus width.</para></listitem>
363 <listitem><para>For formats where the total number of bits per pixel is smaller
364 than the number of bus samples per pixel times the bus width, a padding
365 value stating if the bytes are padded in their most high order bits
366 (PADHI) or low order bits (PADLO).</para></listitem>
367 <listitem><para>For formats where the number of bus samples per pixel is larger
368 than 1, an endianness value stating if the pixel is transferred MSB first
369 (BE) or LSB first (LE).</para></listitem>
370 </itemizedlist>
371 </para>
372
373 <para>For instance, a format with uncompressed 10-bit Bayer components
374 arranged in a red, green, green, blue pattern transferred as 2 8-bit
375 samples per pixel with the least significant bits transferred first will
376 be named <constant>V4L2_MBUS_FMT_SRGGB10_2X8_PADHI_LE</constant>.
377 </para>
378
379 <figure id="bayer-patterns">
380 <title>Bayer Patterns</title>
381 <mediaobject>
382 <imageobject>
383 <imagedata fileref="bayer.pdf" format="PS" />
384 </imageobject>
385 <imageobject>
386 <imagedata fileref="bayer.png" format="PNG" />
387 </imageobject>
388 <textobject>
389 <phrase>Bayer filter color patterns</phrase>
390 </textobject>
391 </mediaobject>
392 </figure>
393
394 <para>The following table lists existing packet Bayer formats. The data
395 organization is given as an example for the first pixel only.</para>
396
397 <table pgwide="0" frame="none" id="v4l2-mbus-pixelcode-bayer">
398 <title>Bayer Formats</title>
399 <tgroup cols="15">
400 <colspec colname="id" align="left" />
401 <colspec colname="code" align="center"/>
402 <colspec colname="bit" />
403 <colspec colnum="4" colname="b11" align="center" />
404 <colspec colnum="5" colname="b10" align="center" />
405 <colspec colnum="6" colname="b09" align="center" />
406 <colspec colnum="7" colname="b08" align="center" />
407 <colspec colnum="8" colname="b07" align="center" />
408 <colspec colnum="9" colname="b06" align="center" />
409 <colspec colnum="10" colname="b05" align="center" />
410 <colspec colnum="11" colname="b04" align="center" />
411 <colspec colnum="12" colname="b03" align="center" />
412 <colspec colnum="13" colname="b02" align="center" />
413 <colspec colnum="14" colname="b01" align="center" />
414 <colspec colnum="15" colname="b00" align="center" />
415 <spanspec namest="b11" nameend="b00" spanname="b0" />
416 <thead>
417 <row>
418 <entry>Identifier</entry>
419 <entry>Code</entry>
420 <entry></entry>
421 <entry spanname="b0">Data organization</entry>
422 </row>
423 <row>
424 <entry></entry>
425 <entry></entry>
426 <entry>Bit</entry>
427 <entry>11</entry>
428 <entry>10</entry>
429 <entry>9</entry>
430 <entry>8</entry>
431 <entry>7</entry>
432 <entry>6</entry>
433 <entry>5</entry>
434 <entry>4</entry>
435 <entry>3</entry>
436 <entry>2</entry>
437 <entry>1</entry>
438 <entry>0</entry>
439 </row>
440 </thead>
441 <tbody valign="top">
442 <row id="V4L2-MBUS-FMT-SBGGR8-1X8">
443 <entry>V4L2_MBUS_FMT_SBGGR8_1X8</entry>
444 <entry>0x3001</entry>
445 <entry></entry>
446 <entry>-</entry>
447 <entry>-</entry>
448 <entry>-</entry>
449 <entry>-</entry>
450 <entry>b<subscript>7</subscript></entry>
451 <entry>b<subscript>6</subscript></entry>
452 <entry>b<subscript>5</subscript></entry>
453 <entry>b<subscript>4</subscript></entry>
454 <entry>b<subscript>3</subscript></entry>
455 <entry>b<subscript>2</subscript></entry>
456 <entry>b<subscript>1</subscript></entry>
457 <entry>b<subscript>0</subscript></entry>
458 </row>
459 <row id="V4L2-MBUS-FMT-SGBRG8-1X8">
460 <entry>V4L2_MBUS_FMT_SGBRG8_1X8</entry>
461 <entry>0x3013</entry>
462 <entry></entry>
463 <entry>-</entry>
464 <entry>-</entry>
465 <entry>-</entry>
466 <entry>-</entry>
467 <entry>g<subscript>7</subscript></entry>
468 <entry>g<subscript>6</subscript></entry>
469 <entry>g<subscript>5</subscript></entry>
470 <entry>g<subscript>4</subscript></entry>
471 <entry>g<subscript>3</subscript></entry>
472 <entry>g<subscript>2</subscript></entry>
473 <entry>g<subscript>1</subscript></entry>
474 <entry>g<subscript>0</subscript></entry>
475 </row>
476 <row id="V4L2-MBUS-FMT-SGRBG8-1X8">
477 <entry>V4L2_MBUS_FMT_SGRBG8_1X8</entry>
478 <entry>0x3002</entry>
479 <entry></entry>
480 <entry>-</entry>
481 <entry>-</entry>
482 <entry>-</entry>
483 <entry>-</entry>
484 <entry>g<subscript>7</subscript></entry>
485 <entry>g<subscript>6</subscript></entry>
486 <entry>g<subscript>5</subscript></entry>
487 <entry>g<subscript>4</subscript></entry>
488 <entry>g<subscript>3</subscript></entry>
489 <entry>g<subscript>2</subscript></entry>
490 <entry>g<subscript>1</subscript></entry>
491 <entry>g<subscript>0</subscript></entry>
492 </row>
493 <row id="V4L2-MBUS-FMT-SRGGB8-1X8">
494 <entry>V4L2_MBUS_FMT_SRGGB8_1X8</entry>
495 <entry>0x3014</entry>
496 <entry></entry>
497 <entry>-</entry>
498 <entry>-</entry>
499 <entry>-</entry>
500 <entry>-</entry>
501 <entry>r<subscript>7</subscript></entry>
502 <entry>r<subscript>6</subscript></entry>
503 <entry>r<subscript>5</subscript></entry>
504 <entry>r<subscript>4</subscript></entry>
505 <entry>r<subscript>3</subscript></entry>
506 <entry>r<subscript>2</subscript></entry>
507 <entry>r<subscript>1</subscript></entry>
508 <entry>r<subscript>0</subscript></entry>
509 </row>
510 <row id="V4L2-MBUS-FMT-SBGGR10-DPCM8-1X8">
511 <entry>V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8</entry>
512 <entry>0x300b</entry>
513 <entry></entry>
514 <entry>-</entry>
515 <entry>-</entry>
516 <entry>-</entry>
517 <entry>-</entry>
518 <entry>b<subscript>7</subscript></entry>
519 <entry>b<subscript>6</subscript></entry>
520 <entry>b<subscript>5</subscript></entry>
521 <entry>b<subscript>4</subscript></entry>
522 <entry>b<subscript>3</subscript></entry>
523 <entry>b<subscript>2</subscript></entry>
524 <entry>b<subscript>1</subscript></entry>
525 <entry>b<subscript>0</subscript></entry>
526 </row>
527 <row id="V4L2-MBUS-FMT-SGBRG10-DPCM8-1X8">
528 <entry>V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8</entry>
529 <entry>0x300c</entry>
530 <entry></entry>
531 <entry>-</entry>
532 <entry>-</entry>
533 <entry>-</entry>
534 <entry>-</entry>
535 <entry>g<subscript>7</subscript></entry>
536 <entry>g<subscript>6</subscript></entry>
537 <entry>g<subscript>5</subscript></entry>
538 <entry>g<subscript>4</subscript></entry>
539 <entry>g<subscript>3</subscript></entry>
540 <entry>g<subscript>2</subscript></entry>
541 <entry>g<subscript>1</subscript></entry>
542 <entry>g<subscript>0</subscript></entry>
543 </row>
544 <row id="V4L2-MBUS-FMT-SGRBG10-DPCM8-1X8">
545 <entry>V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8</entry>
546 <entry>0x3009</entry>
547 <entry></entry>
548 <entry>-</entry>
549 <entry>-</entry>
550 <entry>-</entry>
551 <entry>-</entry>
552 <entry>g<subscript>7</subscript></entry>
553 <entry>g<subscript>6</subscript></entry>
554 <entry>g<subscript>5</subscript></entry>
555 <entry>g<subscript>4</subscript></entry>
556 <entry>g<subscript>3</subscript></entry>
557 <entry>g<subscript>2</subscript></entry>
558 <entry>g<subscript>1</subscript></entry>
559 <entry>g<subscript>0</subscript></entry>
560 </row>
561 <row id="V4L2-MBUS-FMT-SRGGB10-DPCM8-1X8">
562 <entry>V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8</entry>
563 <entry>0x300d</entry>
564 <entry></entry>
565 <entry>-</entry>
566 <entry>-</entry>
567 <entry>-</entry>
568 <entry>-</entry>
569 <entry>r<subscript>7</subscript></entry>
570 <entry>r<subscript>6</subscript></entry>
571 <entry>r<subscript>5</subscript></entry>
572 <entry>r<subscript>4</subscript></entry>
573 <entry>r<subscript>3</subscript></entry>
574 <entry>r<subscript>2</subscript></entry>
575 <entry>r<subscript>1</subscript></entry>
576 <entry>r<subscript>0</subscript></entry>
577 </row>
578 <row id="V4L2-MBUS-FMT-SBGGR10-2X8-PADHI-BE">
579 <entry>V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE</entry>
580 <entry>0x3003</entry>
581 <entry></entry>
582 <entry>-</entry>
583 <entry>-</entry>
584 <entry>-</entry>
585 <entry>-</entry>
586 <entry>0</entry>
587 <entry>0</entry>
588 <entry>0</entry>
589 <entry>0</entry>
590 <entry>0</entry>
591 <entry>0</entry>
592 <entry>b<subscript>9</subscript></entry>
593 <entry>b<subscript>8</subscript></entry>
594 </row>
595 <row>
596 <entry></entry>
597 <entry></entry>
598 <entry></entry>
599 <entry>-</entry>
600 <entry>-</entry>
601 <entry>-</entry>
602 <entry>-</entry>
603 <entry>b<subscript>7</subscript></entry>
604 <entry>b<subscript>6</subscript></entry>
605 <entry>b<subscript>5</subscript></entry>
606 <entry>b<subscript>4</subscript></entry>
607 <entry>b<subscript>3</subscript></entry>
608 <entry>b<subscript>2</subscript></entry>
609 <entry>b<subscript>1</subscript></entry>
610 <entry>b<subscript>0</subscript></entry>
611 </row>
612 <row id="V4L2-MBUS-FMT-SBGGR10-2X8-PADHI-LE">
613 <entry>V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE</entry>
614 <entry>0x3004</entry>
615 <entry></entry>
616 <entry>-</entry>
617 <entry>-</entry>
618 <entry>-</entry>
619 <entry>-</entry>
620 <entry>b<subscript>7</subscript></entry>
621 <entry>b<subscript>6</subscript></entry>
622 <entry>b<subscript>5</subscript></entry>
623 <entry>b<subscript>4</subscript></entry>
624 <entry>b<subscript>3</subscript></entry>
625 <entry>b<subscript>2</subscript></entry>
626 <entry>b<subscript>1</subscript></entry>
627 <entry>b<subscript>0</subscript></entry>
628 </row>
629 <row>
630 <entry></entry>
631 <entry></entry>
632 <entry></entry>
633 <entry>-</entry>
634 <entry>-</entry>
635 <entry>-</entry>
636 <entry>-</entry>
637 <entry>0</entry>
638 <entry>0</entry>
639 <entry>0</entry>
640 <entry>0</entry>
641 <entry>0</entry>
642 <entry>0</entry>
643 <entry>b<subscript>9</subscript></entry>
644 <entry>b<subscript>8</subscript></entry>
645 </row>
646 <row id="V4L2-MBUS-FMT-SBGGR10-2X8-PADLO-BE">
647 <entry>V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE</entry>
648 <entry>0x3005</entry>
649 <entry></entry>
650 <entry>-</entry>
651 <entry>-</entry>
652 <entry>-</entry>
653 <entry>-</entry>
654 <entry>b<subscript>9</subscript></entry>
655 <entry>b<subscript>8</subscript></entry>
656 <entry>b<subscript>7</subscript></entry>
657 <entry>b<subscript>6</subscript></entry>
658 <entry>b<subscript>5</subscript></entry>
659 <entry>b<subscript>4</subscript></entry>
660 <entry>b<subscript>3</subscript></entry>
661 <entry>b<subscript>2</subscript></entry>
662 </row>
663 <row>
664 <entry></entry>
665 <entry></entry>
666 <entry></entry>
667 <entry>-</entry>
668 <entry>-</entry>
669 <entry>-</entry>
670 <entry>-</entry>
671 <entry>b<subscript>1</subscript></entry>
672 <entry>b<subscript>0</subscript></entry>
673 <entry>0</entry>
674 <entry>0</entry>
675 <entry>0</entry>
676 <entry>0</entry>
677 <entry>0</entry>
678 <entry>0</entry>
679 </row>
680 <row id="V4L2-MBUS-FMT-SBGGR10-2X8-PADLO-LE">
681 <entry>V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE</entry>
682 <entry>0x3006</entry>
683 <entry></entry>
684 <entry>-</entry>
685 <entry>-</entry>
686 <entry>-</entry>
687 <entry>-</entry>
688 <entry>b<subscript>1</subscript></entry>
689 <entry>b<subscript>0</subscript></entry>
690 <entry>0</entry>
691 <entry>0</entry>
692 <entry>0</entry>
693 <entry>0</entry>
694 <entry>0</entry>
695 <entry>0</entry>
696 </row>
697 <row>
698 <entry></entry>
699 <entry></entry>
700 <entry></entry>
701 <entry>-</entry>
702 <entry>-</entry>
703 <entry>-</entry>
704 <entry>-</entry>
705 <entry>b<subscript>9</subscript></entry>
706 <entry>b<subscript>8</subscript></entry>
707 <entry>b<subscript>7</subscript></entry>
708 <entry>b<subscript>6</subscript></entry>
709 <entry>b<subscript>5</subscript></entry>
710 <entry>b<subscript>4</subscript></entry>
711 <entry>b<subscript>3</subscript></entry>
712 <entry>b<subscript>2</subscript></entry>
713 </row>
714 <row id="V4L2-MBUS-FMT-SBGGR10-1X10">
715 <entry>V4L2_MBUS_FMT_SBGGR10_1X10</entry>
716 <entry>0x3007</entry>
717 <entry></entry>
718 <entry>-</entry>
719 <entry>-</entry>
720 <entry>b<subscript>9</subscript></entry>
721 <entry>b<subscript>8</subscript></entry>
722 <entry>b<subscript>7</subscript></entry>
723 <entry>b<subscript>6</subscript></entry>
724 <entry>b<subscript>5</subscript></entry>
725 <entry>b<subscript>4</subscript></entry>
726 <entry>b<subscript>3</subscript></entry>
727 <entry>b<subscript>2</subscript></entry>
728 <entry>b<subscript>1</subscript></entry>
729 <entry>b<subscript>0</subscript></entry>
730 </row>
731 <row id="V4L2-MBUS-FMT-SGBRG10-1X10">
732 <entry>V4L2_MBUS_FMT_SGBRG10_1X10</entry>
733 <entry>0x300e</entry>
734 <entry></entry>
735 <entry>-</entry>
736 <entry>-</entry>
737 <entry>g<subscript>9</subscript></entry>
738 <entry>g<subscript>8</subscript></entry>
739 <entry>g<subscript>7</subscript></entry>
740 <entry>g<subscript>6</subscript></entry>
741 <entry>g<subscript>5</subscript></entry>
742 <entry>g<subscript>4</subscript></entry>
743 <entry>g<subscript>3</subscript></entry>
744 <entry>g<subscript>2</subscript></entry>
745 <entry>g<subscript>1</subscript></entry>
746 <entry>g<subscript>0</subscript></entry>
747 </row>
748 <row id="V4L2-MBUS-FMT-SGRBG10-1X10">
749 <entry>V4L2_MBUS_FMT_SGRBG10_1X10</entry>
750 <entry>0x300a</entry>
751 <entry></entry>
752 <entry>-</entry>
753 <entry>-</entry>
754 <entry>g<subscript>9</subscript></entry>
755 <entry>g<subscript>8</subscript></entry>
756 <entry>g<subscript>7</subscript></entry>
757 <entry>g<subscript>6</subscript></entry>
758 <entry>g<subscript>5</subscript></entry>
759 <entry>g<subscript>4</subscript></entry>
760 <entry>g<subscript>3</subscript></entry>
761 <entry>g<subscript>2</subscript></entry>
762 <entry>g<subscript>1</subscript></entry>
763 <entry>g<subscript>0</subscript></entry>
764 </row>
765 <row id="V4L2-MBUS-FMT-SRGGB10-1X10">
766 <entry>V4L2_MBUS_FMT_SRGGB10_1X10</entry>
767 <entry>0x300f</entry>
768 <entry></entry>
769 <entry>-</entry>
770 <entry>-</entry>
771 <entry>r<subscript>9</subscript></entry>
772 <entry>r<subscript>8</subscript></entry>
773 <entry>r<subscript>7</subscript></entry>
774 <entry>r<subscript>6</subscript></entry>
775 <entry>r<subscript>5</subscript></entry>
776 <entry>r<subscript>4</subscript></entry>
777 <entry>r<subscript>3</subscript></entry>
778 <entry>r<subscript>2</subscript></entry>
779 <entry>r<subscript>1</subscript></entry>
780 <entry>r<subscript>0</subscript></entry>
781 </row>
782 <row id="V4L2-MBUS-FMT-SBGGR12-1X12">
783 <entry>V4L2_MBUS_FMT_SBGGR12_1X12</entry>
784 <entry>0x3008</entry>
785 <entry></entry>
786 <entry>b<subscript>11</subscript></entry>
787 <entry>b<subscript>10</subscript></entry>
788 <entry>b<subscript>9</subscript></entry>
789 <entry>b<subscript>8</subscript></entry>
790 <entry>b<subscript>7</subscript></entry>
791 <entry>b<subscript>6</subscript></entry>
792 <entry>b<subscript>5</subscript></entry>
793 <entry>b<subscript>4</subscript></entry>
794 <entry>b<subscript>3</subscript></entry>
795 <entry>b<subscript>2</subscript></entry>
796 <entry>b<subscript>1</subscript></entry>
797 <entry>b<subscript>0</subscript></entry>
798 </row>
799 <row id="V4L2-MBUS-FMT-SGBRG12-1X12">
800 <entry>V4L2_MBUS_FMT_SGBRG12_1X12</entry>
801 <entry>0x3010</entry>
802 <entry></entry>
803 <entry>g<subscript>11</subscript></entry>
804 <entry>g<subscript>10</subscript></entry>
805 <entry>g<subscript>9</subscript></entry>
806 <entry>g<subscript>8</subscript></entry>
807 <entry>g<subscript>7</subscript></entry>
808 <entry>g<subscript>6</subscript></entry>
809 <entry>g<subscript>5</subscript></entry>
810 <entry>g<subscript>4</subscript></entry>
811 <entry>g<subscript>3</subscript></entry>
812 <entry>g<subscript>2</subscript></entry>
813 <entry>g<subscript>1</subscript></entry>
814 <entry>g<subscript>0</subscript></entry>
815 </row>
816 <row id="V4L2-MBUS-FMT-SGRBG12-1X12">
817 <entry>V4L2_MBUS_FMT_SGRBG12_1X12</entry>
818 <entry>0x3011</entry>
819 <entry></entry>
820 <entry>g<subscript>11</subscript></entry>
821 <entry>g<subscript>10</subscript></entry>
822 <entry>g<subscript>9</subscript></entry>
823 <entry>g<subscript>8</subscript></entry>
824 <entry>g<subscript>7</subscript></entry>
825 <entry>g<subscript>6</subscript></entry>
826 <entry>g<subscript>5</subscript></entry>
827 <entry>g<subscript>4</subscript></entry>
828 <entry>g<subscript>3</subscript></entry>
829 <entry>g<subscript>2</subscript></entry>
830 <entry>g<subscript>1</subscript></entry>
831 <entry>g<subscript>0</subscript></entry>
832 </row>
833 <row id="V4L2-MBUS-FMT-SRGGB12-1X12">
834 <entry>V4L2_MBUS_FMT_SRGGB12_1X12</entry>
835 <entry>0x3012</entry>
836 <entry></entry>
837 <entry>r<subscript>11</subscript></entry>
838 <entry>r<subscript>10</subscript></entry>
839 <entry>r<subscript>9</subscript></entry>
840 <entry>r<subscript>8</subscript></entry>
841 <entry>r<subscript>7</subscript></entry>
842 <entry>r<subscript>6</subscript></entry>
843 <entry>r<subscript>5</subscript></entry>
844 <entry>r<subscript>4</subscript></entry>
845 <entry>r<subscript>3</subscript></entry>
846 <entry>r<subscript>2</subscript></entry>
847 <entry>r<subscript>1</subscript></entry>
848 <entry>r<subscript>0</subscript></entry>
849 </row>
850 </tbody>
851 </tgroup>
852 </table>
853 </section>
854
855 <section>
856 <title>Packed YUV Formats</title>
857
858 <para>Those data formats transfer pixel data as (possibly downsampled) Y, U
859 and V components. The format code is made of the following information.
860 <itemizedlist>
861 <listitem><para>The Y, U and V components order code, as transferred on the
862 bus. Possible values are YUYV, UYVY, YVYU and VYUY.</para></listitem>
863 <listitem><para>The number of bits per pixel component. All components are
864 transferred on the same number of bits. Common values are 8, 10 and 12.</para>
865 </listitem>
866 <listitem><para>The number of bus samples per pixel. Pixels that are wider than
867 the bus width must be transferred in multiple samples. Common values are
868 1, 1.5 (encoded as 1_5) and 2.</para></listitem>
869 <listitem><para>The bus width. When the bus width is larger than the number of
870 bits per pixel component, several components are packed in a single bus
871 sample. The components are ordered as specified by the order code, with
872 components on the left of the code transferred in the high order bits.
873 Common values are 8 and 16.</para>
874 </listitem>
875 </itemizedlist>
876 </para>
877
878 <para>For instance, a format where pixels are encoded as 8-bit YUV values
879 downsampled to 4:2:2 and transferred as 2 8-bit bus samples per pixel in the
880 U, Y, V, Y order will be named <constant>V4L2_MBUS_FMT_UYVY8_2X8</constant>.
881 </para>
882
883 <para>The following table lisst existing packet YUV formats.</para>
884
885 <table pgwide="0" frame="none" id="v4l2-mbus-pixelcode-yuv8">
886 <title>YUV Formats</title>
887 <tgroup cols="23">
888 <colspec colname="id" align="left" />
889 <colspec colname="code" align="center"/>
890 <colspec colname="bit" />
891 <colspec colnum="4" colname="b19" align="center" />
892 <colspec colnum="5" colname="b18" align="center" />
893 <colspec colnum="6" colname="b17" align="center" />
894 <colspec colnum="7" colname="b16" align="center" />
895 <colspec colnum="8" colname="b15" align="center" />
896 <colspec colnum="9" colname="b14" align="center" />
897 <colspec colnum="10" colname="b13" align="center" />
898 <colspec colnum="11" colname="b12" align="center" />
899 <colspec colnum="12" colname="b11" align="center" />
900 <colspec colnum="13" colname="b10" align="center" />
901 <colspec colnum="14" colname="b09" align="center" />
902 <colspec colnum="15" colname="b08" align="center" />
903 <colspec colnum="16" colname="b07" align="center" />
904 <colspec colnum="17" colname="b06" align="center" />
905 <colspec colnum="18" colname="b05" align="center" />
906 <colspec colnum="19" colname="b04" align="center" />
907 <colspec colnum="20" colname="b03" align="center" />
908 <colspec colnum="21" colname="b02" align="center" />
909 <colspec colnum="22" colname="b01" align="center" />
910 <colspec colnum="23" colname="b00" align="center" />
911 <spanspec namest="b19" nameend="b00" spanname="b0" />
912 <thead>
913 <row>
914 <entry>Identifier</entry>
915 <entry>Code</entry>
916 <entry></entry>
917 <entry spanname="b0">Data organization</entry>
918 </row>
919 <row>
920 <entry></entry>
921 <entry></entry>
922 <entry>Bit</entry>
923 <entry>19</entry>
924 <entry>18</entry>
925 <entry>17</entry>
926 <entry>16</entry>
927 <entry>15</entry>
928 <entry>14</entry>
929 <entry>13</entry>
930 <entry>12</entry>
931 <entry>11</entry>
932 <entry>10</entry>
933 <entry>9</entry>
934 <entry>8</entry>
935 <entry>7</entry>
936 <entry>6</entry>
937 <entry>5</entry>
938 <entry>4</entry>
939 <entry>3</entry>
940 <entry>2</entry>
941 <entry>1</entry>
942 <entry>0</entry>
943 </row>
944 </thead>
945 <tbody valign="top">
946 <row id="V4L2-MBUS-FMT-Y8-1X8">
947 <entry>V4L2_MBUS_FMT_Y8_1X8</entry>
948 <entry>0x2001</entry>
949 <entry></entry>
950 <entry>-</entry>
951 <entry>-</entry>
952 <entry>-</entry>
953 <entry>-</entry>
954 <entry>-</entry>
955 <entry>-</entry>
956 <entry>-</entry>
957 <entry>-</entry>
958 <entry>-</entry>
959 <entry>-</entry>
960 <entry>-</entry>
961 <entry>-</entry>
962 <entry>y<subscript>7</subscript></entry>
963 <entry>y<subscript>6</subscript></entry>
964 <entry>y<subscript>5</subscript></entry>
965 <entry>y<subscript>4</subscript></entry>
966 <entry>y<subscript>3</subscript></entry>
967 <entry>y<subscript>2</subscript></entry>
968 <entry>y<subscript>1</subscript></entry>
969 <entry>y<subscript>0</subscript></entry>
970 </row>
971 <row id="V4L2-MBUS-FMT-UYVY8-1_5X8">
972 <entry>V4L2_MBUS_FMT_UYVY8_1_5X8</entry>
973 <entry>0x2002</entry>
974 <entry></entry>
975 <entry>-</entry>
976 <entry>-</entry>
977 <entry>-</entry>
978 <entry>-</entry>
979 <entry>-</entry>
980 <entry>-</entry>
981 <entry>-</entry>
982 <entry>-</entry>
983 <entry>-</entry>
984 <entry>-</entry>
985 <entry>-</entry>
986 <entry>-</entry>
987 <entry>u<subscript>7</subscript></entry>
988 <entry>u<subscript>6</subscript></entry>
989 <entry>u<subscript>5</subscript></entry>
990 <entry>u<subscript>4</subscript></entry>
991 <entry>u<subscript>3</subscript></entry>
992 <entry>u<subscript>2</subscript></entry>
993 <entry>u<subscript>1</subscript></entry>
994 <entry>u<subscript>0</subscript></entry>
995 </row>
996 <row>
997 <entry></entry>
998 <entry></entry>
999 <entry></entry>
1000 <entry>-</entry>
1001 <entry>-</entry>
1002 <entry>-</entry>
1003 <entry>-</entry>
1004 <entry>-</entry>
1005 <entry>-</entry>
1006 <entry>-</entry>
1007 <entry>-</entry>
1008 <entry>-</entry>
1009 <entry>-</entry>
1010 <entry>-</entry>
1011 <entry>-</entry>
1012 <entry>y<subscript>7</subscript></entry>
1013 <entry>y<subscript>6</subscript></entry>
1014 <entry>y<subscript>5</subscript></entry>
1015 <entry>y<subscript>4</subscript></entry>
1016 <entry>y<subscript>3</subscript></entry>
1017 <entry>y<subscript>2</subscript></entry>
1018 <entry>y<subscript>1</subscript></entry>
1019 <entry>y<subscript>0</subscript></entry>
1020 </row>
1021 <row>
1022 <entry></entry>
1023 <entry></entry>
1024 <entry></entry>
1025 <entry>-</entry>
1026 <entry>-</entry>
1027 <entry>-</entry>
1028 <entry>-</entry>
1029 <entry>-</entry>
1030 <entry>-</entry>
1031 <entry>-</entry>
1032 <entry>-</entry>
1033 <entry>-</entry>
1034 <entry>-</entry>
1035 <entry>-</entry>
1036 <entry>-</entry>
1037 <entry>y<subscript>7</subscript></entry>
1038 <entry>y<subscript>6</subscript></entry>
1039 <entry>y<subscript>5</subscript></entry>
1040 <entry>y<subscript>4</subscript></entry>
1041 <entry>y<subscript>3</subscript></entry>
1042 <entry>y<subscript>2</subscript></entry>
1043 <entry>y<subscript>1</subscript></entry>
1044 <entry>y<subscript>0</subscript></entry>
1045 </row>
1046 <row>
1047 <entry></entry>
1048 <entry></entry>
1049 <entry></entry>
1050 <entry>-</entry>
1051 <entry>-</entry>
1052 <entry>-</entry>
1053 <entry>-</entry>
1054 <entry>-</entry>
1055 <entry>-</entry>
1056 <entry>-</entry>
1057 <entry>-</entry>
1058 <entry>-</entry>
1059 <entry>-</entry>
1060 <entry>-</entry>
1061 <entry>-</entry>
1062 <entry>v<subscript>7</subscript></entry>
1063 <entry>v<subscript>6</subscript></entry>
1064 <entry>v<subscript>5</subscript></entry>
1065 <entry>v<subscript>4</subscript></entry>
1066 <entry>v<subscript>3</subscript></entry>
1067 <entry>v<subscript>2</subscript></entry>
1068 <entry>v<subscript>1</subscript></entry>
1069 <entry>v<subscript>0</subscript></entry>
1070 </row>
1071 <row>
1072 <entry></entry>
1073 <entry></entry>
1074 <entry></entry>
1075 <entry>-</entry>
1076 <entry>-</entry>
1077 <entry>-</entry>
1078 <entry>-</entry>
1079 <entry>-</entry>
1080 <entry>-</entry>
1081 <entry>-</entry>
1082 <entry>-</entry>
1083 <entry>-</entry>
1084 <entry>-</entry>
1085 <entry>-</entry>
1086 <entry>-</entry>
1087 <entry>y<subscript>7</subscript></entry>
1088 <entry>y<subscript>6</subscript></entry>
1089 <entry>y<subscript>5</subscript></entry>
1090 <entry>y<subscript>4</subscript></entry>
1091 <entry>y<subscript>3</subscript></entry>
1092 <entry>y<subscript>2</subscript></entry>
1093 <entry>y<subscript>1</subscript></entry>
1094 <entry>y<subscript>0</subscript></entry>
1095 </row>
1096 <row>
1097 <entry></entry>
1098 <entry></entry>
1099 <entry></entry>
1100 <entry>-</entry>
1101 <entry>-</entry>
1102 <entry>-</entry>
1103 <entry>-</entry>
1104 <entry>-</entry>
1105 <entry>-</entry>
1106 <entry>-</entry>
1107 <entry>-</entry>
1108 <entry>-</entry>
1109 <entry>-</entry>
1110 <entry>-</entry>
1111 <entry>-</entry>
1112 <entry>y<subscript>7</subscript></entry>
1113 <entry>y<subscript>6</subscript></entry>
1114 <entry>y<subscript>5</subscript></entry>
1115 <entry>y<subscript>4</subscript></entry>
1116 <entry>y<subscript>3</subscript></entry>
1117 <entry>y<subscript>2</subscript></entry>
1118 <entry>y<subscript>1</subscript></entry>
1119 <entry>y<subscript>0</subscript></entry>
1120 </row>
1121 <row id="V4L2-MBUS-FMT-VYUY8-1_5X8">
1122 <entry>V4L2_MBUS_FMT_VYUY8_1_5X8</entry>
1123 <entry>0x2003</entry>
1124 <entry></entry>
1125 <entry>-</entry>
1126 <entry>-</entry>
1127 <entry>-</entry>
1128 <entry>-</entry>
1129 <entry>-</entry>
1130 <entry>-</entry>
1131 <entry>-</entry>
1132 <entry>-</entry>
1133 <entry>-</entry>
1134 <entry>-</entry>
1135 <entry>-</entry>
1136 <entry>-</entry>
1137 <entry>v<subscript>7</subscript></entry>
1138 <entry>v<subscript>6</subscript></entry>
1139 <entry>v<subscript>5</subscript></entry>
1140 <entry>v<subscript>4</subscript></entry>
1141 <entry>v<subscript>3</subscript></entry>
1142 <entry>v<subscript>2</subscript></entry>
1143 <entry>v<subscript>1</subscript></entry>
1144 <entry>v<subscript>0</subscript></entry>
1145 </row>
1146 <row>
1147 <entry></entry>
1148 <entry></entry>
1149 <entry></entry>
1150 <entry>-</entry>
1151 <entry>-</entry>
1152 <entry>-</entry>
1153 <entry>-</entry>
1154 <entry>-</entry>
1155 <entry>-</entry>
1156 <entry>-</entry>
1157 <entry>-</entry>
1158 <entry>-</entry>
1159 <entry>-</entry>
1160 <entry>-</entry>
1161 <entry>-</entry>
1162 <entry>y<subscript>7</subscript></entry>
1163 <entry>y<subscript>6</subscript></entry>
1164 <entry>y<subscript>5</subscript></entry>
1165 <entry>y<subscript>4</subscript></entry>
1166 <entry>y<subscript>3</subscript></entry>
1167 <entry>y<subscript>2</subscript></entry>
1168 <entry>y<subscript>1</subscript></entry>
1169 <entry>y<subscript>0</subscript></entry>
1170 </row>
1171 <row>
1172 <entry></entry>
1173 <entry></entry>
1174 <entry></entry>
1175 <entry>-</entry>
1176 <entry>-</entry>
1177 <entry>-</entry>
1178 <entry>-</entry>
1179 <entry>-</entry>
1180 <entry>-</entry>
1181 <entry>-</entry>
1182 <entry>-</entry>
1183 <entry>-</entry>
1184 <entry>-</entry>
1185 <entry>-</entry>
1186 <entry>-</entry>
1187 <entry>y<subscript>7</subscript></entry>
1188 <entry>y<subscript>6</subscript></entry>
1189 <entry>y<subscript>5</subscript></entry>
1190 <entry>y<subscript>4</subscript></entry>
1191 <entry>y<subscript>3</subscript></entry>
1192 <entry>y<subscript>2</subscript></entry>
1193 <entry>y<subscript>1</subscript></entry>
1194 <entry>y<subscript>0</subscript></entry>
1195 </row>
1196 <row>
1197 <entry></entry>
1198 <entry></entry>
1199 <entry></entry>
1200 <entry>-</entry>
1201 <entry>-</entry>
1202 <entry>-</entry>
1203 <entry>-</entry>
1204 <entry>-</entry>
1205 <entry>-</entry>
1206 <entry>-</entry>
1207 <entry>-</entry>
1208 <entry>-</entry>
1209 <entry>-</entry>
1210 <entry>-</entry>
1211 <entry>-</entry>
1212 <entry>u<subscript>7</subscript></entry>
1213 <entry>u<subscript>6</subscript></entry>
1214 <entry>u<subscript>5</subscript></entry>
1215 <entry>u<subscript>4</subscript></entry>
1216 <entry>u<subscript>3</subscript></entry>
1217 <entry>u<subscript>2</subscript></entry>
1218 <entry>u<subscript>1</subscript></entry>
1219 <entry>u<subscript>0</subscript></entry>
1220 </row>
1221 <row>
1222 <entry></entry>
1223 <entry></entry>
1224 <entry></entry>
1225 <entry>-</entry>
1226 <entry>-</entry>
1227 <entry>-</entry>
1228 <entry>-</entry>
1229 <entry>-</entry>
1230 <entry>-</entry>
1231 <entry>-</entry>
1232 <entry>-</entry>
1233 <entry>-</entry>
1234 <entry>-</entry>
1235 <entry>-</entry>
1236 <entry>-</entry>
1237 <entry>y<subscript>7</subscript></entry>
1238 <entry>y<subscript>6</subscript></entry>
1239 <entry>y<subscript>5</subscript></entry>
1240 <entry>y<subscript>4</subscript></entry>
1241 <entry>y<subscript>3</subscript></entry>
1242 <entry>y<subscript>2</subscript></entry>
1243 <entry>y<subscript>1</subscript></entry>
1244 <entry>y<subscript>0</subscript></entry>
1245 </row>
1246 <row>
1247 <entry></entry>
1248 <entry></entry>
1249 <entry></entry>
1250 <entry>-</entry>
1251 <entry>-</entry>
1252 <entry>-</entry>
1253 <entry>-</entry>
1254 <entry>-</entry>
1255 <entry>-</entry>
1256 <entry>-</entry>
1257 <entry>-</entry>
1258 <entry>-</entry>
1259 <entry>-</entry>
1260 <entry>-</entry>
1261 <entry>-</entry>
1262 <entry>y<subscript>7</subscript></entry>
1263 <entry>y<subscript>6</subscript></entry>
1264 <entry>y<subscript>5</subscript></entry>
1265 <entry>y<subscript>4</subscript></entry>
1266 <entry>y<subscript>3</subscript></entry>
1267 <entry>y<subscript>2</subscript></entry>
1268 <entry>y<subscript>1</subscript></entry>
1269 <entry>y<subscript>0</subscript></entry>
1270 </row>
1271 <row id="V4L2-MBUS-FMT-YUYV8-1_5X8">
1272 <entry>V4L2_MBUS_FMT_YUYV8_1_5X8</entry>
1273 <entry>0x2004</entry>
1274 <entry></entry>
1275 <entry>-</entry>
1276 <entry>-</entry>
1277 <entry>-</entry>
1278 <entry>-</entry>
1279 <entry>-</entry>
1280 <entry>-</entry>
1281 <entry>-</entry>
1282 <entry>-</entry>
1283 <entry>-</entry>
1284 <entry>-</entry>
1285 <entry>-</entry>
1286 <entry>-</entry>
1287 <entry>y<subscript>7</subscript></entry>
1288 <entry>y<subscript>6</subscript></entry>
1289 <entry>y<subscript>5</subscript></entry>
1290 <entry>y<subscript>4</subscript></entry>
1291 <entry>y<subscript>3</subscript></entry>
1292 <entry>y<subscript>2</subscript></entry>
1293 <entry>y<subscript>1</subscript></entry>
1294 <entry>y<subscript>0</subscript></entry>
1295 </row>
1296 <row>
1297 <entry></entry>
1298 <entry></entry>
1299 <entry></entry>
1300 <entry>-</entry>
1301 <entry>-</entry>
1302 <entry>-</entry>
1303 <entry>-</entry>
1304 <entry>-</entry>
1305 <entry>-</entry>
1306 <entry>-</entry>
1307 <entry>-</entry>
1308 <entry>-</entry>
1309 <entry>-</entry>
1310 <entry>-</entry>
1311 <entry>-</entry>
1312 <entry>y<subscript>7</subscript></entry>
1313 <entry>y<subscript>6</subscript></entry>
1314 <entry>y<subscript>5</subscript></entry>
1315 <entry>y<subscript>4</subscript></entry>
1316 <entry>y<subscript>3</subscript></entry>
1317 <entry>y<subscript>2</subscript></entry>
1318 <entry>y<subscript>1</subscript></entry>
1319 <entry>y<subscript>0</subscript></entry>
1320 </row>
1321 <row>
1322 <entry></entry>
1323 <entry></entry>
1324 <entry></entry>
1325 <entry>-</entry>
1326 <entry>-</entry>
1327 <entry>-</entry>
1328 <entry>-</entry>
1329 <entry>-</entry>
1330 <entry>-</entry>
1331 <entry>-</entry>
1332 <entry>-</entry>
1333 <entry>-</entry>
1334 <entry>-</entry>
1335 <entry>-</entry>
1336 <entry>-</entry>
1337 <entry>u<subscript>7</subscript></entry>
1338 <entry>u<subscript>6</subscript></entry>
1339 <entry>u<subscript>5</subscript></entry>
1340 <entry>u<subscript>4</subscript></entry>
1341 <entry>u<subscript>3</subscript></entry>
1342 <entry>u<subscript>2</subscript></entry>
1343 <entry>u<subscript>1</subscript></entry>
1344 <entry>u<subscript>0</subscript></entry>
1345 </row>
1346 <row>
1347 <entry></entry>
1348 <entry></entry>
1349 <entry></entry>
1350 <entry>-</entry>
1351 <entry>-</entry>
1352 <entry>-</entry>
1353 <entry>-</entry>
1354 <entry>-</entry>
1355 <entry>-</entry>
1356 <entry>-</entry>
1357 <entry>-</entry>
1358 <entry>-</entry>
1359 <entry>-</entry>
1360 <entry>-</entry>
1361 <entry>-</entry>
1362 <entry>y<subscript>7</subscript></entry>
1363 <entry>y<subscript>6</subscript></entry>
1364 <entry>y<subscript>5</subscript></entry>
1365 <entry>y<subscript>4</subscript></entry>
1366 <entry>y<subscript>3</subscript></entry>
1367 <entry>y<subscript>2</subscript></entry>
1368 <entry>y<subscript>1</subscript></entry>
1369 <entry>y<subscript>0</subscript></entry>
1370 </row>
1371 <row>
1372 <entry></entry>
1373 <entry></entry>
1374 <entry></entry>
1375 <entry>-</entry>
1376 <entry>-</entry>
1377 <entry>-</entry>
1378 <entry>-</entry>
1379 <entry>-</entry>
1380 <entry>-</entry>
1381 <entry>-</entry>
1382 <entry>-</entry>
1383 <entry>-</entry>
1384 <entry>-</entry>
1385 <entry>-</entry>
1386 <entry>-</entry>
1387 <entry>y<subscript>7</subscript></entry>
1388 <entry>y<subscript>6</subscript></entry>
1389 <entry>y<subscript>5</subscript></entry>
1390 <entry>y<subscript>4</subscript></entry>
1391 <entry>y<subscript>3</subscript></entry>
1392 <entry>y<subscript>2</subscript></entry>
1393 <entry>y<subscript>1</subscript></entry>
1394 <entry>y<subscript>0</subscript></entry>
1395 </row>
1396 <row>
1397 <entry></entry>
1398 <entry></entry>
1399 <entry></entry>
1400 <entry>-</entry>
1401 <entry>-</entry>
1402 <entry>-</entry>
1403 <entry>-</entry>
1404 <entry>-</entry>
1405 <entry>-</entry>
1406 <entry>-</entry>
1407 <entry>-</entry>
1408 <entry>-</entry>
1409 <entry>-</entry>
1410 <entry>-</entry>
1411 <entry>-</entry>
1412 <entry>v<subscript>7</subscript></entry>
1413 <entry>v<subscript>6</subscript></entry>
1414 <entry>v<subscript>5</subscript></entry>
1415 <entry>v<subscript>4</subscript></entry>
1416 <entry>v<subscript>3</subscript></entry>
1417 <entry>v<subscript>2</subscript></entry>
1418 <entry>v<subscript>1</subscript></entry>
1419 <entry>v<subscript>0</subscript></entry>
1420 </row>
1421 <row id="V4L2-MBUS-FMT-YVYU8-1_5X8">
1422 <entry>V4L2_MBUS_FMT_YVYU8_1_5X8</entry>
1423 <entry>0x2005</entry>
1424 <entry></entry>
1425 <entry>-</entry>
1426 <entry>-</entry>
1427 <entry>-</entry>
1428 <entry>-</entry>
1429 <entry>-</entry>
1430 <entry>-</entry>
1431 <entry>-</entry>
1432 <entry>-</entry>
1433 <entry>-</entry>
1434 <entry>-</entry>
1435 <entry>-</entry>
1436 <entry>-</entry>
1437 <entry>y<subscript>7</subscript></entry>
1438 <entry>y<subscript>6</subscript></entry>
1439 <entry>y<subscript>5</subscript></entry>
1440 <entry>y<subscript>4</subscript></entry>
1441 <entry>y<subscript>3</subscript></entry>
1442 <entry>y<subscript>2</subscript></entry>
1443 <entry>y<subscript>1</subscript></entry>
1444 <entry>y<subscript>0</subscript></entry>
1445 </row>
1446 <row>
1447 <entry></entry>
1448 <entry></entry>
1449 <entry></entry>
1450 <entry>-</entry>
1451 <entry>-</entry>
1452 <entry>-</entry>
1453 <entry>-</entry>
1454 <entry>-</entry>
1455 <entry>-</entry>
1456 <entry>-</entry>
1457 <entry>-</entry>
1458 <entry>-</entry>
1459 <entry>-</entry>
1460 <entry>-</entry>
1461 <entry>-</entry>
1462 <entry>y<subscript>7</subscript></entry>
1463 <entry>y<subscript>6</subscript></entry>
1464 <entry>y<subscript>5</subscript></entry>
1465 <entry>y<subscript>4</subscript></entry>
1466 <entry>y<subscript>3</subscript></entry>
1467 <entry>y<subscript>2</subscript></entry>
1468 <entry>y<subscript>1</subscript></entry>
1469 <entry>y<subscript>0</subscript></entry>
1470 </row>
1471 <row>
1472 <entry></entry>
1473 <entry></entry>
1474 <entry></entry>
1475 <entry>-</entry>
1476 <entry>-</entry>
1477 <entry>-</entry>
1478 <entry>-</entry>
1479 <entry>-</entry>
1480 <entry>-</entry>
1481 <entry>-</entry>
1482 <entry>-</entry>
1483 <entry>-</entry>
1484 <entry>-</entry>
1485 <entry>-</entry>
1486 <entry>-</entry>
1487 <entry>v<subscript>7</subscript></entry>
1488 <entry>v<subscript>6</subscript></entry>
1489 <entry>v<subscript>5</subscript></entry>
1490 <entry>v<subscript>4</subscript></entry>
1491 <entry>v<subscript>3</subscript></entry>
1492 <entry>v<subscript>2</subscript></entry>
1493 <entry>v<subscript>1</subscript></entry>
1494 <entry>v<subscript>0</subscript></entry>
1495 </row>
1496 <row>
1497 <entry></entry>
1498 <entry></entry>
1499 <entry></entry>
1500 <entry>-</entry>
1501 <entry>-</entry>
1502 <entry>-</entry>
1503 <entry>-</entry>
1504 <entry>-</entry>
1505 <entry>-</entry>
1506 <entry>-</entry>
1507 <entry>-</entry>
1508 <entry>-</entry>
1509 <entry>-</entry>
1510 <entry>-</entry>
1511 <entry>-</entry>
1512 <entry>y<subscript>7</subscript></entry>
1513 <entry>y<subscript>6</subscript></entry>
1514 <entry>y<subscript>5</subscript></entry>
1515 <entry>y<subscript>4</subscript></entry>
1516 <entry>y<subscript>3</subscript></entry>
1517 <entry>y<subscript>2</subscript></entry>
1518 <entry>y<subscript>1</subscript></entry>
1519 <entry>y<subscript>0</subscript></entry>
1520 </row>
1521 <row>
1522 <entry></entry>
1523 <entry></entry>
1524 <entry></entry>
1525 <entry>-</entry>
1526 <entry>-</entry>
1527 <entry>-</entry>
1528 <entry>-</entry>
1529 <entry>-</entry>
1530 <entry>-</entry>
1531 <entry>-</entry>
1532 <entry>-</entry>
1533 <entry>-</entry>
1534 <entry>-</entry>
1535 <entry>-</entry>
1536 <entry>-</entry>
1537 <entry>y<subscript>7</subscript></entry>
1538 <entry>y<subscript>6</subscript></entry>
1539 <entry>y<subscript>5</subscript></entry>
1540 <entry>y<subscript>4</subscript></entry>
1541 <entry>y<subscript>3</subscript></entry>
1542 <entry>y<subscript>2</subscript></entry>
1543 <entry>y<subscript>1</subscript></entry>
1544 <entry>y<subscript>0</subscript></entry>
1545 </row>
1546 <row>
1547 <entry></entry>
1548 <entry></entry>
1549 <entry></entry>
1550 <entry>-</entry>
1551 <entry>-</entry>
1552 <entry>-</entry>
1553 <entry>-</entry>
1554 <entry>-</entry>
1555 <entry>-</entry>
1556 <entry>-</entry>
1557 <entry>-</entry>
1558 <entry>-</entry>
1559 <entry>-</entry>
1560 <entry>-</entry>
1561 <entry>-</entry>
1562 <entry>u<subscript>7</subscript></entry>
1563 <entry>u<subscript>6</subscript></entry>
1564 <entry>u<subscript>5</subscript></entry>
1565 <entry>u<subscript>4</subscript></entry>
1566 <entry>u<subscript>3</subscript></entry>
1567 <entry>u<subscript>2</subscript></entry>
1568 <entry>u<subscript>1</subscript></entry>
1569 <entry>u<subscript>0</subscript></entry>
1570 </row>
1571 <row id="V4L2-MBUS-FMT-UYVY8-2X8">
1572 <entry>V4L2_MBUS_FMT_UYVY8_2X8</entry>
1573 <entry>0x2006</entry>
1574 <entry></entry>
1575 <entry>-</entry>
1576 <entry>-</entry>
1577 <entry>-</entry>
1578 <entry>-</entry>
1579 <entry>-</entry>
1580 <entry>-</entry>
1581 <entry>-</entry>
1582 <entry>-</entry>
1583 <entry>-</entry>
1584 <entry>-</entry>
1585 <entry>-</entry>
1586 <entry>-</entry>
1587 <entry>u<subscript>7</subscript></entry>
1588 <entry>u<subscript>6</subscript></entry>
1589 <entry>u<subscript>5</subscript></entry>
1590 <entry>u<subscript>4</subscript></entry>
1591 <entry>u<subscript>3</subscript></entry>
1592 <entry>u<subscript>2</subscript></entry>
1593 <entry>u<subscript>1</subscript></entry>
1594 <entry>u<subscript>0</subscript></entry>
1595 </row>
1596 <row>
1597 <entry></entry>
1598 <entry></entry>
1599 <entry></entry>
1600 <entry>-</entry>
1601 <entry>-</entry>
1602 <entry>-</entry>
1603 <entry>-</entry>
1604 <entry>-</entry>
1605 <entry>-</entry>
1606 <entry>-</entry>
1607 <entry>-</entry>
1608 <entry>-</entry>
1609 <entry>-</entry>
1610 <entry>-</entry>
1611 <entry>-</entry>
1612 <entry>y<subscript>7</subscript></entry>
1613 <entry>y<subscript>6</subscript></entry>
1614 <entry>y<subscript>5</subscript></entry>
1615 <entry>y<subscript>4</subscript></entry>
1616 <entry>y<subscript>3</subscript></entry>
1617 <entry>y<subscript>2</subscript></entry>
1618 <entry>y<subscript>1</subscript></entry>
1619 <entry>y<subscript>0</subscript></entry>
1620 </row>
1621 <row>
1622 <entry></entry>
1623 <entry></entry>
1624 <entry></entry>
1625 <entry>-</entry>
1626 <entry>-</entry>
1627 <entry>-</entry>
1628 <entry>-</entry>
1629 <entry>-</entry>
1630 <entry>-</entry>
1631 <entry>-</entry>
1632 <entry>-</entry>
1633 <entry>-</entry>
1634 <entry>-</entry>
1635 <entry>-</entry>
1636 <entry>-</entry>
1637 <entry>v<subscript>7</subscript></entry>
1638 <entry>v<subscript>6</subscript></entry>
1639 <entry>v<subscript>5</subscript></entry>
1640 <entry>v<subscript>4</subscript></entry>
1641 <entry>v<subscript>3</subscript></entry>
1642 <entry>v<subscript>2</subscript></entry>
1643 <entry>v<subscript>1</subscript></entry>
1644 <entry>v<subscript>0</subscript></entry>
1645 </row>
1646 <row>
1647 <entry></entry>
1648 <entry></entry>
1649 <entry></entry>
1650 <entry>-</entry>
1651 <entry>-</entry>
1652 <entry>-</entry>
1653 <entry>-</entry>
1654 <entry>-</entry>
1655 <entry>-</entry>
1656 <entry>-</entry>
1657 <entry>-</entry>
1658 <entry>-</entry>
1659 <entry>-</entry>
1660 <entry>-</entry>
1661 <entry>-</entry>
1662 <entry>y<subscript>7</subscript></entry>
1663 <entry>y<subscript>6</subscript></entry>
1664 <entry>y<subscript>5</subscript></entry>
1665 <entry>y<subscript>4</subscript></entry>
1666 <entry>y<subscript>3</subscript></entry>
1667 <entry>y<subscript>2</subscript></entry>
1668 <entry>y<subscript>1</subscript></entry>
1669 <entry>y<subscript>0</subscript></entry>
1670 </row>
1671 <row id="V4L2-MBUS-FMT-VYUY8-2X8">
1672 <entry>V4L2_MBUS_FMT_VYUY8_2X8</entry>
1673 <entry>0x2007</entry>
1674 <entry></entry>
1675 <entry>-</entry>
1676 <entry>-</entry>
1677 <entry>-</entry>
1678 <entry>-</entry>
1679 <entry>-</entry>
1680 <entry>-</entry>
1681 <entry>-</entry>
1682 <entry>-</entry>
1683 <entry>-</entry>
1684 <entry>-</entry>
1685 <entry>-</entry>
1686 <entry>-</entry>
1687 <entry>v<subscript>7</subscript></entry>
1688 <entry>v<subscript>6</subscript></entry>
1689 <entry>v<subscript>5</subscript></entry>
1690 <entry>v<subscript>4</subscript></entry>
1691 <entry>v<subscript>3</subscript></entry>
1692 <entry>v<subscript>2</subscript></entry>
1693 <entry>v<subscript>1</subscript></entry>
1694 <entry>v<subscript>0</subscript></entry>
1695 </row>
1696 <row>
1697 <entry></entry>
1698 <entry></entry>
1699 <entry></entry>
1700 <entry>-</entry>
1701 <entry>-</entry>
1702 <entry>-</entry>
1703 <entry>-</entry>
1704 <entry>-</entry>
1705 <entry>-</entry>
1706 <entry>-</entry>
1707 <entry>-</entry>
1708 <entry>-</entry>
1709 <entry>-</entry>
1710 <entry>-</entry>
1711 <entry>-</entry>
1712 <entry>y<subscript>7</subscript></entry>
1713 <entry>y<subscript>6</subscript></entry>
1714 <entry>y<subscript>5</subscript></entry>
1715 <entry>y<subscript>4</subscript></entry>
1716 <entry>y<subscript>3</subscript></entry>
1717 <entry>y<subscript>2</subscript></entry>
1718 <entry>y<subscript>1</subscript></entry>
1719 <entry>y<subscript>0</subscript></entry>
1720 </row>
1721 <row>
1722 <entry></entry>
1723 <entry></entry>
1724 <entry></entry>
1725 <entry>-</entry>
1726 <entry>-</entry>
1727 <entry>-</entry>
1728 <entry>-</entry>
1729 <entry>-</entry>
1730 <entry>-</entry>
1731 <entry>-</entry>
1732 <entry>-</entry>
1733 <entry>-</entry>
1734 <entry>-</entry>
1735 <entry>-</entry>
1736 <entry>-</entry>
1737 <entry>u<subscript>7</subscript></entry>
1738 <entry>u<subscript>6</subscript></entry>
1739 <entry>u<subscript>5</subscript></entry>
1740 <entry>u<subscript>4</subscript></entry>
1741 <entry>u<subscript>3</subscript></entry>
1742 <entry>u<subscript>2</subscript></entry>
1743 <entry>u<subscript>1</subscript></entry>
1744 <entry>u<subscript>0</subscript></entry>
1745 </row>
1746 <row>
1747 <entry></entry>
1748 <entry></entry>
1749 <entry></entry>
1750 <entry>-</entry>
1751 <entry>-</entry>
1752 <entry>-</entry>
1753 <entry>-</entry>
1754 <entry>-</entry>
1755 <entry>-</entry>
1756 <entry>-</entry>
1757 <entry>-</entry>
1758 <entry>-</entry>
1759 <entry>-</entry>
1760 <entry>-</entry>
1761 <entry>-</entry>
1762 <entry>y<subscript>7</subscript></entry>
1763 <entry>y<subscript>6</subscript></entry>
1764 <entry>y<subscript>5</subscript></entry>
1765 <entry>y<subscript>4</subscript></entry>
1766 <entry>y<subscript>3</subscript></entry>
1767 <entry>y<subscript>2</subscript></entry>
1768 <entry>y<subscript>1</subscript></entry>
1769 <entry>y<subscript>0</subscript></entry>
1770 </row>
1771 <row id="V4L2-MBUS-FMT-YUYV8-2X8">
1772 <entry>V4L2_MBUS_FMT_YUYV8_2X8</entry>
1773 <entry>0x2008</entry>
1774 <entry></entry>
1775 <entry>-</entry>
1776 <entry>-</entry>
1777 <entry>-</entry>
1778 <entry>-</entry>
1779 <entry>-</entry>
1780 <entry>-</entry>
1781 <entry>-</entry>
1782 <entry>-</entry>
1783 <entry>-</entry>
1784 <entry>-</entry>
1785 <entry>-</entry>
1786 <entry>-</entry>
1787 <entry>y<subscript>7</subscript></entry>
1788 <entry>y<subscript>6</subscript></entry>
1789 <entry>y<subscript>5</subscript></entry>
1790 <entry>y<subscript>4</subscript></entry>
1791 <entry>y<subscript>3</subscript></entry>
1792 <entry>y<subscript>2</subscript></entry>
1793 <entry>y<subscript>1</subscript></entry>
1794 <entry>y<subscript>0</subscript></entry>
1795 </row>
1796 <row>
1797 <entry></entry>
1798 <entry></entry>
1799 <entry></entry>
1800 <entry>-</entry>
1801 <entry>-</entry>
1802 <entry>-</entry>
1803 <entry>-</entry>
1804 <entry>-</entry>
1805 <entry>-</entry>
1806 <entry>-</entry>
1807 <entry>-</entry>
1808 <entry>-</entry>
1809 <entry>-</entry>
1810 <entry>-</entry>
1811 <entry>-</entry>
1812 <entry>u<subscript>7</subscript></entry>
1813 <entry>u<subscript>6</subscript></entry>
1814 <entry>u<subscript>5</subscript></entry>
1815 <entry>u<subscript>4</subscript></entry>
1816 <entry>u<subscript>3</subscript></entry>
1817 <entry>u<subscript>2</subscript></entry>
1818 <entry>u<subscript>1</subscript></entry>
1819 <entry>u<subscript>0</subscript></entry>
1820 </row>
1821 <row>
1822 <entry></entry>
1823 <entry></entry>
1824 <entry></entry>
1825 <entry>-</entry>
1826 <entry>-</entry>
1827 <entry>-</entry>
1828 <entry>-</entry>
1829 <entry>-</entry>
1830 <entry>-</entry>
1831 <entry>-</entry>
1832 <entry>-</entry>
1833 <entry>-</entry>
1834 <entry>-</entry>
1835 <entry>-</entry>
1836 <entry>-</entry>
1837 <entry>y<subscript>7</subscript></entry>
1838 <entry>y<subscript>6</subscript></entry>
1839 <entry>y<subscript>5</subscript></entry>
1840 <entry>y<subscript>4</subscript></entry>
1841 <entry>y<subscript>3</subscript></entry>
1842 <entry>y<subscript>2</subscript></entry>
1843 <entry>y<subscript>1</subscript></entry>
1844 <entry>y<subscript>0</subscript></entry>
1845 </row>
1846 <row>
1847 <entry></entry>
1848 <entry></entry>
1849 <entry></entry>
1850 <entry>-</entry>
1851 <entry>-</entry>
1852 <entry>-</entry>
1853 <entry>-</entry>
1854 <entry>-</entry>
1855 <entry>-</entry>
1856 <entry>-</entry>
1857 <entry>-</entry>
1858 <entry>-</entry>
1859 <entry>-</entry>
1860 <entry>-</entry>
1861 <entry>-</entry>
1862 <entry>v<subscript>7</subscript></entry>
1863 <entry>v<subscript>6</subscript></entry>
1864 <entry>v<subscript>5</subscript></entry>
1865 <entry>v<subscript>4</subscript></entry>
1866 <entry>v<subscript>3</subscript></entry>
1867 <entry>v<subscript>2</subscript></entry>
1868 <entry>v<subscript>1</subscript></entry>
1869 <entry>v<subscript>0</subscript></entry>
1870 </row>
1871 <row id="V4L2-MBUS-FMT-YVYU8-2X8">
1872 <entry>V4L2_MBUS_FMT_YVYU8_2X8</entry>
1873 <entry>0x2009</entry>
1874 <entry></entry>
1875 <entry>-</entry>
1876 <entry>-</entry>
1877 <entry>-</entry>
1878 <entry>-</entry>
1879 <entry>-</entry>
1880 <entry>-</entry>
1881 <entry>-</entry>
1882 <entry>-</entry>
1883 <entry>-</entry>
1884 <entry>-</entry>
1885 <entry>-</entry>
1886 <entry>-</entry>
1887 <entry>y<subscript>7</subscript></entry>
1888 <entry>y<subscript>6</subscript></entry>
1889 <entry>y<subscript>5</subscript></entry>
1890 <entry>y<subscript>4</subscript></entry>
1891 <entry>y<subscript>3</subscript></entry>
1892 <entry>y<subscript>2</subscript></entry>
1893 <entry>y<subscript>1</subscript></entry>
1894 <entry>y<subscript>0</subscript></entry>
1895 </row>
1896 <row>
1897 <entry></entry>
1898 <entry></entry>
1899 <entry></entry>
1900 <entry>-</entry>
1901 <entry>-</entry>
1902 <entry>-</entry>
1903 <entry>-</entry>
1904 <entry>-</entry>
1905 <entry>-</entry>
1906 <entry>-</entry>
1907 <entry>-</entry>
1908 <entry>-</entry>
1909 <entry>-</entry>
1910 <entry>-</entry>
1911 <entry>-</entry>
1912 <entry>v<subscript>7</subscript></entry>
1913 <entry>v<subscript>6</subscript></entry>
1914 <entry>v<subscript>5</subscript></entry>
1915 <entry>v<subscript>4</subscript></entry>
1916 <entry>v<subscript>3</subscript></entry>
1917 <entry>v<subscript>2</subscript></entry>
1918 <entry>v<subscript>1</subscript></entry>
1919 <entry>v<subscript>0</subscript></entry>
1920 </row>
1921 <row>
1922 <entry></entry>
1923 <entry></entry>
1924 <entry></entry>
1925 <entry>-</entry>
1926 <entry>-</entry>
1927 <entry>-</entry>
1928 <entry>-</entry>
1929 <entry>-</entry>
1930 <entry>-</entry>
1931 <entry>-</entry>
1932 <entry>-</entry>
1933 <entry>-</entry>
1934 <entry>-</entry>
1935 <entry>-</entry>
1936 <entry>-</entry>
1937 <entry>y<subscript>7</subscript></entry>
1938 <entry>y<subscript>6</subscript></entry>
1939 <entry>y<subscript>5</subscript></entry>
1940 <entry>y<subscript>4</subscript></entry>
1941 <entry>y<subscript>3</subscript></entry>
1942 <entry>y<subscript>2</subscript></entry>
1943 <entry>y<subscript>1</subscript></entry>
1944 <entry>y<subscript>0</subscript></entry>
1945 </row>
1946 <row>
1947 <entry></entry>
1948 <entry></entry>
1949 <entry></entry>
1950 <entry>-</entry>
1951 <entry>-</entry>
1952 <entry>-</entry>
1953 <entry>-</entry>
1954 <entry>-</entry>
1955 <entry>-</entry>
1956 <entry>-</entry>
1957 <entry>-</entry>
1958 <entry>-</entry>
1959 <entry>-</entry>
1960 <entry>-</entry>
1961 <entry>-</entry>
1962 <entry>u<subscript>7</subscript></entry>
1963 <entry>u<subscript>6</subscript></entry>
1964 <entry>u<subscript>5</subscript></entry>
1965 <entry>u<subscript>4</subscript></entry>
1966 <entry>u<subscript>3</subscript></entry>
1967 <entry>u<subscript>2</subscript></entry>
1968 <entry>u<subscript>1</subscript></entry>
1969 <entry>u<subscript>0</subscript></entry>
1970 </row>
1971 <row id="V4L2-MBUS-FMT-Y10-1X10">
1972 <entry>V4L2_MBUS_FMT_Y10_1X10</entry>
1973 <entry>0x200a</entry>
1974 <entry></entry>
1975 <entry>-</entry>
1976 <entry>-</entry>
1977 <entry>-</entry>
1978 <entry>-</entry>
1979 <entry>-</entry>
1980 <entry>-</entry>
1981 <entry>-</entry>
1982 <entry>-</entry>
1983 <entry>-</entry>
1984 <entry>-</entry>
1985 <entry>y<subscript>9</subscript></entry>
1986 <entry>y<subscript>8</subscript></entry>
1987 <entry>y<subscript>7</subscript></entry>
1988 <entry>y<subscript>6</subscript></entry>
1989 <entry>y<subscript>5</subscript></entry>
1990 <entry>y<subscript>4</subscript></entry>
1991 <entry>y<subscript>3</subscript></entry>
1992 <entry>y<subscript>2</subscript></entry>
1993 <entry>y<subscript>1</subscript></entry>
1994 <entry>y<subscript>0</subscript></entry>
1995 </row>
1996 <row id="V4L2-MBUS-FMT-YUYV10-2X10">
1997 <entry>V4L2_MBUS_FMT_YUYV10_2X10</entry>
1998 <entry>0x200b</entry>
1999 <entry></entry>
2000 <entry>-</entry>
2001 <entry>-</entry>
2002 <entry>-</entry>
2003 <entry>-</entry>
2004 <entry>-</entry>
2005 <entry>-</entry>
2006 <entry>-</entry>
2007 <entry>-</entry>
2008 <entry>-</entry>
2009 <entry>-</entry>
2010 <entry>y<subscript>9</subscript></entry>
2011 <entry>y<subscript>8</subscript></entry>
2012 <entry>y<subscript>7</subscript></entry>
2013 <entry>y<subscript>6</subscript></entry>
2014 <entry>y<subscript>5</subscript></entry>
2015 <entry>y<subscript>4</subscript></entry>
2016 <entry>y<subscript>3</subscript></entry>
2017 <entry>y<subscript>2</subscript></entry>
2018 <entry>y<subscript>1</subscript></entry>
2019 <entry>y<subscript>0</subscript></entry>
2020 </row>
2021 <row>
2022 <entry></entry>
2023 <entry></entry>
2024 <entry></entry>
2025 <entry>-</entry>
2026 <entry>-</entry>
2027 <entry>-</entry>
2028 <entry>-</entry>
2029 <entry>-</entry>
2030 <entry>-</entry>
2031 <entry>-</entry>
2032 <entry>-</entry>
2033 <entry>-</entry>
2034 <entry>-</entry>
2035 <entry>u<subscript>9</subscript></entry>
2036 <entry>u<subscript>8</subscript></entry>
2037 <entry>u<subscript>7</subscript></entry>
2038 <entry>u<subscript>6</subscript></entry>
2039 <entry>u<subscript>5</subscript></entry>
2040 <entry>u<subscript>4</subscript></entry>
2041 <entry>u<subscript>3</subscript></entry>
2042 <entry>u<subscript>2</subscript></entry>
2043 <entry>u<subscript>1</subscript></entry>
2044 <entry>u<subscript>0</subscript></entry>
2045 </row>
2046 <row>
2047 <entry></entry>
2048 <entry></entry>
2049 <entry></entry>
2050 <entry>-</entry>
2051 <entry>-</entry>
2052 <entry>-</entry>
2053 <entry>-</entry>
2054 <entry>-</entry>
2055 <entry>-</entry>
2056 <entry>-</entry>
2057 <entry>-</entry>
2058 <entry>-</entry>
2059 <entry>-</entry>
2060 <entry>y<subscript>9</subscript></entry>
2061 <entry>y<subscript>8</subscript></entry>
2062 <entry>y<subscript>7</subscript></entry>
2063 <entry>y<subscript>6</subscript></entry>
2064 <entry>y<subscript>5</subscript></entry>
2065 <entry>y<subscript>4</subscript></entry>
2066 <entry>y<subscript>3</subscript></entry>
2067 <entry>y<subscript>2</subscript></entry>
2068 <entry>y<subscript>1</subscript></entry>
2069 <entry>y<subscript>0</subscript></entry>
2070 </row>
2071 <row>
2072 <entry></entry>
2073 <entry></entry>
2074 <entry></entry>
2075 <entry>-</entry>
2076 <entry>-</entry>
2077 <entry>-</entry>
2078 <entry>-</entry>
2079 <entry>-</entry>
2080 <entry>-</entry>
2081 <entry>-</entry>
2082 <entry>-</entry>
2083 <entry>-</entry>
2084 <entry>-</entry>
2085 <entry>v<subscript>9</subscript></entry>
2086 <entry>v<subscript>8</subscript></entry>
2087 <entry>v<subscript>7</subscript></entry>
2088 <entry>v<subscript>6</subscript></entry>
2089 <entry>v<subscript>5</subscript></entry>
2090 <entry>v<subscript>4</subscript></entry>
2091 <entry>v<subscript>3</subscript></entry>
2092 <entry>v<subscript>2</subscript></entry>
2093 <entry>v<subscript>1</subscript></entry>
2094 <entry>v<subscript>0</subscript></entry>
2095 </row>
2096 <row id="V4L2-MBUS-FMT-YVYU10-2X10">
2097 <entry>V4L2_MBUS_FMT_YVYU10_2X10</entry>
2098 <entry>0x200c</entry>
2099 <entry></entry>
2100 <entry>-</entry>
2101 <entry>-</entry>
2102 <entry>-</entry>
2103 <entry>-</entry>
2104 <entry>-</entry>
2105 <entry>-</entry>
2106 <entry>-</entry>
2107 <entry>-</entry>
2108 <entry>-</entry>
2109 <entry>-</entry>
2110 <entry>y<subscript>9</subscript></entry>
2111 <entry>y<subscript>8</subscript></entry>
2112 <entry>y<subscript>7</subscript></entry>
2113 <entry>y<subscript>6</subscript></entry>
2114 <entry>y<subscript>5</subscript></entry>
2115 <entry>y<subscript>4</subscript></entry>
2116 <entry>y<subscript>3</subscript></entry>
2117 <entry>y<subscript>2</subscript></entry>
2118 <entry>y<subscript>1</subscript></entry>
2119 <entry>y<subscript>0</subscript></entry>
2120 </row>
2121 <row>
2122 <entry></entry>
2123 <entry></entry>
2124 <entry></entry>
2125 <entry>-</entry>
2126 <entry>-</entry>
2127 <entry>-</entry>
2128 <entry>-</entry>
2129 <entry>-</entry>
2130 <entry>-</entry>
2131 <entry>-</entry>
2132 <entry>-</entry>
2133 <entry>-</entry>
2134 <entry>-</entry>
2135 <entry>v<subscript>9</subscript></entry>
2136 <entry>v<subscript>8</subscript></entry>
2137 <entry>v<subscript>7</subscript></entry>
2138 <entry>v<subscript>6</subscript></entry>
2139 <entry>v<subscript>5</subscript></entry>
2140 <entry>v<subscript>4</subscript></entry>
2141 <entry>v<subscript>3</subscript></entry>
2142 <entry>v<subscript>2</subscript></entry>
2143 <entry>v<subscript>1</subscript></entry>
2144 <entry>v<subscript>0</subscript></entry>
2145 </row>
2146 <row>
2147 <entry></entry>
2148 <entry></entry>
2149 <entry></entry>
2150 <entry>-</entry>
2151 <entry>-</entry>
2152 <entry>-</entry>
2153 <entry>-</entry>
2154 <entry>-</entry>
2155 <entry>-</entry>
2156 <entry>-</entry>
2157 <entry>-</entry>
2158 <entry>-</entry>
2159 <entry>-</entry>
2160 <entry>y<subscript>9</subscript></entry>
2161 <entry>y<subscript>8</subscript></entry>
2162 <entry>y<subscript>7</subscript></entry>
2163 <entry>y<subscript>6</subscript></entry>
2164 <entry>y<subscript>5</subscript></entry>
2165 <entry>y<subscript>4</subscript></entry>
2166 <entry>y<subscript>3</subscript></entry>
2167 <entry>y<subscript>2</subscript></entry>
2168 <entry>y<subscript>1</subscript></entry>
2169 <entry>y<subscript>0</subscript></entry>
2170 </row>
2171 <row>
2172 <entry></entry>
2173 <entry></entry>
2174 <entry></entry>
2175 <entry>-</entry>
2176 <entry>-</entry>
2177 <entry>-</entry>
2178 <entry>-</entry>
2179 <entry>-</entry>
2180 <entry>-</entry>
2181 <entry>-</entry>
2182 <entry>-</entry>
2183 <entry>-</entry>
2184 <entry>-</entry>
2185 <entry>u<subscript>9</subscript></entry>
2186 <entry>u<subscript>8</subscript></entry>
2187 <entry>u<subscript>7</subscript></entry>
2188 <entry>u<subscript>6</subscript></entry>
2189 <entry>u<subscript>5</subscript></entry>
2190 <entry>u<subscript>4</subscript></entry>
2191 <entry>u<subscript>3</subscript></entry>
2192 <entry>u<subscript>2</subscript></entry>
2193 <entry>u<subscript>1</subscript></entry>
2194 <entry>u<subscript>0</subscript></entry>
2195 </row>
2196 <row id="V4L2-MBUS-FMT-Y12-1X12">
2197 <entry>V4L2_MBUS_FMT_Y12_1X12</entry>
2198 <entry>0x2013</entry>
2199 <entry></entry>
2200 <entry>-</entry>
2201 <entry>-</entry>
2202 <entry>-</entry>
2203 <entry>-</entry>
2204 <entry>-</entry>
2205 <entry>-</entry>
2206 <entry>-</entry>
2207 <entry>-</entry>
2208 <entry>y<subscript>11</subscript></entry>
2209 <entry>y<subscript>10</subscript></entry>
2210 <entry>y<subscript>9</subscript></entry>
2211 <entry>y<subscript>8</subscript></entry>
2212 <entry>y<subscript>7</subscript></entry>
2213 <entry>y<subscript>6</subscript></entry>
2214 <entry>y<subscript>5</subscript></entry>
2215 <entry>y<subscript>4</subscript></entry>
2216 <entry>y<subscript>3</subscript></entry>
2217 <entry>y<subscript>2</subscript></entry>
2218 <entry>y<subscript>1</subscript></entry>
2219 <entry>y<subscript>0</subscript></entry>
2220 </row>
2221 <row id="V4L2-MBUS-FMT-UYVY8-1X16">
2222 <entry>V4L2_MBUS_FMT_UYVY8_1X16</entry>
2223 <entry>0x200f</entry>
2224 <entry></entry>
2225 <entry>-</entry>
2226 <entry>-</entry>
2227 <entry>-</entry>
2228 <entry>-</entry>
2229 <entry>u<subscript>7</subscript></entry>
2230 <entry>u<subscript>6</subscript></entry>
2231 <entry>u<subscript>5</subscript></entry>
2232 <entry>u<subscript>4</subscript></entry>
2233 <entry>u<subscript>3</subscript></entry>
2234 <entry>u<subscript>2</subscript></entry>
2235 <entry>u<subscript>1</subscript></entry>
2236 <entry>u<subscript>0</subscript></entry>
2237 <entry>y<subscript>7</subscript></entry>
2238 <entry>y<subscript>6</subscript></entry>
2239 <entry>y<subscript>5</subscript></entry>
2240 <entry>y<subscript>4</subscript></entry>
2241 <entry>y<subscript>3</subscript></entry>
2242 <entry>y<subscript>2</subscript></entry>
2243 <entry>y<subscript>1</subscript></entry>
2244 <entry>y<subscript>0</subscript></entry>
2245 </row>
2246 <row>
2247 <entry></entry>
2248 <entry></entry>
2249 <entry></entry>
2250 <entry>-</entry>
2251 <entry>-</entry>
2252 <entry>-</entry>
2253 <entry>-</entry>
2254 <entry>v<subscript>7</subscript></entry>
2255 <entry>v<subscript>6</subscript></entry>
2256 <entry>v<subscript>5</subscript></entry>
2257 <entry>v<subscript>4</subscript></entry>
2258 <entry>v<subscript>3</subscript></entry>
2259 <entry>v<subscript>2</subscript></entry>
2260 <entry>v<subscript>1</subscript></entry>
2261 <entry>v<subscript>0</subscript></entry>
2262 <entry>y<subscript>7</subscript></entry>
2263 <entry>y<subscript>6</subscript></entry>
2264 <entry>y<subscript>5</subscript></entry>
2265 <entry>y<subscript>4</subscript></entry>
2266 <entry>y<subscript>3</subscript></entry>
2267 <entry>y<subscript>2</subscript></entry>
2268 <entry>y<subscript>1</subscript></entry>
2269 <entry>y<subscript>0</subscript></entry>
2270 </row>
2271 <row id="V4L2-MBUS-FMT-VYUY8-1X16">
2272 <entry>V4L2_MBUS_FMT_VYUY8_1X16</entry>
2273 <entry>0x2010</entry>
2274 <entry></entry>
2275 <entry>-</entry>
2276 <entry>-</entry>
2277 <entry>-</entry>
2278 <entry>-</entry>
2279 <entry>v<subscript>7</subscript></entry>
2280 <entry>v<subscript>6</subscript></entry>
2281 <entry>v<subscript>5</subscript></entry>
2282 <entry>v<subscript>4</subscript></entry>
2283 <entry>v<subscript>3</subscript></entry>
2284 <entry>v<subscript>2</subscript></entry>
2285 <entry>v<subscript>1</subscript></entry>
2286 <entry>v<subscript>0</subscript></entry>
2287 <entry>y<subscript>7</subscript></entry>
2288 <entry>y<subscript>6</subscript></entry>
2289 <entry>y<subscript>5</subscript></entry>
2290 <entry>y<subscript>4</subscript></entry>
2291 <entry>y<subscript>3</subscript></entry>
2292 <entry>y<subscript>2</subscript></entry>
2293 <entry>y<subscript>1</subscript></entry>
2294 <entry>y<subscript>0</subscript></entry>
2295 </row>
2296 <row>
2297 <entry></entry>
2298 <entry></entry>
2299 <entry></entry>
2300 <entry>-</entry>
2301 <entry>-</entry>
2302 <entry>-</entry>
2303 <entry>-</entry>
2304 <entry>u<subscript>7</subscript></entry>
2305 <entry>u<subscript>6</subscript></entry>
2306 <entry>u<subscript>5</subscript></entry>
2307 <entry>u<subscript>4</subscript></entry>
2308 <entry>u<subscript>3</subscript></entry>
2309 <entry>u<subscript>2</subscript></entry>
2310 <entry>u<subscript>1</subscript></entry>
2311 <entry>u<subscript>0</subscript></entry>
2312 <entry>y<subscript>7</subscript></entry>
2313 <entry>y<subscript>6</subscript></entry>
2314 <entry>y<subscript>5</subscript></entry>
2315 <entry>y<subscript>4</subscript></entry>
2316 <entry>y<subscript>3</subscript></entry>
2317 <entry>y<subscript>2</subscript></entry>
2318 <entry>y<subscript>1</subscript></entry>
2319 <entry>y<subscript>0</subscript></entry>
2320 </row>
2321 <row id="V4L2-MBUS-FMT-YUYV8-1X16">
2322 <entry>V4L2_MBUS_FMT_YUYV8_1X16</entry>
2323 <entry>0x2011</entry>
2324 <entry></entry>
2325 <entry>-</entry>
2326 <entry>-</entry>
2327 <entry>-</entry>
2328 <entry>-</entry>
2329 <entry>y<subscript>7</subscript></entry>
2330 <entry>y<subscript>6</subscript></entry>
2331 <entry>y<subscript>5</subscript></entry>
2332 <entry>y<subscript>4</subscript></entry>
2333 <entry>y<subscript>3</subscript></entry>
2334 <entry>y<subscript>2</subscript></entry>
2335 <entry>y<subscript>1</subscript></entry>
2336 <entry>y<subscript>0</subscript></entry>
2337 <entry>u<subscript>7</subscript></entry>
2338 <entry>u<subscript>6</subscript></entry>
2339 <entry>u<subscript>5</subscript></entry>
2340 <entry>u<subscript>4</subscript></entry>
2341 <entry>u<subscript>3</subscript></entry>
2342 <entry>u<subscript>2</subscript></entry>
2343 <entry>u<subscript>1</subscript></entry>
2344 <entry>u<subscript>0</subscript></entry>
2345 </row>
2346 <row>
2347 <entry></entry>
2348 <entry></entry>
2349 <entry></entry>
2350 <entry>-</entry>
2351 <entry>-</entry>
2352 <entry>-</entry>
2353 <entry>-</entry>
2354 <entry>y<subscript>7</subscript></entry>
2355 <entry>y<subscript>6</subscript></entry>
2356 <entry>y<subscript>5</subscript></entry>
2357 <entry>y<subscript>4</subscript></entry>
2358 <entry>y<subscript>3</subscript></entry>
2359 <entry>y<subscript>2</subscript></entry>
2360 <entry>y<subscript>1</subscript></entry>
2361 <entry>y<subscript>0</subscript></entry>
2362 <entry>v<subscript>7</subscript></entry>
2363 <entry>v<subscript>6</subscript></entry>
2364 <entry>v<subscript>5</subscript></entry>
2365 <entry>v<subscript>4</subscript></entry>
2366 <entry>v<subscript>3</subscript></entry>
2367 <entry>v<subscript>2</subscript></entry>
2368 <entry>v<subscript>1</subscript></entry>
2369 <entry>v<subscript>0</subscript></entry>
2370 </row>
2371 <row id="V4L2-MBUS-FMT-YVYU8-1X16">
2372 <entry>V4L2_MBUS_FMT_YVYU8_1X16</entry>
2373 <entry>0x2012</entry>
2374 <entry></entry>
2375 <entry>-</entry>
2376 <entry>-</entry>
2377 <entry>-</entry>
2378 <entry>-</entry>
2379 <entry>y<subscript>7</subscript></entry>
2380 <entry>y<subscript>6</subscript></entry>
2381 <entry>y<subscript>5</subscript></entry>
2382 <entry>y<subscript>4</subscript></entry>
2383 <entry>y<subscript>3</subscript></entry>
2384 <entry>y<subscript>2</subscript></entry>
2385 <entry>y<subscript>1</subscript></entry>
2386 <entry>y<subscript>0</subscript></entry>
2387 <entry>v<subscript>7</subscript></entry>
2388 <entry>v<subscript>6</subscript></entry>
2389 <entry>v<subscript>5</subscript></entry>
2390 <entry>v<subscript>4</subscript></entry>
2391 <entry>v<subscript>3</subscript></entry>
2392 <entry>v<subscript>2</subscript></entry>
2393 <entry>v<subscript>1</subscript></entry>
2394 <entry>v<subscript>0</subscript></entry>
2395 </row>
2396 <row>
2397 <entry></entry>
2398 <entry></entry>
2399 <entry></entry>
2400 <entry>-</entry>
2401 <entry>-</entry>
2402 <entry>-</entry>
2403 <entry>-</entry>
2404 <entry>y<subscript>7</subscript></entry>
2405 <entry>y<subscript>6</subscript></entry>
2406 <entry>y<subscript>5</subscript></entry>
2407 <entry>y<subscript>4</subscript></entry>
2408 <entry>y<subscript>3</subscript></entry>
2409 <entry>y<subscript>2</subscript></entry>
2410 <entry>y<subscript>1</subscript></entry>
2411 <entry>y<subscript>0</subscript></entry>
2412 <entry>u<subscript>7</subscript></entry>
2413 <entry>u<subscript>6</subscript></entry>
2414 <entry>u<subscript>5</subscript></entry>
2415 <entry>u<subscript>4</subscript></entry>
2416 <entry>u<subscript>3</subscript></entry>
2417 <entry>u<subscript>2</subscript></entry>
2418 <entry>u<subscript>1</subscript></entry>
2419 <entry>u<subscript>0</subscript></entry>
2420 </row>
2421 <row id="V4L2-MBUS-FMT-YUYV10-1X20">
2422 <entry>V4L2_MBUS_FMT_YUYV10_1X20</entry>
2423 <entry>0x200d</entry>
2424 <entry></entry>
2425 <entry>y<subscript>9</subscript></entry>
2426 <entry>y<subscript>8</subscript></entry>
2427 <entry>y<subscript>7</subscript></entry>
2428 <entry>y<subscript>6</subscript></entry>
2429 <entry>y<subscript>5</subscript></entry>
2430 <entry>y<subscript>4</subscript></entry>
2431 <entry>y<subscript>3</subscript></entry>
2432 <entry>y<subscript>2</subscript></entry>
2433 <entry>y<subscript>1</subscript></entry>
2434 <entry>y<subscript>0</subscript></entry>
2435 <entry>u<subscript>9</subscript></entry>
2436 <entry>u<subscript>8</subscript></entry>
2437 <entry>u<subscript>7</subscript></entry>
2438 <entry>u<subscript>6</subscript></entry>
2439 <entry>u<subscript>5</subscript></entry>
2440 <entry>u<subscript>4</subscript></entry>
2441 <entry>u<subscript>3</subscript></entry>
2442 <entry>u<subscript>2</subscript></entry>
2443 <entry>u<subscript>1</subscript></entry>
2444 <entry>u<subscript>0</subscript></entry>
2445 </row>
2446 <row>
2447 <entry></entry>
2448 <entry></entry>
2449 <entry></entry>
2450 <entry>y<subscript>9</subscript></entry>
2451 <entry>y<subscript>8</subscript></entry>
2452 <entry>y<subscript>7</subscript></entry>
2453 <entry>y<subscript>6</subscript></entry>
2454 <entry>y<subscript>5</subscript></entry>
2455 <entry>y<subscript>4</subscript></entry>
2456 <entry>y<subscript>3</subscript></entry>
2457 <entry>y<subscript>2</subscript></entry>
2458 <entry>y<subscript>1</subscript></entry>
2459 <entry>y<subscript>0</subscript></entry>
2460 <entry>v<subscript>9</subscript></entry>
2461 <entry>v<subscript>8</subscript></entry>
2462 <entry>v<subscript>7</subscript></entry>
2463 <entry>v<subscript>6</subscript></entry>
2464 <entry>v<subscript>5</subscript></entry>
2465 <entry>v<subscript>4</subscript></entry>
2466 <entry>v<subscript>3</subscript></entry>
2467 <entry>v<subscript>2</subscript></entry>
2468 <entry>v<subscript>1</subscript></entry>
2469 <entry>v<subscript>0</subscript></entry>
2470 </row>
2471 <row id="V4L2-MBUS-FMT-YVYU10-1X20">
2472 <entry>V4L2_MBUS_FMT_YVYU10_1X20</entry>
2473 <entry>0x200e</entry>
2474 <entry></entry>
2475 <entry>y<subscript>9</subscript></entry>
2476 <entry>y<subscript>8</subscript></entry>
2477 <entry>y<subscript>7</subscript></entry>
2478 <entry>y<subscript>6</subscript></entry>
2479 <entry>y<subscript>5</subscript></entry>
2480 <entry>y<subscript>4</subscript></entry>
2481 <entry>y<subscript>3</subscript></entry>
2482 <entry>y<subscript>2</subscript></entry>
2483 <entry>y<subscript>1</subscript></entry>
2484 <entry>y<subscript>0</subscript></entry>
2485 <entry>v<subscript>9</subscript></entry>
2486 <entry>v<subscript>8</subscript></entry>
2487 <entry>v<subscript>7</subscript></entry>
2488 <entry>v<subscript>6</subscript></entry>
2489 <entry>v<subscript>5</subscript></entry>
2490 <entry>v<subscript>4</subscript></entry>
2491 <entry>v<subscript>3</subscript></entry>
2492 <entry>v<subscript>2</subscript></entry>
2493 <entry>v<subscript>1</subscript></entry>
2494 <entry>v<subscript>0</subscript></entry>
2495 </row>
2496 <row>
2497 <entry></entry>
2498 <entry></entry>
2499 <entry></entry>
2500 <entry>y<subscript>9</subscript></entry>
2501 <entry>y<subscript>8</subscript></entry>
2502 <entry>y<subscript>7</subscript></entry>
2503 <entry>y<subscript>6</subscript></entry>
2504 <entry>y<subscript>5</subscript></entry>
2505 <entry>y<subscript>4</subscript></entry>
2506 <entry>y<subscript>3</subscript></entry>
2507 <entry>y<subscript>2</subscript></entry>
2508 <entry>y<subscript>1</subscript></entry>
2509 <entry>y<subscript>0</subscript></entry>
2510 <entry>u<subscript>9</subscript></entry>
2511 <entry>u<subscript>8</subscript></entry>
2512 <entry>u<subscript>7</subscript></entry>
2513 <entry>u<subscript>6</subscript></entry>
2514 <entry>u<subscript>5</subscript></entry>
2515 <entry>u<subscript>4</subscript></entry>
2516 <entry>u<subscript>3</subscript></entry>
2517 <entry>u<subscript>2</subscript></entry>
2518 <entry>u<subscript>1</subscript></entry>
2519 <entry>u<subscript>0</subscript></entry>
2520 </row>
2521 </tbody>
2522 </tgroup>
2523 </table>
2524 </section>
2525
2526 <section>
2527 <title>JPEG Compressed Formats</title>
2528
2529 <para>Those data formats consist of an ordered sequence of 8-bit bytes
2530 obtained from JPEG compression process. Additionally to the
2531 <constant>_JPEG</constant> prefix the format code is made of
2532 the following information.
2533 <itemizedlist>
2534 <listitem><para>The number of bus samples per entropy encoded byte.</para></listitem>
2535 <listitem><para>The bus width.</para></listitem>
2536 </itemizedlist>
2537 </para>
2538
2539 <para>For instance, for a JPEG baseline process and an 8-bit bus width
2540 the format will be named <constant>V4L2_MBUS_FMT_JPEG_1X8</constant>.
2541 </para>
2542
2543 <para>The following table lists existing JPEG compressed formats.</para>
2544
2545 <table pgwide="0" frame="none" id="v4l2-mbus-pixelcode-jpeg">
2546 <title>JPEG Formats</title>
2547 <tgroup cols="3">
2548 <colspec colname="id" align="left" />
2549 <colspec colname="code" align="left"/>
2550 <colspec colname="remarks" align="left"/>
2551 <thead>
2552 <row>
2553 <entry>Identifier</entry>
2554 <entry>Code</entry>
2555 <entry>Remarks</entry>
2556 </row>
2557 </thead>
2558 <tbody valign="top">
2559 <row id="V4L2-MBUS-FMT-JPEG-1X8">
2560 <entry>V4L2_MBUS_FMT_JPEG_1X8</entry>
2561 <entry>0x4001</entry>
2562 <entry>Besides of its usage for the parallel bus this format is
2563 recommended for transmission of JPEG data over MIPI CSI bus
2564 using the User Defined 8-bit Data types.
2565 </entry>
2566 </row>
2567 </tbody>
2568 </tgroup>
2569 </table>
2570 </section>
2571 </section>
2572</section>
diff --git a/Documentation/DocBook/v4l/v4l2.xml b/Documentation/DocBook/v4l/v4l2.xml
index 7c3c098d5d08..a7fd76d0dac1 100644
--- a/Documentation/DocBook/v4l/v4l2.xml
+++ b/Documentation/DocBook/v4l/v4l2.xml
@@ -85,6 +85,17 @@ Remote Controller chapter.</contrib>
85 </address> 85 </address>
86 </affiliation> 86 </affiliation>
87 </author> 87 </author>
88
89 <author>
90 <firstname>Pawel</firstname>
91 <surname>Osciak</surname>
92 <contrib>Designed and documented the multi-planar API.</contrib>
93 <affiliation>
94 <address>
95 <email>pawel AT osciak.com</email>
96 </address>
97 </affiliation>
98 </author>
88 </authorgroup> 99 </authorgroup>
89 100
90 <copyright> 101 <copyright>
@@ -99,8 +110,11 @@ Remote Controller chapter.</contrib>
99 <year>2007</year> 110 <year>2007</year>
100 <year>2008</year> 111 <year>2008</year>
101 <year>2009</year> 112 <year>2009</year>
113 <year>2010</year>
114 <year>2011</year>
102 <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin 115 <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin
103Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder> 116Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab,
117 Pawel Osciak</holder>
104 </copyright> 118 </copyright>
105 <legalnotice> 119 <legalnotice>
106 <para>Except when explicitly stated as GPL, programming examples within 120 <para>Except when explicitly stated as GPL, programming examples within
@@ -110,10 +124,24 @@ Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder>
110 <!-- Put document revisions here, newest first. --> 124 <!-- Put document revisions here, newest first. -->
111 <!-- API revisions (changes and additions of defines, enums, 125 <!-- API revisions (changes and additions of defines, enums,
112structs, ioctls) must be noted in more detail in the history chapter 126structs, ioctls) must be noted in more detail in the history chapter
113(compat.sgml), along with the possible impact on existing drivers and 127(compat.xml), along with the possible impact on existing drivers and
114applications. --> 128applications. -->
115 129
116 <revision> 130 <revision>
131 <revnumber>2.6.39</revnumber>
132 <date>2011-03-01</date>
133 <authorinitials>mcc, po</authorinitials>
134 <revremark>Removed VIDIOC_*_OLD from videodev2.h header and update it to reflect latest changes. Added the <link linkend="planar-apis">multi-planar API</link>.</revremark>
135 </revision>
136
137 <revision>
138 <revnumber>2.6.37</revnumber>
139 <date>2010-08-06</date>
140 <authorinitials>hv</authorinitials>
141 <revremark>Removed obsolete vtx (videotext) API.</revremark>
142 </revision>
143
144 <revision>
117 <revnumber>2.6.33</revnumber> 145 <revnumber>2.6.33</revnumber>
118 <date>2009-12-03</date> 146 <date>2009-12-03</date>
119 <authorinitials>mk</authorinitials> 147 <authorinitials>mk</authorinitials>
@@ -373,7 +401,7 @@ and discussions on the V4L mailing list.</revremark>
373</partinfo> 401</partinfo>
374 402
375<title>Video for Linux Two API Specification</title> 403<title>Video for Linux Two API Specification</title>
376 <subtitle>Revision 2.6.33</subtitle> 404 <subtitle>Revision 2.6.39</subtitle>
377 405
378 <chapter id="common"> 406 <chapter id="common">
379 &sub-common; 407 &sub-common;
@@ -402,6 +430,7 @@ and discussions on the V4L mailing list.</revremark>
402 <section id="radio"> &sub-dev-radio; </section> 430 <section id="radio"> &sub-dev-radio; </section>
403 <section id="rds"> &sub-dev-rds; </section> 431 <section id="rds"> &sub-dev-rds; </section>
404 <section id="event"> &sub-dev-event; </section> 432 <section id="event"> &sub-dev-event; </section>
433 <section id="subdev"> &sub-dev-subdev; </section>
405 </chapter> 434 </chapter>
406 435
407 <chapter id="driver"> 436 <chapter id="driver">
@@ -469,6 +498,12 @@ and discussions on the V4L mailing list.</revremark>
469 &sub-reqbufs; 498 &sub-reqbufs;
470 &sub-s-hw-freq-seek; 499 &sub-s-hw-freq-seek;
471 &sub-streamon; 500 &sub-streamon;
501 &sub-subdev-enum-frame-interval;
502 &sub-subdev-enum-frame-size;
503 &sub-subdev-enum-mbus-code;
504 &sub-subdev-g-crop;
505 &sub-subdev-g-fmt;
506 &sub-subdev-g-frame-interval;
472 &sub-subscribe-event; 507 &sub-subscribe-event;
473 <!-- End of ioctls. --> 508 <!-- End of ioctls. -->
474 &sub-mmap; 509 &sub-mmap;
diff --git a/Documentation/DocBook/v4l/videodev2.h.xml b/Documentation/DocBook/v4l/videodev2.h.xml
index 865b06d9e679..c50536a4f596 100644
--- a/Documentation/DocBook/v4l/videodev2.h.xml
+++ b/Documentation/DocBook/v4l/videodev2.h.xml
@@ -71,6 +71,7 @@
71 * Moved from videodev.h 71 * Moved from videodev.h
72 */ 72 */
73#define VIDEO_MAX_FRAME 32 73#define VIDEO_MAX_FRAME 32
74#define VIDEO_MAX_PLANES 8
74 75
75#ifndef __KERNEL__ 76#ifndef __KERNEL__
76 77
@@ -154,22 +155,26 @@ enum <link linkend="v4l2-buf-type">v4l2_buf_type</link> {
154 V4L2_BUF_TYPE_VBI_OUTPUT = 5, 155 V4L2_BUF_TYPE_VBI_OUTPUT = 5,
155 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, 156 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
156 V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, 157 V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
157#if 1 /*KEEP*/ 158#if 1
158 /* Experimental */ 159 /* Experimental */
159 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8, 160 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
160#endif 161#endif
162 V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
163 V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10,
161 V4L2_BUF_TYPE_PRIVATE = 0x80, 164 V4L2_BUF_TYPE_PRIVATE = 0x80,
162}; 165};
163 166
164enum <link linkend="v4l2-ctrl-type">v4l2_ctrl_type</link> { 167#define V4L2_TYPE_IS_MULTIPLANAR(type) \
165 V4L2_CTRL_TYPE_INTEGER = 1, 168 ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE \
166 V4L2_CTRL_TYPE_BOOLEAN = 2, 169 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
167 V4L2_CTRL_TYPE_MENU = 3, 170
168 V4L2_CTRL_TYPE_BUTTON = 4, 171#define V4L2_TYPE_IS_OUTPUT(type) \
169 V4L2_CTRL_TYPE_INTEGER64 = 5, 172 ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT \
170 V4L2_CTRL_TYPE_CTRL_CLASS = 6, 173 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE \
171 V4L2_CTRL_TYPE_STRING = 7, 174 || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY \
172}; 175 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \
176 || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \
177 || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT)
173 178
174enum <link linkend="v4l2-tuner-type">v4l2_tuner_type</link> { 179enum <link linkend="v4l2-tuner-type">v4l2_tuner_type</link> {
175 V4L2_TUNER_RADIO = 1, 180 V4L2_TUNER_RADIO = 1,
@@ -256,6 +261,11 @@ struct <link linkend="v4l2-capability">v4l2_capability</link> {
256#define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */ 261#define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */
257#define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */ 262#define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */
258 263
264/* Is a video capture device that supports multiplanar formats */
265#define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000
266/* Is a video output device that supports multiplanar formats */
267#define V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000
268
259#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ 269#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
260#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ 270#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
261#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ 271#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */
@@ -288,6 +298,7 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> {
288#define <link linkend="V4L2-PIX-FMT-RGB565">V4L2_PIX_FMT_RGB565</link> v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */ 298#define <link linkend="V4L2-PIX-FMT-RGB565">V4L2_PIX_FMT_RGB565</link> v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */
289#define <link linkend="V4L2-PIX-FMT-RGB555X">V4L2_PIX_FMT_RGB555X</link> v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */ 299#define <link linkend="V4L2-PIX-FMT-RGB555X">V4L2_PIX_FMT_RGB555X</link> v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */
290#define <link linkend="V4L2-PIX-FMT-RGB565X">V4L2_PIX_FMT_RGB565X</link> v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */ 300#define <link linkend="V4L2-PIX-FMT-RGB565X">V4L2_PIX_FMT_RGB565X</link> v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */
301#define <link linkend="V4L2-PIX-FMT-BGR666">V4L2_PIX_FMT_BGR666</link> v4l2_fourcc('B', 'G', 'R', 'H') /* 18 BGR-6-6-6 */
291#define <link linkend="V4L2-PIX-FMT-BGR24">V4L2_PIX_FMT_BGR24</link> v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */ 302#define <link linkend="V4L2-PIX-FMT-BGR24">V4L2_PIX_FMT_BGR24</link> v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */
292#define <link linkend="V4L2-PIX-FMT-RGB24">V4L2_PIX_FMT_RGB24</link> v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ 303#define <link linkend="V4L2-PIX-FMT-RGB24">V4L2_PIX_FMT_RGB24</link> v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */
293#define <link linkend="V4L2-PIX-FMT-BGR32">V4L2_PIX_FMT_BGR32</link> v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ 304#define <link linkend="V4L2-PIX-FMT-BGR32">V4L2_PIX_FMT_BGR32</link> v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */
@@ -295,8 +306,14 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> {
295 306
296/* Grey formats */ 307/* Grey formats */
297#define <link linkend="V4L2-PIX-FMT-GREY">V4L2_PIX_FMT_GREY</link> v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ 308#define <link linkend="V4L2-PIX-FMT-GREY">V4L2_PIX_FMT_GREY</link> v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
309#define <link linkend="V4L2-PIX-FMT-Y4">V4L2_PIX_FMT_Y4</link> v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */
310#define <link linkend="V4L2-PIX-FMT-Y6">V4L2_PIX_FMT_Y6</link> v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */
311#define <link linkend="V4L2-PIX-FMT-Y10">V4L2_PIX_FMT_Y10</link> v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */
298#define <link linkend="V4L2-PIX-FMT-Y16">V4L2_PIX_FMT_Y16</link> v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ 312#define <link linkend="V4L2-PIX-FMT-Y16">V4L2_PIX_FMT_Y16</link> v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */
299 313
314/* Grey bit-packed formats */
315#define <link linkend="V4L2-PIX-FMT-Y10BPACK">V4L2_PIX_FMT_Y10BPACK</link> v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */
316
300/* Palette formats */ 317/* Palette formats */
301#define <link linkend="V4L2-PIX-FMT-PAL8">V4L2_PIX_FMT_PAL8</link> v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ 318#define <link linkend="V4L2-PIX-FMT-PAL8">V4L2_PIX_FMT_PAL8</link> v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */
302 319
@@ -319,6 +336,7 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> {
319#define <link linkend="V4L2-PIX-FMT-YUV420">V4L2_PIX_FMT_YUV420</link> v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */ 336#define <link linkend="V4L2-PIX-FMT-YUV420">V4L2_PIX_FMT_YUV420</link> v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */
320#define <link linkend="V4L2-PIX-FMT-HI240">V4L2_PIX_FMT_HI240</link> v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ 337#define <link linkend="V4L2-PIX-FMT-HI240">V4L2_PIX_FMT_HI240</link> v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */
321#define <link linkend="V4L2-PIX-FMT-HM12">V4L2_PIX_FMT_HM12</link> v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ 338#define <link linkend="V4L2-PIX-FMT-HM12">V4L2_PIX_FMT_HM12</link> v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */
339#define <link linkend="V4L2-PIX-FMT-M420">V4L2_PIX_FMT_M420</link> v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */
322 340
323/* two planes -- one Y, one Cr + Cb interleaved */ 341/* two planes -- one Y, one Cr + Cb interleaved */
324#define <link linkend="V4L2-PIX-FMT-NV12">V4L2_PIX_FMT_NV12</link> v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ 342#define <link linkend="V4L2-PIX-FMT-NV12">V4L2_PIX_FMT_NV12</link> v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */
@@ -326,11 +344,22 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> {
326#define <link linkend="V4L2-PIX-FMT-NV16">V4L2_PIX_FMT_NV16</link> v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ 344#define <link linkend="V4L2-PIX-FMT-NV16">V4L2_PIX_FMT_NV16</link> v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */
327#define <link linkend="V4L2-PIX-FMT-NV61">V4L2_PIX_FMT_NV61</link> v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ 345#define <link linkend="V4L2-PIX-FMT-NV61">V4L2_PIX_FMT_NV61</link> v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */
328 346
347/* two non contiguous planes - one Y, one Cr + Cb interleaved */
348#define <link linkend="V4L2-PIX-FMT-NV12M">V4L2_PIX_FMT_NV12M</link> v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
349#define <link linkend="V4L2-PIX-FMT-NV12MT">V4L2_PIX_FMT_NV12MT</link> v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
350
351/* three non contiguous planes - Y, Cb, Cr */
352#define <link linkend="V4L2-PIX-FMT-YUV420M">V4L2_PIX_FMT_YUV420M</link> v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */
353
329/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ 354/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
330#define <link linkend="V4L2-PIX-FMT-SBGGR8">V4L2_PIX_FMT_SBGGR8</link> v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ 355#define <link linkend="V4L2-PIX-FMT-SBGGR8">V4L2_PIX_FMT_SBGGR8</link> v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
331#define <link linkend="V4L2-PIX-FMT-SGBRG8">V4L2_PIX_FMT_SGBRG8</link> v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ 356#define <link linkend="V4L2-PIX-FMT-SGBRG8">V4L2_PIX_FMT_SGBRG8</link> v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */
332#define <link linkend="V4L2-PIX-FMT-SGRBG8">V4L2_PIX_FMT_SGRBG8</link> v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */ 357#define <link linkend="V4L2-PIX-FMT-SGRBG8">V4L2_PIX_FMT_SGRBG8</link> v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */
333#define <link linkend="V4L2-PIX-FMT-SGRBG10">V4L2_PIX_FMT_SGRBG10</link> v4l2_fourcc('B', 'A', '1', '0') /* 10bit raw bayer */ 358#define <link linkend="V4L2-PIX-FMT-SRGGB8">V4L2_PIX_FMT_SRGGB8</link> v4l2_fourcc('R', 'G', 'G', 'B') /* 8 RGRG.. GBGB.. */
359#define <link linkend="V4L2-PIX-FMT-SBGGR10">V4L2_PIX_FMT_SBGGR10</link> v4l2_fourcc('B', 'G', '1', '0') /* 10 BGBG.. GRGR.. */
360#define <link linkend="V4L2-PIX-FMT-SGBRG10">V4L2_PIX_FMT_SGBRG10</link> v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */
361#define <link linkend="V4L2-PIX-FMT-SGRBG10">V4L2_PIX_FMT_SGRBG10</link> v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */
362#define <link linkend="V4L2-PIX-FMT-SRGGB10">V4L2_PIX_FMT_SRGGB10</link> v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */
334 /* 10bit raw bayer DPCM compressed to 8 bits */ 363 /* 10bit raw bayer DPCM compressed to 8 bits */
335#define <link linkend="V4L2-PIX-FMT-SGRBG10DPCM8">V4L2_PIX_FMT_SGRBG10DPCM8</link> v4l2_fourcc('B', 'D', '1', '0') 364#define <link linkend="V4L2-PIX-FMT-SGRBG10DPCM8">V4L2_PIX_FMT_SGRBG10DPCM8</link> v4l2_fourcc('B', 'D', '1', '0')
336 /* 365 /*
@@ -346,6 +375,7 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> {
346#define <link linkend="V4L2-PIX-FMT-MPEG">V4L2_PIX_FMT_MPEG</link> v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ 375#define <link linkend="V4L2-PIX-FMT-MPEG">V4L2_PIX_FMT_MPEG</link> v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */
347 376
348/* Vendor-specific formats */ 377/* Vendor-specific formats */
378#define <link linkend="V4L2-PIX-FMT-CPIA1">V4L2_PIX_FMT_CPIA1</link> v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
349#define <link linkend="V4L2-PIX-FMT-WNVA">V4L2_PIX_FMT_WNVA</link> v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ 379#define <link linkend="V4L2-PIX-FMT-WNVA">V4L2_PIX_FMT_WNVA</link> v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
350#define <link linkend="V4L2-PIX-FMT-SN9C10X">V4L2_PIX_FMT_SN9C10X</link> v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ 380#define <link linkend="V4L2-PIX-FMT-SN9C10X">V4L2_PIX_FMT_SN9C10X</link> v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
351#define <link linkend="V4L2-PIX-FMT-SN9C20X-I420">V4L2_PIX_FMT_SN9C20X_I420</link> v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */ 381#define <link linkend="V4L2-PIX-FMT-SN9C20X-I420">V4L2_PIX_FMT_SN9C20X_I420</link> v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */
@@ -358,12 +388,15 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> {
358#define <link linkend="V4L2-PIX-FMT-SPCA561">V4L2_PIX_FMT_SPCA561</link> v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ 388#define <link linkend="V4L2-PIX-FMT-SPCA561">V4L2_PIX_FMT_SPCA561</link> v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
359#define <link linkend="V4L2-PIX-FMT-PAC207">V4L2_PIX_FMT_PAC207</link> v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ 389#define <link linkend="V4L2-PIX-FMT-PAC207">V4L2_PIX_FMT_PAC207</link> v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
360#define <link linkend="V4L2-PIX-FMT-MR97310A">V4L2_PIX_FMT_MR97310A</link> v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ 390#define <link linkend="V4L2-PIX-FMT-MR97310A">V4L2_PIX_FMT_MR97310A</link> v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
391#define <link linkend="V4L2-PIX-FMT-SN9C2028">V4L2_PIX_FMT_SN9C2028</link> v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */
361#define <link linkend="V4L2-PIX-FMT-SQ905C">V4L2_PIX_FMT_SQ905C</link> v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ 392#define <link linkend="V4L2-PIX-FMT-SQ905C">V4L2_PIX_FMT_SQ905C</link> v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
362#define <link linkend="V4L2-PIX-FMT-PJPG">V4L2_PIX_FMT_PJPG</link> v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ 393#define <link linkend="V4L2-PIX-FMT-PJPG">V4L2_PIX_FMT_PJPG</link> v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
363#define <link linkend="V4L2-PIX-FMT-OV511">V4L2_PIX_FMT_OV511</link> v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ 394#define <link linkend="V4L2-PIX-FMT-OV511">V4L2_PIX_FMT_OV511</link> v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
364#define <link linkend="V4L2-PIX-FMT-OV518">V4L2_PIX_FMT_OV518</link> v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ 395#define <link linkend="V4L2-PIX-FMT-OV518">V4L2_PIX_FMT_OV518</link> v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
365#define <link linkend="V4L2-PIX-FMT-TM6000">V4L2_PIX_FMT_TM6000</link> v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
366#define <link linkend="V4L2-PIX-FMT-STV0680">V4L2_PIX_FMT_STV0680</link> v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */ 396#define <link linkend="V4L2-PIX-FMT-STV0680">V4L2_PIX_FMT_STV0680</link> v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
397#define <link linkend="V4L2-PIX-FMT-TM6000">V4L2_PIX_FMT_TM6000</link> v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
398#define <link linkend="V4L2-PIX-FMT-CIT-YYVYUY">V4L2_PIX_FMT_CIT_YYVYUY</link> v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
399#define <link linkend="V4L2-PIX-FMT-KONICA420">V4L2_PIX_FMT_KONICA420</link> v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
367 400
368/* 401/*
369 * F O R M A T E N U M E R A T I O N 402 * F O R M A T E N U M E R A T I O N
@@ -380,7 +413,7 @@ struct <link linkend="v4l2-fmtdesc">v4l2_fmtdesc</link> {
380#define V4L2_FMT_FLAG_COMPRESSED 0x0001 413#define V4L2_FMT_FLAG_COMPRESSED 0x0001
381#define V4L2_FMT_FLAG_EMULATED 0x0002 414#define V4L2_FMT_FLAG_EMULATED 0x0002
382 415
383#if 1 /*KEEP*/ 416#if 1
384 /* Experimental Frame Size and frame rate enumeration */ 417 /* Experimental Frame Size and frame rate enumeration */
385/* 418/*
386 * F R A M E S I Z E E N U M E R A T I O N 419 * F R A M E S I Z E E N U M E R A T I O N
@@ -516,6 +549,62 @@ struct <link linkend="v4l2-requestbuffers">v4l2_requestbuffers</link> {
516 __u32 reserved[2]; 549 __u32 reserved[2];
517}; 550};
518 551
552/**
553 * struct <link linkend="v4l2-plane">v4l2_plane</link> - plane info for multi-planar buffers
554 * @bytesused: number of bytes occupied by data in the plane (payload)
555 * @length: size of this plane (NOT the payload) in bytes
556 * @mem_offset: when memory in the associated struct <link linkend="v4l2-buffer">v4l2_buffer</link> is
557 * V4L2_MEMORY_MMAP, equals the offset from the start of
558 * the device memory for this plane (or is a "cookie" that
559 * should be passed to mmap() called on the video node)
560 * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer
561 * pointing to this plane
562 * @data_offset: offset in the plane to the start of data; usually 0,
563 * unless there is a header in front of the data
564 *
565 * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer
566 * with two planes can have one plane for Y, and another for interleaved CbCr
567 * components. Each plane can reside in a separate memory buffer, or even in
568 * a completely separate memory node (e.g. in embedded devices).
569 */
570struct <link linkend="v4l2-plane">v4l2_plane</link> {
571 __u32 bytesused;
572 __u32 length;
573 union {
574 __u32 mem_offset;
575 unsigned long userptr;
576 } m;
577 __u32 data_offset;
578 __u32 reserved[11];
579};
580
581/**
582 * struct <link linkend="v4l2-buffer">v4l2_buffer</link> - video buffer info
583 * @index: id number of the buffer
584 * @type: buffer type (type == *_MPLANE for multiplanar buffers)
585 * @bytesused: number of bytes occupied by data in the buffer (payload);
586 * unused (set to 0) for multiplanar buffers
587 * @flags: buffer informational flags
588 * @field: field order of the image in the buffer
589 * @timestamp: frame timestamp
590 * @timecode: frame timecode
591 * @sequence: sequence count of this frame
592 * @memory: the method, in which the actual video data is passed
593 * @offset: for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
594 * offset from the start of the device memory for this plane,
595 * (or a "cookie" that should be passed to mmap() as offset)
596 * @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
597 * a userspace pointer pointing to this buffer
598 * @planes: for multiplanar buffers; userspace pointer to the array of plane
599 * info structs for this buffer
600 * @length: size in bytes of the buffer (NOT its payload) for single-plane
601 * buffers (when type != *_MPLANE); number of elements in the
602 * planes array for multi-plane buffers
603 * @input: input number from which the video data has has been captured
604 *
605 * Contains data exchanged by application and driver using one of the Streaming
606 * I/O methods.
607 */
519struct <link linkend="v4l2-buffer">v4l2_buffer</link> { 608struct <link linkend="v4l2-buffer">v4l2_buffer</link> {
520 __u32 index; 609 __u32 index;
521 enum <link linkend="v4l2-buf-type">v4l2_buf_type</link> type; 610 enum <link linkend="v4l2-buf-type">v4l2_buf_type</link> type;
@@ -531,6 +620,7 @@ struct <link linkend="v4l2-buffer">v4l2_buffer</link> {
531 union { 620 union {
532 __u32 offset; 621 __u32 offset;
533 unsigned long userptr; 622 unsigned long userptr;
623 struct <link linkend="v4l2-plane">v4l2_plane</link> *planes;
534 } m; 624 } m;
535 __u32 length; 625 __u32 length;
536 __u32 input; 626 __u32 input;
@@ -544,6 +634,8 @@ struct <link linkend="v4l2-buffer">v4l2_buffer</link> {
544#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */ 634#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */
545#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */ 635#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
546#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */ 636#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
637/* Buffer is ready, but the data contained within is corrupted. */
638#define V4L2_BUF_FLAG_ERROR 0x0040
547#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ 639#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
548#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */ 640#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */
549 641
@@ -934,6 +1026,16 @@ struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link> {
934#define V4L2_CTRL_ID2CLASS(id) ((id) &amp; 0x0fff0000UL) 1026#define V4L2_CTRL_ID2CLASS(id) ((id) &amp; 0x0fff0000UL)
935#define V4L2_CTRL_DRIVER_PRIV(id) (((id) &amp; 0xffff) &gt;= 0x1000) 1027#define V4L2_CTRL_DRIVER_PRIV(id) (((id) &amp; 0xffff) &gt;= 0x1000)
936 1028
1029enum <link linkend="v4l2-ctrl-type">v4l2_ctrl_type</link> {
1030 V4L2_CTRL_TYPE_INTEGER = 1,
1031 V4L2_CTRL_TYPE_BOOLEAN = 2,
1032 V4L2_CTRL_TYPE_MENU = 3,
1033 V4L2_CTRL_TYPE_BUTTON = 4,
1034 V4L2_CTRL_TYPE_INTEGER64 = 5,
1035 V4L2_CTRL_TYPE_CTRL_CLASS = 6,
1036 V4L2_CTRL_TYPE_STRING = 7,
1037};
1038
937/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ 1039/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
938struct <link linkend="v4l2-queryctrl">v4l2_queryctrl</link> { 1040struct <link linkend="v4l2-queryctrl">v4l2_queryctrl</link> {
939 __u32 id; 1041 __u32 id;
@@ -1018,21 +1120,27 @@ enum <link linkend="v4l2-colorfx">v4l2_colorfx</link> {
1018 V4L2_COLORFX_NONE = 0, 1120 V4L2_COLORFX_NONE = 0,
1019 V4L2_COLORFX_BW = 1, 1121 V4L2_COLORFX_BW = 1,
1020 V4L2_COLORFX_SEPIA = 2, 1122 V4L2_COLORFX_SEPIA = 2,
1021 V4L2_COLORFX_NEGATIVE = 3, 1123 V4L2_COLORFX_NEGATIVE = 3,
1022 V4L2_COLORFX_EMBOSS = 4, 1124 V4L2_COLORFX_EMBOSS = 4,
1023 V4L2_COLORFX_SKETCH = 5, 1125 V4L2_COLORFX_SKETCH = 5,
1024 V4L2_COLORFX_SKY_BLUE = 6, 1126 V4L2_COLORFX_SKY_BLUE = 6,
1025 V4L2_COLORFX_GRASS_GREEN = 7, 1127 V4L2_COLORFX_GRASS_GREEN = 7,
1026 V4L2_COLORFX_SKIN_WHITEN = 8, 1128 V4L2_COLORFX_SKIN_WHITEN = 8,
1027 V4L2_COLORFX_VIVID = 9. 1129 V4L2_COLORFX_VIVID = 9,
1028}; 1130};
1029#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) 1131#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
1030#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) 1132#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
1031 1133
1032#define V4L2_CID_ROTATE (V4L2_CID_BASE+34) 1134#define V4L2_CID_ROTATE (V4L2_CID_BASE+34)
1033#define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35) 1135#define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35)
1136
1137#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36)
1138
1139#define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37)
1140#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
1141
1034/* last CID + 1 */ 1142/* last CID + 1 */
1035#define V4L2_CID_LASTP1 (V4L2_CID_BASE+36) 1143#define V4L2_CID_LASTP1 (V4L2_CID_BASE+39)
1036 1144
1037/* MPEG-class control IDs defined by V4L2 */ 1145/* MPEG-class control IDs defined by V4L2 */
1038#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 1146#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
@@ -1349,6 +1457,8 @@ struct <link linkend="v4l2-modulator">v4l2_modulator</link> {
1349#define V4L2_TUNER_CAP_SAP 0x0020 1457#define V4L2_TUNER_CAP_SAP 0x0020
1350#define V4L2_TUNER_CAP_LANG1 0x0040 1458#define V4L2_TUNER_CAP_LANG1 0x0040
1351#define V4L2_TUNER_CAP_RDS 0x0080 1459#define V4L2_TUNER_CAP_RDS 0x0080
1460#define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100
1461#define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200
1352 1462
1353/* Flags for the 'rxsubchans' field */ 1463/* Flags for the 'rxsubchans' field */
1354#define V4L2_TUNER_SUB_MONO 0x0001 1464#define V4L2_TUNER_SUB_MONO 0x0001
@@ -1378,7 +1488,8 @@ struct <link linkend="v4l2-hw-freq-seek">v4l2_hw_freq_seek</link> {
1378 enum <link linkend="v4l2-tuner-type">v4l2_tuner_type</link> type; 1488 enum <link linkend="v4l2-tuner-type">v4l2_tuner_type</link> type;
1379 __u32 seek_upward; 1489 __u32 seek_upward;
1380 __u32 wrap_around; 1490 __u32 wrap_around;
1381 __u32 reserved[8]; 1491 __u32 spacing;
1492 __u32 reserved[7];
1382}; 1493};
1383 1494
1384/* 1495/*
@@ -1433,7 +1544,7 @@ struct <link linkend="v4l2-audioout">v4l2_audioout</link> {
1433 * 1544 *
1434 * NOTE: EXPERIMENTAL API 1545 * NOTE: EXPERIMENTAL API
1435 */ 1546 */
1436#if 1 /*KEEP*/ 1547#if 1
1437#define V4L2_ENC_IDX_FRAME_I (0) 1548#define V4L2_ENC_IDX_FRAME_I (0)
1438#define V4L2_ENC_IDX_FRAME_P (1) 1549#define V4L2_ENC_IDX_FRAME_P (1)
1439#define V4L2_ENC_IDX_FRAME_B (2) 1550#define V4L2_ENC_IDX_FRAME_B (2)
@@ -1600,12 +1711,56 @@ struct <link linkend="v4l2-mpeg-vbi-fmt-ivtv">v4l2_mpeg_vbi_fmt_ivtv</link> {
1600 * A G G R E G A T E S T R U C T U R E S 1711 * A G G R E G A T E S T R U C T U R E S
1601 */ 1712 */
1602 1713
1603/* Stream data format 1714/**
1715 * struct <link linkend="v4l2-plane-pix-format">v4l2_plane_pix_format</link> - additional, per-plane format definition
1716 * @sizeimage: maximum size in bytes required for data, for which
1717 * this plane will be used
1718 * @bytesperline: distance in bytes between the leftmost pixels in two
1719 * adjacent lines
1720 */
1721struct <link linkend="v4l2-plane-pix-format">v4l2_plane_pix_format</link> {
1722 __u32 sizeimage;
1723 __u16 bytesperline;
1724 __u16 reserved[7];
1725} __attribute__ ((packed));
1726
1727/**
1728 * struct <link linkend="v4l2-pix-format-mplane">v4l2_pix_format_mplane</link> - multiplanar format definition
1729 * @width: image width in pixels
1730 * @height: image height in pixels
1731 * @pixelformat: little endian four character code (fourcc)
1732 * @field: field order (for interlaced video)
1733 * @colorspace: supplemental to pixelformat
1734 * @plane_fmt: per-plane information
1735 * @num_planes: number of planes for this format
1736 */
1737struct <link linkend="v4l2-pix-format-mplane">v4l2_pix_format_mplane</link> {
1738 __u32 width;
1739 __u32 height;
1740 __u32 pixelformat;
1741 enum <link linkend="v4l2-field">v4l2_field</link> field;
1742 enum <link linkend="v4l2-colorspace">v4l2_colorspace</link> colorspace;
1743
1744 struct <link linkend="v4l2-plane-pix-format">v4l2_plane_pix_format</link> plane_fmt[VIDEO_MAX_PLANES];
1745 __u8 num_planes;
1746 __u8 reserved[11];
1747} __attribute__ ((packed));
1748
1749/**
1750 * struct <link linkend="v4l2-format">v4l2_format</link> - stream data format
1751 * @type: type of the data stream
1752 * @pix: definition of an image format
1753 * @pix_mp: definition of a multiplanar image format
1754 * @win: definition of an overlaid image
1755 * @vbi: raw VBI capture or output parameters
1756 * @sliced: sliced VBI capture or output parameters
1757 * @raw_data: placeholder for future extensions and custom formats
1604 */ 1758 */
1605struct <link linkend="v4l2-format">v4l2_format</link> { 1759struct <link linkend="v4l2-format">v4l2_format</link> {
1606 enum <link linkend="v4l2-buf-type">v4l2_buf_type</link> type; 1760 enum <link linkend="v4l2-buf-type">v4l2_buf_type</link> type;
1607 union { 1761 union {
1608 struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */ 1762 struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
1763 struct <link linkend="v4l2-pix-format-mplane">v4l2_pix_format_mplane</link> pix_mp; /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */
1609 struct <link linkend="v4l2-window">v4l2_window</link> win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */ 1764 struct <link linkend="v4l2-window">v4l2_window</link> win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */
1610 struct <link linkend="v4l2-vbi-format">v4l2_vbi_format</link> vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */ 1765 struct <link linkend="v4l2-vbi-format">v4l2_vbi_format</link> vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */
1611 struct <link linkend="v4l2-sliced-vbi-format">v4l2_sliced_vbi_format</link> sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */ 1766 struct <link linkend="v4l2-sliced-vbi-format">v4l2_sliced_vbi_format</link> sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */
@@ -1613,7 +1768,6 @@ struct <link linkend="v4l2-format">v4l2_format</link> {
1613 } fmt; 1768 } fmt;
1614}; 1769};
1615 1770
1616
1617/* Stream type-dependent parameters 1771/* Stream type-dependent parameters
1618 */ 1772 */
1619struct <link linkend="v4l2-streamparm">v4l2_streamparm</link> { 1773struct <link linkend="v4l2-streamparm">v4l2_streamparm</link> {
@@ -1626,6 +1780,38 @@ struct <link linkend="v4l2-streamparm">v4l2_streamparm</link> {
1626}; 1780};
1627 1781
1628/* 1782/*
1783 * E V E N T S
1784 */
1785
1786#define V4L2_EVENT_ALL 0
1787#define V4L2_EVENT_VSYNC 1
1788#define V4L2_EVENT_EOS 2
1789#define V4L2_EVENT_PRIVATE_START 0x08000000
1790
1791/* Payload for V4L2_EVENT_VSYNC */
1792struct <link linkend="v4l2-event-vsync">v4l2_event_vsync</link> {
1793 /* Can be V4L2_FIELD_ANY, _NONE, _TOP or _BOTTOM */
1794 __u8 field;
1795} __attribute__ ((packed));
1796
1797struct <link linkend="v4l2-event">v4l2_event</link> {
1798 __u32 type;
1799 union {
1800 struct <link linkend="v4l2-event-vsync">v4l2_event_vsync</link> vsync;
1801 __u8 data[64];
1802 } u;
1803 __u32 pending;
1804 __u32 sequence;
1805 struct timespec timestamp;
1806 __u32 reserved[9];
1807};
1808
1809struct <link linkend="v4l2-event-subscription">v4l2_event_subscription</link> {
1810 __u32 type;
1811 __u32 reserved[7];
1812};
1813
1814/*
1629 * A D V A N C E D D E B U G G I N G 1815 * A D V A N C E D D E B U G G I N G
1630 * 1816 *
1631 * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS! 1817 * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS!
@@ -1720,7 +1906,7 @@ struct <link linkend="v4l2-dbg-chip-ident">v4l2_dbg_chip_ident</link> {
1720#define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>) 1906#define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>)
1721#define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>) 1907#define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>)
1722#define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>) 1908#define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>)
1723#if 1 /*KEEP*/ 1909#if 1
1724#define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct <link linkend="v4l2-frmsizeenum">v4l2_frmsizeenum</link>) 1910#define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct <link linkend="v4l2-frmsizeenum">v4l2_frmsizeenum</link>)
1725#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct <link linkend="v4l2-frmivalenum">v4l2_frmivalenum</link>) 1911#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct <link linkend="v4l2-frmivalenum">v4l2_frmivalenum</link>)
1726#define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct <link linkend="v4l2-enc-idx">v4l2_enc_idx</link>) 1912#define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct <link linkend="v4l2-enc-idx">v4l2_enc_idx</link>)
@@ -1728,7 +1914,7 @@ struct <link linkend="v4l2-dbg-chip-ident">v4l2_dbg_chip_ident</link> {
1728#define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct <link linkend="v4l2-encoder-cmd">v4l2_encoder_cmd</link>) 1914#define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct <link linkend="v4l2-encoder-cmd">v4l2_encoder_cmd</link>)
1729#endif 1915#endif
1730 1916
1731#if 1 /*KEEP*/ 1917#if 1
1732/* Experimental, meant for debugging, testing and internal use. 1918/* Experimental, meant for debugging, testing and internal use.
1733 Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined. 1919 Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
1734 You must be root to use these ioctls. Never use these in applications! */ 1920 You must be root to use these ioctls. Never use these in applications! */
@@ -1747,20 +1933,13 @@ struct <link linkend="v4l2-dbg-chip-ident">v4l2_dbg_chip_ident</link> {
1747#define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link>) 1933#define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link>)
1748#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>) 1934#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>)
1749#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>) 1935#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>)
1936#define VIDIOC_DQEVENT _IOR('V', 89, struct <link linkend="v4l2-event">v4l2_event</link>)
1937#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct <link linkend="v4l2-event-subscription">v4l2_event_subscription</link>)
1938#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct <link linkend="v4l2-event-subscription">v4l2_event_subscription</link>)
1750 1939
1751/* Reminder: when adding new ioctls please add support for them to 1940/* Reminder: when adding new ioctls please add support for them to
1752 drivers/media/video/v4l2-compat-ioctl32.c as well! */ 1941 drivers/media/video/v4l2-compat-ioctl32.c as well! */
1753 1942
1754#ifdef __OLD_VIDIOC_
1755/* for compatibility, will go away some day */
1756#define VIDIOC_OVERLAY_OLD _IOWR('V', 14, int)
1757#define VIDIOC_S_PARM_OLD _IOW('V', 22, struct <link linkend="v4l2-streamparm">v4l2_streamparm</link>)
1758#define VIDIOC_S_CTRL_OLD _IOW('V', 28, struct <link linkend="v4l2-control">v4l2_control</link>)
1759#define VIDIOC_G_AUDIO_OLD _IOWR('V', 33, struct <link linkend="v4l2-audio">v4l2_audio</link>)
1760#define VIDIOC_G_AUDOUT_OLD _IOWR('V', 49, struct <link linkend="v4l2-audioout">v4l2_audioout</link>)
1761#define VIDIOC_CROPCAP_OLD _IOR('V', 58, struct <link linkend="v4l2-cropcap">v4l2_cropcap</link>)
1762#endif
1763
1764#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ 1943#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
1765 1944
1766#endif /* __LINUX_VIDEODEV2_H */ 1945#endif /* __LINUX_VIDEODEV2_H */
diff --git a/Documentation/DocBook/v4l/vidioc-enum-fmt.xml b/Documentation/DocBook/v4l/vidioc-enum-fmt.xml
index 960d44615ca6..71d373b6d36a 100644
--- a/Documentation/DocBook/v4l/vidioc-enum-fmt.xml
+++ b/Documentation/DocBook/v4l/vidioc-enum-fmt.xml
@@ -76,7 +76,9 @@ pixelformat</structfield> field.</entry>
76 <entry>Type of the data stream, set by the application. 76 <entry>Type of the data stream, set by the application.
77Only these types are valid here: 77Only these types are valid here:
78<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>, 78<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>,
79<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant>,
79<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>, 80<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>,
81<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant>,
80<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver 82<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver
81defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant> 83defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant>
82and higher.</entry> 84and higher.</entry>
diff --git a/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml b/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml
index 3c6784e132f3..d733721a7519 100644
--- a/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml
+++ b/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml
@@ -16,8 +16,7 @@
16 <funcdef>int <function>ioctl</function></funcdef> 16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef> 17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef> 18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>&v4l2-dv-preset; 19 <paramdef>struct v4l2_dv_preset *<parameter>argp</parameter></paramdef>
20*<parameter>argp</parameter></paramdef>
21 </funcprototype> 20 </funcprototype>
22 </funcsynopsis> 21 </funcsynopsis>
23 </refsynopsisdiv> 22 </refsynopsisdiv>
diff --git a/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml b/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml
index ecc19576bb8f..d5ec6abf0ce2 100644
--- a/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml
+++ b/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml
@@ -16,8 +16,7 @@
16 <funcdef>int <function>ioctl</function></funcdef> 16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef> 17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef> 18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>&v4l2-dv-timings; 19 <paramdef>struct v4l2_dv_timings *<parameter>argp</parameter></paramdef>
20*<parameter>argp</parameter></paramdef>
21 </funcprototype> 20 </funcprototype>
22 </funcsynopsis> 21 </funcsynopsis>
23 </refsynopsisdiv> 22 </refsynopsisdiv>
diff --git a/Documentation/DocBook/v4l/vidioc-g-fmt.xml b/Documentation/DocBook/v4l/vidioc-g-fmt.xml
index 7c7d1b72c40d..a4ae59b664eb 100644
--- a/Documentation/DocBook/v4l/vidioc-g-fmt.xml
+++ b/Documentation/DocBook/v4l/vidioc-g-fmt.xml
@@ -60,11 +60,13 @@ application.</para>
60<structfield>type</structfield> field of a struct 60<structfield>type</structfield> field of a struct
61<structname>v4l2_format</structname> to the respective buffer (stream) 61<structname>v4l2_format</structname> to the respective buffer (stream)
62type. For example video capture devices use 62type. For example video capture devices use
63<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>. When the application 63<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant> or
64<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant>. When the application
64calls the <constant>VIDIOC_G_FMT</constant> ioctl with a pointer to 65calls the <constant>VIDIOC_G_FMT</constant> ioctl with a pointer to
65this structure the driver fills the respective member of the 66this structure the driver fills the respective member of the
66<structfield>fmt</structfield> union. In case of video capture devices 67<structfield>fmt</structfield> union. In case of video capture devices
67that is the &v4l2-pix-format; <structfield>pix</structfield> member. 68that is either the &v4l2-pix-format; <structfield>pix</structfield> or
69the &v4l2-pix-format-mplane; <structfield>pix_mp</structfield> member.
68When the requested buffer type is not supported drivers return an 70When the requested buffer type is not supported drivers return an
69&EINVAL;.</para> 71&EINVAL;.</para>
70 72
@@ -134,6 +136,15 @@ devices.</entry>
134 </row> 136 </row>
135 <row> 137 <row>
136 <entry></entry> 138 <entry></entry>
139 <entry>&v4l2-pix-format-mplane;</entry>
140 <entry><structfield>pix_mp</structfield></entry>
141 <entry>Definition of an image format, see <xref
142 linkend="pixfmt" />, used by video capture and output
143devices that support the <link linkend="planar-apis">multi-planar
144version of the API</link>.</entry>
145 </row>
146 <row>
147 <entry></entry>
137 <entry>&v4l2-window;</entry> 148 <entry>&v4l2-window;</entry>
138 <entry><structfield>win</structfield></entry> 149 <entry><structfield>win</structfield></entry>
139 <entry>Definition of an overlaid image, see <xref 150 <entry>Definition of an overlaid image, see <xref
diff --git a/Documentation/DocBook/v4l/vidioc-qbuf.xml b/Documentation/DocBook/v4l/vidioc-qbuf.xml
index ab691ebf3b93..f2b11f8a4031 100644
--- a/Documentation/DocBook/v4l/vidioc-qbuf.xml
+++ b/Documentation/DocBook/v4l/vidioc-qbuf.xml
@@ -64,7 +64,8 @@ zero to the number of buffers allocated with &VIDIOC-REQBUFS;
64contents of the struct <structname>v4l2_buffer</structname> returned 64contents of the struct <structname>v4l2_buffer</structname> returned
65by a &VIDIOC-QUERYBUF; ioctl will do as well. When the buffer is 65by a &VIDIOC-QUERYBUF; ioctl will do as well. When the buffer is
66intended for output (<structfield>type</structfield> is 66intended for output (<structfield>type</structfield> is
67<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant> or 67<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>,
68<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant>, or
68<constant>V4L2_BUF_TYPE_VBI_OUTPUT</constant>) applications must also 69<constant>V4L2_BUF_TYPE_VBI_OUTPUT</constant>) applications must also
69initialize the <structfield>bytesused</structfield>, 70initialize the <structfield>bytesused</structfield>,
70<structfield>field</structfield> and 71<structfield>field</structfield> and
@@ -75,7 +76,11 @@ supports capturing from specific video inputs and you want to specify a video
75input, then <structfield>flags</structfield> should be set to 76input, then <structfield>flags</structfield> should be set to
76<constant>V4L2_BUF_FLAG_INPUT</constant> and the field 77<constant>V4L2_BUF_FLAG_INPUT</constant> and the field
77<structfield>input</structfield> must be initialized to the desired input. 78<structfield>input</structfield> must be initialized to the desired input.
78The <structfield>reserved</structfield> field must be set to 0. 79The <structfield>reserved</structfield> field must be set to 0. When using
80the <link linkend="planar-apis">multi-planar API</link>, the
81<structfield>m.planes</structfield> field must contain a userspace pointer
82to a filled-in array of &v4l2-plane; and the <structfield>length</structfield>
83field must be set to the number of elements in that array.
79</para> 84</para>
80 85
81 <para>To enqueue a <link linkend="mmap">memory mapped</link> 86 <para>To enqueue a <link linkend="mmap">memory mapped</link>
@@ -93,10 +98,13 @@ structure the driver sets the
93buffer applications set the <structfield>memory</structfield> 98buffer applications set the <structfield>memory</structfield>
94field to <constant>V4L2_MEMORY_USERPTR</constant>, the 99field to <constant>V4L2_MEMORY_USERPTR</constant>, the
95<structfield>m.userptr</structfield> field to the address of the 100<structfield>m.userptr</structfield> field to the address of the
96buffer and <structfield>length</structfield> to its size. 101buffer and <structfield>length</structfield> to its size. When the multi-planar
97When <constant>VIDIOC_QBUF</constant> is called with a pointer to this 102API is used, <structfield>m.userptr</structfield> and
98structure the driver sets the <constant>V4L2_BUF_FLAG_QUEUED</constant> 103<structfield>length</structfield> members of the passed array of &v4l2-plane;
99flag and clears the <constant>V4L2_BUF_FLAG_MAPPED</constant> and 104have to be used instead. When <constant>VIDIOC_QBUF</constant> is called with
105a pointer to this structure the driver sets the
106<constant>V4L2_BUF_FLAG_QUEUED</constant> flag and clears the
107<constant>V4L2_BUF_FLAG_MAPPED</constant> and
100<constant>V4L2_BUF_FLAG_DONE</constant> flags in the 108<constant>V4L2_BUF_FLAG_DONE</constant> flags in the
101<structfield>flags</structfield> field, or it returns an error code. 109<structfield>flags</structfield> field, or it returns an error code.
102This ioctl locks the memory pages of the buffer in physical memory, 110This ioctl locks the memory pages of the buffer in physical memory,
@@ -115,7 +123,9 @@ remaining fields or returns an error code. The driver may also set
115<constant>V4L2_BUF_FLAG_ERROR</constant> in the <structfield>flags</structfield> 123<constant>V4L2_BUF_FLAG_ERROR</constant> in the <structfield>flags</structfield>
116field. It indicates a non-critical (recoverable) streaming error. In such case 124field. It indicates a non-critical (recoverable) streaming error. In such case
117the application may continue as normal, but should be aware that data in the 125the application may continue as normal, but should be aware that data in the
118dequeued buffer might be corrupted.</para> 126dequeued buffer might be corrupted. When using the multi-planar API, the
127planes array does not have to be passed; the <structfield>m.planes</structfield>
128member must be set to NULL in that case.</para>
119 129
120 <para>By default <constant>VIDIOC_DQBUF</constant> blocks when no 130 <para>By default <constant>VIDIOC_DQBUF</constant> blocks when no
121buffer is in the outgoing queue. When the 131buffer is in the outgoing queue. When the
diff --git a/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml b/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml
index 402229ee06f6..d272f7ab91b8 100644
--- a/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml
+++ b/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml
@@ -16,7 +16,7 @@ input</refpurpose>
16 <funcdef>int <function>ioctl</function></funcdef> 16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef> 17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef> 18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>&v4l2-dv-preset; *<parameter>argp</parameter></paramdef> 19 <paramdef>struct v4l2_dv_preset *<parameter>argp</parameter></paramdef>
20 </funcprototype> 20 </funcprototype>
21 </funcsynopsis> 21 </funcsynopsis>
22 </refsynopsisdiv> 22 </refsynopsisdiv>
diff --git a/Documentation/DocBook/v4l/vidioc-querybuf.xml b/Documentation/DocBook/v4l/vidioc-querybuf.xml
index e649805a4908..5c104d42d31c 100644
--- a/Documentation/DocBook/v4l/vidioc-querybuf.xml
+++ b/Documentation/DocBook/v4l/vidioc-querybuf.xml
@@ -61,6 +61,10 @@ buffer at any time after buffers have been allocated with the
61to the number of buffers allocated with &VIDIOC-REQBUFS; 61to the number of buffers allocated with &VIDIOC-REQBUFS;
62 (&v4l2-requestbuffers; <structfield>count</structfield>) minus one. 62 (&v4l2-requestbuffers; <structfield>count</structfield>) minus one.
63The <structfield>reserved</structfield> field should to set to 0. 63The <structfield>reserved</structfield> field should to set to 0.
64When using the <link linkend="planar-apis">multi-planar API</link>, the
65<structfield>m.planes</structfield> field must contain a userspace pointer to an
66array of &v4l2-plane; and the <structfield>length</structfield> field has
67to be set to the number of elements in that array.
64After calling <constant>VIDIOC_QUERYBUF</constant> with a pointer to 68After calling <constant>VIDIOC_QUERYBUF</constant> with a pointer to
65 this structure drivers return an error code or fill the rest of 69 this structure drivers return an error code or fill the rest of
66the structure.</para> 70the structure.</para>
@@ -70,11 +74,13 @@ the structure.</para>
70<constant>V4L2_BUF_FLAG_QUEUED</constant> and 74<constant>V4L2_BUF_FLAG_QUEUED</constant> and
71<constant>V4L2_BUF_FLAG_DONE</constant> flags will be valid. The 75<constant>V4L2_BUF_FLAG_DONE</constant> flags will be valid. The
72<structfield>memory</structfield> field will be set to the current 76<structfield>memory</structfield> field will be set to the current
73I/O method, the <structfield>m.offset</structfield> 77I/O method. For the single-planar API, the <structfield>m.offset</structfield>
74contains the offset of the buffer from the start of the device memory, 78contains the offset of the buffer from the start of the device memory,
75the <structfield>length</structfield> field its size. The driver may 79the <structfield>length</structfield> field its size. For the multi-planar API,
76or may not set the remaining fields and flags, they are meaningless in 80fields <structfield>m.mem_offset</structfield> and
77this context.</para> 81<structfield>length</structfield> in the <structfield>m.planes</structfield>
82array elements will be used instead. The driver may or may not set the remaining
83fields and flags, they are meaningless in this context.</para>
78 84
79 <para>The <structname>v4l2_buffer</structname> structure is 85 <para>The <structname>v4l2_buffer</structname> structure is
80 specified in <xref linkend="buffer" />.</para> 86 specified in <xref linkend="buffer" />.</para>
diff --git a/Documentation/DocBook/v4l/vidioc-querycap.xml b/Documentation/DocBook/v4l/vidioc-querycap.xml
index 6ab7e25b31b6..f29f1b86213c 100644
--- a/Documentation/DocBook/v4l/vidioc-querycap.xml
+++ b/Documentation/DocBook/v4l/vidioc-querycap.xml
@@ -142,16 +142,30 @@ this array to zero.</entry>
142 <row> 142 <row>
143 <entry><constant>V4L2_CAP_VIDEO_CAPTURE</constant></entry> 143 <entry><constant>V4L2_CAP_VIDEO_CAPTURE</constant></entry>
144 <entry>0x00000001</entry> 144 <entry>0x00000001</entry>
145 <entry>The device supports the <link 145 <entry>The device supports the single-planar API through the <link
146linkend="capture">Video Capture</link> interface.</entry> 146linkend="capture">Video Capture</link> interface.</entry>
147 </row> 147 </row>
148 <row> 148 <row>
149 <entry><constant>V4L2_CAP_VIDEO_CAPTURE_MPLANE</constant></entry>
150 <entry>0x00001000</entry>
151 <entry>The device supports the
152 <link linkend="planar-apis">multi-planar API</link> through the
153 <link linkend="capture">Video Capture</link> interface.</entry>
154 </row>
155 <row>
149 <entry><constant>V4L2_CAP_VIDEO_OUTPUT</constant></entry> 156 <entry><constant>V4L2_CAP_VIDEO_OUTPUT</constant></entry>
150 <entry>0x00000002</entry> 157 <entry>0x00000002</entry>
151 <entry>The device supports the <link 158 <entry>The device supports the single-planar API through the <link
152linkend="output">Video Output</link> interface.</entry> 159linkend="output">Video Output</link> interface.</entry>
153 </row> 160 </row>
154 <row> 161 <row>
162 <entry><constant>V4L2_CAP_VIDEO_OUTPUT_MPLANE</constant></entry>
163 <entry>0x00002000</entry>
164 <entry>The device supports the
165 <link linkend="planar-apis">multi-planar API</link> through the
166 <link linkend="output">Video Output</link> interface.</entry>
167 </row>
168 <row>
155 <entry><constant>V4L2_CAP_VIDEO_OVERLAY</constant></entry> 169 <entry><constant>V4L2_CAP_VIDEO_OVERLAY</constant></entry>
156 <entry>0x00000004</entry> 170 <entry>0x00000004</entry>
157 <entry>The device supports the <link 171 <entry>The device supports the <link
@@ -184,7 +198,7 @@ data.</entry>
184 <row> 198 <row>
185 <entry><constant>V4L2_CAP_RDS_CAPTURE</constant></entry> 199 <entry><constant>V4L2_CAP_RDS_CAPTURE</constant></entry>
186 <entry>0x00000100</entry> 200 <entry>0x00000100</entry>
187 <entry>The device supports the <link linkend="rds">RDS</link> interface.</entry> 201 <entry>The device supports the <link linkend="rds">RDS</link> capture interface.</entry>
188 </row> 202 </row>
189 <row> 203 <row>
190 <entry><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant></entry> 204 <entry><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant></entry>
@@ -206,6 +220,11 @@ driver capabilities.</para></footnote></entry>
206hardware frequency seeking.</entry> 220hardware frequency seeking.</entry>
207 </row> 221 </row>
208 <row> 222 <row>
223 <entry><constant>V4L2_CAP_RDS_OUTPUT</constant></entry>
224 <entry>0x00000800</entry>
225 <entry>The device supports the <link linkend="rds">RDS</link> output interface.</entry>
226 </row>
227 <row>
209 <entry><constant>V4L2_CAP_TUNER</constant></entry> 228 <entry><constant>V4L2_CAP_TUNER</constant></entry>
210 <entry>0x00010000</entry> 229 <entry>0x00010000</entry>
211 <entry>The device has some sort of tuner to 230 <entry>The device has some sort of tuner to
diff --git a/Documentation/DocBook/v4l/vidioc-queryctrl.xml b/Documentation/DocBook/v4l/vidioc-queryctrl.xml
index 8e0e055ac934..0d5e8283cf32 100644
--- a/Documentation/DocBook/v4l/vidioc-queryctrl.xml
+++ b/Documentation/DocBook/v4l/vidioc-queryctrl.xml
@@ -103,8 +103,12 @@ structure. The driver fills the rest of the structure or returns an
103<structfield>index</structfield> is invalid. Menu items are enumerated 103<structfield>index</structfield> is invalid. Menu items are enumerated
104by calling <constant>VIDIOC_QUERYMENU</constant> with successive 104by calling <constant>VIDIOC_QUERYMENU</constant> with successive
105<structfield>index</structfield> values from &v4l2-queryctrl; 105<structfield>index</structfield> values from &v4l2-queryctrl;
106<structfield>minimum</structfield> (0) to 106<structfield>minimum</structfield> to
107<structfield>maximum</structfield>, inclusive.</para> 107<structfield>maximum</structfield>, inclusive. Note that it is possible
108for <constant>VIDIOC_QUERYMENU</constant> to return an &EINVAL; for some
109indices between <structfield>minimum</structfield> and <structfield>maximum</structfield>.
110In that case that particular menu item is not supported by this driver. Also note that
111the <structfield>minimum</structfield> value is not necessarily 0.</para>
108 112
109 <para>See also the examples in <xref linkend="control" />.</para> 113 <para>See also the examples in <xref linkend="control" />.</para>
110 114
@@ -139,7 +143,7 @@ string. This information is intended for the user.</entry>
139 <entry><structfield>minimum</structfield></entry> 143 <entry><structfield>minimum</structfield></entry>
140 <entry>Minimum value, inclusive. This field gives a lower 144 <entry>Minimum value, inclusive. This field gives a lower
141bound for <constant>V4L2_CTRL_TYPE_INTEGER</constant> controls and the 145bound for <constant>V4L2_CTRL_TYPE_INTEGER</constant> controls and the
142lowest valid index (always 0) for <constant>V4L2_CTRL_TYPE_MENU</constant> controls. 146lowest valid index for <constant>V4L2_CTRL_TYPE_MENU</constant> controls.
143For <constant>V4L2_CTRL_TYPE_STRING</constant> controls the minimum value 147For <constant>V4L2_CTRL_TYPE_STRING</constant> controls the minimum value
144gives the minimum length of the string. This length <emphasis>does not include the terminating 148gives the minimum length of the string. This length <emphasis>does not include the terminating
145zero</emphasis>. It may not be valid for any other type of control, including 149zero</emphasis>. It may not be valid for any other type of control, including
@@ -279,7 +283,7 @@ values which are actually different on the hardware.</entry>
279 </row> 283 </row>
280 <row> 284 <row>
281 <entry><constant>V4L2_CTRL_TYPE_MENU</constant></entry> 285 <entry><constant>V4L2_CTRL_TYPE_MENU</constant></entry>
282 <entry>0</entry> 286 <entry>&ge; 0</entry>
283 <entry>1</entry> 287 <entry>1</entry>
284 <entry>N-1</entry> 288 <entry>N-1</entry>
285 <entry>The control has a menu of N choices. The names of 289 <entry>The control has a menu of N choices. The names of
@@ -405,8 +409,10 @@ writing a value will cause the device to carry out a given action
405 <term><errorcode>EINVAL</errorcode></term> 409 <term><errorcode>EINVAL</errorcode></term>
406 <listitem> 410 <listitem>
407 <para>The &v4l2-queryctrl; <structfield>id</structfield> 411 <para>The &v4l2-queryctrl; <structfield>id</structfield>
408is invalid. The &v4l2-querymenu; <structfield>id</structfield> or 412is invalid. The &v4l2-querymenu; <structfield>id</structfield> is
409<structfield>index</structfield> is invalid.</para> 413invalid or <structfield>index</structfield> is out of range (less than
414<structfield>minimum</structfield> or greater than <structfield>maximum</structfield>)
415or this particular menu item is not supported by the driver.</para>
410 </listitem> 416 </listitem>
411 </varlistentry> 417 </varlistentry>
412 <varlistentry> 418 <varlistentry>
diff --git a/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml b/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml
index 14b3ec7ed75b..c30dcc4232c0 100644
--- a/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml
+++ b/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml
@@ -51,7 +51,8 @@
51 51
52 <para>Start a hardware frequency seek from the current frequency. 52 <para>Start a hardware frequency seek from the current frequency.
53To do this applications initialize the <structfield>tuner</structfield>, 53To do this applications initialize the <structfield>tuner</structfield>,
54<structfield>type</structfield>, <structfield>seek_upward</structfield> and 54<structfield>type</structfield>, <structfield>seek_upward</structfield>,
55<structfield>spacing</structfield> and
55<structfield>wrap_around</structfield> fields, and zero out the 56<structfield>wrap_around</structfield> fields, and zero out the
56<structfield>reserved</structfield> array of a &v4l2-hw-freq-seek; and 57<structfield>reserved</structfield> array of a &v4l2-hw-freq-seek; and
57call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant> ioctl with a pointer 58call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant> ioctl with a pointer
@@ -89,7 +90,12 @@ field and the &v4l2-tuner; <structfield>index</structfield> field.</entry>
89 </row> 90 </row>
90 <row> 91 <row>
91 <entry>__u32</entry> 92 <entry>__u32</entry>
92 <entry><structfield>reserved</structfield>[8]</entry> 93 <entry><structfield>spacing</structfield></entry>
94 <entry>If non-zero, defines the hardware seek resolution in Hz. The driver selects the nearest value that is supported by the device. If spacing is zero a reasonable default value is used.</entry>
95 </row>
96 <row>
97 <entry>__u32</entry>
98 <entry><structfield>reserved</structfield>[7]</entry>
93 <entry>Reserved for future extensions. Drivers and 99 <entry>Reserved for future extensions. Drivers and
94 applications must set the array to zero.</entry> 100 applications must set the array to zero.</entry>
95 </row> 101 </row>
diff --git a/Documentation/DocBook/v4l/vidioc-streamon.xml b/Documentation/DocBook/v4l/vidioc-streamon.xml
index e42bff1f2c0a..75ed39bf4d2b 100644
--- a/Documentation/DocBook/v4l/vidioc-streamon.xml
+++ b/Documentation/DocBook/v4l/vidioc-streamon.xml
@@ -93,6 +93,15 @@ synchronize with other events.</para>
93been allocated (memory mapping) or enqueued (output) yet.</para> 93been allocated (memory mapping) or enqueued (output) yet.</para>
94 </listitem> 94 </listitem>
95 </varlistentry> 95 </varlistentry>
96 <varlistentry>
97 <term><errorcode>EPIPE</errorcode></term>
98 <listitem>
99 <para>The driver implements <link
100 linkend="pad-level-formats">pad-level format configuration</link> and
101 the pipeline configuration is invalid.
102 </para>
103 </listitem>
104 </varlistentry>
96 </variablelist> 105 </variablelist>
97 </refsect1> 106 </refsect1>
98</refentry> 107</refentry>
diff --git a/Documentation/DocBook/v4l/vidioc-subdev-enum-frame-interval.xml b/Documentation/DocBook/v4l/vidioc-subdev-enum-frame-interval.xml
new file mode 100644
index 000000000000..2f8f4f0a0235
--- /dev/null
+++ b/Documentation/DocBook/v4l/vidioc-subdev-enum-frame-interval.xml
@@ -0,0 +1,152 @@
1<refentry id="vidioc-subdev-enum-frame-interval">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL</refname>
9 <refpurpose>Enumerate frame intervals</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_subdev_frame_interval_enum *
19 <parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <note>
53 <title>Experimental</title>
54 <para>This is an <link linkend="experimental">experimental</link>
55 interface and may change in the future.</para>
56 </note>
57
58 <para>This ioctl lets applications enumerate available frame intervals on a
59 given sub-device pad. Frame intervals only makes sense for sub-devices that
60 can control the frame period on their own. This includes, for instance,
61 image sensors and TV tuners.</para>
62
63 <para>For the common use case of image sensors, the frame intervals
64 available on the sub-device output pad depend on the frame format and size
65 on the same pad. Applications must thus specify the desired format and size
66 when enumerating frame intervals.</para>
67
68 <para>To enumerate frame intervals applications initialize the
69 <structfield>index</structfield>, <structfield>pad</structfield>,
70 <structfield>code</structfield>, <structfield>width</structfield> and
71 <structfield>height</structfield> fields of
72 &v4l2-subdev-frame-interval-enum; and call the
73 <constant>VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL</constant> ioctl with a pointer
74 to this structure. Drivers fill the rest of the structure or return
75 an &EINVAL; if one of the input fields is invalid. All frame intervals are
76 enumerable by beginning at index zero and incrementing by one until
77 <errorcode>EINVAL</errorcode> is returned.</para>
78
79 <para>Available frame intervals may depend on the current 'try' formats
80 at other pads of the sub-device, as well as on the current active links. See
81 &VIDIOC-SUBDEV-G-FMT; for more information about the try formats.</para>
82
83 <para>Sub-devices that support the frame interval enumeration ioctl should
84 implemented it on a single pad only. Its behaviour when supported on
85 multiple pads of the same sub-device is not defined.</para>
86
87 <table pgwide="1" frame="none" id="v4l2-subdev-frame-interval-enum">
88 <title>struct <structname>v4l2_subdev_frame_interval_enum</structname></title>
89 <tgroup cols="3">
90 &cs-str;
91 <tbody valign="top">
92 <row>
93 <entry>__u32</entry>
94 <entry><structfield>index</structfield></entry>
95 <entry>Number of the format in the enumeration, set by the
96 application.</entry>
97 </row>
98 <row>
99 <entry>__u32</entry>
100 <entry><structfield>pad</structfield></entry>
101 <entry>Pad number as reported by the media controller API.</entry>
102 </row>
103 <row>
104 <entry>__u32</entry>
105 <entry><structfield>code</structfield></entry>
106 <entry>The media bus format code, as defined in
107 <xref linkend="v4l2-mbus-format" />.</entry>
108 </row>
109 <row>
110 <entry>__u32</entry>
111 <entry><structfield>width</structfield></entry>
112 <entry>Frame width, in pixels.</entry>
113 </row>
114 <row>
115 <entry>__u32</entry>
116 <entry><structfield>height</structfield></entry>
117 <entry>Frame height, in pixels.</entry>
118 </row>
119 <row>
120 <entry>&v4l2-fract;</entry>
121 <entry><structfield>interval</structfield></entry>
122 <entry>Period, in seconds, between consecutive video frames.</entry>
123 </row>
124 <row>
125 <entry>__u32</entry>
126 <entry><structfield>reserved</structfield>[9]</entry>
127 <entry>Reserved for future extensions. Applications and drivers must
128 set the array to zero.</entry>
129 </row>
130 </tbody>
131 </tgroup>
132 </table>
133 </refsect1>
134
135 <refsect1>
136 &return-value;
137
138 <variablelist>
139 <varlistentry>
140 <term><errorcode>EINVAL</errorcode></term>
141 <listitem>
142 <para>The &v4l2-subdev-frame-interval-enum;
143 <structfield>pad</structfield> references a non-existing pad, one of
144 the <structfield>code</structfield>, <structfield>width</structfield>
145 or <structfield>height</structfield> fields are invalid for the given
146 pad or the <structfield>index</structfield> field is out of bounds.
147 </para>
148 </listitem>
149 </varlistentry>
150 </variablelist>
151 </refsect1>
152</refentry>
diff --git a/Documentation/DocBook/v4l/vidioc-subdev-enum-frame-size.xml b/Documentation/DocBook/v4l/vidioc-subdev-enum-frame-size.xml
new file mode 100644
index 000000000000..79ce42b7c60c
--- /dev/null
+++ b/Documentation/DocBook/v4l/vidioc-subdev-enum-frame-size.xml
@@ -0,0 +1,154 @@
1<refentry id="vidioc-subdev-enum-frame-size">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_ENUM_FRAME_SIZE</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_ENUM_FRAME_SIZE</refname>
9 <refpurpose>Enumerate media bus frame sizes</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_subdev_frame_size_enum *
19 <parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_SUBDEV_ENUM_FRAME_SIZE</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <note>
53 <title>Experimental</title>
54 <para>This is an <link linkend="experimental">experimental</link>
55 interface and may change in the future.</para>
56 </note>
57
58 <para>This ioctl allows applications to enumerate all frame sizes
59 supported by a sub-device on the given pad for the given media bus format.
60 Supported formats can be retrieved with the &VIDIOC-SUBDEV-ENUM-MBUS-CODE;
61 ioctl.</para>
62
63 <para>To enumerate frame sizes applications initialize the
64 <structfield>pad</structfield>, <structfield>code</structfield> and
65 <structfield>index</structfield> fields of the
66 &v4l2-subdev-mbus-code-enum; and call the
67 <constant>VIDIOC_SUBDEV_ENUM_FRAME_SIZE</constant> ioctl with a pointer to
68 the structure. Drivers fill the minimum and maximum frame sizes or return
69 an &EINVAL; if one of the input parameters is invalid.</para>
70
71 <para>Sub-devices that only support discrete frame sizes (such as most
72 sensors) will return one or more frame sizes with identical minimum and
73 maximum values.</para>
74
75 <para>Not all possible sizes in given [minimum, maximum] ranges need to be
76 supported. For instance, a scaler that uses a fixed-point scaling ratio
77 might not be able to produce every frame size between the minimum and
78 maximum values. Applications must use the &VIDIOC-SUBDEV-S-FMT; ioctl to
79 try the sub-device for an exact supported frame size.</para>
80
81 <para>Available frame sizes may depend on the current 'try' formats at other
82 pads of the sub-device, as well as on the current active links and the
83 current values of V4L2 controls. See &VIDIOC-SUBDEV-G-FMT; for more
84 information about try formats.</para>
85
86 <table pgwide="1" frame="none" id="v4l2-subdev-frame-size-enum">
87 <title>struct <structname>v4l2_subdev_frame_size_enum</structname></title>
88 <tgroup cols="3">
89 &cs-str;
90 <tbody valign="top">
91 <row>
92 <entry>__u32</entry>
93 <entry><structfield>index</structfield></entry>
94 <entry>Number of the format in the enumeration, set by the
95 application.</entry>
96 </row>
97 <row>
98 <entry>__u32</entry>
99 <entry><structfield>pad</structfield></entry>
100 <entry>Pad number as reported by the media controller API.</entry>
101 </row>
102 <row>
103 <entry>__u32</entry>
104 <entry><structfield>code</structfield></entry>
105 <entry>The media bus format code, as defined in
106 <xref linkend="v4l2-mbus-format" />.</entry>
107 </row>
108 <row>
109 <entry>__u32</entry>
110 <entry><structfield>min_width</structfield></entry>
111 <entry>Minimum frame width, in pixels.</entry>
112 </row>
113 <row>
114 <entry>__u32</entry>
115 <entry><structfield>max_width</structfield></entry>
116 <entry>Maximum frame width, in pixels.</entry>
117 </row>
118 <row>
119 <entry>__u32</entry>
120 <entry><structfield>min_height</structfield></entry>
121 <entry>Minimum frame height, in pixels.</entry>
122 </row>
123 <row>
124 <entry>__u32</entry>
125 <entry><structfield>max_height</structfield></entry>
126 <entry>Maximum frame height, in pixels.</entry>
127 </row>
128 <row>
129 <entry>__u32</entry>
130 <entry><structfield>reserved</structfield>[9]</entry>
131 <entry>Reserved for future extensions. Applications and drivers must
132 set the array to zero.</entry>
133 </row>
134 </tbody>
135 </tgroup>
136 </table>
137 </refsect1>
138
139 <refsect1>
140 &return-value;
141
142 <variablelist>
143 <varlistentry>
144 <term><errorcode>EINVAL</errorcode></term>
145 <listitem>
146 <para>The &v4l2-subdev-frame-size-enum; <structfield>pad</structfield>
147 references a non-existing pad, the <structfield>code</structfield> is
148 invalid for the given pad or the <structfield>index</structfield>
149 field is out of bounds.</para>
150 </listitem>
151 </varlistentry>
152 </variablelist>
153 </refsect1>
154</refentry>
diff --git a/Documentation/DocBook/v4l/vidioc-subdev-enum-mbus-code.xml b/Documentation/DocBook/v4l/vidioc-subdev-enum-mbus-code.xml
new file mode 100644
index 000000000000..a6b3432449f6
--- /dev/null
+++ b/Documentation/DocBook/v4l/vidioc-subdev-enum-mbus-code.xml
@@ -0,0 +1,119 @@
1<refentry id="vidioc-subdev-enum-mbus-code">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_ENUM_MBUS_CODE</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_ENUM_MBUS_CODE</refname>
9 <refpurpose>Enumerate media bus formats</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_subdev_mbus_code_enum *
19 <parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_SUBDEV_ENUM_MBUS_CODE</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <note>
53 <title>Experimental</title>
54 <para>This is an <link linkend="experimental">experimental</link>
55 interface and may change in the future.</para>
56 </note>
57
58 <para>To enumerate media bus formats available at a given sub-device pad
59 applications initialize the <structfield>pad</structfield> and
60 <structfield>index</structfield> fields of &v4l2-subdev-mbus-code-enum; and
61 call the <constant>VIDIOC_SUBDEV_ENUM_MBUS_CODE</constant> ioctl with a
62 pointer to this structure. Drivers fill the rest of the structure or return
63 an &EINVAL; if either the <structfield>pad</structfield> or
64 <structfield>index</structfield> are invalid. All media bus formats are
65 enumerable by beginning at index zero and incrementing by one until
66 <errorcode>EINVAL</errorcode> is returned.</para>
67
68 <para>Available media bus formats may depend on the current 'try' formats
69 at other pads of the sub-device, as well as on the current active links. See
70 &VIDIOC-SUBDEV-G-FMT; for more information about the try formats.</para>
71
72 <table pgwide="1" frame="none" id="v4l2-subdev-mbus-code-enum">
73 <title>struct <structname>v4l2_subdev_mbus_code_enum</structname></title>
74 <tgroup cols="3">
75 &cs-str;
76 <tbody valign="top">
77 <row>
78 <entry>__u32</entry>
79 <entry><structfield>pad</structfield></entry>
80 <entry>Pad number as reported by the media controller API.</entry>
81 </row>
82 <row>
83 <entry>__u32</entry>
84 <entry><structfield>index</structfield></entry>
85 <entry>Number of the format in the enumeration, set by the
86 application.</entry>
87 </row>
88 <row>
89 <entry>__u32</entry>
90 <entry><structfield>code</structfield></entry>
91 <entry>The media bus format code, as defined in
92 <xref linkend="v4l2-mbus-format" />.</entry>
93 </row>
94 <row>
95 <entry>__u32</entry>
96 <entry><structfield>reserved</structfield>[9]</entry>
97 <entry>Reserved for future extensions. Applications and drivers must
98 set the array to zero.</entry>
99 </row>
100 </tbody>
101 </tgroup>
102 </table>
103 </refsect1>
104
105 <refsect1>
106 &return-value;
107
108 <variablelist>
109 <varlistentry>
110 <term><errorcode>EINVAL</errorcode></term>
111 <listitem>
112 <para>The &v4l2-subdev-mbus-code-enum; <structfield>pad</structfield>
113 references a non-existing pad, or the <structfield>index</structfield>
114 field is out of bounds.</para>
115 </listitem>
116 </varlistentry>
117 </variablelist>
118 </refsect1>
119</refentry>
diff --git a/Documentation/DocBook/v4l/vidioc-subdev-g-crop.xml b/Documentation/DocBook/v4l/vidioc-subdev-g-crop.xml
new file mode 100644
index 000000000000..06197323a8cc
--- /dev/null
+++ b/Documentation/DocBook/v4l/vidioc-subdev-g-crop.xml
@@ -0,0 +1,155 @@
1<refentry id="vidioc-subdev-g-crop">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_G_CROP, VIDIOC_SUBDEV_S_CROP</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_G_CROP</refname>
9 <refname>VIDIOC_SUBDEV_S_CROP</refname>
10 <refpurpose>Get or set the crop rectangle on a subdev pad</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_subdev_crop *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 <funcsynopsis>
23 <funcprototype>
24 <funcdef>int <function>ioctl</function></funcdef>
25 <paramdef>int <parameter>fd</parameter></paramdef>
26 <paramdef>int <parameter>request</parameter></paramdef>
27 <paramdef>const struct v4l2_subdev_crop *<parameter>argp</parameter></paramdef>
28 </funcprototype>
29 </funcsynopsis>
30 </refsynopsisdiv>
31
32 <refsect1>
33 <title>Arguments</title>
34
35 <variablelist>
36 <varlistentry>
37 <term><parameter>fd</parameter></term>
38 <listitem>
39 <para>&fd;</para>
40 </listitem>
41 </varlistentry>
42 <varlistentry>
43 <term><parameter>request</parameter></term>
44 <listitem>
45 <para>VIDIOC_SUBDEV_G_CROP, VIDIOC_SUBDEV_S_CROP</para>
46 </listitem>
47 </varlistentry>
48 <varlistentry>
49 <term><parameter>argp</parameter></term>
50 <listitem>
51 <para></para>
52 </listitem>
53 </varlistentry>
54 </variablelist>
55 </refsect1>
56
57 <refsect1>
58 <title>Description</title>
59
60 <note>
61 <title>Experimental</title>
62 <para>This is an <link linkend="experimental">experimental</link>
63 interface and may change in the future.</para>
64 </note>
65
66 <para>To retrieve the current crop rectangle applications set the
67 <structfield>pad</structfield> field of a &v4l2-subdev-crop; to the
68 desired pad number as reported by the media API and the
69 <structfield>which</structfield> field to
70 <constant>V4L2_SUBDEV_FORMAT_ACTIVE</constant>. They then call the
71 <constant>VIDIOC_SUBDEV_G_CROP</constant> ioctl with a pointer to this
72 structure. The driver fills the members of the <structfield>rect</structfield>
73 field or returns &EINVAL; if the input arguments are invalid, or if cropping
74 is not supported on the given pad.</para>
75
76 <para>To change the current crop rectangle applications set both the
77 <structfield>pad</structfield> and <structfield>which</structfield> fields
78 and all members of the <structfield>rect</structfield> field. They then call
79 the <constant>VIDIOC_SUBDEV_S_CROP</constant> ioctl with a pointer to this
80 structure. The driver verifies the requested crop rectangle, adjusts it
81 based on the hardware capabilities and configures the device. Upon return
82 the &v4l2-subdev-crop; contains the current format as would be returned
83 by a <constant>VIDIOC_SUBDEV_G_CROP</constant> call.</para>
84
85 <para>Applications can query the device capabilities by setting the
86 <structfield>which</structfield> to
87 <constant>V4L2_SUBDEV_FORMAT_TRY</constant>. When set, 'try' crop
88 rectangles are not applied to the device by the driver, but are mangled
89 exactly as active crop rectangles and stored in the sub-device file handle.
90 Two applications querying the same sub-device would thus not interact with
91 each other.</para>
92
93 <para>Drivers must not return an error solely because the requested crop
94 rectangle doesn't match the device capabilities. They must instead modify
95 the rectangle to match what the hardware can provide. The modified format
96 should be as close as possible to the original request.</para>
97
98 <table pgwide="1" frame="none" id="v4l2-subdev-crop">
99 <title>struct <structname>v4l2_subdev_crop</structname></title>
100 <tgroup cols="3">
101 &cs-str;
102 <tbody valign="top">
103 <row>
104 <entry>__u32</entry>
105 <entry><structfield>pad</structfield></entry>
106 <entry>Pad number as reported by the media framework.</entry>
107 </row>
108 <row>
109 <entry>__u32</entry>
110 <entry><structfield>which</structfield></entry>
111 <entry>Crop rectangle to get or set, from
112 &v4l2-subdev-format-whence;.</entry>
113 </row>
114 <row>
115 <entry>&v4l2-rect;</entry>
116 <entry><structfield>rect</structfield></entry>
117 <entry>Crop rectangle boundaries, in pixels.</entry>
118 </row>
119 <row>
120 <entry>__u32</entry>
121 <entry><structfield>reserved</structfield>[8]</entry>
122 <entry>Reserved for future extensions. Applications and drivers must
123 set the array to zero.</entry>
124 </row>
125 </tbody>
126 </tgroup>
127 </table>
128 </refsect1>
129
130 <refsect1>
131 &return-value;
132
133 <variablelist>
134 <varlistentry>
135 <term><errorcode>EBUSY</errorcode></term>
136 <listitem>
137 <para>The crop rectangle can't be changed because the pad is currently
138 busy. This can be caused, for instance, by an active video stream on
139 the pad. The ioctl must not be retried without performing another
140 action to fix the problem first. Only returned by
141 <constant>VIDIOC_SUBDEV_S_CROP</constant></para>
142 </listitem>
143 </varlistentry>
144 <varlistentry>
145 <term><errorcode>EINVAL</errorcode></term>
146 <listitem>
147 <para>The &v4l2-subdev-crop; <structfield>pad</structfield>
148 references a non-existing pad, the <structfield>which</structfield>
149 field references a non-existing format, or cropping is not supported
150 on the given subdev pad.</para>
151 </listitem>
152 </varlistentry>
153 </variablelist>
154 </refsect1>
155</refentry>
diff --git a/Documentation/DocBook/v4l/vidioc-subdev-g-fmt.xml b/Documentation/DocBook/v4l/vidioc-subdev-g-fmt.xml
new file mode 100644
index 000000000000..f367c570c530
--- /dev/null
+++ b/Documentation/DocBook/v4l/vidioc-subdev-g-fmt.xml
@@ -0,0 +1,180 @@
1<refentry id="vidioc-subdev-g-fmt">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_G_FMT, VIDIOC_SUBDEV_S_FMT</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_G_FMT</refname>
9 <refname>VIDIOC_SUBDEV_S_FMT</refname>
10 <refpurpose>Get or set the data format on a subdev pad</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_subdev_format *<parameter>argp</parameter>
20 </paramdef>
21 </funcprototype>
22 </funcsynopsis>
23 </refsynopsisdiv>
24
25 <refsect1>
26 <title>Arguments</title>
27
28 <variablelist>
29 <varlistentry>
30 <term><parameter>fd</parameter></term>
31 <listitem>
32 <para>&fd;</para>
33 </listitem>
34 </varlistentry>
35 <varlistentry>
36 <term><parameter>request</parameter></term>
37 <listitem>
38 <para>VIDIOC_SUBDEV_G_FMT, VIDIOC_SUBDEV_S_FMT</para>
39 </listitem>
40 </varlistentry>
41 <varlistentry>
42 <term><parameter>argp</parameter></term>
43 <listitem>
44 <para></para>
45 </listitem>
46 </varlistentry>
47 </variablelist>
48 </refsect1>
49
50 <refsect1>
51 <title>Description</title>
52
53 <note>
54 <title>Experimental</title>
55 <para>This is an <link linkend="experimental">experimental</link>
56 interface and may change in the future.</para>
57 </note>
58
59 <para>These ioctls are used to negotiate the frame format at specific
60 subdev pads in the image pipeline.</para>
61
62 <para>To retrieve the current format applications set the
63 <structfield>pad</structfield> field of a &v4l2-subdev-format; to the
64 desired pad number as reported by the media API and the
65 <structfield>which</structfield> field to
66 <constant>V4L2_SUBDEV_FORMAT_ACTIVE</constant>. When they call the
67 <constant>VIDIOC_SUBDEV_G_FMT</constant> ioctl with a pointer to this
68 structure the driver fills the members of the <structfield>format</structfield>
69 field.</para>
70
71 <para>To change the current format applications set both the
72 <structfield>pad</structfield> and <structfield>which</structfield> fields
73 and all members of the <structfield>format</structfield> field. When they
74 call the <constant>VIDIOC_SUBDEV_S_FMT</constant> ioctl with a pointer to this
75 structure the driver verifies the requested format, adjusts it based on the
76 hardware capabilities and configures the device. Upon return the
77 &v4l2-subdev-format; contains the current format as would be returned by a
78 <constant>VIDIOC_SUBDEV_G_FMT</constant> call.</para>
79
80 <para>Applications can query the device capabilities by setting the
81 <structfield>which</structfield> to
82 <constant>V4L2_SUBDEV_FORMAT_TRY</constant>. When set, 'try' formats are not
83 applied to the device by the driver, but are changed exactly as active
84 formats and stored in the sub-device file handle. Two applications querying
85 the same sub-device would thus not interact with each other.</para>
86
87 <para>For instance, to try a format at the output pad of a sub-device,
88 applications would first set the try format at the sub-device input with the
89 <constant>VIDIOC_SUBDEV_S_FMT</constant> ioctl. They would then either
90 retrieve the default format at the output pad with the
91 <constant>VIDIOC_SUBDEV_G_FMT</constant> ioctl, or set the desired output
92 pad format with the <constant>VIDIOC_SUBDEV_S_FMT</constant> ioctl and check
93 the returned value.</para>
94
95 <para>Try formats do not depend on active formats, but can depend on the
96 current links configuration or sub-device controls value. For instance, a
97 low-pass noise filter might crop pixels at the frame boundaries, modifying
98 its output frame size.</para>
99
100 <para>Drivers must not return an error solely because the requested format
101 doesn't match the device capabilities. They must instead modify the format
102 to match what the hardware can provide. The modified format should be as
103 close as possible to the original request.</para>
104
105 <table pgwide="1" frame="none" id="v4l2-subdev-format">
106 <title>struct <structname>v4l2_subdev_format</structname></title>
107 <tgroup cols="3">
108 &cs-str;
109 <tbody valign="top">
110 <row>
111 <entry>__u32</entry>
112 <entry><structfield>pad</structfield></entry>
113 <entry>Pad number as reported by the media controller API.</entry>
114 </row>
115 <row>
116 <entry>__u32</entry>
117 <entry><structfield>which</structfield></entry>
118 <entry>Format to modified, from &v4l2-subdev-format-whence;.</entry>
119 </row>
120 <row>
121 <entry>&v4l2-mbus-framefmt;</entry>
122 <entry><structfield>format</structfield></entry>
123 <entry>Definition of an image format, see <xref
124 linkend="v4l2-mbus-framefmt" /> for details.</entry>
125 </row>
126 <row>
127 <entry>__u32</entry>
128 <entry><structfield>reserved</structfield>[8]</entry>
129 <entry>Reserved for future extensions. Applications and drivers must
130 set the array to zero.</entry>
131 </row>
132 </tbody>
133 </tgroup>
134 </table>
135
136 <table pgwide="1" frame="none" id="v4l2-subdev-format-whence">
137 <title>enum <structname>v4l2_subdev_format_whence</structname></title>
138 <tgroup cols="3">
139 &cs-def;
140 <tbody valign="top">
141 <row>
142 <entry>V4L2_SUBDEV_FORMAT_TRY</entry>
143 <entry>0</entry>
144 <entry>Try formats, used for querying device capabilities.</entry>
145 </row>
146 <row>
147 <entry>V4L2_SUBDEV_FORMAT_ACTIVE</entry>
148 <entry>1</entry>
149 <entry>Active formats, applied to the hardware.</entry>
150 </row>
151 </tbody>
152 </tgroup>
153 </table>
154 </refsect1>
155
156 <refsect1>
157 &return-value;
158
159 <variablelist>
160 <varlistentry>
161 <term><errorcode>EBUSY</errorcode></term>
162 <listitem>
163 <para>The format can't be changed because the pad is currently busy.
164 This can be caused, for instance, by an active video stream on the
165 pad. The ioctl must not be retried without performing another action
166 to fix the problem first. Only returned by
167 <constant>VIDIOC_SUBDEV_S_FMT</constant></para>
168 </listitem>
169 </varlistentry>
170 <varlistentry>
171 <term><errorcode>EINVAL</errorcode></term>
172 <listitem>
173 <para>The &v4l2-subdev-format; <structfield>pad</structfield>
174 references a non-existing pad, or the <structfield>which</structfield>
175 field references a non-existing format.</para>
176 </listitem>
177 </varlistentry>
178 </variablelist>
179 </refsect1>
180</refentry>
diff --git a/Documentation/DocBook/v4l/vidioc-subdev-g-frame-interval.xml b/Documentation/DocBook/v4l/vidioc-subdev-g-frame-interval.xml
new file mode 100644
index 000000000000..0bc3ea22d31f
--- /dev/null
+++ b/Documentation/DocBook/v4l/vidioc-subdev-g-frame-interval.xml
@@ -0,0 +1,141 @@
1<refentry id="vidioc-subdev-g-frame-interval">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_G_FRAME_INTERVAL</refname>
9 <refname>VIDIOC_SUBDEV_S_FRAME_INTERVAL</refname>
10 <refpurpose>Get or set the frame interval on a subdev pad</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_subdev_frame_interval *<parameter>argp</parameter>
20 </paramdef>
21 </funcprototype>
22 </funcsynopsis>
23 </refsynopsisdiv>
24
25 <refsect1>
26 <title>Arguments</title>
27
28 <variablelist>
29 <varlistentry>
30 <term><parameter>fd</parameter></term>
31 <listitem>
32 <para>&fd;</para>
33 </listitem>
34 </varlistentry>
35 <varlistentry>
36 <term><parameter>request</parameter></term>
37 <listitem>
38 <para>VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL</para>
39 </listitem>
40 </varlistentry>
41 <varlistentry>
42 <term><parameter>argp</parameter></term>
43 <listitem>
44 <para></para>
45 </listitem>
46 </varlistentry>
47 </variablelist>
48 </refsect1>
49
50 <refsect1>
51 <title>Description</title>
52
53 <note>
54 <title>Experimental</title>
55 <para>This is an <link linkend="experimental">experimental</link>
56 interface and may change in the future.</para>
57 </note>
58
59 <para>These ioctls are used to get and set the frame interval at specific
60 subdev pads in the image pipeline. The frame interval only makes sense for
61 sub-devices that can control the frame period on their own. This includes,
62 for instance, image sensors and TV tuners. Sub-devices that don't support
63 frame intervals must not implement these ioctls.</para>
64
65 <para>To retrieve the current frame interval applications set the
66 <structfield>pad</structfield> field of a &v4l2-subdev-frame-interval; to
67 the desired pad number as reported by the media controller API. When they
68 call the <constant>VIDIOC_SUBDEV_G_FRAME_INTERVAL</constant> ioctl with a
69 pointer to this structure the driver fills the members of the
70 <structfield>interval</structfield> field.</para>
71
72 <para>To change the current frame interval applications set both the
73 <structfield>pad</structfield> field and all members of the
74 <structfield>interval</structfield> field. When they call the
75 <constant>VIDIOC_SUBDEV_S_FRAME_INTERVAL</constant> ioctl with a pointer to
76 this structure the driver verifies the requested interval, adjusts it based
77 on the hardware capabilities and configures the device. Upon return the
78 &v4l2-subdev-frame-interval; contains the current frame interval as would be
79 returned by a <constant>VIDIOC_SUBDEV_G_FRAME_INTERVAL</constant> call.
80 </para>
81
82 <para>Drivers must not return an error solely because the requested interval
83 doesn't match the device capabilities. They must instead modify the interval
84 to match what the hardware can provide. The modified interval should be as
85 close as possible to the original request.</para>
86
87 <para>Sub-devices that support the frame interval ioctls should implement
88 them on a single pad only. Their behaviour when supported on multiple pads
89 of the same sub-device is not defined.</para>
90
91 <table pgwide="1" frame="none" id="v4l2-subdev-frame-interval">
92 <title>struct <structname>v4l2_subdev_frame_interval</structname></title>
93 <tgroup cols="3">
94 &cs-str;
95 <tbody valign="top">
96 <row>
97 <entry>__u32</entry>
98 <entry><structfield>pad</structfield></entry>
99 <entry>Pad number as reported by the media controller API.</entry>
100 </row>
101 <row>
102 <entry>&v4l2-fract;</entry>
103 <entry><structfield>interval</structfield></entry>
104 <entry>Period, in seconds, between consecutive video frames.</entry>
105 </row>
106 <row>
107 <entry>__u32</entry>
108 <entry><structfield>reserved</structfield>[9]</entry>
109 <entry>Reserved for future extensions. Applications and drivers must
110 set the array to zero.</entry>
111 </row>
112 </tbody>
113 </tgroup>
114 </table>
115 </refsect1>
116
117 <refsect1>
118 &return-value;
119
120 <variablelist>
121 <varlistentry>
122 <term><errorcode>EBUSY</errorcode></term>
123 <listitem>
124 <para>The frame interval can't be changed because the pad is currently
125 busy. This can be caused, for instance, by an active video stream on
126 the pad. The ioctl must not be retried without performing another
127 action to fix the problem first. Only returned by
128 <constant>VIDIOC_SUBDEV_S_FRAME_INTERVAL</constant></para>
129 </listitem>
130 </varlistentry>
131 <varlistentry>
132 <term><errorcode>EINVAL</errorcode></term>
133 <listitem>
134 <para>The &v4l2-subdev-frame-interval; <structfield>pad</structfield>
135 references a non-existing pad, or the pad doesn't support frame
136 intervals.</para>
137 </listitem>
138 </varlistentry>
139 </variablelist>
140 </refsect1>
141</refentry>
diff --git a/Documentation/DocBook/writing-an-alsa-driver.tmpl b/Documentation/DocBook/writing-an-alsa-driver.tmpl
index 0ba149de2608..58ced2346e67 100644
--- a/Documentation/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/DocBook/writing-an-alsa-driver.tmpl
@@ -4784,7 +4784,7 @@ struct _snd_pcm_runtime {
4784 FM registers can be directly accessed through the direct-FM API, 4784 FM registers can be directly accessed through the direct-FM API,
4785 defined in <filename>&lt;sound/asound_fm.h&gt;</filename>. In 4785 defined in <filename>&lt;sound/asound_fm.h&gt;</filename>. In
4786 ALSA native mode, FM registers are accessed through 4786 ALSA native mode, FM registers are accessed through
4787 the Hardware-Dependant Device direct-FM extension API, whereas in 4787 the Hardware-Dependent Device direct-FM extension API, whereas in
4788 OSS compatible mode, FM registers can be accessed with the OSS 4788 OSS compatible mode, FM registers can be accessed with the OSS
4789 direct-FM compatible API in <filename>/dev/dmfmX</filename> device. 4789 direct-FM compatible API in <filename>/dev/dmfmX</filename> device.
4790 </para> 4790 </para>
diff --git a/Documentation/HOWTO b/Documentation/HOWTO
index 365bda9a0d94..81bc1a9ab9d8 100644
--- a/Documentation/HOWTO
+++ b/Documentation/HOWTO
@@ -209,7 +209,7 @@ tools. One such tool that is particularly recommended is the Linux
209Cross-Reference project, which is able to present source code in a 209Cross-Reference project, which is able to present source code in a
210self-referential, indexed webpage format. An excellent up-to-date 210self-referential, indexed webpage format. An excellent up-to-date
211repository of the kernel code may be found at: 211repository of the kernel code may be found at:
212 http://users.sosdg.org/~qiyong/lxr/ 212 http://lxr.linux.no/+trees
213 213
214 214
215The development process 215The development process
diff --git a/Documentation/IPMI.txt b/Documentation/IPMI.txt
index 69dd29ed824e..b2bea15137d2 100644
--- a/Documentation/IPMI.txt
+++ b/Documentation/IPMI.txt
@@ -533,6 +533,33 @@ completion during sending a panic event.
533Other Pieces 533Other Pieces
534------------ 534------------
535 535
536Get the detailed info related with the IPMI device
537--------------------------------------------------
538
539Some users need more detailed information about a device, like where
540the address came from or the raw base device for the IPMI interface.
541You can use the IPMI smi_watcher to catch the IPMI interfaces as they
542come or go, and to grab the information, you can use the function
543ipmi_get_smi_info(), which returns the following structure:
544
545struct ipmi_smi_info {
546 enum ipmi_addr_src addr_src;
547 struct device *dev;
548 union {
549 struct {
550 void *acpi_handle;
551 } acpi_info;
552 } addr_info;
553};
554
555Currently special info for only for SI_ACPI address sources is
556returned. Others may be added as necessary.
557
558Note that the dev pointer is included in the above structure, and
559assuming ipmi_smi_get_info returns success, you must call put_device
560on the dev pointer.
561
562
536Watchdog 563Watchdog
537-------- 564--------
538 565
diff --git a/Documentation/IRQ-affinity.txt b/Documentation/IRQ-affinity.txt
index b4a615b78403..7890fae18529 100644
--- a/Documentation/IRQ-affinity.txt
+++ b/Documentation/IRQ-affinity.txt
@@ -4,10 +4,11 @@ ChangeLog:
4 4
5SMP IRQ affinity 5SMP IRQ affinity
6 6
7/proc/irq/IRQ#/smp_affinity specifies which target CPUs are permitted 7/proc/irq/IRQ#/smp_affinity and /proc/irq/IRQ#/smp_affinity_list specify
8for a given IRQ source. It's a bitmask of allowed CPUs. It's not allowed 8which target CPUs are permitted for a given IRQ source. It's a bitmask
9to turn off all CPUs, and if an IRQ controller does not support IRQ 9(smp_affinity) or cpu list (smp_affinity_list) of allowed CPUs. It's not
10affinity then the value will not change from the default 0xffffffff. 10allowed to turn off all CPUs, and if an IRQ controller does not support
11IRQ affinity then the value will not change from the default of all cpus.
11 12
12/proc/irq/default_smp_affinity specifies default affinity mask that applies 13/proc/irq/default_smp_affinity specifies default affinity mask that applies
13to all non-active IRQs. Once IRQ is allocated/activated its affinity bitmask 14to all non-active IRQs. Once IRQ is allocated/activated its affinity bitmask
@@ -54,3 +55,11 @@ round-trip min/avg/max = 0.1/0.5/585.4 ms
54This time around IRQ44 was delivered only to the last four processors. 55This time around IRQ44 was delivered only to the last four processors.
55i.e counters for the CPU0-3 did not change. 56i.e counters for the CPU0-3 did not change.
56 57
58Here is an example of limiting that same irq (44) to cpus 1024 to 1031:
59
60[root@moon 44]# echo 1024-1031 > smp_affinity
61[root@moon 44]# cat smp_affinity
621024-1031
63
64Note that to do this with a bitmask would require 32 bitmasks of zero
65to follow the pertinent one.
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 6fc7ea1d1f9d..9b4bc5c76f33 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1,3 +1,3 @@
1obj-m := DocBook/ accounting/ auxdisplay/ connector/ \ 1obj-m := DocBook/ accounting/ auxdisplay/ connector/ \
2 filesystems/ filesystems/configfs/ ia64/ laptops/ networking/ \ 2 filesystems/ filesystems/configfs/ ia64/ laptops/ networking/ \
3 pcmcia/ spi/ timers/ video4linux/ vm/ watchdog/src/ 3 pcmcia/ spi/ timers/ vm/ watchdog/src/
diff --git a/Documentation/PCI/MSI-HOWTO.txt b/Documentation/PCI/MSI-HOWTO.txt
index dcf7acc720e1..3f5e0b09bed5 100644
--- a/Documentation/PCI/MSI-HOWTO.txt
+++ b/Documentation/PCI/MSI-HOWTO.txt
@@ -253,8 +253,8 @@ In constrast, MSI is restricted to a maximum of 32 interrupts (and
253must be a power of two). In addition, the MSI interrupt vectors must 253must be a power of two). In addition, the MSI interrupt vectors must
254be allocated consecutively, so the system may not be able to allocate 254be allocated consecutively, so the system may not be able to allocate
255as many vectors for MSI as it could for MSI-X. On some platforms, MSI 255as many vectors for MSI as it could for MSI-X. On some platforms, MSI
256interrupts must all be targetted at the same set of CPUs whereas MSI-X 256interrupts must all be targeted at the same set of CPUs whereas MSI-X
257interrupts can all be targetted at different CPUs. 257interrupts can all be targeted at different CPUs.
258 258
2594.5.2 Spinlocks 2594.5.2 Spinlocks
260 260
diff --git a/Documentation/RCU/00-INDEX b/Documentation/RCU/00-INDEX
index 71b6f500ddb9..1d7a885761f5 100644
--- a/Documentation/RCU/00-INDEX
+++ b/Documentation/RCU/00-INDEX
@@ -21,7 +21,7 @@ rcu.txt
21RTFP.txt 21RTFP.txt
22 - List of RCU papers (bibliography) going back to 1980. 22 - List of RCU papers (bibliography) going back to 1980.
23stallwarn.txt 23stallwarn.txt
24 - RCU CPU stall warnings (CONFIG_RCU_CPU_STALL_DETECTOR) 24 - RCU CPU stall warnings (module parameter rcu_cpu_stall_suppress)
25torture.txt 25torture.txt
26 - RCU Torture Test Operation (CONFIG_RCU_TORTURE_TEST) 26 - RCU Torture Test Operation (CONFIG_RCU_TORTURE_TEST)
27trace.txt 27trace.txt
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt
index 790d1a812376..0c134f8afc6f 100644
--- a/Documentation/RCU/checklist.txt
+++ b/Documentation/RCU/checklist.txt
@@ -218,13 +218,22 @@ over a rather long period of time, but improvements are always welcome!
218 include: 218 include:
219 219
220 a. Keeping a count of the number of data-structure elements 220 a. Keeping a count of the number of data-structure elements
221 used by the RCU-protected data structure, including those 221 used by the RCU-protected data structure, including
222 waiting for a grace period to elapse. Enforce a limit 222 those waiting for a grace period to elapse. Enforce a
223 on this number, stalling updates as needed to allow 223 limit on this number, stalling updates as needed to allow
224 previously deferred frees to complete. 224 previously deferred frees to complete. Alternatively,
225 225 limit only the number awaiting deferred free rather than
226 Alternatively, limit only the number awaiting deferred 226 the total number of elements.
227 free rather than the total number of elements. 227
228 One way to stall the updates is to acquire the update-side
229 mutex. (Don't try this with a spinlock -- other CPUs
230 spinning on the lock could prevent the grace period
231 from ever ending.) Another way to stall the updates
232 is for the updates to use a wrapper function around
233 the memory allocator, so that this wrapper function
234 simulates OOM when there is too much memory awaiting an
235 RCU grace period. There are of course many other
236 variations on this theme.
228 237
229 b. Limiting update rate. For example, if updates occur only 238 b. Limiting update rate. For example, if updates occur only
230 once per hour, then no explicit rate limiting is required, 239 once per hour, then no explicit rate limiting is required,
@@ -365,3 +374,26 @@ over a rather long period of time, but improvements are always welcome!
365 and the compiler to freely reorder code into and out of RCU 374 and the compiler to freely reorder code into and out of RCU
366 read-side critical sections. It is the responsibility of the 375 read-side critical sections. It is the responsibility of the
367 RCU update-side primitives to deal with this. 376 RCU update-side primitives to deal with this.
377
37817. Use CONFIG_PROVE_RCU, CONFIG_DEBUG_OBJECTS_RCU_HEAD, and
379 the __rcu sparse checks to validate your RCU code. These
380 can help find problems as follows:
381
382 CONFIG_PROVE_RCU: check that accesses to RCU-protected data
383 structures are carried out under the proper RCU
384 read-side critical section, while holding the right
385 combination of locks, or whatever other conditions
386 are appropriate.
387
388 CONFIG_DEBUG_OBJECTS_RCU_HEAD: check that you don't pass the
389 same object to call_rcu() (or friends) before an RCU
390 grace period has elapsed since the last time that you
391 passed that same object to call_rcu() (or friends).
392
393 __rcu sparse checks: tag the pointer to the RCU-protected data
394 structure with __rcu, and sparse will warn you if you
395 access that pointer without the services of one of the
396 variants of rcu_dereference().
397
398 These debugging aids can help you find problems that are
399 otherwise extremely difficult to spot.
diff --git a/Documentation/RCU/stallwarn.txt b/Documentation/RCU/stallwarn.txt
index 44c6dcc93d6d..4e959208f736 100644
--- a/Documentation/RCU/stallwarn.txt
+++ b/Documentation/RCU/stallwarn.txt
@@ -1,22 +1,25 @@
1Using RCU's CPU Stall Detector 1Using RCU's CPU Stall Detector
2 2
3The CONFIG_RCU_CPU_STALL_DETECTOR kernel config parameter enables 3The rcu_cpu_stall_suppress module parameter enables RCU's CPU stall
4RCU's CPU stall detector, which detects conditions that unduly delay 4detector, which detects conditions that unduly delay RCU grace periods.
5RCU grace periods. The stall detector's idea of what constitutes 5This module parameter enables CPU stall detection by default, but
6"unduly delayed" is controlled by a set of C preprocessor macros: 6may be overridden via boot-time parameter or at runtime via sysfs.
7The stall detector's idea of what constitutes "unduly delayed" is
8controlled by a set of kernel configuration variables and cpp macros:
7 9
8RCU_SECONDS_TILL_STALL_CHECK 10CONFIG_RCU_CPU_STALL_TIMEOUT
9 11
10 This macro defines the period of time that RCU will wait from 12 This kernel configuration parameter defines the period of time
11 the beginning of a grace period until it issues an RCU CPU 13 that RCU will wait from the beginning of a grace period until it
12 stall warning. This time period is normally ten seconds. 14 issues an RCU CPU stall warning. This time period is normally
15 ten seconds.
13 16
14RCU_SECONDS_TILL_STALL_RECHECK 17RCU_SECONDS_TILL_STALL_RECHECK
15 18
16 This macro defines the period of time that RCU will wait after 19 This macro defines the period of time that RCU will wait after
17 issuing a stall warning until it issues another stall warning 20 issuing a stall warning until it issues another stall warning
18 for the same stall. This time period is normally set to thirty 21 for the same stall. This time period is normally set to three
19 seconds. 22 times the check interval plus thirty seconds.
20 23
21RCU_STALL_RAT_DELAY 24RCU_STALL_RAT_DELAY
22 25
@@ -80,6 +83,24 @@ o A CPU looping with bottom halves disabled. This condition can
80o For !CONFIG_PREEMPT kernels, a CPU looping anywhere in the kernel 83o For !CONFIG_PREEMPT kernels, a CPU looping anywhere in the kernel
81 without invoking schedule(). 84 without invoking schedule().
82 85
86o A CPU-bound real-time task in a CONFIG_PREEMPT kernel, which might
87 happen to preempt a low-priority task in the middle of an RCU
88 read-side critical section. This is especially damaging if
89 that low-priority task is not permitted to run on any other CPU,
90 in which case the next RCU grace period can never complete, which
91 will eventually cause the system to run out of memory and hang.
92 While the system is in the process of running itself out of
93 memory, you might see stall-warning messages.
94
95o A CPU-bound real-time task in a CONFIG_PREEMPT_RT kernel that
96 is running at a higher priority than the RCU softirq threads.
97 This will prevent RCU callbacks from ever being invoked,
98 and in a CONFIG_TREE_PREEMPT_RCU kernel will further prevent
99 RCU grace periods from ever completing. Either way, the
100 system will eventually run out of memory and hang. In the
101 CONFIG_TREE_PREEMPT_RCU case, you might see stall-warning
102 messages.
103
83o A bug in the RCU implementation. 104o A bug in the RCU implementation.
84 105
85o A hardware failure. This is quite unlikely, but has occurred 106o A hardware failure. This is quite unlikely, but has occurred
diff --git a/Documentation/RCU/trace.txt b/Documentation/RCU/trace.txt
index efd8cc95c06b..8173cec473aa 100644
--- a/Documentation/RCU/trace.txt
+++ b/Documentation/RCU/trace.txt
@@ -1,39 +1,55 @@
1CONFIG_RCU_TRACE debugfs Files and Formats 1CONFIG_RCU_TRACE debugfs Files and Formats
2 2
3 3
4The rcutree implementation of RCU provides debugfs trace output that 4The rcutree and rcutiny implementations of RCU provide debugfs trace
5summarizes counters and state. This information is useful for debugging 5output that summarizes counters and state. This information is useful for
6RCU itself, and can sometimes also help to debug abuses of RCU. 6debugging RCU itself, and can sometimes also help to debug abuses of RCU.
7The following sections describe the debugfs files and formats. 7The following sections describe the debugfs files and formats, first
8 8for rcutree and next for rcutiny.
9 9
10Hierarchical RCU debugfs Files and Formats 10
11 11CONFIG_TREE_RCU and CONFIG_TREE_PREEMPT_RCU debugfs Files and Formats
12This implementation of RCU provides three debugfs files under the 12
13top-level directory RCU: rcu/rcudata (which displays fields in struct 13These implementations of RCU provides several debugfs files under the
14rcu_data), rcu/rcugp (which displays grace-period counters), and 14top-level directory "rcu":
15rcu/rcuhier (which displays the struct rcu_node hierarchy). 15
16rcu/rcudata:
17 Displays fields in struct rcu_data.
18rcu/rcudata.csv:
19 Comma-separated values spreadsheet version of rcudata.
20rcu/rcugp:
21 Displays grace-period counters.
22rcu/rcuhier:
23 Displays the struct rcu_node hierarchy.
24rcu/rcu_pending:
25 Displays counts of the reasons rcu_pending() decided that RCU had
26 work to do.
27rcu/rcutorture:
28 Displays rcutorture test progress.
29rcu/rcuboost:
30 Displays RCU boosting statistics. Only present if
31 CONFIG_RCU_BOOST=y.
16 32
17The output of "cat rcu/rcudata" looks as follows: 33The output of "cat rcu/rcudata" looks as follows:
18 34
19rcu_sched: 35rcu_sched:
20 0 c=17829 g=17829 pq=1 pqc=17829 qp=0 dt=10951/1 dn=0 df=1101 of=0 ri=36 ql=0 b=10 36 0 c=20972 g=20973 pq=1 pqc=20972 qp=0 dt=545/1/0 df=50 of=0 ri=0 ql=163 qs=NRW. kt=0/W/0 ktl=ebc3 b=10 ci=153737 co=0 ca=0
21 1 c=17829 g=17829 pq=1 pqc=17829 qp=0 dt=16117/1 dn=0 df=1015 of=0 ri=0 ql=0 b=10 37 1 c=20972 g=20973 pq=1 pqc=20972 qp=0 dt=967/1/0 df=58 of=0 ri=0 ql=634 qs=NRW. kt=0/W/1 ktl=58c b=10 ci=191037 co=0 ca=0
22 2 c=17829 g=17829 pq=1 pqc=17829 qp=0 dt=1445/1 dn=0 df=1839 of=0 ri=0 ql=0 b=10 38 2 c=20972 g=20973 pq=1 pqc=20972 qp=0 dt=1081/1/0 df=175 of=0 ri=0 ql=74 qs=N.W. kt=0/W/2 ktl=da94 b=10 ci=75991 co=0 ca=0
23 3 c=17829 g=17829 pq=1 pqc=17829 qp=0 dt=6681/1 dn=0 df=1545 of=0 ri=0 ql=0 b=10 39 3 c=20942 g=20943 pq=1 pqc=20942 qp=1 dt=1846/0/0 df=404 of=0 ri=0 ql=0 qs=.... kt=0/W/3 ktl=d1cd b=10 ci=72261 co=0 ca=0
24 4 c=17829 g=17829 pq=1 pqc=17829 qp=0 dt=1003/1 dn=0 df=1992 of=0 ri=0 ql=0 b=10 40 4 c=20972 g=20973 pq=1 pqc=20972 qp=0 dt=369/1/0 df=83 of=0 ri=0 ql=48 qs=N.W. kt=0/W/4 ktl=e0e7 b=10 ci=128365 co=0 ca=0
25 5 c=17829 g=17830 pq=1 pqc=17829 qp=1 dt=3887/1 dn=0 df=3331 of=0 ri=4 ql=2 b=10 41 5 c=20972 g=20973 pq=1 pqc=20972 qp=0 dt=381/1/0 df=64 of=0 ri=0 ql=169 qs=NRW. kt=0/W/5 ktl=fb2f b=10 ci=164360 co=0 ca=0
26 6 c=17829 g=17829 pq=1 pqc=17829 qp=0 dt=859/1 dn=0 df=3224 of=0 ri=0 ql=0 b=10 42 6 c=20972 g=20973 pq=1 pqc=20972 qp=0 dt=1037/1/0 df=183 of=0 ri=0 ql=62 qs=N.W. kt=0/W/6 ktl=d2ad b=10 ci=65663 co=0 ca=0
27 7 c=17829 g=17830 pq=0 pqc=17829 qp=1 dt=3761/1 dn=0 df=1818 of=0 ri=0 ql=2 b=10 43 7 c=20897 g=20897 pq=1 pqc=20896 qp=0 dt=1572/0/0 df=382 of=0 ri=0 ql=0 qs=.... kt=0/W/7 ktl=cf15 b=10 ci=75006 co=0 ca=0
28rcu_bh: 44rcu_bh:
29 0 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=10951/1 dn=0 df=0 of=0 ri=0 ql=0 b=10 45 0 c=1480 g=1480 pq=1 pqc=1479 qp=0 dt=545/1/0 df=6 of=0 ri=1 ql=0 qs=.... kt=0/W/0 ktl=ebc3 b=10 ci=0 co=0 ca=0
30 1 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=16117/1 dn=0 df=13 of=0 ri=0 ql=0 b=10 46 1 c=1480 g=1480 pq=1 pqc=1479 qp=0 dt=967/1/0 df=3 of=0 ri=1 ql=0 qs=.... kt=0/W/1 ktl=58c b=10 ci=151 co=0 ca=0
31 2 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=1445/1 dn=0 df=15 of=0 ri=0 ql=0 b=10 47 2 c=1480 g=1480 pq=1 pqc=1479 qp=0 dt=1081/1/0 df=6 of=0 ri=1 ql=0 qs=.... kt=0/W/2 ktl=da94 b=10 ci=0 co=0 ca=0
32 3 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=6681/1 dn=0 df=9 of=0 ri=0 ql=0 b=10 48 3 c=1480 g=1480 pq=1 pqc=1479 qp=0 dt=1846/0/0 df=8 of=0 ri=1 ql=0 qs=.... kt=0/W/3 ktl=d1cd b=10 ci=0 co=0 ca=0
33 4 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=1003/1 dn=0 df=15 of=0 ri=0 ql=0 b=10 49 4 c=1480 g=1480 pq=1 pqc=1479 qp=0 dt=369/1/0 df=6 of=0 ri=1 ql=0 qs=.... kt=0/W/4 ktl=e0e7 b=10 ci=0 co=0 ca=0
34 5 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=3887/1 dn=0 df=15 of=0 ri=0 ql=0 b=10 50 5 c=1480 g=1480 pq=1 pqc=1479 qp=0 dt=381/1/0 df=4 of=0 ri=1 ql=0 qs=.... kt=0/W/5 ktl=fb2f b=10 ci=0 co=0 ca=0
35 6 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=859/1 dn=0 df=15 of=0 ri=0 ql=0 b=10 51 6 c=1480 g=1480 pq=1 pqc=1479 qp=0 dt=1037/1/0 df=6 of=0 ri=1 ql=0 qs=.... kt=0/W/6 ktl=d2ad b=10 ci=0 co=0 ca=0
36 7 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=3761/1 dn=0 df=15 of=0 ri=0 ql=0 b=10 52 7 c=1474 g=1474 pq=1 pqc=1473 qp=0 dt=1572/0/0 df=8 of=0 ri=1 ql=0 qs=.... kt=0/W/7 ktl=cf15 b=10 ci=0 co=0 ca=0
37 53
38The first section lists the rcu_data structures for rcu_sched, the second 54The first section lists the rcu_data structures for rcu_sched, the second
39for rcu_bh. Note that CONFIG_TREE_PREEMPT_RCU kernels will have an 55for rcu_bh. Note that CONFIG_TREE_PREEMPT_RCU kernels will have an
@@ -48,17 +64,18 @@ o The number at the beginning of each line is the CPU number.
48 substantially larger than the number of actual CPUs. 64 substantially larger than the number of actual CPUs.
49 65
50o "c" is the count of grace periods that this CPU believes have 66o "c" is the count of grace periods that this CPU believes have
51 completed. CPUs in dynticks idle mode may lag quite a ways 67 completed. Offlined CPUs and CPUs in dynticks idle mode may
52 behind, for example, CPU 4 under "rcu_sched" above, which has 68 lag quite a ways behind, for example, CPU 6 under "rcu_sched"
53 slept through the past 25 RCU grace periods. It is not unusual 69 above, which has been offline through not quite 40,000 RCU grace
54 to see CPUs lagging by thousands of grace periods. 70 periods. It is not unusual to see CPUs lagging by thousands of
71 grace periods.
55 72
56o "g" is the count of grace periods that this CPU believes have 73o "g" is the count of grace periods that this CPU believes have
57 started. Again, CPUs in dynticks idle mode may lag behind. 74 started. Again, offlined CPUs and CPUs in dynticks idle mode
58 If the "c" and "g" values are equal, this CPU has already 75 may lag behind. If the "c" and "g" values are equal, this CPU
59 reported a quiescent state for the last RCU grace period that 76 has already reported a quiescent state for the last RCU grace
60 it is aware of, otherwise, the CPU believes that it owes RCU a 77 period that it is aware of, otherwise, the CPU believes that it
61 quiescent state. 78 owes RCU a quiescent state.
62 79
63o "pq" indicates that this CPU has passed through a quiescent state 80o "pq" indicates that this CPU has passed through a quiescent state
64 for the current grace period. It is possible for "pq" to be 81 for the current grace period. It is possible for "pq" to be
@@ -77,22 +94,16 @@ o "pqc" indicates which grace period the last-observed quiescent
77 the next grace period! 94 the next grace period!
78 95
79o "qp" indicates that RCU still expects a quiescent state from 96o "qp" indicates that RCU still expects a quiescent state from
80 this CPU. 97 this CPU. Offlined CPUs and CPUs in dyntick idle mode might
98 well have qp=1, which is OK: RCU is still ignoring them.
81 99
82o "dt" is the current value of the dyntick counter that is incremented 100o "dt" is the current value of the dyntick counter that is incremented
83 when entering or leaving dynticks idle state, either by the 101 when entering or leaving dynticks idle state, either by the
84 scheduler or by irq. The number after the "/" is the interrupt 102 scheduler or by irq. This number is even if the CPU is in
85 nesting depth when in dyntick-idle state, or one greater than 103 dyntick idle mode and odd otherwise. The number after the first
86 the interrupt-nesting depth otherwise. 104 "/" is the interrupt nesting depth when in dyntick-idle state,
87 105 or one greater than the interrupt-nesting depth otherwise.
88 This field is displayed only for CONFIG_NO_HZ kernels. 106 The number after the second "/" is the NMI nesting depth.
89
90o "dn" is the current value of the dyntick counter that is incremented
91 when entering or leaving dynticks idle state via NMI. If both
92 the "dt" and "dn" values are even, then this CPU is in dynticks
93 idle mode and may be ignored by RCU. If either of these two
94 counters is odd, then RCU must be alert to the possibility of
95 an RCU read-side critical section running on this CPU.
96 107
97 This field is displayed only for CONFIG_NO_HZ kernels. 108 This field is displayed only for CONFIG_NO_HZ kernels.
98 109
@@ -104,7 +115,7 @@ o "df" is the number of times that some other CPU has forced a
104 115
105o "of" is the number of times that some other CPU has forced a 116o "of" is the number of times that some other CPU has forced a
106 quiescent state on behalf of this CPU due to this CPU being 117 quiescent state on behalf of this CPU due to this CPU being
107 offline. In a perfect world, this might neve happen, but it 118 offline. In a perfect world, this might never happen, but it
108 turns out that offlining and onlining a CPU can take several grace 119 turns out that offlining and onlining a CPU can take several grace
109 periods, and so there is likely to be an extended period of time 120 periods, and so there is likely to be an extended period of time
110 when RCU believes that the CPU is online when it really is not. 121 when RCU believes that the CPU is online when it really is not.
@@ -121,10 +132,78 @@ o "ql" is the number of RCU callbacks currently residing on
121 of what state they are in (new, waiting for grace period to 132 of what state they are in (new, waiting for grace period to
122 start, waiting for grace period to end, ready to invoke). 133 start, waiting for grace period to end, ready to invoke).
123 134
135o "qs" gives an indication of the state of the callback queue
136 with four characters:
137
138 "N" Indicates that there are callbacks queued that are not
139 ready to be handled by the next grace period, and thus
140 will be handled by the grace period following the next
141 one.
142
143 "R" Indicates that there are callbacks queued that are
144 ready to be handled by the next grace period.
145
146 "W" Indicates that there are callbacks queued that are
147 waiting on the current grace period.
148
149 "D" Indicates that there are callbacks queued that have
150 already been handled by a prior grace period, and are
151 thus waiting to be invoked. Note that callbacks in
152 the process of being invoked are not counted here.
153 Callbacks in the process of being invoked are those
154 that have been removed from the rcu_data structures
155 queues by rcu_do_batch(), but which have not yet been
156 invoked.
157
158 If there are no callbacks in a given one of the above states,
159 the corresponding character is replaced by ".".
160
161o "kt" is the per-CPU kernel-thread state. The digit preceding
162 the first slash is zero if there is no work pending and 1
163 otherwise. The character between the first pair of slashes is
164 as follows:
165
166 "S" The kernel thread is stopped, in other words, all
167 CPUs corresponding to this rcu_node structure are
168 offline.
169
170 "R" The kernel thread is running.
171
172 "W" The kernel thread is waiting because there is no work
173 for it to do.
174
175 "O" The kernel thread is waiting because it has been
176 forced off of its designated CPU or because its
177 ->cpus_allowed mask permits it to run on other than
178 its designated CPU.
179
180 "Y" The kernel thread is yielding to avoid hogging CPU.
181
182 "?" Unknown value, indicates a bug.
183
184 The number after the final slash is the CPU that the kthread
185 is actually running on.
186
187o "ktl" is the low-order 16 bits (in hexadecimal) of the count of
188 the number of times that this CPU's per-CPU kthread has gone
189 through its loop servicing invoke_rcu_cpu_kthread() requests.
190
124o "b" is the batch limit for this CPU. If more than this number 191o "b" is the batch limit for this CPU. If more than this number
125 of RCU callbacks is ready to invoke, then the remainder will 192 of RCU callbacks is ready to invoke, then the remainder will
126 be deferred. 193 be deferred.
127 194
195o "ci" is the number of RCU callbacks that have been invoked for
196 this CPU. Note that ci+ql is the number of callbacks that have
197 been registered in absence of CPU-hotplug activity.
198
199o "co" is the number of RCU callbacks that have been orphaned due to
200 this CPU going offline. These orphaned callbacks have been moved
201 to an arbitrarily chosen online CPU.
202
203o "ca" is the number of RCU callbacks that have been adopted due to
204 other CPUs going offline. Note that ci+co-ca+ql is the number of
205 RCU callbacks registered on this CPU.
206
128There is also an rcu/rcudata.csv file with the same information in 207There is also an rcu/rcudata.csv file with the same information in
129comma-separated-variable spreadsheet format. 208comma-separated-variable spreadsheet format.
130 209
@@ -157,15 +236,15 @@ o "gpnum" is the number of grace periods that have started. It is
157 236
158The output of "cat rcu/rcuhier" looks as follows, with very long lines: 237The output of "cat rcu/rcuhier" looks as follows, with very long lines:
159 238
160c=6902 g=6903 s=2 jfq=3 j=72c7 nfqs=13142/nfqsng=0(13142) fqlh=6 oqlen=0 239c=6902 g=6903 s=2 jfq=3 j=72c7 nfqs=13142/nfqsng=0(13142) fqlh=6
1611/1 .>. 0:127 ^0 2401/1 ..>. 0:127 ^0
1623/3 .>. 0:35 ^0 0/0 .>. 36:71 ^1 0/0 .>. 72:107 ^2 0/0 .>. 108:127 ^3 2413/3 ..>. 0:35 ^0 0/0 ..>. 36:71 ^1 0/0 ..>. 72:107 ^2 0/0 ..>. 108:127 ^3
1633/3f .>. 0:5 ^0 2/3 .>. 6:11 ^1 0/0 .>. 12:17 ^2 0/0 .>. 18:23 ^3 0/0 .>. 24:29 ^4 0/0 .>. 30:35 ^5 0/0 .>. 36:41 ^0 0/0 .>. 42:47 ^1 0/0 .>. 48:53 ^2 0/0 .>. 54:59 ^3 0/0 .>. 60:65 ^4 0/0 .>. 66:71 ^5 0/0 .>. 72:77 ^0 0/0 .>. 78:83 ^1 0/0 .>. 84:89 ^2 0/0 .>. 90:95 ^3 0/0 .>. 96:101 ^4 0/0 .>. 102:107 ^5 0/0 .>. 108:113 ^0 0/0 .>. 114:119 ^1 0/0 .>. 120:125 ^2 0/0 .>. 126:127 ^3 2423/3f ..>. 0:5 ^0 2/3 ..>. 6:11 ^1 0/0 ..>. 12:17 ^2 0/0 ..>. 18:23 ^3 0/0 ..>. 24:29 ^4 0/0 ..>. 30:35 ^5 0/0 ..>. 36:41 ^0 0/0 ..>. 42:47 ^1 0/0 ..>. 48:53 ^2 0/0 ..>. 54:59 ^3 0/0 ..>. 60:65 ^4 0/0 ..>. 66:71 ^5 0/0 ..>. 72:77 ^0 0/0 ..>. 78:83 ^1 0/0 ..>. 84:89 ^2 0/0 ..>. 90:95 ^3 0/0 ..>. 96:101 ^4 0/0 ..>. 102:107 ^5 0/0 ..>. 108:113 ^0 0/0 ..>. 114:119 ^1 0/0 ..>. 120:125 ^2 0/0 ..>. 126:127 ^3
164rcu_bh: 243rcu_bh:
165c=-226 g=-226 s=1 jfq=-5701 j=72c7 nfqs=88/nfqsng=0(88) fqlh=0 oqlen=0 244c=-226 g=-226 s=1 jfq=-5701 j=72c7 nfqs=88/nfqsng=0(88) fqlh=0
1660/1 .>. 0:127 ^0 2450/1 ..>. 0:127 ^0
1670/3 .>. 0:35 ^0 0/0 .>. 36:71 ^1 0/0 .>. 72:107 ^2 0/0 .>. 108:127 ^3 2460/3 ..>. 0:35 ^0 0/0 ..>. 36:71 ^1 0/0 ..>. 72:107 ^2 0/0 ..>. 108:127 ^3
1680/3f .>. 0:5 ^0 0/3 .>. 6:11 ^1 0/0 .>. 12:17 ^2 0/0 .>. 18:23 ^3 0/0 .>. 24:29 ^4 0/0 .>. 30:35 ^5 0/0 .>. 36:41 ^0 0/0 .>. 42:47 ^1 0/0 .>. 48:53 ^2 0/0 .>. 54:59 ^3 0/0 .>. 60:65 ^4 0/0 .>. 66:71 ^5 0/0 .>. 72:77 ^0 0/0 .>. 78:83 ^1 0/0 .>. 84:89 ^2 0/0 .>. 90:95 ^3 0/0 .>. 96:101 ^4 0/0 .>. 102:107 ^5 0/0 .>. 108:113 ^0 0/0 .>. 114:119 ^1 0/0 .>. 120:125 ^2 0/0 .>. 126:127 ^3 2470/3f ..>. 0:5 ^0 0/3 ..>. 6:11 ^1 0/0 ..>. 12:17 ^2 0/0 ..>. 18:23 ^3 0/0 ..>. 24:29 ^4 0/0 ..>. 30:35 ^5 0/0 ..>. 36:41 ^0 0/0 ..>. 42:47 ^1 0/0 ..>. 48:53 ^2 0/0 ..>. 54:59 ^3 0/0 ..>. 60:65 ^4 0/0 ..>. 66:71 ^5 0/0 ..>. 72:77 ^0 0/0 ..>. 78:83 ^1 0/0 ..>. 84:89 ^2 0/0 ..>. 90:95 ^3 0/0 ..>. 96:101 ^4 0/0 ..>. 102:107 ^5 0/0 ..>. 108:113 ^0 0/0 ..>. 114:119 ^1 0/0 ..>. 120:125 ^2 0/0 ..>. 126:127 ^3
169 248
170This is once again split into "rcu_sched" and "rcu_bh" portions, 249This is once again split into "rcu_sched" and "rcu_bh" portions,
171and CONFIG_TREE_PREEMPT_RCU kernels will again have an additional 250and CONFIG_TREE_PREEMPT_RCU kernels will again have an additional
@@ -180,7 +259,7 @@ o "s" is the "signaled" state that drives force_quiescent_state()'s
180 259
181o "jfq" is the number of jiffies remaining for this grace period 260o "jfq" is the number of jiffies remaining for this grace period
182 before force_quiescent_state() is invoked to help push things 261 before force_quiescent_state() is invoked to help push things
183 along. Note that CPUs in dyntick-idle mode thoughout the grace 262 along. Note that CPUs in dyntick-idle mode throughout the grace
184 period will not report on their own, but rather must be check by 263 period will not report on their own, but rather must be check by
185 some other CPU via force_quiescent_state(). 264 some other CPU via force_quiescent_state().
186 265
@@ -201,11 +280,6 @@ o "fqlh" is the number of calls to force_quiescent_state() that
201 exited immediately (without even being counted in nfqs above) 280 exited immediately (without even being counted in nfqs above)
202 due to contention on ->fqslock. 281 due to contention on ->fqslock.
203 282
204o "oqlen" is the number of callbacks on the "orphan" callback
205 list. RCU callbacks are placed on this list by CPUs going
206 offline, and are "adopted" either by the CPU helping the outgoing
207 CPU or by the next rcu_barrier*() call, whichever comes first.
208
209o Each element of the form "1/1 0:127 ^0" represents one struct 283o Each element of the form "1/1 0:127 ^0" represents one struct
210 rcu_node. Each line represents one level of the hierarchy, from 284 rcu_node. Each line represents one level of the hierarchy, from
211 root to leaves. It is best to think of the rcu_data structures 285 root to leaves. It is best to think of the rcu_data structures
@@ -229,13 +303,20 @@ o Each element of the form "1/1 0:127 ^0" represents one struct
229 current grace period. 303 current grace period.
230 304
231 o The characters separated by the ">" indicate the state 305 o The characters separated by the ">" indicate the state
232 of the blocked-tasks lists. A "T" preceding the ">" 306 of the blocked-tasks lists. A "G" preceding the ">"
233 indicates that at least one task blocked in an RCU 307 indicates that at least one task blocked in an RCU
234 read-side critical section blocks the current grace 308 read-side critical section blocks the current grace
235 period, while a "." preceding the ">" indicates otherwise. 309 period, while a "E" preceding the ">" indicates that
236 The character following the ">" indicates similarly for 310 at least one task blocked in an RCU read-side critical
237 the next grace period. A "T" should appear in this 311 section blocks the current expedited grace period.
238 field only for rcu-preempt. 312 A "T" character following the ">" indicates that at
313 least one task is blocked within an RCU read-side
314 critical section, regardless of whether any current
315 grace period (expedited or normal) is inconvenienced.
316 A "." character appears if the corresponding condition
317 does not hold, so that "..>." indicates that no tasks
318 are blocked. In contrast, "GE>T" indicates maximal
319 inconvenience from blocked tasks.
239 320
240 o The numbers separated by the ":" are the range of CPUs 321 o The numbers separated by the ":" are the range of CPUs
241 served by this struct rcu_node. This can be helpful 322 served by this struct rcu_node. This can be helpful
@@ -315,3 +396,222 @@ o "nn" is the number of times that this CPU needed nothing. Alert
315 readers will note that the rcu "nn" number for a given CPU very 396 readers will note that the rcu "nn" number for a given CPU very
316 closely matches the rcu_bh "np" number for that same CPU. This 397 closely matches the rcu_bh "np" number for that same CPU. This
317 is due to short-circuit evaluation in rcu_pending(). 398 is due to short-circuit evaluation in rcu_pending().
399
400
401The output of "cat rcu/rcutorture" looks as follows:
402
403rcutorture test sequence: 0 (test in progress)
404rcutorture update version number: 615
405
406The first line shows the number of rcutorture tests that have completed
407since boot. If a test is currently running, the "(test in progress)"
408string will appear as shown above. The second line shows the number of
409update cycles that the current test has started, or zero if there is
410no test in progress.
411
412
413The output of "cat rcu/rcuboost" looks as follows:
414
4150:5 tasks=.... kt=W ntb=0 neb=0 nnb=0 j=2f95 bt=300f
416 balk: nt=0 egt=989 bt=0 nb=0 ny=0 nos=16
4176:7 tasks=.... kt=W ntb=0 neb=0 nnb=0 j=2f95 bt=300f
418 balk: nt=0 egt=225 bt=0 nb=0 ny=0 nos=6
419
420This information is output only for rcu_preempt. Each two-line entry
421corresponds to a leaf rcu_node strcuture. The fields are as follows:
422
423o "n:m" is the CPU-number range for the corresponding two-line
424 entry. In the sample output above, the first entry covers
425 CPUs zero through five and the second entry covers CPUs 6
426 and 7.
427
428o "tasks=TNEB" gives the state of the various segments of the
429 rnp->blocked_tasks list:
430
431 "T" This indicates that there are some tasks that blocked
432 while running on one of the corresponding CPUs while
433 in an RCU read-side critical section.
434
435 "N" This indicates that some of the blocked tasks are preventing
436 the current normal (non-expedited) grace period from
437 completing.
438
439 "E" This indicates that some of the blocked tasks are preventing
440 the current expedited grace period from completing.
441
442 "B" This indicates that some of the blocked tasks are in
443 need of RCU priority boosting.
444
445 Each character is replaced with "." if the corresponding
446 condition does not hold.
447
448o "kt" is the state of the RCU priority-boosting kernel
449 thread associated with the corresponding rcu_node structure.
450 The state can be one of the following:
451
452 "S" The kernel thread is stopped, in other words, all
453 CPUs corresponding to this rcu_node structure are
454 offline.
455
456 "R" The kernel thread is running.
457
458 "W" The kernel thread is waiting because there is no work
459 for it to do.
460
461 "Y" The kernel thread is yielding to avoid hogging CPU.
462
463 "?" Unknown value, indicates a bug.
464
465o "ntb" is the number of tasks boosted.
466
467o "neb" is the number of tasks boosted in order to complete an
468 expedited grace period.
469
470o "nnb" is the number of tasks boosted in order to complete a
471 normal (non-expedited) grace period. When boosting a task
472 that was blocking both an expedited and a normal grace period,
473 it is counted against the expedited total above.
474
475o "j" is the low-order 16 bits of the jiffies counter in
476 hexadecimal.
477
478o "bt" is the low-order 16 bits of the value that the jiffies
479 counter will have when we next start boosting, assuming that
480 the current grace period does not end beforehand. This is
481 also in hexadecimal.
482
483o "balk: nt" counts the number of times we didn't boost (in
484 other words, we balked) even though it was time to boost because
485 there were no blocked tasks to boost. This situation occurs
486 when there is one blocked task on one rcu_node structure and
487 none on some other rcu_node structure.
488
489o "egt" counts the number of times we balked because although
490 there were blocked tasks, none of them were blocking the
491 current grace period, whether expedited or otherwise.
492
493o "bt" counts the number of times we balked because boosting
494 had already been initiated for the current grace period.
495
496o "nb" counts the number of times we balked because there
497 was at least one task blocking the current non-expedited grace
498 period that never had blocked. If it is already running, it
499 just won't help to boost its priority!
500
501o "ny" counts the number of times we balked because it was
502 not yet time to start boosting.
503
504o "nos" counts the number of times we balked for other
505 reasons, e.g., the grace period ended first.
506
507
508CONFIG_TINY_RCU and CONFIG_TINY_PREEMPT_RCU debugfs Files and Formats
509
510These implementations of RCU provides a single debugfs file under the
511top-level directory RCU, namely rcu/rcudata, which displays fields in
512rcu_bh_ctrlblk, rcu_sched_ctrlblk and, for CONFIG_TINY_PREEMPT_RCU,
513rcu_preempt_ctrlblk.
514
515The output of "cat rcu/rcudata" is as follows:
516
517rcu_preempt: qlen=24 gp=1097669 g197/p197/c197 tasks=...
518 ttb=. btg=no ntb=184 neb=0 nnb=183 j=01f7 bt=0274
519 normal balk: nt=1097669 gt=0 bt=371 b=0 ny=25073378 nos=0
520 exp balk: bt=0 nos=0
521rcu_sched: qlen: 0
522rcu_bh: qlen: 0
523
524This is split into rcu_preempt, rcu_sched, and rcu_bh sections, with the
525rcu_preempt section appearing only in CONFIG_TINY_PREEMPT_RCU builds.
526The last three lines of the rcu_preempt section appear only in
527CONFIG_RCU_BOOST kernel builds. The fields are as follows:
528
529o "qlen" is the number of RCU callbacks currently waiting either
530 for an RCU grace period or waiting to be invoked. This is the
531 only field present for rcu_sched and rcu_bh, due to the
532 short-circuiting of grace period in those two cases.
533
534o "gp" is the number of grace periods that have completed.
535
536o "g197/p197/c197" displays the grace-period state, with the
537 "g" number being the number of grace periods that have started
538 (mod 256), the "p" number being the number of grace periods
539 that the CPU has responded to (also mod 256), and the "c"
540 number being the number of grace periods that have completed
541 (once again mode 256).
542
543 Why have both "gp" and "g"? Because the data flowing into
544 "gp" is only present in a CONFIG_RCU_TRACE kernel.
545
546o "tasks" is a set of bits. The first bit is "T" if there are
547 currently tasks that have recently blocked within an RCU
548 read-side critical section, the second bit is "N" if any of the
549 aforementioned tasks are blocking the current RCU grace period,
550 and the third bit is "E" if any of the aforementioned tasks are
551 blocking the current expedited grace period. Each bit is "."
552 if the corresponding condition does not hold.
553
554o "ttb" is a single bit. It is "B" if any of the blocked tasks
555 need to be priority boosted and "." otherwise.
556
557o "btg" indicates whether boosting has been carried out during
558 the current grace period, with "exp" indicating that boosting
559 is in progress for an expedited grace period, "no" indicating
560 that boosting has not yet started for a normal grace period,
561 "begun" indicating that boosting has bebug for a normal grace
562 period, and "done" indicating that boosting has completed for
563 a normal grace period.
564
565o "ntb" is the total number of tasks subjected to RCU priority boosting
566 periods since boot.
567
568o "neb" is the number of expedited grace periods that have had
569 to resort to RCU priority boosting since boot.
570
571o "nnb" is the number of normal grace periods that have had
572 to resort to RCU priority boosting since boot.
573
574o "j" is the low-order 16 bits of the jiffies counter in hexadecimal.
575
576o "bt" is the low-order 16 bits of the value that the jiffies counter
577 will have at the next time that boosting is scheduled to begin.
578
579o In the line beginning with "normal balk", the fields are as follows:
580
581 o "nt" is the number of times that the system balked from
582 boosting because there were no blocked tasks to boost.
583 Note that the system will balk from boosting even if the
584 grace period is overdue when the currently running task
585 is looping within an RCU read-side critical section.
586 There is no point in boosting in this case, because
587 boosting a running task won't make it run any faster.
588
589 o "gt" is the number of times that the system balked
590 from boosting because, although there were blocked tasks,
591 none of them were preventing the current grace period
592 from completing.
593
594 o "bt" is the number of times that the system balked
595 from boosting because boosting was already in progress.
596
597 o "b" is the number of times that the system balked from
598 boosting because boosting had already completed for
599 the grace period in question.
600
601 o "ny" is the number of times that the system balked from
602 boosting because it was not yet time to start boosting
603 the grace period in question.
604
605 o "nos" is the number of times that the system balked from
606 boosting for inexplicable ("not otherwise specified")
607 reasons. This can actually happen due to races involving
608 increments of the jiffies counter.
609
610o In the line beginning with "exp balk", the fields are as follows:
611
612 o "bt" is the number of times that the system balked from
613 boosting because there were no blocked tasks to boost.
614
615 o "nos" is the number of times that the system balked from
616 boosting for inexplicable ("not otherwise specified")
617 reasons.
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt
index cfaac34c4557..6ef692667e2f 100644
--- a/Documentation/RCU/whatisRCU.txt
+++ b/Documentation/RCU/whatisRCU.txt
@@ -849,6 +849,37 @@ All: lockdep-checked RCU-protected pointer access
849See the comment headers in the source code (or the docbook generated 849See the comment headers in the source code (or the docbook generated
850from them) for more information. 850from them) for more information.
851 851
852However, given that there are no fewer than four families of RCU APIs
853in the Linux kernel, how do you choose which one to use? The following
854list can be helpful:
855
856a. Will readers need to block? If so, you need SRCU.
857
858b. What about the -rt patchset? If readers would need to block
859 in an non-rt kernel, you need SRCU. If readers would block
860 in a -rt kernel, but not in a non-rt kernel, SRCU is not
861 necessary.
862
863c. Do you need to treat NMI handlers, hardirq handlers,
864 and code segments with preemption disabled (whether
865 via preempt_disable(), local_irq_save(), local_bh_disable(),
866 or some other mechanism) as if they were explicit RCU readers?
867 If so, you need RCU-sched.
868
869d. Do you need RCU grace periods to complete even in the face
870 of softirq monopolization of one or more of the CPUs? For
871 example, is your code subject to network-based denial-of-service
872 attacks? If so, you need RCU-bh.
873
874e. Is your workload too update-intensive for normal use of
875 RCU, but inappropriate for other synchronization mechanisms?
876 If so, consider SLAB_DESTROY_BY_RCU. But please be careful!
877
878f. Otherwise, use RCU.
879
880Of course, this all assumes that you have determined that RCU is in fact
881the right tool for your job.
882
852 883
8538. ANSWERS TO QUICK QUIZZES 8848. ANSWERS TO QUICK QUIZZES
854 885
diff --git a/Documentation/SecurityBugs b/Documentation/SecurityBugs
index 26c3b3635d9f..a660d494c8ed 100644
--- a/Documentation/SecurityBugs
+++ b/Documentation/SecurityBugs
@@ -28,7 +28,7 @@ expect these delays to be short, measurable in days, not weeks or months.
28A disclosure date is negotiated by the security team working with the 28A disclosure date is negotiated by the security team working with the
29bug submitter as well as vendors. However, the kernel security team 29bug submitter as well as vendors. However, the kernel security team
30holds the final say when setting a disclosure date. The timeframe for 30holds the final say when setting a disclosure date. The timeframe for
31disclosure is from immediate (esp. if it's already publically known) 31disclosure is from immediate (esp. if it's already publicly known)
32to a few weeks. As a basic default policy, we expect report date to 32to a few weeks. As a basic default policy, we expect report date to
33disclosure date to be on the order of 7 days. 33disclosure date to be on the order of 7 days.
34 34
diff --git a/Documentation/SubmittingDrivers b/Documentation/SubmittingDrivers
index 38d2aab59cac..319baa8b60dd 100644
--- a/Documentation/SubmittingDrivers
+++ b/Documentation/SubmittingDrivers
@@ -101,7 +101,7 @@ PM support: Since Linux is used on many portable and desktop systems, your
101 complete overview of the power management issues related to 101 complete overview of the power management issues related to
102 drivers see Documentation/power/devices.txt . 102 drivers see Documentation/power/devices.txt .
103 103
104Control: In general if there is active maintainance of a driver by 104Control: In general if there is active maintenance of a driver by
105 the author then patches will be redirected to them unless 105 the author then patches will be redirected to them unless
106 they are totally obvious and without need of checking. 106 they are totally obvious and without need of checking.
107 If you want to be the contact and update point for the 107 If you want to be the contact and update point for the
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 689e2371095c..569f3532e138 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -714,10 +714,11 @@ Jeff Garzik, "Linux kernel patch submission format".
714 <http://linux.yyz.us/patch-format.html> 714 <http://linux.yyz.us/patch-format.html>
715 715
716Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer". 716Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer".
717 <http://www.kroah.com/log/2005/03/31/> 717 <http://www.kroah.com/log/linux/maintainer.html>
718 <http://www.kroah.com/log/2005/07/08/> 718 <http://www.kroah.com/log/linux/maintainer-02.html>
719 <http://www.kroah.com/log/2005/10/19/> 719 <http://www.kroah.com/log/linux/maintainer-03.html>
720 <http://www.kroah.com/log/2006/01/11/> 720 <http://www.kroah.com/log/linux/maintainer-04.html>
721 <http://www.kroah.com/log/linux/maintainer-05.html>
721 722
722NO!!!! No more huge patch bombs to linux-kernel@vger.kernel.org people! 723NO!!!! No more huge patch bombs to linux-kernel@vger.kernel.org people!
723 <http://marc.theaimsgroup.com/?l=linux-kernel&m=112112749912944&w=2> 724 <http://marc.theaimsgroup.com/?l=linux-kernel&m=112112749912944&w=2>
@@ -729,7 +730,7 @@ Linus Torvalds's mail on the canonical patch format:
729 <http://lkml.org/lkml/2005/4/7/183> 730 <http://lkml.org/lkml/2005/4/7/183>
730 731
731Andi Kleen, "On submitting kernel patches" 732Andi Kleen, "On submitting kernel patches"
732 Some strategies to get difficult or controversal changes in. 733 Some strategies to get difficult or controversial changes in.
733 http://halobates.de/on-submitting-patches.pdf 734 http://halobates.de/on-submitting-patches.pdf
734 735
735-- 736--
diff --git a/Documentation/accounting/cgroupstats.txt b/Documentation/accounting/cgroupstats.txt
index eda40fd39cad..d16a9849e60e 100644
--- a/Documentation/accounting/cgroupstats.txt
+++ b/Documentation/accounting/cgroupstats.txt
@@ -21,7 +21,7 @@ information will not be available.
21To extract cgroup statistics a utility very similar to getdelays.c 21To extract cgroup statistics a utility very similar to getdelays.c
22has been developed, the sample output of the utility is shown below 22has been developed, the sample output of the utility is shown below
23 23
24~/balbir/cgroupstats # ./getdelays -C "/cgroup/a" 24~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup/a"
25sleeping 1, blocked 0, running 1, stopped 0, uninterruptible 0 25sleeping 1, blocked 0, running 1, stopped 0, uninterruptible 0
26~/balbir/cgroupstats # ./getdelays -C "/cgroup" 26~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup"
27sleeping 155, blocked 0, running 1, stopped 0, uninterruptible 2 27sleeping 155, blocked 0, running 1, stopped 0, uninterruptible 2
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c
index 6e25c2659e0a..f6318f6d7baf 100644
--- a/Documentation/accounting/getdelays.c
+++ b/Documentation/accounting/getdelays.c
@@ -21,6 +21,7 @@
21#include <sys/types.h> 21#include <sys/types.h>
22#include <sys/stat.h> 22#include <sys/stat.h>
23#include <sys/socket.h> 23#include <sys/socket.h>
24#include <sys/wait.h>
24#include <signal.h> 25#include <signal.h>
25 26
26#include <linux/genetlink.h> 27#include <linux/genetlink.h>
@@ -176,6 +177,8 @@ static int get_family_id(int sd)
176 rc = send_cmd(sd, GENL_ID_CTRL, getpid(), CTRL_CMD_GETFAMILY, 177 rc = send_cmd(sd, GENL_ID_CTRL, getpid(), CTRL_CMD_GETFAMILY,
177 CTRL_ATTR_FAMILY_NAME, (void *)name, 178 CTRL_ATTR_FAMILY_NAME, (void *)name,
178 strlen(TASKSTATS_GENL_NAME)+1); 179 strlen(TASKSTATS_GENL_NAME)+1);
180 if (rc < 0)
181 return 0; /* sendto() failure? */
179 182
180 rep_len = recv(sd, &ans, sizeof(ans), 0); 183 rep_len = recv(sd, &ans, sizeof(ans), 0);
181 if (ans.n.nlmsg_type == NLMSG_ERROR || 184 if (ans.n.nlmsg_type == NLMSG_ERROR ||
@@ -190,30 +193,37 @@ static int get_family_id(int sd)
190 return id; 193 return id;
191} 194}
192 195
196#define average_ms(t, c) (t / 1000000ULL / (c ? c : 1))
197
193static void print_delayacct(struct taskstats *t) 198static void print_delayacct(struct taskstats *t)
194{ 199{
195 printf("\n\nCPU %15s%15s%15s%15s\n" 200 printf("\n\nCPU %15s%15s%15s%15s%15s\n"
196 " %15llu%15llu%15llu%15llu\n" 201 " %15llu%15llu%15llu%15llu%15.3fms\n"
197 "IO %15s%15s\n" 202 "IO %15s%15s%15s\n"
198 " %15llu%15llu\n" 203 " %15llu%15llu%15llums\n"
199 "SWAP %15s%15s\n" 204 "SWAP %15s%15s%15s\n"
200 " %15llu%15llu\n" 205 " %15llu%15llu%15llums\n"
201 "RECLAIM %12s%15s\n" 206 "RECLAIM %12s%15s%15s\n"
202 " %15llu%15llu\n", 207 " %15llu%15llu%15llums\n",
203 "count", "real total", "virtual total", "delay total", 208 "count", "real total", "virtual total",
209 "delay total", "delay average",
204 (unsigned long long)t->cpu_count, 210 (unsigned long long)t->cpu_count,
205 (unsigned long long)t->cpu_run_real_total, 211 (unsigned long long)t->cpu_run_real_total,
206 (unsigned long long)t->cpu_run_virtual_total, 212 (unsigned long long)t->cpu_run_virtual_total,
207 (unsigned long long)t->cpu_delay_total, 213 (unsigned long long)t->cpu_delay_total,
208 "count", "delay total", 214 average_ms((double)t->cpu_delay_total, t->cpu_count),
215 "count", "delay total", "delay average",
209 (unsigned long long)t->blkio_count, 216 (unsigned long long)t->blkio_count,
210 (unsigned long long)t->blkio_delay_total, 217 (unsigned long long)t->blkio_delay_total,
211 "count", "delay total", 218 average_ms(t->blkio_delay_total, t->blkio_count),
219 "count", "delay total", "delay average",
212 (unsigned long long)t->swapin_count, 220 (unsigned long long)t->swapin_count,
213 (unsigned long long)t->swapin_delay_total, 221 (unsigned long long)t->swapin_delay_total,
214 "count", "delay total", 222 average_ms(t->swapin_delay_total, t->swapin_count),
223 "count", "delay total", "delay average",
215 (unsigned long long)t->freepages_count, 224 (unsigned long long)t->freepages_count,
216 (unsigned long long)t->freepages_delay_total); 225 (unsigned long long)t->freepages_delay_total,
226 average_ms(t->freepages_delay_total, t->freepages_count));
217} 227}
218 228
219static void task_context_switch_counts(struct taskstats *t) 229static void task_context_switch_counts(struct taskstats *t)
@@ -266,11 +276,13 @@ int main(int argc, char *argv[])
266 int containerset = 0; 276 int containerset = 0;
267 char containerpath[1024]; 277 char containerpath[1024];
268 int cfd = 0; 278 int cfd = 0;
279 int forking = 0;
280 sigset_t sigset;
269 281
270 struct msgtemplate msg; 282 struct msgtemplate msg;
271 283
272 while (1) { 284 while (!forking) {
273 c = getopt(argc, argv, "qdiw:r:m:t:p:vlC:"); 285 c = getopt(argc, argv, "qdiw:r:m:t:p:vlC:c:");
274 if (c < 0) 286 if (c < 0)
275 break; 287 break;
276 288
@@ -319,6 +331,28 @@ int main(int argc, char *argv[])
319 err(1, "Invalid pid\n"); 331 err(1, "Invalid pid\n");
320 cmd_type = TASKSTATS_CMD_ATTR_PID; 332 cmd_type = TASKSTATS_CMD_ATTR_PID;
321 break; 333 break;
334 case 'c':
335
336 /* Block SIGCHLD for sigwait() later */
337 if (sigemptyset(&sigset) == -1)
338 err(1, "Failed to empty sigset");
339 if (sigaddset(&sigset, SIGCHLD))
340 err(1, "Failed to set sigchld in sigset");
341 sigprocmask(SIG_BLOCK, &sigset, NULL);
342
343 /* fork/exec a child */
344 tid = fork();
345 if (tid < 0)
346 err(1, "Fork failed\n");
347 if (tid == 0)
348 if (execvp(argv[optind - 1],
349 &argv[optind - 1]) < 0)
350 exit(-1);
351
352 /* Set the command type and avoid further processing */
353 cmd_type = TASKSTATS_CMD_ATTR_PID;
354 forking = 1;
355 break;
322 case 'v': 356 case 'v':
323 printf("debug on\n"); 357 printf("debug on\n");
324 dbg = 1; 358 dbg = 1;
@@ -370,6 +404,15 @@ int main(int argc, char *argv[])
370 goto err; 404 goto err;
371 } 405 }
372 406
407 /*
408 * If we forked a child, wait for it to exit. Cannot use waitpid()
409 * as all the delicious data would be reaped as part of the wait
410 */
411 if (tid && forking) {
412 int sig_received;
413 sigwait(&sigset, &sig_received);
414 }
415
373 if (tid) { 416 if (tid) {
374 rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET, 417 rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
375 cmd_type, &tid, sizeof(__u32)); 418 cmd_type, &tid, sizeof(__u32));
@@ -399,8 +442,6 @@ int main(int argc, char *argv[])
399 } 442 }
400 443
401 do { 444 do {
402 int i;
403
404 rep_len = recv(nl_sd, &msg, sizeof(msg), 0); 445 rep_len = recv(nl_sd, &msg, sizeof(msg), 0);
405 PRINTF("received %d bytes\n", rep_len); 446 PRINTF("received %d bytes\n", rep_len);
406 447
@@ -425,7 +466,6 @@ int main(int argc, char *argv[])
425 466
426 na = (struct nlattr *) GENLMSG_DATA(&msg); 467 na = (struct nlattr *) GENLMSG_DATA(&msg);
427 len = 0; 468 len = 0;
428 i = 0;
429 while (len < rep_len) { 469 while (len < rep_len) {
430 len += NLA_ALIGN(na->nla_len); 470 len += NLA_ALIGN(na->nla_len);
431 switch (na->nla_type) { 471 switch (na->nla_type) {
@@ -482,6 +522,7 @@ int main(int argc, char *argv[])
482 default: 522 default:
483 fprintf(stderr, "Unknown nla_type %d\n", 523 fprintf(stderr, "Unknown nla_type %d\n",
484 na->nla_type); 524 na->nla_type);
525 case TASKSTATS_TYPE_NULL:
485 break; 526 break;
486 } 527 }
487 na = (struct nlattr *) (GENLMSG_DATA(&msg) + len); 528 na = (struct nlattr *) (GENLMSG_DATA(&msg) + len);
diff --git a/Documentation/acpi/apei/output_format.txt b/Documentation/acpi/apei/output_format.txt
new file mode 100644
index 000000000000..0c49c197c47a
--- /dev/null
+++ b/Documentation/acpi/apei/output_format.txt
@@ -0,0 +1,147 @@
1 APEI output format
2 ~~~~~~~~~~~~~~~~~~
3
4APEI uses printk as hardware error reporting interface, the output
5format is as follow.
6
7<error record> :=
8APEI generic hardware error status
9severity: <integer>, <severity string>
10section: <integer>, severity: <integer>, <severity string>
11flags: <integer>
12<section flags strings>
13fru_id: <uuid string>
14fru_text: <string>
15section_type: <section type string>
16<section data>
17
18<severity string>* := recoverable | fatal | corrected | info
19
20<section flags strings># :=
21[primary][, containment warning][, reset][, threshold exceeded]\
22[, resource not accessible][, latent error]
23
24<section type string> := generic processor error | memory error | \
25PCIe error | unknown, <uuid string>
26
27<section data> :=
28<generic processor section data> | <memory section data> | \
29<pcie section data> | <null>
30
31<generic processor section data> :=
32[processor_type: <integer>, <proc type string>]
33[processor_isa: <integer>, <proc isa string>]
34[error_type: <integer>
35<proc error type strings>]
36[operation: <integer>, <proc operation string>]
37[flags: <integer>
38<proc flags strings>]
39[level: <integer>]
40[version_info: <integer>]
41[processor_id: <integer>]
42[target_address: <integer>]
43[requestor_id: <integer>]
44[responder_id: <integer>]
45[IP: <integer>]
46
47<proc type string>* := IA32/X64 | IA64
48
49<proc isa string>* := IA32 | IA64 | X64
50
51<processor error type strings># :=
52[cache error][, TLB error][, bus error][, micro-architectural error]
53
54<proc operation string>* := unknown or generic | data read | data write | \
55instruction execution
56
57<proc flags strings># :=
58[restartable][, precise IP][, overflow][, corrected]
59
60<memory section data> :=
61[error_status: <integer>]
62[physical_address: <integer>]
63[physical_address_mask: <integer>]
64[node: <integer>]
65[card: <integer>]
66[module: <integer>]
67[bank: <integer>]
68[device: <integer>]
69[row: <integer>]
70[column: <integer>]
71[bit_position: <integer>]
72[requestor_id: <integer>]
73[responder_id: <integer>]
74[target_id: <integer>]
75[error_type: <integer>, <mem error type string>]
76
77<mem error type string>* :=
78unknown | no error | single-bit ECC | multi-bit ECC | \
79single-symbol chipkill ECC | multi-symbol chipkill ECC | master abort | \
80target abort | parity error | watchdog timeout | invalid address | \
81mirror Broken | memory sparing | scrub corrected error | \
82scrub uncorrected error
83
84<pcie section data> :=
85[port_type: <integer>, <pcie port type string>]
86[version: <integer>.<integer>]
87[command: <integer>, status: <integer>]
88[device_id: <integer>:<integer>:<integer>.<integer>
89slot: <integer>
90secondary_bus: <integer>
91vendor_id: <integer>, device_id: <integer>
92class_code: <integer>]
93[serial number: <integer>, <integer>]
94[bridge: secondary_status: <integer>, control: <integer>]
95[aer_status: <integer>, aer_mask: <integer>
96<aer status string>
97[aer_uncor_severity: <integer>]
98aer_layer=<aer layer string>, aer_agent=<aer agent string>
99aer_tlp_header: <integer> <integer> <integer> <integer>]
100
101<pcie port type string>* := PCIe end point | legacy PCI end point | \
102unknown | unknown | root port | upstream switch port | \
103downstream switch port | PCIe to PCI/PCI-X bridge | \
104PCI/PCI-X to PCIe bridge | root complex integrated endpoint device | \
105root complex event collector
106
107if section severity is fatal or recoverable
108<aer status string># :=
109unknown | unknown | unknown | unknown | Data Link Protocol | \
110unknown | unknown | unknown | unknown | unknown | unknown | unknown | \
111Poisoned TLP | Flow Control Protocol | Completion Timeout | \
112Completer Abort | Unexpected Completion | Receiver Overflow | \
113Malformed TLP | ECRC | Unsupported Request
114else
115<aer status string># :=
116Receiver Error | unknown | unknown | unknown | unknown | unknown | \
117Bad TLP | Bad DLLP | RELAY_NUM Rollover | unknown | unknown | unknown | \
118Replay Timer Timeout | Advisory Non-Fatal
119fi
120
121<aer layer string> :=
122Physical Layer | Data Link Layer | Transaction Layer
123
124<aer agent string> :=
125Receiver ID | Requester ID | Completer ID | Transmitter ID
126
127Where, [] designate corresponding content is optional
128
129All <field string> description with * has the following format:
130
131field: <integer>, <field string>
132
133Where value of <integer> should be the position of "string" in <field
134string> description. Otherwise, <field string> will be "unknown".
135
136All <field strings> description with # has the following format:
137
138field: <integer>
139<field strings>
140
141Where each string in <fields strings> corresponding to one set bit of
142<integer>. The bit position is the position of "string" in <field
143strings> description.
144
145For more detailed explanation of every field, please refer to UEFI
146specification version 2.3 or later, section Appendix N: Common
147Platform Error Record.
diff --git a/Documentation/acpi/method-customizing.txt b/Documentation/acpi/method-customizing.txt
index 3e1d25aee3fb..5f55373dd53b 100644
--- a/Documentation/acpi/method-customizing.txt
+++ b/Documentation/acpi/method-customizing.txt
@@ -66,3 +66,8 @@ Note: We can use a kernel with multiple custom ACPI method running,
66 But each individual write to debugfs can implement a SINGLE 66 But each individual write to debugfs can implement a SINGLE
67 method override. i.e. if we want to insert/override multiple 67 method override. i.e. if we want to insert/override multiple
68 ACPI methods, we need to redo step c) ~ g) for multiple times. 68 ACPI methods, we need to redo step c) ~ g) for multiple times.
69
70Note: Be aware that root can mis-use this driver to modify arbitrary
71 memory and gain additional rights, if root's privileges got
72 restricted (for example if root is not allowed to load additional
73 modules after boot).
diff --git a/Documentation/arm/00-INDEX b/Documentation/arm/00-INDEX
index 7f5fc3ba9c91..91c24a1e8a9e 100644
--- a/Documentation/arm/00-INDEX
+++ b/Documentation/arm/00-INDEX
@@ -6,6 +6,8 @@ Interrupts
6 - ARM Interrupt subsystem documentation 6 - ARM Interrupt subsystem documentation
7IXP2000 7IXP2000
8 - Release Notes for Linux on Intel's IXP2000 Network Processor 8 - Release Notes for Linux on Intel's IXP2000 Network Processor
9msm
10 - MSM specific documentation
9Netwinder 11Netwinder
10 - Netwinder specific documentation 12 - Netwinder specific documentation
11Porting 13Porting
@@ -32,3 +34,5 @@ memory.txt
32 - description of the virtual memory layout 34 - description of the virtual memory layout
33nwfpe/ 35nwfpe/
34 - NWFPE floating point emulator documentation 36 - NWFPE floating point emulator documentation
37swp_emulation
38 - SWP/SWPB emulation handler/logging description
diff --git a/Documentation/arm/Booting b/Documentation/arm/Booting
index 76850295af8f..4e686a2ed91e 100644
--- a/Documentation/arm/Booting
+++ b/Documentation/arm/Booting
@@ -65,13 +65,19 @@ looks at the connected hardware is beyond the scope of this document.
65The boot loader must ultimately be able to provide a MACH_TYPE_xxx 65The boot loader must ultimately be able to provide a MACH_TYPE_xxx
66value to the kernel. (see linux/arch/arm/tools/mach-types). 66value to the kernel. (see linux/arch/arm/tools/mach-types).
67 67
68 684. Setup boot data
694. Setup the kernel tagged list 69------------------
70-------------------------------
71 70
72Existing boot loaders: OPTIONAL, HIGHLY RECOMMENDED 71Existing boot loaders: OPTIONAL, HIGHLY RECOMMENDED
73New boot loaders: MANDATORY 72New boot loaders: MANDATORY
74 73
74The boot loader must provide either a tagged list or a dtb image for
75passing configuration data to the kernel. The physical address of the
76boot data is passed to the kernel in register r2.
77
784a. Setup the kernel tagged list
79--------------------------------
80
75The boot loader must create and initialise the kernel tagged list. 81The boot loader must create and initialise the kernel tagged list.
76A valid tagged list starts with ATAG_CORE and ends with ATAG_NONE. 82A valid tagged list starts with ATAG_CORE and ends with ATAG_NONE.
77The ATAG_CORE tag may or may not be empty. An empty ATAG_CORE tag 83The ATAG_CORE tag may or may not be empty. An empty ATAG_CORE tag
@@ -101,6 +107,24 @@ The tagged list must be placed in a region of memory where neither
101the kernel decompressor nor initrd 'bootp' program will overwrite 107the kernel decompressor nor initrd 'bootp' program will overwrite
102it. The recommended placement is in the first 16KiB of RAM. 108it. The recommended placement is in the first 16KiB of RAM.
103 109
1104b. Setup the device tree
111-------------------------
112
113The boot loader must load a device tree image (dtb) into system ram
114at a 64bit aligned address and initialize it with the boot data. The
115dtb format is documented in Documentation/devicetree/booting-without-of.txt.
116The kernel will look for the dtb magic value of 0xd00dfeed at the dtb
117physical address to determine if a dtb has been passed instead of a
118tagged list.
119
120The boot loader must pass at a minimum the size and location of the
121system memory, and the root filesystem location. The dtb must be
122placed in a region of memory where the kernel decompressor will not
123overwrite it. The recommended placement is in the first 16KiB of RAM
124with the caveat that it may not be located at physical address 0 since
125the kernel interprets a value of 0 in r2 to mean neither a tagged list
126nor a dtb were passed.
127
1045. Calling the kernel image 1285. Calling the kernel image
105--------------------------- 129---------------------------
106 130
@@ -125,7 +149,8 @@ In either case, the following conditions must be met:
125- CPU register settings 149- CPU register settings
126 r0 = 0, 150 r0 = 0,
127 r1 = machine type number discovered in (3) above. 151 r1 = machine type number discovered in (3) above.
128 r2 = physical address of tagged list in system RAM. 152 r2 = physical address of tagged list in system RAM, or
153 physical address of device tree block (dtb) in system RAM
129 154
130- CPU mode 155- CPU mode
131 All forms of interrupts must be disabled (IRQs and FIQs) 156 All forms of interrupts must be disabled (IRQs and FIQs)
diff --git a/Documentation/arm/IXP4xx b/Documentation/arm/IXP4xx
index 133c5fa6c7a1..7b9351f2f555 100644
--- a/Documentation/arm/IXP4xx
+++ b/Documentation/arm/IXP4xx
@@ -36,7 +36,7 @@ Linux currently supports the following features on the IXP4xx chips:
36- Timers (watchdog, OS) 36- Timers (watchdog, OS)
37 37
38The following components of the chips are not supported by Linux and 38The following components of the chips are not supported by Linux and
39require the use of Intel's propietary CSR softare: 39require the use of Intel's proprietary CSR softare:
40 40
41- USB device interface 41- USB device interface
42- Network interfaces (HSS, Utopia, NPEs, etc) 42- Network interfaces (HSS, Utopia, NPEs, etc)
@@ -47,7 +47,7 @@ software from:
47 47
48 http://developer.intel.com/design/network/products/npfamily/ixp425.htm 48 http://developer.intel.com/design/network/products/npfamily/ixp425.htm
49 49
50DO NOT POST QUESTIONS TO THE LINUX MAILING LISTS REGARDING THE PROPIETARY 50DO NOT POST QUESTIONS TO THE LINUX MAILING LISTS REGARDING THE PROPRIETARY
51SOFTWARE. 51SOFTWARE.
52 52
53There are several websites that provide directions/pointers on using 53There are several websites that provide directions/pointers on using
diff --git a/Documentation/arm/OMAP/DSS b/Documentation/arm/OMAP/DSS
index 0af0e9eed5d6..888ae7b83ae4 100644
--- a/Documentation/arm/OMAP/DSS
+++ b/Documentation/arm/OMAP/DSS
@@ -255,9 +255,10 @@ framebuffer parameters.
255Kernel boot arguments 255Kernel boot arguments
256--------------------- 256---------------------
257 257
258vram=<size> 258vram=<size>[,<physaddr>]
259 - Amount of total VRAM to preallocate. For example, "10M". omapfb 259 - Amount of total VRAM to preallocate and optionally a physical start
260 allocates memory for framebuffers from VRAM. 260 memory address. For example, "10M". omapfb allocates memory for
261 framebuffers from VRAM.
261 262
262omapfb.mode=<display>:<mode>[,...] 263omapfb.mode=<display>:<mode>[,...]
263 - Default video mode for specified displays. For example, 264 - Default video mode for specified displays. For example,
diff --git a/Documentation/arm/OMAP/omap_pm b/Documentation/arm/OMAP/omap_pm
index 5389440aade3..9012bb039094 100644
--- a/Documentation/arm/OMAP/omap_pm
+++ b/Documentation/arm/OMAP/omap_pm
@@ -127,3 +127,28 @@ implementation needs:
12710. (*pdata->cpu_set_freq)(unsigned long f) 12710. (*pdata->cpu_set_freq)(unsigned long f)
128 128
12911. (*pdata->cpu_get_freq)(void) 12911. (*pdata->cpu_get_freq)(void)
130
131Customizing OPP for platform
132============================
133Defining CONFIG_PM should enable OPP layer for the silicon
134and the registration of OPP table should take place automatically.
135However, in special cases, the default OPP table may need to be
136tweaked, for e.g.:
137 * enable default OPPs which are disabled by default, but which
138 could be enabled on a platform
139 * Disable an unsupported OPP on the platform
140 * Define and add a custom opp table entry
141in these cases, the board file needs to do additional steps as follows:
142arch/arm/mach-omapx/board-xyz.c
143 #include "pm.h"
144 ....
145 static void __init omap_xyz_init_irq(void)
146 {
147 ....
148 /* Initialize the default table */
149 omapx_opp_init();
150 /* Do customization to the defaults */
151 ....
152 }
153NOTE: omapx_opp_init will be omap3_opp_init or as required
154based on the omap family.
diff --git a/Documentation/arm/SA1100/FreeBird b/Documentation/arm/SA1100/FreeBird
index fb23b770aaf4..ab9193663b2b 100644
--- a/Documentation/arm/SA1100/FreeBird
+++ b/Documentation/arm/SA1100/FreeBird
@@ -1,6 +1,6 @@
1Freebird-1.1 is produced by Legned(C) ,Inc. 1Freebird-1.1 is produced by Legend(C), Inc.
2http://web.archive.org/web/*/http://www.legend.com.cn 2http://web.archive.org/web/*/http://www.legend.com.cn
3and software/linux mainatined by Coventive(C),Inc. 3and software/linux maintained by Coventive(C), Inc.
4(http://www.coventive.com) 4(http://www.coventive.com)
5 5
6Based on the Nicolas's strongarm kernel tree. 6Based on the Nicolas's strongarm kernel tree.
diff --git a/Documentation/arm/SH-Mobile/Makefile b/Documentation/arm/SH-Mobile/Makefile
new file mode 100644
index 000000000000..8771d832cf8c
--- /dev/null
+++ b/Documentation/arm/SH-Mobile/Makefile
@@ -0,0 +1,8 @@
1BIN := vrl4
2
3.PHONY: all
4all: $(BIN)
5
6.PHONY: clean
7clean:
8 rm -f *.o $(BIN)
diff --git a/Documentation/arm/SH-Mobile/vrl4.c b/Documentation/arm/SH-Mobile/vrl4.c
new file mode 100644
index 000000000000..e8a191358ad2
--- /dev/null
+++ b/Documentation/arm/SH-Mobile/vrl4.c
@@ -0,0 +1,169 @@
1/*
2 * vrl4 format generator
3 *
4 * Copyright (C) 2010 Simon Horman
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11/*
12 * usage: vrl4 < zImage > out
13 * dd if=out of=/dev/sdx bs=512 seek=1 # Write the image to sector 1
14 *
15 * Reads a zImage from stdin and writes a vrl4 image to stdout.
16 * In practice this means writing a padded vrl4 header to stdout followed
17 * by the zImage.
18 *
19 * The padding places the zImage at ALIGN bytes into the output.
20 * The vrl4 uses ALIGN + START_BASE as the start_address.
21 * This is where the mask ROM will jump to after verifying the header.
22 *
23 * The header sets copy_size to min(sizeof(zImage), MAX_BOOT_PROG_LEN) + ALIGN.
24 * That is, the mask ROM will load the padded header (ALIGN bytes)
25 * And then MAX_BOOT_PROG_LEN bytes of the image, or the entire image,
26 * whichever is smaller.
27 *
28 * The zImage is not modified in any way.
29 */
30
31#define _BSD_SOURCE
32#include <endian.h>
33#include <unistd.h>
34#include <stdint.h>
35#include <stdio.h>
36#include <errno.h>
37
38struct hdr {
39 uint32_t magic1;
40 uint32_t reserved1;
41 uint32_t magic2;
42 uint32_t reserved2;
43 uint16_t copy_size;
44 uint16_t boot_options;
45 uint32_t reserved3;
46 uint32_t start_address;
47 uint32_t reserved4;
48 uint32_t reserved5;
49 char reserved6[308];
50};
51
52#define DECLARE_HDR(h) \
53 struct hdr (h) = { \
54 .magic1 = htole32(0xea000000), \
55 .reserved1 = htole32(0x56), \
56 .magic2 = htole32(0xe59ff008), \
57 .reserved3 = htole16(0x1) }
58
59/* Align to 512 bytes, the MMCIF sector size */
60#define ALIGN_BITS 9
61#define ALIGN (1 << ALIGN_BITS)
62
63#define START_BASE 0xe55b0000
64
65/*
66 * With an alignment of 512 the header uses the first sector.
67 * There is a 128 sector (64kbyte) limit on the data loaded by the mask ROM.
68 * So there are 127 sectors left for the boot programme. But in practice
69 * Only a small portion of a zImage is needed, 16 sectors should be more
70 * than enough.
71 *
72 * Note that this sets how much of the zImage is copied by the mask ROM.
73 * The entire zImage is present after the header and is loaded
74 * by the code in the boot program (which is the first portion of the zImage).
75 */
76#define MAX_BOOT_PROG_LEN (16 * 512)
77
78#define ROUND_UP(x) ((x + ALIGN - 1) & ~(ALIGN - 1))
79
80ssize_t do_read(int fd, void *buf, size_t count)
81{
82 size_t offset = 0;
83 ssize_t l;
84
85 while (offset < count) {
86 l = read(fd, buf + offset, count - offset);
87 if (!l)
88 break;
89 if (l < 0) {
90 if (errno == EAGAIN || errno == EWOULDBLOCK)
91 continue;
92 perror("read");
93 return -1;
94 }
95 offset += l;
96 }
97
98 return offset;
99}
100
101ssize_t do_write(int fd, const void *buf, size_t count)
102{
103 size_t offset = 0;
104 ssize_t l;
105
106 while (offset < count) {
107 l = write(fd, buf + offset, count - offset);
108 if (l < 0) {
109 if (errno == EAGAIN || errno == EWOULDBLOCK)
110 continue;
111 perror("write");
112 return -1;
113 }
114 offset += l;
115 }
116
117 return offset;
118}
119
120ssize_t write_zero(int fd, size_t len)
121{
122 size_t i = len;
123
124 while (i--) {
125 const char x = 0;
126 if (do_write(fd, &x, 1) < 0)
127 return -1;
128 }
129
130 return len;
131}
132
133int main(void)
134{
135 DECLARE_HDR(hdr);
136 char boot_program[MAX_BOOT_PROG_LEN];
137 size_t aligned_hdr_len, alligned_prog_len;
138 ssize_t prog_len;
139
140 prog_len = do_read(0, boot_program, sizeof(boot_program));
141 if (prog_len <= 0)
142 return -1;
143
144 aligned_hdr_len = ROUND_UP(sizeof(hdr));
145 hdr.start_address = htole32(START_BASE + aligned_hdr_len);
146 alligned_prog_len = ROUND_UP(prog_len);
147 hdr.copy_size = htole16(aligned_hdr_len + alligned_prog_len);
148
149 if (do_write(1, &hdr, sizeof(hdr)) < 0)
150 return -1;
151 if (write_zero(1, aligned_hdr_len - sizeof(hdr)) < 0)
152 return -1;
153
154 if (do_write(1, boot_program, prog_len) < 0)
155 return 1;
156
157 /* Write out the rest of the kernel */
158 while (1) {
159 prog_len = do_read(0, boot_program, sizeof(boot_program));
160 if (prog_len < 0)
161 return 1;
162 if (prog_len == 0)
163 break;
164 if (do_write(1, boot_program, prog_len) < 0)
165 return 1;
166 }
167
168 return 0;
169}
diff --git a/Documentation/arm/SH-Mobile/zboot-rom-mmcif.txt b/Documentation/arm/SH-Mobile/zboot-rom-mmcif.txt
new file mode 100644
index 000000000000..efff8ae2713d
--- /dev/null
+++ b/Documentation/arm/SH-Mobile/zboot-rom-mmcif.txt
@@ -0,0 +1,29 @@
1ROM-able zImage boot from MMC
2-----------------------------
3
4An ROM-able zImage compiled with ZBOOT_ROM_MMCIF may be written to MMC and
5SuperH Mobile ARM will to boot directly from the MMCIF hardware block.
6
7This is achieved by the mask ROM loading the first portion of the image into
8MERAM and then jumping to it. This portion contains loader code which
9copies the entire image to SDRAM and jumps to it. From there the zImage
10boot code proceeds as normal, uncompressing the image into its final
11location and then jumping to it.
12
13This code has been tested on an AP4EB board using the developer 1A eMMC
14boot mode which is configured using the following jumper settings.
15The board used for testing required a patched mask ROM in order for
16this mode to function.
17
18 8 7 6 5 4 3 2 1
19 x|x|x|x|x| |x|
20S4 -+-+-+-+-+-+-+-
21 | | | | |x| |x on
22
23The zImage must be written to the MMC card at sector 1 (512 bytes) in
24vrl4 format. A utility vrl4 is supplied to accomplish this.
25
26e.g.
27 vrl4 < zImage | dd of=/dev/sdX bs=512 seek=1
28
29A dual-voltage MMC 4.0 card was used for testing.
diff --git a/Documentation/arm/Samsung-S3C24XX/Suspend.txt b/Documentation/arm/Samsung-S3C24XX/Suspend.txt
index 7edd0e2e6c5b..1ca63b3e5635 100644
--- a/Documentation/arm/Samsung-S3C24XX/Suspend.txt
+++ b/Documentation/arm/Samsung-S3C24XX/Suspend.txt
@@ -116,7 +116,7 @@ Configuration
116 Allows the entire memory to be checksummed before and after the 116 Allows the entire memory to be checksummed before and after the
117 suspend to see if there has been any corruption of the contents. 117 suspend to see if there has been any corruption of the contents.
118 118
119 Note, the time to calculate the CRC is dependant on the CPU speed 119 Note, the time to calculate the CRC is dependent on the CPU speed
120 and the size of memory. For an 64Mbyte RAM area on an 200MHz 120 and the size of memory. For an 64Mbyte RAM area on an 200MHz
121 S3C2410, this can take approximately 4 seconds to complete. 121 S3C2410, this can take approximately 4 seconds to complete.
122 122
diff --git a/Documentation/arm/Samsung/GPIO.txt b/Documentation/arm/Samsung/GPIO.txt
index 05850c62abeb..513f2562c1a3 100644
--- a/Documentation/arm/Samsung/GPIO.txt
+++ b/Documentation/arm/Samsung/GPIO.txt
@@ -5,7 +5,7 @@ Introduction
5------------ 5------------
6 6
7This outlines the Samsung GPIO implementation and the architecture 7This outlines the Samsung GPIO implementation and the architecture
8specfic calls provided alongisde the drivers/gpio core. 8specific calls provided alongisde the drivers/gpio core.
9 9
10 10
11S3C24XX (Legacy) 11S3C24XX (Legacy)
diff --git a/Documentation/arm/Samsung/Overview.txt b/Documentation/arm/Samsung/Overview.txt
index c3094ea51aa7..658abb258cef 100644
--- a/Documentation/arm/Samsung/Overview.txt
+++ b/Documentation/arm/Samsung/Overview.txt
@@ -14,7 +14,6 @@ Introduction
14 - S3C24XX: See Documentation/arm/Samsung-S3C24XX/Overview.txt for full list 14 - S3C24XX: See Documentation/arm/Samsung-S3C24XX/Overview.txt for full list
15 - S3C64XX: S3C6400 and S3C6410 15 - S3C64XX: S3C6400 and S3C6410
16 - S5P6440 16 - S5P6440
17 - S5P6442
18 - S5PC100 17 - S5PC100
19 - S5PC110 / S5PV210 18 - S5PC110 / S5PV210
20 19
@@ -36,7 +35,6 @@ Configuration
36 unifying all the SoCs into one kernel. 35 unifying all the SoCs into one kernel.
37 36
38 s5p6440_defconfig - S5P6440 specific default configuration 37 s5p6440_defconfig - S5P6440 specific default configuration
39 s5p6442_defconfig - S5P6442 specific default configuration
40 s5pc100_defconfig - S5PC100 specific default configuration 38 s5pc100_defconfig - S5PC100 specific default configuration
41 s5pc110_defconfig - S5PC110 specific default configuration 39 s5pc110_defconfig - S5PC110 specific default configuration
42 s5pv210_defconfig - S5PV210 specific default configuration 40 s5pv210_defconfig - S5PV210 specific default configuration
diff --git a/Documentation/arm/Sharp-LH/ADC-LH7-Touchscreen b/Documentation/arm/Sharp-LH/ADC-LH7-Touchscreen
deleted file mode 100644
index dc460f055647..000000000000
--- a/Documentation/arm/Sharp-LH/ADC-LH7-Touchscreen
+++ /dev/null
@@ -1,61 +0,0 @@
1README on the ADC/Touchscreen Controller
2========================================
3
4The LH79524 and LH7A404 include a built-in Analog to Digital
5controller (ADC) that is used to process input from a touchscreen.
6The driver only implements a four-wire touch panel protocol.
7
8The touchscreen driver is maintenance free except for the pen-down or
9touch threshold. Some resistive displays and board combinations may
10require tuning of this threshold. The driver exposes some of its
11internal state in the sys filesystem. If the kernel is configured
12with it, CONFIG_SYSFS, and sysfs is mounted at /sys, there will be a
13directory
14
15 /sys/devices/platform/adc-lh7.0
16
17containing these files.
18
19 -r--r--r-- 1 root root 4096 Jan 1 00:00 samples
20 -rw-r--r-- 1 root root 4096 Jan 1 00:00 threshold
21 -r--r--r-- 1 root root 4096 Jan 1 00:00 threshold_range
22
23The threshold is the current touch threshold. It defaults to 750 on
24most targets.
25
26 # cat threshold
27 750
28
29The threshold_range contains the range of valid values for the
30threshold. Values outside of this range will be silently ignored.
31
32 # cat threshold_range
33 0 1023
34
35To change the threshold, write a value to the threshold file.
36
37 # echo 500 > threshold
38 # cat threshold
39 500
40
41The samples file contains the most recently sampled values from the
42ADC. There are 12. Below are typical of the last sampled values when
43the pen has been released. The first two and last two samples are for
44detecting whether or not the pen is down. The third through sixth are
45X coordinate samples. The seventh through tenth are Y coordinate
46samples.
47
48 # cat samples
49 1023 1023 0 0 0 0 530 529 530 529 1023 1023
50
51To determine a reasonable threshold, press on the touch panel with an
52appropriate stylus and read the values from samples.
53
54 # cat samples
55 1023 676 92 103 101 102 855 919 922 922 1023 679
56
57The first and eleventh samples are discarded. Thus, the important
58values are the second and twelfth which are used to determine if the
59pen is down. When both are below the threshold, the driver registers
60that the pen is down. When either is above the threshold, it
61registers then pen is up.
diff --git a/Documentation/arm/Sharp-LH/CompactFlash b/Documentation/arm/Sharp-LH/CompactFlash
deleted file mode 100644
index 8616d877df9e..000000000000
--- a/Documentation/arm/Sharp-LH/CompactFlash
+++ /dev/null
@@ -1,32 +0,0 @@
1README on the Compact Flash for Card Engines
2============================================
3
4There are three challenges in supporting the CF interface of the Card
5Engines. First, every IO operation must be followed with IO to
6another memory region. Second, the slot is wired for one-to-one
7address mapping *and* it is wired for 16 bit access only. Second, the
8interrupt request line from the CF device isn't wired.
9
10The IOBARRIER issue is covered in README.IOBARRIER. This isn't an
11onerous problem. Enough said here.
12
13The addressing issue is solved in the
14arch/arm/mach-lh7a40x/ide-lpd7a40x.c file with some awkward
15work-arounds. We implement a special SELECT_DRIVE routine that is
16called before the IDE driver performs its own SELECT_DRIVE. Our code
17recognizes that the SELECT register cannot be modified without also
18writing a command. It send an IDLE_IMMEDIATE command on selecting a
19drive. The function also prevents drive select to the slave drive
20since there can be only one. The awkward part is that the IDE driver,
21even though we have a select procedure, also attempts to change the
22drive by writing directly the SELECT register. This attempt is
23explicitly blocked by the OUTB function--not pretty, but effective.
24
25The lack of interrupts is a more serious problem. Even though the CF
26card is fast when compared to a normal IDE device, we don't know that
27the CF is really flash. A user could use one of the very small hard
28drives being shipped with a CF interface. The IDE code includes a
29check for interfaces that lack an IRQ. In these cases, submitting a
30command to the IDE controller is followed by a call to poll for
31completion. If the device isn't immediately ready, it schedules a
32timer to poll again later.
diff --git a/Documentation/arm/Sharp-LH/IOBarrier b/Documentation/arm/Sharp-LH/IOBarrier
deleted file mode 100644
index 2e953e228f4d..000000000000
--- a/Documentation/arm/Sharp-LH/IOBarrier
+++ /dev/null
@@ -1,45 +0,0 @@
1README on the IOBARRIER for CardEngine IO
2=========================================
3
4Due to an unfortunate oversight when the Card Engines were designed,
5the signals that control access to some peripherals, most notably the
6SMC91C9111 ethernet controller, are not properly handled.
7
8The symptom is that some back to back IO with the peripheral returns
9unreliable data. With the SMC chip, you'll see errors about the bank
10register being 'screwed'.
11
12The cause is that the AEN signal to the SMC chip does not transition
13for every memory access. It is driven through the CPLD from the CS7
14line of the CPU's static memory controller which is optimized to
15eliminate unnecessary transitions. Yet, the SMC requires a transition
16for every write access. The Sharp website has more information about
17the effect this power-conserving feature has on peripheral
18interfacing.
19
20The solution is to follow every write access to the SMC chip with an
21access to another memory region that will force the CPU to release the
22chip select line. It is important to guarantee that this access
23forces the CPU off-chip. We map a page of SDRAM as if it were an
24uncacheable IO device and read from it after every SMC IO write
25operation.
26
27 SMC IO
28 BARRIER IO
29
30Only this sequence is important. It does not matter that there is no
31BARRIER IO before the access to the SMC chip because the AEN latch
32only needs occurs after the SMC IO write cycle. The routines that
33implement this work-around make an additional concession which is to
34disable interrupts during the IO sequence. Other hardware devices
35(the LogicPD CPLD) have registers in the same physical memory
36region as the SMC chip. An interrupt might allow an access to one of
37those registers while SMC IO is being performed.
38
39You might be tempted to think that we have to access another device
40attached to the static memory controller, but the empirical evidence
41indicates that this is not so. Mapping 0x00000000 (flash) and
420xc0000000 (SDRAM) appear to have the same effect. Using SDRAM seems
43to be faster. Choosing to access an undecoded memory region is not
44desirable as there is no way to know how that chip select will be used
45in the future.
diff --git a/Documentation/arm/Sharp-LH/KEV7A400 b/Documentation/arm/Sharp-LH/KEV7A400
deleted file mode 100644
index be32b14cd535..000000000000
--- a/Documentation/arm/Sharp-LH/KEV7A400
+++ /dev/null
@@ -1,8 +0,0 @@
1README on Implementing Linux for Sharp's KEV7a400
2=================================================
3
4This product has been discontinued by Sharp. For the time being, the
5partially implemented code remains in the kernel. At some point in
6the future, either the code will be finished or it will be removed
7completely. This depends primarily on how many of the development
8boards are in the field.
diff --git a/Documentation/arm/Sharp-LH/LCDPanels b/Documentation/arm/Sharp-LH/LCDPanels
deleted file mode 100644
index fb1b21c2f2f4..000000000000
--- a/Documentation/arm/Sharp-LH/LCDPanels
+++ /dev/null
@@ -1,59 +0,0 @@
1README on the LCD Panels
2========================
3
4Configuration options for several LCD panels, available from Logic PD,
5are included in the kernel source. This README will help you
6understand the configuration data and give you some guidance for
7adding support for other panels if you wish.
8
9
10lcd-panels.h
11------------
12
13There is no way, at present, to detect which panel is attached to the
14system at runtime. Thus the kernel configuration is static. The file
15arch/arm/mach-ld7a40x/lcd-panels.h (or similar) defines all of the
16panel specific parameters.
17
18It should be possible for this data to be shared among several device
19families. The current layout may be insufficiently general, but it is
20amenable to improvement.
21
22
23PIXEL_CLOCK
24-----------
25
26The panel data sheets will give a range of acceptable pixel clocks.
27The fundamental LCDCLK input frequency is divided down by a PCD
28constant in field '.tim2'. It may happen that it is impossible to set
29the pixel clock within this range. A clock which is too slow will
30tend to flicker. For the highest quality image, set the clock as high
31as possible.
32
33
34MARGINS
35-------
36
37These values may be difficult to glean from the panel data sheet. In
38the case of the Sharp panels, the upper margin is explicitly called
39out as a specific number of lines from the top of the frame. The
40other values may not matter as much as the panels tend to
41automatically center the image.
42
43
44Sync Sense
45----------
46
47The sense of the hsync and vsync pulses may be called out in the data
48sheet. On one panel, the sense of these pulses determine the height
49of the visible region on the panel. Most of the Sharp panels use
50negative sense sync pulses set by the TIM2_IHS and TIM2_IVS bits in
51'.tim2'.
52
53
54Pel Layout
55----------
56
57The Sharp color TFT panels are all configured for 16 bit direct color
58modes. The amba-lcd driver sets the pel mode to 565 for 5 bits of
59each red and blue and 6 bits of green.
diff --git a/Documentation/arm/Sharp-LH/LPD7A400 b/Documentation/arm/Sharp-LH/LPD7A400
deleted file mode 100644
index 3275b453bfdf..000000000000
--- a/Documentation/arm/Sharp-LH/LPD7A400
+++ /dev/null
@@ -1,15 +0,0 @@
1README on Implementing Linux for the Logic PD LPD7A400-10
2=========================================================
3
4- CPLD memory mapping
5
6 The board designers chose to use high address lines for controlling
7 access to the CPLD registers. It turns out to be a big waste
8 because we're using an MMU and must map IO space into virtual
9 memory. The result is that we have to make a mapping for every
10 register.
11
12- Serial Console
13
14 It may be OK not to use the serial console option if the user passes
15 the console device name to the kernel. This deserves some exploration.
diff --git a/Documentation/arm/Sharp-LH/LPD7A40X b/Documentation/arm/Sharp-LH/LPD7A40X
deleted file mode 100644
index 8c29a27e208f..000000000000
--- a/Documentation/arm/Sharp-LH/LPD7A40X
+++ /dev/null
@@ -1,16 +0,0 @@
1README on Implementing Linux for the Logic PD LPD7A40X-10
2=========================================================
3
4- CPLD memory mapping
5
6 The board designers chose to use high address lines for controlling
7 access to the CPLD registers. It turns out to be a big waste
8 because we're using an MMU and must map IO space into virtual
9 memory. The result is that we have to make a mapping for every
10 register.
11
12- Serial Console
13
14 It may be OK not to use the serial console option if the user passes
15 the console device name to the kernel. This deserves some exploration.
16
diff --git a/Documentation/arm/Sharp-LH/SDRAM b/Documentation/arm/Sharp-LH/SDRAM
deleted file mode 100644
index 93ddc23c2faa..000000000000
--- a/Documentation/arm/Sharp-LH/SDRAM
+++ /dev/null
@@ -1,51 +0,0 @@
1README on the SDRAM Controller for the LH7a40X
2==============================================
3
4The standard configuration for the SDRAM controller generates a sparse
5memory array. The precise layout is determined by the SDRAM chips. A
6default kernel configuration assembles the discontiguous memory
7regions into separate memory nodes via the NUMA (Non-Uniform Memory
8Architecture) facilities. In this default configuration, the kernel
9is forgiving about the precise layout. As long as it is given an
10accurate picture of available memory by the bootloader the kernel will
11execute correctly.
12
13The SDRC supports a mode where some of the chip select lines are
14swapped in order to make SDRAM look like a synchronous ROM. Setting
15this bit means that the RAM will present as a contiguous array. Some
16programmers prefer this to the discontiguous layout. Be aware that
17may be a penalty for this feature where some some configurations of
18memory are significantly reduced; i.e. 64MiB of RAM appears as only 32
19MiB.
20
21There are a couple of configuration options to override the default
22behavior. When the SROMLL bit is set and memory appears as a
23contiguous array, there is no reason to support NUMA.
24CONFIG_LH7A40X_CONTIGMEM disables NUMA support. When physical memory
25is discontiguous, the memory tables are organized such that there are
26two banks per nodes with a small gap between them. This layout wastes
27some kernel memory for page tables representing non-existent memory.
28CONFIG_LH7A40X_ONE_BANK_PER_NODE optimizes the node tables such that
29there are no gaps. These options control the low level organization
30of the memory management tables in ways that may prevent the kernel
31from booting or may cause the kernel to allocated excessively large
32page tables. Be warned. Only change these options if you know what
33you are doing. The default behavior is a reasonable compromise that
34will suit all users.
35
36--
37
38A typical 32MiB system with the default configuration options will
39find physical memory managed as follows.
40
41 node 0: 0xc0000000 4MiB
42 0xc1000000 4MiB
43 node 1: 0xc4000000 4MiB
44 0xc5000000 4MiB
45 node 2: 0xc8000000 4MiB
46 0xc9000000 4MiB
47 node 3: 0xcc000000 4MiB
48 0xcd000000 4MiB
49
50Setting CONFIG_LH7A40X_ONE_BANK_PER_NODE will put each bank into a
51separate node.
diff --git a/Documentation/arm/Sharp-LH/VectoredInterruptController b/Documentation/arm/Sharp-LH/VectoredInterruptController
deleted file mode 100644
index 23047e9861ee..000000000000
--- a/Documentation/arm/Sharp-LH/VectoredInterruptController
+++ /dev/null
@@ -1,80 +0,0 @@
1README on the Vectored Interrupt Controller of the LH7A404
2==========================================================
3
4The 404 revision of the LH7A40X series comes with two vectored
5interrupts controllers. While the kernel does use some of the
6features of these devices, it is far from the purpose for which they
7were designed.
8
9When this README was written, the implementation of the VICs was in
10flux. It is possible that some details, especially with priorities,
11will change.
12
13The VIC support code is inspired by routines written by Sharp.
14
15
16Priority Control
17----------------
18
19The significant reason for using the VIC's vectoring is to control
20interrupt priorities. There are two tables in
21arch/arm/mach-lh7a40x/irq-lh7a404.c that look something like this.
22
23 static unsigned char irq_pri_vic1[] = { IRQ_GPIO3INTR, };
24 static unsigned char irq_pri_vic2[] = {
25 IRQ_T3UI, IRQ_GPIO7INTR,
26 IRQ_UART1INTR, IRQ_UART2INTR, IRQ_UART3INTR, };
27
28The initialization code reads these tables and inserts a vector
29address and enable for each indicated IRQ. Vectored interrupts have
30higher priority than non-vectored interrupts. So, on VIC1,
31IRQ_GPIO3INTR will be served before any other non-FIQ interrupt. Due
32to the way that the vectoring works, IRQ_T3UI is the next highest
33priority followed by the other vectored interrupts on VIC2. After
34that, the non-vectored interrupts are scanned in VIC1 then in VIC2.
35
36
37ISR
38---
39
40The interrupt service routine macro get_irqnr() in
41arch/arm/kernel/entry-armv.S scans the VICs for the next active
42interrupt. The vectoring makes this code somewhat larger than it was
43before using vectoring (refer to the LH7A400 implementation). In the
44case where an interrupt is vectored, the implementation will tend to
45be faster than the non-vectored version. However, the worst-case path
46is longer.
47
48It is worth noting that at present, there is no need to read
49VIC2_VECTADDR because the register appears to be shared between the
50controllers. The code is written such that if this changes, it ought
51to still work properly.
52
53
54Vector Addresses
55----------------
56
57The proper use of the vectoring hardware would jump to the ISR
58specified by the vectoring address. Linux isn't structured to take
59advantage of this feature, though it might be possible to change
60things to support it.
61
62In this implementation, the vectoring address is used to speed the
63search for the active IRQ. The address is coded such that the lowest
646 bits store the IRQ number for vectored interrupts. These numbers
65correspond to the bits in the interrupt status registers. IRQ zero is
66the lowest interrupt bit in VIC1. IRQ 32 is the lowest interrupt bit
67in VIC2. Because zero is a valid IRQ number and because we cannot
68detect whether or not there is a valid vectoring address if that
69address is zero, the eigth bit (0x100) is set for vectored interrupts.
70The address for IRQ 0x18 (VIC2) is 0x118. Only the ninth bit is set
71for the default handler on VIC1 and only the tenth bit is set for the
72default handler on VIC2.
73
74In other words.
75
76 0x000 - no active interrupt
77 0x1ii - vectored interrupt 0xii
78 0x2xx - unvectored interrupt on VIC1 (xx is don't care)
79 0x4xx - unvectored interrupt on VIC2 (xx is don't care)
80
diff --git a/Documentation/arm/msm/gpiomux.txt b/Documentation/arm/msm/gpiomux.txt
new file mode 100644
index 000000000000..67a81620adf6
--- /dev/null
+++ b/Documentation/arm/msm/gpiomux.txt
@@ -0,0 +1,176 @@
1This document provides an overview of the msm_gpiomux interface, which
2is used to provide gpio pin multiplexing and configuration on mach-msm
3targets.
4
5History
6=======
7
8The first-generation API for gpio configuration & multiplexing on msm
9is the function gpio_tlmm_config(). This function has a few notable
10shortcomings, which led to its deprecation and replacement by gpiomux:
11
12The 'disable' parameter: Setting the second parameter to
13gpio_tlmm_config to GPIO_CFG_DISABLE tells the peripheral
14processor in charge of the subsystem to perform a look-up into a
15low-power table and apply the low-power/sleep setting for the pin.
16As the msm family evolved this became problematic. Not all pins
17have sleep settings, not all peripheral processors will accept requests
18to apply said sleep settings, and not all msm targets have their gpio
19subsystems managed by a peripheral processor. In order to get consistent
20behavior on all targets, drivers are forced to ignore this parameter,
21rendering it useless.
22
23The 'direction' flag: for all mux-settings other than raw-gpio (0),
24the output-enable bit of a gpio is hard-wired to a known
25input (usually VDD or ground). For those settings, the direction flag
26is meaningless at best, and deceptive at worst. In addition, using the
27direction flag to change output-enable (OE) directly can cause trouble in
28gpiolib, which has no visibility into gpio direction changes made
29in this way. Direction control in gpio mode should be made through gpiolib.
30
31Key Features of gpiomux
32=======================
33
34- A consistent interface across all generations of msm. Drivers can expect
35the same results on every target.
36- gpiomux plays nicely with gpiolib. Functions that should belong to gpiolib
37are left to gpiolib and not duplicated here. gpiomux is written with the
38intent that gpio_chips will call gpiomux reference-counting methods
39from their request() and free() hooks, providing full integration.
40- Tabular configuration. Instead of having to call gpio_tlmm_config
41hundreds of times, gpio configuration is placed in a single table.
42- Per-gpio sleep. Each gpio is individually reference counted, allowing only
43those lines which are in use to be put in high-power states.
44- 0 means 'do nothing': all flags are designed so that the default memset-zero
45equates to a sensible default of 'no configuration', preventing users
46from having to provide hundreds of 'no-op' configs for unused or
47unwanted lines.
48
49Usage
50=====
51
52To use gpiomux, provide configuration information for relevant gpio lines
53in the msm_gpiomux_configs table. Since a 0 equates to "unconfigured",
54only those lines to be managed by gpiomux need to be specified. Here
55is a completely fictional example:
56
57struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = {
58 [12] = {
59 .active = GPIOMUX_VALID | GPIOMUX_DRV_8MA | GPIOMUX_FUNC_1,
60 .suspended = GPIOMUX_VALID | GPIOMUX_PULL_DOWN,
61 },
62 [34] = {
63 .suspended = GPIOMUX_VALID | GPIOMUX_PULL_DOWN,
64 },
65};
66
67To indicate that a gpio is in use, call msm_gpiomux_get() to increase
68its reference count. To decrease the reference count, call msm_gpiomux_put().
69
70The effect of this configuration is as follows:
71
72When the system boots, gpios 12 and 34 will be initialized with their
73'suspended' configurations. All other gpios, which were left unconfigured,
74will not be touched.
75
76When msm_gpiomux_get() is called on gpio 12 to raise its reference count
77above 0, its active configuration will be applied. Since no other gpio
78line has a valid active configuration, msm_gpiomux_get() will have no
79effect on any other line.
80
81When msm_gpiomux_put() is called on gpio 12 or 34 to drop their reference
82count to 0, their suspended configurations will be applied.
83Since no other gpio line has a valid suspended configuration, no other
84gpio line will be effected by msm_gpiomux_put(). Since gpio 34 has no valid
85active configuration, this is effectively a no-op for gpio 34 as well,
86with one small caveat, see the section "About Output-Enable Settings".
87
88All of the GPIOMUX_VALID flags may seem like unnecessary overhead, but
89they address some important issues. As unused entries (all those
90except 12 and 34) are zero-filled, gpiomux needs a way to distinguish
91the used fields from the unused. In addition, the all-zero pattern
92is a valid configuration! Therefore, gpiomux defines an additional bit
93which is used to indicate when a field is used. This has the pleasant
94side-effect of allowing calls to msm_gpiomux_write to use '0' to indicate
95that a value should not be changed:
96
97 msm_gpiomux_write(0, GPIOMUX_VALID, 0);
98
99replaces the active configuration of gpio 0 with an all-zero configuration,
100but leaves the suspended configuration as it was.
101
102Static Configurations
103=====================
104
105To install a static configuration, which is applied at boot and does
106not change after that, install a configuration with a suspended component
107but no active component, as in the previous example:
108
109 [34] = {
110 .suspended = GPIOMUX_VALID | GPIOMUX_PULL_DOWN,
111 },
112
113The suspended setting is applied during boot, and the lack of any valid
114active setting prevents any other setting from being applied at runtime.
115If other subsystems attempting to access the line is a concern, one could
116*really* anchor the configuration down by calling msm_gpiomux_get on the
117line at initialization to move the line into active mode. With the line
118held, it will never be re-suspended, and with no valid active configuration,
119no new configurations will be applied.
120
121But then, if having other subsystems grabbing for the line is truly a concern,
122it should be reserved with gpio_request instead, which carries an implicit
123msm_gpiomux_get.
124
125gpiomux and gpiolib
126===================
127
128It is expected that msm gpio_chips will call msm_gpiomux_get() and
129msm_gpiomux_put() from their request and free hooks, like this fictional
130example:
131
132static int request(struct gpio_chip *chip, unsigned offset)
133{
134 return msm_gpiomux_get(chip->base + offset);
135}
136
137static void free(struct gpio_chip *chip, unsigned offset)
138{
139 msm_gpiomux_put(chip->base + offset);
140}
141
142 ...somewhere in a gpio_chip declaration...
143 .request = request,
144 .free = free,
145
146This provides important functionality:
147- It guarantees that a gpio line will have its 'active' config applied
148 when the line is requested, and will not be suspended while the line
149 remains requested; and
150- It guarantees that gpio-direction settings from gpiolib behave sensibly.
151 See "About Output-Enable Settings."
152
153This mechanism allows for "auto-request" of gpiomux lines via gpiolib
154when it is suitable. Drivers wishing more exact control are, of course,
155free to also use msm_gpiomux_set and msm_gpiomux_get.
156
157About Output-Enable Settings
158============================
159
160Some msm targets do not have the ability to query the current gpio
161configuration setting. This means that changes made to the output-enable
162(OE) bit by gpiolib cannot be consistently detected and preserved by gpiomux.
163Therefore, when gpiomux applies a configuration setting, any direction
164settings which may have been applied by gpiolib are lost and the default
165input settings are re-applied.
166
167For this reason, drivers should not assume that gpio direction settings
168continue to hold if they free and then re-request a gpio. This seems like
169common sense - after all, anybody could have obtained the line in the
170meantime - but it needs saying.
171
172This also means that calls to msm_gpiomux_write will reset the OE bit,
173which means that if the gpio line is held by a client of gpiolib and
174msm_gpiomux_write is called, the direction setting has been lost and
175gpiolib's internal state has been broken.
176Release gpio lines before reconfiguring them.
diff --git a/Documentation/arm/swp_emulation b/Documentation/arm/swp_emulation
new file mode 100644
index 000000000000..af903d22fd93
--- /dev/null
+++ b/Documentation/arm/swp_emulation
@@ -0,0 +1,27 @@
1Software emulation of deprecated SWP instruction (CONFIG_SWP_EMULATE)
2---------------------------------------------------------------------
3
4ARMv6 architecture deprecates use of the SWP/SWPB instructions, and recommeds
5moving to the load-locked/store-conditional instructions LDREX and STREX.
6
7ARMv7 multiprocessing extensions introduce the ability to disable these
8instructions, triggering an undefined instruction exception when executed.
9Trapped instructions are emulated using an LDREX/STREX or LDREXB/STREXB
10sequence. If a memory access fault (an abort) occurs, a segmentation fault is
11signalled to the triggering process.
12
13/proc/cpu/swp_emulation holds some statistics/information, including the PID of
14the last process to trigger the emulation to be invocated. For example:
15---
16Emulated SWP: 12
17Emulated SWPB: 0
18Aborted SWP{B}: 1
19Last process: 314
20---
21
22NOTE: when accessing uncached shared regions, LDREX/STREX rely on an external
23transaction monitoring block called a global monitor to maintain update
24atomicity. If your system does not implement a global monitor, this option can
25cause programs that perform SWP operations to uncached memory to deadlock, as
26the STREX operation will always fail.
27
diff --git a/Documentation/atomic_ops.txt b/Documentation/atomic_ops.txt
index ac4d47187122..3bd585b44927 100644
--- a/Documentation/atomic_ops.txt
+++ b/Documentation/atomic_ops.txt
@@ -12,7 +12,7 @@ Also, it should be made opaque such that any kind of cast to a normal
12C integer type will fail. Something like the following should 12C integer type will fail. Something like the following should
13suffice: 13suffice:
14 14
15 typedef struct { volatile int counter; } atomic_t; 15 typedef struct { int counter; } atomic_t;
16 16
17Historically, counter has been declared volatile. This is now discouraged. 17Historically, counter has been declared volatile. This is now discouraged.
18See Documentation/volatile-considered-harmful.txt for the complete rationale. 18See Documentation/volatile-considered-harmful.txt for the complete rationale.
diff --git a/Documentation/block/00-INDEX b/Documentation/block/00-INDEX
index a406286f6f3e..d111e3b23db0 100644
--- a/Documentation/block/00-INDEX
+++ b/Documentation/block/00-INDEX
@@ -1,7 +1,5 @@
100-INDEX 100-INDEX
2 - This file 2 - This file
3barrier.txt
4 - I/O Barriers
5biodoc.txt 3biodoc.txt
6 - Notes on the Generic Block Layer Rewrite in Linux 2.5 4 - Notes on the Generic Block Layer Rewrite in Linux 2.5
7capability.txt 5capability.txt
@@ -16,3 +14,5 @@ stat.txt
16 - Block layer statistics in /sys/block/<dev>/stat 14 - Block layer statistics in /sys/block/<dev>/stat
17switching-sched.txt 15switching-sched.txt
18 - Switching I/O schedulers at runtime 16 - Switching I/O schedulers at runtime
17writeback_cache_control.txt
18 - Control of volatile write back caches
diff --git a/Documentation/block/barrier.txt b/Documentation/block/barrier.txt
deleted file mode 100644
index 2c2f24f634e4..000000000000
--- a/Documentation/block/barrier.txt
+++ /dev/null
@@ -1,261 +0,0 @@
1I/O Barriers
2============
3Tejun Heo <htejun@gmail.com>, July 22 2005
4
5I/O barrier requests are used to guarantee ordering around the barrier
6requests. Unless you're crazy enough to use disk drives for
7implementing synchronization constructs (wow, sounds interesting...),
8the ordering is meaningful only for write requests for things like
9journal checkpoints. All requests queued before a barrier request
10must be finished (made it to the physical medium) before the barrier
11request is started, and all requests queued after the barrier request
12must be started only after the barrier request is finished (again,
13made it to the physical medium).
14
15In other words, I/O barrier requests have the following two properties.
16
171. Request ordering
18
19Requests cannot pass the barrier request. Preceding requests are
20processed before the barrier and following requests after.
21
22Depending on what features a drive supports, this can be done in one
23of the following three ways.
24
25i. For devices which have queue depth greater than 1 (TCQ devices) and
26support ordered tags, block layer can just issue the barrier as an
27ordered request and the lower level driver, controller and drive
28itself are responsible for making sure that the ordering constraint is
29met. Most modern SCSI controllers/drives should support this.
30
31NOTE: SCSI ordered tag isn't currently used due to limitation in the
32 SCSI midlayer, see the following random notes section.
33
34ii. For devices which have queue depth greater than 1 but don't
35support ordered tags, block layer ensures that the requests preceding
36a barrier request finishes before issuing the barrier request. Also,
37it defers requests following the barrier until the barrier request is
38finished. Older SCSI controllers/drives and SATA drives fall in this
39category.
40
41iii. Devices which have queue depth of 1. This is a degenerate case
42of ii. Just keeping issue order suffices. Ancient SCSI
43controllers/drives and IDE drives are in this category.
44
452. Forced flushing to physical medium
46
47Again, if you're not gonna do synchronization with disk drives (dang,
48it sounds even more appealing now!), the reason you use I/O barriers
49is mainly to protect filesystem integrity when power failure or some
50other events abruptly stop the drive from operating and possibly make
51the drive lose data in its cache. So, I/O barriers need to guarantee
52that requests actually get written to non-volatile medium in order.
53
54There are four cases,
55
56i. No write-back cache. Keeping requests ordered is enough.
57
58ii. Write-back cache but no flush operation. There's no way to
59guarantee physical-medium commit order. This kind of devices can't to
60I/O barriers.
61
62iii. Write-back cache and flush operation but no FUA (forced unit
63access). We need two cache flushes - before and after the barrier
64request.
65
66iv. Write-back cache, flush operation and FUA. We still need one
67flush to make sure requests preceding a barrier are written to medium,
68but post-barrier flush can be avoided by using FUA write on the
69barrier itself.
70
71
72How to support barrier requests in drivers
73------------------------------------------
74
75All barrier handling is done inside block layer proper. All low level
76drivers have to are implementing its prepare_flush_fn and using one
77the following two functions to indicate what barrier type it supports
78and how to prepare flush requests. Note that the term 'ordered' is
79used to indicate the whole sequence of performing barrier requests
80including draining and flushing.
81
82typedef void (prepare_flush_fn)(struct request_queue *q, struct request *rq);
83
84int blk_queue_ordered(struct request_queue *q, unsigned ordered,
85 prepare_flush_fn *prepare_flush_fn);
86
87@q : the queue in question
88@ordered : the ordered mode the driver/device supports
89@prepare_flush_fn : this function should prepare @rq such that it
90 flushes cache to physical medium when executed
91
92For example, SCSI disk driver's prepare_flush_fn looks like the
93following.
94
95static void sd_prepare_flush(struct request_queue *q, struct request *rq)
96{
97 memset(rq->cmd, 0, sizeof(rq->cmd));
98 rq->cmd_type = REQ_TYPE_BLOCK_PC;
99 rq->timeout = SD_TIMEOUT;
100 rq->cmd[0] = SYNCHRONIZE_CACHE;
101 rq->cmd_len = 10;
102}
103
104The following seven ordered modes are supported. The following table
105shows which mode should be used depending on what features a
106device/driver supports. In the leftmost column of table,
107QUEUE_ORDERED_ prefix is omitted from the mode names to save space.
108
109The table is followed by description of each mode. Note that in the
110descriptions of QUEUE_ORDERED_DRAIN*, '=>' is used whereas '->' is
111used for QUEUE_ORDERED_TAG* descriptions. '=>' indicates that the
112preceding step must be complete before proceeding to the next step.
113'->' indicates that the next step can start as soon as the previous
114step is issued.
115
116 write-back cache ordered tag flush FUA
117-----------------------------------------------------------------------
118NONE yes/no N/A no N/A
119DRAIN no no N/A N/A
120DRAIN_FLUSH yes no yes no
121DRAIN_FUA yes no yes yes
122TAG no yes N/A N/A
123TAG_FLUSH yes yes yes no
124TAG_FUA yes yes yes yes
125
126
127QUEUE_ORDERED_NONE
128 I/O barriers are not needed and/or supported.
129
130 Sequence: N/A
131
132QUEUE_ORDERED_DRAIN
133 Requests are ordered by draining the request queue and cache
134 flushing isn't needed.
135
136 Sequence: drain => barrier
137
138QUEUE_ORDERED_DRAIN_FLUSH
139 Requests are ordered by draining the request queue and both
140 pre-barrier and post-barrier cache flushings are needed.
141
142 Sequence: drain => preflush => barrier => postflush
143
144QUEUE_ORDERED_DRAIN_FUA
145 Requests are ordered by draining the request queue and
146 pre-barrier cache flushing is needed. By using FUA on barrier
147 request, post-barrier flushing can be skipped.
148
149 Sequence: drain => preflush => barrier
150
151QUEUE_ORDERED_TAG
152 Requests are ordered by ordered tag and cache flushing isn't
153 needed.
154
155 Sequence: barrier
156
157QUEUE_ORDERED_TAG_FLUSH
158 Requests are ordered by ordered tag and both pre-barrier and
159 post-barrier cache flushings are needed.
160
161 Sequence: preflush -> barrier -> postflush
162
163QUEUE_ORDERED_TAG_FUA
164 Requests are ordered by ordered tag and pre-barrier cache
165 flushing is needed. By using FUA on barrier request,
166 post-barrier flushing can be skipped.
167
168 Sequence: preflush -> barrier
169
170
171Random notes/caveats
172--------------------
173
174* SCSI layer currently can't use TAG ordering even if the drive,
175controller and driver support it. The problem is that SCSI midlayer
176request dispatch function is not atomic. It releases queue lock and
177switch to SCSI host lock during issue and it's possible and likely to
178happen in time that requests change their relative positions. Once
179this problem is solved, TAG ordering can be enabled.
180
181* Currently, no matter which ordered mode is used, there can be only
182one barrier request in progress. All I/O barriers are held off by
183block layer until the previous I/O barrier is complete. This doesn't
184make any difference for DRAIN ordered devices, but, for TAG ordered
185devices with very high command latency, passing multiple I/O barriers
186to low level *might* be helpful if they are very frequent. Well, this
187certainly is a non-issue. I'm writing this just to make clear that no
188two I/O barrier is ever passed to low-level driver.
189
190* Completion order. Requests in ordered sequence are issued in order
191but not required to finish in order. Barrier implementation can
192handle out-of-order completion of ordered sequence. IOW, the requests
193MUST be processed in order but the hardware/software completion paths
194are allowed to reorder completion notifications - eg. current SCSI
195midlayer doesn't preserve completion order during error handling.
196
197* Requeueing order. Low-level drivers are free to requeue any request
198after they removed it from the request queue with
199blkdev_dequeue_request(). As barrier sequence should be kept in order
200when requeued, generic elevator code takes care of putting requests in
201order around barrier. See blk_ordered_req_seq() and
202ELEVATOR_INSERT_REQUEUE handling in __elv_add_request() for details.
203
204Note that block drivers must not requeue preceding requests while
205completing latter requests in an ordered sequence. Currently, no
206error checking is done against this.
207
208* Error handling. Currently, block layer will report error to upper
209layer if any of requests in an ordered sequence fails. Unfortunately,
210this doesn't seem to be enough. Look at the following request flow.
211QUEUE_ORDERED_TAG_FLUSH is in use.
212
213 [0] [1] [2] [3] [pre] [barrier] [post] < [4] [5] [6] ... >
214 still in elevator
215
216Let's say request [2], [3] are write requests to update file system
217metadata (journal or whatever) and [barrier] is used to mark that
218those updates are valid. Consider the following sequence.
219
220 i. Requests [0] ~ [post] leaves the request queue and enters
221 low-level driver.
222 ii. After a while, unfortunately, something goes wrong and the
223 drive fails [2]. Note that any of [0], [1] and [3] could have
224 completed by this time, but [pre] couldn't have been finished
225 as the drive must process it in order and it failed before
226 processing that command.
227 iii. Error handling kicks in and determines that the error is
228 unrecoverable and fails [2], and resumes operation.
229 iv. [pre] [barrier] [post] gets processed.
230 v. *BOOM* power fails
231
232The problem here is that the barrier request is *supposed* to indicate
233that filesystem update requests [2] and [3] made it safely to the
234physical medium and, if the machine crashes after the barrier is
235written, filesystem recovery code can depend on that. Sadly, that
236isn't true in this case anymore. IOW, the success of a I/O barrier
237should also be dependent on success of some of the preceding requests,
238where only upper layer (filesystem) knows what 'some' is.
239
240This can be solved by implementing a way to tell the block layer which
241requests affect the success of the following barrier request and
242making lower lever drivers to resume operation on error only after
243block layer tells it to do so.
244
245As the probability of this happening is very low and the drive should
246be faulty, implementing the fix is probably an overkill. But, still,
247it's there.
248
249* In previous drafts of barrier implementation, there was fallback
250mechanism such that, if FUA or ordered TAG fails, less fancy ordered
251mode can be selected and the failed barrier request is retried
252automatically. The rationale for this feature was that as FUA is
253pretty new in ATA world and ordered tag was never used widely, there
254could be devices which report to support those features but choke when
255actually given such requests.
256
257 This was removed for two reasons 1. it's an overkill 2. it's
258impossible to implement properly when TAG ordering is used as low
259level drivers resume after an error automatically. If it's ever
260needed adding it back and modifying low level drivers accordingly
261shouldn't be difficult.
diff --git a/Documentation/block/biodoc.txt b/Documentation/block/biodoc.txt
index b9a83dd24732..c6d84cfd2f56 100644
--- a/Documentation/block/biodoc.txt
+++ b/Documentation/block/biodoc.txt
@@ -497,7 +497,7 @@ The scatter gather list is in the form of an array of <page, offset, len>
497entries with their corresponding dma address mappings filled in at the 497entries with their corresponding dma address mappings filled in at the
498appropriate time. As an optimization, contiguous physical pages can be 498appropriate time. As an optimization, contiguous physical pages can be
499covered by a single entry where <page> refers to the first page and <len> 499covered by a single entry where <page> refers to the first page and <len>
500covers the range of pages (upto 16 contiguous pages could be covered this 500covers the range of pages (up to 16 contiguous pages could be covered this
501way). There is a helper routine (blk_rq_map_sg) which drivers can use to build 501way). There is a helper routine (blk_rq_map_sg) which drivers can use to build
502the sg list. 502the sg list.
503 503
@@ -565,7 +565,7 @@ struct request {
565 . 565 .
566 int tag; /* command tag associated with request */ 566 int tag; /* command tag associated with request */
567 void *special; /* same as before */ 567 void *special; /* same as before */
568 char *buffer; /* valid only for low memory buffers upto 568 char *buffer; /* valid only for low memory buffers up to
569 current_nr_sectors */ 569 current_nr_sectors */
570 . 570 .
571 . 571 .
@@ -963,11 +963,6 @@ elevator_dispatch_fn* fills the dispatch queue with ready requests.
963 963
964elevator_add_req_fn* called to add a new request into the scheduler 964elevator_add_req_fn* called to add a new request into the scheduler
965 965
966elevator_queue_empty_fn returns true if the merge queue is empty.
967 Drivers shouldn't use this, but rather check
968 if elv_next_request is NULL (without losing the
969 request if one exists!)
970
971elevator_former_req_fn 966elevator_former_req_fn
972elevator_latter_req_fn These return the request before or after the 967elevator_latter_req_fn These return the request before or after the
973 one specified in disk sort order. Used by the 968 one specified in disk sort order. Used by the
diff --git a/Documentation/block/switching-sched.txt b/Documentation/block/switching-sched.txt
index d5af3f630814..71cfbdc0f74d 100644
--- a/Documentation/block/switching-sched.txt
+++ b/Documentation/block/switching-sched.txt
@@ -16,7 +16,7 @@ you can do so by typing:
16As of the Linux 2.6.10 kernel, it is now possible to change the 16As of the Linux 2.6.10 kernel, it is now possible to change the
17IO scheduler for a given block device on the fly (thus making it possible, 17IO scheduler for a given block device on the fly (thus making it possible,
18for instance, to set the CFQ scheduler for the system default, but 18for instance, to set the CFQ scheduler for the system default, but
19set a specific device to use the anticipatory or noop schedulers - which 19set a specific device to use the deadline or noop schedulers - which
20can improve that device's throughput). 20can improve that device's throughput).
21 21
22To set a specific scheduler, simply do this: 22To set a specific scheduler, simply do this:
@@ -31,7 +31,7 @@ a "cat /sys/block/DEV/queue/scheduler" - the list of valid names
31will be displayed, with the currently selected scheduler in brackets: 31will be displayed, with the currently selected scheduler in brackets:
32 32
33# cat /sys/block/hda/queue/scheduler 33# cat /sys/block/hda/queue/scheduler
34noop anticipatory deadline [cfq] 34noop deadline [cfq]
35# echo anticipatory > /sys/block/hda/queue/scheduler 35# echo deadline > /sys/block/hda/queue/scheduler
36# cat /sys/block/hda/queue/scheduler 36# cat /sys/block/hda/queue/scheduler
37noop [anticipatory] deadline cfq 37noop [deadline] cfq
diff --git a/Documentation/block/writeback_cache_control.txt b/Documentation/block/writeback_cache_control.txt
new file mode 100644
index 000000000000..83407d36630a
--- /dev/null
+++ b/Documentation/block/writeback_cache_control.txt
@@ -0,0 +1,86 @@
1
2Explicit volatile write back cache control
3=====================================
4
5Introduction
6------------
7
8Many storage devices, especially in the consumer market, come with volatile
9write back caches. That means the devices signal I/O completion to the
10operating system before data actually has hit the non-volatile storage. This
11behavior obviously speeds up various workloads, but it means the operating
12system needs to force data out to the non-volatile storage when it performs
13a data integrity operation like fsync, sync or an unmount.
14
15The Linux block layer provides two simple mechanisms that let filesystems
16control the caching behavior of the storage device. These mechanisms are
17a forced cache flush, and the Force Unit Access (FUA) flag for requests.
18
19
20Explicit cache flushes
21----------------------
22
23The REQ_FLUSH flag can be OR ed into the r/w flags of a bio submitted from
24the filesystem and will make sure the volatile cache of the storage device
25has been flushed before the actual I/O operation is started. This explicitly
26guarantees that previously completed write requests are on non-volatile
27storage before the flagged bio starts. In addition the REQ_FLUSH flag can be
28set on an otherwise empty bio structure, which causes only an explicit cache
29flush without any dependent I/O. It is recommend to use
30the blkdev_issue_flush() helper for a pure cache flush.
31
32
33Forced Unit Access
34-----------------
35
36The REQ_FUA flag can be OR ed into the r/w flags of a bio submitted from the
37filesystem and will make sure that I/O completion for this request is only
38signaled after the data has been committed to non-volatile storage.
39
40
41Implementation details for filesystems
42--------------------------------------
43
44Filesystems can simply set the REQ_FLUSH and REQ_FUA bits and do not have to
45worry if the underlying devices need any explicit cache flushing and how
46the Forced Unit Access is implemented. The REQ_FLUSH and REQ_FUA flags
47may both be set on a single bio.
48
49
50Implementation details for make_request_fn based block drivers
51--------------------------------------------------------------
52
53These drivers will always see the REQ_FLUSH and REQ_FUA bits as they sit
54directly below the submit_bio interface. For remapping drivers the REQ_FUA
55bits need to be propagated to underlying devices, and a global flush needs
56to be implemented for bios with the REQ_FLUSH bit set. For real device
57drivers that do not have a volatile cache the REQ_FLUSH and REQ_FUA bits
58on non-empty bios can simply be ignored, and REQ_FLUSH requests without
59data can be completed successfully without doing any work. Drivers for
60devices with volatile caches need to implement the support for these
61flags themselves without any help from the block layer.
62
63
64Implementation details for request_fn based block drivers
65--------------------------------------------------------------
66
67For devices that do not support volatile write caches there is no driver
68support required, the block layer completes empty REQ_FLUSH requests before
69entering the driver and strips off the REQ_FLUSH and REQ_FUA bits from
70requests that have a payload. For devices with volatile write caches the
71driver needs to tell the block layer that it supports flushing caches by
72doing:
73
74 blk_queue_flush(sdkp->disk->queue, REQ_FLUSH);
75
76and handle empty REQ_FLUSH requests in its prep_fn/request_fn. Note that
77REQ_FLUSH requests with a payload are automatically turned into a sequence
78of an empty REQ_FLUSH request followed by the actual write by the block
79layer. For devices that also support the FUA bit the block layer needs
80to be told to pass through the REQ_FUA bit using:
81
82 blk_queue_flush(sdkp->disk->queue, REQ_FLUSH | REQ_FUA);
83
84and the driver must handle write requests that have the REQ_FUA bit set
85in prep_fn/request_fn. If the FUA bit is not natively supported the block
86layer turns it into an empty REQ_FLUSH request after the actual write.
diff --git a/Documentation/blockdev/cciss.txt b/Documentation/blockdev/cciss.txt
index 89698e8df7d4..c00c6a5ab21f 100644
--- a/Documentation/blockdev/cciss.txt
+++ b/Documentation/blockdev/cciss.txt
@@ -169,3 +169,18 @@ is issued which positions the tape to a known position. Typically you
169must rewind the tape (by issuing "mt -f /dev/st0 rewind" for example) 169must rewind the tape (by issuing "mt -f /dev/st0 rewind" for example)
170before i/o can proceed again to a tape drive which was reset. 170before i/o can proceed again to a tape drive which was reset.
171 171
172There is a cciss_tape_cmds module parameter which can be used to make cciss
173allocate more commands for use by tape drives. Ordinarily only a few commands
174(6) are allocated for tape drives because tape drives are slow and
175infrequently used and the primary purpose of Smart Array controllers is to
176act as a RAID controller for disk drives, so the vast majority of commands
177are allocated for disk devices. However, if you have more than a few tape
178drives attached to a smart array, the default number of commands may not be
179enought (for example, if you have 8 tape drives, you could only rewind 6
180at one time with the default number of commands.) The cciss_tape_cmds module
181parameter allows more commands (up to 16 more) to be allocated for use by
182tape drives. For example:
183
184 insmod cciss.ko cciss_tape_cmds=16
185
186Or, as a kernel boot parameter passed in via grub: cciss.cciss_tape_cmds=8
diff --git a/Documentation/cachetlb.txt b/Documentation/cachetlb.txt
index 9164ae3b83bc..9b728dc17535 100644
--- a/Documentation/cachetlb.txt
+++ b/Documentation/cachetlb.txt
@@ -16,7 +16,7 @@ on all processors in the system. Don't let this scare you into
16thinking SMP cache/tlb flushing must be so inefficient, this is in 16thinking SMP cache/tlb flushing must be so inefficient, this is in
17fact an area where many optimizations are possible. For example, 17fact an area where many optimizations are possible. For example,
18if it can be proven that a user address space has never executed 18if it can be proven that a user address space has never executed
19on a cpu (see vma->cpu_vm_mask), one need not perform a flush 19on a cpu (see mm_cpumask()), one need not perform a flush
20for this address space on that cpu. 20for this address space on that cpu.
21 21
22First, the TLB flushing interfaces, since they are the simplest. The 22First, the TLB flushing interfaces, since they are the simplest. The
diff --git a/Documentation/cgroups/blkio-controller.txt b/Documentation/cgroups/blkio-controller.txt
index 6919d62591d9..84f0a15fc210 100644
--- a/Documentation/cgroups/blkio-controller.txt
+++ b/Documentation/cgroups/blkio-controller.txt
@@ -8,12 +8,17 @@ both at leaf nodes as well as at intermediate nodes in a storage hierarchy.
8Plan is to use the same cgroup based management interface for blkio controller 8Plan is to use the same cgroup based management interface for blkio controller
9and based on user options switch IO policies in the background. 9and based on user options switch IO policies in the background.
10 10
11In the first phase, this patchset implements proportional weight time based 11Currently two IO control policies are implemented. First one is proportional
12division of disk policy. It is implemented in CFQ. Hence this policy takes 12weight time based division of disk policy. It is implemented in CFQ. Hence
13effect only on leaf nodes when CFQ is being used. 13this policy takes effect only on leaf nodes when CFQ is being used. The second
14one is throttling policy which can be used to specify upper IO rate limits
15on devices. This policy is implemented in generic block layer and can be
16used on leaf nodes as well as higher level logical devices like device mapper.
14 17
15HOWTO 18HOWTO
16===== 19=====
20Proportional Weight division of bandwidth
21-----------------------------------------
17You can do a very simple testing of running two dd threads in two different 22You can do a very simple testing of running two dd threads in two different
18cgroups. Here is what you can do. 23cgroups. Here is what you can do.
19 24
@@ -23,16 +28,19 @@ cgroups. Here is what you can do.
23- Enable group scheduling in CFQ 28- Enable group scheduling in CFQ
24 CONFIG_CFQ_GROUP_IOSCHED=y 29 CONFIG_CFQ_GROUP_IOSCHED=y
25 30
26- Compile and boot into kernel and mount IO controller (blkio). 31- Compile and boot into kernel and mount IO controller (blkio); see
32 cgroups.txt, Why are cgroups needed?.
27 33
28 mount -t cgroup -o blkio none /cgroup 34 mount -t tmpfs cgroup_root /sys/fs/cgroup
35 mkdir /sys/fs/cgroup/blkio
36 mount -t cgroup -o blkio none /sys/fs/cgroup/blkio
29 37
30- Create two cgroups 38- Create two cgroups
31 mkdir -p /cgroup/test1/ /cgroup/test2 39 mkdir -p /sys/fs/cgroup/blkio/test1/ /sys/fs/cgroup/blkio/test2
32 40
33- Set weights of group test1 and test2 41- Set weights of group test1 and test2
34 echo 1000 > /cgroup/test1/blkio.weight 42 echo 1000 > /sys/fs/cgroup/blkio/test1/blkio.weight
35 echo 500 > /cgroup/test2/blkio.weight 43 echo 500 > /sys/fs/cgroup/blkio/test2/blkio.weight
36 44
37- Create two same size files (say 512MB each) on same disk (file1, file2) and 45- Create two same size files (say 512MB each) on same disk (file1, file2) and
38 launch two dd threads in different cgroup to read those files. 46 launch two dd threads in different cgroup to read those files.
@@ -41,12 +49,12 @@ cgroups. Here is what you can do.
41 echo 3 > /proc/sys/vm/drop_caches 49 echo 3 > /proc/sys/vm/drop_caches
42 50
43 dd if=/mnt/sdb/zerofile1 of=/dev/null & 51 dd if=/mnt/sdb/zerofile1 of=/dev/null &
44 echo $! > /cgroup/test1/tasks 52 echo $! > /sys/fs/cgroup/blkio/test1/tasks
45 cat /cgroup/test1/tasks 53 cat /sys/fs/cgroup/blkio/test1/tasks
46 54
47 dd if=/mnt/sdb/zerofile2 of=/dev/null & 55 dd if=/mnt/sdb/zerofile2 of=/dev/null &
48 echo $! > /cgroup/test2/tasks 56 echo $! > /sys/fs/cgroup/blkio/test2/tasks
49 cat /cgroup/test2/tasks 57 cat /sys/fs/cgroup/blkio/test2/tasks
50 58
51- At macro level, first dd should finish first. To get more precise data, keep 59- At macro level, first dd should finish first. To get more precise data, keep
52 on looking at (with the help of script), at blkio.disk_time and 60 on looking at (with the help of script), at blkio.disk_time and
@@ -55,6 +63,62 @@ cgroups. Here is what you can do.
55 group dispatched to the disk. We provide fairness in terms of disk time, so 63 group dispatched to the disk. We provide fairness in terms of disk time, so
56 ideally io.disk_time of cgroups should be in proportion to the weight. 64 ideally io.disk_time of cgroups should be in proportion to the weight.
57 65
66Throttling/Upper Limit policy
67-----------------------------
68- Enable Block IO controller
69 CONFIG_BLK_CGROUP=y
70
71- Enable throttling in block layer
72 CONFIG_BLK_DEV_THROTTLING=y
73
74- Mount blkio controller (see cgroups.txt, Why are cgroups needed?)
75 mount -t cgroup -o blkio none /sys/fs/cgroup/blkio
76
77- Specify a bandwidth rate on particular device for root group. The format
78 for policy is "<major>:<minor> <byes_per_second>".
79
80 echo "8:16 1048576" > /sys/fs/cgroup/blkio/blkio.throttle.read_bps_device
81
82 Above will put a limit of 1MB/second on reads happening for root group
83 on device having major/minor number 8:16.
84
85- Run dd to read a file and see if rate is throttled to 1MB/s or not.
86
87 # dd if=/mnt/common/zerofile of=/dev/null bs=4K count=1024
88 # iflag=direct
89 1024+0 records in
90 1024+0 records out
91 4194304 bytes (4.2 MB) copied, 4.0001 s, 1.0 MB/s
92
93 Limits for writes can be put using blkio.throttle.write_bps_device file.
94
95Hierarchical Cgroups
96====================
97- Currently none of the IO control policy supports hierarhical groups. But
98 cgroup interface does allow creation of hierarhical cgroups and internally
99 IO policies treat them as flat hierarchy.
100
101 So this patch will allow creation of cgroup hierarhcy but at the backend
102 everything will be treated as flat. So if somebody created a hierarchy like
103 as follows.
104
105 root
106 / \
107 test1 test2
108 |
109 test3
110
111 CFQ and throttling will practically treat all groups at same level.
112
113 pivot
114 / / \ \
115 root test1 test2 test3
116
117 Down the line we can implement hierarchical accounting/control support
118 and also introduce a new cgroup file "use_hierarchy" which will control
119 whether cgroup hierarchy is viewed as flat or hierarchical by the policy..
120 This is how memory controller also has implemented the things.
121
58Various user visible config options 122Various user visible config options
59=================================== 123===================================
60CONFIG_BLK_CGROUP 124CONFIG_BLK_CGROUP
@@ -68,13 +132,18 @@ CONFIG_CFQ_GROUP_IOSCHED
68 - Enables group scheduling in CFQ. Currently only 1 level of group 132 - Enables group scheduling in CFQ. Currently only 1 level of group
69 creation is allowed. 133 creation is allowed.
70 134
135CONFIG_BLK_DEV_THROTTLING
136 - Enable block device throttling support in block layer.
137
71Details of cgroup files 138Details of cgroup files
72======================= 139=======================
140Proportional weight policy files
141--------------------------------
73- blkio.weight 142- blkio.weight
74 - Specifies per cgroup weight. This is default weight of the group 143 - Specifies per cgroup weight. This is default weight of the group
75 on all the devices until and unless overridden by per device rule. 144 on all the devices until and unless overridden by per device rule.
76 (See blkio.weight_device). 145 (See blkio.weight_device).
77 Currently allowed range of weights is from 100 to 1000. 146 Currently allowed range of weights is from 10 to 1000.
78 147
79- blkio.weight_device 148- blkio.weight_device
80 - One can specify per cgroup per device rules using this interface. 149 - One can specify per cgroup per device rules using this interface.
@@ -83,7 +152,7 @@ Details of cgroup files
83 152
84 Following is the format. 153 Following is the format.
85 154
86 #echo dev_maj:dev_minor weight > /path/to/cgroup/blkio.weight_device 155 # echo dev_maj:dev_minor weight > blkio.weight_device
87 Configure weight=300 on /dev/sdb (8:16) in this cgroup 156 Configure weight=300 on /dev/sdb (8:16) in this cgroup
88 # echo 8:16 300 > blkio.weight_device 157 # echo 8:16 300 > blkio.weight_device
89 # cat blkio.weight_device 158 # cat blkio.weight_device
@@ -210,40 +279,73 @@ Details of cgroup files
210 and minor number of the device and third field specifies the number 279 and minor number of the device and third field specifies the number
211 of times a group was dequeued from a particular device. 280 of times a group was dequeued from a particular device.
212 281
282Throttling/Upper limit policy files
283-----------------------------------
284- blkio.throttle.read_bps_device
285 - Specifies upper limit on READ rate from the device. IO rate is
286 specified in bytes per second. Rules are per deivce. Following is
287 the format.
288
289 echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.read_bps_device
290
291- blkio.throttle.write_bps_device
292 - Specifies upper limit on WRITE rate to the device. IO rate is
293 specified in bytes per second. Rules are per deivce. Following is
294 the format.
295
296 echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.write_bps_device
297
298- blkio.throttle.read_iops_device
299 - Specifies upper limit on READ rate from the device. IO rate is
300 specified in IO per second. Rules are per deivce. Following is
301 the format.
302
303 echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.read_iops_device
304
305- blkio.throttle.write_iops_device
306 - Specifies upper limit on WRITE rate to the device. IO rate is
307 specified in io per second. Rules are per deivce. Following is
308 the format.
309
310 echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.write_iops_device
311
312Note: If both BW and IOPS rules are specified for a device, then IO is
313 subjectd to both the constraints.
314
315- blkio.throttle.io_serviced
316 - Number of IOs (bio) completed to/from the disk by the group (as
317 seen by throttling policy). These are further divided by the type
318 of operation - read or write, sync or async. First two fields specify
319 the major and minor number of the device, third field specifies the
320 operation type and the fourth field specifies the number of IOs.
321
322 blkio.io_serviced does accounting as seen by CFQ and counts are in
323 number of requests (struct request). On the other hand,
324 blkio.throttle.io_serviced counts number of IO in terms of number
325 of bios as seen by throttling policy. These bios can later be
326 merged by elevator and total number of requests completed can be
327 lesser.
328
329- blkio.throttle.io_service_bytes
330 - Number of bytes transferred to/from the disk by the group. These
331 are further divided by the type of operation - read or write, sync
332 or async. First two fields specify the major and minor number of the
333 device, third field specifies the operation type and the fourth field
334 specifies the number of bytes.
335
336 These numbers should roughly be same as blkio.io_service_bytes as
337 updated by CFQ. The difference between two is that
338 blkio.io_service_bytes will not be updated if CFQ is not operating
339 on request queue.
340
341Common files among various policies
342-----------------------------------
213- blkio.reset_stats 343- blkio.reset_stats
214 - Writing an int to this file will result in resetting all the stats 344 - Writing an int to this file will result in resetting all the stats
215 for that cgroup. 345 for that cgroup.
216 346
217CFQ sysfs tunable 347CFQ sysfs tunable
218================= 348=================
219/sys/block/<disk>/queue/iosched/group_isolation
220-----------------------------------------------
221
222If group_isolation=1, it provides stronger isolation between groups at the
223expense of throughput. By default group_isolation is 0. In general that
224means that if group_isolation=0, expect fairness for sequential workload
225only. Set group_isolation=1 to see fairness for random IO workload also.
226
227Generally CFQ will put random seeky workload in sync-noidle category. CFQ
228will disable idling on these queues and it does a collective idling on group
229of such queues. Generally these are slow moving queues and if there is a
230sync-noidle service tree in each group, that group gets exclusive access to
231disk for certain period. That means it will bring the throughput down if
232group does not have enough IO to drive deeper queue depths and utilize disk
233capacity to the fullest in the slice allocated to it. But the flip side is
234that even a random reader should get better latencies and overall throughput
235if there are lots of sequential readers/sync-idle workload running in the
236system.
237
238If group_isolation=0, then CFQ automatically moves all the random seeky queues
239in the root group. That means there will be no service differentiation for
240that kind of workload. This leads to better throughput as we do collective
241idling on root sync-noidle tree.
242
243By default one should run with group_isolation=0. If that is not sufficient
244and one wants stronger isolation between groups, then set group_isolation=1
245but this will come at cost of reduced throughput.
246
247/sys/block/<disk>/queue/iosched/slice_idle 349/sys/block/<disk>/queue/iosched/slice_idle
248------------------------------------------ 350------------------------------------------
249On a faster hardware CFQ can be slow, especially with sequential workload. 351On a faster hardware CFQ can be slow, especially with sequential workload.
diff --git a/Documentation/cgroups/cgroup_event_listener.c b/Documentation/cgroups/cgroup_event_listener.c
index 8c2bfc4a6358..3e082f96dc12 100644
--- a/Documentation/cgroups/cgroup_event_listener.c
+++ b/Documentation/cgroups/cgroup_event_listener.c
@@ -91,7 +91,7 @@ int main(int argc, char **argv)
91 91
92 if (ret == -1) { 92 if (ret == -1) {
93 perror("cgroup.event_control " 93 perror("cgroup.event_control "
94 "is not accessable any more"); 94 "is not accessible any more");
95 break; 95 break;
96 } 96 }
97 97
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index b34823ff1646..cd67e90003c0 100644
--- a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -18,7 +18,8 @@ CONTENTS:
18 1.2 Why are cgroups needed ? 18 1.2 Why are cgroups needed ?
19 1.3 How are cgroups implemented ? 19 1.3 How are cgroups implemented ?
20 1.4 What does notify_on_release do ? 20 1.4 What does notify_on_release do ?
21 1.5 How do I use cgroups ? 21 1.5 What does clone_children do ?
22 1.6 How do I use cgroups ?
222. Usage Examples and Syntax 232. Usage Examples and Syntax
23 2.1 Basic Usage 24 2.1 Basic Usage
24 2.2 Attaching processes 25 2.2 Attaching processes
@@ -109,22 +110,22 @@ university server with various users - students, professors, system
109tasks etc. The resource planning for this server could be along the 110tasks etc. The resource planning for this server could be along the
110following lines: 111following lines:
111 112
112 CPU : Top cpuset 113 CPU : "Top cpuset"
113 / \ 114 / \
114 CPUSet1 CPUSet2 115 CPUSet1 CPUSet2
115 | | 116 | |
116 (Profs) (Students) 117 (Professors) (Students)
117 118
118 In addition (system tasks) are attached to topcpuset (so 119 In addition (system tasks) are attached to topcpuset (so
119 that they can run anywhere) with a limit of 20% 120 that they can run anywhere) with a limit of 20%
120 121
121 Memory : Professors (50%), students (30%), system (20%) 122 Memory : Professors (50%), Students (30%), system (20%)
122 123
123 Disk : Prof (50%), students (30%), system (20%) 124 Disk : Professors (50%), Students (30%), system (20%)
124 125
125 Network : WWW browsing (20%), Network File System (60%), others (20%) 126 Network : WWW browsing (20%), Network File System (60%), others (20%)
126 / \ 127 / \
127 Prof (15%) students (5%) 128 Professors (15%) students (5%)
128 129
129Browsers like Firefox/Lynx go into the WWW network class, while (k)nfsd go 130Browsers like Firefox/Lynx go into the WWW network class, while (k)nfsd go
130into NFS network class. 131into NFS network class.
@@ -137,11 +138,11 @@ With the ability to classify tasks differently for different resources
137the admin can easily set up a script which receives exec notifications 138the admin can easily set up a script which receives exec notifications
138and depending on who is launching the browser he can 139and depending on who is launching the browser he can
139 140
140 # echo browser_pid > /mnt/<restype>/<userclass>/tasks 141 # echo browser_pid > /sys/fs/cgroup/<restype>/<userclass>/tasks
141 142
142With only a single hierarchy, he now would potentially have to create 143With only a single hierarchy, he now would potentially have to create
143a separate cgroup for every browser launched and associate it with 144a separate cgroup for every browser launched and associate it with
144approp network and other resource class. This may lead to 145appropriate network and other resource class. This may lead to
145proliferation of such cgroups. 146proliferation of such cgroups.
146 147
147Also lets say that the administrator would like to give enhanced network 148Also lets say that the administrator would like to give enhanced network
@@ -152,9 +153,9 @@ apps enhanced CPU power,
152With ability to write pids directly to resource classes, it's just a 153With ability to write pids directly to resource classes, it's just a
153matter of : 154matter of :
154 155
155 # echo pid > /mnt/network/<new_class>/tasks 156 # echo pid > /sys/fs/cgroup/network/<new_class>/tasks
156 (after some time) 157 (after some time)
157 # echo pid > /mnt/network/<orig_class>/tasks 158 # echo pid > /sys/fs/cgroup/network/<orig_class>/tasks
158 159
159Without this ability, he would have to split the cgroup into 160Without this ability, he would have to split the cgroup into
160multiple separate ones and then associate the new cgroups with the 161multiple separate ones and then associate the new cgroups with the
@@ -235,7 +236,8 @@ containing the following files describing that cgroup:
235 - cgroup.procs: list of tgids in the cgroup. This list is not 236 - cgroup.procs: list of tgids in the cgroup. This list is not
236 guaranteed to be sorted or free of duplicate tgids, and userspace 237 guaranteed to be sorted or free of duplicate tgids, and userspace
237 should sort/uniquify the list if this property is required. 238 should sort/uniquify the list if this property is required.
238 This is a read-only file, for now. 239 Writing a thread group id into this file moves all threads in that
240 group into this cgroup.
239 - notify_on_release flag: run the release agent on exit? 241 - notify_on_release flag: run the release agent on exit?
240 - release_agent: the path to use for release notifications (this file 242 - release_agent: the path to use for release notifications (this file
241 exists in the top cgroup only) 243 exists in the top cgroup only)
@@ -293,27 +295,39 @@ notify_on_release in the root cgroup at system boot is disabled
293value of their parents notify_on_release setting. The default value of 295value of their parents notify_on_release setting. The default value of
294a cgroup hierarchy's release_agent path is empty. 296a cgroup hierarchy's release_agent path is empty.
295 297
2961.5 How do I use cgroups ? 2981.5 What does clone_children do ?
299---------------------------------
300
301If the clone_children flag is enabled (1) in a cgroup, then all
302cgroups created beneath will call the post_clone callbacks for each
303subsystem of the newly created cgroup. Usually when this callback is
304implemented for a subsystem, it copies the values of the parent
305subsystem, this is the case for the cpuset.
306
3071.6 How do I use cgroups ?
297-------------------------- 308--------------------------
298 309
299To start a new job that is to be contained within a cgroup, using 310To start a new job that is to be contained within a cgroup, using
300the "cpuset" cgroup subsystem, the steps are something like: 311the "cpuset" cgroup subsystem, the steps are something like:
301 312
302 1) mkdir /dev/cgroup 313 1) mount -t tmpfs cgroup_root /sys/fs/cgroup
303 2) mount -t cgroup -ocpuset cpuset /dev/cgroup 314 2) mkdir /sys/fs/cgroup/cpuset
304 3) Create the new cgroup by doing mkdir's and write's (or echo's) in 315 3) mount -t cgroup -ocpuset cpuset /sys/fs/cgroup/cpuset
305 the /dev/cgroup virtual file system. 316 4) Create the new cgroup by doing mkdir's and write's (or echo's) in
306 4) Start a task that will be the "founding father" of the new job. 317 the /sys/fs/cgroup virtual file system.
307 5) Attach that task to the new cgroup by writing its pid to the 318 5) Start a task that will be the "founding father" of the new job.
308 /dev/cgroup tasks file for that cgroup. 319 6) Attach that task to the new cgroup by writing its pid to the
309 6) fork, exec or clone the job tasks from this founding father task. 320 /sys/fs/cgroup/cpuset/tasks file for that cgroup.
321 7) fork, exec or clone the job tasks from this founding father task.
310 322
311For example, the following sequence of commands will setup a cgroup 323For example, the following sequence of commands will setup a cgroup
312named "Charlie", containing just CPUs 2 and 3, and Memory Node 1, 324named "Charlie", containing just CPUs 2 and 3, and Memory Node 1,
313and then start a subshell 'sh' in that cgroup: 325and then start a subshell 'sh' in that cgroup:
314 326
315 mount -t cgroup cpuset -ocpuset /dev/cgroup 327 mount -t tmpfs cgroup_root /sys/fs/cgroup
316 cd /dev/cgroup 328 mkdir /sys/fs/cgroup/cpuset
329 mount -t cgroup cpuset -ocpuset /sys/fs/cgroup/cpuset
330 cd /sys/fs/cgroup/cpuset
317 mkdir Charlie 331 mkdir Charlie
318 cd Charlie 332 cd Charlie
319 /bin/echo 2-3 > cpuset.cpus 333 /bin/echo 2-3 > cpuset.cpus
@@ -334,28 +348,41 @@ Creating, modifying, using the cgroups can be done through the cgroup
334virtual filesystem. 348virtual filesystem.
335 349
336To mount a cgroup hierarchy with all available subsystems, type: 350To mount a cgroup hierarchy with all available subsystems, type:
337# mount -t cgroup xxx /dev/cgroup 351# mount -t cgroup xxx /sys/fs/cgroup
338 352
339The "xxx" is not interpreted by the cgroup code, but will appear in 353The "xxx" is not interpreted by the cgroup code, but will appear in
340/proc/mounts so may be any useful identifying string that you like. 354/proc/mounts so may be any useful identifying string that you like.
341 355
356Note: Some subsystems do not work without some user input first. For instance,
357if cpusets are enabled the user will have to populate the cpus and mems files
358for each new cgroup created before that group can be used.
359
360As explained in section `1.2 Why are cgroups needed?' you should create
361different hierarchies of cgroups for each single resource or group of
362resources you want to control. Therefore, you should mount a tmpfs on
363/sys/fs/cgroup and create directories for each cgroup resource or resource
364group.
365
366# mount -t tmpfs cgroup_root /sys/fs/cgroup
367# mkdir /sys/fs/cgroup/rg1
368
342To mount a cgroup hierarchy with just the cpuset and memory 369To mount a cgroup hierarchy with just the cpuset and memory
343subsystems, type: 370subsystems, type:
344# mount -t cgroup -o cpuset,memory hier1 /dev/cgroup 371# mount -t cgroup -o cpuset,memory hier1 /sys/fs/cgroup/rg1
345 372
346To change the set of subsystems bound to a mounted hierarchy, just 373To change the set of subsystems bound to a mounted hierarchy, just
347remount with different options: 374remount with different options:
348# mount -o remount,cpuset,ns hier1 /dev/cgroup 375# mount -o remount,cpuset,blkio hier1 /sys/fs/cgroup/rg1
349 376
350Now memory is removed from the hierarchy and ns is added. 377Now memory is removed from the hierarchy and blkio is added.
351 378
352Note this will add ns to the hierarchy but won't remove memory or 379Note this will add blkio to the hierarchy but won't remove memory or
353cpuset, because the new options are appended to the old ones: 380cpuset, because the new options are appended to the old ones:
354# mount -o remount,ns /dev/cgroup 381# mount -o remount,blkio /sys/fs/cgroup/rg1
355 382
356To Specify a hierarchy's release_agent: 383To Specify a hierarchy's release_agent:
357# mount -t cgroup -o cpuset,release_agent="/sbin/cpuset_release_agent" \ 384# mount -t cgroup -o cpuset,release_agent="/sbin/cpuset_release_agent" \
358 xxx /dev/cgroup 385 xxx /sys/fs/cgroup/rg1
359 386
360Note that specifying 'release_agent' more than once will return failure. 387Note that specifying 'release_agent' more than once will return failure.
361 388
@@ -364,17 +391,17 @@ when the hierarchy consists of a single (root) cgroup. Supporting
364the ability to arbitrarily bind/unbind subsystems from an existing 391the ability to arbitrarily bind/unbind subsystems from an existing
365cgroup hierarchy is intended to be implemented in the future. 392cgroup hierarchy is intended to be implemented in the future.
366 393
367Then under /dev/cgroup you can find a tree that corresponds to the 394Then under /sys/fs/cgroup/rg1 you can find a tree that corresponds to the
368tree of the cgroups in the system. For instance, /dev/cgroup 395tree of the cgroups in the system. For instance, /sys/fs/cgroup/rg1
369is the cgroup that holds the whole system. 396is the cgroup that holds the whole system.
370 397
371If you want to change the value of release_agent: 398If you want to change the value of release_agent:
372# echo "/sbin/new_release_agent" > /dev/cgroup/release_agent 399# echo "/sbin/new_release_agent" > /sys/fs/cgroup/rg1/release_agent
373 400
374It can also be changed via remount. 401It can also be changed via remount.
375 402
376If you want to create a new cgroup under /dev/cgroup: 403If you want to create a new cgroup under /sys/fs/cgroup/rg1:
377# cd /dev/cgroup 404# cd /sys/fs/cgroup/rg1
378# mkdir my_cgroup 405# mkdir my_cgroup
379 406
380Now you want to do something with this cgroup. 407Now you want to do something with this cgroup.
@@ -416,6 +443,20 @@ You can attach the current shell task by echoing 0:
416 443
417# echo 0 > tasks 444# echo 0 > tasks
418 445
446You can use the cgroup.procs file instead of the tasks file to move all
447threads in a threadgroup at once. Echoing the pid of any task in a
448threadgroup to cgroup.procs causes all tasks in that threadgroup to be
449be attached to the cgroup. Writing 0 to cgroup.procs moves all tasks
450in the writing task's threadgroup.
451
452Note: Since every task is always a member of exactly one cgroup in each
453mounted hierarchy, to remove a task from its current cgroup you must
454move it into a new cgroup (possibly the root cgroup) by writing to the
455new cgroup's tasks file.
456
457Note: If the ns cgroup is active, moving a process to another cgroup can
458fail.
459
4192.3 Mounting hierarchies by name 4602.3 Mounting hierarchies by name
420-------------------------------- 461--------------------------------
421 462
@@ -553,7 +594,7 @@ rmdir() will fail with it. From this behavior, pre_destroy() can be
553called multiple times against a cgroup. 594called multiple times against a cgroup.
554 595
555int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, 596int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
556 struct task_struct *task, bool threadgroup) 597 struct task_struct *task)
557(cgroup_mutex held by caller) 598(cgroup_mutex held by caller)
558 599
559Called prior to moving a task into a cgroup; if the subsystem 600Called prior to moving a task into a cgroup; if the subsystem
@@ -562,9 +603,14 @@ task is passed, then a successful result indicates that *any*
562unspecified task can be moved into the cgroup. Note that this isn't 603unspecified task can be moved into the cgroup. Note that this isn't
563called on a fork. If this method returns 0 (success) then this should 604called on a fork. If this method returns 0 (success) then this should
564remain valid while the caller holds cgroup_mutex and it is ensured that either 605remain valid while the caller holds cgroup_mutex and it is ensured that either
565attach() or cancel_attach() will be called in future. If threadgroup is 606attach() or cancel_attach() will be called in future.
566true, then a successful result indicates that all threads in the given 607
567thread's threadgroup can be moved together. 608int can_attach_task(struct cgroup *cgrp, struct task_struct *tsk);
609(cgroup_mutex held by caller)
610
611As can_attach, but for operations that must be run once per task to be
612attached (possibly many when using cgroup_attach_proc). Called after
613can_attach.
568 614
569void cancel_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, 615void cancel_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
570 struct task_struct *task, bool threadgroup) 616 struct task_struct *task, bool threadgroup)
@@ -576,15 +622,24 @@ function, so that the subsystem can implement a rollback. If not, not necessary.
576This will be called only about subsystems whose can_attach() operation have 622This will be called only about subsystems whose can_attach() operation have
577succeeded. 623succeeded.
578 624
625void pre_attach(struct cgroup *cgrp);
626(cgroup_mutex held by caller)
627
628For any non-per-thread attachment work that needs to happen before
629attach_task. Needed by cpuset.
630
579void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, 631void attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
580 struct cgroup *old_cgrp, struct task_struct *task, 632 struct cgroup *old_cgrp, struct task_struct *task)
581 bool threadgroup)
582(cgroup_mutex held by caller) 633(cgroup_mutex held by caller)
583 634
584Called after the task has been attached to the cgroup, to allow any 635Called after the task has been attached to the cgroup, to allow any
585post-attachment activity that requires memory allocations or blocking. 636post-attachment activity that requires memory allocations or blocking.
586If threadgroup is true, the subsystem should take care of all threads 637
587in the specified thread's threadgroup. Currently does not support any 638void attach_task(struct cgroup *cgrp, struct task_struct *tsk);
639(cgroup_mutex held by caller)
640
641As attach, but for operations that must be run once per task to be attached,
642like can_attach_task. Called before attach. Currently does not support any
588subsystem that might need the old_cgrp for every thread in the group. 643subsystem that might need the old_cgrp for every thread in the group.
589 644
590void fork(struct cgroup_subsy *ss, struct task_struct *task) 645void fork(struct cgroup_subsy *ss, struct task_struct *task)
@@ -608,7 +663,7 @@ always handled well.
608void post_clone(struct cgroup_subsys *ss, struct cgroup *cgrp) 663void post_clone(struct cgroup_subsys *ss, struct cgroup *cgrp)
609(cgroup_mutex held by caller) 664(cgroup_mutex held by caller)
610 665
611Called at the end of cgroup_clone() to do any parameter 666Called during cgroup_create() to do any parameter
612initialization which might be required before a task could attach. For 667initialization which might be required before a task could attach. For
613example in cpusets, no task may attach before 'cpus' and 'mems' are set 668example in cpusets, no task may attach before 'cpus' and 'mems' are set
614up. 669up.
diff --git a/Documentation/cgroups/cpuacct.txt b/Documentation/cgroups/cpuacct.txt
index 8b930946c52a..9ad85df4b983 100644
--- a/Documentation/cgroups/cpuacct.txt
+++ b/Documentation/cgroups/cpuacct.txt
@@ -10,26 +10,25 @@ directly present in its group.
10 10
11Accounting groups can be created by first mounting the cgroup filesystem. 11Accounting groups can be created by first mounting the cgroup filesystem.
12 12
13# mkdir /cgroups 13# mount -t cgroup -ocpuacct none /sys/fs/cgroup
14# mount -t cgroup -ocpuacct none /cgroups 14
15 15With the above step, the initial or the parent accounting group becomes
16With the above step, the initial or the parent accounting group 16visible at /sys/fs/cgroup. At bootup, this group includes all the tasks in
17becomes visible at /cgroups. At bootup, this group includes all the 17the system. /sys/fs/cgroup/tasks lists the tasks in this cgroup.
18tasks in the system. /cgroups/tasks lists the tasks in this cgroup. 18/sys/fs/cgroup/cpuacct.usage gives the CPU time (in nanoseconds) obtained
19/cgroups/cpuacct.usage gives the CPU time (in nanoseconds) obtained by 19by this group which is essentially the CPU time obtained by all the tasks
20this group which is essentially the CPU time obtained by all the tasks
21in the system. 20in the system.
22 21
23New accounting groups can be created under the parent group /cgroups. 22New accounting groups can be created under the parent group /sys/fs/cgroup.
24 23
25# cd /cgroups 24# cd /sys/fs/cgroup
26# mkdir g1 25# mkdir g1
27# echo $$ > g1 26# echo $$ > g1
28 27
29The above steps create a new group g1 and move the current shell 28The above steps create a new group g1 and move the current shell
30process (bash) into it. CPU time consumed by this bash and its children 29process (bash) into it. CPU time consumed by this bash and its children
31can be obtained from g1/cpuacct.usage and the same is accumulated in 30can be obtained from g1/cpuacct.usage and the same is accumulated in
32/cgroups/cpuacct.usage also. 31/sys/fs/cgroup/cpuacct.usage also.
33 32
34cpuacct.stat file lists a few statistics which further divide the 33cpuacct.stat file lists a few statistics which further divide the
35CPU time obtained by the cgroup into user and system times. Currently 34CPU time obtained by the cgroup into user and system times. Currently
diff --git a/Documentation/cgroups/cpusets.txt b/Documentation/cgroups/cpusets.txt
index 5d0d5692a365..5b0d78e55ccc 100644
--- a/Documentation/cgroups/cpusets.txt
+++ b/Documentation/cgroups/cpusets.txt
@@ -661,21 +661,21 @@ than stress the kernel.
661 661
662To start a new job that is to be contained within a cpuset, the steps are: 662To start a new job that is to be contained within a cpuset, the steps are:
663 663
664 1) mkdir /dev/cpuset 664 1) mkdir /sys/fs/cgroup/cpuset
665 2) mount -t cgroup -ocpuset cpuset /dev/cpuset 665 2) mount -t cgroup -ocpuset cpuset /sys/fs/cgroup/cpuset
666 3) Create the new cpuset by doing mkdir's and write's (or echo's) in 666 3) Create the new cpuset by doing mkdir's and write's (or echo's) in
667 the /dev/cpuset virtual file system. 667 the /sys/fs/cgroup/cpuset virtual file system.
668 4) Start a task that will be the "founding father" of the new job. 668 4) Start a task that will be the "founding father" of the new job.
669 5) Attach that task to the new cpuset by writing its pid to the 669 5) Attach that task to the new cpuset by writing its pid to the
670 /dev/cpuset tasks file for that cpuset. 670 /sys/fs/cgroup/cpuset tasks file for that cpuset.
671 6) fork, exec or clone the job tasks from this founding father task. 671 6) fork, exec or clone the job tasks from this founding father task.
672 672
673For example, the following sequence of commands will setup a cpuset 673For example, the following sequence of commands will setup a cpuset
674named "Charlie", containing just CPUs 2 and 3, and Memory Node 1, 674named "Charlie", containing just CPUs 2 and 3, and Memory Node 1,
675and then start a subshell 'sh' in that cpuset: 675and then start a subshell 'sh' in that cpuset:
676 676
677 mount -t cgroup -ocpuset cpuset /dev/cpuset 677 mount -t cgroup -ocpuset cpuset /sys/fs/cgroup/cpuset
678 cd /dev/cpuset 678 cd /sys/fs/cgroup/cpuset
679 mkdir Charlie 679 mkdir Charlie
680 cd Charlie 680 cd Charlie
681 /bin/echo 2-3 > cpuset.cpus 681 /bin/echo 2-3 > cpuset.cpus
@@ -693,7 +693,7 @@ There are ways to query or modify cpusets:
693 - via the C library libcgroup. 693 - via the C library libcgroup.
694 (http://sourceforge.net/projects/libcg/) 694 (http://sourceforge.net/projects/libcg/)
695 - via the python application cset. 695 - via the python application cset.
696 (http://developer.novell.com/wiki/index.php/Cpuset) 696 (http://code.google.com/p/cpuset/)
697 697
698The sched_setaffinity calls can also be done at the shell prompt using 698The sched_setaffinity calls can also be done at the shell prompt using
699SGI's runon or Robert Love's taskset. The mbind and set_mempolicy 699SGI's runon or Robert Love's taskset. The mbind and set_mempolicy
@@ -710,14 +710,14 @@ Creating, modifying, using the cpusets can be done through the cpuset
710virtual filesystem. 710virtual filesystem.
711 711
712To mount it, type: 712To mount it, type:
713# mount -t cgroup -o cpuset cpuset /dev/cpuset 713# mount -t cgroup -o cpuset cpuset /sys/fs/cgroup/cpuset
714 714
715Then under /dev/cpuset you can find a tree that corresponds to the 715Then under /sys/fs/cgroup/cpuset you can find a tree that corresponds to the
716tree of the cpusets in the system. For instance, /dev/cpuset 716tree of the cpusets in the system. For instance, /sys/fs/cgroup/cpuset
717is the cpuset that holds the whole system. 717is the cpuset that holds the whole system.
718 718
719If you want to create a new cpuset under /dev/cpuset: 719If you want to create a new cpuset under /sys/fs/cgroup/cpuset:
720# cd /dev/cpuset 720# cd /sys/fs/cgroup/cpuset
721# mkdir my_cpuset 721# mkdir my_cpuset
722 722
723Now you want to do something with this cpuset. 723Now you want to do something with this cpuset.
@@ -725,13 +725,14 @@ Now you want to do something with this cpuset.
725 725
726In this directory you can find several files: 726In this directory you can find several files:
727# ls 727# ls
728cpuset.cpu_exclusive cpuset.memory_spread_slab 728cgroup.clone_children cpuset.memory_pressure
729cpuset.cpus cpuset.mems 729cgroup.event_control cpuset.memory_spread_page
730cpuset.mem_exclusive cpuset.sched_load_balance 730cgroup.procs cpuset.memory_spread_slab
731cpuset.mem_hardwall cpuset.sched_relax_domain_level 731cpuset.cpu_exclusive cpuset.mems
732cpuset.memory_migrate notify_on_release 732cpuset.cpus cpuset.sched_load_balance
733cpuset.memory_pressure tasks 733cpuset.mem_exclusive cpuset.sched_relax_domain_level
734cpuset.memory_spread_page 734cpuset.mem_hardwall notify_on_release
735cpuset.memory_migrate tasks
735 736
736Reading them will give you information about the state of this cpuset: 737Reading them will give you information about the state of this cpuset:
737the CPUs and Memory Nodes it can use, the processes that are using 738the CPUs and Memory Nodes it can use, the processes that are using
@@ -764,12 +765,12 @@ wrapper around the cgroup filesystem.
764 765
765The command 766The command
766 767
767mount -t cpuset X /dev/cpuset 768mount -t cpuset X /sys/fs/cgroup/cpuset
768 769
769is equivalent to 770is equivalent to
770 771
771mount -t cgroup -ocpuset,noprefix X /dev/cpuset 772mount -t cgroup -ocpuset,noprefix X /sys/fs/cgroup/cpuset
772echo "/sbin/cpuset_release_agent" > /dev/cpuset/release_agent 773echo "/sbin/cpuset_release_agent" > /sys/fs/cgroup/cpuset/release_agent
773 774
7742.2 Adding/removing cpus 7752.2 Adding/removing cpus
775------------------------ 776------------------------
diff --git a/Documentation/cgroups/devices.txt b/Documentation/cgroups/devices.txt
index 57ca4c89fe5c..16624a7f8222 100644
--- a/Documentation/cgroups/devices.txt
+++ b/Documentation/cgroups/devices.txt
@@ -22,16 +22,16 @@ removed from the child(ren).
22An entry is added using devices.allow, and removed using 22An entry is added using devices.allow, and removed using
23devices.deny. For instance 23devices.deny. For instance
24 24
25 echo 'c 1:3 mr' > /cgroups/1/devices.allow 25 echo 'c 1:3 mr' > /sys/fs/cgroup/1/devices.allow
26 26
27allows cgroup 1 to read and mknod the device usually known as 27allows cgroup 1 to read and mknod the device usually known as
28/dev/null. Doing 28/dev/null. Doing
29 29
30 echo a > /cgroups/1/devices.deny 30 echo a > /sys/fs/cgroup/1/devices.deny
31 31
32will remove the default 'a *:* rwm' entry. Doing 32will remove the default 'a *:* rwm' entry. Doing
33 33
34 echo a > /cgroups/1/devices.allow 34 echo a > /sys/fs/cgroup/1/devices.allow
35 35
36will add the 'a *:* rwm' entry to the whitelist. 36will add the 'a *:* rwm' entry to the whitelist.
37 37
diff --git a/Documentation/cgroups/freezer-subsystem.txt b/Documentation/cgroups/freezer-subsystem.txt
index 41f37fea1276..c21d77742a07 100644
--- a/Documentation/cgroups/freezer-subsystem.txt
+++ b/Documentation/cgroups/freezer-subsystem.txt
@@ -59,28 +59,28 @@ is non-freezable.
59 59
60* Examples of usage : 60* Examples of usage :
61 61
62 # mkdir /containers 62 # mkdir /sys/fs/cgroup/freezer
63 # mount -t cgroup -ofreezer freezer /containers 63 # mount -t cgroup -ofreezer freezer /sys/fs/cgroup/freezer
64 # mkdir /containers/0 64 # mkdir /sys/fs/cgroup/freezer/0
65 # echo $some_pid > /containers/0/tasks 65 # echo $some_pid > /sys/fs/cgroup/freezer/0/tasks
66 66
67to get status of the freezer subsystem : 67to get status of the freezer subsystem :
68 68
69 # cat /containers/0/freezer.state 69 # cat /sys/fs/cgroup/freezer/0/freezer.state
70 THAWED 70 THAWED
71 71
72to freeze all tasks in the container : 72to freeze all tasks in the container :
73 73
74 # echo FROZEN > /containers/0/freezer.state 74 # echo FROZEN > /sys/fs/cgroup/freezer/0/freezer.state
75 # cat /containers/0/freezer.state 75 # cat /sys/fs/cgroup/freezer/0/freezer.state
76 FREEZING 76 FREEZING
77 # cat /containers/0/freezer.state 77 # cat /sys/fs/cgroup/freezer/0/freezer.state
78 FROZEN 78 FROZEN
79 79
80to unfreeze all tasks in the container : 80to unfreeze all tasks in the container :
81 81
82 # echo THAWED > /containers/0/freezer.state 82 # echo THAWED > /sys/fs/cgroup/freezer/0/freezer.state
83 # cat /containers/0/freezer.state 83 # cat /sys/fs/cgroup/freezer/0/freezer.state
84 THAWED 84 THAWED
85 85
86This is the basic mechanism which should do the right thing for user space task 86This is the basic mechanism which should do the right thing for user space task
diff --git a/Documentation/cgroups/memcg_test.txt b/Documentation/cgroups/memcg_test.txt
index b7eececfb195..fc8fa97a09ac 100644
--- a/Documentation/cgroups/memcg_test.txt
+++ b/Documentation/cgroups/memcg_test.txt
@@ -398,7 +398,7 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
398 written to move_charge_at_immigrate. 398 written to move_charge_at_immigrate.
399 399
400 9.10 Memory thresholds 400 9.10 Memory thresholds
401 Memory controler implements memory thresholds using cgroups notification 401 Memory controller implements memory thresholds using cgroups notification
402 API. You can use Documentation/cgroups/cgroup_event_listener.c to test 402 API. You can use Documentation/cgroups/cgroup_event_listener.c to test
403 it. 403 it.
404 404
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index 7781857dc940..06eb6d957c83 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -1,8 +1,8 @@
1Memory Resource Controller 1Memory Resource Controller
2 2
3NOTE: The Memory Resource Controller has been generically been referred 3NOTE: The Memory Resource Controller has generically been referred to as the
4 to as the memory controller in this document. Do not confuse memory 4 memory controller in this document. Do not confuse memory controller
5 controller used here with the memory controller that is used in hardware. 5 used here with the memory controller that is used in hardware.
6 6
7(For editors) 7(For editors)
8In this document: 8In this document:
@@ -52,8 +52,10 @@ Brief summary of control files.
52 tasks # attach a task(thread) and show list of threads 52 tasks # attach a task(thread) and show list of threads
53 cgroup.procs # show list of processes 53 cgroup.procs # show list of processes
54 cgroup.event_control # an interface for event_fd() 54 cgroup.event_control # an interface for event_fd()
55 memory.usage_in_bytes # show current memory(RSS+Cache) usage. 55 memory.usage_in_bytes # show current res_counter usage for memory
56 memory.memsw.usage_in_bytes # show current memory+Swap usage 56 (See 5.5 for details)
57 memory.memsw.usage_in_bytes # show current res_counter usage for memory+Swap
58 (See 5.5 for details)
57 memory.limit_in_bytes # set/show limit of memory usage 59 memory.limit_in_bytes # set/show limit of memory usage
58 memory.memsw.limit_in_bytes # set/show limit of memory+Swap usage 60 memory.memsw.limit_in_bytes # set/show limit of memory+Swap usage
59 memory.failcnt # show the number of memory usage hits limits 61 memory.failcnt # show the number of memory usage hits limits
@@ -68,6 +70,7 @@ Brief summary of control files.
68 (See sysctl's vm.swappiness) 70 (See sysctl's vm.swappiness)
69 memory.move_charge_at_immigrate # set/show controls of moving charges 71 memory.move_charge_at_immigrate # set/show controls of moving charges
70 memory.oom_control # set/show oom controls. 72 memory.oom_control # set/show oom controls.
73 memory.numa_stat # show the number of memory usage per numa node
71 74
721. History 751. History
73 76
@@ -179,7 +182,7 @@ behind this approach is that a cgroup that aggressively uses a shared
179page will eventually get charged for it (once it is uncharged from 182page will eventually get charged for it (once it is uncharged from
180the cgroup that brought it in -- this will happen on memory pressure). 183the cgroup that brought it in -- this will happen on memory pressure).
181 184
182Exception: If CONFIG_CGROUP_CGROUP_MEM_RES_CTLR_SWAP is not used.. 185Exception: If CONFIG_CGROUP_CGROUP_MEM_RES_CTLR_SWAP is not used.
183When you do swapoff and make swapped-out pages of shmem(tmpfs) to 186When you do swapoff and make swapped-out pages of shmem(tmpfs) to
184be backed into memory in force, charges for pages are accounted against the 187be backed into memory in force, charges for pages are accounted against the
185caller of swapoff rather than the users of shmem. 188caller of swapoff rather than the users of shmem.
@@ -211,7 +214,7 @@ affecting global LRU, memory+swap limit is better than just limiting swap from
211OS point of view. 214OS point of view.
212 215
213* What happens when a cgroup hits memory.memsw.limit_in_bytes 216* What happens when a cgroup hits memory.memsw.limit_in_bytes
214When a cgroup his memory.memsw.limit_in_bytes, it's useless to do swap-out 217When a cgroup hits memory.memsw.limit_in_bytes, it's useless to do swap-out
215in this cgroup. Then, swap-out will not be done by cgroup routine and file 218in this cgroup. Then, swap-out will not be done by cgroup routine and file
216caches are dropped. But as mentioned above, global LRU can do swapout memory 219caches are dropped. But as mentioned above, global LRU can do swapout memory
217from it for sanity of the system's memory management state. You can't forbid 220from it for sanity of the system's memory management state. You can't forbid
@@ -261,16 +264,17 @@ b. Enable CONFIG_RESOURCE_COUNTERS
261c. Enable CONFIG_CGROUP_MEM_RES_CTLR 264c. Enable CONFIG_CGROUP_MEM_RES_CTLR
262d. Enable CONFIG_CGROUP_MEM_RES_CTLR_SWAP (to use swap extension) 265d. Enable CONFIG_CGROUP_MEM_RES_CTLR_SWAP (to use swap extension)
263 266
2641. Prepare the cgroups 2671. Prepare the cgroups (see cgroups.txt, Why are cgroups needed?)
265# mkdir -p /cgroups 268# mount -t tmpfs none /sys/fs/cgroup
266# mount -t cgroup none /cgroups -o memory 269# mkdir /sys/fs/cgroup/memory
270# mount -t cgroup none /sys/fs/cgroup/memory -o memory
267 271
2682. Make the new group and move bash into it 2722. Make the new group and move bash into it
269# mkdir /cgroups/0 273# mkdir /sys/fs/cgroup/memory/0
270# echo $$ > /cgroups/0/tasks 274# echo $$ > /sys/fs/cgroup/memory/0/tasks
271 275
272Since now we're in the 0 cgroup, we can alter the memory limit: 276Since now we're in the 0 cgroup, we can alter the memory limit:
273# echo 4M > /cgroups/0/memory.limit_in_bytes 277# echo 4M > /sys/fs/cgroup/memory/0/memory.limit_in_bytes
274 278
275NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo, 279NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo,
276mega or gigabytes. (Here, Kilo, Mega, Giga are Kibibytes, Mebibytes, Gibibytes.) 280mega or gigabytes. (Here, Kilo, Mega, Giga are Kibibytes, Mebibytes, Gibibytes.)
@@ -278,11 +282,11 @@ mega or gigabytes. (Here, Kilo, Mega, Giga are Kibibytes, Mebibytes, Gibibytes.)
278NOTE: We can write "-1" to reset the *.limit_in_bytes(unlimited). 282NOTE: We can write "-1" to reset the *.limit_in_bytes(unlimited).
279NOTE: We cannot set limits on the root cgroup any more. 283NOTE: We cannot set limits on the root cgroup any more.
280 284
281# cat /cgroups/0/memory.limit_in_bytes 285# cat /sys/fs/cgroup/memory/0/memory.limit_in_bytes
2824194304 2864194304
283 287
284We can check the usage: 288We can check the usage:
285# cat /cgroups/0/memory.usage_in_bytes 289# cat /sys/fs/cgroup/memory/0/memory.usage_in_bytes
2861216512 2901216512
287 291
288A successful write to this file does not guarantee a successful set of 292A successful write to this file does not guarantee a successful set of
@@ -453,6 +457,33 @@ memory under it will be reclaimed.
453You can reset failcnt by writing 0 to failcnt file. 457You can reset failcnt by writing 0 to failcnt file.
454# echo 0 > .../memory.failcnt 458# echo 0 > .../memory.failcnt
455 459
4605.5 usage_in_bytes
461
462For efficiency, as other kernel components, memory cgroup uses some optimization
463to avoid unnecessary cacheline false sharing. usage_in_bytes is affected by the
464method and doesn't show 'exact' value of memory(and swap) usage, it's an fuzz
465value for efficient access. (Of course, when necessary, it's synchronized.)
466If you want to know more exact memory usage, you should use RSS+CACHE(+SWAP)
467value in memory.stat(see 5.2).
468
4695.6 numa_stat
470
471This is similar to numa_maps but operates on a per-memcg basis. This is
472useful for providing visibility into the numa locality information within
473an memcg since the pages are allowed to be allocated from any physical
474node. One of the usecases is evaluating application performance by
475combining this information with the application's cpu allocation.
476
477We export "total", "file", "anon" and "unevictable" pages per-node for
478each memcg. The ouput format of memory.numa_stat is:
479
480total=<total pages> N0=<node 0 pages> N1=<node 1 pages> ...
481file=<total file pages> N0=<node 0 pages> N1=<node 1 pages> ...
482anon=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ...
483unevictable=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ...
484
485And we have total = file + anon + unevictable.
486
4566. Hierarchy support 4876. Hierarchy support
457 488
458The memory controller supports a deep hierarchy and hierarchical accounting. 489The memory controller supports a deep hierarchy and hierarchical accounting.
@@ -460,13 +491,13 @@ The hierarchy is created by creating the appropriate cgroups in the
460cgroup filesystem. Consider for example, the following cgroup filesystem 491cgroup filesystem. Consider for example, the following cgroup filesystem
461hierarchy 492hierarchy
462 493
463 root 494 root
464 / | \ 495 / | \
465 / | \ 496 / | \
466 a b c 497 a b c
467 | \ 498 | \
468 | \ 499 | \
469 d e 500 d e
470 501
471In the diagram above, with hierarchical accounting enabled, all memory 502In the diagram above, with hierarchical accounting enabled, all memory
472usage of e, is accounted to its ancestors up until the root (i.e, c and root), 503usage of e, is accounted to its ancestors up until the root (i.e, c and root),
@@ -485,8 +516,9 @@ The feature can be disabled by
485 516
486# echo 0 > memory.use_hierarchy 517# echo 0 > memory.use_hierarchy
487 518
488NOTE1: Enabling/disabling will fail if the cgroup already has other 519NOTE1: Enabling/disabling will fail if either the cgroup already has other
489 cgroups created below it. 520 cgroups created below it, or if the parent cgroup has use_hierarchy
521 enabled.
490 522
491NOTE2: When panic_on_oom is set to "2", the whole system will panic in 523NOTE2: When panic_on_oom is set to "2", the whole system will panic in
492 case of an OOM event in any cgroup. 524 case of an OOM event in any cgroup.
diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt
index cd2b02837066..96b690348ba1 100644
--- a/Documentation/coccinelle.txt
+++ b/Documentation/coccinelle.txt
@@ -24,6 +24,9 @@ of many distributions, e.g. :
24You can get the latest version released from the Coccinelle homepage at 24You can get the latest version released from the Coccinelle homepage at
25http://coccinelle.lip6.fr/ 25http://coccinelle.lip6.fr/
26 26
27Information and tips about Coccinelle are also provided on the wiki
28pages at http://cocci.ekstranet.diku.dk/wiki/doku.php
29
27Once you have it, run the following command: 30Once you have it, run the following command:
28 31
29 ./configure 32 ./configure
@@ -33,6 +36,10 @@ as a regular user, and install it with
33 36
34 sudo make install 37 sudo make install
35 38
39The semantic patches in the kernel will work best with Coccinelle version
400.2.4 or later. Using earlier versions may incur some parse errors in the
41semantic patch code, but any results that are obtained should still be
42correct.
36 43
37 Using Coccinelle on the Linux kernel 44 Using Coccinelle on the Linux kernel
38~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 45~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -41,20 +48,22 @@ A Coccinelle-specific target is defined in the top level
41Makefile. This target is named 'coccicheck' and calls the 'coccicheck' 48Makefile. This target is named 'coccicheck' and calls the 'coccicheck'
42front-end in the 'scripts' directory. 49front-end in the 'scripts' directory.
43 50
44Four modes are defined: report, patch, context, and org. The mode to 51Four modes are defined: patch, report, context, and org. The mode to
45use is specified by setting the MODE variable with 'MODE=<mode>'. 52use is specified by setting the MODE variable with 'MODE=<mode>'.
46 53
54'patch' proposes a fix, when possible.
55
47'report' generates a list in the following format: 56'report' generates a list in the following format:
48 file:line:column-column: message 57 file:line:column-column: message
49 58
50'patch' proposes a fix, when possible.
51
52'context' highlights lines of interest and their context in a 59'context' highlights lines of interest and their context in a
53diff-like style.Lines of interest are indicated with '-'. 60diff-like style.Lines of interest are indicated with '-'.
54 61
55'org' generates a report in the Org mode format of Emacs. 62'org' generates a report in the Org mode format of Emacs.
56 63
57Note that not all semantic patches implement all modes. 64Note that not all semantic patches implement all modes. For easy use
65of Coccinelle, the default mode is "chain" which tries the previous
66modes in the order above until one succeeds.
58 67
59To make a report for every semantic patch, run the following command: 68To make a report for every semantic patch, run the following command:
60 69
@@ -68,9 +77,9 @@ To produce patches, run:
68 77
69 78
70The coccicheck target applies every semantic patch available in the 79The coccicheck target applies every semantic patch available in the
71subdirectories of 'scripts/coccinelle' to the entire Linux kernel. 80sub-directories of 'scripts/coccinelle' to the entire Linux kernel.
72 81
73For each semantic patch, a changelog message is proposed. It gives a 82For each semantic patch, a commit message is proposed. It gives a
74description of the problem being checked by the semantic patch, and 83description of the problem being checked by the semantic patch, and
75includes a reference to Coccinelle. 84includes a reference to Coccinelle.
76 85
@@ -93,12 +102,35 @@ or
93 make coccicheck COCCI=<my_SP.cocci> MODE=report 102 make coccicheck COCCI=<my_SP.cocci> MODE=report
94 103
95 104
105 Using Coccinelle on (modified) files
106~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107
108To apply Coccinelle on a file basis, instead of a directory basis, the
109following command may be used:
110
111 make C=1 CHECK="scripts/coccicheck"
112
113To check only newly edited code, use the value 2 for the C flag, i.e.
114
115 make C=2 CHECK="scripts/coccicheck"
116
117This runs every semantic patch in scripts/coccinelle by default. The
118COCCI variable may additionally be used to only apply a single
119semantic patch as shown in the previous section.
120
121The "chain" mode is the default. You can select another one with the
122MODE variable explained above.
123
124In this mode, there is no information about semantic patches
125displayed, and no commit message proposed.
126
127
96 Proposing new semantic patches 128 Proposing new semantic patches
97~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 129~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98 130
99New semantic patches can be proposed and submitted by kernel 131New semantic patches can be proposed and submitted by kernel
100developers. For sake of clarity, they should be organized in the 132developers. For sake of clarity, they should be organized in the
101subdirectories of 'scripts/coccinelle/'. 133sub-directories of 'scripts/coccinelle/'.
102 134
103 135
104 Detailed description of the 'report' mode 136 Detailed description of the 'report' mode
@@ -111,7 +143,7 @@ Example:
111 143
112Running 144Running
113 145
114 make coccicheck MODE=report COCCI=scripts/coccinelle/err_cast.cocci 146 make coccicheck MODE=report COCCI=scripts/coccinelle/api/err_cast.cocci
115 147
116will execute the following part of the SmPL script. 148will execute the following part of the SmPL script.
117 149
@@ -149,7 +181,7 @@ identified.
149Example: 181Example:
150 182
151Running 183Running
152 make coccicheck MODE=patch COCCI=scripts/coccinelle/err_cast.cocci 184 make coccicheck MODE=patch COCCI=scripts/coccinelle/api/err_cast.cocci
153 185
154will execute the following part of the SmPL script. 186will execute the following part of the SmPL script.
155 187
@@ -193,7 +225,7 @@ NOTE: The diff-like output generated is NOT an applicable patch. The
193Example: 225Example:
194 226
195Running 227Running
196 make coccicheck MODE=context COCCI=scripts/coccinelle/err_cast.cocci 228 make coccicheck MODE=context COCCI=scripts/coccinelle/api/err_cast.cocci
197 229
198will execute the following part of the SmPL script. 230will execute the following part of the SmPL script.
199 231
@@ -228,7 +260,7 @@ diff -u -p /home/user/linux/crypto/ctr.c /tmp/nothing
228Example: 260Example:
229 261
230Running 262Running
231 make coccicheck MODE=org COCCI=scripts/coccinelle/err_cast.cocci 263 make coccicheck MODE=org COCCI=scripts/coccinelle/api/err_cast.cocci
232 264
233will execute the following part of the SmPL script. 265will execute the following part of the SmPL script.
234 266
diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt
index 737988fca64d..e74d0a2eb1cf 100644
--- a/Documentation/cpu-freq/governors.txt
+++ b/Documentation/cpu-freq/governors.txt
@@ -158,6 +158,17 @@ intensive calculation on your laptop that you do not care how long it
158takes to complete as you can 'nice' it and prevent it from taking part 158takes to complete as you can 'nice' it and prevent it from taking part
159in the deciding process of whether to increase your CPU frequency. 159in the deciding process of whether to increase your CPU frequency.
160 160
161sampling_down_factor: this parameter controls the rate at which the
162kernel makes a decision on when to decrease the frequency while running
163at top speed. When set to 1 (the default) decisions to reevaluate load
164are made at the same interval regardless of current clock speed. But
165when set to greater than 1 (e.g. 100) it acts as a multiplier for the
166scheduling interval for reevaluating load when the CPU is at its top
167speed due to high load. This improves performance by reducing the overhead
168of load evaluation and helping the CPU stay at its top speed when truly
169busy, rather than shifting back and forth in speed. This tunable has no
170effect on behavior at lower speeds/lower CPU loads.
171
161 172
1622.5 Conservative 1732.5 Conservative
163---------------- 174----------------
diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt
index 45d5a217484f..a20bfd415e41 100644
--- a/Documentation/cpu-hotplug.txt
+++ b/Documentation/cpu-hotplug.txt
@@ -196,7 +196,7 @@ the state as 0 when a cpu if offline and 1 when its online.
196 #To display the current cpu state. 196 #To display the current cpu state.
197 #cat /sys/devices/system/cpu/cpuX/online 197 #cat /sys/devices/system/cpu/cpuX/online
198 198
199Q: Why cant i remove CPU0 on some systems? 199Q: Why can't i remove CPU0 on some systems?
200A: Some architectures may have some special dependency on a certain CPU. 200A: Some architectures may have some special dependency on a certain CPU.
201 201
202For e.g in IA64 platforms we have ability to sent platform interrupts to the 202For e.g in IA64 platforms we have ability to sent platform interrupts to the
diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt
index f1c5c4bccd3e..902d3151f527 100644
--- a/Documentation/cputopology.txt
+++ b/Documentation/cputopology.txt
@@ -14,25 +14,39 @@ to /proc/cpuinfo.
14 identifier (rather than the kernel's). The actual value is 14 identifier (rather than the kernel's). The actual value is
15 architecture and platform dependent. 15 architecture and platform dependent.
16 16
173) /sys/devices/system/cpu/cpuX/topology/thread_siblings: 173) /sys/devices/system/cpu/cpuX/topology/book_id:
18
19 the book ID of cpuX. Typically it is the hardware platform's
20 identifier (rather than the kernel's). The actual value is
21 architecture and platform dependent.
22
234) /sys/devices/system/cpu/cpuX/topology/thread_siblings:
18 24
19 internel kernel map of cpuX's hardware threads within the same 25 internel kernel map of cpuX's hardware threads within the same
20 core as cpuX 26 core as cpuX
21 27
224) /sys/devices/system/cpu/cpuX/topology/core_siblings: 285) /sys/devices/system/cpu/cpuX/topology/core_siblings:
23 29
24 internal kernel map of cpuX's hardware threads within the same 30 internal kernel map of cpuX's hardware threads within the same
25 physical_package_id. 31 physical_package_id.
26 32
336) /sys/devices/system/cpu/cpuX/topology/book_siblings:
34
35 internal kernel map of cpuX's hardware threads within the same
36 book_id.
37
27To implement it in an architecture-neutral way, a new source file, 38To implement it in an architecture-neutral way, a new source file,
28drivers/base/topology.c, is to export the 4 attributes. 39drivers/base/topology.c, is to export the 4 or 6 attributes. The two book
40related sysfs files will only be created if CONFIG_SCHED_BOOK is selected.
29 41
30For an architecture to support this feature, it must define some of 42For an architecture to support this feature, it must define some of
31these macros in include/asm-XXX/topology.h: 43these macros in include/asm-XXX/topology.h:
32#define topology_physical_package_id(cpu) 44#define topology_physical_package_id(cpu)
33#define topology_core_id(cpu) 45#define topology_core_id(cpu)
46#define topology_book_id(cpu)
34#define topology_thread_cpumask(cpu) 47#define topology_thread_cpumask(cpu)
35#define topology_core_cpumask(cpu) 48#define topology_core_cpumask(cpu)
49#define topology_book_cpumask(cpu)
36 50
37The type of **_id is int. 51The type of **_id is int.
38The type of siblings is (const) struct cpumask *. 52The type of siblings is (const) struct cpumask *.
@@ -45,6 +59,9 @@ not defined by include/asm-XXX/topology.h:
453) thread_siblings: just the given CPU 593) thread_siblings: just the given CPU
464) core_siblings: just the given CPU 604) core_siblings: just the given CPU
47 61
62For architectures that don't support books (CONFIG_SCHED_BOOK) there are no
63default definitions for topology_book_id() and topology_book_cpumask().
64
48Additionally, CPU topology information is provided under 65Additionally, CPU topology information is provided under
49/sys/devices/system/cpu and includes these files. The internal 66/sys/devices/system/cpu and includes these files. The internal
50source for the output is in brackets ("[]"). 67source for the output is in brackets ("[]").
diff --git a/Documentation/dell_rbu.txt b/Documentation/dell_rbu.txt
index 15174985ad08..d262e22bddec 100644
--- a/Documentation/dell_rbu.txt
+++ b/Documentation/dell_rbu.txt
@@ -62,7 +62,7 @@ image file and then arrange all these packets back to back in to one single
62file. 62file.
63This file is then copied to /sys/class/firmware/dell_rbu/data. 63This file is then copied to /sys/class/firmware/dell_rbu/data.
64Once this file gets to the driver, the driver extracts packet_size data from 64Once this file gets to the driver, the driver extracts packet_size data from
65the file and spreads it accross the physical memory in contiguous packet_sized 65the file and spreads it across the physical memory in contiguous packet_sized
66space. 66space.
67This method makes sure that all the packets get to the driver in a single operation. 67This method makes sure that all the packets get to the driver in a single operation.
68 68
diff --git a/Documentation/development-process/1.Intro b/Documentation/development-process/1.Intro
index 8cc2cba2b10d..9b614480aa84 100644
--- a/Documentation/development-process/1.Intro
+++ b/Documentation/development-process/1.Intro
@@ -56,13 +56,13 @@ information on kernel development.
56 56
571.2: WHAT THIS DOCUMENT IS ABOUT 571.2: WHAT THIS DOCUMENT IS ABOUT
58 58
59The Linux kernel, at over 6 million lines of code and well over 1000 active 59The Linux kernel, at over 8 million lines of code and well over 1000
60contributors, is one of the largest and most active free software projects 60contributors to each release, is one of the largest and most active free
61in existence. Since its humble beginning in 1991, this kernel has evolved 61software projects in existence. Since its humble beginning in 1991, this
62into a best-of-breed operating system component which runs on pocket-sized 62kernel has evolved into a best-of-breed operating system component which
63digital music players, desktop PCs, the largest supercomputers in 63runs on pocket-sized digital music players, desktop PCs, the largest
64existence, and all types of systems in between. It is a robust, efficient, 64supercomputers in existence, and all types of systems in between. It is a
65and scalable solution for almost any situation. 65robust, efficient, and scalable solution for almost any situation.
66 66
67With the growth of Linux has come an increase in the number of developers 67With the growth of Linux has come an increase in the number of developers
68(and companies) wishing to participate in its development. Hardware 68(and companies) wishing to participate in its development. Hardware
@@ -115,7 +115,7 @@ This document was written by Jonathan Corbet, corbet@lwn.net. It has been
115improved by comments from Johannes Berg, James Berry, Alex Chiang, Roland 115improved by comments from Johannes Berg, James Berry, Alex Chiang, Roland
116Dreier, Randy Dunlap, Jake Edge, Jiri Kosina, Matt Mackall, Arthur Marsh, 116Dreier, Randy Dunlap, Jake Edge, Jiri Kosina, Matt Mackall, Arthur Marsh,
117Amanda McPherson, Andrew Morton, Andrew Price, Tsugikazu Shibata, and 117Amanda McPherson, Andrew Morton, Andrew Price, Tsugikazu Shibata, and
118Jochen Voß. 118Jochen Voß.
119 119
120This work was supported by the Linux Foundation; thanks especially to 120This work was supported by the Linux Foundation; thanks especially to
121Amanda McPherson, who saw the value of this effort and made it all happen. 121Amanda McPherson, who saw the value of this effort and made it all happen.
@@ -221,7 +221,7 @@ include:
221- Everything that was said above about code review applies doubly to 221- Everything that was said above about code review applies doubly to
222 closed-source code. Since this code is not available at all, it cannot 222 closed-source code. Since this code is not available at all, it cannot
223 have been reviewed by the community and will, beyond doubt, have serious 223 have been reviewed by the community and will, beyond doubt, have serious
224 problems. 224 problems.
225 225
226Makers of embedded systems, in particular, may be tempted to disregard much 226Makers of embedded systems, in particular, may be tempted to disregard much
227of what has been said in this section in the belief that they are shipping 227of what has been said in this section in the belief that they are shipping
diff --git a/Documentation/development-process/2.Process b/Documentation/development-process/2.Process
index 97726eba6102..4823577c6509 100644
--- a/Documentation/development-process/2.Process
+++ b/Documentation/development-process/2.Process
@@ -14,16 +14,15 @@ The kernel developers use a loosely time-based release process, with a new
14major kernel release happening every two or three months. The recent 14major kernel release happening every two or three months. The recent
15release history looks like this: 15release history looks like this:
16 16
17 2.6.26 July 13, 2008 17 2.6.38 March 14, 2011
18 2.6.25 April 16, 2008 18 2.6.37 January 4, 2011
19 2.6.24 January 24, 2008 19 2.6.36 October 20, 2010
20 2.6.23 October 9, 2007 20 2.6.35 August 1, 2010
21 2.6.22 July 8, 2007 21 2.6.34 May 15, 2010
22 2.6.21 April 25, 2007 22 2.6.33 February 24, 2010
23 2.6.20 February 4, 2007
24 23
25Every 2.6.x release is a major kernel release with new features, internal 24Every 2.6.x release is a major kernel release with new features, internal
26API changes, and more. A typical 2.6 release can contain over 10,000 25API changes, and more. A typical 2.6 release can contain nearly 10,000
27changesets with changes to several hundred thousand lines of code. 2.6 is 26changesets with changes to several hundred thousand lines of code. 2.6 is
28thus the leading edge of Linux kernel development; the kernel uses a 27thus the leading edge of Linux kernel development; the kernel uses a
29rolling development model which is continually integrating major changes. 28rolling development model which is continually integrating major changes.
@@ -42,13 +41,13 @@ merge window do not come out of thin air; they have been collected, tested,
42and staged ahead of time. How that process works will be described in 41and staged ahead of time. How that process works will be described in
43detail later on). 42detail later on).
44 43
45The merge window lasts for two weeks. At the end of this time, Linus 44The merge window lasts for approximately two weeks. At the end of this
46Torvalds will declare that the window is closed and release the first of 45time, Linus Torvalds will declare that the window is closed and release the
47the "rc" kernels. For the kernel which is destined to be 2.6.26, for 46first of the "rc" kernels. For the kernel which is destined to be 2.6.40,
48example, the release which happens at the end of the merge window will be 47for example, the release which happens at the end of the merge window will
49called 2.6.26-rc1. The -rc1 release is the signal that the time to merge 48be called 2.6.40-rc1. The -rc1 release is the signal that the time to
50new features has passed, and that the time to stabilize the next kernel has 49merge new features has passed, and that the time to stabilize the next
51begun. 50kernel has begun.
52 51
53Over the next six to ten weeks, only patches which fix problems should be 52Over the next six to ten weeks, only patches which fix problems should be
54submitted to the mainline. On occasion a more significant change will be 53submitted to the mainline. On occasion a more significant change will be
@@ -66,20 +65,19 @@ will get up to somewhere between -rc6 and -rc9 before the kernel is
66considered to be sufficiently stable and the final 2.6.x release is made. 65considered to be sufficiently stable and the final 2.6.x release is made.
67At that point the whole process starts over again. 66At that point the whole process starts over again.
68 67
69As an example, here is how the 2.6.25 development cycle went (all dates in 68As an example, here is how the 2.6.38 development cycle went (all dates in
702008): 692011):
71 70
72 January 24 2.6.24 stable release 71 January 4 2.6.37 stable release
73 February 10 2.6.25-rc1, merge window closes 72 January 18 2.6.38-rc1, merge window closes
74 February 15 2.6.25-rc2 73 January 21 2.6.38-rc2
75 February 24 2.6.25-rc3 74 February 1 2.6.38-rc3
76 March 4 2.6.25-rc4 75 February 7 2.6.38-rc4
77 March 9 2.6.25-rc5 76 February 15 2.6.38-rc5
78 March 16 2.6.25-rc6 77 February 21 2.6.38-rc6
79 March 25 2.6.25-rc7 78 March 1 2.6.38-rc7
80 April 1 2.6.25-rc8 79 March 7 2.6.38-rc8
81 April 11 2.6.25-rc9 80 March 14 2.6.38 stable release
82 April 16 2.6.25 stable release
83 81
84How do the developers decide when to close the development cycle and create 82How do the developers decide when to close the development cycle and create
85the stable release? The most significant metric used is the list of 83the stable release? The most significant metric used is the list of
@@ -87,7 +85,7 @@ regressions from previous releases. No bugs are welcome, but those which
87break systems which worked in the past are considered to be especially 85break systems which worked in the past are considered to be especially
88serious. For this reason, patches which cause regressions are looked upon 86serious. For this reason, patches which cause regressions are looked upon
89unfavorably and are quite likely to be reverted during the stabilization 87unfavorably and are quite likely to be reverted during the stabilization
90period. 88period.
91 89
92The developers' goal is to fix all known regressions before the stable 90The developers' goal is to fix all known regressions before the stable
93release is made. In the real world, this kind of perfection is hard to 91release is made. In the real world, this kind of perfection is hard to
@@ -99,26 +97,34 @@ kernels go out with a handful of known regressions though, hopefully, none
99of them are serious. 97of them are serious.
100 98
101Once a stable release is made, its ongoing maintenance is passed off to the 99Once a stable release is made, its ongoing maintenance is passed off to the
102"stable team," currently comprised of Greg Kroah-Hartman and Chris Wright. 100"stable team," currently consisting of Greg Kroah-Hartman. The stable team
103The stable team will release occasional updates to the stable release using 101will release occasional updates to the stable release using the 2.6.x.y
104the 2.6.x.y numbering scheme. To be considered for an update release, a 102numbering scheme. To be considered for an update release, a patch must (1)
105patch must (1) fix a significant bug, and (2) already be merged into the 103fix a significant bug, and (2) already be merged into the mainline for the
106mainline for the next development kernel. Continuing our 2.6.25 example, 104next development kernel. Kernels will typically receive stable updates for
107the history (as of this writing) is: 105a little more than one development cycle past their initial release. So,
108 106for example, the 2.6.36 kernel's history looked like:
109 May 1 2.6.25.1 107
110 May 6 2.6.25.2 108 October 10 2.6.36 stable release
111 May 9 2.6.25.3 109 November 22 2.6.36.1
112 May 15 2.6.25.4 110 December 9 2.6.36.2
113 June 7 2.6.25.5 111 January 7 2.6.36.3
114 June 9 2.6.25.6 112 February 17 2.6.36.4
115 June 16 2.6.25.7 113
116 June 21 2.6.25.8 1142.6.36.4 was the final stable update for the 2.6.36 release.
117 June 24 2.6.25.9 115
118 116Some kernels are designated "long term" kernels; they will receive support
119Stable updates for a given kernel are made for approximately six months; 117for a longer period. As of this writing, the current long term kernels
120after that, the maintenance of stable releases is solely the responsibility 118and their maintainers are:
121of the distributors which have shipped that particular kernel. 119
120 2.6.27 Willy Tarreau (Deep-frozen stable kernel)
121 2.6.32 Greg Kroah-Hartman
122 2.6.35 Andi Kleen (Embedded flag kernel)
123
124The selection of a kernel for long-term support is purely a matter of a
125maintainer having the need and the time to maintain that release. There
126are no known plans for long-term support for any specific upcoming
127release.
122 128
123 129
1242.2: THE LIFECYCLE OF A PATCH 1302.2: THE LIFECYCLE OF A PATCH
@@ -130,7 +136,7 @@ each patch implements a change which is desirable to have in the mainline.
130This process can happen quickly for minor fixes, or, in the case of large 136This process can happen quickly for minor fixes, or, in the case of large
131and controversial changes, go on for years. Much developer frustration 137and controversial changes, go on for years. Much developer frustration
132comes from a lack of understanding of this process or from attempts to 138comes from a lack of understanding of this process or from attempts to
133circumvent it. 139circumvent it.
134 140
135In the hopes of reducing that frustration, this document will describe how 141In the hopes of reducing that frustration, this document will describe how
136a patch gets into the kernel. What follows below is an introduction which 142a patch gets into the kernel. What follows below is an introduction which
@@ -154,7 +160,7 @@ The stages that a patch goes through are, generally:
154 inclusion, it should be accepted by a relevant subsystem maintainer - 160 inclusion, it should be accepted by a relevant subsystem maintainer -
155 though this acceptance is not a guarantee that the patch will make it 161 though this acceptance is not a guarantee that the patch will make it
156 all the way to the mainline. The patch will show up in the maintainer's 162 all the way to the mainline. The patch will show up in the maintainer's
157 subsystem tree and into the staging trees (described below). When the 163 subsystem tree and into the -next trees (described below). When the
158 process works, this step leads to more extensive review of the patch and 164 process works, this step leads to more extensive review of the patch and
159 the discovery of any problems resulting from the integration of this 165 the discovery of any problems resulting from the integration of this
160 patch with work being done by others. 166 patch with work being done by others.
@@ -193,8 +199,8 @@ involved.
1932.3: HOW PATCHES GET INTO THE KERNEL 1992.3: HOW PATCHES GET INTO THE KERNEL
194 200
195There is exactly one person who can merge patches into the mainline kernel 201There is exactly one person who can merge patches into the mainline kernel
196repository: Linus Torvalds. But, of the over 12,000 patches which went 202repository: Linus Torvalds. But, of the over 9,500 patches which went
197into the 2.6.25 kernel, only 250 (around 2%) were directly chosen by Linus 203into the 2.6.38 kernel, only 112 (around 1.3%) were directly chosen by Linus
198himself. The kernel project has long since grown to a size where no single 204himself. The kernel project has long since grown to a size where no single
199developer could possibly inspect and select every patch unassisted. The 205developer could possibly inspect and select every patch unassisted. The
200way the kernel developers have addressed this growth is through the use of 206way the kernel developers have addressed this growth is through the use of
@@ -229,14 +235,14 @@ first in trees dedicated to network device drivers, wireless networking,
229etc. This chain of repositories can be arbitrarily long, though it rarely 235etc. This chain of repositories can be arbitrarily long, though it rarely
230exceeds two or three links. Since each maintainer in the chain trusts 236exceeds two or three links. Since each maintainer in the chain trusts
231those managing lower-level trees, this process is known as the "chain of 237those managing lower-level trees, this process is known as the "chain of
232trust." 238trust."
233 239
234Clearly, in a system like this, getting patches into the kernel depends on 240Clearly, in a system like this, getting patches into the kernel depends on
235finding the right maintainer. Sending patches directly to Linus is not 241finding the right maintainer. Sending patches directly to Linus is not
236normally the right way to go. 242normally the right way to go.
237 243
238 244
2392.4: STAGING TREES 2452.4: NEXT TREES
240 246
241The chain of subsystem trees guides the flow of patches into the kernel, 247The chain of subsystem trees guides the flow of patches into the kernel,
242but it also raises an interesting question: what if somebody wants to look 248but it also raises an interesting question: what if somebody wants to look
@@ -250,11 +256,11 @@ changes land in the mainline kernel. One could pull changes from all of
250the interesting subsystem trees, but that would be a big and error-prone 256the interesting subsystem trees, but that would be a big and error-prone
251job. 257job.
252 258
253The answer comes in the form of staging trees, where subsystem trees are 259The answer comes in the form of -next trees, where subsystem trees are
254collected for testing and review. The older of these trees, maintained by 260collected for testing and review. The older of these trees, maintained by
255Andrew Morton, is called "-mm" (for memory management, which is how it got 261Andrew Morton, is called "-mm" (for memory management, which is how it got
256started). The -mm tree integrates patches from a long list of subsystem 262started). The -mm tree integrates patches from a long list of subsystem
257trees; it also has some patches aimed at helping with debugging. 263trees; it also has some patches aimed at helping with debugging.
258 264
259Beyond that, -mm contains a significant collection of patches which have 265Beyond that, -mm contains a significant collection of patches which have
260been selected by Andrew directly. These patches may have been posted on a 266been selected by Andrew directly. These patches may have been posted on a
@@ -264,8 +270,8 @@ subsystem tree of last resort; if there is no other obvious path for a
264patch into the mainline, it is likely to end up in -mm. Miscellaneous 270patch into the mainline, it is likely to end up in -mm. Miscellaneous
265patches which accumulate in -mm will eventually either be forwarded on to 271patches which accumulate in -mm will eventually either be forwarded on to
266an appropriate subsystem tree or be sent directly to Linus. In a typical 272an appropriate subsystem tree or be sent directly to Linus. In a typical
267development cycle, approximately 10% of the patches going into the mainline 273development cycle, approximately 5-10% of the patches going into the
268get there via -mm. 274mainline get there via -mm.
269 275
270The current -mm patch is available in the "mmotm" (-mm of the moment) 276The current -mm patch is available in the "mmotm" (-mm of the moment)
271directory at: 277directory at:
@@ -275,7 +281,7 @@ directory at:
275Use of the MMOTM tree is likely to be a frustrating experience, though; 281Use of the MMOTM tree is likely to be a frustrating experience, though;
276there is a definite chance that it will not even compile. 282there is a definite chance that it will not even compile.
277 283
278The other staging tree, started more recently, is linux-next, maintained by 284The primary tree for next-cycle patch merging is linux-next, maintained by
279Stephen Rothwell. The linux-next tree is, by design, a snapshot of what 285Stephen Rothwell. The linux-next tree is, by design, a snapshot of what
280the mainline is expected to look like after the next merge window closes. 286the mainline is expected to look like after the next merge window closes.
281Linux-next trees are announced on the linux-kernel and linux-next mailing 287Linux-next trees are announced on the linux-kernel and linux-next mailing
@@ -287,27 +293,37 @@ Some information about linux-next has been gathered at:
287 293
288 http://linux.f-seidel.de/linux-next/pmwiki/ 294 http://linux.f-seidel.de/linux-next/pmwiki/
289 295
290How the linux-next tree will fit into the development process is still 296Linux-next has become an integral part of the kernel development process;
291changing. As of this writing, the first full development cycle involving 297all patches merged during a given merge window should really have found
292linux-next (2.6.26) is coming to an end; thus far, it has proved to be a 298their way into linux-next some time before the merge window opens.
293valuable resource for finding and fixing integration problems before the 299
294beginning of the merge window. See http://lwn.net/Articles/287155/ for 300
295more information on how linux-next has worked to set up the 2.6.27 merge 3012.4.1: STAGING TREES
296window. 302
297 303The kernel source tree contains the drivers/staging/ directory, where
298Some developers have begun to suggest that linux-next should be used as the 304many sub-directories for drivers or filesystems that are on their way to
299target for future development as well. The linux-next tree does tend to be 305being added to the kernel tree live. They remain in drivers/staging while
300far ahead of the mainline and is more representative of the tree into which 306they still need more work; once complete, they can be moved into the
301any new work will be merged. The downside to this idea is that the 307kernel proper. This is a way to keep track of drivers that aren't
302volatility of linux-next tends to make it a difficult development target. 308up to Linux kernel coding or quality standards, but people may want to use
303See http://lwn.net/Articles/289013/ for more information on this topic, and 309them and track development.
304stay tuned; much is still in flux where linux-next is involved. 310
305 311Greg Kroah-Hartman currently maintains the staging tree. Drivers that
306Besides the mmotm and linux-next trees, the kernel source tree now contains 312still need work are sent to him, with each driver having its own
307the drivers/staging/ directory and many sub-directories for drivers or 313subdirectory in drivers/staging/. Along with the driver source files, a
308filesystems that are on their way to being added to the kernel tree 314TODO file should be present in the directory as well. The TODO file lists
309proper, but they remain in drivers/staging/ while they still need more 315the pending work that the driver needs for acceptance into the kernel
310work. 316proper, as well as a list of people that should be Cc'd for any patches to
317the driver. Current rules require that drivers contributed to staging
318must, at a minimum, compile properly.
319
320Staging can be a relatively easy way to get new drivers into the mainline
321where, with luck, they will come to the attention of other developers and
322improve quickly. Entry into staging is not the end of the story, though;
323code in staging which is not seeing regular progress will eventually be
324removed. Distributors also tend to be relatively reluctant to enable
325staging drivers. So staging is, at best, a stop on the way toward becoming
326a proper mainline driver.
311 327
312 328
3132.5: TOOLS 3292.5: TOOLS
@@ -334,11 +350,7 @@ page at:
334 350
335 http://git-scm.com/ 351 http://git-scm.com/
336 352
337That page has pointers to documentation and tutorials. One should be 353That page has pointers to documentation and tutorials.
338aware, in particular, of the Kernel Hacker's Guide to git, which has
339information specific to kernel development:
340
341 http://linux.yyz.us/git-howto.html
342 354
343Among the kernel developers who do not use git, the most popular choice is 355Among the kernel developers who do not use git, the most popular choice is
344almost certainly Mercurial: 356almost certainly Mercurial:
@@ -395,7 +407,7 @@ There are a few hints which can help with linux-kernel survival:
395 important to filter on both the topic of interest (though note that 407 important to filter on both the topic of interest (though note that
396 long-running conversations can drift away from the original subject 408 long-running conversations can drift away from the original subject
397 without changing the email subject line) and the people who are 409 without changing the email subject line) and the people who are
398 participating. 410 participating.
399 411
400- Do not feed the trolls. If somebody is trying to stir up an angry 412- Do not feed the trolls. If somebody is trying to stir up an angry
401 response, ignore them. 413 response, ignore them.
diff --git a/Documentation/development-process/3.Early-stage b/Documentation/development-process/3.Early-stage
index 307a159a70ca..f87ba7b3fbac 100644
--- a/Documentation/development-process/3.Early-stage
+++ b/Documentation/development-process/3.Early-stage
@@ -110,8 +110,8 @@ the kernel community's standards. Some examples include:
110 110
111 - The AppArmor security module made use of internal virtual filesystem 111 - The AppArmor security module made use of internal virtual filesystem
112 data structures in ways which were considered to be unsafe and 112 data structures in ways which were considered to be unsafe and
113 unreliable. This code has since been significantly reworked, but 113 unreliable. This concern (among others) kept AppArmor out of the
114 remains outside of the mainline. 114 mainline for years.
115 115
116In each of these cases, a great deal of pain and extra work could have been 116In each of these cases, a great deal of pain and extra work could have been
117avoided with some early discussion with the kernel developers. 117avoided with some early discussion with the kernel developers.
@@ -138,6 +138,19 @@ patches, and who, if anybody, is attaching Signed-off-by lines to those
138patches. Those are the people who will be best placed to help with a new 138patches. Those are the people who will be best placed to help with a new
139development project. 139development project.
140 140
141The task of finding the right maintainer is sometimes challenging enough
142that the kernel developers have added a script to ease the process:
143
144 .../scripts/get_maintainer.pl
145
146This script will return the current maintainer(s) for a given file or
147directory when given the "-f" option. If passed a patch on the
148command line, it will list the maintainers who should probably receive
149copies of the patch. There are a number of options regulating how hard
150get_maintainer.pl will search for maintainers; please be careful about
151using the more aggressive options as you may end up including developers
152who have no real interest in the code you are modifying.
153
141If all else fails, talking to Andrew Morton can be an effective way to 154If all else fails, talking to Andrew Morton can be an effective way to
142track down a maintainer for a specific piece of code. 155track down a maintainer for a specific piece of code.
143 156
@@ -155,11 +168,15 @@ reaction, but, instead, little or no reaction at all. The sad truth of the
155matter is (1) kernel developers tend to be busy, (2) there is no shortage 168matter is (1) kernel developers tend to be busy, (2) there is no shortage
156of people with grand plans and little code (or even prospect of code) to 169of people with grand plans and little code (or even prospect of code) to
157back them up, and (3) nobody is obligated to review or comment on ideas 170back them up, and (3) nobody is obligated to review or comment on ideas
158posted by others. If a request-for-comments posting yields little in the 171posted by others. Beyond that, high-level designs often hide problems
159way of comments, do not assume that it means there is no interest in the 172which are only reviewed when somebody actually tries to implement those
160project. Unfortunately, you also cannot assume that there are no problems 173designs; for that reason, kernel developers would rather see the code.
161with your idea. The best thing to do in this situation is to proceed, 174
162keeping the community informed as you go. 175If a request-for-comments posting yields little in the way of comments, do
176not assume that it means there is no interest in the project.
177Unfortunately, you also cannot assume that there are no problems with your
178idea. The best thing to do in this situation is to proceed, keeping the
179community informed as you go.
163 180
164 181
1653.5: GETTING OFFICIAL BUY-IN 1823.5: GETTING OFFICIAL BUY-IN
diff --git a/Documentation/development-process/4.Coding b/Documentation/development-process/4.Coding
index 2278693c8ffa..f3f1a469443c 100644
--- a/Documentation/development-process/4.Coding
+++ b/Documentation/development-process/4.Coding
@@ -131,6 +131,11 @@ classic time/space tradeoff taught in beginning data structures classes
131often does not apply to contemporary hardware. Space *is* time, in that a 131often does not apply to contemporary hardware. Space *is* time, in that a
132larger program will run slower than one which is more compact. 132larger program will run slower than one which is more compact.
133 133
134More recent compilers take an increasingly active role in deciding whether
135a given function should actually be inlined or not. So the liberal
136placement of "inline" keywords may not just be excessive; it could also be
137irrelevant.
138
134 139
135* Locking 140* Locking
136 141
@@ -285,6 +290,13 @@ be found at https://sparse.wiki.kernel.org/index.php/Main_Page if your
285distributor does not package it); it can then be run on the code by adding 290distributor does not package it); it can then be run on the code by adding
286"C=1" to your make command. 291"C=1" to your make command.
287 292
293The "Coccinelle" tool (http://coccinelle.lip6.fr/) is able to find a wide
294variety of potential coding problems; it can also propose fixes for those
295problems. Quite a few "semantic patches" for the kernel have been packaged
296under the scripts/coccinelle directory; running "make coccicheck" will run
297through those semantic patches and report on any problems found. See
298Documentation/coccinelle.txt for more information.
299
288Other kinds of portability errors are best found by compiling your code for 300Other kinds of portability errors are best found by compiling your code for
289other architectures. If you do not happen to have an S/390 system or a 301other architectures. If you do not happen to have an S/390 system or a
290Blackfin development board handy, you can still perform the compilation 302Blackfin development board handy, you can still perform the compilation
@@ -308,7 +320,9 @@ The first piece of documentation for any patch is its associated
308changelog. Log entries should describe the problem being solved, the form 320changelog. Log entries should describe the problem being solved, the form
309of the solution, the people who worked on the patch, any relevant 321of the solution, the people who worked on the patch, any relevant
310effects on performance, and anything else that might be needed to 322effects on performance, and anything else that might be needed to
311understand the patch. 323understand the patch. Be sure that the changelog says *why* the patch is
324worth applying; a surprising number of developers fail to provide that
325information.
312 326
313Any code which adds a new user-space interface - including new sysfs or 327Any code which adds a new user-space interface - including new sysfs or
314/proc files - should include documentation of that interface which enables 328/proc files - should include documentation of that interface which enables
@@ -321,7 +335,7 @@ boot-time parameters. Any patch which adds new parameters should add the
321appropriate entries to this file. 335appropriate entries to this file.
322 336
323Any new configuration options must be accompanied by help text which 337Any new configuration options must be accompanied by help text which
324clearly explains the options and when the user might want to select them. 338clearly explains the options and when the user might want to select them.
325 339
326Internal API information for many subsystems is documented by way of 340Internal API information for many subsystems is documented by way of
327specially-formatted comments; these comments can be extracted and formatted 341specially-formatted comments; these comments can be extracted and formatted
@@ -372,7 +386,8 @@ which is broken by the change. For a widely-used function, this duty can
372lead to literally hundreds or thousands of changes - many of which are 386lead to literally hundreds or thousands of changes - many of which are
373likely to conflict with work being done by other developers. Needless to 387likely to conflict with work being done by other developers. Needless to
374say, this can be a large job, so it is best to be sure that the 388say, this can be a large job, so it is best to be sure that the
375justification is solid. 389justification is solid. Note that the Coccinelle tool can help with
390wide-ranging API changes.
376 391
377When making an incompatible API change, one should, whenever possible, 392When making an incompatible API change, one should, whenever possible,
378ensure that code which has not been updated is caught by the compiler. 393ensure that code which has not been updated is caught by the compiler.
diff --git a/Documentation/development-process/5.Posting b/Documentation/development-process/5.Posting
index f622c1e9f0f9..903a2546f138 100644
--- a/Documentation/development-process/5.Posting
+++ b/Documentation/development-process/5.Posting
@@ -60,12 +60,15 @@ even in the short term.
60 60
61Patches must be prepared against a specific version of the kernel. As a 61Patches must be prepared against a specific version of the kernel. As a
62general rule, a patch should be based on the current mainline as found in 62general rule, a patch should be based on the current mainline as found in
63Linus's git tree. It may become necessary to make versions against -mm, 63Linus's git tree. When basing on mainline, start with a well-known release
64linux-next, or a subsystem tree, though, to facilitate wider testing and 64point - a stable or -rc release - rather than branching off the mainline at
65review. Depending on the area of your patch and what is going on 65an arbitrary spot.
66elsewhere, basing a patch against these other trees can require a 66
67significant amount of work resolving conflicts and dealing with API 67It may become necessary to make versions against -mm, linux-next, or a
68changes. 68subsystem tree, though, to facilitate wider testing and review. Depending
69on the area of your patch and what is going on elsewhere, basing a patch
70against these other trees can require a significant amount of work
71resolving conflicts and dealing with API changes.
69 72
70Only the most simple changes should be formatted as a single patch; 73Only the most simple changes should be formatted as a single patch;
71everything else should be made as a logical series of changes. Splitting 74everything else should be made as a logical series of changes. Splitting
@@ -100,11 +103,11 @@ rules of thumb, however, which can help considerably:
100 result is a broken kernel, you will make life harder for developers and 103 result is a broken kernel, you will make life harder for developers and
101 users who are engaging in the noble work of tracking down problems. 104 users who are engaging in the noble work of tracking down problems.
102 105
103 - Do not overdo it, though. One developer recently posted a set of edits 106 - Do not overdo it, though. One developer once posted a set of edits
104 to a single file as 500 separate patches - an act which did not make him 107 to a single file as 500 separate patches - an act which did not make him
105 the most popular person on the kernel mailing list. A single patch can 108 the most popular person on the kernel mailing list. A single patch can
106 be reasonably large as long as it still contains a single *logical* 109 be reasonably large as long as it still contains a single *logical*
107 change. 110 change.
108 111
109 - It can be tempting to add a whole new infrastructure with a series of 112 - It can be tempting to add a whole new infrastructure with a series of
110 patches, but to leave that infrastructure unused until the final patch 113 patches, but to leave that infrastructure unused until the final patch
@@ -162,7 +165,8 @@ To that end, the summary line should describe the effects of and motivation
162for the change as well as possible given the one-line constraint. The 165for the change as well as possible given the one-line constraint. The
163detailed description can then amplify on those topics and provide any 166detailed description can then amplify on those topics and provide any
164needed additional information. If the patch fixes a bug, cite the commit 167needed additional information. If the patch fixes a bug, cite the commit
165which introduced the bug if possible. If a problem is associated with 168which introduced the bug if possible (and please provide both the commit ID
169and the title when citing commits). If a problem is associated with
166specific log or compiler output, include that output to help others 170specific log or compiler output, include that output to help others
167searching for a solution to the same problem. If the change is meant to 171searching for a solution to the same problem. If the change is meant to
168support other changes coming in later patch, say so. If internal APIs are 172support other changes coming in later patch, say so. If internal APIs are
@@ -230,7 +234,7 @@ take care of:
230 which have had gratuitous white-space changes or line wrapping performed 234 which have had gratuitous white-space changes or line wrapping performed
231 by the mail client will not apply at the other end, and often will not 235 by the mail client will not apply at the other end, and often will not
232 be examined in any detail. If there is any doubt at all, mail the patch 236 be examined in any detail. If there is any doubt at all, mail the patch
233 to yourself and convince yourself that it shows up intact. 237 to yourself and convince yourself that it shows up intact.
234 238
235 Documentation/email-clients.txt has some helpful hints on making 239 Documentation/email-clients.txt has some helpful hints on making
236 specific mail clients work for sending patches. 240 specific mail clients work for sending patches.
@@ -287,7 +291,7 @@ something like:
287 291
288where "nn" is the ordinal number of the patch, "mm" is the total number of 292where "nn" is the ordinal number of the patch, "mm" is the total number of
289patches in the series, and "subsys" is the name of the affected subsystem. 293patches in the series, and "subsys" is the name of the affected subsystem.
290Clearly, nn/mm can be omitted for a single, standalone patch. 294Clearly, nn/mm can be omitted for a single, standalone patch.
291 295
292If you have a significant series of patches, it is customary to send an 296If you have a significant series of patches, it is customary to send an
293introductory description as part zero. This convention is not universally 297introductory description as part zero. This convention is not universally
@@ -299,5 +303,5 @@ In general, the second and following parts of a multi-part patch should be
299sent as a reply to the first part so that they all thread together at the 303sent as a reply to the first part so that they all thread together at the
300receiving end. Tools like git and quilt have commands to mail out a set of 304receiving end. Tools like git and quilt have commands to mail out a set of
301patches with the proper threading. If you have a long series, though, and 305patches with the proper threading. If you have a long series, though, and
302are using git, please provide the --no-chain-reply-to option to avoid 306are using git, please stay away from the --chain-reply-to option to avoid
303creating exceptionally deep nesting. 307creating exceptionally deep nesting.
diff --git a/Documentation/development-process/6.Followthrough b/Documentation/development-process/6.Followthrough
index a8fba3d83a85..41d324a9420d 100644
--- a/Documentation/development-process/6.Followthrough
+++ b/Documentation/development-process/6.Followthrough
@@ -66,6 +66,11 @@ be easy to become blinded by your own solution to a problem to the point
66that you don't realize that something is fundamentally wrong or, perhaps, 66that you don't realize that something is fundamentally wrong or, perhaps,
67you're not even solving the right problem. 67you're not even solving the right problem.
68 68
69Andrew Morton has suggested that every review comment which does not result
70in a code change should result in an additional code comment instead; that
71can help future reviewers avoid the questions which came up the first time
72around.
73
69One fatal mistake is to ignore review comments in the hope that they will 74One fatal mistake is to ignore review comments in the hope that they will
70go away. They will not go away. If you repost code without having 75go away. They will not go away. If you repost code without having
71responded to the comments you got the time before, you're likely to find 76responded to the comments you got the time before, you're likely to find
@@ -100,7 +105,7 @@ entry into a subsystem maintainer's tree. How that works varies from one
100subsystem to the next; each maintainer has his or her own way of doing 105subsystem to the next; each maintainer has his or her own way of doing
101things. In particular, there may be more than one tree - one, perhaps, 106things. In particular, there may be more than one tree - one, perhaps,
102dedicated to patches planned for the next merge window, and another for 107dedicated to patches planned for the next merge window, and another for
103longer-term work. 108longer-term work.
104 109
105For patches applying to areas for which there is no obvious subsystem tree 110For patches applying to areas for which there is no obvious subsystem tree
106(memory management patches, for example), the default tree often ends up 111(memory management patches, for example), the default tree often ends up
@@ -109,11 +114,10 @@ through the -mm tree.
109 114
110Inclusion into a subsystem tree can bring a higher level of visibility to a 115Inclusion into a subsystem tree can bring a higher level of visibility to a
111patch. Now other developers working with that tree will get the patch by 116patch. Now other developers working with that tree will get the patch by
112default. Subsystem trees typically feed into -mm and linux-next as well, 117default. Subsystem trees typically feed linux-next as well, making their
113making their contents visible to the development community as a whole. At 118contents visible to the development community as a whole. At this point,
114this point, there's a good chance that you will get more comments from a 119there's a good chance that you will get more comments from a new set of
115new set of reviewers; these comments need to be answered as in the previous 120reviewers; these comments need to be answered as in the previous round.
116round.
117 121
118What may also happen at this point, depending on the nature of your patch, 122What may also happen at this point, depending on the nature of your patch,
119is that conflicts with work being done by others turn up. In the worst 123is that conflicts with work being done by others turn up. In the worst
diff --git a/Documentation/development-process/7.AdvancedTopics b/Documentation/development-process/7.AdvancedTopics
index 837179447e17..26dc3fa196e4 100644
--- a/Documentation/development-process/7.AdvancedTopics
+++ b/Documentation/development-process/7.AdvancedTopics
@@ -119,7 +119,7 @@ can affect your ability to get trees pulled in the future. Quoting Linus:
119 to trust things *without* then having to go and check every 119 to trust things *without* then having to go and check every
120 individual change by hand. 120 individual change by hand.
121 121
122(http://lwn.net/Articles/224135/). 122(http://lwn.net/Articles/224135/).
123 123
124To avoid this kind of situation, ensure that all patches within a given 124To avoid this kind of situation, ensure that all patches within a given
125branch stick closely to the associated topic; a "driver fixes" branch 125branch stick closely to the associated topic; a "driver fixes" branch
@@ -138,7 +138,7 @@ When requesting a pull, be sure to give all the relevant information: where
138your tree is, what branch to pull, and what changes will result from the 138your tree is, what branch to pull, and what changes will result from the
139pull. The git request-pull command can be helpful in this regard; it will 139pull. The git request-pull command can be helpful in this regard; it will
140format the request as other developers expect, and will also check to be 140format the request as other developers expect, and will also check to be
141sure that you have remembered to push those changes to the public server. 141sure that you have remembered to push those changes to the public server.
142 142
143 143
1447.2: REVIEWING PATCHES 1447.2: REVIEWING PATCHES
diff --git a/Documentation/device-mapper/dm-crypt.txt b/Documentation/device-mapper/dm-crypt.txt
index 524de926290d..6b5c42dbbe84 100644
--- a/Documentation/device-mapper/dm-crypt.txt
+++ b/Documentation/device-mapper/dm-crypt.txt
@@ -8,7 +8,7 @@ Parameters: <cipher> <key> <iv_offset> <device path> <offset>
8 8
9<cipher> 9<cipher>
10 Encryption cipher and an optional IV generation mode. 10 Encryption cipher and an optional IV generation mode.
11 (In format cipher-chainmode-ivopts:ivmode). 11 (In format cipher[:keycount]-chainmode-ivopts:ivmode).
12 Examples: 12 Examples:
13 des 13 des
14 aes-cbc-essiv:sha256 14 aes-cbc-essiv:sha256
@@ -20,6 +20,11 @@ Parameters: <cipher> <key> <iv_offset> <device path> <offset>
20 Key used for encryption. It is encoded as a hexadecimal number. 20 Key used for encryption. It is encoded as a hexadecimal number.
21 You can only use key sizes that are valid for the selected cipher. 21 You can only use key sizes that are valid for the selected cipher.
22 22
23<keycount>
24 Multi-key compatibility mode. You can define <keycount> keys and
25 then sectors are encrypted according to their offsets (sector 0 uses key0;
26 sector 1 uses key1 etc.). <keycount> must be a power of two.
27
23<iv_offset> 28<iv_offset>
24 The IV offset is a sector count that is added to the sector number 29 The IV offset is a sector count that is added to the sector number
25 before creating the IV. 30 before creating the IV.
@@ -36,7 +41,7 @@ Example scripts
36=============== 41===============
37LUKS (Linux Unified Key Setup) is now the preferred way to set up disk 42LUKS (Linux Unified Key Setup) is now the preferred way to set up disk
38encryption with dm-crypt using the 'cryptsetup' utility, see 43encryption with dm-crypt using the 'cryptsetup' utility, see
39http://clemens.endorphin.org/cryptography 44http://code.google.com/p/cryptsetup/
40 45
41[[ 46[[
42#!/bin/sh 47#!/bin/sh
diff --git a/Documentation/device-mapper/dm-flakey.txt b/Documentation/device-mapper/dm-flakey.txt
new file mode 100644
index 000000000000..c8efdfd19a65
--- /dev/null
+++ b/Documentation/device-mapper/dm-flakey.txt
@@ -0,0 +1,17 @@
1dm-flakey
2=========
3
4This target is the same as the linear target except that it returns I/O
5errors periodically. It's been found useful in simulating failing
6devices for testing purposes.
7
8Starting from the time the table is loaded, the device is available for
9<up interval> seconds, then returns errors for <down interval> seconds,
10and then this cycle repeats.
11
12Parameters: <dev path> <offset> <up interval> <down interval>
13 <dev path>: Full pathname to the underlying block-device, or a
14 "major:minor" device-number.
15 <offset>: Starting sector within the device.
16 <up interval>: Number of seconds device is available.
17 <down interval>: Number of seconds device returns errors.
diff --git a/Documentation/device-mapper/dm-raid.txt b/Documentation/device-mapper/dm-raid.txt
new file mode 100644
index 000000000000..33b6b7071ac8
--- /dev/null
+++ b/Documentation/device-mapper/dm-raid.txt
@@ -0,0 +1,70 @@
1Device-mapper RAID (dm-raid) is a bridge from DM to MD. It
2provides a way to use device-mapper interfaces to access the MD RAID
3drivers.
4
5As with all device-mapper targets, the nominal public interfaces are the
6constructor (CTR) tables and the status outputs (both STATUSTYPE_INFO
7and STATUSTYPE_TABLE). The CTR table looks like the following:
8
91: <s> <l> raid \
102: <raid_type> <#raid_params> <raid_params> \
113: <#raid_devs> <meta_dev1> <dev1> .. <meta_devN> <devN>
12
13Line 1 contains the standard first three arguments to any device-mapper
14target - the start, length, and target type fields. The target type in
15this case is "raid".
16
17Line 2 contains the arguments that define the particular raid
18type/personality/level, the required arguments for that raid type, and
19any optional arguments. Possible raid types include: raid4, raid5_la,
20raid5_ls, raid5_rs, raid6_zr, raid6_nr, and raid6_nc. (raid1 is
21planned for the future.) The list of required and optional parameters
22is the same for all the current raid types. The required parameters are
23positional, while the optional parameters are given as key/value pairs.
24The possible parameters are as follows:
25 <chunk_size> Chunk size in sectors.
26 [[no]sync] Force/Prevent RAID initialization
27 [rebuild <idx>] Rebuild the drive indicated by the index
28 [daemon_sleep <ms>] Time between bitmap daemon work to clear bits
29 [min_recovery_rate <kB/sec/disk>] Throttle RAID initialization
30 [max_recovery_rate <kB/sec/disk>] Throttle RAID initialization
31 [max_write_behind <sectors>] See '-write-behind=' (man mdadm)
32 [stripe_cache <sectors>] Stripe cache size for higher RAIDs
33
34Line 3 contains the list of devices that compose the array in
35metadata/data device pairs. If the metadata is stored separately, a '-'
36is given for the metadata device position. If a drive has failed or is
37missing at creation time, a '-' can be given for both the metadata and
38data drives for a given position.
39
40NB. Currently all metadata devices must be specified as '-'.
41
42Examples:
43# RAID4 - 4 data drives, 1 parity
44# No metadata devices specified to hold superblock/bitmap info
45# Chunk size of 1MiB
46# (Lines separated for easy reading)
470 1960893648 raid \
48 raid4 1 2048 \
49 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81
50
51# RAID4 - 4 data drives, 1 parity (no metadata devices)
52# Chunk size of 1MiB, force RAID initialization,
53# min recovery rate at 20 kiB/sec/disk
540 1960893648 raid \
55 raid4 4 2048 min_recovery_rate 20 sync\
56 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81
57
58Performing a 'dmsetup table' should display the CTR table used to
59construct the mapping (with possible reordering of optional
60parameters).
61
62Performing a 'dmsetup status' will yield information on the state and
63health of the array. The output is as follows:
641: <s> <l> raid \
652: <raid_type> <#devices> <1 health char for each dev> <resync_ratio>
66
67Line 1 is standard DM output. Line 2 is best shown by example:
68 0 1960893648 raid raid4 5 AAAAA 2/490221568
69Here we can see the RAID type is raid4, there are 5 devices - all of
70which are 'A'live, and the array is 2/490221568 complete with recovery.
diff --git a/Documentation/device-mapper/dm-service-time.txt b/Documentation/device-mapper/dm-service-time.txt
index 7d00668e97bb..fb1d4a0cf122 100644
--- a/Documentation/device-mapper/dm-service-time.txt
+++ b/Documentation/device-mapper/dm-service-time.txt
@@ -37,7 +37,7 @@ Algorithm
37========= 37=========
38 38
39dm-service-time adds the I/O size to 'in-flight-size' when the I/O is 39dm-service-time adds the I/O size to 'in-flight-size' when the I/O is
40dispatched and substracts when completed. 40dispatched and subtracts when completed.
41Basically, dm-service-time selects a path having minimum service time 41Basically, dm-service-time selects a path having minimum service time
42which is calculated by: 42which is calculated by:
43 43
diff --git a/Documentation/devices.txt b/Documentation/devices.txt
index d0d1df6cb5de..eccffe715229 100644
--- a/Documentation/devices.txt
+++ b/Documentation/devices.txt
@@ -239,6 +239,7 @@ Your cooperation is appreciated.
239 0 = /dev/tty Current TTY device 239 0 = /dev/tty Current TTY device
240 1 = /dev/console System console 240 1 = /dev/console System console
241 2 = /dev/ptmx PTY master multiplex 241 2 = /dev/ptmx PTY master multiplex
242 3 = /dev/ttyprintk User messages via printk TTY device
242 64 = /dev/cua0 Callout device for ttyS0 243 64 = /dev/cua0 Callout device for ttyS0
243 ... 244 ...
244 255 = /dev/cua191 Callout device for ttyS191 245 255 = /dev/cua191 Callout device for ttyS191
@@ -1495,9 +1496,6 @@ Your cooperation is appreciated.
1495 64 = /dev/radio0 Radio device 1496 64 = /dev/radio0 Radio device
1496 ... 1497 ...
1497 127 = /dev/radio63 Radio device 1498 127 = /dev/radio63 Radio device
1498 192 = /dev/vtx0 Teletext device
1499 ...
1500 223 = /dev/vtx31 Teletext device
1501 224 = /dev/vbi0 Vertical blank interrupt 1499 224 = /dev/vbi0 Vertical blank interrupt
1502 ... 1500 ...
1503 255 = /dev/vbi31 Vertical blank interrupt 1501 255 = /dev/vbi31 Vertical blank interrupt
@@ -2519,6 +2517,12 @@ Your cooperation is appreciated.
2519 8 = /dev/mmcblk1 Second SD/MMC card 2517 8 = /dev/mmcblk1 Second SD/MMC card
2520 ... 2518 ...
2521 2519
2520 The start of next SD/MMC card can be configured with
2521 CONFIG_MMC_BLOCK_MINORS, or overridden at boot/modprobe
2522 time using the mmcblk.perdev_minors option. That would
2523 bump the offset between each card to be the configured
2524 value instead of the default 8.
2525
2522179 char CCube DVXChip-based PCI products 2526179 char CCube DVXChip-based PCI products
2523 0 = /dev/dvxirq0 First DVX device 2527 0 = /dev/dvxirq0 First DVX device
2524 1 = /dev/dvxirq1 Second DVX device 2528 1 = /dev/dvxirq1 Second DVX device
@@ -2553,7 +2557,10 @@ Your cooperation is appreciated.
2553 175 = /dev/usb/legousbtower15 16th USB Legotower device 2557 175 = /dev/usb/legousbtower15 16th USB Legotower device
2554 176 = /dev/usb/usbtmc1 First USB TMC device 2558 176 = /dev/usb/usbtmc1 First USB TMC device
2555 ... 2559 ...
2556 192 = /dev/usb/usbtmc16 16th USB TMC device 2560 191 = /dev/usb/usbtmc16 16th USB TMC device
2561 192 = /dev/usb/yurex1 First USB Yurex device
2562 ...
2563 209 = /dev/usb/yurex16 16th USB Yurex device
2557 240 = /dev/usb/dabusb0 First daubusb device 2564 240 = /dev/usb/dabusb0 First daubusb device
2558 ... 2565 ...
2559 243 = /dev/usb/dabusb3 Fourth dabusb device 2566 243 = /dev/usb/dabusb3 Fourth dabusb device
diff --git a/Documentation/devicetree/00-INDEX b/Documentation/devicetree/00-INDEX
new file mode 100644
index 000000000000..b78f691fd847
--- /dev/null
+++ b/Documentation/devicetree/00-INDEX
@@ -0,0 +1,10 @@
1Documentation for device trees, a data structure by which bootloaders pass
2hardware layout to Linux in a device-independent manner, simplifying hardware
3probing. This subsystem is maintained by Grant Likely
4<grant.likely@secretlab.ca> and has a mailing list at
5https://lists.ozlabs.org/listinfo/devicetree-discuss
6
700-INDEX
8 - this file
9booting-without-of.txt
10 - Booting Linux without Open Firmware, describes history and format of device trees.
diff --git a/Documentation/powerpc/dts-bindings/fsl/sata.txt b/Documentation/devicetree/bindings/ata/fsl-sata.txt
index b46bcf46c3d8..b46bcf46c3d8 100644
--- a/Documentation/powerpc/dts-bindings/fsl/sata.txt
+++ b/Documentation/devicetree/bindings/ata/fsl-sata.txt
diff --git a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
new file mode 100644
index 000000000000..bf57ecd5d73a
--- /dev/null
+++ b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
@@ -0,0 +1,397 @@
1=====================================================================
2SEC 4 Device Tree Binding
3Copyright (C) 2008-2011 Freescale Semiconductor Inc.
4
5 CONTENTS
6 -Overview
7 -SEC 4 Node
8 -Job Ring Node
9 -Run Time Integrity Check (RTIC) Node
10 -Run Time Integrity Check (RTIC) Memory Node
11 -Secure Non-Volatile Storage (SNVS) Node
12 -Full Example
13
14NOTE: the SEC 4 is also known as Freescale's Cryptographic Accelerator
15Accelerator and Assurance Module (CAAM).
16
17=====================================================================
18Overview
19
20DESCRIPTION
21
22SEC 4 h/w can process requests from 2 types of sources.
231. DPAA Queue Interface (HW interface between Queue Manager & SEC 4).
242. Job Rings (HW interface between cores & SEC 4 registers).
25
26High Speed Data Path Configuration:
27
28HW interface between QM & SEC 4 and also BM & SEC 4, on DPAA-enabled parts
29such as the P4080. The number of simultaneous dequeues the QI can make is
30equal to the number of Descriptor Controller (DECO) engines in a particular
31SEC version. E.g., the SEC 4.0 in the P4080 has 5 DECOs and can thus
32dequeue from 5 subportals simultaneously.
33
34Job Ring Data Path Configuration:
35
36Each JR is located on a separate 4k page, they may (or may not) be made visible
37in the memory partition devoted to a particular core. The P4080 has 4 JRs, so
38up to 4 JRs can be configured; and all 4 JRs process requests in parallel.
39
40=====================================================================
41SEC 4 Node
42
43Description
44
45 Node defines the base address of the SEC 4 block.
46 This block specifies the address range of all global
47 configuration registers for the SEC 4 block. It
48 also receives interrupts from the Run Time Integrity Check
49 (RTIC) function within the SEC 4 block.
50
51PROPERTIES
52
53 - compatible
54 Usage: required
55 Value type: <string>
56 Definition: Must include "fsl,sec-v4.0"
57
58 - #address-cells
59 Usage: required
60 Value type: <u32>
61 Definition: A standard property. Defines the number of cells
62 for representing physical addresses in child nodes.
63
64 - #size-cells
65 Usage: required
66 Value type: <u32>
67 Definition: A standard property. Defines the number of cells
68 for representing the size of physical addresses in
69 child nodes.
70
71 - reg
72 Usage: required
73 Value type: <prop-encoded-array>
74 Definition: A standard property. Specifies the physical
75 address and length of the SEC4 configuration registers.
76 registers
77
78 - ranges
79 Usage: required
80 Value type: <prop-encoded-array>
81 Definition: A standard property. Specifies the physical address
82 range of the SEC 4.0 register space (-SNVS not included). A
83 triplet that includes the child address, parent address, &
84 length.
85
86 - interrupts
87 Usage: required
88 Value type: <prop_encoded-array>
89 Definition: Specifies the interrupts generated by this
90 device. The value of the interrupts property
91 consists of one interrupt specifier. The format
92 of the specifier is defined by the binding document
93 describing the node's interrupt parent.
94
95 - interrupt-parent
96 Usage: (required if interrupt property is defined)
97 Value type: <phandle>
98 Definition: A single <phandle> value that points
99 to the interrupt parent to which the child domain
100 is being mapped.
101
102 Note: All other standard properties (see the ePAPR) are allowed
103 but are optional.
104
105
106EXAMPLE
107 crypto@300000 {
108 compatible = "fsl,sec-v4.0";
109 #address-cells = <1>;
110 #size-cells = <1>;
111 reg = <0x300000 0x10000>;
112 ranges = <0 0x300000 0x10000>;
113 interrupt-parent = <&mpic>;
114 interrupts = <92 2>;
115 };
116
117=====================================================================
118Job Ring (JR) Node
119
120 Child of the crypto node defines data processing interface to SEC 4
121 across the peripheral bus for purposes of processing
122 cryptographic descriptors. The specified address
123 range can be made visible to one (or more) cores.
124 The interrupt defined for this node is controlled within
125 the address range of this node.
126
127 - compatible
128 Usage: required
129 Value type: <string>
130 Definition: Must include "fsl,sec-v4.0-job-ring"
131
132 - reg
133 Usage: required
134 Value type: <prop-encoded-array>
135 Definition: Specifies a two JR parameters: an offset from
136 the parent physical address and the length the JR registers.
137
138 - fsl,liodn
139 Usage: optional-but-recommended
140 Value type: <prop-encoded-array>
141 Definition:
142 Specifies the LIODN to be used in conjunction with
143 the ppid-to-liodn table that specifies the PPID to LIODN mapping.
144 Needed if the PAMU is used. Value is a 12 bit value
145 where value is a LIODN ID for this JR. This property is
146 normally set by boot firmware.
147
148 - interrupts
149 Usage: required
150 Value type: <prop_encoded-array>
151 Definition: Specifies the interrupts generated by this
152 device. The value of the interrupts property
153 consists of one interrupt specifier. The format
154 of the specifier is defined by the binding document
155 describing the node's interrupt parent.
156
157 - interrupt-parent
158 Usage: (required if interrupt property is defined)
159 Value type: <phandle>
160 Definition: A single <phandle> value that points
161 to the interrupt parent to which the child domain
162 is being mapped.
163
164EXAMPLE
165 jr@1000 {
166 compatible = "fsl,sec-v4.0-job-ring";
167 reg = <0x1000 0x1000>;
168 fsl,liodn = <0x081>;
169 interrupt-parent = <&mpic>;
170 interrupts = <88 2>;
171 };
172
173
174=====================================================================
175Run Time Integrity Check (RTIC) Node
176
177 Child node of the crypto node. Defines a register space that
178 contains up to 5 sets of addresses and their lengths (sizes) that
179 will be checked at run time. After an initial hash result is
180 calculated, these addresses are checked by HW to monitor any
181 change. If any memory is modified, a Security Violation is
182 triggered (see SNVS definition).
183
184
185 - compatible
186 Usage: required
187 Value type: <string>
188 Definition: Must include "fsl,sec-v4.0-rtic".
189
190 - #address-cells
191 Usage: required
192 Value type: <u32>
193 Definition: A standard property. Defines the number of cells
194 for representing physical addresses in child nodes. Must
195 have a value of 1.
196
197 - #size-cells
198 Usage: required
199 Value type: <u32>
200 Definition: A standard property. Defines the number of cells
201 for representing the size of physical addresses in
202 child nodes. Must have a value of 1.
203
204 - reg
205 Usage: required
206 Value type: <prop-encoded-array>
207 Definition: A standard property. Specifies a two parameters:
208 an offset from the parent physical address and the length
209 the SEC4 registers.
210
211 - ranges
212 Usage: required
213 Value type: <prop-encoded-array>
214 Definition: A standard property. Specifies the physical address
215 range of the SEC 4 register space (-SNVS not included). A
216 triplet that includes the child address, parent address, &
217 length.
218
219EXAMPLE
220 rtic@6000 {
221 compatible = "fsl,sec-v4.0-rtic";
222 #address-cells = <1>;
223 #size-cells = <1>;
224 reg = <0x6000 0x100>;
225 ranges = <0x0 0x6100 0xe00>;
226 };
227
228=====================================================================
229Run Time Integrity Check (RTIC) Memory Node
230 A child node that defines individual RTIC memory regions that are used to
231 perform run-time integrity check of memory areas that should not modified.
232 The node defines a register that contains the memory address &
233 length (combined) and a second register that contains the hash result
234 in big endian format.
235
236 - compatible
237 Usage: required
238 Value type: <string>
239 Definition: Must include "fsl,sec-v4.0-rtic-memory".
240
241 - reg
242 Usage: required
243 Value type: <prop-encoded-array>
244 Definition: A standard property. Specifies two parameters:
245 an offset from the parent physical address and the length:
246
247 1. The location of the RTIC memory address & length registers.
248 2. The location RTIC hash result.
249
250 - fsl,rtic-region
251 Usage: optional-but-recommended
252 Value type: <prop-encoded-array>
253 Definition:
254 Specifies the HW address (36 bit address) for this region
255 followed by the length of the HW partition to be checked;
256 the address is represented as a 64 bit quantity followed
257 by a 32 bit length.
258
259 - fsl,liodn
260 Usage: optional-but-recommended
261 Value type: <prop-encoded-array>
262 Definition:
263 Specifies the LIODN to be used in conjunction with
264 the ppid-to-liodn table that specifies the PPID to LIODN
265 mapping. Needed if the PAMU is used. Value is a 12 bit value
266 where value is a LIODN ID for this RTIC memory region. This
267 property is normally set by boot firmware.
268
269EXAMPLE
270 rtic-a@0 {
271 compatible = "fsl,sec-v4.0-rtic-memory";
272 reg = <0x00 0x20 0x100 0x80>;
273 fsl,liodn = <0x03c>;
274 fsl,rtic-region = <0x12345678 0x12345678 0x12345678>;
275 };
276
277=====================================================================
278Secure Non-Volatile Storage (SNVS) Node
279
280 Node defines address range and the associated
281 interrupt for the SNVS function. This function
282 monitors security state information & reports
283 security violations.
284
285 - compatible
286 Usage: required
287 Value type: <string>
288 Definition: Must include "fsl,sec-v4.0-mon".
289
290 - reg
291 Usage: required
292 Value type: <prop-encoded-array>
293 Definition: A standard property. Specifies the physical
294 address and length of the SEC4 configuration
295 registers.
296
297 - interrupts
298 Usage: required
299 Value type: <prop_encoded-array>
300 Definition: Specifies the interrupts generated by this
301 device. The value of the interrupts property
302 consists of one interrupt specifier. The format
303 of the specifier is defined by the binding document
304 describing the node's interrupt parent.
305
306 - interrupt-parent
307 Usage: (required if interrupt property is defined)
308 Value type: <phandle>
309 Definition: A single <phandle> value that points
310 to the interrupt parent to which the child domain
311 is being mapped.
312
313EXAMPLE
314 sec_mon@314000 {
315 compatible = "fsl,sec-v4.0-mon";
316 reg = <0x314000 0x1000>;
317 interrupt-parent = <&mpic>;
318 interrupts = <93 2>;
319 };
320
321=====================================================================
322FULL EXAMPLE
323
324 crypto: crypto@300000 {
325 compatible = "fsl,sec-v4.0";
326 #address-cells = <1>;
327 #size-cells = <1>;
328 reg = <0x300000 0x10000>;
329 ranges = <0 0x300000 0x10000>;
330 interrupt-parent = <&mpic>;
331 interrupts = <92 2>;
332
333 sec_jr0: jr@1000 {
334 compatible = "fsl,sec-v4.0-job-ring";
335 reg = <0x1000 0x1000>;
336 interrupt-parent = <&mpic>;
337 interrupts = <88 2>;
338 };
339
340 sec_jr1: jr@2000 {
341 compatible = "fsl,sec-v4.0-job-ring";
342 reg = <0x2000 0x1000>;
343 interrupt-parent = <&mpic>;
344 interrupts = <89 2>;
345 };
346
347 sec_jr2: jr@3000 {
348 compatible = "fsl,sec-v4.0-job-ring";
349 reg = <0x3000 0x1000>;
350 interrupt-parent = <&mpic>;
351 interrupts = <90 2>;
352 };
353
354 sec_jr3: jr@4000 {
355 compatible = "fsl,sec-v4.0-job-ring";
356 reg = <0x4000 0x1000>;
357 interrupt-parent = <&mpic>;
358 interrupts = <91 2>;
359 };
360
361 rtic@6000 {
362 compatible = "fsl,sec-v4.0-rtic";
363 #address-cells = <1>;
364 #size-cells = <1>;
365 reg = <0x6000 0x100>;
366 ranges = <0x0 0x6100 0xe00>;
367
368 rtic_a: rtic-a@0 {
369 compatible = "fsl,sec-v4.0-rtic-memory";
370 reg = <0x00 0x20 0x100 0x80>;
371 };
372
373 rtic_b: rtic-b@20 {
374 compatible = "fsl,sec-v4.0-rtic-memory";
375 reg = <0x20 0x20 0x200 0x80>;
376 };
377
378 rtic_c: rtic-c@40 {
379 compatible = "fsl,sec-v4.0-rtic-memory";
380 reg = <0x40 0x20 0x300 0x80>;
381 };
382
383 rtic_d: rtic-d@60 {
384 compatible = "fsl,sec-v4.0-rtic-memory";
385 reg = <0x60 0x20 0x500 0x80>;
386 };
387 };
388 };
389
390 sec_mon: sec_mon@314000 {
391 compatible = "fsl,sec-v4.0-mon";
392 reg = <0x314000 0x1000>;
393 interrupt-parent = <&mpic>;
394 interrupts = <93 2>;
395 };
396
397=====================================================================
diff --git a/Documentation/devicetree/bindings/eeprom.txt b/Documentation/devicetree/bindings/eeprom.txt
new file mode 100644
index 000000000000..4342c10de1bf
--- /dev/null
+++ b/Documentation/devicetree/bindings/eeprom.txt
@@ -0,0 +1,28 @@
1EEPROMs (I2C)
2
3Required properties:
4
5 - compatible : should be "<manufacturer>,<type>"
6 If there is no specific driver for <manufacturer>, a generic
7 driver based on <type> is selected. Possible types are:
8 24c00, 24c01, 24c02, 24c04, 24c08, 24c16, 24c32, 24c64,
9 24c128, 24c256, 24c512, 24c1024, spd
10
11 - reg : the I2C address of the EEPROM
12
13Optional properties:
14
15 - pagesize : the length of the pagesize for writing. Please consult the
16 manual of your device, that value varies a lot. A wrong value
17 may result in data loss! If not specified, a safety value of
18 '1' is used which will be very slow.
19
20 - read-only: this parameterless property disables writes to the eeprom
21
22Example:
23
24eeprom@52 {
25 compatible = "atmel,24c32";
26 reg = <0x52>;
27 pagesize = <32>;
28};
diff --git a/Documentation/devicetree/bindings/fb/sm501fb.txt b/Documentation/devicetree/bindings/fb/sm501fb.txt
new file mode 100644
index 000000000000..9d9f0098092b
--- /dev/null
+++ b/Documentation/devicetree/bindings/fb/sm501fb.txt
@@ -0,0 +1,34 @@
1* SM SM501
2
3The SM SM501 is a LCD controller, with proper hardware, it can also
4drive DVI monitors.
5
6Required properties:
7- compatible : should be "smi,sm501".
8- reg : contain two entries:
9 - First entry: System Configuration register
10 - Second entry: IO space (Display Controller register)
11- interrupts : SMI interrupt to the cpu should be described here.
12- interrupt-parent : the phandle for the interrupt controller that
13 services interrupts for this device.
14
15Optional properties:
16- mode : select a video mode:
17 <xres>x<yres>[-<bpp>][@<refresh>]
18- edid : verbatim EDID data block describing attached display.
19 Data from the detailed timing descriptor will be used to
20 program the display controller.
21- little-endian: available on big endian systems, to
22 set different foreign endian.
23- big-endian: available on little endian systems, to
24 set different foreign endian.
25
26Example for MPC5200:
27 display@1,0 {
28 compatible = "smi,sm501";
29 reg = <1 0x00000000 0x00800000
30 1 0x03e00000 0x00200000>;
31 interrupts = <1 1 3>;
32 mode = "640x480-32@60";
33 edid = [edid-data];
34 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/8xxx_gpio.txt b/Documentation/devicetree/bindings/gpio/8xxx_gpio.txt
index b0019eb5330e..b0019eb5330e 100644
--- a/Documentation/powerpc/dts-bindings/fsl/8xxx_gpio.txt
+++ b/Documentation/devicetree/bindings/gpio/8xxx_gpio.txt
diff --git a/Documentation/powerpc/dts-bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt
index edaa84d288a1..edaa84d288a1 100644
--- a/Documentation/powerpc/dts-bindings/gpio/gpio.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio.txt
diff --git a/Documentation/powerpc/dts-bindings/gpio/led.txt b/Documentation/devicetree/bindings/gpio/led.txt
index 064db928c3c1..064db928c3c1 100644
--- a/Documentation/powerpc/dts-bindings/gpio/led.txt
+++ b/Documentation/devicetree/bindings/gpio/led.txt
diff --git a/Documentation/devicetree/bindings/hwmon/ads1015.txt b/Documentation/devicetree/bindings/hwmon/ads1015.txt
new file mode 100644
index 000000000000..918a507d1159
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/ads1015.txt
@@ -0,0 +1,73 @@
1ADS1015 (I2C)
2
3This device is a 12-bit A-D converter with 4 inputs.
4
5The inputs can be used single ended or in certain differential combinations.
6
7For configuration all possible combinations are mapped to 8 channels:
8 0: Voltage over AIN0 and AIN1.
9 1: Voltage over AIN0 and AIN3.
10 2: Voltage over AIN1 and AIN3.
11 3: Voltage over AIN2 and AIN3.
12 4: Voltage over AIN0 and GND.
13 5: Voltage over AIN1 and GND.
14 6: Voltage over AIN2 and GND.
15 7: Voltage over AIN3 and GND.
16
17Each channel can be configured individually:
18 - pga is the programmable gain amplifier (values are full scale)
19 0: +/- 6.144 V
20 1: +/- 4.096 V
21 2: +/- 2.048 V (default)
22 3: +/- 1.024 V
23 4: +/- 0.512 V
24 5: +/- 0.256 V
25 - data_rate in samples per second
26 0: 128
27 1: 250
28 2: 490
29 3: 920
30 4: 1600 (default)
31 5: 2400
32 6: 3300
33
341) The /ads1015 node
35
36 Required properties:
37
38 - compatible : must be "ti,ads1015"
39 - reg : I2C bus address of the device
40 - #address-cells : must be <1>
41 - #size-cells : must be <0>
42
43 The node contains child nodes for each channel that the platform uses.
44
45 Example ADS1015 node:
46
47 ads1015@49 {
48 compatible = "ti,ads1015";
49 reg = <0x49>;
50 #address-cells = <1>;
51 #size-cells = <0>;
52
53 [ child node definitions... ]
54 }
55
562) channel nodes
57
58 Required properties:
59
60 - reg : the channel number
61
62 Optional properties:
63
64 - ti,gain : the programmable gain amplifier setting
65 - ti,datarate : the converter data rate
66
67 Example ADS1015 channel node:
68
69 channel@4 {
70 reg = <4>;
71 ti,gain = <3>;
72 ti,datarate = <5>;
73 };
diff --git a/Documentation/devicetree/bindings/i2c/ce4100-i2c.txt b/Documentation/devicetree/bindings/i2c/ce4100-i2c.txt
new file mode 100644
index 000000000000..569b16248514
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/ce4100-i2c.txt
@@ -0,0 +1,93 @@
1CE4100 I2C
2----------
3
4CE4100 has one PCI device which is described as the I2C-Controller. This
5PCI device has three PCI-bars, each bar contains a complete I2C
6controller. So we have a total of three independent I2C-Controllers
7which share only an interrupt line.
8The driver is probed via the PCI-ID and is gathering the information of
9attached devices from the devices tree.
10Grant Likely recommended to use the ranges property to map the PCI-Bar
11number to its physical address and to use this to find the child nodes
12of the specific I2C controller. This were his exact words:
13
14 Here's where the magic happens. Each entry in
15 ranges describes how the parent pci address space
16 (middle group of 3) is translated to the local
17 address space (first group of 2) and the size of
18 each range (last cell). In this particular case,
19 the first cell of the local address is chosen to be
20 1:1 mapped to the BARs, and the second is the
21 offset from be base of the BAR (which would be
22 non-zero if you had 2 or more devices mapped off
23 the same BAR)
24
25 ranges allows the address mapping to be described
26 in a way that the OS can interpret without
27 requiring custom device driver code.
28
29This is an example which is used on FalconFalls:
30------------------------------------------------
31 i2c-controller@b,2 {
32 #address-cells = <2>;
33 #size-cells = <1>;
34 compatible = "pci8086,2e68.2",
35 "pci8086,2e68",
36 "pciclass,ff0000",
37 "pciclass,ff00";
38
39 reg = <0x15a00 0x0 0x0 0x0 0x0>;
40 interrupts = <16 1>;
41
42 /* as described by Grant, the first number in the group of
43 * three is the bar number followed by the 64bit bar address
44 * followed by size of the mapping. The bar address
45 * requires also a valid translation in parents ranges
46 * property.
47 */
48 ranges = <0 0 0x02000000 0 0xdffe0500 0x100
49 1 0 0x02000000 0 0xdffe0600 0x100
50 2 0 0x02000000 0 0xdffe0700 0x100>;
51
52 i2c@0 {
53 #address-cells = <1>;
54 #size-cells = <0>;
55 compatible = "intel,ce4100-i2c-controller";
56
57 /* The first number in the reg property is the
58 * number of the bar
59 */
60 reg = <0 0 0x100>;
61
62 /* This I2C controller has no devices */
63 };
64
65 i2c@1 {
66 #address-cells = <1>;
67 #size-cells = <0>;
68 compatible = "intel,ce4100-i2c-controller";
69 reg = <1 0 0x100>;
70
71 /* This I2C controller has one gpio controller */
72 gpio@26 {
73 #gpio-cells = <2>;
74 compatible = "ti,pcf8575";
75 reg = <0x26>;
76 gpio-controller;
77 };
78 };
79
80 i2c@2 {
81 #address-cells = <1>;
82 #size-cells = <0>;
83 compatible = "intel,ce4100-i2c-controller";
84 reg = <2 0 0x100>;
85
86 gpio@26 {
87 #gpio-cells = <2>;
88 compatible = "ti,pcf8575";
89 reg = <0x26>;
90 gpio-controller;
91 };
92 };
93 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/i2c.txt b/Documentation/devicetree/bindings/i2c/fsl-i2c.txt
index 1eacd6b20ed5..1eacd6b20ed5 100644
--- a/Documentation/powerpc/dts-bindings/fsl/i2c.txt
+++ b/Documentation/devicetree/bindings/i2c/fsl-i2c.txt
diff --git a/Documentation/powerpc/dts-bindings/marvell.txt b/Documentation/devicetree/bindings/marvell.txt
index f1533d91953a..f1533d91953a 100644
--- a/Documentation/powerpc/dts-bindings/marvell.txt
+++ b/Documentation/devicetree/bindings/marvell.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt b/Documentation/devicetree/bindings/mmc/fsl-esdhc.txt
index 64bcb8be973c..64bcb8be973c 100644
--- a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt
+++ b/Documentation/devicetree/bindings/mmc/fsl-esdhc.txt
diff --git a/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt b/Documentation/devicetree/bindings/mmc/mmc-spi-slot.txt
index c39ac2891951..89a0084df2f7 100644
--- a/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt
+++ b/Documentation/devicetree/bindings/mmc/mmc-spi-slot.txt
@@ -7,8 +7,13 @@ Required properties:
7- voltage-ranges : two cells are required, first cell specifies minimum 7- voltage-ranges : two cells are required, first cell specifies minimum
8 slot voltage (mV), second cell specifies maximum slot voltage (mV). 8 slot voltage (mV), second cell specifies maximum slot voltage (mV).
9 Several ranges could be specified. 9 Several ranges could be specified.
10- gpios : (optional) may specify GPIOs in this order: Card-Detect GPIO, 10
11Optional properties:
12- gpios : may specify GPIOs in this order: Card-Detect GPIO,
11 Write-Protect GPIO. 13 Write-Protect GPIO.
14- interrupts : the interrupt of a card detect interrupt.
15- interrupt-parent : the phandle for the interrupt controller that
16 services interrupts for this device.
12 17
13Example: 18Example:
14 19
@@ -20,4 +25,6 @@ Example:
20 &qe_pio_d 15 0>; 25 &qe_pio_d 15 0>;
21 voltage-ranges = <3300 3300>; 26 voltage-ranges = <3300 3300>;
22 spi-max-frequency = <50000000>; 27 spi-max-frequency = <50000000>;
28 interrupts = <42>;
29 interrupt-parent = <&PIC>;
23 }; 30 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt b/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt
index a48b2cadc7f0..00f1f546b32e 100644
--- a/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt
@@ -15,7 +15,7 @@ Optional properties:
15- gpios : may specify optional GPIOs connected to the Ready-Not-Busy pins 15- gpios : may specify optional GPIOs connected to the Ready-Not-Busy pins
16 (R/B#). For multi-chip devices, "n" GPIO definitions are required 16 (R/B#). For multi-chip devices, "n" GPIO definitions are required
17 according to the number of chips. 17 according to the number of chips.
18- chip-delay : chip dependent delay for transfering data from array to 18- chip-delay : chip dependent delay for transferring data from array to
19 read registers (tR). Required if property "gpios" is not used 19 read registers (tR). Required if property "gpios" is not used
20 (R/B# pins not connected). 20 (R/B# pins not connected).
21 21
diff --git a/Documentation/powerpc/dts-bindings/mtd-physmap.txt b/Documentation/devicetree/bindings/mtd/mtd-physmap.txt
index 80152cb567d9..80152cb567d9 100644
--- a/Documentation/powerpc/dts-bindings/mtd-physmap.txt
+++ b/Documentation/devicetree/bindings/mtd/mtd-physmap.txt
diff --git a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
new file mode 100755
index 000000000000..1a729f089866
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
@@ -0,0 +1,61 @@
1CAN Device Tree Bindings
2------------------------
32011 Freescale Semiconductor, Inc.
4
5fsl,flexcan-v1.0 nodes
6-----------------------
7In addition to the required compatible-, reg- and interrupt-properties, you can
8also specify which clock source shall be used for the controller.
9
10CPI Clock- Can Protocol Interface Clock
11 This CLK_SRC bit of CTRL(control register) selects the clock source to
12 the CAN Protocol Interface(CPI) to be either the peripheral clock
13 (driven by the PLL) or the crystal oscillator clock. The selected clock
14 is the one fed to the prescaler to generate the Serial Clock (Sclock).
15 The PRESDIV field of CTRL(control register) controls a prescaler that
16 generates the Serial Clock (Sclock), whose period defines the
17 time quantum used to compose the CAN waveform.
18
19Can Engine Clock Source
20 There are two sources for CAN clock
21 - Platform Clock It represents the bus clock
22 - Oscillator Clock
23
24 Peripheral Clock (PLL)
25 --------------
26 |
27 --------- -------------
28 | |CPI Clock | Prescaler | Sclock
29 | |---------------->| (1.. 256) |------------>
30 --------- -------------
31 | |
32 -------------- ---------------------CLK_SRC
33 Oscillator Clock
34
35- fsl,flexcan-clock-source : CAN Engine Clock Source.This property selects
36 the peripheral clock. PLL clock is fed to the
37 prescaler to generate the Serial Clock (Sclock).
38 Valid values are "oscillator" and "platform"
39 "oscillator": CAN engine clock source is oscillator clock.
40 "platform" The CAN engine clock source is the bus clock
41 (platform clock).
42
43- fsl,flexcan-clock-divider : for the reference and system clock, an additional
44 clock divider can be specified.
45- clock-frequency: frequency required to calculate the bitrate for FlexCAN.
46
47Note:
48 - v1.0 of flexcan-v1.0 represent the IP block version for P1010 SOC.
49 - P1010 does not have oscillator as the Clock Source.So the default
50 Clock Source is platform clock.
51Examples:
52
53 can0@1c000 {
54 compatible = "fsl,flexcan-v1.0";
55 reg = <0x1c000 0x1000>;
56 interrupts = <48 0x2>;
57 interrupt-parent = <&mpic>;
58 fsl,flexcan-clock-source = "platform";
59 fsl,flexcan-clock-divider = <2>;
60 clock-frequency = <fixed by u-boot>;
61 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/can.txt b/Documentation/devicetree/bindings/net/can/mpc5xxx-mscan.txt
index 2fa4fcd38fd6..2fa4fcd38fd6 100644
--- a/Documentation/powerpc/dts-bindings/fsl/can.txt
+++ b/Documentation/devicetree/bindings/net/can/mpc5xxx-mscan.txt
diff --git a/Documentation/powerpc/dts-bindings/can/sja1000.txt b/Documentation/devicetree/bindings/net/can/sja1000.txt
index d6d209ded937..c2dbcec0ee31 100644
--- a/Documentation/powerpc/dts-bindings/can/sja1000.txt
+++ b/Documentation/devicetree/bindings/net/can/sja1000.txt
@@ -39,7 +39,7 @@ Optional properties:
39 39
40- nxp,no-comparator-bypass : Allows to disable the CAN input comperator. 40- nxp,no-comparator-bypass : Allows to disable the CAN input comperator.
41 41
42For futher information, please have a look to the SJA1000 data sheet. 42For further information, please have a look to the SJA1000 data sheet.
43 43
44Examples: 44Examples:
45 45
diff --git a/Documentation/powerpc/dts-bindings/fsl/tsec.txt b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
index edb7ae19e868..2c6be0377f55 100644
--- a/Documentation/powerpc/dts-bindings/fsl/tsec.txt
+++ b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
@@ -74,3 +74,57 @@ Example:
74 interrupt-parent = <&mpic>; 74 interrupt-parent = <&mpic>;
75 phy-handle = <&phy0> 75 phy-handle = <&phy0>
76 }; 76 };
77
78* Gianfar PTP clock nodes
79
80General Properties:
81
82 - compatible Should be "fsl,etsec-ptp"
83 - reg Offset and length of the register set for the device
84 - interrupts There should be at least two interrupts. Some devices
85 have as many as four PTP related interrupts.
86
87Clock Properties:
88
89 - fsl,tclk-period Timer reference clock period in nanoseconds.
90 - fsl,tmr-prsc Prescaler, divides the output clock.
91 - fsl,tmr-add Frequency compensation value.
92 - fsl,tmr-fiper1 Fixed interval period pulse generator.
93 - fsl,tmr-fiper2 Fixed interval period pulse generator.
94 - fsl,max-adj Maximum frequency adjustment in parts per billion.
95
96 These properties set the operational parameters for the PTP
97 clock. You must choose these carefully for the clock to work right.
98 Here is how to figure good values:
99
100 TimerOsc = system clock MHz
101 tclk_period = desired clock period nanoseconds
102 NominalFreq = 1000 / tclk_period MHz
103 FreqDivRatio = TimerOsc / NominalFreq (must be greater that 1.0)
104 tmr_add = ceil(2^32 / FreqDivRatio)
105 OutputClock = NominalFreq / tmr_prsc MHz
106 PulseWidth = 1 / OutputClock microseconds
107 FiperFreq1 = desired frequency in Hz
108 FiperDiv1 = 1000000 * OutputClock / FiperFreq1
109 tmr_fiper1 = tmr_prsc * tclk_period * FiperDiv1 - tclk_period
110 max_adj = 1000000000 * (FreqDivRatio - 1.0) - 1
111
112 The calculation for tmr_fiper2 is the same as for tmr_fiper1. The
113 driver expects that tmr_fiper1 will be correctly set to produce a 1
114 Pulse Per Second (PPS) signal, since this will be offered to the PPS
115 subsystem to synchronize the Linux clock.
116
117Example:
118
119 ptp_clock@24E00 {
120 compatible = "fsl,etsec-ptp";
121 reg = <0x24E00 0xB0>;
122 interrupts = <12 0x8 13 0x8>;
123 interrupt-parent = < &ipic >;
124 fsl,tclk-period = <10>;
125 fsl,tmr-prsc = <100>;
126 fsl,tmr-add = <0x999999A4>;
127 fsl,tmr-fiper1 = <0x3B9AC9F6>;
128 fsl,tmr-fiper2 = <0x00018696>;
129 fsl,max-adj = <659999998>;
130 };
diff --git a/Documentation/powerpc/dts-bindings/gpio/mdio.txt b/Documentation/devicetree/bindings/net/mdio-gpio.txt
index bc9549529014..bc9549529014 100644
--- a/Documentation/powerpc/dts-bindings/gpio/mdio.txt
+++ b/Documentation/devicetree/bindings/net/mdio-gpio.txt
diff --git a/Documentation/powerpc/dts-bindings/phy.txt b/Documentation/devicetree/bindings/net/phy.txt
index bb8c742eb8c5..bb8c742eb8c5 100644
--- a/Documentation/powerpc/dts-bindings/phy.txt
+++ b/Documentation/devicetree/bindings/net/phy.txt
diff --git a/Documentation/devicetree/bindings/open-pic.txt b/Documentation/devicetree/bindings/open-pic.txt
new file mode 100644
index 000000000000..909a902dff85
--- /dev/null
+++ b/Documentation/devicetree/bindings/open-pic.txt
@@ -0,0 +1,98 @@
1* Open PIC Binding
2
3This binding specifies what properties must be available in the device tree
4representation of an Open PIC compliant interrupt controller. This binding is
5based on the binding defined for Open PIC in [1] and is a superset of that
6binding.
7
8Required properties:
9
10 NOTE: Many of these descriptions were paraphrased here from [1] to aid
11 readability.
12
13 - compatible: Specifies the compatibility list for the PIC. The type
14 shall be <string> and the value shall include "open-pic".
15
16 - reg: Specifies the base physical address(s) and size(s) of this
17 PIC's addressable register space. The type shall be <prop-encoded-array>.
18
19 - interrupt-controller: The presence of this property identifies the node
20 as an Open PIC. No property value shall be defined.
21
22 - #interrupt-cells: Specifies the number of cells needed to encode an
23 interrupt source. The type shall be a <u32> and the value shall be 2.
24
25 - #address-cells: Specifies the number of cells needed to encode an
26 address. The type shall be <u32> and the value shall be 0. As such,
27 'interrupt-map' nodes do not have to specify a parent unit address.
28
29Optional properties:
30
31 - pic-no-reset: The presence of this property indicates that the PIC
32 shall not be reset during runtime initialization. No property value shall
33 be defined. The presence of this property also mandates that any
34 initialization related to interrupt sources shall be limited to sources
35 explicitly referenced in the device tree.
36
37* Interrupt Specifier Definition
38
39 Interrupt specifiers consists of 2 cells encoded as
40 follows:
41
42 - <1st-cell>: The interrupt-number that identifies the interrupt source.
43
44 - <2nd-cell>: The level-sense information, encoded as follows:
45 0 = low-to-high edge triggered
46 1 = active low level-sensitive
47 2 = active high level-sensitive
48 3 = high-to-low edge triggered
49
50* Examples
51
52Example 1:
53
54 /*
55 * An Open PIC interrupt controller
56 */
57 mpic: pic@40000 {
58 // This is an interrupt controller node.
59 interrupt-controller;
60
61 // No address cells so that 'interrupt-map' nodes which reference
62 // this Open PIC node do not need a parent address specifier.
63 #address-cells = <0>;
64
65 // Two cells to encode interrupt sources.
66 #interrupt-cells = <2>;
67
68 // Offset address of 0x40000 and size of 0x40000.
69 reg = <0x40000 0x40000>;
70
71 // Compatible with Open PIC.
72 compatible = "open-pic";
73
74 // The PIC shall not be reset.
75 pic-no-reset;
76 };
77
78Example 2:
79
80 /*
81 * An interrupt generating device that is wired to an Open PIC.
82 */
83 serial0: serial@4500 {
84 // Interrupt source '42' that is active high level-sensitive.
85 // Note that there are only two cells as specified in the interrupt
86 // parent's '#interrupt-cells' property.
87 interrupts = <42 2>;
88
89 // The interrupt controller that this device is wired to.
90 interrupt-parent = <&mpic>;
91 };
92
93* References
94
95[1] Power.org (TM) Standard for Embedded Power Architecture (TM) Platform
96 Requirements (ePAPR), Version 1.0, July 2008.
97 (http://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf)
98
diff --git a/Documentation/powerpc/dts-bindings/fsl/83xx-512x-pci.txt b/Documentation/devicetree/bindings/pci/83xx-512x-pci.txt
index 35a465362408..35a465362408 100644
--- a/Documentation/powerpc/dts-bindings/fsl/83xx-512x-pci.txt
+++ b/Documentation/devicetree/bindings/pci/83xx-512x-pci.txt
diff --git a/Documentation/devicetree/bindings/powerpc/4xx/cpm.txt b/Documentation/devicetree/bindings/powerpc/4xx/cpm.txt
new file mode 100644
index 000000000000..ee459806d35e
--- /dev/null
+++ b/Documentation/devicetree/bindings/powerpc/4xx/cpm.txt
@@ -0,0 +1,52 @@
1PPC4xx Clock Power Management (CPM) node
2
3Required properties:
4 - compatible : compatible list, currently only "ibm,cpm"
5 - dcr-access-method : "native"
6 - dcr-reg : < DCR register range >
7
8Optional properties:
9 - er-offset : All 4xx SoCs with a CPM controller have
10 one of two different order for the CPM
11 registers. Some have the CPM registers
12 in the following order (ER,FR,SR). The
13 others have them in the following order
14 (SR,ER,FR). For the second case set
15 er-offset = <1>.
16 - unused-units : specifier consist of one cell. For each
17 bit in the cell, the corresponding bit
18 in CPM will be set to turn off unused
19 devices.
20 - idle-doze : specifier consist of one cell. For each
21 bit in the cell, the corresponding bit
22 in CPM will be set to turn off unused
23 devices. This is usually just CPM[CPU].
24 - standby : specifier consist of one cell. For each
25 bit in the cell, the corresponding bit
26 in CPM will be set on standby and
27 restored on resume.
28 - suspend : specifier consist of one cell. For each
29 bit in the cell, the corresponding bit
30 in CPM will be set on suspend (mem) and
31 restored on resume. Note, for standby
32 and suspend the corresponding bits can
33 be different or the same. Usually for
34 standby only class 2 and 3 units are set.
35 However, the interface does not care.
36 If they are the same, the additional
37 power saving will be seeing if support
38 is available to put the DDR in self
39 refresh mode and any additional power
40 saving techniques for the specific SoC.
41
42Example:
43 CPM0: cpm {
44 compatible = "ibm,cpm";
45 dcr-access-method = "native";
46 dcr-reg = <0x160 0x003>;
47 er-offset = <0>;
48 unused-units = <0x00000100>;
49 idle-doze = <0x02000000>;
50 standby = <0xfeff0000>;
51 suspend = <0xfeff791d>;
52};
diff --git a/Documentation/powerpc/dts-bindings/4xx/emac.txt b/Documentation/devicetree/bindings/powerpc/4xx/emac.txt
index 2161334a7ca5..2161334a7ca5 100644
--- a/Documentation/powerpc/dts-bindings/4xx/emac.txt
+++ b/Documentation/devicetree/bindings/powerpc/4xx/emac.txt
diff --git a/Documentation/powerpc/dts-bindings/4xx/ndfc.txt b/Documentation/devicetree/bindings/powerpc/4xx/ndfc.txt
index 869f0b5f16e8..869f0b5f16e8 100644
--- a/Documentation/powerpc/dts-bindings/4xx/ndfc.txt
+++ b/Documentation/devicetree/bindings/powerpc/4xx/ndfc.txt
diff --git a/Documentation/powerpc/dts-bindings/4xx/ppc440spe-adma.txt b/Documentation/devicetree/bindings/powerpc/4xx/ppc440spe-adma.txt
index 515ebcf1b97d..515ebcf1b97d 100644
--- a/Documentation/powerpc/dts-bindings/4xx/ppc440spe-adma.txt
+++ b/Documentation/devicetree/bindings/powerpc/4xx/ppc440spe-adma.txt
diff --git a/Documentation/powerpc/dts-bindings/4xx/reboot.txt b/Documentation/devicetree/bindings/powerpc/4xx/reboot.txt
index d7217260589c..d7217260589c 100644
--- a/Documentation/powerpc/dts-bindings/4xx/reboot.txt
+++ b/Documentation/devicetree/bindings/powerpc/4xx/reboot.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/board.txt b/Documentation/devicetree/bindings/powerpc/fsl/board.txt
index 39e941515a36..39e941515a36 100644
--- a/Documentation/powerpc/dts-bindings/fsl/board.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/board.txt
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/cache_sram.txt b/Documentation/devicetree/bindings/powerpc/fsl/cache_sram.txt
new file mode 100644
index 000000000000..781955f5217d
--- /dev/null
+++ b/Documentation/devicetree/bindings/powerpc/fsl/cache_sram.txt
@@ -0,0 +1,20 @@
1* Freescale PQ3 and QorIQ based Cache SRAM
2
3Freescale's mpc85xx and some QorIQ platforms provide an
4option of configuring a part of (or full) cache memory
5as SRAM. This cache SRAM representation in the device
6tree should be done as under:-
7
8Required properties:
9
10- compatible : should be "fsl,p2020-cache-sram"
11- fsl,cache-sram-ctlr-handle : points to the L2 controller
12- reg : offset and length of the cache-sram.
13
14Example:
15
16cache-sram@fff00000 {
17 fsl,cache-sram-ctlr-handle = <&L2>;
18 reg = <0 0xfff00000 0 0x10000>;
19 compatible = "fsl,p2020-cache-sram";
20};
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm.txt
index 160c752484b4..160c752484b4 100644
--- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/brg.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/brg.txt
index 4c7d45eaf025..4c7d45eaf025 100644
--- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/brg.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/brg.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/i2c.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/i2c.txt
index 87bc6048667e..87bc6048667e 100644
--- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/i2c.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/i2c.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/pic.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/pic.txt
index 8e3ee1681618..8e3ee1681618 100644
--- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/pic.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/pic.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/usb.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/usb.txt
index 74bfda4bb824..74bfda4bb824 100644
--- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/usb.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/usb.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/gpio.txt
index 349f79fd7076..349f79fd7076 100644
--- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/gpio.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/network.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/network.txt
index 0e4269446580..0e4269446580 100644
--- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/network.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/network.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe.txt
index 4f8930263dd9..4f8930263dd9 100644
--- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/firmware.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/firmware.txt
index 249db3a15d15..249db3a15d15 100644
--- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/firmware.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/firmware.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/par_io.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/par_io.txt
index 60984260207b..60984260207b 100644
--- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/par_io.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/par_io.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/pincfg.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/pincfg.txt
index c5b43061db3a..c5b43061db3a 100644
--- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/pincfg.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/pincfg.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/ucc.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/ucc.txt
index e47734bee3f0..e47734bee3f0 100644
--- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/ucc.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/ucc.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/usb.txt
index 9ccd5f30405b..9ccd5f30405b 100644
--- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/usb.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/serial.txt
index 2ea76d9d137c..2ea76d9d137c 100644
--- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/serial.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/diu.txt b/Documentation/devicetree/bindings/powerpc/fsl/diu.txt
index b66cb6d31d69..b66cb6d31d69 100644
--- a/Documentation/powerpc/dts-bindings/fsl/diu.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/diu.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/dma.txt b/Documentation/devicetree/bindings/powerpc/fsl/dma.txt
index 2a4b4bce6110..2a4b4bce6110 100644
--- a/Documentation/powerpc/dts-bindings/fsl/dma.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/dma.txt
diff --git a/Documentation/powerpc/dts-bindings/ecm.txt b/Documentation/devicetree/bindings/powerpc/fsl/ecm.txt
index f514f29c67d6..f514f29c67d6 100644
--- a/Documentation/powerpc/dts-bindings/ecm.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/ecm.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/gtm.txt b/Documentation/devicetree/bindings/powerpc/fsl/gtm.txt
index 9a33efded4bc..9a33efded4bc 100644
--- a/Documentation/powerpc/dts-bindings/fsl/gtm.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/gtm.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/guts.txt b/Documentation/devicetree/bindings/powerpc/fsl/guts.txt
index 9e7a2417dac5..9e7a2417dac5 100644
--- a/Documentation/powerpc/dts-bindings/fsl/guts.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/guts.txt
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/ifc.txt b/Documentation/devicetree/bindings/powerpc/fsl/ifc.txt
new file mode 100644
index 000000000000..939a26d541f6
--- /dev/null
+++ b/Documentation/devicetree/bindings/powerpc/fsl/ifc.txt
@@ -0,0 +1,76 @@
1Integrated Flash Controller
2
3Properties:
4- name : Should be ifc
5- compatible : should contain "fsl,ifc". The version of the integrated
6 flash controller can be found in the IFC_REV register at
7 offset zero.
8
9- #address-cells : Should be either two or three. The first cell is the
10 chipselect number, and the remaining cells are the
11 offset into the chipselect.
12- #size-cells : Either one or two, depending on how large each chipselect
13 can be.
14- reg : Offset and length of the register set for the device
15- interrupts : IFC has two interrupts. The first one is the "common"
16 interrupt(CM_EVTER_STAT), and second is the NAND interrupt
17 (NAND_EVTER_STAT).
18
19- ranges : Each range corresponds to a single chipselect, and covers
20 the entire access window as configured.
21
22Child device nodes describe the devices connected to IFC such as NOR (e.g.
23cfi-flash) and NAND (fsl,ifc-nand). There might be board specific devices
24like FPGAs, CPLDs, etc.
25
26Example:
27
28 ifc@ffe1e000 {
29 compatible = "fsl,ifc", "simple-bus";
30 #address-cells = <2>;
31 #size-cells = <1>;
32 reg = <0x0 0xffe1e000 0 0x2000>;
33 interrupts = <16 2 19 2>;
34
35 /* NOR, NAND Flashes and CPLD on board */
36 ranges = <0x0 0x0 0x0 0xee000000 0x02000000
37 0x1 0x0 0x0 0xffa00000 0x00010000
38 0x3 0x0 0x0 0xffb00000 0x00020000>;
39
40 flash@0,0 {
41 #address-cells = <1>;
42 #size-cells = <1>;
43 compatible = "cfi-flash";
44 reg = <0x0 0x0 0x2000000>;
45 bank-width = <2>;
46 device-width = <1>;
47
48 partition@0 {
49 /* 32MB for user data */
50 reg = <0x0 0x02000000>;
51 label = "NOR Data";
52 };
53 };
54
55 flash@1,0 {
56 #address-cells = <1>;
57 #size-cells = <1>;
58 compatible = "fsl,ifc-nand";
59 reg = <0x1 0x0 0x10000>;
60
61 partition@0 {
62 /* This location must not be altered */
63 /* 1MB for u-boot Bootloader Image */
64 reg = <0x0 0x00100000>;
65 label = "NAND U-Boot Image";
66 read-only;
67 };
68 };
69
70 cpld@3,0 {
71 #address-cells = <1>;
72 #size-cells = <1>;
73 compatible = "fsl,p1010rdb-cpld";
74 reg = <0x3 0x0 0x000001f>;
75 };
76 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/lbc.txt b/Documentation/devicetree/bindings/powerpc/fsl/lbc.txt
index 3300fec501c5..3300fec501c5 100644
--- a/Documentation/powerpc/dts-bindings/fsl/lbc.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/lbc.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/mcm.txt b/Documentation/devicetree/bindings/powerpc/fsl/mcm.txt
index 4ceda9b3b413..4ceda9b3b413 100644
--- a/Documentation/powerpc/dts-bindings/fsl/mcm.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/mcm.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt b/Documentation/devicetree/bindings/powerpc/fsl/mcu-mpc8349emitx.txt
index 0f766333b6eb..0f766333b6eb 100644
--- a/Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/mcu-mpc8349emitx.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt b/Documentation/devicetree/bindings/powerpc/fsl/mpc5121-psc.txt
index 8832e8798912..8832e8798912 100644
--- a/Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/mpc5121-psc.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/mpc5200.txt b/Documentation/devicetree/bindings/powerpc/fsl/mpc5200.txt
index 4ccb2cd5df94..4ccb2cd5df94 100644
--- a/Documentation/powerpc/dts-bindings/fsl/mpc5200.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/mpc5200.txt
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/mpic-timer.txt b/Documentation/devicetree/bindings/powerpc/fsl/mpic-timer.txt
new file mode 100644
index 000000000000..df41958140e8
--- /dev/null
+++ b/Documentation/devicetree/bindings/powerpc/fsl/mpic-timer.txt
@@ -0,0 +1,38 @@
1* Freescale MPIC timers
2
3Required properties:
4- compatible: "fsl,mpic-global-timer"
5
6- reg : Contains two regions. The first is the main timer register bank
7 (GTCCRxx, GTBCRxx, GTVPRxx, GTDRxx). The second is the timer control
8 register (TCRx) for the group.
9
10- fsl,available-ranges: use <start count> style section to define which
11 timer interrupts can be used. This property is optional; without this,
12 all timers within the group can be used.
13
14- interrupts: one interrupt per timer in the group, in order, starting
15 with timer zero. If timer-available-ranges is present, only the
16 interrupts that correspond to available timers shall be present.
17
18Example:
19 /* Note that this requires #interrupt-cells to be 4 */
20 timer0: timer@41100 {
21 compatible = "fsl,mpic-global-timer";
22 reg = <0x41100 0x100 0x41300 4>;
23
24 /* Another AMP partition is using timers 0 and 1 */
25 fsl,available-ranges = <2 2>;
26
27 interrupts = <2 0 3 0
28 3 0 3 0>;
29 };
30
31 timer1: timer@42100 {
32 compatible = "fsl,mpic-global-timer";
33 reg = <0x42100 0x100 0x42300 4>;
34 interrupts = <4 0 3 0
35 5 0 3 0
36 6 0 3 0
37 7 0 3 0>;
38 };
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/mpic.txt b/Documentation/devicetree/bindings/powerpc/fsl/mpic.txt
new file mode 100644
index 000000000000..2cf38bd841fd
--- /dev/null
+++ b/Documentation/devicetree/bindings/powerpc/fsl/mpic.txt
@@ -0,0 +1,211 @@
1=====================================================================
2Freescale MPIC Interrupt Controller Node
3Copyright (C) 2010,2011 Freescale Semiconductor Inc.
4=====================================================================
5
6The Freescale MPIC interrupt controller is found on all PowerQUICC
7and QorIQ processors and is compatible with the Open PIC. The
8notable difference from Open PIC binding is the addition of 2
9additional cells in the interrupt specifier defining interrupt type
10information.
11
12PROPERTIES
13
14 - compatible
15 Usage: required
16 Value type: <string>
17 Definition: Shall include "fsl,mpic". Freescale MPIC
18 controllers compatible with this binding have Block
19 Revision Registers BRR1 and BRR2 at offset 0x0 and
20 0x10 in the MPIC.
21
22 - reg
23 Usage: required
24 Value type: <prop-encoded-array>
25 Definition: A standard property. Specifies the physical
26 offset and length of the device's registers within the
27 CCSR address space.
28
29 - interrupt-controller
30 Usage: required
31 Value type: <empty>
32 Definition: Specifies that this node is an interrupt
33 controller
34
35 - #interrupt-cells
36 Usage: required
37 Value type: <u32>
38 Definition: Shall be 2 or 4. A value of 2 means that interrupt
39 specifiers do not contain the interrupt-type or type-specific
40 information cells.
41
42 - #address-cells
43 Usage: required
44 Value type: <u32>
45 Definition: Shall be 0.
46
47 - pic-no-reset
48 Usage: optional
49 Value type: <empty>
50 Definition: The presence of this property specifies that the
51 MPIC must not be reset by the client program, and that
52 the boot program has initialized all interrupt source
53 configuration registers to a sane state-- masked or
54 directed at other cores. This ensures that the client
55 program will not receive interrupts for sources not belonging
56 to the client. The presence of this property also mandates
57 that any initialization related to interrupt sources shall
58 be limited to sources explicitly referenced in the device tree.
59
60INTERRUPT SPECIFIER DEFINITION
61
62 Interrupt specifiers consists of 4 cells encoded as
63 follows:
64
65 <1st-cell> interrupt-number
66
67 Identifies the interrupt source. The meaning
68 depends on the type of interrupt.
69
70 Note: If the interrupt-type cell is undefined
71 (i.e. #interrupt-cells = 2), this cell
72 should be interpreted the same as for
73 interrupt-type 0-- i.e. an external or
74 normal SoC device interrupt.
75
76 <2nd-cell> level-sense information, encoded as follows:
77 0 = low-to-high edge triggered
78 1 = active low level-sensitive
79 2 = active high level-sensitive
80 3 = high-to-low edge triggered
81
82 <3rd-cell> interrupt-type
83
84 The following types are supported:
85
86 0 = external or normal SoC device interrupt
87
88 The interrupt-number cell contains
89 the SoC device interrupt number. The
90 type-specific cell is undefined. The
91 interrupt-number is derived from the
92 MPIC a block of registers referred to as
93 the "Interrupt Source Configuration Registers".
94 Each source has 32-bytes of registers
95 (vector/priority and destination) in this
96 region. So interrupt 0 is at offset 0x0,
97 interrupt 1 is at offset 0x20, and so on.
98
99 1 = error interrupt
100
101 The interrupt-number cell contains
102 the SoC device interrupt number for
103 the error interrupt. The type-specific
104 cell identifies the specific error
105 interrupt number.
106
107 2 = MPIC inter-processor interrupt (IPI)
108
109 The interrupt-number cell identifies
110 the MPIC IPI number. The type-specific
111 cell is undefined.
112
113 3 = MPIC timer interrupt
114
115 The interrupt-number cell identifies
116 the MPIC timer number. The type-specific
117 cell is undefined.
118
119 <4th-cell> type-specific information
120
121 The type-specific cell is encoded as follows:
122
123 - For interrupt-type 1 (error interrupt),
124 the type-specific cell contains the
125 bit number of the error interrupt in the
126 Error Interrupt Summary Register.
127
128EXAMPLE 1
129 /*
130 * mpic interrupt controller with 4 cells per specifier
131 */
132 mpic: pic@40000 {
133 compatible = "fsl,mpic";
134 interrupt-controller;
135 #interrupt-cells = <4>;
136 #address-cells = <0>;
137 reg = <0x40000 0x40000>;
138 };
139
140EXAMPLE 2
141 /*
142 * The MPC8544 I2C controller node has an internal
143 * interrupt number of 27. As per the reference manual
144 * this corresponds to interrupt source configuration
145 * registers at 0x5_0560.
146 *
147 * The interrupt source configuration registers begin
148 * at 0x5_0000.
149 *
150 * To compute the interrupt specifier interrupt number
151 *
152 * 0x560 >> 5 = 43
153 *
154 * The interrupt source configuration registers begin
155 * at 0x5_0000, and so the i2c vector/priority registers
156 * are at 0x5_0560.
157 */
158 i2c@3000 {
159 #address-cells = <1>;
160 #size-cells = <0>;
161 cell-index = <0>;
162 compatible = "fsl-i2c";
163 reg = <0x3000 0x100>;
164 interrupts = <43 2>;
165 interrupt-parent = <&mpic>;
166 dfsrr;
167 };
168
169
170EXAMPLE 3
171 /*
172 * Definition of a node defining the 4
173 * MPIC IPI interrupts. Note the interrupt
174 * type of 2.
175 */
176 ipi@410a0 {
177 compatible = "fsl,mpic-ipi";
178 reg = <0x40040 0x10>;
179 interrupts = <0 0 2 0
180 1 0 2 0
181 2 0 2 0
182 3 0 2 0>;
183 };
184
185EXAMPLE 4
186 /*
187 * Definition of a node defining the MPIC
188 * global timers. Note the interrupt
189 * type of 3.
190 */
191 timer0: timer@41100 {
192 compatible = "fsl,mpic-global-timer";
193 reg = <0x41100 0x100 0x41300 4>;
194 interrupts = <0 0 3 0
195 1 0 3 0
196 2 0 3 0
197 3 0 3 0>;
198 };
199
200EXAMPLE 5
201 /*
202 * Definition of an error interrupt (interrupt type 1).
203 * SoC interrupt number is 16 and the specific error
204 * interrupt bit in the error interrupt summary register
205 * is 23.
206 */
207 memory-controller@8000 {
208 compatible = "fsl,p4080-memory-controller";
209 reg = <0x8000 0x1000>;
210 interrupts = <16 2 1 23>;
211 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/msi-pic.txt b/Documentation/devicetree/bindings/powerpc/fsl/msi-pic.txt
index bcc30bac6831..70558c3f3682 100644
--- a/Documentation/powerpc/dts-bindings/fsl/msi-pic.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/msi-pic.txt
@@ -5,14 +5,21 @@ Required properties:
5 first is "fsl,CHIP-msi", where CHIP is the processor(mpc8610, mpc8572, 5 first is "fsl,CHIP-msi", where CHIP is the processor(mpc8610, mpc8572,
6 etc.) and the second is "fsl,mpic-msi" or "fsl,ipic-msi" depending on 6 etc.) and the second is "fsl,mpic-msi" or "fsl,ipic-msi" depending on
7 the parent type. 7 the parent type.
8
8- reg : should contain the address and the length of the shared message 9- reg : should contain the address and the length of the shared message
9 interrupt register set. 10 interrupt register set.
11
10- msi-available-ranges: use <start count> style section to define which 12- msi-available-ranges: use <start count> style section to define which
11 msi interrupt can be used in the 256 msi interrupts. This property is 13 msi interrupt can be used in the 256 msi interrupts. This property is
12 optional, without this, all the 256 MSI interrupts can be used. 14 optional, without this, all the 256 MSI interrupts can be used.
15 Each available range must begin and end on a multiple of 32 (i.e.
16 no splitting an individual MSI register or the associated PIC interrupt).
17
13- interrupts : each one of the interrupts here is one entry per 32 MSIs, 18- interrupts : each one of the interrupts here is one entry per 32 MSIs,
14 and routed to the host interrupt controller. the interrupts should 19 and routed to the host interrupt controller. the interrupts should
15 be set as edge sensitive. 20 be set as edge sensitive. If msi-available-ranges is present, only
21 the interrupts that correspond to available ranges shall be present.
22
16- interrupt-parent: the phandle for the interrupt controller 23- interrupt-parent: the phandle for the interrupt controller
17 that services interrupts for this device. for 83xx cpu, the interrupts 24 that services interrupts for this device. for 83xx cpu, the interrupts
18 are routed to IPIC, and for 85xx/86xx cpu the interrupts are routed 25 are routed to IPIC, and for 85xx/86xx cpu the interrupts are routed
diff --git a/Documentation/powerpc/dts-bindings/fsl/pmc.txt b/Documentation/devicetree/bindings/powerpc/fsl/pmc.txt
index 07256b7ffcaa..07256b7ffcaa 100644
--- a/Documentation/powerpc/dts-bindings/fsl/pmc.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/pmc.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/sec.txt b/Documentation/devicetree/bindings/powerpc/fsl/sec.txt
index 2b6f2d45c45a..2b6f2d45c45a 100644
--- a/Documentation/powerpc/dts-bindings/fsl/sec.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/sec.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/ssi.txt b/Documentation/devicetree/bindings/powerpc/fsl/ssi.txt
index 5ff76c9c57d2..5ff76c9c57d2 100644
--- a/Documentation/powerpc/dts-bindings/fsl/ssi.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/ssi.txt
diff --git a/Documentation/powerpc/dts-bindings/nintendo/gamecube.txt b/Documentation/devicetree/bindings/powerpc/nintendo/gamecube.txt
index b558585b1aaf..b558585b1aaf 100644
--- a/Documentation/powerpc/dts-bindings/nintendo/gamecube.txt
+++ b/Documentation/devicetree/bindings/powerpc/nintendo/gamecube.txt
diff --git a/Documentation/powerpc/dts-bindings/nintendo/wii.txt b/Documentation/devicetree/bindings/powerpc/nintendo/wii.txt
index a7e155a023b8..36afa322b04b 100644
--- a/Documentation/powerpc/dts-bindings/nintendo/wii.txt
+++ b/Documentation/devicetree/bindings/powerpc/nintendo/wii.txt
@@ -127,7 +127,7 @@ Nintendo Wii device tree
127 - reg : should contain the SDHCI registers location and length 127 - reg : should contain the SDHCI registers location and length
128 - interrupts : should contain the SDHCI interrupt 128 - interrupts : should contain the SDHCI interrupt
129 129
1301.j) The Inter-Processsor Communication (IPC) node 1301.j) The Inter-Processor Communication (IPC) node
131 131
132 Represent the Inter-Processor Communication interface. This interface 132 Represent the Inter-Processor Communication interface. This interface
133 enables communications between the Broadway and the Starlet processors. 133 enables communications between the Broadway and the Starlet processors.
diff --git a/Documentation/devicetree/bindings/rtc/rtc-cmos.txt b/Documentation/devicetree/bindings/rtc/rtc-cmos.txt
new file mode 100644
index 000000000000..7382989b3052
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/rtc-cmos.txt
@@ -0,0 +1,28 @@
1 Motorola mc146818 compatible RTC
2~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3
4Required properties:
5 - compatible : "motorola,mc146818"
6 - reg : should contain registers location and length.
7
8Optional properties:
9 - interrupts : should contain interrupt.
10 - interrupt-parent : interrupt source phandle.
11 - ctrl-reg : Contains the initial value of the control register also
12 called "Register B".
13 - freq-reg : Contains the initial value of the frequency register also
14 called "Regsiter A".
15
16"Register A" and "B" are usually initialized by the firmware (BIOS for
17instance). If this is not done, it can be performed by the driver.
18
19ISA Example:
20
21 rtc@70 {
22 compatible = "motorola,mc146818";
23 interrupts = <8 3>;
24 interrupt-parent = <&ioapic1>;
25 ctrl-reg = <2>;
26 freq-reg = <0x26>;
27 reg = <1 0x70 2>;
28 };
diff --git a/Documentation/devicetree/bindings/serial/altera_jtaguart.txt b/Documentation/devicetree/bindings/serial/altera_jtaguart.txt
new file mode 100644
index 000000000000..c152f65f9a28
--- /dev/null
+++ b/Documentation/devicetree/bindings/serial/altera_jtaguart.txt
@@ -0,0 +1,4 @@
1Altera JTAG UART
2
3Required properties:
4- compatible : should be "ALTR,juart-1.0"
diff --git a/Documentation/devicetree/bindings/serial/altera_uart.txt b/Documentation/devicetree/bindings/serial/altera_uart.txt
new file mode 100644
index 000000000000..71cae3f70100
--- /dev/null
+++ b/Documentation/devicetree/bindings/serial/altera_uart.txt
@@ -0,0 +1,7 @@
1Altera UART
2
3Required properties:
4- compatible : should be "ALTR,uart-1.0"
5
6Optional properties:
7- clock-frequency : frequency of the clock input to the UART
diff --git a/Documentation/devicetree/bindings/serio/altera_ps2.txt b/Documentation/devicetree/bindings/serio/altera_ps2.txt
new file mode 100644
index 000000000000..4d9eecc2ef7d
--- /dev/null
+++ b/Documentation/devicetree/bindings/serio/altera_ps2.txt
@@ -0,0 +1,4 @@
1Altera UP PS/2 controller
2
3Required properties:
4- compatible : should be "ALTR,ps2-1.0".
diff --git a/Documentation/powerpc/dts-bindings/fsl/spi.txt b/Documentation/devicetree/bindings/spi/fsl-spi.txt
index 80510c018eea..777abd7399d5 100644
--- a/Documentation/powerpc/dts-bindings/fsl/spi.txt
+++ b/Documentation/devicetree/bindings/spi/fsl-spi.txt
@@ -1,7 +1,9 @@
1* SPI (Serial Peripheral Interface) 1* SPI (Serial Peripheral Interface)
2 2
3Required properties: 3Required properties:
4- cell-index : SPI controller index. 4- cell-index : QE SPI subblock index.
5 0: QE subblock SPI1
6 1: QE subblock SPI2
5- compatible : should be "fsl,spi". 7- compatible : should be "fsl,spi".
6- mode : the SPI operation mode, it can be "cpu" or "cpu-qe". 8- mode : the SPI operation mode, it can be "cpu" or "cpu-qe".
7- reg : Offset and length of the register set for the device 9- reg : Offset and length of the register set for the device
@@ -29,3 +31,23 @@ Example:
29 gpios = <&gpio 18 1 // device reg=<0> 31 gpios = <&gpio 18 1 // device reg=<0>
30 &gpio 19 1>; // device reg=<1> 32 &gpio 19 1>; // device reg=<1>
31 }; 33 };
34
35
36* eSPI (Enhanced Serial Peripheral Interface)
37
38Required properties:
39- compatible : should be "fsl,mpc8536-espi".
40- reg : Offset and length of the register set for the device.
41- interrupts : should contain eSPI interrupt, the device has one interrupt.
42- fsl,espi-num-chipselects : the number of the chipselect signals.
43
44Example:
45 spi@110000 {
46 #address-cells = <1>;
47 #size-cells = <0>;
48 compatible = "fsl,mpc8536-espi";
49 reg = <0x110000 0x1000>;
50 interrupts = <53 0x2>;
51 interrupt-parent = <&mpic>;
52 fsl,espi-num-chipselects = <4>;
53 };
diff --git a/Documentation/powerpc/dts-bindings/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt
index e782add2e457..e782add2e457 100644
--- a/Documentation/powerpc/dts-bindings/spi-bus.txt
+++ b/Documentation/devicetree/bindings/spi/spi-bus.txt
diff --git a/Documentation/devicetree/bindings/spi/spi_altera.txt b/Documentation/devicetree/bindings/spi/spi_altera.txt
new file mode 100644
index 000000000000..dda375943506
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi_altera.txt
@@ -0,0 +1,4 @@
1Altera SPI
2
3Required properties:
4- compatible : should be "ALTR,spi-1.0".
diff --git a/Documentation/devicetree/bindings/spi/spi_oc_tiny.txt b/Documentation/devicetree/bindings/spi/spi_oc_tiny.txt
new file mode 100644
index 000000000000..d95c0b367a04
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi_oc_tiny.txt
@@ -0,0 +1,12 @@
1OpenCores tiny SPI
2
3Required properties:
4- compatible : should be "opencores,tiny-spi-rtlsvn2".
5- gpios : should specify GPIOs used for chipselect.
6Optional properties:
7- clock-frequency : input clock frequency to the core.
8- baud-width: width, in bits, of the programmable divider used to scale
9 the input clock to SCLK.
10
11The clock-frequency and baud-width properties are needed only if the divider
12is programmable. They are not needed if the divider is fixed.
diff --git a/Documentation/powerpc/dts-bindings/fsl/usb.txt b/Documentation/devicetree/bindings/usb/fsl-usb.txt
index b00152402694..bd5723f0b67e 100644
--- a/Documentation/powerpc/dts-bindings/fsl/usb.txt
+++ b/Documentation/devicetree/bindings/usb/fsl-usb.txt
@@ -8,6 +8,7 @@ and additions :
8Required properties : 8Required properties :
9 - compatible : Should be "fsl-usb2-mph" for multi port host USB 9 - compatible : Should be "fsl-usb2-mph" for multi port host USB
10 controllers, or "fsl-usb2-dr" for dual role USB controllers 10 controllers, or "fsl-usb2-dr" for dual role USB controllers
11 or "fsl,mpc5121-usb2-dr" for dual role USB controllers of MPC5121
11 - phy_type : For multi port host USB controllers, should be one of 12 - phy_type : For multi port host USB controllers, should be one of
12 "ulpi", or "serial". For dual role USB controllers, should be 13 "ulpi", or "serial". For dual role USB controllers, should be
13 one of "ulpi", "utmi", "utmi_wide", or "serial". 14 one of "ulpi", "utmi", "utmi_wide", or "serial".
@@ -33,6 +34,12 @@ Recommended properties :
33 - interrupt-parent : the phandle for the interrupt controller that 34 - interrupt-parent : the phandle for the interrupt controller that
34 services interrupts for this device. 35 services interrupts for this device.
35 36
37Optional properties :
38 - fsl,invert-drvvbus : boolean; for MPC5121 USB0 only. Indicates the
39 port power polarity of internal PHY signal DRVVBUS is inverted.
40 - fsl,invert-pwr-fault : boolean; for MPC5121 USB0 only. Indicates
41 the PWR_FAULT signal polarity is inverted.
42
36Example multi port host USB controller device node : 43Example multi port host USB controller device node :
37 usb@22000 { 44 usb@22000 {
38 compatible = "fsl-usb2-mph"; 45 compatible = "fsl-usb2-mph";
@@ -57,3 +64,18 @@ Example dual role USB controller device node :
57 dr_mode = "otg"; 64 dr_mode = "otg";
58 phy = "ulpi"; 65 phy = "ulpi";
59 }; 66 };
67
68Example dual role USB controller device node for MPC5121ADS:
69
70 usb@4000 {
71 compatible = "fsl,mpc5121-usb2-dr";
72 reg = <0x4000 0x1000>;
73 #address-cells = <1>;
74 #size-cells = <0>;
75 interrupt-parent = < &ipic >;
76 interrupts = <44 0x8>;
77 dr_mode = "otg";
78 phy_type = "utmi_wide";
79 fsl,invert-drvvbus;
80 fsl,invert-pwr-fault;
81 };
diff --git a/Documentation/powerpc/dts-bindings/usb-ehci.txt b/Documentation/devicetree/bindings/usb/usb-ehci.txt
index fa18612f757b..fa18612f757b 100644
--- a/Documentation/powerpc/dts-bindings/usb-ehci.txt
+++ b/Documentation/devicetree/bindings/usb/usb-ehci.txt
diff --git a/Documentation/devicetree/bindings/x86/ce4100.txt b/Documentation/devicetree/bindings/x86/ce4100.txt
new file mode 100644
index 000000000000..b49ae593a60b
--- /dev/null
+++ b/Documentation/devicetree/bindings/x86/ce4100.txt
@@ -0,0 +1,38 @@
1CE4100 Device Tree Bindings
2---------------------------
3
4The CE4100 SoC uses for in core peripherals the following compatible
5format: <vendor>,<chip>-<device>.
6Many of the "generic" devices like HPET or IO APIC have the ce4100
7name in their compatible property because they first appeared in this
8SoC.
9
10The CPU node
11------------
12 cpu@0 {
13 device_type = "cpu";
14 compatible = "intel,ce4100";
15 reg = <0>;
16 lapic = <&lapic0>;
17 };
18
19The reg property describes the CPU number. The lapic property points to
20the local APIC timer.
21
22The SoC node
23------------
24
25This node describes the in-core peripherals. Required property:
26 compatible = "intel,ce4100-cp";
27
28The PCI node
29------------
30This node describes the PCI bus on the SoC. Its property should be
31 compatible = "intel,ce4100-pci", "pci";
32
33If the OS is using the IO-APIC for interrupt routing then the reported
34interrupt numbers for devices is no longer true. In order to obtain the
35correct interrupt number, the child node which represents the device has
36to contain the interrupt property. Besides the interrupt property it has
37to contain at least the reg property containing the PCI bus address and
38compatible property according to "PCI Bus Binding Revision 2.1".
diff --git a/Documentation/devicetree/bindings/x86/interrupt.txt b/Documentation/devicetree/bindings/x86/interrupt.txt
new file mode 100644
index 000000000000..7d19f494f19a
--- /dev/null
+++ b/Documentation/devicetree/bindings/x86/interrupt.txt
@@ -0,0 +1,26 @@
1Interrupt chips
2---------------
3
4* Intel I/O Advanced Programmable Interrupt Controller (IO APIC)
5
6 Required properties:
7 --------------------
8 compatible = "intel,ce4100-ioapic";
9 #interrupt-cells = <2>;
10
11 Device's interrupt property:
12
13 interrupts = <P S>;
14
15 The first number (P) represents the interrupt pin which is wired to the
16 IO APIC. The second number (S) represents the sense of interrupt which
17 should be configured and can be one of:
18 0 - Edge Rising
19 1 - Level Low
20 2 - Level High
21 3 - Edge Falling
22
23* Local APIC
24 Required property:
25
26 compatible = "intel,ce4100-lapic";
diff --git a/Documentation/devicetree/bindings/x86/timer.txt b/Documentation/devicetree/bindings/x86/timer.txt
new file mode 100644
index 000000000000..c688af58e3bd
--- /dev/null
+++ b/Documentation/devicetree/bindings/x86/timer.txt
@@ -0,0 +1,6 @@
1Timers
2------
3
4* High Precision Event Timer (HPET)
5 Required property:
6 compatible = "intel,ce4100-hpet";
diff --git a/Documentation/powerpc/dts-bindings/xilinx.txt b/Documentation/devicetree/bindings/xilinx.txt
index 299d0923537b..299d0923537b 100644
--- a/Documentation/powerpc/dts-bindings/xilinx.txt
+++ b/Documentation/devicetree/bindings/xilinx.txt
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/devicetree/booting-without-of.txt
index 302db5da49b3..7c1329de0596 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/devicetree/booting-without-of.txt
@@ -12,8 +12,9 @@ Table of Contents
12================= 12=================
13 13
14 I - Introduction 14 I - Introduction
15 1) Entry point for arch/powerpc 15 1) Entry point for arch/arm
16 2) Board support 16 2) Entry point for arch/powerpc
17 3) Entry point for arch/x86
17 18
18 II - The DT block format 19 II - The DT block format
19 1) Header 20 1) Header
@@ -41,13 +42,6 @@ Table of Contents
41 VI - System-on-a-chip devices and nodes 42 VI - System-on-a-chip devices and nodes
42 1) Defining child nodes of an SOC 43 1) Defining child nodes of an SOC
43 2) Representing devices without a current OF specification 44 2) Representing devices without a current OF specification
44 a) PHY nodes
45 b) Interrupt controllers
46 c) 4xx/Axon EMAC ethernet nodes
47 d) Xilinx IP cores
48 e) USB EHCI controllers
49 f) MDIO on GPIOs
50 g) SPI busses
51 45
52 VII - Specifying interrupt information for devices 46 VII - Specifying interrupt information for devices
53 1) interrupts property 47 1) interrupts property
@@ -123,7 +117,7 @@ Revision Information
123I - Introduction 117I - Introduction
124================ 118================
125 119
126During the recent development of the Linux/ppc64 kernel, and more 120During the development of the Linux/ppc64 kernel, and more
127specifically, the addition of new platform types outside of the old 121specifically, the addition of new platform types outside of the old
128IBM pSeries/iSeries pair, it was decided to enforce some strict rules 122IBM pSeries/iSeries pair, it was decided to enforce some strict rules
129regarding the kernel entry and bootloader <-> kernel interfaces, in 123regarding the kernel entry and bootloader <-> kernel interfaces, in
@@ -131,7 +125,7 @@ order to avoid the degeneration that had become the ppc32 kernel entry
131point and the way a new platform should be added to the kernel. The 125point and the way a new platform should be added to the kernel. The
132legacy iSeries platform breaks those rules as it predates this scheme, 126legacy iSeries platform breaks those rules as it predates this scheme,
133but no new board support will be accepted in the main tree that 127but no new board support will be accepted in the main tree that
134doesn't follows them properly. In addition, since the advent of the 128doesn't follow them properly. In addition, since the advent of the
135arch/powerpc merged architecture for ppc32 and ppc64, new 32-bit 129arch/powerpc merged architecture for ppc32 and ppc64, new 32-bit
136platforms and 32-bit platforms which move into arch/powerpc will be 130platforms and 32-bit platforms which move into arch/powerpc will be
137required to use these rules as well. 131required to use these rules as well.
@@ -145,8 +139,8 @@ and properties to be present. This will be described in detail in
145section III, but, for example, the kernel does not require you to 139section III, but, for example, the kernel does not require you to
146create a node for every PCI device in the system. It is a requirement 140create a node for every PCI device in the system. It is a requirement
147to have a node for PCI host bridges in order to provide interrupt 141to have a node for PCI host bridges in order to provide interrupt
148routing informations and memory/IO ranges, among others. It is also 142routing information and memory/IO ranges, among others. It is also
149recommended to define nodes for on chip devices and other busses that 143recommended to define nodes for on chip devices and other buses that
150don't specifically fit in an existing OF specification. This creates a 144don't specifically fit in an existing OF specification. This creates a
151great flexibility in the way the kernel can then probe those and match 145great flexibility in the way the kernel can then probe those and match
152drivers to device, without having to hard code all sorts of tables. It 146drivers to device, without having to hard code all sorts of tables. It
@@ -155,10 +149,49 @@ upgrades without significantly impacting the kernel code or cluttering
155it with special cases. 149it with special cases.
156 150
157 151
1581) Entry point for arch/powerpc 1521) Entry point for arch/arm
153---------------------------
154
155 There is one single entry point to the kernel, at the start
156 of the kernel image. That entry point supports two calling
157 conventions. A summary of the interface is described here. A full
158 description of the boot requirements is documented in
159 Documentation/arm/Booting
160
161 a) ATAGS interface. Minimal information is passed from firmware
162 to the kernel with a tagged list of predefined parameters.
163
164 r0 : 0
165
166 r1 : Machine type number
167
168 r2 : Physical address of tagged list in system RAM
169
170 b) Entry with a flattened device-tree block. Firmware loads the
171 physical address of the flattened device tree block (dtb) into r2,
172 r1 is not used, but it is considered good practise to use a valid
173 machine number as described in Documentation/arm/Booting.
174
175 r0 : 0
176
177 r1 : Valid machine type number. When using a device tree,
178 a single machine type number will often be assigned to
179 represent a class or family of SoCs.
180
181 r2 : physical pointer to the device-tree block
182 (defined in chapter II) in RAM. Device tree can be located
183 anywhere in system RAM, but it should be aligned on a 64 bit
184 boundary.
185
186 The kernel will differentiate between ATAGS and device tree booting by
187 reading the memory pointed to by r2 and looking for either the flattened
188 device tree block magic value (0xd00dfeed) or the ATAG_CORE value at
189 offset 0x4 from r2 (0x54410001).
190
1912) Entry point for arch/powerpc
159------------------------------- 192-------------------------------
160 193
161 There is one and one single entry point to the kernel, at the start 194 There is one single entry point to the kernel, at the start
162 of the kernel image. That entry point supports two calling 195 of the kernel image. That entry point supports two calling
163 conventions: 196 conventions:
164 197
@@ -210,12 +243,6 @@ it with special cases.
210 with all CPUs. The way to do that with method b) will be 243 with all CPUs. The way to do that with method b) will be
211 described in a later revision of this document. 244 described in a later revision of this document.
212 245
213
2142) Board support
215----------------
216
21764-bit kernels:
218
219 Board supports (platforms) are not exclusive config options. An 246 Board supports (platforms) are not exclusive config options. An
220 arbitrary set of board supports can be built in a single kernel 247 arbitrary set of board supports can be built in a single kernel
221 image. The kernel will "know" what set of functions to use for a 248 image. The kernel will "know" what set of functions to use for a
@@ -234,48 +261,30 @@ it with special cases.
234 containing the various callbacks that the generic code will 261 containing the various callbacks that the generic code will
235 use to get to your platform specific code 262 use to get to your platform specific code
236 263
237 c) Add a reference to your "ppc_md" structure in the 264 A kernel image may support multiple platforms, but only if the
238 "machines" table in arch/powerpc/kernel/setup_64.c if you are
239 a 64-bit platform.
240
241 d) request and get assigned a platform number (see PLATFORM_*
242 constants in arch/powerpc/include/asm/processor.h
243
24432-bit embedded kernels:
245
246 Currently, board support is essentially an exclusive config option.
247 The kernel is configured for a single platform. Part of the reason
248 for this is to keep kernels on embedded systems small and efficient;
249 part of this is due to the fact the code is already that way. In the
250 future, a kernel may support multiple platforms, but only if the
251 platforms feature the same core architecture. A single kernel build 265 platforms feature the same core architecture. A single kernel build
252 cannot support both configurations with Book E and configurations 266 cannot support both configurations with Book E and configurations
253 with classic Powerpc architectures. 267 with classic Powerpc architectures.
254 268
255 32-bit embedded platforms that are moved into arch/powerpc using a 2693) Entry point for arch/x86
256 flattened device tree should adopt the merged tree practice of 270-------------------------------
257 setting ppc_md up dynamically, even though the kernel is currently
258 built with support for only a single platform at a time. This allows
259 unification of the setup code, and will make it easier to go to a
260 multiple-platform-support model in the future.
261
262NOTE: I believe the above will be true once Ben's done with the merge
263of the boot sequences.... someone speak up if this is wrong!
264
265 To add a 32-bit embedded platform support, follow the instructions
266 for 64-bit platforms above, with the exception that the Kconfig
267 option should be set up such that the kernel builds exclusively for
268 the platform selected. The processor type for the platform should
269 enable another config option to select the specific board
270 supported.
271
272NOTE: If Ben doesn't merge the setup files, may need to change this to
273point to setup_32.c
274 271
272 There is one single 32bit entry point to the kernel at code32_start,
273 the decompressor (the real mode entry point goes to the same 32bit
274 entry point once it switched into protected mode). That entry point
275 supports one calling convention which is documented in
276 Documentation/x86/boot.txt
277 The physical pointer to the device-tree block (defined in chapter II)
278 is passed via setup_data which requires at least boot protocol 2.09.
279 The type filed is defined as
275 280
276 I will describe later the boot process and various callbacks that 281 #define SETUP_DTB 2
277 your platform should implement.
278 282
283 This device-tree is used as an extension to the "boot page". As such it
284 does not parse / consider data which is already covered by the boot
285 page. This includes memory size, reserved ranges, command line arguments
286 or initrd address. It simply holds information which can not be retrieved
287 otherwise like interrupt routing or a list of devices behind an I2C bus.
279 288
280II - The DT block format 289II - The DT block format
281======================== 290========================
@@ -300,8 +309,8 @@ the block to RAM before passing it to the kernel.
3001) Header 3091) Header
301--------- 310---------
302 311
303 The kernel is entered with r3 pointing to an area of memory that is 312 The kernel is passed the physical address pointing to an area of memory
304 roughly described in arch/powerpc/include/asm/prom.h by the structure 313 that is roughly described in include/linux/of_fdt.h by the structure
305 boot_param_header: 314 boot_param_header:
306 315
307struct boot_param_header { 316struct boot_param_header {
@@ -339,7 +348,7 @@ struct boot_param_header {
339 All values in this header are in big endian format, the various 348 All values in this header are in big endian format, the various
340 fields in this header are defined more precisely below. All 349 fields in this header are defined more precisely below. All
341 "offset" values are in bytes from the start of the header; that is 350 "offset" values are in bytes from the start of the header; that is
342 from the value of r3. 351 from the physical base address of the device tree block.
343 352
344 - magic 353 - magic
345 354
@@ -416,7 +425,7 @@ struct boot_param_header {
416 among others, by kexec. If you are on an SMP system, this value 425 among others, by kexec. If you are on an SMP system, this value
417 should match the content of the "reg" property of the CPU node in 426 should match the content of the "reg" property of the CPU node in
418 the device-tree corresponding to the CPU calling the kernel entry 427 the device-tree corresponding to the CPU calling the kernel entry
419 point (see further chapters for more informations on the required 428 point (see further chapters for more information on the required
420 device-tree contents) 429 device-tree contents)
421 430
422 - size_dt_strings 431 - size_dt_strings
@@ -437,7 +446,7 @@ struct boot_param_header {
437 446
438 447
439 ------------------------------ 448 ------------------------------
440 r3 -> | struct boot_param_header | 449 base -> | struct boot_param_header |
441 ------------------------------ 450 ------------------------------
442 | (alignment gap) (*) | 451 | (alignment gap) (*) |
443 ------------------------------ 452 ------------------------------
@@ -457,7 +466,7 @@ struct boot_param_header {
457 -----> ------------------------------ 466 -----> ------------------------------
458 | 467 |
459 | 468 |
460 --- (r3 + totalsize) 469 --- (base + totalsize)
461 470
462 (*) The alignment gaps are not necessarily present; their presence 471 (*) The alignment gaps are not necessarily present; their presence
463 and size are dependent on the various alignment requirements of 472 and size are dependent on the various alignment requirements of
@@ -500,7 +509,7 @@ the device-tree structure. It is typically used to represent "path" in
500the device-tree. More details about the actual format of these will be 509the device-tree. More details about the actual format of these will be
501below. 510below.
502 511
503The kernel powerpc generic code does not make any formal use of the 512The kernel generic code does not make any formal use of the
504unit address (though some board support code may do) so the only real 513unit address (though some board support code may do) so the only real
505requirement here for the unit address is to ensure uniqueness of 514requirement here for the unit address is to ensure uniqueness of
506the node unit name at a given level of the tree. Nodes with no notion 515the node unit name at a given level of the tree. Nodes with no notion
@@ -518,20 +527,21 @@ path to the root node is "/".
518 527
519Every node which actually represents an actual device (that is, a node 528Every node which actually represents an actual device (that is, a node
520which isn't only a virtual "container" for more nodes, like "/cpus" 529which isn't only a virtual "container" for more nodes, like "/cpus"
521is) is also required to have a "device_type" property indicating the 530is) is also required to have a "compatible" property indicating the
522type of node . 531specific hardware and an optional list of devices it is fully
532backwards compatible with.
523 533
524Finally, every node that can be referenced from a property in another 534Finally, every node that can be referenced from a property in another
525node is required to have a "linux,phandle" property. Real open 535node is required to have either a "phandle" or a "linux,phandle"
526firmware implementations provide a unique "phandle" value for every 536property. Real Open Firmware implementations provide a unique
527node that the "prom_init()" trampoline code turns into 537"phandle" value for every node that the "prom_init()" trampoline code
528"linux,phandle" properties. However, this is made optional if the 538turns into "linux,phandle" properties. However, this is made optional
529flattened device tree is used directly. An example of a node 539if the flattened device tree is used directly. An example of a node
530referencing another node via "phandle" is when laying out the 540referencing another node via "phandle" is when laying out the
531interrupt tree which will be described in a further version of this 541interrupt tree which will be described in a further version of this
532document. 542document.
533 543
534This "linux, phandle" property is a 32-bit value that uniquely 544The "phandle" property is a 32-bit value that uniquely
535identifies a node. You are free to use whatever values or system of 545identifies a node. You are free to use whatever values or system of
536values, internal pointers, or whatever to generate these, the only 546values, internal pointers, or whatever to generate these, the only
537requirement is that every node for which you provide that property has 547requirement is that every node for which you provide that property has
@@ -583,7 +593,7 @@ looks like in practice.
583 593
584This tree is almost a minimal tree. It pretty much contains the 594This tree is almost a minimal tree. It pretty much contains the
585minimal set of required nodes and properties to boot a linux kernel; 595minimal set of required nodes and properties to boot a linux kernel;
586that is, some basic model informations at the root, the CPUs, and the 596that is, some basic model information at the root, the CPUs, and the
587physical memory layout. It also includes misc information passed 597physical memory layout. It also includes misc information passed
588through /chosen, like in this example, the platform type (mandatory) 598through /chosen, like in this example, the platform type (mandatory)
589and the kernel command line arguments (optional). 599and the kernel command line arguments (optional).
@@ -694,7 +704,7 @@ made of 3 cells, the bottom two containing the actual address itself
694while the top cell contains address space indication, flags, and pci 704while the top cell contains address space indication, flags, and pci
695bus & device numbers. 705bus & device numbers.
696 706
697For busses that support dynamic allocation, it's the accepted practice 707For buses that support dynamic allocation, it's the accepted practice
698to then not provide the address in "reg" (keep it 0) though while 708to then not provide the address in "reg" (keep it 0) though while
699providing a flag indicating the address is dynamically allocated, and 709providing a flag indicating the address is dynamically allocated, and
700then, to provide a separate "assigned-addresses" property that 710then, to provide a separate "assigned-addresses" property that
@@ -711,7 +721,7 @@ prom_parse.c file of the recent kernels for your bus type.
711The "reg" property only defines addresses and sizes (if #size-cells is 721The "reg" property only defines addresses and sizes (if #size-cells is
712non-0) within a given bus. In order to translate addresses upward 722non-0) within a given bus. In order to translate addresses upward
713(that is into parent bus addresses, and possibly into CPU physical 723(that is into parent bus addresses, and possibly into CPU physical
714addresses), all busses must contain a "ranges" property. If the 724addresses), all buses must contain a "ranges" property. If the
715"ranges" property is missing at a given level, it's assumed that 725"ranges" property is missing at a given level, it's assumed that
716translation isn't possible, i.e., the registers are not visible on the 726translation isn't possible, i.e., the registers are not visible on the
717parent bus. The format of the "ranges" property for a bus is a list 727parent bus. The format of the "ranges" property for a bus is a list
@@ -727,9 +737,9 @@ example, for a PCI host controller, that would be a CPU address. For a
727PCI<->ISA bridge, that would be a PCI address. It defines the base 737PCI<->ISA bridge, that would be a PCI address. It defines the base
728address in the parent bus where the beginning of that range is mapped. 738address in the parent bus where the beginning of that range is mapped.
729 739
730For a new 64-bit powerpc board, I recommend either the 2/2 format or 740For new 64-bit board support, I recommend either the 2/2 format or
731Apple's 2/1 format which is slightly more compact since sizes usually 741Apple's 2/1 format which is slightly more compact since sizes usually
732fit in a single 32-bit word. New 32-bit powerpc boards should use a 742fit in a single 32-bit word. New 32-bit board support should use a
7331/1 format, unless the processor supports physical addresses greater 7431/1 format, unless the processor supports physical addresses greater
734than 32-bits, in which case a 2/1 format is recommended. 744than 32-bits, in which case a 2/1 format is recommended.
735 745
@@ -754,7 +764,7 @@ of their actual names.
754While earlier users of Open Firmware like OldWorld macintoshes tended 764While earlier users of Open Firmware like OldWorld macintoshes tended
755to use the actual device name for the "name" property, it's nowadays 765to use the actual device name for the "name" property, it's nowadays
756considered a good practice to use a name that is closer to the device 766considered a good practice to use a name that is closer to the device
757class (often equal to device_type). For example, nowadays, ethernet 767class (often equal to device_type). For example, nowadays, Ethernet
758controllers are named "ethernet", an additional "model" property 768controllers are named "ethernet", an additional "model" property
759defining precisely the chip type/model, and "compatible" property 769defining precisely the chip type/model, and "compatible" property
760defining the family in case a single driver can driver more than one 770defining the family in case a single driver can driver more than one
@@ -772,7 +782,7 @@ is present).
7724) Note about node and property names and character set 7824) Note about node and property names and character set
773------------------------------------------------------- 783-------------------------------------------------------
774 784
775While open firmware provides more flexible usage of 8859-1, this 785While Open Firmware provides more flexible usage of 8859-1, this
776specification enforces more strict rules. Nodes and properties should 786specification enforces more strict rules. Nodes and properties should
777be comprised only of ASCII characters 'a' to 'z', '0' to 787be comprised only of ASCII characters 'a' to 'z', '0' to
778'9', ',', '.', '_', '+', '#', '?', and '-'. Node names additionally 788'9', ',', '.', '_', '+', '#', '?', and '-'. Node names additionally
@@ -792,7 +802,7 @@ address which can extend beyond that limit.
792-------------------------------- 802--------------------------------
793 These are all that are currently required. However, it is strongly 803 These are all that are currently required. However, it is strongly
794 recommended that you expose PCI host bridges as documented in the 804 recommended that you expose PCI host bridges as documented in the
795 PCI binding to open firmware, and your interrupt tree as documented 805 PCI binding to Open Firmware, and your interrupt tree as documented
796 in OF interrupt tree specification. 806 in OF interrupt tree specification.
797 807
798 a) The root node 808 a) The root node
@@ -802,20 +812,12 @@ address which can extend beyond that limit.
802 - model : this is your board name/model 812 - model : this is your board name/model
803 - #address-cells : address representation for "root" devices 813 - #address-cells : address representation for "root" devices
804 - #size-cells: the size representation for "root" devices 814 - #size-cells: the size representation for "root" devices
805 - device_type : This property shouldn't be necessary. However, if
806 you decide to create a device_type for your root node, make sure it
807 is _not_ "chrp" unless your platform is a pSeries or PAPR compliant
808 one for 64-bit, or a CHRP-type machine for 32-bit as this will
809 matched by the kernel this way.
810
811 Additionally, some recommended properties are:
812
813 - compatible : the board "family" generally finds its way here, 815 - compatible : the board "family" generally finds its way here,
814 for example, if you have 2 board models with a similar layout, 816 for example, if you have 2 board models with a similar layout,
815 that typically get driven by the same platform code in the 817 that typically get driven by the same platform code in the
816 kernel, you would use a different "model" property but put a 818 kernel, you would specify the exact board model in the
817 value in "compatible". The kernel doesn't directly use that 819 compatible property followed by an entry that represents the SoC
818 value but it is generally useful. 820 model.
819 821
820 The root node is also generally where you add additional properties 822 The root node is also generally where you add additional properties
821 specific to your board like the serial number if any, that sort of 823 specific to your board like the serial number if any, that sort of
@@ -841,8 +843,11 @@ address which can extend beyond that limit.
841 843
842 So under /cpus, you are supposed to create a node for every CPU on 844 So under /cpus, you are supposed to create a node for every CPU on
843 the machine. There is no specific restriction on the name of the 845 the machine. There is no specific restriction on the name of the
844 CPU, though It's common practice to call it PowerPC,<name>. For 846 CPU, though it's common to call it <architecture>,<core>. For
845 example, Apple uses PowerPC,G5 while IBM uses PowerPC,970FX. 847 example, Apple uses PowerPC,G5 while IBM uses PowerPC,970FX.
848 However, the Generic Names convention suggests that it would be
849 better to simply use 'cpu' for each cpu node and use the compatible
850 property to identify the specific cpu core.
846 851
847 Required properties: 852 Required properties:
848 853
@@ -923,7 +928,7 @@ compatibility.
923 928
924 e) The /chosen node 929 e) The /chosen node
925 930
926 This node is a bit "special". Normally, that's where open firmware 931 This node is a bit "special". Normally, that's where Open Firmware
927 puts some variable environment information, like the arguments, or 932 puts some variable environment information, like the arguments, or
928 the default input/output devices. 933 the default input/output devices.
929 934
@@ -940,11 +945,7 @@ compatibility.
940 console device if any. Typically, if you have serial devices on 945 console device if any. Typically, if you have serial devices on
941 your board, you may want to put the full path to the one set as 946 your board, you may want to put the full path to the one set as
942 the default console in the firmware here, for the kernel to pick 947 the default console in the firmware here, for the kernel to pick
943 it up as its own default console. If you look at the function 948 it up as its own default console.
944 set_preferred_console() in arch/ppc64/kernel/setup.c, you'll see
945 that the kernel tries to find out the default console and has
946 knowledge of various types like 8250 serial ports. You may want
947 to extend this function to add your own.
948 949
949 Note that u-boot creates and fills in the chosen node for platforms 950 Note that u-boot creates and fills in the chosen node for platforms
950 that use it. 951 that use it.
@@ -955,23 +956,23 @@ compatibility.
955 956
956 f) the /soc<SOCname> node 957 f) the /soc<SOCname> node
957 958
958 This node is used to represent a system-on-a-chip (SOC) and must be 959 This node is used to represent a system-on-a-chip (SoC) and must be
959 present if the processor is a SOC. The top-level soc node contains 960 present if the processor is a SoC. The top-level soc node contains
960 information that is global to all devices on the SOC. The node name 961 information that is global to all devices on the SoC. The node name
961 should contain a unit address for the SOC, which is the base address 962 should contain a unit address for the SoC, which is the base address
962 of the memory-mapped register set for the SOC. The name of an soc 963 of the memory-mapped register set for the SoC. The name of an SoC
963 node should start with "soc", and the remainder of the name should 964 node should start with "soc", and the remainder of the name should
964 represent the part number for the soc. For example, the MPC8540's 965 represent the part number for the soc. For example, the MPC8540's
965 soc node would be called "soc8540". 966 soc node would be called "soc8540".
966 967
967 Required properties: 968 Required properties:
968 969
969 - device_type : Should be "soc"
970 - ranges : Should be defined as specified in 1) to describe the 970 - ranges : Should be defined as specified in 1) to describe the
971 translation of SOC addresses for memory mapped SOC registers. 971 translation of SoC addresses for memory mapped SoC registers.
972 - bus-frequency: Contains the bus frequency for the SOC node. 972 - bus-frequency: Contains the bus frequency for the SoC node.
973 Typically, the value of this field is filled in by the boot 973 Typically, the value of this field is filled in by the boot
974 loader. 974 loader.
975 - compatible : Exact model of the SoC
975 976
976 977
977 Recommended properties: 978 Recommended properties:
@@ -1025,7 +1026,7 @@ dtc source code can be found at
1025 1026
1026WARNING: This version is still in early development stage; the 1027WARNING: This version is still in early development stage; the
1027resulting device-tree "blobs" have not yet been validated with the 1028resulting device-tree "blobs" have not yet been validated with the
1028kernel. The current generated bloc lacks a useful reserve map (it will 1029kernel. The current generated block lacks a useful reserve map (it will
1029be fixed to generate an empty one, it's up to the bootloader to fill 1030be fixed to generate an empty one, it's up to the bootloader to fill
1030it up) among others. The error handling needs work, bugs are lurking, 1031it up) among others. The error handling needs work, bugs are lurking,
1031etc... 1032etc...
@@ -1098,7 +1099,7 @@ supported currently at the toplevel.
1098 * an arbitrary array of bytes 1099 * an arbitrary array of bytes
1099 */ 1100 */
1100 1101
1101 childnode@addresss { /* define a child node named "childnode" 1102 childnode@address { /* define a child node named "childnode"
1102 * whose unit name is "childnode at 1103 * whose unit name is "childnode at
1103 * address" 1104 * address"
1104 */ 1105 */
@@ -1155,12 +1156,13 @@ while all this has been defined and implemented.
1155 1156
1156 - An example of code for iterating nodes & retrieving properties 1157 - An example of code for iterating nodes & retrieving properties
1157 directly from the flattened tree format can be found in the kernel 1158 directly from the flattened tree format can be found in the kernel
1158 file arch/ppc64/kernel/prom.c, look at scan_flat_dt() function, 1159 file drivers/of/fdt.c. Look at the of_scan_flat_dt() function,
1159 its usage in early_init_devtree(), and the corresponding various 1160 its usage in early_init_devtree(), and the corresponding various
1160 early_init_dt_scan_*() callbacks. That code can be re-used in a 1161 early_init_dt_scan_*() callbacks. That code can be re-used in a
1161 GPL bootloader, and as the author of that code, I would be happy 1162 GPL bootloader, and as the author of that code, I would be happy
1162 to discuss possible free licensing to any vendor who wishes to 1163 to discuss possible free licensing to any vendor who wishes to
1163 integrate all or part of this code into a non-GPL bootloader. 1164 integrate all or part of this code into a non-GPL bootloader.
1165 (reference needed; who is 'I' here? ---gcl Jan 31, 2011)
1164 1166
1165 1167
1166 1168
@@ -1203,18 +1205,19 @@ MPC8540.
12032) Representing devices without a current OF specification 12052) Representing devices without a current OF specification
1204---------------------------------------------------------- 1206----------------------------------------------------------
1205 1207
1206Currently, there are many devices on SOCs that do not have a standard 1208Currently, there are many devices on SoCs that do not have a standard
1207representation pre-defined as part of the open firmware 1209representation defined as part of the Open Firmware specifications,
1208specifications, mainly because the boards that contain these SOCs are 1210mainly because the boards that contain these SoCs are not currently
1209not currently booted using open firmware. This section contains 1211booted using Open Firmware. Binding documentation for new devices
1210descriptions for the SOC devices for which new nodes have been 1212should be added to the Documentation/devicetree/bindings directory.
1211defined; this list will expand as more and more SOC-containing 1213That directory will expand as device tree support is added to more and
1212platforms are moved over to use the flattened-device-tree model. 1214more SoCs.
1215
1213 1216
1214VII - Specifying interrupt information for devices 1217VII - Specifying interrupt information for devices
1215=================================================== 1218===================================================
1216 1219
1217The device tree represents the busses and devices of a hardware 1220The device tree represents the buses and devices of a hardware
1218system in a form similar to the physical bus topology of the 1221system in a form similar to the physical bus topology of the
1219hardware. 1222hardware.
1220 1223
diff --git a/Documentation/dmaengine.txt b/Documentation/dmaengine.txt
index 0c1c2f63c0a9..5a0cb1ef6164 100644
--- a/Documentation/dmaengine.txt
+++ b/Documentation/dmaengine.txt
@@ -1 +1,96 @@
1See Documentation/crypto/async-tx-api.txt 1 DMA Engine API Guide
2 ====================
3
4 Vinod Koul <vinod dot koul at intel.com>
5
6NOTE: For DMA Engine usage in async_tx please see:
7 Documentation/crypto/async-tx-api.txt
8
9
10Below is a guide to device driver writers on how to use the Slave-DMA API of the
11DMA Engine. This is applicable only for slave DMA usage only.
12
13The slave DMA usage consists of following steps
141. Allocate a DMA slave channel
152. Set slave and controller specific parameters
163. Get a descriptor for transaction
174. Submit the transaction and wait for callback notification
18
191. Allocate a DMA slave channel
20Channel allocation is slightly different in the slave DMA context, client
21drivers typically need a channel from a particular DMA controller only and even
22in some cases a specific channel is desired. To request a channel
23dma_request_channel() API is used.
24
25Interface:
26struct dma_chan *dma_request_channel(dma_cap_mask_t mask,
27 dma_filter_fn filter_fn,
28 void *filter_param);
29where dma_filter_fn is defined as:
30typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param);
31
32When the optional 'filter_fn' parameter is set to NULL dma_request_channel
33simply returns the first channel that satisfies the capability mask. Otherwise,
34when the mask parameter is insufficient for specifying the necessary channel,
35the filter_fn routine can be used to disposition the available channels in the
36system. The filter_fn routine is called once for each free channel in the
37system. Upon seeing a suitable channel filter_fn returns DMA_ACK which flags
38that channel to be the return value from dma_request_channel. A channel
39allocated via this interface is exclusive to the caller, until
40dma_release_channel() is called.
41
422. Set slave and controller specific parameters
43Next step is always to pass some specific information to the DMA driver. Most of
44the generic information which a slave DMA can use is in struct dma_slave_config.
45It allows the clients to specify DMA direction, DMA addresses, bus widths, DMA
46burst lengths etc. If some DMA controllers have more parameters to be sent then
47they should try to embed struct dma_slave_config in their controller specific
48structure. That gives flexibility to client to pass more parameters, if
49required.
50
51Interface:
52int dmaengine_slave_config(struct dma_chan *chan,
53 struct dma_slave_config *config)
54
553. Get a descriptor for transaction
56For slave usage the various modes of slave transfers supported by the
57DMA-engine are:
58slave_sg - DMA a list of scatter gather buffers from/to a peripheral
59dma_cyclic - Perform a cyclic DMA operation from/to a peripheral till the
60 operation is explicitly stopped.
61The non NULL return of this transfer API represents a "descriptor" for the given
62transaction.
63
64Interface:
65struct dma_async_tx_descriptor *(*chan->device->device_prep_dma_sg)(
66 struct dma_chan *chan,
67 struct scatterlist *dst_sg, unsigned int dst_nents,
68 struct scatterlist *src_sg, unsigned int src_nents,
69 unsigned long flags);
70struct dma_async_tx_descriptor *(*chan->device->device_prep_dma_cyclic)(
71 struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
72 size_t period_len, enum dma_data_direction direction);
73
744. Submit the transaction and wait for callback notification
75To schedule the transaction to be scheduled by dma device, the "descriptor"
76returned in above (3) needs to be submitted.
77To tell the dma driver that a transaction is ready to be serviced, the
78descriptor->submit() callback needs to be invoked. This chains the descriptor to
79the pending queue.
80The transactions in the pending queue can be activated by calling the
81issue_pending API. If channel is idle then the first transaction in queue is
82started and subsequent ones queued up.
83On completion of the DMA operation the next in queue is submitted and a tasklet
84triggered. The tasklet would then call the client driver completion callback
85routine for notification, if set.
86Interface:
87void dma_async_issue_pending(struct dma_chan *chan);
88
89==============================================================================
90
91Additional usage notes for dma driver writers
921/ Although DMA engine specifies that completion callback routines cannot submit
93any new operations, but typically for slave DMA subsequent transaction may not
94be available for submit prior to callback routine being called. This requirement
95is not a requirement for DMA-slave devices. But they should take care to drop
96the spin-lock they might be holding before calling the callback routine
diff --git a/Documentation/dontdiff b/Documentation/dontdiff
index d9bcffd59433..dfa6fc6e4b28 100644
--- a/Documentation/dontdiff
+++ b/Documentation/dontdiff
@@ -1,6 +1,8 @@
1*.a 1*.a
2*.aux 2*.aux
3*.bin 3*.bin
4*.bz2
5*.cis
4*.cpio 6*.cpio
5*.csp 7*.csp
6*.dsp 8*.dsp
@@ -8,6 +10,8 @@
8*.elf 10*.elf
9*.eps 11*.eps
10*.fw 12*.fw
13*.gcno
14*.gcov
11*.gen.S 15*.gen.S
12*.gif 16*.gif
13*.grep 17*.grep
@@ -19,14 +23,20 @@
19*.ko 23*.ko
20*.log 24*.log
21*.lst 25*.lst
26*.lzma
27*.lzo
28*.mo
22*.moc 29*.moc
23*.mod.c 30*.mod.c
24*.o 31*.o
25*.o.* 32*.o.*
33*.order
26*.orig 34*.orig
27*.out 35*.out
36*.patch
28*.pdf 37*.pdf
29*.png 38*.png
39*.pot
30*.ps 40*.ps
31*.rej 41*.rej
32*.s 42*.s
@@ -39,16 +49,22 @@
39*.tex 49*.tex
40*.ver 50*.ver
41*.xml 51*.xml
52*.xz
42*_MODULES 53*_MODULES
43*_vga16.c 54*_vga16.c
44*~ 55*~
56\#*#
45*.9 57*.9
46*.9.gz
47.* 58.*
59.*.d
48.mm 60.mm
4953c700_d.h 6153c700_d.h
50CVS 62CVS
51ChangeSet 63ChangeSet
64GPATH
65GRTAGS
66GSYMS
67GTAGS
52Image 68Image
53Kerntypes 69Kerntypes
54Module.markers 70Module.markers
@@ -57,11 +73,14 @@ PENDING
57SCCS 73SCCS
58System.map* 74System.map*
59TAGS 75TAGS
76aconf
77af_names.h
60aic7*reg.h* 78aic7*reg.h*
61aic7*reg_print.c* 79aic7*reg_print.c*
62aic7*seq.h* 80aic7*seq.h*
63aicasm 81aicasm
64aicdb.h* 82aicdb.h*
83altivec*.c
65asm-offsets.h 84asm-offsets.h
66asm_offsets.h 85asm_offsets.h
67autoconf.h* 86autoconf.h*
@@ -76,6 +95,8 @@ btfixupprep
76build 95build
77bvmlinux 96bvmlinux
78bzImage* 97bzImage*
98capability_names.h
99capflags.c
79classlist.h* 100classlist.h*
80comp*.log 101comp*.log
81compile.h* 102compile.h*
@@ -83,7 +104,8 @@ conf
83config 104config
84config-* 105config-*
85config_data.h* 106config_data.h*
86config_data.gz* 107config.mak
108config.mak.autogen
87conmakehash 109conmakehash
88consolemap_deftbl.c* 110consolemap_deftbl.c*
89cpustr.h 111cpustr.h
@@ -91,14 +113,18 @@ crc32table.h*
91cscope.* 113cscope.*
92defkeymap.c 114defkeymap.c
93devlist.h* 115devlist.h*
116dnotify_test
94docproc 117docproc
118dslm
95elf2ecoff 119elf2ecoff
96elfconfig.h* 120elfconfig.h*
121evergreen_reg_safe.h
97fixdep 122fixdep
98flask.h 123flask.h
99fore200e_mkfirm 124fore200e_mkfirm
100fore200e_pca_fw.c* 125fore200e_pca_fw.c*
101gconf 126gconf
127gconf.glade.h
102gen-devlist 128gen-devlist
103gen_crc32table 129gen_crc32table
104gen_init_cpio 130gen_init_cpio
@@ -106,11 +132,19 @@ generated
106genheaders 132genheaders
107genksyms 133genksyms
108*_gray256.c 134*_gray256.c
135hpet_example
136hugepage-mmap
137hugepage-shm
109ihex2fw 138ihex2fw
110ikconfig.h* 139ikconfig.h*
111initramfs_data.cpio 140inat-tables.c
112initramfs_data.cpio.gz
113initramfs_list 141initramfs_list
142int16.c
143int1.c
144int2.c
145int32.c
146int4.c
147int8.c
114kallsyms 148kallsyms
115kconfig 149kconfig
116keywords.c 150keywords.c
@@ -120,15 +154,19 @@ kxgettext
120lkc_defs.h 154lkc_defs.h
121lex.c 155lex.c
122lex.*.c 156lex.*.c
157linux
123logo_*.c 158logo_*.c
124logo_*_clut224.c 159logo_*_clut224.c
125logo_*_mono.c 160logo_*_mono.c
126lxdialog 161lxdialog
162mach
127mach-types 163mach-types
128mach-types.h 164mach-types.h
129machtypes.h 165machtypes.h
130map 166map
167map_hugetlb
131maui_boot.h 168maui_boot.h
169media
132mconf 170mconf
133miboot* 171miboot*
134mk_elfconfig 172mk_elfconfig
@@ -137,30 +175,45 @@ mkbugboot
137mkcpustr 175mkcpustr
138mkdep 176mkdep
139mkprep 177mkprep
178mkregtable
140mktables 179mktables
141mktree 180mktree
142modpost 181modpost
182modules.builtin
143modules.order 183modules.order
144modversions.h* 184modversions.h*
185nconf
145ncscope.* 186ncscope.*
146offset.h 187offset.h
147offsets.h 188offsets.h
148oui.c* 189oui.c*
190page-types
149parse.c 191parse.c
150parse.h 192parse.h
151patches* 193patches*
152pca200e.bin 194pca200e.bin
153pca200e_ecd.bin2 195pca200e_ecd.bin2
154piggy.gz 196perf.data
197perf.data.old
198perf-archive
155piggyback 199piggyback
200piggy.gzip
201piggy.S
156pnmtologo 202pnmtologo
157ppc_defs.h* 203ppc_defs.h*
158pss_boot.h 204pss_boot.h
159qconf 205qconf
160raid6altivec*.c 206r100_reg_safe.h
161raid6int*.c 207r200_reg_safe.h
162raid6tables.c 208r300_reg_safe.h
209r420_reg_safe.h
210r600_reg_safe.h
211recordmcount
163relocs 212relocs
213rlim_names.h
214rn50_reg_safe.h
215rs600_reg_safe.h
216rv515_reg_safe.h
164series 217series
165setup 218setup
166setup.bin 219setup.bin
@@ -169,7 +222,9 @@ sImage
169sm_tbl* 222sm_tbl*
170split-include 223split-include
171syscalltab.h 224syscalltab.h
225tables.c
172tags 226tags
227test_get_len
173tftpboot.img 228tftpboot.img
174timeconst.h 229timeconst.h
175times.h* 230times.h*
@@ -186,10 +241,14 @@ vdso32.so.dbg
186vdso64.lds 241vdso64.lds
187vdso64.so.dbg 242vdso64.so.dbg
188version.h* 243version.h*
244vmImage
189vmlinux 245vmlinux
190vmlinux-* 246vmlinux-*
191vmlinux.aout 247vmlinux.aout
248vmlinux.bin.all
192vmlinux.lds 249vmlinux.lds
250vmlinuz
251voffset.h
193vsyscall.lds 252vsyscall.lds
194vsyscall_32.lds 253vsyscall_32.lds
195wanxlfw.inc 254wanxlfw.inc
@@ -200,3 +259,4 @@ wakeup.elf
200wakeup.lds 259wakeup.lds
201zImage* 260zImage*
202zconf.hash.c 261zconf.hash.c
262zoffset.h
diff --git a/Documentation/driver-model/bus.txt b/Documentation/driver-model/bus.txt
index 5001b7511626..6754b2df8aa1 100644
--- a/Documentation/driver-model/bus.txt
+++ b/Documentation/driver-model/bus.txt
@@ -3,24 +3,7 @@ Bus Types
3 3
4Definition 4Definition
5~~~~~~~~~~ 5~~~~~~~~~~
6 6See the kerneldoc for the struct bus_type.
7struct bus_type {
8 char * name;
9
10 struct subsystem subsys;
11 struct kset drivers;
12 struct kset devices;
13
14 struct bus_attribute * bus_attrs;
15 struct device_attribute * dev_attrs;
16 struct driver_attribute * drv_attrs;
17
18 int (*match)(struct device * dev, struct device_driver * drv);
19 int (*hotplug) (struct device *dev, char **envp,
20 int num_envp, char *buffer, int buffer_size);
21 int (*suspend)(struct device * dev, pm_message_t state);
22 int (*resume)(struct device * dev);
23};
24 7
25int bus_register(struct bus_type * bus); 8int bus_register(struct bus_type * bus);
26 9
diff --git a/Documentation/driver-model/class.txt b/Documentation/driver-model/class.txt
index 548505f14aa4..1fefc480a80b 100644
--- a/Documentation/driver-model/class.txt
+++ b/Documentation/driver-model/class.txt
@@ -27,22 +27,7 @@ The device class structure looks like:
27typedef int (*devclass_add)(struct device *); 27typedef int (*devclass_add)(struct device *);
28typedef void (*devclass_remove)(struct device *); 28typedef void (*devclass_remove)(struct device *);
29 29
30struct device_class { 30See the kerneldoc for the struct class.
31 char * name;
32 rwlock_t lock;
33 u32 devnum;
34 struct list_head node;
35
36 struct list_head drivers;
37 struct list_head intf_list;
38
39 struct driver_dir_entry dir;
40 struct driver_dir_entry device_dir;
41 struct driver_dir_entry driver_dir;
42
43 devclass_add add_device;
44 devclass_remove remove_device;
45};
46 31
47A typical device class definition would look like: 32A typical device class definition would look like:
48 33
diff --git a/Documentation/driver-model/device.txt b/Documentation/driver-model/device.txt
index a124f3126b0d..b2ff42685bcb 100644
--- a/Documentation/driver-model/device.txt
+++ b/Documentation/driver-model/device.txt
@@ -2,96 +2,7 @@
2The Basic Device Structure 2The Basic Device Structure
3~~~~~~~~~~~~~~~~~~~~~~~~~~ 3~~~~~~~~~~~~~~~~~~~~~~~~~~
4 4
5struct device { 5See the kerneldoc for the struct device.
6 struct list_head g_list;
7 struct list_head node;
8 struct list_head bus_list;
9 struct list_head driver_list;
10 struct list_head intf_list;
11 struct list_head children;
12 struct device * parent;
13
14 char name[DEVICE_NAME_SIZE];
15 char bus_id[BUS_ID_SIZE];
16
17 spinlock_t lock;
18 atomic_t refcount;
19
20 struct bus_type * bus;
21 struct driver_dir_entry dir;
22
23 u32 class_num;
24
25 struct device_driver *driver;
26 void *driver_data;
27 void *platform_data;
28
29 u32 current_state;
30 unsigned char *saved_state;
31
32 void (*release)(struct device * dev);
33};
34
35Fields
36~~~~~~
37g_list: Node in the global device list.
38
39node: Node in device's parent's children list.
40
41bus_list: Node in device's bus's devices list.
42
43driver_list: Node in device's driver's devices list.
44
45intf_list: List of intf_data. There is one structure allocated for
46 each interface that the device supports.
47
48children: List of child devices.
49
50parent: *** FIXME ***
51
52name: ASCII description of device.
53 Example: " 3Com Corporation 3c905 100BaseTX [Boomerang]"
54
55bus_id: ASCII representation of device's bus position. This
56 field should be a name unique across all devices on the
57 bus type the device belongs to.
58
59 Example: PCI bus_ids are in the form of
60 <bus number>:<slot number>.<function number>
61 This name is unique across all PCI devices in the system.
62
63lock: Spinlock for the device.
64
65refcount: Reference count on the device.
66
67bus: Pointer to struct bus_type that device belongs to.
68
69dir: Device's sysfs directory.
70
71class_num: Class-enumerated value of the device.
72
73driver: Pointer to struct device_driver that controls the device.
74
75driver_data: Driver-specific data.
76
77platform_data: Platform data specific to the device.
78
79 Example: for devices on custom boards, as typical of embedded
80 and SOC based hardware, Linux often uses platform_data to point
81 to board-specific structures describing devices and how they
82 are wired. That can include what ports are available, chip
83 variants, which GPIO pins act in what additional roles, and so
84 on. This shrinks the "Board Support Packages" (BSPs) and
85 minimizes board-specific #ifdefs in drivers.
86
87current_state: Current power state of the device.
88
89saved_state: Pointer to saved state of the device. This is usable by
90 the device driver controlling the device.
91
92release: Callback to free the device after all references have
93 gone away. This should be set by the allocator of the
94 device (i.e. the bus driver that discovered the device).
95 6
96 7
97Programming Interface 8Programming Interface
diff --git a/Documentation/driver-model/driver.txt b/Documentation/driver-model/driver.txt
index d2cd6fb8ba9e..4421135826a2 100644
--- a/Documentation/driver-model/driver.txt
+++ b/Documentation/driver-model/driver.txt
@@ -1,23 +1,7 @@
1 1
2Device Drivers 2Device Drivers
3 3
4struct device_driver { 4See the kerneldoc for the struct device_driver.
5 char * name;
6 struct bus_type * bus;
7
8 struct completion unloaded;
9 struct kobject kobj;
10 list_t devices;
11
12 struct module *owner;
13
14 int (*probe) (struct device * dev);
15 int (*remove) (struct device * dev);
16
17 int (*suspend) (struct device * dev, pm_message_t state);
18 int (*resume) (struct device * dev);
19};
20
21 5
22 6
23Allocation 7Allocation
diff --git a/Documentation/driver-model/interface.txt b/Documentation/driver-model/interface.txt
deleted file mode 100644
index c66912bfe866..000000000000
--- a/Documentation/driver-model/interface.txt
+++ /dev/null
@@ -1,129 +0,0 @@
1
2Device Interfaces
3
4Introduction
5~~~~~~~~~~~~
6
7Device interfaces are the logical interfaces of device classes that correlate
8directly to userspace interfaces, like device nodes.
9
10Each device class may have multiple interfaces through which you can
11access the same device. An input device may support the mouse interface,
12the 'evdev' interface, and the touchscreen interface. A SCSI disk would
13support the disk interface, the SCSI generic interface, and possibly a raw
14device interface.
15
16Device interfaces are registered with the class they belong to. As devices
17are added to the class, they are added to each interface registered with
18the class. The interface is responsible for determining whether the device
19supports the interface or not.
20
21
22Programming Interface
23~~~~~~~~~~~~~~~~~~~~~
24
25struct device_interface {
26 char * name;
27 rwlock_t lock;
28 u32 devnum;
29 struct device_class * devclass;
30
31 struct list_head node;
32 struct driver_dir_entry dir;
33
34 int (*add_device)(struct device *);
35 int (*add_device)(struct intf_data *);
36};
37
38int interface_register(struct device_interface *);
39void interface_unregister(struct device_interface *);
40
41
42An interface must specify the device class it belongs to. It is added
43to that class's list of interfaces on registration.
44
45
46Interfaces can be added to a device class at any time. Whenever it is
47added, each device in the class is passed to the interface's
48add_device callback. When an interface is removed, each device is
49removed from the interface.
50
51
52Devices
53~~~~~~~
54Once a device is added to a device class, it is added to each
55interface that is registered with the device class. The class
56is expected to place a class-specific data structure in
57struct device::class_data. The interface can use that (along with
58other fields of struct device) to determine whether or not the driver
59and/or device support that particular interface.
60
61
62Data
63~~~~
64
65struct intf_data {
66 struct list_head node;
67 struct device_interface * intf;
68 struct device * dev;
69 u32 intf_num;
70};
71
72int interface_add_data(struct interface_data *);
73
74The interface is responsible for allocating and initializing a struct
75intf_data and calling interface_add_data() to add it to the device's list
76of interfaces it belongs to. This list will be iterated over when the device
77is removed from the class (instead of all possible interfaces for a class).
78This structure should probably be embedded in whatever per-device data
79structure the interface is allocating anyway.
80
81Devices are enumerated within the interface. This happens in interface_add_data()
82and the enumerated value is stored in the struct intf_data for that device.
83
84sysfs
85~~~~~
86Each interface is given a directory in the directory of the device
87class it belongs to:
88
89Interfaces get a directory in the class's directory as well:
90
91 class/
92 `-- input
93 |-- devices
94 |-- drivers
95 |-- mouse
96 `-- evdev
97
98When a device is added to the interface, a symlink is created that points
99to the device's directory in the physical hierarchy:
100
101 class/
102 `-- input
103 |-- devices
104 | `-- 1 -> ../../../root/pci0/00:1f.0/usb_bus/00:1f.2-1:0/
105 |-- drivers
106 | `-- usb:usb_mouse -> ../../../bus/drivers/usb_mouse/
107 |-- mouse
108 | `-- 1 -> ../../../root/pci0/00:1f.0/usb_bus/00:1f.2-1:0/
109 `-- evdev
110 `-- 1 -> ../../../root/pci0/00:1f.0/usb_bus/00:1f.2-1:0/
111
112
113Future Plans
114~~~~~~~~~~~~
115A device interface is correlated directly with a userspace interface
116for a device, specifically a device node. For instance, a SCSI disk
117exposes at least two interfaces to userspace: the standard SCSI disk
118interface and the SCSI generic interface. It might also export a raw
119device interface.
120
121Many interfaces have a major number associated with them and each
122device gets a minor number. Or, multiple interfaces might share one
123major number, and each will receive a range of minor numbers (like in
124the case of input devices).
125
126These major and minor numbers could be stored in the interface
127structure. Major and minor allocations could happen when the interface
128is registered with the class, or via a helper function.
129
diff --git a/Documentation/dvb/README.dvb-usb b/Documentation/dvb/README.dvb-usb
index c8238e44ed6b..c4d963a67d6f 100644
--- a/Documentation/dvb/README.dvb-usb
+++ b/Documentation/dvb/README.dvb-usb
@@ -138,7 +138,7 @@ Hotplug is able to load the driver, when it is needed (because you plugged
138in the device). 138in the device).
139 139
140If you want to enable debug output, you have to load the driver manually and 140If you want to enable debug output, you have to load the driver manually and
141from withing the dvb-kernel cvs repository. 141from within the dvb-kernel cvs repository.
142 142
143first have a look, which debug level are available: 143first have a look, which debug level are available:
144 144
diff --git a/Documentation/dvb/ci.txt b/Documentation/dvb/ci.txt
index 4a0c2b56e690..6c3bda50f7dc 100644
--- a/Documentation/dvb/ci.txt
+++ b/Documentation/dvb/ci.txt
@@ -47,7 +47,7 @@ so on.
47 47
48* CI modules that are supported 48* CI modules that are supported
49~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 49~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50The CI module support is largely dependant upon the firmware on the cards 50The CI module support is largely dependent upon the firmware on the cards
51Some cards do support almost all of the available CI modules. There is 51Some cards do support almost all of the available CI modules. There is
52nothing much that can be done in order to make additional CI modules 52nothing much that can be done in order to make additional CI modules
53working with these cards. 53working with these cards.
diff --git a/Documentation/dvb/faq.txt b/Documentation/dvb/faq.txt
index 121832e5d899..97b1373f2428 100644
--- a/Documentation/dvb/faq.txt
+++ b/Documentation/dvb/faq.txt
@@ -106,7 +106,7 @@ Some very frequently asked questions about linuxtv-dvb
1065. The dvb_net device doesn't give me any packets at all 1065. The dvb_net device doesn't give me any packets at all
107 107
108 Run tcpdump on the dvb0_0 interface. This sets the interface 108 Run tcpdump on the dvb0_0 interface. This sets the interface
109 into promiscous mode so it accepts any packets from the PID 109 into promiscuous mode so it accepts any packets from the PID
110 you have configured with the dvbnet utility. Check if there 110 you have configured with the dvbnet utility. Check if there
111 are any packets with the IP addr and MAC addr you have 111 are any packets with the IP addr and MAC addr you have
112 configured with ifconfig. 112 configured with ifconfig.
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware
index 350959f4e41b..3348d313fbe0 100644
--- a/Documentation/dvb/get_dvb_firmware
+++ b/Documentation/dvb/get_dvb_firmware
@@ -26,7 +26,8 @@ use IO::Handle;
26 "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004", 26 "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004",
27 "or51211", "or51132_qam", "or51132_vsb", "bluebird", 27 "or51211", "or51132_qam", "or51132_vsb", "bluebird",
28 "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718", 28 "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718",
29 "af9015", "ngene", "az6027"); 29 "af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395",
30 "lme2510c_s7395_old");
30 31
31# Check args 32# Check args
32syntax() if (scalar(@ARGV) != 1); 33syntax() if (scalar(@ARGV) != 1);
@@ -555,6 +556,9 @@ sub ngene {
555 my $hash1 = "d798d5a757121174f0dbc5f2833c0c85"; 556 my $hash1 = "d798d5a757121174f0dbc5f2833c0c85";
556 my $file2 = "ngene_17.fw"; 557 my $file2 = "ngene_17.fw";
557 my $hash2 = "26b687136e127b8ac24b81e0eeafc20b"; 558 my $hash2 = "26b687136e127b8ac24b81e0eeafc20b";
559 my $url2 = "http://l4m-daten.de/downloads/firmware/dvb-s2/linux/all/";
560 my $file3 = "ngene_18.fw";
561 my $hash3 = "ebce3ea769a53e3e0b0197c3b3f127e3";
558 562
559 checkstandard(); 563 checkstandard();
560 564
@@ -564,7 +568,10 @@ sub ngene {
564 wgetfile($file2, $url . $file2); 568 wgetfile($file2, $url . $file2);
565 verify($file2, $hash2); 569 verify($file2, $hash2);
566 570
567 "$file1, $file2"; 571 wgetfile($file3, $url2 . $file3);
572 verify($file3, $hash3);
573
574 "$file1, $file2, $file3";
568} 575}
569 576
570sub az6027{ 577sub az6027{
@@ -584,6 +591,49 @@ sub az6027{
584 591
585 $firmware; 592 $firmware;
586} 593}
594
595sub lme2510_lg {
596 my $sourcefile = "LMEBDA_DVBS.sys";
597 my $hash = "fc6017ad01e79890a97ec53bea157ed2";
598 my $outfile = "dvb-usb-lme2510-lg.fw";
599 my $hasho = "caa065d5fdbd2c09ad57b399bbf55cad";
600
601 checkstandard();
602
603 verify($sourcefile, $hash);
604 extract($sourcefile, 4168, 3841, $outfile);
605 verify($outfile, $hasho);
606 $outfile;
607}
608
609sub lme2510c_s7395 {
610 my $sourcefile = "US2A0D.sys";
611 my $hash = "b0155a8083fb822a3bd47bc360e74601";
612 my $outfile = "dvb-usb-lme2510c-s7395.fw";
613 my $hasho = "3a3cf1aeebd17b6ddc04cebe131e94cf";
614
615 checkstandard();
616
617 verify($sourcefile, $hash);
618 extract($sourcefile, 37248, 3720, $outfile);
619 verify($outfile, $hasho);
620 $outfile;
621}
622
623sub lme2510c_s7395_old {
624 my $sourcefile = "LMEBDA_DVBS7395C.sys";
625 my $hash = "7572ae0eb9cdf91baabd7c0ba9e09b31";
626 my $outfile = "dvb-usb-lme2510c-s7395.fw";
627 my $hasho = "90430c5b435eb5c6f88fd44a9d950674";
628
629 checkstandard();
630
631 verify($sourcefile, $hash);
632 extract($sourcefile, 4208, 3881, $outfile);
633 verify($outfile, $hasho);
634 $outfile;
635}
636
587# --------------------------------------------------------------- 637# ---------------------------------------------------------------
588# Utilities 638# Utilities
589 639
diff --git a/Documentation/dvb/lmedm04.txt b/Documentation/dvb/lmedm04.txt
new file mode 100644
index 000000000000..10b5f0411386
--- /dev/null
+++ b/Documentation/dvb/lmedm04.txt
@@ -0,0 +1,70 @@
1To extract firmware for the DM04/QQBOX you need to copy the
2following file(s) to this directory.
3
4for DM04+/QQBOX LME2510C (Sharp 7395 Tuner)
5-------------------------------------------
6
7The Sharp 7395 driver can be found in windows/system32/drivers
8
9US2A0D.sys (dated 17 Mar 2009)
10
11
12and run
13./get_dvb_firmware lme2510c_s7395
14
15 will produce
16 dvb-usb-lme2510c-s7395.fw
17
18An alternative but older firmware can be found on the driver
19disk DVB-S_EN_3.5A in BDADriver/driver
20
21LMEBDA_DVBS7395C.sys (dated 18 Jan 2008)
22
23and run
24./get_dvb_firmware lme2510c_s7395_old
25
26 will produce
27 dvb-usb-lme2510c-s7395.fw
28
29--------------------------------------------------------------------
30
31The LG firmware can be found on the driver
32disk DM04+_5.1A[LG] in BDADriver/driver
33
34for DM04 LME2510 (LG Tuner)
35---------------------------
36
37LMEBDA_DVBS.sys (dated 13 Nov 2007)
38
39and run
40./get_dvb_firmware lme2510_lg
41
42 will produce
43 dvb-usb-lme2510-lg.fw
44
45
46Other LG firmware can be extracted manually from US280D.sys
47only found in windows/system32/drivers
48
49dd if=US280D.sys ibs=1 skip=42360 count=3924 of=dvb-usb-lme2510-lg.fw
50
51for DM04 LME2510C (LG Tuner)
52---------------------------
53
54dd if=US280D.sys ibs=1 skip=35200 count=3850 of=dvb-usb-lme2510c-lg.fw
55
56---------------------------------------------------------------------
57
58The Sharp 0194 tuner driver can be found in windows/system32/drivers
59
60US290D.sys (dated 09 Apr 2009)
61
62For LME2510
63dd if=US290D.sys ibs=1 skip=36856 count=3976 of=dvb-usb-lme2510-s0194.fw
64
65
66For LME2510C
67dd if=US290D.sys ibs=1 skip=33152 count=3697 of=dvb-usb-lme2510c-s0194.fw
68
69
70Copy the firmware file(s) to /lib/firmware
diff --git a/Documentation/dvb/udev.txt b/Documentation/dvb/udev.txt
index 68ee224b6aae..412305b7c557 100644
--- a/Documentation/dvb/udev.txt
+++ b/Documentation/dvb/udev.txt
@@ -1,7 +1,7 @@
1The DVB subsystem currently registers to the sysfs subsystem using the 1The DVB subsystem currently registers to the sysfs subsystem using the
2"class_simple" interface. 2"class_simple" interface.
3 3
4This means that only the basic informations like module loading parameters 4This means that only the basic information like module loading parameters
5are presented through sysfs. Other things that might be interesting are 5are presented through sysfs. Other things that might be interesting are
6currently *not* available. 6currently *not* available.
7 7
diff --git a/Documentation/dynamic-debug-howto.txt b/Documentation/dynamic-debug-howto.txt
index 674c5663d346..f959909d7154 100644
--- a/Documentation/dynamic-debug-howto.txt
+++ b/Documentation/dynamic-debug-howto.txt
@@ -6,7 +6,7 @@ This document describes how to use the dynamic debug (ddebug) feature.
6 6
7Dynamic debug is designed to allow you to dynamically enable/disable kernel 7Dynamic debug is designed to allow you to dynamically enable/disable kernel
8code to obtain additional kernel information. Currently, if 8code to obtain additional kernel information. Currently, if
9CONFIG_DYNAMIC_DEBUG is set, then all pr_debug()/dev_debug() calls can be 9CONFIG_DYNAMIC_DEBUG is set, then all pr_debug()/dev_dbg() calls can be
10dynamically enabled per-callsite. 10dynamically enabled per-callsite.
11 11
12Dynamic debug has even more useful features: 12Dynamic debug has even more useful features:
@@ -24,9 +24,9 @@ Dynamic debug has even more useful features:
24 read to display the complete list of known debug statements, to help guide you 24 read to display the complete list of known debug statements, to help guide you
25 25
26Controlling dynamic debug Behaviour 26Controlling dynamic debug Behaviour
27=============================== 27===================================
28 28
29The behaviour of pr_debug()/dev_debug()s are controlled via writing to a 29The behaviour of pr_debug()/dev_dbg()s are controlled via writing to a
30control file in the 'debugfs' filesystem. Thus, you must first mount the debugfs 30control file in the 'debugfs' filesystem. Thus, you must first mount the debugfs
31filesystem, in order to make use of this feature. Subsequently, we refer to the 31filesystem, in order to make use of this feature. Subsequently, we refer to the
32control file as: <debugfs>/dynamic_debug/control. For example, if you want to 32control file as: <debugfs>/dynamic_debug/control. For example, if you want to
@@ -205,12 +205,40 @@ of the characters:
205 205
206The flags are: 206The flags are:
207 207
208f
209 Include the function name in the printed message
210l
211 Include line number in the printed message
212m
213 Include module name in the printed message
208p 214p
209 Causes a printk() message to be emitted to dmesg 215 Causes a printk() message to be emitted to dmesg
216t
217 Include thread ID in messages not generated from interrupt context
210 218
211Note the regexp ^[-+=][scp]+$ matches a flags specification. 219Note the regexp ^[-+=][flmpt]+$ matches a flags specification.
212Note also that there is no convenient syntax to remove all 220Note also that there is no convenient syntax to remove all
213the flags at once, you need to use "-psc". 221the flags at once, you need to use "-flmpt".
222
223
224Debug messages during boot process
225==================================
226
227To be able to activate debug messages during the boot process,
228even before userspace and debugfs exists, use the boot parameter:
229ddebug_query="QUERY"
230
231QUERY follows the syntax described above, but must not exceed 1023
232characters. The enablement of debug messages is done as an arch_initcall.
233Thus you can enable debug messages in all code processed after this
234arch_initcall via this boot parameter.
235On an x86 system for example ACPI enablement is a subsys_initcall and
236ddebug_query="file ec.c +p"
237will show early Embedded Controller transactions during ACPI setup if
238your machine (typically a laptop) has an Embedded Controller.
239PCI (or other devices) initialization also is a hot candidate for using
240this boot parameter for debugging purposes.
241
214 242
215Examples 243Examples
216======== 244========
diff --git a/Documentation/edac.txt b/Documentation/edac.txt
index 0b875e8da969..249822cde82b 100644
--- a/Documentation/edac.txt
+++ b/Documentation/edac.txt
@@ -196,7 +196,7 @@ csrow3.
196The representation of the above is reflected in the directory tree 196The representation of the above is reflected in the directory tree
197in EDAC's sysfs interface. Starting in directory 197in EDAC's sysfs interface. Starting in directory
198/sys/devices/system/edac/mc each memory controller will be represented 198/sys/devices/system/edac/mc each memory controller will be represented
199by its own 'mcX' directory, where 'X" is the index of the MC. 199by its own 'mcX' directory, where 'X' is the index of the MC.
200 200
201 201
202 ..../edac/mc/ 202 ..../edac/mc/
@@ -207,7 +207,7 @@ by its own 'mcX' directory, where 'X" is the index of the MC.
207 .... 207 ....
208 208
209Under each 'mcX' directory each 'csrowX' is again represented by a 209Under each 'mcX' directory each 'csrowX' is again represented by a
210'csrowX', where 'X" is the csrow index: 210'csrowX', where 'X' is the csrow index:
211 211
212 212
213 .../mc/mc0/ 213 .../mc/mc0/
@@ -232,7 +232,7 @@ EDAC control and attribute files.
232 232
233 233
234In 'mcX' directories are EDAC control and attribute files for 234In 'mcX' directories are EDAC control and attribute files for
235this 'X" instance of the memory controllers: 235this 'X' instance of the memory controllers:
236 236
237 237
238Counter reset control file: 238Counter reset control file:
@@ -311,7 +311,7 @@ Total Correctable Errors count attribute file:
311 'ce_noinfo_count' 311 'ce_noinfo_count'
312 312
313 This attribute file displays the number of CEs that 313 This attribute file displays the number of CEs that
314 have occurred wherewith no informations as to which DIMM slot 314 have occurred wherewith no information as to which DIMM slot
315 is having errors. Memory is handicapped, but operational, 315 is having errors. Memory is handicapped, but operational,
316 yet no information is available to indicate which slot 316 yet no information is available to indicate which slot
317 the failing memory is in. This count field should be also 317 the failing memory is in. This count field should be also
@@ -343,7 +343,7 @@ Sdram memory scrubbing rate:
343'csrowX' DIRECTORIES 343'csrowX' DIRECTORIES
344 344
345In the 'csrowX' directories are EDAC control and attribute files for 345In the 'csrowX' directories are EDAC control and attribute files for
346this 'X" instance of csrow: 346this 'X' instance of csrow:
347 347
348 348
349Total Uncorrectable Errors count attribute file: 349Total Uncorrectable Errors count attribute file:
@@ -741,7 +741,7 @@ were done at i7core_edac driver. This chapter will cover those differences
741 As EDAC API maps the minimum unity is csrows, the driver sequencially 741 As EDAC API maps the minimum unity is csrows, the driver sequencially
742 maps channel/dimm into different csrows. 742 maps channel/dimm into different csrows.
743 743
744 For example, suposing the following layout: 744 For example, supposing the following layout:
745 Ch0 phy rd0, wr0 (0x063f4031): 2 ranks, UDIMMs 745 Ch0 phy rd0, wr0 (0x063f4031): 2 ranks, UDIMMs
746 dimm 0 1024 Mb offset: 0, bank: 8, rank: 1, row: 0x4000, col: 0x400 746 dimm 0 1024 Mb offset: 0, bank: 8, rank: 1, row: 0x4000, col: 0x400
747 dimm 1 1024 Mb offset: 4, bank: 8, rank: 1, row: 0x4000, col: 0x400 747 dimm 1 1024 Mb offset: 4, bank: 8, rank: 1, row: 0x4000, col: 0x400
diff --git a/Documentation/eisa.txt b/Documentation/eisa.txt
index f297fc1202ae..38cf0c7b559f 100644
--- a/Documentation/eisa.txt
+++ b/Documentation/eisa.txt
@@ -84,7 +84,7 @@ struct eisa_driver {
84 84
85id_table : an array of NULL terminated EISA id strings, 85id_table : an array of NULL terminated EISA id strings,
86 followed by an empty string. Each string can 86 followed by an empty string. Each string can
87 optionally be paired with a driver-dependant value 87 optionally be paired with a driver-dependent value
88 (driver_data). 88 (driver_data).
89 89
90driver : a generic driver, such as described in 90driver : a generic driver, such as described in
diff --git a/Documentation/email-clients.txt b/Documentation/email-clients.txt
index 945ff3fda433..a0b58e29f911 100644
--- a/Documentation/email-clients.txt
+++ b/Documentation/email-clients.txt
@@ -104,6 +104,13 @@ Then from the "Message" menu item, select insert file and choose your patch.
104As an added bonus you can customise the message creation toolbar menu 104As an added bonus you can customise the message creation toolbar menu
105and put the "insert file" icon there. 105and put the "insert file" icon there.
106 106
107Make the the composer window wide enough so that no lines wrap. As of
108KMail 1.13.5 (KDE 4.5.4), KMail will apply word wrapping when sending
109the email if the lines wrap in the composer window. Having word wrapping
110disabled in the Options menu isn't enough. Thus, if your patch has very
111long lines, you must make the composer window very wide before sending
112the email. See: https://bugs.kde.org/show_bug.cgi?id=174034
113
107You can safely GPG sign attachments, but inlined text is preferred for 114You can safely GPG sign attachments, but inlined text is preferred for
108patches so do not GPG sign them. Signing patches that have been inserted 115patches so do not GPG sign them. Signing patches that have been inserted
109as inlined text will make them tricky to extract from their 7-bit encoding. 116as inlined text will make them tricky to extract from their 7-bit encoding.
@@ -179,26 +186,8 @@ Sylpheed (GUI)
179~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 186~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
180Thunderbird (GUI) 187Thunderbird (GUI)
181 188
182By default, thunderbird likes to mangle text, but there are ways to 189Thunderbird is an Outlook clone that likes to mangle text, but there are ways
183coerce it into being nice. 190to coerce it into behaving.
184
185- Under account settings, composition and addressing, uncheck "Compose
186 messages in HTML format".
187
188- Edit your Thunderbird config settings to tell it not to wrap lines:
189 user_pref("mailnews.wraplength", 0);
190
191- Edit your Thunderbird config settings so that it won't use format=flowed:
192 user_pref("mailnews.send_plaintext_flowed", false);
193
194- You need to get Thunderbird into preformat mode:
195. If you compose HTML messages by default, it's not too hard. Just select
196 "Preformat" from the drop-down box just under the subject line.
197. If you compose in text by default, you have to tell it to compose a new
198 message in HTML (just as a one-off), and then force it from there back to
199 text, else it will wrap lines. To do this, use shift-click on the Write
200 icon to compose to get HTML compose mode, then select "Preformat" from
201 the drop-down box just under the subject line.
202 191
203- Allows use of an external editor: 192- Allows use of an external editor:
204 The easiest thing to do with Thunderbird and patches is to use an 193 The easiest thing to do with Thunderbird and patches is to use an
@@ -208,6 +197,27 @@ coerce it into being nice.
208 View->Toolbars->Customize... and finally just click on it when in the 197 View->Toolbars->Customize... and finally just click on it when in the
209 Compose dialog. 198 Compose dialog.
210 199
200To beat some sense out of the internal editor, do this:
201
202- Under account settings, composition and addressing, uncheck "Compose
203 messages in HTML format".
204
205- Edit your Thunderbird config settings so that it won't use format=flowed.
206 Go to "edit->preferences->advanced->config editor" to bring up the
207 thunderbird's registry editor, and set "mailnews.send_plaintext_flowed" to
208 "false".
209
210- Enable "preformat" mode: Shft-click on the Write icon to bring up the HTML
211 composer, select "Preformat" from the drop-down box just under the subject
212 line, then close the message without saving. (This setting also applies to
213 the text composer, but the only control for it is in the HTML composer.)
214
215- Install the "toggle wordwrap" extension. Download the file from:
216 https://addons.mozilla.org/thunderbird/addon/2351/
217 Then go to "tools->add ons", select "install" at the bottom of the screen,
218 and browse to where you saved the .xul file. This adds an "Enable
219 Wordwrap" entry under the Options menu of the message composer.
220
211~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 221~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
212TkRat (GUI) 222TkRat (GUI)
213 223
diff --git a/Documentation/fb/00-INDEX b/Documentation/fb/00-INDEX
index a618fd99c9f0..30a70542e823 100644
--- a/Documentation/fb/00-INDEX
+++ b/Documentation/fb/00-INDEX
@@ -4,33 +4,41 @@ please mail me.
4 Geert Uytterhoeven <geert@linux-m68k.org> 4 Geert Uytterhoeven <geert@linux-m68k.org>
5 5
600-INDEX 600-INDEX
7 - this file 7 - this file.
8arkfb.txt 8arkfb.txt
9 - info on the fbdev driver for ARK Logic chips. 9 - info on the fbdev driver for ARK Logic chips.
10aty128fb.txt 10aty128fb.txt
11 - info on the ATI Rage128 frame buffer driver. 11 - info on the ATI Rage128 frame buffer driver.
12cirrusfb.txt 12cirrusfb.txt
13 - info on the driver for Cirrus Logic chipsets. 13 - info on the driver for Cirrus Logic chipsets.
14cmap_xfbdev.txt
15 - an introduction to fbdev's cmap structures.
14deferred_io.txt 16deferred_io.txt
15 - an introduction to deferred IO. 17 - an introduction to deferred IO.
18efifb.txt
19 - info on the EFI platform driver for Intel based Apple computers.
20ep93xx-fb.txt
21 - info on the driver for EP93xx LCD controller.
16fbcon.txt 22fbcon.txt
17 - intro to and usage guide for the framebuffer console (fbcon). 23 - intro to and usage guide for the framebuffer console (fbcon).
18framebuffer.txt 24framebuffer.txt
19 - introduction to frame buffer devices. 25 - introduction to frame buffer devices.
20imacfb.txt 26gxfb.txt
21 - info on the generic EFI platform driver for Intel based Macs. 27 - info on the framebuffer driver for AMD Geode GX2 based processors.
22intel810.txt 28intel810.txt
23 - documentation for the Intel 810/815 framebuffer driver. 29 - documentation for the Intel 810/815 framebuffer driver.
24intelfb.txt 30intelfb.txt
25 - docs for Intel 830M/845G/852GM/855GM/865G/915G/945G fb driver. 31 - docs for Intel 830M/845G/852GM/855GM/865G/915G/945G fb driver.
26internals.txt 32internals.txt
27 - quick overview of frame buffer device internals. 33 - quick overview of frame buffer device internals.
34lxfb.txt
35 - info on the framebuffer driver for AMD Geode LX based processors.
28matroxfb.txt 36matroxfb.txt
29 - info on the Matrox framebuffer driver for Alpha, Intel and PPC. 37 - info on the Matrox framebuffer driver for Alpha, Intel and PPC.
38metronomefb.txt
39 - info on the driver for the Metronome display controller.
30modedb.txt 40modedb.txt
31 - info on the video mode database. 41 - info on the video mode database.
32matroxfb.txt
33 - info on the Matrox frame buffer driver.
34pvr2fb.txt 42pvr2fb.txt
35 - info on the PowerVR 2 frame buffer driver. 43 - info on the PowerVR 2 frame buffer driver.
36pxafb.txt 44pxafb.txt
@@ -39,13 +47,23 @@ s3fb.txt
39 - info on the fbdev driver for S3 Trio/Virge chips. 47 - info on the fbdev driver for S3 Trio/Virge chips.
40sa1100fb.txt 48sa1100fb.txt
41 - information about the driver for the SA-1100 LCD controller. 49 - information about the driver for the SA-1100 LCD controller.
50sh7760fb.txt
51 - info on the SH7760/SH7763 integrated LCDC Framebuffer driver.
42sisfb.txt 52sisfb.txt
43 - info on the framebuffer device driver for various SiS chips. 53 - info on the framebuffer device driver for various SiS chips.
44sstfb.txt 54sstfb.txt
45 - info on the frame buffer driver for 3dfx' Voodoo Graphics boards. 55 - info on the frame buffer driver for 3dfx' Voodoo Graphics boards.
46tgafb.txt 56tgafb.txt
47 - info on the TGA (DECChip 21030) frame buffer driver 57 - info on the TGA (DECChip 21030) frame buffer driver.
58tridentfb.txt
59 info on the framebuffer driver for some Trident chip based cards.
60uvesafb.txt
61 - info on the userspace VESA (VBE2+ compliant) frame buffer device.
48vesafb.txt 62vesafb.txt
49 - info on the VESA frame buffer device 63 - info on the VESA frame buffer device.
64viafb.modes
65 - list of modes for VIA Integration Graphic Chip.
66viafb.txt
67 - info on the VIA Integration Graphic Chip console framebuffer driver.
50vt8623fb.txt 68vt8623fb.txt
51 - info on the fb driver for the graphics core in VIA VT8623 chipsets. 69 - info on the fb driver for the graphics core in VIA VT8623 chipsets.
diff --git a/Documentation/fb/sm501.txt b/Documentation/fb/sm501.txt
new file mode 100644
index 000000000000..8d17aebd2648
--- /dev/null
+++ b/Documentation/fb/sm501.txt
@@ -0,0 +1,10 @@
1Configuration:
2
3You can pass the following kernel command line options to sm501 videoframebuffer:
4
5 sm501fb.bpp= SM501 Display driver:
6 Specifiy bits-per-pixel if not specified by 'mode'
7
8 sm501fb.mode= SM501 Display driver:
9 Specify resolution as
10 "<xres>x<yres>[-<bpp>][@<refresh>]"
diff --git a/Documentation/fb/udlfb.txt b/Documentation/fb/udlfb.txt
new file mode 100644
index 000000000000..7fdde2a02a27
--- /dev/null
+++ b/Documentation/fb/udlfb.txt
@@ -0,0 +1,144 @@
1
2What is udlfb?
3===============
4
5This is a driver for DisplayLink USB 2.0 era graphics chips.
6
7DisplayLink chips provide simple hline/blit operations with some compression,
8pairing that with a hardware framebuffer (16MB) on the other end of the
9USB wire. That hardware framebuffer is able to drive the VGA, DVI, or HDMI
10monitor with no CPU involvement until a pixel has to change.
11
12The CPU or other local resource does all the rendering; optinally compares the
13result with a local shadow of the remote hardware framebuffer to identify
14the minimal set of pixels that have changed; and compresses and sends those
15pixels line-by-line via USB bulk transfers.
16
17Because of the efficiency of bulk transfers and a protocol on top that
18does not require any acks - the effect is very low latency that
19can support surprisingly high resolutions with good performance for
20non-gaming and non-video applications.
21
22Mode setting, EDID read, etc are other bulk or control transfers. Mode
23setting is very flexible - able to set nearly arbitrary modes from any timing.
24
25Advantages of USB graphics in general:
26
27 * Ability to add a nearly arbitrary number of displays to any USB 2.0
28 capable system. On Linux, number of displays is limited by fbdev interface
29 (FB_MAX is currently 32). Of course, all USB devices on the same
30 host controller share the same 480Mbs USB 2.0 interface.
31
32Advantages of supporting DisplayLink chips with kernel framebuffer interface:
33
34 * The actual hardware functionality of DisplayLink chips matches nearly
35 one-to-one with the fbdev interface, making the driver quite small and
36 tight relative to the functionality it provides.
37 * X servers and other applications can use the standard fbdev interface
38 from user mode to talk to the device, without needing to know anything
39 about USB or DisplayLink's protocol at all. A "displaylink" X driver
40 and a slightly modified "fbdev" X driver are among those that already do.
41
42Disadvantages:
43
44 * Fbdev's mmap interface assumes a real hardware framebuffer is mapped.
45 In the case of USB graphics, it is just an allocated (virtual) buffer.
46 Writes need to be detected and encoded into USB bulk transfers by the CPU.
47 Accurate damage/changed area notifications work around this problem.
48 In the future, hopefully fbdev will be enhanced with an small standard
49 interface to allow mmap clients to report damage, for the benefit
50 of virtual or remote framebuffers.
51 * Fbdev does not arbitrate client ownership of the framebuffer well.
52 * Fbcon assumes the first framebuffer it finds should be consumed for console.
53 * It's not clear what the future of fbdev is, given the rise of KMS/DRM.
54
55How to use it?
56==============
57
58Udlfb, when loaded as a module, will match against all USB 2.0 generation
59DisplayLink chips (Alex and Ollie family). It will then attempt to read the EDID
60of the monitor, and set the best common mode between the DisplayLink device
61and the monitor's capabilities.
62
63If the DisplayLink device is successful, it will paint a "green screen" which
64means that from a hardware and fbdev software perspective, everything is good.
65
66At that point, a /dev/fb? interface will be present for user-mode applications
67to open and begin writing to the framebuffer of the DisplayLink device using
68standard fbdev calls. Note that if mmap() is used, by default the user mode
69application must send down damage notifcations to trigger repaints of the
70changed regions. Alternatively, udlfb can be recompiled with experimental
71defio support enabled, to support a page-fault based detection mechanism
72that can work without explicit notifcation.
73
74The most common client of udlfb is xf86-video-displaylink or a modified
75xf86-video-fbdev X server. These servers have no real DisplayLink specific
76code. They write to the standard framebuffer interface and rely on udlfb
77to do its thing. The one extra feature they have is the ability to report
78rectangles from the X DAMAGE protocol extension down to udlfb via udlfb's
79damage interface (which will hopefully be standardized for all virtual
80framebuffers that need damage info). These damage notifications allow
81udlfb to efficiently process the changed pixels.
82
83Module Options
84==============
85
86Special configuration for udlfb is usually unnecessary. There are a few
87options, however.
88
89From the command line, pass options to modprobe
90modprobe udlfb defio=1 console=1
91
92Or for permanent option, create file like /etc/modprobe.d/options with text
93options udlfb defio=1 console=1
94
95Accepted options:
96
97fb_defio Make use of the fb_defio (CONFIG_FB_DEFERRED_IO) kernel
98 module to track changed areas of the framebuffer by page faults.
99 Standard fbdev applications that use mmap but that do not
100 report damage, may be able to work with this enabled.
101 Disabled by default because of overhead and other issues.
102
103console Allow fbcon to attach to udlfb provided framebuffers. This
104 is disabled by default because fbcon will aggressively consume
105 the first framebuffer it finds, which isn't usually what the
106 user wants in the case of USB displays.
107
108Sysfs Attributes
109================
110
111Udlfb creates several files in /sys/class/graphics/fb?
112Where ? is the sequential framebuffer id of the particular DisplayLink device
113
114edid If a valid EDID blob is written to this file (typically
115 by a udev rule), then udlfb will use this EDID as a
116 backup in case reading the actual EDID of the monitor
117 attached to the DisplayLink device fails. This is
118 especially useful for fixed panels, etc. that cannot
119 communicate their capabilities via EDID. Reading
120 this file returns the current EDID of the attached
121 monitor (or last backup value written). This is
122 useful to get the EDID of the attached monitor,
123 which can be passed to utilities like parse-edid.
124
125metrics_bytes_rendered 32-bit count of pixel bytes rendered
126
127metrics_bytes_identical 32-bit count of how many of those bytes were found to be
128 unchanged, based on a shadow framebuffer check
129
130metrics_bytes_sent 32-bit count of how many bytes were transferred over
131 USB to communicate the resulting changed pixels to the
132 hardware. Includes compression and protocol overhead
133
134metrics_cpu_kcycles_used 32-bit count of CPU cycles used in processing the
135 above pixels (in thousands of cycles).
136
137metrics_reset Write-only. Any write to this file resets all metrics
138 above to zero. Note that the 32-bit counters above
139 roll over very quickly. To get reliable results, design
140 performance tests to start and finish in a very short
141 period of time (one minute or less is safe).
142
143--
144Bernie Thompson <bernie@plugable.com>
diff --git a/Documentation/fb/viafb.txt b/Documentation/fb/viafb.txt
index f3e046a6a987..444e34b52ae1 100644
--- a/Documentation/fb/viafb.txt
+++ b/Documentation/fb/viafb.txt
@@ -197,6 +197,54 @@ Notes:
197 example, 197 example,
198 # fbset -depth 16 198 # fbset -depth 16
199 199
200
201[Configure viafb via /proc]
202---------------------------
203 The following files exist in /proc/viafb
204
205 supported_output_devices
206
207 This read-only file contains a full ',' separated list containing all
208 output devices that could be available on your platform. It is likely
209 that not all of those have a connector on your hardware but it should
210 provide a good starting point to figure out which of those names match
211 a real connector.
212 Example:
213 # cat /proc/viafb/supported_output_devices
214
215 iga1/output_devices
216 iga2/output_devices
217
218 These two files are readable and writable. iga1 and iga2 are the two
219 independent units that produce the screen image. Those images can be
220 forwarded to one or more output devices. Reading those files is a way
221 to query which output devices are currently used by an iga.
222 Example:
223 # cat /proc/viafb/iga1/output_devices
224 If there are no output devices printed the output of this iga is lost.
225 This can happen for example if only one (the other) iga is used.
226 Writing to these files allows adjusting the output devices during
227 runtime. One can add new devices, remove existing ones or switch
228 between igas. Essentially you can write a ',' separated list of device
229 names (or a single one) in the same format as the output to those
230 files. You can add a '+' or '-' as a prefix allowing simple addition
231 and removal of devices. So a prefix '+' adds the devices from your list
232 to the already existing ones, '-' removes the listed devices from the
233 existing ones and if no prefix is given it replaces all existing ones
234 with the listed ones. If you remove devices they are expected to turn
235 off. If you add devices that are already part of the other iga they are
236 removed there and added to the new one.
237 Examples:
238 Add CRT as output device to iga1
239 # echo +CRT > /proc/viafb/iga1/output_devices
240
241 Remove (turn off) DVP1 and LVDS1 as output devices of iga2
242 # echo -DVP1,LVDS1 > /proc/viafb/iga2/output_devices
243
244 Replace all iga1 output devices by CRT
245 # echo CRT > /proc/viafb/iga1/output_devices
246
247
200[Bootup with viafb]: 248[Bootup with viafb]:
201-------------------- 249--------------------
202 Add the following line to your grub.conf: 250 Add the following line to your grub.conf:
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 842aa9de84a6..b1c921c27519 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -6,6 +6,42 @@ be removed from this file.
6 6
7--------------------------- 7---------------------------
8 8
9What: x86 floppy disable_hlt
10When: 2012
11Why: ancient workaround of dubious utility clutters the
12 code used by everybody else.
13Who: Len Brown <len.brown@intel.com>
14
15---------------------------
16
17What: CONFIG_APM_CPU_IDLE, and its ability to call APM BIOS in idle
18When: 2012
19Why: This optional sub-feature of APM is of dubious reliability,
20 and ancient APM laptops are likely better served by calling HLT.
21 Deleting CONFIG_APM_CPU_IDLE allows x86 to stop exporting
22 the pm_idle function pointer to modules.
23Who: Len Brown <len.brown@intel.com>
24
25----------------------------
26
27What: x86_32 "no-hlt" cmdline param
28When: 2012
29Why: remove a branch from idle path, simplify code used by everybody.
30 This option disabled the use of HLT in idle and machine_halt()
31 for hardware that was flakey 15-years ago. Today we have
32 "idle=poll" that removed HLT from idle, and so if such a machine
33 is still running the upstream kernel, "idle=poll" is likely sufficient.
34Who: Len Brown <len.brown@intel.com>
35
36----------------------------
37
38What: x86 "idle=mwait" cmdline param
39When: 2012
40Why: simplify x86 idle code
41Who: Len Brown <len.brown@intel.com>
42
43----------------------------
44
9What: PRISM54 45What: PRISM54
10When: 2.6.34 46When: 2.6.34
11 47
@@ -97,25 +133,6 @@ Who: Pavel Machek <pavel@ucw.cz>
97 133
98--------------------------- 134---------------------------
99 135
100What: Video4Linux API 1 ioctls and from Video devices.
101When: July 2009
102Files: include/linux/videodev.h
103Check: include/linux/videodev.h
104Why: V4L1 AP1 was replaced by V4L2 API during migration from 2.4 to 2.6
105 series. The old API have lots of drawbacks and don't provide enough
106 means to work with all video and audio standards. The newer API is
107 already available on the main drivers and should be used instead.
108 Newer drivers should use v4l_compat_translate_ioctl function to handle
109 old calls, replacing to newer ones.
110 Decoder iocts are using internally to allow video drivers to
111 communicate with video decoders. This should also be improved to allow
112 V4L2 calls being translated into compatible internal ioctls.
113 Compatibility ioctls will be provided, for a while, via
114 v4l1-compat module.
115Who: Mauro Carvalho Chehab <mchehab@infradead.org>
116
117---------------------------
118
119What: sys_sysctl 136What: sys_sysctl
120When: September 2010 137When: September 2010
121Option: CONFIG_SYSCTL_SYSCALL 138Option: CONFIG_SYSCTL_SYSCALL
@@ -176,6 +193,20 @@ Why: /proc/<pid>/oom_adj allows userspace to influence the oom killer's
176 193
177--------------------------- 194---------------------------
178 195
196What: CS5535/CS5536 obsolete GPIO driver
197When: June 2011
198Files: drivers/staging/cs5535_gpio/*
199Check: drivers/staging/cs5535_gpio/cs5535_gpio.c
200Why: A newer driver replaces this; it is drivers/gpio/cs5535-gpio.c, and
201 integrates with the Linux GPIO subsystem. The old driver has been
202 moved to staging, and will be removed altogether around 2.6.40.
203 Please test the new driver, and ensure that the functionality you
204 need and any bugfixes from the old driver are available in the new
205 one.
206Who: Andres Salomon <dilinger@queued.net>
207
208--------------------------
209
179What: remove EXPORT_SYMBOL(kernel_thread) 210What: remove EXPORT_SYMBOL(kernel_thread)
180When: August 2006 211When: August 2006
181Files: arch/*/kernel/*_ksyms.c 212Files: arch/*/kernel/*_ksyms.c
@@ -217,11 +248,14 @@ Who: Zhang Rui <rui.zhang@intel.com>
217 248
218--------------------------- 249---------------------------
219 250
220What: /proc/acpi/button 251What: CONFIG_ACPI_PROCFS_POWER
221When: August 2007 252When: 2.6.39
222Why: /proc/acpi/button has been replaced by events to the input layer 253Why: sysfs I/F for ACPI power devices, including AC and Battery,
223 since 2.6.20. 254 has been working in upstream kernel since 2.6.24, Sep 2007.
224Who: Len Brown <len.brown@intel.com> 255 In 2.6.37, we make the sysfs I/F always built in and this option
256 disabled by default.
257 Remove this option and the ACPI power procfs interface in 2.6.39.
258Who: Zhang Rui <rui.zhang@intel.com>
225 259
226--------------------------- 260---------------------------
227 261
@@ -264,16 +298,6 @@ Who: Michael Buesch <mb@bu3sch.de>
264 298
265--------------------------- 299---------------------------
266 300
267What: /sys/o2cb symlink
268When: January 2010
269Why: /sys/fs/o2cb is the proper location for this information - /sys/o2cb
270 exists as a symlink for backwards compatibility for old versions of
271 ocfs2-tools. 2 years should be sufficient time to phase in new versions
272 which know to look in /sys/fs/o2cb.
273Who: ocfs2-devel@oss.oracle.com
274
275---------------------------
276
277What: Ability for non root users to shm_get hugetlb pages based on mlock 301What: Ability for non root users to shm_get hugetlb pages based on mlock
278 resource limits 302 resource limits
279When: 2.6.31 303When: 2.6.31
@@ -315,14 +339,6 @@ Who: Dave Jones <davej@redhat.com>, Matthew Garrett <mjg@redhat.com>
315 339
316----------------------------- 340-----------------------------
317 341
318What: __do_IRQ all in one fits nothing interrupt handler
319When: 2.6.32
320Why: __do_IRQ was kept for easy migration to the type flow handlers.
321 More than two years of migration time is enough.
322Who: Thomas Gleixner <tglx@linutronix.de>
323
324-----------------------------
325
326What: fakephp and associated sysfs files in /sys/bus/pci/slots/ 342What: fakephp and associated sysfs files in /sys/bus/pci/slots/
327When: 2011 343When: 2011
328Why: In 2.6.27, the semantics of /sys/bus/pci/slots was redefined to 344Why: In 2.6.27, the semantics of /sys/bus/pci/slots was redefined to
@@ -386,54 +402,6 @@ Who: Tejun Heo <tj@kernel.org>
386 402
387---------------------------- 403----------------------------
388 404
389What: Support for VMware's guest paravirtuliazation technique [VMI] will be
390 dropped.
391When: 2.6.37 or earlier.
392Why: With the recent innovations in CPU hardware acceleration technologies
393 from Intel and AMD, VMware ran a few experiments to compare these
394 techniques to guest paravirtualization technique on VMware's platform.
395 These hardware assisted virtualization techniques have outperformed the
396 performance benefits provided by VMI in most of the workloads. VMware
397 expects that these hardware features will be ubiquitous in a couple of
398 years, as a result, VMware has started a phased retirement of this
399 feature from the hypervisor. We will be removing this feature from the
400 Kernel too. Right now we are targeting 2.6.37 but can retire earlier if
401 technical reasons (read opportunity to remove major chunk of pvops)
402 arise.
403
404 Please note that VMI has always been an optimization and non-VMI kernels
405 still work fine on VMware's platform.
406 Latest versions of VMware's product which support VMI are,
407 Workstation 7.0 and VSphere 4.0 on ESX side, future maintainence
408 releases for these products will continue supporting VMI.
409
410 For more details about VMI retirement take a look at this,
411 http://blogs.vmware.com/guestosguide/2009/09/vmi-retirement.html
412
413Who: Alok N Kataria <akataria@vmware.com>
414
415----------------------------
416
417What: Support for lcd_switch and display_get in asus-laptop driver
418When: March 2010
419Why: These two features use non-standard interfaces. There are the
420 only features that really need multiple path to guess what's
421 the right method name on a specific laptop.
422
423 Removing them will allow to remove a lot of code an significantly
424 clean the drivers.
425
426 This will affect the backlight code which won't be able to know
427 if the backlight is on or off. The platform display file will also be
428 write only (like the one in eeepc-laptop).
429
430 This should'nt affect a lot of user because they usually know
431 when their display is on or off.
432
433Who: Corentin Chary <corentin.chary@gmail.com>
434
435----------------------------
436
437What: sysfs-class-rfkill state file 405What: sysfs-class-rfkill state file
438When: Feb 2014 406When: Feb 2014
439Files: net/rfkill/core.c 407Files: net/rfkill/core.c
@@ -452,16 +420,6 @@ Who: anybody or Florian Mickler <florian@mickler.org>
452 420
453---------------------------- 421----------------------------
454 422
455What: capifs
456When: February 2011
457Files: drivers/isdn/capi/capifs.*
458Why: udev fully replaces this special file system that only contains CAPI
459 NCCI TTY device nodes. User space (pppdcapiplugin) works without
460 noticing the difference.
461Who: Jan Kiszka <jan.kiszka@web.de>
462
463----------------------------
464
465What: KVM paravirt mmu host support 423What: KVM paravirt mmu host support
466When: January 2011 424When: January 2011
467Why: The paravirt mmu host support is slower than non-paravirt mmu, both 425Why: The paravirt mmu host support is slower than non-paravirt mmu, both
@@ -498,29 +456,6 @@ When: April 2011
498Why: Superseded by xt_CT 456Why: Superseded by xt_CT
499Who: Netfilter developer team <netfilter-devel@vger.kernel.org> 457Who: Netfilter developer team <netfilter-devel@vger.kernel.org>
500 458
501---------------------------
502
503What: video4linux /dev/vtx teletext API support
504When: 2.6.35
505Files: drivers/media/video/saa5246a.c drivers/media/video/saa5249.c
506 include/linux/videotext.h
507Why: The vtx device nodes have been superseded by vbi device nodes
508 for many years. No applications exist that use the vtx support.
509 Of the two i2c drivers that actually support this API the saa5249
510 has been impossible to use for a year now and no known hardware
511 that supports this device exists. The saa5246a is theoretically
512 supported by the old mxb boards, but it never actually worked.
513
514 In summary: there is no hardware that can use this API and there
515 are no applications actually implementing this API.
516
517 The vtx support still reserves minors 192-223 and we would really
518 like to reuse those for upcoming new functionality. In the unlikely
519 event that new hardware appears that wants to use the functionality
520 provided by the vtx API, then that functionality should be build
521 around the sliced VBI API instead.
522Who: Hans Verkuil <hverkuil@xs4all.nl>
523
524---------------------------- 459----------------------------
525 460
526What: IRQF_DISABLED 461What: IRQF_DISABLED
@@ -530,24 +465,6 @@ Who: Thomas Gleixner <tglx@linutronix.de>
530 465
531---------------------------- 466----------------------------
532 467
533What: old ieee1394 subsystem (CONFIG_IEEE1394)
534When: 2.6.37
535Files: drivers/ieee1394/ except init_ohci1394_dma.c
536Why: superseded by drivers/firewire/ (CONFIG_FIREWIRE) which offers more
537 features, better performance, and better security, all with smaller
538 and more modern code base
539Who: Stefan Richter <stefanr@s5r6.in-berlin.de>
540
541----------------------------
542
543What: The acpi_sleep=s4_nonvs command line option
544When: 2.6.37
545Files: arch/x86/kernel/acpi/sleep.c
546Why: superseded by acpi_sleep=nonvs
547Who: Rafael J. Wysocki <rjw@sisk.pl>
548
549----------------------------
550
551What: PCI DMA unmap state API 468What: PCI DMA unmap state API
552When: August 2012 469When: August 2012
553Why: PCI DMA unmap state API (include/linux/pci-dma.h) was replaced 470Why: PCI DMA unmap state API (include/linux/pci-dma.h) was replaced
@@ -564,3 +481,127 @@ Who: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
564 481
565---------------------------- 482----------------------------
566 483
484What: iwlwifi disable_hw_scan module parameters
485When: 2.6.40
486Why: Hareware scan is the prefer method for iwlwifi devices for
487 scanning operation. Remove software scan support for all the
488 iwlwifi devices.
489
490Who: Wey-Yi Guy <wey-yi.w.guy@intel.com>
491
492----------------------------
493
494What: access to nfsd auth cache through sys_nfsservctl or '.' files
495 in the 'nfsd' filesystem.
496When: 2.6.40
497Why: This is a legacy interface which have been replaced by a more
498 dynamic cache. Continuing to maintain this interface is an
499 unnecessary burden.
500Who: NeilBrown <neilb@suse.de>
501
502----------------------------
503
504What: cancel_rearming_delayed_work[queue]()
505When: 2.6.39
506
507Why: The functions have been superceded by cancel_delayed_work_sync()
508 quite some time ago. The conversion is trivial and there is no
509 in-kernel user left.
510Who: Tejun Heo <tj@kernel.org>
511
512----------------------------
513
514What: Legacy, non-standard chassis intrusion detection interface.
515When: June 2011
516Why: The adm9240, w83792d and w83793 hardware monitoring drivers have
517 legacy interfaces for chassis intrusion detection. A standard
518 interface has been added to each driver, so the legacy interface
519 can be removed.
520Who: Jean Delvare <khali@linux-fr.org>
521
522----------------------------
523
524What: xt_connlimit rev 0
525When: 2012
526Who: Jan Engelhardt <jengelh@medozas.de>
527Files: net/netfilter/xt_connlimit.c
528
529----------------------------
530
531What: noswapaccount kernel command line parameter
532When: 2.6.40
533Why: The original implementation of memsw feature enabled by
534 CONFIG_CGROUP_MEM_RES_CTLR_SWAP could be disabled by the noswapaccount
535 kernel parameter (introduced in 2.6.29-rc1). Later on, this decision
536 turned out to be not ideal because we cannot have the feature compiled
537 in and disabled by default and let only interested to enable it
538 (e.g. general distribution kernels might need it). Therefore we have
539 added swapaccount[=0|1] parameter (introduced in 2.6.37) which provides
540 the both possibilities. If we remove noswapaccount we will have
541 less command line parameters with the same functionality and we
542 can also cleanup the parameter handling a bit ().
543Who: Michal Hocko <mhocko@suse.cz>
544
545----------------------------
546
547What: ipt_addrtype match include file
548When: 2012
549Why: superseded by xt_addrtype
550Who: Florian Westphal <fw@strlen.de>
551Files: include/linux/netfilter_ipv4/ipt_addrtype.h
552
553----------------------------
554
555What: i2c_driver.attach_adapter
556 i2c_driver.detach_adapter
557When: September 2011
558Why: These legacy callbacks should no longer be used as i2c-core offers
559 a variety of preferable alternative ways to instantiate I2C devices.
560Who: Jean Delvare <khali@linux-fr.org>
561
562----------------------------
563
564What: Support for UVCIOC_CTRL_ADD in the uvcvideo driver
565When: 2.6.42
566Why: The information passed to the driver by this ioctl is now queried
567 dynamically from the device.
568Who: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
569
570----------------------------
571
572What: Support for UVCIOC_CTRL_MAP_OLD in the uvcvideo driver
573When: 2.6.42
574Why: Used only by applications compiled against older driver versions.
575 Superseded by UVCIOC_CTRL_MAP which supports V4L2 menu controls.
576Who: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
577
578----------------------------
579
580What: Support for UVCIOC_CTRL_GET and UVCIOC_CTRL_SET in the uvcvideo driver
581When: 2.6.42
582Why: Superseded by the UVCIOC_CTRL_QUERY ioctl.
583Who: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
584
585----------------------------
586
587What: For VIDIOC_S_FREQUENCY the type field must match the device node's type.
588 If not, return -EINVAL.
589When: 3.2
590Why: It makes no sense to switch the tuner to radio mode by calling
591 VIDIOC_S_FREQUENCY on a video node, or to switch the tuner to tv mode by
592 calling VIDIOC_S_FREQUENCY on a radio node. This is the first step of a
593 move to more consistent handling of tv and radio tuners.
594Who: Hans Verkuil <hans.verkuil@cisco.com>
595
596----------------------------
597
598What: Opening a radio device node will no longer automatically switch the
599 tuner mode from tv to radio.
600When: 3.3
601Why: Just opening a V4L device should not change the state of the hardware
602 like that. It's very unexpected and against the V4L spec. Instead, you
603 switch to radio mode by calling VIDIOC_S_FREQUENCY. This is the second
604 and last step of the move to consistent handling of tv and radio tuners.
605Who: Hans Verkuil <hans.verkuil@cisco.com>
606
607----------------------------
diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX
index 4303614b5add..8c624a18f67d 100644
--- a/Documentation/filesystems/00-INDEX
+++ b/Documentation/filesystems/00-INDEX
@@ -96,8 +96,6 @@ seq_file.txt
96 - how to use the seq_file API 96 - how to use the seq_file API
97sharedsubtree.txt 97sharedsubtree.txt
98 - a description of shared subtrees for namespaces. 98 - a description of shared subtrees for namespaces.
99smbfs.txt
100 - info on using filesystems with the SMB protocol (Win 3.11 and NT).
101spufs.txt 99spufs.txt
102 - info and mount options for the SPU filesystem used on Cell. 100 - info and mount options for the SPU filesystem used on Cell.
103sysfs-pci.txt 101sysfs-pci.txt
diff --git a/Documentation/filesystems/9p.txt b/Documentation/filesystems/9p.txt
index f9765e8cf086..13de64c7f0ab 100644
--- a/Documentation/filesystems/9p.txt
+++ b/Documentation/filesystems/9p.txt
@@ -25,6 +25,8 @@ Other applications are described in the following papers:
25 http://xcpu.org/papers/cellfs-talk.pdf 25 http://xcpu.org/papers/cellfs-talk.pdf
26 * PROSE I/O: Using 9p to enable Application Partitions 26 * PROSE I/O: Using 9p to enable Application Partitions
27 http://plan9.escet.urjc.es/iwp9/cready/PROSE_iwp9_2006.pdf 27 http://plan9.escet.urjc.es/iwp9/cready/PROSE_iwp9_2006.pdf
28 * VirtFS: A Virtualization Aware File System pass-through
29 http://goo.gl/3WPDg
28 30
29USAGE 31USAGE
30===== 32=====
@@ -111,7 +113,7 @@ OPTIONS
111 This can be used to share devices/named pipes/sockets between 113 This can be used to share devices/named pipes/sockets between
112 hosts. This functionality will be expanded in later versions. 114 hosts. This functionality will be expanded in later versions.
113 115
114 access there are three access modes. 116 access there are four access modes.
115 user = if a user tries to access a file on v9fs 117 user = if a user tries to access a file on v9fs
116 filesystem for the first time, v9fs sends an 118 filesystem for the first time, v9fs sends an
117 attach command (Tattach) for that user. 119 attach command (Tattach) for that user.
@@ -120,6 +122,8 @@ OPTIONS
120 the files on the mounted filesystem 122 the files on the mounted filesystem
121 any = v9fs does single attach and performs all 123 any = v9fs does single attach and performs all
122 operations as one user 124 operations as one user
125 client = ACL based access check on the 9p client
126 side for access validation
123 127
124 cachetag cache tag to use the specified persistent cache. 128 cachetag cache tag to use the specified persistent cache.
125 cache tags for existing cache sessions can be listed at 129 cache tags for existing cache sessions can be listed at
@@ -128,31 +132,20 @@ OPTIONS
128RESOURCES 132RESOURCES
129========= 133=========
130 134
131Our current recommendation is to use Inferno (http://www.vitanuova.com/nferno/index.html) 135Protocol specifications are maintained on github:
132as the 9p server. You can start a 9p server under Inferno by issuing the 136http://ericvh.github.com/9p-rfc/
133following command:
134 ; styxlisten -A tcp!*!564 export '#U*'
135 137
136The -A specifies an unauthenticated export. The 564 is the port # (you may 1389p client and server implementations are listed on
137have to choose a higher port number if running as a normal user). The '#U*' 139http://9p.cat-v.org/implementations
138specifies exporting the root of the Linux name space. You may specify a
139subset of the namespace by extending the path: '#U*'/tmp would just export
140/tmp. For more information, see the Inferno manual pages covering styxlisten
141and export.
142 140
143A Linux version of the 9p server is now maintained under the npfs project 141A 9p2000.L server is being developed by LLNL and can be found
144on sourceforge (http://sourceforge.net/projects/npfs). The currently 142at http://code.google.com/p/diod/
145maintained version is the single-threaded version of the server (named spfs)
146available from the same SVN repository.
147 143
148There are user and developer mailing lists available through the v9fs project 144There are user and developer mailing lists available through the v9fs project
149on sourceforge (http://sourceforge.net/projects/v9fs). 145on sourceforge (http://sourceforge.net/projects/v9fs).
150 146
151A stand-alone version of the module (which should build for any 2.6 kernel) 147News and other information is maintained on a Wiki.
152is available via (http://github.com/ericvh/9p-sac/tree/master) 148(http://sf.net/apps/mediawiki/v9fs/index.php).
153
154News and other information is maintained on SWiK (http://swik.net/v9fs)
155and the Wiki (http://sf.net/apps/mediawiki/v9fs/index.php).
156 149
157Bug reports may be issued through the kernel.org bugzilla 150Bug reports may be issued through the kernel.org bugzilla
158(http://bugzilla.kernel.org) 151(http://bugzilla.kernel.org)
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index 2db4283efa8d..57d827d6071d 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -9,24 +9,30 @@ be able to use diff(1).
9 9
10--------------------------- dentry_operations -------------------------- 10--------------------------- dentry_operations --------------------------
11prototypes: 11prototypes:
12 int (*d_revalidate)(struct dentry *, int); 12 int (*d_revalidate)(struct dentry *, struct nameidata *);
13 int (*d_hash) (struct dentry *, struct qstr *); 13 int (*d_hash)(const struct dentry *, const struct inode *,
14 int (*d_compare) (struct dentry *, struct qstr *, struct qstr *); 14 struct qstr *);
15 int (*d_compare)(const struct dentry *, const struct inode *,
16 const struct dentry *, const struct inode *,
17 unsigned int, const char *, const struct qstr *);
15 int (*d_delete)(struct dentry *); 18 int (*d_delete)(struct dentry *);
16 void (*d_release)(struct dentry *); 19 void (*d_release)(struct dentry *);
17 void (*d_iput)(struct dentry *, struct inode *); 20 void (*d_iput)(struct dentry *, struct inode *);
18 char *(*d_dname)((struct dentry *dentry, char *buffer, int buflen); 21 char *(*d_dname)((struct dentry *dentry, char *buffer, int buflen);
22 struct vfsmount *(*d_automount)(struct path *path);
23 int (*d_manage)(struct dentry *, bool);
19 24
20locking rules: 25locking rules:
21 none have BKL 26 rename_lock ->d_lock may block rcu-walk
22 dcache_lock rename_lock ->d_lock may block 27d_revalidate: no no yes (ref-walk) maybe
23d_revalidate: no no no yes 28d_hash no no no maybe
24d_hash no no no yes 29d_compare: yes no no maybe
25d_compare: no yes no no 30d_delete: no yes no no
26d_delete: yes no yes no 31d_release: no no yes no
27d_release: no no no yes 32d_iput: no no yes no
28d_iput: no no no yes
29d_dname: no no no no 33d_dname: no no no no
34d_automount: no no yes no
35d_manage: no no yes (ref-walk) maybe
30 36
31--------------------------- inode_operations --------------------------- 37--------------------------- inode_operations ---------------------------
32prototypes: 38prototypes:
@@ -42,18 +48,22 @@ ata *);
42 int (*rename) (struct inode *, struct dentry *, 48 int (*rename) (struct inode *, struct dentry *,
43 struct inode *, struct dentry *); 49 struct inode *, struct dentry *);
44 int (*readlink) (struct dentry *, char __user *,int); 50 int (*readlink) (struct dentry *, char __user *,int);
45 int (*follow_link) (struct dentry *, struct nameidata *); 51 void * (*follow_link) (struct dentry *, struct nameidata *);
52 void (*put_link) (struct dentry *, struct nameidata *, void *);
46 void (*truncate) (struct inode *); 53 void (*truncate) (struct inode *);
47 int (*permission) (struct inode *, int, struct nameidata *); 54 int (*permission) (struct inode *, int, unsigned int);
55 int (*check_acl)(struct inode *, int, unsigned int);
48 int (*setattr) (struct dentry *, struct iattr *); 56 int (*setattr) (struct dentry *, struct iattr *);
49 int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *); 57 int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *);
50 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); 58 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
51 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); 59 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
52 ssize_t (*listxattr) (struct dentry *, char *, size_t); 60 ssize_t (*listxattr) (struct dentry *, char *, size_t);
53 int (*removexattr) (struct dentry *, const char *); 61 int (*removexattr) (struct dentry *, const char *);
62 void (*truncate_range)(struct inode *, loff_t, loff_t);
63 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len);
54 64
55locking rules: 65locking rules:
56 all may block, none have BKL 66 all may block
57 i_mutex(inode) 67 i_mutex(inode)
58lookup: yes 68lookup: yes
59create: yes 69create: yes
@@ -66,19 +76,23 @@ rmdir: yes (both) (see below)
66rename: yes (all) (see below) 76rename: yes (all) (see below)
67readlink: no 77readlink: no
68follow_link: no 78follow_link: no
79put_link: no
69truncate: yes (see below) 80truncate: yes (see below)
70setattr: yes 81setattr: yes
71permission: no 82permission: no (may not block if called in rcu-walk mode)
83check_acl: no
72getattr: no 84getattr: no
73setxattr: yes 85setxattr: yes
74getxattr: no 86getxattr: no
75listxattr: no 87listxattr: no
76removexattr: yes 88removexattr: yes
89truncate_range: yes
90fiemap: no
77 Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on 91 Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on
78victim. 92victim.
79 cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem. 93 cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem.
80 ->truncate() is never called directly - it's a callback, not a 94 ->truncate() is never called directly - it's a callback, not a
81method. It's called by vmtruncate() - library function normally used by 95method. It's called by vmtruncate() - deprecated library function used by
82->setattr(). Locking information above applies to that call (i.e. is 96->setattr(). Locking information above applies to that call (i.e. is
83inherited from ->setattr() - vmtruncate() is used when ATTR_SIZE had been 97inherited from ->setattr() - vmtruncate() is used when ATTR_SIZE had been
84passed). 98passed).
@@ -90,8 +104,8 @@ of the locking scheme for directory operations.
90prototypes: 104prototypes:
91 struct inode *(*alloc_inode)(struct super_block *sb); 105 struct inode *(*alloc_inode)(struct super_block *sb);
92 void (*destroy_inode)(struct inode *); 106 void (*destroy_inode)(struct inode *);
93 void (*dirty_inode) (struct inode *); 107 void (*dirty_inode) (struct inode *, int flags);
94 int (*write_inode) (struct inode *, int); 108 int (*write_inode) (struct inode *, struct writeback_control *wbc);
95 int (*drop_inode) (struct inode *); 109 int (*drop_inode) (struct inode *);
96 void (*evict_inode) (struct inode *); 110 void (*evict_inode) (struct inode *);
97 void (*put_super) (struct super_block *); 111 void (*put_super) (struct super_block *);
@@ -105,16 +119,16 @@ prototypes:
105 int (*show_options)(struct seq_file *, struct vfsmount *); 119 int (*show_options)(struct seq_file *, struct vfsmount *);
106 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); 120 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
107 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 121 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
122 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
108 123
109locking rules: 124locking rules:
110 All may block [not true, see below] 125 All may block [not true, see below]
111 None have BKL
112 s_umount 126 s_umount
113alloc_inode: 127alloc_inode:
114destroy_inode: 128destroy_inode:
115dirty_inode: (must not sleep) 129dirty_inode:
116write_inode: 130write_inode:
117drop_inode: !!!inode_lock!!! 131drop_inode: !!!inode->i_lock!!!
118evict_inode: 132evict_inode:
119put_super: write 133put_super: write
120write_super: read 134write_super: read
@@ -127,6 +141,7 @@ umount_begin: no
127show_options: no (namespace_sem) 141show_options: no (namespace_sem)
128quota_read: no (see below) 142quota_read: no (see below)
129quota_write: no (see below) 143quota_write: no (see below)
144bdev_try_to_free_page: no (see below)
130 145
131->statfs() has s_umount (shared) when called by ustat(2) (native or 146->statfs() has s_umount (shared) when called by ustat(2) (native or
132compat), but that's an accident of bad API; s_umount is used to pin 147compat), but that's an accident of bad API; s_umount is used to pin
@@ -139,19 +154,23 @@ be the only ones operating on the quota file by the quota code (via
139dqio_sem) (unless an admin really wants to screw up something and 154dqio_sem) (unless an admin really wants to screw up something and
140writes to quota files with quotas on). For other details about locking 155writes to quota files with quotas on). For other details about locking
141see also dquot_operations section. 156see also dquot_operations section.
157->bdev_try_to_free_page is called from the ->releasepage handler of
158the block device inode. See there for more details.
142 159
143--------------------------- file_system_type --------------------------- 160--------------------------- file_system_type ---------------------------
144prototypes: 161prototypes:
145 int (*get_sb) (struct file_system_type *, int, 162 int (*get_sb) (struct file_system_type *, int,
146 const char *, void *, struct vfsmount *); 163 const char *, void *, struct vfsmount *);
164 struct dentry *(*mount) (struct file_system_type *, int,
165 const char *, void *);
147 void (*kill_sb) (struct super_block *); 166 void (*kill_sb) (struct super_block *);
148locking rules: 167locking rules:
149 may block BKL 168 may block
150get_sb yes no 169mount yes
151kill_sb yes no 170kill_sb yes
152 171
153->get_sb() returns error or 0 with locked superblock attached to the vfsmount 172->mount() returns ERR_PTR or the root dentry; its superblock should be locked
154(exclusive on ->s_umount). 173on return.
155->kill_sb() takes a write-locked superblock, does all shutdown work on it, 174->kill_sb() takes a write-locked superblock, does all shutdown work on it,
156unlocks and drops the reference. 175unlocks and drops the reference.
157 176
@@ -173,28 +192,38 @@ prototypes:
173 sector_t (*bmap)(struct address_space *, sector_t); 192 sector_t (*bmap)(struct address_space *, sector_t);
174 int (*invalidatepage) (struct page *, unsigned long); 193 int (*invalidatepage) (struct page *, unsigned long);
175 int (*releasepage) (struct page *, int); 194 int (*releasepage) (struct page *, int);
195 void (*freepage)(struct page *);
176 int (*direct_IO)(int, struct kiocb *, const struct iovec *iov, 196 int (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
177 loff_t offset, unsigned long nr_segs); 197 loff_t offset, unsigned long nr_segs);
178 int (*launder_page) (struct page *); 198 int (*get_xip_mem)(struct address_space *, pgoff_t, int, void **,
199 unsigned long *);
200 int (*migratepage)(struct address_space *, struct page *, struct page *);
201 int (*launder_page)(struct page *);
202 int (*is_partially_uptodate)(struct page *, read_descriptor_t *, unsigned long);
203 int (*error_remove_page)(struct address_space *, struct page *);
179 204
180locking rules: 205locking rules:
181 All except set_page_dirty may block 206 All except set_page_dirty and freepage may block
182 207
183 BKL PageLocked(page) i_mutex 208 PageLocked(page) i_mutex
184writepage: no yes, unlocks (see below) 209writepage: yes, unlocks (see below)
185readpage: no yes, unlocks 210readpage: yes, unlocks
186sync_page: no maybe 211sync_page: maybe
187writepages: no 212writepages:
188set_page_dirty no no 213set_page_dirty no
189readpages: no 214readpages:
190write_begin: no locks the page yes 215write_begin: locks the page yes
191write_end: no yes, unlocks yes 216write_end: yes, unlocks yes
192perform_write: no n/a yes 217bmap:
193bmap: no 218invalidatepage: yes
194invalidatepage: no yes 219releasepage: yes
195releasepage: no yes 220freepage: yes
196direct_IO: no 221direct_IO:
197launder_page: no yes 222get_xip_mem: maybe
223migratepage: yes (both)
224launder_page: yes
225is_partially_uptodate: yes
226error_remove_page: yes
198 227
199 ->write_begin(), ->write_end(), ->sync_page() and ->readpage() 228 ->write_begin(), ->write_end(), ->sync_page() and ->readpage()
200may be called from the request handler (/dev/loop). 229may be called from the request handler (/dev/loop).
@@ -274,9 +303,8 @@ under spinlock (it cannot block) and is sometimes called with the page
274not locked. 303not locked.
275 304
276 ->bmap() is currently used by legacy ioctl() (FIBMAP) provided by some 305 ->bmap() is currently used by legacy ioctl() (FIBMAP) provided by some
277filesystems and by the swapper. The latter will eventually go away. All 306filesystems and by the swapper. The latter will eventually go away. Please,
278instances do not actually need the BKL. Please, keep it that way and don't 307keep it that way and don't breed new callers.
279breed new callers.
280 308
281 ->invalidatepage() is called when the filesystem must attempt to drop 309 ->invalidatepage() is called when the filesystem must attempt to drop
282some or all of the buffers from the page when it is being truncated. It 310some or all of the buffers from the page when it is being truncated. It
@@ -288,55 +316,44 @@ buffers from the page in preparation for freeing it. It returns zero to
288indicate that the buffers are (or may be) freeable. If ->releasepage is zero, 316indicate that the buffers are (or may be) freeable. If ->releasepage is zero,
289the kernel assumes that the fs has no private interest in the buffers. 317the kernel assumes that the fs has no private interest in the buffers.
290 318
319 ->freepage() is called when the kernel is done dropping the page
320from the page cache.
321
291 ->launder_page() may be called prior to releasing a page if 322 ->launder_page() may be called prior to releasing a page if
292it is still found to be dirty. It returns zero if the page was successfully 323it is still found to be dirty. It returns zero if the page was successfully
293cleaned, or an error value if not. Note that in order to prevent the page 324cleaned, or an error value if not. Note that in order to prevent the page
294getting mapped back in and redirtied, it needs to be kept locked 325getting mapped back in and redirtied, it needs to be kept locked
295across the entire operation. 326across the entire operation.
296 327
297 Note: currently almost all instances of address_space methods are
298using BKL for internal serialization and that's one of the worst sources
299of contention. Normally they are calling library functions (in fs/buffer.c)
300and pass foo_get_block() as a callback (on local block-based filesystems,
301indeed). BKL is not needed for library stuff and is usually taken by
302foo_get_block(). It's an overkill, since block bitmaps can be protected by
303internal fs locking and real critical areas are much smaller than the areas
304filesystems protect now.
305
306----------------------- file_lock_operations ------------------------------ 328----------------------- file_lock_operations ------------------------------
307prototypes: 329prototypes:
308 void (*fl_insert)(struct file_lock *); /* lock insertion callback */
309 void (*fl_remove)(struct file_lock *); /* lock removal callback */
310 void (*fl_copy_lock)(struct file_lock *, struct file_lock *); 330 void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
311 void (*fl_release_private)(struct file_lock *); 331 void (*fl_release_private)(struct file_lock *);
312 332
313 333
314locking rules: 334locking rules:
315 BKL may block 335 file_lock_lock may block
316fl_insert: yes no 336fl_copy_lock: yes no
317fl_remove: yes no 337fl_release_private: maybe no
318fl_copy_lock: yes no
319fl_release_private: yes yes
320 338
321----------------------- lock_manager_operations --------------------------- 339----------------------- lock_manager_operations ---------------------------
322prototypes: 340prototypes:
323 int (*fl_compare_owner)(struct file_lock *, struct file_lock *); 341 int (*fl_compare_owner)(struct file_lock *, struct file_lock *);
324 void (*fl_notify)(struct file_lock *); /* unblock callback */ 342 void (*fl_notify)(struct file_lock *); /* unblock callback */
325 void (*fl_copy_lock)(struct file_lock *, struct file_lock *); 343 int (*fl_grant)(struct file_lock *, struct file_lock *, int);
326 void (*fl_release_private)(struct file_lock *); 344 void (*fl_release_private)(struct file_lock *);
327 void (*fl_break)(struct file_lock *); /* break_lease callback */ 345 void (*fl_break)(struct file_lock *); /* break_lease callback */
346 int (*fl_change)(struct file_lock **, int);
328 347
329locking rules: 348locking rules:
330 BKL may block 349 file_lock_lock may block
331fl_compare_owner: yes no 350fl_compare_owner: yes no
332fl_notify: yes no 351fl_notify: yes no
333fl_copy_lock: yes no 352fl_grant: no no
334fl_release_private: yes yes 353fl_release_private: maybe no
335fl_break: yes no 354fl_break: yes no
336 355fl_change yes no
337 Currently only NFSD and NLM provide instances of this class. None of the 356
338them block. If you have out-of-tree instances - please, show up. Locking
339in that area will change.
340--------------------------- buffer_head ----------------------------------- 357--------------------------- buffer_head -----------------------------------
341prototypes: 358prototypes:
342 void (*b_end_io)(struct buffer_head *bh, int uptodate); 359 void (*b_end_io)(struct buffer_head *bh, int uptodate);
@@ -349,21 +366,36 @@ call this method upon the IO completion.
349 366
350--------------------------- block_device_operations ----------------------- 367--------------------------- block_device_operations -----------------------
351prototypes: 368prototypes:
352 int (*open) (struct inode *, struct file *); 369 int (*open) (struct block_device *, fmode_t);
353 int (*release) (struct inode *, struct file *); 370 int (*release) (struct gendisk *, fmode_t);
354 int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long); 371 int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
372 int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
373 int (*direct_access) (struct block_device *, sector_t, void **, unsigned long *);
355 int (*media_changed) (struct gendisk *); 374 int (*media_changed) (struct gendisk *);
375 void (*unlock_native_capacity) (struct gendisk *);
356 int (*revalidate_disk) (struct gendisk *); 376 int (*revalidate_disk) (struct gendisk *);
377 int (*getgeo)(struct block_device *, struct hd_geometry *);
378 void (*swap_slot_free_notify) (struct block_device *, unsigned long);
357 379
358locking rules: 380locking rules:
359 BKL bd_sem 381 bd_mutex
360open: yes yes 382open: yes
361release: yes yes 383release: yes
362ioctl: yes no 384ioctl: no
363media_changed: no no 385compat_ioctl: no
364revalidate_disk: no no 386direct_access: no
387media_changed: no
388unlock_native_capacity: no
389revalidate_disk: no
390getgeo: no
391swap_slot_free_notify: no (see below)
392
393media_changed, unlock_native_capacity and revalidate_disk are called only from
394check_disk_change().
395
396swap_slot_free_notify is called with swap_lock and sometimes the page lock
397held.
365 398
366The last two are called only from check_disk_change().
367 399
368--------------------------- file_operations ------------------------------- 400--------------------------- file_operations -------------------------------
369prototypes: 401prototypes:
@@ -395,34 +427,22 @@ prototypes:
395 unsigned long (*get_unmapped_area)(struct file *, unsigned long, 427 unsigned long (*get_unmapped_area)(struct file *, unsigned long,
396 unsigned long, unsigned long, unsigned long); 428 unsigned long, unsigned long, unsigned long);
397 int (*check_flags)(int); 429 int (*check_flags)(int);
430 int (*flock) (struct file *, int, struct file_lock *);
431 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *,
432 size_t, unsigned int);
433 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *,
434 size_t, unsigned int);
435 int (*setlease)(struct file *, long, struct file_lock **);
436 long (*fallocate)(struct file *, int, loff_t, loff_t);
398}; 437};
399 438
400locking rules: 439locking rules:
401 All may block. 440 All may block except for ->setlease.
402 BKL 441 No VFS locks held on entry except for ->fsync and ->setlease.
403llseek: no (see below) 442
404read: no 443->fsync() has i_mutex on inode.
405aio_read: no 444
406write: no 445->setlease has the file_list_lock held and must not sleep.
407aio_write: no
408readdir: no
409poll: no
410unlocked_ioctl: no
411compat_ioctl: no
412mmap: no
413open: no
414flush: no
415release: no
416fsync: no (see below)
417aio_fsync: no
418fasync: no
419lock: yes
420readv: no
421writev: no
422sendfile: no
423sendpage: no
424get_unmapped_area: no
425check_flags: no
426 446
427->llseek() locking has moved from llseek to the individual llseek 447->llseek() locking has moved from llseek to the individual llseek
428implementations. If your fs is not using generic_file_llseek, you 448implementations. If your fs is not using generic_file_llseek, you
@@ -432,17 +452,10 @@ mutex or just to use i_size_read() instead.
432Note: this does not protect the file->f_pos against concurrent modifications 452Note: this does not protect the file->f_pos against concurrent modifications
433since this is something the userspace has to take care about. 453since this is something the userspace has to take care about.
434 454
435Note: ext2_release() was *the* source of contention on fs-intensive 455->fasync() is responsible for maintaining the FASYNC bit in filp->f_flags.
436loads and dropping BKL on ->release() helps to get rid of that (we still 456Most instances call fasync_helper(), which does that maintenance, so it's
437grab BKL for cases when we close a file that had been opened r/w, but that 457not normally something one needs to worry about. Return values > 0 will be
438can and should be done using the internal locking with smaller critical areas). 458mapped to zero in the VFS layer.
439Current worst offender is ext2_get_block()...
440
441->fasync() is called without BKL protection, and is responsible for
442maintaining the FASYNC bit in filp->f_flags. Most instances call
443fasync_helper(), which does that maintenance, so it's not normally
444something one needs to worry about. Return values > 0 will be mapped to
445zero in the VFS layer.
446 459
447->readdir() and ->ioctl() on directories must be changed. Ideally we would 460->readdir() and ->ioctl() on directories must be changed. Ideally we would
448move ->readdir() to inode_operations and use a separate method for directory 461move ->readdir() to inode_operations and use a separate method for directory
@@ -453,8 +466,6 @@ components. And there are other reasons why the current interface is a mess...
453->read on directories probably must go away - we should just enforce -EISDIR 466->read on directories probably must go away - we should just enforce -EISDIR
454in sys_read() and friends. 467in sys_read() and friends.
455 468
456->fsync() has i_mutex on inode.
457
458--------------------------- dquot_operations ------------------------------- 469--------------------------- dquot_operations -------------------------------
459prototypes: 470prototypes:
460 int (*write_dquot) (struct dquot *); 471 int (*write_dquot) (struct dquot *);
@@ -489,12 +500,12 @@ prototypes:
489 int (*access)(struct vm_area_struct *, unsigned long, void*, int, int); 500 int (*access)(struct vm_area_struct *, unsigned long, void*, int, int);
490 501
491locking rules: 502locking rules:
492 BKL mmap_sem PageLocked(page) 503 mmap_sem PageLocked(page)
493open: no yes 504open: yes
494close: no yes 505close: yes
495fault: no yes can return with page locked 506fault: yes can return with page locked
496page_mkwrite: no yes can return with page locked 507page_mkwrite: yes can return with page locked
497access: no yes 508access: yes
498 509
499 ->fault() is called when a previously not present pte is about 510 ->fault() is called when a previously not present pte is about
500to be faulted in. The filesystem must find and return the page associated 511to be faulted in. The filesystem must find and return the page associated
@@ -521,6 +532,3 @@ VM_IO | VM_PFNMAP VMAs.
521 532
522(if you break something or notice that it is broken and do not fix it yourself 533(if you break something or notice that it is broken and do not fix it yourself
523- at least put it here) 534- at least put it here)
524
525ipc/shm.c::shm_delete() - may need BKL.
526->read() and ->write() in many drivers are (probably) missing BKL.
diff --git a/Documentation/filesystems/adfs.txt b/Documentation/filesystems/adfs.txt
index 9e8811f92b84..5949766353f7 100644
--- a/Documentation/filesystems/adfs.txt
+++ b/Documentation/filesystems/adfs.txt
@@ -9,6 +9,9 @@ Mount options for ADFS
9 will be nnn. Default 0700. 9 will be nnn. Default 0700.
10 othmask=nnn The permission mask for ADFS 'other' permissions 10 othmask=nnn The permission mask for ADFS 'other' permissions
11 will be nnn. Default 0077. 11 will be nnn. Default 0077.
12 ftsuffix=n When ftsuffix=0, no file type suffix will be applied.
13 When ftsuffix=1, a hexadecimal suffix corresponding to
14 the RISC OS file type will be added. Default 0.
12 15
13Mapping of ADFS permissions to Linux permissions 16Mapping of ADFS permissions to Linux permissions
14------------------------------------------------ 17------------------------------------------------
@@ -55,3 +58,18 @@ Mapping of ADFS permissions to Linux permissions
55 58
56 You can therefore tailor the permission translation to whatever you 59 You can therefore tailor the permission translation to whatever you
57 desire the permissions should be under Linux. 60 desire the permissions should be under Linux.
61
62RISC OS file type suffix
63------------------------
64
65 RISC OS file types are stored in bits 19..8 of the file load address.
66
67 To enable non-RISC OS systems to be used to store files without losing
68 file type information, a file naming convention was devised (initially
69 for use with NFS) such that a hexadecimal suffix of the form ,xyz
70 denoted the file type: e.g. BasicFile,ffb is a BASIC (0xffb) file. This
71 naming convention is now also used by RISC OS emulators such as RPCEmu.
72
73 Mounting an ADFS disc with option ftsuffix=1 will cause appropriate file
74 type suffixes to be appended to file names read from a directory. If the
75 ftsuffix option is zero or omitted, no file type suffixes will be added.
diff --git a/Documentation/filesystems/autofs4-mount-control.txt b/Documentation/filesystems/autofs4-mount-control.txt
index 51986bf08a4d..4c95935cbcf4 100644
--- a/Documentation/filesystems/autofs4-mount-control.txt
+++ b/Documentation/filesystems/autofs4-mount-control.txt
@@ -309,7 +309,7 @@ ioctlfd field set to the descriptor obtained from the open call.
309AUTOFS_DEV_IOCTL_TIMEOUT_CMD 309AUTOFS_DEV_IOCTL_TIMEOUT_CMD
310---------------------------- 310----------------------------
311 311
312Set the expire timeout for mounts withing an autofs mount point. 312Set the expire timeout for mounts within an autofs mount point.
313 313
314The call requires an initialized struct autofs_dev_ioctl with the 314The call requires an initialized struct autofs_dev_ioctl with the
315ioctlfd field set to the descriptor obtained from the open call. 315ioctlfd field set to the descriptor obtained from the open call.
diff --git a/Documentation/filesystems/caching/netfs-api.txt b/Documentation/filesystems/caching/netfs-api.txt
index 1902c57b72ef..7cc6bf2871eb 100644
--- a/Documentation/filesystems/caching/netfs-api.txt
+++ b/Documentation/filesystems/caching/netfs-api.txt
@@ -95,7 +95,7 @@ restraints as possible on how an index is structured and where it is placed in
95the tree. The netfs can even mix indices and data files at the same level, but 95the tree. The netfs can even mix indices and data files at the same level, but
96it's not recommended. 96it's not recommended.
97 97
98Each index entry consists of a key of indeterminate length plus some auxilliary 98Each index entry consists of a key of indeterminate length plus some auxiliary
99data, also of indeterminate length. 99data, also of indeterminate length.
100 100
101There are some limits on indices: 101There are some limits on indices:
@@ -203,23 +203,23 @@ This has the following fields:
203 203
204 If the function is absent, a file size of 0 is assumed. 204 If the function is absent, a file size of 0 is assumed.
205 205
206 (6) A function to retrieve auxilliary data from the netfs [optional]. 206 (6) A function to retrieve auxiliary data from the netfs [optional].
207 207
208 This function will be called with the netfs data that was passed to the 208 This function will be called with the netfs data that was passed to the
209 cookie acquisition function and the maximum length of auxilliary data that 209 cookie acquisition function and the maximum length of auxiliary data that
210 it may provide. It should write the auxilliary data into the given buffer 210 it may provide. It should write the auxiliary data into the given buffer
211 and return the quantity it wrote. 211 and return the quantity it wrote.
212 212
213 If this function is absent, the auxilliary data length will be set to 0. 213 If this function is absent, the auxiliary data length will be set to 0.
214 214
215 The length of the auxilliary data buffer may be dependent on the key 215 The length of the auxiliary data buffer may be dependent on the key
216 length. A netfs mustn't rely on being able to provide more than 400 bytes 216 length. A netfs mustn't rely on being able to provide more than 400 bytes
217 for both. 217 for both.
218 218
219 (7) A function to check the auxilliary data [optional]. 219 (7) A function to check the auxiliary data [optional].
220 220
221 This function will be called to check that a match found in the cache for 221 This function will be called to check that a match found in the cache for
222 this object is valid. For instance with AFS it could check the auxilliary 222 this object is valid. For instance with AFS it could check the auxiliary
223 data against the data version number returned by the server to determine 223 data against the data version number returned by the server to determine
224 whether the index entry in a cache is still valid. 224 whether the index entry in a cache is still valid.
225 225
@@ -232,7 +232,7 @@ This has the following fields:
232 (*) FSCACHE_CHECKAUX_NEEDS_UPDATE - the entry requires update 232 (*) FSCACHE_CHECKAUX_NEEDS_UPDATE - the entry requires update
233 (*) FSCACHE_CHECKAUX_OBSOLETE - the entry should be deleted 233 (*) FSCACHE_CHECKAUX_OBSOLETE - the entry should be deleted
234 234
235 This function can also be used to extract data from the auxilliary data in 235 This function can also be used to extract data from the auxiliary data in
236 the cache and copy it into the netfs's structures. 236 the cache and copy it into the netfs's structures.
237 237
238 (8) A pair of functions to manage contexts for the completion callback 238 (8) A pair of functions to manage contexts for the completion callback
@@ -673,6 +673,22 @@ storage request to complete, or it may attempt to cancel the storage request -
673in which case the page will not be stored in the cache this time. 673in which case the page will not be stored in the cache this time.
674 674
675 675
676BULK INODE PAGE UNCACHE
677-----------------------
678
679A convenience routine is provided to perform an uncache on all the pages
680attached to an inode. This assumes that the pages on the inode correspond on a
6811:1 basis with the pages in the cache.
682
683 void fscache_uncache_all_inode_pages(struct fscache_cookie *cookie,
684 struct inode *inode);
685
686This takes the netfs cookie that the pages were cached with and the inode that
687the pages are attached to. This function will wait for pages to finish being
688written to the cache and for the cache to finish with the page generally. No
689error is returned.
690
691
676========================== 692==========================
677INDEX AND DATA FILE UPDATE 693INDEX AND DATA FILE UPDATE
678========================== 694==========================
diff --git a/Documentation/filesystems/configfs/configfs.txt b/Documentation/filesystems/configfs/configfs.txt
index fabcb0e00f25..dd57bb6bb390 100644
--- a/Documentation/filesystems/configfs/configfs.txt
+++ b/Documentation/filesystems/configfs/configfs.txt
@@ -409,7 +409,7 @@ As a consequence of this, default_groups cannot be removed directly via
409rmdir(2). They also are not considered when rmdir(2) on the parent 409rmdir(2). They also are not considered when rmdir(2) on the parent
410group is checking for children. 410group is checking for children.
411 411
412[Dependant Subsystems] 412[Dependent Subsystems]
413 413
414Sometimes other drivers depend on particular configfs items. For 414Sometimes other drivers depend on particular configfs items. For
415example, ocfs2 mounts depend on a heartbeat region item. If that 415example, ocfs2 mounts depend on a heartbeat region item. If that
diff --git a/Documentation/filesystems/configfs/configfs_example_explicit.c b/Documentation/filesystems/configfs/configfs_example_explicit.c
index d428cc9f07f3..1420233dfa55 100644
--- a/Documentation/filesystems/configfs/configfs_example_explicit.c
+++ b/Documentation/filesystems/configfs/configfs_example_explicit.c
@@ -89,7 +89,7 @@ static ssize_t childless_storeme_write(struct childless *childless,
89 char *p = (char *) page; 89 char *p = (char *) page;
90 90
91 tmp = simple_strtoul(p, &p, 10); 91 tmp = simple_strtoul(p, &p, 10);
92 if (!p || (*p && (*p != '\n'))) 92 if ((*p != '\0') && (*p != '\n'))
93 return -EINVAL; 93 return -EINVAL;
94 94
95 if (tmp > INT_MAX) 95 if (tmp > INT_MAX)
@@ -464,9 +464,8 @@ static int __init configfs_example_init(void)
464 return 0; 464 return 0;
465 465
466out_unregister: 466out_unregister:
467 for (; i >= 0; i--) { 467 for (i--; i >= 0; i--)
468 configfs_unregister_subsystem(example_subsys[i]); 468 configfs_unregister_subsystem(example_subsys[i]);
469 }
470 469
471 return ret; 470 return ret;
472} 471}
@@ -475,9 +474,8 @@ static void __exit configfs_example_exit(void)
475{ 474{
476 int i; 475 int i;
477 476
478 for (i = 0; example_subsys[i]; i++) { 477 for (i = 0; example_subsys[i]; i++)
479 configfs_unregister_subsystem(example_subsys[i]); 478 configfs_unregister_subsystem(example_subsys[i]);
480 }
481} 479}
482 480
483module_init(configfs_example_init); 481module_init(configfs_example_init);
diff --git a/Documentation/filesystems/configfs/configfs_example_macros.c b/Documentation/filesystems/configfs/configfs_example_macros.c
index d8e30a0378aa..327dfbc640a9 100644
--- a/Documentation/filesystems/configfs/configfs_example_macros.c
+++ b/Documentation/filesystems/configfs/configfs_example_macros.c
@@ -427,9 +427,8 @@ static int __init configfs_example_init(void)
427 return 0; 427 return 0;
428 428
429out_unregister: 429out_unregister:
430 for (; i >= 0; i--) { 430 for (i--; i >= 0; i--)
431 configfs_unregister_subsystem(example_subsys[i]); 431 configfs_unregister_subsystem(example_subsys[i]);
432 }
433 432
434 return ret; 433 return ret;
435} 434}
@@ -438,9 +437,8 @@ static void __exit configfs_example_exit(void)
438{ 437{
439 int i; 438 int i;
440 439
441 for (i = 0; example_subsys[i]; i++) { 440 for (i = 0; example_subsys[i]; i++)
442 configfs_unregister_subsystem(example_subsys[i]); 441 configfs_unregister_subsystem(example_subsys[i]);
443 }
444} 442}
445 443
446module_init(configfs_example_init); 444module_init(configfs_example_init);
diff --git a/Documentation/filesystems/dentry-locking.txt b/Documentation/filesystems/dentry-locking.txt
deleted file mode 100644
index 79334ed5daa7..000000000000
--- a/Documentation/filesystems/dentry-locking.txt
+++ /dev/null
@@ -1,174 +0,0 @@
1RCU-based dcache locking model
2==============================
3
4On many workloads, the most common operation on dcache is to look up a
5dentry, given a parent dentry and the name of the child. Typically,
6for every open(), stat() etc., the dentry corresponding to the
7pathname will be looked up by walking the tree starting with the first
8component of the pathname and using that dentry along with the next
9component to look up the next level and so on. Since it is a frequent
10operation for workloads like multiuser environments and web servers,
11it is important to optimize this path.
12
13Prior to 2.5.10, dcache_lock was acquired in d_lookup and thus in
14every component during path look-up. Since 2.5.10 onwards, fast-walk
15algorithm changed this by holding the dcache_lock at the beginning and
16walking as many cached path component dentries as possible. This
17significantly decreases the number of acquisition of
18dcache_lock. However it also increases the lock hold time
19significantly and affects performance in large SMP machines. Since
202.5.62 kernel, dcache has been using a new locking model that uses RCU
21to make dcache look-up lock-free.
22
23The current dcache locking model is not very different from the
24existing dcache locking model. Prior to 2.5.62 kernel, dcache_lock
25protected the hash chain, d_child, d_alias, d_lru lists as well as
26d_inode and several other things like mount look-up. RCU-based changes
27affect only the way the hash chain is protected. For everything else
28the dcache_lock must be taken for both traversing as well as
29updating. The hash chain updates too take the dcache_lock. The
30significant change is the way d_lookup traverses the hash chain, it
31doesn't acquire the dcache_lock for this and rely on RCU to ensure
32that the dentry has not been *freed*.
33
34
35Dcache locking details
36======================
37
38For many multi-user workloads, open() and stat() on files are very
39frequently occurring operations. Both involve walking of path names to
40find the dentry corresponding to the concerned file. In 2.4 kernel,
41dcache_lock was held during look-up of each path component. Contention
42and cache-line bouncing of this global lock caused significant
43scalability problems. With the introduction of RCU in Linux kernel,
44this was worked around by making the look-up of path components during
45path walking lock-free.
46
47
48Safe lock-free look-up of dcache hash table
49===========================================
50
51Dcache is a complex data structure with the hash table entries also
52linked together in other lists. In 2.4 kernel, dcache_lock protected
53all the lists. We applied RCU only on hash chain walking. The rest of
54the lists are still protected by dcache_lock. Some of the important
55changes are :
56
571. The deletion from hash chain is done using hlist_del_rcu() macro
58 which doesn't initialize next pointer of the deleted dentry and
59 this allows us to walk safely lock-free while a deletion is
60 happening.
61
622. Insertion of a dentry into the hash table is done using
63 hlist_add_head_rcu() which take care of ordering the writes - the
64 writes to the dentry must be visible before the dentry is
65 inserted. This works in conjunction with hlist_for_each_rcu(),
66 which has since been replaced by hlist_for_each_entry_rcu(), while
67 walking the hash chain. The only requirement is that all
68 initialization to the dentry must be done before
69 hlist_add_head_rcu() since we don't have dcache_lock protection
70 while traversing the hash chain. This isn't different from the
71 existing code.
72
733. The dentry looked up without holding dcache_lock by cannot be
74 returned for walking if it is unhashed. It then may have a NULL
75 d_inode or other bogosity since RCU doesn't protect the other
76 fields in the dentry. We therefore use a flag DCACHE_UNHASHED to
77 indicate unhashed dentries and use this in conjunction with a
78 per-dentry lock (d_lock). Once looked up without the dcache_lock,
79 we acquire the per-dentry lock (d_lock) and check if the dentry is
80 unhashed. If so, the look-up is failed. If not, the reference count
81 of the dentry is increased and the dentry is returned.
82
834. Once a dentry is looked up, it must be ensured during the path walk
84 for that component it doesn't go away. In pre-2.5.10 code, this was
85 done holding a reference to the dentry. dcache_rcu does the same.
86 In some sense, dcache_rcu path walking looks like the pre-2.5.10
87 version.
88
895. All dentry hash chain updates must take the dcache_lock as well as
90 the per-dentry lock in that order. dput() does this to ensure that
91 a dentry that has just been looked up in another CPU doesn't get
92 deleted before dget() can be done on it.
93
946. There are several ways to do reference counting of RCU protected
95 objects. One such example is in ipv4 route cache where deferred
96 freeing (using call_rcu()) is done as soon as the reference count
97 goes to zero. This cannot be done in the case of dentries because
98 tearing down of dentries require blocking (dentry_iput()) which
99 isn't supported from RCU callbacks. Instead, tearing down of
100 dentries happen synchronously in dput(), but actual freeing happens
101 later when RCU grace period is over. This allows safe lock-free
102 walking of the hash chains, but a matched dentry may have been
103 partially torn down. The checking of DCACHE_UNHASHED flag with
104 d_lock held detects such dentries and prevents them from being
105 returned from look-up.
106
107
108Maintaining POSIX rename semantics
109==================================
110
111Since look-up of dentries is lock-free, it can race against a
112concurrent rename operation. For example, during rename of file A to
113B, look-up of either A or B must succeed. So, if look-up of B happens
114after A has been removed from the hash chain but not added to the new
115hash chain, it may fail. Also, a comparison while the name is being
116written concurrently by a rename may result in false positive matches
117violating rename semantics. Issues related to race with rename are
118handled as described below :
119
1201. Look-up can be done in two ways - d_lookup() which is safe from
121 simultaneous renames and __d_lookup() which is not. If
122 __d_lookup() fails, it must be followed up by a d_lookup() to
123 correctly determine whether a dentry is in the hash table or
124 not. d_lookup() protects look-ups using a sequence lock
125 (rename_lock).
126
1272. The name associated with a dentry (d_name) may be changed if a
128 rename is allowed to happen simultaneously. To avoid memcmp() in
129 __d_lookup() go out of bounds due to a rename and false positive
130 comparison, the name comparison is done while holding the
131 per-dentry lock. This prevents concurrent renames during this
132 operation.
133
1343. Hash table walking during look-up may move to a different bucket as
135 the current dentry is moved to a different bucket due to rename.
136 But we use hlists in dcache hash table and they are
137 null-terminated. So, even if a dentry moves to a different bucket,
138 hash chain walk will terminate. [with a list_head list, it may not
139 since termination is when the list_head in the original bucket is
140 reached]. Since we redo the d_parent check and compare name while
141 holding d_lock, lock-free look-up will not race against d_move().
142
1434. There can be a theoretical race when a dentry keeps coming back to
144 original bucket due to double moves. Due to this look-up may
145 consider that it has never moved and can end up in a infinite loop.
146 But this is not any worse that theoretical livelocks we already
147 have in the kernel.
148
149
150Important guidelines for filesystem developers related to dcache_rcu
151====================================================================
152
1531. Existing dcache interfaces (pre-2.5.62) exported to filesystem
154 don't change. Only dcache internal implementation changes. However
155 filesystems *must not* delete from the dentry hash chains directly
156 using the list macros like allowed earlier. They must use dcache
157 APIs like d_drop() or __d_drop() depending on the situation.
158
1592. d_flags is now protected by a per-dentry lock (d_lock). All access
160 to d_flags must be protected by it.
161
1623. For a hashed dentry, checking of d_count needs to be protected by
163 d_lock.
164
165
166Papers and other documentation on dcache locking
167================================================
168
1691. Scaling dcache with RCU (http://linuxjournal.com/article.php?sid=7124).
170
1712. http://lse.sourceforge.net/locking/dcache/dcache.html
172
173
174
diff --git a/Documentation/filesystems/exofs.txt b/Documentation/filesystems/exofs.txt
index abd2a9b5b787..23583a136975 100644
--- a/Documentation/filesystems/exofs.txt
+++ b/Documentation/filesystems/exofs.txt
@@ -104,7 +104,15 @@ Where:
104 exofs specific options: Options are separated by commas (,) 104 exofs specific options: Options are separated by commas (,)
105 pid=<integer> - The partition number to mount/create as 105 pid=<integer> - The partition number to mount/create as
106 container of the filesystem. 106 container of the filesystem.
107 This option is mandatory. 107 This option is mandatory. integer can be
108 Hex by pre-pending an 0x to the number.
109 osdname=<id> - Mount by a device's osdname.
110 osdname is usually a 36 character uuid of the
111 form "d2683732-c906-4ee1-9dbd-c10c27bb40df".
112 It is one of the device's uuid specified in the
113 mkfs.exofs format command.
114 If this option is specified then the /dev/osdX
115 above can be empty and is ignored.
108 to=<integer> - Timeout in ticks for a single command. 116 to=<integer> - Timeout in ticks for a single command.
109 default is (60 * HZ) [for debugging only] 117 default is (60 * HZ) [for debugging only]
110 118
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt
index e1def1786e50..3ae9bc94352a 100644
--- a/Documentation/filesystems/ext4.txt
+++ b/Documentation/filesystems/ext4.txt
@@ -97,7 +97,7 @@ Note: More extensive information for getting started with ext4 can be
97* Inode allocation using large virtual block groups via flex_bg 97* Inode allocation using large virtual block groups via flex_bg
98* delayed allocation 98* delayed allocation
99* large block (up to pagesize) support 99* large block (up to pagesize) support
100* efficent new ordered mode in JBD2 and ext4(avoid using buffer head to force 100* efficient new ordered mode in JBD2 and ext4(avoid using buffer head to force
101 the ordering) 101 the ordering)
102 102
103[1] Filesystems with a block size of 1k may see a limit imposed by the 103[1] Filesystems with a block size of 1k may see a limit imposed by the
@@ -106,7 +106,7 @@ directory hash tree having a maximum depth of two.
1062.2 Candidate features for future inclusion 1062.2 Candidate features for future inclusion
107 107
108* Online defrag (patches available but not well tested) 108* Online defrag (patches available but not well tested)
109* reduced mke2fs time via lazy itable initialization in conjuction with 109* reduced mke2fs time via lazy itable initialization in conjunction with
110 the uninit_bg feature (capability to do this is available in e2fsprogs 110 the uninit_bg feature (capability to do this is available in e2fsprogs
111 but a kernel thread to do lazy zeroing of unused inode table blocks 111 but a kernel thread to do lazy zeroing of unused inode table blocks
112 after filesystem is first mounted is required for safety) 112 after filesystem is first mounted is required for safety)
@@ -226,10 +226,6 @@ acl Enables POSIX Access Control Lists support.
226noacl This option disables POSIX Access Control List 226noacl This option disables POSIX Access Control List
227 support. 227 support.
228 228
229reservation
230
231noreservation
232
233bsddf (*) Make 'df' act like BSD. 229bsddf (*) Make 'df' act like BSD.
234minixdf Make 'df' act like Minix. 230minixdf Make 'df' act like Minix.
235 231
@@ -353,12 +349,61 @@ noauto_da_alloc replacing existing files via patterns such as
353 system crashes before the delayed allocation 349 system crashes before the delayed allocation
354 blocks are forced to disk. 350 blocks are forced to disk.
355 351
356discard Controls whether ext4 should issue discard/TRIM 352noinit_itable Do not initialize any uninitialized inode table
353 blocks in the background. This feature may be
354 used by installation CD's so that the install
355 process can complete as quickly as possible; the
356 inode table initialization process would then be
357 deferred until the next time the file system
358 is unmounted.
359
360init_itable=n The lazy itable init code will wait n times the
361 number of milliseconds it took to zero out the
362 previous block group's inode table. This
363 minimizes the impact on the systme performance
364 while file system's inode table is being initialized.
365
366discard Controls whether ext4 should issue discard/TRIM
357nodiscard(*) commands to the underlying block device when 367nodiscard(*) commands to the underlying block device when
358 blocks are freed. This is useful for SSD devices 368 blocks are freed. This is useful for SSD devices
359 and sparse/thinly-provisioned LUNs, but it is off 369 and sparse/thinly-provisioned LUNs, but it is off
360 by default until sufficient testing has been done. 370 by default until sufficient testing has been done.
361 371
372nouid32 Disables 32-bit UIDs and GIDs. This is for
373 interoperability with older kernels which only
374 store and expect 16-bit values.
375
376resize Allows to resize filesystem to the end of the last
377 existing block group, further resize has to be done
378 with resize2fs either online, or offline. It can be
379 used only with conjunction with remount.
380
381block_validity This options allows to enables/disables the in-kernel
382noblock_validity facility for tracking filesystem metadata blocks
383 within internal data structures. This allows multi-
384 block allocator and other routines to quickly locate
385 extents which might overlap with filesystem metadata
386 blocks. This option is intended for debugging
387 purposes and since it negatively affects the
388 performance, it is off by default.
389
390dioread_lock Controls whether or not ext4 should use the DIO read
391dioread_nolock locking. If the dioread_nolock option is specified
392 ext4 will allocate uninitialized extent before buffer
393 write and convert the extent to initialized after IO
394 completes. This approach allows ext4 code to avoid
395 using inode mutex, which improves scalability on high
396 speed storages. However this does not work with nobh
397 option and the mount will fail. Nor does it work with
398 data journaling and dioread_nolock option will be
399 ignored with kernel warning. Note that dioread_nolock
400 code path is only used for extent-based files.
401 Because of the restrictions this options comprises
402 it is off by default (e.g. dioread_lock).
403
404i_version Enable 64-bit inode version support. This option is
405 off by default.
406
362Data Mode 407Data Mode
363========= 408=========
364There are 3 different data modes: 409There are 3 different data modes:
@@ -386,6 +431,176 @@ needs to be read from and written to disk at the same time where it
386outperforms all others modes. Currently ext4 does not have delayed 431outperforms all others modes. Currently ext4 does not have delayed
387allocation support if this data journalling mode is selected. 432allocation support if this data journalling mode is selected.
388 433
434/proc entries
435=============
436
437Information about mounted ext4 file systems can be found in
438/proc/fs/ext4. Each mounted filesystem will have a directory in
439/proc/fs/ext4 based on its device name (i.e., /proc/fs/ext4/hdc or
440/proc/fs/ext4/dm-0). The files in each per-device directory are shown
441in table below.
442
443Files in /proc/fs/ext4/<devname>
444..............................................................................
445 File Content
446 mb_groups details of multiblock allocator buddy cache of free blocks
447..............................................................................
448
449/sys entries
450============
451
452Information about mounted ext4 file systems can be found in
453/sys/fs/ext4. Each mounted filesystem will have a directory in
454/sys/fs/ext4 based on its device name (i.e., /sys/fs/ext4/hdc or
455/sys/fs/ext4/dm-0). The files in each per-device directory are shown
456in table below.
457
458Files in /sys/fs/ext4/<devname>
459(see also Documentation/ABI/testing/sysfs-fs-ext4)
460..............................................................................
461 File Content
462
463 delayed_allocation_blocks This file is read-only and shows the number of
464 blocks that are dirty in the page cache, but
465 which do not have their location in the
466 filesystem allocated yet.
467
468 inode_goal Tuning parameter which (if non-zero) controls
469 the goal inode used by the inode allocator in
470 preference to all other allocation heuristics.
471 This is intended for debugging use only, and
472 should be 0 on production systems.
473
474 inode_readahead_blks Tuning parameter which controls the maximum
475 number of inode table blocks that ext4's inode
476 table readahead algorithm will pre-read into
477 the buffer cache
478
479 lifetime_write_kbytes This file is read-only and shows the number of
480 kilobytes of data that have been written to this
481 filesystem since it was created.
482
483 max_writeback_mb_bump The maximum number of megabytes the writeback
484 code will try to write out before move on to
485 another inode.
486
487 mb_group_prealloc The multiblock allocator will round up allocation
488 requests to a multiple of this tuning parameter if
489 the stripe size is not set in the ext4 superblock
490
491 mb_max_to_scan The maximum number of extents the multiblock
492 allocator will search to find the best extent
493
494 mb_min_to_scan The minimum number of extents the multiblock
495 allocator will search to find the best extent
496
497 mb_order2_req Tuning parameter which controls the minimum size
498 for requests (as a power of 2) where the buddy
499 cache is used
500
501 mb_stats Controls whether the multiblock allocator should
502 collect statistics, which are shown during the
503 unmount. 1 means to collect statistics, 0 means
504 not to collect statistics
505
506 mb_stream_req Files which have fewer blocks than this tunable
507 parameter will have their blocks allocated out
508 of a block group specific preallocation pool, so
509 that small files are packed closely together.
510 Each large file will have its blocks allocated
511 out of its own unique preallocation pool.
512
513 session_write_kbytes This file is read-only and shows the number of
514 kilobytes of data that have been written to this
515 filesystem since it was mounted.
516..............................................................................
517
518Ioctls
519======
520
521There is some Ext4 specific functionality which can be accessed by applications
522through the system call interfaces. The list of all Ext4 specific ioctls are
523shown in the table below.
524
525Table of Ext4 specific ioctls
526..............................................................................
527 Ioctl Description
528 EXT4_IOC_GETFLAGS Get additional attributes associated with inode.
529 The ioctl argument is an integer bitfield, with
530 bit values described in ext4.h. This ioctl is an
531 alias for FS_IOC_GETFLAGS.
532
533 EXT4_IOC_SETFLAGS Set additional attributes associated with inode.
534 The ioctl argument is an integer bitfield, with
535 bit values described in ext4.h. This ioctl is an
536 alias for FS_IOC_SETFLAGS.
537
538 EXT4_IOC_GETVERSION
539 EXT4_IOC_GETVERSION_OLD
540 Get the inode i_generation number stored for
541 each inode. The i_generation number is normally
542 changed only when new inode is created and it is
543 particularly useful for network filesystems. The
544 '_OLD' version of this ioctl is an alias for
545 FS_IOC_GETVERSION.
546
547 EXT4_IOC_SETVERSION
548 EXT4_IOC_SETVERSION_OLD
549 Set the inode i_generation number stored for
550 each inode. The '_OLD' version of this ioctl
551 is an alias for FS_IOC_SETVERSION.
552
553 EXT4_IOC_GROUP_EXTEND This ioctl has the same purpose as the resize
554 mount option. It allows to resize filesystem
555 to the end of the last existing block group,
556 further resize has to be done with resize2fs,
557 either online, or offline. The argument points
558 to the unsigned logn number representing the
559 filesystem new block count.
560
561 EXT4_IOC_MOVE_EXT Move the block extents from orig_fd (the one
562 this ioctl is pointing to) to the donor_fd (the
563 one specified in move_extent structure passed
564 as an argument to this ioctl). Then, exchange
565 inode metadata between orig_fd and donor_fd.
566 This is especially useful for online
567 defragmentation, because the allocator has the
568 opportunity to allocate moved blocks better,
569 ideally into one contiguous extent.
570
571 EXT4_IOC_GROUP_ADD Add a new group descriptor to an existing or
572 new group descriptor block. The new group
573 descriptor is described by ext4_new_group_input
574 structure, which is passed as an argument to
575 this ioctl. This is especially useful in
576 conjunction with EXT4_IOC_GROUP_EXTEND,
577 which allows online resize of the filesystem
578 to the end of the last existing block group.
579 Those two ioctls combined is used in userspace
580 online resize tool (e.g. resize2fs).
581
582 EXT4_IOC_MIGRATE This ioctl operates on the filesystem itself.
583 It converts (migrates) ext3 indirect block mapped
584 inode to ext4 extent mapped inode by walking
585 through indirect block mapping of the original
586 inode and converting contiguous block ranges
587 into ext4 extents of the temporary inode. Then,
588 inodes are swapped. This ioctl might help, when
589 migrating from ext3 to ext4 filesystem, however
590 suggestion is to create fresh ext4 filesystem
591 and copy data from the backup. Note, that
592 filesystem has to support extents for this ioctl
593 to work.
594
595 EXT4_IOC_ALLOC_DA_BLKS Force all of the delay allocated blocks to be
596 allocated to preserve application-expected ext3
597 behaviour. Note that this will also start
598 triggering a write of the data blocks, but this
599 behaviour may change in the future as it is
600 not necessary and has been done this way only
601 for sake of simplicity.
602..............................................................................
603
389References 604References
390========== 605==========
391 606
diff --git a/Documentation/filesystems/gfs2-uevents.txt b/Documentation/filesystems/gfs2-uevents.txt
index fd966dc9979a..d81889669293 100644
--- a/Documentation/filesystems/gfs2-uevents.txt
+++ b/Documentation/filesystems/gfs2-uevents.txt
@@ -62,7 +62,7 @@ be fixed.
62 62
63The REMOVE uevent is generated at the end of an unsuccessful mount 63The REMOVE uevent is generated at the end of an unsuccessful mount
64or at the end of a umount of the filesystem. All REMOVE uevents will 64or at the end of a umount of the filesystem. All REMOVE uevents will
65have been preceeded by at least an ADD uevent for the same fileystem, 65have been preceded by at least an ADD uevent for the same fileystem,
66and unlike the other uevents is generated automatically by the kernel's 66and unlike the other uevents is generated automatically by the kernel's
67kobject subsystem. 67kobject subsystem.
68 68
diff --git a/Documentation/filesystems/gfs2.txt b/Documentation/filesystems/gfs2.txt
index 0b59c0200912..4cda926628aa 100644
--- a/Documentation/filesystems/gfs2.txt
+++ b/Documentation/filesystems/gfs2.txt
@@ -11,7 +11,7 @@ their I/O so file system consistency is maintained. One of the nifty
11features of GFS is perfect consistency -- changes made to the file system 11features of GFS is perfect consistency -- changes made to the file system
12on one machine show up immediately on all other machines in the cluster. 12on one machine show up immediately on all other machines in the cluster.
13 13
14GFS uses interchangable inter-node locking mechanisms, the currently 14GFS uses interchangeable inter-node locking mechanisms, the currently
15supported mechanisms are: 15supported mechanisms are:
16 16
17 lock_nolock -- allows gfs to be used as a local file system 17 lock_nolock -- allows gfs to be used as a local file system
diff --git a/Documentation/filesystems/nfs/00-INDEX b/Documentation/filesystems/nfs/00-INDEX
index 2f68cd688769..a57e12411d2a 100644
--- a/Documentation/filesystems/nfs/00-INDEX
+++ b/Documentation/filesystems/nfs/00-INDEX
@@ -12,5 +12,9 @@ nfs-rdma.txt
12 - how to install and setup the Linux NFS/RDMA client and server software 12 - how to install and setup the Linux NFS/RDMA client and server software
13nfsroot.txt 13nfsroot.txt
14 - short guide on setting up a diskless box with NFS root filesystem. 14 - short guide on setting up a diskless box with NFS root filesystem.
15pnfs.txt
16 - short explanation of some of the internals of the pnfs client code
15rpc-cache.txt 17rpc-cache.txt
16 - introduction to the caching mechanisms in the sunrpc layer. 18 - introduction to the caching mechanisms in the sunrpc layer.
19idmapper.txt
20 - information for configuring request-keys to be used by idmapper
diff --git a/Documentation/filesystems/nfs/idmapper.txt b/Documentation/filesystems/nfs/idmapper.txt
new file mode 100644
index 000000000000..9c8fd6148656
--- /dev/null
+++ b/Documentation/filesystems/nfs/idmapper.txt
@@ -0,0 +1,67 @@
1
2=========
3ID Mapper
4=========
5Id mapper is used by NFS to translate user and group ids into names, and to
6translate user and group names into ids. Part of this translation involves
7performing an upcall to userspace to request the information. Id mapper will
8user request-key to perform this upcall and cache the result. The program
9/usr/sbin/nfs.idmap should be called by request-key, and will perform the
10translation and initialize a key with the resulting information.
11
12 NFS_USE_NEW_IDMAPPER must be selected when configuring the kernel to use this
13 feature.
14
15===========
16Configuring
17===========
18The file /etc/request-key.conf will need to be modified so /sbin/request-key can
19direct the upcall. The following line should be added:
20
21#OP TYPE DESCRIPTION CALLOUT INFO PROGRAM ARG1 ARG2 ARG3 ...
22#====== ======= =============== =============== ===============================
23create id_resolver * * /usr/sbin/nfs.idmap %k %d 600
24
25This will direct all id_resolver requests to the program /usr/sbin/nfs.idmap.
26The last parameter, 600, defines how many seconds into the future the key will
27expire. This parameter is optional for /usr/sbin/nfs.idmap. When the timeout
28is not specified, nfs.idmap will default to 600 seconds.
29
30id mapper uses for key descriptions:
31 uid: Find the UID for the given user
32 gid: Find the GID for the given group
33 user: Find the user name for the given UID
34 group: Find the group name for the given GID
35
36You can handle any of these individually, rather than using the generic upcall
37program. If you would like to use your own program for a uid lookup then you
38would edit your request-key.conf so it look similar to this:
39
40#OP TYPE DESCRIPTION CALLOUT INFO PROGRAM ARG1 ARG2 ARG3 ...
41#====== ======= =============== =============== ===============================
42create id_resolver uid:* * /some/other/program %k %d 600
43create id_resolver * * /usr/sbin/nfs.idmap %k %d 600
44
45Notice that the new line was added above the line for the generic program.
46request-key will find the first matching line and corresponding program. In
47this case, /some/other/program will handle all uid lookups and
48/usr/sbin/nfs.idmap will handle gid, user, and group lookups.
49
50See <file:Documentation/security/keys-request-keys.txt> for more information
51about the request-key function.
52
53
54=========
55nfs.idmap
56=========
57nfs.idmap is designed to be called by request-key, and should not be run "by
58hand". This program takes two arguments, a serialized key and a key
59description. The serialized key is first converted into a key_serial_t, and
60then passed as an argument to keyctl_instantiate (both are part of keyutils.h).
61
62The actual lookups are performed by functions found in nfsidmap.h. nfs.idmap
63determines the correct function to call by looking at the first part of the
64description string. For example, a uid lookup description will appear as
65"uid:user@domain".
66
67nfs.idmap will return 0 if the key was instantiated, and non-zero otherwise.
diff --git a/Documentation/filesystems/nfs/nfsroot.txt b/Documentation/filesystems/nfs/nfsroot.txt
index f2430a7974e1..90c71c6f0d00 100644
--- a/Documentation/filesystems/nfs/nfsroot.txt
+++ b/Documentation/filesystems/nfs/nfsroot.txt
@@ -159,6 +159,28 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
159 Default: any 159 Default: any
160 160
161 161
162nfsrootdebug
163
164 This parameter enables debugging messages to appear in the kernel
165 log at boot time so that administrators can verify that the correct
166 NFS mount options, server address, and root path are passed to the
167 NFS client.
168
169
170rdinit=<executable file>
171
172 To specify which file contains the program that starts system
173 initialization, administrators can use this command line parameter.
174 The default value of this parameter is "/init". If the specified
175 file exists and the kernel can execute it, root filesystem related
176 kernel command line parameters, including `nfsroot=', are ignored.
177
178 A description of the process of mounting the root file system can be
179 found in:
180
181 Documentation/early-userspace/README
182
183
162 184
163 185
1643.) Boot Loader 1863.) Boot Loader
diff --git a/Documentation/filesystems/nfs/pnfs.txt b/Documentation/filesystems/nfs/pnfs.txt
new file mode 100644
index 000000000000..983e14abe7e9
--- /dev/null
+++ b/Documentation/filesystems/nfs/pnfs.txt
@@ -0,0 +1,55 @@
1Reference counting in pnfs:
2==========================
3
4The are several inter-related caches. We have layouts which can
5reference multiple devices, each of which can reference multiple data servers.
6Each data server can be referenced by multiple devices. Each device
7can be referenced by multiple layouts. To keep all of this straight,
8we need to reference count.
9
10
11struct pnfs_layout_hdr
12----------------------
13The on-the-wire command LAYOUTGET corresponds to struct
14pnfs_layout_segment, usually referred to by the variable name lseg.
15Each nfs_inode may hold a pointer to a cache of of these layout
16segments in nfsi->layout, of type struct pnfs_layout_hdr.
17
18We reference the header for the inode pointing to it, across each
19outstanding RPC call that references it (LAYOUTGET, LAYOUTRETURN,
20LAYOUTCOMMIT), and for each lseg held within.
21
22Each header is also (when non-empty) put on a list associated with
23struct nfs_client (cl_layouts). Being put on this list does not bump
24the reference count, as the layout is kept around by the lseg that
25keeps it in the list.
26
27deviceid_cache
28--------------
29lsegs reference device ids, which are resolved per nfs_client and
30layout driver type. The device ids are held in a RCU cache (struct
31nfs4_deviceid_cache). The cache itself is referenced across each
32mount. The entries (struct nfs4_deviceid) themselves are held across
33the lifetime of each lseg referencing them.
34
35RCU is used because the deviceid is basically a write once, read many
36data structure. The hlist size of 32 buckets needs better
37justification, but seems reasonable given that we can have multiple
38deviceid's per filesystem, and multiple filesystems per nfs_client.
39
40The hash code is copied from the nfsd code base. A discussion of
41hashing and variations of this algorithm can be found at:
42http://groups.google.com/group/comp.lang.c/browse_thread/thread/9522965e2b8d3809
43
44data server cache
45-----------------
46file driver devices refer to data servers, which are kept in a module
47level cache. Its reference is held over the lifetime of the deviceid
48pointing to it.
49
50lseg
51----
52lseg maintains an extra reference corresponding to the NFS_LSEG_VALID
53bit which holds it in the pnfs_layout_hdr's list. When the final lseg
54is removed from the pnfs_layout_hdr's list, the NFS_LAYOUT_DESTROYED
55bit is set, preventing any new lsegs from being added.
diff --git a/Documentation/filesystems/nilfs2.txt b/Documentation/filesystems/nilfs2.txt
index d5c0cef38a71..873a2ab2e9f8 100644
--- a/Documentation/filesystems/nilfs2.txt
+++ b/Documentation/filesystems/nilfs2.txt
@@ -40,7 +40,6 @@ Features which NILFS2 does not support yet:
40 - POSIX ACLs 40 - POSIX ACLs
41 - quotas 41 - quotas
42 - fsck 42 - fsck
43 - resize
44 - defragmentation 43 - defragmentation
45 44
46Mount options 45Mount options
diff --git a/Documentation/filesystems/ntfs.txt b/Documentation/filesystems/ntfs.txt
index ac2a261c5f7d..791af8dac065 100644
--- a/Documentation/filesystems/ntfs.txt
+++ b/Documentation/filesystems/ntfs.txt
@@ -350,7 +350,7 @@ Note the "Should sync?" parameter "nosync" means that the two mirrors are
350already in sync which will be the case on a clean shutdown of Windows. If the 350already in sync which will be the case on a clean shutdown of Windows. If the
351mirrors are not clean, you can specify the "sync" option instead of "nosync" 351mirrors are not clean, you can specify the "sync" option instead of "nosync"
352and the Device-Mapper driver will then copy the entirety of the "Source Device" 352and the Device-Mapper driver will then copy the entirety of the "Source Device"
353to the "Target Device" or if you specified multipled target devices to all of 353to the "Target Device" or if you specified multiple target devices to all of
354them. 354them.
355 355
356Once you have your table, save it in a file somewhere (e.g. /etc/ntfsvolume1), 356Once you have your table, save it in a file somewhere (e.g. /etc/ntfsvolume1),
@@ -457,6 +457,11 @@ ChangeLog
457 457
458Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog. 458Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.
459 459
4602.1.30:
461 - Fix writev() (it kept writing the first segment over and over again
462 instead of moving onto subsequent segments).
463 - Fix crash in ntfs_mft_record_alloc() when mapping the new extent mft
464 record failed.
4602.1.29: 4652.1.29:
461 - Fix a deadlock when mounting read-write. 466 - Fix a deadlock when mounting read-write.
4622.1.28: 4672.1.28:
diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt
index 1f7ae144f6d8..7618a287aa41 100644
--- a/Documentation/filesystems/ocfs2.txt
+++ b/Documentation/filesystems/ocfs2.txt
@@ -46,9 +46,15 @@ errors=panic Panic and halt the machine if an error occurs.
46intr (*) Allow signals to interrupt cluster operations. 46intr (*) Allow signals to interrupt cluster operations.
47nointr Do not allow signals to interrupt cluster 47nointr Do not allow signals to interrupt cluster
48 operations. 48 operations.
49noatime Do not update access time.
50relatime(*) Update atime if the previous atime is older than
51 mtime or ctime
52strictatime Always update atime, but the minimum update interval
53 is specified by atime_quantum.
49atime_quantum=60(*) OCFS2 will not update atime unless this number 54atime_quantum=60(*) OCFS2 will not update atime unless this number
50 of seconds has passed since the last update. 55 of seconds has passed since the last update.
51 Set to zero to always update atime. 56 Set to zero to always update atime. This option need
57 work with strictatime.
52data=ordered (*) All data are forced directly out to the main file 58data=ordered (*) All data are forced directly out to the main file
53 system prior to its metadata being committed to the 59 system prior to its metadata being committed to the
54 journal. 60 journal.
@@ -80,10 +86,17 @@ user_xattr (*) Enables Extended User Attributes.
80nouser_xattr Disables Extended User Attributes. 86nouser_xattr Disables Extended User Attributes.
81acl Enables POSIX Access Control Lists support. 87acl Enables POSIX Access Control Lists support.
82noacl (*) Disables POSIX Access Control Lists support. 88noacl (*) Disables POSIX Access Control Lists support.
83resv_level=2 (*) Set how agressive allocation reservations will be. 89resv_level=2 (*) Set how aggressive allocation reservations will be.
84 Valid values are between 0 (reservations off) to 8 90 Valid values are between 0 (reservations off) to 8
85 (maximum space for reservations). 91 (maximum space for reservations).
86dir_resv_level= (*) By default, directory reservations will scale with file 92dir_resv_level= (*) By default, directory reservations will scale with file
87 reservations - users should rarely need to change this 93 reservations - users should rarely need to change this
88 value. If allocation reservations are turned off, this 94 value. If allocation reservations are turned off, this
89 option will have no effect. 95 option will have no effect.
96coherency=full (*) Disallow concurrent O_DIRECT writes, cluster inode
97 lock will be taken to force other nodes drop cache,
98 therefore full cluster coherency is guaranteed even
99 for O_DIRECT writes.
100coherency=buffered Allow concurrent O_DIRECT writes without EX lock among
101 nodes, which gains high performance at risk of getting
102 stale data on other nodes.
diff --git a/Documentation/filesystems/path-lookup.txt b/Documentation/filesystems/path-lookup.txt
new file mode 100644
index 000000000000..3571667c7105
--- /dev/null
+++ b/Documentation/filesystems/path-lookup.txt
@@ -0,0 +1,382 @@
1Path walking and name lookup locking
2====================================
3
4Path resolution is the finding a dentry corresponding to a path name string, by
5performing a path walk. Typically, for every open(), stat() etc., the path name
6will be resolved. Paths are resolved by walking the namespace tree, starting
7with the first component of the pathname (eg. root or cwd) with a known dentry,
8then finding the child of that dentry, which is named the next component in the
9path string. Then repeating the lookup from the child dentry and finding its
10child with the next element, and so on.
11
12Since it is a frequent operation for workloads like multiuser environments and
13web servers, it is important to optimize this code.
14
15Path walking synchronisation history:
16Prior to 2.5.10, dcache_lock was acquired in d_lookup (dcache hash lookup) and
17thus in every component during path look-up. Since 2.5.10 onwards, fast-walk
18algorithm changed this by holding the dcache_lock at the beginning and walking
19as many cached path component dentries as possible. This significantly
20decreases the number of acquisition of dcache_lock. However it also increases
21the lock hold time significantly and affects performance in large SMP machines.
22Since 2.5.62 kernel, dcache has been using a new locking model that uses RCU to
23make dcache look-up lock-free.
24
25All the above algorithms required taking a lock and reference count on the
26dentry that was looked up, so that may be used as the basis for walking the
27next path element. This is inefficient and unscalable. It is inefficient
28because of the locks and atomic operations required for every dentry element
29slows things down. It is not scalable because many parallel applications that
30are path-walk intensive tend to do path lookups starting from a common dentry
31(usually, the root "/" or current working directory). So contention on these
32common path elements causes lock and cacheline queueing.
33
34Since 2.6.38, RCU is used to make a significant part of the entire path walk
35(including dcache look-up) completely "store-free" (so, no locks, atomics, or
36even stores into cachelines of common dentries). This is known as "rcu-walk"
37path walking.
38
39Path walking overview
40=====================
41
42A name string specifies a start (root directory, cwd, fd-relative) and a
43sequence of elements (directory entry names), which together refer to a path in
44the namespace. A path is represented as a (dentry, vfsmount) tuple. The name
45elements are sub-strings, separated by '/'.
46
47Name lookups will want to find a particular path that a name string refers to
48(usually the final element, or parent of final element). This is done by taking
49the path given by the name's starting point (which we know in advance -- eg.
50current->fs->cwd or current->fs->root) as the first parent of the lookup. Then
51iteratively for each subsequent name element, look up the child of the current
52parent with the given name and if it is not the desired entry, make it the
53parent for the next lookup.
54
55A parent, of course, must be a directory, and we must have appropriate
56permissions on the parent inode to be able to walk into it.
57
58Turning the child into a parent for the next lookup requires more checks and
59procedures. Symlinks essentially substitute the symlink name for the target
60name in the name string, and require some recursive path walking. Mount points
61must be followed into (thus changing the vfsmount that subsequent path elements
62refer to), switching from the mount point path to the root of the particular
63mounted vfsmount. These behaviours are variously modified depending on the
64exact path walking flags.
65
66Path walking then must, broadly, do several particular things:
67- find the start point of the walk;
68- perform permissions and validity checks on inodes;
69- perform dcache hash name lookups on (parent, name element) tuples;
70- traverse mount points;
71- traverse symlinks;
72- lookup and create missing parts of the path on demand.
73
74Safe store-free look-up of dcache hash table
75============================================
76
77Dcache name lookup
78------------------
79In order to lookup a dcache (parent, name) tuple, we take a hash on the tuple
80and use that to select a bucket in the dcache-hash table. The list of entries
81in that bucket is then walked, and we do a full comparison of each entry
82against our (parent, name) tuple.
83
84The hash lists are RCU protected, so list walking is not serialised with
85concurrent updates (insertion, deletion from the hash). This is a standard RCU
86list application with the exception of renames, which will be covered below.
87
88Parent and name members of a dentry, as well as its membership in the dcache
89hash, and its inode are protected by the per-dentry d_lock spinlock. A
90reference is taken on the dentry (while the fields are verified under d_lock),
91and this stabilises its d_inode pointer and actual inode. This gives a stable
92point to perform the next step of our path walk against.
93
94These members are also protected by d_seq seqlock, although this offers
95read-only protection and no durability of results, so care must be taken when
96using d_seq for synchronisation (see seqcount based lookups, below).
97
98Renames
99-------
100Back to the rename case. In usual RCU protected lists, the only operations that
101will happen to an object is insertion, and then eventually removal from the
102list. The object will not be reused until an RCU grace period is complete.
103This ensures the RCU list traversal primitives can run over the object without
104problems (see RCU documentation for how this works).
105
106However when a dentry is renamed, its hash value can change, requiring it to be
107moved to a new hash list. Allocating and inserting a new alias would be
108expensive and also problematic for directory dentries. Latency would be far to
109high to wait for a grace period after removing the dentry and before inserting
110it in the new hash bucket. So what is done is to insert the dentry into the
111new list immediately.
112
113However, when the dentry's list pointers are updated to point to objects in the
114new list before waiting for a grace period, this can result in a concurrent RCU
115lookup of the old list veering off into the new (incorrect) list and missing
116the remaining dentries on the list.
117
118There is no fundamental problem with walking down the wrong list, because the
119dentry comparisons will never match. However it is fatal to miss a matching
120dentry. So a seqlock is used to detect when a rename has occurred, and so the
121lookup can be retried.
122
123 1 2 3
124 +---+ +---+ +---+
125hlist-->| N-+->| N-+->| N-+->
126head <--+-P |<-+-P |<-+-P |
127 +---+ +---+ +---+
128
129Rename of dentry 2 may require it deleted from the above list, and inserted
130into a new list. Deleting 2 gives the following list.
131
132 1 3
133 +---+ +---+ (don't worry, the longer pointers do not
134hlist-->| N-+-------->| N-+-> impose a measurable performance overhead
135head <--+-P |<--------+-P | on modern CPUs)
136 +---+ +---+
137 ^ 2 ^
138 | +---+ |
139 | | N-+----+
140 +----+-P |
141 +---+
142
143This is a standard RCU-list deletion, which leaves the deleted object's
144pointers intact, so a concurrent list walker that is currently looking at
145object 2 will correctly continue to object 3 when it is time to traverse the
146next object.
147
148However, when inserting object 2 onto a new list, we end up with this:
149
150 1 3
151 +---+ +---+
152hlist-->| N-+-------->| N-+->
153head <--+-P |<--------+-P |
154 +---+ +---+
155 2
156 +---+
157 | N-+---->
158 <----+-P |
159 +---+
160
161Because we didn't wait for a grace period, there may be a concurrent lookup
162still at 2. Now when it follows 2's 'next' pointer, it will walk off into
163another list without ever having checked object 3.
164
165A related, but distinctly different, issue is that of rename atomicity versus
166lookup operations. If a file is renamed from 'A' to 'B', a lookup must only
167find either 'A' or 'B'. So if a lookup of 'A' returns NULL, a subsequent lookup
168of 'B' must succeed (note the reverse is not true).
169
170Between deleting the dentry from the old hash list, and inserting it on the new
171hash list, a lookup may find neither 'A' nor 'B' matching the dentry. The same
172rename seqlock is also used to cover this race in much the same way, by
173retrying a negative lookup result if a rename was in progress.
174
175Seqcount based lookups
176----------------------
177In refcount based dcache lookups, d_lock is used to serialise access to
178the dentry, stabilising it while comparing its name and parent and then
179taking a reference count (the reference count then gives a stable place to
180start the next part of the path walk from).
181
182As explained above, we would like to do path walking without taking locks or
183reference counts on intermediate dentries along the path. To do this, a per
184dentry seqlock (d_seq) is used to take a "coherent snapshot" of what the dentry
185looks like (its name, parent, and inode). That snapshot is then used to start
186the next part of the path walk. When loading the coherent snapshot under d_seq,
187care must be taken to load the members up-front, and use those pointers rather
188than reloading from the dentry later on (otherwise we'd have interesting things
189like d_inode going NULL underneath us, if the name was unlinked).
190
191Also important is to avoid performing any destructive operations (pretty much:
192no non-atomic stores to shared data), and to recheck the seqcount when we are
193"done" with the operation. Retry or abort if the seqcount does not match.
194Avoiding destructive or changing operations means we can easily unwind from
195failure.
196
197What this means is that a caller, provided they are holding RCU lock to
198protect the dentry object from disappearing, can perform a seqcount based
199lookup which does not increment the refcount on the dentry or write to
200it in any way. This returned dentry can be used for subsequent operations,
201provided that d_seq is rechecked after that operation is complete.
202
203Inodes are also rcu freed, so the seqcount lookup dentry's inode may also be
204queried for permissions.
205
206With this two parts of the puzzle, we can do path lookups without taking
207locks or refcounts on dentry elements.
208
209RCU-walk path walking design
210============================
211
212Path walking code now has two distinct modes, ref-walk and rcu-walk. ref-walk
213is the traditional[*] way of performing dcache lookups using d_lock to
214serialise concurrent modifications to the dentry and take a reference count on
215it. ref-walk is simple and obvious, and may sleep, take locks, etc while path
216walking is operating on each dentry. rcu-walk uses seqcount based dentry
217lookups, and can perform lookup of intermediate elements without any stores to
218shared data in the dentry or inode. rcu-walk can not be applied to all cases,
219eg. if the filesystem must sleep or perform non trivial operations, rcu-walk
220must be switched to ref-walk mode.
221
222[*] RCU is still used for the dentry hash lookup in ref-walk, but not the full
223 path walk.
224
225Where ref-walk uses a stable, refcounted ``parent'' to walk the remaining
226path string, rcu-walk uses a d_seq protected snapshot. When looking up a
227child of this parent snapshot, we open d_seq critical section on the child
228before closing d_seq critical section on the parent. This gives an interlocking
229ladder of snapshots to walk down.
230
231
232 proc 101
233 /----------------\
234 / comm: "vi" \
235 / fs.root: dentry0 \
236 \ fs.cwd: dentry2 /
237 \ /
238 \----------------/
239
240So when vi wants to open("/home/npiggin/test.c", O_RDWR), then it will
241start from current->fs->root, which is a pinned dentry. Alternatively,
242"./test.c" would start from cwd; both names refer to the same path in
243the context of proc101.
244
245 dentry 0
246 +---------------------+ rcu-walk begins here, we note d_seq, check the
247 | name: "/" | inode's permission, and then look up the next
248 | inode: 10 | path element which is "home"...
249 | children:"home", ...|
250 +---------------------+
251 |
252 dentry 1 V
253 +---------------------+ ... which brings us here. We find dentry1 via
254 | name: "home" | hash lookup, then note d_seq and compare name
255 | inode: 678 | string and parent pointer. When we have a match,
256 | children:"npiggin" | we now recheck the d_seq of dentry0. Then we
257 +---------------------+ check inode and look up the next element.
258 |
259 dentry2 V
260 +---------------------+ Note: if dentry0 is now modified, lookup is
261 | name: "npiggin" | not necessarily invalid, so we need only keep a
262 | inode: 543 | parent for d_seq verification, and grandparents
263 | children:"a.c", ... | can be forgotten.
264 +---------------------+
265 |
266 dentry3 V
267 +---------------------+ At this point we have our destination dentry.
268 | name: "a.c" | We now take its d_lock, verify d_seq of this
269 | inode: 14221 | dentry. If that checks out, we can increment
270 | children:NULL | its refcount because we're holding d_lock.
271 +---------------------+
272
273Taking a refcount on a dentry from rcu-walk mode, by taking its d_lock,
274re-checking its d_seq, and then incrementing its refcount is called
275"dropping rcu" or dropping from rcu-walk into ref-walk mode.
276
277It is, in some sense, a bit of a house of cards. If the seqcount check of the
278parent snapshot fails, the house comes down, because we had closed the d_seq
279section on the grandparent, so we have nothing left to stand on. In that case,
280the path walk must be fully restarted (which we do in ref-walk mode, to avoid
281live locks). It is costly to have a full restart, but fortunately they are
282quite rare.
283
284When we reach a point where sleeping is required, or a filesystem callout
285requires ref-walk, then instead of restarting the walk, we attempt to drop rcu
286at the last known good dentry we have. Avoiding a full restart in ref-walk in
287these cases is fundamental for performance and scalability because blocking
288operations such as creates and unlinks are not uncommon.
289
290The detailed design for rcu-walk is like this:
291* LOOKUP_RCU is set in nd->flags, which distinguishes rcu-walk from ref-walk.
292* Take the RCU lock for the entire path walk, starting with the acquiring
293 of the starting path (eg. root/cwd/fd-path). So now dentry refcounts are
294 not required for dentry persistence.
295* synchronize_rcu is called when unregistering a filesystem, so we can
296 access d_ops and i_ops during rcu-walk.
297* Similarly take the vfsmount lock for the entire path walk. So now mnt
298 refcounts are not required for persistence. Also we are free to perform mount
299 lookups, and to assume dentry mount points and mount roots are stable up and
300 down the path.
301* Have a per-dentry seqlock to protect the dentry name, parent, and inode,
302 so we can load this tuple atomically, and also check whether any of its
303 members have changed.
304* Dentry lookups (based on parent, candidate string tuple) recheck the parent
305 sequence after the child is found in case anything changed in the parent
306 during the path walk.
307* inode is also RCU protected so we can load d_inode and use the inode for
308 limited things.
309* i_mode, i_uid, i_gid can be tested for exec permissions during path walk.
310* i_op can be loaded.
311* When the destination dentry is reached, drop rcu there (ie. take d_lock,
312 verify d_seq, increment refcount).
313* If seqlock verification fails anywhere along the path, do a full restart
314 of the path lookup in ref-walk mode. -ECHILD tends to be used (for want of
315 a better errno) to signal an rcu-walk failure.
316
317The cases where rcu-walk cannot continue are:
318* NULL dentry (ie. any uncached path element)
319* Following links
320
321It may be possible eventually to make following links rcu-walk aware.
322
323Uncached path elements will always require dropping to ref-walk mode, at the
324very least because i_mutex needs to be grabbed, and objects allocated.
325
326Final note:
327"store-free" path walking is not strictly store free. We take vfsmount lock
328and refcounts (both of which can be made per-cpu), and we also store to the
329stack (which is essentially CPU-local), and we also have to take locks and
330refcount on final dentry.
331
332The point is that shared data, where practically possible, is not locked
333or stored into. The result is massive improvements in performance and
334scalability of path resolution.
335
336
337Interesting statistics
338======================
339
340The following table gives rcu lookup statistics for a few simple workloads
341(2s12c24t Westmere, debian non-graphical system). Ungraceful are attempts to
342drop rcu that fail due to d_seq failure and requiring the entire path lookup
343again. Other cases are successful rcu-drops that are required before the final
344element, nodentry for missing dentry, revalidate for filesystem revalidate
345routine requiring rcu drop, permission for permission check requiring drop,
346and link for symlink traversal requiring drop.
347
348 rcu-lookups restart nodentry link revalidate permission
349bootup 47121 0 4624 1010 10283 7852
350dbench 25386793 0 6778659(26.7%) 55 549 1156
351kbuild 2696672 10 64442(2.3%) 108764(4.0%) 1 1590
352git diff 39605 0 28 2 0 106
353vfstest 24185492 4945 708725(2.9%) 1076136(4.4%) 0 2651
354
355What this shows is that failed rcu-walk lookups, ie. ones that are restarted
356entirely with ref-walk, are quite rare. Even the "vfstest" case which
357specifically has concurrent renames/mkdir/rmdir/ creat/unlink/etc to exercise
358such races is not showing a huge amount of restarts.
359
360Dropping from rcu-walk to ref-walk mean that we have encountered a dentry where
361the reference count needs to be taken for some reason. This is either because
362we have reached the target of the path walk, or because we have encountered a
363condition that can't be resolved in rcu-walk mode. Ideally, we drop rcu-walk
364only when we have reached the target dentry, so the other statistics show where
365this does not happen.
366
367Note that a graceful drop from rcu-walk mode due to something such as the
368dentry not existing (which can be common) is not necessarily a failure of
369rcu-walk scheme, because some elements of the path may have been walked in
370rcu-walk mode. The further we get from common path elements (such as cwd or
371root), the less contended the dentry is likely to be. The closer we are to
372common path elements, the more likely they will exist in dentry cache.
373
374
375Papers and other documentation on dcache locking
376================================================
377
3781. Scaling dcache with RCU (http://linuxjournal.com/article.php?sid=7124).
379
3802. http://lse.sourceforge.net/locking/dcache/dcache.html
381
382
diff --git a/Documentation/filesystems/pohmelfs/network_protocol.txt b/Documentation/filesystems/pohmelfs/network_protocol.txt
index 40ea6c295afb..65e03dd44823 100644
--- a/Documentation/filesystems/pohmelfs/network_protocol.txt
+++ b/Documentation/filesystems/pohmelfs/network_protocol.txt
@@ -20,7 +20,7 @@ Commands can be embedded into transaction command (which in turn has own command
20so one can extend protocol as needed without breaking backward compatibility as long 20so one can extend protocol as needed without breaking backward compatibility as long
21as old commands are supported. All string lengths include tail 0 byte. 21as old commands are supported. All string lengths include tail 0 byte.
22 22
23All commans are transfered over the network in big-endian. CPU endianess is used at the end peers. 23All commands are transferred over the network in big-endian. CPU endianess is used at the end peers.
24 24
25@cmd - command number, which specifies command to be processed. Following 25@cmd - command number, which specifies command to be processed. Following
26 commands are used currently: 26 commands are used currently:
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting
index b12c89538680..6e29954851a2 100644
--- a/Documentation/filesystems/porting
+++ b/Documentation/filesystems/porting
@@ -216,7 +216,6 @@ had ->revalidate()) add calls in ->follow_link()/->readlink().
216->d_parent changes are not protected by BKL anymore. Read access is safe 216->d_parent changes are not protected by BKL anymore. Read access is safe
217if at least one of the following is true: 217if at least one of the following is true:
218 * filesystem has no cross-directory rename() 218 * filesystem has no cross-directory rename()
219 * dcache_lock is held
220 * we know that parent had been locked (e.g. we are looking at 219 * we know that parent had been locked (e.g. we are looking at
221->d_parent of ->lookup() argument). 220->d_parent of ->lookup() argument).
222 * we are called from ->rename(). 221 * we are called from ->rename().
@@ -299,11 +298,14 @@ be used instead. It gets called whenever the inode is evicted, whether it has
299remaining links or not. Caller does *not* evict the pagecache or inode-associated 298remaining links or not. Caller does *not* evict the pagecache or inode-associated
300metadata buffers; getting rid of those is responsibility of method, as it had 299metadata buffers; getting rid of those is responsibility of method, as it had
301been for ->delete_inode(). 300been for ->delete_inode().
302 ->drop_inode() returns int now; it's called on final iput() with inode_lock 301
303held and it returns true if filesystems wants the inode to be dropped. As before, 302 ->drop_inode() returns int now; it's called on final iput() with
304generic_drop_inode() is still the default and it's been updated appropriately. 303inode->i_lock held and it returns true if filesystems wants the inode to be
305generic_delete_inode() is also alive and it consists simply of return 1. Note that 304dropped. As before, generic_drop_inode() is still the default and it's been
306all actual eviction work is done by caller after ->drop_inode() returns. 305updated appropriately. generic_delete_inode() is also alive and it consists
306simply of return 1. Note that all actual eviction work is done by caller after
307->drop_inode() returns.
308
307 clear_inode() is gone; use end_writeback() instead. As before, it must 309 clear_inode() is gone; use end_writeback() instead. As before, it must
308be called exactly once on each call of ->evict_inode() (as it used to be for 310be called exactly once on each call of ->evict_inode() (as it used to be for
309each call of ->delete_inode()). Unlike before, if you are using inode-associated 311each call of ->delete_inode()). Unlike before, if you are using inode-associated
@@ -318,3 +320,90 @@ if it's zero is not *and* *never* *had* *been* enough. Final unlink() and iput(
318may happen while the inode is in the middle of ->write_inode(); e.g. if you blindly 320may happen while the inode is in the middle of ->write_inode(); e.g. if you blindly
319free the on-disk inode, you may end up doing that while ->write_inode() is writing 321free the on-disk inode, you may end up doing that while ->write_inode() is writing
320to it. 322to it.
323
324---
325[mandatory]
326
327 .d_delete() now only advises the dcache as to whether or not to cache
328unreferenced dentries, and is now only called when the dentry refcount goes to
3290. Even on 0 refcount transition, it must be able to tolerate being called 0,
3301, or more times (eg. constant, idempotent).
331
332---
333[mandatory]
334
335 .d_compare() calling convention and locking rules are significantly
336changed. Read updated documentation in Documentation/filesystems/vfs.txt (and
337look at examples of other filesystems) for guidance.
338
339---
340[mandatory]
341
342 .d_hash() calling convention and locking rules are significantly
343changed. Read updated documentation in Documentation/filesystems/vfs.txt (and
344look at examples of other filesystems) for guidance.
345
346---
347[mandatory]
348 dcache_lock is gone, replaced by fine grained locks. See fs/dcache.c
349for details of what locks to replace dcache_lock with in order to protect
350particular things. Most of the time, a filesystem only needs ->d_lock, which
351protects *all* the dcache state of a given dentry.
352
353--
354[mandatory]
355
356 Filesystems must RCU-free their inodes, if they can have been accessed
357via rcu-walk path walk (basically, if the file can have had a path name in the
358vfs namespace).
359
360 i_dentry and i_rcu share storage in a union, and the vfs expects
361i_dentry to be reinitialized before it is freed, so an:
362
363 INIT_LIST_HEAD(&inode->i_dentry);
364
365must be done in the RCU callback.
366
367--
368[recommended]
369 vfs now tries to do path walking in "rcu-walk mode", which avoids
370atomic operations and scalability hazards on dentries and inodes (see
371Documentation/filesystems/path-lookup.txt). d_hash and d_compare changes
372(above) are examples of the changes required to support this. For more complex
373filesystem callbacks, the vfs drops out of rcu-walk mode before the fs call, so
374no changes are required to the filesystem. However, this is costly and loses
375the benefits of rcu-walk mode. We will begin to add filesystem callbacks that
376are rcu-walk aware, shown below. Filesystems should take advantage of this
377where possible.
378
379--
380[mandatory]
381 d_revalidate is a callback that is made on every path element (if
382the filesystem provides it), which requires dropping out of rcu-walk mode. This
383may now be called in rcu-walk mode (nd->flags & LOOKUP_RCU). -ECHILD should be
384returned if the filesystem cannot handle rcu-walk. See
385Documentation/filesystems/vfs.txt for more details.
386
387 permission and check_acl are inode permission checks that are called
388on many or all directory inodes on the way down a path walk (to check for
389exec permission). These must now be rcu-walk aware (flags & IPERM_FLAG_RCU).
390See Documentation/filesystems/vfs.txt for more details.
391
392--
393[mandatory]
394 In ->fallocate() you must check the mode option passed in. If your
395filesystem does not support hole punching (deallocating space in the middle of a
396file) you must return -EOPNOTSUPP if FALLOC_FL_PUNCH_HOLE is set in mode.
397Currently you can only have FALLOC_FL_PUNCH_HOLE with FALLOC_FL_KEEP_SIZE set,
398so the i_size should not change when hole punching, even when puching the end of
399a file off.
400
401--
402[mandatory]
403
404--
405[mandatory]
406 ->get_sb() is gone. Switch to use of ->mount(). Typically it's just
407a matter of switching from calling get_sb_... to mount_... and changing the
408function type. If you were doing it manually, just switch from setting ->mnt_root
409to some pointer to returning that pointer. On errors return ERR_PTR(...).
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index a6aca8740883..db3b1aba32a3 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -136,6 +136,7 @@ Table 1-1: Process specific entries in /proc
136 statm Process memory status information 136 statm Process memory status information
137 status Process status in human readable form 137 status Process status in human readable form
138 wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan 138 wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan
139 pagemap Page table
139 stack Report full stack trace, enable via CONFIG_STACKTRACE 140 stack Report full stack trace, enable via CONFIG_STACKTRACE
140 smaps a extension based on maps, showing the memory consumption of 141 smaps a extension based on maps, showing the memory consumption of
141 each mapping 142 each mapping
@@ -370,17 +371,25 @@ Shared_Dirty: 0 kB
370Private_Clean: 0 kB 371Private_Clean: 0 kB
371Private_Dirty: 0 kB 372Private_Dirty: 0 kB
372Referenced: 892 kB 373Referenced: 892 kB
374Anonymous: 0 kB
373Swap: 0 kB 375Swap: 0 kB
374KernelPageSize: 4 kB 376KernelPageSize: 4 kB
375MMUPageSize: 4 kB 377MMUPageSize: 4 kB
376 378Locked: 374 kB
377The first of these lines shows the same information as is displayed for the 379
378mapping in /proc/PID/maps. The remaining lines show the size of the mapping, 380The first of these lines shows the same information as is displayed for the
379the amount of the mapping that is currently resident in RAM, the "proportional 381mapping in /proc/PID/maps. The remaining lines show the size of the mapping
380set size” (divide each shared page by the number of processes sharing it), the 382(size), the amount of the mapping that is currently resident in RAM (RSS), the
381number of clean and dirty shared pages in the mapping, and the number of clean 383process' proportional share of this mapping (PSS), the number of clean and
382and dirty private pages in the mapping. The "Referenced" indicates the amount 384dirty private pages in the mapping. Note that even a page which is part of a
383of memory currently marked as referenced or accessed. 385MAP_SHARED mapping, but has only a single pte mapped, i.e. is currently used
386by only one process, is accounted as private and not as shared. "Referenced"
387indicates the amount of memory currently marked as referenced or accessed.
388"Anonymous" shows the amount of memory that does not belong to any file. Even
389a mapping associated with a file may contain anonymous pages: when MAP_PRIVATE
390and a page is modified, the file page is replaced by a private anonymous copy.
391"Swap" shows how much would-be-anonymous memory is also used, but out on
392swap.
384 393
385This file is only present if the CONFIG_MMU kernel configuration option is 394This file is only present if the CONFIG_MMU kernel configuration option is
386enabled. 395enabled.
@@ -397,6 +406,9 @@ To clear the bits for the file mapped pages associated with the process
397 > echo 3 > /proc/PID/clear_refs 406 > echo 3 > /proc/PID/clear_refs
398Any other value written to /proc/PID/clear_refs will have no effect. 407Any other value written to /proc/PID/clear_refs will have no effect.
399 408
409The /proc/pid/pagemap gives the PFN, which can be used to find the pageflags
410using /proc/kpageflags and number of times a page is mapped using
411/proc/kpagecount. For detailed explanation, see Documentation/vm/pagemap.txt.
400 412
4011.2 Kernel data 4131.2 Kernel data
402--------------- 414---------------
@@ -531,7 +543,7 @@ just those considered 'most important'. The new vectors are:
531 their statistics are used by kernel developers and interested users to 543 their statistics are used by kernel developers and interested users to
532 determine the occurrence of interrupts of the given type. 544 determine the occurrence of interrupts of the given type.
533 545
534The above IRQ vectors are displayed only when relevent. For example, 546The above IRQ vectors are displayed only when relevant. For example,
535the threshold vector does not exist on x86_64 platforms. Others are 547the threshold vector does not exist on x86_64 platforms. Others are
536suppressed when the system is a uniprocessor. As of this writing, only 548suppressed when the system is a uniprocessor. As of this writing, only
537i386 and x86_64 platforms support the new IRQ vector displays. 549i386 and x86_64 platforms support the new IRQ vector displays.
@@ -562,6 +574,12 @@ The contents of each smp_affinity file is the same by default:
562 > cat /proc/irq/0/smp_affinity 574 > cat /proc/irq/0/smp_affinity
563 ffffffff 575 ffffffff
564 576
577There is an alternate interface, smp_affinity_list which allows specifying
578a cpu range instead of a bitmask:
579
580 > cat /proc/irq/0/smp_affinity_list
581 1024-1031
582
565The default_smp_affinity mask applies to all non-active IRQs, which are the 583The default_smp_affinity mask applies to all non-active IRQs, which are the
566IRQs which have not yet been allocated/activated, and hence which lack a 584IRQs which have not yet been allocated/activated, and hence which lack a
567/proc/irq/[0-9]* directory. 585/proc/irq/[0-9]* directory.
@@ -571,12 +589,13 @@ reports itself as being attached. This hardware locality information does not
571include information about any possible driver locality preference. 589include information about any possible driver locality preference.
572 590
573prof_cpu_mask specifies which CPUs are to be profiled by the system wide 591prof_cpu_mask specifies which CPUs are to be profiled by the system wide
574profiler. Default value is ffffffff (all cpus). 592profiler. Default value is ffffffff (all cpus if there are only 32 of them).
575 593
576The way IRQs are routed is handled by the IO-APIC, and it's Round Robin 594The way IRQs are routed is handled by the IO-APIC, and it's Round Robin
577between all the CPUs which are allowed to handle it. As usual the kernel has 595between all the CPUs which are allowed to handle it. As usual the kernel has
578more info than you and does a better job than you, so the defaults are the 596more info than you and does a better job than you, so the defaults are the
579best choice for almost everyone. 597best choice for almost everyone. [Note this applies only to those IO-APIC's
598that support "Round Robin" interrupt distribution.]
580 599
581There are three more important subdirectories in /proc: net, scsi, and sys. 600There are three more important subdirectories in /proc: net, scsi, and sys.
582The general rule is that the contents, or even the existence of these 601The general rule is that the contents, or even the existence of these
@@ -659,6 +678,8 @@ varies by architecture and compile options. The following is from a
659 678
660> cat /proc/meminfo 679> cat /proc/meminfo
661 680
681The "Locked" indicates whether the mapping is locked in memory or not.
682
662 683
663MemTotal: 16344972 kB 684MemTotal: 16344972 kB
664MemFree: 13634064 kB 685MemFree: 13634064 kB
@@ -1170,6 +1191,30 @@ Table 1-12: Files in /proc/fs/ext4/<devname>
1170 mb_groups details of multiblock allocator buddy cache of free blocks 1191 mb_groups details of multiblock allocator buddy cache of free blocks
1171.............................................................................. 1192..............................................................................
1172 1193
11942.0 /proc/consoles
1195------------------
1196Shows registered system console lines.
1197
1198To see which character device lines are currently used for the system console
1199/dev/console, you may simply look into the file /proc/consoles:
1200
1201 > cat /proc/consoles
1202 tty0 -WU (ECp) 4:7
1203 ttyS0 -W- (Ep) 4:64
1204
1205The columns are:
1206
1207 device name of the device
1208 operations R = can do read operations
1209 W = can do write operations
1210 U = can do unblank
1211 flags E = it is enabled
1212 C = it is preferred console
1213 B = it is primary boot console
1214 p = it is used for printk buffer
1215 b = it is not a TTY but a Braille device
1216 a = it is safe to use when cpu is offline
1217 major:minor major and minor number of the device separated by a colon
1173 1218
1174------------------------------------------------------------------------------ 1219------------------------------------------------------------------------------
1175Summary 1220Summary
@@ -1285,11 +1330,15 @@ scaled linearly with /proc/<pid>/oom_score_adj.
1285Writing to /proc/<pid>/oom_score_adj or /proc/<pid>/oom_adj will change the 1330Writing to /proc/<pid>/oom_score_adj or /proc/<pid>/oom_adj will change the
1286other with its scaled value. 1331other with its scaled value.
1287 1332
1333The value of /proc/<pid>/oom_score_adj may be reduced no lower than the last
1334value set by a CAP_SYS_RESOURCE process. To reduce the value any lower
1335requires CAP_SYS_RESOURCE.
1336
1288NOTICE: /proc/<pid>/oom_adj is deprecated and will be removed, please see 1337NOTICE: /proc/<pid>/oom_adj is deprecated and will be removed, please see
1289Documentation/feature-removal-schedule.txt. 1338Documentation/feature-removal-schedule.txt.
1290 1339
1291Caveat: when a parent task is selected, the oom killer will sacrifice any first 1340Caveat: when a parent task is selected, the oom killer will sacrifice any first
1292generation children with seperate address spaces instead, if possible. This 1341generation children with separate address spaces instead, if possible. This
1293avoids servers and important system daemons from being killed and loses the 1342avoids servers and important system daemons from being killed and loses the
1294minimal amount of work. 1343minimal amount of work.
1295 1344
diff --git a/Documentation/filesystems/romfs.txt b/Documentation/filesystems/romfs.txt
index 2d2a7b2a16b9..e2b07cc9120a 100644
--- a/Documentation/filesystems/romfs.txt
+++ b/Documentation/filesystems/romfs.txt
@@ -17,8 +17,7 @@ comparison, an actual rescue disk used up 3202 blocks with ext2, while
17with romfs, it needed 3079 blocks. 17with romfs, it needed 3079 blocks.
18 18
19To create such a file system, you'll need a user program named 19To create such a file system, you'll need a user program named
20genromfs. It is available via anonymous ftp on sunsite.unc.edu and 20genromfs. It is available on http://romfs.sourceforge.net/
21its mirrors, in the /pub/Linux/system/recovery/ directory.
22 21
23As the name suggests, romfs could be also used (space-efficiently) on 22As the name suggests, romfs could be also used (space-efficiently) on
24various read-only media, like (E)EPROM disks if someone will have the 23various read-only media, like (E)EPROM disks if someone will have the
diff --git a/Documentation/filesystems/sharedsubtree.txt b/Documentation/filesystems/sharedsubtree.txt
index fc0e39af43c3..4ede421c9687 100644
--- a/Documentation/filesystems/sharedsubtree.txt
+++ b/Documentation/filesystems/sharedsubtree.txt
@@ -62,10 +62,10 @@ replicas continue to be exactly same.
62 # mount /dev/sd0 /tmp/a 62 # mount /dev/sd0 /tmp/a
63 63
64 #ls /tmp/a 64 #ls /tmp/a
65 t1 t2 t2 65 t1 t2 t3
66 66
67 #ls /mnt/a 67 #ls /mnt/a
68 t1 t2 t2 68 t1 t2 t3
69 69
70 Note that the mount has propagated to the mount at /mnt as well. 70 Note that the mount has propagated to the mount at /mnt as well.
71 71
diff --git a/Documentation/filesystems/smbfs.txt b/Documentation/filesystems/smbfs.txt
deleted file mode 100644
index 194fb0decd2c..000000000000
--- a/Documentation/filesystems/smbfs.txt
+++ /dev/null
@@ -1,8 +0,0 @@
1Smbfs is a filesystem that implements the SMB protocol, which is the
2protocol used by Windows for Workgroups, Windows 95 and Windows NT.
3Smbfs was inspired by Samba, the program written by Andrew Tridgell
4that turns any Unix host into a file server for DOS or Windows clients.
5
6Smbfs is a SMB client, but uses parts of samba for its operation. For
7more info on samba, including documentation, please go to
8http://www.samba.org/ and then on to your nearest mirror.
diff --git a/Documentation/filesystems/squashfs.txt b/Documentation/filesystems/squashfs.txt
index 66699afd66ca..d4d41465a0b1 100644
--- a/Documentation/filesystems/squashfs.txt
+++ b/Documentation/filesystems/squashfs.txt
@@ -59,12 +59,15 @@ obtained from this site also.
593. SQUASHFS FILESYSTEM DESIGN 593. SQUASHFS FILESYSTEM DESIGN
60----------------------------- 60-----------------------------
61 61
62A squashfs filesystem consists of a maximum of eight parts, packed together on a byte 62A squashfs filesystem consists of a maximum of nine parts, packed together on a
63alignment: 63byte alignment:
64 64
65 --------------- 65 ---------------
66 | superblock | 66 | superblock |
67 |---------------| 67 |---------------|
68 | compression |
69 | options |
70 |---------------|
68 | datablocks | 71 | datablocks |
69 | & fragments | 72 | & fragments |
70 |---------------| 73 |---------------|
@@ -91,7 +94,14 @@ the source directory, and checked for duplicates. Once all file data has been
91written the completed inode, directory, fragment, export and uid/gid lookup 94written the completed inode, directory, fragment, export and uid/gid lookup
92tables are written. 95tables are written.
93 96
943.1 Inodes 973.1 Compression options
98-----------------------
99
100Compressors can optionally support compression specific options (e.g.
101dictionary size). If non-default compression options have been used, then
102these are stored here.
103
1043.2 Inodes
95---------- 105----------
96 106
97Metadata (inodes and directories) are compressed in 8Kbyte blocks. Each 107Metadata (inodes and directories) are compressed in 8Kbyte blocks. Each
@@ -114,7 +124,7 @@ directory inode are defined: inodes optimised for frequently occurring
114regular files and directories, and extended types where extra 124regular files and directories, and extended types where extra
115information has to be stored. 125information has to be stored.
116 126
1173.2 Directories 1273.3 Directories
118--------------- 128---------------
119 129
120Like inodes, directories are packed into compressed metadata blocks, stored 130Like inodes, directories are packed into compressed metadata blocks, stored
@@ -144,7 +154,7 @@ decompressed to do a lookup irrespective of the length of the directory.
144This scheme has the advantage that it doesn't require extra memory overhead 154This scheme has the advantage that it doesn't require extra memory overhead
145and doesn't require much extra storage on disk. 155and doesn't require much extra storage on disk.
146 156
1473.3 File data 1573.4 File data
148------------- 158-------------
149 159
150Regular files consist of a sequence of contiguous compressed blocks, and/or a 160Regular files consist of a sequence of contiguous compressed blocks, and/or a
@@ -163,7 +173,7 @@ Larger files use multiple slots, with 1.75 TiB files using all 8 slots.
163The index cache is designed to be memory efficient, and by default uses 173The index cache is designed to be memory efficient, and by default uses
16416 KiB. 17416 KiB.
165 175
1663.4 Fragment lookup table 1763.5 Fragment lookup table
167------------------------- 177-------------------------
168 178
169Regular files can contain a fragment index which is mapped to a fragment 179Regular files can contain a fragment index which is mapped to a fragment
@@ -173,7 +183,7 @@ A second index table is used to locate these. This second index table for
173speed of access (and because it is small) is read at mount time and cached 183speed of access (and because it is small) is read at mount time and cached
174in memory. 184in memory.
175 185
1763.5 Uid/gid lookup table 1863.6 Uid/gid lookup table
177------------------------ 187------------------------
178 188
179For space efficiency regular files store uid and gid indexes, which are 189For space efficiency regular files store uid and gid indexes, which are
@@ -182,7 +192,7 @@ stored compressed into metadata blocks. A second index table is used to
182locate these. This second index table for speed of access (and because it 192locate these. This second index table for speed of access (and because it
183is small) is read at mount time and cached in memory. 193is small) is read at mount time and cached in memory.
184 194
1853.6 Export table 1953.7 Export table
186---------------- 196----------------
187 197
188To enable Squashfs filesystems to be exportable (via NFS etc.) filesystems 198To enable Squashfs filesystems to be exportable (via NFS etc.) filesystems
@@ -196,7 +206,7 @@ This table is stored compressed into metadata blocks. A second index table is
196used to locate these. This second index table for speed of access (and because 206used to locate these. This second index table for speed of access (and because
197it is small) is read at mount time and cached in memory. 207it is small) is read at mount time and cached in memory.
198 208
1993.7 Xattr table 2093.8 Xattr table
200--------------- 210---------------
201 211
202The xattr table contains extended attributes for each inode. The xattrs 212The xattr table contains extended attributes for each inode. The xattrs
@@ -209,7 +219,7 @@ or if it is stored out of line (in which case the value field stores a
209reference to where the actual value is stored). This allows large values 219reference to where the actual value is stored). This allows large values
210to be stored out of line improving scanning and lookup performance and it 220to be stored out of line improving scanning and lookup performance and it
211also allows values to be de-duplicated, the value being stored once, and 221also allows values to be de-duplicated, the value being stored once, and
212all other occurences holding an out of line reference to that value. 222all other occurrences holding an out of line reference to that value.
213 223
214The xattr lists are packed into compressed 8K metadata blocks. 224The xattr lists are packed into compressed 8K metadata blocks.
215To reduce overhead in inodes, rather than storing the on-disk 225To reduce overhead in inodes, rather than storing the on-disk
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 5d1335faec2d..597f728e7b4e 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -39,10 +39,12 @@ userspace. Top-level directories in sysfs represent the common
39ancestors of object hierarchies; i.e. the subsystems the objects 39ancestors of object hierarchies; i.e. the subsystems the objects
40belong to. 40belong to.
41 41
42Sysfs internally stores the kobject that owns the directory in the 42Sysfs internally stores a pointer to the kobject that implements a
43->d_fsdata pointer of the directory's dentry. This allows sysfs to do 43directory in the sysfs_dirent object associated with the directory. In
44reference counting directly on the kobject when the file is opened and 44the past this kobject pointer has been used by sysfs to do reference
45closed. 45counting directly on the kobject whenever the file is opened or closed.
46With the current sysfs implementation the kobject reference count is
47only modified directly by the function sysfs_schedule_callback().
46 48
47 49
48Attributes 50Attributes
@@ -60,7 +62,7 @@ values of the same type.
60 62
61Mixing types, expressing multiple lines of data, and doing fancy 63Mixing types, expressing multiple lines of data, and doing fancy
62formatting of data is heavily frowned upon. Doing these things may get 64formatting of data is heavily frowned upon. Doing these things may get
63you publically humiliated and your code rewritten without notice. 65you publicly humiliated and your code rewritten without notice.
64 66
65 67
66An attribute definition is simply: 68An attribute definition is simply:
@@ -208,9 +210,9 @@ Other notes:
208 is 4096. 210 is 4096.
209 211
210- show() methods should return the number of bytes printed into the 212- show() methods should return the number of bytes printed into the
211 buffer. This is the return value of snprintf(). 213 buffer. This is the return value of scnprintf().
212 214
213- show() should always use snprintf(). 215- show() should always use scnprintf().
214 216
215- store() should return the number of bytes used from the buffer. If the 217- store() should return the number of bytes used from the buffer. If the
216 entire buffer has been used, just return the count argument. 218 entire buffer has been used, just return the count argument.
@@ -229,7 +231,7 @@ A very simple (and naive) implementation of a device attribute is:
229static ssize_t show_name(struct device *dev, struct device_attribute *attr, 231static ssize_t show_name(struct device *dev, struct device_attribute *attr,
230 char *buf) 232 char *buf)
231{ 233{
232 return snprintf(buf, PAGE_SIZE, "%s\n", dev->name); 234 return scnprintf(buf, PAGE_SIZE, "%s\n", dev->name);
233} 235}
234 236
235static ssize_t store_name(struct device *dev, struct device_attribute *attr, 237static ssize_t store_name(struct device *dev, struct device_attribute *attr,
diff --git a/Documentation/filesystems/ubifs.txt b/Documentation/filesystems/ubifs.txt
index 12fedb7834c6..8e4fab639d9c 100644
--- a/Documentation/filesystems/ubifs.txt
+++ b/Documentation/filesystems/ubifs.txt
@@ -82,12 +82,12 @@ Mount options
82bulk_read read more in one go to take advantage of flash 82bulk_read read more in one go to take advantage of flash
83 media that read faster sequentially 83 media that read faster sequentially
84no_bulk_read (*) do not bulk-read 84no_bulk_read (*) do not bulk-read
85no_chk_data_crc skip checking of CRCs on data nodes in order to 85no_chk_data_crc (*) skip checking of CRCs on data nodes in order to
86 improve read performance. Use this option only 86 improve read performance. Use this option only
87 if the flash media is highly reliable. The effect 87 if the flash media is highly reliable. The effect
88 of this option is that corruption of the contents 88 of this option is that corruption of the contents
89 of a file can go unnoticed. 89 of a file can go unnoticed.
90chk_data_crc (*) do not skip checking CRCs on data nodes 90chk_data_crc do not skip checking CRCs on data nodes
91compr=none override default compressor and set it to "none" 91compr=none override default compressor and set it to "none"
92compr=lzo override default compressor and set it to "lzo" 92compr=lzo override default compressor and set it to "lzo"
93compr=zlib override default compressor and set it to "zlib" 93compr=zlib override default compressor and set it to "zlib"
@@ -115,28 +115,8 @@ ubi.mtd=0 root=ubi0:rootfs rootfstype=ubifs
115Module Parameters for Debugging 115Module Parameters for Debugging
116=============================== 116===============================
117 117
118When UBIFS has been compiled with debugging enabled, there are 3 module 118When UBIFS has been compiled with debugging enabled, there are 2 module
119parameters that are available to control aspects of testing and debugging. 119parameters that are available to control aspects of testing and debugging.
120The parameters are unsigned integers where each bit controls an option.
121The parameters are:
122
123debug_msgs Selects which debug messages to display, as follows:
124
125 Message Type Flag value
126
127 General messages 1
128 Journal messages 2
129 Mount messages 4
130 Commit messages 8
131 LEB search messages 16
132 Budgeting messages 32
133 Garbage collection messages 64
134 Tree Node Cache (TNC) messages 128
135 LEB properties (lprops) messages 256
136 Input/output messages 512
137 Log messages 1024
138 Scan messages 2048
139 Recovery messages 4096
140 120
141debug_chks Selects extra checks that UBIFS can do while running: 121debug_chks Selects extra checks that UBIFS can do while running:
142 122
@@ -154,11 +134,9 @@ debug_tsts Selects a mode of testing, as follows:
154 134
155 Test mode Flag value 135 Test mode Flag value
156 136
157 Force in-the-gaps method 2
158 Failure mode for recovery testing 4 137 Failure mode for recovery testing 4
159 138
160For example, set debug_msgs to 5 to display General messages and Mount 139For example, set debug_chks to 3 to enable general and TNC checks.
161messages.
162 140
163 141
164References 142References
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index ed7e5efc06d8..88b9f5519af9 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -95,10 +95,11 @@ functions:
95 extern int unregister_filesystem(struct file_system_type *); 95 extern int unregister_filesystem(struct file_system_type *);
96 96
97The passed struct file_system_type describes your filesystem. When a 97The passed struct file_system_type describes your filesystem. When a
98request is made to mount a device onto a directory in your filespace, 98request is made to mount a filesystem onto a directory in your namespace,
99the VFS will call the appropriate get_sb() method for the specific 99the VFS will call the appropriate mount() method for the specific
100filesystem. The dentry for the mount point will then be updated to 100filesystem. New vfsmount referring to the tree returned by ->mount()
101point to the root inode for the new filesystem. 101will be attached to the mountpoint, so that when pathname resolution
102reaches the mountpoint it will jump into the root of that vfsmount.
102 103
103You can see all filesystems that are registered to the kernel in the 104You can see all filesystems that are registered to the kernel in the
104file /proc/filesystems. 105file /proc/filesystems.
@@ -107,14 +108,14 @@ file /proc/filesystems.
107struct file_system_type 108struct file_system_type
108----------------------- 109-----------------------
109 110
110This describes the filesystem. As of kernel 2.6.22, the following 111This describes the filesystem. As of kernel 2.6.39, the following
111members are defined: 112members are defined:
112 113
113struct file_system_type { 114struct file_system_type {
114 const char *name; 115 const char *name;
115 int fs_flags; 116 int fs_flags;
116 int (*get_sb) (struct file_system_type *, int, 117 struct dentry (*mount) (struct file_system_type *, int,
117 const char *, void *, struct vfsmount *); 118 const char *, void *);
118 void (*kill_sb) (struct super_block *); 119 void (*kill_sb) (struct super_block *);
119 struct module *owner; 120 struct module *owner;
120 struct file_system_type * next; 121 struct file_system_type * next;
@@ -128,11 +129,11 @@ struct file_system_type {
128 129
129 fs_flags: various flags (i.e. FS_REQUIRES_DEV, FS_NO_DCACHE, etc.) 130 fs_flags: various flags (i.e. FS_REQUIRES_DEV, FS_NO_DCACHE, etc.)
130 131
131 get_sb: the method to call when a new instance of this 132 mount: the method to call when a new instance of this
132 filesystem should be mounted 133 filesystem should be mounted
133 134
134 kill_sb: the method to call when an instance of this filesystem 135 kill_sb: the method to call when an instance of this filesystem
135 should be unmounted 136 should be shut down
136 137
137 owner: for internal VFS use: you should initialize this to THIS_MODULE in 138 owner: for internal VFS use: you should initialize this to THIS_MODULE in
138 most cases. 139 most cases.
@@ -141,7 +142,7 @@ struct file_system_type {
141 142
142 s_lock_key, s_umount_key: lockdep-specific 143 s_lock_key, s_umount_key: lockdep-specific
143 144
144The get_sb() method has the following arguments: 145The mount() method has the following arguments:
145 146
146 struct file_system_type *fs_type: describes the filesystem, partly initialized 147 struct file_system_type *fs_type: describes the filesystem, partly initialized
147 by the specific filesystem code 148 by the specific filesystem code
@@ -153,32 +154,39 @@ The get_sb() method has the following arguments:
153 void *data: arbitrary mount options, usually comes as an ASCII 154 void *data: arbitrary mount options, usually comes as an ASCII
154 string (see "Mount Options" section) 155 string (see "Mount Options" section)
155 156
156 struct vfsmount *mnt: a vfs-internal representation of a mount point 157The mount() method must return the root dentry of the tree requested by
158caller. An active reference to its superblock must be grabbed and the
159superblock must be locked. On failure it should return ERR_PTR(error).
157 160
158The get_sb() method must determine if the block device specified 161The arguments match those of mount(2) and their interpretation
159in the dev_name and fs_type contains a filesystem of the type the method 162depends on filesystem type. E.g. for block filesystems, dev_name is
160supports. If it succeeds in opening the named block device, it initializes a 163interpreted as block device name, that device is opened and if it
161struct super_block descriptor for the filesystem contained by the block device. 164contains a suitable filesystem image the method creates and initializes
162On failure it returns an error. 165struct super_block accordingly, returning its root dentry to caller.
166
167->mount() may choose to return a subtree of existing filesystem - it
168doesn't have to create a new one. The main result from the caller's
169point of view is a reference to dentry at the root of (sub)tree to
170be attached; creation of new superblock is a common side effect.
163 171
164The most interesting member of the superblock structure that the 172The most interesting member of the superblock structure that the
165get_sb() method fills in is the "s_op" field. This is a pointer to 173mount() method fills in is the "s_op" field. This is a pointer to
166a "struct super_operations" which describes the next level of the 174a "struct super_operations" which describes the next level of the
167filesystem implementation. 175filesystem implementation.
168 176
169Usually, a filesystem uses one of the generic get_sb() implementations 177Usually, a filesystem uses one of the generic mount() implementations
170and provides a fill_super() method instead. The generic methods are: 178and provides a fill_super() callback instead. The generic variants are:
171 179
172 get_sb_bdev: mount a filesystem residing on a block device 180 mount_bdev: mount a filesystem residing on a block device
173 181
174 get_sb_nodev: mount a filesystem that is not backed by a device 182 mount_nodev: mount a filesystem that is not backed by a device
175 183
176 get_sb_single: mount a filesystem which shares the instance between 184 mount_single: mount a filesystem which shares the instance between
177 all mounts 185 all mounts
178 186
179A fill_super() method implementation has the following arguments: 187A fill_super() callback implementation has the following arguments:
180 188
181 struct super_block *sb: the superblock structure. The method fill_super() 189 struct super_block *sb: the superblock structure. The callback
182 must initialize this properly. 190 must initialize this properly.
183 191
184 void *data: arbitrary mount options, usually comes as an ASCII 192 void *data: arbitrary mount options, usually comes as an ASCII
@@ -203,7 +211,7 @@ struct super_operations {
203 struct inode *(*alloc_inode)(struct super_block *sb); 211 struct inode *(*alloc_inode)(struct super_block *sb);
204 void (*destroy_inode)(struct inode *); 212 void (*destroy_inode)(struct inode *);
205 213
206 void (*dirty_inode) (struct inode *); 214 void (*dirty_inode) (struct inode *, int flags);
207 int (*write_inode) (struct inode *, int); 215 int (*write_inode) (struct inode *, int);
208 void (*drop_inode) (struct inode *); 216 void (*drop_inode) (struct inode *);
209 void (*delete_inode) (struct inode *); 217 void (*delete_inode) (struct inode *);
@@ -246,7 +254,7 @@ or bottom half).
246 should be synchronous or not, not all filesystems check this flag. 254 should be synchronous or not, not all filesystems check this flag.
247 255
248 drop_inode: called when the last access to the inode is dropped, 256 drop_inode: called when the last access to the inode is dropped,
249 with the inode_lock spinlock held. 257 with the inode->i_lock spinlock held.
250 258
251 This method should be either NULL (normal UNIX filesystem 259 This method should be either NULL (normal UNIX filesystem
252 semantics) or "generic_delete_inode" (for filesystems that do not 260 semantics) or "generic_delete_inode" (for filesystems that do not
@@ -325,7 +333,8 @@ struct inode_operations {
325 void * (*follow_link) (struct dentry *, struct nameidata *); 333 void * (*follow_link) (struct dentry *, struct nameidata *);
326 void (*put_link) (struct dentry *, struct nameidata *, void *); 334 void (*put_link) (struct dentry *, struct nameidata *, void *);
327 void (*truncate) (struct inode *); 335 void (*truncate) (struct inode *);
328 int (*permission) (struct inode *, int, struct nameidata *); 336 int (*permission) (struct inode *, int, unsigned int);
337 int (*check_acl)(struct inode *, int, unsigned int);
329 int (*setattr) (struct dentry *, struct iattr *); 338 int (*setattr) (struct dentry *, struct iattr *);
330 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); 339 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
331 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); 340 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
@@ -414,6 +423,13 @@ otherwise noted.
414 permission: called by the VFS to check for access rights on a POSIX-like 423 permission: called by the VFS to check for access rights on a POSIX-like
415 filesystem. 424 filesystem.
416 425
426 May be called in rcu-walk mode (flags & IPERM_FLAG_RCU). If in rcu-walk
427 mode, the filesystem must check the permission without blocking or
428 storing to the inode.
429
430 If a situation is encountered that rcu-walk cannot handle, return
431 -ECHILD and it will be called again in ref-walk mode.
432
417 setattr: called by the VFS to set attributes for a file. This method 433 setattr: called by the VFS to set attributes for a file. This method
418 is called by chmod(2) and related system calls. 434 is called by chmod(2) and related system calls.
419 435
@@ -534,6 +550,7 @@ struct address_space_operations {
534 sector_t (*bmap)(struct address_space *, sector_t); 550 sector_t (*bmap)(struct address_space *, sector_t);
535 int (*invalidatepage) (struct page *, unsigned long); 551 int (*invalidatepage) (struct page *, unsigned long);
536 int (*releasepage) (struct page *, int); 552 int (*releasepage) (struct page *, int);
553 void (*freepage)(struct page *);
537 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, 554 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
538 loff_t offset, unsigned long nr_segs); 555 loff_t offset, unsigned long nr_segs);
539 struct page* (*get_xip_page)(struct address_space *, sector_t, 556 struct page* (*get_xip_page)(struct address_space *, sector_t,
@@ -660,11 +677,10 @@ struct address_space_operations {
660 releasepage: releasepage is called on PagePrivate pages to indicate 677 releasepage: releasepage is called on PagePrivate pages to indicate
661 that the page should be freed if possible. ->releasepage 678 that the page should be freed if possible. ->releasepage
662 should remove any private data from the page and clear the 679 should remove any private data from the page and clear the
663 PagePrivate flag. It may also remove the page from the 680 PagePrivate flag. If releasepage() fails for some reason, it must
664 address_space. If this fails for some reason, it may indicate 681 indicate failure with a 0 return value.
665 failure with a 0 return value. 682 releasepage() is used in two distinct though related cases. The
666 This is used in two distinct though related cases. The first 683 first is when the VM finds a clean page with no active users and
667 is when the VM finds a clean page with no active users and
668 wants to make it a free page. If ->releasepage succeeds, the 684 wants to make it a free page. If ->releasepage succeeds, the
669 page will be removed from the address_space and become free. 685 page will be removed from the address_space and become free.
670 686
@@ -679,6 +695,12 @@ struct address_space_operations {
679 need to ensure this. Possibly it can clear the PageUptodate 695 need to ensure this. Possibly it can clear the PageUptodate
680 bit if it cannot free private data yet. 696 bit if it cannot free private data yet.
681 697
698 freepage: freepage is called once the page is no longer visible in
699 the page cache in order to allow the cleanup of any private
700 data. Since it may be called by the memory reclaimer, it
701 should not assume that the original address_space mapping still
702 exists, and it should not block.
703
682 direct_IO: called by the generic read/write routines to perform 704 direct_IO: called by the generic read/write routines to perform
683 direct_IO - that is IO requests which bypass the page cache 705 direct_IO - that is IO requests which bypass the page cache
684 and transfer data directly between the storage and the 706 and transfer data directly between the storage and the
@@ -841,12 +863,17 @@ defined:
841 863
842struct dentry_operations { 864struct dentry_operations {
843 int (*d_revalidate)(struct dentry *, struct nameidata *); 865 int (*d_revalidate)(struct dentry *, struct nameidata *);
844 int (*d_hash) (struct dentry *, struct qstr *); 866 int (*d_hash)(const struct dentry *, const struct inode *,
845 int (*d_compare) (struct dentry *, struct qstr *, struct qstr *); 867 struct qstr *);
846 int (*d_delete)(struct dentry *); 868 int (*d_compare)(const struct dentry *, const struct inode *,
869 const struct dentry *, const struct inode *,
870 unsigned int, const char *, const struct qstr *);
871 int (*d_delete)(const struct dentry *);
847 void (*d_release)(struct dentry *); 872 void (*d_release)(struct dentry *);
848 void (*d_iput)(struct dentry *, struct inode *); 873 void (*d_iput)(struct dentry *, struct inode *);
849 char *(*d_dname)(struct dentry *, char *, int); 874 char *(*d_dname)(struct dentry *, char *, int);
875 struct vfsmount *(*d_automount)(struct path *);
876 int (*d_manage)(struct dentry *, bool);
850}; 877};
851 878
852 d_revalidate: called when the VFS needs to revalidate a dentry. This 879 d_revalidate: called when the VFS needs to revalidate a dentry. This
@@ -854,13 +881,45 @@ struct dentry_operations {
854 dcache. Most filesystems leave this as NULL, because all their 881 dcache. Most filesystems leave this as NULL, because all their
855 dentries in the dcache are valid 882 dentries in the dcache are valid
856 883
857 d_hash: called when the VFS adds a dentry to the hash table 884 d_revalidate may be called in rcu-walk mode (nd->flags & LOOKUP_RCU).
885 If in rcu-walk mode, the filesystem must revalidate the dentry without
886 blocking or storing to the dentry, d_parent and d_inode should not be
887 used without care (because they can go NULL), instead nd->inode should
888 be used.
889
890 If a situation is encountered that rcu-walk cannot handle, return
891 -ECHILD and it will be called again in ref-walk mode.
892
893 d_hash: called when the VFS adds a dentry to the hash table. The first
894 dentry passed to d_hash is the parent directory that the name is
895 to be hashed into. The inode is the dentry's inode.
858 896
859 d_compare: called when a dentry should be compared with another 897 Same locking and synchronisation rules as d_compare regarding
898 what is safe to dereference etc.
860 899
861 d_delete: called when the last reference to a dentry is 900 d_compare: called to compare a dentry name with a given name. The first
862 deleted. This means no-one is using the dentry, however it is 901 dentry is the parent of the dentry to be compared, the second is
863 still valid and in the dcache 902 the parent's inode, then the dentry and inode (may be NULL) of the
903 child dentry. len and name string are properties of the dentry to be
904 compared. qstr is the name to compare it with.
905
906 Must be constant and idempotent, and should not take locks if
907 possible, and should not or store into the dentry or inodes.
908 Should not dereference pointers outside the dentry or inodes without
909 lots of care (eg. d_parent, d_inode, d_name should not be used).
910
911 However, our vfsmount is pinned, and RCU held, so the dentries and
912 inodes won't disappear, neither will our sb or filesystem module.
913 ->i_sb and ->d_sb may be used.
914
915 It is a tricky calling convention because it needs to be called under
916 "rcu-walk", ie. without any locks or references on things.
917
918 d_delete: called when the last reference to a dentry is dropped and the
919 dcache is deciding whether or not to cache it. Return 1 to delete
920 immediately, or 0 to cache the dentry. Default is NULL which means to
921 always cache a reachable dentry. d_delete must be constant and
922 idempotent.
864 923
865 d_release: called when a dentry is really deallocated 924 d_release: called when a dentry is really deallocated
866 925
@@ -881,6 +940,43 @@ struct dentry_operations {
881 at the end of the buffer, and returns a pointer to the first char. 940 at the end of the buffer, and returns a pointer to the first char.
882 dynamic_dname() helper function is provided to take care of this. 941 dynamic_dname() helper function is provided to take care of this.
883 942
943 d_automount: called when an automount dentry is to be traversed (optional).
944 This should create a new VFS mount record and return the record to the
945 caller. The caller is supplied with a path parameter giving the
946 automount directory to describe the automount target and the parent
947 VFS mount record to provide inheritable mount parameters. NULL should
948 be returned if someone else managed to make the automount first. If
949 the vfsmount creation failed, then an error code should be returned.
950 If -EISDIR is returned, then the directory will be treated as an
951 ordinary directory and returned to pathwalk to continue walking.
952
953 If a vfsmount is returned, the caller will attempt to mount it on the
954 mountpoint and will remove the vfsmount from its expiration list in
955 the case of failure. The vfsmount should be returned with 2 refs on
956 it to prevent automatic expiration - the caller will clean up the
957 additional ref.
958
959 This function is only used if DCACHE_NEED_AUTOMOUNT is set on the
960 dentry. This is set by __d_instantiate() if S_AUTOMOUNT is set on the
961 inode being added.
962
963 d_manage: called to allow the filesystem to manage the transition from a
964 dentry (optional). This allows autofs, for example, to hold up clients
965 waiting to explore behind a 'mountpoint' whilst letting the daemon go
966 past and construct the subtree there. 0 should be returned to let the
967 calling process continue. -EISDIR can be returned to tell pathwalk to
968 use this directory as an ordinary directory and to ignore anything
969 mounted on it and not to check the automount flag. Any other error
970 code will abort pathwalk completely.
971
972 If the 'rcu_walk' parameter is true, then the caller is doing a
973 pathwalk in RCU-walk mode. Sleeping is not permitted in this mode,
974 and the caller can be asked to leave it and call again by returing
975 -ECHILD.
976
977 This function is only used if DCACHE_MANAGE_TRANSIT is set on the
978 dentry being transited from.
979
884Example : 980Example :
885 981
886static char *pipefs_dname(struct dentry *dent, char *buffer, int buflen) 982static char *pipefs_dname(struct dentry *dent, char *buffer, int buflen)
@@ -904,14 +1000,11 @@ manipulate dentries:
904 the usage count) 1000 the usage count)
905 1001
906 dput: close a handle for a dentry (decrements the usage count). If 1002 dput: close a handle for a dentry (decrements the usage count). If
907 the usage count drops to 0, the "d_delete" method is called 1003 the usage count drops to 0, and the dentry is still in its
908 and the dentry is placed on the unused list if the dentry is 1004 parent's hash, the "d_delete" method is called to check whether
909 still in its parents hash list. Putting the dentry on the 1005 it should be cached. If it should not be cached, or if the dentry
910 unused list just means that if the system needs some RAM, it 1006 is not hashed, it is deleted. Otherwise cached dentries are put
911 goes through the unused list of dentries and deallocates them. 1007 into an LRU list to be reclaimed on memory shortage.
912 If the dentry has already been unhashed and the usage count
913 drops to 0, in this case the dentry is deallocated after the
914 "d_delete" method is called
915 1008
916 d_drop: this unhashes a dentry from its parents hash list. A 1009 d_drop: this unhashes a dentry from its parents hash list. A
917 subsequent call to dput() will deallocate the dentry if its 1010 subsequent call to dput() will deallocate the dentry if its
diff --git a/Documentation/filesystems/xfs-delayed-logging-design.txt b/Documentation/filesystems/xfs-delayed-logging-design.txt
index 96d0df28bed3..2ce36439c09f 100644
--- a/Documentation/filesystems/xfs-delayed-logging-design.txt
+++ b/Documentation/filesystems/xfs-delayed-logging-design.txt
@@ -42,7 +42,7 @@ the aggregation of all the previous changes currently held only in the log.
42This relogging technique also allows objects to be moved forward in the log so 42This relogging technique also allows objects to be moved forward in the log so
43that an object being relogged does not prevent the tail of the log from ever 43that an object being relogged does not prevent the tail of the log from ever
44moving forward. This can be seen in the table above by the changing 44moving forward. This can be seen in the table above by the changing
45(increasing) LSN of each subsquent transaction - the LSN is effectively a 45(increasing) LSN of each subsequent transaction - the LSN is effectively a
46direct encoding of the location in the log of the transaction. 46direct encoding of the location in the log of the transaction.
47 47
48This relogging is also used to implement long-running, multiple-commit 48This relogging is also used to implement long-running, multiple-commit
@@ -338,7 +338,7 @@ the same time another transaction modifies the item and inserts the log item
338into the new CIL, then checkpoint transaction commit code cannot use log items 338into the new CIL, then checkpoint transaction commit code cannot use log items
339to store the list of log vectors that need to be written into the transaction. 339to store the list of log vectors that need to be written into the transaction.
340Hence log vectors need to be able to be chained together to allow them to be 340Hence log vectors need to be able to be chained together to allow them to be
341detatched from the log items. That is, when the CIL is flushed the memory 341detached from the log items. That is, when the CIL is flushed the memory
342buffer and log vector attached to each log item needs to be attached to the 342buffer and log vector attached to each log item needs to be attached to the
343checkpoint context so that the log item can be released. In diagrammatic form, 343checkpoint context so that the log item can be released. In diagrammatic form,
344the CIL would look like this before the flush: 344the CIL would look like this before the flush:
@@ -577,7 +577,7 @@ only becomes unpinned when all the transactions complete and there are no
577pending transactions. Thus the pinning and unpinning of a log item is symmetric 577pending transactions. Thus the pinning and unpinning of a log item is symmetric
578as there is a 1:1 relationship with transaction commit and log item completion. 578as there is a 1:1 relationship with transaction commit and log item completion.
579 579
580For delayed logging, however, we have an assymetric transaction commit to 580For delayed logging, however, we have an asymmetric transaction commit to
581completion relationship. Every time an object is relogged in the CIL it goes 581completion relationship. Every time an object is relogged in the CIL it goes
582through the commit process without a corresponding completion being registered. 582through the commit process without a corresponding completion being registered.
583That is, we now have a many-to-one relationship between transaction commit and 583That is, we now have a many-to-one relationship between transaction commit and
@@ -780,7 +780,7 @@ With delayed logging, there are new steps inserted into the life cycle:
780From this, it can be seen that the only life cycle differences between the two 780From this, it can be seen that the only life cycle differences between the two
781logging methods are in the middle of the life cycle - they still have the same 781logging methods are in the middle of the life cycle - they still have the same
782beginning and end and execution constraints. The only differences are in the 782beginning and end and execution constraints. The only differences are in the
783commiting of the log items to the log itself and the completion processing. 783committing of the log items to the log itself and the completion processing.
784Hence delayed logging should not introduce any constraints on log item 784Hence delayed logging should not introduce any constraints on log item
785behaviour, allocation or freeing that don't already exist. 785behaviour, allocation or freeing that don't already exist.
786 786
@@ -791,21 +791,3 @@ mount option. Fundamentally, there is no reason why the log manager would not
791be able to swap methods automatically and transparently depending on load 791be able to swap methods automatically and transparently depending on load
792characteristics, but this should not be necessary if delayed logging works as 792characteristics, but this should not be necessary if delayed logging works as
793designed. 793designed.
794
795Roadmap:
796
7972.6.37 Remove experimental tag from mount option
798 => should be roughly 6 months after initial merge
799 => enough time to:
800 => gain confidence and fix problems reported by early
801 adopters (a.k.a. guinea pigs)
802 => address worst performance regressions and undesired
803 behaviours
804 => start tuning/optimising code for parallelism
805 => start tuning/optimising algorithms consuming
806 excessive CPU time
807
8082.6.39 Switch default mount option to use delayed logging
809 => should be roughly 12 months after initial merge
810 => enough time to shake out remaining problems before next round of
811 enterprise distro kernel rebases
diff --git a/Documentation/filesystems/xfs.txt b/Documentation/filesystems/xfs.txt
index 7bff3e4f35df..3fc0c31a6f5d 100644
--- a/Documentation/filesystems/xfs.txt
+++ b/Documentation/filesystems/xfs.txt
@@ -39,6 +39,12 @@ When mounting an XFS filesystem, the following options are accepted.
39 drive level write caching to be enabled, for devices that 39 drive level write caching to be enabled, for devices that
40 support write barriers. 40 support write barriers.
41 41
42 discard
43 Issue command to let the block device reclaim space freed by the
44 filesystem. This is useful for SSD devices, thinly provisioned
45 LUNs and virtual machine images, but may have a performance
46 impact. This option is incompatible with the nodelaylog option.
47
42 dmapi 48 dmapi
43 Enable the DMAPI (Data Management API) event callouts. 49 Enable the DMAPI (Data Management API) event callouts.
44 Use with the "mtpt" option. 50 Use with the "mtpt" option.
diff --git a/Documentation/flexible-arrays.txt b/Documentation/flexible-arrays.txt
index cb8a3a00cc92..df904aec9904 100644
--- a/Documentation/flexible-arrays.txt
+++ b/Documentation/flexible-arrays.txt
@@ -66,10 +66,10 @@ trick is to ensure that any needed memory allocations are done before
66entering atomic context, using: 66entering atomic context, using:
67 67
68 int flex_array_prealloc(struct flex_array *array, unsigned int start, 68 int flex_array_prealloc(struct flex_array *array, unsigned int start,
69 unsigned int end, gfp_t flags); 69 unsigned int nr_elements, gfp_t flags);
70 70
71This function will ensure that memory for the elements indexed in the range 71This function will ensure that memory for the elements indexed in the range
72defined by start and end has been allocated. Thereafter, a 72defined by start and nr_elements has been allocated. Thereafter, a
73flex_array_put() call on an element in that range is guaranteed not to 73flex_array_put() call on an element in that range is guaranteed not to
74block. 74block.
75 75
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt
index 9633da01ff46..792faa3c06cf 100644
--- a/Documentation/gpio.txt
+++ b/Documentation/gpio.txt
@@ -617,6 +617,16 @@ and have the following read/write attributes:
617 is configured as an output, this value may be written; 617 is configured as an output, this value may be written;
618 any nonzero value is treated as high. 618 any nonzero value is treated as high.
619 619
620 If the pin can be configured as interrupt-generating interrupt
621 and if it has been configured to generate interrupts (see the
622 description of "edge"), you can poll(2) on that file and
623 poll(2) will return whenever the interrupt was triggered. If
624 you use poll(2), set the events POLLPRI and POLLERR. If you
625 use select(2), set the file descriptor in exceptfds. After
626 poll(2) returns, either lseek(2) to the beginning of the sysfs
627 file and read the new value or close the file and re-open it
628 to read the value.
629
620 "edge" ... reads as either "none", "rising", "falling", or 630 "edge" ... reads as either "none", "rising", "falling", or
621 "both". Write these strings to select the signal edge(s) 631 "both". Write these strings to select the signal edge(s)
622 that will make poll(2) on the "value" file return. 632 that will make poll(2) on the "value" file return.
diff --git a/Documentation/usb/hiddev.txt b/Documentation/hid/hiddev.txt
index 6e8c9f1d2f22..6e8c9f1d2f22 100644
--- a/Documentation/usb/hiddev.txt
+++ b/Documentation/hid/hiddev.txt
diff --git a/Documentation/hid/hidraw.txt b/Documentation/hid/hidraw.txt
new file mode 100644
index 000000000000..029e6cb9a7e8
--- /dev/null
+++ b/Documentation/hid/hidraw.txt
@@ -0,0 +1,119 @@
1 HIDRAW - Raw Access to USB and Bluetooth Human Interface Devices
2 ==================================================================
3
4The hidraw driver provides a raw interface to USB and Bluetooth Human
5Interface Devices (HIDs). It differs from hiddev in that reports sent and
6received are not parsed by the HID parser, but are sent to and received from
7the device unmodified.
8
9Hidraw should be used if the userspace application knows exactly how to
10communicate with the hardware device, and is able to construct the HID
11reports manually. This is often the case when making userspace drivers for
12custom HID devices.
13
14Hidraw is also useful for communicating with non-conformant HID devices
15which send and receive data in a way that is inconsistent with their report
16descriptors. Because hiddev parses reports which are sent and received
17through it, checking them against the device's report descriptor, such
18communication with these non-conformant devices is impossible using hiddev.
19Hidraw is the only alternative, short of writing a custom kernel driver, for
20these non-conformant devices.
21
22A benefit of hidraw is that its use by userspace applications is independent
23of the underlying hardware type. Currently, Hidraw is implemented for USB
24and Bluetooth. In the future, as new hardware bus types are developed which
25use the HID specification, hidraw will be expanded to add support for these
26new bus types.
27
28Hidraw uses a dynamic major number, meaning that udev should be relied on to
29create hidraw device nodes. Udev will typically create the device nodes
30directly under /dev (eg: /dev/hidraw0). As this location is distribution-
31and udev rule-dependent, applications should use libudev to locate hidraw
32devices attached to the system. There is a tutorial on libudev with a
33working example at:
34 http://www.signal11.us/oss/udev/
35
36The HIDRAW API
37---------------
38
39read()
40-------
41read() will read a queued report received from the HID device. On USB
42devices, the reports read using read() are the reports sent from the device
43on the INTERRUPT IN endpoint. By default, read() will block until there is
44a report available to be read. read() can be made non-blocking, by passing
45the O_NONBLOCK flag to open(), or by setting the O_NONBLOCK flag using
46fcntl().
47
48On a device which uses numbered reports, the first byte of the returned data
49will be the report number; the report data follows, beginning in the second
50byte. For devices which do not use numbered reports, the report data
51will begin at the first byte.
52
53write()
54--------
55The write() function will write a report to the device. For USB devices, if
56the device has an INTERRUPT OUT endpoint, the report will be sent on that
57endpoint. If it does not, the report will be sent over the control endpoint,
58using a SET_REPORT transfer.
59
60The first byte of the buffer passed to write() should be set to the report
61number. If the device does not use numbered reports, the first byte should
62be set to 0. The report data itself should begin at the second byte.
63
64ioctl()
65--------
66Hidraw supports the following ioctls:
67
68HIDIOCGRDESCSIZE: Get Report Descriptor Size
69This ioctl will get the size of the device's report descriptor.
70
71HIDIOCGRDESC: Get Report Descriptor
72This ioctl returns the device's report descriptor using a
73hidraw_report_descriptor struct. Make sure to set the size field of the
74hidraw_report_descriptor struct to the size returned from HIDIOCGRDESCSIZE.
75
76HIDIOCGRAWINFO: Get Raw Info
77This ioctl will return a hidraw_devinfo struct containing the bus type, the
78vendor ID (VID), and product ID (PID) of the device. The bus type can be one
79of:
80 BUS_USB
81 BUS_HIL
82 BUS_BLUETOOTH
83 BUS_VIRTUAL
84which are defined in linux/input.h.
85
86HIDIOCGRAWNAME(len): Get Raw Name
87This ioctl returns a string containing the vendor and product strings of
88the device. The returned string is Unicode, UTF-8 encoded.
89
90HIDIOCGRAWPHYS(len): Get Physical Address
91This ioctl returns a string representing the physical address of the device.
92For USB devices, the string contains the physical path to the device (the
93USB controller, hubs, ports, etc). For Bluetooth devices, the string
94contains the hardware (MAC) address of the device.
95
96HIDIOCSFEATURE(len): Send a Feature Report
97This ioctl will send a feature report to the device. Per the HID
98specification, feature reports are always sent using the control endpoint.
99Set the first byte of the supplied buffer to the report number. For devices
100which do not use numbered reports, set the first byte to 0. The report data
101begins in the second byte. Make sure to set len accordingly, to one more
102than the length of the report (to account for the report number).
103
104HIDIOCGFEATURE(len): Get a Feature Report
105This ioctl will request a feature report from the device using the control
106endpoint. The first byte of the supplied buffer should be set to the report
107number of the requested report. For devices which do not use numbered
108reports, set the first byte to 0. The report will be returned starting at
109the first byte of the buffer (ie: the report number is not returned).
110
111Example
112---------
113In samples/, find hid-example.c, which shows examples of read(), write(),
114and all the ioctls for hidraw. The code may be used by anyone for any
115purpose, and can serve as a starting point for developing applications using
116hidraw.
117
118Document by:
119 Alan Ott <alan@signal11.us>, Signal 11 Software
diff --git a/Documentation/hwmon/abituguru b/Documentation/hwmon/abituguru
index 5eb3b9d5f0d5..915f32063a26 100644
--- a/Documentation/hwmon/abituguru
+++ b/Documentation/hwmon/abituguru
@@ -78,7 +78,7 @@ motherboards (most modern Abit motherboards).
78 78
79The first and second revision of the uGuru chip in reality is a Winbond 79The first and second revision of the uGuru chip in reality is a Winbond
80W83L950D in disguise (despite Abit claiming it is "a new microprocessor 80W83L950D in disguise (despite Abit claiming it is "a new microprocessor
81designed by the ABIT Engineers"). Unfortunatly this doesn't help since the 81designed by the ABIT Engineers"). Unfortunately this doesn't help since the
82W83L950D is a generic microcontroller with a custom Abit application running 82W83L950D is a generic microcontroller with a custom Abit application running
83on it. 83on it.
84 84
diff --git a/Documentation/hwmon/abituguru-datasheet b/Documentation/hwmon/abituguru-datasheet
index d9251efdcec7..8d2be8a0b1e3 100644
--- a/Documentation/hwmon/abituguru-datasheet
+++ b/Documentation/hwmon/abituguru-datasheet
@@ -5,9 +5,9 @@ First of all, what I know about uGuru is no fact based on any help, hints or
5datasheet from Abit. The data I have got on uGuru have I assembled through 5datasheet from Abit. The data I have got on uGuru have I assembled through
6my weak knowledge in "backwards engineering". 6my weak knowledge in "backwards engineering".
7And just for the record, you may have noticed uGuru isn't a chip developed by 7And just for the record, you may have noticed uGuru isn't a chip developed by
8Abit, as they claim it to be. It's realy just an microprocessor (uC) created by 8Abit, as they claim it to be. It's really just an microprocessor (uC) created by
9Winbond (W83L950D). And no, reading the manual for this specific uC or 9Winbond (W83L950D). And no, reading the manual for this specific uC or
10mailing Windbond for help won't give any usefull data about uGuru, as it is 10mailing Windbond for help won't give any useful data about uGuru, as it is
11the program inside the uC that is responding to calls. 11the program inside the uC that is responding to calls.
12 12
13Olle Sandberg <ollebull@gmail.com>, 2005-05-25 13Olle Sandberg <ollebull@gmail.com>, 2005-05-25
@@ -41,7 +41,7 @@ later on attached again data-port will hold 0x08, more about this later.
41 41
42After wider testing of the Linux kernel driver some variants of the uGuru have 42After wider testing of the Linux kernel driver some variants of the uGuru have
43turned up which will hold 0x00 instead of 0xAC at the CMD port, thus we also 43turned up which will hold 0x00 instead of 0xAC at the CMD port, thus we also
44have to test CMD for two different values. On these uGuru's DATA will initally 44have to test CMD for two different values. On these uGuru's DATA will initially
45hold 0x09 and will only hold 0x08 after reading CMD first, so CMD must be read 45hold 0x09 and will only hold 0x08 after reading CMD first, so CMD must be read
46first! 46first!
47 47
@@ -308,5 +308,5 @@ the voltage / clock programming out, I tried reading and only reading banks
308resulted in a _permanent_ reprogramming of the voltages, luckily I had the 308resulted in a _permanent_ reprogramming of the voltages, luckily I had the
309sensors part configured so that it would shutdown my system on any out of spec 309sensors part configured so that it would shutdown my system on any out of spec
310voltages which proprably safed my computer (after a reboot I managed to 310voltages which proprably safed my computer (after a reboot I managed to
311immediatly enter the bios and reload the defaults). This probably means that 311immediately enter the bios and reload the defaults). This probably means that
312the read/write cycle for the non sensor part is different from the sensor part. 312the read/write cycle for the non sensor part is different from the sensor part.
diff --git a/Documentation/hwmon/abituguru3 b/Documentation/hwmon/abituguru3
index fa598aac22fa..a6ccfe4bb6aa 100644
--- a/Documentation/hwmon/abituguru3
+++ b/Documentation/hwmon/abituguru3
@@ -47,7 +47,7 @@ This driver supports the hardware monitoring features of the third revision of
47the Abit uGuru chip, found on recent Abit uGuru featuring motherboards. 47the Abit uGuru chip, found on recent Abit uGuru featuring motherboards.
48 48
49The 3rd revision of the uGuru chip in reality is a Winbond W83L951G. 49The 3rd revision of the uGuru chip in reality is a Winbond W83L951G.
50Unfortunatly this doesn't help since the W83L951G is a generic microcontroller 50Unfortunately this doesn't help since the W83L951G is a generic microcontroller
51with a custom Abit application running on it. 51with a custom Abit application running on it.
52 52
53Despite Abit not releasing any information regarding the uGuru revision 3, 53Despite Abit not releasing any information regarding the uGuru revision 3,
diff --git a/Documentation/hwmon/adm1021 b/Documentation/hwmon/adm1021
index 03d02bfb3df1..02ad96cf9b2b 100644
--- a/Documentation/hwmon/adm1021
+++ b/Documentation/hwmon/adm1021
@@ -14,10 +14,6 @@ Supported chips:
14 Prefix: 'gl523sm' 14 Prefix: 'gl523sm'
15 Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e 15 Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
16 Datasheet: 16 Datasheet:
17 * Intel Xeon Processor
18 Prefix: - any other - may require 'force_adm1021' parameter
19 Addresses scanned: none
20 Datasheet: Publicly available at Intel website
21 * Maxim MAX1617 17 * Maxim MAX1617
22 Prefix: 'max1617' 18 Prefix: 'max1617'
23 Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e 19 Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
@@ -91,21 +87,27 @@ will do no harm, but will return 'old' values. It is possible to make
91ADM1021-clones do faster measurements, but there is really no good reason 87ADM1021-clones do faster measurements, but there is really no good reason
92for that. 88for that.
93 89
94Xeon support
95------------
96 90
97Some Xeon processors have real max1617, adm1021, or compatible chips 91Netburst-based Xeon support
98within them, with two temperature sensors. 92---------------------------
99 93
100Other Xeons have chips with only one sensor. 94Some Xeon processors based on the Netburst (early Pentium 4, from 2001 to
952003) microarchitecture had real MAX1617, ADM1021, or compatible chips
96within them, with two temperature sensors. Other Xeon processors of this
97era (with 400 MHz FSB) had chips with only one temperature sensor.
101 98
102If you have a Xeon, and the adm1021 module loads, and both temperatures 99If you have such an old Xeon, and you get two valid temperatures when
103appear valid, then things are good. 100loading the adm1021 module, then things are good.
104 101
105If the adm1021 module doesn't load, you should try this: 102If nothing happens when loading the adm1021 module, and you are certain
106 modprobe adm1021 force_adm1021=BUS,ADDRESS 103that your specific Xeon processor model includes compatible sensors, you
107 ADDRESS can only be 0x18, 0x1a, 0x29, 0x2b, 0x4c, or 0x4e. 104will have to explicitly instantiate the sensor chips from user-space. See
105method 4 in Documentation/i2c/instantiating-devices. Possible slave
106addresses are 0x18, 0x1a, 0x29, 0x2b, 0x4c, or 0x4e. It is likely that
107only temp2 will be correct and temp1 will have to be ignored.
108 108
109If you have dual Xeons you may have appear to have two separate 109Previous generations of the Xeon processor (based on Pentium II/III)
110adm1021-compatible chips, or two single-temperature sensors, at distinct 110didn't have these sensors. Next generations of Xeon processors (533 MHz
111addresses. 111FSB and faster) lost them, until the Core-based generation which
112introduced integrated digital thermal sensors. These are supported by
113the coretemp driver.
diff --git a/Documentation/hwmon/adm1275 b/Documentation/hwmon/adm1275
new file mode 100644
index 000000000000..6a3a6476cf20
--- /dev/null
+++ b/Documentation/hwmon/adm1275
@@ -0,0 +1,60 @@
1Kernel driver adm1275
2=====================
3
4Supported chips:
5 * Analog Devices ADM1275
6 Prefix: 'adm1275'
7 Addresses scanned: -
8 Datasheet: www.analog.com/static/imported-files/data_sheets/ADM1275.pdf
9
10Author: Guenter Roeck <guenter.roeck@ericsson.com>
11
12
13Description
14-----------
15
16This driver supports hardware montoring for Analog Devices ADM1275 Hot-Swap
17Controller and Digital Power Monitor.
18
19The ADM1275 is a hot-swap controller that allows a circuit board to be removed
20from or inserted into a live backplane. It also features current and voltage
21readback via an integrated 12-bit analog-to-digital converter (ADC), accessed
22using a PMBus. interface.
23
24The driver is a client driver to the core PMBus driver. Please see
25Documentation/hwmon/pmbus for details on PMBus client drivers.
26
27
28Usage Notes
29-----------
30
31This driver does not auto-detect devices. You will have to instantiate the
32devices explicitly. Please see Documentation/i2c/instantiating-devices for
33details.
34
35
36Platform data support
37---------------------
38
39The driver supports standard PMBus driver platform data. Please see
40Documentation/hwmon/pmbus for details.
41
42
43Sysfs entries
44-------------
45
46The following attributes are supported. Limits are read-write; all other
47attributes are read-only.
48
49in1_label "vin1" or "vout1" depending on chip variant and
50 configuration.
51in1_input Measured voltage. From READ_VOUT register.
52in1_min Minumum Voltage. From VOUT_UV_WARN_LIMIT register.
53in1_max Maximum voltage. From VOUT_OV_WARN_LIMIT register.
54in1_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status.
55in1_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status.
56
57curr1_label "iout1"
58curr1_input Measured current. From READ_IOUT register.
59curr1_max Maximum current. From IOUT_OC_WARN_LIMIT register.
60curr1_max_alarm Current high alarm. From IOUT_OC_WARN_LIMIT register.
diff --git a/Documentation/hwmon/adm9240 b/Documentation/hwmon/adm9240
index 2c6f1fed4618..36e8ec6aa868 100644
--- a/Documentation/hwmon/adm9240
+++ b/Documentation/hwmon/adm9240
@@ -155,7 +155,7 @@ connected to a normally open switch.
155The ADM9240 provides an internal open drain on this line, and may output 155The ADM9240 provides an internal open drain on this line, and may output
156a 20 ms active low pulse to reset an external Chassis Intrusion latch. 156a 20 ms active low pulse to reset an external Chassis Intrusion latch.
157 157
158Clear the CI latch by writing value 1 to the sysfs chassis_clear file. 158Clear the CI latch by writing value 0 to the sysfs intrusion0_alarm file.
159 159
160Alarm flags reported as 16-bit word 160Alarm flags reported as 16-bit word
161 161
diff --git a/Documentation/hwmon/ads1015 b/Documentation/hwmon/ads1015
new file mode 100644
index 000000000000..f6fe9c203733
--- /dev/null
+++ b/Documentation/hwmon/ads1015
@@ -0,0 +1,72 @@
1Kernel driver ads1015
2=====================
3
4Supported chips:
5 * Texas Instruments ADS1015
6 Prefix: 'ads1015'
7 Datasheet: Publicly available at the Texas Instruments website :
8 http://focus.ti.com/lit/ds/symlink/ads1015.pdf
9
10Authors:
11 Dirk Eibach, Guntermann & Drunck GmbH <eibach@gdsys.de>
12
13Description
14-----------
15
16This driver implements support for the Texas Instruments ADS1015.
17
18This device is a 12-bit A-D converter with 4 inputs.
19
20The inputs can be used single ended or in certain differential combinations.
21
22The inputs can be made available by 8 sysfs input files in0_input - in7_input:
23in0: Voltage over AIN0 and AIN1.
24in1: Voltage over AIN0 and AIN3.
25in2: Voltage over AIN1 and AIN3.
26in3: Voltage over AIN2 and AIN3.
27in4: Voltage over AIN0 and GND.
28in5: Voltage over AIN1 and GND.
29in6: Voltage over AIN2 and GND.
30in7: Voltage over AIN3 and GND.
31
32Which inputs are available can be configured using platform data or devicetree.
33
34By default all inputs are exported.
35
36Platform Data
37-------------
38
39In linux/i2c/ads1015.h platform data is defined, channel_data contains
40configuration data for the used input combinations:
41- pga is the programmable gain amplifier (values are full scale)
42 0: +/- 6.144 V
43 1: +/- 4.096 V
44 2: +/- 2.048 V
45 3: +/- 1.024 V
46 4: +/- 0.512 V
47 5: +/- 0.256 V
48- data_rate in samples per second
49 0: 128
50 1: 250
51 2: 490
52 3: 920
53 4: 1600
54 5: 2400
55 6: 3300
56
57Example:
58struct ads1015_platform_data data = {
59 .channel_data = {
60 [2] = { .enabled = true, .pga = 1, .data_rate = 0 },
61 [4] = { .enabled = true, .pga = 4, .data_rate = 5 },
62 }
63};
64
65In this case only in2_input (FS +/- 4.096 V, 128 SPS) and in4_input
66(FS +/- 0.512 V, 2400 SPS) would be created.
67
68Devicetree
69----------
70
71Configuration is also possible via devicetree:
72Documentation/devicetree/bindings/hwmon/ads1015.txt
diff --git a/Documentation/hwmon/ads7828 b/Documentation/hwmon/ads7828
index 75bc4beaf447..2bbebe6f771f 100644
--- a/Documentation/hwmon/ads7828
+++ b/Documentation/hwmon/ads7828
@@ -9,7 +9,7 @@ Supported chips:
9 http://focus.ti.com/lit/ds/symlink/ads7828.pdf 9 http://focus.ti.com/lit/ds/symlink/ads7828.pdf
10 10
11Authors: 11Authors:
12 Steve Hardy <steve@linuxrealtime.co.uk> 12 Steve Hardy <shardy@redhat.com>
13 13
14Module Parameters 14Module Parameters
15----------------- 15-----------------
diff --git a/Documentation/hwmon/coretemp b/Documentation/hwmon/coretemp
index 25568f844804..f85e913a3401 100644
--- a/Documentation/hwmon/coretemp
+++ b/Documentation/hwmon/coretemp
@@ -15,8 +15,13 @@ Author: Rudolf Marek
15 15
16Description 16Description
17----------- 17-----------
18This driver permits reading the DTS (Digital Temperature Sensor) embedded
19inside Intel CPUs. This driver can read both the per-core and per-package
20temperature using the appropriate sensors. The per-package sensor is new;
21as of now, it is present only in the SandyBridge platform. The driver will
22show the temperature of all cores inside a package under a single device
23directory inside hwmon.
18 24
19This driver permits reading temperature sensor embedded inside Intel Core CPU.
20Temperature is measured in degrees Celsius and measurement resolution is 25Temperature is measured in degrees Celsius and measurement resolution is
211 degree C. Valid temperatures are from 0 to TjMax degrees C, because 261 degree C. Valid temperatures are from 0 to TjMax degrees C, because
22the actual value of temperature register is in fact a delta from TjMax. 27the actual value of temperature register is in fact a delta from TjMax.
@@ -27,13 +32,15 @@ mechanism will perform actions to forcibly cool down the processor. Alarm
27may be raised, if the temperature grows enough (more than TjMax) to trigger 32may be raised, if the temperature grows enough (more than TjMax) to trigger
28the Out-Of-Spec bit. Following table summarizes the exported sysfs files: 33the Out-Of-Spec bit. Following table summarizes the exported sysfs files:
29 34
30temp1_input - Core temperature (in millidegrees Celsius). 35All Sysfs entries are named with their core_id (represented here by 'X').
31temp1_max - All cooling devices should be turned on (on Core2). 36tempX_input - Core temperature (in millidegrees Celsius).
32temp1_crit - Maximum junction temperature (in millidegrees Celsius). 37tempX_max - All cooling devices should be turned on (on Core2).
33temp1_crit_alarm - Set when Out-of-spec bit is set, never clears. 38tempX_crit - Maximum junction temperature (in millidegrees Celsius).
39tempX_crit_alarm - Set when Out-of-spec bit is set, never clears.
34 Correct CPU operation is no longer guaranteed. 40 Correct CPU operation is no longer guaranteed.
35temp1_label - Contains string "Core X", where X is processor 41tempX_label - Contains string "Core X", where X is processor
36 number. 42 number. For Package temp, this will be "Physical id Y",
43 where Y is the package number.
37 44
38The TjMax temperature is set to 85 degrees C if undocumented model specific 45The TjMax temperature is set to 85 degrees C if undocumented model specific
39register (UMSR) 0xee has bit 30 set. If not the TjMax is 100 degrees C as 46register (UMSR) 0xee has bit 30 set. If not the TjMax is 100 degrees C as
diff --git a/Documentation/hwmon/dme1737 b/Documentation/hwmon/dme1737
index fc5df7654d63..4d2935145a1c 100644
--- a/Documentation/hwmon/dme1737
+++ b/Documentation/hwmon/dme1737
@@ -42,7 +42,7 @@ Description
42This driver implements support for the hardware monitoring capabilities of the 42This driver implements support for the hardware monitoring capabilities of the
43SMSC DME1737 and Asus A8000 (which are the same), SMSC SCH5027, SCH311x, 43SMSC DME1737 and Asus A8000 (which are the same), SMSC SCH5027, SCH311x,
44and SCH5127 Super-I/O chips. These chips feature monitoring of 3 temp sensors 44and SCH5127 Super-I/O chips. These chips feature monitoring of 3 temp sensors
45temp[1-3] (2 remote diodes and 1 internal), 7 voltages in[0-6] (6 external and 45temp[1-3] (2 remote diodes and 1 internal), 8 voltages in[0-7] (7 external and
461 internal) and up to 6 fan speeds fan[1-6]. Additionally, the chips implement 461 internal) and up to 6 fan speeds fan[1-6]. Additionally, the chips implement
47up to 5 PWM outputs pwm[1-3,5-6] for controlling fan speeds both manually and 47up to 5 PWM outputs pwm[1-3,5-6] for controlling fan speeds both manually and
48automatically. 48automatically.
@@ -105,6 +105,7 @@ SCH5127:
105 in4: V1_IN 0V - 1.5V 105 in4: V1_IN 0V - 1.5V
106 in5: VTR (+3.3V standby) 0V - 4.38V 106 in5: VTR (+3.3V standby) 0V - 4.38V
107 in6: Vbat (+3.0V) 0V - 4.38V 107 in6: Vbat (+3.0V) 0V - 4.38V
108 in7: Vtrip (+1.5V) 0V - 1.99V
108 109
109Each voltage input has associated min and max limits which trigger an alarm 110Each voltage input has associated min and max limits which trigger an alarm
110when crossed. 111when crossed.
@@ -217,10 +218,10 @@ cpu0_vid RO CPU core reference voltage in
217vrm RW Voltage regulator module version 218vrm RW Voltage regulator module version
218 number. 219 number.
219 220
220in[0-6]_input RO Measured voltage in millivolts. 221in[0-7]_input RO Measured voltage in millivolts.
221in[0-6]_min RW Low limit for voltage input. 222in[0-7]_min RW Low limit for voltage input.
222in[0-6]_max RW High limit for voltage input. 223in[0-7]_max RW High limit for voltage input.
223in[0-6]_alarm RO Voltage input alarm. Returns 1 if 224in[0-7]_alarm RO Voltage input alarm. Returns 1 if
224 voltage input is or went outside the 225 voltage input is or went outside the
225 associated min-max range, 0 otherwise. 226 associated min-max range, 0 otherwise.
226 227
@@ -324,3 +325,4 @@ fan5 opt opt
324pwm5 opt opt 325pwm5 opt opt
325fan6 opt opt 326fan6 opt opt
326pwm6 opt opt 327pwm6 opt opt
328in7 yes
diff --git a/Documentation/hwmon/ds620 b/Documentation/hwmon/ds620
new file mode 100644
index 000000000000..1fbe3cd916cc
--- /dev/null
+++ b/Documentation/hwmon/ds620
@@ -0,0 +1,34 @@
1Kernel driver ds620
2===================
3
4Supported chips:
5 * Dallas Semiconductor DS620
6 Prefix: 'ds620'
7 Datasheet: Publicly available at the Dallas Semiconductor website
8 http://www.dalsemi.com/
9
10Authors:
11 Roland Stigge <stigge@antcom.de>
12 based on ds1621.c by
13 Christian W. Zuckschwerdt <zany@triq.net>
14
15Description
16-----------
17
18The DS620 is a (one instance) digital thermometer and thermostat. It has both
19high and low temperature limits which can be user defined (i.e. programmed
20into non-volatile on-chip registers). Temperature range is -55 degree Celsius
21to +125. Between 0 and 70 degree Celsius, accuracy is 0.5 Kelvin. The value
22returned via sysfs displays post decimal positions.
23
24The thermostat function works as follows: When configured via platform_data
25(struct ds620_platform_data) .pomode == 0 (default), the thermostat output pin
26PO is always low. If .pomode == 1, the thermostat is in PO_LOW mode. I.e., the
27output pin PO becomes active when the temperature falls below temp1_min and
28stays active until the temperature goes above temp1_max.
29
30Likewise, with .pomode == 2, the thermostat is in PO_HIGH mode. I.e., the PO
31output pin becomes active when the temperature goes above temp1_max and stays
32active until the temperature falls below temp1_min.
33
34The PO output pin of the DS620 operates active-low.
diff --git a/Documentation/hwmon/emc6w201 b/Documentation/hwmon/emc6w201
new file mode 100644
index 000000000000..32f355aaf56b
--- /dev/null
+++ b/Documentation/hwmon/emc6w201
@@ -0,0 +1,42 @@
1Kernel driver emc6w201
2======================
3
4Supported chips:
5 * SMSC EMC6W201
6 Prefix: 'emc6w201'
7 Addresses scanned: I2C 0x2c, 0x2d, 0x2e
8 Datasheet: Not public
9
10Author: Jean Delvare <khali@linux-fr.org>
11
12
13Description
14-----------
15
16From the datasheet:
17
18"The EMC6W201 is an environmental monitoring device with automatic fan
19control capability and enhanced system acoustics for noise suppression.
20This ACPI compliant device provides hardware monitoring for up to six
21voltages (including its own VCC) and five external thermal sensors,
22measures the speed of up to five fans, and controls the speed of
23multiple DC fans using three Pulse Width Modulator (PWM) outputs. Note
24that it is possible to control more than three fans by connecting two
25fans to one PWM output. The EMC6W201 will be available in a 36-pin
26QFN package."
27
28The device is functionally close to the EMC6D100 series, but is
29register-incompatible.
30
31The driver currently only supports the monitoring of the voltages,
32temperatures and fan speeds. Limits can be changed. Alarms are not
33supported, and neither is fan speed control.
34
35
36Known Systems With EMC6W201
37---------------------------
38
39The EMC6W201 is a rare device, only found on a few systems, made in
402005 and 2006. Known systems with this device:
41* Dell Precision 670 workstation
42* Gigabyte 2CEWH mainboard
diff --git a/Documentation/hwmon/f71882fg b/Documentation/hwmon/f71882fg
index a7952c2bd959..de91c0db5846 100644
--- a/Documentation/hwmon/f71882fg
+++ b/Documentation/hwmon/f71882fg
@@ -2,6 +2,14 @@ Kernel driver f71882fg
2====================== 2======================
3 3
4Supported chips: 4Supported chips:
5 * Fintek F71808E
6 Prefix: 'f71808e'
7 Addresses scanned: none, address read from Super I/O config space
8 Datasheet: Not public
9 * Fintek F71808A
10 Prefix: 'f71808a'
11 Addresses scanned: none, address read from Super I/O config space
12 Datasheet: Not public
5 * Fintek F71858FG 13 * Fintek F71858FG
6 Prefix: 'f71858fg' 14 Prefix: 'f71858fg'
7 Addresses scanned: none, address read from Super I/O config space 15 Addresses scanned: none, address read from Super I/O config space
@@ -10,6 +18,14 @@ Supported chips:
10 Prefix: 'f71862fg' 18 Prefix: 'f71862fg'
11 Addresses scanned: none, address read from Super I/O config space 19 Addresses scanned: none, address read from Super I/O config space
12 Datasheet: Available from the Fintek website 20 Datasheet: Available from the Fintek website
21 * Fintek F71869F and F71869E
22 Prefix: 'f71869'
23 Addresses scanned: none, address read from Super I/O config space
24 Datasheet: Available from the Fintek website
25 * Fintek F71869A
26 Prefix: 'f71869a'
27 Addresses scanned: none, address read from Super I/O config space
28 Datasheet: Not public
13 * Fintek F71882FG and F71883FG 29 * Fintek F71882FG and F71883FG
14 Prefix: 'f71882fg' 30 Prefix: 'f71882fg'
15 Addresses scanned: none, address read from Super I/O config space 31 Addresses scanned: none, address read from Super I/O config space
@@ -17,11 +33,30 @@ Supported chips:
17 * Fintek F71889FG 33 * Fintek F71889FG
18 Prefix: 'f71889fg' 34 Prefix: 'f71889fg'
19 Addresses scanned: none, address read from Super I/O config space 35 Addresses scanned: none, address read from Super I/O config space
36 Datasheet: Available from the Fintek website
37 * Fintek F71889ED
38 Prefix: 'f71889ed'
39 Addresses scanned: none, address read from Super I/O config space
40 Datasheet: Should become available on the Fintek website soon
41 * Fintek F71889A
42 Prefix: 'f71889a'
43 Addresses scanned: none, address read from Super I/O config space
20 Datasheet: Should become available on the Fintek website soon 44 Datasheet: Should become available on the Fintek website soon
21 * Fintek F8000 45 * Fintek F8000
22 Prefix: 'f8000' 46 Prefix: 'f8000'
23 Addresses scanned: none, address read from Super I/O config space 47 Addresses scanned: none, address read from Super I/O config space
24 Datasheet: Not public 48 Datasheet: Not public
49 * Fintek F81801U
50 Prefix: 'f71889fg'
51 Addresses scanned: none, address read from Super I/O config space
52 Datasheet: Not public
53 Note: This is the 64-pin variant of the F71889FG, they have the
54 same device ID and are fully compatible as far as hardware
55 monitoring is concerned.
56 * Fintek F81865F
57 Prefix: 'f81865f'
58 Addresses scanned: none, address read from Super I/O config space
59 Datasheet: Available from the Fintek website
25 60
26Author: Hans de Goede <hdegoede@redhat.com> 61Author: Hans de Goede <hdegoede@redhat.com>
27 62
@@ -29,9 +64,9 @@ Author: Hans de Goede <hdegoede@redhat.com>
29Description 64Description
30----------- 65-----------
31 66
32Fintek F718xxFG/F8000 Super I/O chips include complete hardware monitoring 67Fintek F718xx/F8000 Super I/O chips include complete hardware monitoring
33capabilities. They can monitor up to 9 voltages (3 for the F8000), 4 fans and 68capabilities. They can monitor up to 9 voltages, 4 fans and 3 temperature
343 temperature sensors. 69sensors.
35 70
36These chips also have fan controlling features, using either DC or PWM, in 71These chips also have fan controlling features, using either DC or PWM, in
37three different modes (one manual, two automatic). 72three different modes (one manual, two automatic).
@@ -99,5 +134,5 @@ Writing an unsupported mode will result in an invalid parameter error.
99 The fan speed is regulated to keep the temp the fan is mapped to between 134 The fan speed is regulated to keep the temp the fan is mapped to between
100 temp#_auto_point2_temp and temp#_auto_point3_temp. 135 temp#_auto_point2_temp and temp#_auto_point3_temp.
101 136
102Both of the automatic modes require that pwm1 corresponds to fan1, pwm2 to 137All of the automatic modes require that pwm1 corresponds to fan1, pwm2 to
103fan2 and pwm3 to fan3. 138fan2 and pwm3 to fan3.
diff --git a/Documentation/hwmon/fam15h_power b/Documentation/hwmon/fam15h_power
new file mode 100644
index 000000000000..a92918e0bd69
--- /dev/null
+++ b/Documentation/hwmon/fam15h_power
@@ -0,0 +1,37 @@
1Kernel driver fam15h_power
2==========================
3
4Supported chips:
5* AMD Family 15h Processors
6
7 Prefix: 'fam15h_power'
8 Addresses scanned: PCI space
9 Datasheets:
10 BIOS and Kernel Developer's Guide (BKDG) For AMD Family 15h Processors
11 (not yet published)
12
13Author: Andreas Herrmann <andreas.herrmann3@amd.com>
14
15Description
16-----------
17
18This driver permits reading of registers providing power information
19of AMD Family 15h processors.
20
21For AMD Family 15h processors the following power values can be
22calculated using different processor northbridge function registers:
23
24* BasePwrWatts: Specifies in watts the maximum amount of power
25 consumed by the processor for NB and logic external to the core.
26* ProcessorPwrWatts: Specifies in watts the maximum amount of power
27 the processor can support.
28* CurrPwrWatts: Specifies in watts the current amount of power being
29 consumed by the processor.
30
31This driver provides ProcessorPwrWatts and CurrPwrWatts:
32* power1_crit (ProcessorPwrWatts)
33* power1_input (CurrPwrWatts)
34
35On multi-node processors the calculated value is for the entire
36package and not for a single node. Thus the driver creates sysfs
37attributes only for internal node0 of a multi-node processor.
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87
index 8d08bf0d38ed..38425f0f2645 100644
--- a/Documentation/hwmon/it87
+++ b/Documentation/hwmon/it87
@@ -22,6 +22,10 @@ Supported chips:
22 Prefix: 'it8720' 22 Prefix: 'it8720'
23 Addresses scanned: from Super I/O config space (8 I/O ports) 23 Addresses scanned: from Super I/O config space (8 I/O ports)
24 Datasheet: Not publicly available 24 Datasheet: Not publicly available
25 * IT8721F/IT8758E
26 Prefix: 'it8721'
27 Addresses scanned: from Super I/O config space (8 I/O ports)
28 Datasheet: Not publicly available
25 * SiS950 [clone of IT8705F] 29 * SiS950 [clone of IT8705F]
26 Prefix: 'it87' 30 Prefix: 'it87'
27 Addresses scanned: from Super I/O config space (8 I/O ports) 31 Addresses scanned: from Super I/O config space (8 I/O ports)
@@ -67,7 +71,7 @@ Description
67----------- 71-----------
68 72
69This driver implements support for the IT8705F, IT8712F, IT8716F, 73This driver implements support for the IT8705F, IT8712F, IT8716F,
70IT8718F, IT8720F, IT8726F and SiS950 chips. 74IT8718F, IT8720F, IT8721F, IT8726F, IT8758E and SiS950 chips.
71 75
72These chips are 'Super I/O chips', supporting floppy disks, infrared ports, 76These chips are 'Super I/O chips', supporting floppy disks, infrared ports,
73joysticks and other miscellaneous stuff. For hardware monitoring, they 77joysticks and other miscellaneous stuff. For hardware monitoring, they
@@ -86,14 +90,15 @@ the driver won't notice and report changes in the VID value. The two
86upper VID bits share their pins with voltage inputs (in5 and in6) so you 90upper VID bits share their pins with voltage inputs (in5 and in6) so you
87can't have both on a given board. 91can't have both on a given board.
88 92
89The IT8716F, IT8718F, IT8720F and later IT8712F revisions have support for 93The IT8716F, IT8718F, IT8720F, IT8721F/IT8758E and later IT8712F revisions
902 additional fans. The additional fans are supported by the driver. 94have support for 2 additional fans. The additional fans are supported by the
95driver.
91 96
92The IT8716F, IT8718F and IT8720F, and late IT8712F and IT8705F also have 97The IT8716F, IT8718F, IT8720F and IT8721F/IT8758E, and late IT8712F and
93optional 16-bit tachometer counters for fans 1 to 3. This is better (no more 98IT8705F also have optional 16-bit tachometer counters for fans 1 to 3. This
94fan clock divider mess) but not compatible with the older chips and 99is better (no more fan clock divider mess) but not compatible with the older
95revisions. The 16-bit tachometer mode is enabled by the driver when one 100chips and revisions. The 16-bit tachometer mode is enabled by the driver when
96of the above chips is detected. 101one of the above chips is detected.
97 102
98The IT8726F is just bit enhanced IT8716F with additional hardware 103The IT8726F is just bit enhanced IT8716F with additional hardware
99for AMD power sequencing. Therefore the chip will appear as IT8716F 104for AMD power sequencing. Therefore the chip will appear as IT8716F
@@ -115,7 +120,12 @@ alarm is triggered if the voltage has crossed a programmable minimum or
115maximum limit. Note that minimum in this case always means 'closest to 120maximum limit. Note that minimum in this case always means 'closest to
116zero'; this is important for negative voltage measurements. All voltage 121zero'; this is important for negative voltage measurements. All voltage
117inputs can measure voltages between 0 and 4.08 volts, with a resolution of 122inputs can measure voltages between 0 and 4.08 volts, with a resolution of
1180.016 volt. The battery voltage in8 does not have limit registers. 1230.016 volt (except IT8721F/IT8758E: 0.012 volt.) The battery voltage in8 does
124not have limit registers.
125
126On the IT8721F/IT8758E, some voltage inputs are internal and scaled inside
127the chip (in7, in8 and optionally in3). The driver handles this transparently
128so user-space doesn't have to care.
119 129
120The VID lines (IT8712F/IT8716F/IT8718F/IT8720F) encode the core voltage value: 130The VID lines (IT8712F/IT8716F/IT8718F/IT8720F) encode the core voltage value:
121the voltage level your processor should work with. This is hardcoded by 131the voltage level your processor should work with. This is hardcoded by
diff --git a/Documentation/hwmon/jc42 b/Documentation/hwmon/jc42
index 0e76ef12e4c6..a22ecf48f255 100644
--- a/Documentation/hwmon/jc42
+++ b/Documentation/hwmon/jc42
@@ -51,7 +51,8 @@ Supported chips:
51 * JEDEC JC 42.4 compliant temperature sensor chips 51 * JEDEC JC 42.4 compliant temperature sensor chips
52 Prefix: 'jc42' 52 Prefix: 'jc42'
53 Addresses scanned: I2C 0x18 - 0x1f 53 Addresses scanned: I2C 0x18 - 0x1f
54 Datasheet: - 54 Datasheet:
55 http://www.jedec.org/sites/default/files/docs/4_01_04R19.pdf
55 56
56Author: 57Author:
57 Guenter Roeck <guenter.roeck@ericsson.com> 58 Guenter Roeck <guenter.roeck@ericsson.com>
@@ -60,7 +61,11 @@ Author:
60Description 61Description
61----------- 62-----------
62 63
63This driver implements support for JEDEC JC 42.4 compliant temperature sensors. 64This driver implements support for JEDEC JC 42.4 compliant temperature sensors,
65which are used on many DDR3 memory modules for mobile devices and servers. Some
66systems use the sensor to prevent memory overheating by automatically throttling
67the memory controller.
68
64The driver auto-detects the chips listed above, but can be manually instantiated 69The driver auto-detects the chips listed above, but can be manually instantiated
65to support other JC 42.4 compliant chips. 70to support other JC 42.4 compliant chips.
66 71
@@ -81,15 +86,19 @@ limits. The chip supports only a single register to configure the hysteresis,
81which applies to all limits. This register can be written by writing into 86which applies to all limits. This register can be written by writing into
82temp1_crit_hyst. Other hysteresis attributes are read-only. 87temp1_crit_hyst. Other hysteresis attributes are read-only.
83 88
89If the BIOS has configured the sensor for automatic temperature management, it
90is likely that it has locked the registers, i.e., that the temperature limits
91cannot be changed.
92
84Sysfs entries 93Sysfs entries
85------------- 94-------------
86 95
87temp1_input Temperature (RO) 96temp1_input Temperature (RO)
88temp1_min Minimum temperature (RW) 97temp1_min Minimum temperature (RO or RW)
89temp1_max Maximum temperature (RW) 98temp1_max Maximum temperature (RO or RW)
90temp1_crit Critical high temperature (RW) 99temp1_crit Critical high temperature (RO or RW)
91 100
92temp1_crit_hyst Critical hysteresis temperature (RW) 101temp1_crit_hyst Critical hysteresis temperature (RO or RW)
93temp1_max_hyst Maximum hysteresis temperature (RO) 102temp1_max_hyst Maximum hysteresis temperature (RO)
94 103
95temp1_min_alarm Temperature low alarm 104temp1_min_alarm Temperature low alarm
diff --git a/Documentation/hwmon/k10temp b/Documentation/hwmon/k10temp
index 6526eee525a6..a10f73624ad3 100644
--- a/Documentation/hwmon/k10temp
+++ b/Documentation/hwmon/k10temp
@@ -9,6 +9,9 @@ Supported chips:
9 Socket S1G3: Athlon II, Sempron, Turion II 9 Socket S1G3: Athlon II, Sempron, Turion II
10* AMD Family 11h processors: 10* AMD Family 11h processors:
11 Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra) 11 Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra)
12* AMD Family 12h processors: "Llano" (E2/A4/A6/A8-Series)
13* AMD Family 14h processors: "Brazos" (C/E/G/Z-Series)
14* AMD Family 15h processors: "Bulldozer"
12 15
13 Prefix: 'k10temp' 16 Prefix: 'k10temp'
14 Addresses scanned: PCI space 17 Addresses scanned: PCI space
@@ -17,10 +20,18 @@ Supported chips:
17 http://support.amd.com/us/Processor_TechDocs/31116.pdf 20 http://support.amd.com/us/Processor_TechDocs/31116.pdf
18 BIOS and Kernel Developer's Guide (BKDG) for AMD Family 11h Processors: 21 BIOS and Kernel Developer's Guide (BKDG) for AMD Family 11h Processors:
19 http://support.amd.com/us/Processor_TechDocs/41256.pdf 22 http://support.amd.com/us/Processor_TechDocs/41256.pdf
23 BIOS and Kernel Developer's Guide (BKDG) for AMD Family 12h Processors:
24 http://support.amd.com/us/Processor_TechDocs/41131.pdf
25 BIOS and Kernel Developer's Guide (BKDG) for AMD Family 14h Models 00h-0Fh Processors:
26 http://support.amd.com/us/Processor_TechDocs/43170.pdf
20 Revision Guide for AMD Family 10h Processors: 27 Revision Guide for AMD Family 10h Processors:
21 http://support.amd.com/us/Processor_TechDocs/41322.pdf 28 http://support.amd.com/us/Processor_TechDocs/41322.pdf
22 Revision Guide for AMD Family 11h Processors: 29 Revision Guide for AMD Family 11h Processors:
23 http://support.amd.com/us/Processor_TechDocs/41788.pdf 30 http://support.amd.com/us/Processor_TechDocs/41788.pdf
31 Revision Guide for AMD Family 12h Processors:
32 http://support.amd.com/us/Processor_TechDocs/44739.pdf
33 Revision Guide for AMD Family 14h Models 00h-0Fh Processors:
34 http://support.amd.com/us/Processor_TechDocs/47534.pdf
24 AMD Family 11h Processor Power and Thermal Data Sheet for Notebooks: 35 AMD Family 11h Processor Power and Thermal Data Sheet for Notebooks:
25 http://support.amd.com/us/Processor_TechDocs/43373.pdf 36 http://support.amd.com/us/Processor_TechDocs/43373.pdf
26 AMD Family 10h Server and Workstation Processor Power and Thermal Data Sheet: 37 AMD Family 10h Server and Workstation Processor Power and Thermal Data Sheet:
@@ -34,7 +45,7 @@ Description
34----------- 45-----------
35 46
36This driver permits reading of the internal temperature sensor of AMD 47This driver permits reading of the internal temperature sensor of AMD
37Family 10h and 11h processors. 48Family 10h/11h/12h/14h/15h processors.
38 49
39All these processors have a sensor, but on those for Socket F or AM2+, 50All these processors have a sensor, but on those for Socket F or AM2+,
40the sensor may return inconsistent values (erratum 319). The driver 51the sensor may return inconsistent values (erratum 319). The driver
diff --git a/Documentation/hwmon/lineage-pem b/Documentation/hwmon/lineage-pem
new file mode 100644
index 000000000000..2ba5ed126858
--- /dev/null
+++ b/Documentation/hwmon/lineage-pem
@@ -0,0 +1,77 @@
1Kernel driver lineage-pem
2=========================
3
4Supported devices:
5 * Lineage Compact Power Line Power Entry Modules
6 Prefix: 'lineage-pem'
7 Addresses scanned: -
8 Documentation:
9 http://www.lineagepower.com/oem/pdf/CPLI2C.pdf
10
11Author: Guenter Roeck <guenter.roeck@ericsson.com>
12
13
14Description
15-----------
16
17This driver supports various Lineage Compact Power Line DC/DC and AC/DC
18converters such as CP1800, CP2000AC, CP2000DC, CP2100DC, and others.
19
20Lineage CPL power entry modules are nominally PMBus compliant. However, most
21standard PMBus commands are not supported. Specifically, all hardware monitoring
22and status reporting commands are non-standard. For this reason, a standard
23PMBus driver can not be used.
24
25
26Usage Notes
27-----------
28
29This driver does not probe for Lineage CPL devices, since there is no register
30which can be safely used to identify the chip. You will have to instantiate
31the devices explicitly.
32
33Example: the following will load the driver for a Lineage PEM at address 0x40
34on I2C bus #1:
35$ modprobe lineage-pem
36$ echo lineage-pem 0x40 > /sys/bus/i2c/devices/i2c-1/new_device
37
38All Lineage CPL power entry modules have a built-in I2C bus master selector
39(PCA9541). To ensure device access, this driver should only be used as client
40driver to the pca9541 I2C master selector driver.
41
42
43Sysfs entries
44-------------
45
46All Lineage CPL devices report output voltage and device temperature as well as
47alarms for output voltage, temperature, input voltage, input current, input power,
48and fan status.
49
50Input voltage, input current, input power, and fan speed measurement is only
51supported on newer devices. The driver detects if those attributes are supported,
52and only creates respective sysfs entries if they are.
53
54in1_input Output voltage (mV)
55in1_min_alarm Output undervoltage alarm
56in1_max_alarm Output overvoltage alarm
57in1_crit Output voltage critical alarm
58
59in2_input Input voltage (mV, optional)
60in2_alarm Input voltage alarm
61
62curr1_input Input current (mA, optional)
63curr1_alarm Input overcurrent alarm
64
65power1_input Input power (uW, optional)
66power1_alarm Input power alarm
67
68fan1_input Fan 1 speed (rpm, optional)
69fan2_input Fan 2 speed (rpm, optional)
70fan3_input Fan 3 speed (rpm, optional)
71
72temp1_input
73temp1_max
74temp1_crit
75temp1_alarm
76temp1_crit_alarm
77temp1_fault
diff --git a/Documentation/hwmon/lm75 b/Documentation/hwmon/lm75
index 8e6356fe05d7..a1790401fdde 100644
--- a/Documentation/hwmon/lm75
+++ b/Documentation/hwmon/lm75
@@ -7,6 +7,11 @@ Supported chips:
7 Addresses scanned: I2C 0x48 - 0x4f 7 Addresses scanned: I2C 0x48 - 0x4f
8 Datasheet: Publicly available at the National Semiconductor website 8 Datasheet: Publicly available at the National Semiconductor website
9 http://www.national.com/ 9 http://www.national.com/
10 * National Semiconductor LM75A
11 Prefix: 'lm75a'
12 Addresses scanned: I2C 0x48 - 0x4f
13 Datasheet: Publicly available at the National Semiconductor website
14 http://www.national.com/
10 * Dallas Semiconductor DS75 15 * Dallas Semiconductor DS75
11 Prefix: 'lm75' 16 Prefix: 'lm75'
12 Addresses scanned: I2C 0x48 - 0x4f 17 Addresses scanned: I2C 0x48 - 0x4f
diff --git a/Documentation/hwmon/lm85 b/Documentation/hwmon/lm85
index b98e0e0d1910..7c49feaa79d2 100644
--- a/Documentation/hwmon/lm85
+++ b/Documentation/hwmon/lm85
@@ -14,6 +14,10 @@ Supported chips:
14 Prefix: 'adt7463' 14 Prefix: 'adt7463'
15 Addresses scanned: I2C 0x2c, 0x2d, 0x2e 15 Addresses scanned: I2C 0x2c, 0x2d, 0x2e
16 Datasheet: http://www.onsemi.com/PowerSolutions/product.do?id=ADT7463 16 Datasheet: http://www.onsemi.com/PowerSolutions/product.do?id=ADT7463
17 * Analog Devices ADT7468
18 Prefix: 'adt7468'
19 Addresses scanned: I2C 0x2c, 0x2d, 0x2e
20 Datasheet: http://www.onsemi.com/PowerSolutions/product.do?id=ADT7468
17 * SMSC EMC6D100, SMSC EMC6D101 21 * SMSC EMC6D100, SMSC EMC6D101
18 Prefix: 'emc6d100' 22 Prefix: 'emc6d100'
19 Addresses scanned: I2C 0x2c, 0x2d, 0x2e 23 Addresses scanned: I2C 0x2c, 0x2d, 0x2e
@@ -22,6 +26,14 @@ Supported chips:
22 Prefix: 'emc6d102' 26 Prefix: 'emc6d102'
23 Addresses scanned: I2C 0x2c, 0x2d, 0x2e 27 Addresses scanned: I2C 0x2c, 0x2d, 0x2e
24 Datasheet: http://www.smsc.com/main/catalog/emc6d102.html 28 Datasheet: http://www.smsc.com/main/catalog/emc6d102.html
29 * SMSC EMC6D103
30 Prefix: 'emc6d103'
31 Addresses scanned: I2C 0x2c, 0x2d, 0x2e
32 Datasheet: http://www.smsc.com/main/catalog/emc6d103.html
33 * SMSC EMC6D103S
34 Prefix: 'emc6d103s'
35 Addresses scanned: I2C 0x2c, 0x2d, 0x2e
36 Datasheet: http://www.smsc.com/main/catalog/emc6d103s.html
25 37
26Authors: 38Authors:
27 Philip Pokorny <ppokorny@penguincomputing.com>, 39 Philip Pokorny <ppokorny@penguincomputing.com>,
@@ -34,7 +46,7 @@ Description
34----------- 46-----------
35 47
36This driver implements support for the National Semiconductor LM85 and 48This driver implements support for the National Semiconductor LM85 and
37compatible chips including the Analog Devices ADM1027, ADT7463 and 49compatible chips including the Analog Devices ADM1027, ADT7463, ADT7468 and
38SMSC EMC6D10x chips family. 50SMSC EMC6D10x chips family.
39 51
40The LM85 uses the 2-wire interface compatible with the SMBUS 2.0 52The LM85 uses the 2-wire interface compatible with the SMBUS 2.0
@@ -87,14 +99,22 @@ To smooth the response of fans to changes in temperature, the LM85 has an
87optional filter for smoothing temperatures. The ADM1027 has the same 99optional filter for smoothing temperatures. The ADM1027 has the same
88config option but uses it to rate limit the changes to fan speed instead. 100config option but uses it to rate limit the changes to fan speed instead.
89 101
90The ADM1027 and ADT7463 have a 10-bit ADC and can therefore measure 102The ADM1027, ADT7463 and ADT7468 have a 10-bit ADC and can therefore
91temperatures with 0.25 degC resolution. They also provide an offset to the 103measure temperatures with 0.25 degC resolution. They also provide an offset
92temperature readings that is automatically applied during measurement. 104to the temperature readings that is automatically applied during
93This offset can be used to zero out any errors due to traces and placement. 105measurement. This offset can be used to zero out any errors due to traces
94The documentation says that the offset is in 0.25 degC steps, but in 106and placement. The documentation says that the offset is in 0.25 degC
95initial testing of the ADM1027 it was 1.00 degC steps. Analog Devices has 107steps, but in initial testing of the ADM1027 it was 1.00 degC steps. Analog
96confirmed this "bug". The ADT7463 is reported to work as described in the 108Devices has confirmed this "bug". The ADT7463 is reported to work as
97documentation. The current lm85 driver does not show the offset register. 109described in the documentation. The current lm85 driver does not show the
110offset register.
111
112The ADT7468 has a high-frequency PWM mode, where all PWM outputs are
113driven by a 22.5 kHz clock. This is a global mode, not per-PWM output,
114which means that setting any PWM frequency above 11.3 kHz will switch
115all 3 PWM outputs to a 22.5 kHz frequency. Conversely, setting any PWM
116frequency below 11.3 kHz will switch all 3 PWM outputs to a frequency
117between 10 and 100 Hz, which can then be tuned separately.
98 118
99See the vendor datasheets for more information. There is application note 119See the vendor datasheets for more information. There is application note
100from National (AN-1260) with some additional information about the LM85. 120from National (AN-1260) with some additional information about the LM85.
@@ -110,9 +130,11 @@ to be register compatible. The EMC6D100 offers all the features of the
110EMC6D101 plus additional voltage monitoring and system control features. 130EMC6D101 plus additional voltage monitoring and system control features.
111Unfortunately it is not possible to distinguish between the package 131Unfortunately it is not possible to distinguish between the package
112versions on register level so these additional voltage inputs may read 132versions on register level so these additional voltage inputs may read
113zero. The EMC6D102 features addtional ADC bits thus extending precision 133zero. EMC6D102 and EMC6D103 feature additional ADC bits thus extending precision
114of voltage and temperature channels. 134of voltage and temperature channels.
115 135
136SMSC EMC6D103S is similar to EMC6D103, but does not support pwm#_auto_pwm_minctl
137and temp#_auto_temp_off.
116 138
117Hardware Configurations 139Hardware Configurations
118----------------------- 140-----------------------
@@ -125,17 +147,17 @@ datasheet for a complete description of the differences. Other than
125identifying the chip, the driver behaves no differently with regard to 147identifying the chip, the driver behaves no differently with regard to
126these two chips. The LM85B is recommended for new designs. 148these two chips. The LM85B is recommended for new designs.
127 149
128The ADM1027 and ADT7463 chips have an optional SMBALERT output that can be 150The ADM1027, ADT7463 and ADT7468 chips have an optional SMBALERT output
129used to signal the chipset in case a limit is exceeded or the temperature 151that can be used to signal the chipset in case a limit is exceeded or the
130sensors fail. Individual sensor interrupts can be masked so they won't 152temperature sensors fail. Individual sensor interrupts can be masked so
131trigger SMBALERT. The SMBALERT output if configured replaces one of the other 153they won't trigger SMBALERT. The SMBALERT output if configured replaces one
132functions (PWM2 or IN0). This functionality is not implemented in current 154of the other functions (PWM2 or IN0). This functionality is not implemented
133driver. 155in current driver.
134 156
135The ADT7463 also has an optional THERM output/input which can be connected 157The ADT7463 and ADT7468 also have an optional THERM output/input which can
136to the processor PROC_HOT output. If available, the autofan control 158be connected to the processor PROC_HOT output. If available, the autofan
137dynamic Tmin feature can be enabled to keep the system temperature within 159control dynamic Tmin feature can be enabled to keep the system temperature
138spec (just?!) with the least possible fan noise. 160within spec (just?!) with the least possible fan noise.
139 161
140Configuration Notes 162Configuration Notes
141------------------- 163-------------------
@@ -201,8 +223,8 @@ the temperatures to compensate for systemic errors in the
201measurements. These features are not currently supported by the lm85 223measurements. These features are not currently supported by the lm85
202driver. 224driver.
203 225
204In addition to the ADM1027 features, the ADT7463 also has Tmin control 226In addition to the ADM1027 features, the ADT7463 and ADT7468 also have
205and THERM asserted counts. Automatic Tmin control acts to adjust the 227Tmin control and THERM asserted counts. Automatic Tmin control acts to
206Tmin value to maintain the measured temperature sensor at a specified 228adjust the Tmin value to maintain the measured temperature sensor at a
207temperature. There isn't much documentation on this feature in the 229specified temperature. There isn't much documentation on this feature in
208ADT7463 data sheet. This is not supported by current driver. 230the ADT7463 data sheet. This is not supported by current driver.
diff --git a/Documentation/hwmon/lm90 b/Documentation/hwmon/lm90
index 6a03dd4bcc94..f3efd18e87f4 100644
--- a/Documentation/hwmon/lm90
+++ b/Documentation/hwmon/lm90
@@ -32,6 +32,16 @@ Supported chips:
32 Addresses scanned: I2C 0x4c and 0x4d 32 Addresses scanned: I2C 0x4c and 0x4d
33 Datasheet: Publicly available at the ON Semiconductor website 33 Datasheet: Publicly available at the ON Semiconductor website
34 http://www.onsemi.com/PowerSolutions/product.do?id=ADT7461 34 http://www.onsemi.com/PowerSolutions/product.do?id=ADT7461
35 * Analog Devices ADT7461A
36 Prefix: 'adt7461a'
37 Addresses scanned: I2C 0x4c and 0x4d
38 Datasheet: Publicly available at the ON Semiconductor website
39 http://www.onsemi.com/PowerSolutions/product.do?id=ADT7461A
40 * ON Semiconductor NCT1008
41 Prefix: 'nct1008'
42 Addresses scanned: I2C 0x4c and 0x4d
43 Datasheet: Publicly available at the ON Semiconductor website
44 http://www.onsemi.com/PowerSolutions/product.do?id=NCT1008
35 * Maxim MAX6646 45 * Maxim MAX6646
36 Prefix: 'max6646' 46 Prefix: 'max6646'
37 Addresses scanned: I2C 0x4d 47 Addresses scanned: I2C 0x4d
@@ -63,8 +73,8 @@ Supported chips:
63 Datasheet: Publicly available at the Maxim website 73 Datasheet: Publicly available at the Maxim website
64 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578 74 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578
65 * Maxim MAX6659 75 * Maxim MAX6659
66 Prefix: 'max6657' 76 Prefix: 'max6659'
67 Addresses scanned: I2C 0x4c, 0x4d (unsupported 0x4e) 77 Addresses scanned: I2C 0x4c, 0x4d, 0x4e
68 Datasheet: Publicly available at the Maxim website 78 Datasheet: Publicly available at the Maxim website
69 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578 79 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578
70 * Maxim MAX6680 80 * Maxim MAX6680
@@ -84,6 +94,21 @@ Supported chips:
84 Addresses scanned: I2C 0x4c 94 Addresses scanned: I2C 0x4c
85 Datasheet: Publicly available at the Maxim website 95 Datasheet: Publicly available at the Maxim website
86 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3500 96 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3500
97 * Maxim MAX6695
98 Prefix: 'max6695'
99 Addresses scanned: I2C 0x18
100 Datasheet: Publicly available at the Maxim website
101 http://www.maxim-ic.com/datasheet/index.mvp/id/4199
102 * Maxim MAX6696
103 Prefix: 'max6695'
104 Addresses scanned: I2C 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b,
105 0x4c, 0x4d and 0x4e
106 Datasheet: Publicly available at the Maxim website
107 http://www.maxim-ic.com/datasheet/index.mvp/id/4199
108 * Winbond/Nuvoton W83L771W/G
109 Prefix: 'w83l771'
110 Addresses scanned: I2C 0x4c
111 Datasheet: No longer available
87 * Winbond/Nuvoton W83L771AWG/ASG 112 * Winbond/Nuvoton W83L771AWG/ASG
88 Prefix: 'w83l771' 113 Prefix: 'w83l771'
89 Addresses scanned: I2C 0x4c 114 Addresses scanned: I2C 0x4c
@@ -101,10 +126,11 @@ well as the temperature of up to one external diode. It is compatible
101with many other devices, many of which are supported by this driver. 126with many other devices, many of which are supported by this driver.
102 127
103Note that there is no easy way to differentiate between the MAX6657, 128Note that there is no easy way to differentiate between the MAX6657,
104MAX6658 and MAX6659 variants. The extra address and features of the 129MAX6658 and MAX6659 variants. The extra features of the MAX6659 are only
105MAX6659 are not supported by this driver. The MAX6680 and MAX6681 only 130supported by this driver if the chip is located at address 0x4d or 0x4e,
106differ in their pinout, therefore they obviously can't (and don't need to) 131or if the chip type is explicitly selected as max6659.
107be distinguished. 132The MAX6680 and MAX6681 only differ in their pinout, therefore they obviously
133can't (and don't need to) be distinguished.
108 134
109The specificity of this family of chipsets over the ADM1021/LM84 135The specificity of this family of chipsets over the ADM1021/LM84
110family is that it features critical limits with hysteresis, and an 136family is that it features critical limits with hysteresis, and an
@@ -133,7 +159,7 @@ ADM1032:
133 * ALERT is triggered by open remote sensor. 159 * ALERT is triggered by open remote sensor.
134 * SMBus PEC support for Write Byte and Receive Byte transactions. 160 * SMBus PEC support for Write Byte and Receive Byte transactions.
135 161
136ADT7461: 162ADT7461, ADT7461A, NCT1008:
137 * Extended temperature range (breaks compatibility) 163 * Extended temperature range (breaks compatibility)
138 * Lower resolution for remote temperature 164 * Lower resolution for remote temperature
139 165
@@ -151,11 +177,21 @@ MAX6680 and MAX6681:
151 * Selectable address 177 * Selectable address
152 * Remote sensor type selection 178 * Remote sensor type selection
153 179
180MAX6695 and MAX6696:
181 * Better local resolution
182 * Selectable address (max6696)
183 * Second critical temperature limit
184 * Two remote sensors
185
186W83L771W/G
187 * The G variant is lead-free, otherwise similar to the W.
188 * Filter and alert configuration register at 0xBF
189 * Moving average (depending on conversion rate)
190
154W83L771AWG/ASG 191W83L771AWG/ASG
192 * Successor of the W83L771W/G, same features.
155 * The AWG and ASG variants only differ in package format. 193 * The AWG and ASG variants only differ in package format.
156 * Filter and alert configuration register at 0xBF
157 * Diode ideality factor configuration (remote sensor) at 0xE3 194 * Diode ideality factor configuration (remote sensor) at 0xE3
158 * Moving average (depending on conversion rate)
159 195
160All temperature values are given in degrees Celsius. Resolution 196All temperature values are given in degrees Celsius. Resolution
161is 1.0 degree for the local temperature, 0.125 degree for the remote 197is 1.0 degree for the local temperature, 0.125 degree for the remote
@@ -169,9 +205,9 @@ are exported, one for each channel, but these values are of course linked.
169Only the local hysteresis can be set from user-space, and the same delta 205Only the local hysteresis can be set from user-space, and the same delta
170applies to the remote hysteresis. 206applies to the remote hysteresis.
171 207
172The lm90 driver will not update its values more frequently than every 208The lm90 driver will not update its values more frequently than configured with
173other second; reading them more often will do no harm, but will return 209the update_interval attribute; reading them more often will do no harm, but will
174'old' values. 210return 'old' values.
175 211
176SMBus Alert Support 212SMBus Alert Support
177------------------- 213-------------------
@@ -179,11 +215,12 @@ SMBus Alert Support
179This driver has basic support for SMBus alert. When an alert is received, 215This driver has basic support for SMBus alert. When an alert is received,
180the status register is read and the faulty temperature channel is logged. 216the status register is read and the faulty temperature channel is logged.
181 217
182The Analog Devices chips (ADM1032 and ADT7461) do not implement the SMBus 218The Analog Devices chips (ADM1032, ADT7461 and ADT7461A) and ON
183alert protocol properly so additional care is needed: the ALERT output is 219Semiconductor chips (NCT1008) do not implement the SMBus alert protocol
184disabled when an alert is received, and is re-enabled only when the alarm 220properly so additional care is needed: the ALERT output is disabled when
185is gone. Otherwise the chip would block alerts from other chips in the bus 221an alert is received, and is re-enabled only when the alarm is gone.
186as long as the alarm is active. 222Otherwise the chip would block alerts from other chips in the bus as long
223as the alarm is active.
187 224
188PEC Support 225PEC Support
189----------- 226-----------
diff --git a/Documentation/hwmon/lm93 b/Documentation/hwmon/lm93
index ac711f357faf..f3b2ad2ceb01 100644
--- a/Documentation/hwmon/lm93
+++ b/Documentation/hwmon/lm93
@@ -6,12 +6,16 @@ Supported chips:
6 Prefix 'lm93' 6 Prefix 'lm93'
7 Addresses scanned: I2C 0x2c-0x2e 7 Addresses scanned: I2C 0x2c-0x2e
8 Datasheet: http://www.national.com/ds.cgi/LM/LM93.pdf 8 Datasheet: http://www.national.com/ds.cgi/LM/LM93.pdf
9 * National Semiconductor LM94
10 Prefix 'lm94'
11 Addresses scanned: I2C 0x2c-0x2e
12 Datasheet: http://www.national.com/ds.cgi/LM/LM94.pdf
9 13
10Authors: 14Authors:
11 Mark M. Hoffman <mhoffman@lightlink.com> 15 Mark M. Hoffman <mhoffman@lightlink.com>
12 Ported to 2.6 by Eric J. Bowersox <ericb@aspsys.com> 16 Ported to 2.6 by Eric J. Bowersox <ericb@aspsys.com>
13 Adapted to 2.6.20 by Carsten Emde <ce@osadl.org> 17 Adapted to 2.6.20 by Carsten Emde <ce@osadl.org>
14 Modified for mainline integration by Hans J. Koch <hjk@linutronix.de> 18 Modified for mainline integration by Hans J. Koch <hjk@hansjkoch.de>
15 19
16Module Parameters 20Module Parameters
17----------------- 21-----------------
@@ -56,6 +60,9 @@ previous motherboard management ASICs and uses some of the LM85's features
56for dynamic Vccp monitoring and PROCHOT. It is designed to monitor a dual 60for dynamic Vccp monitoring and PROCHOT. It is designed to monitor a dual
57processor Xeon class motherboard with a minimum of external components. 61processor Xeon class motherboard with a minimum of external components.
58 62
63LM94 is also supported in LM93 compatible mode. Extra sensors and features of
64LM94 are not supported.
65
59 66
60User Interface 67User Interface
61-------------- 68--------------
diff --git a/Documentation/hwmon/ltc4151 b/Documentation/hwmon/ltc4151
new file mode 100644
index 000000000000..43c667e6677a
--- /dev/null
+++ b/Documentation/hwmon/ltc4151
@@ -0,0 +1,47 @@
1Kernel driver ltc4151
2=====================
3
4Supported chips:
5 * Linear Technology LTC4151
6 Prefix: 'ltc4151'
7 Addresses scanned: -
8 Datasheet:
9 http://www.linear.com/docs/Datasheet/4151fc.pdf
10
11Author: Per Dalen <per.dalen@appeartv.com>
12
13
14Description
15-----------
16
17The LTC4151 is a High Voltage I2C Current and Voltage Monitor.
18
19
20Usage Notes
21-----------
22
23This driver does not probe for LTC4151 devices, since there is no register
24which can be safely used to identify the chip. You will have to instantiate
25the devices explicitly.
26
27Example: the following will load the driver for an LTC4151 at address 0x6f
28on I2C bus #0:
29# modprobe ltc4151
30# echo ltc4151 0x6f > /sys/bus/i2c/devices/i2c-0/new_device
31
32
33Sysfs entries
34-------------
35
36Voltage readings provided by this driver are reported as obtained from the ADIN
37and VIN registers.
38
39Current reading provided by this driver is reported as obtained from the Current
40Sense register. The reported value assumes that a 1 mOhm sense resistor is
41installed.
42
43in1_input VDIN voltage (mV)
44
45in2_input ADIN voltage (mV)
46
47curr1_input SENSE current (mA)
diff --git a/Documentation/hwmon/ltc4261 b/Documentation/hwmon/ltc4261
new file mode 100644
index 000000000000..eba2e2c4b94d
--- /dev/null
+++ b/Documentation/hwmon/ltc4261
@@ -0,0 +1,63 @@
1Kernel driver ltc4261
2=====================
3
4Supported chips:
5 * Linear Technology LTC4261
6 Prefix: 'ltc4261'
7 Addresses scanned: -
8 Datasheet:
9 http://cds.linear.com/docs/Datasheet/42612fb.pdf
10
11Author: Guenter Roeck <guenter.roeck@ericsson.com>
12
13
14Description
15-----------
16
17The LTC4261/LTC4261-2 negative voltage Hot Swap controllers allow a board
18to be safely inserted and removed from a live backplane.
19
20
21Usage Notes
22-----------
23
24This driver does not probe for LTC4261 devices, since there is no register
25which can be safely used to identify the chip. You will have to instantiate
26the devices explicitly.
27
28Example: the following will load the driver for an LTC4261 at address 0x10
29on I2C bus #1:
30$ modprobe ltc4261
31$ echo ltc4261 0x10 > /sys/bus/i2c/devices/i2c-1/new_device
32
33
34Sysfs entries
35-------------
36
37Voltage readings provided by this driver are reported as obtained from the ADC
38registers. If a set of voltage divider resistors is installed, calculate the
39real voltage by multiplying the reported value with (R1+R2)/R2, where R1 is the
40value of the divider resistor against the measured voltage and R2 is the value
41of the divider resistor against Ground.
42
43Current reading provided by this driver is reported as obtained from the ADC
44Current Sense register. The reported value assumes that a 1 mOhm sense resistor
45is installed. If a different sense resistor is installed, calculate the real
46current by dividing the reported value by the sense resistor value in mOhm.
47
48The chip has two voltage sensors, but only one set of voltage alarm status bits.
49In many many designs, those alarms are associated with the ADIN2 sensor, due to
50the proximity of the ADIN2 pin to the OV pin. ADIN2 is, however, not available
51on all chip variants. To ensure that the alarm condition is reported to the user,
52report it with both voltage sensors.
53
54in1_input ADIN2 voltage (mV)
55in1_min_alarm ADIN/ADIN2 Undervoltage alarm
56in1_max_alarm ADIN/ADIN2 Overvoltage alarm
57
58in2_input ADIN voltage (mV)
59in2_min_alarm ADIN/ADIN2 Undervoltage alarm
60in2_max_alarm ADIN/ADIN2 Overvoltage alarm
61
62curr1_input SENSE current (mA)
63curr1_alarm SENSE overcurrent alarm
diff --git a/Documentation/hwmon/max16064 b/Documentation/hwmon/max16064
new file mode 100644
index 000000000000..41728999e142
--- /dev/null
+++ b/Documentation/hwmon/max16064
@@ -0,0 +1,62 @@
1Kernel driver max16064
2======================
3
4Supported chips:
5 * Maxim MAX16064
6 Prefix: 'max16064'
7 Addresses scanned: -
8 Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX16064.pdf
9
10Author: Guenter Roeck <guenter.roeck@ericsson.com>
11
12
13Description
14-----------
15
16This driver supports hardware montoring for Maxim MAX16064 Quad Power-Supply
17Controller with Active-Voltage Output Control and PMBus Interface.
18
19The driver is a client driver to the core PMBus driver.
20Please see Documentation/hwmon/pmbus for details on PMBus client drivers.
21
22
23Usage Notes
24-----------
25
26This driver does not auto-detect devices. You will have to instantiate the
27devices explicitly. Please see Documentation/i2c/instantiating-devices for
28details.
29
30
31Platform data support
32---------------------
33
34The driver supports standard PMBus driver platform data.
35
36
37Sysfs entries
38-------------
39
40The following attributes are supported. Limits are read-write; all other
41attributes are read-only.
42
43in[1-4]_label "vout[1-4]"
44in[1-4]_input Measured voltage. From READ_VOUT register.
45in[1-4]_min Minumum Voltage. From VOUT_UV_WARN_LIMIT register.
46in[1-4]_max Maximum voltage. From VOUT_OV_WARN_LIMIT register.
47in[1-4]_lcrit Critical minumum Voltage. VOUT_UV_FAULT_LIMIT register.
48in[1-4]_crit Critical maximum voltage. From VOUT_OV_FAULT_LIMIT register.
49in[1-4]_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status.
50in[1-4]_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status.
51in[1-4]_lcrit_alarm Voltage critical low alarm. From VOLTAGE_UV_FAULT status.
52in[1-4]_crit_alarm Voltage critical high alarm. From VOLTAGE_OV_FAULT status.
53
54temp1_input Measured temperature. From READ_TEMPERATURE_1 register.
55temp1_max Maximum temperature. From OT_WARN_LIMIT register.
56temp1_crit Critical high temperature. From OT_FAULT_LIMIT register.
57temp1_max_alarm Chip temperature high alarm. Set by comparing
58 READ_TEMPERATURE_1 with OT_WARN_LIMIT if TEMP_OT_WARNING
59 status is set.
60temp1_crit_alarm Chip temperature critical high alarm. Set by comparing
61 READ_TEMPERATURE_1 with OT_FAULT_LIMIT if TEMP_OT_FAULT
62 status is set.
diff --git a/Documentation/hwmon/max16065 b/Documentation/hwmon/max16065
new file mode 100644
index 000000000000..44b4f61e04f9
--- /dev/null
+++ b/Documentation/hwmon/max16065
@@ -0,0 +1,98 @@
1Kernel driver max16065
2======================
3
4Supported chips:
5 * Maxim MAX16065, MAX16066
6 Prefixes: 'max16065', 'max16066'
7 Addresses scanned: -
8 Datasheet:
9 http://datasheets.maxim-ic.com/en/ds/MAX16065-MAX16066.pdf
10 * Maxim MAX16067
11 Prefix: 'max16067'
12 Addresses scanned: -
13 Datasheet:
14 http://datasheets.maxim-ic.com/en/ds/MAX16067.pdf
15 * Maxim MAX16068
16 Prefix: 'max16068'
17 Addresses scanned: -
18 Datasheet:
19 http://datasheets.maxim-ic.com/en/ds/MAX16068.pdf
20 * Maxim MAX16070/MAX16071
21 Prefixes: 'max16070', 'max16071'
22 Addresses scanned: -
23 Datasheet:
24 http://datasheets.maxim-ic.com/en/ds/MAX16070-MAX16071.pdf
25
26
27Author: Guenter Roeck <guenter.roeck@ericsson.com>
28
29
30Description
31-----------
32
33[From datasheets] The MAX16065/MAX16066 flash-configurable system managers
34monitor and sequence multiple system voltages. The MAX16065/MAX16066 can also
35accurately monitor (+/-2.5%) one current channel using a dedicated high-side
36current-sense amplifier. The MAX16065 manages up to twelve system voltages
37simultaneously, and the MAX16066 manages up to eight supply voltages.
38
39The MAX16067 flash-configurable system manager monitors and sequences multiple
40system voltages. The MAX16067 manages up to six system voltages simultaneously.
41
42The MAX16068 flash-configurable system manager monitors and manages up to six
43system voltages simultaneously.
44
45The MAX16070/MAX16071 flash-configurable system monitors supervise multiple
46system voltages. The MAX16070/MAX16071 can also accurately monitor (+/-2.5%)
47one current channel using a dedicated high-side current-sense amplifier. The
48MAX16070 monitors up to twelve system voltages simultaneously, and the MAX16071
49monitors up to eight supply voltages.
50
51Each monitored channel has its own low and high critical limits. MAX16065,
52MAX16066, MAX16070, and MAX16071 support an additional limit which is
53configurable as either low or high secondary limit. MAX16065, MAX16066,
54MAX16070, and MAX16071 also support supply current monitoring.
55
56
57Usage Notes
58-----------
59
60This driver does not probe for devices, since there is no register which
61can be safely used to identify the chip. You will have to instantiate
62the devices explicitly. Please see Documentation/i2c/instantiating-devices for
63details.
64
65
66Sysfs entries
67-------------
68
69in[0-11]_input Input voltage measurements.
70
71in12_input Voltage on CSP (Current Sense Positive) pin.
72 Only if the chip supports current sensing and if
73 current sensing is enabled.
74
75in[0-11]_min Low warning limit.
76 Supported on MAX16065, MAX16066, MAX16070, and MAX16071
77 only.
78
79in[0-11]_max High warning limit.
80 Supported on MAX16065, MAX16066, MAX16070, and MAX16071
81 only.
82
83 Either low or high warning limits are supported
84 (depending on chip configuration), but not both.
85
86in[0-11]_lcrit Low critical limit.
87
88in[0-11]_crit High critical limit.
89
90in[0-11]_alarm Input voltage alarm.
91
92curr1_input Current sense input; only if the chip supports current
93 sensing and if current sensing is enabled.
94 Displayed current assumes 0.001 Ohm current sense
95 resistor.
96
97curr1_alarm Overcurrent alarm; only if the chip supports current
98 sensing and if current sensing is enabled.
diff --git a/Documentation/hwmon/max34440 b/Documentation/hwmon/max34440
new file mode 100644
index 000000000000..6c525dd07d59
--- /dev/null
+++ b/Documentation/hwmon/max34440
@@ -0,0 +1,79 @@
1Kernel driver max34440
2======================
3
4Supported chips:
5 * Maxim MAX34440
6 Prefixes: 'max34440'
7 Addresses scanned: -
8 Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX34440.pdf
9 * Maxim MAX34441
10 PMBus 5-Channel Power-Supply Manager and Intelligent Fan Controller
11 Prefixes: 'max34441'
12 Addresses scanned: -
13 Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX34441.pdf
14
15Author: Guenter Roeck <guenter.roeck@ericsson.com>
16
17
18Description
19-----------
20
21This driver supports hardware montoring for Maxim MAX34440 PMBus 6-Channel
22Power-Supply Manager and MAX34441 PMBus 5-Channel Power-Supply Manager
23and Intelligent Fan Controller.
24
25The driver is a client driver to the core PMBus driver. Please see
26Documentation/hwmon/pmbus for details on PMBus client drivers.
27
28
29Usage Notes
30-----------
31
32This driver does not auto-detect devices. You will have to instantiate the
33devices explicitly. Please see Documentation/i2c/instantiating-devices for
34details.
35
36
37Platform data support
38---------------------
39
40The driver supports standard PMBus driver platform data.
41
42
43Sysfs entries
44-------------
45
46The following attributes are supported. Limits are read-write; all other
47attributes are read-only.
48
49in[1-6]_label "vout[1-6]".
50in[1-6]_input Measured voltage. From READ_VOUT register.
51in[1-6]_min Minumum Voltage. From VOUT_UV_WARN_LIMIT register.
52in[1-6]_max Maximum voltage. From VOUT_OV_WARN_LIMIT register.
53in[1-6]_lcrit Critical minumum Voltage. VOUT_UV_FAULT_LIMIT register.
54in[1-6]_crit Critical maximum voltage. From VOUT_OV_FAULT_LIMIT register.
55in[1-6]_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status.
56in[1-6]_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status.
57in[1-6]_lcrit_alarm Voltage critical low alarm. From VOLTAGE_UV_FAULT status.
58in[1-6]_crit_alarm Voltage critical high alarm. From VOLTAGE_OV_FAULT status.
59
60curr[1-6]_label "iout[1-6]".
61curr[1-6]_input Measured current. From READ_IOUT register.
62curr[1-6]_max Maximum current. From IOUT_OC_WARN_LIMIT register.
63curr[1-6]_crit Critical maximum current. From IOUT_OC_FAULT_LIMIT register.
64curr[1-6]_max_alarm Current high alarm. From IOUT_OC_WARNING status.
65curr[1-6]_crit_alarm Current critical high alarm. From IOUT_OC_FAULT status.
66
67 in6 and curr6 attributes only exist for MAX34440.
68
69temp[1-8]_input Measured temperatures. From READ_TEMPERATURE_1 register.
70 temp1 is the chip's internal temperature. temp2..temp5
71 are remote I2C temperature sensors. For MAX34441, temp6
72 is a remote thermal-diode sensor. For MAX34440, temp6..8
73 are remote I2C temperature sensors.
74temp[1-8]_max Maximum temperature. From OT_WARN_LIMIT register.
75temp[1-8]_crit Critical high temperature. From OT_FAULT_LIMIT register.
76temp[1-8]_max_alarm Temperature high alarm.
77temp[1-8]_crit_alarm Temperature critical high alarm.
78
79 temp7 and temp8 attributes only exist for MAX34440.
diff --git a/Documentation/hwmon/max6639 b/Documentation/hwmon/max6639
new file mode 100644
index 000000000000..dc49f8be7167
--- /dev/null
+++ b/Documentation/hwmon/max6639
@@ -0,0 +1,49 @@
1Kernel driver max6639
2=====================
3
4Supported chips:
5 * Maxim MAX6639
6 Prefix: 'max6639'
7 Addresses scanned: I2C 0x2c, 0x2e, 0x2f
8 Datasheet: http://pdfserv.maxim-ic.com/en/ds/MAX6639.pdf
9
10Authors:
11 He Changqing <hechangqing@semptian.com>
12 Roland Stigge <stigge@antcom.de>
13
14Description
15-----------
16
17This driver implements support for the Maxim MAX6639. This chip is a 2-channel
18temperature monitor with dual PWM fan speed controller. It can monitor its own
19temperature and one external diode-connected transistor or two external
20diode-connected transistors.
21
22The following device attributes are implemented via sysfs:
23
24Attribute R/W Contents
25----------------------------------------------------------------------------
26temp1_input R Temperature channel 1 input (0..150 C)
27temp2_input R Temperature channel 2 input (0..150 C)
28temp1_fault R Temperature channel 1 diode fault
29temp2_fault R Temperature channel 2 diode fault
30temp1_max RW Set THERM temperature for input 1
31 (in C, see datasheet)
32temp2_max RW Set THERM temperature for input 2
33temp1_crit RW Set ALERT temperature for input 1
34temp2_crit RW Set ALERT temperature for input 2
35temp1_emergency RW Set OT temperature for input 1
36 (in C, see datasheet)
37temp2_emergency RW Set OT temperature for input 2
38pwm1 RW Fan 1 target duty cycle (0..255)
39pwm2 RW Fan 2 target duty cycle (0..255)
40fan1_input R TACH1 fan tachometer input (in RPM)
41fan2_input R TACH2 fan tachometer input (in RPM)
42fan1_fault R Fan 1 fault
43fan2_fault R Fan 2 fault
44temp1_max_alarm R Alarm on THERM temperature on channel 1
45temp2_max_alarm R Alarm on THERM temperature on channel 2
46temp1_crit_alarm R Alarm on ALERT temperature on channel 1
47temp2_crit_alarm R Alarm on ALERT temperature on channel 2
48temp1_emergency_alarm R Alarm on OT temperature on channel 1
49temp2_emergency_alarm R Alarm on OT temperature on channel 2
diff --git a/Documentation/hwmon/max6642 b/Documentation/hwmon/max6642
new file mode 100644
index 000000000000..afbd3e4942e2
--- /dev/null
+++ b/Documentation/hwmon/max6642
@@ -0,0 +1,21 @@
1Kernel driver max6642
2=====================
3
4Supported chips:
5 * Maxim MAX6642
6 Prefix: 'max6642'
7 Addresses scanned: I2C 0x48-0x4f
8 Datasheet: Publicly available at the Maxim website
9 http://datasheets.maxim-ic.com/en/ds/MAX6642.pdf
10
11Authors:
12 Per Dalen <per.dalen@appeartv.com>
13
14Description
15-----------
16
17The MAX6642 is a digital temperature sensor. It senses its own temperature as
18well as the temperature on one external diode.
19
20All temperature values are given in degrees Celsius. Resolution
21is 0.25 degree for the local temperature and for the remote temperature.
diff --git a/Documentation/hwmon/max6650 b/Documentation/hwmon/max6650
index 8be7beb9e3e8..58d9644a2bde 100644
--- a/Documentation/hwmon/max6650
+++ b/Documentation/hwmon/max6650
@@ -2,23 +2,27 @@ Kernel driver max6650
2===================== 2=====================
3 3
4Supported chips: 4Supported chips:
5 * Maxim 6650 / 6651 5 * Maxim MAX6650
6 Prefix: 'max6650' 6 Prefix: 'max6650'
7 Addresses scanned: I2C 0x1b, 0x1f, 0x48, 0x4b 7 Addresses scanned: none
8 Datasheet: http://pdfserv.maxim-ic.com/en/ds/MAX6650-MAX6651.pdf
9 * Maxim MAX6651
10 Prefix: 'max6651'
11 Addresses scanned: none
8 Datasheet: http://pdfserv.maxim-ic.com/en/ds/MAX6650-MAX6651.pdf 12 Datasheet: http://pdfserv.maxim-ic.com/en/ds/MAX6650-MAX6651.pdf
9 13
10Authors: 14Authors:
11 Hans J. Koch <hjk@linutronix.de> 15 Hans J. Koch <hjk@hansjkoch.de>
12 John Morris <john.morris@spirentcom.com> 16 John Morris <john.morris@spirentcom.com>
13 Claus Gindhart <claus.gindhart@kontron.com> 17 Claus Gindhart <claus.gindhart@kontron.com>
14 18
15Description 19Description
16----------- 20-----------
17 21
18This driver implements support for the Maxim 6650/6651 22This driver implements support for the Maxim MAX6650 and MAX6651.
19 23
20The 2 devices are very similar, but the Maxim 6550 has a reduced feature 24The 2 devices are very similar, but the MAX6550 has a reduced feature
21set, e.g. only one fan-input, instead of 4 for the 6651. 25set, e.g. only one fan-input, instead of 4 for the MAX6651.
22 26
23The driver is not able to distinguish between the 2 devices. 27The driver is not able to distinguish between the 2 devices.
24 28
@@ -36,6 +40,13 @@ fan1_div rw sets the speed range the inputs can handle. Legal
36 values are 1, 2, 4, and 8. Use lower values for 40 values are 1, 2, 4, and 8. Use lower values for
37 faster fans. 41 faster fans.
38 42
43Usage notes
44-----------
45
46This driver does not auto-detect devices. You will have to instantiate the
47devices explicitly. Please see Documentation/i2c/instantiating-devices for
48details.
49
39Module parameters 50Module parameters
40----------------- 51-----------------
41 52
diff --git a/Documentation/hwmon/max8688 b/Documentation/hwmon/max8688
new file mode 100644
index 000000000000..0ddd3a412030
--- /dev/null
+++ b/Documentation/hwmon/max8688
@@ -0,0 +1,69 @@
1Kernel driver max8688
2=====================
3
4Supported chips:
5 * Maxim MAX8688
6 Prefix: 'max8688'
7 Addresses scanned: -
8 Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX8688.pdf
9
10Author: Guenter Roeck <guenter.roeck@ericsson.com>
11
12
13Description
14-----------
15
16This driver supports hardware montoring for Maxim MAX8688 Digital Power-Supply
17Controller/Monitor with PMBus Interface.
18
19The driver is a client driver to the core PMBus driver. Please see
20Documentation/hwmon/pmbus for details on PMBus client drivers.
21
22
23Usage Notes
24-----------
25
26This driver does not auto-detect devices. You will have to instantiate the
27devices explicitly. Please see Documentation/i2c/instantiating-devices for
28details.
29
30
31Platform data support
32---------------------
33
34The driver supports standard PMBus driver platform data.
35
36
37Sysfs entries
38-------------
39
40The following attributes are supported. Limits are read-write; all other
41attributes are read-only.
42
43in1_label "vout1"
44in1_input Measured voltage. From READ_VOUT register.
45in1_min Minumum Voltage. From VOUT_UV_WARN_LIMIT register.
46in1_max Maximum voltage. From VOUT_OV_WARN_LIMIT register.
47in1_lcrit Critical minumum Voltage. VOUT_UV_FAULT_LIMIT register.
48in1_crit Critical maximum voltage. From VOUT_OV_FAULT_LIMIT register.
49in1_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status.
50in1_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status.
51in1_lcrit_alarm Voltage critical low alarm. From VOLTAGE_UV_FAULT status.
52in1_crit_alarm Voltage critical high alarm. From VOLTAGE_OV_FAULT status.
53
54curr1_label "iout1"
55curr1_input Measured current. From READ_IOUT register.
56curr1_max Maximum current. From IOUT_OC_WARN_LIMIT register.
57curr1_crit Critical maximum current. From IOUT_OC_FAULT_LIMIT register.
58curr1_max_alarm Current high alarm. From IOUT_OC_WARN_LIMIT register.
59curr1_crit_alarm Current critical high alarm. From IOUT_OC_FAULT status.
60
61temp1_input Measured temperature. From READ_TEMPERATURE_1 register.
62temp1_max Maximum temperature. From OT_WARN_LIMIT register.
63temp1_crit Critical high temperature. From OT_FAULT_LIMIT register.
64temp1_max_alarm Chip temperature high alarm. Set by comparing
65 READ_TEMPERATURE_1 with OT_WARN_LIMIT if TEMP_OT_WARNING
66 status is set.
67temp1_crit_alarm Chip temperature critical high alarm. Set by comparing
68 READ_TEMPERATURE_1 with OT_FAULT_LIMIT if TEMP_OT_FAULT
69 status is set.
diff --git a/Documentation/hwmon/pcf8591 b/Documentation/hwmon/pcf8591
index e76a7892f68e..ac020b3bb7b3 100644
--- a/Documentation/hwmon/pcf8591
+++ b/Documentation/hwmon/pcf8591
@@ -4,7 +4,7 @@ Kernel driver pcf8591
4Supported chips: 4Supported chips:
5 * Philips/NXP PCF8591 5 * Philips/NXP PCF8591
6 Prefix: 'pcf8591' 6 Prefix: 'pcf8591'
7 Addresses scanned: I2C 0x48 - 0x4f 7 Addresses scanned: none
8 Datasheet: Publicly available at the NXP website 8 Datasheet: Publicly available at the NXP website
9 http://www.nxp.com/pip/PCF8591_6.html 9 http://www.nxp.com/pip/PCF8591_6.html
10 10
@@ -58,18 +58,16 @@ Module parameters
58Accessing PCF8591 via /sys interface 58Accessing PCF8591 via /sys interface
59------------------------------------- 59-------------------------------------
60 60
61! Be careful ! 61The PCF8591 is plainly impossible to detect! Thus the driver won't even
62The PCF8591 is plainly impossible to detect! Stupid chip. 62try. You have to explicitly instantiate the device at the relevant
63So every chip with address in the interval [0x48..0x4f] is 63address (in the interval [0x48..0x4f]) either through platform data, or
64detected as PCF8591. If you have other chips in this address 64using the sysfs interface. See Documentation/i2c/instantiating-devices
65range, the workaround is to load this module after the one 65for details.
66for your others chips.
67 66
68On detection (i.e. insmod, modprobe et al.), directories are being 67Directories are being created for each instantiated PCF8591:
69created for each detected PCF8591:
70 68
71/sys/bus/i2c/devices/<0>-<1>/ 69/sys/bus/i2c/devices/<0>-<1>/
72where <0> is the bus the chip was detected on (e. g. i2c-0) 70where <0> is the bus the chip is connected to (e. g. i2c-0)
73and <1> the chip address ([48..4f]) 71and <1> the chip address ([48..4f])
74 72
75Inside these directories, there are such files: 73Inside these directories, there are such files:
diff --git a/Documentation/hwmon/pkgtemp b/Documentation/hwmon/pkgtemp
deleted file mode 100644
index c8e1fb0fadd3..000000000000
--- a/Documentation/hwmon/pkgtemp
+++ /dev/null
@@ -1,36 +0,0 @@
1Kernel driver pkgtemp
2======================
3
4Supported chips:
5 * Intel family
6 Prefix: 'pkgtemp'
7 CPUID:
8 Datasheet: Intel 64 and IA-32 Architectures Software Developer's Manual
9 Volume 3A: System Programming Guide
10
11Author: Fenghua Yu
12
13Description
14-----------
15
16This driver permits reading package level temperature sensor embedded inside
17Intel CPU package. The sensors can be in core, uncore, memory controller, or
18other components in a package. The feature is first implemented in Intel Sandy
19Bridge platform.
20
21Temperature is measured in degrees Celsius and measurement resolution is
221 degree C. Valid temperatures are from 0 to TjMax degrees C, because the actual
23value of temperature register is in fact a delta from TjMax.
24
25Temperature known as TjMax is the maximum junction temperature of package.
26We get this from MSR_IA32_TEMPERATURE_TARGET. If the MSR is not accessible,
27we define TjMax as 100 degrees Celsius. At this temperature, protection
28mechanism will perform actions to forcibly cool down the package. Alarm
29may be raised, if the temperature grows enough (more than TjMax) to trigger
30the Out-Of-Spec bit. Following table summarizes the exported sysfs files:
31
32temp1_input - Package temperature (in millidegrees Celsius).
33temp1_max - All cooling devices should be turned on.
34temp1_crit - Maximum junction temperature (in millidegrees Celsius).
35temp1_crit_alarm - Set when Out-of-spec bit is set, never clears.
36 Correct CPU operation is no longer guaranteed.
diff --git a/Documentation/hwmon/pmbus b/Documentation/hwmon/pmbus
new file mode 100644
index 000000000000..5e462fc7f99b
--- /dev/null
+++ b/Documentation/hwmon/pmbus
@@ -0,0 +1,197 @@
1Kernel driver pmbus
2====================
3
4Supported chips:
5 * Ericsson BMR45X series
6 DC/DC Converter
7 Prefixes: 'bmr450', 'bmr451', 'bmr453', 'bmr454'
8 Addresses scanned: -
9 Datasheet:
10 http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146395
11 * Linear Technology LTC2978
12 Octal PMBus Power Supply Monitor and Controller
13 Prefix: 'ltc2978'
14 Addresses scanned: -
15 Datasheet: http://cds.linear.com/docs/Datasheet/2978fa.pdf
16 * Generic PMBus devices
17 Prefix: 'pmbus'
18 Addresses scanned: -
19 Datasheet: n.a.
20
21Author: Guenter Roeck <guenter.roeck@ericsson.com>
22
23
24Description
25-----------
26
27This driver supports hardware montoring for various PMBus compliant devices.
28It supports voltage, current, power, and temperature sensors as supported
29by the device.
30
31Each monitored channel has its own high and low limits, plus a critical
32limit.
33
34Fan support will be added in a later version of this driver.
35
36
37Usage Notes
38-----------
39
40This driver does not probe for PMBus devices, since there is no register
41which can be safely used to identify the chip (The MFG_ID register is not
42supported by all chips), and since there is no well defined address range for
43PMBus devices. You will have to instantiate the devices explicitly.
44
45Example: the following will load the driver for an LTC2978 at address 0x60
46on I2C bus #1:
47$ modprobe pmbus
48$ echo ltc2978 0x60 > /sys/bus/i2c/devices/i2c-1/new_device
49
50
51Platform data support
52---------------------
53
54Support for additional PMBus chips can be added by defining chip parameters in
55a new chip specific driver file. For example, (untested) code to add support for
56Emerson DS1200 power modules might look as follows.
57
58static struct pmbus_driver_info ds1200_info = {
59 .pages = 1,
60 /* Note: All other sensors are in linear mode */
61 .direct[PSC_VOLTAGE_OUT] = true,
62 .direct[PSC_TEMPERATURE] = true,
63 .direct[PSC_CURRENT_OUT] = true,
64 .m[PSC_VOLTAGE_IN] = 1,
65 .b[PSC_VOLTAGE_IN] = 0,
66 .R[PSC_VOLTAGE_IN] = 3,
67 .m[PSC_VOLTAGE_OUT] = 1,
68 .b[PSC_VOLTAGE_OUT] = 0,
69 .R[PSC_VOLTAGE_OUT] = 3,
70 .m[PSC_TEMPERATURE] = 1,
71 .b[PSC_TEMPERATURE] = 0,
72 .R[PSC_TEMPERATURE] = 3,
73 .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | PMBUS_HAVE_STATUS_INPUT
74 | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
75 | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
76 | PMBUS_HAVE_PIN | PMBUS_HAVE_POUT
77 | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP
78 | PMBUS_HAVE_FAN12 | PMBUS_HAVE_STATUS_FAN12,
79};
80
81static int ds1200_probe(struct i2c_client *client,
82 const struct i2c_device_id *id)
83{
84 return pmbus_do_probe(client, id, &ds1200_info);
85}
86
87static int ds1200_remove(struct i2c_client *client)
88{
89 return pmbus_do_remove(client);
90}
91
92static const struct i2c_device_id ds1200_id[] = {
93 {"ds1200", 0},
94 {}
95};
96
97MODULE_DEVICE_TABLE(i2c, ds1200_id);
98
99/* This is the driver that will be inserted */
100static struct i2c_driver ds1200_driver = {
101 .driver = {
102 .name = "ds1200",
103 },
104 .probe = ds1200_probe,
105 .remove = ds1200_remove,
106 .id_table = ds1200_id,
107};
108
109static int __init ds1200_init(void)
110{
111 return i2c_add_driver(&ds1200_driver);
112}
113
114static void __exit ds1200_exit(void)
115{
116 i2c_del_driver(&ds1200_driver);
117}
118
119
120Sysfs entries
121-------------
122
123When probing the chip, the driver identifies which PMBus registers are
124supported, and determines available sensors from this information.
125Attribute files only exist if respective sensors are suported by the chip.
126Labels are provided to inform the user about the sensor associated with
127a given sysfs entry.
128
129The following attributes are supported. Limits are read-write; all other
130attributes are read-only.
131
132inX_input Measured voltage. From READ_VIN or READ_VOUT register.
133inX_min Minimum Voltage.
134 From VIN_UV_WARN_LIMIT or VOUT_UV_WARN_LIMIT register.
135inX_max Maximum voltage.
136 From VIN_OV_WARN_LIMIT or VOUT_OV_WARN_LIMIT register.
137inX_lcrit Critical minimum Voltage.
138 From VIN_UV_FAULT_LIMIT or VOUT_UV_FAULT_LIMIT register.
139inX_crit Critical maximum voltage.
140 From VIN_OV_FAULT_LIMIT or VOUT_OV_FAULT_LIMIT register.
141inX_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status.
142inX_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status.
143inX_lcrit_alarm Voltage critical low alarm.
144 From VOLTAGE_UV_FAULT status.
145inX_crit_alarm Voltage critical high alarm.
146 From VOLTAGE_OV_FAULT status.
147inX_label "vin", "vcap", or "voutY"
148
149currX_input Measured current. From READ_IIN or READ_IOUT register.
150currX_max Maximum current.
151 From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT register.
152currX_lcrit Critical minimum output current.
153 From IOUT_UC_FAULT_LIMIT register.
154currX_crit Critical maximum current.
155 From IIN_OC_FAULT_LIMIT or IOUT_OC_FAULT_LIMIT register.
156currX_alarm Current high alarm.
157 From IIN_OC_WARNING or IOUT_OC_WARNING status.
158currX_max_alarm Current high alarm.
159 From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT status.
160currX_lcrit_alarm Output current critical low alarm.
161 From IOUT_UC_FAULT status.
162currX_crit_alarm Current critical high alarm.
163 From IIN_OC_FAULT or IOUT_OC_FAULT status.
164currX_label "iin" or "ioutY"
165
166powerX_input Measured power. From READ_PIN or READ_POUT register.
167powerX_cap Output power cap. From POUT_MAX register.
168powerX_max Power limit. From PIN_OP_WARN_LIMIT or
169 POUT_OP_WARN_LIMIT register.
170powerX_crit Critical output power limit.
171 From POUT_OP_FAULT_LIMIT register.
172powerX_alarm Power high alarm.
173 From PIN_OP_WARNING or POUT_OP_WARNING status.
174powerX_crit_alarm Output power critical high alarm.
175 From POUT_OP_FAULT status.
176powerX_label "pin" or "poutY"
177
178tempX_input Measured temperature.
179 From READ_TEMPERATURE_X register.
180tempX_min Mimimum temperature. From UT_WARN_LIMIT register.
181tempX_max Maximum temperature. From OT_WARN_LIMIT register.
182tempX_lcrit Critical low temperature.
183 From UT_FAULT_LIMIT register.
184tempX_crit Critical high temperature.
185 From OT_FAULT_LIMIT register.
186tempX_min_alarm Chip temperature low alarm. Set by comparing
187 READ_TEMPERATURE_X with UT_WARN_LIMIT if
188 TEMP_UT_WARNING status is set.
189tempX_max_alarm Chip temperature high alarm. Set by comparing
190 READ_TEMPERATURE_X with OT_WARN_LIMIT if
191 TEMP_OT_WARNING status is set.
192tempX_lcrit_alarm Chip temperature critical low alarm. Set by comparing
193 READ_TEMPERATURE_X with UT_FAULT_LIMIT if
194 TEMP_UT_FAULT status is set.
195tempX_crit_alarm Chip temperature critical high alarm. Set by comparing
196 READ_TEMPERATURE_X with OT_FAULT_LIMIT if
197 TEMP_OT_FAULT status is set.
diff --git a/Documentation/hwmon/sch5627 b/Documentation/hwmon/sch5627
new file mode 100644
index 000000000000..446a054e4912
--- /dev/null
+++ b/Documentation/hwmon/sch5627
@@ -0,0 +1,22 @@
1Kernel driver sch5627
2=====================
3
4Supported chips:
5 * SMSC SCH5627
6 Prefix: 'sch5627'
7 Addresses scanned: none, address read from Super I/O config space
8 Datasheet: Application Note available upon request
9
10Author: Hans de Goede <hdegoede@redhat.com>
11
12
13Description
14-----------
15
16SMSC SCH5627 Super I/O chips include complete hardware monitoring
17capabilities. They can monitor up to 5 voltages, 4 fans and 8 temperatures.
18
19The hardware monitoring part of the SMSC SCH5627 is accessed by talking
20through an embedded microcontroller. An application note describing the
21protocol for communicating with the microcontroller is available upon
22request. Please mail me if you want a copy.
diff --git a/Documentation/hwmon/sht15 b/Documentation/hwmon/sht15
new file mode 100644
index 000000000000..02850bdfac18
--- /dev/null
+++ b/Documentation/hwmon/sht15
@@ -0,0 +1,74 @@
1Kernel driver sht15
2===================
3
4Authors:
5 * Wouter Horre
6 * Jonathan Cameron
7 * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
8 * Jerome Oufella <jerome.oufella@savoirfairelinux.com>
9
10Supported chips:
11 * Sensirion SHT10
12 Prefix: 'sht10'
13
14 * Sensirion SHT11
15 Prefix: 'sht11'
16
17 * Sensirion SHT15
18 Prefix: 'sht15'
19
20 * Sensirion SHT71
21 Prefix: 'sht71'
22
23 * Sensirion SHT75
24 Prefix: 'sht75'
25
26Datasheet: Publicly available at the Sensirion website
27http://www.sensirion.ch/en/pdf/product_information/Datasheet-humidity-sensor-SHT1x.pdf
28
29Description
30-----------
31
32The SHT10, SHT11, SHT15, SHT71, and SHT75 are humidity and temperature
33sensors.
34
35The devices communicate using two GPIO lines.
36
37Supported resolutions for the measurements are 14 bits for temperature and 12
38bits for humidity, or 12 bits for temperature and 8 bits for humidity.
39
40The humidity calibration coefficients are programmed into an OTP memory on the
41chip. These coefficients are used to internally calibrate the signals from the
42sensors. Disabling the reload of those coefficients allows saving 10ms for each
43measurement and decrease power consumption, while loosing on precision.
44
45Some options may be set directly in the sht15_platform_data structure
46or via sysfs attributes.
47
48Notes:
49 * The regulator supply name is set to "vcc".
50 * If a CRC validation fails, a soft reset command is sent, which resets
51 status register to its hardware default value, but the driver will try to
52 restore the previous device configuration.
53
54Platform data
55-------------
56
57* checksum:
58 set it to true to enable CRC validation of the readings (default to false).
59* no_otp_reload:
60 flag to indicate not to reload from OTP (default to false).
61* low_resolution:
62 flag to indicate the temp/humidity resolution to use (default to false).
63
64Sysfs interface
65---------------
66
67* temp1_input: temperature input
68* humidity1_input: humidity input
69* heater_enable: write 1 in this attribute to enable the on-chip heater,
70 0 to disable it. Be careful not to enable the heater
71 for too long.
72* temp1_fault: if 1, this means that the voltage is low (below 2.47V) and
73 measurement may be invalid.
74* humidity1_fault: same as temp1_fault.
diff --git a/Documentation/hwmon/sht21 b/Documentation/hwmon/sht21
new file mode 100644
index 000000000000..db17fda45c3e
--- /dev/null
+++ b/Documentation/hwmon/sht21
@@ -0,0 +1,49 @@
1Kernel driver sht21
2===================
3
4Supported chips:
5 * Sensirion SHT21
6 Prefix: 'sht21'
7 Addresses scanned: none
8 Datasheet: Publicly available at the Sensirion website
9 http://www.sensirion.com/en/pdf/product_information/Datasheet-humidity-sensor-SHT21.pdf
10
11 * Sensirion SHT25
12 Prefix: 'sht21'
13 Addresses scanned: none
14 Datasheet: Publicly available at the Sensirion website
15 http://www.sensirion.com/en/pdf/product_information/Datasheet-humidity-sensor-SHT25.pdf
16
17Author:
18 Urs Fleisch <urs.fleisch@sensirion.com>
19
20Description
21-----------
22
23The SHT21 and SHT25 are humidity and temperature sensors in a DFN package of
24only 3 x 3 mm footprint and 1.1 mm height. The difference between the two
25devices is the higher level of precision of the SHT25 (1.8% relative humidity,
260.2 degree Celsius) compared with the SHT21 (2.0% relative humidity,
270.3 degree Celsius).
28
29The devices communicate with the I2C protocol. All sensors are set to the same
30I2C address 0x40, so an entry with I2C_BOARD_INFO("sht21", 0x40) can be used
31in the board setup code.
32
33sysfs-Interface
34---------------
35
36temp1_input - temperature input
37humidity1_input - humidity input
38
39Notes
40-----
41
42The driver uses the default resolution settings of 12 bit for humidity and 14
43bit for temperature, which results in typical measurement times of 22 ms for
44humidity and 66 ms for temperature. To keep self heating below 0.1 degree
45Celsius, the device should not be active for more than 10% of the time,
46e.g. maximum two measurements per second at the given resolution.
47
48Different resolutions, the on-chip heater, using the CRC checksum and reading
49the serial number are not supported yet.
diff --git a/Documentation/hwmon/smm665 b/Documentation/hwmon/smm665
index 3820fc9ca52d..59e316140542 100644
--- a/Documentation/hwmon/smm665
+++ b/Documentation/hwmon/smm665
@@ -150,8 +150,8 @@ in8_crit_alarm Channel F critical alarm
150in9_crit_alarm AIN1 critical alarm 150in9_crit_alarm AIN1 critical alarm
151in10_crit_alarm AIN2 critical alarm 151in10_crit_alarm AIN2 critical alarm
152 152
153temp1_input Chip tempererature 153temp1_input Chip temperature
154temp1_min Mimimum chip tempererature 154temp1_min Mimimum chip temperature
155temp1_max Maximum chip tempererature 155temp1_max Maximum chip temperature
156temp1_crit Critical chip tempererature 156temp1_crit Critical chip temperature
157temp1_crit_alarm Temperature critical alarm 157temp1_crit_alarm Temperature critical alarm
diff --git a/Documentation/hwmon/submitting-patches b/Documentation/hwmon/submitting-patches
new file mode 100644
index 000000000000..86f42e8e9e49
--- /dev/null
+++ b/Documentation/hwmon/submitting-patches
@@ -0,0 +1,109 @@
1 How to Get Your Patch Accepted Into the Hwmon Subsystem
2 -------------------------------------------------------
3
4This text is is a collection of suggestions for people writing patches or
5drivers for the hwmon subsystem. Following these suggestions will greatly
6increase the chances of your change being accepted.
7
8
91. General
10----------
11
12* It should be unnecessary to mention, but please read and follow
13 Documentation/SubmitChecklist
14 Documentation/SubmittingDrivers
15 Documentation/SubmittingPatches
16 Documentation/CodingStyle
17
18* If your patch generates checkpatch warnings, please refrain from explanations
19 such as "I don't like that coding style". Keep in mind that each unnecessary
20 warning helps hiding a real problem. If you don't like the kernel coding
21 style, don't write kernel drivers.
22
23* Please test your patch thoroughly. We are not your test group.
24 Sometimes a patch can not or not completely be tested because of missing
25 hardware. In such cases, you should test-build the code on at least one
26 architecture. If run-time testing was not achieved, it should be written
27 explicitly below the patch header.
28
29* If your patch (or the driver) is affected by configuration options such as
30 CONFIG_SMP or CONFIG_HOTPLUG, make sure it compiles for all configuration
31 variants.
32
33
342. Adding functionality to existing drivers
35-------------------------------------------
36
37* Make sure the documentation in Documentation/hwmon/<driver_name> is up to
38 date.
39
40* Make sure the information in Kconfig is up to date.
41
42* If the added functionality requires some cleanup or structural changes, split
43 your patch into a cleanup part and the actual addition. This makes it easier
44 to review your changes, and to bisect any resulting problems.
45
46* Never mix bug fixes, cleanup, and functional enhancements in a single patch.
47
48
493. New drivers
50--------------
51
52* Running your patch or driver file(s) through checkpatch does not mean its
53 formatting is clean. If unsure about formatting in your new driver, run it
54 through Lindent. Lindent is not perfect, and you may have to do some minor
55 cleanup, but it is a good start.
56
57* Consider adding yourself to MAINTAINERS.
58
59* Document the driver in Documentation/hwmon/<driver_name>.
60
61* Add the driver to Kconfig and Makefile in alphabetical order.
62
63* Make sure that all dependencies are listed in Kconfig. For new drivers, it
64 is most likely prudent to add a dependency on EXPERIMENTAL.
65
66* Avoid forward declarations if you can. Rearrange the code if necessary.
67
68* Avoid calculations in macros and macro-generated functions. While such macros
69 may save a line or so in the source, it obfuscates the code and makes code
70 review more difficult. It may also result in code which is more complicated
71 than necessary. Use inline functions or just regular functions instead.
72
73* If the driver has a detect function, make sure it is silent. Debug messages
74 and messages printed after a successful detection are acceptable, but it
75 must not print messages such as "Chip XXX not found/supported".
76
77 Keep in mind that the detect function will run for all drivers supporting an
78 address if a chip is detected on that address. Unnecessary messages will just
79 pollute the kernel log and not provide any value.
80
81* Provide a detect function if and only if a chip can be detected reliably.
82
83* Avoid writing to chip registers in the detect function. If you have to write,
84 only do it after you have already gathered enough data to be certain that the
85 detection is going to be successful.
86
87 Keep in mind that the chip might not be what your driver believes it is, and
88 writing to it might cause a bad misconfiguration.
89
90* Make sure there are no race conditions in the probe function. Specifically,
91 completely initialize your chip first, then create sysfs entries and register
92 with the hwmon subsystem.
93
94* Do not provide support for deprecated sysfs attributes.
95
96* Do not create non-standard attributes unless really needed. If you have to use
97 non-standard attributes, or you believe you do, discuss it on the mailing list
98 first. Either case, provide a detailed explanation why you need the
99 non-standard attribute(s).
100 Standard attributes are specified in Documentation/hwmon/sysfs-interface.
101
102* When deciding which sysfs attributes to support, look at the chip's
103 capabilities. While we do not expect your driver to support everything the
104 chip may offer, it should at least support all limits and alarms.
105
106* Last but not least, please check if a driver for your chip already exists
107 before starting to write a new driver. Especially for temperature sensors,
108 new chips are often variants of previously released chips. In some cases,
109 a presumably new chip may simply have been relabeled.
diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface
index 48ceabedf55d..8f63c244f1aa 100644
--- a/Documentation/hwmon/sysfs-interface
+++ b/Documentation/hwmon/sysfs-interface
@@ -187,6 +187,17 @@ fan[1-*]_div Fan divisor.
187 Note that this is actually an internal clock divisor, which 187 Note that this is actually an internal clock divisor, which
188 affects the measurable speed range, not the read value. 188 affects the measurable speed range, not the read value.
189 189
190fan[1-*]_pulses Number of tachometer pulses per fan revolution.
191 Integer value, typically between 1 and 4.
192 RW
193 This value is a characteristic of the fan connected to the
194 device's input, so it has to be set in accordance with the fan
195 model.
196 Should only be created if the chip has a register to configure
197 the number of pulses. In the absence of such a register (and
198 thus attribute) the value assumed by all devices is 2 pulses
199 per fan revolution.
200
190fan[1-*]_target 201fan[1-*]_target
191 Desired fan speed 202 Desired fan speed
192 Unit: revolution/min (RPM) 203 Unit: revolution/min (RPM)
@@ -309,6 +320,20 @@ temp[1-*]_crit_hyst
309 from the critical value. 320 from the critical value.
310 RW 321 RW
311 322
323temp[1-*]_emergency
324 Temperature emergency max value, for chips supporting more than
325 two upper temperature limits. Must be equal or greater than
326 corresponding temp_crit values.
327 Unit: millidegree Celsius
328 RW
329
330temp[1-*]_emergency_hyst
331 Temperature hysteresis value for emergency limit.
332 Unit: millidegree Celsius
333 Must be reported as an absolute temperature, NOT a delta
334 from the emergency value.
335 RW
336
312temp[1-*]_lcrit Temperature critical min value, typically lower than 337temp[1-*]_lcrit Temperature critical min value, typically lower than
313 corresponding temp_min values. 338 corresponding temp_min values.
314 Unit: millidegree Celsius 339 Unit: millidegree Celsius
@@ -370,10 +395,20 @@ curr[1-*]_min Current min value.
370 Unit: milliampere 395 Unit: milliampere
371 RW 396 RW
372 397
398curr[1-*]_lcrit Current critical low value
399 Unit: milliampere
400 RW
401
402curr[1-*]_crit Current critical high value.
403 Unit: milliampere
404 RW
405
373curr[1-*]_input Current input value 406curr[1-*]_input Current input value
374 Unit: milliampere 407 Unit: milliampere
375 RO 408 RO
376 409
410Also see the Alarms section for status flags associated with currents.
411
377********* 412*********
378* Power * 413* Power *
379********* 414*********
@@ -436,13 +471,6 @@ power[1-*]_accuracy Accuracy of the power meter.
436 Unit: Percent 471 Unit: Percent
437 RO 472 RO
438 473
439power[1-*]_alarm 1 if the system is drawing more power than the
440 cap allows; 0 otherwise. A poll notification is
441 sent to this file when the power use exceeds the
442 cap. This file only appears if the cap is known
443 to be enforced by hardware.
444 RO
445
446power[1-*]_cap If power use rises above this limit, the 474power[1-*]_cap If power use rises above this limit, the
447 system should take action to reduce power use. 475 system should take action to reduce power use.
448 A poll notification is sent to this file if the 476 A poll notification is sent to this file if the
@@ -465,6 +493,20 @@ power[1-*]_cap_min Minimum cap that can be set.
465 Unit: microWatt 493 Unit: microWatt
466 RO 494 RO
467 495
496power[1-*]_max Maximum power.
497 Unit: microWatt
498 RW
499
500power[1-*]_crit Critical maximum power.
501 If power rises to or above this limit, the
502 system is expected take drastic action to reduce
503 power consumption, such as a system shutdown or
504 a forced powerdown of some devices.
505 Unit: microWatt
506 RW
507
508Also see the Alarms section for status flags associated with power readings.
509
468********** 510**********
469* Energy * 511* Energy *
470********** 512**********
@@ -474,6 +516,15 @@ energy[1-*]_input Cumulative energy use
474 RO 516 RO
475 517
476 518
519************
520* Humidity *
521************
522
523humidity[1-*]_input Humidity
524 Unit: milli-percent (per cent mille, pcm)
525 RO
526
527
477********** 528**********
478* Alarms * 529* Alarms *
479********** 530**********
@@ -487,6 +538,7 @@ implementation.
487 538
488in[0-*]_alarm 539in[0-*]_alarm
489curr[1-*]_alarm 540curr[1-*]_alarm
541power[1-*]_alarm
490fan[1-*]_alarm 542fan[1-*]_alarm
491temp[1-*]_alarm 543temp[1-*]_alarm
492 Channel alarm 544 Channel alarm
@@ -498,13 +550,22 @@ OR
498 550
499in[0-*]_min_alarm 551in[0-*]_min_alarm
500in[0-*]_max_alarm 552in[0-*]_max_alarm
553in[0-*]_lcrit_alarm
554in[0-*]_crit_alarm
501curr[1-*]_min_alarm 555curr[1-*]_min_alarm
502curr[1-*]_max_alarm 556curr[1-*]_max_alarm
557curr[1-*]_lcrit_alarm
558curr[1-*]_crit_alarm
559power[1-*]_cap_alarm
560power[1-*]_max_alarm
561power[1-*]_crit_alarm
503fan[1-*]_min_alarm 562fan[1-*]_min_alarm
504fan[1-*]_max_alarm 563fan[1-*]_max_alarm
505temp[1-*]_min_alarm 564temp[1-*]_min_alarm
506temp[1-*]_max_alarm 565temp[1-*]_max_alarm
566temp[1-*]_lcrit_alarm
507temp[1-*]_crit_alarm 567temp[1-*]_crit_alarm
568temp[1-*]_emergency_alarm
508 Limit alarm 569 Limit alarm
509 0: no alarm 570 0: no alarm
510 1: alarm 571 1: alarm
@@ -518,7 +579,7 @@ channel should not be trusted.
518fan[1-*]_fault 579fan[1-*]_fault
519temp[1-*]_fault 580temp[1-*]_fault
520 Input fault condition 581 Input fault condition
521 0: no fault occured 582 0: no fault occurred
522 1: fault condition 583 1: fault condition
523 RO 584 RO
524 585
diff --git a/Documentation/hwmon/twl4030-madc-hwmon b/Documentation/hwmon/twl4030-madc-hwmon
new file mode 100644
index 000000000000..ef7984317cec
--- /dev/null
+++ b/Documentation/hwmon/twl4030-madc-hwmon
@@ -0,0 +1,45 @@
1Kernel driver twl4030-madc
2=========================
3
4Supported chips:
5 * Texas Instruments TWL4030
6 Prefix: 'twl4030-madc'
7
8
9Authors:
10 J Keerthy <j-keerthy@ti.com>
11
12Description
13-----------
14
15The Texas Instruments TWL4030 is a Power Management and Audio Circuit. Among
16other things it contains a 10-bit A/D converter MADC. The converter has 16
17channels which can be used in different modes.
18
19
20See this table for the meaning of the different channels
21
22Channel Signal
23------------------------------------------
240 Battery type(BTYPE)
251 BCI: Battery temperature (BTEMP)
262 GP analog input
273 GP analog input
284 GP analog input
295 GP analog input
306 GP analog input
317 GP analog input
328 BCI: VBUS voltage(VBUS)
339 Backup Battery voltage (VBKP)
3410 BCI: Battery charger current (ICHG)
3511 BCI: Battery charger voltage (VCHG)
3612 BCI: Main battery voltage (VBAT)
3713 Reserved
3814 Reserved
3915 VRUSB Supply/Speaker left/Speaker right polarization level
40
41
42The Sysfs nodes will represent the voltage in the units of mV,
43the temperature channel shows the converted temperature in
44degree celcius. The Battery charging current channel represents
45battery charging current in mA.
diff --git a/Documentation/hwmon/ucd9000 b/Documentation/hwmon/ucd9000
new file mode 100644
index 000000000000..40ca6db50c48
--- /dev/null
+++ b/Documentation/hwmon/ucd9000
@@ -0,0 +1,110 @@
1Kernel driver ucd9000
2=====================
3
4Supported chips:
5 * TI UCD90120, UCD90124, UCD9090, and UCD90910
6 Prefixes: 'ucd90120', 'ucd90124', 'ucd9090', 'ucd90910'
7 Addresses scanned: -
8 Datasheets:
9 http://focus.ti.com/lit/ds/symlink/ucd90120.pdf
10 http://focus.ti.com/lit/ds/symlink/ucd90124.pdf
11 http://focus.ti.com/lit/ds/symlink/ucd9090.pdf
12 http://focus.ti.com/lit/ds/symlink/ucd90910.pdf
13
14Author: Guenter Roeck <guenter.roeck@ericsson.com>
15
16
17Description
18-----------
19
20From datasheets:
21
22The UCD90120 Power Supply Sequencer and System Health Monitor monitors and
23sequences up to 12 independent voltage rails. The device integrates a 12-bit
24ADC with a 2.5V internal reference for monitoring up to 13 power supply voltage,
25current, or temperature inputs.
26
27The UCD90124 is a 12-rail PMBus/I2C addressable power-supply sequencer and
28system-health monitor. The device integrates a 12-bit ADC for monitoring up to
2913 power-supply voltage, current, or temperature inputs. Twenty-six GPIO pins
30can be used for power supply enables, power-on reset signals, external
31interrupts, cascading, or other system functions. Twelve of these pins offer PWM
32functionality. Using these pins, the UCD90124 offers support for fan control,
33margining, and general-purpose PWM functions.
34
35The UCD9090 is a 10-rail PMBus/I2C addressable power-supply sequencer and
36monitor. The device integrates a 12-bit ADC for monitoring up to 10 power-supply
37voltage inputs. Twenty-three GPIO pins can be used for power supply enables,
38power-on reset signals, external interrupts, cascading, or other system
39functions. Ten of these pins offer PWM functionality. Using these pins, the
40UCD9090 offers support for margining, and general-purpose PWM functions.
41
42The UCD90910 is a ten-rail I2C / PMBus addressable power-supply sequencer and
43system-health monitor. The device integrates a 12-bit ADC for monitoring up to
4413 power-supply voltage, current, or temperature inputs.
45
46This driver is a client driver to the core PMBus driver. Please see
47Documentation/hwmon/pmbus for details on PMBus client drivers.
48
49
50Usage Notes
51-----------
52
53This driver does not auto-detect devices. You will have to instantiate the
54devices explicitly. Please see Documentation/i2c/instantiating-devices for
55details.
56
57
58Platform data support
59---------------------
60
61The driver supports standard PMBus driver platform data. Please see
62Documentation/hwmon/pmbus for details.
63
64
65Sysfs entries
66-------------
67
68The following attributes are supported. Limits are read-write; all other
69attributes are read-only.
70
71in[1-12]_label "vout[1-12]".
72in[1-12]_input Measured voltage. From READ_VOUT register.
73in[1-12]_min Minumum Voltage. From VOUT_UV_WARN_LIMIT register.
74in[1-12]_max Maximum voltage. From VOUT_OV_WARN_LIMIT register.
75in[1-12]_lcrit Critical minumum Voltage. VOUT_UV_FAULT_LIMIT register.
76in[1-12]_crit Critical maximum voltage. From VOUT_OV_FAULT_LIMIT register.
77in[1-12]_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status.
78in[1-12]_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status.
79in[1-12]_lcrit_alarm Voltage critical low alarm. From VOLTAGE_UV_FAULT status.
80in[1-12]_crit_alarm Voltage critical high alarm. From VOLTAGE_OV_FAULT status.
81
82curr[1-12]_label "iout[1-12]".
83curr[1-12]_input Measured current. From READ_IOUT register.
84curr[1-12]_max Maximum current. From IOUT_OC_WARN_LIMIT register.
85curr[1-12]_lcrit Critical minumum output current. From IOUT_UC_FAULT_LIMIT
86 register.
87curr[1-12]_crit Critical maximum current. From IOUT_OC_FAULT_LIMIT register.
88curr[1-12]_max_alarm Current high alarm. From IOUT_OC_WARNING status.
89curr[1-12]_crit_alarm Current critical high alarm. From IOUT_OC_FAULT status.
90
91 For each attribute index, either voltage or current is
92 reported, but not both. If voltage or current is
93 reported depends on the chip configuration.
94
95temp[1-2]_input Measured temperatures. From READ_TEMPERATURE_1 and
96 READ_TEMPERATURE_2 registers.
97temp[1-2]_max Maximum temperature. From OT_WARN_LIMIT register.
98temp[1-2]_crit Critical high temperature. From OT_FAULT_LIMIT register.
99temp[1-2]_max_alarm Temperature high alarm.
100temp[1-2]_crit_alarm Temperature critical high alarm.
101
102fan[1-4]_input Fan RPM.
103fan[1-4]_alarm Fan alarm.
104fan[1-4]_fault Fan fault.
105
106 Fan attributes are only available on chips supporting
107 fan control (UCD90124, UCD90910). Attribute files are
108 created only for enabled fans.
109 Note that even though UCD90910 supports up to 10 fans,
110 only up to four fans are currently supported.
diff --git a/Documentation/hwmon/ucd9200 b/Documentation/hwmon/ucd9200
new file mode 100644
index 000000000000..3c58607f72fe
--- /dev/null
+++ b/Documentation/hwmon/ucd9200
@@ -0,0 +1,112 @@
1Kernel driver ucd9200
2=====================
3
4Supported chips:
5 * TI UCD9220, UCD9222, UCD9224, UCD9240, UCD9244, UCD9246, and UCD9248
6 Prefixes: 'ucd9220', 'ucd9222', 'ucd9224', 'ucd9240', 'ucd9244', 'ucd9246',
7 'ucd9248'
8 Addresses scanned: -
9 Datasheets:
10 http://focus.ti.com/lit/ds/symlink/ucd9220.pdf
11 http://focus.ti.com/lit/ds/symlink/ucd9222.pdf
12 http://focus.ti.com/lit/ds/symlink/ucd9224.pdf
13 http://focus.ti.com/lit/ds/symlink/ucd9240.pdf
14 http://focus.ti.com/lit/ds/symlink/ucd9244.pdf
15 http://focus.ti.com/lit/ds/symlink/ucd9246.pdf
16 http://focus.ti.com/lit/ds/symlink/ucd9248.pdf
17
18Author: Guenter Roeck <guenter.roeck@ericsson.com>
19
20
21Description
22-----------
23
24[From datasheets] UCD9220, UCD9222, UCD9224, UCD9240, UCD9244, UCD9246, and
25UCD9248 are multi-rail, multi-phase synchronous buck digital PWM controllers
26designed for non-isolated DC/DC power applications. The devices integrate
27dedicated circuitry for DC/DC loop management with flash memory and a serial
28interface to support configuration, monitoring and management.
29
30This driver is a client driver to the core PMBus driver. Please see
31Documentation/hwmon/pmbus for details on PMBus client drivers.
32
33
34Usage Notes
35-----------
36
37This driver does not auto-detect devices. You will have to instantiate the
38devices explicitly. Please see Documentation/i2c/instantiating-devices for
39details.
40
41
42Platform data support
43---------------------
44
45The driver supports standard PMBus driver platform data. Please see
46Documentation/hwmon/pmbus for details.
47
48
49Sysfs entries
50-------------
51
52The following attributes are supported. Limits are read-write; all other
53attributes are read-only.
54
55in1_label "vin".
56in1_input Measured voltage. From READ_VIN register.
57in1_min Minumum Voltage. From VIN_UV_WARN_LIMIT register.
58in1_max Maximum voltage. From VIN_OV_WARN_LIMIT register.
59in1_lcrit Critical minumum Voltage. VIN_UV_FAULT_LIMIT register.
60in1_crit Critical maximum voltage. From VIN_OV_FAULT_LIMIT register.
61in1_min_alarm Voltage low alarm. From VIN_UV_WARNING status.
62in1_max_alarm Voltage high alarm. From VIN_OV_WARNING status.
63in1_lcrit_alarm Voltage critical low alarm. From VIN_UV_FAULT status.
64in1_crit_alarm Voltage critical high alarm. From VIN_OV_FAULT status.
65
66in[2-5]_label "vout[1-4]".
67in[2-5]_input Measured voltage. From READ_VOUT register.
68in[2-5]_min Minumum Voltage. From VOUT_UV_WARN_LIMIT register.
69in[2-5]_max Maximum voltage. From VOUT_OV_WARN_LIMIT register.
70in[2-5]_lcrit Critical minumum Voltage. VOUT_UV_FAULT_LIMIT register.
71in[2-5]_crit Critical maximum voltage. From VOUT_OV_FAULT_LIMIT register.
72in[2-5]_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status.
73in[2-5]_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status.
74in[2-5]_lcrit_alarm Voltage critical low alarm. From VOLTAGE_UV_FAULT status.
75in[2-5]_crit_alarm Voltage critical high alarm. From VOLTAGE_OV_FAULT status.
76
77curr1_label "iin".
78curr1_input Measured current. From READ_IIN register.
79
80curr[2-5]_label "iout[1-4]".
81curr[2-5]_input Measured current. From READ_IOUT register.
82curr[2-5]_max Maximum current. From IOUT_OC_WARN_LIMIT register.
83curr[2-5]_lcrit Critical minumum output current. From IOUT_UC_FAULT_LIMIT
84 register.
85curr[2-5]_crit Critical maximum current. From IOUT_OC_FAULT_LIMIT register.
86curr[2-5]_max_alarm Current high alarm. From IOUT_OC_WARNING status.
87curr[2-5]_crit_alarm Current critical high alarm. From IOUT_OC_FAULT status.
88
89power1_input Measured input power. From READ_PIN register.
90power1_label "pin"
91
92power[2-5]_input Measured output power. From READ_POUT register.
93power[2-5]_label "pout[1-4]"
94
95 The number of output voltage, current, and power
96 attribute sets is determined by the number of enabled
97 rails. See chip datasheets for details.
98
99temp[1-5]_input Measured temperatures. From READ_TEMPERATURE_1 and
100 READ_TEMPERATURE_2 registers.
101 temp1 is the chip internal temperature. temp[2-5] are
102 rail temperatures. temp[2-5] attributes are only
103 created for enabled rails. See chip datasheets for
104 details.
105temp[1-5]_max Maximum temperature. From OT_WARN_LIMIT register.
106temp[1-5]_crit Critical high temperature. From OT_FAULT_LIMIT register.
107temp[1-5]_max_alarm Temperature high alarm.
108temp[1-5]_crit_alarm Temperature critical high alarm.
109
110fan1_input Fan RPM. ucd9240 only.
111fan1_alarm Fan alarm. ucd9240 only.
112fan1_fault Fan fault. ucd9240 only.
diff --git a/Documentation/hwmon/w83627ehf b/Documentation/hwmon/w83627ehf
index 13d556112fc0..76ffef94ed75 100644
--- a/Documentation/hwmon/w83627ehf
+++ b/Documentation/hwmon/w83627ehf
@@ -5,13 +5,11 @@ Supported chips:
5 * Winbond W83627EHF/EHG (ISA access ONLY) 5 * Winbond W83627EHF/EHG (ISA access ONLY)
6 Prefix: 'w83627ehf' 6 Prefix: 'w83627ehf'
7 Addresses scanned: ISA address retrieved from Super I/O registers 7 Addresses scanned: ISA address retrieved from Super I/O registers
8 Datasheet: 8 Datasheet: not available
9 http://www.nuvoton.com.tw/NR/rdonlyres/A6A258F0-F0C9-4F97-81C0-C4D29E7E943E/0/W83627EHF.pdf
10 * Winbond W83627DHG 9 * Winbond W83627DHG
11 Prefix: 'w83627dhg' 10 Prefix: 'w83627dhg'
12 Addresses scanned: ISA address retrieved from Super I/O registers 11 Addresses scanned: ISA address retrieved from Super I/O registers
13 Datasheet: 12 Datasheet: not available
14 http://www.nuvoton.com.tw/NR/rdonlyres/7885623D-A487-4CF9-A47F-30C5F73D6FE6/0/W83627DHG.pdf
15 * Winbond W83627DHG-P 13 * Winbond W83627DHG-P
16 Prefix: 'w83627dhg' 14 Prefix: 'w83627dhg'
17 Addresses scanned: ISA address retrieved from Super I/O registers 15 Addresses scanned: ISA address retrieved from Super I/O registers
@@ -24,6 +22,14 @@ Supported chips:
24 Prefix: 'w83667hg' 22 Prefix: 'w83667hg'
25 Addresses scanned: ISA address retrieved from Super I/O registers 23 Addresses scanned: ISA address retrieved from Super I/O registers
26 Datasheet: Available from Nuvoton upon request 24 Datasheet: Available from Nuvoton upon request
25 * Nuvoton NCT6775F/W83667HG-I
26 Prefix: 'nct6775'
27 Addresses scanned: ISA address retrieved from Super I/O registers
28 Datasheet: Available from Nuvoton upon request
29 * Nuvoton NCT6776F
30 Prefix: 'nct6776'
31 Addresses scanned: ISA address retrieved from Super I/O registers
32 Datasheet: Available from Nuvoton upon request
27 33
28Authors: 34Authors:
29 Jean Delvare <khali@linux-fr.org> 35 Jean Delvare <khali@linux-fr.org>
@@ -36,19 +42,28 @@ Description
36----------- 42-----------
37 43
38This driver implements support for the Winbond W83627EHF, W83627EHG, 44This driver implements support for the Winbond W83627EHF, W83627EHG,
39W83627DHG, W83627DHG-P, W83667HG and W83667HG-B super I/O chips. 45W83627DHG, W83627DHG-P, W83667HG, W83667HG-B, W83667HG-I (NCT6775F),
40We will refer to them collectively as Winbond chips. 46and NCT6776F super I/O chips. We will refer to them collectively as
41 47Winbond chips.
42The chips implement three temperature sensors, five fan rotation 48
43speed sensors, ten analog voltage sensors (only nine for the 627DHG), one 49The chips implement three temperature sensors (up to four for 667HG-B, and nine
44VID (6 pins for the 627EHF/EHG, 8 pins for the 627DHG and 667HG), alarms 50for NCT6775F and NCT6776F), five fan rotation speed sensors, ten analog voltage
45with beep warnings (control unimplemented), and some automatic fan 51sensors (only nine for the 627DHG), one VID (6 pins for the 627EHF/EHG, 8 pins
46regulation strategies (plus manual fan control mode). 52for the 627DHG and 667HG), alarms with beep warnings (control unimplemented),
53and some automatic fan regulation strategies (plus manual fan control mode).
54
55The temperature sensor sources on W82677HG-B, NCT6775F, and NCT6776F are
56configurable. temp4 and higher attributes are only reported if its temperature
57source differs from the temperature sources of the already reported temperature
58sensors. The configured source for each of the temperature sensors is provided
59in tempX_label.
47 60
48Temperatures are measured in degrees Celsius and measurement resolution is 1 61Temperatures are measured in degrees Celsius and measurement resolution is 1
49degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when 62degC for temp1 and and 0.5 degC for temp2 and temp3. For temp4 and higher,
50the temperature gets higher than high limit; it stays on until the temperature 63resolution is 1 degC for W83667HG-B and 0.0 degC for NCT6775F and NCT6776F.
51falls below the hysteresis value. 64An alarm is triggered when the temperature gets higher than high limit;
65it stays on until the temperature falls below the hysteresis value.
66Alarms are only supported for temp1, temp2, and temp3.
52 67
53Fan rotation speeds are reported in RPM (rotations per minute). An alarm is 68Fan rotation speeds are reported in RPM (rotations per minute). An alarm is
54triggered if the rotation speed has dropped below a programmable limit. Fan 69triggered if the rotation speed has dropped below a programmable limit. Fan
@@ -80,7 +95,8 @@ prog -> pwm4 (not on 667HG and 667HG-B; the programmable setting is not
80 95
81name - this is a standard hwmon device entry. For the W83627EHF and W83627EHG, 96name - this is a standard hwmon device entry. For the W83627EHF and W83627EHG,
82 it is set to "w83627ehf", for the W83627DHG it is set to "w83627dhg", 97 it is set to "w83627ehf", for the W83627DHG it is set to "w83627dhg",
83 and for the W83667HG it is set to "w83667hg". 98 for the W83667HG and W83667HG-B it is set to "w83667hg", for NCT6775F it
99 is set to "nct6775", and for NCT6776F it is set to "nct6776".
84 100
85pwm[1-4] - this file stores PWM duty cycle or DC value (fan speed) in range: 101pwm[1-4] - this file stores PWM duty cycle or DC value (fan speed) in range:
86 0 (stop) to 255 (full) 102 0 (stop) to 255 (full)
@@ -90,6 +106,18 @@ pwm[1-4]_enable - this file controls mode of fan/temperature control:
90 * 2 "Thermal Cruise" mode 106 * 2 "Thermal Cruise" mode
91 * 3 "Fan Speed Cruise" mode 107 * 3 "Fan Speed Cruise" mode
92 * 4 "Smart Fan III" mode 108 * 4 "Smart Fan III" mode
109 * 5 "Smart Fan IV" mode
110
111 SmartFan III mode is not supported on NCT6776F.
112
113 SmartFan IV mode is configurable only if it was configured at system
114 startup, and is only supported for W83677HG-B, NCT6775F, and NCT6776F.
115 SmartFan IV operational parameters can not be configured at this time,
116 and the various pwm attributes are not used in SmartFan IV mode.
117 The attributes can be written to, which is useful if you plan to
118 configure the system for a different pwm mode. However, the information
119 returned when reading pwm attributes is unrelated to SmartFan IV
120 operation.
93 121
94pwm[1-4]_mode - controls if output is PWM or DC level 122pwm[1-4]_mode - controls if output is PWM or DC level
95 * 0 DC output (0 - 12v) 123 * 0 DC output (0 - 12v)
diff --git a/Documentation/hwmon/w83627hf b/Documentation/hwmon/w83627hf
index fb145e5e722a..8432e1118173 100644
--- a/Documentation/hwmon/w83627hf
+++ b/Documentation/hwmon/w83627hf
@@ -91,3 +91,25 @@ isaset -y -f 0x2e 0xaa
91 91
92The above sequence assumes a Super-I/O config space at 0x2e/0x2f, but 92The above sequence assumes a Super-I/O config space at 0x2e/0x2f, but
930x4e/0x4f is also possible. 930x4e/0x4f is also possible.
94
95Voltage pin mapping
96-------------------
97
98Here is a summary of the voltage pin mapping for the W83627THF. This
99can be useful to convert data provided by board manufacturers into
100working libsensors configuration statements.
101
102 W83627THF |
103 Pin | Name | Register | Sysfs attribute
104-----------------------------------------------------
105 100 | CPUVCORE | 20h | in0
106 99 | VIN0 | 21h | in1
107 98 | VIN1 | 22h | in2
108 97 | VIN2 | 24h | in4
109 114 | AVCC | 23h | in3
110 61 | 5VSB | 50h (bank 5) | in7
111 74 | VBAT | 51h (bank 5) | in8
112
113For other supported devices, you'll have to take the hard path and
114look up the information in the datasheet yourself (and then add it
115to this document please.)
diff --git a/Documentation/hwmon/w83781d b/Documentation/hwmon/w83781d
index ecbc1e4574b4..129b0a3b555b 100644
--- a/Documentation/hwmon/w83781d
+++ b/Documentation/hwmon/w83781d
@@ -403,7 +403,7 @@ found out the following values do work as a form of coarse pwm:
403 403
4040x80 - seems to turn fans off after some time(1-2 minutes)... might be 4040x80 - seems to turn fans off after some time(1-2 minutes)... might be
405some form of auto-fan-control based on temp? hmm (Qfan? this mobo is an 405some form of auto-fan-control based on temp? hmm (Qfan? this mobo is an
406old ASUS, it isn't marketed as Qfan. Maybe some beta pre-attemp at Qfan 406old ASUS, it isn't marketed as Qfan. Maybe some beta pre-attempt at Qfan
407that was dropped at the BIOS) 407that was dropped at the BIOS)
4080x81 - off 4080x81 - off
4090x82 - slightly "on-ner" than off, but my fans do not get to move. I can 4090x82 - slightly "on-ner" than off, but my fans do not get to move. I can
diff --git a/Documentation/hwmon/w83791d b/Documentation/hwmon/w83791d
index 5663e491655c..90387c3540f7 100644
--- a/Documentation/hwmon/w83791d
+++ b/Documentation/hwmon/w83791d
@@ -93,7 +93,7 @@ The sysfs interface to the beep bitmask has migrated from the original legacy
93method of a single sysfs beep_mask file to a newer method using multiple 93method of a single sysfs beep_mask file to a newer method using multiple
94*_beep files as described in .../Documentation/hwmon/sysfs-interface. 94*_beep files as described in .../Documentation/hwmon/sysfs-interface.
95 95
96A similar change has occured for the bitmap corresponding to the alarms. The 96A similar change has occurred for the bitmap corresponding to the alarms. The
97original legacy method used a single sysfs alarms file containing a bitmap 97original legacy method used a single sysfs alarms file containing a bitmap
98of triggered alarms. The newer method uses multiple sysfs *_alarm files 98of triggered alarms. The newer method uses multiple sysfs *_alarm files
99(again following the pattern described in sysfs-interface). 99(again following the pattern described in sysfs-interface).
diff --git a/Documentation/hwmon/w83793 b/Documentation/hwmon/w83793
index 51171a83165b..6cc5f639b721 100644
--- a/Documentation/hwmon/w83793
+++ b/Documentation/hwmon/w83793
@@ -92,7 +92,7 @@ This driver implements support for Winbond W83793G/W83793R chips.
92 92
93* Chassis 93* Chassis
94 If the case open alarm triggers, it will stay in this state unless cleared 94 If the case open alarm triggers, it will stay in this state unless cleared
95 by any write to the sysfs file "chassis". 95 by writing 0 to the sysfs file "intrusion0_alarm".
96 96
97* VID and VRM 97* VID and VRM
98 The VRM version is detected automatically, don't modify the it unless you 98 The VRM version is detected automatically, don't modify the it unless you
diff --git a/Documentation/hwmon/w83795 b/Documentation/hwmon/w83795
new file mode 100644
index 000000000000..9f160371f463
--- /dev/null
+++ b/Documentation/hwmon/w83795
@@ -0,0 +1,127 @@
1Kernel driver w83795
2====================
3
4Supported chips:
5 * Winbond/Nuvoton W83795G
6 Prefix: 'w83795g'
7 Addresses scanned: I2C 0x2c - 0x2f
8 Datasheet: Available for download on nuvoton.com
9 * Winbond/Nuvoton W83795ADG
10 Prefix: 'w83795adg'
11 Addresses scanned: I2C 0x2c - 0x2f
12 Datasheet: Available for download on nuvoton.com
13
14Authors:
15 Wei Song (Nuvoton)
16 Jean Delvare <khali@linux-fr.org>
17
18
19Pin mapping
20-----------
21
22Here is a summary of the pin mapping for the W83795G and W83795ADG.
23This can be useful to convert data provided by board manufacturers
24into working libsensors configuration statements.
25
26 W83795G |
27 Pin | Name | Register | Sysfs attribute
28------------------------------------------------------------------
29 13 | VSEN1 (VCORE1) | 10h | in0
30 14 | VSEN2 (VCORE2) | 11h | in1
31 15 | VSEN3 (VCORE3) | 12h | in2
32 16 | VSEN4 | 13h | in3
33 17 | VSEN5 | 14h | in4
34 18 | VSEN6 | 15h | in5
35 19 | VSEN7 | 16h | in6
36 20 | VSEN8 | 17h | in7
37 21 | VSEN9 | 18h | in8
38 22 | VSEN10 | 19h | in9
39 23 | VSEN11 | 1Ah | in10
40 28 | VTT | 1Bh | in11
41 24 | 3VDD | 1Ch | in12
42 25 | 3VSB | 1Dh | in13
43 26 | VBAT | 1Eh | in14
44 3 | VSEN12/TR5 | 1Fh | in15/temp5
45 4 | VSEN13/TR5 | 20h | in16/temp6
46 5/ 6 | VDSEN14/TR1/TD1 | 21h | in17/temp1
47 7/ 8 | VDSEN15/TR2/TD2 | 22h | in18/temp2
48 9/ 10 | VDSEN16/TR3/TD3 | 23h | in19/temp3
49 11/ 12 | VDSEN17/TR4/TD4 | 24h | in20/temp4
50 40 | FANIN1 | 2Eh | fan1
51 42 | FANIN2 | 2Fh | fan2
52 44 | FANIN3 | 30h | fan3
53 46 | FANIN4 | 31h | fan4
54 48 | FANIN5 | 32h | fan5
55 50 | FANIN6 | 33h | fan6
56 52 | FANIN7 | 34h | fan7
57 54 | FANIN8 | 35h | fan8
58 57 | FANIN9 | 36h | fan9
59 58 | FANIN10 | 37h | fan10
60 59 | FANIN11 | 38h | fan11
61 60 | FANIN12 | 39h | fan12
62 31 | FANIN13 | 3Ah | fan13
63 35 | FANIN14 | 3Bh | fan14
64 41 | FANCTL1 | 10h (bank 2) | pwm1
65 43 | FANCTL2 | 11h (bank 2) | pwm2
66 45 | FANCTL3 | 12h (bank 2) | pwm3
67 47 | FANCTL4 | 13h (bank 2) | pwm4
68 49 | FANCTL5 | 14h (bank 2) | pwm5
69 51 | FANCTL6 | 15h (bank 2) | pwm6
70 53 | FANCTL7 | 16h (bank 2) | pwm7
71 55 | FANCTL8 | 17h (bank 2) | pwm8
72 29/ 30 | PECI/TSI (DTS1) | 26h | temp7
73 29/ 30 | PECI/TSI (DTS2) | 27h | temp8
74 29/ 30 | PECI/TSI (DTS3) | 28h | temp9
75 29/ 30 | PECI/TSI (DTS4) | 29h | temp10
76 29/ 30 | PECI/TSI (DTS5) | 2Ah | temp11
77 29/ 30 | PECI/TSI (DTS6) | 2Bh | temp12
78 29/ 30 | PECI/TSI (DTS7) | 2Ch | temp13
79 29/ 30 | PECI/TSI (DTS8) | 2Dh | temp14
80 27 | CASEOPEN# | 46h | intrusion0
81
82 W83795ADG |
83 Pin | Name | Register | Sysfs attribute
84------------------------------------------------------------------
85 10 | VSEN1 (VCORE1) | 10h | in0
86 11 | VSEN2 (VCORE2) | 11h | in1
87 12 | VSEN3 (VCORE3) | 12h | in2
88 13 | VSEN4 | 13h | in3
89 14 | VSEN5 | 14h | in4
90 15 | VSEN6 | 15h | in5
91 16 | VSEN7 | 16h | in6
92 17 | VSEN8 | 17h | in7
93 22 | VTT | 1Bh | in11
94 18 | 3VDD | 1Ch | in12
95 19 | 3VSB | 1Dh | in13
96 20 | VBAT | 1Eh | in14
97 48 | VSEN12/TR5 | 1Fh | in15/temp5
98 1 | VSEN13/TR5 | 20h | in16/temp6
99 2/ 3 | VDSEN14/TR1/TD1 | 21h | in17/temp1
100 4/ 5 | VDSEN15/TR2/TD2 | 22h | in18/temp2
101 6/ 7 | VDSEN16/TR3/TD3 | 23h | in19/temp3
102 8/ 9 | VDSEN17/TR4/TD4 | 24h | in20/temp4
103 32 | FANIN1 | 2Eh | fan1
104 34 | FANIN2 | 2Fh | fan2
105 36 | FANIN3 | 30h | fan3
106 37 | FANIN4 | 31h | fan4
107 38 | FANIN5 | 32h | fan5
108 39 | FANIN6 | 33h | fan6
109 40 | FANIN7 | 34h | fan7
110 41 | FANIN8 | 35h | fan8
111 43 | FANIN9 | 36h | fan9
112 44 | FANIN10 | 37h | fan10
113 45 | FANIN11 | 38h | fan11
114 46 | FANIN12 | 39h | fan12
115 24 | FANIN13 | 3Ah | fan13
116 28 | FANIN14 | 3Bh | fan14
117 33 | FANCTL1 | 10h (bank 2) | pwm1
118 35 | FANCTL2 | 11h (bank 2) | pwm2
119 23 | PECI (DTS1) | 26h | temp7
120 23 | PECI (DTS2) | 27h | temp8
121 23 | PECI (DTS3) | 28h | temp9
122 23 | PECI (DTS4) | 29h | temp10
123 23 | PECI (DTS5) | 2Ah | temp11
124 23 | PECI (DTS6) | 2Bh | temp12
125 23 | PECI (DTS7) | 2Ch | temp13
126 23 | PECI (DTS8) | 2Dh | temp14
127 21 | CASEOPEN# | 46h | intrusion0
diff --git a/Documentation/hwspinlock.txt b/Documentation/hwspinlock.txt
new file mode 100644
index 000000000000..7dcd1a4e726c
--- /dev/null
+++ b/Documentation/hwspinlock.txt
@@ -0,0 +1,293 @@
1Hardware Spinlock Framework
2
31. Introduction
4
5Hardware spinlock modules provide hardware assistance for synchronization
6and mutual exclusion between heterogeneous processors and those not operating
7under a single, shared operating system.
8
9For example, OMAP4 has dual Cortex-A9, dual Cortex-M3 and a C64x+ DSP,
10each of which is running a different Operating System (the master, A9,
11is usually running Linux and the slave processors, the M3 and the DSP,
12are running some flavor of RTOS).
13
14A generic hwspinlock framework allows platform-independent drivers to use
15the hwspinlock device in order to access data structures that are shared
16between remote processors, that otherwise have no alternative mechanism
17to accomplish synchronization and mutual exclusion operations.
18
19This is necessary, for example, for Inter-processor communications:
20on OMAP4, cpu-intensive multimedia tasks are offloaded by the host to the
21remote M3 and/or C64x+ slave processors (by an IPC subsystem called Syslink).
22
23To achieve fast message-based communications, a minimal kernel support
24is needed to deliver messages arriving from a remote processor to the
25appropriate user process.
26
27This communication is based on simple data structures that is shared between
28the remote processors, and access to it is synchronized using the hwspinlock
29module (remote processor directly places new messages in this shared data
30structure).
31
32A common hwspinlock interface makes it possible to have generic, platform-
33independent, drivers.
34
352. User API
36
37 struct hwspinlock *hwspin_lock_request(void);
38 - dynamically assign an hwspinlock and return its address, or NULL
39 in case an unused hwspinlock isn't available. Users of this
40 API will usually want to communicate the lock's id to the remote core
41 before it can be used to achieve synchronization.
42 Can be called from an atomic context (this function will not sleep) but
43 not from within interrupt context.
44
45 struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
46 - assign a specific hwspinlock id and return its address, or NULL
47 if that hwspinlock is already in use. Usually board code will
48 be calling this function in order to reserve specific hwspinlock
49 ids for predefined purposes.
50 Can be called from an atomic context (this function will not sleep) but
51 not from within interrupt context.
52
53 int hwspin_lock_free(struct hwspinlock *hwlock);
54 - free a previously-assigned hwspinlock; returns 0 on success, or an
55 appropriate error code on failure (e.g. -EINVAL if the hwspinlock
56 is already free).
57 Can be called from an atomic context (this function will not sleep) but
58 not from within interrupt context.
59
60 int hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int timeout);
61 - lock a previously-assigned hwspinlock with a timeout limit (specified in
62 msecs). If the hwspinlock is already taken, the function will busy loop
63 waiting for it to be released, but give up when the timeout elapses.
64 Upon a successful return from this function, preemption is disabled so
65 the caller must not sleep, and is advised to release the hwspinlock as
66 soon as possible, in order to minimize remote cores polling on the
67 hardware interconnect.
68 Returns 0 when successful and an appropriate error code otherwise (most
69 notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).
70 The function will never sleep.
71
72 int hwspin_lock_timeout_irq(struct hwspinlock *hwlock, unsigned int timeout);
73 - lock a previously-assigned hwspinlock with a timeout limit (specified in
74 msecs). If the hwspinlock is already taken, the function will busy loop
75 waiting for it to be released, but give up when the timeout elapses.
76 Upon a successful return from this function, preemption and the local
77 interrupts are disabled, so the caller must not sleep, and is advised to
78 release the hwspinlock as soon as possible.
79 Returns 0 when successful and an appropriate error code otherwise (most
80 notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).
81 The function will never sleep.
82
83 int hwspin_lock_timeout_irqsave(struct hwspinlock *hwlock, unsigned int to,
84 unsigned long *flags);
85 - lock a previously-assigned hwspinlock with a timeout limit (specified in
86 msecs). If the hwspinlock is already taken, the function will busy loop
87 waiting for it to be released, but give up when the timeout elapses.
88 Upon a successful return from this function, preemption is disabled,
89 local interrupts are disabled and their previous state is saved at the
90 given flags placeholder. The caller must not sleep, and is advised to
91 release the hwspinlock as soon as possible.
92 Returns 0 when successful and an appropriate error code otherwise (most
93 notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).
94 The function will never sleep.
95
96 int hwspin_trylock(struct hwspinlock *hwlock);
97 - attempt to lock a previously-assigned hwspinlock, but immediately fail if
98 it is already taken.
99 Upon a successful return from this function, preemption is disabled so
100 caller must not sleep, and is advised to release the hwspinlock as soon as
101 possible, in order to minimize remote cores polling on the hardware
102 interconnect.
103 Returns 0 on success and an appropriate error code otherwise (most
104 notably -EBUSY if the hwspinlock was already taken).
105 The function will never sleep.
106
107 int hwspin_trylock_irq(struct hwspinlock *hwlock);
108 - attempt to lock a previously-assigned hwspinlock, but immediately fail if
109 it is already taken.
110 Upon a successful return from this function, preemption and the local
111 interrupts are disabled so caller must not sleep, and is advised to
112 release the hwspinlock as soon as possible.
113 Returns 0 on success and an appropriate error code otherwise (most
114 notably -EBUSY if the hwspinlock was already taken).
115 The function will never sleep.
116
117 int hwspin_trylock_irqsave(struct hwspinlock *hwlock, unsigned long *flags);
118 - attempt to lock a previously-assigned hwspinlock, but immediately fail if
119 it is already taken.
120 Upon a successful return from this function, preemption is disabled,
121 the local interrupts are disabled and their previous state is saved
122 at the given flags placeholder. The caller must not sleep, and is advised
123 to release the hwspinlock as soon as possible.
124 Returns 0 on success and an appropriate error code otherwise (most
125 notably -EBUSY if the hwspinlock was already taken).
126 The function will never sleep.
127
128 void hwspin_unlock(struct hwspinlock *hwlock);
129 - unlock a previously-locked hwspinlock. Always succeed, and can be called
130 from any context (the function never sleeps). Note: code should _never_
131 unlock an hwspinlock which is already unlocked (there is no protection
132 against this).
133
134 void hwspin_unlock_irq(struct hwspinlock *hwlock);
135 - unlock a previously-locked hwspinlock and enable local interrupts.
136 The caller should _never_ unlock an hwspinlock which is already unlocked.
137 Doing so is considered a bug (there is no protection against this).
138 Upon a successful return from this function, preemption and local
139 interrupts are enabled. This function will never sleep.
140
141 void
142 hwspin_unlock_irqrestore(struct hwspinlock *hwlock, unsigned long *flags);
143 - unlock a previously-locked hwspinlock.
144 The caller should _never_ unlock an hwspinlock which is already unlocked.
145 Doing so is considered a bug (there is no protection against this).
146 Upon a successful return from this function, preemption is reenabled,
147 and the state of the local interrupts is restored to the state saved at
148 the given flags. This function will never sleep.
149
150 int hwspin_lock_get_id(struct hwspinlock *hwlock);
151 - retrieve id number of a given hwspinlock. This is needed when an
152 hwspinlock is dynamically assigned: before it can be used to achieve
153 mutual exclusion with a remote cpu, the id number should be communicated
154 to the remote task with which we want to synchronize.
155 Returns the hwspinlock id number, or -EINVAL if hwlock is null.
156
1573. Typical usage
158
159#include <linux/hwspinlock.h>
160#include <linux/err.h>
161
162int hwspinlock_example1(void)
163{
164 struct hwspinlock *hwlock;
165 int ret;
166
167 /* dynamically assign a hwspinlock */
168 hwlock = hwspin_lock_request();
169 if (!hwlock)
170 ...
171
172 id = hwspin_lock_get_id(hwlock);
173 /* probably need to communicate id to a remote processor now */
174
175 /* take the lock, spin for 1 sec if it's already taken */
176 ret = hwspin_lock_timeout(hwlock, 1000);
177 if (ret)
178 ...
179
180 /*
181 * we took the lock, do our thing now, but do NOT sleep
182 */
183
184 /* release the lock */
185 hwspin_unlock(hwlock);
186
187 /* free the lock */
188 ret = hwspin_lock_free(hwlock);
189 if (ret)
190 ...
191
192 return ret;
193}
194
195int hwspinlock_example2(void)
196{
197 struct hwspinlock *hwlock;
198 int ret;
199
200 /*
201 * assign a specific hwspinlock id - this should be called early
202 * by board init code.
203 */
204 hwlock = hwspin_lock_request_specific(PREDEFINED_LOCK_ID);
205 if (!hwlock)
206 ...
207
208 /* try to take it, but don't spin on it */
209 ret = hwspin_trylock(hwlock);
210 if (!ret) {
211 pr_info("lock is already taken\n");
212 return -EBUSY;
213 }
214
215 /*
216 * we took the lock, do our thing now, but do NOT sleep
217 */
218
219 /* release the lock */
220 hwspin_unlock(hwlock);
221
222 /* free the lock */
223 ret = hwspin_lock_free(hwlock);
224 if (ret)
225 ...
226
227 return ret;
228}
229
230
2314. API for implementors
232
233 int hwspin_lock_register(struct hwspinlock *hwlock);
234 - to be called from the underlying platform-specific implementation, in
235 order to register a new hwspinlock instance. Can be called from an atomic
236 context (this function will not sleep) but not from within interrupt
237 context. Returns 0 on success, or appropriate error code on failure.
238
239 struct hwspinlock *hwspin_lock_unregister(unsigned int id);
240 - to be called from the underlying vendor-specific implementation, in order
241 to unregister an existing (and unused) hwspinlock instance.
242 Can be called from an atomic context (will not sleep) but not from
243 within interrupt context.
244 Returns the address of hwspinlock on success, or NULL on error (e.g.
245 if the hwspinlock is sill in use).
246
2475. struct hwspinlock
248
249This struct represents an hwspinlock instance. It is registered by the
250underlying hwspinlock implementation using the hwspin_lock_register() API.
251
252/**
253 * struct hwspinlock - vendor-specific hwspinlock implementation
254 *
255 * @dev: underlying device, will be used with runtime PM api
256 * @ops: vendor-specific hwspinlock handlers
257 * @id: a global, unique, system-wide, index of the lock.
258 * @lock: initialized and used by hwspinlock core
259 * @owner: underlying implementation module, used to maintain module ref count
260 */
261struct hwspinlock {
262 struct device *dev;
263 const struct hwspinlock_ops *ops;
264 int id;
265 spinlock_t lock;
266 struct module *owner;
267};
268
269The underlying implementation is responsible to assign the dev, ops, id and
270owner members. The lock member, OTOH, is initialized and used by the hwspinlock
271core.
272
2736. Implementation callbacks
274
275There are three possible callbacks defined in 'struct hwspinlock_ops':
276
277struct hwspinlock_ops {
278 int (*trylock)(struct hwspinlock *lock);
279 void (*unlock)(struct hwspinlock *lock);
280 void (*relax)(struct hwspinlock *lock);
281};
282
283The first two callbacks are mandatory:
284
285The ->trylock() callback should make a single attempt to take the lock, and
286return 0 on failure and 1 on success. This callback may _not_ sleep.
287
288The ->unlock() callback releases the lock. It always succeed, and it, too,
289may _not_ sleep.
290
291The ->relax() callback is optional. It is called by hwspinlock core while
292spinning on a lock, and can be used by the underlying implementation to force
293a delay between two successive invocations of ->trylock(). It may _not_ sleep.
diff --git a/Documentation/i2c/busses/i2c-diolan-u2c b/Documentation/i2c/busses/i2c-diolan-u2c
new file mode 100644
index 000000000000..30fe4bb9a069
--- /dev/null
+++ b/Documentation/i2c/busses/i2c-diolan-u2c
@@ -0,0 +1,26 @@
1Kernel driver i2c-diolan-u2c
2
3Supported adapters:
4 * Diolan U2C-12 I2C-USB adapter
5 Documentation:
6 http://www.diolan.com/i2c/u2c12.html
7
8Author: Guenter Roeck <guenter.roeck@ericsson.com>
9
10Description
11-----------
12
13This is the driver for the Diolan U2C-12 USB-I2C adapter.
14
15The Diolan U2C-12 I2C-USB Adapter provides a low cost solution to connect
16a computer to I2C slave devices using a USB interface. It also supports
17connectivity to SPI devices.
18
19This driver only supports the I2C interface of U2C-12. The driver does not use
20interrupts.
21
22
23Module parameters
24-----------------
25
26* frequency: I2C bus frequency
diff --git a/Documentation/i2c/busses/i2c-i801 b/Documentation/i2c/busses/i2c-i801
index e307914a3eda..2871fd500349 100644
--- a/Documentation/i2c/busses/i2c-i801
+++ b/Documentation/i2c/busses/i2c-i801
@@ -15,10 +15,16 @@ Supported adapters:
15 * Intel 82801I (ICH9) 15 * Intel 82801I (ICH9)
16 * Intel EP80579 (Tolapai) 16 * Intel EP80579 (Tolapai)
17 * Intel 82801JI (ICH10) 17 * Intel 82801JI (ICH10)
18 * Intel 3400/5 Series (PCH) 18 * Intel 5/3400 Series (PCH)
19 * Intel Cougar Point (PCH) 19 * Intel 6 Series (PCH)
20 * Intel Patsburg (PCH)
21 * Intel DH89xxCC (PCH)
22 * Intel Panther Point (PCH)
20 Datasheets: Publicly available at the Intel website 23 Datasheets: Publicly available at the Intel website
21 24
25On Intel Patsburg and later chipsets, both the normal host SMBus controller
26and the additional 'Integrated Device Function' controllers are supported.
27
22Authors: 28Authors:
23 Mark Studebaker <mdsxyz123@yahoo.com> 29 Mark Studebaker <mdsxyz123@yahoo.com>
24 Jean Delvare <khali@linux-fr.org> 30 Jean Delvare <khali@linux-fr.org>
diff --git a/Documentation/i2c/busses/i2c-parport-light b/Documentation/i2c/busses/i2c-parport-light
index bdc9cbb2e0f2..c22ee063e1e5 100644
--- a/Documentation/i2c/busses/i2c-parport-light
+++ b/Documentation/i2c/busses/i2c-parport-light
@@ -4,7 +4,7 @@ Author: Jean Delvare <khali@linux-fr.org>
4 4
5This driver is a light version of i2c-parport. It doesn't depend 5This driver is a light version of i2c-parport. It doesn't depend
6on the parport driver, and uses direct I/O access instead. This might be 6on the parport driver, and uses direct I/O access instead. This might be
7prefered on embedded systems where wasting memory for the clean but heavy 7preferred on embedded systems where wasting memory for the clean but heavy
8parport handling is not an option. The drawback is a reduced portability 8parport handling is not an option. The drawback is a reduced portability
9and the impossibility to daisy-chain other parallel port devices. 9and the impossibility to daisy-chain other parallel port devices.
10 10
diff --git a/Documentation/i2c/busses/i2c-sis96x b/Documentation/i2c/busses/i2c-sis96x
index 70e6a0cc1e15..0b979f3252a4 100644
--- a/Documentation/i2c/busses/i2c-sis96x
+++ b/Documentation/i2c/busses/i2c-sis96x
@@ -35,7 +35,7 @@ or perhaps this...
35 35
36(kernel versions later than 2.4.18 may fill in the "Unknown"s) 36(kernel versions later than 2.4.18 may fill in the "Unknown"s)
37 37
38If you cant see it please look on quirk_sis_96x_smbus 38If you can't see it please look on quirk_sis_96x_smbus
39(drivers/pci/quirks.c) (also if southbridge detection fails) 39(drivers/pci/quirks.c) (also if southbridge detection fails)
40 40
41I suspect that this driver could be made to work for the following SiS 41I suspect that this driver could be made to work for the following SiS
diff --git a/Documentation/i2c/busses/i2c-taos-evm b/Documentation/i2c/busses/i2c-taos-evm
index 9146e33be6dd..63f62bcbf592 100644
--- a/Documentation/i2c/busses/i2c-taos-evm
+++ b/Documentation/i2c/busses/i2c-taos-evm
@@ -13,7 +13,7 @@ Currently supported devices are:
13 13
14* TAOS TSL2550 EVM 14* TAOS TSL2550 EVM
15 15
16For addtional information on TAOS products, please see 16For additional information on TAOS products, please see
17 http://www.taosinc.com/ 17 http://www.taosinc.com/
18 18
19 19
diff --git a/Documentation/i2c/instantiating-devices b/Documentation/i2c/instantiating-devices
index 87da405a8597..9edb75d8c9b9 100644
--- a/Documentation/i2c/instantiating-devices
+++ b/Documentation/i2c/instantiating-devices
@@ -100,7 +100,7 @@ static int __devinit usb_hcd_pnx4008_probe(struct platform_device *pdev)
100 (...) 100 (...)
101 i2c_adap = i2c_get_adapter(2); 101 i2c_adap = i2c_get_adapter(2);
102 memset(&i2c_info, 0, sizeof(struct i2c_board_info)); 102 memset(&i2c_info, 0, sizeof(struct i2c_board_info));
103 strlcpy(i2c_info.name, "isp1301_pnx", I2C_NAME_SIZE); 103 strlcpy(i2c_info.type, "isp1301_pnx", I2C_NAME_SIZE);
104 isp1301_i2c_client = i2c_new_probed_device(i2c_adap, &i2c_info, 104 isp1301_i2c_client = i2c_new_probed_device(i2c_adap, &i2c_info,
105 normal_i2c, NULL); 105 normal_i2c, NULL);
106 i2c_put_adapter(i2c_adap); 106 i2c_put_adapter(i2c_adap);
diff --git a/Documentation/i2c/muxes/gpio-i2cmux b/Documentation/i2c/muxes/gpio-i2cmux
new file mode 100644
index 000000000000..811cd78d4cdc
--- /dev/null
+++ b/Documentation/i2c/muxes/gpio-i2cmux
@@ -0,0 +1,65 @@
1Kernel driver gpio-i2cmux
2
3Author: Peter Korsgaard <peter.korsgaard@barco.com>
4
5Description
6-----------
7
8gpio-i2cmux is an i2c mux driver providing access to I2C bus segments
9from a master I2C bus and a hardware MUX controlled through GPIO pins.
10
11E.G.:
12
13 ---------- ---------- Bus segment 1 - - - - -
14 | | SCL/SDA | |-------------- | |
15 | |------------| |
16 | | | | Bus segment 2 | |
17 | Linux | GPIO 1..N | MUX |--------------- Devices
18 | |------------| | | |
19 | | | | Bus segment M
20 | | | |---------------| |
21 ---------- ---------- - - - - -
22
23SCL/SDA of the master I2C bus is multiplexed to bus segment 1..M
24according to the settings of the GPIO pins 1..N.
25
26Usage
27-----
28
29gpio-i2cmux uses the platform bus, so you need to provide a struct
30platform_device with the platform_data pointing to a struct
31gpio_i2cmux_platform_data with the I2C adapter number of the master
32bus, the number of bus segments to create and the GPIO pins used
33to control it. See include/linux/gpio-i2cmux.h for details.
34
35E.G. something like this for a MUX providing 4 bus segments
36controlled through 3 GPIO pins:
37
38#include <linux/gpio-i2cmux.h>
39#include <linux/platform_device.h>
40
41static const unsigned myboard_gpiomux_gpios[] = {
42 AT91_PIN_PC26, AT91_PIN_PC25, AT91_PIN_PC24
43};
44
45static const unsigned myboard_gpiomux_values[] = {
46 0, 1, 2, 3
47};
48
49static struct gpio_i2cmux_platform_data myboard_i2cmux_data = {
50 .parent = 1,
51 .base_nr = 2, /* optional */
52 .values = myboard_gpiomux_values,
53 .n_values = ARRAY_SIZE(myboard_gpiomux_values),
54 .gpios = myboard_gpiomux_gpios,
55 .n_gpios = ARRAY_SIZE(myboard_gpiomux_gpios),
56 .idle = 4, /* optional */
57};
58
59static struct platform_device myboard_i2cmux = {
60 .name = "gpio-i2cmux",
61 .id = 0,
62 .dev = {
63 .platform_data = &myboard_i2cmux_data,
64 },
65};
diff --git a/Documentation/i2c/upgrading-clients b/Documentation/i2c/upgrading-clients
index 9a45f9bb6a25..d6991625c407 100644
--- a/Documentation/i2c/upgrading-clients
+++ b/Documentation/i2c/upgrading-clients
@@ -61,7 +61,7 @@ static int example_attach(struct i2c_adapter *adap, int addr, int kind)
61 return 0; 61 return 0;
62} 62}
63 63
64static int __devexit example_detach(struct i2c_client *client) 64static int example_detach(struct i2c_client *client)
65{ 65{
66 struct example_state *state = i2c_get_clientdata(client); 66 struct example_state *state = i2c_get_clientdata(client);
67 67
@@ -81,7 +81,7 @@ static struct i2c_driver example_driver = {
81 .name = "example", 81 .name = "example",
82 }, 82 },
83 .attach_adapter = example_attach_adapter, 83 .attach_adapter = example_attach_adapter,
84 .detach_client = __devexit_p(example_detach), 84 .detach_client = example_detach,
85 .suspend = example_suspend, 85 .suspend = example_suspend,
86 .resume = example_resume, 86 .resume = example_resume,
87}; 87};
@@ -93,7 +93,7 @@ Updating the client
93The new style binding model will check against a list of supported 93The new style binding model will check against a list of supported
94devices and their associated address supplied by the code registering 94devices and their associated address supplied by the code registering
95the busses. This means that the driver .attach_adapter and 95the busses. This means that the driver .attach_adapter and
96.detach_adapter methods can be removed, along with the addr_data, 96.detach_client methods can be removed, along with the addr_data,
97as follows: 97as follows:
98 98
99- static struct i2c_driver example_driver; 99- static struct i2c_driver example_driver;
@@ -110,14 +110,14 @@ as follows:
110 110
111 static struct i2c_driver example_driver = { 111 static struct i2c_driver example_driver = {
112- .attach_adapter = example_attach_adapter, 112- .attach_adapter = example_attach_adapter,
113- .detach_client = __devexit_p(example_detach), 113- .detach_client = example_detach,
114 } 114 }
115 115
116Add the probe and remove methods to the i2c_driver, as so: 116Add the probe and remove methods to the i2c_driver, as so:
117 117
118 static struct i2c_driver example_driver = { 118 static struct i2c_driver example_driver = {
119+ .probe = example_probe, 119+ .probe = example_probe,
120+ .remove = __devexit_p(example_remove), 120+ .remove = example_remove,
121 } 121 }
122 122
123Change the example_attach method to accept the new parameters 123Change the example_attach method to accept the new parameters
@@ -199,8 +199,8 @@ to delete the i2c_detach_client call. It is possible that you
199can also remove the ret variable as it is not not needed for 199can also remove the ret variable as it is not not needed for
200any of the core functions. 200any of the core functions.
201 201
202- static int __devexit example_detach(struct i2c_client *client) 202- static int example_detach(struct i2c_client *client)
203+ static int __devexit example_remove(struct i2c_client *client) 203+ static int example_remove(struct i2c_client *client)
204{ 204{
205 struct example_state *state = i2c_get_clientdata(client); 205 struct example_state *state = i2c_get_clientdata(client);
206 206
@@ -253,7 +253,7 @@ static int example_probe(struct i2c_client *client,
253 return 0; 253 return 0;
254} 254}
255 255
256static int __devexit example_remove(struct i2c_client *client) 256static int example_remove(struct i2c_client *client)
257{ 257{
258 struct example_state *state = i2c_get_clientdata(client); 258 struct example_state *state = i2c_get_clientdata(client);
259 259
@@ -275,7 +275,7 @@ static struct i2c_driver example_driver = {
275 }, 275 },
276 .id_table = example_idtable, 276 .id_table = example_idtable,
277 .probe = example_probe, 277 .probe = example_probe,
278 .remove = __devexit_p(example_remove), 278 .remove = example_remove,
279 .suspend = example_suspend, 279 .suspend = example_suspend,
280 .resume = example_resume, 280 .resume = example_resume,
281}; 281};
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
index 5ebf5af1d716..5aa53374ea2a 100644
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -38,7 +38,7 @@ static struct i2c_driver foo_driver = {
38 .name = "foo", 38 .name = "foo",
39 }, 39 },
40 40
41 .id_table = foo_ids, 41 .id_table = foo_idtable,
42 .probe = foo_probe, 42 .probe = foo_probe,
43 .remove = foo_remove, 43 .remove = foo_remove,
44 /* if device autodetection is needed: */ 44 /* if device autodetection is needed: */
diff --git a/Documentation/i2o/README b/Documentation/i2o/README
index 0ebf58c73f54..ee91e2626ff0 100644
--- a/Documentation/i2o/README
+++ b/Documentation/i2o/README
@@ -53,7 +53,7 @@ Symbios Logic (Now LSI)
53BoxHill Corporation 53BoxHill Corporation
54 Loan of initial FibreChannel disk array used for development work. 54 Loan of initial FibreChannel disk array used for development work.
55 55
56European Comission 56European Commission
57 Funding the work done by the University of Helsinki 57 Funding the work done by the University of Helsinki
58 58
59SysKonnect 59SysKonnect
diff --git a/Documentation/ia64/aliasing-test.c b/Documentation/ia64/aliasing-test.c
index 3dfb76ca6931..5caa2af33207 100644
--- a/Documentation/ia64/aliasing-test.c
+++ b/Documentation/ia64/aliasing-test.c
@@ -177,7 +177,7 @@ static int scan_rom(char *path, char *file)
177 177
178 /* 178 /*
179 * It's OK if the ROM is unreadable. Maybe there 179 * It's OK if the ROM is unreadable. Maybe there
180 * is no ROM, or some other error ocurred. The 180 * is no ROM, or some other error occurred. The
181 * important thing is that no MCA happened. 181 * important thing is that no MCA happened.
182 */ 182 */
183 if (rc > 0) 183 if (rc > 0)
diff --git a/Documentation/input/cma3000_d0x.txt b/Documentation/input/cma3000_d0x.txt
new file mode 100644
index 000000000000..29d088db4afd
--- /dev/null
+++ b/Documentation/input/cma3000_d0x.txt
@@ -0,0 +1,115 @@
1Kernel driver for CMA3000-D0x
2============================
3
4Supported chips:
5* VTI CMA3000-D0x
6Datasheet:
7 CMA3000-D0X Product Family Specification 8281000A.02.pdf
8 <http://www.vti.fi/en/>
9
10Author: Hemanth V <hemanthv@ti.com>
11
12
13Description
14-----------
15CMA3000 Tri-axis accelerometer supports Motion detect, Measurement and
16Free fall modes.
17
18Motion Detect Mode: Its the low power mode where interrupts are generated only
19when motion exceeds the defined thresholds.
20
21Measurement Mode: This mode is used to read the acceleration data on X,Y,Z
22axis and supports 400, 100, 40 Hz sample frequency.
23
24Free fall Mode: This mode is intended to save system resources.
25
26Threshold values: Chip supports defining threshold values for above modes
27which includes time and g value. Refer product specifications for more details.
28
29CMA3000 chip supports mutually exclusive I2C and SPI interfaces for
30communication, currently the driver supports I2C based communication only.
31Initial configuration for bus mode is set in non volatile memory and can later
32be modified through bus interface command.
33
34Driver reports acceleration data through input subsystem. It generates ABS_MISC
35event with value 1 when free fall is detected.
36
37Platform data need to be configured for initial default values.
38
39Platform Data
40-------------
41fuzz_x: Noise on X Axis
42
43fuzz_y: Noise on Y Axis
44
45fuzz_z: Noise on Z Axis
46
47g_range: G range in milli g i.e 2000 or 8000
48
49mode: Default Operating mode
50
51mdthr: Motion detect g range threshold value
52
53mdfftmr: Motion detect and free fall time threshold value
54
55ffthr: Free fall g range threshold value
56
57Input Interface
58--------------
59Input driver version is 1.0.0
60Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
61Input device name: "cma3000-accelerometer"
62Supported events:
63 Event type 0 (Sync)
64 Event type 3 (Absolute)
65 Event code 0 (X)
66 Value 47
67 Min -8000
68 Max 8000
69 Fuzz 200
70 Event code 1 (Y)
71 Value -28
72 Min -8000
73 Max 8000
74 Fuzz 200
75 Event code 2 (Z)
76 Value 905
77 Min -8000
78 Max 8000
79 Fuzz 200
80 Event code 40 (Misc)
81 Value 0
82 Min 0
83 Max 1
84 Event type 4 (Misc)
85
86
87Register/Platform parameters Description
88----------------------------------------
89
90mode:
91 0: power down mode
92 1: 100 Hz Measurement mode
93 2: 400 Hz Measurement mode
94 3: 40 Hz Measurement mode
95 4: Motion Detect mode (default)
96 5: 100 Hz Free fall mode
97 6: 40 Hz Free fall mode
98 7: Power off mode
99
100grange:
101 2000: 2000 mg or 2G Range
102 8000: 8000 mg or 8G Range
103
104mdthr:
105 X: X * 71mg (8G Range)
106 X: X * 18mg (2G Range)
107
108mdfftmr:
109 X: (X & 0x70) * 100 ms (MDTMR)
110 (X & 0x0F) * 2.5 ms (FFTMR 400 Hz)
111 (X & 0x0F) * 10 ms (FFTMR 100 Hz)
112
113ffthr:
114 X: (X >> 2) * 18mg (2G Range)
115 X: (X & 0x0F) * 71 mg (8G Range)
diff --git a/Documentation/input/elantech.txt b/Documentation/input/elantech.txt
index 56941ae1f5db..db798af5ef98 100644
--- a/Documentation/input/elantech.txt
+++ b/Documentation/input/elantech.txt
@@ -34,7 +34,8 @@ Contents
34Currently the Linux Elantech touchpad driver is aware of two different 34Currently the Linux Elantech touchpad driver is aware of two different
35hardware versions unimaginatively called version 1 and version 2. Version 1 35hardware versions unimaginatively called version 1 and version 2. Version 1
36is found in "older" laptops and uses 4 bytes per packet. Version 2 seems to 36is found in "older" laptops and uses 4 bytes per packet. Version 2 seems to
37be introduced with the EeePC and uses 6 bytes per packet. 37be introduced with the EeePC and uses 6 bytes per packet, and provides
38additional features such as position of two fingers, and width of the touch.
38 39
39The driver tries to support both hardware versions and should be compatible 40The driver tries to support both hardware versions and should be compatible
40with the Xorg Synaptics touchpad driver and its graphical configuration 41with the Xorg Synaptics touchpad driver and its graphical configuration
@@ -94,18 +95,44 @@ Currently the Linux Elantech touchpad driver provides two extra knobs under
94 can check these bits and reject any packet that appears corrupted. Using 95 can check these bits and reject any packet that appears corrupted. Using
95 this knob you can bypass that check. 96 this knob you can bypass that check.
96 97
97 It is not known yet whether hardware version 2 provides the same parity 98 Hardware version 2 does not provide the same parity bits. Only some basic
98 bits. Hence checking is disabled by default. Currently even turning it on 99 data consistency checking can be done. For now checking is disabled by
99 will do nothing. 100 default. Currently even turning it on will do nothing.
100
101 101
102///////////////////////////////////////////////////////////////////////////// 102/////////////////////////////////////////////////////////////////////////////
103 103
1043. Differentiating hardware versions
105 =================================
106
107To detect the hardware version, read the version number as param[0].param[1].param[2]
108
109 4 bytes version: (after the arrow is the name given in the Dell-provided driver)
110 02.00.22 => EF013
111 02.06.00 => EF019
112In the wild, there appear to be more versions, such as 00.01.64, 01.00.21,
11302.00.00, 02.00.04, 02.00.06.
114
115 6 bytes:
116 02.00.30 => EF113
117 02.08.00 => EF023
118 02.08.XX => EF123
119 02.0B.00 => EF215
120 04.01.XX => Scroll_EF051
121 04.02.XX => EF051
122In the wild, there appear to be more versions, such as 04.03.01, 04.04.11. There
123appears to be almost no difference, except for EF113, which does not report
124pressure/width and has different data consistency checks.
125
126Probably all the versions with param[0] <= 01 can be considered as
1274 bytes/firmware 1. The versions < 02.08.00, with the exception of 02.00.30, as
1284 bytes/firmware 2. Everything >= 02.08.00 can be considered as 6 bytes.
129
130/////////////////////////////////////////////////////////////////////////////
104 131
1053. Hardware version 1 1324. Hardware version 1
106 ================== 133 ==================
107 134
1083.1 Registers 1354.1 Registers
109 ~~~~~~~~~ 136 ~~~~~~~~~
110 137
111By echoing a hexadecimal value to a register it contents can be altered. 138By echoing a hexadecimal value to a register it contents can be altered.
@@ -168,7 +195,7 @@ For example:
168 smart edge activation area width? 195 smart edge activation area width?
169 196
170 197
1713.2 Native relative mode 4 byte packet format 1984.2 Native relative mode 4 byte packet format
172 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 199 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
173 200
174byte 0: 201byte 0:
@@ -226,9 +253,13 @@ byte 3:
226 positive = down 253 positive = down
227 254
228 255
2293.3 Native absolute mode 4 byte packet format 2564.3 Native absolute mode 4 byte packet format
230 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 257 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
231 258
259EF013 and EF019 have a special behaviour (due to a bug in the firmware?), and
260when 1 finger is touching, the first 2 position reports must be discarded.
261This counting is reset whenever a different number of fingers is reported.
262
232byte 0: 263byte 0:
233 firmware version 1.x: 264 firmware version 1.x:
234 265
@@ -279,11 +310,11 @@ byte 3:
279///////////////////////////////////////////////////////////////////////////// 310/////////////////////////////////////////////////////////////////////////////
280 311
281 312
2824. Hardware version 2 3135. Hardware version 2
283 ================== 314 ==================
284 315
285 316
2864.1 Registers 3175.1 Registers
287 ~~~~~~~~~ 318 ~~~~~~~~~
288 319
289By echoing a hexadecimal value to a register it contents can be altered. 320By echoing a hexadecimal value to a register it contents can be altered.
@@ -316,16 +347,41 @@ For example:
316 0x7f = never i.e. tap again to release) 347 0x7f = never i.e. tap again to release)
317 348
318 349
3194.2 Native absolute mode 6 byte packet format 3505.2 Native absolute mode 6 byte packet format
320 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 351 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
321 3525.2.1 Parity checking and packet re-synchronization
3224.2.1 One finger touch 353There is no parity checking, however some consistency checks can be performed.
354
355For instance for EF113:
356 SA1= packet[0];
357 A1 = packet[1];
358 B1 = packet[2];
359 SB1= packet[3];
360 C1 = packet[4];
361 D1 = packet[5];
362 if( (((SA1 & 0x3C) != 0x3C) && ((SA1 & 0xC0) != 0x80)) || // check Byte 1
363 (((SA1 & 0x0C) != 0x0C) && ((SA1 & 0xC0) == 0x80)) || // check Byte 1 (one finger pressed)
364 (((SA1 & 0xC0) != 0x80) && (( A1 & 0xF0) != 0x00)) || // check Byte 2
365 (((SB1 & 0x3E) != 0x38) && ((SA1 & 0xC0) != 0x80)) || // check Byte 4
366 (((SB1 & 0x0E) != 0x08) && ((SA1 & 0xC0) == 0x80)) || // check Byte 4 (one finger pressed)
367 (((SA1 & 0xC0) != 0x80) && (( C1 & 0xF0) != 0x00)) ) // check Byte 5
368 // error detected
369
370For all the other ones, there are just a few constant bits:
371 if( ((packet[0] & 0x0C) != 0x04) ||
372 ((packet[3] & 0x0f) != 0x02) )
373 // error detected
374
375
376In case an error is detected, all the packets are shifted by one (and packet[0] is discarded).
377
3785.2.1 One/Three finger touch
323 ~~~~~~~~~~~~~~~~ 379 ~~~~~~~~~~~~~~~~
324 380
325byte 0: 381byte 0:
326 382
327 bit 7 6 5 4 3 2 1 0 383 bit 7 6 5 4 3 2 1 0
328 n1 n0 . . . . R L 384 n1 n0 w3 w2 . . R L
329 385
330 L, R = 1 when Left, Right mouse button pressed 386 L, R = 1 when Left, Right mouse button pressed
331 n1..n0 = numbers of fingers on touchpad 387 n1..n0 = numbers of fingers on touchpad
@@ -333,24 +389,40 @@ byte 0:
333byte 1: 389byte 1:
334 390
335 bit 7 6 5 4 3 2 1 0 391 bit 7 6 5 4 3 2 1 0
336 . . . . . x10 x9 x8 392 p7 p6 p5 p4 . x10 x9 x8
337 393
338byte 2: 394byte 2:
339 395
340 bit 7 6 5 4 3 2 1 0 396 bit 7 6 5 4 3 2 1 0
341 x7 x6 x5 x4 x4 x2 x1 x0 397 x7 x6 x5 x4 x3 x2 x1 x0
342 398
343 x10..x0 = absolute x value (horizontal) 399 x10..x0 = absolute x value (horizontal)
344 400
345byte 3: 401byte 3:
346 402
347 bit 7 6 5 4 3 2 1 0 403 bit 7 6 5 4 3 2 1 0
348 . . . . . . . . 404 n4 vf w1 w0 . . . b2
405
406 n4 = set if more than 3 fingers (only in 3 fingers mode)
407 vf = a kind of flag ? (only on EF123, 0 when finger is over one
408 of the buttons, 1 otherwise)
409 w3..w0 = width of the finger touch (not EF113)
410 b2 (on EF113 only, 0 otherwise), b2.R.L indicates one button pressed:
411 0 = none
412 1 = Left
413 2 = Right
414 3 = Middle (Left and Right)
415 4 = Forward
416 5 = Back
417 6 = Another one
418 7 = Another one
349 419
350byte 4: 420byte 4:
351 421
352 bit 7 6 5 4 3 2 1 0 422 bit 7 6 5 4 3 2 1 0
353 . . . . . . y9 y8 423 p3 p1 p2 p0 . . y9 y8
424
425 p7..p0 = pressure (not EF113)
354 426
355byte 5: 427byte 5:
356 428
@@ -363,6 +435,11 @@ byte 5:
3634.2.2 Two finger touch 4354.2.2 Two finger touch
364 ~~~~~~~~~~~~~~~~ 436 ~~~~~~~~~~~~~~~~
365 437
438Note that the two pairs of coordinates are not exactly the coordinates of the
439two fingers, but only the pair of the lower-left and upper-right coordinates.
440So the actual fingers might be situated on the other diagonal of the square
441defined by these two points.
442
366byte 0: 443byte 0:
367 444
368 bit 7 6 5 4 3 2 1 0 445 bit 7 6 5 4 3 2 1 0
@@ -376,14 +453,14 @@ byte 1:
376 bit 7 6 5 4 3 2 1 0 453 bit 7 6 5 4 3 2 1 0
377 ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0 454 ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0
378 455
379 ax8..ax0 = first finger absolute x value 456 ax8..ax0 = lower-left finger absolute x value
380 457
381byte 2: 458byte 2:
382 459
383 bit 7 6 5 4 3 2 1 0 460 bit 7 6 5 4 3 2 1 0
384 ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0 461 ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0
385 462
386 ay8..ay0 = first finger absolute y value 463 ay8..ay0 = lower-left finger absolute y value
387 464
388byte 3: 465byte 3:
389 466
@@ -395,11 +472,11 @@ byte 4:
395 bit 7 6 5 4 3 2 1 0 472 bit 7 6 5 4 3 2 1 0
396 bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0 473 bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0
397 474
398 bx8..bx0 = second finger absolute x value 475 bx8..bx0 = upper-right finger absolute x value
399 476
400byte 5: 477byte 5:
401 478
402 bit 7 6 5 4 3 2 1 0 479 bit 7 6 5 4 3 2 1 0
403 by7 by8 by5 by4 by3 by2 by1 by0 480 by7 by8 by5 by4 by3 by2 by1 by0
404 481
405 by8..by0 = second finger absolute y value 482 by8..by0 = upper-right finger absolute y value
diff --git a/Documentation/input/event-codes.txt b/Documentation/input/event-codes.txt
new file mode 100644
index 000000000000..23fcb05175be
--- /dev/null
+++ b/Documentation/input/event-codes.txt
@@ -0,0 +1,262 @@
1The input protocol uses a map of types and codes to express input device values
2to userspace. This document describes the types and codes and how and when they
3may be used.
4
5A single hardware event generates multiple input events. Each input event
6contains the new value of a single data item. A special event type, EV_SYN, is
7used to separate input events into packets of input data changes occurring at
8the same moment in time. In the following, the term "event" refers to a single
9input event encompassing a type, code, and value.
10
11The input protocol is a stateful protocol. Events are emitted only when values
12of event codes have changed. However, the state is maintained within the Linux
13input subsystem; drivers do not need to maintain the state and may attempt to
14emit unchanged values without harm. Userspace may obtain the current state of
15event code values using the EVIOCG* ioctls defined in linux/input.h. The event
16reports supported by a device are also provided by sysfs in
17class/input/event*/device/capabilities/, and the properties of a device are
18provided in class/input/event*/device/properties.
19
20Types:
21==========
22Types are groupings of codes under a logical input construct. Each type has a
23set of applicable codes to be used in generating events. See the Codes section
24for details on valid codes for each type.
25
26* EV_SYN:
27 - Used as markers to separate events. Events may be separated in time or in
28 space, such as with the multitouch protocol.
29
30* EV_KEY:
31 - Used to describe state changes of keyboards, buttons, or other key-like
32 devices.
33
34* EV_REL:
35 - Used to describe relative axis value changes, e.g. moving the mouse 5 units
36 to the left.
37
38* EV_ABS:
39 - Used to describe absolute axis value changes, e.g. describing the
40 coordinates of a touch on a touchscreen.
41
42* EV_MSC:
43 - Used to describe miscellaneous input data that do not fit into other types.
44
45* EV_SW:
46 - Used to describe binary state input switches.
47
48* EV_LED:
49 - Used to turn LEDs on devices on and off.
50
51* EV_SND:
52 - Used to output sound to devices.
53
54* EV_REP:
55 - Used for autorepeating devices.
56
57* EV_FF:
58 - Used to send force feedback commands to an input device.
59
60* EV_PWR:
61 - A special type for power button and switch input.
62
63* EV_FF_STATUS:
64 - Used to receive force feedback device status.
65
66Codes:
67==========
68Codes define the precise type of event.
69
70EV_SYN:
71----------
72EV_SYN event values are undefined. Their usage is defined only by when they are
73sent in the evdev event stream.
74
75* SYN_REPORT:
76 - Used to synchronize and separate events into packets of input data changes
77 occurring at the same moment in time. For example, motion of a mouse may set
78 the REL_X and REL_Y values for one motion, then emit a SYN_REPORT. The next
79 motion will emit more REL_X and REL_Y values and send another SYN_REPORT.
80
81* SYN_CONFIG:
82 - TBD
83
84* SYN_MT_REPORT:
85 - Used to synchronize and separate touch events. See the
86 multi-touch-protocol.txt document for more information.
87
88* SYN_DROPPED:
89 - Used to indicate buffer overrun in the evdev client's event queue.
90 Client should ignore all events up to and including next SYN_REPORT
91 event and query the device (using EVIOCG* ioctls) to obtain its
92 current state.
93
94EV_KEY:
95----------
96EV_KEY events take the form KEY_<name> or BTN_<name>. For example, KEY_A is used
97to represent the 'A' key on a keyboard. When a key is depressed, an event with
98the key's code is emitted with value 1. When the key is released, an event is
99emitted with value 0. Some hardware send events when a key is repeated. These
100events have a value of 2. In general, KEY_<name> is used for keyboard keys, and
101BTN_<name> is used for other types of momentary switch events.
102
103A few EV_KEY codes have special meanings:
104
105* BTN_TOOL_<name>:
106 - These codes are used in conjunction with input trackpads, tablets, and
107 touchscreens. These devices may be used with fingers, pens, or other tools.
108 When an event occurs and a tool is used, the corresponding BTN_TOOL_<name>
109 code should be set to a value of 1. When the tool is no longer interacting
110 with the input device, the BTN_TOOL_<name> code should be reset to 0. All
111 trackpads, tablets, and touchscreens should use at least one BTN_TOOL_<name>
112 code when events are generated.
113
114* BTN_TOUCH:
115 BTN_TOUCH is used for touch contact. While an input tool is determined to be
116 within meaningful physical contact, the value of this property must be set
117 to 1. Meaningful physical contact may mean any contact, or it may mean
118 contact conditioned by an implementation defined property. For example, a
119 touchpad may set the value to 1 only when the touch pressure rises above a
120 certain value. BTN_TOUCH may be combined with BTN_TOOL_<name> codes. For
121 example, a pen tablet may set BTN_TOOL_PEN to 1 and BTN_TOUCH to 0 while the
122 pen is hovering over but not touching the tablet surface.
123
124Note: For appropriate function of the legacy mousedev emulation driver,
125BTN_TOUCH must be the first evdev code emitted in a synchronization frame.
126
127Note: Historically a touch device with BTN_TOOL_FINGER and BTN_TOUCH was
128interpreted as a touchpad by userspace, while a similar device without
129BTN_TOOL_FINGER was interpreted as a touchscreen. For backwards compatibility
130with current userspace it is recommended to follow this distinction. In the
131future, this distinction will be deprecated and the device properties ioctl
132EVIOCGPROP, defined in linux/input.h, will be used to convey the device type.
133
134* BTN_TOOL_FINGER, BTN_TOOL_DOUBLETAP, BTN_TOOL_TRIPLETAP, BTN_TOOL_QUADTAP:
135 - These codes denote one, two, three, and four finger interaction on a
136 trackpad or touchscreen. For example, if the user uses two fingers and moves
137 them on the touchpad in an effort to scroll content on screen,
138 BTN_TOOL_DOUBLETAP should be set to value 1 for the duration of the motion.
139 Note that all BTN_TOOL_<name> codes and the BTN_TOUCH code are orthogonal in
140 purpose. A trackpad event generated by finger touches should generate events
141 for one code from each group. At most only one of these BTN_TOOL_<name>
142 codes should have a value of 1 during any synchronization frame.
143
144Note: Historically some drivers emitted multiple of the finger count codes with
145a value of 1 in the same synchronization frame. This usage is deprecated.
146
147Note: In multitouch drivers, the input_mt_report_finger_count() function should
148be used to emit these codes. Please see multi-touch-protocol.txt for details.
149
150EV_REL:
151----------
152EV_REL events describe relative changes in a property. For example, a mouse may
153move to the left by a certain number of units, but its absolute position in
154space is unknown. If the absolute position is known, EV_ABS codes should be used
155instead of EV_REL codes.
156
157A few EV_REL codes have special meanings:
158
159* REL_WHEEL, REL_HWHEEL:
160 - These codes are used for vertical and horizontal scroll wheels,
161 respectively.
162
163EV_ABS:
164----------
165EV_ABS events describe absolute changes in a property. For example, a touchpad
166may emit coordinates for a touch location.
167
168A few EV_ABS codes have special meanings:
169
170* ABS_DISTANCE:
171 - Used to describe the distance of a tool from an interaction surface. This
172 event should only be emitted while the tool is hovering, meaning in close
173 proximity of the device and while the value of the BTN_TOUCH code is 0. If
174 the input device may be used freely in three dimensions, consider ABS_Z
175 instead.
176
177* ABS_MT_<name>:
178 - Used to describe multitouch input events. Please see
179 multi-touch-protocol.txt for details.
180
181EV_SW:
182----------
183EV_SW events describe stateful binary switches. For example, the SW_LID code is
184used to denote when a laptop lid is closed.
185
186Upon binding to a device or resuming from suspend, a driver must report
187the current switch state. This ensures that the device, kernel, and userspace
188state is in sync.
189
190Upon resume, if the switch state is the same as before suspend, then the input
191subsystem will filter out the duplicate switch state reports. The driver does
192not need to keep the state of the switch at any time.
193
194EV_MSC:
195----------
196EV_MSC events are used for input and output events that do not fall under other
197categories.
198
199EV_LED:
200----------
201EV_LED events are used for input and output to set and query the state of
202various LEDs on devices.
203
204EV_REP:
205----------
206EV_REP events are used for specifying autorepeating events.
207
208EV_SND:
209----------
210EV_SND events are used for sending sound commands to simple sound output
211devices.
212
213EV_FF:
214----------
215EV_FF events are used to initialize a force feedback capable device and to cause
216such device to feedback.
217
218EV_PWR:
219----------
220EV_PWR events are a special type of event used specifically for power
221mangement. Its usage is not well defined. To be addressed later.
222
223Guidelines:
224==========
225The guidelines below ensure proper single-touch and multi-finger functionality.
226For multi-touch functionality, see the multi-touch-protocol.txt document for
227more information.
228
229Mice:
230----------
231REL_{X,Y} must be reported when the mouse moves. BTN_LEFT must be used to report
232the primary button press. BTN_{MIDDLE,RIGHT,4,5,etc.} should be used to report
233further buttons of the device. REL_WHEEL and REL_HWHEEL should be used to report
234scroll wheel events where available.
235
236Touchscreens:
237----------
238ABS_{X,Y} must be reported with the location of the touch. BTN_TOUCH must be
239used to report when a touch is active on the screen.
240BTN_{MOUSE,LEFT,MIDDLE,RIGHT} must not be reported as the result of touch
241contact. BTN_TOOL_<name> events should be reported where possible.
242
243Trackpads:
244----------
245Legacy trackpads that only provide relative position information must report
246events like mice described above.
247
248Trackpads that provide absolute touch position must report ABS_{X,Y} for the
249location of the touch. BTN_TOUCH should be used to report when a touch is active
250on the trackpad. Where multi-finger support is available, BTN_TOOL_<name> should
251be used to report the number of touches active on the trackpad.
252
253Tablets:
254----------
255BTN_TOOL_<name> events must be reported when a stylus or other tool is active on
256the tablet. ABS_{X,Y} must be reported with the location of the tool. BTN_TOUCH
257should be used to report when the tool is in contact with the tablet.
258BTN_{STYLUS,STYLUS2} should be used to report buttons on the tool itself. Any
259button may be used for buttons on the tablet except BTN_{MOUSE,LEFT}.
260BTN_{0,1,2,etc} are good generic codes for unlabeled buttons. Do not use
261meaningful buttons, like BTN_FORWARD, unless the button is labeled for that
262purpose on the device.
diff --git a/Documentation/input/ff.txt b/Documentation/input/ff.txt
index ded4d5f53109..b3867bf49f8f 100644
--- a/Documentation/input/ff.txt
+++ b/Documentation/input/ff.txt
@@ -49,7 +49,9 @@ This information is subject to change.
49#include <linux/input.h> 49#include <linux/input.h>
50#include <sys/ioctl.h> 50#include <sys/ioctl.h>
51 51
52unsigned long features[1 + FF_MAX/sizeof(unsigned long)]; 52#define BITS_TO_LONGS(x) \
53 (((x) + 8 * sizeof (unsigned long) - 1) / (8 * sizeof (unsigned long)))
54unsigned long features[BITS_TO_LONGS(FF_CNT)];
53int ioctl(int file_descriptor, int request, unsigned long *features); 55int ioctl(int file_descriptor, int request, unsigned long *features);
54 56
55"request" must be EVIOCGBIT(EV_FF, size of features array in bytes ) 57"request" must be EVIOCGBIT(EV_FF, size of features array in bytes )
diff --git a/Documentation/input/joystick-parport.txt b/Documentation/input/joystick-parport.txt
index 1c856f32ff2c..56870c70a796 100644
--- a/Documentation/input/joystick-parport.txt
+++ b/Documentation/input/joystick-parport.txt
@@ -272,7 +272,7 @@ if you want to use gamecon.c.
272 272
273 Also, the connection is a bit more complex. You'll need a bunch of diodes, 273 Also, the connection is a bit more complex. You'll need a bunch of diodes,
274and one pullup resistor. First, you connect the Directions and the button 274and one pullup resistor. First, you connect the Directions and the button
275the same as for db9, however with the diodes inbetween. 275the same as for db9, however with the diodes between.
276 276
277 Diodes 277 Diodes
278(pin 2) -----|<|----> Up 278(pin 2) -----|<|----> Up
diff --git a/Documentation/input/multi-touch-protocol.txt b/Documentation/input/multi-touch-protocol.txt
index bdcba154b83e..71536e78406f 100644
--- a/Documentation/input/multi-touch-protocol.txt
+++ b/Documentation/input/multi-touch-protocol.txt
@@ -1,6 +1,6 @@
1Multi-touch (MT) Protocol 1Multi-touch (MT) Protocol
2------------------------- 2-------------------------
3 Copyright (C) 2009 Henrik Rydberg <rydberg@euromail.se> 3 Copyright (C) 2009-2010 Henrik Rydberg <rydberg@euromail.se>
4 4
5 5
6Introduction 6Introduction
@@ -161,19 +161,24 @@ against the glass. The inner region will increase, and in general, the
161ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller than 161ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller than
162unity, is related to the contact pressure. For pressure-based devices, 162unity, is related to the contact pressure. For pressure-based devices,
163ABS_MT_PRESSURE may be used to provide the pressure on the contact area 163ABS_MT_PRESSURE may be used to provide the pressure on the contact area
164instead. 164instead. Devices capable of contact hovering can use ABS_MT_DISTANCE to
165indicate the distance between the contact and the surface.
165 166
166In addition to the MAJOR parameters, the oval shape of the contact can be 167In addition to the MAJOR parameters, the oval shape of the contact can be
167described by adding the MINOR parameters, such that MAJOR and MINOR are the 168described by adding the MINOR parameters, such that MAJOR and MINOR are the
168major and minor axis of an ellipse. Finally, the orientation of the oval 169major and minor axis of an ellipse. Finally, the orientation of the oval
169shape can be describe with the ORIENTATION parameter. 170shape can be describe with the ORIENTATION parameter.
170 171
172For type A devices, further specification of the touch shape is possible
173via ABS_MT_BLOB_ID.
174
171The ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a 175The ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a
172contact or a pen or something else. Devices with more granular information 176finger or a pen or something else. Finally, the ABS_MT_TRACKING_ID event
173may specify general shapes as blobs, i.e., as a sequence of rectangular 177may be used to track identified contacts over time [5].
174shapes grouped together by an ABS_MT_BLOB_ID. Finally, for the few devices 178
175that currently support it, the ABS_MT_TRACKING_ID event may be used to 179In the type B protocol, ABS_MT_TOOL_TYPE and ABS_MT_TRACKING_ID are
176report contact tracking from hardware [5]. 180implicitly handled by input core; drivers should instead call
181input_mt_report_slot_state().
177 182
178 183
179Event Semantics 184Event Semantics
@@ -213,6 +218,12 @@ The pressure, in arbitrary units, on the contact area. May be used instead
213of TOUCH and WIDTH for pressure-based devices or any device with a spatial 218of TOUCH and WIDTH for pressure-based devices or any device with a spatial
214signal intensity distribution. 219signal intensity distribution.
215 220
221ABS_MT_DISTANCE
222
223The distance, in surface units, between the contact and the surface. Zero
224distance means the contact is touching the surface. A positive number means
225the contact is hovering above the surface.
226
216ABS_MT_ORIENTATION 227ABS_MT_ORIENTATION
217 228
218The orientation of the ellipse. The value should describe a signed quarter 229The orientation of the ellipse. The value should describe a signed quarter
@@ -240,21 +251,24 @@ ABS_MT_TOOL_TYPE
240The type of approaching tool. A lot of kernel drivers cannot distinguish 251The type of approaching tool. A lot of kernel drivers cannot distinguish
241between different tool types, such as a finger or a pen. In such cases, the 252between different tool types, such as a finger or a pen. In such cases, the
242event should be omitted. The protocol currently supports MT_TOOL_FINGER and 253event should be omitted. The protocol currently supports MT_TOOL_FINGER and
243MT_TOOL_PEN [2]. 254MT_TOOL_PEN [2]. For type B devices, this event is handled by input core;
255drivers should instead use input_mt_report_slot_state().
244 256
245ABS_MT_BLOB_ID 257ABS_MT_BLOB_ID
246 258
247The BLOB_ID groups several packets together into one arbitrarily shaped 259The BLOB_ID groups several packets together into one arbitrarily shaped
248contact. This is a low-level anonymous grouping for type A devices, and 260contact. The sequence of points forms a polygon which defines the shape of
261the contact. This is a low-level anonymous grouping for type A devices, and
249should not be confused with the high-level trackingID [5]. Most type A 262should not be confused with the high-level trackingID [5]. Most type A
250devices do not have blob capability, so drivers can safely omit this event. 263devices do not have blob capability, so drivers can safely omit this event.
251 264
252ABS_MT_TRACKING_ID 265ABS_MT_TRACKING_ID
253 266
254The TRACKING_ID identifies an initiated contact throughout its life cycle 267The TRACKING_ID identifies an initiated contact throughout its life cycle
255[5]. This event is mandatory for type B devices. The value range of the 268[5]. The value range of the TRACKING_ID should be large enough to ensure
256TRACKING_ID should be large enough to ensure unique identification of a 269unique identification of a contact maintained over an extended period of
257contact maintained over an extended period of time. 270time. For type B devices, this event is handled by input core; drivers
271should instead use input_mt_report_slot_state().
258 272
259 273
260Event Computation 274Event Computation
@@ -301,18 +315,19 @@ and with ORIENTATION, one can detect twisting of fingers.
301Notes 315Notes
302----- 316-----
303 317
304In order to stay compatible with existing applications, the data 318In order to stay compatible with existing applications, the data reported
305reported in a finger packet must not be recognized as single-touch 319in a finger packet must not be recognized as single-touch events.
306events. In addition, all finger data must bypass input filtering, 320
307since subsequent events of the same type refer to different fingers. 321For type A devices, all finger data bypasses input filtering, since
322subsequent events of the same type refer to different fingers.
308 323
309The first kernel driver to utilize the MT protocol is the bcm5974 driver, 324For example usage of the type A protocol, see the bcm5974 driver. For
310where examples can be found. 325example usage of the type B protocol, see the hid-egalax driver.
311 326
312[1] With the extension ABS_MT_APPROACH_X and ABS_MT_APPROACH_Y, the 327[1] With the extension ABS_MT_APPROACH_X and ABS_MT_APPROACH_Y, the
313difference between the contact position and the approaching tool position 328difference between the contact position and the approaching tool position
314could be used to derive tilt. 329could be used to derive tilt.
315[2] The list can of course be extended. 330[2] The list can of course be extended.
316[3] Multitouch X driver project: http://bitmath.org/code/multitouch/. 331[3] The mtdev project: http://bitmath.org/code/mtdev/.
317[4] See the section on event computation. 332[4] See the section on event computation.
318[5] See the section on finger tracking. 333[5] See the section on finger tracking.
diff --git a/Documentation/input/ntrig.txt b/Documentation/input/ntrig.txt
new file mode 100644
index 000000000000..be1fd981f73f
--- /dev/null
+++ b/Documentation/input/ntrig.txt
@@ -0,0 +1,126 @@
1N-Trig touchscreen Driver
2-------------------------
3 Copyright (c) 2008-2010 Rafi Rubin <rafi@seas.upenn.edu>
4 Copyright (c) 2009-2010 Stephane Chatty
5
6This driver provides support for N-Trig pen and multi-touch sensors. Single
7and multi-touch events are translated to the appropriate protocols for
8the hid and input systems. Pen events are sufficiently hid compliant and
9are left to the hid core. The driver also provides additional filtering
10and utility functions accessible with sysfs and module parameters.
11
12This driver has been reported to work properly with multiple N-Trig devices
13attached.
14
15
16Parameters
17----------
18
19Note: values set at load time are global and will apply to all applicable
20devices. Adjusting parameters with sysfs will override the load time values,
21but only for that one device.
22
23The following parameters are used to configure filters to reduce noise:
24
25activate_slack number of fingers to ignore before processing events
26
27activation_height size threshold to activate immediately
28activation_width
29
30min_height size threshold bellow which fingers are ignored
31min_width both to decide activation and during activity
32
33deactivate_slack the number of "no contact" frames to ignore before
34 propagating the end of activity events
35
36When the last finger is removed from the device, it sends a number of empty
37frames. By holding off on deactivation for a few frames we can tolerate false
38erroneous disconnects, where the sensor may mistakenly not detect a finger that
39is still present. Thus deactivate_slack addresses problems where a users might
40see breaks in lines during drawing, or drop an object during a long drag.
41
42
43Additional sysfs items
44----------------------
45
46These nodes just provide easy access to the ranges reported by the device.
47sensor_logical_height the range for positions reported during activity
48sensor_logical_width
49
50sensor_physical_height internal ranges not used for normal events but
51sensor_physical_width useful for tuning
52
53All N-Trig devices with product id of 1 report events in the ranges of
54X: 0-9600
55Y: 0-7200
56However not all of these devices have the same physical dimensions. Most
57seem to be 12" sensors (Dell Latitude XT and XT2 and the HP TX2), and
58at least one model (Dell Studio 17) has a 17" sensor. The ratio of physical
59to logical sizes is used to adjust the size based filter parameters.
60
61
62Filtering
63---------
64
65With the release of the early multi-touch firmwares it became increasingly
66obvious that these sensors were prone to erroneous events. Users reported
67seeing both inappropriately dropped contact and ghosts, contacts reported
68where no finger was actually touching the screen.
69
70Deactivation slack helps prevent dropped contact for single touch use, but does
71not address the problem of dropping one of more contacts while other contacts
72are still active. Drops in the multi-touch context require additional
73processing and should be handled in tandem with tacking.
74
75As observed ghost contacts are similar to actual use of the sensor, but they
76seem to have different profiles. Ghost activity typically shows up as small
77short lived touches. As such, I assume that the longer the continuous stream
78of events the more likely those events are from a real contact, and that the
79larger the size of each contact the more likely it is real. Balancing the
80goals of preventing ghosts and accepting real events quickly (to minimize
81user observable latency), the filter accumulates confidence for incoming
82events until it hits thresholds and begins propagating. In the interest in
83minimizing stored state as well as the cost of operations to make a decision,
84I've kept that decision simple.
85
86Time is measured in terms of the number of fingers reported, not frames since
87the probability of multiple simultaneous ghosts is expected to drop off
88dramatically with increasing numbers. Rather than accumulate weight as a
89function of size, I just use it as a binary threshold. A sufficiently large
90contact immediately overrides the waiting period and leads to activation.
91
92Setting the activation size thresholds to large values will result in deciding
93primarily on activation slack. If you see longer lived ghosts, turning up the
94activation slack while reducing the size thresholds may suffice to eliminate
95the ghosts while keeping the screen quite responsive to firm taps.
96
97Contacts continue to be filtered with min_height and min_width even after
98the initial activation filter is satisfied. The intent is to provide
99a mechanism for filtering out ghosts in the form of an extra finger while
100you actually are using the screen. In practice this sort of ghost has
101been far less problematic or relatively rare and I've left the defaults
102set to 0 for both parameters, effectively turning off that filter.
103
104I don't know what the optimal values are for these filters. If the defaults
105don't work for you, please play with the parameters. If you do find other
106values more comfortable, I would appreciate feedback.
107
108The calibration of these devices does drift over time. If ghosts or contact
109dropping worsen and interfere with the normal usage of your device, try
110recalibrating it.
111
112
113Calibration
114-----------
115
116The N-Trig windows tools provide calibration and testing routines. Also an
117unofficial unsupported set of user space tools including a calibrator is
118available at:
119http://code.launchpad.net/~rafi-seas/+junk/ntrig_calib
120
121
122Tracking
123--------
124
125As of yet, all tested N-Trig firmwares do not track fingers. When multiple
126contacts are active they seem to be sorted primarily by Y position.
diff --git a/Documentation/input/rotary-encoder.txt b/Documentation/input/rotary-encoder.txt
index 8b4129de1d2d..92e68bce13a4 100644
--- a/Documentation/input/rotary-encoder.txt
+++ b/Documentation/input/rotary-encoder.txt
@@ -9,6 +9,9 @@ peripherals with two wires. The outputs are phase-shifted by 90 degrees
9and by triggering on falling and rising edges, the turn direction can 9and by triggering on falling and rising edges, the turn direction can
10be determined. 10be determined.
11 11
12Some encoders have both outputs low in stable states, whereas others also have
13a stable state with both outputs high (half-period mode).
14
12The phase diagram of these two outputs look like this: 15The phase diagram of these two outputs look like this:
13 16
14 _____ _____ _____ 17 _____ _____ _____
@@ -26,6 +29,8 @@ The phase diagram of these two outputs look like this:
26 |<-------->| 29 |<-------->|
27 one step 30 one step
28 31
32 |<-->|
33 one step (half-period mode)
29 34
30For more information, please see 35For more information, please see
31 http://en.wikipedia.org/wiki/Rotary_encoder 36 http://en.wikipedia.org/wiki/Rotary_encoder
@@ -34,6 +39,13 @@ For more information, please see
341. Events / state machine 391. Events / state machine
35------------------------- 40-------------------------
36 41
42In half-period mode, state a) and c) above are used to determine the
43rotational direction based on the last stable state. Events are reported in
44states b) and d) given that the new stable state is different from the last
45(i.e. the rotation was not reversed half-way).
46
47Otherwise, the following apply:
48
37a) Rising edge on channel A, channel B in low state 49a) Rising edge on channel A, channel B in low state
38 This state is used to recognize a clockwise turn 50 This state is used to recognize a clockwise turn
39 51
@@ -46,7 +58,7 @@ c) Falling edge on channel A, channel B in high state
46 58
47d) Falling edge on channel B, channel A in low state 59d) Falling edge on channel B, channel A in low state
48 Parking position. If the encoder enters this state, a full transition 60 Parking position. If the encoder enters this state, a full transition
49 should have happend, unless it flipped back on half the way. The 61 should have happened, unless it flipped back on half the way. The
50 'armed' state tells us about that. 62 'armed' state tells us about that.
51 63
522. Platform requirements 642. Platform requirements
@@ -96,6 +108,7 @@ static struct rotary_encoder_platform_data my_rotary_encoder_info = {
96 .gpio_b = GPIO_ROTARY_B, 108 .gpio_b = GPIO_ROTARY_B,
97 .inverted_a = 0, 109 .inverted_a = 0,
98 .inverted_b = 0, 110 .inverted_b = 0,
111 .half_period = false,
99}; 112};
100 113
101static struct platform_device rotary_encoder_device = { 114static struct platform_device rotary_encoder_device = {
diff --git a/Documentation/input/walkera0701.txt b/Documentation/input/walkera0701.txt
index 8f4289efc5c4..561385d38482 100644
--- a/Documentation/input/walkera0701.txt
+++ b/Documentation/input/walkera0701.txt
@@ -77,7 +77,7 @@ pulse length:
77 77
7824 bin+oct values + 1 bin value = 24*4+1 bits = 97 bits 7824 bin+oct values + 1 bin value = 24*4+1 bits = 97 bits
79 79
80(Warning, pulses on ACK ar inverted by transistor, irq is rised up on sync 80(Warning, pulses on ACK are inverted by transistor, irq is raised up on sync
81to bin change or octal value to bin change). 81to bin change or octal value to bin change).
82 82
83Binary data representations: 83Binary data representations:
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt
index 33223ff121d8..3a46e360496d 100644
--- a/Documentation/ioctl/ioctl-number.txt
+++ b/Documentation/ioctl/ioctl-number.txt
@@ -133,6 +133,7 @@ Code Seq#(hex) Include File Comments
133'H' C0-DF net/bluetooth/hidp/hidp.h conflict! 133'H' C0-DF net/bluetooth/hidp/hidp.h conflict!
134'H' C0-DF net/bluetooth/cmtp/cmtp.h conflict! 134'H' C0-DF net/bluetooth/cmtp/cmtp.h conflict!
135'H' C0-DF net/bluetooth/bnep/bnep.h conflict! 135'H' C0-DF net/bluetooth/bnep/bnep.h conflict!
136'H' F1 linux/hid-roccat.h <mailto:erazor_de@users.sourceforge.net>
136'I' all linux/isdn.h conflict! 137'I' all linux/isdn.h conflict!
137'I' 00-0F drivers/isdn/divert/isdn_divert.h conflict! 138'I' 00-0F drivers/isdn/divert/isdn_divert.h conflict!
138'I' 40-4F linux/mISDNif.h conflict! 139'I' 40-4F linux/mISDNif.h conflict!
@@ -155,7 +156,6 @@ Code Seq#(hex) Include File Comments
155'Q' all linux/soundcard.h 156'Q' all linux/soundcard.h
156'R' 00-1F linux/random.h conflict! 157'R' 00-1F linux/random.h conflict!
157'R' 01 linux/rfkill.h conflict! 158'R' 01 linux/rfkill.h conflict!
158'R' 01-0F media/rds.h conflict!
159'R' C0-DF net/bluetooth/rfcomm.h 159'R' C0-DF net/bluetooth/rfcomm.h
160'S' all linux/cdrom.h conflict! 160'S' all linux/cdrom.h conflict!
161'S' 80-81 scsi/scsi_ioctl.h conflict! 161'S' 80-81 scsi/scsi_ioctl.h conflict!
@@ -166,7 +166,6 @@ Code Seq#(hex) Include File Comments
166'T' all arch/x86/include/asm/ioctls.h conflict! 166'T' all arch/x86/include/asm/ioctls.h conflict!
167'T' C0-DF linux/if_tun.h conflict! 167'T' C0-DF linux/if_tun.h conflict!
168'U' all sound/asound.h conflict! 168'U' all sound/asound.h conflict!
169'U' 00-0F drivers/media/video/uvc/uvcvideo.h conflict!
170'U' 00-CF linux/uinput.h conflict! 169'U' 00-CF linux/uinput.h conflict!
171'U' 00-EF linux/usbdevice_fs.h 170'U' 00-EF linux/usbdevice_fs.h
172'U' C0-CF drivers/bluetooth/hci_uart.h 171'U' C0-CF drivers/bluetooth/hci_uart.h
@@ -194,7 +193,6 @@ Code Seq#(hex) Include File Comments
194 <http://lrcwww.epfl.ch/> 193 <http://lrcwww.epfl.ch/>
195'b' 00-FF conflict! bit3 vme host bridge 194'b' 00-FF conflict! bit3 vme host bridge
196 <mailto:natalia@nikhefk.nikhef.nl> 195 <mailto:natalia@nikhefk.nikhef.nl>
197'b' 00-0F media/bt819.h conflict!
198'c' all linux/cm4000_cs.h conflict! 196'c' all linux/cm4000_cs.h conflict!
199'c' 00-7F linux/comstats.h conflict! 197'c' 00-7F linux/comstats.h conflict!
200'c' 00-7F linux/coda.h conflict! 198'c' 00-7F linux/coda.h conflict!
@@ -249,7 +247,7 @@ Code Seq#(hex) Include File Comments
249'p' 40-7F linux/nvram.h 247'p' 40-7F linux/nvram.h
250'p' 80-9F linux/ppdev.h user-space parport 248'p' 80-9F linux/ppdev.h user-space parport
251 <mailto:tim@cyberelk.net> 249 <mailto:tim@cyberelk.net>
252'p' A1-A4 linux/pps.h LinuxPPS 250'p' A1-A5 linux/pps.h LinuxPPS
253 <mailto:giometti@linux.it> 251 <mailto:giometti@linux.it>
254'q' 00-1F linux/serio.h 252'q' 00-1F linux/serio.h
255'q' 80-FF linux/telephony.h Internet PhoneJACK, Internet LineJACK 253'q' 80-FF linux/telephony.h Internet PhoneJACK, Internet LineJACK
@@ -259,15 +257,13 @@ Code Seq#(hex) Include File Comments
259't' 00-7F linux/if_ppp.h 257't' 00-7F linux/if_ppp.h
260't' 80-8F linux/isdn_ppp.h 258't' 80-8F linux/isdn_ppp.h
261't' 90 linux/toshiba.h 259't' 90 linux/toshiba.h
262'u' 00-1F linux/smb_fs.h 260'u' 00-1F linux/smb_fs.h gone
263'v' all linux/videodev.h conflict! 261'u' 20-3F linux/uvcvideo.h USB video class host driver
264'v' 00-1F linux/ext2_fs.h conflict! 262'v' 00-1F linux/ext2_fs.h conflict!
265'v' 00-1F linux/fs.h conflict! 263'v' 00-1F linux/fs.h conflict!
266'v' 00-0F linux/sonypi.h conflict! 264'v' 00-0F linux/sonypi.h conflict!
267'v' C0-CF drivers/media/video/ov511.h conflict!
268'v' C0-DF media/pwc-ioctl.h conflict! 265'v' C0-DF media/pwc-ioctl.h conflict!
269'v' C0-FF linux/meye.h conflict! 266'v' C0-FF linux/meye.h conflict!
270'v' C0-CF drivers/media/video/zoran/zoran.h conflict!
271'v' D0-DF drivers/media/video/cpia2/cpia2dev.h conflict! 267'v' D0-DF drivers/media/video/cpia2/cpia2dev.h conflict!
272'w' all CERN SCI driver 268'w' all CERN SCI driver
273'y' 00-1F packet based user level communications 269'y' 00-1F packet based user level communications
@@ -277,9 +273,8 @@ Code Seq#(hex) Include File Comments
277'z' 40-7F CAN bus card conflict! 273'z' 40-7F CAN bus card conflict!
278 <mailto:oe@port.de> 274 <mailto:oe@port.de>
279'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict! 275'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict!
276'|' 00-7F linux/media.h
2800x80 00-1F linux/fb.h 2770x80 00-1F linux/fb.h
2810x81 00-1F linux/videotext.h
2820x88 00-3F media/ovcamchip.h
2830x89 00-06 arch/x86/include/asm/sockios.h 2780x89 00-06 arch/x86/include/asm/sockios.h
2840x89 0B-DF linux/sockios.h 2790x89 0B-DF linux/sockios.h
2850x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range 2800x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range
@@ -309,6 +304,7 @@ Code Seq#(hex) Include File Comments
3090xB0 all RATIO devices in development: 3040xB0 all RATIO devices in development:
310 <mailto:vgo@ratio.de> 305 <mailto:vgo@ratio.de>
3110xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca> 3060xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca>
3070xB3 00 linux/mmc/ioctl.h
3120xC0 00-0F linux/usb/iowarrior.h 3080xC0 00-0F linux/usb/iowarrior.h
3130xCB 00-1F CBM serial IEC bus in development: 3090xCB 00-1F CBM serial IEC bus in development:
314 <mailto:michael.klein@puffin.lb.shuttle.de> 310 <mailto:michael.klein@puffin.lb.shuttle.de>
diff --git a/Documentation/iostats.txt b/Documentation/iostats.txt
index 59a69ec67c40..c76c21d87e85 100644
--- a/Documentation/iostats.txt
+++ b/Documentation/iostats.txt
@@ -1,8 +1,6 @@
1I/O statistics fields 1I/O statistics fields
2--------------- 2---------------
3 3
4Last modified Sep 30, 2003
5
6Since 2.4.20 (and some versions before, with patches), and 2.5.45, 4Since 2.4.20 (and some versions before, with patches), and 2.5.45,
7more extensive disk statistics have been introduced to help measure disk 5more extensive disk statistics have been introduced to help measure disk
8activity. Tools such as sar and iostat typically interpret these and do 6activity. Tools such as sar and iostat typically interpret these and do
@@ -46,11 +44,12 @@ the above example, the first field of statistics would be 446216.
46By contrast, in 2.6 if you look at /sys/block/hda/stat, you'll 44By contrast, in 2.6 if you look at /sys/block/hda/stat, you'll
47find just the eleven fields, beginning with 446216. If you look at 45find just the eleven fields, beginning with 446216. If you look at
48/proc/diskstats, the eleven fields will be preceded by the major and 46/proc/diskstats, the eleven fields will be preceded by the major and
49minor device numbers, and device name. Each of these formats provide 47minor device numbers, and device name. Each of these formats provides
50eleven fields of statistics, each meaning exactly the same things. 48eleven fields of statistics, each meaning exactly the same things.
51All fields except field 9 are cumulative since boot. Field 9 should 49All fields except field 9 are cumulative since boot. Field 9 should
52go to zero as I/Os complete; all others only increase. Yes, these are 50go to zero as I/Os complete; all others only increase (unless they
5332 bit unsigned numbers, and on a very busy or long-lived system they 51overflow and wrap). Yes, these are (32-bit or 64-bit) unsigned long
52(native word size) numbers, and on a very busy or long-lived system they
54may wrap. Applications should be prepared to deal with that; unless 53may wrap. Applications should be prepared to deal with that; unless
55your observations are measured in large numbers of minutes or hours, 54your observations are measured in large numbers of minutes or hours,
56they should not wrap twice before you notice them. 55they should not wrap twice before you notice them.
@@ -81,7 +80,7 @@ Field 9 -- # of I/Os currently in progress
81 The only field that should go to zero. Incremented as requests are 80 The only field that should go to zero. Incremented as requests are
82 given to appropriate struct request_queue and decremented as they finish. 81 given to appropriate struct request_queue and decremented as they finish.
83Field 10 -- # of milliseconds spent doing I/Os 82Field 10 -- # of milliseconds spent doing I/Os
84 This field is increases so long as field 9 is nonzero. 83 This field increases so long as field 9 is nonzero.
85Field 11 -- weighted # of milliseconds spent doing I/Os 84Field 11 -- weighted # of milliseconds spent doing I/Os
86 This field is incremented at each I/O start, I/O completion, I/O 85 This field is incremented at each I/O start, I/O completion, I/O
87 merge, or read of these stats by the number of I/Os in progress 86 merge, or read of these stats by the number of I/Os in progress
@@ -96,11 +95,11 @@ introduced when changes collide, so (for instance) adding up all the
96read I/Os issued per partition should equal those made to the disks ... 95read I/Os issued per partition should equal those made to the disks ...
97but due to the lack of locking it may only be very close. 96but due to the lack of locking it may only be very close.
98 97
99In 2.6, there are counters for each cpu, which made the lack of locking 98In 2.6, there are counters for each CPU, which make the lack of locking
100almost a non-issue. When the statistics are read, the per-cpu counters 99almost a non-issue. When the statistics are read, the per-CPU counters
101are summed (possibly overflowing the unsigned 32-bit variable they are 100are summed (possibly overflowing the unsigned long variable they are
102summed to) and the result given to the user. There is no convenient 101summed to) and the result given to the user. There is no convenient
103user interface for accessing the per-cpu counters themselves. 102user interface for accessing the per-CPU counters themselves.
104 103
105Disks vs Partitions 104Disks vs Partitions
106------------------- 105-------------------
diff --git a/Documentation/irqflags-tracing.txt b/Documentation/irqflags-tracing.txt
index 6a444877ee0b..67aa71e73035 100644
--- a/Documentation/irqflags-tracing.txt
+++ b/Documentation/irqflags-tracing.txt
@@ -53,5 +53,5 @@ implementation in an architecture: lockdep will detect that and will
53turn itself off. I.e. the lock validator will still be reliable. There 53turn itself off. I.e. the lock validator will still be reliable. There
54should be no crashes due to irq-tracing bugs. (except if the assembly 54should be no crashes due to irq-tracing bugs. (except if the assembly
55changes break other code by modifying conditions or registers that 55changes break other code by modifying conditions or registers that
56shouldnt be) 56shouldn't be)
57 57
diff --git a/Documentation/isdn/INTERFACE.CAPI b/Documentation/isdn/INTERFACE.CAPI
index 309eb5ed942b..1688b5a1fd77 100644
--- a/Documentation/isdn/INTERFACE.CAPI
+++ b/Documentation/isdn/INTERFACE.CAPI
@@ -240,7 +240,7 @@ Functions capi_cmsg2message() and capi_message2cmsg() are provided to convert
240messages between their transport encoding described in the CAPI 2.0 standard 240messages between their transport encoding described in the CAPI 2.0 standard
241and their _cmsg structure representation. Note that capi_cmsg2message() does 241and their _cmsg structure representation. Note that capi_cmsg2message() does
242not know or check the size of its destination buffer. The caller must make 242not know or check the size of its destination buffer. The caller must make
243sure it is big enough to accomodate the resulting CAPI message. 243sure it is big enough to accommodate the resulting CAPI message.
244 244
245 245
2465. Lower Layer Interface Functions 2465. Lower Layer Interface Functions
diff --git a/Documentation/ja_JP/HOWTO b/Documentation/ja_JP/HOWTO
index b63301a03811..050d37fe6d40 100644
--- a/Documentation/ja_JP/HOWTO
+++ b/Documentation/ja_JP/HOWTO
@@ -11,14 +11,14 @@ for non English (read: Japanese) speakers and is not intended as a
11fork. So if you have any comments or updates for this file, please try 11fork. So if you have any comments or updates for this file, please try
12to update the original English file first. 12to update the original English file first.
13 13
14Last Updated: 2008/10/24 14Last Updated: 2011/03/31
15================================== 15==================================
16これは、 16これは、
17linux-2.6.28/Documentation/HOWTO 17linux-2.6.38/Documentation/HOWTO
18の和訳です。 18の和訳です。
19 19
20翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ > 20翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ >
21翻訳日: 2008/10/24 21翻訳日: 2011/3/28
22翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com> 22翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com>
23校正者: 松倉さん <nbh--mats at nifty dot com> 23校正者: 松倉さん <nbh--mats at nifty dot com>
24 小林 雅典さん (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp> 24 小林 雅典さん (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp>
@@ -256,8 +256,8 @@ Linux カーネルの開発プロセスは現在幾つかの異なるメイン
256 - メインの 2.6.x カーネルツリー 256 - メインの 2.6.x カーネルツリー
257 - 2.6.x.y -stable カーネルツリー 257 - 2.6.x.y -stable カーネルツリー
258 - 2.6.x -git カーネルパッチ 258 - 2.6.x -git カーネルパッチ
259 - 2.6.x -mm カーネルパッチ
260 - サブシステム毎のカーネルツリーとパッチ 259 - サブシステム毎のカーネルツリーとパッチ
260 - 統合テストのための 2.6.x -next カーネルツリー
261 261
2622.6.x カーネルツリー 2622.6.x カーネルツリー
263----------------- 263-----------------
@@ -268,9 +268,9 @@ Linux カーネルの開発プロセスは現在幾つかの異なるメイン
268 268
269 - 新しいカーネルがリリースされた直後に、2週間の特別期間が設けられ、 269 - 新しいカーネルがリリースされた直後に、2週間の特別期間が設けられ、
270 この期間中に、メンテナ達は Linus に大きな差分を送ることができます。 270 この期間中に、メンテナ達は Linus に大きな差分を送ることができます。
271 このような差分は通常 -mm カーネルに数週間含まれてきたパッチです。 271 このような差分は通常 -next カーネルに数週間含まれてきたパッチです。
272 大きな変更は git(カーネルのソース管理ツール、詳細は 272 大きな変更は git(カーネルのソース管理ツール、詳細は
273 http://git.or.cz/ 参照) を使って送るのが好ましいやり方ですが、パッ 273 http://git-scm.com/ 参照) を使って送るのが好ましいやり方ですが、パッ
274 チファイルの形式のまま送るのでも十分です。 274 チファイルの形式のまま送るのでも十分です。
275 275
276 - 2週間後、-rc1 カーネルがリリースされ、この後にはカーネル全体の安定 276 - 2週間後、-rc1 カーネルがリリースされ、この後にはカーネル全体の安定
@@ -333,86 +333,44 @@ git リポジトリで管理されているLinus のカーネルツリーの毎
333れは -rc カーネルと比べて、パッチが大丈夫かどうかも確認しないで自動的 333れは -rc カーネルと比べて、パッチが大丈夫かどうかも確認しないで自動的
334に生成されるので、より実験的です。 334に生成されるので、より実験的です。
335 335
3362.6.x -mm カーネルパッチ
337------------------------
338
339Andrew Morton によってリリースされる実験的なカーネルパッチ群です。
340Andrew は個別のサブシステムカーネルツリーとパッチを全て集めてきて
341linux-kernel メーリングリストで収集された多数のパッチと同時に一つにま
342とめます。
343このツリーは新機能とパッチが検証される場となります。ある期間の間パッチ
344が -mm に入って価値を証明されたら、Andrew やサブシステムメンテナが、
345メインラインへ入れるように Linus にプッシュします。
346
347メインカーネルツリーに含めるために Linus に送る前に、すべての新しいパッ
348チが -mm ツリーでテストされることが強く推奨されています。マージウィン
349ドウが開く前に -mm ツリーに現れなかったパッチはメインラインにマージさ
350れることは困難になります。
351
352これらのカーネルは安定して動作すべきシステムとして使うのには適切ではあ
353りませんし、カーネルブランチの中でももっとも動作にリスクが高いものです。
354
355もしあなたが、カーネル開発プロセスの支援をしたいと思っているのであれば、
356どうぞこれらのカーネルリリースをテストに使ってみて、そしてもし問題があ
357れば、またもし全てが正しく動作したとしても、linux-kernel メーリングリ
358ストにフィードバックを提供してください。
359
360すべての他の実験的パッチに加えて、これらのカーネルは通常リリース時点で
361メインラインの -git カーネルに含まれる全ての変更も含んでいます。
362
363-mm カーネルは決まったスケジュールではリリースされません、しかし通常幾
364つかの -mm カーネル (1 から 3 が普通)が各-rc カーネルの間にリリースさ
365れます。
366
367サブシステム毎のカーネルツリーとパッチ 336サブシステム毎のカーネルツリーとパッチ
368------------------------------------------- 337-------------------------------------------
369 338
370カーネルの様々な領域で何が起きているかを見られるようにするため、多くの 339それぞれのカーネルサブシステムのメンテナ達は --- そして多くのカーネル
371カーネルサブシステム開発者は彼らの開発ツリーを公開しています。これらの 340サブシステムの開発者達も --- 各自の最新の開発状況をソースリポジトリに
372ツリーは説明したように -mm カーネルリリースに入れ込まれます。 341公開しています。そのため、自分とは異なる領域のカーネルで何が起きている
373 342かを他の人が見られるようになっています。開発が早く進んでいる領域では、
374以下はさまざまなカーネルツリーの中のいくつかのリスト- 343開発者は自身の投稿がどのサブシステムカーネルツリーを元にしているか質問
375 344されるので、その投稿とすでに進行中の他の作業との衝突が避けられます。
376 git ツリー- 345
377 - Kbuild の開発ツリー、Sam Ravnborg <sam@ravnborg.org> 346大部分のこれらのリポジトリは git ツリーです。しかしその他の SCM や
378 git.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git 347quilt シリーズとして公開されているパッチキューも使われています。これら
379 348のサブシステムリポジトリのアドレスは MAINTAINERS ファイルにリストされ
380 - ACPI の開発ツリー、 Len Brown <len.brown@intel.com> 349ています。これらの多くは http://git.kernel.org/ で参照することができま
381 git.kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git 350す。
382
383 - Block の開発ツリー、Jens Axboe <axboe@suse.de>
384 git.kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
385
386 - DRM の開発ツリー、Dave Airlie <airlied@linux.ie>
387 git.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git
388
389 - ia64 の開発ツリー、Tony Luck <tony.luck@intel.com>
390 git.kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git
391
392 - infiniband, Roland Dreier <rolandd@cisco.com>
393 git.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git
394
395 - libata, Jeff Garzik <jgarzik@pobox.com>
396 git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
397
398 - ネットワークドライバ, Jeff Garzik <jgarzik@pobox.com>
399 git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git
400
401 - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net>
402 git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git
403
404 - SCSI, James Bottomley <James.Bottomley@hansenpartnership.com>
405 git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
406
407 - x86, Ingo Molnar <mingo@elte.hu>
408 git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git
409
410 quilt ツリー-
411 - USB, ドライバコアと I2C, Greg Kroah-Hartman <gregkh@suse.de>
412 kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
413 351
414 その他のカーネルツリーは http://git.kernel.org/ と MAINTAINERS ファ 352提案されたパッチがこのようなサブシステムツリーにコミットされる前に、メー
415 イルに一覧表があります。 353リングリストで事前にレビューにかけられます(以下の対応するセクションを
354参照)。いくつかのカーネルサブシステムでは、このレビューは patchwork
355というツールによって追跡されます。Patchwork は web インターフェイスに
356よってパッチ投稿の表示、パッチへのコメント付けや改訂などができ、そして
357メンテナはパッチに対して、レビュー中、受付済み、拒否というようなマーク
358をつけることができます。大部分のこれらの patchwork のサイトは
359http://patchwork.kernel.org/ でリストされています。
360
361統合テストのための 2.6.x -next カーネルツリー
362---------------------------------------------
363
364サブシステムツリーの更新内容がメインラインの 2.6.x ツリーにマージされ
365る前に、それらは統合テストされる必要があります。この目的のため、実質的
366に全サブシステムツリーからほぼ毎日プルされてできる特別なテスト用のリ
367ポジトリが存在します-
368 http://git.kernel.org/?p=linux/kernel/git/sfr/linux-next.git
369 http://linux.f-seidel.de/linux-next/pmwiki/
370
371このやり方によって、-next カーネルは次のマージ機会でどんなものがメイン
372ラインカーネルにマージされるか、おおまかなの展望を提供します。-next
373カーネルの実行テストを行う冒険好きなテスターは大いに歓迎されます
416 374
417バグレポート 375バグレポート
418------------- 376-------------
@@ -673,10 +631,9 @@ Linux カーネルコミュニティは、一度に大量のコードの塊を
673じところからスタートしたのですから。 631じところからスタートしたのですから。
674 632
675Paolo Ciarrocchi に感謝、彼は彼の書いた "Development Process" 633Paolo Ciarrocchi に感謝、彼は彼の書いた "Development Process"
676(http://linux.tar.bz/articles/2.6-development_process)セクショ 634(http://lwn.net/Articles/94386/) セクションをこのテキストの原型にする
677ンをこのテキストの原型にすることを許可してくれました。 635ことを許可してくれました。Rundy Dunlap と Gerrit Huizenga はメーリング
678Rundy Dunlap と Gerrit Huizenga はメーリングリストでやるべきこととやっ 636リストでやるべきこととやってはいけないことのリストを提供してくれました。
679てはいけないことのリストを提供してくれました。
680以下の人々のレビュー、コメント、貢献に感謝。 637以下の人々のレビュー、コメント、貢献に感謝。
681Pat Mochel, Hanna Linder, Randy Dunlap, Kay Sievers, 638Pat Mochel, Hanna Linder, Randy Dunlap, Kay Sievers,
682Vojtech Pavlik, Jan Kara, Josh Boyer, Kees Cook, Andrew Morton, Andi 639Vojtech Pavlik, Jan Kara, Josh Boyer, Kees Cook, Andrew Morton, Andi
diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt
index 1e5165aa9e4e..68e32bb6bd80 100644
--- a/Documentation/kbuild/kbuild.txt
+++ b/Documentation/kbuild/kbuild.txt
@@ -26,11 +26,11 @@ Additional options to the assembler (for built-in and modules).
26 26
27AFLAGS_MODULE 27AFLAGS_MODULE
28-------------------------------------------------- 28--------------------------------------------------
29Addtional module specific options to use for $(AS). 29Additional module specific options to use for $(AS).
30 30
31AFLAGS_KERNEL 31AFLAGS_KERNEL
32-------------------------------------------------- 32--------------------------------------------------
33Addtional options for $(AS) when used for assembler 33Additional options for $(AS) when used for assembler
34code for code that is compiled as built-in. 34code for code that is compiled as built-in.
35 35
36KCFLAGS 36KCFLAGS
@@ -39,12 +39,12 @@ Additional options to the C compiler (for built-in and modules).
39 39
40CFLAGS_KERNEL 40CFLAGS_KERNEL
41-------------------------------------------------- 41--------------------------------------------------
42Addtional options for $(CC) when used to compile 42Additional options for $(CC) when used to compile
43code that is compiled as built-in. 43code that is compiled as built-in.
44 44
45CFLAGS_MODULE 45CFLAGS_MODULE
46-------------------------------------------------- 46--------------------------------------------------
47Addtional module specific options to use for $(CC). 47Additional module specific options to use for $(CC).
48 48
49LDFLAGS_MODULE 49LDFLAGS_MODULE
50-------------------------------------------------- 50--------------------------------------------------
@@ -73,6 +73,14 @@ Specify the output directory when building the kernel.
73The output directory can also be specified using "O=...". 73The output directory can also be specified using "O=...".
74Setting "O=..." takes precedence over KBUILD_OUTPUT. 74Setting "O=..." takes precedence over KBUILD_OUTPUT.
75 75
76KBUILD_DEBARCH
77--------------------------------------------------
78For the deb-pkg target, allows overriding the normal heuristics deployed by
79deb-pkg. Normally deb-pkg attempts to guess the right architecture based on
80the UTS_MACHINE variable, and on some architectures also the kernel config.
81The value of KBUILD_DEBARCH is assumed (not checked) to be a valid Debian
82architecture.
83
76ARCH 84ARCH
77-------------------------------------------------- 85--------------------------------------------------
78Set ARCH to the architecture to be built. 86Set ARCH to the architecture to be built.
@@ -138,7 +146,7 @@ INSTALL_MOD_STRIP
138INSTALL_MOD_STRIP, if defined, will cause modules to be 146INSTALL_MOD_STRIP, if defined, will cause modules to be
139stripped after they are installed. If INSTALL_MOD_STRIP is '1', then 147stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
140the default option --strip-debug will be used. Otherwise, 148the default option --strip-debug will be used. Otherwise,
141INSTALL_MOD_STRIP will used as the options to the strip command. 149INSTALL_MOD_STRIP value will be used as the options to the strip command.
142 150
143INSTALL_FW_PATH 151INSTALL_FW_PATH
144-------------------------------------------------- 152--------------------------------------------------
@@ -188,3 +196,21 @@ to be included in the databases, separated by blank space. E.g.:
188To get all available archs you can also specify all. E.g.: 196To get all available archs you can also specify all. E.g.:
189 197
190 $ make ALLSOURCE_ARCHS=all tags 198 $ make ALLSOURCE_ARCHS=all tags
199
200KBUILD_ENABLE_EXTRA_GCC_CHECKS
201--------------------------------------------------
202If enabled over the make command line with "W=1", it turns on additional
203gcc -W... options for more extensive build-time checking.
204
205KBUILD_BUILD_TIMESTAMP
206--------------------------------------------------
207Setting this to a date string overrides the timestamp used in the
208UTS_VERSION definition (uname -v in the running kernel). The value has to
209be a string that can be passed to date -d. The default value
210is the output of the date command at one point during build.
211
212KBUILD_BUILD_USER, KBUILD_BUILD_HOST
213--------------------------------------------------
214These two variables allow to override the user@host string displayed during
215boot and in /proc/version. The default value is the output of the commands
216whoami and host, respectively.
diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt
index b472e4e0ba67..44e2649fbb29 100644
--- a/Documentation/kbuild/kconfig-language.txt
+++ b/Documentation/kbuild/kconfig-language.txt
@@ -112,7 +112,13 @@ applicable everywhere (see syntax).
112 (no prompts anywhere) and for symbols with no dependencies. 112 (no prompts anywhere) and for symbols with no dependencies.
113 That will limit the usefulness but on the other hand avoid 113 That will limit the usefulness but on the other hand avoid
114 the illegal configurations all over. 114 the illegal configurations all over.
115 kconfig should one day warn about such things. 115
116- limiting menu display: "visible if" <expr>
117 This attribute is only applicable to menu blocks, if the condition is
118 false, the menu block is not displayed to the user (the symbols
119 contained there can still be selected by other symbols, though). It is
120 similar to a conditional "prompt" attribude for individual menu
121 entries. Default value of "visible" is true.
116 122
117- numerical ranges: "range" <symbol> <symbol> ["if" <expr>] 123- numerical ranges: "range" <symbol> <symbol> ["if" <expr>]
118 This allows to limit the range of possible input values for int 124 This allows to limit the range of possible input values for int
@@ -268,7 +274,7 @@ separate list of options.
268 274
269choices: 275choices:
270 276
271 "choice" 277 "choice" [symbol]
272 <choice options> 278 <choice options>
273 <choice block> 279 <choice block>
274 "endchoice" 280 "endchoice"
@@ -282,6 +288,10 @@ single driver can be compiled/loaded into the kernel, but all drivers
282can be compiled as modules. 288can be compiled as modules.
283A choice accepts another option "optional", which allows to set the 289A choice accepts another option "optional", which allows to set the
284choice to 'n' and no entry needs to be selected. 290choice to 'n' and no entry needs to be selected.
291If no [symbol] is associated with a choice, then you can not have multiple
292definitions of that choice. If a [symbol] is associated to the choice,
293then you may define the same choice (ie. with the same entries) in another
294place.
285 295
286comment: 296comment:
287 297
@@ -300,7 +310,8 @@ menu:
300 "endmenu" 310 "endmenu"
301 311
302This defines a menu block, see "Menu structure" above for more 312This defines a menu block, see "Menu structure" above for more
303information. The only possible options are dependencies. 313information. The only possible options are dependencies and "visible"
314attributes.
304 315
305if: 316if:
306 317
@@ -322,7 +333,8 @@ mainmenu:
322 "mainmenu" <prompt> 333 "mainmenu" <prompt>
323 334
324This sets the config program's title bar if the config program chooses 335This sets the config program's title bar if the config program chooses
325to use it. 336to use it. It should be placed at the top of the configuration, before any
337other statement.
326 338
327 339
328Kconfig hints 340Kconfig hints
@@ -377,3 +389,25 @@ config FOO
377 389
378limits FOO to module (=m) or disabled (=n). 390limits FOO to module (=m) or disabled (=n).
379 391
392Kconfig symbol existence
393~~~~~~~~~~~~~~~~~~~~~~~~
394The following two methods produce the same kconfig symbol dependencies
395but differ greatly in kconfig symbol existence (production) in the
396generated config file.
397
398case 1:
399
400config FOO
401 tristate "about foo"
402 depends on BAR
403
404vs. case 2:
405
406if BAR
407config FOO
408 tristate "about foo"
409endif
410
411In case 1, the symbol FOO will always exist in the config file (given
412no other dependencies). In case 2, the symbol FOO will only exist in
413the config file if BAR is enabled.
diff --git a/Documentation/kbuild/kconfig.txt b/Documentation/kbuild/kconfig.txt
index cca46b1a0f6c..c313d71324b4 100644
--- a/Documentation/kbuild/kconfig.txt
+++ b/Documentation/kbuild/kconfig.txt
@@ -48,11 +48,6 @@ KCONFIG_OVERWRITECONFIG
48If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not 48If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not
49break symlinks when .config is a symlink to somewhere else. 49break symlinks when .config is a symlink to somewhere else.
50 50
51KCONFIG_NOTIMESTAMP
52--------------------------------------------------
53If this environment variable exists and is non-null, the timestamp line
54in generated .config files is omitted.
55
56______________________________________________________________________ 51______________________________________________________________________
57Environment variables for '{allyes/allmod/allno/rand}config' 52Environment variables for '{allyes/allmod/allno/rand}config'
58 53
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index c787ae512120..47435e56c5da 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -40,11 +40,13 @@ This document describes the Linux kernel Makefiles.
40 --- 6.6 Commands useful for building a boot image 40 --- 6.6 Commands useful for building a boot image
41 --- 6.7 Custom kbuild commands 41 --- 6.7 Custom kbuild commands
42 --- 6.8 Preprocessing linker scripts 42 --- 6.8 Preprocessing linker scripts
43 --- 6.9 Generic header files
43 44
44 === 7 Kbuild syntax for exported headers 45 === 7 Kbuild syntax for exported headers
45 --- 7.1 header-y 46 --- 7.1 header-y
46 --- 7.2 objhdr-y 47 --- 7.2 objhdr-y
47 --- 7.3 destination-y 48 --- 7.3 destination-y
49 --- 7.4 generic-y
48 50
49 === 8 Kbuild Variables 51 === 8 Kbuild Variables
50 === 9 Makefile language 52 === 9 Makefile language
@@ -499,6 +501,18 @@ more details, with real examples.
499 gcc >= 3.00. For gcc < 3.00, -malign-functions=4 is used. 501 gcc >= 3.00. For gcc < 3.00, -malign-functions=4 is used.
500 Note: cc-option-align uses KBUILD_CFLAGS for $(CC) options 502 Note: cc-option-align uses KBUILD_CFLAGS for $(CC) options
501 503
504 cc-disable-warning
505 cc-disable-warning checks if gcc supports a given warning and returns
506 the commandline switch to disable it. This special function is needed,
507 because gcc 4.4 and later accept any unknown -Wno-* option and only
508 warn about it if there is another warning in the source file.
509
510 Example:
511 KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
512
513 In the above example, -Wno-unused-but-set-variable will be added to
514 KBUILD_CFLAGS only if gcc really accepts it.
515
502 cc-version 516 cc-version
503 cc-version returns a numerical version of the $(CC) compiler version. 517 cc-version returns a numerical version of the $(CC) compiler version.
504 The format is <major><minor> where both are two digits. So for example 518 The format is <major><minor> where both are two digits. So for example
@@ -776,6 +790,13 @@ This will delete the directory debian, including all subdirectories.
776Kbuild will assume the directories to be in the same relative path as the 790Kbuild will assume the directories to be in the same relative path as the
777Makefile if no absolute path is specified (path does not start with '/'). 791Makefile if no absolute path is specified (path does not start with '/').
778 792
793To exclude certain files from make clean, use the $(no-clean-files) variable.
794This is only a special case used in the top level Kbuild file:
795
796 Example:
797 #Kbuild
798 no-clean-files := $(bounds-file) $(offsets-file)
799
779Usually kbuild descends down in subdirectories due to "obj-* := dir/", 800Usually kbuild descends down in subdirectories due to "obj-* := dir/",
780but in the architecture makefiles where the kbuild infrastructure 801but in the architecture makefiles where the kbuild infrastructure
781is not sufficient this sometimes needs to be explicit. 802is not sufficient this sometimes needs to be explicit.
@@ -948,6 +969,11 @@ When kbuild executes, the following steps are followed (roughly):
948 used when linking modules. This is often a linker script. 969 used when linking modules. This is often a linker script.
949 From commandline LDFLAGS_MODULE shall be used (see kbuild.txt). 970 From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).
950 971
972 KBUILD_ARFLAGS Options for $(AR) when creating archives
973
974 $(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic
975 mode) if this option is supported by $(AR).
976
951--- 6.2 Add prerequisites to archprepare: 977--- 6.2 Add prerequisites to archprepare:
952 978
953 The archprepare: rule is used to list prerequisites that need to be 979 The archprepare: rule is used to list prerequisites that need to be
@@ -1129,6 +1155,21 @@ When kbuild executes, the following steps are followed (roughly):
1129 resulting in the target file being recompiled for no 1155 resulting in the target file being recompiled for no
1130 obvious reason. 1156 obvious reason.
1131 1157
1158 dtc
1159 Create flattend device tree blob object suitable for linking
1160 into vmlinux. Device tree blobs linked into vmlinux are placed
1161 in an init section in the image. Platform code *must* copy the
1162 blob to non-init memory prior to calling unflatten_device_tree().
1163
1164 Example:
1165 #arch/x86/platform/ce4100/Makefile
1166 clean-files := *dtb.S
1167
1168 DTC_FLAGS := -p 1024
1169 obj-y += foo.dtb.o
1170
1171 $(obj)/%.dtb: $(src)/%.dts
1172 $(call cmd,dtc)
1132 1173
1133--- 6.7 Custom kbuild commands 1174--- 6.7 Custom kbuild commands
1134 1175
@@ -1187,6 +1228,14 @@ When kbuild executes, the following steps are followed (roughly):
1187 The kbuild infrastructure for *lds file are used in several 1228 The kbuild infrastructure for *lds file are used in several
1188 architecture-specific files. 1229 architecture-specific files.
1189 1230
1231--- 6.9 Generic header files
1232
1233 The directory include/asm-generic contains the header files
1234 that may be shared between individual architectures.
1235 The recommended approach how to use a generic header file is
1236 to list the file in the Kbuild file.
1237 See "7.4 generic-y" for further info on syntax etc.
1238
1190=== 7 Kbuild syntax for exported headers 1239=== 7 Kbuild syntax for exported headers
1191 1240
1192The kernel include a set of headers that is exported to userspace. 1241The kernel include a set of headers that is exported to userspace.
@@ -1243,6 +1292,32 @@ See subsequent chapter for the syntax of the Kbuild file.
1243 In the example above all exported headers in the Kbuild file 1292 In the example above all exported headers in the Kbuild file
1244 will be located in the directory "include/linux" when exported. 1293 will be located in the directory "include/linux" when exported.
1245 1294
1295 --- 7.4 generic-y
1296
1297 If an architecture uses a verbatim copy of a header from
1298 include/asm-generic then this is listed in the file
1299 arch/$(ARCH)/include/asm/Kbuild like this:
1300
1301 Example:
1302 #arch/x86/include/asm/Kbuild
1303 generic-y += termios.h
1304 generic-y += rtc.h
1305
1306 During the prepare phase of the build a wrapper include
1307 file is generated in the directory:
1308
1309 arch/$(ARCH)/include/generated/asm
1310
1311 When a header is exported where the architecture uses
1312 the generic header a similar wrapper is generated as part
1313 of the set of exported headers in the directory:
1314
1315 usr/include/asm
1316
1317 The generated wrapper will in both cases look like the following:
1318
1319 Example: termios.h
1320 #include <asm-generic/termios.h>
1246 1321
1247=== 8 Kbuild Variables 1322=== 8 Kbuild Variables
1248 1323
@@ -1303,7 +1378,8 @@ The top Makefile exports the following variables:
1303 If this variable is specified, will cause modules to be stripped 1378 If this variable is specified, will cause modules to be stripped
1304 after they are installed. If INSTALL_MOD_STRIP is '1', then the 1379 after they are installed. If INSTALL_MOD_STRIP is '1', then the
1305 default option --strip-debug will be used. Otherwise, 1380 default option --strip-debug will be used. Otherwise,
1306 INSTALL_MOD_STRIP will used as the option(s) to the strip command. 1381 INSTALL_MOD_STRIP value will be used as the option(s) to the strip
1382 command.
1307 1383
1308 1384
1309=== 9 Makefile language 1385=== 9 Makefile language
diff --git a/Documentation/kbuild/modules.txt b/Documentation/kbuild/modules.txt
index 0767cf69c69e..3fb39e0116b4 100644
--- a/Documentation/kbuild/modules.txt
+++ b/Documentation/kbuild/modules.txt
@@ -1,215 +1,185 @@
1Building External Modules
1 2
2In this document you will find information about: 3This document describes how to build an out-of-tree kernel module.
3- how to build external modules
4- how to make your module use the kbuild infrastructure
5- how kbuild will install a kernel
6- how to install modules in a non-standard location
7 4
8=== Table of Contents 5=== Table of Contents
9 6
10 === 1 Introduction 7 === 1 Introduction
11 === 2 How to build external modules 8 === 2 How to Build External Modules
12 --- 2.1 Building external modules 9 --- 2.1 Command Syntax
13 --- 2.2 Available targets 10 --- 2.2 Options
14 --- 2.3 Available options 11 --- 2.3 Targets
15 --- 2.4 Preparing the kernel tree for module build 12 --- 2.4 Building Separate Files
16 --- 2.5 Building separate files for a module 13 === 3. Creating a Kbuild File for an External Module
17 === 3. Example commands 14 --- 3.1 Shared Makefile
18 === 4. Creating a kbuild file for an external module 15 --- 3.2 Separate Kbuild file and Makefile
19 === 5. Include files 16 --- 3.3 Binary Blobs
20 --- 5.1 How to include files from the kernel include dir 17 --- 3.4 Building Multiple Modules
21 --- 5.2 External modules using an include/ dir 18 === 4. Include Files
22 --- 5.3 External modules using several directories 19 --- 4.1 Kernel Includes
23 === 6. Module installation 20 --- 4.2 Single Subdirectory
24 --- 6.1 INSTALL_MOD_PATH 21 --- 4.3 Several Subdirectories
25 --- 6.2 INSTALL_MOD_DIR 22 === 5. Module Installation
26 === 7. Module versioning & Module.symvers 23 --- 5.1 INSTALL_MOD_PATH
27 --- 7.1 Symbols from the kernel (vmlinux + modules) 24 --- 5.2 INSTALL_MOD_DIR
28 --- 7.2 Symbols and external modules 25 === 6. Module Versioning
29 --- 7.3 Symbols from another external module 26 --- 6.1 Symbols From the Kernel (vmlinux + modules)
30 === 8. Tips & Tricks 27 --- 6.2 Symbols and External Modules
31 --- 8.1 Testing for CONFIG_FOO_BAR 28 --- 6.3 Symbols From Another External Module
29 === 7. Tips & Tricks
30 --- 7.1 Testing for CONFIG_FOO_BAR
32 31
33 32
34 33
35=== 1. Introduction 34=== 1. Introduction
36 35
37kbuild includes functionality for building modules both 36"kbuild" is the build system used by the Linux kernel. Modules must use
38within the kernel source tree and outside the kernel source tree. 37kbuild to stay compatible with changes in the build infrastructure and
39The latter is usually referred to as external or "out-of-tree" 38to pick up the right flags to "gcc." Functionality for building modules
40modules and is used both during development and for modules that 39both in-tree and out-of-tree is provided. The method for building
41are not planned to be included in the kernel tree. 40either is similar, and all modules are initially developed and built
41out-of-tree.
42 42
43What is covered within this file is mainly information to authors 43Covered in this document is information aimed at developers interested
44of modules. The author of an external module should supply 44in building out-of-tree (or "external") modules. The author of an
45a makefile that hides most of the complexity, so one only has to type 45external module should supply a makefile that hides most of the
46'make' to build the module. A complete example will be presented in 46complexity, so one only has to type "make" to build the module. This is
47chapter 4, "Creating a kbuild file for an external module". 47easily accomplished, and a complete example will be presented in
48section 3.
48 49
49 50
50=== 2. How to build external modules 51=== 2. How to Build External Modules
51 52
52kbuild offers functionality to build external modules, with the 53To build external modules, you must have a prebuilt kernel available
53prerequisite that there is a pre-built kernel available with full source. 54that contains the configuration and header files used in the build.
54A subset of the targets available when building the kernel is available 55Also, the kernel must have been built with modules enabled. If you are
55when building an external module. 56using a distribution kernel, there will be a package for the kernel you
57are running provided by your distribution.
56 58
57--- 2.1 Building external modules 59An alternative is to use the "make" target "modules_prepare." This will
60make sure the kernel contains the information required. The target
61exists solely as a simple way to prepare a kernel source tree for
62building external modules.
58 63
59 Use the following command to build an external module: 64NOTE: "modules_prepare" will not build Module.symvers even if
65CONFIG_MODVERSIONS is set; therefore, a full kernel build needs to be
66executed to make module versioning work.
60 67
61 make -C <path-to-kernel> M=`pwd` 68--- 2.1 Command Syntax
62 69
63 For the running kernel use: 70 The command to build an external module is:
64 71
65 make -C /lib/modules/`uname -r`/build M=`pwd` 72 $ make -C <path_to_kernel_src> M=$PWD
66 73
67 For the above command to succeed, the kernel must have been 74 The kbuild system knows that an external module is being built
68 built with modules enabled. 75 due to the "M=<dir>" option given in the command.
69 76
70 To install the modules that were just built: 77 To build against the running kernel use:
71 78
72 make -C <path-to-kernel> M=`pwd` modules_install 79 $ make -C /lib/modules/`uname -r`/build M=$PWD
73 80
74 More complex examples will be shown later, the above should 81 Then to install the module(s) just built, add the target
75 be enough to get you started. 82 "modules_install" to the command:
76 83
77--- 2.2 Available targets 84 $ make -C /lib/modules/`uname -r`/build M=$PWD modules_install
78 85
79 $KDIR refers to the path to the kernel source top-level directory 86--- 2.2 Options
80 87
81 make -C $KDIR M=`pwd` 88 ($KDIR refers to the path of the kernel source directory.)
82 Will build the module(s) located in current directory.
83 All output files will be located in the same directory
84 as the module source.
85 No attempts are made to update the kernel source, and it is
86 a precondition that a successful make has been executed
87 for the kernel.
88 89
89 make -C $KDIR M=`pwd` modules 90 make -C $KDIR M=$PWD
90 The modules target is implied when no target is given.
91 Same functionality as if no target was specified.
92 See description above.
93 91
94 make -C $KDIR M=`pwd` modules_install 92 -C $KDIR
95 Install the external module(s). 93 The directory where the kernel source is located.
96 Installation default is in /lib/modules/<kernel-version>/extra, 94 "make" will actually change to the specified directory
97 but may be prefixed with INSTALL_MOD_PATH - see separate 95 when executing and will change back when finished.
98 chapter.
99 96
100 make -C $KDIR M=`pwd` clean 97 M=$PWD
101 Remove all generated files for the module - the kernel 98 Informs kbuild that an external module is being built.
102 source directory is not modified. 99 The value given to "M" is the absolute path of the
100 directory where the external module (kbuild file) is
101 located.
103 102
104 make -C $KDIR M=`pwd` help 103--- 2.3 Targets
105 help will list the available target when building external
106 modules.
107 104
108--- 2.3 Available options: 105 When building an external module, only a subset of the "make"
106 targets are available.
109 107
110 $KDIR refers to the path to the kernel source top-level directory 108 make -C $KDIR M=$PWD [target]
111 109
112 make -C $KDIR 110 The default will build the module(s) located in the current
113 Used to specify where to find the kernel source. 111 directory, so a target does not need to be specified. All
114 '$KDIR' represent the directory where the kernel source is. 112 output files will also be generated in this directory. No
115 Make will actually change directory to the specified directory 113 attempts are made to update the kernel source, and it is a
116 when executed but change back when finished. 114 precondition that a successful "make" has been executed for the
115 kernel.
117 116
118 make -C $KDIR M=`pwd` 117 modules
119 M= is used to tell kbuild that an external module is 118 The default target for external modules. It has the
120 being built. 119 same functionality as if no target was specified. See
121 The option given to M= is the directory where the external 120 description above.
122 module (kbuild file) is located.
123 When an external module is being built only a subset of the
124 usual targets are available.
125 121
126 make -C $KDIR SUBDIRS=`pwd` 122 modules_install
127 Same as M=. The SUBDIRS= syntax is kept for backwards 123 Install the external module(s). The default location is
128 compatibility. 124 /lib/modules/<kernel_release>/extra/, but a prefix may
125 be added with INSTALL_MOD_PATH (discussed in section 5).
129 126
130--- 2.4 Preparing the kernel tree for module build 127 clean
128 Remove all generated files in the module directory only.
131 129
132 To make sure the kernel contains the information required to 130 help
133 build external modules the target 'modules_prepare' must be used. 131 List the available targets for external modules.
134 'modules_prepare' exists solely as a simple way to prepare
135 a kernel source tree for building external modules.
136 Note: modules_prepare will not build Module.symvers even if
137 CONFIG_MODVERSIONS is set. Therefore a full kernel build
138 needs to be executed to make module versioning work.
139 132
140--- 2.5 Building separate files for a module 133--- 2.4 Building Separate Files
141 It is possible to build single files which are part of a module.
142 This works equally well for the kernel, a module and even for
143 external modules.
144 Examples (module foo.ko, consist of bar.o, baz.o):
145 make -C $KDIR M=`pwd` bar.lst
146 make -C $KDIR M=`pwd` bar.o
147 make -C $KDIR M=`pwd` foo.ko
148 make -C $KDIR M=`pwd` /
149
150
151=== 3. Example commands
152
153This example shows the actual commands to be executed when building
154an external module for the currently running kernel.
155In the example below, the distribution is supposed to use the
156facility to locate output files for a kernel compile in a different
157directory than the kernel source - but the examples will also work
158when the source and the output files are mixed in the same directory.
159 134
160# Kernel source 135 It is possible to build single files that are part of a module.
161/lib/modules/<kernel-version>/source -> /usr/src/linux-<version> 136 This works equally well for the kernel, a module, and even for
162 137 external modules.
163# Output from kernel compile
164/lib/modules/<kernel-version>/build -> /usr/src/linux-<version>-up
165
166Change to the directory where the kbuild file is located and execute
167the following commands to build the module:
168 138
169 cd /home/user/src/module 139 Example (The module foo.ko, consist of bar.o and baz.o):
170 make -C /usr/src/`uname -r`/source \ 140 make -C $KDIR M=$PWD bar.lst
171 O=/lib/modules/`uname-r`/build \ 141 make -C $KDIR M=$PWD baz.o
172 M=`pwd` 142 make -C $KDIR M=$PWD foo.ko
143 make -C $KDIR M=$PWD /
173 144
174Then, to install the module use the following command:
175 145
176 make -C /usr/src/`uname -r`/source \ 146=== 3. Creating a Kbuild File for an External Module
177 O=/lib/modules/`uname-r`/build \
178 M=`pwd` \
179 modules_install
180 147
181If you look closely you will see that this is the same command as 148In the last section we saw the command to build a module for the
182listed before - with the directories spelled out. 149running kernel. The module is not actually built, however, because a
150build file is required. Contained in this file will be the name of
151the module(s) being built, along with the list of requisite source
152files. The file may be as simple as a single line:
183 153
184The above are rather long commands, and the following chapter 154 obj-m := <module_name>.o
185lists a few tricks to make it all easier.
186 155
156The kbuild system will build <module_name>.o from <module_name>.c,
157and, after linking, will result in the kernel module <module_name>.ko.
158The above line can be put in either a "Kbuild" file or a "Makefile."
159When the module is built from multiple sources, an additional line is
160needed listing the files:
187 161
188=== 4. Creating a kbuild file for an external module 162 <module_name>-y := <src1>.o <src2>.o ...
189 163
190kbuild is the build system for the kernel, and external modules 164NOTE: Further documentation describing the syntax used by kbuild is
191must use kbuild to stay compatible with changes in the build system 165located in Documentation/kbuild/makefiles.txt.
192and to pick up the right flags to gcc etc.
193 166
194The kbuild file used as input shall follow the syntax described 167The examples below demonstrate how to create a build file for the
195in Documentation/kbuild/makefiles.txt. This chapter will introduce a few 168module 8123.ko, which is built from the following files:
196more tricks to be used when dealing with external modules.
197 169
198In the following a Makefile will be created for a module with the
199following files:
200 8123_if.c 170 8123_if.c
201 8123_if.h 171 8123_if.h
202 8123_pci.c 172 8123_pci.c
203 8123_bin.o_shipped <= Binary blob 173 8123_bin.o_shipped <= Binary blob
204 174
205--- 4.1 Shared Makefile for module and kernel 175--- 3.1 Shared Makefile
206 176
207 An external module always includes a wrapper Makefile supporting 177 An external module always includes a wrapper makefile that
208 building the module using 'make' with no arguments. 178 supports building the module using "make" with no arguments.
209 The Makefile provided will most likely include additional 179 This target is not used by kbuild; it is only for convenience.
210 functionality such as test targets etc. and this part shall 180 Additional functionality, such as test targets, can be included
211 be filtered away from kbuild since it may impact kbuild if 181 but should be filtered out from kbuild due to possible name
212 name clashes occurs. 182 clashes.
213 183
214 Example 1: 184 Example 1:
215 --> filename: Makefile 185 --> filename: Makefile
@@ -219,11 +189,11 @@ following files:
219 8123-y := 8123_if.o 8123_pci.o 8123_bin.o 189 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
220 190
221 else 191 else
222 # Normal Makefile 192 # normal makefile
193 KDIR ?= /lib/modules/`uname -r`/build
223 194
224 KERNELDIR := /lib/modules/`uname -r`/build 195 default:
225 all:: 196 $(MAKE) -C $(KDIR) M=$$PWD
226 $(MAKE) -C $(KERNELDIR) M=`pwd` $@
227 197
228 # Module specific targets 198 # Module specific targets
229 genbin: 199 genbin:
@@ -231,15 +201,20 @@ following files:
231 201
232 endif 202 endif
233 203
234 In example 1, the check for KERNELRELEASE is used to separate 204 The check for KERNELRELEASE is used to separate the two parts
235 the two parts of the Makefile. kbuild will only see the two 205 of the makefile. In the example, kbuild will only see the two
236 assignments whereas make will see everything except the two 206 assignments, whereas "make" will see everything except these
237 kbuild assignments. 207 two assignments. This is due to two passes made on the file:
208 the first pass is by the "make" instance run on the command
209 line; the second pass is by the kbuild system, which is
210 initiated by the parameterized "make" in the default target.
211
212--- 3.2 Separate Kbuild File and Makefile
238 213
239 In recent versions of the kernel, kbuild will look for a file named 214 In newer versions of the kernel, kbuild will first look for a
240 Kbuild and as second option look for a file named Makefile. 215 file named "Kbuild," and only if that is not found, will it
241 Utilising the Kbuild file makes us split up the Makefile in example 1 216 then look for a makefile. Utilizing a "Kbuild" file allows us
242 into two files as shown in example 2: 217 to split up the makefile from example 1 into two files:
243 218
244 Example 2: 219 Example 2:
245 --> filename: Kbuild 220 --> filename: Kbuild
@@ -247,20 +222,21 @@ following files:
247 8123-y := 8123_if.o 8123_pci.o 8123_bin.o 222 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
248 223
249 --> filename: Makefile 224 --> filename: Makefile
250 KERNELDIR := /lib/modules/`uname -r`/build 225 KDIR ?= /lib/modules/`uname -r`/build
251 all:: 226
252 $(MAKE) -C $(KERNELDIR) M=`pwd` $@ 227 default:
228 $(MAKE) -C $(KDIR) M=$$PWD
253 229
254 # Module specific targets 230 # Module specific targets
255 genbin: 231 genbin:
256 echo "X" > 8123_bin.o_shipped 232 echo "X" > 8123_bin.o_shipped
257 233
234 The split in example 2 is questionable due to the simplicity of
235 each file; however, some external modules use makefiles
236 consisting of several hundred lines, and here it really pays
237 off to separate the kbuild part from the rest.
258 238
259 In example 2, we are down to two fairly simple files and for simple 239 The next example shows a backward compatible version.
260 files as used in this example the split is questionable. But some
261 external modules use Makefiles of several hundred lines and here it
262 really pays off to separate the kbuild part from the rest.
263 Example 3 shows a backward compatible version.
264 240
265 Example 3: 241 Example 3:
266 --> filename: Kbuild 242 --> filename: Kbuild
@@ -269,13 +245,15 @@ following files:
269 245
270 --> filename: Makefile 246 --> filename: Makefile
271 ifneq ($(KERNELRELEASE),) 247 ifneq ($(KERNELRELEASE),)
248 # kbuild part of makefile
272 include Kbuild 249 include Kbuild
250
273 else 251 else
274 # Normal Makefile 252 # normal makefile
253 KDIR ?= /lib/modules/`uname -r`/build
275 254
276 KERNELDIR := /lib/modules/`uname -r`/build 255 default:
277 all:: 256 $(MAKE) -C $(KDIR) M=$$PWD
278 $(MAKE) -C $(KERNELDIR) M=`pwd` $@
279 257
280 # Module specific targets 258 # Module specific targets
281 genbin: 259 genbin:
@@ -283,260 +261,271 @@ following files:
283 261
284 endif 262 endif
285 263
286 The trick here is to include the Kbuild file from Makefile, so 264 Here the "Kbuild" file is included from the makefile. This
287 if an older version of kbuild picks up the Makefile, the Kbuild 265 allows an older version of kbuild, which only knows of
288 file will be included. 266 makefiles, to be used when the "make" and kbuild parts are
267 split into separate files.
289 268
290--- 4.2 Binary blobs included in a module 269--- 3.3 Binary Blobs
291 270
292 Some external modules needs to include a .o as a blob. kbuild 271 Some external modules need to include an object file as a blob.
293 has support for this, but requires the blob file to be named 272 kbuild has support for this, but requires the blob file to be
294 <filename>_shipped. In our example the blob is named 273 named <filename>_shipped. When the kbuild rules kick in, a copy
295 8123_bin.o_shipped and when the kbuild rules kick in the file 274 of <filename>_shipped is created with _shipped stripped off,
296 8123_bin.o is created as a simple copy off the 8213_bin.o_shipped file 275 giving us <filename>. This shortened filename can be used in
297 with the _shipped part stripped of the filename. 276 the assignment to the module.
298 This allows the 8123_bin.o filename to be used in the assignment to 277
299 the module. 278 Throughout this section, 8123_bin.o_shipped has been used to
279 build the kernel module 8123.ko; it has been included as
280 8123_bin.o.
300 281
301 Example 4:
302 obj-m := 8123.o
303 8123-y := 8123_if.o 8123_pci.o 8123_bin.o 282 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
304 283
305 In example 4, there is no distinction between the ordinary .c/.h files 284 Although there is no distinction between the ordinary source
306 and the binary file. But kbuild will pick up different rules to create 285 files and the binary file, kbuild will pick up different rules
307 the .o file. 286 when creating the object file for the module.
287
288--- 3.4 Building Multiple Modules
308 289
290 kbuild supports building multiple modules with a single build
291 file. For example, if you wanted to build two modules, foo.ko
292 and bar.ko, the kbuild lines would be:
309 293
310=== 5. Include files 294 obj-m := foo.o bar.o
295 foo-y := <foo_srcs>
296 bar-y := <bar_srcs>
311 297
312Include files are a necessity when a .c file uses something from other .c 298 It is that simple!
313files (not strictly in the sense of C, but if good programming practice is
314used). Any module that consists of more than one .c file will have a .h file
315for one of the .c files.
316 299
317- If the .h file only describes a module internal interface, then the .h file
318 shall be placed in the same directory as the .c files.
319- If the .h files describe an interface used by other parts of the kernel
320 located in different directories, the .h files shall be located in
321 include/linux/ or other include/ directories as appropriate.
322 300
323One exception for this rule is larger subsystems that have their own directory 301=== 4. Include Files
324under include/ such as include/scsi. Another exception is arch-specific
325.h files which are located under include/asm-$(ARCH)/*.
326 302
327External modules have a tendency to locate include files in a separate include/ 303Within the kernel, header files are kept in standard locations
328directory and therefore need to deal with this in their kbuild file. 304according to the following rule:
329 305
330--- 5.1 How to include files from the kernel include dir 306 * If the header file only describes the internal interface of a
307 module, then the file is placed in the same directory as the
308 source files.
309 * If the header file describes an interface used by other parts
310 of the kernel that are located in different directories, then
311 the file is placed in include/linux/.
331 312
332 When a module needs to include a file from include/linux/, then one 313 NOTE: There are two notable exceptions to this rule: larger
333 just uses: 314 subsystems have their own directory under include/, such as
315 include/scsi; and architecture specific headers are located
316 under arch/$(ARCH)/include/.
334 317
335 #include <linux/modules.h> 318--- 4.1 Kernel Includes
336 319
337 kbuild will make sure to add options to gcc so the relevant 320 To include a header file located under include/linux/, simply
338 directories are searched. 321 use:
339 Likewise for .h files placed in the same directory as the .c file.
340 322
341 #include "8123_if.h" 323 #include <linux/module.h>
342 324
343 will do the job. 325 kbuild will add options to "gcc" so the relevant directories
326 are searched.
344 327
345--- 5.2 External modules using an include/ dir 328--- 4.2 Single Subdirectory
346 329
347 External modules often locate their .h files in a separate include/ 330 External modules tend to place header files in a separate
348 directory although this is not usual kernel style. When an external 331 include/ directory where their source is located, although this
349 module uses an include/ dir then kbuild needs to be told so. 332 is not the usual kernel style. To inform kbuild of the
350 The trick here is to use either EXTRA_CFLAGS (take effect for all .c 333 directory, use either ccflags-y or CFLAGS_<filename>.o.
351 files) or CFLAGS_$F.o (take effect only for a single file).
352 334
353 In our example, if we move 8123_if.h to a subdirectory named include/ 335 Using the example from section 3, if we moved 8123_if.h to a
354 the resulting Kbuild file would look like: 336 subdirectory named include, the resulting kbuild file would
337 look like:
355 338
356 --> filename: Kbuild 339 --> filename: Kbuild
357 obj-m := 8123.o 340 obj-m := 8123.o
358 341
359 EXTRA_CFLAGS := -Iinclude 342 ccflags-y := -Iinclude
360 8123-y := 8123_if.o 8123_pci.o 8123_bin.o 343 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
361 344
362 Note that in the assignment there is no space between -I and the path. 345 Note that in the assignment there is no space between -I and
363 This is a kbuild limitation: there must be no space present. 346 the path. This is a limitation of kbuild: there must be no
347 space present.
364 348
365--- 5.3 External modules using several directories 349--- 4.3 Several Subdirectories
366
367 If an external module does not follow the usual kernel style, but
368 decides to spread files over several directories, then kbuild can
369 handle this too.
370 350
351 kbuild can handle files that are spread over several directories.
371 Consider the following example: 352 Consider the following example:
372 353
373 | 354 .
374 +- src/complex_main.c 355 |__ src
375 | +- hal/hardwareif.c 356 | |__ complex_main.c
376 | +- hal/include/hardwareif.h 357 | |__ hal
377 +- include/complex.h 358 | |__ hardwareif.c
378 359 | |__ include
379 To build a single module named complex.ko, we then need the following 360 | |__ hardwareif.h
361 |__ include
362 |__ complex.h
363
364 To build the module complex.ko, we then need the following
380 kbuild file: 365 kbuild file:
381 366
382 Kbuild: 367 --> filename: Kbuild
383 obj-m := complex.o 368 obj-m := complex.o
384 complex-y := src/complex_main.o 369 complex-y := src/complex_main.o
385 complex-y += src/hal/hardwareif.o 370 complex-y += src/hal/hardwareif.o
386 371
387 EXTRA_CFLAGS := -I$(src)/include 372 ccflags-y := -I$(src)/include
388 EXTRA_CFLAGS += -I$(src)src/hal/include 373 ccflags-y += -I$(src)/src/hal/include
389 374
375 As you can see, kbuild knows how to handle object files located
376 in other directories. The trick is to specify the directory
377 relative to the kbuild file's location. That being said, this
378 is NOT recommended practice.
390 379
391 kbuild knows how to handle .o files located in another directory - 380 For the header files, kbuild must be explicitly told where to
392 although this is NOT recommended practice. The syntax is to specify 381 look. When kbuild executes, the current directory is always the
393 the directory relative to the directory where the Kbuild file is 382 root of the kernel tree (the argument to "-C") and therefore an
394 located. 383 absolute path is needed. $(src) provides the absolute path by
384 pointing to the directory where the currently executing kbuild
385 file is located.
395 386
396 To find the .h files, we have to explicitly tell kbuild where to look
397 for the .h files. When kbuild executes, the current directory is always
398 the root of the kernel tree (argument to -C) and therefore we have to
399 tell kbuild how to find the .h files using absolute paths.
400 $(src) will specify the absolute path to the directory where the
401 Kbuild file are located when being build as an external module.
402 Therefore -I$(src)/ is used to point out the directory of the Kbuild
403 file and any additional path are just appended.
404 387
405=== 6. Module installation 388=== 5. Module Installation
406 389
407Modules which are included in the kernel are installed in the directory: 390Modules which are included in the kernel are installed in the
391directory:
408 392
409 /lib/modules/$(KERNELRELEASE)/kernel 393 /lib/modules/$(KERNELRELEASE)/kernel/
410 394
411External modules are installed in the directory: 395And external modules are installed in:
412 396
413 /lib/modules/$(KERNELRELEASE)/extra 397 /lib/modules/$(KERNELRELEASE)/extra/
414 398
415--- 6.1 INSTALL_MOD_PATH 399--- 5.1 INSTALL_MOD_PATH
416 400
417 Above are the default directories, but as always, some level of 401 Above are the default directories but as always some level of
418 customization is possible. One can prefix the path using the variable 402 customization is possible. A prefix can be added to the
419 INSTALL_MOD_PATH: 403 installation path using the variable INSTALL_MOD_PATH:
420 404
421 $ make INSTALL_MOD_PATH=/frodo modules_install 405 $ make INSTALL_MOD_PATH=/frodo modules_install
422 => Install dir: /frodo/lib/modules/$(KERNELRELEASE)/kernel 406 => Install dir: /frodo/lib/modules/$(KERNELRELEASE)/kernel/
423
424 INSTALL_MOD_PATH may be set as an ordinary shell variable or as in the
425 example above, can be specified on the command line when calling make.
426 INSTALL_MOD_PATH has effect both when installing modules included in
427 the kernel as well as when installing external modules.
428 407
429--- 6.2 INSTALL_MOD_DIR 408 INSTALL_MOD_PATH may be set as an ordinary shell variable or,
409 as shown above, can be specified on the command line when
410 calling "make." This has effect when installing both in-tree
411 and out-of-tree modules.
430 412
431 When installing external modules they are by default installed to a 413--- 5.2 INSTALL_MOD_DIR
432 directory under /lib/modules/$(KERNELRELEASE)/extra, but one may wish
433 to locate modules for a specific functionality in a separate
434 directory. For this purpose, one can use INSTALL_MOD_DIR to specify an
435 alternative name to 'extra'.
436 414
437 $ make INSTALL_MOD_DIR=gandalf -C KERNELDIR \ 415 External modules are by default installed to a directory under
438 M=`pwd` modules_install 416 /lib/modules/$(KERNELRELEASE)/extra/, but you may wish to
439 => Install dir: /lib/modules/$(KERNELRELEASE)/gandalf 417 locate modules for a specific functionality in a separate
418 directory. For this purpose, use INSTALL_MOD_DIR to specify an
419 alternative name to "extra."
440 420
421 $ make INSTALL_MOD_DIR=gandalf -C $KDIR \
422 M=$PWD modules_install
423 => Install dir: /lib/modules/$(KERNELRELEASE)/gandalf/
441 424
442=== 7. Module versioning & Module.symvers
443 425
444Module versioning is enabled by the CONFIG_MODVERSIONS tag. 426=== 6. Module Versioning
445 427
446Module versioning is used as a simple ABI consistency check. The Module 428Module versioning is enabled by the CONFIG_MODVERSIONS tag, and is used
447versioning creates a CRC value of the full prototype for an exported symbol and 429as a simple ABI consistency check. A CRC value of the full prototype
448when a module is loaded/used then the CRC values contained in the kernel are 430for an exported symbol is created. When a module is loaded/used, the
449compared with similar values in the module. If they are not equal, then the 431CRC values contained in the kernel are compared with similar values in
450kernel refuses to load the module. 432the module; if they are not equal, the kernel refuses to load the
433module.
451 434
452Module.symvers contains a list of all exported symbols from a kernel build. 435Module.symvers contains a list of all exported symbols from a kernel
436build.
453 437
454--- 7.1 Symbols from the kernel (vmlinux + modules) 438--- 6.1 Symbols From the Kernel (vmlinux + modules)
455 439
456 During a kernel build, a file named Module.symvers will be generated. 440 During a kernel build, a file named Module.symvers will be
457 Module.symvers contains all exported symbols from the kernel and 441 generated. Module.symvers contains all exported symbols from
458 compiled modules. For each symbols, the corresponding CRC value 442 the kernel and compiled modules. For each symbol, the
459 is stored too. 443 corresponding CRC value is also stored.
460 444
461 The syntax of the Module.symvers file is: 445 The syntax of the Module.symvers file is:
462 <CRC> <Symbol> <module> 446 <CRC> <Symbol> <module>
463 Sample: 447
464 0x2d036834 scsi_remove_host drivers/scsi/scsi_mod 448 0x2d036834 scsi_remove_host drivers/scsi/scsi_mod
465 449
466 For a kernel build without CONFIG_MODVERSIONS enabled, the crc 450 For a kernel build without CONFIG_MODVERSIONS enabled, the CRC
467 would read: 0x00000000 451 would read 0x00000000.
468 452
469 Module.symvers serves two purposes: 453 Module.symvers serves two purposes:
470 1) It lists all exported symbols both from vmlinux and all modules 454 1) It lists all exported symbols from vmlinux and all modules.
471 2) It lists the CRC if CONFIG_MODVERSIONS is enabled 455 2) It lists the CRC if CONFIG_MODVERSIONS is enabled.
472 456
473--- 7.2 Symbols and external modules 457--- 6.2 Symbols and External Modules
474 458
475 When building an external module, the build system needs access to 459 When building an external module, the build system needs access
476 the symbols from the kernel to check if all external symbols are 460 to the symbols from the kernel to check if all external symbols
477 defined. This is done in the MODPOST step and to obtain all 461 are defined. This is done in the MODPOST step. modpost obtains
478 symbols, modpost reads Module.symvers from the kernel. 462 the symbols by reading Module.symvers from the kernel source
479 If a Module.symvers file is present in the directory where 463 tree. If a Module.symvers file is present in the directory
480 the external module is being built, this file will be read too. 464 where the external module is being built, this file will be
481 During the MODPOST step, a new Module.symvers file will be written 465 read too. During the MODPOST step, a new Module.symvers file
482 containing all exported symbols that were not defined in the kernel. 466 will be written containing all exported symbols that were not
483 467 defined in the kernel.
484--- 7.3 Symbols from another external module 468
485 469--- 6.3 Symbols From Another External Module
486 Sometimes, an external module uses exported symbols from another 470
487 external module. Kbuild needs to have full knowledge on all symbols 471 Sometimes, an external module uses exported symbols from
488 to avoid spitting out warnings about undefined symbols. 472 another external module. kbuild needs to have full knowledge of
489 Three solutions exist to let kbuild know all symbols of more than 473 all symbols to avoid spitting out warnings about undefined
490 one external module. 474 symbols. Three solutions exist for this situation.
491 The method with a top-level kbuild file is recommended but may be 475
492 impractical in certain situations. 476 NOTE: The method with a top-level kbuild file is recommended
493 477 but may be impractical in certain situations.
494 Use a top-level Kbuild file 478
495 If you have two modules: 'foo' and 'bar', and 'foo' needs 479 Use a top-level kbuild file
496 symbols from 'bar', then one can use a common top-level kbuild 480 If you have two modules, foo.ko and bar.ko, where
497 file so both modules are compiled in same build. 481 foo.ko needs symbols from bar.ko, you can use a
498 482 common top-level kbuild file so both modules are
499 Consider following directory layout: 483 compiled in the same build. Consider the following
500 ./foo/ <= contains the foo module 484 directory layout:
501 ./bar/ <= contains the bar module 485
502 The top-level Kbuild file would then look like: 486 ./foo/ <= contains foo.ko
503 487 ./bar/ <= contains bar.ko
504 #./Kbuild: (this file may also be named Makefile) 488
489 The top-level kbuild file would then look like:
490
491 #./Kbuild (or ./Makefile):
505 obj-y := foo/ bar/ 492 obj-y := foo/ bar/
506 493
507 Executing: 494 And executing
508 make -C $KDIR M=`pwd` 495
496 $ make -C $KDIR M=$PWD
509 497
510 will then do the expected and compile both modules with full 498 will then do the expected and compile both modules with
511 knowledge on symbols from both modules. 499 full knowledge of symbols from either module.
512 500
513 Use an extra Module.symvers file 501 Use an extra Module.symvers file
514 When an external module is built, a Module.symvers file is 502 When an external module is built, a Module.symvers file
515 generated containing all exported symbols which are not 503 is generated containing all exported symbols which are
516 defined in the kernel. 504 not defined in the kernel. To get access to symbols
517 To get access to symbols from module 'bar', one can copy the 505 from bar.ko, copy the Module.symvers file from the
518 Module.symvers file from the compilation of the 'bar' module 506 compilation of bar.ko to the directory where foo.ko is
519 to the directory where the 'foo' module is built. 507 built. During the module build, kbuild will read the
520 During the module build, kbuild will read the Module.symvers 508 Module.symvers file in the directory of the external
521 file in the directory of the external module and when the 509 module, and when the build is finished, a new
522 build is finished, a new Module.symvers file is created 510 Module.symvers file is created containing the sum of
523 containing the sum of all symbols defined and not part of the 511 all symbols defined and not part of the kernel.
524 kernel. 512
525 513 Use "make" variable KBUILD_EXTRA_SYMBOLS
526 Use make variable KBUILD_EXTRA_SYMBOLS in the Makefile 514 If it is impractical to copy Module.symvers from
527 If it is impractical to copy Module.symvers from another 515 another module, you can assign a space separated list
528 module, you can assign a space separated list of files to 516 of files to KBUILD_EXTRA_SYMBOLS in your build file.
529 KBUILD_EXTRA_SYMBOLS in your Makfile. These files will be 517 These files will be loaded by modpost during the
530 loaded by modpost during the initialisation of its symbol 518 initialization of its symbol tables.
531 tables. 519
532 520
533=== 8. Tips & Tricks 521=== 7. Tips & Tricks
534 522
535--- 8.1 Testing for CONFIG_FOO_BAR 523--- 7.1 Testing for CONFIG_FOO_BAR
536 524
537 Modules often need to check for certain CONFIG_ options to decide if 525 Modules often need to check for certain CONFIG_ options to
538 a specific feature shall be included in the module. When kbuild is used 526 decide if a specific feature is included in the module. In
539 this is done by referencing the CONFIG_ variable directly. 527 kbuild this is done by referencing the CONFIG_ variable
528 directly.
540 529
541 #fs/ext2/Makefile 530 #fs/ext2/Makefile
542 obj-$(CONFIG_EXT2_FS) += ext2.o 531 obj-$(CONFIG_EXT2_FS) += ext2.o
@@ -544,9 +533,9 @@ Module.symvers contains a list of all exported symbols from a kernel build.
544 ext2-y := balloc.o bitmap.o dir.o 533 ext2-y := balloc.o bitmap.o dir.o
545 ext2-$(CONFIG_EXT2_FS_XATTR) += xattr.o 534 ext2-$(CONFIG_EXT2_FS_XATTR) += xattr.o
546 535
547 External modules have traditionally used grep to check for specific 536 External modules have traditionally used "grep" to check for
548 CONFIG_ settings directly in .config. This usage is broken. 537 specific CONFIG_ settings directly in .config. This usage is
549 As introduced before, external modules shall use kbuild when building 538 broken. As introduced before, external modules should use
550 and therefore can use the same methods as in-kernel modules when 539 kbuild for building and can therefore use the same methods as
551 testing for CONFIG_ definitions. 540 in-tree modules when testing for CONFIG_ definitions.
552 541
diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt
index cab61d842259..7a9e0b4b2903 100644
--- a/Documentation/kdump/kdump.txt
+++ b/Documentation/kdump/kdump.txt
@@ -65,18 +65,21 @@ Install kexec-tools
65 65
662) Download the kexec-tools user-space package from the following URL: 662) Download the kexec-tools user-space package from the following URL:
67 67
68http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools.tar.gz 68http://kernel.org/pub/linux/utils/kernel/kexec/kexec-tools.tar.gz
69 69
70This is a symlink to the latest version. 70This is a symlink to the latest version.
71 71
72The latest kexec-tools git tree is available at: 72The latest kexec-tools git tree is available at:
73 73
74git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools.git 74git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git
75or 75and
76http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools.git 76http://www.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git
77
78There is also a gitweb interface available at
79http://www.kernel.org/git/?p=utils/kernel/kexec/kexec-tools.git
77 80
78More information about kexec-tools can be found at 81More information about kexec-tools can be found at
79http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/README.html 82http://www.kernel.org/pub/linux/utils/kernel/kexec/README.html
80 83
813) Unpack the tarball with the tar command, as follows: 843) Unpack the tarball with the tar command, as follows:
82 85
@@ -439,6 +442,6 @@ To Do
439Contact 442Contact
440======= 443=======
441 444
442Vivek Goyal (vgoyal@in.ibm.com) 445Vivek Goyal (vgoyal@redhat.com)
443Maneesh Soni (maneesh@in.ibm.com) 446Maneesh Soni (maneesh@in.ibm.com)
444 447
diff --git a/Documentation/kernel-docs.txt b/Documentation/kernel-docs.txt
index 715eaaf1519d..9a8674629a07 100644
--- a/Documentation/kernel-docs.txt
+++ b/Documentation/kernel-docs.txt
@@ -537,7 +537,7 @@
537 Notes: Further information in 537 Notes: Further information in
538 http://www.oreilly.com/catalog/linuxdrive2/ 538 http://www.oreilly.com/catalog/linuxdrive2/
539 539
540 * Title: "Linux Device Drivers, 3nd Edition" 540 * Title: "Linux Device Drivers, 3rd Edition"
541 Authors: Jonathan Corbet, Alessandro Rubini, and Greg Kroah-Hartman 541 Authors: Jonathan Corbet, Alessandro Rubini, and Greg Kroah-Hartman
542 Publisher: O'Reilly & Associates. 542 Publisher: O'Reilly & Associates.
543 Date: 2005. 543 Date: 2005.
@@ -592,14 +592,6 @@
592 Pages: 600. 592 Pages: 600.
593 ISBN: 0-13-101908-2 593 ISBN: 0-13-101908-2
594 594
595 * Title: "The Design and Implementation of the 4.4 BSD UNIX
596 Operating System"
597 Author: Marshall Kirk McKusick, Keith Bostic, Michael J. Karels,
598 John S. Quarterman.
599 Publisher: Addison-Wesley.
600 Date: 1996.
601 ISBN: 0-201-54979-4
602
603 * Title: "Programming for the real world - POSIX.4" 595 * Title: "Programming for the real world - POSIX.4"
604 Author: Bill O. Gallmeister. 596 Author: Bill O. Gallmeister.
605 Publisher: O'Reilly & Associates, Inc.. 597 Publisher: O'Reilly & Associates, Inc..
@@ -610,28 +602,13 @@
610 POSIX. Good reference. 602 POSIX. Good reference.
611 603
612 * Title: "UNIX Systems for Modern Architectures: Symmetric 604 * Title: "UNIX Systems for Modern Architectures: Symmetric
613 Multiprocesssing and Caching for Kernel Programmers" 605 Multiprocessing and Caching for Kernel Programmers"
614 Author: Curt Schimmel. 606 Author: Curt Schimmel.
615 Publisher: Addison Wesley. 607 Publisher: Addison Wesley.
616 Date: June, 1994. 608 Date: June, 1994.
617 Pages: 432. 609 Pages: 432.
618 ISBN: 0-201-63338-8 610 ISBN: 0-201-63338-8
619 611
620 * Title: "The Design and Implementation of the 4.3 BSD UNIX
621 Operating System"
622 Author: Samuel J. Leffler, Marshall Kirk McKusick, Michael J.
623 Karels, John S. Quarterman.
624 Publisher: Addison-Wesley.
625 Date: 1989 (reprinted with corrections on October, 1990).
626 ISBN: 0-201-06196-1
627
628 * Title: "The Design of the UNIX Operating System"
629 Author: Maurice J. Bach.
630 Publisher: Prentice Hall.
631 Date: 1986.
632 Pages: 471.
633 ISBN: 0-13-201757-1
634
635 MISCELLANEOUS: 612 MISCELLANEOUS:
636 613
637 * Name: linux/Documentation 614 * Name: linux/Documentation
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 8dd7248508a9..aa47be71df4c 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -44,6 +44,7 @@ parameter is applicable:
44 AX25 Appropriate AX.25 support is enabled. 44 AX25 Appropriate AX.25 support is enabled.
45 BLACKFIN Blackfin architecture is enabled. 45 BLACKFIN Blackfin architecture is enabled.
46 DRM Direct Rendering Management support is enabled. 46 DRM Direct Rendering Management support is enabled.
47 DYNAMIC_DEBUG Build in debug messages and enable them at runtime
47 EDD BIOS Enhanced Disk Drive Services (EDD) is enabled 48 EDD BIOS Enhanced Disk Drive Services (EDD) is enabled
48 EFI EFI Partitioning (GPT) is enabled 49 EFI EFI Partitioning (GPT) is enabled
49 EIDE EIDE/ATAPI support is enabled. 50 EIDE EIDE/ATAPI support is enabled.
@@ -143,6 +144,11 @@ a fixed number of characters. This limit depends on the architecture
143and is between 256 and 4096 characters. It is defined in the file 144and is between 256 and 4096 characters. It is defined in the file
144./include/asm/setup.h as COMMAND_LINE_SIZE. 145./include/asm/setup.h as COMMAND_LINE_SIZE.
145 146
147Finally, the [KMG] suffix is commonly described after a number of kernel
148parameter values. These 'K', 'M', and 'G' letters represent the _binary_
149multipliers 'Kilo', 'Mega', and 'Giga', equalling 2^10, 2^20, and 2^30
150bytes respectively. Such letter suffixes can also be entirely omitted.
151
146 152
147 acpi= [HW,ACPI,X86] 153 acpi= [HW,ACPI,X86]
148 Advanced Configuration and Power Interface 154 Advanced Configuration and Power Interface
@@ -198,11 +204,6 @@ and is between 256 and 4096 characters. It is defined in the file
198 unusable. The "log_buf_len" parameter may be useful 204 unusable. The "log_buf_len" parameter may be useful
199 if you need to capture more output. 205 if you need to capture more output.
200 206
201 acpi_display_output= [HW,ACPI]
202 acpi_display_output=vendor
203 acpi_display_output=video
204 See above.
205
206 acpi_irq_balance [HW,ACPI] 207 acpi_irq_balance [HW,ACPI]
207 ACPI will balance active IRQs 208 ACPI will balance active IRQs
208 default in APIC mode 209 default in APIC mode
@@ -244,7 +245,7 @@ and is between 256 and 4096 characters. It is defined in the file
244 245
245 acpi_sleep= [HW,ACPI] Sleep options 246 acpi_sleep= [HW,ACPI] Sleep options
246 Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig, 247 Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig,
247 old_ordering, s4_nonvs, sci_force_enable } 248 old_ordering, nonvs, sci_force_enable }
248 See Documentation/power/video.txt for information on 249 See Documentation/power/video.txt for information on
249 s3_bios and s3_mode. 250 s3_bios and s3_mode.
250 s3_beep is for debugging; it makes the PC's speaker beep 251 s3_beep is for debugging; it makes the PC's speaker beep
@@ -402,6 +403,10 @@ and is between 256 and 4096 characters. It is defined in the file
402 bttv.pll= See Documentation/video4linux/bttv/Insmod-options 403 bttv.pll= See Documentation/video4linux/bttv/Insmod-options
403 bttv.tuner= and Documentation/video4linux/bttv/CARDLIST 404 bttv.tuner= and Documentation/video4linux/bttv/CARDLIST
404 405
406 bulk_remove=off [PPC] This parameter disables the use of the pSeries
407 firmware feature for flushing multiple hpte entries
408 at a time.
409
405 c101= [NET] Moxa C101 synchronous serial card 410 c101= [NET] Moxa C101 synchronous serial card
406 411
407 cachesize= [BUGS=X86-32] Override level 2 CPU cache size detection. 412 cachesize= [BUGS=X86-32] Override level 2 CPU cache size detection.
@@ -455,7 +460,7 @@ and is between 256 and 4096 characters. It is defined in the file
455 [ARM] imx_timer1,OSTS,netx_timer,mpu_timer2, 460 [ARM] imx_timer1,OSTS,netx_timer,mpu_timer2,
456 pxa_timer,timer3,32k_counter,timer0_1 461 pxa_timer,timer3,32k_counter,timer0_1
457 [AVR32] avr32 462 [AVR32] avr32
458 [X86-32] pit,hpet,tsc,vmi-timer; 463 [X86-32] pit,hpet,tsc;
459 scx200_hrt on Geode; cyclone on IBM x440 464 scx200_hrt on Geode; cyclone on IBM x440
460 [MIPS] MIPS 465 [MIPS] MIPS
461 [PARISC] cr16 466 [PARISC] cr16
@@ -545,16 +550,20 @@ and is between 256 and 4096 characters. It is defined in the file
545 Format: 550 Format:
546 <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>] 551 <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
547 552
548 crashkernel=nn[KMG]@ss[KMG] 553 crashkernel=size[KMG][@offset[KMG]]
549 [KNL] Reserve a chunk of physical memory to 554 [KNL] Using kexec, Linux can switch to a 'crash kernel'
550 hold a kernel to switch to with kexec on panic. 555 upon panic. This parameter reserves the physical
556 memory region [offset, offset + size] for that kernel
557 image. If '@offset' is omitted, then a suitable offset
558 is selected automatically. Check
559 Documentation/kdump/kdump.txt for further details.
551 560
552 crashkernel=range1:size1[,range2:size2,...][@offset] 561 crashkernel=range1:size1[,range2:size2,...][@offset]
553 [KNL] Same as above, but depends on the memory 562 [KNL] Same as above, but depends on the memory
554 in the running system. The syntax of range is 563 in the running system. The syntax of range is
555 start-[end] where start and end are both 564 start-[end] where start and end are both
556 a memory unit (amount[KMG]). See also 565 a memory unit (amount[KMG]). See also
557 Documentation/kdump/kdump.txt for a example. 566 Documentation/kdump/kdump.txt for an example.
558 567
559 cs89x0_dma= [HW,NET] 568 cs89x0_dma= [HW,NET]
560 Format: <dma> 569 Format: <dma>
@@ -570,6 +579,10 @@ and is between 256 and 4096 characters. It is defined in the file
570 Format: <port#>,<type> 579 Format: <port#>,<type>
571 See also Documentation/input/joystick-parport.txt 580 See also Documentation/input/joystick-parport.txt
572 581
582 ddebug_query= [KNL,DYNAMIC_DEBUG] Enable debug messages at early boot
583 time. See Documentation/dynamic-debug-howto.txt for
584 details.
585
573 debug [KNL] Enable kernel debugging (events log level). 586 debug [KNL] Enable kernel debugging (events log level).
574 587
575 debug_locks_verbose= 588 debug_locks_verbose=
@@ -613,6 +626,10 @@ and is between 256 and 4096 characters. It is defined in the file
613 disable= [IPV6] 626 disable= [IPV6]
614 See Documentation/networking/ipv6.txt. 627 See Documentation/networking/ipv6.txt.
615 628
629 disable_ddw [PPC/PSERIES]
630 Disable Dynamic DMA Window support. Use this if
631 to workaround buggy firmware.
632
616 disable_ipv6= [IPV6] 633 disable_ipv6= [IPV6]
617 See Documentation/networking/ipv6.txt. 634 See Documentation/networking/ipv6.txt.
618 635
@@ -650,11 +667,6 @@ and is between 256 and 4096 characters. It is defined in the file
650 667
651 dscc4.setup= [NET] 668 dscc4.setup= [NET]
652 669
653 dynamic_printk Enables pr_debug()/dev_dbg() calls if
654 CONFIG_DYNAMIC_PRINTK_DEBUG has been enabled.
655 These can also be switched on/off via
656 <debugfs>/dynamic_printk/modules
657
658 earlycon= [KNL] Output early console device and options. 670 earlycon= [KNL] Output early console device and options.
659 uart[8250],io,<addr>[,options] 671 uart[8250],io,<addr>[,options]
660 uart[8250],mmio,<addr>[,options] 672 uart[8250],mmio,<addr>[,options]
@@ -687,7 +699,7 @@ and is between 256 and 4096 characters. It is defined in the file
687 ekgdboc= [X86,KGDB] Allow early kernel console debugging 699 ekgdboc= [X86,KGDB] Allow early kernel console debugging
688 ekgdboc=kbd 700 ekgdboc=kbd
689 701
690 This is desgined to be used in conjunction with 702 This is designed to be used in conjunction with
691 the boot argument: earlyprintk=vga 703 the boot argument: earlyprintk=vga
692 704
693 edd= [EDD] 705 edd= [EDD]
@@ -701,7 +713,7 @@ and is between 256 and 4096 characters. It is defined in the file
701 arch/x86/kernel/cpu/cpufreq/elanfreq.c. 713 arch/x86/kernel/cpu/cpufreq/elanfreq.c.
702 714
703 elevator= [IOSCHED] 715 elevator= [IOSCHED]
704 Format: {"anticipatory" | "cfq" | "deadline" | "noop"} 716 Format: {"cfq" | "deadline" | "noop"}
705 See Documentation/block/as-iosched.txt and 717 See Documentation/block/as-iosched.txt and
706 Documentation/block/deadline-iosched.txt for details. 718 Documentation/block/deadline-iosched.txt for details.
707 719
@@ -860,6 +872,12 @@ and is between 256 and 4096 characters. It is defined in the file
860 If specified, z/VM IUCV HVC accepts connections 872 If specified, z/VM IUCV HVC accepts connections
861 from listed z/VM user IDs only. 873 from listed z/VM user IDs only.
862 874
875 keep_bootcon [KNL]
876 Do not unregister boot console at start. This is only
877 useful for debugging when something happens in the window
878 between unregistering the boot console and initializing
879 the real console.
880
863 i2c_bus= [HW] Override the default board specific I2C bus speed 881 i2c_bus= [HW] Override the default board specific I2C bus speed
864 or register an additional I2C bus that is not 882 or register an additional I2C bus that is not
865 registered from board initialization code. 883 registered from board initialization code.
@@ -879,6 +897,7 @@ and is between 256 and 4096 characters. It is defined in the file
879 controller 897 controller
880 i8042.nopnp [HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX 898 i8042.nopnp [HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX
881 controllers 899 controllers
900 i8042.notimeout [HW] Ignore timeout condition signalled by conroller
882 i8042.reset [HW] Reset the controller during init and cleanup 901 i8042.reset [HW] Reset the controller during init and cleanup
883 i8042.unlock [HW] Unlock (ignore) the keylock 902 i8042.unlock [HW] Unlock (ignore) the keylock
884 903
@@ -980,7 +999,10 @@ and is between 256 and 4096 characters. It is defined in the file
980 With this option on every unmap_single operation will 999 With this option on every unmap_single operation will
981 result in a hardware IOTLB flush operation as opposed 1000 result in a hardware IOTLB flush operation as opposed
982 to batching them for performance. 1001 to batching them for performance.
983 1002 sp_off [Default Off]
1003 By default, super page will be supported if Intel IOMMU
1004 has the capability. With this option, super page will
1005 not be supported.
984 intremap= [X86-64, Intel-IOMMU] 1006 intremap= [X86-64, Intel-IOMMU]
985 Format: { on (default) | off | nosid } 1007 Format: { on (default) | off | nosid }
986 on enable Interrupt Remapping (default) 1008 on enable Interrupt Remapping (default)
@@ -1126,9 +1148,13 @@ and is between 256 and 4096 characters. It is defined in the file
1126 kvm.oos_shadow= [KVM] Disable out-of-sync shadow paging. 1148 kvm.oos_shadow= [KVM] Disable out-of-sync shadow paging.
1127 Default is 1 (enabled) 1149 Default is 1 (enabled)
1128 1150
1129 kvm-amd.nested= [KVM,AMD] Allow nested virtualization in KVM/SVM. 1151 kvm.mmu_audit= [KVM] This is a R/W parameter which allows audit
1152 KVM MMU at runtime.
1130 Default is 0 (off) 1153 Default is 0 (off)
1131 1154
1155 kvm-amd.nested= [KVM,AMD] Allow nested virtualization in KVM/SVM.
1156 Default is 1 (enabled)
1157
1132 kvm-amd.npt= [KVM,AMD] Disable nested paging (virtualized MMU) 1158 kvm-amd.npt= [KVM,AMD] Disable nested paging (virtualized MMU)
1133 for all guests. 1159 for all guests.
1134 Default is 1 (enabled) if in 64bit or 32bit-PAE mode 1160 Default is 1 (enabled) if in 64bit or 32bit-PAE mode
@@ -1258,10 +1284,9 @@ and is between 256 and 4096 characters. It is defined in the file
1258 6 (KERN_INFO) informational 1284 6 (KERN_INFO) informational
1259 7 (KERN_DEBUG) debug-level messages 1285 7 (KERN_DEBUG) debug-level messages
1260 1286
1261 log_buf_len=n Sets the size of the printk ring buffer, in bytes. 1287 log_buf_len=n[KMG] Sets the size of the printk ring buffer,
1262 Format: { n | nk | nM } 1288 in bytes. n must be a power of two. The default
1263 n must be a power of two. The default size 1289 size is set in the kernel config file.
1264 is set in the kernel config file.
1265 1290
1266 logo.nologo [FB] Disables display of the built-in Linux logo. 1291 logo.nologo [FB] Disables display of the built-in Linux logo.
1267 This may be used to provide more screen space for 1292 This may be used to provide more screen space for
@@ -1481,6 +1506,10 @@ and is between 256 and 4096 characters. It is defined in the file
1481 mtdparts= [MTD] 1506 mtdparts= [MTD]
1482 See drivers/mtd/cmdlinepart.c. 1507 See drivers/mtd/cmdlinepart.c.
1483 1508
1509 multitce=off [PPC] This parameter disables the use of the pSeries
1510 firmware feature for updating multiple TCE entries
1511 at a time.
1512
1484 onenand.bdry= [HW,MTD] Flex-OneNAND Boundary Configuration 1513 onenand.bdry= [HW,MTD] Flex-OneNAND Boundary Configuration
1485 1514
1486 Format: [die0_boundary][,die0_lock][,die1_boundary][,die1_lock] 1515 Format: [die0_boundary][,die0_lock][,die1_boundary][,die1_lock]
@@ -1532,12 +1561,15 @@ and is between 256 and 4096 characters. It is defined in the file
1532 1 to enable accounting 1561 1 to enable accounting
1533 Default value is 0. 1562 Default value is 0.
1534 1563
1535 nfsaddrs= [NFS] 1564 nfsaddrs= [NFS] Deprecated. Use ip= instead.
1536 See Documentation/filesystems/nfs/nfsroot.txt. 1565 See Documentation/filesystems/nfs/nfsroot.txt.
1537 1566
1538 nfsroot= [NFS] nfs root filesystem for disk-less boxes. 1567 nfsroot= [NFS] nfs root filesystem for disk-less boxes.
1539 See Documentation/filesystems/nfs/nfsroot.txt. 1568 See Documentation/filesystems/nfs/nfsroot.txt.
1540 1569
1570 nfsrootdebug [NFS] enable nfsroot debugging messages.
1571 See Documentation/filesystems/nfs/nfsroot.txt.
1572
1541 nfs.callback_tcpport= 1573 nfs.callback_tcpport=
1542 [NFS] set the TCP port on which the NFSv4 callback 1574 [NFS] set the TCP port on which the NFSv4 callback
1543 channel should listen. 1575 channel should listen.
@@ -1561,26 +1593,27 @@ and is between 256 and 4096 characters. It is defined in the file
1561 of returning the full 64-bit number. 1593 of returning the full 64-bit number.
1562 The default is to return 64-bit inode numbers. 1594 The default is to return 64-bit inode numbers.
1563 1595
1596 nfs.nfs4_disable_idmapping=
1597 [NFSv4] When set, this option disables the NFSv4
1598 idmapper on the client, but only if the mount
1599 is using the 'sec=sys' security flavour. This may
1600 make migration from legacy NFSv2/v3 systems easier
1601 provided that the server has the appropriate support.
1602 The default is to always enable NFSv4 idmapping.
1603
1564 nmi_debug= [KNL,AVR32,SH] Specify one or more actions to take 1604 nmi_debug= [KNL,AVR32,SH] Specify one or more actions to take
1565 when a NMI is triggered. 1605 when a NMI is triggered.
1566 Format: [state][,regs][,debounce][,die] 1606 Format: [state][,regs][,debounce][,die]
1567 1607
1568 nmi_watchdog= [KNL,BUGS=X86] Debugging features for SMP kernels 1608 nmi_watchdog= [KNL,BUGS=X86] Debugging features for SMP kernels
1569 Format: [panic,][num] 1609 Format: [panic,][nopanic,][num]
1570 Valid num: 0,1,2 1610 Valid num: 0
1571 0 - turn nmi_watchdog off 1611 0 - turn nmi_watchdog off
1572 1 - use the IO-APIC timer for the NMI watchdog
1573 2 - use the local APIC for the NMI watchdog using
1574 a performance counter. Note: This will use one
1575 performance counter and the local APIC's performance
1576 vector.
1577 When panic is specified, panic when an NMI watchdog 1612 When panic is specified, panic when an NMI watchdog
1578 timeout occurs. 1613 timeout occurs (or 'nopanic' to override the opposite
1614 default).
1579 This is useful when you use a panic=... timeout and 1615 This is useful when you use a panic=... timeout and
1580 need the box quickly up again. 1616 need the box quickly up again.
1581 Instead of 1 and 2 it is possible to use the following
1582 symbolic names: lapic and ioapic
1583 Example: nmi_watchdog=2 or nmi_watchdog=panic,lapic
1584 1617
1585 netpoll.carrier_timeout= 1618 netpoll.carrier_timeout=
1586 [NET] Specifies amount of time (in seconds) that 1619 [NET] Specifies amount of time (in seconds) that
@@ -1610,6 +1643,8 @@ and is between 256 and 4096 characters. It is defined in the file
1610 noapic [SMP,APIC] Tells the kernel to not make use of any 1643 noapic [SMP,APIC] Tells the kernel to not make use of any
1611 IOAPICs that may be present in the system. 1644 IOAPICs that may be present in the system.
1612 1645
1646 noautogroup Disable scheduler automatic task group creation.
1647
1613 nobats [PPC] Do not use BATs for mapping kernel lowmem 1648 nobats [PPC] Do not use BATs for mapping kernel lowmem
1614 on "Classic" PPC cores. 1649 on "Classic" PPC cores.
1615 1650
@@ -1632,6 +1667,10 @@ and is between 256 and 4096 characters. It is defined in the file
1632 noexec=on: enable non-executable mappings (default) 1667 noexec=on: enable non-executable mappings (default)
1633 noexec=off: disable non-executable mappings 1668 noexec=off: disable non-executable mappings
1634 1669
1670 nosmep [X86]
1671 Disable SMEP (Supervisor Mode Execution Protection)
1672 even if it is supported by processor.
1673
1635 noexec32 [X86-64] 1674 noexec32 [X86-64]
1636 This affects only 32-bit executables. 1675 This affects only 32-bit executables.
1637 noexec32=on: enable non-executable mappings (default) 1676 noexec32=on: enable non-executable mappings (default)
@@ -1693,6 +1732,11 @@ and is between 256 and 4096 characters. It is defined in the file
1693 1732
1694 nojitter [IA64] Disables jitter checking for ITC timers. 1733 nojitter [IA64] Disables jitter checking for ITC timers.
1695 1734
1735 no-kvmclock [X86,KVM] Disable paravirtualized KVM clock driver
1736
1737 no-kvmapf [X86,KVM] Disable paravirtualized asynchronous page
1738 fault handling.
1739
1696 nolapic [X86-32,APIC] Do not enable or use the local APIC. 1740 nolapic [X86-32,APIC] Do not enable or use the local APIC.
1697 1741
1698 nolapic_timer [X86-32,APIC] Do not use the local APIC timer. 1742 nolapic_timer [X86-32,APIC] Do not use the local APIC timer.
@@ -1713,7 +1757,7 @@ and is between 256 and 4096 characters. It is defined in the file
1713 norandmaps Don't use address space randomization. Equivalent to 1757 norandmaps Don't use address space randomization. Equivalent to
1714 echo 0 > /proc/sys/kernel/randomize_va_space 1758 echo 0 > /proc/sys/kernel/randomize_va_space
1715 1759
1716 noreplace-paravirt [X86-32,PV_OPS] Don't patch paravirt_ops 1760 noreplace-paravirt [X86,IA-64,PV_OPS] Don't patch paravirt_ops
1717 1761
1718 noreplace-smp [X86-32,SMP] Don't replace SMP instructions 1762 noreplace-smp [X86-32,SMP] Don't replace SMP instructions
1719 with UP alternatives 1763 with UP alternatives
@@ -1736,16 +1780,13 @@ and is between 256 and 4096 characters. It is defined in the file
1736 1780
1737 nosoftlockup [KNL] Disable the soft-lockup detector. 1781 nosoftlockup [KNL] Disable the soft-lockup detector.
1738 1782
1739 noswapaccount [KNL] Disable accounting of swap in memory resource
1740 controller. (See Documentation/cgroups/memory.txt)
1741
1742 nosync [HW,M68K] Disables sync negotiation for all devices. 1783 nosync [HW,M68K] Disables sync negotiation for all devices.
1743 1784
1744 notsc [BUGS=X86-32] Disable Time Stamp Counter 1785 notsc [BUGS=X86-32] Disable Time Stamp Counter
1745 1786
1746 nousb [USB] Disable the USB subsystem 1787 nousb [USB] Disable the USB subsystem
1747 1788
1748 nowatchdog [KNL] Disable the lockup detector. 1789 nowatchdog [KNL] Disable the lockup detector (NMI watchdog).
1749 1790
1750 nowb [ARM] 1791 nowb [ARM]
1751 1792
@@ -1795,10 +1836,17 @@ and is between 256 and 4096 characters. It is defined in the file
1795 perfmon on Intel CPUs instead of the 1836 perfmon on Intel CPUs instead of the
1796 CPU specific event set. 1837 CPU specific event set.
1797 1838
1839 oops=panic Always panic on oopses. Default is to just kill the
1840 process, but there is a small probability of
1841 deadlocking the machine.
1842 This will also cause panics on machine check exceptions.
1843 Useful together with panic=30 to trigger a reboot.
1844
1798 OSS [HW,OSS] 1845 OSS [HW,OSS]
1799 See Documentation/sound/oss/oss-parameters.txt 1846 See Documentation/sound/oss/oss-parameters.txt
1800 1847
1801 panic= [KNL] Kernel behaviour on panic 1848 panic= [KNL] Kernel behaviour on panic: delay <timeout>
1849 seconds before rebooting
1802 Format: <timeout> 1850 Format: <timeout>
1803 1851
1804 parkbd.port= [HW] Parallel port number the keyboard adapter is 1852 parkbd.port= [HW] Parallel port number the keyboard adapter is
@@ -1967,6 +2015,8 @@ and is between 256 and 4096 characters. It is defined in the file
1967 the default. 2015 the default.
1968 off: Turn ECRC off 2016 off: Turn ECRC off
1969 on: Turn ECRC on. 2017 on: Turn ECRC on.
2018 realloc reallocate PCI resources if allocations done by BIOS
2019 are erroneous.
1970 2020
1971 pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power 2021 pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power
1972 Management. 2022 Management.
@@ -2153,6 +2203,11 @@ and is between 256 and 4096 characters. It is defined in the file
2153 Reserves a hole at the top of the kernel virtual 2203 Reserves a hole at the top of the kernel virtual
2154 address space. 2204 address space.
2155 2205
2206 reservelow= [X86]
2207 Format: nn[K]
2208 Set the amount of memory to reserve for BIOS at
2209 the bottom of the address space.
2210
2156 reset_devices [KNL] Force drivers to reset the underlying device 2211 reset_devices [KNL] Force drivers to reset the underlying device
2157 during initialization. 2212 during initialization.
2158 2213
@@ -2165,6 +2220,11 @@ and is between 256 and 4096 characters. It is defined in the file
2165 in <PAGE_SIZE> units (needed only for swap files). 2220 in <PAGE_SIZE> units (needed only for swap files).
2166 See Documentation/power/swsusp-and-swap-files.txt 2221 See Documentation/power/swsusp-and-swap-files.txt
2167 2222
2223 hibernate= [HIBERNATION]
2224 noresume Don't check if there's a hibernation image
2225 present during boot.
2226 nocompress Don't compress/decompress hibernation images.
2227
2168 retain_initrd [RAM] Keep initrd memory after extraction 2228 retain_initrd [RAM] Keep initrd memory after extraction
2169 2229
2170 rhash_entries= [KNL,NET] 2230 rhash_entries= [KNL,NET]
@@ -2291,6 +2351,7 @@ and is between 256 and 4096 characters. It is defined in the file
2291 2351
2292 softlockup_panic= 2352 softlockup_panic=
2293 [KNL] Should the soft-lockup detector generate panics. 2353 [KNL] Should the soft-lockup detector generate panics.
2354 Format: <integer>
2294 2355
2295 sonypi.*= [HW] Sony Programmable I/O Control Device driver 2356 sonypi.*= [HW] Sony Programmable I/O Control Device driver
2296 See Documentation/sonypi.txt 2357 See Documentation/sonypi.txt
@@ -2356,10 +2417,24 @@ and is between 256 and 4096 characters. It is defined in the file
2356 improve throughput, but will also increase the 2417 improve throughput, but will also increase the
2357 amount of memory reserved for use by the client. 2418 amount of memory reserved for use by the client.
2358 2419
2420 swapaccount[=0|1]
2421 [KNL] Enable accounting of swap in memory resource
2422 controller if no parameter or 1 is given or disable
2423 it if 0 is given (See Documentation/cgroups/memory.txt)
2424
2359 swiotlb= [IA-64] Number of I/O TLB slabs 2425 swiotlb= [IA-64] Number of I/O TLB slabs
2360 2426
2361 switches= [HW,M68k] 2427 switches= [HW,M68k]
2362 2428
2429 sysfs.deprecated=0|1 [KNL]
2430 Enable/disable old style sysfs layout for old udev
2431 on older distributions. When this option is enabled
2432 very new udev will not work anymore. When this option
2433 is disabled (or CONFIG_SYSFS_DEPRECATED not compiled)
2434 in older udev will not work anymore.
2435 Default depends on CONFIG_SYSFS_DEPRECATED_V2 set in
2436 the kernel configuration.
2437
2363 sysrq_always_enabled 2438 sysrq_always_enabled
2364 [KNL] 2439 [KNL]
2365 Ignore sysrq setting - this boot parameter will 2440 Ignore sysrq setting - this boot parameter will
@@ -2402,13 +2477,17 @@ and is between 256 and 4096 characters. It is defined in the file
2402 <deci-seconds>: poll all this frequency 2477 <deci-seconds>: poll all this frequency
2403 0: no polling (default) 2478 0: no polling (default)
2404 2479
2480 threadirqs [KNL]
2481 Force threading of all interrupt handlers except those
2482 marked explicitely IRQF_NO_THREAD.
2483
2405 topology= [S390] 2484 topology= [S390]
2406 Format: {off | on} 2485 Format: {off | on}
2407 Specify if the kernel should make use of the cpu 2486 Specify if the kernel should make use of the cpu
2408 topology informations if the hardware supports these. 2487 topology information if the hardware supports this.
2409 The scheduler will make use of these informations and 2488 The scheduler will make use of this information and
2410 e.g. base its process migration decisions on it. 2489 e.g. base its process migration decisions on it.
2411 Default is off. 2490 Default is on.
2412 2491
2413 tp720= [HW,PS2] 2492 tp720= [HW,PS2]
2414 2493
@@ -2429,12 +2508,17 @@ and is between 256 and 4096 characters. It is defined in the file
2429 to facilitate early boot debugging. 2508 to facilitate early boot debugging.
2430 See also Documentation/trace/events.txt 2509 See also Documentation/trace/events.txt
2431 2510
2432 tsc= Disable clocksource-must-verify flag for TSC. 2511 tsc= Disable clocksource stability checks for TSC.
2433 Format: <string> 2512 Format: <string>
2434 [x86] reliable: mark tsc clocksource as reliable, this 2513 [x86] reliable: mark tsc clocksource as reliable, this
2435 disables clocksource verification at runtime. 2514 disables clocksource verification at runtime, as well
2436 Used to enable high-resolution timer mode on older 2515 as the stability checks done at bootup. Used to enable
2437 hardware, and in virtualized environment. 2516 high-resolution timer mode on older hardware, and in
2517 virtualized environment.
2518 [x86] noirqtime: Do not use TSC to do irq accounting.
2519 Used to run time disable IRQ_TIME_ACCOUNTING on any
2520 platforms where RDTSC is slow and this accounting
2521 can add overhead.
2438 2522
2439 turbografx.map[2|3]= [HW,JOY] 2523 turbografx.map[2|3]= [HW,JOY]
2440 TurboGraFX parallel port interface 2524 TurboGraFX parallel port interface
@@ -2454,8 +2538,7 @@ and is between 256 and 4096 characters. It is defined in the file
2454 reported either. 2538 reported either.
2455 2539
2456 unknown_nmi_panic 2540 unknown_nmi_panic
2457 [X86] 2541 [X86] Cause panic on unknown NMI.
2458 Set unknown_nmi_panic=1 early on boot.
2459 2542
2460 usbcore.autosuspend= 2543 usbcore.autosuspend=
2461 [USB] The autosuspend time delay (in seconds) used 2544 [USB] The autosuspend time delay (in seconds) used
@@ -2504,6 +2587,10 @@ and is between 256 and 4096 characters. It is defined in the file
2504 bytes of sense data); 2587 bytes of sense data);
2505 c = FIX_CAPACITY (decrease the reported 2588 c = FIX_CAPACITY (decrease the reported
2506 device capacity by one sector); 2589 device capacity by one sector);
2590 d = NO_READ_DISC_INFO (don't use
2591 READ_DISC_INFO command);
2592 e = NO_READ_CAPACITY_16 (don't use
2593 READ_CAPACITY_16 command);
2507 h = CAPACITY_HEURISTICS (decrease the 2594 h = CAPACITY_HEURISTICS (decrease the
2508 reported device capacity by one 2595 reported device capacity by one
2509 sector if the number is odd); 2596 sector if the number is odd);
@@ -2513,6 +2600,8 @@ and is between 256 and 4096 characters. It is defined in the file
2513 unlock ejectable media); 2600 unlock ejectable media);
2514 m = MAX_SECTORS_64 (don't transfer more 2601 m = MAX_SECTORS_64 (don't transfer more
2515 than 64 sectors = 32 KB at a time); 2602 than 64 sectors = 32 KB at a time);
2603 n = INITIAL_READ10 (force a retry of the
2604 initial READ(10) command);
2516 o = CAPACITY_OK (accept the capacity 2605 o = CAPACITY_OK (accept the capacity
2517 reported by the device); 2606 reported by the device);
2518 r = IGNORE_RESIDUE (the device reports 2607 r = IGNORE_RESIDUE (the device reports
diff --git a/Documentation/kmemleak.txt b/Documentation/kmemleak.txt
index 34f6638aa5ac..51063e681ca4 100644
--- a/Documentation/kmemleak.txt
+++ b/Documentation/kmemleak.txt
@@ -12,6 +12,9 @@ reported via /sys/kernel/debug/kmemleak. A similar method is used by the
12Valgrind tool (memcheck --leak-check) to detect the memory leaks in 12Valgrind tool (memcheck --leak-check) to detect the memory leaks in
13user-space applications. 13user-space applications.
14 14
15Please check DEBUG_KMEMLEAK dependencies in lib/Kconfig.debug for supported
16architectures.
17
15Usage 18Usage
16----- 19-----
17 20
@@ -178,5 +181,4 @@ block doesn't need to be freed (some cases in the init_call functions),
178the pointer is calculated by other methods than the usual container_of 181the pointer is calculated by other methods than the usual container_of
179macro or the pointer is stored in a location not scanned by kmemleak. 182macro or the pointer is stored in a location not scanned by kmemleak.
180 183
181Page allocations and ioremap are not tracked. Only the ARM and x86 184Page allocations and ioremap are not tracked.
182architectures are currently supported.
diff --git a/Documentation/ko_KR/HOWTO b/Documentation/ko_KR/HOWTO
index e3a55b6091e9..ab5189ae3428 100644
--- a/Documentation/ko_KR/HOWTO
+++ b/Documentation/ko_KR/HOWTO
@@ -391,8 +391,8 @@ bugme-new 메일링 리스트나(새로운 버그 리포트들만이 이곳에
391bugme-janitor 메일링 리스트(bugzilla에 모든 변화들이 여기서 메일로 전해진다) 391bugme-janitor 메일링 리스트(bugzilla에 모든 변화들이 여기서 메일로 전해진다)
392에 등록하면 된다. 392에 등록하면 된다.
393 393
394 http://lists.osdl.org/mailman/listinfo/bugme-new 394 https://lists.linux-foundation.org/mailman/listinfo/bugme-new
395 http://lists.osdl.org/mailman/listinfo/bugme-janitors 395 https://lists.linux-foundation.org/mailman/listinfo/bugme-janitors
396 396
397 397
398 398
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt
index 1762b81fcdf2..0cfb00fd86ff 100644
--- a/Documentation/kprobes.txt
+++ b/Documentation/kprobes.txt
@@ -542,9 +542,11 @@ Kprobes does not use mutexes or allocate memory except during
542registration and unregistration. 542registration and unregistration.
543 543
544Probe handlers are run with preemption disabled. Depending on the 544Probe handlers are run with preemption disabled. Depending on the
545architecture, handlers may also run with interrupts disabled. In any 545architecture and optimization state, handlers may also run with
546case, your handler should not yield the CPU (e.g., by attempting to 546interrupts disabled (e.g., kretprobe handlers and optimized kprobe
547acquire a semaphore). 547handlers run without interrupt disabled on x86/x86-64). In any case,
548your handler should not yield the CPU (e.g., by attempting to acquire
549a semaphore).
548 550
549Since a return probe is implemented by replacing the return 551Since a return probe is implemented by replacing the return
550address with the trampoline's address, stack backtraces and calls 552address with the trampoline's address, stack backtraces and calls
@@ -596,7 +598,7 @@ a 5-byte jump instruction. So there are several limitations.
596a) The instructions in DCR must be relocatable. 598a) The instructions in DCR must be relocatable.
597b) The instructions in DCR must not include a call instruction. 599b) The instructions in DCR must not include a call instruction.
598c) JTPR must not be targeted by any jump or call instruction. 600c) JTPR must not be targeted by any jump or call instruction.
599d) DCR must not straddle the border betweeen functions. 601d) DCR must not straddle the border between functions.
600 602
601Anyway, these limitations are checked by the in-kernel instruction 603Anyway, these limitations are checked by the in-kernel instruction
602decoder, so you don't need to worry about that. 604decoder, so you don't need to worry about that.
diff --git a/Documentation/kref.txt b/Documentation/kref.txt
index ae203f91ee9b..48ba715d5a63 100644
--- a/Documentation/kref.txt
+++ b/Documentation/kref.txt
@@ -156,7 +156,7 @@ static struct my_data *get_entry()
156 struct my_data *entry = NULL; 156 struct my_data *entry = NULL;
157 mutex_lock(&mutex); 157 mutex_lock(&mutex);
158 if (!list_empty(&q)) { 158 if (!list_empty(&q)) {
159 entry = container_of(q.next, struct my_q_entry, link); 159 entry = container_of(q.next, struct my_data, link);
160 kref_get(&entry->refcount); 160 kref_get(&entry->refcount);
161 } 161 }
162 mutex_unlock(&mutex); 162 mutex_unlock(&mutex);
diff --git a/Documentation/laptops/acer-wmi.txt b/Documentation/laptops/acer-wmi.txt
deleted file mode 100644
index 4beafa663dd6..000000000000
--- a/Documentation/laptops/acer-wmi.txt
+++ /dev/null
@@ -1,184 +0,0 @@
1Acer Laptop WMI Extras Driver
2http://code.google.com/p/aceracpi
3Version 0.3
44th April 2009
5
6Copyright 2007-2009 Carlos Corbacho <carlos@strangeworlds.co.uk>
7
8acer-wmi is a driver to allow you to control various parts of your Acer laptop
9hardware under Linux which are exposed via ACPI-WMI.
10
11This driver completely replaces the old out-of-tree acer_acpi, which I am
12currently maintaining for bug fixes only on pre-2.6.25 kernels. All development
13work is now focused solely on acer-wmi.
14
15Disclaimer
16**********
17
18Acer and Wistron have provided nothing towards the development acer_acpi or
19acer-wmi. All information we have has been through the efforts of the developers
20and the users to discover as much as possible about the hardware.
21
22As such, I do warn that this could break your hardware - this is extremely
23unlikely of course, but please bear this in mind.
24
25Background
26**********
27
28acer-wmi is derived from acer_acpi, originally developed by Mark
29Smith in 2005, then taken over by Carlos Corbacho in 2007, in order to activate
30the wireless LAN card under a 64-bit version of Linux, as acerhk[1] (the
31previous solution to the problem) relied on making 32 bit BIOS calls which are
32not possible in kernel space from a 64 bit OS.
33
34[1] acerhk: http://www.cakey.de/acerhk/
35
36Supported Hardware
37******************
38
39NOTE: The Acer Aspire One is not supported hardware. It cannot work with
40acer-wmi until Acer fix their ACPI-WMI implementation on them, so has been
41blacklisted until that happens.
42
43Please see the website for the current list of known working hardware:
44
45http://code.google.com/p/aceracpi/wiki/SupportedHardware
46
47If your laptop is not listed, or listed as unknown, and works with acer-wmi,
48please contact me with a copy of the DSDT.
49
50If your Acer laptop doesn't work with acer-wmi, I would also like to see the
51DSDT.
52
53To send me the DSDT, as root/sudo:
54
55cat /sys/firmware/acpi/tables/DSDT > dsdt
56
57And send me the resulting 'dsdt' file.
58
59Usage
60*****
61
62On Acer laptops, acer-wmi should already be autoloaded based on DMI matching.
63For non-Acer laptops, until WMI based autoloading support is added, you will
64need to manually load acer-wmi.
65
66acer-wmi creates /sys/devices/platform/acer-wmi, and fills it with various
67files whose usage is detailed below, which enables you to control some of the
68following (varies between models):
69
70* the wireless LAN card radio
71* inbuilt Bluetooth adapter
72* inbuilt 3G card
73* mail LED of your laptop
74* brightness of the LCD panel
75
76Wireless
77********
78
79With regards to wireless, all acer-wmi does is enable the radio on the card. It
80is not responsible for the wireless LED - once the radio is enabled, this is
81down to the wireless driver for your card. So the behaviour of the wireless LED,
82once you enable the radio, will depend on your hardware and driver combination.
83
84e.g. With the BCM4318 on the Acer Aspire 5020 series:
85
86ndiswrapper: Light blinks on when transmitting
87b43: Solid light, blinks off when transmitting
88
89Wireless radio control is unconditionally enabled - all Acer laptops that support
90acer-wmi come with built-in wireless. However, should you feel so inclined to
91ever wish to remove the card, or swap it out at some point, please get in touch
92with me, as we may well be able to gain some data on wireless card detection.
93
94The wireless radio is exposed through rfkill.
95
96Bluetooth
97*********
98
99For bluetooth, this is an internal USB dongle, so once enabled, you will get
100a USB device connection event, and a new USB device appears. When you disable
101bluetooth, you get the reverse - a USB device disconnect event, followed by the
102device disappearing again.
103
104Bluetooth is autodetected by acer-wmi, so if you do not have a bluetooth module
105installed in your laptop, this file won't exist (please be aware that it is
106quite common for Acer not to fit bluetooth to their laptops - so just because
107you have a bluetooth button on the laptop, doesn't mean that bluetooth is
108installed).
109
110For the adventurously minded - if you want to buy an internal bluetooth
111module off the internet that is compatible with your laptop and fit it, then
112it will work just fine with acer-wmi.
113
114Bluetooth is exposed through rfkill.
115
1163G
117**
118
1193G is currently not autodetected, so the 'threeg' file is always created under
120sysfs. So far, no-one in possession of an Acer laptop with 3G built-in appears to
121have tried Linux, or reported back, so we don't have any information on this.
122
123If you have an Acer laptop that does have a 3G card in, please contact me so we
124can properly detect these, and find out a bit more about them.
125
126To read the status of the 3G card (0=off, 1=on):
127cat /sys/devices/platform/acer-wmi/threeg
128
129To enable the 3G card:
130echo 1 > /sys/devices/platform/acer-wmi/threeg
131
132To disable the 3G card:
133echo 0 > /sys/devices/platform/acer-wmi/threeg
134
135To set the state of the 3G card when loading acer-wmi, pass:
136threeg=X (where X is 0 or 1)
137
138Mail LED
139********
140
141This can be found in most older Acer laptops supported by acer-wmi, and many
142newer ones - it is built into the 'mail' button, and blinks when active.
143
144On newer (WMID) laptops though, we have no way of detecting the mail LED. If
145your laptop identifies itself in dmesg as a WMID model, then please try loading
146acer_acpi with:
147
148force_series=2490
149
150This will use a known alternative method of reading/ writing the mail LED. If
151it works, please report back to me with the DMI data from your laptop so this
152can be added to acer-wmi.
153
154The LED is exposed through the LED subsystem, and can be found in:
155
156/sys/devices/platform/acer-wmi/leds/acer-wmi::mail/
157
158The mail LED is autodetected, so if you don't have one, the LED device won't
159be registered.
160
161Backlight
162*********
163
164The backlight brightness control is available on all acer-wmi supported
165hardware. The maximum brightness level is usually 15, but on some newer laptops
166it's 10 (this is again autodetected).
167
168The backlight is exposed through the backlight subsystem, and can be found in:
169
170/sys/devices/platform/acer-wmi/backlight/acer-wmi/
171
172Credits
173*******
174
175Olaf Tauber, who did the real hard work when he developed acerhk
176http://www.cakey.de/acerhk/
177All the authors of laptop ACPI modules in the kernel, whose work
178was an inspiration in the early days of acer_acpi
179Mathieu Segaud, who solved the problem with having to modprobe the driver
180twice in acer_acpi 0.2.
181Jim Ramsay, who added support for the WMID interface
182Mark Smith, who started the original acer_acpi
183
184And the many people who have used both acer_acpi and acer-wmi.
diff --git a/Documentation/laptops/asus-laptop.txt b/Documentation/laptops/asus-laptop.txt
index c1c5be84e4b1..803e51f6768b 100644
--- a/Documentation/laptops/asus-laptop.txt
+++ b/Documentation/laptops/asus-laptop.txt
@@ -61,7 +61,7 @@ Usage
61 Hotkeys are also reported as input keys (like keyboards) you can check 61 Hotkeys are also reported as input keys (like keyboards) you can check
62 which key are supported using "xev" under X11. 62 which key are supported using "xev" under X11.
63 63
64 You can get informations on the version of your DSDT table by reading the 64 You can get information on the version of your DSDT table by reading the
65 /sys/devices/platform/asus-laptop/infos entry. If you have a question or a 65 /sys/devices/platform/asus-laptop/infos entry. If you have a question or a
66 bug report to do, please include the output of this entry. 66 bug report to do, please include the output of this entry.
67 67
@@ -178,7 +178,7 @@ LED display
178----------- 178-----------
179 179
180 Some models like the W1N have a LED display that can be used to display 180 Some models like the W1N have a LED display that can be used to display
181 several informations. 181 several items of information.
182 182
183 LED display works for the following models: 183 LED display works for the following models:
184 W1000N 184 W1000N
diff --git a/Documentation/hwmon/hpfall.c b/Documentation/laptops/hpfall.c
index a4a8fc5d05d4..a4a8fc5d05d4 100644
--- a/Documentation/hwmon/hpfall.c
+++ b/Documentation/laptops/hpfall.c
diff --git a/Documentation/laptops/sony-laptop.txt b/Documentation/laptops/sony-laptop.txt
index 23ce7d350d1a..2bd4e82e5d9f 100644
--- a/Documentation/laptops/sony-laptop.txt
+++ b/Documentation/laptops/sony-laptop.txt
@@ -14,7 +14,8 @@ Some models report hotkeys through the SNC or SPIC devices, such events are
14reported both through the ACPI subsystem as acpi events and through the INPUT 14reported both through the ACPI subsystem as acpi events and through the INPUT
15subsystem. See the logs of acpid or /proc/acpi/event and 15subsystem. See the logs of acpid or /proc/acpi/event and
16/proc/bus/input/devices to find out what those events are and which input 16/proc/bus/input/devices to find out what those events are and which input
17devices are created by the driver. 17devices are created by the driver. Additionally, loading the driver with the
18debug option will report all events in the kernel log.
18 19
19Backlight control: 20Backlight control:
20------------------ 21------------------
@@ -64,6 +65,16 @@ powers off the sound card,
64 # echo "1" > /sys/devices/platform/sony-laptop/audiopower 65 # echo "1" > /sys/devices/platform/sony-laptop/audiopower
65powers on the sound card. 66powers on the sound card.
66 67
68
69RFkill control:
70---------------
71More recent Vaio models expose a consistent set of ACPI methods to
72control radio frequency emitting devices. If you are a lucky owner of
73such a laptop you will find the necessary rfkill devices under
74/sys/class/rfkill. Check those starting with sony-* in
75 # grep . /sys/class/rfkill/*/{state,name}
76
77
67Development: 78Development:
68------------ 79------------
69 80
@@ -75,8 +86,21 @@ pass the option 'debug=1'.
75REPEAT: DON'T DO THIS IF YOU DON'T LIKE RISKY BUSINESS. 86REPEAT: DON'T DO THIS IF YOU DON'T LIKE RISKY BUSINESS.
76 87
77In your kernel logs you will find the list of all ACPI methods 88In your kernel logs you will find the list of all ACPI methods
78the SNC device has on your laptop. You can see the GCDP/GCDP methods 89the SNC device has on your laptop.
79used to pwer on/off the CD drive, but there are others. 90
91* For new models you will see a long list of meaningless method names,
92reading the DSDT table source should reveal that:
93(1) the SNC device uses an internal capability lookup table
94(2) SN00 is used to find values in the lookup table
95(3) SN06 and SN07 are used to call into the real methods based on
96 offsets you can obtain iterating the table using SN00
97(4) SN02 used to enable events.
98Some values in the capability lookup table are more or less known, see
99the code for all sony_call_snc_handle calls, others are more obscure.
100
101* For old models you can see the GCDP/GCDP methods used to pwer on/off
102the CD drive, but there are others and they are usually different from
103model to model.
80 104
81I HAVE NO IDEA WHAT THOSE METHODS DO. 105I HAVE NO IDEA WHAT THOSE METHODS DO.
82 106
@@ -108,9 +132,8 @@ Bugs/Limitations:
108 laptop, including permanent damage. 132 laptop, including permanent damage.
109 133
110* The sony-laptop and sonypi drivers do not interact at all. In the 134* The sony-laptop and sonypi drivers do not interact at all. In the
111 future, sonypi could use sony-laptop to do (part of) its business. 135 future, sonypi will be removed and replaced by sony-laptop.
112 136
113* spicctrl, which is the userspace tool used to communicate with the 137* spicctrl, which is the userspace tool used to communicate with the
114 sonypi driver (through /dev/sonypi) does not try to use the 138 sonypi driver (through /dev/sonypi) is deprecated as well since all
115 sony-laptop driver. In the future, spicctrl could try sonypi first, 139 its features are now available under the sysfs tree via sony-laptop.
116 and if it isn't present, try sony-laptop instead.
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index 1565eefd6fd5..61815483efa3 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -534,6 +534,8 @@ Events that are never propagated by the driver:
5340x2404 System is waking up from hibernation to undock 5340x2404 System is waking up from hibernation to undock
5350x2405 System is waking up from hibernation to eject bay 5350x2405 System is waking up from hibernation to eject bay
5360x5010 Brightness level changed/control event 5360x5010 Brightness level changed/control event
5370x6000 KEYBOARD: Numlock key pressed
5380x6005 KEYBOARD: Fn key pressed (TO BE VERIFIED)
537 539
538Events that are propagated by the driver to userspace: 540Events that are propagated by the driver to userspace:
539 541
@@ -545,6 +547,8 @@ Events that are propagated by the driver to userspace:
5450x3006 Bay hotplug request (hint to power up SATA link when 5470x3006 Bay hotplug request (hint to power up SATA link when
546 the optical drive tray is ejected) 548 the optical drive tray is ejected)
5470x4003 Undocked (see 0x2x04), can sleep again 5490x4003 Undocked (see 0x2x04), can sleep again
5500x4010 Docked into hotplug port replicator (non-ACPI dock)
5510x4011 Undocked from hotplug port replicator (non-ACPI dock)
5480x500B Tablet pen inserted into its storage bay 5520x500B Tablet pen inserted into its storage bay
5490x500C Tablet pen removed from its storage bay 5530x500C Tablet pen removed from its storage bay
5500x6011 ALARM: battery is too hot 5540x6011 ALARM: battery is too hot
@@ -552,6 +556,7 @@ Events that are propagated by the driver to userspace:
5520x6021 ALARM: a sensor is too hot 5560x6021 ALARM: a sensor is too hot
5530x6022 ALARM: a sensor is extremely hot 5570x6022 ALARM: a sensor is extremely hot
5540x6030 System thermal table changed 5580x6030 System thermal table changed
5590x6040 Nvidia Optimus/AC adapter related (TO BE VERIFIED)
555 560
556Battery nearly empty alarms are a last resort attempt to get the 561Battery nearly empty alarms are a last resort attempt to get the
557operating system to hibernate or shutdown cleanly (0x2313), or shutdown 562operating system to hibernate or shutdown cleanly (0x2313), or shutdown
diff --git a/Documentation/leds/00-INDEX b/Documentation/leds/00-INDEX
new file mode 100644
index 000000000000..29f481df32c7
--- /dev/null
+++ b/Documentation/leds/00-INDEX
@@ -0,0 +1,8 @@
1leds-class.txt
2 - documents LED handling under Linux.
3leds-lp3944.txt
4 - notes on how to use the leds-lp3944 driver.
5leds-lp5521.txt
6 - notes on how to use the leds-lp5521 driver.
7leds-lp5523.txt
8 - notes on how to use the leds-lp5523 driver.
diff --git a/Documentation/leds-class.txt b/Documentation/leds/leds-class.txt
index 8fd5ca2ae32d..4996586e27e8 100644
--- a/Documentation/leds-class.txt
+++ b/Documentation/leds/leds-class.txt
@@ -60,15 +60,18 @@ Hardware accelerated blink of LEDs
60 60
61Some LEDs can be programmed to blink without any CPU interaction. To 61Some LEDs can be programmed to blink without any CPU interaction. To
62support this feature, a LED driver can optionally implement the 62support this feature, a LED driver can optionally implement the
63blink_set() function (see <linux/leds.h>). If implemented, triggers can 63blink_set() function (see <linux/leds.h>). To set an LED to blinking,
64attempt to use it before falling back to software timers. The blink_set() 64however, it is better to use use the API function led_blink_set(),
65function should return 0 if the blink setting is supported, or -EINVAL 65as it will check and implement software fallback if necessary.
66otherwise, which means that LED blinking will be handled by software.
67 66
68The blink_set() function should choose a user friendly blinking 67To turn off blinking again, use the API function led_brightness_set()
69value if it is called with *delay_on==0 && *delay_off==0 parameters. In 68as that will not just set the LED brightness but also stop any software
70this case the driver should give back the chosen value through delay_on 69timers that may have been required for blinking.
71and delay_off parameters to the leds subsystem. 70
71The blink_set() function should choose a user friendly blinking value
72if it is called with *delay_on==0 && *delay_off==0 parameters. In this
73case the driver should give back the chosen value through delay_on and
74delay_off parameters to the leds subsystem.
72 75
73Setting the brightness to zero with brightness_set() callback function 76Setting the brightness to zero with brightness_set() callback function
74should completely turn off the LED and cancel the previously programmed 77should completely turn off the LED and cancel the previously programmed
@@ -92,4 +95,3 @@ There are a number of cases where a trigger might only be mappable to a
92particular LED (ACPI?). The addition of triggers provided by the LED driver 95particular LED (ACPI?). The addition of triggers provided by the LED driver
93should cover this option and be possible to add without breaking the 96should cover this option and be possible to add without breaking the
94current interface. 97current interface.
95
diff --git a/Documentation/leds-lp3944.txt b/Documentation/leds/leds-lp3944.txt
index c6eda18b15ef..c6eda18b15ef 100644
--- a/Documentation/leds-lp3944.txt
+++ b/Documentation/leds/leds-lp3944.txt
diff --git a/Documentation/leds/leds-lp5521.txt b/Documentation/leds/leds-lp5521.txt
new file mode 100644
index 000000000000..c4d8d151e0fe
--- /dev/null
+++ b/Documentation/leds/leds-lp5521.txt
@@ -0,0 +1,88 @@
1Kernel driver for lp5521
2========================
3
4* National Semiconductor LP5521 led driver chip
5* Datasheet: http://www.national.com/pf/LP/LP5521.html
6
7Authors: Mathias Nyman, Yuri Zaporozhets, Samu Onkalo
8Contact: Samu Onkalo (samu.p.onkalo-at-nokia.com)
9
10Description
11-----------
12
13LP5521 can drive up to 3 channels. Leds can be controlled directly via
14the led class control interface. Channels have generic names:
15lp5521:channelx, where x is 0 .. 2
16
17All three channels can be also controlled using the engine micro programs.
18More details of the instructions can be found from the public data sheet.
19
20Control interface for the engines:
21x is 1 .. 3
22enginex_mode : disabled, load, run
23enginex_load : store program (visible only in engine load mode)
24
25Example (start to blink the channel 2 led):
26cd /sys/class/leds/lp5521:channel2/device
27echo "load" > engine3_mode
28echo "037f4d0003ff6000" > engine3_load
29echo "run" > engine3_mode
30
31stop the engine:
32echo "disabled" > engine3_mode
33
34sysfs contains a selftest entry.
35The test communicates with the chip and checks that
36the clock mode is automatically set to the requested one.
37
38Each channel has its own led current settings.
39/sys/class/leds/lp5521:channel0/led_current - RW
40/sys/class/leds/lp5521:channel0/max_current - RO
41Format: 10x mA i.e 10 means 1.0 mA
42
43example platform data:
44
45Note: chan_nr can have values between 0 and 2.
46
47static struct lp5521_led_config lp5521_led_config[] = {
48 {
49 .chan_nr = 0,
50 .led_current = 50,
51 .max_current = 130,
52 }, {
53 .chan_nr = 1,
54 .led_current = 0,
55 .max_current = 130,
56 }, {
57 .chan_nr = 2,
58 .led_current = 0,
59 .max_current = 130,
60 }
61};
62
63static int lp5521_setup(void)
64{
65 /* setup HW resources */
66}
67
68static void lp5521_release(void)
69{
70 /* Release HW resources */
71}
72
73static void lp5521_enable(bool state)
74{
75 /* Control of chip enable signal */
76}
77
78static struct lp5521_platform_data lp5521_platform_data = {
79 .led_config = lp5521_led_config,
80 .num_channels = ARRAY_SIZE(lp5521_led_config),
81 .clock_mode = LP5521_CLOCK_EXT,
82 .setup_resources = lp5521_setup,
83 .release_resources = lp5521_release,
84 .enable = lp5521_enable,
85};
86
87If the current is set to 0 in the platform data, that channel is
88disabled and it is not visible in the sysfs.
diff --git a/Documentation/leds/leds-lp5523.txt b/Documentation/leds/leds-lp5523.txt
new file mode 100644
index 000000000000..fad2feb8b7ce
--- /dev/null
+++ b/Documentation/leds/leds-lp5523.txt
@@ -0,0 +1,83 @@
1Kernel driver for lp5523
2========================
3
4* National Semiconductor LP5523 led driver chip
5* Datasheet: http://www.national.com/pf/LP/LP5523.html
6
7Authors: Mathias Nyman, Yuri Zaporozhets, Samu Onkalo
8Contact: Samu Onkalo (samu.p.onkalo-at-nokia.com)
9
10Description
11-----------
12LP5523 can drive up to 9 channels. Leds can be controlled directly via
13the led class control interface. Channels have generic names:
14lp5523:channelx where x is 0...8
15
16The chip provides 3 engines. Each engine can control channels without
17interaction from the main CPU. Details of the micro engine code can be found
18from the public data sheet. Leds can be muxed to different channels.
19
20Control interface for the engines:
21x is 1 .. 3
22enginex_mode : disabled, load, run
23enginex_load : microcode load (visible only in load mode)
24enginex_leds : led mux control (visible only in load mode)
25
26cd /sys/class/leds/lp5523:channel2/device
27echo "load" > engine3_mode
28echo "9d80400004ff05ff437f0000" > engine3_load
29echo "111111111" > engine3_leds
30echo "run" > engine3_mode
31
32sysfs contains a selftest entry. It measures each channel
33voltage level and checks if it looks reasonable. If the level is too high,
34the led is missing; if the level is too low, there is a short circuit.
35
36Selftest uses always the current from the platform data.
37
38Each channel contains led current settings.
39/sys/class/leds/lp5523:channel2/led_current - RW
40/sys/class/leds/lp5523:channel2/max_current - RO
41Format: 10x mA i.e 10 means 1.0 mA
42
43Example platform data:
44
45Note - chan_nr can have values between 0 and 8.
46
47static struct lp5523_led_config lp5523_led_config[] = {
48 {
49 .chan_nr = 0,
50 .led_current = 50,
51 .max_current = 130,
52 },
53...
54 }, {
55 .chan_nr = 8,
56 .led_current = 50,
57 .max_current = 130,
58 }
59};
60
61static int lp5523_setup(void)
62{
63 /* Setup HW resources */
64}
65
66static void lp5523_release(void)
67{
68 /* Release HW resources */
69}
70
71static void lp5523_enable(bool state)
72{
73 /* Control chip enable signal */
74}
75
76static struct lp5523_platform_data lp5523_platform_data = {
77 .led_config = lp5523_led_config,
78 .num_channels = ARRAY_SIZE(lp5523_led_config),
79 .clock_mode = LP5523_CLOCK_EXT,
80 .setup_resources = lp5523_setup,
81 .release_resources = lp5523_release,
82 .enable = lp5523_enable,
83};
diff --git a/Documentation/lockstat.txt b/Documentation/lockstat.txt
index 65f4c795015d..cef00d42ed5b 100644
--- a/Documentation/lockstat.txt
+++ b/Documentation/lockstat.txt
@@ -12,8 +12,9 @@ Because things like lock contention can severely impact performance.
12- HOW 12- HOW
13 13
14Lockdep already has hooks in the lock functions and maps lock instances to 14Lockdep already has hooks in the lock functions and maps lock instances to
15lock classes. We build on that. The graph below shows the relation between 15lock classes. We build on that (see Documentation/lockdep-design.txt).
16the lock functions and the various hooks therein. 16The graph below shows the relation between the lock functions and the various
17hooks therein.
17 18
18 __acquire 19 __acquire
19 | 20 |
@@ -128,6 +129,37 @@ points are the points we're contending with.
128 129
129The integer part of the time values is in us. 130The integer part of the time values is in us.
130 131
132Dealing with nested locks, subclasses may appear:
133
13432...............................................................................................................................................................................................
13533
13634 &rq->lock: 13128 13128 0.43 190.53 103881.26 97454 3453404 0.00 401.11 13224683.11
13735 ---------
13836 &rq->lock 645 [<ffffffff8103bfc4>] task_rq_lock+0x43/0x75
13937 &rq->lock 297 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
14038 &rq->lock 360 [<ffffffff8103c4c5>] select_task_rq_fair+0x1f0/0x74a
14139 &rq->lock 428 [<ffffffff81045f98>] scheduler_tick+0x46/0x1fb
14240 ---------
14341 &rq->lock 77 [<ffffffff8103bfc4>] task_rq_lock+0x43/0x75
14442 &rq->lock 174 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
14543 &rq->lock 4715 [<ffffffff8103ed4b>] double_rq_lock+0x42/0x54
14644 &rq->lock 893 [<ffffffff81340524>] schedule+0x157/0x7b8
14745
14846...............................................................................................................................................................................................
14947
15048 &rq->lock/1: 11526 11488 0.33 388.73 136294.31 21461 38404 0.00 37.93 109388.53
15149 -----------
15250 &rq->lock/1 11526 [<ffffffff8103ed58>] double_rq_lock+0x4f/0x54
15351 -----------
15452 &rq->lock/1 5645 [<ffffffff8103ed4b>] double_rq_lock+0x42/0x54
15553 &rq->lock/1 1224 [<ffffffff81340524>] schedule+0x157/0x7b8
15654 &rq->lock/1 4336 [<ffffffff8103ed58>] double_rq_lock+0x4f/0x54
15755 &rq->lock/1 181 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
158
159Line 48 shows statistics for the second subclass (/1) of &rq->lock class
160(subclass starts from 0), since in this case, as line 50 suggests,
161double_rq_lock actually acquires a nested lock of two spinlocks.
162
131View the top contending locks: 163View the top contending locks:
132 164
133# grep : /proc/lock_stat | head 165# grep : /proc/lock_stat | head
@@ -136,7 +168,7 @@ View the top contending locks:
136 dcache_lock: 1037 1161 0.38 45.32 774.51 6611 243371 0.15 306.48 77387.24 168 dcache_lock: 1037 1161 0.38 45.32 774.51 6611 243371 0.15 306.48 77387.24
137 &inode->i_mutex: 161 286 18446744073709 62882.54 1244614.55 3653 20598 18446744073709 62318.60 1693822.74 169 &inode->i_mutex: 161 286 18446744073709 62882.54 1244614.55 3653 20598 18446744073709 62318.60 1693822.74
138 &zone->lru_lock: 94 94 0.53 7.33 92.10 4366 32690 0.29 59.81 16350.06 170 &zone->lru_lock: 94 94 0.53 7.33 92.10 4366 32690 0.29 59.81 16350.06
139 &inode->i_data.i_mmap_lock: 79 79 0.40 3.77 53.03 11779 87755 0.28 116.93 29898.44 171 &inode->i_data.i_mmap_mutex: 79 79 0.40 3.77 53.03 11779 87755 0.28 116.93 29898.44
140 &q->__queue_lock: 48 50 0.52 31.62 86.31 774 13131 0.17 113.08 12277.52 172 &q->__queue_lock: 48 50 0.52 31.62 86.31 774 13131 0.17 113.08 12277.52
141 &rq->rq_lock_key: 43 47 0.74 68.50 170.63 3706 33929 0.22 107.99 17460.62 173 &rq->rq_lock_key: 43 47 0.74 68.50 170.63 3706 33929 0.22 107.99 17460.62
142 &rq->rq_lock_key#2: 39 46 0.75 6.68 49.03 2979 32292 0.17 125.17 17137.63 174 &rq->rq_lock_key#2: 39 46 0.75 6.68 49.03 2979 32292 0.17 125.17 17137.63
diff --git a/Documentation/magic-number.txt b/Documentation/magic-number.txt
index 505f19607542..4b12abcb2ad3 100644
--- a/Documentation/magic-number.txt
+++ b/Documentation/magic-number.txt
@@ -150,7 +150,7 @@ NBD_REPLY_MAGIC 0x96744668 nbd_reply include/linux/nbd.h
150STL_BOARDMAGIC 0xa2267f52 stlbrd include/linux/stallion.h 150STL_BOARDMAGIC 0xa2267f52 stlbrd include/linux/stallion.h
151ENI155_MAGIC 0xa54b872d midway_eprom drivers/atm/eni.h 151ENI155_MAGIC 0xa54b872d midway_eprom drivers/atm/eni.h
152SCI_MAGIC 0xbabeface gs_port drivers/char/sh-sci.h 152SCI_MAGIC 0xbabeface gs_port drivers/char/sh-sci.h
153CODA_MAGIC 0xC0DAC0DA coda_file_info include/linux/coda_fs_i.h 153CODA_MAGIC 0xC0DAC0DA coda_file_info fs/coda/coda_fs_i.h
154DPMEM_MAGIC 0xc0ffee11 gdt_pci_sram drivers/scsi/gdth.h 154DPMEM_MAGIC 0xc0ffee11 gdt_pci_sram drivers/scsi/gdth.h
155STLI_PORTMAGIC 0xe671c7a1 stliport include/linux/istallion.h 155STLI_PORTMAGIC 0xe671c7a1 stliport include/linux/istallion.h
156YAM_MAGIC 0xF10A7654 yam_port drivers/net/hamradio/yam.c 156YAM_MAGIC 0xF10A7654 yam_port drivers/net/hamradio/yam.c
diff --git a/Documentation/make/headers_install.txt b/Documentation/make/headers_install.txt
index f2481cabffcb..951eb9f1e040 100644
--- a/Documentation/make/headers_install.txt
+++ b/Documentation/make/headers_install.txt
@@ -39,8 +39,9 @@ INSTALL_HDR_PATH indicates where to install the headers. It defaults to
39The command "make headers_install_all" exports headers for all architectures 39The command "make headers_install_all" exports headers for all architectures
40simultaneously. (This is mostly of interest to distribution maintainers, 40simultaneously. (This is mostly of interest to distribution maintainers,
41who create an architecture-independent tarball from the resulting include 41who create an architecture-independent tarball from the resulting include
42directory.) Remember to provide the appropriate linux/asm directory via "mv" 42directory.) You also can use HDR_ARCH_LIST to specify list of architectures.
43or "ln -s" before building a C library with headers exported this way. 43Remember to provide the appropriate linux/asm directory via "mv" or "ln -s"
44before building a C library with headers exported this way.
44 45
45The kernel header export infrastructure is maintained by David Woodhouse 46The kernel header export infrastructure is maintained by David Woodhouse
46<dwmw2@infradead.org>. 47<dwmw2@infradead.org>.
diff --git a/Documentation/md.txt b/Documentation/md.txt
index a81c7b4790f2..f0eee83ff78a 100644
--- a/Documentation/md.txt
+++ b/Documentation/md.txt
@@ -552,6 +552,16 @@ also have
552 within the array where IO will be blocked. This is currently 552 within the array where IO will be blocked. This is currently
553 only supported for raid4/5/6. 553 only supported for raid4/5/6.
554 554
555 sync_min
556 sync_max
557 The two values, given as numbers of sectors, indicate a range
558 within the array where 'check'/'repair' will operate. Must be
559 a multiple of chunk_size. When it reaches "sync_max" it will
560 pause, rather than complete.
561 You can use 'select' or 'poll' on "sync_completed" to wait for
562 that number to reach sync_max. Then you can either increase
563 "sync_max", or can write 'idle' to "sync_action".
564
555 565
556Each active md device may also have attributes specific to the 566Each active md device may also have attributes specific to the
557personality module that manages it. 567personality module that manages it.
diff --git a/Documentation/media-framework.txt b/Documentation/media-framework.txt
new file mode 100644
index 000000000000..76a2087db205
--- /dev/null
+++ b/Documentation/media-framework.txt
@@ -0,0 +1,353 @@
1Linux kernel media framework
2============================
3
4This document describes the Linux kernel media framework, its data structures,
5functions and their usage.
6
7
8Introduction
9------------
10
11The media controller API is documented in DocBook format in
12Documentation/DocBook/v4l/media-controller.xml. This document will focus on
13the kernel-side implementation of the media framework.
14
15
16Abstract media device model
17---------------------------
18
19Discovering a device internal topology, and configuring it at runtime, is one
20of the goals of the media framework. To achieve this, hardware devices are
21modeled as an oriented graph of building blocks called entities connected
22through pads.
23
24An entity is a basic media hardware building block. It can correspond to
25a large variety of logical blocks such as physical hardware devices
26(CMOS sensor for instance), logical hardware devices (a building block
27in a System-on-Chip image processing pipeline), DMA channels or physical
28connectors.
29
30A pad is a connection endpoint through which an entity can interact with
31other entities. Data (not restricted to video) produced by an entity
32flows from the entity's output to one or more entity inputs. Pads should
33not be confused with physical pins at chip boundaries.
34
35A link is a point-to-point oriented connection between two pads, either
36on the same entity or on different entities. Data flows from a source
37pad to a sink pad.
38
39
40Media device
41------------
42
43A media device is represented by a struct media_device instance, defined in
44include/media/media-device.h. Allocation of the structure is handled by the
45media device driver, usually by embedding the media_device instance in a
46larger driver-specific structure.
47
48Drivers register media device instances by calling
49
50 media_device_register(struct media_device *mdev);
51
52The caller is responsible for initializing the media_device structure before
53registration. The following fields must be set:
54
55 - dev must point to the parent device (usually a pci_dev, usb_interface or
56 platform_device instance).
57
58 - model must be filled with the device model name as a NUL-terminated UTF-8
59 string. The device/model revision must not be stored in this field.
60
61The following fields are optional:
62
63 - serial is a unique serial number stored as a NUL-terminated ASCII string.
64 The field is big enough to store a GUID in text form. If the hardware
65 doesn't provide a unique serial number this field must be left empty.
66
67 - bus_info represents the location of the device in the system as a
68 NUL-terminated ASCII string. For PCI/PCIe devices bus_info must be set to
69 "PCI:" (or "PCIe:") followed by the value of pci_name(). For USB devices,
70 the usb_make_path() function must be used. This field is used by
71 applications to distinguish between otherwise identical devices that don't
72 provide a serial number.
73
74 - hw_revision is the hardware device revision in a driver-specific format.
75 When possible the revision should be formatted with the KERNEL_VERSION
76 macro.
77
78 - driver_version is formatted with the KERNEL_VERSION macro. The version
79 minor must be incremented when new features are added to the userspace API
80 without breaking binary compatibility. The version major must be
81 incremented when binary compatibility is broken.
82
83Upon successful registration a character device named media[0-9]+ is created.
84The device major and minor numbers are dynamic. The model name is exported as
85a sysfs attribute.
86
87Drivers unregister media device instances by calling
88
89 media_device_unregister(struct media_device *mdev);
90
91Unregistering a media device that hasn't been registered is *NOT* safe.
92
93
94Entities, pads and links
95------------------------
96
97- Entities
98
99Entities are represented by a struct media_entity instance, defined in
100include/media/media-entity.h. The structure is usually embedded into a
101higher-level structure, such as a v4l2_subdev or video_device instance,
102although drivers can allocate entities directly.
103
104Drivers initialize entities by calling
105
106 media_entity_init(struct media_entity *entity, u16 num_pads,
107 struct media_pad *pads, u16 extra_links);
108
109The media_entity name, type, flags, revision and group_id fields can be
110initialized before or after calling media_entity_init. Entities embedded in
111higher-level standard structures can have some of those fields set by the
112higher-level framework.
113
114As the number of pads is known in advance, the pads array is not allocated
115dynamically but is managed by the entity driver. Most drivers will embed the
116pads array in a driver-specific structure, avoiding dynamic allocation.
117
118Drivers must set the direction of every pad in the pads array before calling
119media_entity_init. The function will initialize the other pads fields.
120
121Unlike the number of pads, the total number of links isn't always known in
122advance by the entity driver. As an initial estimate, media_entity_init
123pre-allocates a number of links equal to the number of pads plus an optional
124number of extra links. The links array will be reallocated if it grows beyond
125the initial estimate.
126
127Drivers register entities with a media device by calling
128
129 media_device_register_entity(struct media_device *mdev,
130 struct media_entity *entity);
131
132Entities are identified by a unique positive integer ID. Drivers can provide an
133ID by filling the media_entity id field prior to registration, or request the
134media controller framework to assign an ID automatically. Drivers that provide
135IDs manually must ensure that all IDs are unique. IDs are not guaranteed to be
136contiguous even when they are all assigned automatically by the framework.
137
138Drivers unregister entities by calling
139
140 media_device_unregister_entity(struct media_entity *entity);
141
142Unregistering an entity will not change the IDs of the other entities, and the
143ID will never be reused for a newly registered entity.
144
145When a media device is unregistered, all its entities are unregistered
146automatically. No manual entities unregistration is then required.
147
148Drivers free resources associated with an entity by calling
149
150 media_entity_cleanup(struct media_entity *entity);
151
152This function must be called during the cleanup phase after unregistering the
153entity. Note that the media_entity instance itself must be freed explicitly by
154the driver if required.
155
156Entities have flags that describe the entity capabilities and state.
157
158 MEDIA_ENT_FL_DEFAULT indicates the default entity for a given type.
159 This can be used to report the default audio and video devices or the
160 default camera sensor.
161
162Logical entity groups can be defined by setting the group ID of all member
163entities to the same non-zero value. An entity group serves no purpose in the
164kernel, but is reported to userspace during entities enumeration. The group_id
165field belongs to the media device driver and must not by touched by entity
166drivers.
167
168Media device drivers should define groups if several entities are logically
169bound together. Example usages include reporting
170
171 - ALSA, VBI and video nodes that carry the same media stream
172 - lens and flash controllers associated with a sensor
173
174- Pads
175
176Pads are represented by a struct media_pad instance, defined in
177include/media/media-entity.h. Each entity stores its pads in a pads array
178managed by the entity driver. Drivers usually embed the array in a
179driver-specific structure.
180
181Pads are identified by their entity and their 0-based index in the pads array.
182Both information are stored in the media_pad structure, making the media_pad
183pointer the canonical way to store and pass link references.
184
185Pads have flags that describe the pad capabilities and state.
186
187 MEDIA_PAD_FL_SINK indicates that the pad supports sinking data.
188 MEDIA_PAD_FL_SOURCE indicates that the pad supports sourcing data.
189
190One and only one of MEDIA_PAD_FL_SINK and MEDIA_PAD_FL_SOURCE must be set for
191each pad.
192
193- Links
194
195Links are represented by a struct media_link instance, defined in
196include/media/media-entity.h. Each entity stores all links originating at or
197targeting any of its pads in a links array. A given link is thus stored
198twice, once in the source entity and once in the target entity. The array is
199pre-allocated and grows dynamically as needed.
200
201Drivers create links by calling
202
203 media_entity_create_link(struct media_entity *source, u16 source_pad,
204 struct media_entity *sink, u16 sink_pad,
205 u32 flags);
206
207An entry in the link array of each entity is allocated and stores pointers
208to source and sink pads.
209
210Links have flags that describe the link capabilities and state.
211
212 MEDIA_LNK_FL_ENABLED indicates that the link is enabled and can be used
213 to transfer media data. When two or more links target a sink pad, only
214 one of them can be enabled at a time.
215 MEDIA_LNK_FL_IMMUTABLE indicates that the link enabled state can't be
216 modified at runtime. If MEDIA_LNK_FL_IMMUTABLE is set, then
217 MEDIA_LNK_FL_ENABLED must also be set since an immutable link is always
218 enabled.
219
220
221Graph traversal
222---------------
223
224The media framework provides APIs to iterate over entities in a graph.
225
226To iterate over all entities belonging to a media device, drivers can use the
227media_device_for_each_entity macro, defined in include/media/media-device.h.
228
229 struct media_entity *entity;
230
231 media_device_for_each_entity(entity, mdev) {
232 /* entity will point to each entity in turn */
233 ...
234 }
235
236Drivers might also need to iterate over all entities in a graph that can be
237reached only through enabled links starting at a given entity. The media
238framework provides a depth-first graph traversal API for that purpose.
239
240Note that graphs with cycles (whether directed or undirected) are *NOT*
241supported by the graph traversal API. To prevent infinite loops, the graph
242traversal code limits the maximum depth to MEDIA_ENTITY_ENUM_MAX_DEPTH,
243currently defined as 16.
244
245Drivers initiate a graph traversal by calling
246
247 media_entity_graph_walk_start(struct media_entity_graph *graph,
248 struct media_entity *entity);
249
250The graph structure, provided by the caller, is initialized to start graph
251traversal at the given entity.
252
253Drivers can then retrieve the next entity by calling
254
255 media_entity_graph_walk_next(struct media_entity_graph *graph);
256
257When the graph traversal is complete the function will return NULL.
258
259Graph traversal can be interrupted at any moment. No cleanup function call is
260required and the graph structure can be freed normally.
261
262Helper functions can be used to find a link between two given pads, or a pad
263connected to another pad through an enabled link
264
265 media_entity_find_link(struct media_pad *source,
266 struct media_pad *sink);
267
268 media_entity_remote_source(struct media_pad *pad);
269
270Refer to the kerneldoc documentation for more information.
271
272
273Use count and power handling
274----------------------------
275
276Due to the wide differences between drivers regarding power management needs,
277the media controller does not implement power management. However, the
278media_entity structure includes a use_count field that media drivers can use to
279track the number of users of every entity for power management needs.
280
281The use_count field is owned by media drivers and must not be touched by entity
282drivers. Access to the field must be protected by the media device graph_mutex
283lock.
284
285
286Links setup
287-----------
288
289Link properties can be modified at runtime by calling
290
291 media_entity_setup_link(struct media_link *link, u32 flags);
292
293The flags argument contains the requested new link flags.
294
295The only configurable property is the ENABLED link flag to enable/disable a
296link. Links marked with the IMMUTABLE link flag can not be enabled or disabled.
297
298When a link is enabled or disabled, the media framework calls the
299link_setup operation for the two entities at the source and sink of the link,
300in that order. If the second link_setup call fails, another link_setup call is
301made on the first entity to restore the original link flags.
302
303Media device drivers can be notified of link setup operations by setting the
304media_device::link_notify pointer to a callback function. If provided, the
305notification callback will be called before enabling and after disabling
306links.
307
308Entity drivers must implement the link_setup operation if any of their links
309is non-immutable. The operation must either configure the hardware or store
310the configuration information to be applied later.
311
312Link configuration must not have any side effect on other links. If an enabled
313link at a sink pad prevents another link at the same pad from being disabled,
314the link_setup operation must return -EBUSY and can't implicitly disable the
315first enabled link.
316
317
318Pipelines and media streams
319---------------------------
320
321When starting streaming, drivers must notify all entities in the pipeline to
322prevent link states from being modified during streaming by calling
323
324 media_entity_pipeline_start(struct media_entity *entity,
325 struct media_pipeline *pipe);
326
327The function will mark all entities connected to the given entity through
328enabled links, either directly or indirectly, as streaming.
329
330The media_pipeline instance pointed to by the pipe argument will be stored in
331every entity in the pipeline. Drivers should embed the media_pipeline structure
332in higher-level pipeline structures and can then access the pipeline through
333the media_entity pipe field.
334
335Calls to media_entity_pipeline_start() can be nested. The pipeline pointer must
336be identical for all nested calls to the function.
337
338When stopping the stream, drivers must notify the entities with
339
340 media_entity_pipeline_stop(struct media_entity *entity);
341
342If multiple calls to media_entity_pipeline_start() have been made the same
343number of media_entity_pipeline_stop() calls are required to stop streaming. The
344media_entity pipe field is reset to NULL on the last nested stop call.
345
346Link configuration will fail with -EBUSY by default if either end of the link is
347a streaming entity. Links that can be modified while streaming must be marked
348with the MEDIA_LNK_FL_DYNAMIC flag.
349
350If other operations need to be disallowed on streaming entities (such as
351changing entities configuration parameters) drivers can explicitly check the
352media_entity stream_count field to find out if an entity is streaming. This
353operation must be done with the media_device graph_mutex held.
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index 631ad2f1b229..f0d3a8026a56 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -21,6 +21,7 @@ Contents:
21 - SMP barrier pairing. 21 - SMP barrier pairing.
22 - Examples of memory barrier sequences. 22 - Examples of memory barrier sequences.
23 - Read memory barriers vs load speculation. 23 - Read memory barriers vs load speculation.
24 - Transitivity
24 25
25 (*) Explicit kernel barriers. 26 (*) Explicit kernel barriers.
26 27
@@ -959,6 +960,63 @@ the speculation will be cancelled and the value reloaded:
959 retrieved : : +-------+ 960 retrieved : : +-------+
960 961
961 962
963TRANSITIVITY
964------------
965
966Transitivity is a deeply intuitive notion about ordering that is not
967always provided by real computer systems. The following example
968demonstrates transitivity (also called "cumulativity"):
969
970 CPU 1 CPU 2 CPU 3
971 ======================= ======================= =======================
972 { X = 0, Y = 0 }
973 STORE X=1 LOAD X STORE Y=1
974 <general barrier> <general barrier>
975 LOAD Y LOAD X
976
977Suppose that CPU 2's load from X returns 1 and its load from Y returns 0.
978This indicates that CPU 2's load from X in some sense follows CPU 1's
979store to X and that CPU 2's load from Y in some sense preceded CPU 3's
980store to Y. The question is then "Can CPU 3's load from X return 0?"
981
982Because CPU 2's load from X in some sense came after CPU 1's store, it
983is natural to expect that CPU 3's load from X must therefore return 1.
984This expectation is an example of transitivity: if a load executing on
985CPU A follows a load from the same variable executing on CPU B, then
986CPU A's load must either return the same value that CPU B's load did,
987or must return some later value.
988
989In the Linux kernel, use of general memory barriers guarantees
990transitivity. Therefore, in the above example, if CPU 2's load from X
991returns 1 and its load from Y returns 0, then CPU 3's load from X must
992also return 1.
993
994However, transitivity is -not- guaranteed for read or write barriers.
995For example, suppose that CPU 2's general barrier in the above example
996is changed to a read barrier as shown below:
997
998 CPU 1 CPU 2 CPU 3
999 ======================= ======================= =======================
1000 { X = 0, Y = 0 }
1001 STORE X=1 LOAD X STORE Y=1
1002 <read barrier> <general barrier>
1003 LOAD Y LOAD X
1004
1005This substitution destroys transitivity: in this example, it is perfectly
1006legal for CPU 2's load from X to return 1, its load from Y to return 0,
1007and CPU 3's load from X to return 0.
1008
1009The key point is that although CPU 2's read barrier orders its pair
1010of loads, it does not guarantee to order CPU 1's store. Therefore, if
1011this example runs on a system where CPUs 1 and 2 share a store buffer
1012or a level of cache, CPU 2 might have early access to CPU 1's writes.
1013General barriers are therefore required to ensure that all CPUs agree
1014on the combined order of CPU 1's and CPU 2's accesses.
1015
1016To reiterate, if your code requires transitivity, use general barriers
1017throughout.
1018
1019
962======================== 1020========================
963EXPLICIT KERNEL BARRIERS 1021EXPLICIT KERNEL BARRIERS
964======================== 1022========================
diff --git a/Documentation/memory-hotplug.txt b/Documentation/memory-hotplug.txt
index 57e7e9cc1870..8f485d72cf25 100644
--- a/Documentation/memory-hotplug.txt
+++ b/Documentation/memory-hotplug.txt
@@ -126,36 +126,51 @@ config options.
126-------------------------------- 126--------------------------------
1274 sysfs files for memory hotplug 1274 sysfs files for memory hotplug
128-------------------------------- 128--------------------------------
129All sections have their device information under /sys/devices/system/memory as 129All sections have their device information in sysfs. Each section is part of
130a memory block under /sys/devices/system/memory as
130 131
131/sys/devices/system/memory/memoryXXX 132/sys/devices/system/memory/memoryXXX
132(XXX is section id.) 133(XXX is the section id.)
133 134
134Now, XXX is defined as start_address_of_section / section_size. 135Now, XXX is defined as (start_address_of_section / section_size) of the first
136section contained in the memory block. The files 'phys_index' and
137'end_phys_index' under each directory report the beginning and end section id's
138for the memory block covered by the sysfs directory. It is expected that all
139memory sections in this range are present and no memory holes exist in the
140range. Currently there is no way to determine if there is a memory hole, but
141the existence of one should not affect the hotplug capabilities of the memory
142block.
135 143
136For example, assume 1GiB section size. A device for a memory starting at 144For example, assume 1GiB section size. A device for a memory starting at
1370x100000000 is /sys/device/system/memory/memory4 1450x100000000 is /sys/device/system/memory/memory4
138(0x100000000 / 1Gib = 4) 146(0x100000000 / 1Gib = 4)
139This device covers address range [0x100000000 ... 0x140000000) 147This device covers address range [0x100000000 ... 0x140000000)
140 148
141Under each section, you can see 4 files. 149Under each section, you can see 4 or 5 files, the end_phys_index file being
150a recent addition and not present on older kernels.
142 151
143/sys/devices/system/memory/memoryXXX/phys_index 152/sys/devices/system/memory/memoryXXX/start_phys_index
153/sys/devices/system/memory/memoryXXX/end_phys_index
144/sys/devices/system/memory/memoryXXX/phys_device 154/sys/devices/system/memory/memoryXXX/phys_device
145/sys/devices/system/memory/memoryXXX/state 155/sys/devices/system/memory/memoryXXX/state
146/sys/devices/system/memory/memoryXXX/removable 156/sys/devices/system/memory/memoryXXX/removable
147 157
148'phys_index' : read-only and contains section id, same as XXX. 158'phys_index' : read-only and contains section id of the first section
149'state' : read-write 159 in the memory block, same as XXX.
150 at read: contains online/offline state of memory. 160'end_phys_index' : read-only and contains section id of the last section
151 at write: user can specify "online", "offline" command 161 in the memory block.
152'phys_device': read-only: designed to show the name of physical memory device. 162'state' : read-write
153 This is not well implemented now. 163 at read: contains online/offline state of memory.
154'removable' : read-only: contains an integer value indicating 164 at write: user can specify "online", "offline" command
155 whether the memory section is removable or not 165 which will be performed on al sections in the block.
156 removable. A value of 1 indicates that the memory 166'phys_device' : read-only: designed to show the name of physical memory
157 section is removable and a value of 0 indicates that 167 device. This is not well implemented now.
158 it is not removable. 168'removable' : read-only: contains an integer value indicating
169 whether the memory block is removable or not
170 removable. A value of 1 indicates that the memory
171 block is removable and a value of 0 indicates that
172 it is not removable. A memory block is removable only if
173 every section in the block is removable.
159 174
160NOTE: 175NOTE:
161 These directories/files appear after physical memory hotplug phase. 176 These directories/files appear after physical memory hotplug phase.
diff --git a/Documentation/mips/AU1xxx_IDE.README b/Documentation/mips/AU1xxx_IDE.README
index 8ace35ebdcd5..cc887ecfd6eb 100644
--- a/Documentation/mips/AU1xxx_IDE.README
+++ b/Documentation/mips/AU1xxx_IDE.README
@@ -39,13 +39,13 @@ Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE
39 Interface and Linux Device Driver" Application Note. 39 Interface and Linux Device Driver" Application Note.
40 40
41 41
42FILES, CONFIGS AND COMPATABILITY 42FILES, CONFIGS AND COMPATIBILITY
43-------------------------------- 43--------------------------------
44 44
45Two files are introduced: 45Two files are introduced:
46 46
47 a) 'arch/mips/include/asm/mach-au1x00/au1xxx_ide.h' 47 a) 'arch/mips/include/asm/mach-au1x00/au1xxx_ide.h'
48 containes : struct _auide_hwif 48 contains : struct _auide_hwif
49 timing parameters for PIO mode 0/1/2/3/4 49 timing parameters for PIO mode 0/1/2/3/4
50 timing parameters for MWDMA 0/1/2 50 timing parameters for MWDMA 0/1/2
51 51
diff --git a/Documentation/misc-devices/apds990x.txt b/Documentation/misc-devices/apds990x.txt
new file mode 100644
index 000000000000..d5408cade32f
--- /dev/null
+++ b/Documentation/misc-devices/apds990x.txt
@@ -0,0 +1,111 @@
1Kernel driver apds990x
2======================
3
4Supported chips:
5Avago APDS990X
6
7Data sheet:
8Not freely available
9
10Author:
11Samu Onkalo <samu.p.onkalo@nokia.com>
12
13Description
14-----------
15
16APDS990x is a combined ambient light and proximity sensor. ALS and proximity
17functionality are highly connected. ALS measurement path must be running
18while the proximity functionality is enabled.
19
20ALS produces raw measurement values for two channels: Clear channel
21(infrared + visible light) and IR only. However, threshold comparisons happen
22using clear channel only. Lux value and the threshold level on the HW
23might vary quite much depending the spectrum of the light source.
24
25Driver makes necessary conversions to both directions so that user handles
26only lux values. Lux value is calculated using information from the both
27channels. HW threshold level is calculated from the given lux value to match
28with current type of the lightning. Sometimes inaccuracy of the estimations
29lead to false interrupt, but that doesn't harm.
30
31ALS contains 4 different gain steps. Driver automatically
32selects suitable gain step. After each measurement, reliability of the results
33is estimated and new measurement is trigged if necessary.
34
35Platform data can provide tuned values to the conversion formulas if
36values are known. Otherwise plain sensor default values are used.
37
38Proximity side is little bit simpler. There is no need for complex conversions.
39It produces directly usable values.
40
41Driver controls chip operational state using pm_runtime framework.
42Voltage regulators are controlled based on chip operational state.
43
44SYSFS
45-----
46
47
48chip_id
49 RO - shows detected chip type and version
50
51power_state
52 RW - enable / disable chip. Uses counting logic
53 1 enables the chip
54 0 disables the chip
55lux0_input
56 RO - measured lux value
57 sysfs_notify called when threshold interrupt occurs
58
59lux0_sensor_range
60 RO - lux0_input max value. Actually never reaches since sensor tends
61 to saturate much before that. Real max value varies depending
62 on the light spectrum etc.
63
64lux0_rate
65 RW - measurement rate in Hz
66
67lux0_rate_avail
68 RO - supported measurement rates
69
70lux0_calibscale
71 RW - calibration value. Set to neutral value by default.
72 Output results are multiplied with calibscale / calibscale_default
73 value.
74
75lux0_calibscale_default
76 RO - neutral calibration value
77
78lux0_thresh_above_value
79 RW - HI level threshold value. All results above the value
80 trigs an interrupt. 65535 (i.e. sensor_range) disables the above
81 interrupt.
82
83lux0_thresh_below_value
84 RW - LO level threshold value. All results below the value
85 trigs an interrupt. 0 disables the below interrupt.
86
87prox0_raw
88 RO - measured proximity value
89 sysfs_notify called when threshold interrupt occurs
90
91prox0_sensor_range
92 RO - prox0_raw max value (1023)
93
94prox0_raw_en
95 RW - enable / disable proximity - uses counting logic
96 1 enables the proximity
97 0 disables the proximity
98
99prox0_reporting_mode
100 RW - trigger / periodic. In "trigger" mode the driver tells two possible
101 values: 0 or prox0_sensor_range value. 0 means no proximity,
102 1023 means proximity. This causes minimal number of interrupts.
103 In "periodic" mode the driver reports all values above
104 prox0_thresh_above. This causes more interrupts, but it can give
105 _rough_ estimate about the distance.
106
107prox0_reporting_mode_avail
108 RO - accepted values to prox0_reporting_mode (trigger, periodic)
109
110prox0_thresh_above_value
111 RW - threshold level which trigs proximity events.
diff --git a/Documentation/misc-devices/bh1770glc.txt b/Documentation/misc-devices/bh1770glc.txt
new file mode 100644
index 000000000000..7d64c014dc70
--- /dev/null
+++ b/Documentation/misc-devices/bh1770glc.txt
@@ -0,0 +1,116 @@
1Kernel driver bh1770glc
2=======================
3
4Supported chips:
5ROHM BH1770GLC
6OSRAM SFH7770
7
8Data sheet:
9Not freely available
10
11Author:
12Samu Onkalo <samu.p.onkalo@nokia.com>
13
14Description
15-----------
16BH1770GLC and SFH7770 are combined ambient light and proximity sensors.
17ALS and proximity parts operates on their own, but they shares common I2C
18interface and interrupt logic. In principle they can run on their own,
19but ALS side results are used to estimate reliability of the proximity sensor.
20
21ALS produces 16 bit lux values. The chip contains interrupt logic to produce
22low and high threshold interrupts.
23
24Proximity part contains IR-led driver up to 3 IR leds. The chip measures
25amount of reflected IR light and produces proximity result. Resolution is
268 bit. Driver supports only one channel. Driver uses ALS results to estimate
27reliability of the proximity results. Thus ALS is always running while
28proximity detection is needed.
29
30Driver uses threshold interrupts to avoid need for polling the values.
31Proximity low interrupt doesn't exists in the chip. This is simulated
32by using a delayed work. As long as there is proximity threshold above
33interrupts the delayed work is pushed forward. So, when proximity level goes
34below the threshold value, there is no interrupt and the delayed work will
35finally run. This is handled as no proximity indication.
36
37Chip state is controlled via runtime pm framework when enabled in config.
38
39Calibscale factor is used to hide differences between the chips. By default
40value set to neutral state meaning factor of 1.00. To get proper values,
41calibrated source of light is needed as a reference. Calibscale factor is set
42so that measurement produces about the expected lux value.
43
44SYSFS
45-----
46
47chip_id
48 RO - shows detected chip type and version
49
50power_state
51 RW - enable / disable chip. Uses counting logic
52 1 enables the chip
53 0 disables the chip
54
55lux0_input
56 RO - measured lux value
57 sysfs_notify called when threshold interrupt occurs
58
59lux0_sensor_range
60 RO - lux0_input max value
61
62lux0_rate
63 RW - measurement rate in Hz
64
65lux0_rate_avail
66 RO - supported measurement rates
67
68lux0_thresh_above_value
69 RW - HI level threshold value. All results above the value
70 trigs an interrupt. 65535 (i.e. sensor_range) disables the above
71 interrupt.
72
73lux0_thresh_below_value
74 RW - LO level threshold value. All results below the value
75 trigs an interrupt. 0 disables the below interrupt.
76
77lux0_calibscale
78 RW - calibration value. Set to neutral value by default.
79 Output results are multiplied with calibscale / calibscale_default
80 value.
81
82lux0_calibscale_default
83 RO - neutral calibration value
84
85prox0_raw
86 RO - measured proximity value
87 sysfs_notify called when threshold interrupt occurs
88
89prox0_sensor_range
90 RO - prox0_raw max value
91
92prox0_raw_en
93 RW - enable / disable proximity - uses counting logic
94 1 enables the proximity
95 0 disables the proximity
96
97prox0_thresh_above_count
98 RW - number of proximity interrupts needed before triggering the event
99
100prox0_rate_above
101 RW - Measurement rate (in Hz) when the level is above threshold
102 i.e. when proximity on has been reported.
103
104prox0_rate_below
105 RW - Measurement rate (in Hz) when the level is below threshold
106 i.e. when proximity off has been reported.
107
108prox0_rate_avail
109 RO - Supported proximity measurement rates in Hz
110
111prox0_thresh_above0_value
112 RW - threshold level which trigs proximity events.
113 Filtered by persistence filter (prox0_thresh_above_count)
114
115prox0_thresh_above1_value
116 RW - threshold level which trigs event immediately
diff --git a/Documentation/misc-devices/ics932s401 b/Documentation/misc-devices/ics932s401
index 07a739f406d8..bdac67ff6e3f 100644
--- a/Documentation/misc-devices/ics932s401
+++ b/Documentation/misc-devices/ics932s401
@@ -5,7 +5,7 @@ Supported chips:
5 * IDT ICS932S401 5 * IDT ICS932S401
6 Prefix: 'ics932s401' 6 Prefix: 'ics932s401'
7 Addresses scanned: I2C 0x69 7 Addresses scanned: I2C 0x69
8 Datasheet: Publically available at the IDT website 8 Datasheet: Publicly available at the IDT website
9 9
10Author: Darrick J. Wong 10Author: Darrick J. Wong
11 11
diff --git a/Documentation/hwmon/lis3lv02d b/Documentation/misc-devices/lis3lv02d
index 06534f25e643..f1a4ec840f86 100644
--- a/Documentation/hwmon/lis3lv02d
+++ b/Documentation/misc-devices/lis3lv02d
@@ -17,8 +17,8 @@ Description
17This driver provides support for the accelerometer found in various HP laptops 17This driver provides support for the accelerometer found in various HP laptops
18sporting the feature officially called "HP Mobile Data Protection System 3D" or 18sporting the feature officially called "HP Mobile Data Protection System 3D" or
19"HP 3D DriveGuard". It detects automatically laptops with this sensor. Known 19"HP 3D DriveGuard". It detects automatically laptops with this sensor. Known
20models (full list can be found in drivers/hwmon/hp_accel.c) will have their 20models (full list can be found in drivers/platform/x86/hp_accel.c) will have
21axis automatically oriented on standard way (eg: you can directly play 21their axis automatically oriented on standard way (eg: you can directly play
22neverball). The accelerometer data is readable via 22neverball). The accelerometer data is readable via
23/sys/devices/platform/lis3lv02d. Reported values are scaled 23/sys/devices/platform/lis3lv02d. Reported values are scaled
24to mg values (1/1000th of earth gravity). 24to mg values (1/1000th of earth gravity).
diff --git a/Documentation/misc-devices/spear-pcie-gadget.txt b/Documentation/misc-devices/spear-pcie-gadget.txt
new file mode 100644
index 000000000000..02c13ef5e908
--- /dev/null
+++ b/Documentation/misc-devices/spear-pcie-gadget.txt
@@ -0,0 +1,130 @@
1Spear PCIe Gadget Driver:
2
3Author
4=============
5Pratyush Anand (pratyush.anand@st.com)
6
7Location
8============
9driver/misc/spear13xx_pcie_gadget.c
10
11Supported Chip:
12===================
13SPEAr1300
14SPEAr1310
15
16Menuconfig option:
17==========================
18Device Drivers
19 Misc devices
20 PCIe gadget support for SPEAr13XX platform
21purpose
22===========
23This driver has several nodes which can be read/written by configfs interface.
24Its main purpose is to configure selected dual mode PCIe controller as device
25and then program its various registers to configure it as a particular device
26type. This driver can be used to show spear's PCIe device capability.
27
28Description of different nodes:
29=================================
30
31read behavior of nodes:
32------------------------------
33link :gives ltssm status.
34int_type :type of supported interrupt
35no_of_msi :zero if MSI is not enabled by host. A positive value is the
36 number of MSI vector granted.
37vendor_id :returns programmed vendor id (hex)
38device_id :returns programmed device id(hex)
39bar0_size: :returns size of bar0 in hex.
40bar0_address :returns address of bar0 mapped area in hex.
41bar0_rw_offset :returns offset of bar0 for which bar0_data will return value.
42bar0_data :returns data at bar0_rw_offset.
43
44write behavior of nodes:
45------------------------------
46link :write UP to enable ltsmm DOWN to disable
47int_type :write interrupt type to be configured and (int_type could be
48 INTA, MSI or NO_INT). Select MSI only when you have programmed
49 no_of_msi node.
50no_of_msi :number of MSI vector needed.
51inta :write 1 to assert INTA and 0 to de-assert.
52send_msi :write MSI vector to be sent.
53vendor_id :write vendor id(hex) to be programmed.
54device_id :write device id(hex) to be programmed.
55bar0_size :write size of bar0 in hex. default bar0 size is 1000 (hex)
56 bytes.
57bar0_address :write address of bar0 mapped area in hex. (default mapping of
58 bar0 is SYSRAM1(E0800000). Always program bar size before bar
59 address. Kernel might modify bar size and address for alignment, so
60 read back bar size and address after writing to cross check.
61bar0_rw_offset :write offset of bar0 for which bar0_data will write value.
62bar0_data :write data to be written at bar0_rw_offset.
63
64Node programming example
65===========================
66Program all PCIe registers in such a way that when this device is connected
67to the PCIe host, then host sees this device as 1MB RAM.
68#mount -t configfs none /Config
69For nth PCIe Device Controller
70# cd /config/pcie_gadget.n/
71Now you have all the nodes in this directory.
72program vendor id as 0x104a
73# echo 104A >> vendor_id
74
75program device id as 0xCD80
76# echo CD80 >> device_id
77
78program BAR0 size as 1MB
79# echo 100000 >> bar0_size
80
81check for programmed bar0 size
82# cat bar0_size
83
84Program BAR0 Address as DDR (0x2100000). This is the physical address of
85memory, which is to be made visible to PCIe host. Similarly any other peripheral
86can also be made visible to PCIe host. E.g., if you program base address of UART
87as BAR0 address then when this device will be connected to a host, it will be
88visible as UART.
89# echo 2100000 >> bar0_address
90
91program interrupt type : INTA
92# echo INTA >> int_type
93
94go for link up now.
95# echo UP >> link
96
97It will have to be insured that, once link up is done on gadget, then only host
98is initialized and start to search PCIe devices on its port.
99
100/*wait till link is up*/
101# cat link
102wait till it returns UP.
103
104To assert INTA
105# echo 1 >> inta
106
107To de-assert INTA
108# echo 0 >> inta
109
110if MSI is to be used as interrupt, program no of msi vector needed (say4)
111# echo 4 >> no_of_msi
112
113select MSI as interrupt type
114# echo MSI >> int_type
115
116go for link up now
117# echo UP >> link
118
119wait till link is up
120# cat link
121An application can repetitively read this node till link is found UP. It can
122sleep between two read.
123
124wait till msi is enabled
125# cat no_of_msi
126Should return 4 (number of requested MSI vector)
127
128to send msi vector 2
129# echo 2 >> send_msi
130#cd -
diff --git a/Documentation/mmc/00-INDEX b/Documentation/mmc/00-INDEX
index fca586f5b853..93dd7a714075 100644
--- a/Documentation/mmc/00-INDEX
+++ b/Documentation/mmc/00-INDEX
@@ -2,3 +2,5 @@
2 - this file 2 - this file
3mmc-dev-attrs.txt 3mmc-dev-attrs.txt
4 - info on SD and MMC device attributes 4 - info on SD and MMC device attributes
5mmc-dev-parts.txt
6 - info on SD and MMC device partitions
diff --git a/Documentation/mmc/mmc-dev-attrs.txt b/Documentation/mmc/mmc-dev-attrs.txt
index ff2bd685bced..8898a95b41e5 100644
--- a/Documentation/mmc/mmc-dev-attrs.txt
+++ b/Documentation/mmc/mmc-dev-attrs.txt
@@ -1,3 +1,13 @@
1SD and MMC Block Device Attributes
2==================================
3
4These attributes are defined for the block devices associated with the
5SD or MMC device.
6
7The following attributes are read/write.
8
9 force_ro Enforce read-only access even if write protect switch is off.
10
1SD and MMC Device Attributes 11SD and MMC Device Attributes
2============================ 12============================
3 13
diff --git a/Documentation/mmc/mmc-dev-parts.txt b/Documentation/mmc/mmc-dev-parts.txt
new file mode 100644
index 000000000000..2db28b8e662f
--- /dev/null
+++ b/Documentation/mmc/mmc-dev-parts.txt
@@ -0,0 +1,27 @@
1SD and MMC Device Partitions
2============================
3
4Device partitions are additional logical block devices present on the
5SD/MMC device.
6
7As of this writing, MMC boot partitions as supported and exposed as
8/dev/mmcblkXboot0 and /dev/mmcblkXboot1, where X is the index of the
9parent /dev/mmcblkX.
10
11MMC Boot Partitions
12===================
13
14Read and write access is provided to the two MMC boot partitions. Due to
15the sensitive nature of the boot partition contents, which often store
16a bootloader or bootloader configuration tables crucial to booting the
17platform, write access is disabled by default to reduce the chance of
18accidental bricking.
19
20To enable write access to /dev/mmcblkXbootY, disable the forced read-only
21access with:
22
23echo 0 > /sys/block/mmcblkXbootY/force_ro
24
25To re-enable read-only access:
26
27echo 1 > /sys/block/mmcblkXbootY/force_ro
diff --git a/Documentation/networking/00-INDEX b/Documentation/networking/00-INDEX
index fe5c099b8fc8..4edd78dfb362 100644
--- a/Documentation/networking/00-INDEX
+++ b/Documentation/networking/00-INDEX
@@ -40,8 +40,6 @@ decnet.txt
40 - info on using the DECnet networking layer in Linux. 40 - info on using the DECnet networking layer in Linux.
41depca.txt 41depca.txt
42 - the Digital DEPCA/EtherWORKS DE1?? and DE2?? LANCE Ethernet driver 42 - the Digital DEPCA/EtherWORKS DE1?? and DE2?? LANCE Ethernet driver
43dgrs.txt
44 - the Digi International RightSwitch SE-X Ethernet driver
45dmfe.txt 43dmfe.txt
46 - info on the Davicom DM9102(A)/DM9132/DM9801 fast ethernet driver. 44 - info on the Davicom DM9102(A)/DM9132/DM9801 fast ethernet driver.
47e100.txt 45e100.txt
@@ -50,8 +48,6 @@ e1000.txt
50 - info on Intel's E1000 line of gigabit ethernet boards 48 - info on Intel's E1000 line of gigabit ethernet boards
51eql.txt 49eql.txt
52 - serial IP load balancing 50 - serial IP load balancing
53ethertap.txt
54 - the Ethertap user space packet reception and transmission driver
55ewrk3.txt 51ewrk3.txt
56 - the Digital EtherWORKS 3 DE203/4/5 Ethernet driver 52 - the Digital EtherWORKS 3 DE203/4/5 Ethernet driver
57filter.txt 53filter.txt
@@ -104,8 +100,6 @@ tuntap.txt
104 - TUN/TAP device driver, allowing user space Rx/Tx of packets. 100 - TUN/TAP device driver, allowing user space Rx/Tx of packets.
105vortex.txt 101vortex.txt
106 - info on using 3Com Vortex (3c590, 3c592, 3c595, 3c597) Ethernet cards. 102 - info on using 3Com Vortex (3c590, 3c592, 3c595, 3c597) Ethernet cards.
107wavelan.txt
108 - AT&T GIS (nee NCR) WaveLAN card: An Ethernet-like radio transceiver
109x25.txt 103x25.txt
110 - general info on X.25 development. 104 - general info on X.25 development.
111x25-iface.txt 105x25-iface.txt
diff --git a/Documentation/networking/3c359.txt b/Documentation/networking/3c359.txt
index 4af8071a6d18..dadfe8147ab8 100644
--- a/Documentation/networking/3c359.txt
+++ b/Documentation/networking/3c359.txt
@@ -45,7 +45,7 @@ debugging messages on, that must be done by modified the source code.
45 45
46Variable MTU size: 46Variable MTU size:
47 47
48The driver can handle a MTU size upto either 4500 or 18000 depending upon 48The driver can handle a MTU size up to either 4500 or 18000 depending upon
49ring speed. The driver also changes the size of the receive buffers as part 49ring speed. The driver also changes the size of the receive buffers as part
50of the mtu re-sizing, so if you set mtu = 18000, you will need to be able 50of the mtu re-sizing, so if you set mtu = 18000, you will need to be able
51to allocate 16 * (sk_buff with 18000 buffer size) call it 18500 bytes per ring 51to allocate 16 * (sk_buff with 18000 buffer size) call it 18500 bytes per ring
diff --git a/Documentation/networking/LICENSE.qlcnic b/Documentation/networking/LICENSE.qlcnic
new file mode 100644
index 000000000000..29ad4b106420
--- /dev/null
+++ b/Documentation/networking/LICENSE.qlcnic
@@ -0,0 +1,327 @@
1Copyright (c) 2009-2010 QLogic Corporation
2QLogic Linux qlcnic NIC Driver
3
4This program includes a device driver for Linux 2.6 that may be
5distributed with QLogic hardware specific firmware binary file.
6You may modify and redistribute the device driver code under the
7GNU General Public License (a copy of which is attached hereto as
8Exhibit A) published by the Free Software Foundation (version 2).
9
10You may redistribute the hardware specific firmware binary file
11under the following terms:
12
13 1. Redistribution of source code (only if applicable),
14 must retain the above copyright notice, this list of
15 conditions and the following disclaimer.
16
17 2. Redistribution in binary form must reproduce the above
18 copyright notice, this list of conditions and the
19 following disclaimer in the documentation and/or other
20 materials provided with the distribution.
21
22 3. The name of QLogic Corporation may not be used to
23 endorse or promote products derived from this software
24 without specific prior written permission
25
26REGARDLESS OF WHAT LICENSING MECHANISM IS USED OR APPLICABLE,
27THIS PROGRAM IS PROVIDED BY QLOGIC CORPORATION "AS IS'' AND ANY
28EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
30PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
31BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
33TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38POSSIBILITY OF SUCH DAMAGE.
39
40USER ACKNOWLEDGES AND AGREES THAT USE OF THIS PROGRAM WILL NOT
41CREATE OR GIVE GROUNDS FOR A LICENSE BY IMPLICATION, ESTOPPEL, OR
42OTHERWISE IN ANY INTELLECTUAL PROPERTY RIGHTS (PATENT, COPYRIGHT,
43TRADE SECRET, MASK WORK, OR OTHER PROPRIETARY RIGHT) EMBODIED IN
44ANY OTHER QLOGIC HARDWARE OR SOFTWARE EITHER SOLELY OR IN
45COMBINATION WITH THIS PROGRAM.
46
47
48EXHIBIT A
49
50 GNU GENERAL PUBLIC LICENSE
51 Version 2, June 1991
52
53 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
54 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
55 Everyone is permitted to copy and distribute verbatim copies
56 of this license document, but changing it is not allowed.
57
58 Preamble
59
60 The licenses for most software are designed to take away your
61freedom to share and change it. By contrast, the GNU General Public
62License is intended to guarantee your freedom to share and change free
63software--to make sure the software is free for all its users. This
64General Public License applies to most of the Free Software
65Foundation's software and to any other program whose authors commit to
66using it. (Some other Free Software Foundation software is covered by
67the GNU Lesser General Public License instead.) You can apply it to
68your programs, too.
69
70 When we speak of free software, we are referring to freedom, not
71price. Our General Public Licenses are designed to make sure that you
72have the freedom to distribute copies of free software (and charge for
73this service if you wish), that you receive source code or can get it
74if you want it, that you can change the software or use pieces of it
75in new free programs; and that you know you can do these things.
76
77 To protect your rights, we need to make restrictions that forbid
78anyone to deny you these rights or to ask you to surrender the rights.
79These restrictions translate to certain responsibilities for you if you
80distribute copies of the software, or if you modify it.
81
82 For example, if you distribute copies of such a program, whether
83gratis or for a fee, you must give the recipients all the rights that
84you have. You must make sure that they, too, receive or can get the
85source code. And you must show them these terms so they know their
86rights.
87
88 We protect your rights with two steps: (1) copyright the software, and
89(2) offer you this license which gives you legal permission to copy,
90distribute and/or modify the software.
91
92 Also, for each author's protection and ours, we want to make certain
93that everyone understands that there is no warranty for this free
94software. If the software is modified by someone else and passed on, we
95want its recipients to know that what they have is not the original, so
96that any problems introduced by others will not reflect on the original
97authors' reputations.
98
99 Finally, any free program is threatened constantly by software
100patents. We wish to avoid the danger that redistributors of a free
101program will individually obtain patent licenses, in effect making the
102program proprietary. To prevent this, we have made it clear that any
103patent must be licensed for everyone's free use or not licensed at all.
104
105 The precise terms and conditions for copying, distribution and
106modification follow.
107
108 GNU GENERAL PUBLIC LICENSE
109 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
110
111 0. This License applies to any program or other work which contains
112a notice placed by the copyright holder saying it may be distributed
113under the terms of this General Public License. The "Program", below,
114refers to any such program or work, and a "work based on the Program"
115means either the Program or any derivative work under copyright law:
116that is to say, a work containing the Program or a portion of it,
117either verbatim or with modifications and/or translated into another
118language. (Hereinafter, translation is included without limitation in
119the term "modification".) Each licensee is addressed as "you".
120
121Activities other than copying, distribution and modification are not
122covered by this License; they are outside its scope. The act of
123running the Program is not restricted, and the output from the Program
124is covered only if its contents constitute a work based on the
125Program (independent of having been made by running the Program).
126Whether that is true depends on what the Program does.
127
128 1. You may copy and distribute verbatim copies of the Program's
129source code as you receive it, in any medium, provided that you
130conspicuously and appropriately publish on each copy an appropriate
131copyright notice and disclaimer of warranty; keep intact all the
132notices that refer to this License and to the absence of any warranty;
133and give any other recipients of the Program a copy of this License
134along with the Program.
135
136You may charge a fee for the physical act of transferring a copy, and
137you may at your option offer warranty protection in exchange for a fee.
138
139 2. You may modify your copy or copies of the Program or any portion
140of it, thus forming a work based on the Program, and copy and
141distribute such modifications or work under the terms of Section 1
142above, provided that you also meet all of these conditions:
143
144 a) You must cause the modified files to carry prominent notices
145 stating that you changed the files and the date of any change.
146
147 b) You must cause any work that you distribute or publish, that in
148 whole or in part contains or is derived from the Program or any
149 part thereof, to be licensed as a whole at no charge to all third
150 parties under the terms of this License.
151
152 c) If the modified program normally reads commands interactively
153 when run, you must cause it, when started running for such
154 interactive use in the most ordinary way, to print or display an
155 announcement including an appropriate copyright notice and a
156 notice that there is no warranty (or else, saying that you provide
157 a warranty) and that users may redistribute the program under
158 these conditions, and telling the user how to view a copy of this
159 License. (Exception: if the Program itself is interactive but
160 does not normally print such an announcement, your work based on
161 the Program is not required to print an announcement.)
162
163These requirements apply to the modified work as a whole. If
164identifiable sections of that work are not derived from the Program,
165and can be reasonably considered independent and separate works in
166themselves, then this License, and its terms, do not apply to those
167sections when you distribute them as separate works. But when you
168distribute the same sections as part of a whole which is a work based
169on the Program, the distribution of the whole must be on the terms of
170this License, whose permissions for other licensees extend to the
171entire whole, and thus to each and every part regardless of who wrote it.
172
173Thus, it is not the intent of this section to claim rights or contest
174your rights to work written entirely by you; rather, the intent is to
175exercise the right to control the distribution of derivative or
176collective works based on the Program.
177
178In addition, mere aggregation of another work not based on the Program
179with the Program (or with a work based on the Program) on a volume of
180a storage or distribution medium does not bring the other work under
181the scope of this License.
182
183 3. You may copy and distribute the Program (or a work based on it,
184under Section 2) in object code or executable form under the terms of
185Sections 1 and 2 above provided that you also do one of the following:
186
187 a) Accompany it with the complete corresponding machine-readable
188 source code, which must be distributed under the terms of Sections
189 1 and 2 above on a medium customarily used for software interchange; or,
190
191 b) Accompany it with a written offer, valid for at least three
192 years, to give any third party, for a charge no more than your
193 cost of physically performing source distribution, a complete
194 machine-readable copy of the corresponding source code, to be
195 distributed under the terms of Sections 1 and 2 above on a medium
196 customarily used for software interchange; or,
197
198 c) Accompany it with the information you received as to the offer
199 to distribute corresponding source code. (This alternative is
200 allowed only for noncommercial distribution and only if you
201 received the program in object code or executable form with such
202 an offer, in accord with Subsection b above.)
203
204The source code for a work means the preferred form of the work for
205making modifications to it. For an executable work, complete source
206code means all the source code for all modules it contains, plus any
207associated interface definition files, plus the scripts used to
208control compilation and installation of the executable. However, as a
209special exception, the source code distributed need not include
210anything that is normally distributed (in either source or binary
211form) with the major components (compiler, kernel, and so on) of the
212operating system on which the executable runs, unless that component
213itself accompanies the executable.
214
215If distribution of executable or object code is made by offering
216access to copy from a designated place, then offering equivalent
217access to copy the source code from the same place counts as
218distribution of the source code, even though third parties are not
219compelled to copy the source along with the object code.
220
221 4. You may not copy, modify, sublicense, or distribute the Program
222except as expressly provided under this License. Any attempt
223otherwise to copy, modify, sublicense or distribute the Program is
224void, and will automatically terminate your rights under this License.
225However, parties who have received copies, or rights, from you under
226this License will not have their licenses terminated so long as such
227parties remain in full compliance.
228
229 5. You are not required to accept this License, since you have not
230signed it. However, nothing else grants you permission to modify or
231distribute the Program or its derivative works. These actions are
232prohibited by law if you do not accept this License. Therefore, by
233modifying or distributing the Program (or any work based on the
234Program), you indicate your acceptance of this License to do so, and
235all its terms and conditions for copying, distributing or modifying
236the Program or works based on it.
237
238 6. Each time you redistribute the Program (or any work based on the
239Program), the recipient automatically receives a license from the
240original licensor to copy, distribute or modify the Program subject to
241these terms and conditions. You may not impose any further
242restrictions on the recipients' exercise of the rights granted herein.
243You are not responsible for enforcing compliance by third parties to
244this License.
245
246 7. If, as a consequence of a court judgment or allegation of patent
247infringement or for any other reason (not limited to patent issues),
248conditions are imposed on you (whether by court order, agreement or
249otherwise) that contradict the conditions of this License, they do not
250excuse you from the conditions of this License. If you cannot
251distribute so as to satisfy simultaneously your obligations under this
252License and any other pertinent obligations, then as a consequence you
253may not distribute the Program at all. For example, if a patent
254license would not permit royalty-free redistribution of the Program by
255all those who receive copies directly or indirectly through you, then
256the only way you could satisfy both it and this License would be to
257refrain entirely from distribution of the Program.
258
259If any portion of this section is held invalid or unenforceable under
260any particular circumstance, the balance of the section is intended to
261apply and the section as a whole is intended to apply in other
262circumstances.
263
264It is not the purpose of this section to induce you to infringe any
265patents or other property right claims or to contest validity of any
266such claims; this section has the sole purpose of protecting the
267integrity of the free software distribution system, which is
268implemented by public license practices. Many people have made
269generous contributions to the wide range of software distributed
270through that system in reliance on consistent application of that
271system; it is up to the author/donor to decide if he or she is willing
272to distribute software through any other system and a licensee cannot
273impose that choice.
274
275This section is intended to make thoroughly clear what is believed to
276be a consequence of the rest of this License.
277
278 8. If the distribution and/or use of the Program is restricted in
279certain countries either by patents or by copyrighted interfaces, the
280original copyright holder who places the Program under this License
281may add an explicit geographical distribution limitation excluding
282those countries, so that distribution is permitted only in or among
283countries not thus excluded. In such case, this License incorporates
284the limitation as if written in the body of this License.
285
286 9. The Free Software Foundation may publish revised and/or new versions
287of the General Public License from time to time. Such new versions will
288be similar in spirit to the present version, but may differ in detail to
289address new problems or concerns.
290
291Each version is given a distinguishing version number. If the Program
292specifies a version number of this License which applies to it and "any
293later version", you have the option of following the terms and conditions
294either of that version or of any later version published by the Free
295Software Foundation. If the Program does not specify a version number of
296this License, you may choose any version ever published by the Free Software
297Foundation.
298
299 10. If you wish to incorporate parts of the Program into other free
300programs whose distribution conditions are different, write to the author
301to ask for permission. For software which is copyrighted by the Free
302Software Foundation, write to the Free Software Foundation; we sometimes
303make exceptions for this. Our decision will be guided by the two goals
304of preserving the free status of all derivatives of our free software and
305of promoting the sharing and reuse of software generally.
306
307 NO WARRANTY
308
309 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
310FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
311OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
312PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
313OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
314MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
315TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
316PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
317REPAIR OR CORRECTION.
318
319 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
320WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
321REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
322INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
323OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
324TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
325YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
326PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
327POSSIBILITY OF SUCH DAMAGES.
diff --git a/Documentation/networking/Makefile b/Documentation/networking/Makefile
index 5aba7a33aeeb..24c308dd3fd1 100644
--- a/Documentation/networking/Makefile
+++ b/Documentation/networking/Makefile
@@ -4,6 +4,8 @@ obj- := dummy.o
4# List of programs to build 4# List of programs to build
5hostprogs-y := ifenslave 5hostprogs-y := ifenslave
6 6
7HOSTCFLAGS_ifenslave.o += -I$(objtree)/usr/include
8
7# Tell kbuild to always build the programs 9# Tell kbuild to always build the programs
8always := $(hostprogs-y) 10always := $(hostprogs-y)
9 11
diff --git a/Documentation/networking/README.ipw2200 b/Documentation/networking/README.ipw2200
index 616a8e540b0b..b7658bed4906 100644
--- a/Documentation/networking/README.ipw2200
+++ b/Documentation/networking/README.ipw2200
@@ -256,7 +256,7 @@ You can set the debug level via:
256 256
257Where $VALUE would be a number in the case of this sysfs entry. The 257Where $VALUE would be a number in the case of this sysfs entry. The
258input to sysfs files does not have to be a number. For example, the 258input to sysfs files does not have to be a number. For example, the
259firmware loader used by hotplug utilizes sysfs entries for transfering 259firmware loader used by hotplug utilizes sysfs entries for transferring
260the firmware image from user space into the driver. 260the firmware image from user space into the driver.
261 261
262The Intel(R) PRO/Wireless 2915ABG Driver for Linux exposes sysfs entries 262The Intel(R) PRO/Wireless 2915ABG Driver for Linux exposes sysfs entries
diff --git a/Documentation/networking/batman-adv.txt b/Documentation/networking/batman-adv.txt
new file mode 100644
index 000000000000..88d4afbdef98
--- /dev/null
+++ b/Documentation/networking/batman-adv.txt
@@ -0,0 +1,241 @@
1[state: 17-04-2011]
2
3BATMAN-ADV
4----------
5
6Batman advanced is a new approach to wireless networking which
7does no longer operate on the IP basis. Unlike the batman daemon,
8which exchanges information using UDP packets and sets routing
9tables, batman-advanced operates on ISO/OSI Layer 2 only and uses
10and routes (or better: bridges) Ethernet Frames. It emulates a
11virtual network switch of all nodes participating. Therefore all
12nodes appear to be link local, thus all higher operating proto-
13cols won't be affected by any changes within the network. You can
14run almost any protocol above batman advanced, prominent examples
15are: IPv4, IPv6, DHCP, IPX.
16
17Batman advanced was implemented as a Linux kernel driver to re-
18duce the overhead to a minimum. It does not depend on any (other)
19network driver, and can be used on wifi as well as ethernet lan,
20vpn, etc ... (anything with ethernet-style layer 2).
21
22
23CONFIGURATION
24-------------
25
26Load the batman-adv module into your kernel:
27
28# insmod batman-adv.ko
29
30The module is now waiting for activation. You must add some in-
31terfaces on which batman can operate. After loading the module
32batman advanced will scan your systems interfaces to search for
33compatible interfaces. Once found, it will create subfolders in
34the /sys directories of each supported interface, e.g.
35
36# ls /sys/class/net/eth0/batman_adv/
37# iface_status mesh_iface
38
39If an interface does not have the "batman_adv" subfolder it prob-
40ably is not supported. Not supported interfaces are: loopback,
41non-ethernet and batman's own interfaces.
42
43Note: After the module was loaded it will continuously watch for
44new interfaces to verify the compatibility. There is no need to
45reload the module if you plug your USB wifi adapter into your ma-
46chine after batman advanced was initially loaded.
47
48To activate a given interface simply write "bat0" into its
49"mesh_iface" file inside the batman_adv subfolder:
50
51# echo bat0 > /sys/class/net/eth0/batman_adv/mesh_iface
52
53Repeat this step for all interfaces you wish to add. Now batman
54starts using/broadcasting on this/these interface(s).
55
56By reading the "iface_status" file you can check its status:
57
58# cat /sys/class/net/eth0/batman_adv/iface_status
59# active
60
61To deactivate an interface you have to write "none" into its
62"mesh_iface" file:
63
64# echo none > /sys/class/net/eth0/batman_adv/mesh_iface
65
66
67All mesh wide settings can be found in batman's own interface
68folder:
69
70# ls /sys/class/net/bat0/mesh/
71# aggregated_ogms gw_bandwidth hop_penalty
72# bonding gw_mode orig_interval
73# fragmentation gw_sel_class vis_mode
74
75
76There is a special folder for debugging information:
77
78# ls /sys/kernel/debug/batman_adv/bat0/
79# gateways socket transtable_global vis_data
80# originators softif_neigh transtable_local
81
82
83Some of the files contain all sort of status information regard-
84ing the mesh network. For example, you can view the table of
85originators (mesh participants) with:
86
87# cat /sys/kernel/debug/batman_adv/bat0/originators
88
89Other files allow to change batman's behaviour to better fit your
90requirements. For instance, you can check the current originator
91interval (value in milliseconds which determines how often batman
92sends its broadcast packets):
93
94# cat /sys/class/net/bat0/mesh/orig_interval
95# 1000
96
97and also change its value:
98
99# echo 3000 > /sys/class/net/bat0/mesh/orig_interval
100
101In very mobile scenarios, you might want to adjust the originator
102interval to a lower value. This will make the mesh more respon-
103sive to topology changes, but will also increase the overhead.
104
105
106USAGE
107-----
108
109To make use of your newly created mesh, batman advanced provides
110a new interface "bat0" which you should use from this point on.
111All interfaces added to batman advanced are not relevant any
112longer because batman handles them for you. Basically, one "hands
113over" the data by using the batman interface and batman will make
114sure it reaches its destination.
115
116The "bat0" interface can be used like any other regular inter-
117face. It needs an IP address which can be either statically con-
118figured or dynamically (by using DHCP or similar services):
119
120# NodeA: ifconfig bat0 192.168.0.1
121# NodeB: ifconfig bat0 192.168.0.2
122# NodeB: ping 192.168.0.1
123
124Note: In order to avoid problems remove all IP addresses previ-
125ously assigned to interfaces now used by batman advanced, e.g.
126
127# ifconfig eth0 0.0.0.0
128
129
130VISUALIZATION
131-------------
132
133If you want topology visualization, at least one mesh node must
134be configured as VIS-server:
135
136# echo "server" > /sys/class/net/bat0/mesh/vis_mode
137
138Each node is either configured as "server" or as "client" (de-
139fault: "client"). Clients send their topology data to the server
140next to them, and server synchronize with other servers. If there
141is no server configured (default) within the mesh, no topology
142information will be transmitted. With these "synchronizing
143servers", there can be 1 or more vis servers sharing the same (or
144at least very similar) data.
145
146When configured as server, you can get a topology snapshot of
147your mesh:
148
149# cat /sys/kernel/debug/batman_adv/bat0/vis_data
150
151This raw output is intended to be easily parsable and convertable
152with other tools. Have a look at the batctl README if you want a
153vis output in dot or json format for instance and how those out-
154puts could then be visualised in an image.
155
156The raw format consists of comma separated values per entry where
157each entry is giving information about a certain source inter-
158face. Each entry can/has to have the following values:
159-> "mac" - mac address of an originator's source interface
160 (each line begins with it)
161-> "TQ mac value" - src mac's link quality towards mac address
162 of a neighbor originator's interface which
163 is being used for routing
164-> "TT mac" - TT announced by source mac
165-> "PRIMARY" - this is a primary interface
166-> "SEC mac" - secondary mac address of source
167 (requires preceding PRIMARY)
168
169The TQ value has a range from 4 to 255 with 255 being the best.
170The TT entries are showing which hosts are connected to the mesh
171via bat0 or being bridged into the mesh network. The PRIMARY/SEC
172values are only applied on primary interfaces
173
174
175LOGGING/DEBUGGING
176-----------------
177
178All error messages, warnings and information messages are sent to
179the kernel log. Depending on your operating system distribution
180this can be read in one of a number of ways. Try using the com-
181mands: dmesg, logread, or looking in the files /var/log/kern.log
182or /var/log/syslog. All batman-adv messages are prefixed with
183"batman-adv:" So to see just these messages try
184
185# dmesg | grep batman-adv
186
187When investigating problems with your mesh network it is some-
188times necessary to see more detail debug messages. This must be
189enabled when compiling the batman-adv module. When building bat-
190man-adv as part of kernel, use "make menuconfig" and enable the
191option "B.A.T.M.A.N. debugging".
192
193Those additional debug messages can be accessed using a special
194file in debugfs
195
196# cat /sys/kernel/debug/batman_adv/bat0/log
197
198The additional debug output is by default disabled. It can be en-
199abled during run time. Following log_levels are defined:
200
2010 - All debug output disabled
2021 - Enable messages related to routing / flooding / broadcasting
2032 - Enable route or tt entry added / changed / deleted
2043 - Enable all messages
205
206The debug output can be changed at runtime using the file
207/sys/class/net/bat0/mesh/log_level. e.g.
208
209# echo 2 > /sys/class/net/bat0/mesh/log_level
210
211will enable debug messages for when routes or TTs change.
212
213
214BATCTL
215------
216
217As batman advanced operates on layer 2 all hosts participating in
218the virtual switch are completely transparent for all protocols
219above layer 2. Therefore the common diagnosis tools do not work
220as expected. To overcome these problems batctl was created. At
221the moment the batctl contains ping, traceroute, tcpdump and
222interfaces to the kernel module settings.
223
224For more information, please see the manpage (man batctl).
225
226batctl is available on http://www.open-mesh.org/
227
228
229CONTACT
230-------
231
232Please send us comments, experiences, questions, anything :)
233
234IRC: #batman on irc.freenode.org
235Mailing-list: b.a.t.m.a.n@open-mesh.org (optional subscription
236 at https://lists.open-mesh.org/mm/listinfo/b.a.t.m.a.n)
237
238You can also contact the Authors:
239
240Marek Lindner <lindner_marek@yahoo.de>
241Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
index d2b62b71b617..675612ff41ae 100644
--- a/Documentation/networking/bonding.txt
+++ b/Documentation/networking/bonding.txt
@@ -1,7 +1,7 @@
1 1
2 Linux Ethernet Bonding Driver HOWTO 2 Linux Ethernet Bonding Driver HOWTO
3 3
4 Latest update: 23 September 2009 4 Latest update: 27 April 2011
5 5
6Initial release : Thomas Davis <tadavis at lbl.gov> 6Initial release : Thomas Davis <tadavis at lbl.gov>
7Corrections, HA extensions : 2000/10/03-15 : 7Corrections, HA extensions : 2000/10/03-15 :
@@ -49,7 +49,8 @@ Table of Contents
493.3 Configuring Bonding Manually with Ifenslave 493.3 Configuring Bonding Manually with Ifenslave
503.3.1 Configuring Multiple Bonds Manually 503.3.1 Configuring Multiple Bonds Manually
513.4 Configuring Bonding Manually via Sysfs 513.4 Configuring Bonding Manually via Sysfs
523.5 Overriding Configuration for Special Cases 523.5 Configuration with Interfaces Support
533.6 Overriding Configuration for Special Cases
53 54
544. Querying Bonding Configuration 554. Querying Bonding Configuration
554.1 Bonding Configuration 564.1 Bonding Configuration
@@ -161,8 +162,8 @@ onwards) do not have /usr/include/linux symbolically linked to the
161default kernel source include directory. 162default kernel source include directory.
162 163
163SECOND IMPORTANT NOTE: 164SECOND IMPORTANT NOTE:
164 If you plan to configure bonding using sysfs, you do not need 165 If you plan to configure bonding using sysfs or using the
165to use ifenslave. 166/etc/network/interfaces file, you do not need to use ifenslave.
166 167
1672. Bonding Driver Options 1682. Bonding Driver Options
168========================= 169=========================
@@ -367,7 +368,7 @@ fail_over_mac
367 gratuitous ARP is lost, communication may be 368 gratuitous ARP is lost, communication may be
368 disrupted. 369 disrupted.
369 370
370 When this policy is used in conjuction with the mii 371 When this policy is used in conjunction with the mii
371 monitor, devices which assert link up prior to being 372 monitor, devices which assert link up prior to being
372 able to actually transmit and receive are particularly 373 able to actually transmit and receive are particularly
373 susceptible to loss of the gratuitous ARP, and an 374 susceptible to loss of the gratuitous ARP, and an
@@ -584,25 +585,23 @@ mode
584 chosen. 585 chosen.
585 586
586num_grat_arp 587num_grat_arp
587
588 Specifies the number of gratuitous ARPs to be issued after a
589 failover event. One gratuitous ARP is issued immediately after
590 the failover, subsequent ARPs are sent at a rate of one per link
591 monitor interval (arp_interval or miimon, whichever is active).
592
593 The valid range is 0 - 255; the default value is 1. This option
594 affects only the active-backup mode. This option was added for
595 bonding version 3.3.0.
596
597num_unsol_na 588num_unsol_na
598 589
599 Specifies the number of unsolicited IPv6 Neighbor Advertisements 590 Specify the number of peer notifications (gratuitous ARPs and
600 to be issued after a failover event. One unsolicited NA is issued 591 unsolicited IPv6 Neighbor Advertisements) to be issued after a
601 immediately after the failover. 592 failover event. As soon as the link is up on the new slave
593 (possibly immediately) a peer notification is sent on the
594 bonding device and each VLAN sub-device. This is repeated at
595 each link monitor interval (arp_interval or miimon, whichever
596 is active) if the number is greater than 1.
602 597
603 The valid range is 0 - 255; the default value is 1. This option 598 The valid range is 0 - 255; the default value is 1. These options
604 affects only the active-backup mode. This option was added for 599 affect only the active-backup mode. These options were added for
605 bonding version 3.4.0. 600 bonding versions 3.3.0 and 3.4.0 respectively.
601
602 From Linux 2.6.40 and bonding version 3.7.1, these notifications
603 are generated by the ipv4 and ipv6 code and the numbers of
604 repetitions cannot be set independently.
606 605
607primary 606primary
608 607
@@ -765,28 +764,49 @@ xmit_hash_policy
765 does not exist, and the layer2 policy is the only policy. The 764 does not exist, and the layer2 policy is the only policy. The
766 layer2+3 value was added for bonding version 3.2.2. 765 layer2+3 value was added for bonding version 3.2.2.
767 766
767resend_igmp
768
769 Specifies the number of IGMP membership reports to be issued after
770 a failover event. One membership report is issued immediately after
771 the failover, subsequent packets are sent in each 200ms interval.
772
773 The valid range is 0 - 255; the default value is 1. A value of 0
774 prevents the IGMP membership report from being issued in response
775 to the failover event.
776
777 This option is useful for bonding modes balance-rr (0), active-backup
778 (1), balance-tlb (5) and balance-alb (6), in which a failover can
779 switch the IGMP traffic from one slave to another. Therefore a fresh
780 IGMP report must be issued to cause the switch to forward the incoming
781 IGMP traffic over the newly selected slave.
782
783 This option was added for bonding version 3.7.0.
768 784
7693. Configuring Bonding Devices 7853. Configuring Bonding Devices
770============================== 786==============================
771 787
772 You can configure bonding using either your distro's network 788 You can configure bonding using either your distro's network
773initialization scripts, or manually using either ifenslave or the 789initialization scripts, or manually using either ifenslave or the
774sysfs interface. Distros generally use one of two packages for the 790sysfs interface. Distros generally use one of three packages for the
775network initialization scripts: initscripts or sysconfig. Recent 791network initialization scripts: initscripts, sysconfig or interfaces.
776versions of these packages have support for bonding, while older 792Recent versions of these packages have support for bonding, while older
777versions do not. 793versions do not.
778 794
779 We will first describe the options for configuring bonding for 795 We will first describe the options for configuring bonding for
780distros using versions of initscripts and sysconfig with full or 796distros using versions of initscripts, sysconfig and interfaces with full
781partial support for bonding, then provide information on enabling 797or partial support for bonding, then provide information on enabling
782bonding without support from the network initialization scripts (i.e., 798bonding without support from the network initialization scripts (i.e.,
783older versions of initscripts or sysconfig). 799older versions of initscripts or sysconfig).
784 800
785 If you're unsure whether your distro uses sysconfig or 801 If you're unsure whether your distro uses sysconfig,
786initscripts, or don't know if it's new enough, have no fear. 802initscripts or interfaces, or don't know if it's new enough, have no fear.
787Determining this is fairly straightforward. 803Determining this is fairly straightforward.
788 804
789 First, issue the command: 805 First, look for a file called interfaces in /etc/network directory.
806If this file is present in your system, then your system use interfaces. See
807Configuration with Interfaces Support.
808
809 Else, issue the command:
790 810
791$ rpm -qf /sbin/ifup 811$ rpm -qf /sbin/ifup
792 812
@@ -1319,8 +1339,62 @@ echo 2000 > /sys/class/net/bond1/bonding/arp_interval
1319echo +eth2 > /sys/class/net/bond1/bonding/slaves 1339echo +eth2 > /sys/class/net/bond1/bonding/slaves
1320echo +eth3 > /sys/class/net/bond1/bonding/slaves 1340echo +eth3 > /sys/class/net/bond1/bonding/slaves
1321 1341
13223.5 Overriding Configuration for Special Cases 13423.5 Configuration with Interfaces Support
1343-----------------------------------------
1344
1345 This section applies to distros which use /etc/network/interfaces file
1346to describe network interface configuration, most notably Debian and it's
1347derivatives.
1348
1349 The ifup and ifdown commands on Debian don't support bonding out of
1350the box. The ifenslave-2.6 package should be installed to provide bonding
1351support. Once installed, this package will provide bond-* options to be used
1352into /etc/network/interfaces.
1353
1354 Note that ifenslave-2.6 package will load the bonding module and use
1355the ifenslave command when appropriate.
1356
1357Example Configurations
1358----------------------
1359
1360In /etc/network/interfaces, the following stanza will configure bond0, in
1361active-backup mode, with eth0 and eth1 as slaves.
1362
1363auto bond0
1364iface bond0 inet dhcp
1365 bond-slaves eth0 eth1
1366 bond-mode active-backup
1367 bond-miimon 100
1368 bond-primary eth0 eth1
1369
1370If the above configuration doesn't work, you might have a system using
1371upstart for system startup. This is most notably true for recent
1372Ubuntu versions. The following stanza in /etc/network/interfaces will
1373produce the same result on those systems.
1374
1375auto bond0
1376iface bond0 inet dhcp
1377 bond-slaves none
1378 bond-mode active-backup
1379 bond-miimon 100
1380
1381auto eth0
1382iface eth0 inet manual
1383 bond-master bond0
1384 bond-primary eth0 eth1
1385
1386auto eth1
1387iface eth1 inet manual
1388 bond-master bond0
1389 bond-primary eth0 eth1
1390
1391For a full list of bond-* supported options in /etc/network/interfaces and some
1392more advanced examples tailored to you particular distros, see the files in
1393/usr/share/doc/ifenslave-2.6.
1394
13953.6 Overriding Configuration for Special Cases
1323---------------------------------------------- 1396----------------------------------------------
1397
1324When using the bonding driver, the physical port which transmits a frame is 1398When using the bonding driver, the physical port which transmits a frame is
1325typically selected by the bonding driver, and is not relevant to the user or 1399typically selected by the bonding driver, and is not relevant to the user or
1326system administrator. The output port is simply selected using the policies of 1400system administrator. The output port is simply selected using the policies of
@@ -2491,18 +2565,15 @@ enslaved.
249116. Resources and Links 256516. Resources and Links
2492======================= 2566=======================
2493 2567
2494The latest version of the bonding driver can be found in the latest 2568 The latest version of the bonding driver can be found in the latest
2495version of the linux kernel, found on http://kernel.org 2569version of the linux kernel, found on http://kernel.org
2496 2570
2497The latest version of this document can be found in either the latest 2571 The latest version of this document can be found in the latest kernel
2498kernel source (named Documentation/networking/bonding.txt), or on the 2572source (named Documentation/networking/bonding.txt).
2499bonding sourceforge site:
2500
2501http://www.sourceforge.net/projects/bonding
2502 2573
2503Discussions regarding the bonding driver take place primarily on the 2574 Discussions regarding the usage of the bonding driver take place on the
2504bonding-devel mailing list, hosted at sourceforge.net. If you have 2575bonding-devel mailing list, hosted at sourceforge.net. If you have questions or
2505questions or problems, post them to the list. The list address is: 2576problems, post them to the list. The list address is:
2506 2577
2507bonding-devel@lists.sourceforge.net 2578bonding-devel@lists.sourceforge.net
2508 2579
@@ -2511,6 +2582,17 @@ be found at:
2511 2582
2512https://lists.sourceforge.net/lists/listinfo/bonding-devel 2583https://lists.sourceforge.net/lists/listinfo/bonding-devel
2513 2584
2585 Discussions regarding the developpement of the bonding driver take place
2586on the main Linux network mailing list, hosted at vger.kernel.org. The list
2587address is:
2588
2589netdev@vger.kernel.org
2590
2591 The administrative interface (to subscribe or unsubscribe) can
2592be found at:
2593
2594http://vger.kernel.org/vger-lists.html#netdev
2595
2514Donald Becker's Ethernet Drivers and diag programs may be found at : 2596Donald Becker's Ethernet Drivers and diag programs may be found at :
2515 - http://web.archive.org/web/*/http://www.scyld.com/network/ 2597 - http://web.archive.org/web/*/http://www.scyld.com/network/
2516 2598
diff --git a/Documentation/networking/bridge.txt b/Documentation/networking/bridge.txt
index bec69a8a1697..a7ba5e4e2c91 100644
--- a/Documentation/networking/bridge.txt
+++ b/Documentation/networking/bridge.txt
@@ -1,8 +1,8 @@
1In order to use the Ethernet bridging functionality, you'll need the 1In order to use the Ethernet bridging functionality, you'll need the
2userspace tools. These programs and documentation are available 2userspace tools. These programs and documentation are available
3at http://www.linux-foundation.org/en/Net:Bridge. The download page is 3at http://www.linuxfoundation.org/en/Net:Bridge. The download page is
4http://prdownloads.sourceforge.net/bridge. 4http://prdownloads.sourceforge.net/bridge.
5 5
6If you still have questions, don't hesitate to post to the mailing list 6If you still have questions, don't hesitate to post to the mailing list
7(more info http://lists.osdl.org/mailman/listinfo/bridge). 7(more info https://lists.linux-foundation.org/mailman/listinfo/bridge).
8 8
diff --git a/Documentation/networking/caif/Linux-CAIF.txt b/Documentation/networking/caif/Linux-CAIF.txt
index 7fe7a9a33a4f..e52fd62bef3a 100644
--- a/Documentation/networking/caif/Linux-CAIF.txt
+++ b/Documentation/networking/caif/Linux-CAIF.txt
@@ -136,7 +136,7 @@ The CAIF Protocol implementation contains:
136 - CFMUX CAIF Mux layer. Handles multiplexing between multiple 136 - CFMUX CAIF Mux layer. Handles multiplexing between multiple
137 physical bearers and multiple channels such as VEI, Datagram, etc. 137 physical bearers and multiple channels such as VEI, Datagram, etc.
138 The MUX keeps track of the existing CAIF Channels and 138 The MUX keeps track of the existing CAIF Channels and
139 Physical Instances and selects the apropriate instance based 139 Physical Instances and selects the appropriate instance based
140 on Channel-Id and Physical-ID. 140 on Channel-Id and Physical-ID.
141 141
142 - CFFRML CAIF Framing layer. Handles Framing i.e. Frame length 142 - CFFRML CAIF Framing layer. Handles Framing i.e. Frame length
diff --git a/Documentation/networking/caif/spi_porting.txt b/Documentation/networking/caif/spi_porting.txt
index 61d7c9247453..9efd0687dc4c 100644
--- a/Documentation/networking/caif/spi_porting.txt
+++ b/Documentation/networking/caif/spi_porting.txt
@@ -32,7 +32,7 @@ the physical hardware, both with regard to SPI and to GPIOs.
32 This function is called by the CAIF SPI interface to give 32 This function is called by the CAIF SPI interface to give
33 you a chance to set up your hardware to be ready to receive 33 you a chance to set up your hardware to be ready to receive
34 a stream of data from the master. The xfer structure contains 34 a stream of data from the master. The xfer structure contains
35 both physical and logical adresses, as well as the total length 35 both physical and logical addresses, as well as the total length
36 of the transfer in both directions.The dev parameter can be used 36 of the transfer in both directions.The dev parameter can be used
37 to map to different CAIF SPI slave devices. 37 to map to different CAIF SPI slave devices.
38 38
@@ -150,7 +150,7 @@ static int sspi_init_xfer(struct cfspi_xfer *xfer, struct cfspi_dev *dev)
150void sspi_sig_xfer(bool xfer, struct cfspi_dev *dev) 150void sspi_sig_xfer(bool xfer, struct cfspi_dev *dev)
151{ 151{
152 /* If xfer is true then you should assert the SPI_INT to indicate to 152 /* If xfer is true then you should assert the SPI_INT to indicate to
153 * the master that you are ready to recieve the data from the master 153 * the master that you are ready to receive the data from the master
154 * SPI. If xfer is false then you should de-assert SPI_INT to indicate 154 * SPI. If xfer is false then you should de-assert SPI_INT to indicate
155 * that the transfer is done. 155 * that the transfer is done.
156 */ 156 */
diff --git a/Documentation/networking/can.txt b/Documentation/networking/can.txt
index cd79735013f9..56ca3b75376e 100644
--- a/Documentation/networking/can.txt
+++ b/Documentation/networking/can.txt
@@ -22,6 +22,7 @@ This file contains
22 4.1.2 RAW socket option CAN_RAW_ERR_FILTER 22 4.1.2 RAW socket option CAN_RAW_ERR_FILTER
23 4.1.3 RAW socket option CAN_RAW_LOOPBACK 23 4.1.3 RAW socket option CAN_RAW_LOOPBACK
24 4.1.4 RAW socket option CAN_RAW_RECV_OWN_MSGS 24 4.1.4 RAW socket option CAN_RAW_RECV_OWN_MSGS
25 4.1.5 RAW socket returned message flags
25 4.2 Broadcast Manager protocol sockets (SOCK_DGRAM) 26 4.2 Broadcast Manager protocol sockets (SOCK_DGRAM)
26 4.3 connected transport protocols (SOCK_SEQPACKET) 27 4.3 connected transport protocols (SOCK_SEQPACKET)
27 4.4 unconnected transport protocols (SOCK_DGRAM) 28 4.4 unconnected transport protocols (SOCK_DGRAM)
@@ -239,7 +240,7 @@ solution for a couple of reasons:
239 the user application using the common CAN filter mechanisms. Inside 240 the user application using the common CAN filter mechanisms. Inside
240 this filter definition the (interested) type of errors may be 241 this filter definition the (interested) type of errors may be
241 selected. The reception of error frames is disabled by default. 242 selected. The reception of error frames is disabled by default.
242 The format of the CAN error frame is briefly decribed in the Linux 243 The format of the CAN error frame is briefly described in the Linux
243 header file "include/linux/can/error.h". 244 header file "include/linux/can/error.h".
244 245
2454. How to use Socket CAN 2464. How to use Socket CAN
@@ -471,6 +472,17 @@ solution for a couple of reasons:
471 setsockopt(s, SOL_CAN_RAW, CAN_RAW_RECV_OWN_MSGS, 472 setsockopt(s, SOL_CAN_RAW, CAN_RAW_RECV_OWN_MSGS,
472 &recv_own_msgs, sizeof(recv_own_msgs)); 473 &recv_own_msgs, sizeof(recv_own_msgs));
473 474
475 4.1.5 RAW socket returned message flags
476
477 When using recvmsg() call, the msg->msg_flags may contain following flags:
478
479 MSG_DONTROUTE: set when the received frame was created on the local host.
480
481 MSG_CONFIRM: set when the frame was sent via the socket it is received on.
482 This flag can be interpreted as a 'transmission confirmation' when the
483 CAN driver supports the echo of frames on driver level, see 3.2 and 6.2.
484 In order to receive such messages, CAN_RAW_RECV_OWN_MSGS must be set.
485
474 4.2 Broadcast Manager protocol sockets (SOCK_DGRAM) 486 4.2 Broadcast Manager protocol sockets (SOCK_DGRAM)
475 4.3 connected transport protocols (SOCK_SEQPACKET) 487 4.3 connected transport protocols (SOCK_SEQPACKET)
476 4.4 unconnected transport protocols (SOCK_DGRAM) 488 4.4 unconnected transport protocols (SOCK_DGRAM)
diff --git a/Documentation/networking/dccp.txt b/Documentation/networking/dccp.txt
index a62fdf7a6bff..d718bc2ff1cf 100644
--- a/Documentation/networking/dccp.txt
+++ b/Documentation/networking/dccp.txt
@@ -1,18 +1,20 @@
1DCCP protocol 1DCCP protocol
2============ 2=============
3 3
4 4
5Contents 5Contents
6======== 6========
7
8- Introduction 7- Introduction
9- Missing features 8- Missing features
10- Socket options 9- Socket options
10- Sysctl variables
11- IOCTLs
12- Other tunables
11- Notes 13- Notes
12 14
15
13Introduction 16Introduction
14============ 17============
15
16Datagram Congestion Control Protocol (DCCP) is an unreliable, connection 18Datagram Congestion Control Protocol (DCCP) is an unreliable, connection
17oriented protocol designed to solve issues present in UDP and TCP, particularly 19oriented protocol designed to solve issues present in UDP and TCP, particularly
18for real-time and multimedia (streaming) traffic. 20for real-time and multimedia (streaming) traffic.
@@ -29,22 +31,41 @@ It has a base protocol and pluggable congestion control IDs (CCIDs).
29DCCP is a Proposed Standard (RFC 2026), and the homepage for DCCP as a protocol 31DCCP is a Proposed Standard (RFC 2026), and the homepage for DCCP as a protocol
30is at http://www.ietf.org/html.charters/dccp-charter.html 32is at http://www.ietf.org/html.charters/dccp-charter.html
31 33
34
32Missing features 35Missing features
33================ 36================
34
35The Linux DCCP implementation does not currently support all the features that are 37The Linux DCCP implementation does not currently support all the features that are
36specified in RFCs 4340...42. 38specified in RFCs 4340...42.
37 39
38The known bugs are at: 40The known bugs are at:
39 http://linux-net.osdl.org/index.php/TODO#DCCP 41 http://www.linuxfoundation.org/collaborate/workgroups/networking/todo#DCCP
40 42
41For more up-to-date versions of the DCCP implementation, please consider using 43For more up-to-date versions of the DCCP implementation, please consider using
42the experimental DCCP test tree; instructions for checking this out are on: 44the experimental DCCP test tree; instructions for checking this out are on:
43http://linux-net.osdl.org/index.php/DCCP_Testing#Experimental_DCCP_source_tree 45http://www.linuxfoundation.org/collaborate/workgroups/networking/dccp_testing#Experimental_DCCP_source_tree
44 46
45 47
46Socket options 48Socket options
47============== 49==============
50DCCP_SOCKOPT_QPOLICY_ID sets the dequeuing policy for outgoing packets. It takes
51a policy ID as argument and can only be set before the connection (i.e. changes
52during an established connection are not supported). Currently, two policies are
53defined: the "simple" policy (DCCPQ_POLICY_SIMPLE), which does nothing special,
54and a priority-based variant (DCCPQ_POLICY_PRIO). The latter allows to pass an
55u32 priority value as ancillary data to sendmsg(), where higher numbers indicate
56a higher packet priority (similar to SO_PRIORITY). This ancillary data needs to
57be formatted using a cmsg(3) message header filled in as follows:
58 cmsg->cmsg_level = SOL_DCCP;
59 cmsg->cmsg_type = DCCP_SCM_PRIORITY;
60 cmsg->cmsg_len = CMSG_LEN(sizeof(uint32_t)); /* or CMSG_LEN(4) */
61
62DCCP_SOCKOPT_QPOLICY_TXQLEN sets the maximum length of the output queue. A zero
63value is always interpreted as unbounded queue length. If different from zero,
64the interpretation of this parameter depends on the current dequeuing policy
65(see above): the "simple" policy will enforce a fixed queue size by returning
66EAGAIN, whereas the "prio" policy enforces a fixed queue length by dropping the
67lowest-priority packet first. The default value for this parameter is
68initialised from /proc/sys/net/dccp/default/tx_qlen.
48 69
49DCCP_SOCKOPT_SERVICE sets the service. The specification mandates use of 70DCCP_SOCKOPT_SERVICE sets the service. The specification mandates use of
50service codes (RFC 4340, sec. 8.1.2); if this socket option is not set, 71service codes (RFC 4340, sec. 8.1.2); if this socket option is not set,
@@ -112,6 +133,7 @@ DCCP_SOCKOPT_CCID_TX_INFO
112On unidirectional connections it is useful to close the unused half-connection 133On unidirectional connections it is useful to close the unused half-connection
113via shutdown (SHUT_WR or SHUT_RD): this will reduce per-packet processing costs. 134via shutdown (SHUT_WR or SHUT_RD): this will reduce per-packet processing costs.
114 135
136
115Sysctl variables 137Sysctl variables
116================ 138================
117Several DCCP default parameters can be managed by the following sysctls 139Several DCCP default parameters can be managed by the following sysctls
@@ -145,6 +167,7 @@ rx_ccid = 2
145seq_window = 100 167seq_window = 100
146 The initial sequence window (sec. 7.5.2) of the sender. This influences 168 The initial sequence window (sec. 7.5.2) of the sender. This influences
147 the local ackno validity and the remote seqno validity windows (7.5.1). 169 the local ackno validity and the remote seqno validity windows (7.5.1).
170 Values in the range Wmin = 32 (RFC 4340, 7.5.2) up to 2^32-1 can be set.
148 171
149tx_qlen = 5 172tx_qlen = 5
150 The size of the transmit buffer in packets. A value of 0 corresponds 173 The size of the transmit buffer in packets. A value of 0 corresponds
@@ -155,15 +178,30 @@ sync_ratelimit = 125 ms
155 sequence-invalid packets on the same socket (RFC 4340, 7.5.4). The unit 178 sequence-invalid packets on the same socket (RFC 4340, 7.5.4). The unit
156 of this parameter is milliseconds; a value of 0 disables rate-limiting. 179 of this parameter is milliseconds; a value of 0 disables rate-limiting.
157 180
181
158IOCTLS 182IOCTLS
159====== 183======
160FIONREAD 184FIONREAD
161 Works as in udp(7): returns in the `int' argument pointer the size of 185 Works as in udp(7): returns in the `int' argument pointer the size of
162 the next pending datagram in bytes, or 0 when no datagram is pending. 186 the next pending datagram in bytes, or 0 when no datagram is pending.
163 187
188
189Other tunables
190==============
191Per-route rto_min support
192 CCID-2 supports the RTAX_RTO_MIN per-route setting for the minimum value
193 of the RTO timer. This setting can be modified via the 'rto_min' option
194 of iproute2; for example:
195 > ip route change 10.0.0.0/24 rto_min 250j dev wlan0
196 > ip route add 10.0.0.254/32 rto_min 800j dev wlan0
197 > ip route show dev wlan0
198 CCID-3 also supports the rto_min setting: it is used to define the lower
199 bound for the expiry of the nofeedback timer. This can be useful on LANs
200 with very low RTTs (e.g., loopback, Gbit ethernet).
201
202
164Notes 203Notes
165===== 204=====
166
167DCCP does not travel through NAT successfully at present on many boxes. This is 205DCCP does not travel through NAT successfully at present on many boxes. This is
168because the checksum covers the pseudo-header as per TCP and UDP. Linux NAT 206because the checksum covers the pseudo-header as per TCP and UDP. Linux NAT
169support for DCCP has been added. 207support for DCCP has been added.
diff --git a/Documentation/networking/dns_resolver.txt b/Documentation/networking/dns_resolver.txt
index aefd1e681804..7f531ad83285 100644
--- a/Documentation/networking/dns_resolver.txt
+++ b/Documentation/networking/dns_resolver.txt
@@ -61,7 +61,6 @@ before the more general line given above as the first match is the one taken.
61 create dns_resolver foo:* * /usr/sbin/dns.foo %k 61 create dns_resolver foo:* * /usr/sbin/dns.foo %k
62 62
63 63
64
65===== 64=====
66USAGE 65USAGE
67===== 66=====
@@ -104,6 +103,14 @@ implemented in the module can be called after doing:
104 returned also. 103 returned also.
105 104
106 105
106===============================
107READING DNS KEYS FROM USERSPACE
108===============================
109
110Keys of dns_resolver type can be read from userspace using keyctl_read() or
111"keyctl read/print/pipe".
112
113
107========= 114=========
108MECHANISM 115MECHANISM
109========= 116=========
@@ -132,8 +139,8 @@ the key will be discarded and recreated when the data it holds has expired.
132dns_query() returns a copy of the value attached to the key, or an error if 139dns_query() returns a copy of the value attached to the key, or an error if
133that is indicated instead. 140that is indicated instead.
134 141
135See <file:Documentation/keys-request-key.txt> for further information about 142See <file:Documentation/security/keys-request-key.txt> for further
136request-key function. 143information about request-key function.
137 144
138 145
139========= 146=========
diff --git a/Documentation/networking/e100.txt b/Documentation/networking/e100.txt
index 944aa55e79f8..162f323a7a1f 100644
--- a/Documentation/networking/e100.txt
+++ b/Documentation/networking/e100.txt
@@ -72,7 +72,7 @@ Tx Descriptors: Number of transmit descriptors. A transmit descriptor is a data
72 ethtool -G eth? tx n, where n is the number of desired tx descriptors. 72 ethtool -G eth? tx n, where n is the number of desired tx descriptors.
73 73
74Speed/Duplex: The driver auto-negotiates the link speed and duplex settings by 74Speed/Duplex: The driver auto-negotiates the link speed and duplex settings by
75 default. Ethtool can be used as follows to force speed/duplex. 75 default. The ethtool utility can be used as follows to force speed/duplex.
76 76
77 ethtool -s eth? autoneg off speed {10|100} duplex {full|half} 77 ethtool -s eth? autoneg off speed {10|100} duplex {full|half}
78 78
@@ -126,30 +126,21 @@ Additional Configurations
126 ------- 126 -------
127 127
128 The driver utilizes the ethtool interface for driver configuration and 128 The driver utilizes the ethtool interface for driver configuration and
129 diagnostics, as well as displaying statistical information. Ethtool 129 diagnostics, as well as displaying statistical information. The ethtool
130 version 1.6 or later is required for this functionality. 130 version 1.6 or later is required for this functionality.
131 131
132 The latest release of ethtool can be found from 132 The latest release of ethtool can be found from
133 http://sourceforge.net/projects/gkernel. 133 http://ftp.kernel.org/pub/software/network/ethtool/
134
135 NOTE: Ethtool 1.6 only supports a limited set of ethtool options. Support
136 for a more complete ethtool feature set can be enabled by upgrading
137 ethtool to ethtool-1.8.1.
138
139 134
140 Enabling Wake on LAN* (WoL) 135 Enabling Wake on LAN* (WoL)
141 --------------------------- 136 ---------------------------
142 WoL is provided through the Ethtool* utility. Ethtool is included with Red 137 WoL is provided through the ethtool* utility. For instructions on enabling
143 Hat* 8.0. For other Linux distributions, download and install Ethtool from 138 WoL with ethtool, refer to the ethtool man page.
144 the following website: http://sourceforge.net/projects/gkernel.
145
146 For instructions on enabling WoL with Ethtool, refer to the Ethtool man page.
147 139
148 WoL will be enabled on the system during the next shut down or reboot. For 140 WoL will be enabled on the system during the next shut down or reboot. For
149 this driver version, in order to enable WoL, the e100 driver must be 141 this driver version, in order to enable WoL, the e100 driver must be
150 loaded when shutting down or rebooting the system. 142 loaded when shutting down or rebooting the system.
151 143
152
153 NAPI 144 NAPI
154 ---- 145 ----
155 146
diff --git a/Documentation/networking/e1000.txt b/Documentation/networking/e1000.txt
index d9271e74e488..71ca95855671 100644
--- a/Documentation/networking/e1000.txt
+++ b/Documentation/networking/e1000.txt
@@ -79,7 +79,7 @@ InterruptThrottleRate
79--------------------- 79---------------------
80(not supported on Intel(R) 82542, 82543 or 82544-based adapters) 80(not supported on Intel(R) 82542, 82543 or 82544-based adapters)
81Valid Range: 0,1,3,4,100-100000 (0=off, 1=dynamic, 3=dynamic conservative, 81Valid Range: 0,1,3,4,100-100000 (0=off, 1=dynamic, 3=dynamic conservative,
82 4=simplified balancing) 82 4=simplified balancing)
83Default Value: 3 83Default Value: 3
84 84
85The driver can limit the amount of interrupts per second that the adapter 85The driver can limit the amount of interrupts per second that the adapter
@@ -124,8 +124,8 @@ InterruptThrottleRate is set to mode 1. In this mode, which operates
124the same as mode 3, the InterruptThrottleRate will be increased stepwise to 124the same as mode 3, the InterruptThrottleRate will be increased stepwise to
12570000 for traffic in class "Lowest latency". 12570000 for traffic in class "Lowest latency".
126 126
127In simplified mode the interrupt rate is based on the ratio of Tx and 127In simplified mode the interrupt rate is based on the ratio of TX and
128Rx traffic. If the bytes per second rate is approximately equal, the 128RX traffic. If the bytes per second rate is approximately equal, the
129interrupt rate will drop as low as 2000 interrupts per second. If the 129interrupt rate will drop as low as 2000 interrupts per second. If the
130traffic is mostly transmit or mostly receive, the interrupt rate could 130traffic is mostly transmit or mostly receive, the interrupt rate could
131be as high as 8000. 131be as high as 8000.
@@ -245,7 +245,7 @@ NOTE: Depending on the available system resources, the request for a
245TxDescriptorStep 245TxDescriptorStep
246---------------- 246----------------
247Valid Range: 1 (use every Tx Descriptor) 247Valid Range: 1 (use every Tx Descriptor)
248 4 (use every 4th Tx Descriptor) 248 4 (use every 4th Tx Descriptor)
249 249
250Default Value: 1 (use every Tx Descriptor) 250Default Value: 1 (use every Tx Descriptor)
251 251
@@ -312,7 +312,7 @@ Valid Range: 0-xxxxxxx (0=off)
312Default Value: 256 312Default Value: 256
313Usage: insmod e1000.ko copybreak=128 313Usage: insmod e1000.ko copybreak=128
314 314
315Driver copies all packets below or equaling this size to a fresh Rx 315Driver copies all packets below or equaling this size to a fresh RX
316buffer before handing it up the stack. 316buffer before handing it up the stack.
317 317
318This parameter is different than other parameters, in that it is a 318This parameter is different than other parameters, in that it is a
@@ -431,15 +431,15 @@ Additional Configurations
431 Ethtool 431 Ethtool
432 ------- 432 -------
433 The driver utilizes the ethtool interface for driver configuration and 433 The driver utilizes the ethtool interface for driver configuration and
434 diagnostics, as well as displaying statistical information. Ethtool 434 diagnostics, as well as displaying statistical information. The ethtool
435 version 1.6 or later is required for this functionality. 435 version 1.6 or later is required for this functionality.
436 436
437 The latest release of ethtool can be found from 437 The latest release of ethtool can be found from
438 http://sourceforge.net/projects/gkernel. 438 http://ftp.kernel.org/pub/software/network/ethtool/
439 439
440 Enabling Wake on LAN* (WoL) 440 Enabling Wake on LAN* (WoL)
441 --------------------------- 441 ---------------------------
442 WoL is configured through the Ethtool* utility. 442 WoL is configured through the ethtool* utility.
443 443
444 WoL will be enabled on the system during the next shut down or reboot. 444 WoL will be enabled on the system during the next shut down or reboot.
445 For this driver version, in order to enable WoL, the e1000 driver must be 445 For this driver version, in order to enable WoL, the e1000 driver must be
diff --git a/Documentation/networking/e1000e.txt b/Documentation/networking/e1000e.txt
index 6aa048badf32..97b5ba942ebf 100644
--- a/Documentation/networking/e1000e.txt
+++ b/Documentation/networking/e1000e.txt
@@ -1,5 +1,5 @@
1Linux* Driver for Intel(R) Network Connection 1Linux* Driver for Intel(R) Network Connection
2=============================================================== 2=============================================
3 3
4Intel Gigabit Linux driver. 4Intel Gigabit Linux driver.
5Copyright(c) 1999 - 2010 Intel Corporation. 5Copyright(c) 1999 - 2010 Intel Corporation.
@@ -61,6 +61,12 @@ per second, even if more packets have come in. This reduces interrupt
61load on the system and can lower CPU utilization under heavy load, 61load on the system and can lower CPU utilization under heavy load,
62but will increase latency as packets are not processed as quickly. 62but will increase latency as packets are not processed as quickly.
63 63
64The default behaviour of the driver previously assumed a static
65InterruptThrottleRate value of 8000, providing a good fallback value for
66all traffic types, but lacking in small packet performance and latency.
67The hardware can handle many more small packets per second however, and
68for this reason an adaptive interrupt moderation algorithm was implemented.
69
64The driver has two adaptive modes (setting 1 or 3) in which 70The driver has two adaptive modes (setting 1 or 3) in which
65it dynamically adjusts the InterruptThrottleRate value based on the traffic 71it dynamically adjusts the InterruptThrottleRate value based on the traffic
66that it receives. After determining the type of incoming traffic in the last 72that it receives. After determining the type of incoming traffic in the last
@@ -86,8 +92,8 @@ InterruptThrottleRate is set to mode 1. In this mode, which operates
86the same as mode 3, the InterruptThrottleRate will be increased stepwise to 92the same as mode 3, the InterruptThrottleRate will be increased stepwise to
8770000 for traffic in class "Lowest latency". 9370000 for traffic in class "Lowest latency".
88 94
89In simplified mode the interrupt rate is based on the ratio of Tx and 95In simplified mode the interrupt rate is based on the ratio of TX and
90Rx traffic. If the bytes per second rate is approximately equal the 96RX traffic. If the bytes per second rate is approximately equal, the
91interrupt rate will drop as low as 2000 interrupts per second. If the 97interrupt rate will drop as low as 2000 interrupts per second. If the
92traffic is mostly transmit or mostly receive, the interrupt rate could 98traffic is mostly transmit or mostly receive, the interrupt rate could
93be as high as 8000. 99be as high as 8000.
@@ -177,7 +183,7 @@ Copybreak
177Valid Range: 0-xxxxxxx (0=off) 183Valid Range: 0-xxxxxxx (0=off)
178Default Value: 256 184Default Value: 256
179 185
180Driver copies all packets below or equaling this size to a fresh Rx 186Driver copies all packets below or equaling this size to a fresh RX
181buffer before handing it up the stack. 187buffer before handing it up the stack.
182 188
183This parameter is different than other parameters, in that it is a 189This parameter is different than other parameters, in that it is a
@@ -223,17 +229,17 @@ loading or enabling the driver, try disabling this feature.
223 229
224WriteProtectNVM 230WriteProtectNVM
225--------------- 231---------------
226Valid Range: 0-1 232Valid Range: 0,1
227Default Value: 1 (enabled) 233Default Value: 1
228 234
229Set the hardware to ignore all write/erase cycles to the GbE region in the 235If set to 1, configure the hardware to ignore all write/erase cycles to the
230ICHx NVM (non-volatile memory). This feature can be disabled by the 236GbE region in the ICHx NVM (in order to prevent accidental corruption of the
231WriteProtectNVM module parameter (enabled by default) only after a hardware 237NVM). This feature can be disabled by setting the parameter to 0 during initial
232reset, but the machine must be power cycled before trying to enable writes. 238driver load.
233 239NOTE: The machine must be power cycled (full off/on) when enabling NVM writes
234Note: the kernel boot option iomem=relaxed may need to be set if the kernel 240via setting the parameter to zero. Once the NVM has been locked (via the
235config option CONFIG_STRICT_DEVMEM=y, if the root user wants to write the 241parameter at 1 when the driver loads) it cannot be unlocked except via power
236NVM from user space via ethtool. 242cycle.
237 243
238Additional Configurations 244Additional Configurations
239========================= 245=========================
@@ -259,32 +265,30 @@ Additional Configurations
259 - Some adapters limit Jumbo Frames sized packets to a maximum of 265 - Some adapters limit Jumbo Frames sized packets to a maximum of
260 4096 bytes and some adapters do not support Jumbo Frames. 266 4096 bytes and some adapters do not support Jumbo Frames.
261 267
262
263 Ethtool 268 Ethtool
264 ------- 269 -------
265 The driver utilizes the ethtool interface for driver configuration and 270 The driver utilizes the ethtool interface for driver configuration and
266 diagnostics, as well as displaying statistical information. We 271 diagnostics, as well as displaying statistical information. We
267 strongly recommend downloading the latest version of Ethtool at: 272 strongly recommend downloading the latest version of ethtool at:
268 273
269 http://sourceforge.net/projects/gkernel. 274 http://ftp.kernel.org/pub/software/network/ethtool/
270 275
271 Speed and Duplex 276 Speed and Duplex
272 ---------------- 277 ----------------
273 Speed and Duplex are configured through the Ethtool* utility. For 278 Speed and Duplex are configured through the ethtool* utility. For
274 instructions, refer to the Ethtool man page. 279 instructions, refer to the ethtool man page.
275 280
276 Enabling Wake on LAN* (WoL) 281 Enabling Wake on LAN* (WoL)
277 --------------------------- 282 ---------------------------
278 WoL is configured through the Ethtool* utility. For instructions on 283 WoL is configured through the ethtool* utility. For instructions on
279 enabling WoL with Ethtool, refer to the Ethtool man page. 284 enabling WoL with ethtool, refer to the ethtool man page.
280 285
281 WoL will be enabled on the system during the next shut down or reboot. 286 WoL will be enabled on the system during the next shut down or reboot.
282 For this driver version, in order to enable WoL, the e1000e driver must be 287 For this driver version, in order to enable WoL, the e1000e driver must be
283 loaded when shutting down or rebooting the system. 288 loaded when shutting down or rebooting the system.
284 289
285 In most cases Wake On LAN is only supported on port A for multiple port 290 In most cases Wake On LAN is only supported on port A for multiple port
286 adapters. To verify if a port supports Wake on LAN run ethtool eth<X>. 291 adapters. To verify if a port supports Wake on Lan run ethtool eth<X>.
287
288 292
289Support 293Support
290======= 294=======
diff --git a/Documentation/networking/generic_netlink.txt b/Documentation/networking/generic_netlink.txt
index d4f8b8b9b53c..3e071115ca90 100644
--- a/Documentation/networking/generic_netlink.txt
+++ b/Documentation/networking/generic_netlink.txt
@@ -1,3 +1,3 @@
1A wiki document on how to use Generic Netlink can be found here: 1A wiki document on how to use Generic Netlink can be found here:
2 2
3 * http://linux-net.osdl.org/index.php/Generic_Netlink_HOWTO 3 * http://www.linuxfoundation.org/collaborate/workgroups/networking/generic_netlink_howto
diff --git a/Documentation/networking/ieee802154.txt b/Documentation/networking/ieee802154.txt
index 23c995e64032..f41ea2405220 100644
--- a/Documentation/networking/ieee802154.txt
+++ b/Documentation/networking/ieee802154.txt
@@ -9,7 +9,7 @@ The Linux-ZigBee project goal is to provide complete implementation
9of IEEE 802.15.4 / ZigBee / 6LoWPAN protocols. IEEE 802.15.4 is a stack 9of IEEE 802.15.4 / ZigBee / 6LoWPAN protocols. IEEE 802.15.4 is a stack
10of protocols for organizing Low-Rate Wireless Personal Area Networks. 10of protocols for organizing Low-Rate Wireless Personal Area Networks.
11 11
12Currently only IEEE 802.15.4 layer is implemented. We have choosen 12Currently only IEEE 802.15.4 layer is implemented. We have chosen
13to use plain Berkeley socket API, the generic Linux networking stack 13to use plain Berkeley socket API, the generic Linux networking stack
14to transfer IEEE 802.15.4 messages and a special protocol over genetlink 14to transfer IEEE 802.15.4 messages and a special protocol over genetlink
15for configuration/management 15for configuration/management
diff --git a/Documentation/networking/igb.txt b/Documentation/networking/igb.txt
index ab2d71831892..9a2a037194a5 100644
--- a/Documentation/networking/igb.txt
+++ b/Documentation/networking/igb.txt
@@ -36,6 +36,7 @@ Default Value: 0
36This parameter adds support for SR-IOV. It causes the driver to spawn up to 36This parameter adds support for SR-IOV. It causes the driver to spawn up to
37max_vfs worth of virtual function. 37max_vfs worth of virtual function.
38 38
39
39Additional Configurations 40Additional Configurations
40========================= 41=========================
41 42
@@ -60,15 +61,16 @@ Additional Configurations
60 Ethtool 61 Ethtool
61 ------- 62 -------
62 The driver utilizes the ethtool interface for driver configuration and 63 The driver utilizes the ethtool interface for driver configuration and
63 diagnostics, as well as displaying statistical information. 64 diagnostics, as well as displaying statistical information. The latest
65 version of ethtool can be found at:
64 66
65 http://sourceforge.net/projects/gkernel. 67 http://ftp.kernel.org/pub/software/network/ethtool/
66 68
67 Enabling Wake on LAN* (WoL) 69 Enabling Wake on LAN* (WoL)
68 --------------------------- 70 ---------------------------
69 WoL is configured through the Ethtool* utility. 71 WoL is configured through the ethtool* utility.
70 72
71 For instructions on enabling WoL with Ethtool, refer to the Ethtool man page. 73 For instructions on enabling WoL with ethtool, refer to the ethtool man page.
72 74
73 WoL will be enabled on the system during the next shut down or reboot. 75 WoL will be enabled on the system during the next shut down or reboot.
74 For this driver version, in order to enable WoL, the igb driver must be 76 For this driver version, in order to enable WoL, the igb driver must be
@@ -91,30 +93,18 @@ Additional Configurations
91 REQUIREMENTS: MSI-X support is required for Multiqueue. If MSI-X is not 93 REQUIREMENTS: MSI-X support is required for Multiqueue. If MSI-X is not
92 found, the system will fallback to MSI or to Legacy interrupts. 94 found, the system will fallback to MSI or to Legacy interrupts.
93 95
94 LRO 96 MAC and VLAN anti-spoofing feature
95 --- 97 ----------------------------------
96 Large Receive Offload (LRO) is a technique for increasing inbound throughput 98 When a malicious driver attempts to send a spoofed packet, it is dropped by
97 of high-bandwidth network connections by reducing CPU overhead. It works by 99 the hardware and not transmitted. An interrupt is sent to the PF driver
98 aggregating multiple incoming packets from a single stream into a larger 100 notifying it of the spoof attempt.
99 buffer before they are passed higher up the networking stack, thus reducing 101
100 the number of packets that have to be processed. LRO combines multiple 102 When a spoofed packet is detected the PF driver will send the following
101 Ethernet frames into a single receive in the stack, thereby potentially 103 message to the system log (displayed by the "dmesg" command):
102 decreasing CPU utilization for receives. 104
103 105 Spoof event(s) detected on VF(n)
104 NOTE: You need to have inet_lro enabled via either the CONFIG_INET_LRO or 106
105 CONFIG_INET_LRO_MODULE kernel config option. Additionally, if 107 Where n=the VF that attempted to do the spoofing.
106 CONFIG_INET_LRO_MODULE is used, the inet_lro module needs to be loaded
107 before the igb driver.
108
109 You can verify that the driver is using LRO by looking at these counters in
110 Ethtool:
111
112 lro_aggregated - count of total packets that were combined
113 lro_flushed - counts the number of packets flushed out of LRO
114 lro_no_desc - counts the number of times an LRO descriptor was not available
115 for the LRO packet
116
117 NOTE: IPv6 and UDP are not supported by LRO.
118 108
119Support 109Support
120======= 110=======
diff --git a/Documentation/networking/igbvf.txt b/Documentation/networking/igbvf.txt
index 056028138d9c..cbfe4ee65533 100644
--- a/Documentation/networking/igbvf.txt
+++ b/Documentation/networking/igbvf.txt
@@ -58,9 +58,11 @@ Additional Configurations
58 Ethtool 58 Ethtool
59 ------- 59 -------
60 The driver utilizes the ethtool interface for driver configuration and 60 The driver utilizes the ethtool interface for driver configuration and
61 diagnostics, as well as displaying statistical information. 61 diagnostics, as well as displaying statistical information. The ethtool
62 version 3.0 or later is required for this functionality, although we
63 strongly recommend downloading the latest version at:
62 64
63 http://sourceforge.net/projects/gkernel. 65 http://ftp.kernel.org/pub/software/network/ethtool/
64 66
65Support 67Support
66======= 68=======
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index f350c69b2bb4..bfe924217f24 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -11,7 +11,9 @@ ip_forward - BOOLEAN
11 for routers) 11 for routers)
12 12
13ip_default_ttl - INTEGER 13ip_default_ttl - INTEGER
14 default 64 14 Default value of TTL field (Time To Live) for outgoing (but not
15 forwarded) IP packets. Should be between 1 and 255 inclusive.
16 Default: 64 (as recommended by RFC1700)
15 17
16ip_no_pmtu_disc - BOOLEAN 18ip_no_pmtu_disc - BOOLEAN
17 Disable Path MTU Discovery. 19 Disable Path MTU Discovery.
@@ -20,6 +22,15 @@ ip_no_pmtu_disc - BOOLEAN
20min_pmtu - INTEGER 22min_pmtu - INTEGER
21 default 562 - minimum discovered Path MTU 23 default 562 - minimum discovered Path MTU
22 24
25route/max_size - INTEGER
26 Maximum number of routes allowed in the kernel. Increase
27 this when using large numbers of interfaces and/or routes.
28
29neigh/default/gc_thresh3 - INTEGER
30 Maximum number of neighbor entries allowed. Increase this
31 when using large numbers of interfaces and when communicating
32 with large numbers of directly-connected peers.
33
23mtu_expires - INTEGER 34mtu_expires - INTEGER
24 Time, in seconds, that cached PMTU information is kept. 35 Time, in seconds, that cached PMTU information is kept.
25 36
@@ -135,6 +146,7 @@ tcp_adv_win_scale - INTEGER
135 Count buffering overhead as bytes/2^tcp_adv_win_scale 146 Count buffering overhead as bytes/2^tcp_adv_win_scale
136 (if tcp_adv_win_scale > 0) or bytes-bytes/2^(-tcp_adv_win_scale), 147 (if tcp_adv_win_scale > 0) or bytes-bytes/2^(-tcp_adv_win_scale),
137 if it is <= 0. 148 if it is <= 0.
149 Possible values are [-31, 31], inclusive.
138 Default: 2 150 Default: 2
139 151
140tcp_allowed_congestion_control - STRING 152tcp_allowed_congestion_control - STRING
@@ -175,7 +187,7 @@ tcp_cookie_size - INTEGER
175tcp_dsack - BOOLEAN 187tcp_dsack - BOOLEAN
176 Allows TCP to send "duplicate" SACKs. 188 Allows TCP to send "duplicate" SACKs.
177 189
178tcp_ecn - BOOLEAN 190tcp_ecn - INTEGER
179 Enable Explicit Congestion Notification (ECN) in TCP. ECN is only 191 Enable Explicit Congestion Notification (ECN) in TCP. ECN is only
180 used when both ends of the TCP flow support it. It is useful to 192 used when both ends of the TCP flow support it. It is useful to
181 avoid losses due to congestion (when the bottleneck router supports 193 avoid losses due to congestion (when the bottleneck router supports
@@ -268,6 +280,17 @@ tcp_max_orphans - INTEGER
268 more aggressively. Let me to remind again: each orphan eats 280 more aggressively. Let me to remind again: each orphan eats
269 up to ~64K of unswappable memory. 281 up to ~64K of unswappable memory.
270 282
283tcp_max_ssthresh - INTEGER
284 Limited Slow-Start for TCP with large congestion windows (cwnd) defined in
285 RFC3742. Limited slow-start is a mechanism to limit growth of the cwnd
286 on the region where cwnd is larger than tcp_max_ssthresh. TCP increases cwnd
287 by at most tcp_max_ssthresh segments, and by at least tcp_max_ssthresh/2
288 segments per RTT when the cwnd is above tcp_max_ssthresh.
289 If TCP connection increased cwnd to thousands (or tens of thousands) segments,
290 and thousands of packets were being dropped during slow-start, you can set
291 tcp_max_ssthresh to improve performance for new TCP connection.
292 Default: 0 (off)
293
271tcp_max_syn_backlog - INTEGER 294tcp_max_syn_backlog - INTEGER
272 Maximal number of remembered connection requests, which are 295 Maximal number of remembered connection requests, which are
273 still did not receive an acknowledgment from connecting client. 296 still did not receive an acknowledgment from connecting client.
@@ -323,7 +346,7 @@ tcp_orphan_retries - INTEGER
323 when RTO retransmissions remain unacknowledged. 346 when RTO retransmissions remain unacknowledged.
324 See tcp_retries2 for more details. 347 See tcp_retries2 for more details.
325 348
326 The default value is 7. 349 The default value is 8.
327 If your machine is a loaded WEB server, 350 If your machine is a loaded WEB server,
328 you should think about lowering this value, such sockets 351 you should think about lowering this value, such sockets
329 may consume significant resources. Cf. tcp_max_orphans. 352 may consume significant resources. Cf. tcp_max_orphans.
@@ -698,10 +721,28 @@ igmp_max_memberships - INTEGER
698 Change the maximum number of multicast groups we can subscribe to. 721 Change the maximum number of multicast groups we can subscribe to.
699 Default: 20 722 Default: 20
700 723
701conf/interface/* changes special settings per interface (where "interface" is 724 Theoretical maximum value is bounded by having to send a membership
702 the name of your network interface) 725 report in a single datagram (i.e. the report can't span multiple
703conf/all/* is special, changes the settings for all interfaces 726 datagrams, or risk confusing the switch and leaving groups you don't
727 intend to).
728
729 The number of supported groups 'M' is bounded by the number of group
730 report entries you can fit into a single datagram of 65535 bytes.
731
732 M = 65536-sizeof (ip header)/(sizeof(Group record))
733
734 Group records are variable length, with a minimum of 12 bytes.
735 So net.ipv4.igmp_max_memberships should not be set higher than:
736
737 (65536-24) / 12 = 5459
738
739 The value 5459 assumes no IP header options, so in practice
740 this number may be lower.
704 741
742 conf/interface/* changes special settings per interface (where
743 "interface" is the name of your network interface)
744
745 conf/all/* is special, changes the settings for all interfaces
705 746
706log_martians - BOOLEAN 747log_martians - BOOLEAN
707 Log packets with impossible addresses to kernel log. 748 Log packets with impossible addresses to kernel log.
@@ -1014,6 +1055,12 @@ conf/interface/*:
1014accept_ra - BOOLEAN 1055accept_ra - BOOLEAN
1015 Accept Router Advertisements; autoconfigure using them. 1056 Accept Router Advertisements; autoconfigure using them.
1016 1057
1058 Possible values are:
1059 0 Do not accept Router Advertisements.
1060 1 Accept Router Advertisements if forwarding is disabled.
1061 2 Overrule forwarding behaviour. Accept Router Advertisements
1062 even if forwarding is enabled.
1063
1017 Functional default: enabled if local forwarding is disabled. 1064 Functional default: enabled if local forwarding is disabled.
1018 disabled if local forwarding is enabled. 1065 disabled if local forwarding is enabled.
1019 1066
@@ -1075,7 +1122,12 @@ forwarding - BOOLEAN
1075 Note: It is recommended to have the same setting on all 1122 Note: It is recommended to have the same setting on all
1076 interfaces; mixed router/host scenarios are rather uncommon. 1123 interfaces; mixed router/host scenarios are rather uncommon.
1077 1124
1078 FALSE: 1125 Possible values are:
1126 0 Forwarding disabled
1127 1 Forwarding enabled
1128 2 Forwarding enabled (Hybrid Mode)
1129
1130 FALSE (0):
1079 1131
1080 By default, Host behaviour is assumed. This means: 1132 By default, Host behaviour is assumed. This means:
1081 1133
@@ -1085,18 +1137,24 @@ forwarding - BOOLEAN
1085 Advertisements (and do autoconfiguration). 1137 Advertisements (and do autoconfiguration).
1086 4. If accept_redirects is TRUE (default), accept Redirects. 1138 4. If accept_redirects is TRUE (default), accept Redirects.
1087 1139
1088 TRUE: 1140 TRUE (1):
1089 1141
1090 If local forwarding is enabled, Router behaviour is assumed. 1142 If local forwarding is enabled, Router behaviour is assumed.
1091 This means exactly the reverse from the above: 1143 This means exactly the reverse from the above:
1092 1144
1093 1. IsRouter flag is set in Neighbour Advertisements. 1145 1. IsRouter flag is set in Neighbour Advertisements.
1094 2. Router Solicitations are not sent. 1146 2. Router Solicitations are not sent.
1095 3. Router Advertisements are ignored. 1147 3. Router Advertisements are ignored unless accept_ra is 2.
1096 4. Redirects are ignored. 1148 4. Redirects are ignored.
1097 1149
1098 Default: FALSE if global forwarding is disabled (default), 1150 TRUE (2):
1099 otherwise TRUE. 1151
1152 Hybrid mode. Same behaviour as TRUE, except for:
1153
1154 2. Router Solicitations are being sent when necessary.
1155
1156 Default: 0 (disabled) if global forwarding is disabled (default),
1157 otherwise 1 (enabled).
1100 1158
1101hop_limit - INTEGER 1159hop_limit - INTEGER
1102 Default Hop Limit to set. 1160 Default Hop Limit to set.
diff --git a/Documentation/networking/ixgb.txt b/Documentation/networking/ixgb.txt
index a0d0ffb5e584..e196f16df313 100644
--- a/Documentation/networking/ixgb.txt
+++ b/Documentation/networking/ixgb.txt
@@ -309,15 +309,15 @@ Additional Configurations
309 Ethtool 309 Ethtool
310 ------- 310 -------
311 The driver utilizes the ethtool interface for driver configuration and 311 The driver utilizes the ethtool interface for driver configuration and
312 diagnostics, as well as displaying statistical information. Ethtool 312 diagnostics, as well as displaying statistical information. The ethtool
313 version 1.6 or later is required for this functionality. 313 version 1.6 or later is required for this functionality.
314 314
315 The latest release of ethtool can be found from 315 The latest release of ethtool can be found from
316 http://sourceforge.net/projects/gkernel 316 http://ftp.kernel.org/pub/software/network/ethtool/
317 317
318 NOTE: Ethtool 1.6 only supports a limited set of ethtool options. Support 318 NOTE: The ethtool version 1.6 only supports a limited set of ethtool options.
319 for a more complete ethtool feature set can be enabled by upgrading 319 Support for a more complete ethtool feature set can be enabled by
320 to the latest version. 320 upgrading to the latest version.
321 321
322 322
323 NAPI 323 NAPI
diff --git a/Documentation/networking/ixgbe.txt b/Documentation/networking/ixgbe.txt
index eeb68685c788..af77ed3c4172 100644
--- a/Documentation/networking/ixgbe.txt
+++ b/Documentation/networking/ixgbe.txt
@@ -1,107 +1,126 @@
1Linux Base Driver for 10 Gigabit PCI Express Intel(R) Network Connection 1Linux Base Driver for 10 Gigabit PCI Express Intel(R) Network Connection
2======================================================================== 2========================================================================
3 3
4March 10, 2009 4Intel Gigabit Linux driver.
5 5Copyright(c) 1999 - 2010 Intel Corporation.
6 6
7Contents 7Contents
8======== 8========
9 9
10- In This Release
11- Identifying Your Adapter 10- Identifying Your Adapter
12- Building and Installation
13- Additional Configurations 11- Additional Configurations
12- Performance Tuning
13- Known Issues
14- Support 14- Support
15 15
16Identifying Your Adapter
17========================
16 18
19The driver in this release is compatible with 82598 and 82599-based Intel
20Network Connections.
17 21
18In This Release 22For more information on how to identify your adapter, go to the Adapter &
19=============== 23Driver ID Guide at:
20 24
21This file describes the ixgbe Linux Base Driver for the 10 Gigabit PCI 25 http://support.intel.com/support/network/sb/CS-012904.htm
22Express Intel(R) Network Connection. This driver includes support for
23Itanium(R)2-based systems.
24 26
25For questions related to hardware requirements, refer to the documentation 27SFP+ Devices with Pluggable Optics
26supplied with your 10 Gigabit adapter. All hardware requirements listed apply 28----------------------------------
27to use with Linux.
28 29
29The following features are available in this kernel: 3082599-BASED ADAPTERS
30 - Native VLANs
31 - Channel Bonding (teaming)
32 - SNMP
33 - Generic Receive Offload
34 - Data Center Bridging
35 31
36Channel Bonding documentation can be found in the Linux kernel source: 32NOTES: If your 82599-based Intel(R) Network Adapter came with Intel optics, or
37/Documentation/networking/bonding.txt 33is an Intel(R) Ethernet Server Adapter X520-2, then it only supports Intel
34optics and/or the direct attach cables listed below.
38 35
39Ethtool, lspci, and ifconfig can be used to display device and driver 36When 82599-based SFP+ devices are connected back to back, they should be set to
40specific information. 37the same Speed setting via ethtool. Results may vary if you mix speed settings.
3882598-based adapters support all passive direct attach cables that comply
39with SFF-8431 v4.1 and SFF-8472 v10.4 specifications. Active direct attach
40cables are not supported.
41 41
42Supplier Type Part Numbers
42 43
43Identifying Your Adapter 44SR Modules
44======================== 45Intel DUAL RATE 1G/10G SFP+ SR (bailed) FTLX8571D3BCV-IT
46Intel DUAL RATE 1G/10G SFP+ SR (bailed) AFBR-703SDDZ-IN1
47Intel DUAL RATE 1G/10G SFP+ SR (bailed) AFBR-703SDZ-IN2
48LR Modules
49Intel DUAL RATE 1G/10G SFP+ LR (bailed) FTLX1471D3BCV-IT
50Intel DUAL RATE 1G/10G SFP+ LR (bailed) AFCT-701SDDZ-IN1
51Intel DUAL RATE 1G/10G SFP+ LR (bailed) AFCT-701SDZ-IN2
45 52
46This driver supports devices based on the 82598 controller and the 82599 53The following is a list of 3rd party SFP+ modules and direct attach cables that
47controller. 54have received some testing. Not all modules are applicable to all devices.
48 55
49For specific information on identifying which adapter you have, please visit: 56Supplier Type Part Numbers
50 57
51 http://support.intel.com/support/network/sb/CS-008441.htm 58Finisar SFP+ SR bailed, 10g single rate FTLX8571D3BCL
59Avago SFP+ SR bailed, 10g single rate AFBR-700SDZ
60Finisar SFP+ LR bailed, 10g single rate FTLX1471D3BCL
52 61
62Finisar DUAL RATE 1G/10G SFP+ SR (No Bail) FTLX8571D3QCV-IT
63Avago DUAL RATE 1G/10G SFP+ SR (No Bail) AFBR-703SDZ-IN1
64Finisar DUAL RATE 1G/10G SFP+ LR (No Bail) FTLX1471D3QCV-IT
65Avago DUAL RATE 1G/10G SFP+ LR (No Bail) AFCT-701SDZ-IN1
66Finistar 1000BASE-T SFP FCLF8522P2BTL
67Avago 1000BASE-T SFP ABCU-5710RZ
53 68
54Building and Installation 6982599-based adapters support all passive and active limiting direct attach
55========================= 70cables that comply with SFF-8431 v4.1 and SFF-8472 v10.4 specifications.
56 71
57select m for "Intel(R) 10GbE PCI Express adapters support" located at: 72Laser turns off for SFP+ when ifconfig down
58 Location: 73-------------------------------------------
59 -> Device Drivers 74"ifconfig down" turns off the laser for 82599-based SFP+ fiber adapters.
60 -> Network device support (NETDEVICES [=y]) 75"ifconfig up" turns on the later.
61 -> Ethernet (10000 Mbit) (NETDEV_10000 [=y])
62 76
631. make modules & make modules_install
64 77
652. Load the module: 7882598-BASED ADAPTERS
66 79
67# modprobe ixgbe 80NOTES for 82598-Based Adapters:
81- Intel(R) Network Adapters that support removable optical modules only support
82 their original module type (i.e., the Intel(R) 10 Gigabit SR Dual Port
83 Express Module only supports SR optical modules). If you plug in a different
84 type of module, the driver will not load.
85- Hot Swapping/hot plugging optical modules is not supported.
86- Only single speed, 10 gigabit modules are supported.
87- LAN on Motherboard (LOMs) may support DA, SR, or LR modules. Other module
88 types are not supported. Please see your system documentation for details.
68 89
69 The insmod command can be used if the full 90The following is a list of 3rd party SFP+ modules and direct attach cables that
70 path to the driver module is specified. For example: 91have received some testing. Not all modules are applicable to all devices.
71 92
72 insmod /lib/modules/<KERNEL VERSION>/kernel/drivers/net/ixgbe/ixgbe.ko 93Supplier Type Part Numbers
73 94
74 With 2.6 based kernels also make sure that older ixgbe drivers are 95Finisar SFP+ SR bailed, 10g single rate FTLX8571D3BCL
75 removed from the kernel, before loading the new module: 96Avago SFP+ SR bailed, 10g single rate AFBR-700SDZ
97Finisar SFP+ LR bailed, 10g single rate FTLX1471D3BCL
76 98
77 rmmod ixgbe; modprobe ixgbe 9982598-based adapters support all passive direct attach cables that comply
100with SFF-8431 v4.1 and SFF-8472 v10.4 specifications. Active direct attach
101cables are not supported.
78 102
793. Assign an IP address to the interface by entering the following, where
80 x is the interface number:
81 103
82 ifconfig ethx <IP_address> 104Flow Control
105------------
106Ethernet Flow Control (IEEE 802.3x) can be configured with ethtool to enable
107receiving and transmitting pause frames for ixgbe. When TX is enabled, PAUSE
108frames are generated when the receive packet buffer crosses a predefined
109threshold. When rx is enabled, the transmit unit will halt for the time delay
110specified when a PAUSE frame is received.
83 111
844. Verify that the interface works. Enter the following, where <IP_address> 112Flow Control is enabled by default. If you want to disable a flow control
85 is the IP address for another machine on the same subnet as the interface 113capable link partner, use ethtool:
86 that is being tested:
87 114
88 ping <IP_address> 115 ethtool -A eth? autoneg off RX off TX off
89 116
117NOTE: For 82598 backplane cards entering 1 gig mode, flow control default
118behavior is changed to off. Flow control in 1 gig mode on these devices can
119lead to Tx hangs.
90 120
91Additional Configurations 121Additional Configurations
92========================= 122=========================
93 123
94 Viewing Link Messages
95 ---------------------
96 Link messages will not be displayed to the console if the distribution is
97 restricting system messages. In order to see network driver link messages on
98 your console, set dmesg to eight by entering the following:
99
100 dmesg -n 8
101
102 NOTE: This setting is not saved across reboots.
103
104
105 Jumbo Frames 124 Jumbo Frames
106 ------------ 125 ------------
107 The driver supports Jumbo Frames for all adapters. Jumbo Frames support is 126 The driver supports Jumbo Frames for all adapters. Jumbo Frames support is
@@ -123,13 +142,8 @@ Additional Configurations
123 other protocols besides TCP. It's also safe to use with configurations that 142 other protocols besides TCP. It's also safe to use with configurations that
124 are problematic for LRO, namely bridging and iSCSI. 143 are problematic for LRO, namely bridging and iSCSI.
125 144
126 GRO is enabled by default in the driver. Future versions of ethtool will
127 support disabling and re-enabling GRO on the fly.
128
129
130 Data Center Bridging, aka DCB 145 Data Center Bridging, aka DCB
131 ----------------------------- 146 -----------------------------
132
133 DCB is a configuration Quality of Service implementation in hardware. 147 DCB is a configuration Quality of Service implementation in hardware.
134 It uses the VLAN priority tag (802.1p) to filter traffic. That means 148 It uses the VLAN priority tag (802.1p) to filter traffic. That means
135 that there are 8 different priorities that traffic can be filtered into. 149 that there are 8 different priorities that traffic can be filtered into.
@@ -163,24 +177,71 @@ Additional Configurations
163 177
164 http://e1000.sf.net 178 http://e1000.sf.net
165 179
166
167 Ethtool 180 Ethtool
168 ------- 181 -------
169 The driver utilizes the ethtool interface for driver configuration and 182 The driver utilizes the ethtool interface for driver configuration and
170 diagnostics, as well as displaying statistical information. Ethtool 183 diagnostics, as well as displaying statistical information. The latest
171 version 3.0 or later is required for this functionality. 184 ethtool version is required for this functionality.
172 185
173 The latest release of ethtool can be found from 186 The latest release of ethtool can be found from
174 http://sourceforge.net/projects/gkernel. 187 http://ftp.kernel.org/pub/software/network/ethtool/
175 188
176 189 FCoE
177 NAPI
178 ---- 190 ----
191 This release of the ixgbe driver contains new code to enable users to use
192 Fiber Channel over Ethernet (FCoE) and Data Center Bridging (DCB)
193 functionality that is supported by the 82598-based hardware. This code has
194 no default effect on the regular driver operation, and configuring DCB and
195 FCoE is outside the scope of this driver README. Refer to
196 http://www.open-fcoe.org/ for FCoE project information and contact
197 e1000-eedc@lists.sourceforge.net for DCB information.
198
199 MAC and VLAN anti-spoofing feature
200 ----------------------------------
201 When a malicious driver attempts to send a spoofed packet, it is dropped by
202 the hardware and not transmitted. An interrupt is sent to the PF driver
203 notifying it of the spoof attempt.
204
205 When a spoofed packet is detected the PF driver will send the following
206 message to the system log (displayed by the "dmesg" command):
207
208 Spoof event(s) detected on VF (n)
209
210 Where n=the VF that attempted to do the spoofing.
211
212
213Performance Tuning
214==================
215
216An excellent article on performance tuning can be found at:
217
218http://www.redhat.com/promo/summit/2008/downloads/pdf/Thursday/Mark_Wagner.pdf
219
220
221Known Issues
222============
223
224 Enabling SR-IOV in a 32-bit Microsoft* Windows* Server 2008 Guest OS using
225 Intel (R) 82576-based GbE or Intel (R) 82599-based 10GbE controller under KVM
226 -----------------------------------------------------------------------------
227 KVM Hypervisor/VMM supports direct assignment of a PCIe device to a VM. This
228 includes traditional PCIe devices, as well as SR-IOV-capable devices using
229 Intel 82576-based and 82599-based controllers.
230
231 While direct assignment of a PCIe device or an SR-IOV Virtual Function (VF)
232 to a Linux-based VM running 2.6.32 or later kernel works fine, there is a
233 known issue with Microsoft Windows Server 2008 VM that results in a "yellow
234 bang" error. This problem is within the KVM VMM itself, not the Intel driver,
235 or the SR-IOV logic of the VMM, but rather that KVM emulates an older CPU
236 model for the guests, and this older CPU model does not support MSI-X
237 interrupts, which is a requirement for Intel SR-IOV.
179 238
180 NAPI (Rx polling mode) is supported in the ixgbe driver. NAPI is enabled 239 If you wish to use the Intel 82576 or 82599-based controllers in SR-IOV mode
181 by default in the driver. 240 with KVM and a Microsoft Windows Server 2008 guest try the following
241 workaround. The workaround is to tell KVM to emulate a different model of CPU
242 when using qemu to create the KVM guest:
182 243
183 See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI. 244 "-cpu qemu64,model=13"
184 245
185 246
186Support 247Support
diff --git a/Documentation/networking/ixgbevf.txt b/Documentation/networking/ixgbevf.txt
index 21dd5d15b6b4..5a91a41fa946 100644
--- a/Documentation/networking/ixgbevf.txt
+++ b/Documentation/networking/ixgbevf.txt
@@ -35,10 +35,6 @@ Driver ID Guide at:
35Known Issues/Troubleshooting 35Known Issues/Troubleshooting
36============================ 36============================
37 37
38 Unloading Physical Function (PF) Driver Causes System Reboots When VM is
39 Running and VF is Loaded on the VM
40 ------------------------------------------------------------------------
41 Do not unload the PF driver (ixgbe) while VFs are assigned to guests.
42 38
43Support 39Support
44======= 40=======
diff --git a/Documentation/networking/olympic.txt b/Documentation/networking/olympic.txt
index c65a94010ea8..b95b5bf96751 100644
--- a/Documentation/networking/olympic.txt
+++ b/Documentation/networking/olympic.txt
@@ -65,7 +65,7 @@ together.
65 65
66Variable MTU size: 66Variable MTU size:
67 67
68The driver can handle a MTU size upto either 4500 or 18000 depending upon 68The driver can handle a MTU size up to either 4500 or 18000 depending upon
69ring speed. The driver also changes the size of the receive buffers as part 69ring speed. The driver also changes the size of the receive buffers as part
70of the mtu re-sizing, so if you set mtu = 18000, you will need to be able 70of the mtu re-sizing, so if you set mtu = 18000, you will need to be able
71to allocate 16 * (sk_buff with 18000 buffer size) call it 18500 bytes per ring 71to allocate 16 * (sk_buff with 18000 buffer size) call it 18500 bytes per ring
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt
index 073894d1c093..4acea6603720 100644
--- a/Documentation/networking/packet_mmap.txt
+++ b/Documentation/networking/packet_mmap.txt
@@ -223,7 +223,7 @@ we will get the following buffer structure:
223 223
224A frame can be of any size with the only condition it can fit in a block. A block 224A frame can be of any size with the only condition it can fit in a block. A block
225can only hold an integer number of frames, or in other words, a frame cannot 225can only hold an integer number of frames, or in other words, a frame cannot
226be spawned accross two blocks, so there are some details you have to take into 226be spawned across two blocks, so there are some details you have to take into
227account when choosing the frame_size. See "Mapping and use of the circular 227account when choosing the frame_size. See "Mapping and use of the circular
228buffer (ring)". 228buffer (ring)".
229 229
diff --git a/Documentation/networking/phonet.txt b/Documentation/networking/phonet.txt
index 6e8ce09f9c73..81003581f47a 100644
--- a/Documentation/networking/phonet.txt
+++ b/Documentation/networking/phonet.txt
@@ -112,6 +112,22 @@ However, connect() and getpeername() are not supported, as they did
112not seem useful with Phonet usages (could be added easily). 112not seem useful with Phonet usages (could be added easily).
113 113
114 114
115Resource subscription
116---------------------
117
118A Phonet datagram socket can be subscribed to any number of 8-bits
119Phonet resources, as follow:
120
121 uint32_t res = 0xXX;
122 ioctl(fd, SIOCPNADDRESOURCE, &res);
123
124Subscription is similarly cancelled using the SIOCPNDELRESOURCE I/O
125control request, or when the socket is closed.
126
127Note that no more than one socket can be subcribed to any given
128resource at a time. If not, ioctl() will return EBUSY.
129
130
115Phonet Pipe protocol 131Phonet Pipe protocol
116-------------------- 132--------------------
117 133
@@ -138,9 +154,28 @@ connections, one per accept()'d socket.
138 write(cfd, msg, msglen); 154 write(cfd, msg, msglen);
139 } 155 }
140 156
141Connections are established between two endpoints by a "third party" 157Connections are traditionally established between two endpoints by a
142application. This means that both endpoints are passive; so connect() 158"third party" application. This means that both endpoints are passive.
143is not possible. 159
160
161As of Linux kernel version 2.6.39, it is also possible to connect
162two endpoints directly, using connect() on the active side. This is
163intended to support the newer Nokia Wireless Modem API, as found in
164e.g. the Nokia Slim Modem in the ST-Ericsson U8500 platform:
165
166 struct sockaddr_spn spn;
167 int fd;
168
169 fd = socket(PF_PHONET, SOCK_SEQPACKET, PN_PROTO_PIPE);
170 memset(&spn, 0, sizeof(spn));
171 spn.spn_family = AF_PHONET;
172 spn.spn_obj = ...;
173 spn.spn_dev = ...;
174 spn.spn_resource = 0xD9;
175 connect(fd, (struct sockaddr *)&spn, sizeof(spn));
176 /* normal I/O here ... */
177 close(fd);
178
144 179
145WARNING: 180WARNING:
146When polling a connected pipe socket for writability, there is an 181When polling a connected pipe socket for writability, there is an
@@ -165,6 +200,10 @@ The pipe protocol provides two socket options at the SOL_PNPIPE level:
165 interface index of the network interface created by PNPIPE_ENCAP, 200 interface index of the network interface created by PNPIPE_ENCAP,
166 or zero if encapsulation is off. 201 or zero if encapsulation is off.
167 202
203 PNPIPE_HANDLE is a read-only integer value. It contains the underlying
204 identifier ("pipe handle") of the pipe. This is only defined for
205 socket descriptors that are already connected or being connected.
206
168 207
169Authors 208Authors
170------- 209-------
diff --git a/Documentation/networking/phy.txt b/Documentation/networking/phy.txt
index 88bb71b46da4..9eb1ba52013d 100644
--- a/Documentation/networking/phy.txt
+++ b/Documentation/networking/phy.txt
@@ -177,18 +177,6 @@ Doing it all yourself
177 177
178 A convenience function to print out the PHY status neatly. 178 A convenience function to print out the PHY status neatly.
179 179
180 int phy_clear_interrupt(struct phy_device *phydev);
181 int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
182
183 Clear the PHY's interrupt, and configure which ones are allowed,
184 respectively. Currently only supports all on, or all off.
185
186 int phy_enable_interrupts(struct phy_device *phydev);
187 int phy_disable_interrupts(struct phy_device *phydev);
188
189 Functions which enable/disable PHY interrupts, clearing them
190 before and after, respectively.
191
192 int phy_start_interrupts(struct phy_device *phydev); 180 int phy_start_interrupts(struct phy_device *phydev);
193 int phy_stop_interrupts(struct phy_device *phydev); 181 int phy_stop_interrupts(struct phy_device *phydev);
194 182
@@ -213,12 +201,6 @@ Doing it all yourself
213 Fills the phydev structure with up-to-date information about the current 201 Fills the phydev structure with up-to-date information about the current
214 settings in the PHY. 202 settings in the PHY.
215 203
216 void phy_sanitize_settings(struct phy_device *phydev)
217
218 Resolves differences between currently desired settings, and
219 supported settings for the given PHY device. Does not make
220 the changes in the hardware, though.
221
222 int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); 204 int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
223 int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); 205 int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
224 206
diff --git a/Documentation/networking/s2io.txt b/Documentation/networking/s2io.txt
index 9d4e0f4df5a8..4be0c039edbc 100644
--- a/Documentation/networking/s2io.txt
+++ b/Documentation/networking/s2io.txt
@@ -37,7 +37,7 @@ To associate an interface with a physical adapter use "ethtool -p <ethX>".
37The corresponding adapter's LED will blink multiple times. 37The corresponding adapter's LED will blink multiple times.
38 38
393. Features supported: 393. Features supported:
40a. Jumbo frames. Xframe I/II supports MTU upto 9600 bytes, 40a. Jumbo frames. Xframe I/II supports MTU up to 9600 bytes,
41modifiable using ifconfig command. 41modifiable using ifconfig command.
42 42
43b. Offloads. Supports checksum offload(TCP/UDP/IP) on transmit 43b. Offloads. Supports checksum offload(TCP/UDP/IP) on transmit
@@ -49,7 +49,7 @@ significant performance improvement on certain platforms(SGI Altix,
49IBM xSeries). 49IBM xSeries).
50 50
51d. MSI/MSI-X. Can be enabled on platforms which support this feature 51d. MSI/MSI-X. Can be enabled on platforms which support this feature
52(IA64, Xeon) resulting in noticeable performance improvement(upto 7% 52(IA64, Xeon) resulting in noticeable performance improvement(up to 7%
53on certain platforms). 53on certain platforms).
54 54
55e. Statistics. Comprehensive MAC-level and software statistics displayed 55e. Statistics. Comprehensive MAC-level and software statistics displayed
diff --git a/Documentation/networking/stmmac.txt b/Documentation/networking/stmmac.txt
index 7ee770b5ef5f..80a7a3454902 100644
--- a/Documentation/networking/stmmac.txt
+++ b/Documentation/networking/stmmac.txt
@@ -7,7 +7,7 @@ This is the driver for the MAC 10/100/1000 on-chip Ethernet controllers
7(Synopsys IP blocks); it has been fully tested on STLinux platforms. 7(Synopsys IP blocks); it has been fully tested on STLinux platforms.
8 8
9Currently this network device driver is for all STM embedded MAC/GMAC 9Currently this network device driver is for all STM embedded MAC/GMAC
10(7xxx SoCs). 10(7xxx SoCs). Other platforms start using it i.e. ARM SPEAr.
11 11
12DWC Ether MAC 10/100/1000 Universal version 3.41a and DWC Ether MAC 10/100 12DWC Ether MAC 10/100/1000 Universal version 3.41a and DWC Ether MAC 10/100
13Universal version 4.0 have been used for developing the first code 13Universal version 4.0 have been used for developing the first code
@@ -95,9 +95,14 @@ Several information came from the platform; please refer to the
95driver's Header file in include/linux directory. 95driver's Header file in include/linux directory.
96 96
97struct plat_stmmacenet_data { 97struct plat_stmmacenet_data {
98 int bus_id; 98 int bus_id;
99 int pbl; 99 int pbl;
100 int has_gmac; 100 int clk_csr;
101 int has_gmac;
102 int enh_desc;
103 int tx_coe;
104 int bugged_jumbo;
105 int pmt;
101 void (*fix_mac_speed)(void *priv, unsigned int speed); 106 void (*fix_mac_speed)(void *priv, unsigned int speed);
102 void (*bus_setup)(unsigned long ioaddr); 107 void (*bus_setup)(unsigned long ioaddr);
103#ifdef CONFIG_STM_DRIVERS 108#ifdef CONFIG_STM_DRIVERS
@@ -114,6 +119,12 @@ Where:
114 registers (on STM platforms); 119 registers (on STM platforms);
115- has_gmac: GMAC core is on board (get it at run-time in the next step); 120- has_gmac: GMAC core is on board (get it at run-time in the next step);
116- bus_id: bus identifier. 121- bus_id: bus identifier.
122- tx_coe: core is able to perform the tx csum in HW.
123- enh_desc: if sets the MAC will use the enhanced descriptor structure.
124- clk_csr: CSR Clock range selection.
125- bugged_jumbo: some HWs are not able to perform the csum in HW for
126 over-sized frames due to limited buffer sizes. Setting this
127 flag the csum will be done in SW on JUMBO frames.
117 128
118struct plat_stmmacphy_data { 129struct plat_stmmacphy_data {
119 int bus_id; 130 int bus_id;
@@ -131,13 +142,28 @@ Where:
131- interface: physical MII interface mode; 142- interface: physical MII interface mode;
132- phy_reset: hook to reset HW function. 143- phy_reset: hook to reset HW function.
133 144
145SOURCES:
146- Kconfig
147- Makefile
148- stmmac_main.c: main network device driver;
149- stmmac_mdio.c: mdio functions;
150- stmmac_ethtool.c: ethtool support;
151- stmmac_timer.[ch]: timer code used for mitigating the driver dma interrupts
152 Only tested on ST40 platforms based.
153- stmmac.h: private driver structure;
154- common.h: common definitions and VFTs;
155- descs.h: descriptor structure definitions;
156- dwmac1000_core.c: GMAC core functions;
157- dwmac1000_dma.c: dma functions for the GMAC chip;
158- dwmac1000.h: specific header file for the GMAC;
159- dwmac100_core: MAC 100 core and dma code;
160- dwmac100_dma.c: dma funtions for the MAC chip;
161- dwmac1000.h: specific header file for the MAC;
162- dwmac_lib.c: generic DMA functions shared among chips
163- enh_desc.c: functions for handling enhanced descriptors
164- norm_desc.c: functions for handling normal descriptors
165
134TODO: 166TODO:
135- Continue to make the driver more generic and suitable for other Synopsys 167- XGMAC controller is not supported.
136 Ethernet controllers used on other architectures (i.e. ARM).
137- 10G controllers are not supported.
138- MAC uses Normal descriptors and GMAC uses enhanced ones.
139 This is a limit that should be reviewed. MAC could want to
140 use the enhanced structure.
141- Checksumming: Rx/Tx csum is done in HW in case of GMAC only.
142- Review the timer optimisation code to use an embedded device that seems to be 168- Review the timer optimisation code to use an embedded device that seems to be
143 available in new chip generations. 169 available in new chip generations.
diff --git a/Documentation/networking/tc-actions-env-rules.txt b/Documentation/networking/tc-actions-env-rules.txt
index dcadf6f88e34..70d6cf608251 100644
--- a/Documentation/networking/tc-actions-env-rules.txt
+++ b/Documentation/networking/tc-actions-env-rules.txt
@@ -1,5 +1,5 @@
1 1
2The "enviromental" rules for authors of any new tc actions are: 2The "environmental" rules for authors of any new tc actions are:
3 3
41) If you stealeth or borroweth any packet thou shalt be branching 41) If you stealeth or borroweth any packet thou shalt be branching
5from the righteous path and thou shalt cloneth. 5from the righteous path and thou shalt cloneth.
@@ -20,7 +20,7 @@ this way any action downstream can stomp on the packet.
203) Dropping packets you don't own is a no-no. You simply return 203) Dropping packets you don't own is a no-no. You simply return
21TC_ACT_SHOT to the caller and they will drop it. 21TC_ACT_SHOT to the caller and they will drop it.
22 22
23The "enviromental" rules for callers of actions (qdiscs etc) are: 23The "environmental" rules for callers of actions (qdiscs etc) are:
24 24
25*) Thou art responsible for freeing anything returned as being 25*) Thou art responsible for freeing anything returned as being
26TC_ACT_SHOT/STOLEN/QUEUED. If none of TC_ACT_SHOT/STOLEN/QUEUED is 26TC_ACT_SHOT/STOLEN/QUEUED. If none of TC_ACT_SHOT/STOLEN/QUEUED is
diff --git a/Documentation/networking/timestamping.txt b/Documentation/networking/timestamping.txt
index e8c8f4f06c67..98097d8cb910 100644
--- a/Documentation/networking/timestamping.txt
+++ b/Documentation/networking/timestamping.txt
@@ -172,15 +172,19 @@ struct skb_shared_hwtstamps {
172}; 172};
173 173
174Time stamps for outgoing packets are to be generated as follows: 174Time stamps for outgoing packets are to be generated as follows:
175- In hard_start_xmit(), check if skb_tx(skb)->hardware is set no-zero. 175- In hard_start_xmit(), check if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)
176 If yes, then the driver is expected to do hardware time stamping. 176 is set no-zero. If yes, then the driver is expected to do hardware time
177 stamping.
177- If this is possible for the skb and requested, then declare 178- If this is possible for the skb and requested, then declare
178 that the driver is doing the time stamping by setting the field 179 that the driver is doing the time stamping by setting the flag
179 skb_tx(skb)->in_progress non-zero. You might want to keep a pointer 180 SKBTX_IN_PROGRESS in skb_shinfo(skb)->tx_flags , e.g. with
180 to the associated skb for the next step and not free the skb. A driver 181
181 not supporting hardware time stamping doesn't do that. A driver must 182 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
182 never touch sk_buff::tstamp! It is used to store software generated 183
183 time stamps by the network subsystem. 184 You might want to keep a pointer to the associated skb for the next step
185 and not free the skb. A driver not supporting hardware time stamping doesn't
186 do that. A driver must never touch sk_buff::tstamp! It is used to store
187 software generated time stamps by the network subsystem.
184- As soon as the driver has sent the packet and/or obtained a 188- As soon as the driver has sent the packet and/or obtained a
185 hardware time stamp for it, it passes the time stamp back by 189 hardware time stamp for it, it passes the time stamp back by
186 calling skb_hwtstamp_tx() with the original skb, the raw 190 calling skb_hwtstamp_tx() with the original skb, the raw
@@ -191,6 +195,6 @@ Time stamps for outgoing packets are to be generated as follows:
191 this would occur at a later time in the processing pipeline than other 195 this would occur at a later time in the processing pipeline than other
192 software time stamping and therefore could lead to unexpected deltas 196 software time stamping and therefore could lead to unexpected deltas
193 between time stamps. 197 between time stamps.
194- If the driver did not call set skb_tx(skb)->in_progress, then 198- If the driver did not set the SKBTX_IN_PROGRESS flag (see above), then
195 dev_hard_start_xmit() checks whether software time stamping 199 dev_hard_start_xmit() checks whether software time stamping
196 is wanted as fallback and potentially generates the time stamp. 200 is wanted as fallback and potentially generates the time stamp.
diff --git a/Documentation/nfc/nfc-pn544.txt b/Documentation/nfc/nfc-pn544.txt
new file mode 100644
index 000000000000..2fcac9f5996e
--- /dev/null
+++ b/Documentation/nfc/nfc-pn544.txt
@@ -0,0 +1,114 @@
1Kernel driver for the NXP Semiconductors PN544 Near Field
2Communication chip
3
4Author: Jari Vanhala
5Contact: Matti Aaltonen (matti.j.aaltonen at nokia.com)
6
7General
8-------
9
10The PN544 is an integrated transmission module for contactless
11communication. The driver goes under drives/nfc/ and is compiled as a
12module named "pn544". It registers a misc device and creates a device
13file named "/dev/pn544".
14
15Host Interfaces: I2C, SPI and HSU, this driver supports currently only I2C.
16
17The Interface
18-------------
19
20The driver offers a sysfs interface for a hardware test and an IOCTL
21interface for selecting between two operating modes. There are read,
22write and poll functions for transferring messages. The two operating
23modes are the normal (HCI) mode and the firmware update mode.
24
25PN544 is controlled by sending messages from the userspace to the
26chip. The main function of the driver is just to pass those messages
27without caring about the message content.
28
29
30Protocols
31---------
32
33In the normal (HCI) mode and in the firmware update mode read and
34write functions behave a bit differently because the message formats
35or the protocols are different.
36
37In the normal (HCI) mode the protocol used is derived from the ETSI
38HCI specification. The firmware is updated using a specific protocol,
39which is different from HCI.
40
41HCI messages consist of an eight bit header and the message body. The
42header contains the message length. Maximum size for an HCI message is
4333. In HCI mode sent messages are tested for a correct
44checksum. Firmware update messages have the length in the second (MSB)
45and third (LSB) bytes of the message. The maximum FW message length is
461024 bytes.
47
48For the ETSI HCI specification see
49http://www.etsi.org/WebSite/Technologies/ProtocolSpecification.aspx
50
51The Hardware Test
52-----------------
53
54The idea of the test is that it can performed by reading from the
55corresponding sysfs file. The test is implemented in the board file
56and it should test that PN544 can be put into the firmware update
57mode. If the test is not implemented the sysfs file does not get
58created.
59
60Example:
61> cat /sys/module/pn544/drivers/i2c\:pn544/3-002b/nfc_test
621
63
64Normal Operation
65----------------
66
67PN544 is powered up when the device file is opened, otherwise it's
68turned off. Only one instance can use the device at a time.
69
70Userspace applications control PN544 with HCI messages. The hardware
71sends an interrupt when data is available for reading. Data is
72physically read when the read function is called by a userspace
73application. Poll() checks the read interrupt state. Configuration and
74self testing are also done from the userspace using read and write.
75
76Example platform data:
77
78static int rx71_pn544_nfc_request_resources(struct i2c_client *client)
79{
80 /* Get and setup the HW resources for the device */
81}
82
83static void rx71_pn544_nfc_free_resources(void)
84{
85 /* Release the HW resources */
86}
87
88static void rx71_pn544_nfc_enable(int fw)
89{
90 /* Turn the device on */
91}
92
93static int rx71_pn544_nfc_test(void)
94{
95 /*
96 * Put the device into the FW update mode
97 * and then back to the normal mode.
98 * Check the behavior and return one on success,
99 * zero on failure.
100 */
101}
102
103static void rx71_pn544_nfc_disable(void)
104{
105 /* turn the power off */
106}
107
108static struct pn544_nfc_platform_data rx71_nfc_data = {
109 .request_resources = rx71_pn544_nfc_request_resources,
110 .free_resources = rx71_pn544_nfc_free_resources,
111 .enable = rx71_pn544_nfc_enable,
112 .test = rx71_pn544_nfc_test,
113 .disable = rx71_pn544_nfc_disable,
114};
diff --git a/Documentation/pcmcia/driver-changes.txt b/Documentation/pcmcia/driver-changes.txt
index 26c0f9c00545..dd04361dd361 100644
--- a/Documentation/pcmcia/driver-changes.txt
+++ b/Documentation/pcmcia/driver-changes.txt
@@ -1,4 +1,29 @@
1This file details changes in 2.6 which affect PCMCIA card driver authors: 1This file details changes in 2.6 which affect PCMCIA card driver authors:
2* pcmcia_loop_config() and autoconfiguration (as of 2.6.36)
3 If struct pcmcia_device *p_dev->config_flags is set accordingly,
4 pcmcia_loop_config() now sets up certain configuration values
5 automatically, though the driver may still override the settings
6 in the callback function. The following autoconfiguration options
7 are provided at the moment:
8 CONF_AUTO_CHECK_VCC : check for matching Vcc
9 CONF_AUTO_SET_VPP : set Vpp
10 CONF_AUTO_AUDIO : auto-enable audio line, if required
11 CONF_AUTO_SET_IO : set ioport resources (->resource[0,1])
12 CONF_AUTO_SET_IOMEM : set first iomem resource (->resource[2])
13
14* pcmcia_request_configuration -> pcmcia_enable_device (as of 2.6.36)
15 pcmcia_request_configuration() got renamed to pcmcia_enable_device(),
16 as it mirrors pcmcia_disable_device(). Configuration settings are now
17 stored in struct pcmcia_device, e.g. in the fields config_flags,
18 config_index, config_base, vpp.
19
20* pcmcia_request_window changes (as of 2.6.36)
21 Instead of win_req_t, drivers are now requested to fill out
22 struct pcmcia_device *p_dev->resource[2,3,4,5] for up to four ioport
23 ranges. After a call to pcmcia_request_window(), the regions found there
24 are reserved and may be used immediately -- until pcmcia_release_window()
25 is called.
26
2* pcmcia_request_io changes (as of 2.6.36) 27* pcmcia_request_io changes (as of 2.6.36)
3 Instead of io_req_t, drivers are now requested to fill out 28 Instead of io_req_t, drivers are now requested to fill out
4 struct pcmcia_device *p_dev->resource[0,1] for up to two ioport 29 struct pcmcia_device *p_dev->resource[0,1] for up to two ioport
diff --git a/Documentation/power/00-INDEX b/Documentation/power/00-INDEX
index fb742c213c9e..45e9d4a91284 100644
--- a/Documentation/power/00-INDEX
+++ b/Documentation/power/00-INDEX
@@ -14,6 +14,8 @@ interface.txt
14 - Power management user interface in /sys/power 14 - Power management user interface in /sys/power
15notifiers.txt 15notifiers.txt
16 - Registering suspend notifiers in device drivers 16 - Registering suspend notifiers in device drivers
17opp.txt
18 - Operating Performance Point library
17pci.txt 19pci.txt
18 - How the PCI Subsystem Does Power Management 20 - How the PCI Subsystem Does Power Management
19pm_qos_interface.txt 21pm_qos_interface.txt
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
index 57080cd74575..64565aac6e40 100644
--- a/Documentation/power/devices.txt
+++ b/Documentation/power/devices.txt
@@ -1,6 +1,6 @@
1Device Power Management 1Device Power Management
2 2
3Copyright (c) 2010 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. 3Copyright (c) 2010-2011 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc.
4Copyright (c) 2010 Alan Stern <stern@rowland.harvard.edu> 4Copyright (c) 2010 Alan Stern <stern@rowland.harvard.edu>
5 5
6 6
@@ -159,18 +159,18 @@ matter, and the kernel is responsible for keeping track of it. By contrast,
159whether or not a wakeup-capable device should issue wakeup events is a policy 159whether or not a wakeup-capable device should issue wakeup events is a policy
160decision, and it is managed by user space through a sysfs attribute: the 160decision, and it is managed by user space through a sysfs attribute: the
161power/wakeup file. User space can write the strings "enabled" or "disabled" to 161power/wakeup file. User space can write the strings "enabled" or "disabled" to
162set or clear the should_wakeup flag, respectively. Reads from the file will 162set or clear the "should_wakeup" flag, respectively. This file is only present
163return the corresponding string if can_wakeup is true, but if can_wakeup is 163for wakeup-capable devices (i.e. devices whose "can_wakeup" flags are set)
164false then reads will return an empty string, to indicate that the device 164and is created (or removed) by device_set_wakeup_capable(). Reads from the
165doesn't support wakeup events. (But even though the file appears empty, writes 165file will return the corresponding string.
166will still affect the should_wakeup flag.)
167 166
168The device_may_wakeup() routine returns true only if both flags are set. 167The device_may_wakeup() routine returns true only if both flags are set.
169Drivers should check this routine when putting devices in a low-power state 168This information is used by subsystems, like the PCI bus type code, to see
170during a system sleep transition, to see whether or not to enable the devices' 169whether or not to enable the devices' wakeup mechanisms. If device wakeup
171wakeup mechanisms. However for runtime power management, wakeup events should 170mechanisms are enabled or disabled directly by drivers, they also should use
172be enabled whenever the device and driver both support them, regardless of the 171device_may_wakeup() to decide what to do during a system sleep transition.
173should_wakeup flag. 172However for runtime power management, wakeup events should be enabled whenever
173the device and driver both support them, regardless of the should_wakeup flag.
174 174
175 175
176/sys/devices/.../power/control files 176/sys/devices/.../power/control files
@@ -249,23 +249,18 @@ various phases always run after tasks have been frozen and before they are
249unfrozen. Furthermore, the *_noirq phases run at a time when IRQ handlers have 249unfrozen. Furthermore, the *_noirq phases run at a time when IRQ handlers have
250been disabled (except for those marked with the IRQ_WAKEUP flag). 250been disabled (except for those marked with the IRQ_WAKEUP flag).
251 251
252Most phases use bus, type, and class callbacks (that is, methods defined in 252All phases use bus, type, or class callbacks (that is, methods defined in
253dev->bus->pm, dev->type->pm, and dev->class->pm). The prepare and complete 253dev->bus->pm, dev->type->pm, or dev->class->pm). These callbacks are mutually
254phases are exceptions; they use only bus callbacks. When multiple callbacks 254exclusive, so if the device type provides a struct dev_pm_ops object pointed to
255are used in a phase, they are invoked in the order: <class, type, bus> during 255by its pm field (i.e. both dev->type and dev->type->pm are defined), the
256power-down transitions and in the opposite order during power-up transitions. 256callbacks included in that object (i.e. dev->type->pm) will be used. Otherwise,
257For example, during the suspend phase the PM core invokes 257if the class provides a struct dev_pm_ops object pointed to by its pm field
258 258(i.e. both dev->class and dev->class->pm are defined), the PM core will use the
259 dev->class->pm.suspend(dev); 259callbacks from that object (i.e. dev->class->pm). Finally, if the pm fields of
260 dev->type->pm.suspend(dev); 260both the device type and class objects are NULL (or those objects do not exist),
261 dev->bus->pm.suspend(dev); 261the callbacks provided by the bus (that is, the callbacks from dev->bus->pm)
262 262will be used (this allows device types to override callbacks provided by bus
263before moving on to the next device, whereas during the resume phase the core 263types or classes if necessary).
264invokes
265
266 dev->bus->pm.resume(dev);
267 dev->type->pm.resume(dev);
268 dev->class->pm.resume(dev);
269 264
270These callbacks may in turn invoke device- or driver-specific methods stored in 265These callbacks may in turn invoke device- or driver-specific methods stored in
271dev->driver->pm, but they don't have to. 266dev->driver->pm, but they don't have to.
@@ -284,11 +279,15 @@ When the system goes into the standby or memory sleep state, the phases are:
284 time.) Unlike the other suspend-related phases, during the prepare 279 time.) Unlike the other suspend-related phases, during the prepare
285 phase the device tree is traversed top-down. 280 phase the device tree is traversed top-down.
286 281
287 The prepare phase uses only a bus callback. After the callback method 282 In addition to that, if device drivers need to allocate additional
288 returns, no new children may be registered below the device. The method 283 memory to be able to hadle device suspend correctly, that should be
289 may also prepare the device or driver in some way for the upcoming 284 done in the prepare phase.
290 system power transition, but it should not put the device into a 285
291 low-power state. 286 After the prepare callback method returns, no new children may be
287 registered below the device. The method may also prepare the device or
288 driver in some way for the upcoming system power transition (for
289 example, by allocating additional memory required for this purpose), but
290 it should not put the device into a low-power state.
292 291
293 2. The suspend methods should quiesce the device to stop it from performing 292 2. The suspend methods should quiesce the device to stop it from performing
294 I/O. They also may save the device registers and put it into the 293 I/O. They also may save the device registers and put it into the
@@ -372,7 +371,7 @@ Drivers need to be able to handle hardware which has been reset since the
372suspend methods were called, for example by complete reinitialization. 371suspend methods were called, for example by complete reinitialization.
373This may be the hardest part, and the one most protected by NDA'd documents 372This may be the hardest part, and the one most protected by NDA'd documents
374and chip errata. It's simplest if the hardware state hasn't changed since 373and chip errata. It's simplest if the hardware state hasn't changed since
375the suspend was carried out, but that can't be guaranteed (in fact, it ususally 374the suspend was carried out, but that can't be guaranteed (in fact, it usually
376is not the case). 375is not the case).
377 376
378Drivers must also be prepared to notice that the device has been removed 377Drivers must also be prepared to notice that the device has been removed
@@ -507,30 +506,34 @@ routines. Nevertheless, different callback pointers are used in case there is a
507situation where it actually matters. 506situation where it actually matters.
508 507
509 508
510System Devices 509Device Power Domains
511-------------- 510--------------------
512System devices (sysdevs) follow a slightly different API, which can be found in 511Sometimes devices share reference clocks or other power resources. In those
513 512cases it generally is not possible to put devices into low-power states
514 include/linux/sysdev.h 513individually. Instead, a set of devices sharing a power resource can be put
515 drivers/base/sys.c 514into a low-power state together at the same time by turning off the shared
516 515power resource. Of course, they also need to be put into the full-power state
517System devices will be suspended with interrupts disabled, and after all other 516together, by turning the shared power resource on. A set of devices with this
518devices have been suspended. On resume, they will be resumed before any other 517property is often referred to as a power domain.
519devices, and also with interrupts disabled. These things occur in special 518
520"sysdev_driver" phases, which affect only system devices. 519Support for power domains is provided through the pwr_domain field of struct
521 520device. This field is a pointer to an object of type struct dev_power_domain,
522Thus, after the suspend_noirq (or freeze_noirq or poweroff_noirq) phase, when 521defined in include/linux/pm.h, providing a set of power management callbacks
523the non-boot CPUs are all offline and IRQs are disabled on the remaining online 522analogous to the subsystem-level and device driver callbacks that are executed
524CPU, then a sysdev_driver.suspend phase is carried out, and the system enters a 523for the given device during all power transitions, instead of the respective
525sleep state (or a system image is created). During resume (or after the image 524subsystem-level callbacks. Specifically, if a device's pm_domain pointer is
526has been created or loaded) a sysdev_driver.resume phase is carried out, IRQs 525not NULL, the ->suspend() callback from the object pointed to by it will be
527are enabled on the only online CPU, the non-boot CPUs are enabled, and the 526executed instead of its subsystem's (e.g. bus type's) ->suspend() callback and
528resume_noirq (or thaw_noirq or restore_noirq) phase begins. 527anlogously for all of the remaining callbacks. In other words, power management
529 528domain callbacks, if defined for the given device, always take precedence over
530Code to actually enter and exit the system-wide low power state sometimes 529the callbacks provided by the device's subsystem (e.g. bus type).
531involves hardware details that are only known to the boot firmware, and 530
532may leave a CPU running software (from SRAM or flash memory) that monitors 531The support for device power management domains is only relevant to platforms
533the system and manages its wakeup sequence. 532needing to use the same device driver power management callbacks in many
533different power domain configurations and wanting to avoid incorporating the
534support for power domains into subsystem-level callbacks, for example by
535modifying the platform bus type. Other platforms need not implement it or take
536it into account in any way.
534 537
535 538
536Device Low Power (suspend) States 539Device Low Power (suspend) States
diff --git a/Documentation/power/drivers-testing.txt b/Documentation/power/drivers-testing.txt
index 7f7a737f7f9f..638afdf4d6b8 100644
--- a/Documentation/power/drivers-testing.txt
+++ b/Documentation/power/drivers-testing.txt
@@ -23,10 +23,10 @@ Once you have resolved the suspend/resume-related problems with your test system
23without the new driver, you are ready to test it: 23without the new driver, you are ready to test it:
24 24
25a) Build the driver as a module, load it and try the test modes of hibernation 25a) Build the driver as a module, load it and try the test modes of hibernation
26 (see: Documents/power/basic-pm-debugging.txt, 1). 26 (see: Documentation/power/basic-pm-debugging.txt, 1).
27 27
28b) Load the driver and attempt to hibernate in the "reboot", "shutdown" and 28b) Load the driver and attempt to hibernate in the "reboot", "shutdown" and
29 "platform" modes (see: Documents/power/basic-pm-debugging.txt, 1). 29 "platform" modes (see: Documentation/power/basic-pm-debugging.txt, 1).
30 30
31c) Compile the driver directly into the kernel and try the test modes of 31c) Compile the driver directly into the kernel and try the test modes of
32 hibernation. 32 hibernation.
@@ -34,12 +34,12 @@ c) Compile the driver directly into the kernel and try the test modes of
34d) Attempt to hibernate with the driver compiled directly into the kernel 34d) Attempt to hibernate with the driver compiled directly into the kernel
35 in the "reboot", "shutdown" and "platform" modes. 35 in the "reboot", "shutdown" and "platform" modes.
36 36
37e) Try the test modes of suspend (see: Documents/power/basic-pm-debugging.txt, 37e) Try the test modes of suspend (see: Documentation/power/basic-pm-debugging.txt,
38 2). [As far as the STR tests are concerned, it should not matter whether or 38 2). [As far as the STR tests are concerned, it should not matter whether or
39 not the driver is built as a module.] 39 not the driver is built as a module.]
40 40
41f) Attempt to suspend to RAM using the s2ram tool with the driver loaded 41f) Attempt to suspend to RAM using the s2ram tool with the driver loaded
42 (see: Documents/power/basic-pm-debugging.txt, 2). 42 (see: Documentation/power/basic-pm-debugging.txt, 2).
43 43
44Each of the above tests should be repeated several times and the STD tests 44Each of the above tests should be repeated several times and the STD tests
45should be mixed with the STR tests. If any of them fails, the driver cannot be 45should be mixed with the STR tests. If any of them fails, the driver cannot be
diff --git a/Documentation/power/interface.txt b/Documentation/power/interface.txt
index e67211fe0ee2..c537834af005 100644
--- a/Documentation/power/interface.txt
+++ b/Documentation/power/interface.txt
@@ -57,7 +57,7 @@ smallest image possible. In particular, if "0" is written to this file, the
57suspend image will be as small as possible. 57suspend image will be as small as possible.
58 58
59Reading from this file will display the current image size limit, which 59Reading from this file will display the current image size limit, which
60is set to 500 MB by default. 60is set to 2/5 of available RAM by default.
61 61
62/sys/power/pm_trace controls the code which saves the last PM event point in 62/sys/power/pm_trace controls the code which saves the last PM event point in
63the RTC across reboots, so that you can debug a machine that just hangs 63the RTC across reboots, so that you can debug a machine that just hangs
diff --git a/Documentation/power/notifiers.txt b/Documentation/power/notifiers.txt
index ae1b7ec07684..c2a4a346c0d9 100644
--- a/Documentation/power/notifiers.txt
+++ b/Documentation/power/notifiers.txt
@@ -1,46 +1,41 @@
1Suspend notifiers 1Suspend notifiers
2 (C) 2007 Rafael J. Wysocki <rjw@sisk.pl>, GPL 2 (C) 2007-2011 Rafael J. Wysocki <rjw@sisk.pl>, GPL
3 3
4There are some operations that device drivers may want to carry out in their 4There are some operations that subsystems or drivers may want to carry out
5.suspend() routines, but shouldn't, because they can cause the hibernation or 5before hibernation/suspend or after restore/resume, but they require the system
6suspend to fail. For example, a driver may want to allocate a substantial amount 6to be fully functional, so the drivers' and subsystems' .suspend() and .resume()
7of memory (like 50 MB) in .suspend(), but that shouldn't be done after the 7or even .prepare() and .complete() callbacks are not suitable for this purpose.
8swsusp's memory shrinker has run. 8For example, device drivers may want to upload firmware to their devices after
9 9resume/restore, but they cannot do it by calling request_firmware() from their
10Also, there may be some operations, that subsystems want to carry out before a 10.resume() or .complete() routines (user land processes are frozen at these
11hibernation/suspend or after a restore/resume, requiring the system to be fully 11points). The solution may be to load the firmware into memory before processes
12functional, so the drivers' .suspend() and .resume() routines are not suitable 12are frozen and upload it from there in the .resume() routine.
13for this purpose. For example, device drivers may want to upload firmware to 13A suspend/hibernation notifier may be used for this purpose.
14their devices after a restore from a hibernation image, but they cannot do it by 14
15calling request_firmware() from their .resume() routines (user land processes 15The subsystems or drivers having such needs can register suspend notifiers that
16are frozen at this point). The solution may be to load the firmware into 16will be called upon the following events by the PM core:
17memory before processes are frozen and upload it from there in the .resume()
18routine. Of course, a hibernation notifier may be used for this purpose.
19
20The subsystems that have such needs can register suspend notifiers that will be
21called upon the following events by the suspend core:
22 17
23PM_HIBERNATION_PREPARE The system is going to hibernate or suspend, tasks will 18PM_HIBERNATION_PREPARE The system is going to hibernate or suspend, tasks will
24 be frozen immediately. 19 be frozen immediately.
25 20
26PM_POST_HIBERNATION The system memory state has been restored from a 21PM_POST_HIBERNATION The system memory state has been restored from a
27 hibernation image or an error occured during the 22 hibernation image or an error occurred during
28 hibernation. Device drivers' .resume() callbacks have 23 hibernation. Device drivers' restore callbacks have
29 been executed and tasks have been thawed. 24 been executed and tasks have been thawed.
30 25
31PM_RESTORE_PREPARE The system is going to restore a hibernation image. 26PM_RESTORE_PREPARE The system is going to restore a hibernation image.
32 If all goes well the restored kernel will issue a 27 If all goes well, the restored kernel will issue a
33 PM_POST_HIBERNATION notification. 28 PM_POST_HIBERNATION notification.
34 29
35PM_POST_RESTORE An error occurred during the hibernation restore. 30PM_POST_RESTORE An error occurred during restore from hibernation.
36 Device drivers' .resume() callbacks have been executed 31 Device drivers' restore callbacks have been executed
37 and tasks have been thawed. 32 and tasks have been thawed.
38 33
39PM_SUSPEND_PREPARE The system is preparing for a suspend. 34PM_SUSPEND_PREPARE The system is preparing for suspend.
40 35
41PM_POST_SUSPEND The system has just resumed or an error occured during 36PM_POST_SUSPEND The system has just resumed or an error occurred during
42 the suspend. Device drivers' .resume() callbacks have 37 suspend. Device drivers' resume callbacks have been
43 been executed and tasks have been thawed. 38 executed and tasks have been thawed.
44 39
45It is generally assumed that whatever the notifiers do for 40It is generally assumed that whatever the notifiers do for
46PM_HIBERNATION_PREPARE, should be undone for PM_POST_HIBERNATION. Analogously, 41PM_HIBERNATION_PREPARE, should be undone for PM_POST_HIBERNATION. Analogously,
diff --git a/Documentation/power/opp.txt b/Documentation/power/opp.txt
new file mode 100644
index 000000000000..5ae70a12c1e2
--- /dev/null
+++ b/Documentation/power/opp.txt
@@ -0,0 +1,378 @@
1*=============*
2* OPP Library *
3*=============*
4
5(C) 2009-2010 Nishanth Menon <nm@ti.com>, Texas Instruments Incorporated
6
7Contents
8--------
91. Introduction
102. Initial OPP List Registration
113. OPP Search Functions
124. OPP Availability Control Functions
135. OPP Data Retrieval Functions
146. Cpufreq Table Generation
157. Data Structures
16
171. Introduction
18===============
19Complex SoCs of today consists of a multiple sub-modules working in conjunction.
20In an operational system executing varied use cases, not all modules in the SoC
21need to function at their highest performing frequency all the time. To
22facilitate this, sub-modules in a SoC are grouped into domains, allowing some
23domains to run at lower voltage and frequency while other domains are loaded
24more. The set of discrete tuples consisting of frequency and voltage pairs that
25the device will support per domain are called Operating Performance Points or
26OPPs.
27
28OPP library provides a set of helper functions to organize and query the OPP
29information. The library is located in drivers/base/power/opp.c and the header
30is located in include/linux/opp.h. OPP library can be enabled by enabling
31CONFIG_PM_OPP from power management menuconfig menu. OPP library depends on
32CONFIG_PM as certain SoCs such as Texas Instrument's OMAP framework allows to
33optionally boot at a certain OPP without needing cpufreq.
34
35Typical usage of the OPP library is as follows:
36(users) -> registers a set of default OPPs -> (library)
37SoC framework -> modifies on required cases certain OPPs -> OPP layer
38 -> queries to search/retrieve information ->
39
40Architectures that provide a SoC framework for OPP should select ARCH_HAS_OPP
41to make the OPP layer available.
42
43OPP layer expects each domain to be represented by a unique device pointer. SoC
44framework registers a set of initial OPPs per device with the OPP layer. This
45list is expected to be an optimally small number typically around 5 per device.
46This initial list contains a set of OPPs that the framework expects to be safely
47enabled by default in the system.
48
49Note on OPP Availability:
50------------------------
51As the system proceeds to operate, SoC framework may choose to make certain
52OPPs available or not available on each device based on various external
53factors. Example usage: Thermal management or other exceptional situations where
54SoC framework might choose to disable a higher frequency OPP to safely continue
55operations until that OPP could be re-enabled if possible.
56
57OPP library facilitates this concept in it's implementation. The following
58operational functions operate only on available opps:
59opp_find_freq_{ceil, floor}, opp_get_voltage, opp_get_freq, opp_get_opp_count
60and opp_init_cpufreq_table
61
62opp_find_freq_exact is meant to be used to find the opp pointer which can then
63be used for opp_enable/disable functions to make an opp available as required.
64
65WARNING: Users of OPP library should refresh their availability count using
66get_opp_count if opp_enable/disable functions are invoked for a device, the
67exact mechanism to trigger these or the notification mechanism to other
68dependent subsystems such as cpufreq are left to the discretion of the SoC
69specific framework which uses the OPP library. Similar care needs to be taken
70care to refresh the cpufreq table in cases of these operations.
71
72WARNING on OPP List locking mechanism:
73-------------------------------------------------
74OPP library uses RCU for exclusivity. RCU allows the query functions to operate
75in multiple contexts and this synchronization mechanism is optimal for a read
76intensive operations on data structure as the OPP library caters to.
77
78To ensure that the data retrieved are sane, the users such as SoC framework
79should ensure that the section of code operating on OPP queries are locked
80using RCU read locks. The opp_find_freq_{exact,ceil,floor},
81opp_get_{voltage, freq, opp_count} fall into this category.
82
83opp_{add,enable,disable} are updaters which use mutex and implement it's own
84RCU locking mechanisms. opp_init_cpufreq_table acts as an updater and uses
85mutex to implment RCU updater strategy. These functions should *NOT* be called
86under RCU locks and other contexts that prevent blocking functions in RCU or
87mutex operations from working.
88
892. Initial OPP List Registration
90================================
91The SoC implementation calls opp_add function iteratively to add OPPs per
92device. It is expected that the SoC framework will register the OPP entries
93optimally- typical numbers range to be less than 5. The list generated by
94registering the OPPs is maintained by OPP library throughout the device
95operation. The SoC framework can subsequently control the availability of the
96OPPs dynamically using the opp_enable / disable functions.
97
98opp_add - Add a new OPP for a specific domain represented by the device pointer.
99 The OPP is defined using the frequency and voltage. Once added, the OPP
100 is assumed to be available and control of it's availability can be done
101 with the opp_enable/disable functions. OPP library internally stores
102 and manages this information in the opp struct. This function may be
103 used by SoC framework to define a optimal list as per the demands of
104 SoC usage environment.
105
106 WARNING: Do not use this function in interrupt context.
107
108 Example:
109 soc_pm_init()
110 {
111 /* Do things */
112 r = opp_add(mpu_dev, 1000000, 900000);
113 if (!r) {
114 pr_err("%s: unable to register mpu opp(%d)\n", r);
115 goto no_cpufreq;
116 }
117 /* Do cpufreq things */
118 no_cpufreq:
119 /* Do remaining things */
120 }
121
1223. OPP Search Functions
123=======================
124High level framework such as cpufreq operates on frequencies. To map the
125frequency back to the corresponding OPP, OPP library provides handy functions
126to search the OPP list that OPP library internally manages. These search
127functions return the matching pointer representing the opp if a match is
128found, else returns error. These errors are expected to be handled by standard
129error checks such as IS_ERR() and appropriate actions taken by the caller.
130
131opp_find_freq_exact - Search for an OPP based on an *exact* frequency and
132 availability. This function is especially useful to enable an OPP which
133 is not available by default.
134 Example: In a case when SoC framework detects a situation where a
135 higher frequency could be made available, it can use this function to
136 find the OPP prior to call the opp_enable to actually make it available.
137 rcu_read_lock();
138 opp = opp_find_freq_exact(dev, 1000000000, false);
139 rcu_read_unlock();
140 /* dont operate on the pointer.. just do a sanity check.. */
141 if (IS_ERR(opp)) {
142 pr_err("frequency not disabled!\n");
143 /* trigger appropriate actions.. */
144 } else {
145 opp_enable(dev,1000000000);
146 }
147
148 NOTE: This is the only search function that operates on OPPs which are
149 not available.
150
151opp_find_freq_floor - Search for an available OPP which is *at most* the
152 provided frequency. This function is useful while searching for a lesser
153 match OR operating on OPP information in the order of decreasing
154 frequency.
155 Example: To find the highest opp for a device:
156 freq = ULONG_MAX;
157 rcu_read_lock();
158 opp_find_freq_floor(dev, &freq);
159 rcu_read_unlock();
160
161opp_find_freq_ceil - Search for an available OPP which is *at least* the
162 provided frequency. This function is useful while searching for a
163 higher match OR operating on OPP information in the order of increasing
164 frequency.
165 Example 1: To find the lowest opp for a device:
166 freq = 0;
167 rcu_read_lock();
168 opp_find_freq_ceil(dev, &freq);
169 rcu_read_unlock();
170 Example 2: A simplified implementation of a SoC cpufreq_driver->target:
171 soc_cpufreq_target(..)
172 {
173 /* Do stuff like policy checks etc. */
174 /* Find the best frequency match for the req */
175 rcu_read_lock();
176 opp = opp_find_freq_ceil(dev, &freq);
177 rcu_read_unlock();
178 if (!IS_ERR(opp))
179 soc_switch_to_freq_voltage(freq);
180 else
181 /* do something when we can't satisfy the req */
182 /* do other stuff */
183 }
184
1854. OPP Availability Control Functions
186=====================================
187A default OPP list registered with the OPP library may not cater to all possible
188situation. The OPP library provides a set of functions to modify the
189availability of a OPP within the OPP list. This allows SoC frameworks to have
190fine grained dynamic control of which sets of OPPs are operationally available.
191These functions are intended to *temporarily* remove an OPP in conditions such
192as thermal considerations (e.g. don't use OPPx until the temperature drops).
193
194WARNING: Do not use these functions in interrupt context.
195
196opp_enable - Make a OPP available for operation.
197 Example: Lets say that 1GHz OPP is to be made available only if the
198 SoC temperature is lower than a certain threshold. The SoC framework
199 implementation might choose to do something as follows:
200 if (cur_temp < temp_low_thresh) {
201 /* Enable 1GHz if it was disabled */
202 rcu_read_lock();
203 opp = opp_find_freq_exact(dev, 1000000000, false);
204 rcu_read_unlock();
205 /* just error check */
206 if (!IS_ERR(opp))
207 ret = opp_enable(dev, 1000000000);
208 else
209 goto try_something_else;
210 }
211
212opp_disable - Make an OPP to be not available for operation
213 Example: Lets say that 1GHz OPP is to be disabled if the temperature
214 exceeds a threshold value. The SoC framework implementation might
215 choose to do something as follows:
216 if (cur_temp > temp_high_thresh) {
217 /* Disable 1GHz if it was enabled */
218 rcu_read_lock();
219 opp = opp_find_freq_exact(dev, 1000000000, true);
220 rcu_read_unlock();
221 /* just error check */
222 if (!IS_ERR(opp))
223 ret = opp_disable(dev, 1000000000);
224 else
225 goto try_something_else;
226 }
227
2285. OPP Data Retrieval Functions
229===============================
230Since OPP library abstracts away the OPP information, a set of functions to pull
231information from the OPP structure is necessary. Once an OPP pointer is
232retrieved using the search functions, the following functions can be used by SoC
233framework to retrieve the information represented inside the OPP layer.
234
235opp_get_voltage - Retrieve the voltage represented by the opp pointer.
236 Example: At a cpufreq transition to a different frequency, SoC
237 framework requires to set the voltage represented by the OPP using
238 the regulator framework to the Power Management chip providing the
239 voltage.
240 soc_switch_to_freq_voltage(freq)
241 {
242 /* do things */
243 rcu_read_lock();
244 opp = opp_find_freq_ceil(dev, &freq);
245 v = opp_get_voltage(opp);
246 rcu_read_unlock();
247 if (v)
248 regulator_set_voltage(.., v);
249 /* do other things */
250 }
251
252opp_get_freq - Retrieve the freq represented by the opp pointer.
253 Example: Lets say the SoC framework uses a couple of helper functions
254 we could pass opp pointers instead of doing additional parameters to
255 handle quiet a bit of data parameters.
256 soc_cpufreq_target(..)
257 {
258 /* do things.. */
259 max_freq = ULONG_MAX;
260 rcu_read_lock();
261 max_opp = opp_find_freq_floor(dev,&max_freq);
262 requested_opp = opp_find_freq_ceil(dev,&freq);
263 if (!IS_ERR(max_opp) && !IS_ERR(requested_opp))
264 r = soc_test_validity(max_opp, requested_opp);
265 rcu_read_unlock();
266 /* do other things */
267 }
268 soc_test_validity(..)
269 {
270 if(opp_get_voltage(max_opp) < opp_get_voltage(requested_opp))
271 return -EINVAL;
272 if(opp_get_freq(max_opp) < opp_get_freq(requested_opp))
273 return -EINVAL;
274 /* do things.. */
275 }
276
277opp_get_opp_count - Retrieve the number of available opps for a device
278 Example: Lets say a co-processor in the SoC needs to know the available
279 frequencies in a table, the main processor can notify as following:
280 soc_notify_coproc_available_frequencies()
281 {
282 /* Do things */
283 rcu_read_lock();
284 num_available = opp_get_opp_count(dev);
285 speeds = kzalloc(sizeof(u32) * num_available, GFP_KERNEL);
286 /* populate the table in increasing order */
287 freq = 0;
288 while (!IS_ERR(opp = opp_find_freq_ceil(dev, &freq))) {
289 speeds[i] = freq;
290 freq++;
291 i++;
292 }
293 rcu_read_unlock();
294
295 soc_notify_coproc(AVAILABLE_FREQs, speeds, num_available);
296 /* Do other things */
297 }
298
2996. Cpufreq Table Generation
300===========================
301opp_init_cpufreq_table - cpufreq framework typically is initialized with
302 cpufreq_frequency_table_cpuinfo which is provided with the list of
303 frequencies that are available for operation. This function provides
304 a ready to use conversion routine to translate the OPP layer's internal
305 information about the available frequencies into a format readily
306 providable to cpufreq.
307
308 WARNING: Do not use this function in interrupt context.
309
310 Example:
311 soc_pm_init()
312 {
313 /* Do things */
314 r = opp_init_cpufreq_table(dev, &freq_table);
315 if (!r)
316 cpufreq_frequency_table_cpuinfo(policy, freq_table);
317 /* Do other things */
318 }
319
320 NOTE: This function is available only if CONFIG_CPU_FREQ is enabled in
321 addition to CONFIG_PM as power management feature is required to
322 dynamically scale voltage and frequency in a system.
323
3247. Data Structures
325==================
326Typically an SoC contains multiple voltage domains which are variable. Each
327domain is represented by a device pointer. The relationship to OPP can be
328represented as follows:
329SoC
330 |- device 1
331 | |- opp 1 (availability, freq, voltage)
332 | |- opp 2 ..
333 ... ...
334 | `- opp n ..
335 |- device 2
336 ...
337 `- device m
338
339OPP library maintains a internal list that the SoC framework populates and
340accessed by various functions as described above. However, the structures
341representing the actual OPPs and domains are internal to the OPP library itself
342to allow for suitable abstraction reusable across systems.
343
344struct opp - The internal data structure of OPP library which is used to
345 represent an OPP. In addition to the freq, voltage, availability
346 information, it also contains internal book keeping information required
347 for the OPP library to operate on. Pointer to this structure is
348 provided back to the users such as SoC framework to be used as a
349 identifier for OPP in the interactions with OPP layer.
350
351 WARNING: The struct opp pointer should not be parsed or modified by the
352 users. The defaults of for an instance is populated by opp_add, but the
353 availability of the OPP can be modified by opp_enable/disable functions.
354
355struct device - This is used to identify a domain to the OPP layer. The
356 nature of the device and it's implementation is left to the user of
357 OPP library such as the SoC framework.
358
359Overall, in a simplistic view, the data structure operations is represented as
360following:
361
362Initialization / modification:
363 +-----+ /- opp_enable
364opp_add --> | opp | <-------
365 | +-----+ \- opp_disable
366 \-------> domain_info(device)
367
368Search functions:
369 /-- opp_find_freq_ceil ---\ +-----+
370domain_info<---- opp_find_freq_exact -----> | opp |
371 \-- opp_find_freq_floor ---/ +-----+
372
373Retrieval functions:
374+-----+ /- opp_get_voltage
375| opp | <---
376+-----+ \- opp_get_freq
377
378domain_info <- opp_get_opp_count
diff --git a/Documentation/power/regulator/machine.txt b/Documentation/power/regulator/machine.txt
index bdec39b9bd75..b42419b52e44 100644
--- a/Documentation/power/regulator/machine.txt
+++ b/Documentation/power/regulator/machine.txt
@@ -53,11 +53,11 @@ static struct regulator_init_data regulator1_data = {
53 53
54Regulator-1 supplies power to Regulator-2. This relationship must be registered 54Regulator-1 supplies power to Regulator-2. This relationship must be registered
55with the core so that Regulator-1 is also enabled when Consumer A enables its 55with the core so that Regulator-1 is also enabled when Consumer A enables its
56supply (Regulator-2). The supply regulator is set by the supply_regulator_dev 56supply (Regulator-2). The supply regulator is set by the supply_regulator
57field below:- 57field below:-
58 58
59static struct regulator_init_data regulator2_data = { 59static struct regulator_init_data regulator2_data = {
60 .supply_regulator_dev = &platform_regulator1_device.dev, 60 .supply_regulator = "regulator_name",
61 .constraints = { 61 .constraints = {
62 .min_uV = 1800000, 62 .min_uV = 1800000,
63 .max_uV = 2000000, 63 .max_uV = 2000000,
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
index 55b859b3bc72..b24875b1ced5 100644
--- a/Documentation/power/runtime_pm.txt
+++ b/Documentation/power/runtime_pm.txt
@@ -1,6 +1,7 @@
1Run-time Power Management Framework for I/O Devices 1Run-time Power Management Framework for I/O Devices
2 2
3(C) 2009 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. 3(C) 2009-2011 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc.
4(C) 2010 Alan Stern <stern@rowland.harvard.edu>
4 5
51. Introduction 61. Introduction
6 7
@@ -43,11 +44,21 @@ struct dev_pm_ops {
43}; 44};
44 45
45The ->runtime_suspend(), ->runtime_resume() and ->runtime_idle() callbacks are 46The ->runtime_suspend(), ->runtime_resume() and ->runtime_idle() callbacks are
46executed by the PM core for either the bus type, or device type (if the bus 47executed by the PM core for either the device type, or the class (if the device
47type's callback is not defined), or device class (if the bus type's and device 48type's struct dev_pm_ops object does not exist), or the bus type (if the
48type's callbacks are not defined) of given device. The bus type, device type 49device type's and class' struct dev_pm_ops objects do not exist) of the given
49and device class callbacks are referred to as subsystem-level callbacks in what 50device (this allows device types to override callbacks provided by bus types or
50follows. 51classes if necessary). The bus type, device type and class callbacks are
52referred to as subsystem-level callbacks in what follows.
53
54By default, the callbacks are always invoked in process context with interrupts
55enabled. However, subsystems can use the pm_runtime_irq_safe() helper function
56to tell the PM core that a device's ->runtime_suspend() and ->runtime_resume()
57callbacks should be invoked in atomic context with interrupts disabled
58(->runtime_idle() is still invoked the default way). This implies that these
59callback routines must not block or sleep, but it also means that the
60synchronous helper functions listed at the end of Section 4 can be used within
61an interrupt handler or in an atomic context.
51 62
52The subsystem-level suspend callback is _entirely_ _responsible_ for handling 63The subsystem-level suspend callback is _entirely_ _responsible_ for handling
53the suspend of the device as appropriate, which may, but need not include 64the suspend of the device as appropriate, which may, but need not include
@@ -157,7 +168,8 @@ rules:
157 to execute it, the other callbacks will not be executed for the same device. 168 to execute it, the other callbacks will not be executed for the same device.
158 169
159 * A request to execute ->runtime_resume() will cancel any pending or 170 * A request to execute ->runtime_resume() will cancel any pending or
160 scheduled requests to execute the other callbacks for the same device. 171 scheduled requests to execute the other callbacks for the same device,
172 except for scheduled autosuspends.
161 173
1623. Run-time PM Device Fields 1743. Run-time PM Device Fields
163 175
@@ -165,7 +177,7 @@ The following device run-time PM fields are present in 'struct dev_pm_info', as
165defined in include/linux/pm.h: 177defined in include/linux/pm.h:
166 178
167 struct timer_list suspend_timer; 179 struct timer_list suspend_timer;
168 - timer used for scheduling (delayed) suspend request 180 - timer used for scheduling (delayed) suspend and autosuspend requests
169 181
170 unsigned long timer_expires; 182 unsigned long timer_expires;
171 - timer expiration time, in jiffies (if this is different from zero, the 183 - timer expiration time, in jiffies (if this is different from zero, the
@@ -230,6 +242,32 @@ defined in include/linux/pm.h:
230 interface; it may only be modified with the help of the pm_runtime_allow() 242 interface; it may only be modified with the help of the pm_runtime_allow()
231 and pm_runtime_forbid() helper functions 243 and pm_runtime_forbid() helper functions
232 244
245 unsigned int no_callbacks;
246 - indicates that the device does not use the run-time PM callbacks (see
247 Section 8); it may be modified only by the pm_runtime_no_callbacks()
248 helper function
249
250 unsigned int irq_safe;
251 - indicates that the ->runtime_suspend() and ->runtime_resume() callbacks
252 will be invoked with the spinlock held and interrupts disabled
253
254 unsigned int use_autosuspend;
255 - indicates that the device's driver supports delayed autosuspend (see
256 Section 9); it may be modified only by the
257 pm_runtime{_dont}_use_autosuspend() helper functions
258
259 unsigned int timer_autosuspends;
260 - indicates that the PM core should attempt to carry out an autosuspend
261 when the timer expires rather than a normal suspend
262
263 int autosuspend_delay;
264 - the delay time (in milliseconds) to be used for autosuspend
265
266 unsigned long last_busy;
267 - the time (in jiffies) when the pm_runtime_mark_last_busy() helper
268 function was last called for this device; used in calculating inactivity
269 periods for autosuspend
270
233All of the above fields are members of the 'power' member of 'struct device'. 271All of the above fields are members of the 'power' member of 'struct device'.
234 272
2354. Run-time PM Device Helper Functions 2734. Run-time PM Device Helper Functions
@@ -255,6 +293,12 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
255 error code on failure, where -EAGAIN or -EBUSY means it is safe to attempt 293 error code on failure, where -EAGAIN or -EBUSY means it is safe to attempt
256 to suspend the device again in future 294 to suspend the device again in future
257 295
296 int pm_runtime_autosuspend(struct device *dev);
297 - same as pm_runtime_suspend() except that the autosuspend delay is taken
298 into account; if pm_runtime_autosuspend_expiration() says the delay has
299 not yet expired then an autosuspend is scheduled for the appropriate time
300 and 0 is returned
301
258 int pm_runtime_resume(struct device *dev); 302 int pm_runtime_resume(struct device *dev);
259 - execute the subsystem-level resume callback for the device; returns 0 on 303 - execute the subsystem-level resume callback for the device; returns 0 on
260 success, 1 if the device's run-time PM status was already 'active' or 304 success, 1 if the device's run-time PM status was already 'active' or
@@ -267,6 +311,11 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
267 device (the request is represented by a work item in pm_wq); returns 0 on 311 device (the request is represented by a work item in pm_wq); returns 0 on
268 success or error code if the request has not been queued up 312 success or error code if the request has not been queued up
269 313
314 int pm_request_autosuspend(struct device *dev);
315 - schedule the execution of the subsystem-level suspend callback for the
316 device when the autosuspend delay has expired; if the delay has already
317 expired then the work item is queued up immediately
318
270 int pm_schedule_suspend(struct device *dev, unsigned int delay); 319 int pm_schedule_suspend(struct device *dev, unsigned int delay);
271 - schedule the execution of the subsystem-level suspend callback for the 320 - schedule the execution of the subsystem-level suspend callback for the
272 device in future, where 'delay' is the time to wait before queuing up a 321 device in future, where 'delay' is the time to wait before queuing up a
@@ -298,12 +347,24 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
298 - decrement the device's usage counter 347 - decrement the device's usage counter
299 348
300 int pm_runtime_put(struct device *dev); 349 int pm_runtime_put(struct device *dev);
301 - decrement the device's usage counter, run pm_request_idle(dev) and return 350 - decrement the device's usage counter; if the result is 0 then run
302 its result 351 pm_request_idle(dev) and return its result
352
353 int pm_runtime_put_autosuspend(struct device *dev);
354 - decrement the device's usage counter; if the result is 0 then run
355 pm_request_autosuspend(dev) and return its result
303 356
304 int pm_runtime_put_sync(struct device *dev); 357 int pm_runtime_put_sync(struct device *dev);
305 - decrement the device's usage counter, run pm_runtime_idle(dev) and return 358 - decrement the device's usage counter; if the result is 0 then run
306 its result 359 pm_runtime_idle(dev) and return its result
360
361 int pm_runtime_put_sync_suspend(struct device *dev);
362 - decrement the device's usage counter; if the result is 0 then run
363 pm_runtime_suspend(dev) and return its result
364
365 int pm_runtime_put_sync_autosuspend(struct device *dev);
366 - decrement the device's usage counter; if the result is 0 then run
367 pm_runtime_autosuspend(dev) and return its result
307 368
308 void pm_runtime_enable(struct device *dev); 369 void pm_runtime_enable(struct device *dev);
309 - enable the run-time PM helper functions to run the device bus type's 370 - enable the run-time PM helper functions to run the device bus type's
@@ -336,8 +397,8 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
336 zero) 397 zero)
337 398
338 bool pm_runtime_suspended(struct device *dev); 399 bool pm_runtime_suspended(struct device *dev);
339 - return true if the device's runtime PM status is 'suspended', or false 400 - return true if the device's runtime PM status is 'suspended' and its
340 otherwise 401 'power.disable_depth' field is equal to zero, or false otherwise
341 402
342 void pm_runtime_allow(struct device *dev); 403 void pm_runtime_allow(struct device *dev);
343 - set the power.runtime_auto flag for the device and decrease its usage 404 - set the power.runtime_auto flag for the device and decrease its usage
@@ -349,19 +410,65 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
349 counter (used by the /sys/devices/.../power/control interface to 410 counter (used by the /sys/devices/.../power/control interface to
350 effectively prevent the device from being power managed at run time) 411 effectively prevent the device from being power managed at run time)
351 412
413 void pm_runtime_no_callbacks(struct device *dev);
414 - set the power.no_callbacks flag for the device and remove the run-time
415 PM attributes from /sys/devices/.../power (or prevent them from being
416 added when the device is registered)
417
418 void pm_runtime_irq_safe(struct device *dev);
419 - set the power.irq_safe flag for the device, causing the runtime-PM
420 suspend and resume callbacks (but not the idle callback) to be invoked
421 with interrupts disabled
422
423 void pm_runtime_mark_last_busy(struct device *dev);
424 - set the power.last_busy field to the current time
425
426 void pm_runtime_use_autosuspend(struct device *dev);
427 - set the power.use_autosuspend flag, enabling autosuspend delays
428
429 void pm_runtime_dont_use_autosuspend(struct device *dev);
430 - clear the power.use_autosuspend flag, disabling autosuspend delays
431
432 void pm_runtime_set_autosuspend_delay(struct device *dev, int delay);
433 - set the power.autosuspend_delay value to 'delay' (expressed in
434 milliseconds); if 'delay' is negative then run-time suspends are
435 prevented
436
437 unsigned long pm_runtime_autosuspend_expiration(struct device *dev);
438 - calculate the time when the current autosuspend delay period will expire,
439 based on power.last_busy and power.autosuspend_delay; if the delay time
440 is 1000 ms or larger then the expiration time is rounded up to the
441 nearest second; returns 0 if the delay period has already expired or
442 power.use_autosuspend isn't set, otherwise returns the expiration time
443 in jiffies
444
352It is safe to execute the following helper functions from interrupt context: 445It is safe to execute the following helper functions from interrupt context:
353 446
354pm_request_idle() 447pm_request_idle()
448pm_request_autosuspend()
355pm_schedule_suspend() 449pm_schedule_suspend()
356pm_request_resume() 450pm_request_resume()
357pm_runtime_get_noresume() 451pm_runtime_get_noresume()
358pm_runtime_get() 452pm_runtime_get()
359pm_runtime_put_noidle() 453pm_runtime_put_noidle()
360pm_runtime_put() 454pm_runtime_put()
455pm_runtime_put_autosuspend()
456pm_runtime_enable()
361pm_suspend_ignore_children() 457pm_suspend_ignore_children()
362pm_runtime_set_active() 458pm_runtime_set_active()
363pm_runtime_set_suspended() 459pm_runtime_set_suspended()
364pm_runtime_enable() 460pm_runtime_suspended()
461pm_runtime_mark_last_busy()
462pm_runtime_autosuspend_expiration()
463
464If pm_runtime_irq_safe() has been called for a device then the following helper
465functions may also be used in interrupt context:
466
467pm_runtime_suspend()
468pm_runtime_autosuspend()
469pm_runtime_resume()
470pm_runtime_get_sync()
471pm_runtime_put_sync_suspend()
365 472
3665. Run-time PM Initialization, Device Probing and Removal 4735. Run-time PM Initialization, Device Probing and Removal
367 474
@@ -394,13 +501,29 @@ helper functions described in Section 4. In that case, pm_runtime_resume()
394should be used. Of course, for this purpose the device's run-time PM has to be 501should be used. Of course, for this purpose the device's run-time PM has to be
395enabled earlier by calling pm_runtime_enable(). 502enabled earlier by calling pm_runtime_enable().
396 503
397If the device bus type's or driver's ->probe() or ->remove() callback runs 504If the device bus type's or driver's ->probe() callback runs
398pm_runtime_suspend() or pm_runtime_idle() or their asynchronous counterparts, 505pm_runtime_suspend() or pm_runtime_idle() or their asynchronous counterparts,
399they will fail returning -EAGAIN, because the device's usage counter is 506they will fail returning -EAGAIN, because the device's usage counter is
400incremented by the core before executing ->probe() and ->remove(). Still, it 507incremented by the driver core before executing ->probe(). Still, it may be
401may be desirable to suspend the device as soon as ->probe() or ->remove() has 508desirable to suspend the device as soon as ->probe() has finished, so the driver
402finished, so the PM core uses pm_runtime_idle_sync() to invoke the 509core uses pm_runtime_put_sync() to invoke the subsystem-level idle callback for
403subsystem-level idle callback for the device at that time. 510the device at that time.
511
512Moreover, the driver core prevents runtime PM callbacks from racing with the bus
513notifier callback in __device_release_driver(), which is necessary, because the
514notifier is used by some subsystems to carry out operations affecting the
515runtime PM functionality. It does so by calling pm_runtime_get_sync() before
516driver_sysfs_remove() and the BUS_NOTIFY_UNBIND_DRIVER notifications. This
517resumes the device if it's in the suspended state and prevents it from
518being suspended again while those routines are being executed.
519
520To allow bus types and drivers to put devices into the suspended state by
521calling pm_runtime_suspend() from their ->remove() routines, the driver core
522executes pm_runtime_put_sync() after running the BUS_NOTIFY_UNBIND_DRIVER
523notifications in __device_release_driver(). This requires bus types and
524drivers to make their ->remove() callbacks avoid races with runtime PM directly,
525but also it allows of more flexibility in the handling of devices during the
526removal of their drivers.
404 527
405The user space can effectively disallow the driver of the device to power manage 528The user space can effectively disallow the driver of the device to power manage
406it at run time by changing the value of its /sys/devices/.../power/control 529it at run time by changing the value of its /sys/devices/.../power/control
@@ -459,11 +582,6 @@ to do this is:
459 pm_runtime_set_active(dev); 582 pm_runtime_set_active(dev);
460 pm_runtime_enable(dev); 583 pm_runtime_enable(dev);
461 584
462The PM core always increments the run-time usage counter before calling the
463->prepare() callback and decrements it after calling the ->complete() callback.
464Hence disabling run-time PM temporarily like this will not cause any run-time
465suspend callbacks to be lost.
466
4677. Generic subsystem callbacks 5857. Generic subsystem callbacks
468 586
469Subsystems may wish to conserve code space by using the set of generic power 587Subsystems may wish to conserve code space by using the set of generic power
@@ -524,3 +642,141 @@ poweroff and run-time suspend callback, and similarly for system resume, thaw,
524restore, and run-time resume, can achieve this with the help of the 642restore, and run-time resume, can achieve this with the help of the
525UNIVERSAL_DEV_PM_OPS macro defined in include/linux/pm.h (possibly setting its 643UNIVERSAL_DEV_PM_OPS macro defined in include/linux/pm.h (possibly setting its
526last argument to NULL). 644last argument to NULL).
645
6468. "No-Callback" Devices
647
648Some "devices" are only logical sub-devices of their parent and cannot be
649power-managed on their own. (The prototype example is a USB interface. Entire
650USB devices can go into low-power mode or send wake-up requests, but neither is
651possible for individual interfaces.) The drivers for these devices have no
652need of run-time PM callbacks; if the callbacks did exist, ->runtime_suspend()
653and ->runtime_resume() would always return 0 without doing anything else and
654->runtime_idle() would always call pm_runtime_suspend().
655
656Subsystems can tell the PM core about these devices by calling
657pm_runtime_no_callbacks(). This should be done after the device structure is
658initialized and before it is registered (although after device registration is
659also okay). The routine will set the device's power.no_callbacks flag and
660prevent the non-debugging run-time PM sysfs attributes from being created.
661
662When power.no_callbacks is set, the PM core will not invoke the
663->runtime_idle(), ->runtime_suspend(), or ->runtime_resume() callbacks.
664Instead it will assume that suspends and resumes always succeed and that idle
665devices should be suspended.
666
667As a consequence, the PM core will never directly inform the device's subsystem
668or driver about run-time power changes. Instead, the driver for the device's
669parent must take responsibility for telling the device's driver when the
670parent's power state changes.
671
6729. Autosuspend, or automatically-delayed suspends
673
674Changing a device's power state isn't free; it requires both time and energy.
675A device should be put in a low-power state only when there's some reason to
676think it will remain in that state for a substantial time. A common heuristic
677says that a device which hasn't been used for a while is liable to remain
678unused; following this advice, drivers should not allow devices to be suspended
679at run-time until they have been inactive for some minimum period. Even when
680the heuristic ends up being non-optimal, it will still prevent devices from
681"bouncing" too rapidly between low-power and full-power states.
682
683The term "autosuspend" is an historical remnant. It doesn't mean that the
684device is automatically suspended (the subsystem or driver still has to call
685the appropriate PM routines); rather it means that run-time suspends will
686automatically be delayed until the desired period of inactivity has elapsed.
687
688Inactivity is determined based on the power.last_busy field. Drivers should
689call pm_runtime_mark_last_busy() to update this field after carrying out I/O,
690typically just before calling pm_runtime_put_autosuspend(). The desired length
691of the inactivity period is a matter of policy. Subsystems can set this length
692initially by calling pm_runtime_set_autosuspend_delay(), but after device
693registration the length should be controlled by user space, using the
694/sys/devices/.../power/autosuspend_delay_ms attribute.
695
696In order to use autosuspend, subsystems or drivers must call
697pm_runtime_use_autosuspend() (preferably before registering the device), and
698thereafter they should use the various *_autosuspend() helper functions instead
699of the non-autosuspend counterparts:
700
701 Instead of: pm_runtime_suspend use: pm_runtime_autosuspend;
702 Instead of: pm_schedule_suspend use: pm_request_autosuspend;
703 Instead of: pm_runtime_put use: pm_runtime_put_autosuspend;
704 Instead of: pm_runtime_put_sync use: pm_runtime_put_sync_autosuspend.
705
706Drivers may also continue to use the non-autosuspend helper functions; they
707will behave normally, not taking the autosuspend delay into account.
708Similarly, if the power.use_autosuspend field isn't set then the autosuspend
709helper functions will behave just like the non-autosuspend counterparts.
710
711The implementation is well suited for asynchronous use in interrupt contexts.
712However such use inevitably involves races, because the PM core can't
713synchronize ->runtime_suspend() callbacks with the arrival of I/O requests.
714This synchronization must be handled by the driver, using its private lock.
715Here is a schematic pseudo-code example:
716
717 foo_read_or_write(struct foo_priv *foo, void *data)
718 {
719 lock(&foo->private_lock);
720 add_request_to_io_queue(foo, data);
721 if (foo->num_pending_requests++ == 0)
722 pm_runtime_get(&foo->dev);
723 if (!foo->is_suspended)
724 foo_process_next_request(foo);
725 unlock(&foo->private_lock);
726 }
727
728 foo_io_completion(struct foo_priv *foo, void *req)
729 {
730 lock(&foo->private_lock);
731 if (--foo->num_pending_requests == 0) {
732 pm_runtime_mark_last_busy(&foo->dev);
733 pm_runtime_put_autosuspend(&foo->dev);
734 } else {
735 foo_process_next_request(foo);
736 }
737 unlock(&foo->private_lock);
738 /* Send req result back to the user ... */
739 }
740
741 int foo_runtime_suspend(struct device *dev)
742 {
743 struct foo_priv foo = container_of(dev, ...);
744 int ret = 0;
745
746 lock(&foo->private_lock);
747 if (foo->num_pending_requests > 0) {
748 ret = -EBUSY;
749 } else {
750 /* ... suspend the device ... */
751 foo->is_suspended = 1;
752 }
753 unlock(&foo->private_lock);
754 return ret;
755 }
756
757 int foo_runtime_resume(struct device *dev)
758 {
759 struct foo_priv foo = container_of(dev, ...);
760
761 lock(&foo->private_lock);
762 /* ... resume the device ... */
763 foo->is_suspended = 0;
764 pm_runtime_mark_last_busy(&foo->dev);
765 if (foo->num_pending_requests > 0)
766 foo_process_requests(foo);
767 unlock(&foo->private_lock);
768 return 0;
769 }
770
771The important point is that after foo_io_completion() asks for an autosuspend,
772the foo_runtime_suspend() callback may race with foo_read_or_write().
773Therefore foo_runtime_suspend() has to check whether there are any pending I/O
774requests (while holding the private lock) before allowing the suspend to
775proceed.
776
777In addition, the power.autosuspend_delay field can be changed by user space at
778any time. If a driver cares about this, it can call
779pm_runtime_autosuspend_expiration() from within the ->runtime_suspend()
780callback while holding its private lock. If the function returns a nonzero
781value then the delay has not yet expired and the callback should return
782-EAGAIN.
diff --git a/Documentation/power/s2ram.txt b/Documentation/power/s2ram.txt
index 514b94fc931e..1bdfa0443773 100644
--- a/Documentation/power/s2ram.txt
+++ b/Documentation/power/s2ram.txt
@@ -49,6 +49,13 @@ machine that doesn't boot) is:
49 device (lspci and /sys/devices/pci* is your friend), and see if you can 49 device (lspci and /sys/devices/pci* is your friend), and see if you can
50 fix it, disable it, or trace into its resume function. 50 fix it, disable it, or trace into its resume function.
51 51
52 If no device matches the hash (or any matches appear to be false positives),
53 the culprit may be a device from a loadable kernel module that is not loaded
54 until after the hash is checked. You can check the hash against the current
55 devices again after more modules are loaded using sysfs:
56
57 cat /sys/power/pm_trace_dev_match
58
52For example, the above happens to be the VGA device on my EVO, which I 59For example, the above happens to be the VGA device on my EVO, which I
53used to run with "radeonfb" (it's an ATI Radeon mobility). It turns out 60used to run with "radeonfb" (it's an ATI Radeon mobility). It turns out
54that "radeonfb" simply cannot resume that device - it tries to set the 61that "radeonfb" simply cannot resume that device - it tries to set the
diff --git a/Documentation/power/states.txt b/Documentation/power/states.txt
index 34800cc521bf..4416b28630df 100644
--- a/Documentation/power/states.txt
+++ b/Documentation/power/states.txt
@@ -62,12 +62,12 @@ setup via another operating system for it to use. Despite the
62inconvenience, this method requires minimal work by the kernel, since 62inconvenience, this method requires minimal work by the kernel, since
63the firmware will also handle restoring memory contents on resume. 63the firmware will also handle restoring memory contents on resume.
64 64
65For suspend-to-disk, a mechanism called swsusp called 'swsusp' (Swap 65For suspend-to-disk, a mechanism called 'swsusp' (Swap Suspend) is used
66Suspend) is used to write memory contents to free swap space. 66to write memory contents to free swap space. swsusp has some restrictive
67swsusp has some restrictive requirements, but should work in most 67requirements, but should work in most cases. Some, albeit outdated,
68cases. Some, albeit outdated, documentation can be found in 68documentation can be found in Documentation/power/swsusp.txt.
69Documentation/power/swsusp.txt. Alternatively, userspace can do most 69Alternatively, userspace can do most of the actual suspend to disk work,
70of the actual suspend to disk work, see userland-swsusp.txt. 70see userland-swsusp.txt.
71 71
72Once memory state is written to disk, the system may either enter a 72Once memory state is written to disk, the system may either enter a
73low-power state (like ACPI S4), or it may simply power down. Powering 73low-power state (like ACPI S4), or it may simply power down. Powering
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt
index 9d60ab717a7b..ac190cf1963e 100644
--- a/Documentation/power/swsusp.txt
+++ b/Documentation/power/swsusp.txt
@@ -66,7 +66,8 @@ swsusp saves the state of the machine into active swaps and then reboots or
66powerdowns. You must explicitly specify the swap partition to resume from with 66powerdowns. You must explicitly specify the swap partition to resume from with
67``resume='' kernel option. If signature is found it loads and restores saved 67``resume='' kernel option. If signature is found it loads and restores saved
68state. If the option ``noresume'' is specified as a boot parameter, it skips 68state. If the option ``noresume'' is specified as a boot parameter, it skips
69the resuming. 69the resuming. If the option ``hibernate=nocompress'' is specified as a boot
70parameter, it saves hibernation image without compression.
70 71
71In the meantime while the system is suspended you should not add/remove any 72In the meantime while the system is suspended you should not add/remove any
72of the hardware, write to the filesystems, etc. 73of the hardware, write to the filesystems, etc.
@@ -191,7 +192,7 @@ Q: There don't seem to be any generally useful behavioral
191distinctions between SUSPEND and FREEZE. 192distinctions between SUSPEND and FREEZE.
192 193
193A: Doing SUSPEND when you are asked to do FREEZE is always correct, 194A: Doing SUSPEND when you are asked to do FREEZE is always correct,
194but it may be unneccessarily slow. If you want your driver to stay simple, 195but it may be unnecessarily slow. If you want your driver to stay simple,
195slowness may not matter to you. It can always be fixed later. 196slowness may not matter to you. It can always be fixed later.
196 197
197For devices like disk it does matter, you do not want to spindown for 198For devices like disk it does matter, you do not want to spindown for
@@ -236,7 +237,7 @@ disk. Whole sequence goes like
236 237
237 running system, user asks for suspend-to-disk 238 running system, user asks for suspend-to-disk
238 239
239 user processes are stopped (in common case there are none, but with resume-from-initrd, noone knows) 240 user processes are stopped (in common case there are none, but with resume-from-initrd, no one knows)
240 241
241 read image from disk 242 read image from disk
242 243
diff --git a/Documentation/power/userland-swsusp.txt b/Documentation/power/userland-swsusp.txt
index 81680f9f5909..1101bee4e822 100644
--- a/Documentation/power/userland-swsusp.txt
+++ b/Documentation/power/userland-swsusp.txt
@@ -98,7 +98,7 @@ SNAPSHOT_S2RAM - suspend to RAM; using this call causes the kernel to
98The device's read() operation can be used to transfer the snapshot image from 98The device's read() operation can be used to transfer the snapshot image from
99the kernel. It has the following limitations: 99the kernel. It has the following limitations:
100- you cannot read() more than one virtual memory page at a time 100- you cannot read() more than one virtual memory page at a time
101- read()s accross page boundaries are impossible (ie. if ypu read() 1/2 of 101- read()s across page boundaries are impossible (ie. if ypu read() 1/2 of
102 a page in the previous call, you will only be able to read() 102 a page in the previous call, you will only be able to read()
103 _at_ _most_ 1/2 of the page in the next call) 103 _at_ _most_ 1/2 of the page in the next call)
104 104
@@ -137,7 +137,7 @@ mechanism and the userland utilities using the interface SHOULD use additional
137means, such as checksums, to ensure the integrity of the snapshot image. 137means, such as checksums, to ensure the integrity of the snapshot image.
138 138
139The suspending and resuming utilities MUST lock themselves in memory, 139The suspending and resuming utilities MUST lock themselves in memory,
140preferrably using mlockall(), before calling SNAPSHOT_FREEZE. 140preferably using mlockall(), before calling SNAPSHOT_FREEZE.
141 141
142The suspending utility MUST check the value stored by SNAPSHOT_CREATE_IMAGE 142The suspending utility MUST check the value stored by SNAPSHOT_CREATE_IMAGE
143in the memory location pointed to by the last argument of ioctl() and proceed 143in the memory location pointed to by the last argument of ioctl() and proceed
@@ -147,7 +147,7 @@ in accordance with it:
147 (a) The suspending utility MUST NOT close the snapshot device 147 (a) The suspending utility MUST NOT close the snapshot device
148 _unless_ the whole suspend procedure is to be cancelled, in 148 _unless_ the whole suspend procedure is to be cancelled, in
149 which case, if the snapshot image has already been saved, the 149 which case, if the snapshot image has already been saved, the
150 suspending utility SHOULD destroy it, preferrably by zapping 150 suspending utility SHOULD destroy it, preferably by zapping
151 its header. If the suspend is not to be cancelled, the 151 its header. If the suspend is not to be cancelled, the
152 system MUST be powered off or rebooted after the snapshot 152 system MUST be powered off or rebooted after the snapshot
153 image has been saved. 153 image has been saved.
diff --git a/Documentation/powerpc/00-INDEX b/Documentation/powerpc/00-INDEX
index e3960b8c8689..5620fb5ac425 100644
--- a/Documentation/powerpc/00-INDEX
+++ b/Documentation/powerpc/00-INDEX
@@ -5,8 +5,6 @@ please mail me.
5 5
600-INDEX 600-INDEX
7 - this file 7 - this file
8booting-without-of.txt
9 - Booting the Linux/ppc kernel without Open Firmware
10cpu_features.txt 8cpu_features.txt
11 - info on how we support a variety of CPUs with minimal compile-time 9 - info on how we support a variety of CPUs with minimal compile-time
12 options. 10 options.
@@ -16,8 +14,6 @@ hvcs.txt
16 - IBM "Hypervisor Virtual Console Server" Installation Guide 14 - IBM "Hypervisor Virtual Console Server" Installation Guide
17mpc52xx.txt 15mpc52xx.txt
18 - Linux 2.6.x on MPC52xx family 16 - Linux 2.6.x on MPC52xx family
19mpc52xx-device-tree-bindings.txt
20 - MPC5200 Device Tree Bindings
21sound.txt 17sound.txt
22 - info on sound support under Linux/PPC 18 - info on sound support under Linux/PPC
23zImage_layout.txt 19zImage_layout.txt
diff --git a/Documentation/powerpc/dts-bindings/fsl/mpic.txt b/Documentation/powerpc/dts-bindings/fsl/mpic.txt
deleted file mode 100644
index 71e39cf3215b..000000000000
--- a/Documentation/powerpc/dts-bindings/fsl/mpic.txt
+++ /dev/null
@@ -1,42 +0,0 @@
1* OpenPIC and its interrupt numbers on Freescale's e500/e600 cores
2
3The OpenPIC specification does not specify which interrupt source has to
4become which interrupt number. This is up to the software implementation
5of the interrupt controller. The only requirement is that every
6interrupt source has to have an unique interrupt number / vector number.
7To accomplish this the current implementation assigns the number zero to
8the first source, the number one to the second source and so on until
9all interrupt sources have their unique number.
10Usually the assigned vector number equals the interrupt number mentioned
11in the documentation for a given core / CPU. This is however not true
12for the e500 cores (MPC85XX CPUs) where the documentation distinguishes
13between internal and external interrupt sources and starts counting at
14zero for both of them.
15
16So what to write for external interrupt source X or internal interrupt
17source Y into the device tree? Here is an example:
18
19The memory map for the interrupt controller in the MPC8544[0] shows,
20that the first interrupt source starts at 0x5_0000 (PIC Register Address
21Map-Interrupt Source Configuration Registers). This source becomes the
22number zero therefore:
23 External interrupt 0 = interrupt number 0
24 External interrupt 1 = interrupt number 1
25 External interrupt 2 = interrupt number 2
26 ...
27Every interrupt number allocates 0x20 bytes register space. So to get
28its number it is sufficient to shift the lower 16bits to right by five.
29So for the external interrupt 10 we have:
30 0x0140 >> 5 = 10
31
32After the external sources, the internal sources follow. The in core I2C
33controller on the MPC8544 for instance has the internal source number
3427. Oo obtain its interrupt number we take the lower 16bits of its memory
35address (0x5_0560) and shift it right:
36 0x0560 >> 5 = 43
37
38Therefore the I2C device node for the MPC8544 CPU has to have the
39interrupt number 43 specified in the device tree.
40
41[0] MPC8544E PowerQUICCTM III, Integrated Host Processor Family Reference Manual
42 MPC8544ERM Rev. 1 10/2007
diff --git a/Documentation/powerpc/hvcs.txt b/Documentation/powerpc/hvcs.txt
index 6d8be3468d7d..a730ca5a07f8 100644
--- a/Documentation/powerpc/hvcs.txt
+++ b/Documentation/powerpc/hvcs.txt
@@ -528,7 +528,7 @@ this driver assignment of hotplug added vty-servers may be in a different
528order than how they would be exposed on module load. Rebooting or 528order than how they would be exposed on module load. Rebooting or
529reloading the module after dynamic addition may result in the /dev/hvcs* 529reloading the module after dynamic addition may result in the /dev/hvcs*
530and vty-server coupling changing if a vty-server adapter was added in a 530and vty-server coupling changing if a vty-server adapter was added in a
531slot inbetween two other vty-server adapters. Refer to the section above 531slot between two other vty-server adapters. Refer to the section above
532on how to determine which vty-server goes with which /dev/hvcs* node. 532on how to determine which vty-server goes with which /dev/hvcs* node.
533Hint; look at the sysfs "index" attribute for the vty-server. 533Hint; look at the sysfs "index" attribute for the vty-server.
534 534
diff --git a/Documentation/pps/pps.txt b/Documentation/pps/pps.txt
index 125f4ab48998..d35dcdd82ff6 100644
--- a/Documentation/pps/pps.txt
+++ b/Documentation/pps/pps.txt
@@ -170,3 +170,49 @@ and the run ppstest as follow:
170 170
171Please, note that to compile userland programs you need the file timepps.h 171Please, note that to compile userland programs you need the file timepps.h
172(see Documentation/pps/). 172(see Documentation/pps/).
173
174
175Generators
176----------
177
178Sometimes one needs to be able not only to catch PPS signals but to produce
179them also. For example, running a distributed simulation, which requires
180computers' clock to be synchronized very tightly. One way to do this is to
181invent some complicated hardware solutions but it may be neither necessary
182nor affordable. The cheap way is to load a PPS generator on one of the
183computers (master) and PPS clients on others (slaves), and use very simple
184cables to deliver signals using parallel ports, for example.
185
186Parallel port cable pinout:
187pin name master slave
1881 STROBE *------ *
1892 D0 * | *
1903 D1 * | *
1914 D2 * | *
1925 D3 * | *
1936 D4 * | *
1947 D5 * | *
1958 D6 * | *
1969 D7 * | *
19710 ACK * ------*
19811 BUSY * *
19912 PE * *
20013 SEL * *
20114 AUTOFD * *
20215 ERROR * *
20316 INIT * *
20417 SELIN * *
20518-25 GND *-----------*
206
207Please note that parallel port interrupt occurs only on high->low transition,
208so it is used for PPS assert edge. PPS clear edge can be determined only
209using polling in the interrupt handler which actually can be done way more
210precisely because interrupt handling delays can be quite big and random. So
211current parport PPS generator implementation (pps_gen_parport module) is
212geared towards using the clear edge for time synchronization.
213
214Clear edge polling is done with disabled interrupts so it's better to select
215delay between assert and clear edge as small as possible to reduce system
216latencies. But if it is too small slave won't be able to capture clear edge
217transition. The default of 30us should be good enough in most situations.
218The delay can be selected using 'delay' pps_gen_parport module parameter.
diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt
index 1b5a5ddbc3ef..5df176ed59b8 100644
--- a/Documentation/printk-formats.txt
+++ b/Documentation/printk-formats.txt
@@ -9,7 +9,121 @@ If variable is of Type, use printk format specifier:
9 size_t %zu or %zx 9 size_t %zu or %zx
10 ssize_t %zd or %zx 10 ssize_t %zd or %zx
11 11
12Raw pointer value SHOULD be printed with %p. 12Raw pointer value SHOULD be printed with %p. The kernel supports
13the following extended format specifiers for pointer types:
14
15Symbols/Function Pointers:
16
17 %pF versatile_init+0x0/0x110
18 %pf versatile_init
19 %pS versatile_init+0x0/0x110
20 %ps versatile_init
21 %pB prev_fn_of_versatile_init+0x88/0x88
22
23 For printing symbols and function pointers. The 'S' and 's' specifiers
24 result in the symbol name with ('S') or without ('s') offsets. Where
25 this is used on a kernel without KALLSYMS - the symbol address is
26 printed instead.
27
28 The 'B' specifier results in the symbol name with offsets and should be
29 used when printing stack backtraces. The specifier takes into
30 consideration the effect of compiler optimisations which may occur
31 when tail-call's are used and marked with the noreturn GCC attribute.
32
33 On ia64, ppc64 and parisc64 architectures function pointers are
34 actually function descriptors which must first be resolved. The 'F' and
35 'f' specifiers perform this resolution and then provide the same
36 functionality as the 'S' and 's' specifiers.
37
38Kernel Pointers:
39
40 %pK 0x01234567 or 0x0123456789abcdef
41
42 For printing kernel pointers which should be hidden from unprivileged
43 users. The behaviour of %pK depends on the kptr_restrict sysctl - see
44 Documentation/sysctl/kernel.txt for more details.
45
46Struct Resources:
47
48 %pr [mem 0x60000000-0x6fffffff flags 0x2200] or
49 [mem 0x0000000060000000-0x000000006fffffff flags 0x2200]
50 %pR [mem 0x60000000-0x6fffffff pref] or
51 [mem 0x0000000060000000-0x000000006fffffff pref]
52
53 For printing struct resources. The 'R' and 'r' specifiers result in a
54 printed resource with ('R') or without ('r') a decoded flags member.
55
56MAC/FDDI addresses:
57
58 %pM 00:01:02:03:04:05
59 %pMF 00-01-02-03-04-05
60 %pm 000102030405
61
62 For printing 6-byte MAC/FDDI addresses in hex notation. The 'M' and 'm'
63 specifiers result in a printed address with ('M') or without ('m') byte
64 separators. The default byte separator is the colon (':').
65
66 Where FDDI addresses are concerned the 'F' specifier can be used after
67 the 'M' specifier to use dash ('-') separators instead of the default
68 separator.
69
70IPv4 addresses:
71
72 %pI4 1.2.3.4
73 %pi4 001.002.003.004
74 %p[Ii][hnbl]
75
76 For printing IPv4 dot-separated decimal addresses. The 'I4' and 'i4'
77 specifiers result in a printed address with ('i4') or without ('I4')
78 leading zeros.
79
80 The additional 'h', 'n', 'b', and 'l' specifiers are used to specify
81 host, network, big or little endian order addresses respectively. Where
82 no specifier is provided the default network/big endian order is used.
83
84IPv6 addresses:
85
86 %pI6 0001:0002:0003:0004:0005:0006:0007:0008
87 %pi6 00010002000300040005000600070008
88 %pI6c 1:2:3:4:5:6:7:8
89
90 For printing IPv6 network-order 16-bit hex addresses. The 'I6' and 'i6'
91 specifiers result in a printed address with ('I6') or without ('i6')
92 colon-separators. Leading zeros are always used.
93
94 The additional 'c' specifier can be used with the 'I' specifier to
95 print a compressed IPv6 address as described by
96 http://tools.ietf.org/html/rfc5952
97
98UUID/GUID addresses:
99
100 %pUb 00010203-0405-0607-0809-0a0b0c0d0e0f
101 %pUB 00010203-0405-0607-0809-0A0B0C0D0E0F
102 %pUl 03020100-0504-0706-0809-0a0b0c0e0e0f
103 %pUL 03020100-0504-0706-0809-0A0B0C0E0E0F
104
105 For printing 16-byte UUID/GUIDs addresses. The additional 'l', 'L',
106 'b' and 'B' specifiers are used to specify a little endian order in
107 lower ('l') or upper case ('L') hex characters - and big endian order
108 in lower ('b') or upper case ('B') hex characters.
109
110 Where no additional specifiers are used the default little endian
111 order with lower case hex characters will be printed.
112
113struct va_format:
114
115 %pV
116
117 For printing struct va_format structures. These contain a format string
118 and va_list as follows:
119
120 struct va_format {
121 const char *fmt;
122 va_list *va;
123 };
124
125 Do not use this feature without some mechanism to verify the
126 correctness of the format string and va_list arguments.
13 127
14u64 SHOULD be printed with %llu/%llx, (unsigned long long): 128u64 SHOULD be printed with %llu/%llx, (unsigned long long):
15 129
@@ -32,4 +146,5 @@ Reminder: sizeof() result is of type size_t.
32Thank you for your cooperation and attention. 146Thank you for your cooperation and attention.
33 147
34 148
35By Randy Dunlap <rdunlap@xenotime.net> 149By Randy Dunlap <rdunlap@xenotime.net> and
150Andrew Murray <amurray@mpc-data.co.uk>
diff --git a/Documentation/pti/pti_intel_mid.txt b/Documentation/pti/pti_intel_mid.txt
new file mode 100644
index 000000000000..e7a5b6d1f7a9
--- /dev/null
+++ b/Documentation/pti/pti_intel_mid.txt
@@ -0,0 +1,99 @@
1The Intel MID PTI project is HW implemented in Intel Atom
2system-on-a-chip designs based on the Parallel Trace
3Interface for MIPI P1149.7 cJTAG standard. The kernel solution
4for this platform involves the following files:
5
6./include/linux/pti.h
7./drivers/.../n_tracesink.h
8./drivers/.../n_tracerouter.c
9./drivers/.../n_tracesink.c
10./drivers/.../pti.c
11
12pti.c is the driver that enables various debugging features
13popular on platforms from certain mobile manufacturers.
14n_tracerouter.c and n_tracesink.c allow extra system information to
15be collected and routed to the pti driver, such as trace
16debugging data from a modem. Although n_tracerouter
17and n_tracesink are a part of the complete PTI solution,
18these two line disciplines can work separately from
19pti.c and route any data stream from one /dev/tty node
20to another /dev/tty node via kernel-space. This provides
21a stable, reliable connection that will not break unless
22the user-space application shuts down (plus avoids
23kernel->user->kernel context switch overheads of routing
24data).
25
26An example debugging usage for this driver system:
27 *Hook /dev/ttyPTI0 to syslogd. Opening this port will also start
28 a console device to further capture debugging messages to PTI.
29 *Hook /dev/ttyPTI1 to modem debugging data to write to PTI HW.
30 This is where n_tracerouter and n_tracesink are used.
31 *Hook /dev/pti to a user-level debugging application for writing
32 to PTI HW.
33 *Use mipi_* Kernel Driver API in other device drivers for
34 debugging to PTI by first requesting a PTI write address via
35 mipi_request_masterchannel(1).
36
37Below is example pseudo-code on how a 'privileged' application
38can hook up n_tracerouter and n_tracesink to any tty on
39a system. 'Privileged' means the application has enough
40privileges to successfully manipulate the ldisc drivers
41but is not just blindly executing as 'root'. Keep in mind
42the use of ioctl(,TIOCSETD,) is not specific to the n_tracerouter
43and n_tracesink line discpline drivers but is a generic
44operation for a program to use a line discpline driver
45on a tty port other than the default n_tty.
46
47/////////// To hook up n_tracerouter and n_tracesink /////////
48
49// Note that n_tracerouter depends on n_tracesink.
50#include <errno.h>
51#define ONE_TTY "/dev/ttyOne"
52#define TWO_TTY "/dev/ttyTwo"
53
54// needed global to hand onto ldisc connection
55static int g_fd_source = -1;
56static int g_fd_sink = -1;
57
58// these two vars used to grab LDISC values from loaded ldisc drivers
59// in OS. Look at /proc/tty/ldiscs to get the right numbers from
60// the ldiscs loaded in the system.
61int source_ldisc_num, sink_ldisc_num = -1;
62int retval;
63
64g_fd_source = open(ONE_TTY, O_RDWR); // must be R/W
65g_fd_sink = open(TWO_TTY, O_RDWR); // must be R/W
66
67if (g_fd_source <= 0) || (g_fd_sink <= 0) {
68 // doubt you'll want to use these exact error lines of code
69 printf("Error on open(). errno: %d\n",errno);
70 return errno;
71}
72
73retval = ioctl(g_fd_sink, TIOCSETD, &sink_ldisc_num);
74if (retval < 0) {
75 printf("Error on ioctl(). errno: %d\n", errno);
76 return errno;
77}
78
79retval = ioctl(g_fd_source, TIOCSETD, &source_ldisc_num);
80if (retval < 0) {
81 printf("Error on ioctl(). errno: %d\n", errno);
82 return errno;
83}
84
85/////////// To disconnect n_tracerouter and n_tracesink ////////
86
87// First make sure data through the ldiscs has stopped.
88
89// Second, disconnect ldiscs. This provides a
90// little cleaner shutdown on tty stack.
91sink_ldisc_num = 0;
92source_ldisc_num = 0;
93ioctl(g_fd_uart, TIOCSETD, &sink_ldisc_num);
94ioctl(g_fd_gadget, TIOCSETD, &source_ldisc_num);
95
96// Three, program closes connection, and cleanup:
97close(g_fd_uart);
98close(g_fd_gadget);
99g_fd_uart = g_fd_gadget = NULL;
diff --git a/Documentation/ptp/ptp.txt b/Documentation/ptp/ptp.txt
new file mode 100644
index 000000000000..ae8fef86b832
--- /dev/null
+++ b/Documentation/ptp/ptp.txt
@@ -0,0 +1,89 @@
1
2* PTP hardware clock infrastructure for Linux
3
4 This patch set introduces support for IEEE 1588 PTP clocks in
5 Linux. Together with the SO_TIMESTAMPING socket options, this
6 presents a standardized method for developing PTP user space
7 programs, synchronizing Linux with external clocks, and using the
8 ancillary features of PTP hardware clocks.
9
10 A new class driver exports a kernel interface for specific clock
11 drivers and a user space interface. The infrastructure supports a
12 complete set of PTP hardware clock functionality.
13
14 + Basic clock operations
15 - Set time
16 - Get time
17 - Shift the clock by a given offset atomically
18 - Adjust clock frequency
19
20 + Ancillary clock features
21 - One short or periodic alarms, with signal delivery to user program
22 - Time stamp external events
23 - Period output signals configurable from user space
24 - Synchronization of the Linux system time via the PPS subsystem
25
26** PTP hardware clock kernel API
27
28 A PTP clock driver registers itself with the class driver. The
29 class driver handles all of the dealings with user space. The
30 author of a clock driver need only implement the details of
31 programming the clock hardware. The clock driver notifies the class
32 driver of asynchronous events (alarms and external time stamps) via
33 a simple message passing interface.
34
35 The class driver supports multiple PTP clock drivers. In normal use
36 cases, only one PTP clock is needed. However, for testing and
37 development, it can be useful to have more than one clock in a
38 single system, in order to allow performance comparisons.
39
40** PTP hardware clock user space API
41
42 The class driver also creates a character device for each
43 registered clock. User space can use an open file descriptor from
44 the character device as a POSIX clock id and may call
45 clock_gettime, clock_settime, and clock_adjtime. These calls
46 implement the basic clock operations.
47
48 User space programs may control the clock using standardized
49 ioctls. A program may query, enable, configure, and disable the
50 ancillary clock features. User space can receive time stamped
51 events via blocking read() and poll(). One shot and periodic
52 signals may be configured via the POSIX timer_settime() system
53 call.
54
55** Writing clock drivers
56
57 Clock drivers include include/linux/ptp_clock_kernel.h and register
58 themselves by presenting a 'struct ptp_clock_info' to the
59 registration method. Clock drivers must implement all of the
60 functions in the interface. If a clock does not offer a particular
61 ancillary feature, then the driver should just return -EOPNOTSUPP
62 from those functions.
63
64 Drivers must ensure that all of the methods in interface are
65 reentrant. Since most hardware implementations treat the time value
66 as a 64 bit integer accessed as two 32 bit registers, drivers
67 should use spin_lock_irqsave/spin_unlock_irqrestore to protect
68 against concurrent access. This locking cannot be accomplished in
69 class driver, since the lock may also be needed by the clock
70 driver's interrupt service routine.
71
72** Supported hardware
73
74 + Freescale eTSEC gianfar
75 - 2 Time stamp external triggers, programmable polarity (opt. interrupt)
76 - 2 Alarm registers (optional interrupt)
77 - 3 Periodic signals (optional interrupt)
78
79 + National DP83640
80 - 6 GPIOs programmable as inputs or outputs
81 - 6 GPIOs with dedicated functions (LED/JTAG/clock) can also be
82 used as general inputs or outputs
83 - GPIO inputs can time stamp external triggers
84 - GPIO outputs can produce periodic signals
85 - 1 interrupt pin
86
87 + Intel IXP465
88 - Auxiliary Slave/Master Mode Snapshot (optional interrupt)
89 - Target Time (optional interrupt)
diff --git a/Documentation/ptp/testptp.c b/Documentation/ptp/testptp.c
new file mode 100644
index 000000000000..f59ded066108
--- /dev/null
+++ b/Documentation/ptp/testptp.c
@@ -0,0 +1,381 @@
1/*
2 * PTP 1588 clock support - User space test program
3 *
4 * Copyright (C) 2010 OMICRON electronics GmbH
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20#include <errno.h>
21#include <fcntl.h>
22#include <math.h>
23#include <signal.h>
24#include <stdio.h>
25#include <stdlib.h>
26#include <string.h>
27#include <sys/ioctl.h>
28#include <sys/mman.h>
29#include <sys/stat.h>
30#include <sys/time.h>
31#include <sys/timex.h>
32#include <sys/types.h>
33#include <time.h>
34#include <unistd.h>
35
36#include <linux/ptp_clock.h>
37
38#define DEVICE "/dev/ptp0"
39
40#ifndef ADJ_SETOFFSET
41#define ADJ_SETOFFSET 0x0100
42#endif
43
44#ifndef CLOCK_INVALID
45#define CLOCK_INVALID -1
46#endif
47
48/* When glibc offers the syscall, this will go away. */
49#include <sys/syscall.h>
50static int clock_adjtime(clockid_t id, struct timex *tx)
51{
52 return syscall(__NR_clock_adjtime, id, tx);
53}
54
55static clockid_t get_clockid(int fd)
56{
57#define CLOCKFD 3
58#define FD_TO_CLOCKID(fd) ((~(clockid_t) (fd) << 3) | CLOCKFD)
59
60 return FD_TO_CLOCKID(fd);
61}
62
63static void handle_alarm(int s)
64{
65 printf("received signal %d\n", s);
66}
67
68static int install_handler(int signum, void (*handler)(int))
69{
70 struct sigaction action;
71 sigset_t mask;
72
73 /* Unblock the signal. */
74 sigemptyset(&mask);
75 sigaddset(&mask, signum);
76 sigprocmask(SIG_UNBLOCK, &mask, NULL);
77
78 /* Install the signal handler. */
79 action.sa_handler = handler;
80 action.sa_flags = 0;
81 sigemptyset(&action.sa_mask);
82 sigaction(signum, &action, NULL);
83
84 return 0;
85}
86
87static long ppb_to_scaled_ppm(int ppb)
88{
89 /*
90 * The 'freq' field in the 'struct timex' is in parts per
91 * million, but with a 16 bit binary fractional field.
92 * Instead of calculating either one of
93 *
94 * scaled_ppm = (ppb / 1000) << 16 [1]
95 * scaled_ppm = (ppb << 16) / 1000 [2]
96 *
97 * we simply use double precision math, in order to avoid the
98 * truncation in [1] and the possible overflow in [2].
99 */
100 return (long) (ppb * 65.536);
101}
102
103static void usage(char *progname)
104{
105 fprintf(stderr,
106 "usage: %s [options]\n"
107 " -a val request a one-shot alarm after 'val' seconds\n"
108 " -A val request a periodic alarm every 'val' seconds\n"
109 " -c query the ptp clock's capabilities\n"
110 " -d name device to open\n"
111 " -e val read 'val' external time stamp events\n"
112 " -f val adjust the ptp clock frequency by 'val' ppb\n"
113 " -g get the ptp clock time\n"
114 " -h prints this message\n"
115 " -p val enable output with a period of 'val' nanoseconds\n"
116 " -P val enable or disable (val=1|0) the system clock PPS\n"
117 " -s set the ptp clock time from the system time\n"
118 " -S set the system time from the ptp clock time\n"
119 " -t val shift the ptp clock time by 'val' seconds\n",
120 progname);
121}
122
123int main(int argc, char *argv[])
124{
125 struct ptp_clock_caps caps;
126 struct ptp_extts_event event;
127 struct ptp_extts_request extts_request;
128 struct ptp_perout_request perout_request;
129 struct timespec ts;
130 struct timex tx;
131
132 static timer_t timerid;
133 struct itimerspec timeout;
134 struct sigevent sigevent;
135
136 char *progname;
137 int c, cnt, fd;
138
139 char *device = DEVICE;
140 clockid_t clkid;
141 int adjfreq = 0x7fffffff;
142 int adjtime = 0;
143 int capabilities = 0;
144 int extts = 0;
145 int gettime = 0;
146 int oneshot = 0;
147 int periodic = 0;
148 int perout = -1;
149 int pps = -1;
150 int settime = 0;
151
152 progname = strrchr(argv[0], '/');
153 progname = progname ? 1+progname : argv[0];
154 while (EOF != (c = getopt(argc, argv, "a:A:cd:e:f:ghp:P:sSt:v"))) {
155 switch (c) {
156 case 'a':
157 oneshot = atoi(optarg);
158 break;
159 case 'A':
160 periodic = atoi(optarg);
161 break;
162 case 'c':
163 capabilities = 1;
164 break;
165 case 'd':
166 device = optarg;
167 break;
168 case 'e':
169 extts = atoi(optarg);
170 break;
171 case 'f':
172 adjfreq = atoi(optarg);
173 break;
174 case 'g':
175 gettime = 1;
176 break;
177 case 'p':
178 perout = atoi(optarg);
179 break;
180 case 'P':
181 pps = atoi(optarg);
182 break;
183 case 's':
184 settime = 1;
185 break;
186 case 'S':
187 settime = 2;
188 break;
189 case 't':
190 adjtime = atoi(optarg);
191 break;
192 case 'h':
193 usage(progname);
194 return 0;
195 case '?':
196 default:
197 usage(progname);
198 return -1;
199 }
200 }
201
202 fd = open(device, O_RDWR);
203 if (fd < 0) {
204 fprintf(stderr, "opening %s: %s\n", device, strerror(errno));
205 return -1;
206 }
207
208 clkid = get_clockid(fd);
209 if (CLOCK_INVALID == clkid) {
210 fprintf(stderr, "failed to read clock id\n");
211 return -1;
212 }
213
214 if (capabilities) {
215 if (ioctl(fd, PTP_CLOCK_GETCAPS, &caps)) {
216 perror("PTP_CLOCK_GETCAPS");
217 } else {
218 printf("capabilities:\n"
219 " %d maximum frequency adjustment (ppb)\n"
220 " %d programmable alarms\n"
221 " %d external time stamp channels\n"
222 " %d programmable periodic signals\n"
223 " %d pulse per second\n",
224 caps.max_adj,
225 caps.n_alarm,
226 caps.n_ext_ts,
227 caps.n_per_out,
228 caps.pps);
229 }
230 }
231
232 if (0x7fffffff != adjfreq) {
233 memset(&tx, 0, sizeof(tx));
234 tx.modes = ADJ_FREQUENCY;
235 tx.freq = ppb_to_scaled_ppm(adjfreq);
236 if (clock_adjtime(clkid, &tx)) {
237 perror("clock_adjtime");
238 } else {
239 puts("frequency adjustment okay");
240 }
241 }
242
243 if (adjtime) {
244 memset(&tx, 0, sizeof(tx));
245 tx.modes = ADJ_SETOFFSET;
246 tx.time.tv_sec = adjtime;
247 tx.time.tv_usec = 0;
248 if (clock_adjtime(clkid, &tx) < 0) {
249 perror("clock_adjtime");
250 } else {
251 puts("time shift okay");
252 }
253 }
254
255 if (gettime) {
256 if (clock_gettime(clkid, &ts)) {
257 perror("clock_gettime");
258 } else {
259 printf("clock time: %ld.%09ld or %s",
260 ts.tv_sec, ts.tv_nsec, ctime(&ts.tv_sec));
261 }
262 }
263
264 if (settime == 1) {
265 clock_gettime(CLOCK_REALTIME, &ts);
266 if (clock_settime(clkid, &ts)) {
267 perror("clock_settime");
268 } else {
269 puts("set time okay");
270 }
271 }
272
273 if (settime == 2) {
274 clock_gettime(clkid, &ts);
275 if (clock_settime(CLOCK_REALTIME, &ts)) {
276 perror("clock_settime");
277 } else {
278 puts("set time okay");
279 }
280 }
281
282 if (extts) {
283 memset(&extts_request, 0, sizeof(extts_request));
284 extts_request.index = 0;
285 extts_request.flags = PTP_ENABLE_FEATURE;
286 if (ioctl(fd, PTP_EXTTS_REQUEST, &extts_request)) {
287 perror("PTP_EXTTS_REQUEST");
288 extts = 0;
289 } else {
290 puts("external time stamp request okay");
291 }
292 for (; extts; extts--) {
293 cnt = read(fd, &event, sizeof(event));
294 if (cnt != sizeof(event)) {
295 perror("read");
296 break;
297 }
298 printf("event index %u at %lld.%09u\n", event.index,
299 event.t.sec, event.t.nsec);
300 fflush(stdout);
301 }
302 /* Disable the feature again. */
303 extts_request.flags = 0;
304 if (ioctl(fd, PTP_EXTTS_REQUEST, &extts_request)) {
305 perror("PTP_EXTTS_REQUEST");
306 }
307 }
308
309 if (oneshot) {
310 install_handler(SIGALRM, handle_alarm);
311 /* Create a timer. */
312 sigevent.sigev_notify = SIGEV_SIGNAL;
313 sigevent.sigev_signo = SIGALRM;
314 if (timer_create(clkid, &sigevent, &timerid)) {
315 perror("timer_create");
316 return -1;
317 }
318 /* Start the timer. */
319 memset(&timeout, 0, sizeof(timeout));
320 timeout.it_value.tv_sec = oneshot;
321 if (timer_settime(timerid, 0, &timeout, NULL)) {
322 perror("timer_settime");
323 return -1;
324 }
325 pause();
326 timer_delete(timerid);
327 }
328
329 if (periodic) {
330 install_handler(SIGALRM, handle_alarm);
331 /* Create a timer. */
332 sigevent.sigev_notify = SIGEV_SIGNAL;
333 sigevent.sigev_signo = SIGALRM;
334 if (timer_create(clkid, &sigevent, &timerid)) {
335 perror("timer_create");
336 return -1;
337 }
338 /* Start the timer. */
339 memset(&timeout, 0, sizeof(timeout));
340 timeout.it_interval.tv_sec = periodic;
341 timeout.it_value.tv_sec = periodic;
342 if (timer_settime(timerid, 0, &timeout, NULL)) {
343 perror("timer_settime");
344 return -1;
345 }
346 while (1) {
347 pause();
348 }
349 timer_delete(timerid);
350 }
351
352 if (perout >= 0) {
353 if (clock_gettime(clkid, &ts)) {
354 perror("clock_gettime");
355 return -1;
356 }
357 memset(&perout_request, 0, sizeof(perout_request));
358 perout_request.index = 0;
359 perout_request.start.sec = ts.tv_sec + 2;
360 perout_request.start.nsec = 0;
361 perout_request.period.sec = 0;
362 perout_request.period.nsec = perout;
363 if (ioctl(fd, PTP_PEROUT_REQUEST, &perout_request)) {
364 perror("PTP_PEROUT_REQUEST");
365 } else {
366 puts("periodic output request okay");
367 }
368 }
369
370 if (pps != -1) {
371 int enable = pps ? 1 : 0;
372 if (ioctl(fd, PTP_ENABLE_PPS, enable)) {
373 perror("PTP_ENABLE_PPS");
374 } else {
375 puts("pps for system time request okay");
376 }
377 }
378
379 close(fd);
380 return 0;
381}
diff --git a/Documentation/ptp/testptp.mk b/Documentation/ptp/testptp.mk
new file mode 100644
index 000000000000..4ef2d9755421
--- /dev/null
+++ b/Documentation/ptp/testptp.mk
@@ -0,0 +1,33 @@
1# PTP 1588 clock support - User space test program
2#
3# Copyright (C) 2010 OMICRON electronics GmbH
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19CC = $(CROSS_COMPILE)gcc
20INC = -I$(KBUILD_OUTPUT)/usr/include
21CFLAGS = -Wall $(INC)
22LDLIBS = -lrt
23PROGS = testptp
24
25all: $(PROGS)
26
27testptp: testptp.o
28
29clean:
30 rm -f testptp.o
31
32distclean: clean
33 rm -f $(PROGS)
diff --git a/Documentation/rapidio/rapidio.txt b/Documentation/rapidio/rapidio.txt
new file mode 100644
index 000000000000..be70ee15f8ca
--- /dev/null
+++ b/Documentation/rapidio/rapidio.txt
@@ -0,0 +1,173 @@
1 The Linux RapidIO Subsystem
2
3~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
5The RapidIO standard is a packet-based fabric interconnect standard designed for
6use in embedded systems. Development of the RapidIO standard is directed by the
7RapidIO Trade Association (RTA). The current version of the RapidIO specification
8is publicly available for download from the RTA web-site [1].
9
10This document describes the basics of the Linux RapidIO subsystem and provides
11information on its major components.
12
131 Overview
14----------
15
16Because the RapidIO subsystem follows the Linux device model it is integrated
17into the kernel similarly to other buses by defining RapidIO-specific device and
18bus types and registering them within the device model.
19
20The Linux RapidIO subsystem is architecture independent and therefore defines
21architecture-specific interfaces that provide support for common RapidIO
22subsystem operations.
23
242. Core Components
25------------------
26
27A typical RapidIO network is a combination of endpoints and switches.
28Each of these components is represented in the subsystem by an associated data
29structure. The core logical components of the RapidIO subsystem are defined
30in include/linux/rio.h file.
31
322.1 Master Port
33
34A master port (or mport) is a RapidIO interface controller that is local to the
35processor executing the Linux code. A master port generates and receives RapidIO
36packets (transactions). In the RapidIO subsystem each master port is represented
37by a rio_mport data structure. This structure contains master port specific
38resources such as mailboxes and doorbells. The rio_mport also includes a unique
39host device ID that is valid when a master port is configured as an enumerating
40host.
41
42RapidIO master ports are serviced by subsystem specific mport device drivers
43that provide functionality defined for this subsystem. To provide a hardware
44independent interface for RapidIO subsystem operations, rio_mport structure
45includes rio_ops data structure which contains pointers to hardware specific
46implementations of RapidIO functions.
47
482.2 Device
49
50A RapidIO device is any endpoint (other than mport) or switch in the network.
51All devices are presented in the RapidIO subsystem by corresponding rio_dev data
52structure. Devices form one global device list and per-network device lists
53(depending on number of available mports and networks).
54
552.3 Switch
56
57A RapidIO switch is a special class of device that routes packets between its
58ports towards their final destination. The packet destination port within a
59switch is defined by an internal routing table. A switch is presented in the
60RapidIO subsystem by rio_dev data structure expanded by additional rio_switch
61data structure, which contains switch specific information such as copy of the
62routing table and pointers to switch specific functions.
63
64The RapidIO subsystem defines the format and initialization method for subsystem
65specific switch drivers that are designed to provide hardware-specific
66implementation of common switch management routines.
67
682.4 Network
69
70A RapidIO network is a combination of interconnected endpoint and switch devices.
71Each RapidIO network known to the system is represented by corresponding rio_net
72data structure. This structure includes lists of all devices and local master
73ports that form the same network. It also contains a pointer to the default
74master port that is used to communicate with devices within the network.
75
763. Subsystem Initialization
77---------------------------
78
79In order to initialize the RapidIO subsystem, a platform must initialize and
80register at least one master port within the RapidIO network. To register mport
81within the subsystem controller driver initialization code calls function
82rio_register_mport() for each available master port. After all active master
83ports are registered with a RapidIO subsystem, the rio_init_mports() routine
84is called to perform enumeration and discovery.
85
86In the current PowerPC-based implementation a subsys_initcall() is specified to
87perform controller initialization and mport registration. At the end it directly
88calls rio_init_mports() to execute RapidIO enumeration and discovery.
89
904. Enumeration and Discovery
91----------------------------
92
93When rio_init_mports() is called it scans a list of registered master ports and
94calls an enumeration or discovery routine depending on the configured role of a
95master port: host or agent.
96
97Enumeration is performed by a master port if it is configured as a host port by
98assigning a host device ID greater than or equal to zero. A host device ID is
99assigned to a master port through the kernel command line parameter "riohdid=",
100or can be configured in a platform-specific manner. If the host device ID for
101a specific master port is set to -1, the discovery process will be performed
102for it.
103
104The enumeration and discovery routines use RapidIO maintenance transactions
105to access the configuration space of devices.
106
107The enumeration process is implemented according to the enumeration algorithm
108outlined in the RapidIO Interconnect Specification: Annex I [1].
109
110The enumeration process traverses the network using a recursive depth-first
111algorithm. When a new device is found, the enumerator takes ownership of that
112device by writing into the Host Device ID Lock CSR. It does this to ensure that
113the enumerator has exclusive right to enumerate the device. If device ownership
114is successfully acquired, the enumerator allocates a new rio_dev structure and
115initializes it according to device capabilities.
116
117If the device is an endpoint, a unique device ID is assigned to it and its value
118is written into the device's Base Device ID CSR.
119
120If the device is a switch, the enumerator allocates an additional rio_switch
121structure to store switch specific information. Then the switch's vendor ID and
122device ID are queried against a table of known RapidIO switches. Each switch
123table entry contains a pointer to a switch-specific initialization routine that
124initializes pointers to the rest of switch specific operations, and performs
125hardware initialization if necessary. A RapidIO switch does not have a unique
126device ID; it relies on hopcount and routing for device ID of an attached
127endpoint if access to its configuration registers is required. If a switch (or
128chain of switches) does not have any endpoint (except enumerator) attached to
129it, a fake device ID will be assigned to configure a route to that switch.
130In the case of a chain of switches without endpoint, one fake device ID is used
131to configure a route through the entire chain and switches are differentiated by
132their hopcount value.
133
134For both endpoints and switches the enumerator writes a unique component tag
135into device's Component Tag CSR. That unique value is used by the error
136management notification mechanism to identify a device that is reporting an
137error management event.
138
139Enumeration beyond a switch is completed by iterating over each active egress
140port of that switch. For each active link, a route to a default device ID
141(0xFF for 8-bit systems and 0xFFFF for 16-bit systems) is temporarily written
142into the routing table. The algorithm recurs by calling itself with hopcount + 1
143and the default device ID in order to access the device on the active port.
144
145After the host has completed enumeration of the entire network it releases
146devices by clearing device ID locks (calls rio_clear_locks()). For each endpoint
147in the system, it sets the Master Enable bit in the Port General Control CSR
148to indicate that enumeration is completed and agents are allowed to execute
149passive discovery of the network.
150
151The discovery process is performed by agents and is similar to the enumeration
152process that is described above. However, the discovery process is performed
153without changes to the existing routing because agents only gather information
154about RapidIO network structure and are building an internal map of discovered
155devices. This way each Linux-based component of the RapidIO subsystem has
156a complete view of the network. The discovery process can be performed
157simultaneously by several agents. After initializing its RapidIO master port
158each agent waits for enumeration completion by the host for the configured wait
159time period. If this wait time period expires before enumeration is completed,
160an agent skips RapidIO discovery and continues with remaining kernel
161initialization.
162
1635. References
164-------------
165
166[1] RapidIO Trade Association. RapidIO Interconnect Specifications.
167 http://www.rapidio.org.
168[2] Rapidio TA. Technology Comparisons.
169 http://www.rapidio.org/education/technology_comparisons/
170[3] RapidIO support for Linux.
171 http://lwn.net/Articles/139118/
172[4] Matt Porter. RapidIO for Linux. Ottawa Linux Symposium, 2005
173 http://www.kernel.org/doc/ols/2005/ols2005v2-pages-43-56.pdf
diff --git a/Documentation/rapidio/sysfs.txt b/Documentation/rapidio/sysfs.txt
new file mode 100644
index 000000000000..97f71ce575d6
--- /dev/null
+++ b/Documentation/rapidio/sysfs.txt
@@ -0,0 +1,90 @@
1 RapidIO sysfs Files
2
3~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
51. Device Subdirectories
6------------------------
7
8For each RapidIO device, the RapidIO subsystem creates files in an individual
9subdirectory with the following name, /sys/bus/rapidio/devices/<device_name>.
10
11The format of device_name is "nn:d:iiii", where:
12
13nn - two-digit hexadecimal ID of RapidIO network where the device resides
14d - device typr: 'e' - for endpoint or 's' - for switch
15iiii - four-digit device destID for endpoints, or switchID for switches
16
17For example, below is a list of device directories that represents a typical
18RapidIO network with one switch, one host, and two agent endpoints, as it is
19seen by the enumerating host (destID = 1):
20
21/sys/bus/rapidio/devices/00:e:0000
22/sys/bus/rapidio/devices/00:e:0002
23/sys/bus/rapidio/devices/00:s:0001
24
25NOTE: An enumerating or discovering endpoint does not create a sysfs entry for
26itself, this is why an endpoint with destID=1 is not shown in the list.
27
282. Attributes Common for All Devices
29------------------------------------
30
31Each device subdirectory contains the following informational read-only files:
32
33 did - returns the device identifier
34 vid - returns the device vendor identifier
35device_rev - returns the device revision level
36 asm_did - returns identifier for the assembly containing the device
37 asm_rev - returns revision level of the assembly containing the device
38 asm_vid - returns vendor identifier of the assembly containing the device
39 destid - returns device destination ID assigned by the enumeration routine
40 (see 4.1 for switch specific details)
41 lprev - returns name of previous device (switch) on the path to the device
42 that that owns this attribute
43
44In addition to the files listed above, each device has a binary attribute file
45that allows read/write access to the device configuration registers using
46the RapidIO maintenance transactions:
47
48 config - reads from and writes to the device configuration registers.
49
50This attribute is similar in behavior to the "config" attribute of PCI devices
51and provides an access to the RapidIO device registers using standard file read
52and write operations.
53
543. Endpoint Device Attributes
55-----------------------------
56
57Currently Linux RapidIO subsystem does not create any endpoint specific sysfs
58attributes. It is possible that RapidIO master port drivers and endpoint device
59drivers will add their device-specific sysfs attributes but such attributes are
60outside the scope of this document.
61
624. Switch Device Attributes
63---------------------------
64
65RapidIO switches have additional attributes in sysfs. RapidIO subsystem supports
66common and device-specific sysfs attributes for switches. Because switches are
67integrated into the RapidIO subsystem, it offers a method to create
68device-specific sysfs attributes by specifying a callback function that may be
69set by the switch initialization routine during enumeration or discovery process.
70
714.1 Common Switch Attributes
72
73 routes - reports switch routing information in "destID port" format. This
74 attribute reports only valid routing table entries, one line for
75 each entry.
76 destid - device destination ID that defines a route to the switch
77 hopcount - number of hops on the path to the switch
78 lnext - returns names of devices linked to the switch except one of a device
79 linked to the ingress port (reported as "lprev"). This is an array
80 names with number of lines equal to number of ports in switch. If
81 a switch port has no attached device, returns "null" instead of
82 a device name.
83
844.2 Device-specific Switch Attributes
85
86Device-specific switch attributes are listed for each RapidIO switch driver
87that exports additional attributes.
88
89IDT_GEN2:
90 errlog - reads contents of device error log until it is empty.
diff --git a/Documentation/rbtree.txt b/Documentation/rbtree.txt
index 221f38be98f4..19f8278c3854 100644
--- a/Documentation/rbtree.txt
+++ b/Documentation/rbtree.txt
@@ -21,8 +21,8 @@ three rotations, respectively, to balance the tree), with slightly slower
21To quote Linux Weekly News: 21To quote Linux Weekly News:
22 22
23 There are a number of red-black trees in use in the kernel. 23 There are a number of red-black trees in use in the kernel.
24 The anticipatory, deadline, and CFQ I/O schedulers all employ 24 The deadline and CFQ I/O schedulers employ rbtrees to
25 rbtrees to track requests; the packet CD/DVD driver does the same. 25 track requests; the packet CD/DVD driver does the same.
26 The high-resolution timer code uses an rbtree to organize outstanding 26 The high-resolution timer code uses an rbtree to organize outstanding
27 timer requests. The ext3 filesystem tracks directory entries in a 27 timer requests. The ext3 filesystem tracks directory entries in a
28 red-black tree. Virtual memory areas (VMAs) are tracked with red-black 28 red-black tree. Virtual memory areas (VMAs) are tracked with red-black
diff --git a/Documentation/rtc.txt b/Documentation/rtc.txt
index 9104c1062084..250160469d83 100644
--- a/Documentation/rtc.txt
+++ b/Documentation/rtc.txt
@@ -178,38 +178,29 @@ RTC class framework, but can't be supported by the older driver.
178 setting the longer alarm time and enabling its IRQ using a single 178 setting the longer alarm time and enabling its IRQ using a single
179 request (using the same model as EFI firmware). 179 request (using the same model as EFI firmware).
180 180
181 * RTC_UIE_ON, RTC_UIE_OFF ... if the RTC offers IRQs, it probably 181 * RTC_UIE_ON, RTC_UIE_OFF ... if the RTC offers IRQs, the RTC framework
182 also offers update IRQs whenever the "seconds" counter changes. 182 will emulate this mechanism.
183 If needed, the RTC framework can emulate this mechanism.
184 183
185 * RTC_PIE_ON, RTC_PIE_OFF, RTC_IRQP_SET, RTC_IRQP_READ ... another 184 * RTC_PIE_ON, RTC_PIE_OFF, RTC_IRQP_SET, RTC_IRQP_READ ... these icotls
186 feature often accessible with an IRQ line is a periodic IRQ, issued 185 are emulated via a kernel hrtimer.
187 at settable frequencies (usually 2^N Hz).
188 186
189In many cases, the RTC alarm can be a system wake event, used to force 187In many cases, the RTC alarm can be a system wake event, used to force
190Linux out of a low power sleep state (or hibernation) back to a fully 188Linux out of a low power sleep state (or hibernation) back to a fully
191operational state. For example, a system could enter a deep power saving 189operational state. For example, a system could enter a deep power saving
192state until it's time to execute some scheduled tasks. 190state until it's time to execute some scheduled tasks.
193 191
194Note that many of these ioctls need not actually be implemented by your 192Note that many of these ioctls are handled by the common rtc-dev interface.
195driver. The common rtc-dev interface handles many of these nicely if your 193Some common examples:
196driver returns ENOIOCTLCMD. Some common examples:
197 194
198 * RTC_RD_TIME, RTC_SET_TIME: the read_time/set_time functions will be 195 * RTC_RD_TIME, RTC_SET_TIME: the read_time/set_time functions will be
199 called with appropriate values. 196 called with appropriate values.
200 197
201 * RTC_ALM_SET, RTC_ALM_READ, RTC_WKALM_SET, RTC_WKALM_RD: the 198 * RTC_ALM_SET, RTC_ALM_READ, RTC_WKALM_SET, RTC_WKALM_RD: gets or sets
202 set_alarm/read_alarm functions will be called. 199 the alarm rtc_timer. May call the set_alarm driver function.
203 200
204 * RTC_IRQP_SET, RTC_IRQP_READ: the irq_set_freq function will be called 201 * RTC_IRQP_SET, RTC_IRQP_READ: These are emulated by the generic code.
205 to set the frequency while the framework will handle the read for you
206 since the frequency is stored in the irq_freq member of the rtc_device
207 structure. Your driver needs to initialize the irq_freq member during
208 init. Make sure you check the requested frequency is in range of your
209 hardware in the irq_set_freq function. If it isn't, return -EINVAL. If
210 you cannot actually change the frequency, do not define irq_set_freq.
211 202
212 * RTC_PIE_ON, RTC_PIE_OFF: the irq_set_state function will be called. 203 * RTC_PIE_ON, RTC_PIE_OFF: These are also emulated by the generic code.
213 204
214If all else fails, check out the rtc-test.c driver! 205If all else fails, check out the rtc-test.c driver!
215 206
diff --git a/Documentation/s390/Debugging390.txt b/Documentation/s390/Debugging390.txt
index 86f9f74b2b34..efe998becc5b 100644
--- a/Documentation/s390/Debugging390.txt
+++ b/Documentation/s390/Debugging390.txt
@@ -2273,7 +2273,7 @@ IP forwarding is on.
2273There is a lot of useful info in here best found by going in & having a look around, 2273There is a lot of useful info in here best found by going in & having a look around,
2274so I'll take you through some entries I consider important. 2274so I'll take you through some entries I consider important.
2275 2275
2276All the processes running on the machine have there own entry defined by 2276All the processes running on the machine have their own entry defined by
2277/proc/<pid> 2277/proc/<pid>
2278So lets have a look at the init process 2278So lets have a look at the init process
2279cd /proc/1 2279cd /proc/1
diff --git a/Documentation/scheduler/00-INDEX b/Documentation/scheduler/00-INDEX
index 3c00c9c3219e..d2651c47ae27 100644
--- a/Documentation/scheduler/00-INDEX
+++ b/Documentation/scheduler/00-INDEX
@@ -3,7 +3,7 @@
3sched-arch.txt 3sched-arch.txt
4 - CPU Scheduler implementation hints for architecture specific code. 4 - CPU Scheduler implementation hints for architecture specific code.
5sched-design-CFS.txt 5sched-design-CFS.txt
6 - goals, design and implementation of the Complete Fair Scheduler. 6 - goals, design and implementation of the Completely Fair Scheduler.
7sched-domains.txt 7sched-domains.txt
8 - information on scheduling domains. 8 - information on scheduling domains.
9sched-nice-design.txt 9sched-nice-design.txt
diff --git a/Documentation/scheduler/sched-design-CFS.txt b/Documentation/scheduler/sched-design-CFS.txt
index 8239ebbcddce..91ecff07cede 100644
--- a/Documentation/scheduler/sched-design-CFS.txt
+++ b/Documentation/scheduler/sched-design-CFS.txt
@@ -164,7 +164,7 @@ This is the (partial) list of the hooks:
164 It puts the scheduling entity (task) into the red-black tree and 164 It puts the scheduling entity (task) into the red-black tree and
165 increments the nr_running variable. 165 increments the nr_running variable.
166 166
167 - dequeue_tree(...) 167 - dequeue_task(...)
168 168
169 When a task is no longer runnable, this function is called to keep the 169 When a task is no longer runnable, this function is called to keep the
170 corresponding scheduling entity out of the red-black tree. It decrements 170 corresponding scheduling entity out of the red-black tree. It decrements
@@ -195,11 +195,6 @@ This is the (partial) list of the hooks:
195 This function is mostly called from time tick functions; it might lead to 195 This function is mostly called from time tick functions; it might lead to
196 process switch. This drives the running preemption. 196 process switch. This drives the running preemption.
197 197
198 - task_new(...)
199
200 The core scheduler gives the scheduling module an opportunity to manage new
201 task startup. The CFS scheduling module uses it for group scheduling, while
202 the scheduling module for a real-time task does not use it.
203 198
204 199
205 200
@@ -228,9 +223,10 @@ When CONFIG_FAIR_GROUP_SCHED is defined, a "cpu.shares" file is created for each
228group created using the pseudo filesystem. See example steps below to create 223group created using the pseudo filesystem. See example steps below to create
229task groups and modify their CPU share using the "cgroups" pseudo filesystem. 224task groups and modify their CPU share using the "cgroups" pseudo filesystem.
230 225
231 # mkdir /dev/cpuctl 226 # mount -t tmpfs cgroup_root /sys/fs/cgroup
232 # mount -t cgroup -ocpu none /dev/cpuctl 227 # mkdir /sys/fs/cgroup/cpu
233 # cd /dev/cpuctl 228 # mount -t cgroup -ocpu none /sys/fs/cgroup/cpu
229 # cd /sys/fs/cgroup/cpu
234 230
235 # mkdir multimedia # create "multimedia" group of tasks 231 # mkdir multimedia # create "multimedia" group of tasks
236 # mkdir browser # create "browser" group of tasks 232 # mkdir browser # create "browser" group of tasks
diff --git a/Documentation/scheduler/sched-domains.txt b/Documentation/scheduler/sched-domains.txt
index 373ceacc367e..b7ee379b651b 100644
--- a/Documentation/scheduler/sched-domains.txt
+++ b/Documentation/scheduler/sched-domains.txt
@@ -1,8 +1,7 @@
1Each CPU has a "base" scheduling domain (struct sched_domain). These are 1Each CPU has a "base" scheduling domain (struct sched_domain). The domain
2accessed via cpu_sched_domain(i) and this_sched_domain() macros. The domain
3hierarchy is built from these base domains via the ->parent pointer. ->parent 2hierarchy is built from these base domains via the ->parent pointer. ->parent
4MUST be NULL terminated, and domain structures should be per-CPU as they 3MUST be NULL terminated, and domain structures should be per-CPU as they are
5are locklessly updated. 4locklessly updated.
6 5
7Each scheduling domain spans a number of CPUs (stored in the ->span field). 6Each scheduling domain spans a number of CPUs (stored in the ->span field).
8A domain's span MUST be a superset of it child's span (this restriction could 7A domain's span MUST be a superset of it child's span (this restriction could
@@ -26,11 +25,26 @@ is treated as one entity. The load of a group is defined as the sum of the
26load of each of its member CPUs, and only when the load of a group becomes 25load of each of its member CPUs, and only when the load of a group becomes
27out of balance are tasks moved between groups. 26out of balance are tasks moved between groups.
28 27
29In kernel/sched.c, rebalance_tick is run periodically on each CPU. This 28In kernel/sched.c, trigger_load_balance() is run periodically on each CPU
30function takes its CPU's base sched domain and checks to see if has reached 29through scheduler_tick(). It raises a softirq after the next regularly scheduled
31its rebalance interval. If so, then it will run load_balance on that domain. 30rebalancing event for the current runqueue has arrived. The actual load
32rebalance_tick then checks the parent sched_domain (if it exists), and the 31balancing workhorse, run_rebalance_domains()->rebalance_domains(), is then run
33parent of the parent and so forth. 32in softirq context (SCHED_SOFTIRQ).
33
34The latter function takes two arguments: the current CPU and whether it was idle
35at the time the scheduler_tick() happened and iterates over all sched domains
36our CPU is on, starting from its base domain and going up the ->parent chain.
37While doing that, it checks to see if the current domain has exhausted its
38rebalance interval. If so, it runs load_balance() on that domain. It then checks
39the parent sched_domain (if it exists), and the parent of the parent and so
40forth.
41
42Initially, load_balance() finds the busiest group in the current sched domain.
43If it succeeds, it looks for the busiest runqueue of all the CPUs' runqueues in
44that group. If it manages to find such a runqueue, it locks both our initial
45CPU's runqueue and the newly found busiest one and starts moving tasks from it
46to our runqueue. The exact number of tasks amounts to an imbalance previously
47computed while iterating over this sched domain's groups.
34 48
35*** Implementing sched domains *** 49*** Implementing sched domains ***
36The "base" domain will "span" the first level of the hierarchy. In the case 50The "base" domain will "span" the first level of the hierarchy. In the case
diff --git a/Documentation/scheduler/sched-rt-group.txt b/Documentation/scheduler/sched-rt-group.txt
index 605b0d40329d..71b54d549987 100644
--- a/Documentation/scheduler/sched-rt-group.txt
+++ b/Documentation/scheduler/sched-rt-group.txt
@@ -129,9 +129,8 @@ priority!
129Enabling CONFIG_RT_GROUP_SCHED lets you explicitly allocate real 129Enabling CONFIG_RT_GROUP_SCHED lets you explicitly allocate real
130CPU bandwidth to task groups. 130CPU bandwidth to task groups.
131 131
132This uses the /cgroup virtual file system and 132This uses the cgroup virtual file system and "<cgroup>/cpu.rt_runtime_us"
133"/cgroup/<cgroup>/cpu.rt_runtime_us" to control the CPU time reserved for each 133to control the CPU time reserved for each control group.
134control group.
135 134
136For more information on working with control groups, you should read 135For more information on working with control groups, you should read
137Documentation/cgroups/cgroups.txt as well. 136Documentation/cgroups/cgroups.txt as well.
@@ -150,7 +149,7 @@ For now, this can be simplified to just the following (but see Future plans):
150=============== 149===============
151 150
152There is work in progress to make the scheduling period for each group 151There is work in progress to make the scheduling period for each group
153("/cgroup/<cgroup>/cpu.rt_period_us") configurable as well. 152("<cgroup>/cpu.rt_period_us") configurable as well.
154 153
155The constraint on the period is that a subgroup must have a smaller or 154The constraint on the period is that a subgroup must have a smaller or
156equal period to its parent. But realistically its not very useful _yet_ 155equal period to its parent. But realistically its not very useful _yet_
diff --git a/Documentation/scheduler/sched-stats.txt b/Documentation/scheduler/sched-stats.txt
index 01e69404ee5e..1cd5d51bc761 100644
--- a/Documentation/scheduler/sched-stats.txt
+++ b/Documentation/scheduler/sched-stats.txt
@@ -1,3 +1,7 @@
1Version 15 of schedstats dropped counters for some sched_yield:
2yld_exp_empty, yld_act_empty and yld_both_empty. Otherwise, it is
3identical to version 14.
4
1Version 14 of schedstats includes support for sched_domains, which hit the 5Version 14 of schedstats includes support for sched_domains, which hit the
2mainline kernel in 2.6.20 although it is identical to the stats from version 6mainline kernel in 2.6.20 although it is identical to the stats from version
312 which was in the kernel from 2.6.13-2.6.19 (version 13 never saw a kernel 712 which was in the kernel from 2.6.13-2.6.19 (version 13 never saw a kernel
@@ -28,32 +32,25 @@ to write their own scripts, the fields are described here.
28 32
29CPU statistics 33CPU statistics
30-------------- 34--------------
31cpu<N> 1 2 3 4 5 6 7 8 9 10 11 12 35cpu<N> 1 2 3 4 5 6 7 8 9
32
33NOTE: In the sched_yield() statistics, the active queue is considered empty
34 if it has only one process in it, since obviously the process calling
35 sched_yield() is that process.
36 36
37First four fields are sched_yield() statistics: 37First field is a sched_yield() statistic:
38 1) # of times both the active and the expired queue were empty 38 1) # of times sched_yield() was called
39 2) # of times just the active queue was empty
40 3) # of times just the expired queue was empty
41 4) # of times sched_yield() was called
42 39
43Next three are schedule() statistics: 40Next three are schedule() statistics:
44 5) # of times we switched to the expired queue and reused it 41 2) # of times we switched to the expired queue and reused it
45 6) # of times schedule() was called 42 3) # of times schedule() was called
46 7) # of times schedule() left the processor idle 43 4) # of times schedule() left the processor idle
47 44
48Next two are try_to_wake_up() statistics: 45Next two are try_to_wake_up() statistics:
49 8) # of times try_to_wake_up() was called 46 5) # of times try_to_wake_up() was called
50 9) # of times try_to_wake_up() was called to wake up the local cpu 47 6) # of times try_to_wake_up() was called to wake up the local cpu
51 48
52Next three are statistics describing scheduling latency: 49Next three are statistics describing scheduling latency:
53 10) sum of all time spent running by tasks on this processor (in jiffies) 50 7) sum of all time spent running by tasks on this processor (in jiffies)
54 11) sum of all time spent waiting to run by tasks on this processor (in 51 8) sum of all time spent waiting to run by tasks on this processor (in
55 jiffies) 52 jiffies)
56 12) # of timeslices run on this cpu 53 9) # of timeslices run on this cpu
57 54
58 55
59Domain statistics 56Domain statistics
diff --git a/Documentation/scsi/ChangeLog.lpfc b/Documentation/scsi/ChangeLog.lpfc
index 337c924cc81f..c56ec99d7b2f 100644
--- a/Documentation/scsi/ChangeLog.lpfc
+++ b/Documentation/scsi/ChangeLog.lpfc
@@ -352,7 +352,7 @@ Changes from 20041229 to 20050110
352 lpfc_scsiport.c 352 lpfc_scsiport.c
353 * In remote port changes: no longer nulling target->pnode when 353 * In remote port changes: no longer nulling target->pnode when
354 removing from mapped list. Pnode get nulled when the node is 354 removing from mapped list. Pnode get nulled when the node is
355 freed (after nodev tmo). This bug was causing i/o recieved in 355 freed (after nodev tmo). This bug was causing i/o received in
356 the small window while the device was blocked to be errored w/ 356 the small window while the device was blocked to be errored w/
357 did_no_connect. With the fix, it returns host_busy 357 did_no_connect. With the fix, it returns host_busy
358 (per the pre-remote port changes). 358 (per the pre-remote port changes).
@@ -530,7 +530,7 @@ Changes from 20041018 to 20041123
530 coherent mappings. Note: There are more consistent mappings 530 coherent mappings. Note: There are more consistent mappings
531 that are using pci_dma_sync calls. Probably these should be 531 that are using pci_dma_sync calls. Probably these should be
532 removed as well. 532 removed as well.
533 * Modified lpfc_free_scsi_buf to accomodate all three scsi_buf 533 * Modified lpfc_free_scsi_buf to accommodate all three scsi_buf
534 free types to alleviate miscellaneous panics with cable pull 534 free types to alleviate miscellaneous panics with cable pull
535 testing. 535 testing.
536 * Set hotplug to default 0 and lpfc_target_remove to not remove 536 * Set hotplug to default 0 and lpfc_target_remove to not remove
@@ -573,7 +573,7 @@ Changes from 20041018 to 20041123
573 * Backround nodev_timeout processing to DPC This enables us to 573 * Backround nodev_timeout processing to DPC This enables us to
574 unblock (stop dev_loss_tmo) when appopriate. 574 unblock (stop dev_loss_tmo) when appopriate.
575 * Fix array discovery with multiple luns. The max_luns was 0 at 575 * Fix array discovery with multiple luns. The max_luns was 0 at
576 the time the host structure was intialized. lpfc_cfg_params 576 the time the host structure was initialized. lpfc_cfg_params
577 then set the max_luns to the correct value afterwards. 577 then set the max_luns to the correct value afterwards.
578 * Remove unused define LPFC_MAX_LUN and set the default value of 578 * Remove unused define LPFC_MAX_LUN and set the default value of
579 lpfc_max_lun parameter to 512. 579 lpfc_max_lun parameter to 512.
@@ -583,7 +583,7 @@ Changes from 20041018 to 20041123
583 included more than once. 583 included more than once.
584 * Replaced "set_current_state(TASK_UNINTERRUPTIBLE); 584 * Replaced "set_current_state(TASK_UNINTERRUPTIBLE);
585 schedule_timeout(timeout)" with "msleep(timeout)". 585 schedule_timeout(timeout)" with "msleep(timeout)".
586 * Fixnode was loosing starget when rediscovered. We saw messages 586 * Fixnode was losing starget when rediscovered. We saw messages
587 like: lpfc 0000:04:02.0: 0:0263 Cannot block scsi target as a 587 like: lpfc 0000:04:02.0: 0:0263 Cannot block scsi target as a
588 result. Moved starget field into struct lpfc_target which is 588 result. Moved starget field into struct lpfc_target which is
589 referenced from the node. 589 referenced from the node.
@@ -604,7 +604,7 @@ Changes from 20041018 to 20041123
604 * Make 3 functions static: lpfc_get_hba_sym_node_name, 604 * Make 3 functions static: lpfc_get_hba_sym_node_name,
605 lpfc_intr_prep and lpfc_setup_slim_access. Move lpfc_intr_prep 605 lpfc_intr_prep and lpfc_setup_slim_access. Move lpfc_intr_prep
606 and lpfc_setup_slim_access so they're defined before being used. 606 and lpfc_setup_slim_access so they're defined before being used.
607 * Remove an unecessary list_del() in lpfc_hbadisc.c. 607 * Remove an unnecessary list_del() in lpfc_hbadisc.c.
608 * Set nlp_state before calling lpfc_nlp_list() since this will 608 * Set nlp_state before calling lpfc_nlp_list() since this will
609 potentially call fc_target_unblock which may cause a race in 609 potentially call fc_target_unblock which may cause a race in
610 queuecommand by releasing host_lock. 610 queuecommand by releasing host_lock.
@@ -753,7 +753,7 @@ Changes from 20040908 to 20040920
753 * Changed version number to 8.0.12 753 * Changed version number to 8.0.12
754 * Removed used #defines: DEFAULT_PCI_LATENCY_CLOCKS and 754 * Removed used #defines: DEFAULT_PCI_LATENCY_CLOCKS and
755 PCI_LATENCY_VALUE from lpfc_hw.h. 755 PCI_LATENCY_VALUE from lpfc_hw.h.
756 * Changes to accomodate rnid. 756 * Changes to accommodate rnid.
757 * Fix RSCN handling so RSCN NS queries only effect NPorts found in 757 * Fix RSCN handling so RSCN NS queries only effect NPorts found in
758 RSCN data. 758 RSCN data.
759 * If we rcv a plogi on a NPort queued up for discovery, clear the 759 * If we rcv a plogi on a NPort queued up for discovery, clear the
@@ -813,7 +813,7 @@ Changes from 20040908 to 20040920
813 counter instead, brd_no isn't reused anymore. Also some tiny 813 counter instead, brd_no isn't reused anymore. Also some tiny
814 whitespace cleanups in surrounding code. 814 whitespace cleanups in surrounding code.
815 * Reorder functions in lpfc_els.c to remove need for prototypes. 815 * Reorder functions in lpfc_els.c to remove need for prototypes.
816 * Removed unsed prototypes from lpfc_crtn.h - 816 * Removed unused prototypes from lpfc_crtn.h -
817 lpfc_ip_timeout_handler, lpfc_read_pci and lpfc_revoke. 817 lpfc_ip_timeout_handler, lpfc_read_pci and lpfc_revoke.
818 * Removed some unused prototypes from lpfc_crtn.h - 818 * Removed some unused prototypes from lpfc_crtn.h -
819 lpfc_scsi_hba_reset, lpfc_scsi_issue_inqsn, 819 lpfc_scsi_hba_reset, lpfc_scsi_issue_inqsn,
@@ -863,7 +863,7 @@ Changes from 20040823 to 20040908
863 * Minimal support for SCSI flat space addressing/volume set 863 * Minimal support for SCSI flat space addressing/volume set
864 addressing. Use 16 bits of LUN address so that flat 864 addressing. Use 16 bits of LUN address so that flat
865 addressing/VSA will work. 865 addressing/VSA will work.
866 * Changed 2 occurences of if( 1 != f(x)) to if(f(x) != 1) 866 * Changed 2 occurrences of if( 1 != f(x)) to if(f(x) != 1)
867 * Drop include of lpfc_cfgparm.h. 867 * Drop include of lpfc_cfgparm.h.
868 * Reduce stack usage of lpfc_fdmi_cmd in lpfc_ct.c. 868 * Reduce stack usage of lpfc_fdmi_cmd in lpfc_ct.c.
869 * Add minimum range checking property to /sys write/store 869 * Add minimum range checking property to /sys write/store
@@ -1449,7 +1449,7 @@ Changes from 20040402 to 20040409
1449 * Removed lpfc_els_chk_latt from the lpfc_config_post function. 1449 * Removed lpfc_els_chk_latt from the lpfc_config_post function.
1450 lpfc_els_chk_latt will enable the link event interrupts when 1450 lpfc_els_chk_latt will enable the link event interrupts when
1451 flogi is pending which causes two discovery state machines 1451 flogi is pending which causes two discovery state machines
1452 running parallely. 1452 running parallelly.
1453 * Add pci_disable_device to unload path. 1453 * Add pci_disable_device to unload path.
1454 * Move lpfc_sleep_event from lpfc_fcp.c to lpfc_util_ioctl.c 1454 * Move lpfc_sleep_event from lpfc_fcp.c to lpfc_util_ioctl.c
1455 * Call dma_map_single() & pci_map_single() directly instead of via 1455 * Call dma_map_single() & pci_map_single() directly instead of via
@@ -1590,7 +1590,7 @@ Changes from 20040326 to 20040402
1590 ELX_WRITE_HS ELX_WRITE_HA ELX_WRITE_CA ELX_READ_HC 1590 ELX_WRITE_HS ELX_WRITE_HA ELX_WRITE_CA ELX_READ_HC
1591 ELX_READ_HS ELX_READ_HA ELX_READ_CA ELX_READ_MB ELX_RESET 1591 ELX_READ_HS ELX_READ_HA ELX_READ_CA ELX_READ_MB ELX_RESET
1592 ELX_READ_HBA ELX_INSTANCE ELX_LIP. Also introduced 1592 ELX_READ_HBA ELX_INSTANCE ELX_LIP. Also introduced
1593 attribute "set" to be used in conjuction with the above 1593 attribute "set" to be used in conjunction with the above
1594 attributes. 1594 attributes.
1595 * Removed DLINK, enque and deque declarations now that clock 1595 * Removed DLINK, enque and deque declarations now that clock
1596 doesn't use them anymore 1596 doesn't use them anymore
diff --git a/Documentation/scsi/ChangeLog.megaraid b/Documentation/scsi/ChangeLog.megaraid
index 5e07d320817d..d2052fdbedd2 100644
--- a/Documentation/scsi/ChangeLog.megaraid
+++ b/Documentation/scsi/ChangeLog.megaraid
@@ -168,7 +168,7 @@ Older Version : 2.20.4.6 (scsi module), 2.20.2.6 (cmm module)
168 168
1691. Sorted out PCI IDs to remove megaraid support overlaps. 1691. Sorted out PCI IDs to remove megaraid support overlaps.
170 Based on the patch from Daniel, sorted out PCI IDs along with 170 Based on the patch from Daniel, sorted out PCI IDs along with
171 charactor node name change from 'megadev' to 'megadev_legacy' to avoid 171 character node name change from 'megadev' to 'megadev_legacy' to avoid
172 conflict. 172 conflict.
173 --- 173 ---
174 Hopefully we'll be getting the build restriction zapped much sooner, 174 Hopefully we'll be getting the build restriction zapped much sooner,
diff --git a/Documentation/scsi/ChangeLog.megaraid_sas b/Documentation/scsi/ChangeLog.megaraid_sas
index 30023568805e..9ed1d9d96783 100644
--- a/Documentation/scsi/ChangeLog.megaraid_sas
+++ b/Documentation/scsi/ChangeLog.megaraid_sas
@@ -1,3 +1,109 @@
1Release Date : Wed. May 11, 2011 17:00:00 PST 2010 -
2 (emaild-id:megaraidlinux@lsi.com)
3 Adam Radford
4Current Version : 00.00.05.38-rc1
5Old Version : 00.00.05.34-rc1
6 1. Remove MSI-X black list, use MFI_REG_STATE.ready.msiEnable.
7 2. Remove un-used function megasas_return_cmd_for_smid().
8 3. Check MFI_REG_STATE.fault.resetAdapter in megasas_reset_fusion().
9 4. Disable interrupts/free_irq() in megasas_shutdown().
10 5. Fix bug where AENs could be lost in probe() and resume().
11 6. Convert 6,10,12 byte CDB's to 16 byte CDB for large LBA's for FastPath
12 IO.
13 7. Add 1078 OCR support.
14-------------------------------------------------------------------------------
15Release Date : Thu. Feb 24, 2011 17:00:00 PST 2010 -
16 (emaild-id:megaraidlinux@lsi.com)
17 Adam Radford
18Current Version : 00.00.05.34-rc1
19Old Version : 00.00.05.29-rc1
20 1. Fix some failure gotos from megasas_probe_one(), etc.
21 2. Add missing check_and_restore_queue_depth() call in
22 complete_cmd_fusion().
23 3. Enable MSI-X before calling megasas_init_fw().
24 4. Call tasklet_schedule() even if outbound_intr_status == 0 for MFI based
25 boards in MSI-X mode.
26 5. Fix megasas_probe_one() to clear PCI_MSIX_FLAGS_ENABLE in msi control
27 register in kdump kernel.
28 6. Fix megasas_get_cmd() to only print "Command pool empty" if
29 megasas_dbg_lvl is set.
30 7. Fix megasas_build_dcdb_fusion() to not filter by TYPE_DISK.
31 8. Fix megasas_build_dcdb_fusion() to use io_request->LUN[1] field.
32 9. Add MR_EVT_CFG_CLEARED to megasas_aen_polling().
33 10. Fix tasklet_init() in megasas_init_fw() to use instancet->tasklet.
34 11. Fix fault state handling in megasas_transition_to_ready().
35 12. Fix max_sectors setting for IEEE SGL's.
36 13. Fix iMR OCR support to work correctly.
37-------------------------------------------------------------------------------
38Release Date : Tues. Dec 14, 2010 17:00:00 PST 2010 -
39 (emaild-id:megaraidlinux@lsi.com)
40 Adam Radford
41Current Version : 00.00.05.29-rc1
42Old Version : 00.00.04.31-rc1
43 1. Rename megaraid_sas.c to megaraid_sas_base.c.
44 2. Update GPL headers.
45 3. Add MSI-X support and 'msix_disable' module parameter.
46 4. Use lowest memory bar (for SR-IOV VF support).
47 5. Add struct megasas_instance_temlate changes, and change all code to use
48 new instance entries:
49
50 irqreturn_t (*service_isr )(int irq, void *devp);
51 void (*tasklet)(unsigned long);
52 u32 (*init_adapter)(struct megasas_instance *);
53 u32 (*build_and_issue_cmd) (struct megasas_instance *,
54 struct scsi_cmnd *);
55 void (*issue_dcmd) (struct megasas_instance *instance,
56 struct megasas_cmd *cmd);
57
58 6. Add code to support MegaRAID 9265/9285 controllers device id (0x5b).
59-------------------------------------------------------------------------------
601 Release Date : Thur. May 03, 2010 09:12:45 PST 2009 -
61 (emaild-id:megaraidlinux@lsi.com)
62 Bo Yang
63
642 Current Version : 00.00.04.31-rc1
653 Older Version : 00.00.04.17.1-rc1
66
671. Add the Online Controller Reset (OCR) to the Driver.
68 OCR is the new feature for megaraid_sas driver which
69 will allow the fw to do the chip reset which will not
70 affact the OS behavious.
71
72 To add the OCR support, driver need to do:
73 a). reset the controller chips -- Xscale and Gen2 which
74 will change the function calls and add the reset function
75 related to this two chips.
76
77 b). during the reset, driver will store the pending cmds
78 which not returned by FW to driver's pending queue. Driver
79 will re-issue those pending cmds again to FW after the OCR
80 finished.
81
82 c). In driver's timeout routine, driver will report to
83 OS as reset. Also driver's queue routine will block the
84 cmds until the OCR finished.
85
86 d). in Driver's ISR routine, if driver get the FW state as
87 state change, FW in Failure status and FW support online controller
88 reset (OCR), driver will start to do the controller reset.
89
90 e). In driver's IOCTL routine, the application cmds will wait for the
91 OCR to finish, then issue the cmds to FW.
92
93 f). Before driver kill adapter, driver will do last chance of
94 OCR to see if driver can bring back the FW.
95
962. Add the support update flag to the driver to tell LSI megaraid_sas
97 application which driver will support the device update. So application
98 will not need to do the device update after application add/del the device
99 from the system.
1003. In driver's timeout routine, driver will do three time reset if fw is in
101 failed state. Driver will kill adapter if can't bring back FW after the
102 this three times reset.
1034. Add the input parameter max_sectors to 1MB support to our GEN2 controller.
104 customer can use the input paramenter max_sectors to add 1MB support to GEN2
105 controller.
106
11 Release Date : Thur. Oct 29, 2009 09:12:45 PST 2009 - 1071 Release Date : Thur. Oct 29, 2009 09:12:45 PST 2009 -
2 (emaild-id:megaraidlinux@lsi.com) 108 (emaild-id:megaraidlinux@lsi.com)
3 Bo Yang 109 Bo Yang
diff --git a/Documentation/scsi/ChangeLog.ncr53c8xx b/Documentation/scsi/ChangeLog.ncr53c8xx
index 8b278c10edfd..9288e3d8974a 100644
--- a/Documentation/scsi/ChangeLog.ncr53c8xx
+++ b/Documentation/scsi/ChangeLog.ncr53c8xx
@@ -200,7 +200,7 @@ Sun Feb 14:00 1999 Gerard Roudier (groudier@club-internet.fr)
200 By default the driver uses both IRQF_SHARED and IRQF_DISABLED. 200 By default the driver uses both IRQF_SHARED and IRQF_DISABLED.
201 Option 'ncr53c8xx=irqm:0x20' may be used when an IRQ is shared by 201 Option 'ncr53c8xx=irqm:0x20' may be used when an IRQ is shared by
202 a 53C8XX adapter and a network board. 202 a 53C8XX adapter and a network board.
203 - Tiny mispelling fixed (ABORT instead of ABRT). Was fortunately 203 - Tiny misspelling fixed (ABORT instead of ABRT). Was fortunately
204 harmless. 204 harmless.
205 - Negotiate SYNC data transfers with CCS devices. 205 - Negotiate SYNC data transfers with CCS devices.
206 206
diff --git a/Documentation/scsi/ChangeLog.sym53c8xx b/Documentation/scsi/ChangeLog.sym53c8xx
index 02ffbc1e8a84..c1933707d0bc 100644
--- a/Documentation/scsi/ChangeLog.sym53c8xx
+++ b/Documentation/scsi/ChangeLog.sym53c8xx
@@ -457,7 +457,7 @@ Fri Jan 1 20:00 1999 Gerard Roudier (groudier@club-internet.fr)
457Sat Dec 19 21:00 1998 Gerard Roudier (groudier@club-internet.fr) 457Sat Dec 19 21:00 1998 Gerard Roudier (groudier@club-internet.fr)
458 * version sym53c8xx-1.0 458 * version sym53c8xx-1.0
459 - Define some new IO registers for the 896 (istat1, mbox0, mbox1) 459 - Define some new IO registers for the 896 (istat1, mbox0, mbox1)
460 - Revamp slighly the Symbios NVRAM lay-out based on the excerpt of 460 - Revamp slightly the Symbios NVRAM lay-out based on the excerpt of
461 the header file I received from Symbios. 461 the header file I received from Symbios.
462 - Check the PCI bus number for the boot order (Using a fast 462 - Check the PCI bus number for the boot order (Using a fast
463 PCI controller behing a PCI-PCI bridge seems sub-optimal). 463 PCI controller behing a PCI-PCI bridge seems sub-optimal).
diff --git a/Documentation/scsi/LICENSE.qla2xxx b/Documentation/scsi/LICENSE.qla2xxx
index 9e15b4f9cd28..19e7cd4bba66 100644
--- a/Documentation/scsi/LICENSE.qla2xxx
+++ b/Documentation/scsi/LICENSE.qla2xxx
@@ -1,11 +1,11 @@
1Copyright (c) 2003-2005 QLogic Corporation 1Copyright (c) 2003-2011 QLogic Corporation
2QLogic Linux Fibre Channel HBA Driver 2QLogic Linux/ESX Fibre Channel HBA Driver
3 3
4This program includes a device driver for Linux 2.6 that may be 4This program includes a device driver for Linux 2.6/ESX that may be
5distributed with QLogic hardware specific firmware binary file. 5distributed with QLogic hardware specific firmware binary file.
6You may modify and redistribute the device driver code under the 6You may modify and redistribute the device driver code under the
7GNU General Public License as published by the Free Software 7GNU General Public License (a copy of which is attached hereto as
8Foundation (version 2 or a later version). 8Exhibit A) published by the Free Software Foundation (version 2).
9 9
10You may redistribute the hardware specific firmware binary file 10You may redistribute the hardware specific firmware binary file
11under the following terms: 11under the following terms:
@@ -43,3 +43,285 @@ OTHERWISE IN ANY INTELLECTUAL PROPERTY RIGHTS (PATENT, COPYRIGHT,
43TRADE SECRET, MASK WORK, OR OTHER PROPRIETARY RIGHT) EMBODIED IN 43TRADE SECRET, MASK WORK, OR OTHER PROPRIETARY RIGHT) EMBODIED IN
44ANY OTHER QLOGIC HARDWARE OR SOFTWARE EITHER SOLELY OR IN 44ANY OTHER QLOGIC HARDWARE OR SOFTWARE EITHER SOLELY OR IN
45COMBINATION WITH THIS PROGRAM. 45COMBINATION WITH THIS PROGRAM.
46
47
48EXHIBIT A
49
50 GNU GENERAL PUBLIC LICENSE
51 Version 2, June 1991
52
53 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
54 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
55 Everyone is permitted to copy and distribute verbatim copies
56 of this license document, but changing it is not allowed.
57
58 Preamble
59
60 The licenses for most software are designed to take away your
61freedom to share and change it. By contrast, the GNU General Public
62License is intended to guarantee your freedom to share and change free
63software--to make sure the software is free for all its users. This
64General Public License applies to most of the Free Software
65Foundation's software and to any other program whose authors commit to
66using it. (Some other Free Software Foundation software is covered by
67the GNU Lesser General Public License instead.) You can apply it to
68your programs, too.
69
70 When we speak of free software, we are referring to freedom, not
71price. Our General Public Licenses are designed to make sure that you
72have the freedom to distribute copies of free software (and charge for
73this service if you wish), that you receive source code or can get it
74if you want it, that you can change the software or use pieces of it
75in new free programs; and that you know you can do these things.
76
77 To protect your rights, we need to make restrictions that forbid
78anyone to deny you these rights or to ask you to surrender the rights.
79These restrictions translate to certain responsibilities for you if you
80distribute copies of the software, or if you modify it.
81
82 For example, if you distribute copies of such a program, whether
83gratis or for a fee, you must give the recipients all the rights that
84you have. You must make sure that they, too, receive or can get the
85source code. And you must show them these terms so they know their
86rights.
87
88 We protect your rights with two steps: (1) copyright the software, and
89(2) offer you this license which gives you legal permission to copy,
90distribute and/or modify the software.
91
92 Also, for each author's protection and ours, we want to make certain
93that everyone understands that there is no warranty for this free
94software. If the software is modified by someone else and passed on, we
95want its recipients to know that what they have is not the original, so
96that any problems introduced by others will not reflect on the original
97authors' reputations.
98
99 Finally, any free program is threatened constantly by software
100patents. We wish to avoid the danger that redistributors of a free
101program will individually obtain patent licenses, in effect making the
102program proprietary. To prevent this, we have made it clear that any
103patent must be licensed for everyone's free use or not licensed at all.
104
105 The precise terms and conditions for copying, distribution and
106modification follow.
107
108 GNU GENERAL PUBLIC LICENSE
109 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
110
111 0. This License applies to any program or other work which contains
112a notice placed by the copyright holder saying it may be distributed
113under the terms of this General Public License. The "Program", below,
114refers to any such program or work, and a "work based on the Program"
115means either the Program or any derivative work under copyright law:
116that is to say, a work containing the Program or a portion of it,
117either verbatim or with modifications and/or translated into another
118language. (Hereinafter, translation is included without limitation in
119the term "modification".) Each licensee is addressed as "you".
120
121Activities other than copying, distribution and modification are not
122covered by this License; they are outside its scope. The act of
123running the Program is not restricted, and the output from the Program
124is covered only if its contents constitute a work based on the
125Program (independent of having been made by running the Program).
126Whether that is true depends on what the Program does.
127
128 1. You may copy and distribute verbatim copies of the Program's
129source code as you receive it, in any medium, provided that you
130conspicuously and appropriately publish on each copy an appropriate
131copyright notice and disclaimer of warranty; keep intact all the
132notices that refer to this License and to the absence of any warranty;
133and give any other recipients of the Program a copy of this License
134along with the Program.
135
136You may charge a fee for the physical act of transferring a copy, and
137you may at your option offer warranty protection in exchange for a fee.
138
139 2. You may modify your copy or copies of the Program or any portion
140of it, thus forming a work based on the Program, and copy and
141distribute such modifications or work under the terms of Section 1
142above, provided that you also meet all of these conditions:
143
144 a) You must cause the modified files to carry prominent notices
145 stating that you changed the files and the date of any change.
146
147 b) You must cause any work that you distribute or publish, that in
148 whole or in part contains or is derived from the Program or any
149 part thereof, to be licensed as a whole at no charge to all third
150 parties under the terms of this License.
151
152 c) If the modified program normally reads commands interactively
153 when run, you must cause it, when started running for such
154 interactive use in the most ordinary way, to print or display an
155 announcement including an appropriate copyright notice and a
156 notice that there is no warranty (or else, saying that you provide
157 a warranty) and that users may redistribute the program under
158 these conditions, and telling the user how to view a copy of this
159 License. (Exception: if the Program itself is interactive but
160 does not normally print such an announcement, your work based on
161 the Program is not required to print an announcement.)
162
163These requirements apply to the modified work as a whole. If
164identifiable sections of that work are not derived from the Program,
165and can be reasonably considered independent and separate works in
166themselves, then this License, and its terms, do not apply to those
167sections when you distribute them as separate works. But when you
168distribute the same sections as part of a whole which is a work based
169on the Program, the distribution of the whole must be on the terms of
170this License, whose permissions for other licensees extend to the
171entire whole, and thus to each and every part regardless of who wrote it.
172
173Thus, it is not the intent of this section to claim rights or contest
174your rights to work written entirely by you; rather, the intent is to
175exercise the right to control the distribution of derivative or
176collective works based on the Program.
177
178In addition, mere aggregation of another work not based on the Program
179with the Program (or with a work based on the Program) on a volume of
180a storage or distribution medium does not bring the other work under
181the scope of this License.
182
183 3. You may copy and distribute the Program (or a work based on it,
184under Section 2) in object code or executable form under the terms of
185Sections 1 and 2 above provided that you also do one of the following:
186
187 a) Accompany it with the complete corresponding machine-readable
188 source code, which must be distributed under the terms of Sections
189 1 and 2 above on a medium customarily used for software interchange; or,
190
191 b) Accompany it with a written offer, valid for at least three
192 years, to give any third party, for a charge no more than your
193 cost of physically performing source distribution, a complete
194 machine-readable copy of the corresponding source code, to be
195 distributed under the terms of Sections 1 and 2 above on a medium
196 customarily used for software interchange; or,
197
198 c) Accompany it with the information you received as to the offer
199 to distribute corresponding source code. (This alternative is
200 allowed only for noncommercial distribution and only if you
201 received the program in object code or executable form with such
202 an offer, in accord with Subsection b above.)
203
204The source code for a work means the preferred form of the work for
205making modifications to it. For an executable work, complete source
206code means all the source code for all modules it contains, plus any
207associated interface definition files, plus the scripts used to
208control compilation and installation of the executable. However, as a
209special exception, the source code distributed need not include
210anything that is normally distributed (in either source or binary
211form) with the major components (compiler, kernel, and so on) of the
212operating system on which the executable runs, unless that component
213itself accompanies the executable.
214
215If distribution of executable or object code is made by offering
216access to copy from a designated place, then offering equivalent
217access to copy the source code from the same place counts as
218distribution of the source code, even though third parties are not
219compelled to copy the source along with the object code.
220
221 4. You may not copy, modify, sublicense, or distribute the Program
222except as expressly provided under this License. Any attempt
223otherwise to copy, modify, sublicense or distribute the Program is
224void, and will automatically terminate your rights under this License.
225However, parties who have received copies, or rights, from you under
226this License will not have their licenses terminated so long as such
227parties remain in full compliance.
228
229 5. You are not required to accept this License, since you have not
230signed it. However, nothing else grants you permission to modify or
231distribute the Program or its derivative works. These actions are
232prohibited by law if you do not accept this License. Therefore, by
233modifying or distributing the Program (or any work based on the
234Program), you indicate your acceptance of this License to do so, and
235all its terms and conditions for copying, distributing or modifying
236the Program or works based on it.
237
238 6. Each time you redistribute the Program (or any work based on the
239Program), the recipient automatically receives a license from the
240original licensor to copy, distribute or modify the Program subject to
241these terms and conditions. You may not impose any further
242restrictions on the recipients' exercise of the rights granted herein.
243You are not responsible for enforcing compliance by third parties to
244this License.
245
246 7. If, as a consequence of a court judgment or allegation of patent
247infringement or for any other reason (not limited to patent issues),
248conditions are imposed on you (whether by court order, agreement or
249otherwise) that contradict the conditions of this License, they do not
250excuse you from the conditions of this License. If you cannot
251distribute so as to satisfy simultaneously your obligations under this
252License and any other pertinent obligations, then as a consequence you
253may not distribute the Program at all. For example, if a patent
254license would not permit royalty-free redistribution of the Program by
255all those who receive copies directly or indirectly through you, then
256the only way you could satisfy both it and this License would be to
257refrain entirely from distribution of the Program.
258
259If any portion of this section is held invalid or unenforceable under
260any particular circumstance, the balance of the section is intended to
261apply and the section as a whole is intended to apply in other
262circumstances.
263
264It is not the purpose of this section to induce you to infringe any
265patents or other property right claims or to contest validity of any
266such claims; this section has the sole purpose of protecting the
267integrity of the free software distribution system, which is
268implemented by public license practices. Many people have made
269generous contributions to the wide range of software distributed
270through that system in reliance on consistent application of that
271system; it is up to the author/donor to decide if he or she is willing
272to distribute software through any other system and a licensee cannot
273impose that choice.
274
275This section is intended to make thoroughly clear what is believed to
276be a consequence of the rest of this License.
277
278 8. If the distribution and/or use of the Program is restricted in
279certain countries either by patents or by copyrighted interfaces, the
280original copyright holder who places the Program under this License
281may add an explicit geographical distribution limitation excluding
282those countries, so that distribution is permitted only in or among
283countries not thus excluded. In such case, this License incorporates
284the limitation as if written in the body of this License.
285
286 9. The Free Software Foundation may publish revised and/or new versions
287of the General Public License from time to time. Such new versions will
288be similar in spirit to the present version, but may differ in detail to
289address new problems or concerns.
290
291Each version is given a distinguishing version number. If the Program
292specifies a version number of this License which applies to it and "any
293later version", you have the option of following the terms and conditions
294either of that version or of any later version published by the Free
295Software Foundation. If the Program does not specify a version number of
296this License, you may choose any version ever published by the Free Software
297Foundation.
298
299 10. If you wish to incorporate parts of the Program into other free
300programs whose distribution conditions are different, write to the author
301to ask for permission. For software which is copyrighted by the Free
302Software Foundation, write to the Free Software Foundation; we sometimes
303make exceptions for this. Our decision will be guided by the two goals
304of preserving the free status of all derivatives of our free software and
305of promoting the sharing and reuse of software generally.
306
307 NO WARRANTY
308
309 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
310FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
311OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
312PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
313OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
314MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
315TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
316PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
317REPAIR OR CORRECTION.
318
319 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
320WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
321REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
322INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
323OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
324TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
325YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
326PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
327POSSIBILITY OF SUCH DAMAGES.
diff --git a/Documentation/scsi/aha152x.txt b/Documentation/scsi/aha152x.txt
index 29ce6d87e451..94848734ac66 100644
--- a/Documentation/scsi/aha152x.txt
+++ b/Documentation/scsi/aha152x.txt
@@ -124,7 +124,7 @@ in the partition table and therefore every operating system has to know
124the right geometry to be able to interpret it. 124the right geometry to be able to interpret it.
125 125
126Moreover there are certain limitations to the C/H/S addressing scheme, 126Moreover there are certain limitations to the C/H/S addressing scheme,
127namely the address space is limited to upto 255 heads, upto 63 sectors 127namely the address space is limited to up to 255 heads, up to 63 sectors
128and a maximum of 1023 cylinders. 128and a maximum of 1023 cylinders.
129 129
130The AHA-1522 BIOS calculates the geometry by fixing the number of heads 130The AHA-1522 BIOS calculates the geometry by fixing the number of heads
diff --git a/Documentation/scsi/aic79xx.txt b/Documentation/scsi/aic79xx.txt
index 16e054c9c70b..64ac7093c872 100644
--- a/Documentation/scsi/aic79xx.txt
+++ b/Documentation/scsi/aic79xx.txt
@@ -267,7 +267,7 @@ The following information is available in this file:
267 Option: tag_info:{{value[,value...]}[,{value[,value...]}...]} 267 Option: tag_info:{{value[,value...]}[,{value[,value...]}...]}
268 Definition: Set the per-target tagged queue depth on a 268 Definition: Set the per-target tagged queue depth on a
269 per controller basis. Both controllers and targets 269 per controller basis. Both controllers and targets
270 may be ommitted indicating that they should retain 270 may be omitted indicating that they should retain
271 the default tag depth. 271 the default tag depth.
272 Examples: tag_info:{{16,32,32,64,8,8,,32,32,32,32,32,32,32,32,32} 272 Examples: tag_info:{{16,32,32,64,8,8,,32,32,32,32,32,32,32,32,32}
273 On Controller 0 273 On Controller 0
@@ -291,7 +291,7 @@ The following information is available in this file:
291 The rd_strm_bitmask is a 16 bit hex value in which 291 The rd_strm_bitmask is a 16 bit hex value in which
292 each bit represents a target. Setting the target's 292 each bit represents a target. Setting the target's
293 bit to '1' enables read streaming for that 293 bit to '1' enables read streaming for that
294 target. Controllers may be ommitted indicating that 294 target. Controllers may be omitted indicating that
295 they should retain the default read streaming setting. 295 they should retain the default read streaming setting.
296 Example: rd_strm:{0x0041} 296 Example: rd_strm:{0x0041}
297 On Controller 0 297 On Controller 0
@@ -313,7 +313,7 @@ The following information is available in this file:
313 ----------------------------------------------------------------- 313 -----------------------------------------------------------------
314 Option: dv: {value[,value...]} 314 Option: dv: {value[,value...]}
315 Definition: Set Domain Validation Policy on a per-controller basis. 315 Definition: Set Domain Validation Policy on a per-controller basis.
316 Controllers may be ommitted indicating that 316 Controllers may be omitted indicating that
317 they should retain the default read streaming setting. 317 they should retain the default read streaming setting.
318 Example: dv:{-1,0,,1,1,0} 318 Example: dv:{-1,0,,1,1,0}
319 On Controller 0 leave DV at its default setting. 319 On Controller 0 leave DV at its default setting.
@@ -340,7 +340,7 @@ The following information is available in this file:
340 Option: precomp: {value[,value...]} 340 Option: precomp: {value[,value...]}
341 Definition: Set IO Cell precompensation value on a per-controller 341 Definition: Set IO Cell precompensation value on a per-controller
342 basis. 342 basis.
343 Controllers may be ommitted indicating that 343 Controllers may be omitted indicating that
344 they should retain the default precompensation setting. 344 they should retain the default precompensation setting.
345 Example: precomp:{0x1} 345 Example: precomp:{0x1}
346 On Controller 0 set precompensation to 1. 346 On Controller 0 set precompensation to 1.
@@ -353,7 +353,7 @@ The following information is available in this file:
353 ----------------------------------------------------------------- 353 -----------------------------------------------------------------
354 Option: slewrate: {value[,value...]} 354 Option: slewrate: {value[,value...]}
355 Definition: Set IO Cell slew rate on a per-controller basis. 355 Definition: Set IO Cell slew rate on a per-controller basis.
356 Controllers may be ommitted indicating that 356 Controllers may be omitted indicating that
357 they should retain the default slew rate setting. 357 they should retain the default slew rate setting.
358 Example: slewrate:{0x1} 358 Example: slewrate:{0x1}
359 On Controller 0 set slew rate to 1. 359 On Controller 0 set slew rate to 1.
@@ -366,7 +366,7 @@ The following information is available in this file:
366 ----------------------------------------------------------------- 366 -----------------------------------------------------------------
367 Option: amplitude: {value[,value...]} 367 Option: amplitude: {value[,value...]}
368 Definition: Set IO Cell signal amplitude on a per-controller basis. 368 Definition: Set IO Cell signal amplitude on a per-controller basis.
369 Controllers may be ommitted indicating that 369 Controllers may be omitted indicating that
370 they should retain the default read streaming setting. 370 they should retain the default read streaming setting.
371 Example: amplitude:{0x1} 371 Example: amplitude:{0x1}
372 On Controller 0 set amplitude to 1. 372 On Controller 0 set amplitude to 1.
diff --git a/Documentation/scsi/hpsa.txt b/Documentation/scsi/hpsa.txt
index dca658362cbf..891435a72fce 100644
--- a/Documentation/scsi/hpsa.txt
+++ b/Documentation/scsi/hpsa.txt
@@ -28,6 +28,12 @@ boot parameter "hpsa_allow_any=1" is specified, however these are not tested
28nor supported by HP with this driver. For older Smart Arrays, the cciss 28nor supported by HP with this driver. For older Smart Arrays, the cciss
29driver should still be used. 29driver should still be used.
30 30
31The "hpsa_simple_mode=1" boot parameter may be used to prevent the driver from
32putting the controller into "performant" mode. The difference is that with simple
33mode, each command completion requires an interrupt, while with "performant mode"
34(the default, and ordinarily better performing) it is possible to have multiple
35command completions indicated by a single interrupt.
36
31HPSA specific entries in /sys 37HPSA specific entries in /sys
32----------------------------- 38-----------------------------
33 39
@@ -39,6 +45,8 @@ HPSA specific entries in /sys
39 45
40 /sys/class/scsi_host/host*/rescan 46 /sys/class/scsi_host/host*/rescan
41 /sys/class/scsi_host/host*/firmware_revision 47 /sys/class/scsi_host/host*/firmware_revision
48 /sys/class/scsi_host/host*/resettable
49 /sys/class/scsi_host/host*/transport_mode
42 50
43 the host "rescan" attribute is a write only attribute. Writing to this 51 the host "rescan" attribute is a write only attribute. Writing to this
44 attribute will cause the driver to scan for new, changed, or removed devices 52 attribute will cause the driver to scan for new, changed, or removed devices
@@ -55,6 +63,21 @@ HPSA specific entries in /sys
55 root@host:/sys/class/scsi_host/host4# cat firmware_revision 63 root@host:/sys/class/scsi_host/host4# cat firmware_revision
56 7.14 64 7.14
57 65
66 The transport_mode indicates whether the controller is in "performant"
67 or "simple" mode. This is controlled by the "hpsa_simple_mode" module
68 parameter.
69
70 The "resettable" read-only attribute indicates whether a particular
71 controller is able to honor the "reset_devices" kernel parameter. If the
72 device is resettable, this file will contain a "1", otherwise, a "0". This
73 parameter is used by kdump, for example, to reset the controller at driver
74 load time to eliminate any outstanding commands on the controller and get the
75 controller into a known state so that the kdump initiated i/o will work right
76 and not be disrupted in any way by stale commands or other stale state
77 remaining on the controller from the previous kernel. This attribute enables
78 kexec tools to warn the user if they attempt to designate a device which is
79 unable to honor the reset_devices kernel parameter as a dump device.
80
58 HPSA specific disk attributes: 81 HPSA specific disk attributes:
59 ------------------------------ 82 ------------------------------
60 83
diff --git a/Documentation/scsi/ibmmca.txt b/Documentation/scsi/ibmmca.txt
index 45d61ad8c6f7..ac41a9fcac77 100644
--- a/Documentation/scsi/ibmmca.txt
+++ b/Documentation/scsi/ibmmca.txt
@@ -303,7 +303,7 @@
303 (scb) and calls a local function issue_cmd(), which writes a scb 303 (scb) and calls a local function issue_cmd(), which writes a scb
304 command into subsystem I/O ports. Once the scb command is carried out, 304 command into subsystem I/O ports. Once the scb command is carried out,
305 the interrupt_handler() is invoked. If a device is determined to be 305 the interrupt_handler() is invoked. If a device is determined to be
306 existant and it has not assigned any ldn, it gets one dynamically. 306 existent and it has not assigned any ldn, it gets one dynamically.
307 For this, the whole stuff is done in ibmmca_queuecommand(). 307 For this, the whole stuff is done in ibmmca_queuecommand().
308 308
309 2.6 Abort & Reset Commands 309 2.6 Abort & Reset Commands
@@ -741,7 +741,7 @@
741 some error appeared, else it is undefined. Now, this is fixed. Before 741 some error appeared, else it is undefined. Now, this is fixed. Before
742 any SCB command gets queued, the tsb.dev_status is set to 0, so the 742 any SCB command gets queued, the tsb.dev_status is set to 0, so the
743 cmd->result won't screw up Linux higher level drivers. 743 cmd->result won't screw up Linux higher level drivers.
744 2) The reset-function has slightly improved. This is still planed for 744 2) The reset-function has slightly improved. This is still planned for
745 abort. During the abort and the reset function, no interrupts are 745 abort. During the abort and the reset function, no interrupts are
746 allowed. This is however quite hard to cope with, so the INT-status 746 allowed. This is however quite hard to cope with, so the INT-status
747 register is read. When the interrupt gets queued, one can find its 747 register is read. When the interrupt gets queued, one can find its
diff --git a/Documentation/scsi/scsi-changer.txt b/Documentation/scsi/scsi-changer.txt
index 032399b16a53..ade046ea7c17 100644
--- a/Documentation/scsi/scsi-changer.txt
+++ b/Documentation/scsi/scsi-changer.txt
@@ -102,7 +102,7 @@ Trouble?
102 102
103If you insmod the driver with "insmod debug=1", it will be verbose and 103If you insmod the driver with "insmod debug=1", it will be verbose and
104prints a lot of stuff to the syslog. Compiling the kernel with 104prints a lot of stuff to the syslog. Compiling the kernel with
105CONFIG_SCSI_CONSTANTS=y improves the quality of the error messages alot 105CONFIG_SCSI_CONSTANTS=y improves the quality of the error messages a lot
106because the kernel will translate the error codes into human-readable 106because the kernel will translate the error codes into human-readable
107strings then. 107strings then.
108 108
diff --git a/Documentation/scsi/scsi_eh.txt b/Documentation/scsi/scsi_eh.txt
index 7acbebb17fa6..6ff16b620d84 100644
--- a/Documentation/scsi/scsi_eh.txt
+++ b/Documentation/scsi/scsi_eh.txt
@@ -290,7 +290,7 @@ scmd->allowed.
290 SCSI transports/LLDDs automatically acquire sense data on 290 SCSI transports/LLDDs automatically acquire sense data on
291 command failures (autosense). Autosense is recommended for 291 command failures (autosense). Autosense is recommended for
292 performance reasons and as sense information could get out of 292 performance reasons and as sense information could get out of
293 sync inbetween occurrence of CHECK CONDITION and this action. 293 sync between occurrence of CHECK CONDITION and this action.
294 294
295 Note that if autosense is not supported, scmd->sense_buffer 295 Note that if autosense is not supported, scmd->sense_buffer
296 contains invalid sense data when error-completing the scmd 296 contains invalid sense data when error-completing the scmd
diff --git a/Documentation/scsi/scsi_fc_transport.txt b/Documentation/scsi/scsi_fc_transport.txt
index e00192de4d1c..f79282fc48d7 100644
--- a/Documentation/scsi/scsi_fc_transport.txt
+++ b/Documentation/scsi/scsi_fc_transport.txt
@@ -291,7 +291,7 @@ Transport <-> LLDD Interfaces :
291Vport support by LLDD: 291Vport support by LLDD:
292 292
293 The LLDD indicates support for vports by supplying a vport_create() 293 The LLDD indicates support for vports by supplying a vport_create()
294 function in the transport template. The presense of this function will 294 function in the transport template. The presence of this function will
295 cause the creation of the new attributes on the fc_host. As part of 295 cause the creation of the new attributes on the fc_host. As part of
296 the physical port completing its initialization relative to the 296 the physical port completing its initialization relative to the
297 transport, it should set the max_npiv_vports attribute to indicate the 297 transport, it should set the max_npiv_vports attribute to indicate the
diff --git a/Documentation/scsi/scsi_mid_low_api.txt b/Documentation/scsi/scsi_mid_low_api.txt
index 570ef2b3d79b..5f17d29c59b5 100644
--- a/Documentation/scsi/scsi_mid_low_api.txt
+++ b/Documentation/scsi/scsi_mid_low_api.txt
@@ -1044,9 +1044,9 @@ Details:
1044 1044
1045 1045
1046/** 1046/**
1047 * queuecommand - queue scsi command, invoke 'done' on completion 1047 * queuecommand - queue scsi command, invoke scp->scsi_done on completion
1048 * @shost: pointer to the scsi host object
1048 * @scp: pointer to scsi command object 1049 * @scp: pointer to scsi command object
1049 * @done: function pointer to be invoked on completion
1050 * 1050 *
1051 * Returns 0 on success. 1051 * Returns 0 on success.
1052 * 1052 *
@@ -1074,42 +1074,45 @@ Details:
1074 * 1074 *
1075 * Other types of errors that are detected immediately may be 1075 * Other types of errors that are detected immediately may be
1076 * flagged by setting scp->result to an appropriate value, 1076 * flagged by setting scp->result to an appropriate value,
1077 * invoking the 'done' callback, and then returning 0 from this 1077 * invoking the scp->scsi_done callback, and then returning 0
1078 * function. If the command is not performed immediately (and the 1078 * from this function. If the command is not performed
1079 * LLD is starting (or will start) the given command) then this 1079 * immediately (and the LLD is starting (or will start) the given
1080 * function should place 0 in scp->result and return 0. 1080 * command) then this function should place 0 in scp->result and
1081 * return 0.
1081 * 1082 *
1082 * Command ownership. If the driver returns zero, it owns the 1083 * Command ownership. If the driver returns zero, it owns the
1083 * command and must take responsibility for ensuring the 'done' 1084 * command and must take responsibility for ensuring the
1084 * callback is executed. Note: the driver may call done before 1085 * scp->scsi_done callback is executed. Note: the driver may
1085 * returning zero, but after it has called done, it may not 1086 * call scp->scsi_done before returning zero, but after it has
1086 * return any value other than zero. If the driver makes a 1087 * called scp->scsi_done, it may not return any value other than
1087 * non-zero return, it must not execute the command's done 1088 * zero. If the driver makes a non-zero return, it must not
1088 * callback at any time. 1089 * execute the command's scsi_done callback at any time.
1089 * 1090 *
1090 * Locks: struct Scsi_Host::host_lock held on entry (with "irqsave") 1091 * Locks: up to and including 2.6.36, struct Scsi_Host::host_lock
1091 * and is expected to be held on return. 1092 * held on entry (with "irqsave") and is expected to be
1093 * held on return. From 2.6.37 onwards, queuecommand is
1094 * called without any locks held.
1092 * 1095 *
1093 * Calling context: in interrupt (soft irq) or process context 1096 * Calling context: in interrupt (soft irq) or process context
1094 * 1097 *
1095 * Notes: This function should be relatively fast. Normally it will 1098 * Notes: This function should be relatively fast. Normally it
1096 * not wait for IO to complete. Hence the 'done' callback is invoked 1099 * will not wait for IO to complete. Hence the scp->scsi_done
1097 * (often directly from an interrupt service routine) some time after 1100 * callback is invoked (often directly from an interrupt service
1098 * this function has returned. In some cases (e.g. pseudo adapter 1101 * routine) some time after this function has returned. In some
1099 * drivers that manufacture the response to a SCSI INQUIRY) 1102 * cases (e.g. pseudo adapter drivers that manufacture the
1100 * the 'done' callback may be invoked before this function returns. 1103 * response to a SCSI INQUIRY) the scp->scsi_done callback may be
1101 * If the 'done' callback is not invoked within a certain period 1104 * invoked before this function returns. If the scp->scsi_done
1102 * the SCSI mid level will commence error processing. 1105 * callback is not invoked within a certain period the SCSI mid
1103 * If a status of CHECK CONDITION is placed in "result" when the 1106 * level will commence error processing. If a status of CHECK
1104 * 'done' callback is invoked, then the LLD driver should 1107 * CONDITION is placed in "result" when the scp->scsi_done
1105 * perform autosense and fill in the struct scsi_cmnd::sense_buffer 1108 * callback is invoked, then the LLD driver should perform
1109 * autosense and fill in the struct scsi_cmnd::sense_buffer
1106 * array. The scsi_cmnd::sense_buffer array is zeroed prior to 1110 * array. The scsi_cmnd::sense_buffer array is zeroed prior to
1107 * the mid level queuing a command to an LLD. 1111 * the mid level queuing a command to an LLD.
1108 * 1112 *
1109 * Defined in: LLD 1113 * Defined in: LLD
1110 **/ 1114 **/
1111 int queuecommand(struct scsi_cmnd * scp, 1115 int queuecommand(struct Scsi_Host *shost, struct scsi_cmnd * scp)
1112 void (*done)(struct scsi_cmnd *))
1113 1116
1114 1117
1115/** 1118/**
@@ -1340,7 +1343,7 @@ Members of interest:
1340 underruns (overruns should be rare). If possible an LLD 1343 underruns (overruns should be rare). If possible an LLD
1341 should set 'resid' prior to invoking 'done'. The most 1344 should set 'resid' prior to invoking 'done'. The most
1342 interesting case is data transfers from a SCSI target 1345 interesting case is data transfers from a SCSI target
1343 device device (i.e. READs) that underrun. 1346 device (e.g. READs) that underrun.
1344 underflow - LLD should place (DID_ERROR << 16) in 'result' if 1347 underflow - LLD should place (DID_ERROR << 16) in 'result' if
1345 actual number of bytes transferred is less than this 1348 actual number of bytes transferred is less than this
1346 figure. Not many LLDs implement this check and some that 1349 figure. Not many LLDs implement this check and some that
@@ -1348,6 +1351,18 @@ Members of interest:
1348 report a DID_ERROR. Better for an LLD to implement 1351 report a DID_ERROR. Better for an LLD to implement
1349 'resid'. 1352 'resid'.
1350 1353
1354It is recommended that a LLD set 'resid' on data transfers from a SCSI
1355target device (e.g. READs). It is especially important that 'resid' is set
1356when such data transfers have sense keys of MEDIUM ERROR and HARDWARE ERROR
1357(and possibly RECOVERED ERROR). In these cases if a LLD is in doubt how much
1358data has been received then the safest approach is to indicate no bytes have
1359been received. For example: to indicate that no valid data has been received
1360a LLD might use these helpers:
1361 scsi_set_resid(SCpnt, scsi_bufflen(SCpnt));
1362where 'SCpnt' is a pointer to a scsi_cmnd object. To indicate only three 512
1363bytes blocks has been received 'resid' could be set like this:
1364 scsi_set_resid(SCpnt, scsi_bufflen(SCpnt) - (3 * 512));
1365
1351The scsi_cmnd structure is defined in include/scsi/scsi_cmnd.h 1366The scsi_cmnd structure is defined in include/scsi/scsi_cmnd.h
1352 1367
1353 1368
diff --git a/Documentation/scsi/st.txt b/Documentation/scsi/st.txt
index 40752602c050..691ca292c24d 100644
--- a/Documentation/scsi/st.txt
+++ b/Documentation/scsi/st.txt
@@ -2,7 +2,7 @@ This file contains brief information about the SCSI tape driver.
2The driver is currently maintained by Kai Mäkisara (email 2The driver is currently maintained by Kai Mäkisara (email
3Kai.Makisara@kolumbus.fi) 3Kai.Makisara@kolumbus.fi)
4 4
5Last modified: Sun Feb 24 21:59:07 2008 by kai.makisara 5Last modified: Sun Aug 29 18:25:47 2010 by kai.makisara
6 6
7 7
8BASICS 8BASICS
@@ -85,6 +85,17 @@ writing and the last operation has been a write. Two filemarks can be
85optionally written. In both cases end of data is signified by 85optionally written. In both cases end of data is signified by
86returning zero bytes for two consecutive reads. 86returning zero bytes for two consecutive reads.
87 87
88Writing filemarks without the immediate bit set in the SCSI command block acts
89as a synchronization point, i.e., all remaining data form the drive buffers is
90written to tape before the command returns. This makes sure that write errors
91are caught at that point, but this takes time. In some applications, several
92consecutive files must be written fast. The MTWEOFI operation can be used to
93write the filemarks without flushing the drive buffer. Writing filemark at
94close() is always flushing the drive buffers. However, if the previous
95operation is MTWEOFI, close() does not write a filemark. This can be used if
96the program wants to close/open the tape device between files and wants to
97skip waiting.
98
88If rewind, offline, bsf, or seek is done and previous tape operation was 99If rewind, offline, bsf, or seek is done and previous tape operation was
89write, a filemark is written before moving tape. 100write, a filemark is written before moving tape.
90 101
@@ -301,6 +312,8 @@ MTBSR Space backward over count records.
301MTFSS Space forward over count setmarks. 312MTFSS Space forward over count setmarks.
302MTBSS Space backward over count setmarks. 313MTBSS Space backward over count setmarks.
303MTWEOF Write count filemarks. 314MTWEOF Write count filemarks.
315MTWEOFI Write count filemarks with immediate bit set (i.e., does not
316 wait until data is on tape)
304MTWSM Write count setmarks. 317MTWSM Write count setmarks.
305MTREW Rewind tape. 318MTREW Rewind tape.
306MTOFFL Set device off line (often rewind plus eject). 319MTOFFL Set device off line (often rewind plus eject).
diff --git a/Documentation/scsi/sym53c8xx_2.txt b/Documentation/scsi/sym53c8xx_2.txt
index 6f63b7989679..6af8f7a7770f 100644
--- a/Documentation/scsi/sym53c8xx_2.txt
+++ b/Documentation/scsi/sym53c8xx_2.txt
@@ -285,7 +285,7 @@ from the driver.
285 285
2867. Profiling information 2867. Profiling information
287 287
288This driver does not provide profiling informations as did its predecessors. 288This driver does not provide profiling information as did its predecessors.
289This feature was not this useful and added complexity to the code. 289This feature was not this useful and added complexity to the code.
290As the driver code got more complex, I have decided to remove everything 290As the driver code got more complex, I have decided to remove everything
291that didn't seem actually useful. 291that didn't seem actually useful.
diff --git a/Documentation/security/00-INDEX b/Documentation/security/00-INDEX
new file mode 100644
index 000000000000..19bc49439cac
--- /dev/null
+++ b/Documentation/security/00-INDEX
@@ -0,0 +1,18 @@
100-INDEX
2 - this file.
3SELinux.txt
4 - how to get started with the SELinux security enhancement.
5Smack.txt
6 - documentation on the Smack Linux Security Module.
7apparmor.txt
8 - documentation on the AppArmor security extension.
9credentials.txt
10 - documentation about credentials in Linux.
11keys-request-key.txt
12 - description of the kernel key request service.
13keys-trusted-encrypted.txt
14 - info on the Trusted and Encrypted keys in the kernel key ring service.
15keys.txt
16 - description of the kernel key retention service.
17tomoyo.txt
18 - documentation on the TOMOYO Linux Security Module.
diff --git a/Documentation/SELinux.txt b/Documentation/security/SELinux.txt
index 07eae00f3314..07eae00f3314 100644
--- a/Documentation/SELinux.txt
+++ b/Documentation/security/SELinux.txt
diff --git a/Documentation/Smack.txt b/Documentation/security/Smack.txt
index e9dab41c0fe0..e9dab41c0fe0 100644
--- a/Documentation/Smack.txt
+++ b/Documentation/security/Smack.txt
diff --git a/Documentation/apparmor.txt b/Documentation/security/apparmor.txt
index 93c1fd7d0635..93c1fd7d0635 100644
--- a/Documentation/apparmor.txt
+++ b/Documentation/security/apparmor.txt
diff --git a/Documentation/credentials.txt b/Documentation/security/credentials.txt
index 995baf379c07..fc0366cbd7ce 100644
--- a/Documentation/credentials.txt
+++ b/Documentation/security/credentials.txt
@@ -216,7 +216,7 @@ The Linux kernel supports the following types of credentials:
216 When a process accesses a key, if not already present, it will normally be 216 When a process accesses a key, if not already present, it will normally be
217 cached on one of these keyrings for future accesses to find. 217 cached on one of these keyrings for future accesses to find.
218 218
219 For more information on using keys, see Documentation/keys.txt. 219 For more information on using keys, see Documentation/security/keys.txt.
220 220
221 (5) LSM 221 (5) LSM
222 222
diff --git a/Documentation/keys-request-key.txt b/Documentation/security/keys-request-key.txt
index 09b55e461740..51987bfecfed 100644
--- a/Documentation/keys-request-key.txt
+++ b/Documentation/security/keys-request-key.txt
@@ -3,8 +3,8 @@
3 =================== 3 ===================
4 4
5The key request service is part of the key retention service (refer to 5The key request service is part of the key retention service (refer to
6Documentation/keys.txt). This document explains more fully how the requesting 6Documentation/security/keys.txt). This document explains more fully how
7algorithm works. 7the requesting algorithm works.
8 8
9The process starts by either the kernel requesting a service by calling 9The process starts by either the kernel requesting a service by calling
10request_key*(): 10request_key*():
@@ -127,14 +127,15 @@ This is because process A's keyrings can't simply be attached to
127of them, and (b) it requires the same UID/GID/Groups all the way through. 127of them, and (b) it requires the same UID/GID/Groups all the way through.
128 128
129 129
130====================== 130====================================
131NEGATIVE INSTANTIATION 131NEGATIVE INSTANTIATION AND REJECTION
132====================== 132====================================
133 133
134Rather than instantiating a key, it is possible for the possessor of an 134Rather than instantiating a key, it is possible for the possessor of an
135authorisation key to negatively instantiate a key that's under construction. 135authorisation key to negatively instantiate a key that's under construction.
136This is a short duration placeholder that causes any attempt at re-requesting 136This is a short duration placeholder that causes any attempt at re-requesting
137the key whilst it exists to fail with error ENOKEY. 137the key whilst it exists to fail with error ENOKEY if negated or the specified
138error if rejected.
138 139
139This is provided to prevent excessive repeated spawning of /sbin/request-key 140This is provided to prevent excessive repeated spawning of /sbin/request-key
140processes for a key that will never be obtainable. 141processes for a key that will never be obtainable.
diff --git a/Documentation/security/keys-trusted-encrypted.txt b/Documentation/security/keys-trusted-encrypted.txt
new file mode 100644
index 000000000000..8fb79bc1ac4b
--- /dev/null
+++ b/Documentation/security/keys-trusted-encrypted.txt
@@ -0,0 +1,145 @@
1 Trusted and Encrypted Keys
2
3Trusted and Encrypted Keys are two new key types added to the existing kernel
4key ring service. Both of these new types are variable length symmetic keys,
5and in both cases all keys are created in the kernel, and user space sees,
6stores, and loads only encrypted blobs. Trusted Keys require the availability
7of a Trusted Platform Module (TPM) chip for greater security, while Encrypted
8Keys can be used on any system. All user level blobs, are displayed and loaded
9in hex ascii for convenience, and are integrity verified.
10
11Trusted Keys use a TPM both to generate and to seal the keys. Keys are sealed
12under a 2048 bit RSA key in the TPM, and optionally sealed to specified PCR
13(integrity measurement) values, and only unsealed by the TPM, if PCRs and blob
14integrity verifications match. A loaded Trusted Key can be updated with new
15(future) PCR values, so keys are easily migrated to new pcr values, such as
16when the kernel and initramfs are updated. The same key can have many saved
17blobs under different PCR values, so multiple boots are easily supported.
18
19By default, trusted keys are sealed under the SRK, which has the default
20authorization value (20 zeros). This can be set at takeownership time with the
21trouser's utility: "tpm_takeownership -u -z".
22
23Usage:
24 keyctl add trusted name "new keylen [options]" ring
25 keyctl add trusted name "load hex_blob [pcrlock=pcrnum]" ring
26 keyctl update key "update [options]"
27 keyctl print keyid
28
29 options:
30 keyhandle= ascii hex value of sealing key default 0x40000000 (SRK)
31 keyauth= ascii hex auth for sealing key default 0x00...i
32 (40 ascii zeros)
33 blobauth= ascii hex auth for sealed data default 0x00...
34 (40 ascii zeros)
35 blobauth= ascii hex auth for sealed data default 0x00...
36 (40 ascii zeros)
37 pcrinfo= ascii hex of PCR_INFO or PCR_INFO_LONG (no default)
38 pcrlock= pcr number to be extended to "lock" blob
39 migratable= 0|1 indicating permission to reseal to new PCR values,
40 default 1 (resealing allowed)
41
42"keyctl print" returns an ascii hex copy of the sealed key, which is in standard
43TPM_STORED_DATA format. The key length for new keys are always in bytes.
44Trusted Keys can be 32 - 128 bytes (256 - 1024 bits), the upper limit is to fit
45within the 2048 bit SRK (RSA) keylength, with all necessary structure/padding.
46
47Encrypted keys do not depend on a TPM, and are faster, as they use AES for
48encryption/decryption. New keys are created from kernel generated random
49numbers, and are encrypted/decrypted using a specified 'master' key. The
50'master' key can either be a trusted-key or user-key type. The main
51disadvantage of encrypted keys is that if they are not rooted in a trusted key,
52they are only as secure as the user key encrypting them. The master user key
53should therefore be loaded in as secure a way as possible, preferably early in
54boot.
55
56Usage:
57 keyctl add encrypted name "new key-type:master-key-name keylen" ring
58 keyctl add encrypted name "load hex_blob" ring
59 keyctl update keyid "update key-type:master-key-name"
60
61where 'key-type' is either 'trusted' or 'user'.
62
63Examples of trusted and encrypted key usage:
64
65Create and save a trusted key named "kmk" of length 32 bytes:
66
67 $ keyctl add trusted kmk "new 32" @u
68 440502848
69
70 $ keyctl show
71 Session Keyring
72 -3 --alswrv 500 500 keyring: _ses
73 97833714 --alswrv 500 -1 \_ keyring: _uid.500
74 440502848 --alswrv 500 500 \_ trusted: kmk
75
76 $ keyctl print 440502848
77 0101000000000000000001005d01b7e3f4a6be5709930f3b70a743cbb42e0cc95e18e915
78 3f60da455bbf1144ad12e4f92b452f966929f6105fd29ca28e4d4d5a031d068478bacb0b
79 27351119f822911b0a11ba3d3498ba6a32e50dac7f32894dd890eb9ad578e4e292c83722
80 a52e56a097e6a68b3f56f7a52ece0cdccba1eb62cad7d817f6dc58898b3ac15f36026fec
81 d568bd4a706cb60bb37be6d8f1240661199d640b66fb0fe3b079f97f450b9ef9c22c6d5d
82 dd379f0facd1cd020281dfa3c70ba21a3fa6fc2471dc6d13ecf8298b946f65345faa5ef0
83 f1f8fff03ad0acb083725535636addb08d73dedb9832da198081e5deae84bfaf0409c22b
84 e4a8aea2b607ec96931e6f4d4fe563ba
85
86 $ keyctl pipe 440502848 > kmk.blob
87
88Load a trusted key from the saved blob:
89
90 $ keyctl add trusted kmk "load `cat kmk.blob`" @u
91 268728824
92
93 $ keyctl print 268728824
94 0101000000000000000001005d01b7e3f4a6be5709930f3b70a743cbb42e0cc95e18e915
95 3f60da455bbf1144ad12e4f92b452f966929f6105fd29ca28e4d4d5a031d068478bacb0b
96 27351119f822911b0a11ba3d3498ba6a32e50dac7f32894dd890eb9ad578e4e292c83722
97 a52e56a097e6a68b3f56f7a52ece0cdccba1eb62cad7d817f6dc58898b3ac15f36026fec
98 d568bd4a706cb60bb37be6d8f1240661199d640b66fb0fe3b079f97f450b9ef9c22c6d5d
99 dd379f0facd1cd020281dfa3c70ba21a3fa6fc2471dc6d13ecf8298b946f65345faa5ef0
100 f1f8fff03ad0acb083725535636addb08d73dedb9832da198081e5deae84bfaf0409c22b
101 e4a8aea2b607ec96931e6f4d4fe563ba
102
103Reseal a trusted key under new pcr values:
104
105 $ keyctl update 268728824 "update pcrinfo=`cat pcr.blob`"
106 $ keyctl print 268728824
107 010100000000002c0002800093c35a09b70fff26e7a98ae786c641e678ec6ffb6b46d805
108 77c8a6377aed9d3219c6dfec4b23ffe3000001005d37d472ac8a44023fbb3d18583a4f73
109 d3a076c0858f6f1dcaa39ea0f119911ff03f5406df4f7f27f41da8d7194f45c9f4e00f2e
110 df449f266253aa3f52e55c53de147773e00f0f9aca86c64d94c95382265968c354c5eab4
111 9638c5ae99c89de1e0997242edfb0b501744e11ff9762dfd951cffd93227cc513384e7e6
112 e782c29435c7ec2edafaa2f4c1fe6e7a781b59549ff5296371b42133777dcc5b8b971610
113 94bc67ede19e43ddb9dc2baacad374a36feaf0314d700af0a65c164b7082401740e489c9
114 7ef6a24defe4846104209bf0c3eced7fa1a672ed5b125fc9d8cd88b476a658a4434644ef
115 df8ae9a178e9f83ba9f08d10fa47e4226b98b0702f06b3b8
116
117Create and save an encrypted key "evm" using the above trusted key "kmk":
118
119 $ keyctl add encrypted evm "new trusted:kmk 32" @u
120 159771175
121
122 $ keyctl print 159771175
123 trusted:kmk 32 2375725ad57798846a9bbd240de8906f006e66c03af53b1b382dbbc55
124 be2a44616e4959430436dc4f2a7a9659aa60bb4652aeb2120f149ed197c564e024717c64
125 5972dcb82ab2dde83376d82b2e3c09ffc
126
127 $ keyctl pipe 159771175 > evm.blob
128
129Load an encrypted key "evm" from saved blob:
130
131 $ keyctl add encrypted evm "load `cat evm.blob`" @u
132 831684262
133
134 $ keyctl print 831684262
135 trusted:kmk 32 2375725ad57798846a9bbd240de8906f006e66c03af53b1b382dbbc55
136 be2a44616e4959430436dc4f2a7a9659aa60bb4652aeb2120f149ed197c564e024717c64
137 5972dcb82ab2dde83376d82b2e3c09ffc
138
139
140The initial consumer of trusted keys is EVM, which at boot time needs a high
141quality symmetric key for HMAC protection of file metadata. The use of a
142trusted key provides strong guarantees that the EVM key has not been
143compromised by a user level problem, and when sealed to specific boot PCR
144values, protects against boot and offline attacks. Other uses for trusted and
145encrypted keys, such as for disk and file encryption are anticipated.
diff --git a/Documentation/keys.txt b/Documentation/security/keys.txt
index e4dbbdb1bd96..4d75931d2d79 100644
--- a/Documentation/keys.txt
+++ b/Documentation/security/keys.txt
@@ -434,7 +434,7 @@ The main syscalls are:
434 /sbin/request-key will be invoked in an attempt to obtain a key. The 434 /sbin/request-key will be invoked in an attempt to obtain a key. The
435 callout_info string will be passed as an argument to the program. 435 callout_info string will be passed as an argument to the program.
436 436
437 See also Documentation/keys-request-key.txt. 437 See also Documentation/security/keys-request-key.txt.
438 438
439 439
440The keyctl syscall functions are: 440The keyctl syscall functions are:
@@ -637,6 +637,9 @@ The keyctl syscall functions are:
637 long keyctl(KEYCTL_INSTANTIATE, key_serial_t key, 637 long keyctl(KEYCTL_INSTANTIATE, key_serial_t key,
638 const void *payload, size_t plen, 638 const void *payload, size_t plen,
639 key_serial_t keyring); 639 key_serial_t keyring);
640 long keyctl(KEYCTL_INSTANTIATE_IOV, key_serial_t key,
641 const struct iovec *payload_iov, unsigned ioc,
642 key_serial_t keyring);
640 643
641 If the kernel calls back to userspace to complete the instantiation of a 644 If the kernel calls back to userspace to complete the instantiation of a
642 key, userspace should use this call to supply data for the key before the 645 key, userspace should use this call to supply data for the key before the
@@ -652,11 +655,16 @@ The keyctl syscall functions are:
652 655
653 The payload and plen arguments describe the payload data as for add_key(). 656 The payload and plen arguments describe the payload data as for add_key().
654 657
658 The payload_iov and ioc arguments describe the payload data in an iovec
659 array instead of a single buffer.
660
655 661
656 (*) Negatively instantiate a partially constructed key. 662 (*) Negatively instantiate a partially constructed key.
657 663
658 long keyctl(KEYCTL_NEGATE, key_serial_t key, 664 long keyctl(KEYCTL_NEGATE, key_serial_t key,
659 unsigned timeout, key_serial_t keyring); 665 unsigned timeout, key_serial_t keyring);
666 long keyctl(KEYCTL_REJECT, key_serial_t key,
667 unsigned timeout, unsigned error, key_serial_t keyring);
660 668
661 If the kernel calls back to userspace to complete the instantiation of a 669 If the kernel calls back to userspace to complete the instantiation of a
662 key, userspace should use this call mark the key as negative before the 670 key, userspace should use this call mark the key as negative before the
@@ -669,6 +677,10 @@ The keyctl syscall functions are:
669 that keyring, however all the constraints applying in KEYCTL_LINK apply in 677 that keyring, however all the constraints applying in KEYCTL_LINK apply in
670 this case too. 678 this case too.
671 679
680 If the key is rejected, future searches for it will return the specified
681 error code until the rejected key expires. Negating the key is the same
682 as rejecting the key with ENOKEY as the error code.
683
672 684
673 (*) Set the default request-key destination keyring. 685 (*) Set the default request-key destination keyring.
674 686
@@ -852,7 +864,7 @@ payload contents" for more information.
852 If successful, the key will have been attached to the default keyring for 864 If successful, the key will have been attached to the default keyring for
853 implicitly obtained request-key keys, as set by KEYCTL_SET_REQKEY_KEYRING. 865 implicitly obtained request-key keys, as set by KEYCTL_SET_REQKEY_KEYRING.
854 866
855 See also Documentation/keys-request-key.txt. 867 See also Documentation/security/keys-request-key.txt.
856 868
857 869
858(*) To search for a key, passing auxiliary data to the upcaller, call: 870(*) To search for a key, passing auxiliary data to the upcaller, call:
@@ -1062,6 +1074,13 @@ The structure has a number of fields, some of which are mandatory:
1062 viable. 1074 viable.
1063 1075
1064 1076
1077 (*) int (*vet_description)(const char *description);
1078
1079 This optional method is called to vet a key description. If the key type
1080 doesn't approve of the key description, it may return an error, otherwise
1081 it should return 0.
1082
1083
1065 (*) int (*instantiate)(struct key *key, const void *data, size_t datalen); 1084 (*) int (*instantiate)(struct key *key, const void *data, size_t datalen);
1066 1085
1067 This method is called to attach a payload to a key during construction. 1086 This method is called to attach a payload to a key during construction.
@@ -1231,10 +1250,11 @@ hand the request off to (perhaps a path held in placed in another key by, for
1231example, the KDE desktop manager). 1250example, the KDE desktop manager).
1232 1251
1233The program (or whatever it calls) should finish construction of the key by 1252The program (or whatever it calls) should finish construction of the key by
1234calling KEYCTL_INSTANTIATE, which also permits it to cache the key in one of 1253calling KEYCTL_INSTANTIATE or KEYCTL_INSTANTIATE_IOV, which also permits it to
1235the keyrings (probably the session ring) before returning. Alternatively, the 1254cache the key in one of the keyrings (probably the session ring) before
1236key can be marked as negative with KEYCTL_NEGATE; this also permits the key to 1255returning. Alternatively, the key can be marked as negative with KEYCTL_NEGATE
1237be cached in one of the keyrings. 1256or KEYCTL_REJECT; this also permits the key to be cached in one of the
1257keyrings.
1238 1258
1239If it returns with the key remaining in the unconstructed state, the key will 1259If it returns with the key remaining in the unconstructed state, the key will
1240be marked as being negative, it will be added to the session keyring, and an 1260be marked as being negative, it will be added to the session keyring, and an
diff --git a/Documentation/tomoyo.txt b/Documentation/security/tomoyo.txt
index 200a2d37cbc8..200a2d37cbc8 100644
--- a/Documentation/tomoyo.txt
+++ b/Documentation/security/tomoyo.txt
diff --git a/Documentation/serial/00-INDEX b/Documentation/serial/00-INDEX
index 07dcdb0d2a36..e09468ad3cb1 100644
--- a/Documentation/serial/00-INDEX
+++ b/Documentation/serial/00-INDEX
@@ -14,6 +14,8 @@ riscom8.txt
14 - notes on using the RISCom/8 multi-port serial driver. 14 - notes on using the RISCom/8 multi-port serial driver.
15rocket.txt 15rocket.txt
16 - info on the Comtrol RocketPort multiport serial driver. 16 - info on the Comtrol RocketPort multiport serial driver.
17serial-rs485.txt
18 - info about RS485 structures and support in the kernel.
17specialix.txt 19specialix.txt
18 - info on hardware/driver for specialix IO8+ multiport serial card. 20 - info on hardware/driver for specialix IO8+ multiport serial card.
19stallion.txt 21stallion.txt
diff --git a/Documentation/serial/moxa-smartio b/Documentation/serial/moxa-smartio
index d10443918684..5d2a33be0bd8 100644
--- a/Documentation/serial/moxa-smartio
+++ b/Documentation/serial/moxa-smartio
@@ -473,7 +473,7 @@ Content
473 spd_normal Use 38.4kb when the application requests 38.4kb. 473 spd_normal Use 38.4kb when the application requests 38.4kb.
474 spd_cust Use the custom divisor to set the speed when the 474 spd_cust Use the custom divisor to set the speed when the
475 application requests 38.4kb. 475 application requests 38.4kb.
476 divisor This option set the custom divison. 476 divisor This option set the custom division.
477 baud_base This option set the base baud rate. 477 baud_base This option set the base baud rate.
478 478
479----------------------------------------------------------------------------- 479-----------------------------------------------------------------------------
diff --git a/Documentation/serial/n_gsm.txt b/Documentation/serial/n_gsm.txt
new file mode 100644
index 000000000000..a5d91126a8f7
--- /dev/null
+++ b/Documentation/serial/n_gsm.txt
@@ -0,0 +1,89 @@
1n_gsm.c GSM 0710 tty multiplexor HOWTO
2===================================================
3
4This line discipline implements the GSM 07.10 multiplexing protocol
5detailed in the following 3GPP document :
6http://www.3gpp.org/ftp/Specs/archive/07_series/07.10/0710-720.zip
7
8This document give some hints on how to use this driver with GPRS and 3G
9modems connected to a physical serial port.
10
11How to use it
12-------------
131- initialize the modem in 0710 mux mode (usually AT+CMUX= command) through
14its serial port. Depending on the modem used, you can pass more or less
15parameters to this command,
162- switch the serial line to using the n_gsm line discipline by using
17TIOCSETD ioctl,
183- configure the mux using GSMIOC_GETCONF / GSMIOC_SETCONF ioctl,
19
20Major parts of the initialization program :
21(a good starting point is util-linux-ng/sys-utils/ldattach.c)
22#include <linux/gsmmux.h>
23#define N_GSM0710 21 /* GSM 0710 Mux */
24#define DEFAULT_SPEED B115200
25#define SERIAL_PORT /dev/ttyS0
26
27 int ldisc = N_GSM0710;
28 struct gsm_config c;
29 struct termios configuration;
30
31 /* open the serial port connected to the modem */
32 fd = open(SERIAL_PORT, O_RDWR | O_NOCTTY | O_NDELAY);
33
34 /* configure the serial port : speed, flow control ... */
35
36 /* send the AT commands to switch the modem to CMUX mode
37 and check that it's successful (should return OK) */
38 write(fd, "AT+CMUX=0\r", 10);
39
40 /* experience showed that some modems need some time before
41 being able to answer to the first MUX packet so a delay
42 may be needed here in some case */
43 sleep(3);
44
45 /* use n_gsm line discipline */
46 ioctl(fd, TIOCSETD, &ldisc);
47
48 /* get n_gsm configuration */
49 ioctl(fd, GSMIOC_GETCONF, &c);
50 /* we are initiator and need encoding 0 (basic) */
51 c.initiator = 1;
52 c.encapsulation = 0;
53 /* our modem defaults to a maximum size of 127 bytes */
54 c.mru = 127;
55 c.mtu = 127;
56 /* set the new configuration */
57 ioctl(fd, GSMIOC_SETCONF, &c);
58
59 /* and wait for ever to keep the line discipline enabled */
60 daemon(0,0);
61 pause();
62
634- create the devices corresponding to the "virtual" serial ports (take care,
64each modem has its configuration and some DLC have dedicated functions,
65for example GPS), starting with minor 1 (DLC0 is reserved for the management
66of the mux)
67
68MAJOR=`cat /proc/devices |grep gsmtty | awk '{print $1}`
69for i in `seq 1 4`; do
70 mknod /dev/ttygsm$i c $MAJOR $i
71done
72
735- use these devices as plain serial ports.
74for example, it's possible :
75- and to use gnokii to send / receive SMS on ttygsm1
76- to use ppp to establish a datalink on ttygsm2
77
786- first close all virtual ports before closing the physical port.
79
80Additional Documentation
81------------------------
82More practical details on the protocol and how it's supported by industrial
83modems can be found in the following documents :
84http://www.telit.com/module/infopool/download.php?id=616
85http://www.u-blox.com/images/downloads/Product_Docs/LEON-G100-G200-MuxImplementation_ApplicationNote_%28GSM%20G1-CS-10002%29.pdf
86http://www.sierrawireless.com/Support/Downloads/AirPrime/WMP_Series/~/media/Support_Downloads/AirPrime/Application_notes/CMUX_Feature_Application_Note-Rev004.ashx
87http://wm.sim.com/sim/News/photo/2010721161442.pdf
88
8911-03-08 - Eric Bénard - <eric@eukrea.com>
diff --git a/Documentation/serial/serial-rs485.txt b/Documentation/serial/serial-rs485.txt
new file mode 100644
index 000000000000..a4932387bbfb
--- /dev/null
+++ b/Documentation/serial/serial-rs485.txt
@@ -0,0 +1,120 @@
1 RS485 SERIAL COMMUNICATIONS
2
31. INTRODUCTION
4
5 EIA-485, also known as TIA/EIA-485 or RS-485, is a standard defining the
6 electrical characteristics of drivers and receivers for use in balanced
7 digital multipoint systems.
8 This standard is widely used for communications in industrial automation
9 because it can be used effectively over long distances and in electrically
10 noisy environments.
11
122. HARDWARE-RELATED CONSIDERATIONS
13
14 Some CPUs/UARTs (e.g., Atmel AT91 or 16C950 UART) contain a built-in
15 half-duplex mode capable of automatically controlling line direction by
16 toggling RTS or DTR signals. That can be used to control external
17 half-duplex hardware like an RS485 transceiver or any RS232-connected
18 half-duplex devices like some modems.
19
20 For these microcontrollers, the Linux driver should be made capable of
21 working in both modes, and proper ioctls (see later) should be made
22 available at user-level to allow switching from one mode to the other, and
23 vice versa.
24
253. DATA STRUCTURES ALREADY AVAILABLE IN THE KERNEL
26
27 The Linux kernel provides the serial_rs485 structure (see [1]) to handle
28 RS485 communications. This data structure is used to set and configure RS485
29 parameters in the platform data and in ioctls.
30
31 Any driver for devices capable of working both as RS232 and RS485 should
32 provide at least the following ioctls:
33
34 - TIOCSRS485 (typically associated with number 0x542F). This ioctl is used
35 to enable/disable RS485 mode from user-space
36
37 - TIOCGRS485 (typically associated with number 0x542E). This ioctl is used
38 to get RS485 mode from kernel-space (i.e., driver) to user-space.
39
40 In other words, the serial driver should contain a code similar to the next
41 one:
42
43 static struct uart_ops atmel_pops = {
44 /* ... */
45 .ioctl = handle_ioctl,
46 };
47
48 static int handle_ioctl(struct uart_port *port,
49 unsigned int cmd,
50 unsigned long arg)
51 {
52 struct serial_rs485 rs485conf;
53
54 switch (cmd) {
55 case TIOCSRS485:
56 if (copy_from_user(&rs485conf,
57 (struct serial_rs485 *) arg,
58 sizeof(rs485conf)))
59 return -EFAULT;
60
61 /* ... */
62 break;
63
64 case TIOCGRS485:
65 if (copy_to_user((struct serial_rs485 *) arg,
66 ...,
67 sizeof(rs485conf)))
68 return -EFAULT;
69 /* ... */
70 break;
71
72 /* ... */
73 }
74 }
75
76
774. USAGE FROM USER-LEVEL
78
79 From user-level, RS485 configuration can be get/set using the previous
80 ioctls. For instance, to set RS485 you can use the following code:
81
82 #include <linux/serial.h>
83
84 /* Driver-specific ioctls: */
85 #define TIOCGRS485 0x542E
86 #define TIOCSRS485 0x542F
87
88 /* Open your specific device (e.g., /dev/mydevice): */
89 int fd = open ("/dev/mydevice", O_RDWR);
90 if (fd < 0) {
91 /* Error handling. See errno. */
92 }
93
94 struct serial_rs485 rs485conf;
95
96 /* Set RS485 mode: */
97 rs485conf.flags |= SER_RS485_ENABLED;
98
99 /* Set rts delay before send, if needed: */
100 rs485conf.flags |= SER_RS485_RTS_BEFORE_SEND;
101 rs485conf.delay_rts_before_send = ...;
102
103 /* Set rts delay after send, if needed: */
104 rs485conf.flags |= SER_RS485_RTS_AFTER_SEND;
105 rs485conf.delay_rts_after_send = ...;
106
107 if (ioctl (fd, TIOCSRS485, &rs485conf) < 0) {
108 /* Error handling. See errno. */
109 }
110
111 /* Use read() and write() syscalls here... */
112
113 /* Close the device when finished: */
114 if (close (fd) < 0) {
115 /* Error handling. See errno. */
116 }
117
1185. REFERENCES
119
120 [1] include/linux/serial.h
diff --git a/Documentation/serial/tty.txt b/Documentation/serial/tty.txt
index 7c900507279f..540db41dfd5d 100644
--- a/Documentation/serial/tty.txt
+++ b/Documentation/serial/tty.txt
@@ -107,7 +107,7 @@ write_wakeup() - May be called at any point between open and close.
107 107
108dcd_change() - Report to the tty line the current DCD pin status 108dcd_change() - Report to the tty line the current DCD pin status
109 changes and the relative timestamp. The timestamp 109 changes and the relative timestamp. The timestamp
110 can be NULL. 110 cannot be NULL.
111 111
112 112
113Driver Access 113Driver Access
diff --git a/Documentation/sh/clk.txt b/Documentation/sh/clk.txt
deleted file mode 100644
index 114b595cfa97..000000000000
--- a/Documentation/sh/clk.txt
+++ /dev/null
@@ -1,32 +0,0 @@
1Clock framework on SuperH architecture
2
3The framework on SH extends existing API by the function clk_set_rate_ex,
4which prototype is as follows:
5
6 clk_set_rate_ex (struct clk *clk, unsigned long rate, int algo_id)
7
8The algo_id parameter is used to specify algorithm used to recalculate clocks,
9adjanced to clock, specified as first argument. It is assumed that algo_id==0
10means no changes to adjanced clock
11
12Internally, the clk_set_rate_ex forwards request to clk->ops->set_rate method,
13if it is present in ops structure. The method should set the clock rate and adjust
14all needed clocks according to the passed algo_id.
15Exact values for algo_id are machine-dependent. For the sh7722, the following
16values are defined:
17
18 NO_CHANGE = 0,
19 IUS_N1_N1, /* I:U = N:1, U:Sh = N:1 */
20 IUS_322, /* I:U:Sh = 3:2:2 */
21 IUS_522, /* I:U:Sh = 5:2:2 */
22 IUS_N11, /* I:U:Sh = N:1:1 */
23 SB_N1, /* Sh:B = N:1 */
24 SB3_N1, /* Sh:B3 = N:1 */
25 SB3_32, /* Sh:B3 = 3:2 */
26 SB3_43, /* Sh:B3 = 4:3 */
27 SB3_54, /* Sh:B3 = 5:4 */
28 BP_N1, /* B:P = N:1 */
29 IP_N1 /* I:P = N:1 */
30
31Each of these constants means relation between clocks that can be set via the FRQCR
32register
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 7f4dcebda9c6..89757012c7ff 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -300,6 +300,74 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
300 control correctly. If you have problems regarding this, try 300 control correctly. If you have problems regarding this, try
301 another ALSA compliant mixer (alsamixer works). 301 another ALSA compliant mixer (alsamixer works).
302 302
303 Module snd-azt1605
304 ------------------
305
306 Module for Aztech Sound Galaxy soundcards based on the Aztech AZT1605
307 chipset.
308
309 port - port # for BASE (0x220,0x240,0x260,0x280)
310 wss_port - port # for WSS (0x530,0x604,0xe80,0xf40)
311 irq - IRQ # for WSS (7,9,10,11)
312 dma1 - DMA # for WSS playback (0,1,3)
313 dma2 - DMA # for WSS capture (0,1), -1 = disabled (default)
314 mpu_port - port # for MPU-401 UART (0x300,0x330), -1 = disabled (default)
315 mpu_irq - IRQ # for MPU-401 UART (3,5,7,9), -1 = disabled (default)
316 fm_port - port # for OPL3 (0x388), -1 = disabled (default)
317
318 This module supports multiple cards. It does not support autoprobe: port,
319 wss_port, irq and dma1 have to be specified. The other values are
320 optional.
321
322 "port" needs to match the BASE ADDRESS jumper on the card (0x220 or 0x240)
323 or the value stored in the card's EEPROM for cards that have an EEPROM and
324 their "CONFIG MODE" jumper set to "EEPROM SETTING". The other values can
325 be chosen freely from the options enumerated above.
326
327 If dma2 is specified and different from dma1, the card will operate in
328 full-duplex mode. When dma1=3, only dma2=0 is valid and the only way to
329 enable capture since only channels 0 and 1 are available for capture.
330
331 Generic settings are "port=0x220 wss_port=0x530 irq=10 dma1=1 dma2=0
332 mpu_port=0x330 mpu_irq=9 fm_port=0x388".
333
334 Whatever IRQ and DMA channels you pick, be sure to reserve them for
335 legacy ISA in your BIOS.
336
337 Module snd-azt2316
338 ------------------
339
340 Module for Aztech Sound Galaxy soundcards based on the Aztech AZT2316
341 chipset.
342
343 port - port # for BASE (0x220,0x240,0x260,0x280)
344 wss_port - port # for WSS (0x530,0x604,0xe80,0xf40)
345 irq - IRQ # for WSS (7,9,10,11)
346 dma1 - DMA # for WSS playback (0,1,3)
347 dma2 - DMA # for WSS capture (0,1), -1 = disabled (default)
348 mpu_port - port # for MPU-401 UART (0x300,0x330), -1 = disabled (default)
349 mpu_irq - IRQ # for MPU-401 UART (5,7,9,10), -1 = disabled (default)
350 fm_port - port # for OPL3 (0x388), -1 = disabled (default)
351
352 This module supports multiple cards. It does not support autoprobe: port,
353 wss_port, irq and dma1 have to be specified. The other values are
354 optional.
355
356 "port" needs to match the BASE ADDRESS jumper on the card (0x220 or 0x240)
357 or the value stored in the card's EEPROM for cards that have an EEPROM and
358 their "CONFIG MODE" jumper set to "EEPROM SETTING". The other values can
359 be chosen freely from the options enumerated above.
360
361 If dma2 is specified and different from dma1, the card will operate in
362 full-duplex mode. When dma1=3, only dma2=0 is valid and the only way to
363 enable capture since only channels 0 and 1 are available for capture.
364
365 Generic settings are "port=0x220 wss_port=0x530 irq=10 dma1=1 dma2=0
366 mpu_port=0x330 mpu_irq=9 fm_port=0x388".
367
368 Whatever IRQ and DMA channels you pick, be sure to reserve them for
369 legacy ISA in your BIOS.
370
303 Module snd-aw2 371 Module snd-aw2
304 -------------- 372 --------------
305 373
@@ -906,13 +974,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
906 974
907 See hdspm.txt for details. 975 See hdspm.txt for details.
908 976
909 Module snd-hifier
910 -----------------
911
912 Module for the MediaTek/TempoTec HiFier Fantasia sound card.
913
914 This module supports autoprobe and multiple cards.
915
916 Module snd-ice1712 977 Module snd-ice1712
917 ------------------ 978 ------------------
918 979
@@ -1169,6 +1230,13 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1169 This module supports multiple cards. 1230 This module supports multiple cards.
1170 The driver requires the firmware loader support on kernel. 1231 The driver requires the firmware loader support on kernel.
1171 1232
1233 Module snd-lola
1234 ---------------
1235
1236 Module for Digigram Lola PCI-e boards
1237
1238 This module supports multiple cards.
1239
1172 Module snd-lx6464es 1240 Module snd-lx6464es
1173 ------------------- 1241 -------------------
1174 1242
@@ -1463,15 +1531,20 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1463 Module snd-oxygen 1531 Module snd-oxygen
1464 ----------------- 1532 -----------------
1465 1533
1466 Module for sound cards based on the C-Media CMI8788 chip: 1534 Module for sound cards based on the C-Media CMI8786/8787/8788 chip:
1467 * Asound A-8788 1535 * Asound A-8788
1536 * Asus Xonar DG
1468 * AuzenTech X-Meridian 1537 * AuzenTech X-Meridian
1538 * AuzenTech X-Meridian 2G
1469 * Bgears b-Enspirer 1539 * Bgears b-Enspirer
1470 * Club3D Theatron DTS 1540 * Club3D Theatron DTS
1471 * HT-Omega Claro (plus) 1541 * HT-Omega Claro (plus)
1472 * HT-Omega Claro halo (XT) 1542 * HT-Omega Claro halo (XT)
1543 * Kuroutoshikou CMI8787-HG2PCI
1473 * Razer Barracuda AC-1 1544 * Razer Barracuda AC-1
1474 * Sondigo Inferno 1545 * Sondigo Inferno
1546 * TempoTec HiFier Fantasia
1547 * TempoTec HiFier Serenade
1475 1548
1476 This module supports autoprobe and multiple cards. 1549 This module supports autoprobe and multiple cards.
1477 1550
@@ -1641,20 +1714,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1641 1714
1642 This card is also known as Audio Excel DSP 16 or Zoltrix AV302. 1715 This card is also known as Audio Excel DSP 16 or Zoltrix AV302.
1643 1716
1644 Module snd-sgalaxy
1645 ------------------
1646
1647 Module for Aztech Sound Galaxy sound card.
1648
1649 sbport - Port # for SB16 interface (0x220,0x240)
1650 wssport - Port # for WSS interface (0x530,0xe80,0xf40,0x604)
1651 irq - IRQ # (7,9,10,11)
1652 dma1 - DMA #
1653
1654 This module supports multiple cards.
1655
1656 The power-management is supported.
1657
1658 Module snd-sscape 1717 Module snd-sscape
1659 ----------------- 1718 -----------------
1660 1719
@@ -1952,9 +2011,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1952 Module snd-virtuoso 2011 Module snd-virtuoso
1953 ------------------- 2012 -------------------
1954 2013
1955 Module for sound cards based on the Asus AV100/AV200 chips, 2014 Module for sound cards based on the Asus AV66/AV100/AV200 chips,
1956 i.e., Xonar D1, DX, D2, D2X, DS, HDAV1.3 (Deluxe), Essence ST 2015 i.e., Xonar D1, DX, D2, D2X, DS, Essence ST (Deluxe), Essence STX,
1957 (Deluxe) and Essence STX. 2016 HDAV1.3 (Deluxe), and HDAV1.3 Slim.
1958 2017
1959 This module supports autoprobe and multiple cards. 2018 This module supports autoprobe and multiple cards.
1960 2019
@@ -2177,7 +2236,7 @@ Proc interfaces (/proc/asound)
2177 2236
2178/proc/asound/card#/pcm#[cp]/oss 2237/proc/asound/card#/pcm#[cp]/oss
2179------------------------------- 2238-------------------------------
2180 String "erase" - erase all additional informations about OSS applications 2239 String "erase" - erase all additional information about OSS applications
2181 String "<app_name> <fragments> <fragment_size> [<options>]" 2240 String "<app_name> <fragments> <fragment_size> [<options>]"
2182 2241
2183 <app_name> - name of application with (higher priority) or without path 2242 <app_name> - name of application with (higher priority) or without path
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt
index 37c6aad5e590..d70c93bdcadf 100644
--- a/Documentation/sound/alsa/HD-Audio-Models.txt
+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
@@ -94,7 +94,7 @@ ALC662/663/272
94 3stack-dig 3-stack (2-channel) with SPDIF 94 3stack-dig 3-stack (2-channel) with SPDIF
95 3stack-6ch 3-stack (6-channel) 95 3stack-6ch 3-stack (6-channel)
96 3stack-6ch-dig 3-stack (6-channel) with SPDIF 96 3stack-6ch-dig 3-stack (6-channel) with SPDIF
97 6stack-dig 6-stack with SPDIF 97 5stack-dig 5-stack with SPDIF
98 lenovo-101e Lenovo laptop 98 lenovo-101e Lenovo laptop
99 eeepc-p701 ASUS Eeepc P701 99 eeepc-p701 ASUS Eeepc P701
100 eeepc-ep20 ASUS Eeepc EP20 100 eeepc-ep20 ASUS Eeepc EP20
@@ -149,7 +149,6 @@ ALC882/883/885/888/889
149 acer-aspire-7730g Acer Aspire 7730G 149 acer-aspire-7730g Acer Aspire 7730G
150 acer-aspire-8930g Acer Aspire 8930G 150 acer-aspire-8930g Acer Aspire 8930G
151 medion Medion Laptops 151 medion Medion Laptops
152 medion-md2 Medion MD2
153 targa-dig Targa/MSI 152 targa-dig Targa/MSI
154 targa-2ch-dig Targa/MSI with 2-channel 153 targa-2ch-dig Targa/MSI with 2-channel
155 targa-8ch-dig Targa/MSI with 8-channel (MSI GX620) 154 targa-8ch-dig Targa/MSI with 8-channel (MSI GX620)
@@ -297,6 +296,7 @@ Conexant 5066
297============= 296=============
298 laptop Basic Laptop config (default) 297 laptop Basic Laptop config (default)
299 hp-laptop HP laptops, e g G60 298 hp-laptop HP laptops, e g G60
299 asus Asus K52JU, Lenovo G560
300 dell-laptop Dell laptops 300 dell-laptop Dell laptops
301 dell-vostro Dell Vostro 301 dell-vostro Dell Vostro
302 olpc-xo-1_5 OLPC XO 1.5 302 olpc-xo-1_5 OLPC XO 1.5
diff --git a/Documentation/sound/alsa/HD-Audio.txt b/Documentation/sound/alsa/HD-Audio.txt
index 278cc2122ea0..c82beb007634 100644
--- a/Documentation/sound/alsa/HD-Audio.txt
+++ b/Documentation/sound/alsa/HD-Audio.txt
@@ -57,9 +57,11 @@ dead. However, this detection isn't perfect on some devices. In such
57a case, you can change the default method via `position_fix` option. 57a case, you can change the default method via `position_fix` option.
58 58
59`position_fix=1` means to use LPIB method explicitly. 59`position_fix=1` means to use LPIB method explicitly.
60`position_fix=2` means to use the position-buffer. 0 is the default 60`position_fix=2` means to use the position-buffer.
61value, the automatic check and fallback to LPIB as described in the 61`position_fix=3` means to use a combination of both methods, needed
62above. If you get a problem of repeated sounds, this option might 62for some VIA and ATI controllers. 0 is the default value for all other
63controllers, the automatic check and fallback to LPIB as described in
64the above. If you get a problem of repeated sounds, this option might
63help. 65help.
64 66
65In addition to that, every controller is known to be broken regarding 67In addition to that, every controller is known to be broken regarding
diff --git a/Documentation/sound/alsa/SB-Live-mixer.txt b/Documentation/sound/alsa/SB-Live-mixer.txt
index f5639d40521d..f4b5988f450c 100644
--- a/Documentation/sound/alsa/SB-Live-mixer.txt
+++ b/Documentation/sound/alsa/SB-Live-mixer.txt
@@ -87,14 +87,14 @@ accumulator. ALSA uses accumulators 0 and 1 for left and right PCM.
87The result is forwarded to the ADC capture FIFO (thus to the standard capture 87The result is forwarded to the ADC capture FIFO (thus to the standard capture
88PCM device). 88PCM device).
89 89
90name='Music Playback Volume',index=0 90name='Synth Playback Volume',index=0
91 91
92This control is used to attenuate samples for left and right MIDI FX-bus 92This control is used to attenuate samples for left and right MIDI FX-bus
93accumulators. ALSA uses accumulators 4 and 5 for left and right MIDI samples. 93accumulators. ALSA uses accumulators 4 and 5 for left and right MIDI samples.
94The result samples are forwarded to the front DAC PCM slots of the AC97 codec. 94The result samples are forwarded to the front DAC PCM slots of the AC97 codec.
95 95
96name='Music Capture Volume',index=0 96name='Synth Capture Volume',index=0
97name='Music Capture Switch',index=0 97name='Synth Capture Switch',index=0
98 98
99These controls are used to attenuate samples for left and right MIDI FX-bus 99These controls are used to attenuate samples for left and right MIDI FX-bus
100accumulator. ALSA uses accumulators 4 and 5 for left and right PCM. 100accumulator. ALSA uses accumulators 4 and 5 for left and right PCM.
diff --git a/Documentation/sound/alsa/soc/codec.txt b/Documentation/sound/alsa/soc/codec.txt
index 37ba3a72cb76..bce23a4a7875 100644
--- a/Documentation/sound/alsa/soc/codec.txt
+++ b/Documentation/sound/alsa/soc/codec.txt
@@ -27,42 +27,38 @@ ASoC Codec driver breakdown
27 27
281 - Codec DAI and PCM configuration 281 - Codec DAI and PCM configuration
29----------------------------------- 29-----------------------------------
30Each codec driver must have a struct snd_soc_codec_dai to define its DAI and 30Each codec driver must have a struct snd_soc_dai_driver to define its DAI and
31PCM capabilities and operations. This struct is exported so that it can be 31PCM capabilities and operations. This struct is exported so that it can be
32registered with the core by your machine driver. 32registered with the core by your machine driver.
33 33
34e.g. 34e.g.
35 35
36struct snd_soc_codec_dai wm8731_dai = { 36static struct snd_soc_dai_ops wm8731_dai_ops = {
37 .name = "WM8731", 37 .prepare = wm8731_pcm_prepare,
38 /* playback capabilities */ 38 .hw_params = wm8731_hw_params,
39 .shutdown = wm8731_shutdown,
40 .digital_mute = wm8731_mute,
41 .set_sysclk = wm8731_set_dai_sysclk,
42 .set_fmt = wm8731_set_dai_fmt,
43};
44
45struct snd_soc_dai_driver wm8731_dai = {
46 .name = "wm8731-hifi",
39 .playback = { 47 .playback = {
40 .stream_name = "Playback", 48 .stream_name = "Playback",
41 .channels_min = 1, 49 .channels_min = 1,
42 .channels_max = 2, 50 .channels_max = 2,
43 .rates = WM8731_RATES, 51 .rates = WM8731_RATES,
44 .formats = WM8731_FORMATS,}, 52 .formats = WM8731_FORMATS,},
45 /* capture capabilities */
46 .capture = { 53 .capture = {
47 .stream_name = "Capture", 54 .stream_name = "Capture",
48 .channels_min = 1, 55 .channels_min = 1,
49 .channels_max = 2, 56 .channels_max = 2,
50 .rates = WM8731_RATES, 57 .rates = WM8731_RATES,
51 .formats = WM8731_FORMATS,}, 58 .formats = WM8731_FORMATS,},
52 /* pcm operations - see section 4 below */ 59 .ops = &wm8731_dai_ops,
53 .ops = { 60 .symmetric_rates = 1,
54 .prepare = wm8731_pcm_prepare,
55 .hw_params = wm8731_hw_params,
56 .shutdown = wm8731_shutdown,
57 },
58 /* DAI operations - see DAI.txt */
59 .dai_ops = {
60 .digital_mute = wm8731_mute,
61 .set_sysclk = wm8731_set_dai_sysclk,
62 .set_fmt = wm8731_set_dai_fmt,
63 }
64}; 61};
65EXPORT_SYMBOL_GPL(wm8731_dai);
66 62
67 63
682 - Codec control IO 642 - Codec control IO
@@ -186,13 +182,14 @@ when the mute is applied or freed.
186 182
187i.e. 183i.e.
188 184
189static int wm8974_mute(struct snd_soc_codec *codec, 185static int wm8974_mute(struct snd_soc_dai *dai, int mute)
190 struct snd_soc_codec_dai *dai, int mute)
191{ 186{
192 u16 mute_reg = wm8974_read_reg_cache(codec, WM8974_DAC) & 0xffbf; 187 struct snd_soc_codec *codec = dai->codec;
193 if(mute) 188 u16 mute_reg = snd_soc_read(codec, WM8974_DAC) & 0xffbf;
194 wm8974_write(codec, WM8974_DAC, mute_reg | 0x40); 189
190 if (mute)
191 snd_soc_write(codec, WM8974_DAC, mute_reg | 0x40);
195 else 192 else
196 wm8974_write(codec, WM8974_DAC, mute_reg); 193 snd_soc_write(codec, WM8974_DAC, mute_reg);
197 return 0; 194 return 0;
198} 195}
diff --git a/Documentation/sound/alsa/soc/machine.txt b/Documentation/sound/alsa/soc/machine.txt
index 2524c75557df..3e2ec9cbf397 100644
--- a/Documentation/sound/alsa/soc/machine.txt
+++ b/Documentation/sound/alsa/soc/machine.txt
@@ -12,6 +12,8 @@ the following struct:-
12struct snd_soc_card { 12struct snd_soc_card {
13 char *name; 13 char *name;
14 14
15 ...
16
15 int (*probe)(struct platform_device *pdev); 17 int (*probe)(struct platform_device *pdev);
16 int (*remove)(struct platform_device *pdev); 18 int (*remove)(struct platform_device *pdev);
17 19
@@ -22,12 +24,13 @@ struct snd_soc_card {
22 int (*resume_pre)(struct platform_device *pdev); 24 int (*resume_pre)(struct platform_device *pdev);
23 int (*resume_post)(struct platform_device *pdev); 25 int (*resume_post)(struct platform_device *pdev);
24 26
25 /* machine stream operations */ 27 ...
26 struct snd_soc_ops *ops;
27 28
28 /* CPU <--> Codec DAI links */ 29 /* CPU <--> Codec DAI links */
29 struct snd_soc_dai_link *dai_link; 30 struct snd_soc_dai_link *dai_link;
30 int num_links; 31 int num_links;
32
33 ...
31}; 34};
32 35
33probe()/remove() 36probe()/remove()
@@ -42,11 +45,6 @@ of any machine audio tasks that have to be done before or after the codec, DAIs
42and DMA is suspended and resumed. Optional. 45and DMA is suspended and resumed. Optional.
43 46
44 47
45Machine operations
46------------------
47The machine specific audio operations can be set here. Again this is optional.
48
49
50Machine DAI Configuration 48Machine DAI Configuration
51------------------------- 49-------------------------
52The machine DAI configuration glues all the codec and CPU DAIs together. It can 50The machine DAI configuration glues all the codec and CPU DAIs together. It can
@@ -61,8 +59,10 @@ struct snd_soc_dai_link is used to set up each DAI in your machine. e.g.
61static struct snd_soc_dai_link corgi_dai = { 59static struct snd_soc_dai_link corgi_dai = {
62 .name = "WM8731", 60 .name = "WM8731",
63 .stream_name = "WM8731", 61 .stream_name = "WM8731",
64 .cpu_dai = &pxa_i2s_dai, 62 .cpu_dai_name = "pxa-is2-dai",
65 .codec_dai = &wm8731_dai, 63 .codec_dai_name = "wm8731-hifi",
64 .platform_name = "pxa-pcm-audio",
65 .codec_name = "wm8713-codec.0-001a",
66 .init = corgi_wm8731_init, 66 .init = corgi_wm8731_init,
67 .ops = &corgi_ops, 67 .ops = &corgi_ops,
68}; 68};
@@ -77,26 +77,6 @@ static struct snd_soc_card snd_soc_corgi = {
77}; 77};
78 78
79 79
80Machine Audio Subsystem
81-----------------------
82
83The machine soc device glues the platform, machine and codec driver together.
84Private data can also be set here. e.g.
85
86/* corgi audio private data */
87static struct wm8731_setup_data corgi_wm8731_setup = {
88 .i2c_address = 0x1b,
89};
90
91/* corgi audio subsystem */
92static struct snd_soc_device corgi_snd_devdata = {
93 .machine = &snd_soc_corgi,
94 .platform = &pxa2xx_soc_platform,
95 .codec_dev = &soc_codec_dev_wm8731,
96 .codec_data = &corgi_wm8731_setup,
97};
98
99
100Machine Power Map 80Machine Power Map
101----------------- 81-----------------
102 82
diff --git a/Documentation/sound/alsa/soc/platform.txt b/Documentation/sound/alsa/soc/platform.txt
index 06d835987c6a..d57efad37e0a 100644
--- a/Documentation/sound/alsa/soc/platform.txt
+++ b/Documentation/sound/alsa/soc/platform.txt
@@ -20,9 +20,10 @@ struct snd_soc_ops {
20 int (*trigger)(struct snd_pcm_substream *, int); 20 int (*trigger)(struct snd_pcm_substream *, int);
21}; 21};
22 22
23The platform driver exports its DMA functionality via struct snd_soc_platform:- 23The platform driver exports its DMA functionality via struct
24snd_soc_platform_driver:-
24 25
25struct snd_soc_platform { 26struct snd_soc_platform_driver {
26 char *name; 27 char *name;
27 28
28 int (*probe)(struct platform_device *pdev); 29 int (*probe)(struct platform_device *pdev);
@@ -34,6 +35,13 @@ struct snd_soc_platform {
34 int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *, struct snd_pcm *); 35 int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *, struct snd_pcm *);
35 void (*pcm_free)(struct snd_pcm *); 36 void (*pcm_free)(struct snd_pcm *);
36 37
38 /*
39 * For platform caused delay reporting.
40 * Optional.
41 */
42 snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *,
43 struct snd_soc_dai *);
44
37 /* platform stream ops */ 45 /* platform stream ops */
38 struct snd_pcm_ops *pcm_ops; 46 struct snd_pcm_ops *pcm_ops;
39}; 47};
diff --git a/Documentation/sound/oss/AudioExcelDSP16 b/Documentation/sound/oss/AudioExcelDSP16
index c0f08922993b..e0dc0641b480 100644
--- a/Documentation/sound/oss/AudioExcelDSP16
+++ b/Documentation/sound/oss/AudioExcelDSP16
@@ -1,10 +1,10 @@
1Driver 1Driver
2------ 2------
3 3
4Informations about Audio Excel DSP 16 driver can be found in the source 4Information about Audio Excel DSP 16 driver can be found in the source
5file aedsp16.c 5file aedsp16.c
6Please, read the head of the source before using it. It contain useful 6Please, read the head of the source before using it. It contain useful
7informations. 7information.
8 8
9Configuration 9Configuration
10------------- 10-------------
@@ -68,7 +68,7 @@ Sound cards supported
68This driver supports the SC-6000 and SC-6600 based Gallant's sound card. 68This driver supports the SC-6000 and SC-6600 based Gallant's sound card.
69It don't support the Audio Excel DSP 16 III (try the SC-6600 code). 69It don't support the Audio Excel DSP 16 III (try the SC-6600 code).
70I'm working on the III version of the card: if someone have useful 70I'm working on the III version of the card: if someone have useful
71informations about it, please let me know. 71information about it, please let me know.
72For all the non-supported audio cards, you have to boot MS-DOS (or WIN95) 72For all the non-supported audio cards, you have to boot MS-DOS (or WIN95)
73activating the audio card with the MS-DOS device driver, then you have to 73activating the audio card with the MS-DOS device driver, then you have to
74<ctrl>-<alt>-<del> and boot Linux. 74<ctrl>-<alt>-<del> and boot Linux.
diff --git a/Documentation/sound/oss/README.OSS b/Documentation/sound/oss/README.OSS
index c615debbf08d..4be259428a1c 100644
--- a/Documentation/sound/oss/README.OSS
+++ b/Documentation/sound/oss/README.OSS
@@ -1352,7 +1352,7 @@ OSS-mixer.
1352The PCM20 contains a radio tuner, which is also controlled by 1352The PCM20 contains a radio tuner, which is also controlled by
1353ACI. This radio tuner is supported by the ACI driver together with the 1353ACI. This radio tuner is supported by the ACI driver together with the
1354miropcm20.o module. Also the 7-band equalizer is integrated 1354miropcm20.o module. Also the 7-band equalizer is integrated
1355(limited by the OSS-design). Developement has started and maybe 1355(limited by the OSS-design). Development has started and maybe
1356finished for the RDS decoder on this card, too. You will be able to 1356finished for the RDS decoder on this card, too. You will be able to
1357read RadioText, the Programme Service name, Programme TYpe and 1357read RadioText, the Programme Service name, Programme TYpe and
1358others. Even the v4l radio module benefits from it with a refined 1358others. Even the v4l radio module benefits from it with a refined
diff --git a/Documentation/sound/oss/README.ymfsb b/Documentation/sound/oss/README.ymfsb
index af8a7d3a4e8e..b6b77906b58d 100644
--- a/Documentation/sound/oss/README.ymfsb
+++ b/Documentation/sound/oss/README.ymfsb
@@ -5,7 +5,7 @@ FIRST OF ALL
5============ 5============
6 6
7 This code references YAMAHA's sample codes and data sheets. 7 This code references YAMAHA's sample codes and data sheets.
8 I respect and thank for all people they made open the informations 8 I respect and thank for all people they made open the information
9 about YMF7xx cards. 9 about YMF7xx cards.
10 10
11 And this codes heavily based on Jeff Garzik <jgarzik@pobox.com>'s 11 And this codes heavily based on Jeff Garzik <jgarzik@pobox.com>'s
diff --git a/Documentation/spi/pxa2xx b/Documentation/spi/pxa2xx
index 6bb916d57c95..493dada57372 100644
--- a/Documentation/spi/pxa2xx
+++ b/Documentation/spi/pxa2xx
@@ -19,7 +19,7 @@ Declaring PXA2xx Master Controllers
19----------------------------------- 19-----------------------------------
20Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a 20Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a
21"platform device". The master configuration is passed to the driver via a table 21"platform device". The master configuration is passed to the driver via a table
22found in arch/arm/mach-pxa/include/mach/pxa2xx_spi.h: 22found in include/linux/spi/pxa2xx_spi.h:
23 23
24struct pxa2xx_spi_master { 24struct pxa2xx_spi_master {
25 enum pxa_ssp_type ssp_type; 25 enum pxa_ssp_type ssp_type;
@@ -94,7 +94,7 @@ using the "spi_board_info" structure found in "linux/spi/spi.h". See
94 94
95Each slave device attached to the PXA must provide slave specific configuration 95Each slave device attached to the PXA must provide slave specific configuration
96information via the structure "pxa2xx_spi_chip" found in 96information via the structure "pxa2xx_spi_chip" found in
97"arch/arm/mach-pxa/include/mach/pxa2xx_spi.h". The pxa2xx_spi master controller driver 97"include/linux/spi/pxa2xx_spi.h". The pxa2xx_spi master controller driver
98will uses the configuration whenever the driver communicates with the slave 98will uses the configuration whenever the driver communicates with the slave
99device. All fields are optional. 99device. All fields are optional.
100 100
@@ -143,7 +143,7 @@ configured to use SSPFRM instead.
143NOTE: the SPI driver cannot control the chip select if SSPFRM is used, so the 143NOTE: the SPI driver cannot control the chip select if SSPFRM is used, so the
144chipselect is dropped after each spi_transfer. Most devices need chip select 144chipselect is dropped after each spi_transfer. Most devices need chip select
145asserted around the complete message. Use SSPFRM as a GPIO (through cs_control) 145asserted around the complete message. Use SSPFRM as a GPIO (through cs_control)
146to accomodate these chips. 146to accommodate these chips.
147 147
148 148
149NSSP SLAVE SAMPLE 149NSSP SLAVE SAMPLE
diff --git a/Documentation/spi/spi-lm70llp b/Documentation/spi/spi-lm70llp
index 34a9cfd746bd..463f6d01fa15 100644
--- a/Documentation/spi/spi-lm70llp
+++ b/Documentation/spi/spi-lm70llp
@@ -46,7 +46,7 @@ The hardware interfacing on the LM70 LLP eval board is as follows:
46 46
47Note that since the LM70 uses a "3-wire" variant of SPI, the SI/SO pin 47Note that since the LM70 uses a "3-wire" variant of SPI, the SI/SO pin
48is connected to both pin D7 (as Master Out) and Select (as Master In) 48is connected to both pin D7 (as Master Out) and Select (as Master In)
49using an arrangment that lets either the parport or the LM70 pull the 49using an arrangement that lets either the parport or the LM70 pull the
50pin low. This can't be shared with true SPI devices, but other 3-wire 50pin low. This can't be shared with true SPI devices, but other 3-wire
51devices might share the same SI/SO pin. 51devices might share the same SI/SO pin.
52 52
diff --git a/Documentation/spinlocks.txt b/Documentation/spinlocks.txt
index 178c831b907d..9dbe885ecd8d 100644
--- a/Documentation/spinlocks.txt
+++ b/Documentation/spinlocks.txt
@@ -13,18 +13,8 @@ static DEFINE_SPINLOCK(xxx_lock);
13The above is always safe. It will disable interrupts _locally_, but the 13The above is always safe. It will disable interrupts _locally_, but the
14spinlock itself will guarantee the global lock, so it will guarantee that 14spinlock itself will guarantee the global lock, so it will guarantee that
15there is only one thread-of-control within the region(s) protected by that 15there is only one thread-of-control within the region(s) protected by that
16lock. This works well even under UP. The above sequence under UP 16lock. This works well even under UP also, so the code does _not_ need to
17essentially is just the same as doing 17worry about UP vs SMP issues: the spinlocks work correctly under both.
18
19 unsigned long flags;
20
21 save_flags(flags); cli();
22 ... critical section ...
23 restore_flags(flags);
24
25so the code does _not_ need to worry about UP vs SMP issues: the spinlocks
26work correctly under both (and spinlocks are actually more efficient on
27architectures that allow doing the "save_flags + cli" in one operation).
28 18
29 NOTE! Implications of spin_locks for memory are further described in: 19 NOTE! Implications of spin_locks for memory are further described in:
30 20
@@ -36,27 +26,7 @@ The above is usually pretty simple (you usually need and want only one
36spinlock for most things - using more than one spinlock can make things a 26spinlock for most things - using more than one spinlock can make things a
37lot more complex and even slower and is usually worth it only for 27lot more complex and even slower and is usually worth it only for
38sequences that you _know_ need to be split up: avoid it at all cost if you 28sequences that you _know_ need to be split up: avoid it at all cost if you
39aren't sure). HOWEVER, it _does_ mean that if you have some code that does 29aren't sure).
40
41 cli();
42 .. critical section ..
43 sti();
44
45and another sequence that does
46
47 spin_lock_irqsave(flags);
48 .. critical section ..
49 spin_unlock_irqrestore(flags);
50
51then they are NOT mutually exclusive, and the critical regions can happen
52at the same time on two different CPU's. That's fine per se, but the
53critical regions had better be critical for different things (ie they
54can't stomp on each other).
55
56The above is a problem mainly if you end up mixing code - for example the
57routines in ll_rw_block() tend to use cli/sti to protect the atomicity of
58their actions, and if a driver uses spinlocks instead then you should
59think about issues like the above.
60 30
61This is really the only really hard part about spinlocks: once you start 31This is really the only really hard part about spinlocks: once you start
62using spinlocks they tend to expand to areas you might not have noticed 32using spinlocks they tend to expand to areas you might not have noticed
@@ -86,7 +56,7 @@ to change the variables it has to get an exclusive write lock.
86 56
87The routines look the same as above: 57The routines look the same as above:
88 58
89 rwlock_t xxx_lock = RW_LOCK_UNLOCKED; 59 rwlock_t xxx_lock = __RW_LOCK_UNLOCKED(xxx_lock);
90 60
91 unsigned long flags; 61 unsigned long flags;
92 62
@@ -120,11 +90,10 @@ Lesson 3: spinlocks revisited.
120 90
121The single spin-lock primitives above are by no means the only ones. They 91The single spin-lock primitives above are by no means the only ones. They
122are the most safe ones, and the ones that work under all circumstances, 92are the most safe ones, and the ones that work under all circumstances,
123but partly _because_ they are safe they are also fairly slow. They are 93but partly _because_ they are safe they are also fairly slow. They are slower
124much faster than a generic global cli/sti pair, but slower than they'd 94than they'd need to be, because they do have to disable interrupts
125need to be, because they do have to disable interrupts (which is just a 95(which is just a single instruction on a x86, but it's an expensive one -
126single instruction on a x86, but it's an expensive one - and on other 96and on other architectures it can be worse).
127architectures it can be worse).
128 97
129If you have a case where you have to protect a data structure across 98If you have a case where you have to protect a data structure across
130several CPU's and you want to use spinlocks you can potentially use 99several CPU's and you want to use spinlocks you can potentially use
@@ -196,25 +165,3 @@ appropriate:
196 165
197For static initialization, use DEFINE_SPINLOCK() / DEFINE_RWLOCK() or 166For static initialization, use DEFINE_SPINLOCK() / DEFINE_RWLOCK() or
198__SPIN_LOCK_UNLOCKED() / __RW_LOCK_UNLOCKED() as appropriate. 167__SPIN_LOCK_UNLOCKED() / __RW_LOCK_UNLOCKED() as appropriate.
199
200SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED are deprecated. These interfere
201with lockdep state tracking.
202
203Most of the time, you can simply turn:
204 static spinlock_t xxx_lock = SPIN_LOCK_UNLOCKED;
205into:
206 static DEFINE_SPINLOCK(xxx_lock);
207
208Static structure member variables go from:
209
210 struct foo bar {
211 .lock = SPIN_LOCK_UNLOCKED;
212 };
213
214to:
215
216 struct foo bar {
217 .lock = __SPIN_LOCK_UNLOCKED(bar.lock);
218 };
219
220Declaration of static rw_locks undergo a similar transformation.
diff --git a/Documentation/stable_api_nonsense.txt b/Documentation/stable_api_nonsense.txt
index 847b342b7b20..db3be892afb2 100644
--- a/Documentation/stable_api_nonsense.txt
+++ b/Documentation/stable_api_nonsense.txt
@@ -122,7 +122,7 @@ operating system to suffer.
122 122
123In both of these instances, all developers agreed that these were 123In both of these instances, all developers agreed that these were
124important changes that needed to be made, and they were made, with 124important changes that needed to be made, and they were made, with
125relatively little pain. If Linux had to ensure that it preserve a 125relatively little pain. If Linux had to ensure that it will preserve a
126stable source interface, a new interface would have been created, and 126stable source interface, a new interface would have been created, and
127the older, broken one would have had to be maintained over time, leading 127the older, broken one would have had to be maintained over time, leading
128to extra work for the USB developers. Since all Linux USB developers do 128to extra work for the USB developers. Since all Linux USB developers do
diff --git a/Documentation/sysctl/00-INDEX b/Documentation/sysctl/00-INDEX
index 1286f455992f..8cf5d493fd03 100644
--- a/Documentation/sysctl/00-INDEX
+++ b/Documentation/sysctl/00-INDEX
@@ -4,8 +4,6 @@ README
4 - general information about /proc/sys/ sysctl files. 4 - general information about /proc/sys/ sysctl files.
5abi.txt 5abi.txt
6 - documentation for /proc/sys/abi/*. 6 - documentation for /proc/sys/abi/*.
7ctl_unnumbered.txt
8 - explanation of why one should not add new binary sysctl numbers.
9fs.txt 7fs.txt
10 - documentation for /proc/sys/fs/*. 8 - documentation for /proc/sys/fs/*.
11kernel.txt 9kernel.txt
diff --git a/Documentation/sysctl/fs.txt b/Documentation/sysctl/fs.txt
index 62682500878a..88fd7f5c8dcd 100644
--- a/Documentation/sysctl/fs.txt
+++ b/Documentation/sysctl/fs.txt
@@ -88,20 +88,19 @@ you might want to raise the limit.
88 88
89file-max & file-nr: 89file-max & file-nr:
90 90
91The kernel allocates file handles dynamically, but as yet it
92doesn't free them again.
93
94The value in file-max denotes the maximum number of file- 91The value in file-max denotes the maximum number of file-
95handles that the Linux kernel will allocate. When you get lots 92handles that the Linux kernel will allocate. When you get lots
96of error messages about running out of file handles, you might 93of error messages about running out of file handles, you might
97want to increase this limit. 94want to increase this limit.
98 95
99Historically, the three values in file-nr denoted the number of 96Historically,the kernel was able to allocate file handles
100allocated file handles, the number of allocated but unused file 97dynamically, but not to free them again. The three values in
101handles, and the maximum number of file handles. Linux 2.6 always 98file-nr denote the number of allocated file handles, the number
102reports 0 as the number of free file handles -- this is not an 99of allocated but unused file handles, and the maximum number of
103error, it just means that the number of allocated file handles 100file handles. Linux 2.6 always reports 0 as the number of free
104exactly matches the number of used file handles. 101file handles -- this is not an error, it just means that the
102number of allocated file handles exactly matches the number of
103used file handles.
105 104
106Attempts to allocate more file descriptors than file-max are 105Attempts to allocate more file descriptors than file-max are
107reported with printk, look for "VFS: file-max limit <number> 106reported with printk, look for "VFS: file-max limit <number>
@@ -232,13 +231,6 @@ its creation).
232 231
233This directory contains configuration options for the epoll(7) interface. 232This directory contains configuration options for the epoll(7) interface.
234 233
235max_user_instances
236------------------
237
238This is the maximum number of epoll file descriptors that a single user can
239have open at a given time. The default value is 128, and should be enough
240for normal users.
241
242max_user_watches 234max_user_watches
243---------------- 235----------------
244 236
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index 3894eaa23486..5e7cb39ad195 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -28,11 +28,13 @@ show up in /proc/sys/kernel:
28- core_uses_pid 28- core_uses_pid
29- ctrl-alt-del 29- ctrl-alt-del
30- dentry-state 30- dentry-state
31- dmesg_restrict
31- domainname 32- domainname
32- hostname 33- hostname
33- hotplug 34- hotplug
34- java-appletviewer [ binfmt_java, obsolete ] 35- java-appletviewer [ binfmt_java, obsolete ]
35- java-interpreter [ binfmt_java, obsolete ] 36- java-interpreter [ binfmt_java, obsolete ]
37- kptr_restrict
36- kstack_depth_to_print [ X86 only ] 38- kstack_depth_to_print [ X86 only ]
37- l2cr [ PPC only ] 39- l2cr [ PPC only ]
38- modprobe ==> Documentation/debugging-modules.txt 40- modprobe ==> Documentation/debugging-modules.txt
@@ -159,7 +161,8 @@ core_pattern is used to specify a core dumpfile pattern name.
159 %s signal number 161 %s signal number
160 %t UNIX time of dump 162 %t UNIX time of dump
161 %h hostname 163 %h hostname
162 %e executable filename 164 %e executable filename (may be shortened)
165 %E executable path
163 %<OTHER> both are dropped 166 %<OTHER> both are dropped
164. If the first character of the pattern is a '|', the kernel will treat 167. If the first character of the pattern is a '|', the kernel will treat
165 the rest of the pattern as a command to run. The core dump will be 168 the rest of the pattern as a command to run. The core dump will be
@@ -213,6 +216,19 @@ to decide what to do with it.
213 216
214============================================================== 217==============================================================
215 218
219dmesg_restrict:
220
221This toggle indicates whether unprivileged users are prevented from using
222dmesg(8) to view messages from the kernel's log buffer. When
223dmesg_restrict is set to (0) there are no restrictions. When
224dmesg_restrict is set set to (1), users must have CAP_SYSLOG to use
225dmesg(8).
226
227The kernel config option CONFIG_SECURITY_DMESG_RESTRICT sets the default
228value of dmesg_restrict.
229
230==============================================================
231
216domainname & hostname: 232domainname & hostname:
217 233
218These files can be used to set the NIS/YP domainname and the 234These files can be used to set the NIS/YP domainname and the
@@ -247,6 +263,19 @@ This flag controls the L2 cache of G3 processor boards. If
247 263
248============================================================== 264==============================================================
249 265
266kptr_restrict:
267
268This toggle indicates whether restrictions are placed on
269exposing kernel addresses via /proc and other interfaces. When
270kptr_restrict is set to (0), there are no restrictions. When
271kptr_restrict is set to (1), the default, kernel pointers
272printed using the %pK format specifier will be replaced with 0's
273unless the user has CAP_SYSLOG. When kptr_restrict is set to
274(2), kernel pointers printed using %pK will be replaced with 0's
275regardless of privileges.
276
277==============================================================
278
250kstack_depth_to_print: (X86 only) 279kstack_depth_to_print: (X86 only)
251 280
252Controls the number of words to print when dumping the raw 281Controls the number of words to print when dumping the raw
@@ -339,7 +368,7 @@ the different loglevels.
339 368
340- console_loglevel: messages with a higher priority than 369- console_loglevel: messages with a higher priority than
341 this will be printed to the console 370 this will be printed to the console
342- default_message_level: messages without an explicit priority 371- default_message_loglevel: messages without an explicit priority
343 will be printed with this priority 372 will be printed with this priority
344- minimum_console_loglevel: minimum (highest) value to which 373- minimum_console_loglevel: minimum (highest) value to which
345 console_loglevel can be set 374 console_loglevel can be set
diff --git a/Documentation/sysctl/net.txt b/Documentation/sysctl/net.txt
index cbd05ffc606b..3201a7097e4d 100644
--- a/Documentation/sysctl/net.txt
+++ b/Documentation/sysctl/net.txt
@@ -32,6 +32,17 @@ Table : Subdirectories in /proc/sys/net
321. /proc/sys/net/core - Network core options 321. /proc/sys/net/core - Network core options
33------------------------------------------------------- 33-------------------------------------------------------
34 34
35bpf_jit_enable
36--------------
37
38This enables Berkeley Packet Filter Just in Time compiler.
39Currently supported on x86_64 architecture, bpf_jit provides a framework
40to speed packet filtering, the one used by tcpdump/libpcap for example.
41Values :
42 0 - disable the JIT (default value)
43 1 - enable the JIT
44 2 - enable the JIT and ask the compiler to emit traces on kernel log.
45
35rmem_default 46rmem_default
36------------ 47------------
37 48
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index b606c2c4dd37..96f0ee825bed 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -80,8 +80,10 @@ dirty_background_bytes
80Contains the amount of dirty memory at which the pdflush background writeback 80Contains the amount of dirty memory at which the pdflush background writeback
81daemon will start writeback. 81daemon will start writeback.
82 82
83If dirty_background_bytes is written, dirty_background_ratio becomes a function 83Note: dirty_background_bytes is the counterpart of dirty_background_ratio. Only
84of its value (dirty_background_bytes / the amount of dirtyable system memory). 84one of them may be specified at a time. When one sysctl is written it is
85immediately taken into account to evaluate the dirty memory limits and the
86other appears as 0 when read.
85 87
86============================================================== 88==============================================================
87 89
@@ -97,8 +99,10 @@ dirty_bytes
97Contains the amount of dirty memory at which a process generating disk writes 99Contains the amount of dirty memory at which a process generating disk writes
98will itself start writeback. 100will itself start writeback.
99 101
100If dirty_bytes is written, dirty_ratio becomes a function of its value 102Note: dirty_bytes is the counterpart of dirty_ratio. Only one of them may be
101(dirty_bytes / the amount of dirtyable system memory). 103specified at a time. When one sysctl is written it is immediately taken into
104account to evaluate the dirty memory limits and the other appears as 0 when
105read.
102 106
103Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any 107Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any
104value lower than this limit will be ignored and the old configuration will be 108value lower than this limit will be ignored and the old configuration will be
@@ -477,10 +481,10 @@ the DMA zone.
477Type(A) is called as "Node" order. Type (B) is "Zone" order. 481Type(A) is called as "Node" order. Type (B) is "Zone" order.
478 482
479"Node order" orders the zonelists by node, then by zone within each node. 483"Node order" orders the zonelists by node, then by zone within each node.
480Specify "[Nn]ode" for zone order 484Specify "[Nn]ode" for node order
481 485
482"Zone Order" orders the zonelists by zone type, then by node within each 486"Zone Order" orders the zonelists by zone type, then by node within each
483zone. Specify "[Zz]one"for zode order. 487zone. Specify "[Zz]one" for zone order.
484 488
485Specify "[Dd]efault" to request automatic configuration. Autoconfiguration 489Specify "[Dd]efault" to request automatic configuration. Autoconfiguration
486will select "node" order in following case. 490will select "node" order in following case.
diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt
index 5c17196c8fe9..312e3754e8c5 100644
--- a/Documentation/sysrq.txt
+++ b/Documentation/sysrq.txt
@@ -75,7 +75,7 @@ On all - write a character to /proc/sysrq-trigger. e.g.:
75 75
76'f' - Will call oom_kill to kill a memory hog process. 76'f' - Will call oom_kill to kill a memory hog process.
77 77
78'g' - Used by kgdb on ppc and sh platforms. 78'g' - Used by kgdb (kernel debugger)
79 79
80'h' - Will display help (actually any other key than those listed 80'h' - Will display help (actually any other key than those listed
81 here will display help. but 'h' is easy to remember :-) 81 here will display help. but 'h' is easy to remember :-)
@@ -110,12 +110,15 @@ On all - write a character to /proc/sysrq-trigger. e.g.:
110 110
111'u' - Will attempt to remount all mounted filesystems read-only. 111'u' - Will attempt to remount all mounted filesystems read-only.
112 112
113'v' - Dumps Voyager SMP processor info to your console. 113'v' - Forcefully restores framebuffer console
114'v' - Causes ETM buffer dump [ARM-specific]
114 115
115'w' - Dumps tasks that are in uninterruptable (blocked) state. 116'w' - Dumps tasks that are in uninterruptable (blocked) state.
116 117
117'x' - Used by xmon interface on ppc/powerpc platforms. 118'x' - Used by xmon interface on ppc/powerpc platforms.
118 119
120'y' - Show global CPU Registers [SPARC-64 specific]
121
119'z' - Dump the ftrace buffer 122'z' - Dump the ftrace buffer
120 123
121'0'-'9' - Sets the console log level, controlling which kernel messages 124'0'-'9' - Sets the console log level, controlling which kernel messages
diff --git a/Documentation/target/tcm_mod_builder.py b/Documentation/target/tcm_mod_builder.py
new file mode 100755
index 000000000000..7ef9b843d529
--- /dev/null
+++ b/Documentation/target/tcm_mod_builder.py
@@ -0,0 +1,1094 @@
1#!/usr/bin/python
2# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
3#
4# Copyright (c) 2010 Rising Tide Systems
5# Copyright (c) 2010 Linux-iSCSI.org
6#
7# Author: nab@kernel.org
8#
9import os, sys
10import subprocess as sub
11import string
12import re
13import optparse
14
15tcm_dir = ""
16
17fabric_ops = []
18fabric_mod_dir = ""
19fabric_mod_port = ""
20fabric_mod_init_port = ""
21
22def tcm_mod_err(msg):
23 print msg
24 sys.exit(1)
25
26def tcm_mod_create_module_subdir(fabric_mod_dir_var):
27
28 if os.path.isdir(fabric_mod_dir_var) == True:
29 return 1
30
31 print "Creating fabric_mod_dir: " + fabric_mod_dir_var
32 ret = os.mkdir(fabric_mod_dir_var)
33 if ret:
34 tcm_mod_err("Unable to mkdir " + fabric_mod_dir_var)
35
36 return
37
38def tcm_mod_build_FC_include(fabric_mod_dir_var, fabric_mod_name):
39 global fabric_mod_port
40 global fabric_mod_init_port
41 buf = ""
42
43 f = fabric_mod_dir_var + "/" + fabric_mod_name + "_base.h"
44 print "Writing file: " + f
45
46 p = open(f, 'w');
47 if not p:
48 tcm_mod_err("Unable to open file: " + f)
49
50 buf = "#define " + fabric_mod_name.upper() + "_VERSION \"v0.1\"\n"
51 buf += "#define " + fabric_mod_name.upper() + "_NAMELEN 32\n"
52 buf += "\n"
53 buf += "struct " + fabric_mod_name + "_nacl {\n"
54 buf += " /* Binary World Wide unique Port Name for FC Initiator Nport */\n"
55 buf += " u64 nport_wwpn;\n"
56 buf += " /* ASCII formatted WWPN for FC Initiator Nport */\n"
57 buf += " char nport_name[" + fabric_mod_name.upper() + "_NAMELEN];\n"
58 buf += " /* Returned by " + fabric_mod_name + "_make_nodeacl() */\n"
59 buf += " struct se_node_acl se_node_acl;\n"
60 buf += "};\n"
61 buf += "\n"
62 buf += "struct " + fabric_mod_name + "_tpg {\n"
63 buf += " /* FC lport target portal group tag for TCM */\n"
64 buf += " u16 lport_tpgt;\n"
65 buf += " /* Pointer back to " + fabric_mod_name + "_lport */\n"
66 buf += " struct " + fabric_mod_name + "_lport *lport;\n"
67 buf += " /* Returned by " + fabric_mod_name + "_make_tpg() */\n"
68 buf += " struct se_portal_group se_tpg;\n"
69 buf += "};\n"
70 buf += "\n"
71 buf += "struct " + fabric_mod_name + "_lport {\n"
72 buf += " /* SCSI protocol the lport is providing */\n"
73 buf += " u8 lport_proto_id;\n"
74 buf += " /* Binary World Wide unique Port Name for FC Target Lport */\n"
75 buf += " u64 lport_wwpn;\n"
76 buf += " /* ASCII formatted WWPN for FC Target Lport */\n"
77 buf += " char lport_name[" + fabric_mod_name.upper() + "_NAMELEN];\n"
78 buf += " /* Returned by " + fabric_mod_name + "_make_lport() */\n"
79 buf += " struct se_wwn lport_wwn;\n"
80 buf += "};\n"
81
82 ret = p.write(buf)
83 if ret:
84 tcm_mod_err("Unable to write f: " + f)
85
86 p.close()
87
88 fabric_mod_port = "lport"
89 fabric_mod_init_port = "nport"
90
91 return
92
93def tcm_mod_build_SAS_include(fabric_mod_dir_var, fabric_mod_name):
94 global fabric_mod_port
95 global fabric_mod_init_port
96 buf = ""
97
98 f = fabric_mod_dir_var + "/" + fabric_mod_name + "_base.h"
99 print "Writing file: " + f
100
101 p = open(f, 'w');
102 if not p:
103 tcm_mod_err("Unable to open file: " + f)
104
105 buf = "#define " + fabric_mod_name.upper() + "_VERSION \"v0.1\"\n"
106 buf += "#define " + fabric_mod_name.upper() + "_NAMELEN 32\n"
107 buf += "\n"
108 buf += "struct " + fabric_mod_name + "_nacl {\n"
109 buf += " /* Binary World Wide unique Port Name for SAS Initiator port */\n"
110 buf += " u64 iport_wwpn;\n"
111 buf += " /* ASCII formatted WWPN for Sas Initiator port */\n"
112 buf += " char iport_name[" + fabric_mod_name.upper() + "_NAMELEN];\n"
113 buf += " /* Returned by " + fabric_mod_name + "_make_nodeacl() */\n"
114 buf += " struct se_node_acl se_node_acl;\n"
115 buf += "};\n\n"
116 buf += "struct " + fabric_mod_name + "_tpg {\n"
117 buf += " /* SAS port target portal group tag for TCM */\n"
118 buf += " u16 tport_tpgt;\n"
119 buf += " /* Pointer back to " + fabric_mod_name + "_tport */\n"
120 buf += " struct " + fabric_mod_name + "_tport *tport;\n"
121 buf += " /* Returned by " + fabric_mod_name + "_make_tpg() */\n"
122 buf += " struct se_portal_group se_tpg;\n"
123 buf += "};\n\n"
124 buf += "struct " + fabric_mod_name + "_tport {\n"
125 buf += " /* SCSI protocol the tport is providing */\n"
126 buf += " u8 tport_proto_id;\n"
127 buf += " /* Binary World Wide unique Port Name for SAS Target port */\n"
128 buf += " u64 tport_wwpn;\n"
129 buf += " /* ASCII formatted WWPN for SAS Target port */\n"
130 buf += " char tport_name[" + fabric_mod_name.upper() + "_NAMELEN];\n"
131 buf += " /* Returned by " + fabric_mod_name + "_make_tport() */\n"
132 buf += " struct se_wwn tport_wwn;\n"
133 buf += "};\n"
134
135 ret = p.write(buf)
136 if ret:
137 tcm_mod_err("Unable to write f: " + f)
138
139 p.close()
140
141 fabric_mod_port = "tport"
142 fabric_mod_init_port = "iport"
143
144 return
145
146def tcm_mod_build_iSCSI_include(fabric_mod_dir_var, fabric_mod_name):
147 global fabric_mod_port
148 global fabric_mod_init_port
149 buf = ""
150
151 f = fabric_mod_dir_var + "/" + fabric_mod_name + "_base.h"
152 print "Writing file: " + f
153
154 p = open(f, 'w');
155 if not p:
156 tcm_mod_err("Unable to open file: " + f)
157
158 buf = "#define " + fabric_mod_name.upper() + "_VERSION \"v0.1\"\n"
159 buf += "#define " + fabric_mod_name.upper() + "_NAMELEN 32\n"
160 buf += "\n"
161 buf += "struct " + fabric_mod_name + "_nacl {\n"
162 buf += " /* ASCII formatted InitiatorName */\n"
163 buf += " char iport_name[" + fabric_mod_name.upper() + "_NAMELEN];\n"
164 buf += " /* Returned by " + fabric_mod_name + "_make_nodeacl() */\n"
165 buf += " struct se_node_acl se_node_acl;\n"
166 buf += "};\n\n"
167 buf += "struct " + fabric_mod_name + "_tpg {\n"
168 buf += " /* iSCSI target portal group tag for TCM */\n"
169 buf += " u16 tport_tpgt;\n"
170 buf += " /* Pointer back to " + fabric_mod_name + "_tport */\n"
171 buf += " struct " + fabric_mod_name + "_tport *tport;\n"
172 buf += " /* Returned by " + fabric_mod_name + "_make_tpg() */\n"
173 buf += " struct se_portal_group se_tpg;\n"
174 buf += "};\n\n"
175 buf += "struct " + fabric_mod_name + "_tport {\n"
176 buf += " /* SCSI protocol the tport is providing */\n"
177 buf += " u8 tport_proto_id;\n"
178 buf += " /* ASCII formatted TargetName for IQN */\n"
179 buf += " char tport_name[" + fabric_mod_name.upper() + "_NAMELEN];\n"
180 buf += " /* Returned by " + fabric_mod_name + "_make_tport() */\n"
181 buf += " struct se_wwn tport_wwn;\n"
182 buf += "};\n"
183
184 ret = p.write(buf)
185 if ret:
186 tcm_mod_err("Unable to write f: " + f)
187
188 p.close()
189
190 fabric_mod_port = "tport"
191 fabric_mod_init_port = "iport"
192
193 return
194
195def tcm_mod_build_base_includes(proto_ident, fabric_mod_dir_val, fabric_mod_name):
196
197 if proto_ident == "FC":
198 tcm_mod_build_FC_include(fabric_mod_dir_val, fabric_mod_name)
199 elif proto_ident == "SAS":
200 tcm_mod_build_SAS_include(fabric_mod_dir_val, fabric_mod_name)
201 elif proto_ident == "iSCSI":
202 tcm_mod_build_iSCSI_include(fabric_mod_dir_val, fabric_mod_name)
203 else:
204 print "Unsupported proto_ident: " + proto_ident
205 sys.exit(1)
206
207 return
208
209def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
210 buf = ""
211
212 f = fabric_mod_dir_var + "/" + fabric_mod_name + "_configfs.c"
213 print "Writing file: " + f
214
215 p = open(f, 'w');
216 if not p:
217 tcm_mod_err("Unable to open file: " + f)
218
219 buf = "#include <linux/module.h>\n"
220 buf += "#include <linux/moduleparam.h>\n"
221 buf += "#include <linux/version.h>\n"
222 buf += "#include <generated/utsrelease.h>\n"
223 buf += "#include <linux/utsname.h>\n"
224 buf += "#include <linux/init.h>\n"
225 buf += "#include <linux/slab.h>\n"
226 buf += "#include <linux/kthread.h>\n"
227 buf += "#include <linux/types.h>\n"
228 buf += "#include <linux/string.h>\n"
229 buf += "#include <linux/configfs.h>\n"
230 buf += "#include <linux/ctype.h>\n"
231 buf += "#include <asm/unaligned.h>\n\n"
232 buf += "#include <target/target_core_base.h>\n"
233 buf += "#include <target/target_core_transport.h>\n"
234 buf += "#include <target/target_core_fabric_ops.h>\n"
235 buf += "#include <target/target_core_fabric_configfs.h>\n"
236 buf += "#include <target/target_core_fabric_lib.h>\n"
237 buf += "#include <target/target_core_device.h>\n"
238 buf += "#include <target/target_core_tpg.h>\n"
239 buf += "#include <target/target_core_configfs.h>\n"
240 buf += "#include <target/target_core_base.h>\n"
241 buf += "#include <target/configfs_macros.h>\n\n"
242 buf += "#include \"" + fabric_mod_name + "_base.h\"\n"
243 buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n"
244
245 buf += "/* Local pointer to allocated TCM configfs fabric module */\n"
246 buf += "struct target_fabric_configfs *" + fabric_mod_name + "_fabric_configfs;\n\n"
247
248 buf += "static struct se_node_acl *" + fabric_mod_name + "_make_nodeacl(\n"
249 buf += " struct se_portal_group *se_tpg,\n"
250 buf += " struct config_group *group,\n"
251 buf += " const char *name)\n"
252 buf += "{\n"
253 buf += " struct se_node_acl *se_nacl, *se_nacl_new;\n"
254 buf += " struct " + fabric_mod_name + "_nacl *nacl;\n"
255
256 if proto_ident == "FC" or proto_ident == "SAS":
257 buf += " u64 wwpn = 0;\n"
258
259 buf += " u32 nexus_depth;\n\n"
260 buf += " /* " + fabric_mod_name + "_parse_wwn(name, &wwpn, 1) < 0)\n"
261 buf += " return ERR_PTR(-EINVAL); */\n"
262 buf += " se_nacl_new = " + fabric_mod_name + "_alloc_fabric_acl(se_tpg);\n"
263 buf += " if (!(se_nacl_new))\n"
264 buf += " return ERR_PTR(-ENOMEM);\n"
265 buf += "//#warning FIXME: Hardcoded nexus depth in " + fabric_mod_name + "_make_nodeacl()\n"
266 buf += " nexus_depth = 1;\n"
267 buf += " /*\n"
268 buf += " * se_nacl_new may be released by core_tpg_add_initiator_node_acl()\n"
269 buf += " * when converting a NodeACL from demo mode -> explict\n"
270 buf += " */\n"
271 buf += " se_nacl = core_tpg_add_initiator_node_acl(se_tpg, se_nacl_new,\n"
272 buf += " name, nexus_depth);\n"
273 buf += " if (IS_ERR(se_nacl)) {\n"
274 buf += " " + fabric_mod_name + "_release_fabric_acl(se_tpg, se_nacl_new);\n"
275 buf += " return se_nacl;\n"
276 buf += " }\n"
277 buf += " /*\n"
278 buf += " * Locate our struct " + fabric_mod_name + "_nacl and set the FC Nport WWPN\n"
279 buf += " */\n"
280 buf += " nacl = container_of(se_nacl, struct " + fabric_mod_name + "_nacl, se_node_acl);\n"
281
282 if proto_ident == "FC" or proto_ident == "SAS":
283 buf += " nacl->" + fabric_mod_init_port + "_wwpn = wwpn;\n"
284
285 buf += " /* " + fabric_mod_name + "_format_wwn(&nacl->" + fabric_mod_init_port + "_name[0], " + fabric_mod_name.upper() + "_NAMELEN, wwpn); */\n\n"
286 buf += " return se_nacl;\n"
287 buf += "}\n\n"
288 buf += "static void " + fabric_mod_name + "_drop_nodeacl(struct se_node_acl *se_acl)\n"
289 buf += "{\n"
290 buf += " struct " + fabric_mod_name + "_nacl *nacl = container_of(se_acl,\n"
291 buf += " struct " + fabric_mod_name + "_nacl, se_node_acl);\n"
292 buf += " core_tpg_del_initiator_node_acl(se_acl->se_tpg, se_acl, 1);\n"
293 buf += " kfree(nacl);\n"
294 buf += "}\n\n"
295
296 buf += "static struct se_portal_group *" + fabric_mod_name + "_make_tpg(\n"
297 buf += " struct se_wwn *wwn,\n"
298 buf += " struct config_group *group,\n"
299 buf += " const char *name)\n"
300 buf += "{\n"
301 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + "*" + fabric_mod_port + " = container_of(wwn,\n"
302 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + ", " + fabric_mod_port + "_wwn);\n\n"
303 buf += " struct " + fabric_mod_name + "_tpg *tpg;\n"
304 buf += " unsigned long tpgt;\n"
305 buf += " int ret;\n\n"
306 buf += " if (strstr(name, \"tpgt_\") != name)\n"
307 buf += " return ERR_PTR(-EINVAL);\n"
308 buf += " if (strict_strtoul(name + 5, 10, &tpgt) || tpgt > UINT_MAX)\n"
309 buf += " return ERR_PTR(-EINVAL);\n\n"
310 buf += " tpg = kzalloc(sizeof(struct " + fabric_mod_name + "_tpg), GFP_KERNEL);\n"
311 buf += " if (!(tpg)) {\n"
312 buf += " printk(KERN_ERR \"Unable to allocate struct " + fabric_mod_name + "_tpg\");\n"
313 buf += " return ERR_PTR(-ENOMEM);\n"
314 buf += " }\n"
315 buf += " tpg->" + fabric_mod_port + " = " + fabric_mod_port + ";\n"
316 buf += " tpg->" + fabric_mod_port + "_tpgt = tpgt;\n\n"
317 buf += " ret = core_tpg_register(&" + fabric_mod_name + "_fabric_configfs->tf_ops, wwn,\n"
318 buf += " &tpg->se_tpg, (void *)tpg,\n"
319 buf += " TRANSPORT_TPG_TYPE_NORMAL);\n"
320 buf += " if (ret < 0) {\n"
321 buf += " kfree(tpg);\n"
322 buf += " return NULL;\n"
323 buf += " }\n"
324 buf += " return &tpg->se_tpg;\n"
325 buf += "}\n\n"
326 buf += "static void " + fabric_mod_name + "_drop_tpg(struct se_portal_group *se_tpg)\n"
327 buf += "{\n"
328 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n"
329 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n\n"
330 buf += " core_tpg_deregister(se_tpg);\n"
331 buf += " kfree(tpg);\n"
332 buf += "}\n\n"
333
334 buf += "static struct se_wwn *" + fabric_mod_name + "_make_" + fabric_mod_port + "(\n"
335 buf += " struct target_fabric_configfs *tf,\n"
336 buf += " struct config_group *group,\n"
337 buf += " const char *name)\n"
338 buf += "{\n"
339 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + ";\n"
340
341 if proto_ident == "FC" or proto_ident == "SAS":
342 buf += " u64 wwpn = 0;\n\n"
343
344 buf += " /* if (" + fabric_mod_name + "_parse_wwn(name, &wwpn, 1) < 0)\n"
345 buf += " return ERR_PTR(-EINVAL); */\n\n"
346 buf += " " + fabric_mod_port + " = kzalloc(sizeof(struct " + fabric_mod_name + "_" + fabric_mod_port + "), GFP_KERNEL);\n"
347 buf += " if (!(" + fabric_mod_port + ")) {\n"
348 buf += " printk(KERN_ERR \"Unable to allocate struct " + fabric_mod_name + "_" + fabric_mod_port + "\");\n"
349 buf += " return ERR_PTR(-ENOMEM);\n"
350 buf += " }\n"
351
352 if proto_ident == "FC" or proto_ident == "SAS":
353 buf += " " + fabric_mod_port + "->" + fabric_mod_port + "_wwpn = wwpn;\n"
354
355 buf += " /* " + fabric_mod_name + "_format_wwn(&" + fabric_mod_port + "->" + fabric_mod_port + "_name[0], " + fabric_mod_name.upper() + "__NAMELEN, wwpn); */\n\n"
356 buf += " return &" + fabric_mod_port + "->" + fabric_mod_port + "_wwn;\n"
357 buf += "}\n\n"
358 buf += "static void " + fabric_mod_name + "_drop_" + fabric_mod_port + "(struct se_wwn *wwn)\n"
359 buf += "{\n"
360 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = container_of(wwn,\n"
361 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + ", " + fabric_mod_port + "_wwn);\n"
362 buf += " kfree(" + fabric_mod_port + ");\n"
363 buf += "}\n\n"
364 buf += "static ssize_t " + fabric_mod_name + "_wwn_show_attr_version(\n"
365 buf += " struct target_fabric_configfs *tf,\n"
366 buf += " char *page)\n"
367 buf += "{\n"
368 buf += " return sprintf(page, \"" + fabric_mod_name.upper() + " fabric module %s on %s/%s\"\n"
369 buf += " \"on \"UTS_RELEASE\"\\n\", " + fabric_mod_name.upper() + "_VERSION, utsname()->sysname,\n"
370 buf += " utsname()->machine);\n"
371 buf += "}\n\n"
372 buf += "TF_WWN_ATTR_RO(" + fabric_mod_name + ", version);\n\n"
373 buf += "static struct configfs_attribute *" + fabric_mod_name + "_wwn_attrs[] = {\n"
374 buf += " &" + fabric_mod_name + "_wwn_version.attr,\n"
375 buf += " NULL,\n"
376 buf += "};\n\n"
377
378 buf += "static struct target_core_fabric_ops " + fabric_mod_name + "_ops = {\n"
379 buf += " .get_fabric_name = " + fabric_mod_name + "_get_fabric_name,\n"
380 buf += " .get_fabric_proto_ident = " + fabric_mod_name + "_get_fabric_proto_ident,\n"
381 buf += " .tpg_get_wwn = " + fabric_mod_name + "_get_fabric_wwn,\n"
382 buf += " .tpg_get_tag = " + fabric_mod_name + "_get_tag,\n"
383 buf += " .tpg_get_default_depth = " + fabric_mod_name + "_get_default_depth,\n"
384 buf += " .tpg_get_pr_transport_id = " + fabric_mod_name + "_get_pr_transport_id,\n"
385 buf += " .tpg_get_pr_transport_id_len = " + fabric_mod_name + "_get_pr_transport_id_len,\n"
386 buf += " .tpg_parse_pr_out_transport_id = " + fabric_mod_name + "_parse_pr_out_transport_id,\n"
387 buf += " .tpg_check_demo_mode = " + fabric_mod_name + "_check_false,\n"
388 buf += " .tpg_check_demo_mode_cache = " + fabric_mod_name + "_check_true,\n"
389 buf += " .tpg_check_demo_mode_write_protect = " + fabric_mod_name + "_check_true,\n"
390 buf += " .tpg_check_prod_mode_write_protect = " + fabric_mod_name + "_check_false,\n"
391 buf += " .tpg_alloc_fabric_acl = " + fabric_mod_name + "_alloc_fabric_acl,\n"
392 buf += " .tpg_release_fabric_acl = " + fabric_mod_name + "_release_fabric_acl,\n"
393 buf += " .tpg_get_inst_index = " + fabric_mod_name + "_tpg_get_inst_index,\n"
394 buf += " .release_cmd_to_pool = " + fabric_mod_name + "_release_cmd,\n"
395 buf += " .release_cmd_direct = " + fabric_mod_name + "_release_cmd,\n"
396 buf += " .shutdown_session = " + fabric_mod_name + "_shutdown_session,\n"
397 buf += " .close_session = " + fabric_mod_name + "_close_session,\n"
398 buf += " .stop_session = " + fabric_mod_name + "_stop_session,\n"
399 buf += " .fall_back_to_erl0 = " + fabric_mod_name + "_reset_nexus,\n"
400 buf += " .sess_logged_in = " + fabric_mod_name + "_sess_logged_in,\n"
401 buf += " .sess_get_index = " + fabric_mod_name + "_sess_get_index,\n"
402 buf += " .sess_get_initiator_sid = NULL,\n"
403 buf += " .write_pending = " + fabric_mod_name + "_write_pending,\n"
404 buf += " .write_pending_status = " + fabric_mod_name + "_write_pending_status,\n"
405 buf += " .set_default_node_attributes = " + fabric_mod_name + "_set_default_node_attrs,\n"
406 buf += " .get_task_tag = " + fabric_mod_name + "_get_task_tag,\n"
407 buf += " .get_cmd_state = " + fabric_mod_name + "_get_cmd_state,\n"
408 buf += " .new_cmd_failure = " + fabric_mod_name + "_new_cmd_failure,\n"
409 buf += " .queue_data_in = " + fabric_mod_name + "_queue_data_in,\n"
410 buf += " .queue_status = " + fabric_mod_name + "_queue_status,\n"
411 buf += " .queue_tm_rsp = " + fabric_mod_name + "_queue_tm_rsp,\n"
412 buf += " .get_fabric_sense_len = " + fabric_mod_name + "_get_fabric_sense_len,\n"
413 buf += " .set_fabric_sense_len = " + fabric_mod_name + "_set_fabric_sense_len,\n"
414 buf += " .is_state_remove = " + fabric_mod_name + "_is_state_remove,\n"
415 buf += " .pack_lun = " + fabric_mod_name + "_pack_lun,\n"
416 buf += " /*\n"
417 buf += " * Setup function pointers for generic logic in target_core_fabric_configfs.c\n"
418 buf += " */\n"
419 buf += " .fabric_make_wwn = " + fabric_mod_name + "_make_" + fabric_mod_port + ",\n"
420 buf += " .fabric_drop_wwn = " + fabric_mod_name + "_drop_" + fabric_mod_port + ",\n"
421 buf += " .fabric_make_tpg = " + fabric_mod_name + "_make_tpg,\n"
422 buf += " .fabric_drop_tpg = " + fabric_mod_name + "_drop_tpg,\n"
423 buf += " .fabric_post_link = NULL,\n"
424 buf += " .fabric_pre_unlink = NULL,\n"
425 buf += " .fabric_make_np = NULL,\n"
426 buf += " .fabric_drop_np = NULL,\n"
427 buf += " .fabric_make_nodeacl = " + fabric_mod_name + "_make_nodeacl,\n"
428 buf += " .fabric_drop_nodeacl = " + fabric_mod_name + "_drop_nodeacl,\n"
429 buf += "};\n\n"
430
431 buf += "static int " + fabric_mod_name + "_register_configfs(void)\n"
432 buf += "{\n"
433 buf += " struct target_fabric_configfs *fabric;\n"
434 buf += " int ret;\n\n"
435 buf += " printk(KERN_INFO \"" + fabric_mod_name.upper() + " fabric module %s on %s/%s\"\n"
436 buf += " \" on \"UTS_RELEASE\"\\n\"," + fabric_mod_name.upper() + "_VERSION, utsname()->sysname,\n"
437 buf += " utsname()->machine);\n"
438 buf += " /*\n"
439 buf += " * Register the top level struct config_item_type with TCM core\n"
440 buf += " */\n"
441 buf += " fabric = target_fabric_configfs_init(THIS_MODULE, \"" + fabric_mod_name[4:] + "\");\n"
442 buf += " if (!(fabric)) {\n"
443 buf += " printk(KERN_ERR \"target_fabric_configfs_init() failed\\n\");\n"
444 buf += " return -ENOMEM;\n"
445 buf += " }\n"
446 buf += " /*\n"
447 buf += " * Setup fabric->tf_ops from our local " + fabric_mod_name + "_ops\n"
448 buf += " */\n"
449 buf += " fabric->tf_ops = " + fabric_mod_name + "_ops;\n"
450 buf += " /*\n"
451 buf += " * Setup default attribute lists for various fabric->tf_cit_tmpl\n"
452 buf += " */\n"
453 buf += " TF_CIT_TMPL(fabric)->tfc_wwn_cit.ct_attrs = " + fabric_mod_name + "_wwn_attrs;\n"
454 buf += " TF_CIT_TMPL(fabric)->tfc_tpg_base_cit.ct_attrs = NULL;\n"
455 buf += " TF_CIT_TMPL(fabric)->tfc_tpg_attrib_cit.ct_attrs = NULL;\n"
456 buf += " TF_CIT_TMPL(fabric)->tfc_tpg_param_cit.ct_attrs = NULL;\n"
457 buf += " TF_CIT_TMPL(fabric)->tfc_tpg_np_base_cit.ct_attrs = NULL;\n"
458 buf += " TF_CIT_TMPL(fabric)->tfc_tpg_nacl_base_cit.ct_attrs = NULL;\n"
459 buf += " TF_CIT_TMPL(fabric)->tfc_tpg_nacl_attrib_cit.ct_attrs = NULL;\n"
460 buf += " TF_CIT_TMPL(fabric)->tfc_tpg_nacl_auth_cit.ct_attrs = NULL;\n"
461 buf += " TF_CIT_TMPL(fabric)->tfc_tpg_nacl_param_cit.ct_attrs = NULL;\n"
462 buf += " /*\n"
463 buf += " * Register the fabric for use within TCM\n"
464 buf += " */\n"
465 buf += " ret = target_fabric_configfs_register(fabric);\n"
466 buf += " if (ret < 0) {\n"
467 buf += " printk(KERN_ERR \"target_fabric_configfs_register() failed\"\n"
468 buf += " \" for " + fabric_mod_name.upper() + "\\n\");\n"
469 buf += " return ret;\n"
470 buf += " }\n"
471 buf += " /*\n"
472 buf += " * Setup our local pointer to *fabric\n"
473 buf += " */\n"
474 buf += " " + fabric_mod_name + "_fabric_configfs = fabric;\n"
475 buf += " printk(KERN_INFO \"" + fabric_mod_name.upper() + "[0] - Set fabric -> " + fabric_mod_name + "_fabric_configfs\\n\");\n"
476 buf += " return 0;\n"
477 buf += "};\n\n"
478 buf += "static void " + fabric_mod_name + "_deregister_configfs(void)\n"
479 buf += "{\n"
480 buf += " if (!(" + fabric_mod_name + "_fabric_configfs))\n"
481 buf += " return;\n\n"
482 buf += " target_fabric_configfs_deregister(" + fabric_mod_name + "_fabric_configfs);\n"
483 buf += " " + fabric_mod_name + "_fabric_configfs = NULL;\n"
484 buf += " printk(KERN_INFO \"" + fabric_mod_name.upper() + "[0] - Cleared " + fabric_mod_name + "_fabric_configfs\\n\");\n"
485 buf += "};\n\n"
486
487 buf += "static int __init " + fabric_mod_name + "_init(void)\n"
488 buf += "{\n"
489 buf += " int ret;\n\n"
490 buf += " ret = " + fabric_mod_name + "_register_configfs();\n"
491 buf += " if (ret < 0)\n"
492 buf += " return ret;\n\n"
493 buf += " return 0;\n"
494 buf += "};\n\n"
495 buf += "static void " + fabric_mod_name + "_exit(void)\n"
496 buf += "{\n"
497 buf += " " + fabric_mod_name + "_deregister_configfs();\n"
498 buf += "};\n\n"
499
500 buf += "#ifdef MODULE\n"
501 buf += "MODULE_DESCRIPTION(\"" + fabric_mod_name.upper() + " series fabric driver\");\n"
502 buf += "MODULE_LICENSE(\"GPL\");\n"
503 buf += "module_init(" + fabric_mod_name + "_init);\n"
504 buf += "module_exit(" + fabric_mod_name + "_exit);\n"
505 buf += "#endif\n"
506
507 ret = p.write(buf)
508 if ret:
509 tcm_mod_err("Unable to write f: " + f)
510
511 p.close()
512
513 return
514
515def tcm_mod_scan_fabric_ops(tcm_dir):
516
517 fabric_ops_api = tcm_dir + "include/target/target_core_fabric_ops.h"
518
519 print "Using tcm_mod_scan_fabric_ops: " + fabric_ops_api
520 process_fo = 0;
521
522 p = open(fabric_ops_api, 'r')
523
524 line = p.readline()
525 while line:
526 if process_fo == 0 and re.search('struct target_core_fabric_ops {', line):
527 line = p.readline()
528 continue
529
530 if process_fo == 0:
531 process_fo = 1;
532 line = p.readline()
533 # Search for function pointer
534 if not re.search('\(\*', line):
535 continue
536
537 fabric_ops.append(line.rstrip())
538 continue
539
540 line = p.readline()
541 # Search for function pointer
542 if not re.search('\(\*', line):
543 continue
544
545 fabric_ops.append(line.rstrip())
546
547 p.close()
548 return
549
550def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
551 buf = ""
552 bufi = ""
553
554 f = fabric_mod_dir_var + "/" + fabric_mod_name + "_fabric.c"
555 print "Writing file: " + f
556
557 p = open(f, 'w')
558 if not p:
559 tcm_mod_err("Unable to open file: " + f)
560
561 fi = fabric_mod_dir_var + "/" + fabric_mod_name + "_fabric.h"
562 print "Writing file: " + fi
563
564 pi = open(fi, 'w')
565 if not pi:
566 tcm_mod_err("Unable to open file: " + fi)
567
568 buf = "#include <linux/slab.h>\n"
569 buf += "#include <linux/kthread.h>\n"
570 buf += "#include <linux/types.h>\n"
571 buf += "#include <linux/list.h>\n"
572 buf += "#include <linux/types.h>\n"
573 buf += "#include <linux/string.h>\n"
574 buf += "#include <linux/ctype.h>\n"
575 buf += "#include <asm/unaligned.h>\n"
576 buf += "#include <scsi/scsi.h>\n"
577 buf += "#include <scsi/scsi_host.h>\n"
578 buf += "#include <scsi/scsi_device.h>\n"
579 buf += "#include <scsi/scsi_cmnd.h>\n"
580 buf += "#include <scsi/libfc.h>\n\n"
581 buf += "#include <target/target_core_base.h>\n"
582 buf += "#include <target/target_core_transport.h>\n"
583 buf += "#include <target/target_core_fabric_ops.h>\n"
584 buf += "#include <target/target_core_fabric_lib.h>\n"
585 buf += "#include <target/target_core_device.h>\n"
586 buf += "#include <target/target_core_tpg.h>\n"
587 buf += "#include <target/target_core_configfs.h>\n\n"
588 buf += "#include \"" + fabric_mod_name + "_base.h\"\n"
589 buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n"
590
591 buf += "int " + fabric_mod_name + "_check_true(struct se_portal_group *se_tpg)\n"
592 buf += "{\n"
593 buf += " return 1;\n"
594 buf += "}\n\n"
595 bufi += "int " + fabric_mod_name + "_check_true(struct se_portal_group *);\n"
596
597 buf += "int " + fabric_mod_name + "_check_false(struct se_portal_group *se_tpg)\n"
598 buf += "{\n"
599 buf += " return 0;\n"
600 buf += "}\n\n"
601 bufi += "int " + fabric_mod_name + "_check_false(struct se_portal_group *);\n"
602
603 total_fabric_ops = len(fabric_ops)
604 i = 0
605
606 while i < total_fabric_ops:
607 fo = fabric_ops[i]
608 i += 1
609# print "fabric_ops: " + fo
610
611 if re.search('get_fabric_name', fo):
612 buf += "char *" + fabric_mod_name + "_get_fabric_name(void)\n"
613 buf += "{\n"
614 buf += " return \"" + fabric_mod_name[4:] + "\";\n"
615 buf += "}\n\n"
616 bufi += "char *" + fabric_mod_name + "_get_fabric_name(void);\n"
617 continue
618
619 if re.search('get_fabric_proto_ident', fo):
620 buf += "u8 " + fabric_mod_name + "_get_fabric_proto_ident(struct se_portal_group *se_tpg)\n"
621 buf += "{\n"
622 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n"
623 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n"
624 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n"
625 buf += " u8 proto_id;\n\n"
626 buf += " switch (" + fabric_mod_port + "->" + fabric_mod_port + "_proto_id) {\n"
627 if proto_ident == "FC":
628 buf += " case SCSI_PROTOCOL_FCP:\n"
629 buf += " default:\n"
630 buf += " proto_id = fc_get_fabric_proto_ident(se_tpg);\n"
631 buf += " break;\n"
632 elif proto_ident == "SAS":
633 buf += " case SCSI_PROTOCOL_SAS:\n"
634 buf += " default:\n"
635 buf += " proto_id = sas_get_fabric_proto_ident(se_tpg);\n"
636 buf += " break;\n"
637 elif proto_ident == "iSCSI":
638 buf += " case SCSI_PROTOCOL_ISCSI:\n"
639 buf += " default:\n"
640 buf += " proto_id = iscsi_get_fabric_proto_ident(se_tpg);\n"
641 buf += " break;\n"
642
643 buf += " }\n\n"
644 buf += " return proto_id;\n"
645 buf += "}\n\n"
646 bufi += "u8 " + fabric_mod_name + "_get_fabric_proto_ident(struct se_portal_group *);\n"
647
648 if re.search('get_wwn', fo):
649 buf += "char *" + fabric_mod_name + "_get_fabric_wwn(struct se_portal_group *se_tpg)\n"
650 buf += "{\n"
651 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n"
652 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n"
653 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n\n"
654 buf += " return &" + fabric_mod_port + "->" + fabric_mod_port + "_name[0];\n"
655 buf += "}\n\n"
656 bufi += "char *" + fabric_mod_name + "_get_fabric_wwn(struct se_portal_group *);\n"
657
658 if re.search('get_tag', fo):
659 buf += "u16 " + fabric_mod_name + "_get_tag(struct se_portal_group *se_tpg)\n"
660 buf += "{\n"
661 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n"
662 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n"
663 buf += " return tpg->" + fabric_mod_port + "_tpgt;\n"
664 buf += "}\n\n"
665 bufi += "u16 " + fabric_mod_name + "_get_tag(struct se_portal_group *);\n"
666
667 if re.search('get_default_depth', fo):
668 buf += "u32 " + fabric_mod_name + "_get_default_depth(struct se_portal_group *se_tpg)\n"
669 buf += "{\n"
670 buf += " return 1;\n"
671 buf += "}\n\n"
672 bufi += "u32 " + fabric_mod_name + "_get_default_depth(struct se_portal_group *);\n"
673
674 if re.search('get_pr_transport_id\)\(', fo):
675 buf += "u32 " + fabric_mod_name + "_get_pr_transport_id(\n"
676 buf += " struct se_portal_group *se_tpg,\n"
677 buf += " struct se_node_acl *se_nacl,\n"
678 buf += " struct t10_pr_registration *pr_reg,\n"
679 buf += " int *format_code,\n"
680 buf += " unsigned char *buf)\n"
681 buf += "{\n"
682 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n"
683 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n"
684 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n"
685 buf += " int ret = 0;\n\n"
686 buf += " switch (" + fabric_mod_port + "->" + fabric_mod_port + "_proto_id) {\n"
687 if proto_ident == "FC":
688 buf += " case SCSI_PROTOCOL_FCP:\n"
689 buf += " default:\n"
690 buf += " ret = fc_get_pr_transport_id(se_tpg, se_nacl, pr_reg,\n"
691 buf += " format_code, buf);\n"
692 buf += " break;\n"
693 elif proto_ident == "SAS":
694 buf += " case SCSI_PROTOCOL_SAS:\n"
695 buf += " default:\n"
696 buf += " ret = sas_get_pr_transport_id(se_tpg, se_nacl, pr_reg,\n"
697 buf += " format_code, buf);\n"
698 buf += " break;\n"
699 elif proto_ident == "iSCSI":
700 buf += " case SCSI_PROTOCOL_ISCSI:\n"
701 buf += " default:\n"
702 buf += " ret = iscsi_get_pr_transport_id(se_tpg, se_nacl, pr_reg,\n"
703 buf += " format_code, buf);\n"
704 buf += " break;\n"
705
706 buf += " }\n\n"
707 buf += " return ret;\n"
708 buf += "}\n\n"
709 bufi += "u32 " + fabric_mod_name + "_get_pr_transport_id(struct se_portal_group *,\n"
710 bufi += " struct se_node_acl *, struct t10_pr_registration *,\n"
711 bufi += " int *, unsigned char *);\n"
712
713 if re.search('get_pr_transport_id_len\)\(', fo):
714 buf += "u32 " + fabric_mod_name + "_get_pr_transport_id_len(\n"
715 buf += " struct se_portal_group *se_tpg,\n"
716 buf += " struct se_node_acl *se_nacl,\n"
717 buf += " struct t10_pr_registration *pr_reg,\n"
718 buf += " int *format_code)\n"
719 buf += "{\n"
720 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n"
721 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n"
722 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n"
723 buf += " int ret = 0;\n\n"
724 buf += " switch (" + fabric_mod_port + "->" + fabric_mod_port + "_proto_id) {\n"
725 if proto_ident == "FC":
726 buf += " case SCSI_PROTOCOL_FCP:\n"
727 buf += " default:\n"
728 buf += " ret = fc_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg,\n"
729 buf += " format_code);\n"
730 buf += " break;\n"
731 elif proto_ident == "SAS":
732 buf += " case SCSI_PROTOCOL_SAS:\n"
733 buf += " default:\n"
734 buf += " ret = sas_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg,\n"
735 buf += " format_code);\n"
736 buf += " break;\n"
737 elif proto_ident == "iSCSI":
738 buf += " case SCSI_PROTOCOL_ISCSI:\n"
739 buf += " default:\n"
740 buf += " ret = iscsi_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg,\n"
741 buf += " format_code);\n"
742 buf += " break;\n"
743
744
745 buf += " }\n\n"
746 buf += " return ret;\n"
747 buf += "}\n\n"
748 bufi += "u32 " + fabric_mod_name + "_get_pr_transport_id_len(struct se_portal_group *,\n"
749 bufi += " struct se_node_acl *, struct t10_pr_registration *,\n"
750 bufi += " int *);\n"
751
752 if re.search('parse_pr_out_transport_id\)\(', fo):
753 buf += "char *" + fabric_mod_name + "_parse_pr_out_transport_id(\n"
754 buf += " struct se_portal_group *se_tpg,\n"
755 buf += " const char *buf,\n"
756 buf += " u32 *out_tid_len,\n"
757 buf += " char **port_nexus_ptr)\n"
758 buf += "{\n"
759 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n"
760 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n"
761 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n"
762 buf += " char *tid = NULL;\n\n"
763 buf += " switch (" + fabric_mod_port + "->" + fabric_mod_port + "_proto_id) {\n"
764 if proto_ident == "FC":
765 buf += " case SCSI_PROTOCOL_FCP:\n"
766 buf += " default:\n"
767 buf += " tid = fc_parse_pr_out_transport_id(se_tpg, buf, out_tid_len,\n"
768 buf += " port_nexus_ptr);\n"
769 elif proto_ident == "SAS":
770 buf += " case SCSI_PROTOCOL_SAS:\n"
771 buf += " default:\n"
772 buf += " tid = sas_parse_pr_out_transport_id(se_tpg, buf, out_tid_len,\n"
773 buf += " port_nexus_ptr);\n"
774 elif proto_ident == "iSCSI":
775 buf += " case SCSI_PROTOCOL_ISCSI:\n"
776 buf += " default:\n"
777 buf += " tid = iscsi_parse_pr_out_transport_id(se_tpg, buf, out_tid_len,\n"
778 buf += " port_nexus_ptr);\n"
779
780 buf += " }\n\n"
781 buf += " return tid;\n"
782 buf += "}\n\n"
783 bufi += "char *" + fabric_mod_name + "_parse_pr_out_transport_id(struct se_portal_group *,\n"
784 bufi += " const char *, u32 *, char **);\n"
785
786 if re.search('alloc_fabric_acl\)\(', fo):
787 buf += "struct se_node_acl *" + fabric_mod_name + "_alloc_fabric_acl(struct se_portal_group *se_tpg)\n"
788 buf += "{\n"
789 buf += " struct " + fabric_mod_name + "_nacl *nacl;\n\n"
790 buf += " nacl = kzalloc(sizeof(struct " + fabric_mod_name + "_nacl), GFP_KERNEL);\n"
791 buf += " if (!(nacl)) {\n"
792 buf += " printk(KERN_ERR \"Unable to alocate struct " + fabric_mod_name + "_nacl\\n\");\n"
793 buf += " return NULL;\n"
794 buf += " }\n\n"
795 buf += " return &nacl->se_node_acl;\n"
796 buf += "}\n\n"
797 bufi += "struct se_node_acl *" + fabric_mod_name + "_alloc_fabric_acl(struct se_portal_group *);\n"
798
799 if re.search('release_fabric_acl\)\(', fo):
800 buf += "void " + fabric_mod_name + "_release_fabric_acl(\n"
801 buf += " struct se_portal_group *se_tpg,\n"
802 buf += " struct se_node_acl *se_nacl)\n"
803 buf += "{\n"
804 buf += " struct " + fabric_mod_name + "_nacl *nacl = container_of(se_nacl,\n"
805 buf += " struct " + fabric_mod_name + "_nacl, se_node_acl);\n"
806 buf += " kfree(nacl);\n"
807 buf += "}\n\n"
808 bufi += "void " + fabric_mod_name + "_release_fabric_acl(struct se_portal_group *,\n"
809 bufi += " struct se_node_acl *);\n"
810
811 if re.search('tpg_get_inst_index\)\(', fo):
812 buf += "u32 " + fabric_mod_name + "_tpg_get_inst_index(struct se_portal_group *se_tpg)\n"
813 buf += "{\n"
814 buf += " return 1;\n"
815 buf += "}\n\n"
816 bufi += "u32 " + fabric_mod_name + "_tpg_get_inst_index(struct se_portal_group *);\n"
817
818 if re.search('release_cmd_to_pool', fo):
819 buf += "void " + fabric_mod_name + "_release_cmd(struct se_cmd *se_cmd)\n"
820 buf += "{\n"
821 buf += " return;\n"
822 buf += "}\n\n"
823 bufi += "void " + fabric_mod_name + "_release_cmd(struct se_cmd *);\n"
824
825 if re.search('shutdown_session\)\(', fo):
826 buf += "int " + fabric_mod_name + "_shutdown_session(struct se_session *se_sess)\n"
827 buf += "{\n"
828 buf += " return 0;\n"
829 buf += "}\n\n"
830 bufi += "int " + fabric_mod_name + "_shutdown_session(struct se_session *);\n"
831
832 if re.search('close_session\)\(', fo):
833 buf += "void " + fabric_mod_name + "_close_session(struct se_session *se_sess)\n"
834 buf += "{\n"
835 buf += " return;\n"
836 buf += "}\n\n"
837 bufi += "void " + fabric_mod_name + "_close_session(struct se_session *);\n"
838
839 if re.search('stop_session\)\(', fo):
840 buf += "void " + fabric_mod_name + "_stop_session(struct se_session *se_sess, int sess_sleep , int conn_sleep)\n"
841 buf += "{\n"
842 buf += " return;\n"
843 buf += "}\n\n"
844 bufi += "void " + fabric_mod_name + "_stop_session(struct se_session *, int, int);\n"
845
846 if re.search('fall_back_to_erl0\)\(', fo):
847 buf += "void " + fabric_mod_name + "_reset_nexus(struct se_session *se_sess)\n"
848 buf += "{\n"
849 buf += " return;\n"
850 buf += "}\n\n"
851 bufi += "void " + fabric_mod_name + "_reset_nexus(struct se_session *);\n"
852
853 if re.search('sess_logged_in\)\(', fo):
854 buf += "int " + fabric_mod_name + "_sess_logged_in(struct se_session *se_sess)\n"
855 buf += "{\n"
856 buf += " return 0;\n"
857 buf += "}\n\n"
858 bufi += "int " + fabric_mod_name + "_sess_logged_in(struct se_session *);\n"
859
860 if re.search('sess_get_index\)\(', fo):
861 buf += "u32 " + fabric_mod_name + "_sess_get_index(struct se_session *se_sess)\n"
862 buf += "{\n"
863 buf += " return 0;\n"
864 buf += "}\n\n"
865 bufi += "u32 " + fabric_mod_name + "_sess_get_index(struct se_session *);\n"
866
867 if re.search('write_pending\)\(', fo):
868 buf += "int " + fabric_mod_name + "_write_pending(struct se_cmd *se_cmd)\n"
869 buf += "{\n"
870 buf += " return 0;\n"
871 buf += "}\n\n"
872 bufi += "int " + fabric_mod_name + "_write_pending(struct se_cmd *);\n"
873
874 if re.search('write_pending_status\)\(', fo):
875 buf += "int " + fabric_mod_name + "_write_pending_status(struct se_cmd *se_cmd)\n"
876 buf += "{\n"
877 buf += " return 0;\n"
878 buf += "}\n\n"
879 bufi += "int " + fabric_mod_name + "_write_pending_status(struct se_cmd *);\n"
880
881 if re.search('set_default_node_attributes\)\(', fo):
882 buf += "void " + fabric_mod_name + "_set_default_node_attrs(struct se_node_acl *nacl)\n"
883 buf += "{\n"
884 buf += " return;\n"
885 buf += "}\n\n"
886 bufi += "void " + fabric_mod_name + "_set_default_node_attrs(struct se_node_acl *);\n"
887
888 if re.search('get_task_tag\)\(', fo):
889 buf += "u32 " + fabric_mod_name + "_get_task_tag(struct se_cmd *se_cmd)\n"
890 buf += "{\n"
891 buf += " return 0;\n"
892 buf += "}\n\n"
893 bufi += "u32 " + fabric_mod_name + "_get_task_tag(struct se_cmd *);\n"
894
895 if re.search('get_cmd_state\)\(', fo):
896 buf += "int " + fabric_mod_name + "_get_cmd_state(struct se_cmd *se_cmd)\n"
897 buf += "{\n"
898 buf += " return 0;\n"
899 buf += "}\n\n"
900 bufi += "int " + fabric_mod_name + "_get_cmd_state(struct se_cmd *);\n"
901
902 if re.search('new_cmd_failure\)\(', fo):
903 buf += "void " + fabric_mod_name + "_new_cmd_failure(struct se_cmd *se_cmd)\n"
904 buf += "{\n"
905 buf += " return;\n"
906 buf += "}\n\n"
907 bufi += "void " + fabric_mod_name + "_new_cmd_failure(struct se_cmd *);\n"
908
909 if re.search('queue_data_in\)\(', fo):
910 buf += "int " + fabric_mod_name + "_queue_data_in(struct se_cmd *se_cmd)\n"
911 buf += "{\n"
912 buf += " return 0;\n"
913 buf += "}\n\n"
914 bufi += "int " + fabric_mod_name + "_queue_data_in(struct se_cmd *);\n"
915
916 if re.search('queue_status\)\(', fo):
917 buf += "int " + fabric_mod_name + "_queue_status(struct se_cmd *se_cmd)\n"
918 buf += "{\n"
919 buf += " return 0;\n"
920 buf += "}\n\n"
921 bufi += "int " + fabric_mod_name + "_queue_status(struct se_cmd *);\n"
922
923 if re.search('queue_tm_rsp\)\(', fo):
924 buf += "int " + fabric_mod_name + "_queue_tm_rsp(struct se_cmd *se_cmd)\n"
925 buf += "{\n"
926 buf += " return 0;\n"
927 buf += "}\n\n"
928 bufi += "int " + fabric_mod_name + "_queue_tm_rsp(struct se_cmd *);\n"
929
930 if re.search('get_fabric_sense_len\)\(', fo):
931 buf += "u16 " + fabric_mod_name + "_get_fabric_sense_len(void)\n"
932 buf += "{\n"
933 buf += " return 0;\n"
934 buf += "}\n\n"
935 bufi += "u16 " + fabric_mod_name + "_get_fabric_sense_len(void);\n"
936
937 if re.search('set_fabric_sense_len\)\(', fo):
938 buf += "u16 " + fabric_mod_name + "_set_fabric_sense_len(struct se_cmd *se_cmd, u32 sense_length)\n"
939 buf += "{\n"
940 buf += " return 0;\n"
941 buf += "}\n\n"
942 bufi += "u16 " + fabric_mod_name + "_set_fabric_sense_len(struct se_cmd *, u32);\n"
943
944 if re.search('is_state_remove\)\(', fo):
945 buf += "int " + fabric_mod_name + "_is_state_remove(struct se_cmd *se_cmd)\n"
946 buf += "{\n"
947 buf += " return 0;\n"
948 buf += "}\n\n"
949 bufi += "int " + fabric_mod_name + "_is_state_remove(struct se_cmd *);\n"
950
951 if re.search('pack_lun\)\(', fo):
952 buf += "u64 " + fabric_mod_name + "_pack_lun(unsigned int lun)\n"
953 buf += "{\n"
954 buf += " WARN_ON(lun >= 256);\n"
955 buf += " /* Caller wants this byte-swapped */\n"
956 buf += " return cpu_to_le64((lun & 0xff) << 8);\n"
957 buf += "}\n\n"
958 bufi += "u64 " + fabric_mod_name + "_pack_lun(unsigned int);\n"
959
960
961 ret = p.write(buf)
962 if ret:
963 tcm_mod_err("Unable to write f: " + f)
964
965 p.close()
966
967 ret = pi.write(bufi)
968 if ret:
969 tcm_mod_err("Unable to write fi: " + fi)
970
971 pi.close()
972 return
973
974def tcm_mod_build_kbuild(fabric_mod_dir_var, fabric_mod_name):
975
976 buf = ""
977 f = fabric_mod_dir_var + "/Makefile"
978 print "Writing file: " + f
979
980 p = open(f, 'w')
981 if not p:
982 tcm_mod_err("Unable to open file: " + f)
983
984 buf += fabric_mod_name + "-objs := " + fabric_mod_name + "_fabric.o \\\n"
985 buf += " " + fabric_mod_name + "_configfs.o\n"
986 buf += "obj-$(CONFIG_" + fabric_mod_name.upper() + ") += " + fabric_mod_name + ".o\n"
987
988 ret = p.write(buf)
989 if ret:
990 tcm_mod_err("Unable to write f: " + f)
991
992 p.close()
993 return
994
995def tcm_mod_build_kconfig(fabric_mod_dir_var, fabric_mod_name):
996
997 buf = ""
998 f = fabric_mod_dir_var + "/Kconfig"
999 print "Writing file: " + f
1000
1001 p = open(f, 'w')
1002 if not p:
1003 tcm_mod_err("Unable to open file: " + f)
1004
1005 buf = "config " + fabric_mod_name.upper() + "\n"
1006 buf += " tristate \"" + fabric_mod_name.upper() + " fabric module\"\n"
1007 buf += " depends on TARGET_CORE && CONFIGFS_FS\n"
1008 buf += " default n\n"
1009 buf += " ---help---\n"
1010 buf += " Say Y here to enable the " + fabric_mod_name.upper() + " fabric module\n"
1011
1012 ret = p.write(buf)
1013 if ret:
1014 tcm_mod_err("Unable to write f: " + f)
1015
1016 p.close()
1017 return
1018
1019def tcm_mod_add_kbuild(tcm_dir, fabric_mod_name):
1020 buf = "obj-$(CONFIG_" + fabric_mod_name.upper() + ") += " + fabric_mod_name.lower() + "/\n"
1021 kbuild = tcm_dir + "/drivers/target/Makefile"
1022
1023 f = open(kbuild, 'a')
1024 f.write(buf)
1025 f.close()
1026 return
1027
1028def tcm_mod_add_kconfig(tcm_dir, fabric_mod_name):
1029 buf = "source \"drivers/target/" + fabric_mod_name.lower() + "/Kconfig\"\n"
1030 kconfig = tcm_dir + "/drivers/target/Kconfig"
1031
1032 f = open(kconfig, 'a')
1033 f.write(buf)
1034 f.close()
1035 return
1036
1037def main(modname, proto_ident):
1038# proto_ident = "FC"
1039# proto_ident = "SAS"
1040# proto_ident = "iSCSI"
1041
1042 tcm_dir = os.getcwd();
1043 tcm_dir += "/../../"
1044 print "tcm_dir: " + tcm_dir
1045 fabric_mod_name = modname
1046 fabric_mod_dir = tcm_dir + "drivers/target/" + fabric_mod_name
1047 print "Set fabric_mod_name: " + fabric_mod_name
1048 print "Set fabric_mod_dir: " + fabric_mod_dir
1049 print "Using proto_ident: " + proto_ident
1050
1051 if proto_ident != "FC" and proto_ident != "SAS" and proto_ident != "iSCSI":
1052 print "Unsupported proto_ident: " + proto_ident
1053 sys.exit(1)
1054
1055 ret = tcm_mod_create_module_subdir(fabric_mod_dir)
1056 if ret:
1057 print "tcm_mod_create_module_subdir() failed because module already exists!"
1058 sys.exit(1)
1059
1060 tcm_mod_build_base_includes(proto_ident, fabric_mod_dir, fabric_mod_name)
1061 tcm_mod_scan_fabric_ops(tcm_dir)
1062 tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir, fabric_mod_name)
1063 tcm_mod_build_configfs(proto_ident, fabric_mod_dir, fabric_mod_name)
1064 tcm_mod_build_kbuild(fabric_mod_dir, fabric_mod_name)
1065 tcm_mod_build_kconfig(fabric_mod_dir, fabric_mod_name)
1066
1067 input = raw_input("Would you like to add " + fabric_mod_name + "to drivers/target/Makefile..? [yes,no]: ")
1068 if input == "yes" or input == "y":
1069 tcm_mod_add_kbuild(tcm_dir, fabric_mod_name)
1070
1071 input = raw_input("Would you like to add " + fabric_mod_name + "to drivers/target/Kconfig..? [yes,no]: ")
1072 if input == "yes" or input == "y":
1073 tcm_mod_add_kconfig(tcm_dir, fabric_mod_name)
1074
1075 return
1076
1077parser = optparse.OptionParser()
1078parser.add_option('-m', '--modulename', help='Module name', dest='modname',
1079 action='store', nargs=1, type='string')
1080parser.add_option('-p', '--protoident', help='Protocol Ident', dest='protoident',
1081 action='store', nargs=1, type='string')
1082
1083(opts, args) = parser.parse_args()
1084
1085mandatories = ['modname', 'protoident']
1086for m in mandatories:
1087 if not opts.__dict__[m]:
1088 print "mandatory option is missing\n"
1089 parser.print_help()
1090 exit(-1)
1091
1092if __name__ == "__main__":
1093
1094 main(str(opts.modname), opts.protoident)
diff --git a/Documentation/target/tcm_mod_builder.txt b/Documentation/target/tcm_mod_builder.txt
new file mode 100644
index 000000000000..84533d8e747f
--- /dev/null
+++ b/Documentation/target/tcm_mod_builder.txt
@@ -0,0 +1,145 @@
1>>>>>>>>>> The TCM v4 fabric module script generator <<<<<<<<<<
2
3Greetings all,
4
5This document is intended to be a mini-HOWTO for using the tcm_mod_builder.py
6script to generate a brand new functional TCM v4 fabric .ko module of your very own,
7that once built can be immediately be loaded to start access the new TCM/ConfigFS
8fabric skeleton, by simply using:
9
10 modprobe $TCM_NEW_MOD
11 mkdir -p /sys/kernel/config/target/$TCM_NEW_MOD
12
13This script will create a new drivers/target/$TCM_NEW_MOD/, and will do the following
14
15 *) Generate new API callers for drivers/target/target_core_fabric_configs.c logic
16 ->make_nodeacl(), ->drop_nodeacl(), ->make_tpg(), ->drop_tpg()
17 ->make_wwn(), ->drop_wwn(). These are created into $TCM_NEW_MOD/$TCM_NEW_MOD_configfs.c
18 *) Generate basic infrastructure for loading/unloading LKMs and TCM/ConfigFS fabric module
19 using a skeleton struct target_core_fabric_ops API template.
20 *) Based on user defined T10 Proto_Ident for the new fabric module being built,
21 the TransportID / Initiator and Target WWPN related handlers for
22 SPC-3 persistent reservation are automatically generated in $TCM_NEW_MOD/$TCM_NEW_MOD_fabric.c
23 using drivers/target/target_core_fabric_lib.c logic.
24 *) NOP API calls for all other Data I/O path and fabric dependent attribute logic
25 in $TCM_NEW_MOD/$TCM_NEW_MOD_fabric.c
26
27tcm_mod_builder.py depends upon the mandatory '-p $PROTO_IDENT' and '-m
28$FABRIC_MOD_name' parameters, and actually running the script looks like:
29
30target:/mnt/sdb/lio-core-2.6.git/Documentation/target# python tcm_mod_builder.py -p iSCSI -m tcm_nab5000
31tcm_dir: /mnt/sdb/lio-core-2.6.git/Documentation/target/../../
32Set fabric_mod_name: tcm_nab5000
33Set fabric_mod_dir:
34/mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000
35Using proto_ident: iSCSI
36Creating fabric_mod_dir:
37/mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000
38Writing file:
39/mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/tcm_nab5000_base.h
40Using tcm_mod_scan_fabric_ops:
41/mnt/sdb/lio-core-2.6.git/Documentation/target/../../include/target/target_core_fabric_ops.h
42Writing file:
43/mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/tcm_nab5000_fabric.c
44Writing file:
45/mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/tcm_nab5000_fabric.h
46Writing file:
47/mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/tcm_nab5000_configfs.c
48Writing file:
49/mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/Kbuild
50Writing file:
51/mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/Kconfig
52Would you like to add tcm_nab5000to drivers/target/Kbuild..? [yes,no]: yes
53Would you like to add tcm_nab5000to drivers/target/Kconfig..? [yes,no]: yes
54
55At the end of tcm_mod_builder.py. the script will ask to add the following
56line to drivers/target/Kbuild:
57
58 obj-$(CONFIG_TCM_NAB5000) += tcm_nab5000/
59
60and the same for drivers/target/Kconfig:
61
62 source "drivers/target/tcm_nab5000/Kconfig"
63
64*) Run 'make menuconfig' and select the new CONFIG_TCM_NAB5000 item:
65
66 <M> TCM_NAB5000 fabric module
67
68*) Build using 'make modules', once completed you will have:
69
70target:/mnt/sdb/lio-core-2.6.git# ls -la drivers/target/tcm_nab5000/
71total 1348
72drwxr-xr-x 2 root root 4096 2010-10-05 03:23 .
73drwxr-xr-x 9 root root 4096 2010-10-05 03:22 ..
74-rw-r--r-- 1 root root 282 2010-10-05 03:22 Kbuild
75-rw-r--r-- 1 root root 171 2010-10-05 03:22 Kconfig
76-rw-r--r-- 1 root root 49 2010-10-05 03:23 modules.order
77-rw-r--r-- 1 root root 738 2010-10-05 03:22 tcm_nab5000_base.h
78-rw-r--r-- 1 root root 9096 2010-10-05 03:22 tcm_nab5000_configfs.c
79-rw-r--r-- 1 root root 191200 2010-10-05 03:23 tcm_nab5000_configfs.o
80-rw-r--r-- 1 root root 40504 2010-10-05 03:23 .tcm_nab5000_configfs.o.cmd
81-rw-r--r-- 1 root root 5414 2010-10-05 03:22 tcm_nab5000_fabric.c
82-rw-r--r-- 1 root root 2016 2010-10-05 03:22 tcm_nab5000_fabric.h
83-rw-r--r-- 1 root root 190932 2010-10-05 03:23 tcm_nab5000_fabric.o
84-rw-r--r-- 1 root root 40713 2010-10-05 03:23 .tcm_nab5000_fabric.o.cmd
85-rw-r--r-- 1 root root 401861 2010-10-05 03:23 tcm_nab5000.ko
86-rw-r--r-- 1 root root 265 2010-10-05 03:23 .tcm_nab5000.ko.cmd
87-rw-r--r-- 1 root root 459 2010-10-05 03:23 tcm_nab5000.mod.c
88-rw-r--r-- 1 root root 23896 2010-10-05 03:23 tcm_nab5000.mod.o
89-rw-r--r-- 1 root root 22655 2010-10-05 03:23 .tcm_nab5000.mod.o.cmd
90-rw-r--r-- 1 root root 379022 2010-10-05 03:23 tcm_nab5000.o
91-rw-r--r-- 1 root root 211 2010-10-05 03:23 .tcm_nab5000.o.cmd
92
93*) Load the new module, create a lun_0 configfs group, and add new TCM Core
94 IBLOCK backstore symlink to port:
95
96target:/mnt/sdb/lio-core-2.6.git# insmod drivers/target/tcm_nab5000.ko
97target:/mnt/sdb/lio-core-2.6.git# mkdir -p /sys/kernel/config/target/nab5000/iqn.foo/tpgt_1/lun/lun_0
98target:/mnt/sdb/lio-core-2.6.git# cd /sys/kernel/config/target/nab5000/iqn.foo/tpgt_1/lun/lun_0/
99target:/sys/kernel/config/target/nab5000/iqn.foo/tpgt_1/lun/lun_0# ln -s /sys/kernel/config/target/core/iblock_0/lvm_test0 nab5000_port
100
101target:/sys/kernel/config/target/nab5000/iqn.foo/tpgt_1/lun/lun_0# cd -
102target:/mnt/sdb/lio-core-2.6.git# tree /sys/kernel/config/target/nab5000/
103/sys/kernel/config/target/nab5000/
104|-- discovery_auth
105|-- iqn.foo
106| `-- tpgt_1
107| |-- acls
108| |-- attrib
109| |-- lun
110| | `-- lun_0
111| | |-- alua_tg_pt_gp
112| | |-- alua_tg_pt_offline
113| | |-- alua_tg_pt_status
114| | |-- alua_tg_pt_write_md
115| | `-- nab5000_port -> ../../../../../../target/core/iblock_0/lvm_test0
116| |-- np
117| `-- param
118`-- version
119
120target:/mnt/sdb/lio-core-2.6.git# lsmod
121Module Size Used by
122tcm_nab5000 3935 4
123iscsi_target_mod 193211 0
124target_core_stgt 8090 0
125target_core_pscsi 11122 1
126target_core_file 9172 2
127target_core_iblock 9280 1
128target_core_mod 228575 31
129tcm_nab5000,iscsi_target_mod,target_core_stgt,target_core_pscsi,target_core_file,target_core_iblock
130libfc 73681 0
131scsi_debug 56265 0
132scsi_tgt 8666 1 target_core_stgt
133configfs 20644 2 target_core_mod
134
135----------------------------------------------------------------------
136
137Future TODO items:
138
139 *) Add more T10 proto_idents
140 *) Make tcm_mod_dump_fabric_ops() smarter and generate function pointer
141 defs directly from include/target/target_core_fabric_ops.h:struct target_core_fabric_ops
142 structure members.
143
144October 5th, 2010
145Nicholas A. Bellinger <nab@linux-iscsi.org>
diff --git a/Documentation/telephony/ixj.txt b/Documentation/telephony/ixj.txt
index 4fb314d51702..db94fb6c5678 100644
--- a/Documentation/telephony/ixj.txt
+++ b/Documentation/telephony/ixj.txt
@@ -51,7 +51,7 @@ be removed to protect the rights of others.
51Specifically, very old Internet PhoneJACK cards have non-standard 51Specifically, very old Internet PhoneJACK cards have non-standard
52G.723.1 codecs (due to the early nature of the DSPs in those days). 52G.723.1 codecs (due to the early nature of the DSPs in those days).
53The auto-conversion code to bring those cards into compliance with 53The auto-conversion code to bring those cards into compliance with
54todays standards is available as a binary only module to those people 54today's standards is available as a binary only module to those people
55needing it. If you bought your card after 1997 or so, you are OK - 55needing it. If you bought your card after 1997 or so, you are OK -
56it's only the very old cards that are affected. 56it's only the very old cards that are affected.
57 57
diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
index cb3d15bc1aeb..b61e46f449aa 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.txt
@@ -278,3 +278,15 @@ method, the sys I/F structure will be built like this:
278 |---name: acpitz 278 |---name: acpitz
279 |---temp1_input: 37000 279 |---temp1_input: 37000
280 |---temp1_crit: 100000 280 |---temp1_crit: 100000
281
2824. Event Notification
283
284The framework includes a simple notification mechanism, in the form of a
285netlink event. Netlink socket initialization is done during the _init_
286of the framework. Drivers which intend to use the notification mechanism
287just need to call generate_netlink_event() with two arguments viz
288(originator, event). Typically the originator will be an integer assigned
289to a thermal_zone_device when it registers itself with the framework. The
290event will be one of:{THERMAL_AUX0, THERMAL_AUX1, THERMAL_CRITICAL,
291THERMAL_DEV_FAULT}. Notification can be sent when the current temperature
292crosses any of the configured thresholds.
diff --git a/Documentation/timers/hpet_example.c b/Documentation/timers/hpet_example.c
index 4bfafb7bc4c5..9a3e7012c190 100644
--- a/Documentation/timers/hpet_example.c
+++ b/Documentation/timers/hpet_example.c
@@ -97,6 +97,33 @@ hpet_open_close(int argc, const char **argv)
97void 97void
98hpet_info(int argc, const char **argv) 98hpet_info(int argc, const char **argv)
99{ 99{
100 struct hpet_info info;
101 int fd;
102
103 if (argc != 1) {
104 fprintf(stderr, "hpet_info: device-name\n");
105 return;
106 }
107
108 fd = open(argv[0], O_RDONLY);
109 if (fd < 0) {
110 fprintf(stderr, "hpet_info: open of %s failed\n", argv[0]);
111 return;
112 }
113
114 if (ioctl(fd, HPET_INFO, &info) < 0) {
115 fprintf(stderr, "hpet_info: failed to get info\n");
116 goto out;
117 }
118
119 fprintf(stderr, "hpet_info: hi_irqfreq 0x%lx hi_flags 0x%lx ",
120 info.hi_ireqfreq, info.hi_flags);
121 fprintf(stderr, "hi_hpet %d hi_timer %d\n",
122 info.hi_hpet, info.hi_timer);
123
124out:
125 close(fd);
126 return;
100} 127}
101 128
102void 129void
diff --git a/Documentation/timers/timer_stats.txt b/Documentation/timers/timer_stats.txt
index 9bd00fc2e823..8abd40b22b7f 100644
--- a/Documentation/timers/timer_stats.txt
+++ b/Documentation/timers/timer_stats.txt
@@ -19,7 +19,7 @@ Linux system over a sample period:
19 19
20- the pid of the task(process) which initialized the timer 20- the pid of the task(process) which initialized the timer
21- the name of the process which initialized the timer 21- the name of the process which initialized the timer
22- the function where the timer was intialized 22- the function where the timer was initialized
23- the callback function which is associated to the timer 23- the callback function which is associated to the timer
24- the number of events (callbacks) 24- the number of events (callbacks)
25 25
diff --git a/Documentation/timers/timers-howto.txt b/Documentation/timers/timers-howto.txt
index c9ef29d2ede3..038f8c77a076 100644
--- a/Documentation/timers/timers-howto.txt
+++ b/Documentation/timers/timers-howto.txt
@@ -24,7 +24,7 @@ ATOMIC CONTEXT:
24 24
25 ndelay(unsigned long nsecs) 25 ndelay(unsigned long nsecs)
26 udelay(unsigned long usecs) 26 udelay(unsigned long usecs)
27 mdelay(unsgined long msecs) 27 mdelay(unsigned long msecs)
28 28
29 udelay is the generally preferred API; ndelay-level 29 udelay is the generally preferred API; ndelay-level
30 precision may not actually exist on many non-PC devices. 30 precision may not actually exist on many non-PC devices.
diff --git a/Documentation/trace/events-power.txt b/Documentation/trace/events-power.txt
new file mode 100644
index 000000000000..96d87b67fe37
--- /dev/null
+++ b/Documentation/trace/events-power.txt
@@ -0,0 +1,90 @@
1
2 Subsystem Trace Points: power
3
4The power tracing system captures events related to power transitions
5within the kernel. Broadly speaking there are three major subheadings:
6
7 o Power state switch which reports events related to suspend (S-states),
8 cpuidle (C-states) and cpufreq (P-states)
9 o System clock related changes
10 o Power domains related changes and transitions
11
12This document describes what each of the tracepoints is and why they
13might be useful.
14
15Cf. include/trace/events/power.h for the events definitions.
16
171. Power state switch events
18============================
19
201.1 New trace API
21-----------------
22
23A 'cpu' event class gathers the CPU-related events: cpuidle and
24cpufreq.
25
26cpu_idle "state=%lu cpu_id=%lu"
27cpu_frequency "state=%lu cpu_id=%lu"
28
29A suspend event is used to indicate the system going in and out of the
30suspend mode:
31
32machine_suspend "state=%lu"
33
34
35Note: the value of '-1' or '4294967295' for state means an exit from the current state,
36i.e. trace_cpu_idle(4, smp_processor_id()) means that the system
37enters the idle state 4, while trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id())
38means that the system exits the previous idle state.
39
40The event which has 'state=4294967295' in the trace is very important to the user
41space tools which are using it to detect the end of the current state, and so to
42correctly draw the states diagrams and to calculate accurate statistics etc.
43
441.2 DEPRECATED trace API
45------------------------
46
47A new Kconfig option CONFIG_EVENT_POWER_TRACING_DEPRECATED with the default value of
48'y' has been created. This allows the legacy trace power API to be used conjointly
49with the new trace API.
50The Kconfig option, the old trace API (in include/trace/events/power.h) and the
51old trace points will disappear in a future release (namely 2.6.41).
52
53power_start "type=%lu state=%lu cpu_id=%lu"
54power_frequency "type=%lu state=%lu cpu_id=%lu"
55power_end "cpu_id=%lu"
56
57The 'type' parameter takes one of those macros:
58 . POWER_NONE = 0,
59 . POWER_CSTATE = 1, /* C-State */
60 . POWER_PSTATE = 2, /* Fequency change or DVFS */
61
62The 'state' parameter is set depending on the type:
63 . Target C-state for type=POWER_CSTATE,
64 . Target frequency for type=POWER_PSTATE,
65
66power_end is used to indicate the exit of a state, corresponding to the latest
67power_start event.
68
692. Clocks events
70================
71The clock events are used for clock enable/disable and for
72clock rate change.
73
74clock_enable "%s state=%lu cpu_id=%lu"
75clock_disable "%s state=%lu cpu_id=%lu"
76clock_set_rate "%s state=%lu cpu_id=%lu"
77
78The first parameter gives the clock name (e.g. "gpio1_iclk").
79The second parameter is '1' for enable, '0' for disable, the target
80clock rate for set_rate.
81
823. Power domains events
83=======================
84The power domain events are used for power domains transitions
85
86power_domain_target "%s state=%lu cpu_id=%lu"
87
88The first parameter gives the power domain name (e.g. "mpu_pwrdm").
89The second parameter is the power domain target state.
90
diff --git a/Documentation/trace/events.txt b/Documentation/trace/events.txt
index 09bd8e902989..b510564aac7e 100644
--- a/Documentation/trace/events.txt
+++ b/Documentation/trace/events.txt
@@ -125,7 +125,7 @@ is the size of the data item, in bytes.
125For example, here's the information displayed for the 'sched_wakeup' 125For example, here's the information displayed for the 'sched_wakeup'
126event: 126event:
127 127
128# cat /debug/tracing/events/sched/sched_wakeup/format 128# cat /sys/kernel/debug/tracing/events/sched/sched_wakeup/format
129 129
130name: sched_wakeup 130name: sched_wakeup
131ID: 60 131ID: 60
@@ -201,19 +201,19 @@ to the 'filter' file for the given event.
201 201
202For example: 202For example:
203 203
204# cd /debug/tracing/events/sched/sched_wakeup 204# cd /sys/kernel/debug/tracing/events/sched/sched_wakeup
205# echo "common_preempt_count > 4" > filter 205# echo "common_preempt_count > 4" > filter
206 206
207A slightly more involved example: 207A slightly more involved example:
208 208
209# cd /debug/tracing/events/sched/sched_signal_send 209# cd /sys/kernel/debug/tracing/events/signal/signal_generate
210# echo "((sig >= 10 && sig < 15) || sig == 17) && comm != bash" > filter 210# echo "((sig >= 10 && sig < 15) || sig == 17) && comm != bash" > filter
211 211
212If there is an error in the expression, you'll get an 'Invalid 212If there is an error in the expression, you'll get an 'Invalid
213argument' error when setting it, and the erroneous string along with 213argument' error when setting it, and the erroneous string along with
214an error message can be seen by looking at the filter e.g.: 214an error message can be seen by looking at the filter e.g.:
215 215
216# cd /debug/tracing/events/sched/sched_signal_send 216# cd /sys/kernel/debug/tracing/events/signal/signal_generate
217# echo "((sig >= 10 && sig < 15) || dsig == 17) && comm != bash" > filter 217# echo "((sig >= 10 && sig < 15) || dsig == 17) && comm != bash" > filter
218-bash: echo: write error: Invalid argument 218-bash: echo: write error: Invalid argument
219# cat filter 219# cat filter
diff --git a/Documentation/trace/ftrace-design.txt b/Documentation/trace/ftrace-design.txt
index dc52bd442c92..79fcafc7fd64 100644
--- a/Documentation/trace/ftrace-design.txt
+++ b/Documentation/trace/ftrace-design.txt
@@ -247,6 +247,13 @@ You need very few things to get the syscalls tracing in an arch.
247- Support the TIF_SYSCALL_TRACEPOINT thread flags. 247- Support the TIF_SYSCALL_TRACEPOINT thread flags.
248- Put the trace_sys_enter() and trace_sys_exit() tracepoints calls from ptrace 248- Put the trace_sys_enter() and trace_sys_exit() tracepoints calls from ptrace
249 in the ptrace syscalls tracing path. 249 in the ptrace syscalls tracing path.
250- If the system call table on this arch is more complicated than a simple array
251 of addresses of the system calls, implement an arch_syscall_addr to return
252 the address of a given system call.
253- If the symbol names of the system calls do not match the function names on
254 this arch, define ARCH_HAS_SYSCALL_MATCH_SYM_NAME in asm/ftrace.h and
255 implement arch_syscall_match_sym_name with the appropriate logic to return
256 true if the function name corresponds with the symbol name.
250- Tag this arch as HAVE_SYSCALL_TRACEPOINTS. 257- Tag this arch as HAVE_SYSCALL_TRACEPOINTS.
251 258
252 259
diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt
index 557c1edeccaf..1ebc24cf9a55 100644
--- a/Documentation/trace/ftrace.txt
+++ b/Documentation/trace/ftrace.txt
@@ -80,11 +80,11 @@ of ftrace. Here is a list of some of the key files:
80 tracers listed here can be configured by 80 tracers listed here can be configured by
81 echoing their name into current_tracer. 81 echoing their name into current_tracer.
82 82
83 tracing_enabled: 83 tracing_on:
84 84
85 This sets or displays whether the current_tracer 85 This sets or displays whether writing to the trace
86 is activated and tracing or not. Echo 0 into this 86 ring buffer is enabled. Echo 0 into this file to disable
87 file to disable the tracer or 1 to enable it. 87 the tracer or 1 to enable it.
88 88
89 trace: 89 trace:
90 90
@@ -202,10 +202,6 @@ Here is the list of current tracers that may be configured.
202 to draw a graph of function calls similar to C code 202 to draw a graph of function calls similar to C code
203 source. 203 source.
204 204
205 "sched_switch"
206
207 Traces the context switches and wakeups between tasks.
208
209 "irqsoff" 205 "irqsoff"
210 206
211 Traces the areas that disable interrupts and saves 207 Traces the areas that disable interrupts and saves
@@ -273,39 +269,6 @@ format, the function name that was traced "path_put" and the
273parent function that called this function "path_walk". The 269parent function that called this function "path_walk". The
274timestamp is the time at which the function was entered. 270timestamp is the time at which the function was entered.
275 271
276The sched_switch tracer also includes tracing of task wakeups
277and context switches.
278
279 ksoftirqd/1-7 [01] 1453.070013: 7:115:R + 2916:115:S
280 ksoftirqd/1-7 [01] 1453.070013: 7:115:R + 10:115:S
281 ksoftirqd/1-7 [01] 1453.070013: 7:115:R ==> 10:115:R
282 events/1-10 [01] 1453.070013: 10:115:S ==> 2916:115:R
283 kondemand/1-2916 [01] 1453.070013: 2916:115:S ==> 7:115:R
284 ksoftirqd/1-7 [01] 1453.070013: 7:115:S ==> 0:140:R
285
286Wake ups are represented by a "+" and the context switches are
287shown as "==>". The format is:
288
289 Context switches:
290
291 Previous task Next Task
292
293 <pid>:<prio>:<state> ==> <pid>:<prio>:<state>
294
295 Wake ups:
296
297 Current task Task waking up
298
299 <pid>:<prio>:<state> + <pid>:<prio>:<state>
300
301The prio is the internal kernel priority, which is the inverse
302of the priority that is usually displayed by user-space tools.
303Zero represents the highest priority (99). Prio 100 starts the
304"nice" priorities with 100 being equal to nice -20 and 139 being
305nice 19. The prio "140" is reserved for the idle task which is
306the lowest priority thread (pid 0).
307
308
309Latency trace format 272Latency trace format
310-------------------- 273--------------------
311 274
@@ -491,78 +454,10 @@ x494] <- /root/a.out[+0x4a8] <- /lib/libc-2.7.so[+0x1e1a6]
491 latencies, as described in "Latency 454 latencies, as described in "Latency
492 trace format". 455 trace format".
493 456
494sched_switch 457 overwrite - This controls what happens when the trace buffer is
495------------ 458 full. If "1" (default), the oldest events are
496 459 discarded and overwritten. If "0", then the newest
497This tracer simply records schedule switches. Here is an example 460 events are discarded.
498of how to use it.
499
500 # echo sched_switch > current_tracer
501 # echo 1 > tracing_enabled
502 # sleep 1
503 # echo 0 > tracing_enabled
504 # cat trace
505
506# tracer: sched_switch
507#
508# TASK-PID CPU# TIMESTAMP FUNCTION
509# | | | | |
510 bash-3997 [01] 240.132281: 3997:120:R + 4055:120:R
511 bash-3997 [01] 240.132284: 3997:120:R ==> 4055:120:R
512 sleep-4055 [01] 240.132371: 4055:120:S ==> 3997:120:R
513 bash-3997 [01] 240.132454: 3997:120:R + 4055:120:S
514 bash-3997 [01] 240.132457: 3997:120:R ==> 4055:120:R
515 sleep-4055 [01] 240.132460: 4055:120:D ==> 3997:120:R
516 bash-3997 [01] 240.132463: 3997:120:R + 4055:120:D
517 bash-3997 [01] 240.132465: 3997:120:R ==> 4055:120:R
518 <idle>-0 [00] 240.132589: 0:140:R + 4:115:S
519 <idle>-0 [00] 240.132591: 0:140:R ==> 4:115:R
520 ksoftirqd/0-4 [00] 240.132595: 4:115:S ==> 0:140:R
521 <idle>-0 [00] 240.132598: 0:140:R + 4:115:S
522 <idle>-0 [00] 240.132599: 0:140:R ==> 4:115:R
523 ksoftirqd/0-4 [00] 240.132603: 4:115:S ==> 0:140:R
524 sleep-4055 [01] 240.133058: 4055:120:S ==> 3997:120:R
525 [...]
526
527
528As we have discussed previously about this format, the header
529shows the name of the trace and points to the options. The
530"FUNCTION" is a misnomer since here it represents the wake ups
531and context switches.
532
533The sched_switch file only lists the wake ups (represented with
534'+') and context switches ('==>') with the previous task or
535current task first followed by the next task or task waking up.
536The format for both of these is PID:KERNEL-PRIO:TASK-STATE.
537Remember that the KERNEL-PRIO is the inverse of the actual
538priority with zero (0) being the highest priority and the nice
539values starting at 100 (nice -20). Below is a quick chart to map
540the kernel priority to user land priorities.
541
542 Kernel Space User Space
543 ===============================================================
544 0(high) to 98(low) user RT priority 99(high) to 1(low)
545 with SCHED_RR or SCHED_FIFO
546 ---------------------------------------------------------------
547 99 sched_priority is not used in scheduling
548 decisions(it must be specified as 0)
549 ---------------------------------------------------------------
550 100(high) to 139(low) user nice -20(high) to 19(low)
551 ---------------------------------------------------------------
552 140 idle task priority
553 ---------------------------------------------------------------
554
555The task states are:
556
557 R - running : wants to run, may not actually be running
558 S - sleep : process is waiting to be woken up (handles signals)
559 D - disk sleep (uninterruptible sleep) : process must be woken up
560 (ignores signals)
561 T - stopped : process suspended
562 t - traced : process is being traced (with something like gdb)
563 Z - zombie : process waiting to be cleaned up
564 X - unknown
565
566 461
567ftrace_enabled 462ftrace_enabled
568-------------- 463--------------
@@ -607,10 +502,10 @@ an example:
607 # echo irqsoff > current_tracer 502 # echo irqsoff > current_tracer
608 # echo latency-format > trace_options 503 # echo latency-format > trace_options
609 # echo 0 > tracing_max_latency 504 # echo 0 > tracing_max_latency
610 # echo 1 > tracing_enabled 505 # echo 1 > tracing_on
611 # ls -ltr 506 # ls -ltr
612 [...] 507 [...]
613 # echo 0 > tracing_enabled 508 # echo 0 > tracing_on
614 # cat trace 509 # cat trace
615# tracer: irqsoff 510# tracer: irqsoff
616# 511#
@@ -715,10 +610,10 @@ is much like the irqsoff tracer.
715 # echo preemptoff > current_tracer 610 # echo preemptoff > current_tracer
716 # echo latency-format > trace_options 611 # echo latency-format > trace_options
717 # echo 0 > tracing_max_latency 612 # echo 0 > tracing_max_latency
718 # echo 1 > tracing_enabled 613 # echo 1 > tracing_on
719 # ls -ltr 614 # ls -ltr
720 [...] 615 [...]
721 # echo 0 > tracing_enabled 616 # echo 0 > tracing_on
722 # cat trace 617 # cat trace
723# tracer: preemptoff 618# tracer: preemptoff
724# 619#
@@ -863,10 +758,10 @@ tracers.
863 # echo preemptirqsoff > current_tracer 758 # echo preemptirqsoff > current_tracer
864 # echo latency-format > trace_options 759 # echo latency-format > trace_options
865 # echo 0 > tracing_max_latency 760 # echo 0 > tracing_max_latency
866 # echo 1 > tracing_enabled 761 # echo 1 > tracing_on
867 # ls -ltr 762 # ls -ltr
868 [...] 763 [...]
869 # echo 0 > tracing_enabled 764 # echo 0 > tracing_on
870 # cat trace 765 # cat trace
871# tracer: preemptirqsoff 766# tracer: preemptirqsoff
872# 767#
@@ -1026,9 +921,9 @@ Instead of performing an 'ls', we will run 'sleep 1' under
1026 # echo wakeup > current_tracer 921 # echo wakeup > current_tracer
1027 # echo latency-format > trace_options 922 # echo latency-format > trace_options
1028 # echo 0 > tracing_max_latency 923 # echo 0 > tracing_max_latency
1029 # echo 1 > tracing_enabled 924 # echo 1 > tracing_on
1030 # chrt -f 5 sleep 1 925 # chrt -f 5 sleep 1
1031 # echo 0 > tracing_enabled 926 # echo 0 > tracing_on
1032 # cat trace 927 # cat trace
1033# tracer: wakeup 928# tracer: wakeup
1034# 929#
@@ -1140,9 +1035,9 @@ ftrace_enabled is set; otherwise this tracer is a nop.
1140 1035
1141 # sysctl kernel.ftrace_enabled=1 1036 # sysctl kernel.ftrace_enabled=1
1142 # echo function > current_tracer 1037 # echo function > current_tracer
1143 # echo 1 > tracing_enabled 1038 # echo 1 > tracing_on
1144 # usleep 1 1039 # usleep 1
1145 # echo 0 > tracing_enabled 1040 # echo 0 > tracing_on
1146 # cat trace 1041 # cat trace
1147# tracer: function 1042# tracer: function
1148# 1043#
@@ -1180,7 +1075,7 @@ int trace_fd;
1180[...] 1075[...]
1181int main(int argc, char *argv[]) { 1076int main(int argc, char *argv[]) {
1182 [...] 1077 [...]
1183 trace_fd = open(tracing_file("tracing_enabled"), O_WRONLY); 1078 trace_fd = open(tracing_file("tracing_on"), O_WRONLY);
1184 [...] 1079 [...]
1185 if (condition_hit()) { 1080 if (condition_hit()) {
1186 write(trace_fd, "0", 1); 1081 write(trace_fd, "0", 1);
@@ -1631,9 +1526,9 @@ If I am only interested in sys_nanosleep and hrtimer_interrupt:
1631 # echo sys_nanosleep hrtimer_interrupt \ 1526 # echo sys_nanosleep hrtimer_interrupt \
1632 > set_ftrace_filter 1527 > set_ftrace_filter
1633 # echo function > current_tracer 1528 # echo function > current_tracer
1634 # echo 1 > tracing_enabled 1529 # echo 1 > tracing_on
1635 # usleep 1 1530 # usleep 1
1636 # echo 0 > tracing_enabled 1531 # echo 0 > tracing_on
1637 # cat trace 1532 # cat trace
1638# tracer: ftrace 1533# tracer: ftrace
1639# 1534#
@@ -1879,9 +1774,9 @@ different. The trace is live.
1879 # echo function > current_tracer 1774 # echo function > current_tracer
1880 # cat trace_pipe > /tmp/trace.out & 1775 # cat trace_pipe > /tmp/trace.out &
1881[1] 4153 1776[1] 4153
1882 # echo 1 > tracing_enabled 1777 # echo 1 > tracing_on
1883 # usleep 1 1778 # usleep 1
1884 # echo 0 > tracing_enabled 1779 # echo 0 > tracing_on
1885 # cat trace 1780 # cat trace
1886# tracer: function 1781# tracer: function
1887# 1782#
diff --git a/Documentation/trace/kprobetrace.txt b/Documentation/trace/kprobetrace.txt
index 5f77d94598dd..c83bd6b4e6e8 100644
--- a/Documentation/trace/kprobetrace.txt
+++ b/Documentation/trace/kprobetrace.txt
@@ -42,11 +42,25 @@ Synopsis of kprobe_events
42 +|-offs(FETCHARG) : Fetch memory at FETCHARG +|- offs address.(**) 42 +|-offs(FETCHARG) : Fetch memory at FETCHARG +|- offs address.(**)
43 NAME=FETCHARG : Set NAME as the argument name of FETCHARG. 43 NAME=FETCHARG : Set NAME as the argument name of FETCHARG.
44 FETCHARG:TYPE : Set TYPE as the type of FETCHARG. Currently, basic types 44 FETCHARG:TYPE : Set TYPE as the type of FETCHARG. Currently, basic types
45 (u8/u16/u32/u64/s8/s16/s32/s64) and string are supported. 45 (u8/u16/u32/u64/s8/s16/s32/s64), "string" and bitfield
46 are supported.
46 47
47 (*) only for return probe. 48 (*) only for return probe.
48 (**) this is useful for fetching a field of data structures. 49 (**) this is useful for fetching a field of data structures.
49 50
51Types
52-----
53Several types are supported for fetch-args. Kprobe tracer will access memory
54by given type. Prefix 's' and 'u' means those types are signed and unsigned
55respectively. Traced arguments are shown in decimal (signed) or hex (unsigned).
56String type is a special type, which fetches a "null-terminated" string from
57kernel space. This means it will fail and store NULL if the string container
58has been paged out.
59Bitfield is another special type, which takes 3 parameters, bit-width, bit-
60offset, and container-size (usually 32). The syntax is;
61
62 b<bit-width>@<bit-offset>/<container-size>
63
50 64
51Per-Probe Event Filtering 65Per-Probe Event Filtering
52------------------------- 66-------------------------
@@ -106,7 +120,6 @@ format:
106 field:unsigned char common_flags; offset:2; size:1; signed:0; 120 field:unsigned char common_flags; offset:2; size:1; signed:0;
107 field:unsigned char common_preempt_count; offset:3; size:1;signed:0; 121 field:unsigned char common_preempt_count; offset:3; size:1;signed:0;
108 field:int common_pid; offset:4; size:4; signed:1; 122 field:int common_pid; offset:4; size:4; signed:1;
109 field:int common_lock_depth; offset:8; size:4; signed:1;
110 123
111 field:unsigned long __probe_ip; offset:12; size:4; signed:0; 124 field:unsigned long __probe_ip; offset:12; size:4; signed:0;
112 field:int __probe_nargs; offset:16; size:4; signed:1; 125 field:int __probe_nargs; offset:16; size:4; signed:1;
diff --git a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl
index 1b55146d1c8d..12cecc83cd91 100644
--- a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl
+++ b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl
@@ -46,7 +46,7 @@ use constant HIGH_KSWAPD_LATENCY => 20;
46use constant HIGH_KSWAPD_REWAKEUP => 21; 46use constant HIGH_KSWAPD_REWAKEUP => 21;
47use constant HIGH_NR_SCANNED => 22; 47use constant HIGH_NR_SCANNED => 22;
48use constant HIGH_NR_TAKEN => 23; 48use constant HIGH_NR_TAKEN => 23;
49use constant HIGH_NR_RECLAIM => 24; 49use constant HIGH_NR_RECLAIMED => 24;
50use constant HIGH_NR_CONTIG_DIRTY => 25; 50use constant HIGH_NR_CONTIG_DIRTY => 25;
51 51
52my %perprocesspid; 52my %perprocesspid;
@@ -58,11 +58,13 @@ my $opt_read_procstat;
58my $total_wakeup_kswapd; 58my $total_wakeup_kswapd;
59my ($total_direct_reclaim, $total_direct_nr_scanned); 59my ($total_direct_reclaim, $total_direct_nr_scanned);
60my ($total_direct_latency, $total_kswapd_latency); 60my ($total_direct_latency, $total_kswapd_latency);
61my ($total_direct_nr_reclaimed);
61my ($total_direct_writepage_file_sync, $total_direct_writepage_file_async); 62my ($total_direct_writepage_file_sync, $total_direct_writepage_file_async);
62my ($total_direct_writepage_anon_sync, $total_direct_writepage_anon_async); 63my ($total_direct_writepage_anon_sync, $total_direct_writepage_anon_async);
63my ($total_kswapd_nr_scanned, $total_kswapd_wake); 64my ($total_kswapd_nr_scanned, $total_kswapd_wake);
64my ($total_kswapd_writepage_file_sync, $total_kswapd_writepage_file_async); 65my ($total_kswapd_writepage_file_sync, $total_kswapd_writepage_file_async);
65my ($total_kswapd_writepage_anon_sync, $total_kswapd_writepage_anon_async); 66my ($total_kswapd_writepage_anon_sync, $total_kswapd_writepage_anon_async);
67my ($total_kswapd_nr_reclaimed);
66 68
67# Catch sigint and exit on request 69# Catch sigint and exit on request
68my $sigint_report = 0; 70my $sigint_report = 0;
@@ -104,7 +106,7 @@ my $regex_kswapd_wake_default = 'nid=([0-9]*) order=([0-9]*)';
104my $regex_kswapd_sleep_default = 'nid=([0-9]*)'; 106my $regex_kswapd_sleep_default = 'nid=([0-9]*)';
105my $regex_wakeup_kswapd_default = 'nid=([0-9]*) zid=([0-9]*) order=([0-9]*)'; 107my $regex_wakeup_kswapd_default = 'nid=([0-9]*) zid=([0-9]*) order=([0-9]*)';
106my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_taken=([0-9]*) contig_taken=([0-9]*) contig_dirty=([0-9]*) contig_failed=([0-9]*)'; 108my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_taken=([0-9]*) contig_taken=([0-9]*) contig_dirty=([0-9]*) contig_failed=([0-9]*)';
107my $regex_lru_shrink_inactive_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) priority=([0-9]*)'; 109my $regex_lru_shrink_inactive_default = 'nid=([0-9]*) zid=([0-9]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) priority=([0-9]*) flags=([A-Z_|]*)';
108my $regex_lru_shrink_active_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_rotated=([0-9]*) priority=([0-9]*)'; 110my $regex_lru_shrink_active_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_rotated=([0-9]*) priority=([0-9]*)';
109my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)'; 111my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)';
110 112
@@ -203,8 +205,8 @@ $regex_lru_shrink_inactive = generate_traceevent_regex(
203 "vmscan/mm_vmscan_lru_shrink_inactive", 205 "vmscan/mm_vmscan_lru_shrink_inactive",
204 $regex_lru_shrink_inactive_default, 206 $regex_lru_shrink_inactive_default,
205 "nid", "zid", 207 "nid", "zid",
206 "lru", 208 "nr_scanned", "nr_reclaimed", "priority",
207 "nr_scanned", "nr_reclaimed", "priority"); 209 "flags");
208$regex_lru_shrink_active = generate_traceevent_regex( 210$regex_lru_shrink_active = generate_traceevent_regex(
209 "vmscan/mm_vmscan_lru_shrink_active", 211 "vmscan/mm_vmscan_lru_shrink_active",
210 $regex_lru_shrink_active_default, 212 $regex_lru_shrink_active_default,
@@ -371,10 +373,29 @@ EVENT_PROCESS:
371 print " $regex_lru_isolate/o\n"; 373 print " $regex_lru_isolate/o\n";
372 next; 374 next;
373 } 375 }
376 my $isolate_mode = $1;
374 my $nr_scanned = $4; 377 my $nr_scanned = $4;
375 my $nr_contig_dirty = $7; 378 my $nr_contig_dirty = $7;
376 $perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned; 379
380 # To closer match vmstat scanning statistics, only count isolate_both
381 # and isolate_inactive as scanning. isolate_active is rotation
382 # isolate_inactive == 0
383 # isolate_active == 1
384 # isolate_both == 2
385 if ($isolate_mode != 1) {
386 $perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned;
387 }
377 $perprocesspid{$process_pid}->{HIGH_NR_CONTIG_DIRTY} += $nr_contig_dirty; 388 $perprocesspid{$process_pid}->{HIGH_NR_CONTIG_DIRTY} += $nr_contig_dirty;
389 } elsif ($tracepoint eq "mm_vmscan_lru_shrink_inactive") {
390 $details = $5;
391 if ($details !~ /$regex_lru_shrink_inactive/o) {
392 print "WARNING: Failed to parse mm_vmscan_lru_shrink_inactive as expected\n";
393 print " $details\n";
394 print " $regex_lru_shrink_inactive/o\n";
395 next;
396 }
397 my $nr_reclaimed = $4;
398 $perprocesspid{$process_pid}->{HIGH_NR_RECLAIMED} += $nr_reclaimed;
378 } elsif ($tracepoint eq "mm_vmscan_writepage") { 399 } elsif ($tracepoint eq "mm_vmscan_writepage") {
379 $details = $5; 400 $details = $5;
380 if ($details !~ /$regex_writepage/o) { 401 if ($details !~ /$regex_writepage/o) {
@@ -464,8 +485,8 @@ sub dump_stats {
464 485
465 # Print out process activity 486 # Print out process activity
466 printf("\n"); 487 printf("\n");
467 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s\n", "Process", "Direct", "Wokeup", "Pages", "Pages", "Pages", "Time"); 488 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s %8s\n", "Process", "Direct", "Wokeup", "Pages", "Pages", "Pages", "Pages", "Time");
468 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s\n", "details", "Rclms", "Kswapd", "Scanned", "Sync-IO", "ASync-IO", "Stalled"); 489 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s %8s\n", "details", "Rclms", "Kswapd", "Scanned", "Rclmed", "Sync-IO", "ASync-IO", "Stalled");
469 foreach $process_pid (keys %stats) { 490 foreach $process_pid (keys %stats) {
470 491
471 if (!$stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}) { 492 if (!$stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}) {
@@ -475,6 +496,7 @@ sub dump_stats {
475 $total_direct_reclaim += $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}; 496 $total_direct_reclaim += $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN};
476 $total_wakeup_kswapd += $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}; 497 $total_wakeup_kswapd += $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD};
477 $total_direct_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED}; 498 $total_direct_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED};
499 $total_direct_nr_reclaimed += $stats{$process_pid}->{HIGH_NR_RECLAIMED};
478 $total_direct_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}; 500 $total_direct_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC};
479 $total_direct_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}; 501 $total_direct_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC};
480 $total_direct_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}; 502 $total_direct_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC};
@@ -489,11 +511,12 @@ sub dump_stats {
489 $index++; 511 $index++;
490 } 512 }
491 513
492 printf("%-" . $max_strlen . "s %8d %10d %8u %8u %8u %8.3f", 514 printf("%-" . $max_strlen . "s %8d %10d %8u %8u %8u %8u %8.3f",
493 $process_pid, 515 $process_pid,
494 $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}, 516 $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN},
495 $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}, 517 $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD},
496 $stats{$process_pid}->{HIGH_NR_SCANNED}, 518 $stats{$process_pid}->{HIGH_NR_SCANNED},
519 $stats{$process_pid}->{HIGH_NR_RECLAIMED},
497 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}, 520 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC},
498 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}, 521 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC},
499 $this_reclaim_delay / 1000); 522 $this_reclaim_delay / 1000);
@@ -529,8 +552,8 @@ sub dump_stats {
529 552
530 # Print out kswapd activity 553 # Print out kswapd activity
531 printf("\n"); 554 printf("\n");
532 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Kswapd", "Kswapd", "Order", "Pages", "Pages", "Pages"); 555 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Kswapd", "Kswapd", "Order", "Pages", "Pages", "Pages", "Pages");
533 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Instance", "Wakeups", "Re-wakeup", "Scanned", "Sync-IO", "ASync-IO"); 556 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Instance", "Wakeups", "Re-wakeup", "Scanned", "Rclmed", "Sync-IO", "ASync-IO");
534 foreach $process_pid (keys %stats) { 557 foreach $process_pid (keys %stats) {
535 558
536 if (!$stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}) { 559 if (!$stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}) {
@@ -539,16 +562,18 @@ sub dump_stats {
539 562
540 $total_kswapd_wake += $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}; 563 $total_kswapd_wake += $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE};
541 $total_kswapd_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED}; 564 $total_kswapd_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED};
565 $total_kswapd_nr_reclaimed += $stats{$process_pid}->{HIGH_NR_RECLAIMED};
542 $total_kswapd_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}; 566 $total_kswapd_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC};
543 $total_kswapd_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}; 567 $total_kswapd_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC};
544 $total_kswapd_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}; 568 $total_kswapd_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC};
545 $total_kswapd_writepage_anon_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}; 569 $total_kswapd_writepage_anon_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC};
546 570
547 printf("%-" . $max_strlen . "s %8d %10d %8u %8i %8u", 571 printf("%-" . $max_strlen . "s %8d %10d %8u %8u %8i %8u",
548 $process_pid, 572 $process_pid,
549 $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}, 573 $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE},
550 $stats{$process_pid}->{HIGH_KSWAPD_REWAKEUP}, 574 $stats{$process_pid}->{HIGH_KSWAPD_REWAKEUP},
551 $stats{$process_pid}->{HIGH_NR_SCANNED}, 575 $stats{$process_pid}->{HIGH_NR_SCANNED},
576 $stats{$process_pid}->{HIGH_NR_RECLAIMED},
552 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}, 577 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC},
553 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}); 578 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC});
554 579
@@ -579,6 +604,7 @@ sub dump_stats {
579 print "\nSummary\n"; 604 print "\nSummary\n";
580 print "Direct reclaims: $total_direct_reclaim\n"; 605 print "Direct reclaims: $total_direct_reclaim\n";
581 print "Direct reclaim pages scanned: $total_direct_nr_scanned\n"; 606 print "Direct reclaim pages scanned: $total_direct_nr_scanned\n";
607 print "Direct reclaim pages reclaimed: $total_direct_nr_reclaimed\n";
582 print "Direct reclaim write file sync I/O: $total_direct_writepage_file_sync\n"; 608 print "Direct reclaim write file sync I/O: $total_direct_writepage_file_sync\n";
583 print "Direct reclaim write anon sync I/O: $total_direct_writepage_anon_sync\n"; 609 print "Direct reclaim write anon sync I/O: $total_direct_writepage_anon_sync\n";
584 print "Direct reclaim write file async I/O: $total_direct_writepage_file_async\n"; 610 print "Direct reclaim write file async I/O: $total_direct_writepage_file_async\n";
@@ -588,6 +614,7 @@ sub dump_stats {
588 print "\n"; 614 print "\n";
589 print "Kswapd wakeups: $total_kswapd_wake\n"; 615 print "Kswapd wakeups: $total_kswapd_wake\n";
590 print "Kswapd pages scanned: $total_kswapd_nr_scanned\n"; 616 print "Kswapd pages scanned: $total_kswapd_nr_scanned\n";
617 print "Kswapd pages reclaimed: $total_kswapd_nr_reclaimed\n";
591 print "Kswapd reclaim write file sync I/O: $total_kswapd_writepage_file_sync\n"; 618 print "Kswapd reclaim write file sync I/O: $total_kswapd_writepage_file_sync\n";
592 print "Kswapd reclaim write anon sync I/O: $total_kswapd_writepage_anon_sync\n"; 619 print "Kswapd reclaim write anon sync I/O: $total_kswapd_writepage_anon_sync\n";
593 print "Kswapd reclaim write file async I/O: $total_kswapd_writepage_file_async\n"; 620 print "Kswapd reclaim write file async I/O: $total_kswapd_writepage_file_async\n";
@@ -612,6 +639,7 @@ sub aggregate_perprocesspid() {
612 $perprocess{$process}->{MM_VMSCAN_WAKEUP_KSWAPD} += $perprocesspid{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}; 639 $perprocess{$process}->{MM_VMSCAN_WAKEUP_KSWAPD} += $perprocesspid{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD};
613 $perprocess{$process}->{HIGH_KSWAPD_REWAKEUP} += $perprocesspid{$process_pid}->{HIGH_KSWAPD_REWAKEUP}; 640 $perprocess{$process}->{HIGH_KSWAPD_REWAKEUP} += $perprocesspid{$process_pid}->{HIGH_KSWAPD_REWAKEUP};
614 $perprocess{$process}->{HIGH_NR_SCANNED} += $perprocesspid{$process_pid}->{HIGH_NR_SCANNED}; 641 $perprocess{$process}->{HIGH_NR_SCANNED} += $perprocesspid{$process_pid}->{HIGH_NR_SCANNED};
642 $perprocess{$process}->{HIGH_NR_RECLAIMED} += $perprocesspid{$process_pid}->{HIGH_NR_RECLAIMED};
615 $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}; 643 $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC};
616 $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}; 644 $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC};
617 $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}; 645 $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC};
diff --git a/Documentation/trace/ring-buffer-design.txt b/Documentation/trace/ring-buffer-design.txt
index d299ff31df57..7d350b496585 100644
--- a/Documentation/trace/ring-buffer-design.txt
+++ b/Documentation/trace/ring-buffer-design.txt
@@ -237,7 +237,7 @@ with the previous write.
237 |written | 237 |written |
238 +---------+ 238 +---------+
239 |written | 239 |written |
240 +---------+ <--- next positon for write (current commit) 240 +---------+ <--- next position for write (current commit)
241 | empty | 241 | empty |
242 +---------+ 242 +---------+
243 243
diff --git a/Documentation/usb/callbacks.txt b/Documentation/usb/callbacks.txt
index bfb36b34b79e..9e85846bdb98 100644
--- a/Documentation/usb/callbacks.txt
+++ b/Documentation/usb/callbacks.txt
@@ -95,9 +95,11 @@ pre_reset
95 95
96int (*pre_reset)(struct usb_interface *intf); 96int (*pre_reset)(struct usb_interface *intf);
97 97
98Another driver or user space is triggering a reset on the device which 98A driver or user space is triggering a reset on the device which
99contains the interface passed as an argument. Cease IO and save any 99contains the interface passed as an argument. Cease IO, wait for all
100device state you need to restore. 100outstanding URBs to complete, and save any device state you need to
101restore. No more URBs may be submitted until the post_reset method
102is called.
101 103
102If you need to allocate memory here, use GFP_NOIO or GFP_ATOMIC, if you 104If you need to allocate memory here, use GFP_NOIO or GFP_ATOMIC, if you
103are in atomic context. 105are in atomic context.
diff --git a/Documentation/usb/error-codes.txt b/Documentation/usb/error-codes.txt
index d83703ea74b2..b3f606b81a03 100644
--- a/Documentation/usb/error-codes.txt
+++ b/Documentation/usb/error-codes.txt
@@ -76,6 +76,13 @@ A transfer's actual_length may be positive even when an error has been
76reported. That's because transfers often involve several packets, so that 76reported. That's because transfers often involve several packets, so that
77one or more packets could finish before an error stops further endpoint I/O. 77one or more packets could finish before an error stops further endpoint I/O.
78 78
79For isochronous URBs, the urb status value is non-zero only if the URB is
80unlinked, the device is removed, the host controller is disabled, or the total
81transferred length is less than the requested length and the URB_SHORT_NOT_OK
82flag is set. Completion handlers for isochronous URBs should only see
83urb->status set to zero, -ENOENT, -ECONNRESET, -ESHUTDOWN, or -EREMOTEIO.
84Individual frame descriptor status fields may report more status codes.
85
79 86
800 Transfer completed successfully 870 Transfer completed successfully
81 88
@@ -132,7 +139,7 @@ one or more packets could finish before an error stops further endpoint I/O.
132 device removal events immediately. 139 device removal events immediately.
133 140
134-EXDEV ISO transfer only partially completed 141-EXDEV ISO transfer only partially completed
135 look at individual frame status for details 142 (only set in iso_frame_desc[n].status, not urb->status)
136 143
137-EINVAL ISO madness, if this happens: Log off and go home 144-EINVAL ISO madness, if this happens: Log off and go home
138 145
diff --git a/Documentation/usb/linux-cdc-acm.inf b/Documentation/usb/linux-cdc-acm.inf
index 612e7220fb29..37a02ce54841 100644
--- a/Documentation/usb/linux-cdc-acm.inf
+++ b/Documentation/usb/linux-cdc-acm.inf
@@ -90,10 +90,10 @@ ServiceBinary=%12%\USBSER.sys
90[SourceDisksFiles] 90[SourceDisksFiles]
91[SourceDisksNames] 91[SourceDisksNames]
92[DeviceList] 92[DeviceList]
93%DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7, USB\VID_0525&PID_A4AB&MI_02 93%DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7, USB\VID_1D6B&PID_0104&MI_02
94 94
95[DeviceList.NTamd64] 95[DeviceList.NTamd64]
96%DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7, USB\VID_0525&PID_A4AB&MI_02 96%DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7, USB\VID_1D6B&PID_0104&MI_02
97 97
98 98
99;------------------------------------------------------------------------------ 99;------------------------------------------------------------------------------
diff --git a/Documentation/usb/linux.inf b/Documentation/usb/linux.inf
index 4dee95851224..4ffa715b0ae8 100644
--- a/Documentation/usb/linux.inf
+++ b/Documentation/usb/linux.inf
@@ -18,15 +18,15 @@ DriverVer = 06/21/2006,6.0.6000.16384
18 18
19; Decoration for x86 architecture 19; Decoration for x86 architecture
20[LinuxDevices.NTx86] 20[LinuxDevices.NTx86]
21%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2, USB\VID_0525&PID_a4ab&MI_00 21%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2, USB\VID_1d6b&PID_0104&MI_00
22 22
23; Decoration for x64 architecture 23; Decoration for x64 architecture
24[LinuxDevices.NTamd64] 24[LinuxDevices.NTamd64]
25%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2, USB\VID_0525&PID_a4ab&MI_00 25%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2, USB\VID_1d6b&PID_0104&MI_00
26 26
27; Decoration for ia64 architecture 27; Decoration for ia64 architecture
28[LinuxDevices.NTia64] 28[LinuxDevices.NTia64]
29%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2, USB\VID_0525&PID_a4ab&MI_00 29%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2, USB\VID_1d6b&PID_0104&MI_00
30 30
31;@@@ This is the common setting for setup 31;@@@ This is the common setting for setup
32[ControlFlags] 32[ControlFlags]
diff --git a/Documentation/usb/power-management.txt b/Documentation/usb/power-management.txt
index b29d8e56cf28..c9ffa9ced7ee 100644
--- a/Documentation/usb/power-management.txt
+++ b/Documentation/usb/power-management.txt
@@ -2,7 +2,7 @@
2 2
3 Alan Stern <stern@rowland.harvard.edu> 3 Alan Stern <stern@rowland.harvard.edu>
4 4
5 December 11, 2009 5 October 28, 2010
6 6
7 7
8 8
@@ -107,9 +107,14 @@ allowed to issue dynamic suspends.
107The user interface for controlling dynamic PM is located in the power/ 107The user interface for controlling dynamic PM is located in the power/
108subdirectory of each USB device's sysfs directory, that is, in 108subdirectory of each USB device's sysfs directory, that is, in
109/sys/bus/usb/devices/.../power/ where "..." is the device's ID. The 109/sys/bus/usb/devices/.../power/ where "..." is the device's ID. The
110relevant attribute files are: wakeup, control, and autosuspend. 110relevant attribute files are: wakeup, control, and
111(There may also be a file named "level"; this file was deprecated 111autosuspend_delay_ms. (There may also be a file named "level"; this
112as of the 2.6.35 kernel and replaced by the "control" file.) 112file was deprecated as of the 2.6.35 kernel and replaced by the
113"control" file. In 2.6.38 the "autosuspend" file will be deprecated
114and replaced by the "autosuspend_delay_ms" file. The only difference
115is that the newer file expresses the delay in milliseconds whereas the
116older file uses seconds. Confusingly, both files are present in 2.6.37
117but only "autosuspend" works.)
113 118
114 power/wakeup 119 power/wakeup
115 120
@@ -140,33 +145,36 @@ as of the 2.6.35 kernel and replaced by the "control" file.)
140 suspended and autoresume was not allowed. This 145 suspended and autoresume was not allowed. This
141 setting is no longer supported.) 146 setting is no longer supported.)
142 147
143 power/autosuspend 148 power/autosuspend_delay_ms
144 149
145 This file contains an integer value, which is the 150 This file contains an integer value, which is the
146 number of seconds the device should remain idle before 151 number of milliseconds the device should remain idle
147 the kernel will autosuspend it (the idle-delay time). 152 before the kernel will autosuspend it (the idle-delay
148 The default is 2. 0 means to autosuspend as soon as 153 time). The default is 2000. 0 means to autosuspend
149 the device becomes idle, and negative values mean 154 as soon as the device becomes idle, and negative
150 never to autosuspend. You can write a number to the 155 values mean never to autosuspend. You can write a
151 file to change the autosuspend idle-delay time. 156 number to the file to change the autosuspend
152 157 idle-delay time.
153Writing "-1" to power/autosuspend and writing "on" to power/control do 158
154essentially the same thing -- they both prevent the device from being 159Writing "-1" to power/autosuspend_delay_ms and writing "on" to
155autosuspended. Yes, this is a redundancy in the API. 160power/control do essentially the same thing -- they both prevent the
161device from being autosuspended. Yes, this is a redundancy in the
162API.
156 163
157(In 2.6.21 writing "0" to power/autosuspend would prevent the device 164(In 2.6.21 writing "0" to power/autosuspend would prevent the device
158from being autosuspended; the behavior was changed in 2.6.22. The 165from being autosuspended; the behavior was changed in 2.6.22. The
159power/autosuspend attribute did not exist prior to 2.6.21, and the 166power/autosuspend attribute did not exist prior to 2.6.21, and the
160power/level attribute did not exist prior to 2.6.22. power/control 167power/level attribute did not exist prior to 2.6.22. power/control
161was added in 2.6.34.) 168was added in 2.6.34, and power/autosuspend_delay_ms was added in
1692.6.37 but did not become functional until 2.6.38.)
162 170
163 171
164 Changing the default idle-delay time 172 Changing the default idle-delay time
165 ------------------------------------ 173 ------------------------------------
166 174
167The default autosuspend idle-delay time is controlled by a module 175The default autosuspend idle-delay time (in seconds) is controlled by
168parameter in usbcore. You can specify the value when usbcore is 176a module parameter in usbcore. You can specify the value when usbcore
169loaded. For example, to set it to 5 seconds instead of 2 you would 177is loaded. For example, to set it to 5 seconds instead of 2 you would
170do: 178do:
171 179
172 modprobe usbcore autosuspend=5 180 modprobe usbcore autosuspend=5
@@ -234,25 +242,23 @@ every device.
234 242
235If a driver knows that its device has proper suspend/resume support, 243If a driver knows that its device has proper suspend/resume support,
236it can enable autosuspend all by itself. For example, the video 244it can enable autosuspend all by itself. For example, the video
237driver for a laptop's webcam might do this, since these devices are 245driver for a laptop's webcam might do this (in recent kernels they
238rarely used and so should normally be autosuspended. 246do), since these devices are rarely used and so should normally be
247autosuspended.
239 248
240Sometimes it turns out that even when a device does work okay with 249Sometimes it turns out that even when a device does work okay with
241autosuspend there are still problems. For example, there are 250autosuspend there are still problems. For example, the usbhid driver,
242experimental patches adding autosuspend support to the usbhid driver, 251which manages keyboards and mice, has autosuspend support. Tests with
243which manages keyboards and mice, among other things. Tests with a 252a number of keyboards show that typing on a suspended keyboard, while
244number of keyboards showed that typing on a suspended keyboard, while 253causing the keyboard to do a remote wakeup all right, will nonetheless
245causing the keyboard to do a remote wakeup all right, would 254frequently result in lost keystrokes. Tests with mice show that some
246nonetheless frequently result in lost keystrokes. Tests with mice 255of them will issue a remote-wakeup request in response to button
247showed that some of them would issue a remote-wakeup request in 256presses but not to motion, and some in response to neither.
248response to button presses but not to motion, and some in response to
249neither.
250 257
251The kernel will not prevent you from enabling autosuspend on devices 258The kernel will not prevent you from enabling autosuspend on devices
252that can't handle it. It is even possible in theory to damage a 259that can't handle it. It is even possible in theory to damage a
253device by suspending it at the wrong time -- for example, suspending a 260device by suspending it at the wrong time. (Highly unlikely, but
254USB hard disk might cause it to spin down without parking the heads. 261possible.) Take care.
255(Highly unlikely, but possible.) Take care.
256 262
257 263
258 The driver interface for Power Management 264 The driver interface for Power Management
@@ -336,10 +342,6 @@ autosuspend the interface's device. When the usage counter is = 0
336then the interface is considered to be idle, and the kernel may 342then the interface is considered to be idle, and the kernel may
337autosuspend the device. 343autosuspend the device.
338 344
339(There is a similar usage counter field in struct usb_device,
340associated with the device itself rather than any of its interfaces.
341This counter is used only by the USB core.)
342
343Drivers need not be concerned about balancing changes to the usage 345Drivers need not be concerned about balancing changes to the usage
344counter; the USB core will undo any remaining "get"s when a driver 346counter; the USB core will undo any remaining "get"s when a driver
345is unbound from its interface. As a corollary, drivers must not call 347is unbound from its interface. As a corollary, drivers must not call
@@ -409,11 +411,11 @@ during autosuspend. For example, there's not much point
409autosuspending a keyboard if the user can't cause the keyboard to do a 411autosuspending a keyboard if the user can't cause the keyboard to do a
410remote wakeup by typing on it. If the driver sets 412remote wakeup by typing on it. If the driver sets
411intf->needs_remote_wakeup to 1, the kernel won't autosuspend the 413intf->needs_remote_wakeup to 1, the kernel won't autosuspend the
412device if remote wakeup isn't available or has been disabled through 414device if remote wakeup isn't available. (If the device is already
413the power/wakeup attribute. (If the device is already autosuspended, 415autosuspended, though, setting this flag won't cause the kernel to
414though, setting this flag won't cause the kernel to autoresume it. 416autoresume it. Normally a driver would set this flag in its probe
415Normally a driver would set this flag in its probe method, at which 417method, at which time the device is guaranteed not to be
416time the device is guaranteed not to be autosuspended.) 418autosuspended.)
417 419
418If a driver does its I/O asynchronously in interrupt context, it 420If a driver does its I/O asynchronously in interrupt context, it
419should call usb_autopm_get_interface_async() before starting output and 421should call usb_autopm_get_interface_async() before starting output and
@@ -422,20 +424,19 @@ it receives an input event, it should call
422 424
423 usb_mark_last_busy(struct usb_device *udev); 425 usb_mark_last_busy(struct usb_device *udev);
424 426
425in the event handler. This sets udev->last_busy to the current time. 427in the event handler. This tells the PM core that the device was just
426udev->last_busy is the field used for idle-delay calculations; 428busy and therefore the next autosuspend idle-delay expiration should
427updating it will cause any pending autosuspend to be moved back. Most 429be pushed back. Many of the usb_autopm_* routines also make this call,
428of the usb_autopm_* routines will also set the last_busy field to the 430so drivers need to worry only when interrupt-driven input arrives.
429current time.
430 431
431Asynchronous operation is always subject to races. For example, a 432Asynchronous operation is always subject to races. For example, a
432driver may call one of the usb_autopm_*_interface_async() routines at 433driver may call the usb_autopm_get_interface_async() routine at a time
433a time when the core has just finished deciding the device has been 434when the core has just finished deciding the device has been idle for
434idle for long enough but not yet gotten around to calling the driver's 435long enough but not yet gotten around to calling the driver's suspend
435suspend method. The suspend method must be responsible for 436method. The suspend method must be responsible for synchronizing with
436synchronizing with the output request routine and the URB completion 437the I/O request routine and the URB completion handler; it should
437handler; it should cause autosuspends to fail with -EBUSY if the 438cause autosuspends to fail with -EBUSY if the driver needs to use the
438driver needs to use the device. 439device.
439 440
440External suspend calls should never be allowed to fail in this way, 441External suspend calls should never be allowed to fail in this way,
441only autosuspend calls. The driver can tell them apart by checking 442only autosuspend calls. The driver can tell them apart by checking
@@ -472,7 +473,9 @@ Firstly, a device may already be autosuspended when a system suspend
472occurs. Since system suspends are supposed to be as transparent as 473occurs. Since system suspends are supposed to be as transparent as
473possible, the device should remain suspended following the system 474possible, the device should remain suspended following the system
474resume. But this theory may not work out well in practice; over time 475resume. But this theory may not work out well in practice; over time
475the kernel's behavior in this regard has changed. 476the kernel's behavior in this regard has changed. As of 2.6.37 the
477policy is to resume all devices during a system resume and let them
478handle their own runtime suspends afterward.
476 479
477Secondly, a dynamic power-management event may occur as a system 480Secondly, a dynamic power-management event may occur as a system
478suspend is underway. The window for this is short, since system 481suspend is underway. The window for this is short, since system
diff --git a/Documentation/usb/proc_usb_info.txt b/Documentation/usb/proc_usb_info.txt
index fafcd4723260..afe596d5f201 100644
--- a/Documentation/usb/proc_usb_info.txt
+++ b/Documentation/usb/proc_usb_info.txt
@@ -1,12 +1,17 @@
1/proc/bus/usb filesystem output 1/proc/bus/usb filesystem output
2=============================== 2===============================
3(version 2003.05.30) 3(version 2010.09.13)
4 4
5 5
6The usbfs filesystem for USB devices is traditionally mounted at 6The usbfs filesystem for USB devices is traditionally mounted at
7/proc/bus/usb. It provides the /proc/bus/usb/devices file, as well as 7/proc/bus/usb. It provides the /proc/bus/usb/devices file, as well as
8the /proc/bus/usb/BBB/DDD files. 8the /proc/bus/usb/BBB/DDD files.
9 9
10In many modern systems the usbfs filsystem isn't used at all. Instead
11USB device nodes are created under /dev/usb/ or someplace similar. The
12"devices" file is available in debugfs, typically as
13/sys/kernel/debug/usb/devices.
14
10 15
11**NOTE**: If /proc/bus/usb appears empty, and a host controller 16**NOTE**: If /proc/bus/usb appears empty, and a host controller
12 driver has been linked, then you need to mount the 17 driver has been linked, then you need to mount the
@@ -106,8 +111,8 @@ Legend:
106 111
107Topology info: 112Topology info:
108 113
109T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=ddd MxCh=dd 114T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=dddd MxCh=dd
110| | | | | | | | |__MaxChildren 115| | | | | | | | |__MaxChildren
111| | | | | | | |__Device Speed in Mbps 116| | | | | | | |__Device Speed in Mbps
112| | | | | | |__DeviceNumber 117| | | | | | |__DeviceNumber
113| | | | | |__Count of devices at this level 118| | | | | |__Count of devices at this level
@@ -120,8 +125,13 @@ T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=ddd MxCh=dd
120 Speed may be: 125 Speed may be:
121 1.5 Mbit/s for low speed USB 126 1.5 Mbit/s for low speed USB
122 12 Mbit/s for full speed USB 127 12 Mbit/s for full speed USB
123 480 Mbit/s for high speed USB (added for USB 2.0) 128 480 Mbit/s for high speed USB (added for USB 2.0);
129 also used for Wireless USB, which has no fixed speed
130 5000 Mbit/s for SuperSpeed USB (added for USB 3.0)
124 131
132 For reasons lost in the mists of time, the Port number is always
133 too low by 1. For example, a device plugged into port 4 will
134 show up with "Port=03".
125 135
126Bandwidth info: 136Bandwidth info:
127B: Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd 137B: Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd
@@ -291,7 +301,7 @@ Here's an example, from a system which has a UHCI root hub,
291an external hub connected to the root hub, and a mouse and 301an external hub connected to the root hub, and a mouse and
292a serial converter connected to the external hub. 302a serial converter connected to the external hub.
293 303
294T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 304T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
295B: Alloc= 28/900 us ( 3%), #Int= 2, #Iso= 0 305B: Alloc= 28/900 us ( 3%), #Int= 2, #Iso= 0
296D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 306D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
297P: Vendor=0000 ProdID=0000 Rev= 0.00 307P: Vendor=0000 ProdID=0000 Rev= 0.00
@@ -301,21 +311,21 @@ C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA
301I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub 311I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
302E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms 312E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms
303 313
304T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4 314T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4
305D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 315D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
306P: Vendor=0451 ProdID=1446 Rev= 1.00 316P: Vendor=0451 ProdID=1446 Rev= 1.00
307C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA 317C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
308I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub 318I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
309E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=255ms 319E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=255ms
310 320
311T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0 321T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0
312D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 322D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
313P: Vendor=04b4 ProdID=0001 Rev= 0.00 323P: Vendor=04b4 ProdID=0001 Rev= 0.00
314C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA 324C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
315I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse 325I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse
316E: Ad=81(I) Atr=03(Int.) MxPS= 3 Ivl= 10ms 326E: Ad=81(I) Atr=03(Int.) MxPS= 3 Ivl= 10ms
317 327
318T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0 328T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0
319D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 329D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
320P: Vendor=0565 ProdID=0001 Rev= 1.08 330P: Vendor=0565 ProdID=0001 Rev= 1.08
321S: Manufacturer=Peracom Networks, Inc. 331S: Manufacturer=Peracom Networks, Inc.
@@ -330,12 +340,12 @@ E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl= 8ms
330Selecting only the "T:" and "I:" lines from this (for example, by using 340Selecting only the "T:" and "I:" lines from this (for example, by using
331"procusb ti"), we have: 341"procusb ti"), we have:
332 342
333T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 343T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
334T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4 344T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4
335I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub 345I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
336T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0 346T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0
337I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse 347I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse
338T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0 348T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0
339I: If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=serial 349I: If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=serial
340 350
341 351
diff --git a/Documentation/usb/usbmon.txt b/Documentation/usb/usbmon.txt
index 66f92d1194c1..a4efa0462f05 100644
--- a/Documentation/usb/usbmon.txt
+++ b/Documentation/usb/usbmon.txt
@@ -12,6 +12,10 @@ Controller Drivers (HCD). So, if HCD is buggy, the traces reported by
12usbmon may not correspond to bus transactions precisely. This is the same 12usbmon may not correspond to bus transactions precisely. This is the same
13situation as with tcpdump. 13situation as with tcpdump.
14 14
15Two APIs are currently implemented: "text" and "binary". The binary API
16is available through a character device in /dev namespace and is an ABI.
17The text API is deprecated since 2.6.35, but available for convenience.
18
15* How to use usbmon to collect raw text traces 19* How to use usbmon to collect raw text traces
16 20
17Unlike the packet socket, usbmon has an interface which provides traces 21Unlike the packet socket, usbmon has an interface which provides traces
@@ -162,39 +166,11 @@ Here is the list of words, from left to right:
162 not machine words, but really just a byte stream split into words to make 166 not machine words, but really just a byte stream split into words to make
163 it easier to read. Thus, the last word may contain from one to four bytes. 167 it easier to read. Thus, the last word may contain from one to four bytes.
164 The length of collected data is limited and can be less than the data length 168 The length of collected data is limited and can be less than the data length
165 report in Data Length word. 169 reported in the Data Length word. In the case of an Isochronous input (Zi)
166 170 completion where the received data is sparse in the buffer, the length of
167Here is an example of code to read the data stream in a well known programming 171 the collected data can be greater than the Data Length value (because Data
168language: 172 Length counts only the bytes that were received whereas the Data words
169 173 contain the entire transfer buffer).
170class ParsedLine {
171 int data_len; /* Available length of data */
172 byte data[];
173
174 void parseData(StringTokenizer st) {
175 int availwords = st.countTokens();
176 data = new byte[availwords * 4];
177 data_len = 0;
178 while (st.hasMoreTokens()) {
179 String data_str = st.nextToken();
180 int len = data_str.length() / 2;
181 int i;
182 int b; // byte is signed, apparently?! XXX
183 for (i = 0; i < len; i++) {
184 // data[data_len] = Byte.parseByte(
185 // data_str.substring(i*2, i*2 + 2),
186 // 16);
187 b = Integer.parseInt(
188 data_str.substring(i*2, i*2 + 2),
189 16);
190 if (b >= 128)
191 b *= -1;
192 data[data_len] = (byte) b;
193 data_len++;
194 }
195 }
196 }
197}
198 174
199Examples: 175Examples:
200 176
diff --git a/Documentation/vgaarbiter.txt b/Documentation/vgaarbiter.txt
index 43a9b0694fdd..b7d401e0eae9 100644
--- a/Documentation/vgaarbiter.txt
+++ b/Documentation/vgaarbiter.txt
@@ -14,11 +14,10 @@ the legacy VGA arbitration task (besides other bus management tasks) when more
14than one legacy device co-exists on the same machine. But the problem happens 14than one legacy device co-exists on the same machine. But the problem happens
15when these devices are trying to be accessed by different userspace clients 15when these devices are trying to be accessed by different userspace clients
16(e.g. two server in parallel). Their address assignments conflict. Moreover, 16(e.g. two server in parallel). Their address assignments conflict. Moreover,
17ideally, being an userspace application, it is not the role of the the X 17ideally, being a userspace application, it is not the role of the X server to
18server to control bus resources. Therefore an arbitration scheme outside of 18control bus resources. Therefore an arbitration scheme outside of the X server
19the X server is needed to control the sharing of these resources. This 19is needed to control the sharing of these resources. This document introduces
20document introduces the operation of the VGA arbiter implemented for Linux 20the operation of the VGA arbiter implemented for the Linux kernel.
21kernel.
22 21
23---------------------------------------------------------------------------- 22----------------------------------------------------------------------------
24 23
@@ -39,7 +38,7 @@ I.1 vgaarb
39The vgaarb is a module of the Linux Kernel. When it is initially loaded, it 38The vgaarb is a module of the Linux Kernel. When it is initially loaded, it
40scans all PCI devices and adds the VGA ones inside the arbitration. The 39scans all PCI devices and adds the VGA ones inside the arbitration. The
41arbiter then enables/disables the decoding on different devices of the VGA 40arbiter then enables/disables the decoding on different devices of the VGA
42legacy instructions. Device which do not want/need to use the arbiter may 41legacy instructions. Devices which do not want/need to use the arbiter may
43explicitly tell it by calling vga_set_legacy_decoding(). 42explicitly tell it by calling vga_set_legacy_decoding().
44 43
45The kernel exports a char device interface (/dev/vga_arbiter) to the clients, 44The kernel exports a char device interface (/dev/vga_arbiter) to the clients,
@@ -95,8 +94,8 @@ In the case of devices hot-{un,}plugged, there is a hook - pci_notify() - to
95notify them being added/removed in the system and automatically added/removed 94notify them being added/removed in the system and automatically added/removed
96in the arbiter. 95in the arbiter.
97 96
98There's also a in-kernel API of the arbiter in the case of DRM, vgacon and 97There is also an in-kernel API of the arbiter in case DRM, vgacon, or other
99others which may use the arbiter. 98drivers want to use it.
100 99
101 100
102I.2 libpciaccess 101I.2 libpciaccess
@@ -117,9 +116,8 @@ Besides it, in pci_system were added:
117 struct pci_device *vga_default_dev; 116 struct pci_device *vga_default_dev;
118 117
119 118
120The vga_count is usually need to keep informed how many cards are being 119The vga_count is used to track how many cards are being arbitrated, so for
121arbitrated, so for instance if there's only one then it can totally escape the 120instance, if there is only one card, then it can completely escape arbitration.
122scheme.
123 121
124 122
125These functions below acquire VGA resources for the given card and mark those 123These functions below acquire VGA resources for the given card and mark those
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88
index f2510541373b..42517d9121de 100644
--- a/Documentation/video4linux/CARDLIST.cx88
+++ b/Documentation/video4linux/CARDLIST.cx88
@@ -83,3 +83,4 @@
83 82 -> WinFast DTV2000 H rev. J [107d:6f2b] 83 82 -> WinFast DTV2000 H rev. J [107d:6f2b]
84 83 -> Prof 7301 DVB-S/S2 [b034:3034] 84 83 -> Prof 7301 DVB-S/S2 [b034:3034]
85 84 -> Samsung SMT 7020 DVB-S [18ac:dc00,18ac:dccd] 85 84 -> Samsung SMT 7020 DVB-S [18ac:dc00,18ac:dccd]
86 85 -> Twinhan VP-1027 DVB-S [1822:0023]
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx
index 5c568757c301..9aae449440dc 100644
--- a/Documentation/video4linux/CARDLIST.em28xx
+++ b/Documentation/video4linux/CARDLIST.em28xx
@@ -1,5 +1,5 @@
1 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800] 1 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800]
2 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2862,eb1a:2863,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868] 2 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2862,eb1a:2863,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868,eb1a:2875]
3 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036] 3 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036]
4 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208] 4 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208]
5 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201] 5 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201]
@@ -9,7 +9,7 @@
9 8 -> Kworld USB2800 (em2800) 9 8 -> Kworld USB2800 (em2800)
10 9 -> Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker (em2820/em2840) [1b80:e302,1b80:e304,2304:0207,2304:021a] 10 9 -> Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker (em2820/em2840) [1b80:e302,1b80:e304,2304:0207,2304:021a]
11 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500] 11 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500]
12 11 -> Terratec Hybrid XS (em2880) [0ccd:0042] 12 11 -> Terratec Hybrid XS (em2880)
13 12 -> Kworld PVR TV 2800 RF (em2820/em2840) 13 12 -> Kworld PVR TV 2800 RF (em2820/em2840)
14 13 -> Terratec Prodigy XS (em2880) [0ccd:0047] 14 13 -> Terratec Prodigy XS (em2880) [0ccd:0047]
15 14 -> SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0 (em2820/em2840) 15 14 -> SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0 (em2820/em2840)
@@ -31,6 +31,7 @@
31 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840) 31 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840)
32 31 -> Usbgear VD204v9 (em2821) 32 31 -> Usbgear VD204v9 (em2821)
33 32 -> Supercomp USB 2.0 TV (em2821) 33 32 -> Supercomp USB 2.0 TV (em2821)
34 33 -> Elgato Video Capture (em2860) [0fd9:0033]
34 34 -> Terratec Cinergy A Hybrid XS (em2860) [0ccd:004f] 35 34 -> Terratec Cinergy A Hybrid XS (em2860) [0ccd:004f]
35 35 -> Typhoon DVD Maker (em2860) 36 35 -> Typhoon DVD Maker (em2860)
36 36 -> NetGMBH Cam (em2860) 37 36 -> NetGMBH Cam (em2860)
@@ -45,15 +46,15 @@
45 45 -> Pinnacle PCTV DVB-T (em2870) 46 45 -> Pinnacle PCTV DVB-T (em2870)
46 46 -> Compro, VideoMate U3 (em2870) [185b:2870] 47 46 -> Compro, VideoMate U3 (em2870) [185b:2870]
47 47 -> KWorld DVB-T 305U (em2880) [eb1a:e305] 48 47 -> KWorld DVB-T 305U (em2880) [eb1a:e305]
48 48 -> KWorld DVB-T 310U (em2880) [eb1a:e310] 49 48 -> KWorld DVB-T 310U (em2880)
49 49 -> MSI DigiVox A/D (em2880) [eb1a:e310] 50 49 -> MSI DigiVox A/D (em2880) [eb1a:e310]
50 50 -> MSI DigiVox A/D II (em2880) [eb1a:e320] 51 50 -> MSI DigiVox A/D II (em2880) [eb1a:e320]
51 51 -> Terratec Hybrid XS Secam (em2880) [0ccd:004c] 52 51 -> Terratec Hybrid XS Secam (em2880) [0ccd:004c]
52 52 -> DNT DA2 Hybrid (em2881) 53 52 -> DNT DA2 Hybrid (em2881)
53 53 -> Pinnacle Hybrid Pro (em2881) 54 53 -> Pinnacle Hybrid Pro (em2881)
54 54 -> Kworld VS-DVB-T 323UR (em2882) [eb1a:e323] 55 54 -> Kworld VS-DVB-T 323UR (em2882) [eb1a:e323]
55 55 -> Terratec Hybrid XS (em2882) (em2882) [0ccd:005e] 56 55 -> Terratec Cinnergy Hybrid T USB XS (em2882) (em2882) [0ccd:005e,0ccd:0042]
56 56 -> Pinnacle Hybrid Pro (2) (em2882) [2304:0226] 57 56 -> Pinnacle Hybrid Pro (330e) (em2882) [2304:0226]
57 57 -> Kworld PlusTV HD Hybrid 330 (em2883) [eb1a:a316] 58 57 -> Kworld PlusTV HD Hybrid 330 (em2883) [eb1a:a316]
58 58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041] 59 58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041]
59 60 -> Hauppauge WinTV HVR 850 (em2883) [2040:651f] 60 60 -> Hauppauge WinTV HVR 850 (em2883) [2040:651f]
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
index 4000c29fcfb6..6b4c72d8862d 100644
--- a/Documentation/video4linux/CARDLIST.saa7134
+++ b/Documentation/video4linux/CARDLIST.saa7134
@@ -126,7 +126,7 @@
126125 -> Beholder BeholdTV 409 [0000:4090] 126125 -> Beholder BeholdTV 409 [0000:4090]
127126 -> Beholder BeholdTV 505 FM [5ace:5050] 127126 -> Beholder BeholdTV 505 FM [5ace:5050]
128127 -> Beholder BeholdTV 507 FM / BeholdTV 509 FM [5ace:5070,5ace:5090] 128127 -> Beholder BeholdTV 507 FM / BeholdTV 509 FM [5ace:5070,5ace:5090]
129128 -> Beholder BeholdTV Columbus TVFM [0000:5201] 129128 -> Beholder BeholdTV Columbus TV/FM [0000:5201]
130129 -> Beholder BeholdTV 607 FM [5ace:6070] 130129 -> Beholder BeholdTV 607 FM [5ace:6070]
131130 -> Beholder BeholdTV M6 [5ace:6190] 131130 -> Beholder BeholdTV M6 [5ace:6190]
132131 -> Twinhan Hybrid DTV-DVB 3056 PCI [1822:0022] 132131 -> Twinhan Hybrid DTV-DVB 3056 PCI [1822:0022]
@@ -180,3 +180,5 @@
180179 -> Beholder BeholdTV A7 [5ace:7090] 180179 -> Beholder BeholdTV A7 [5ace:7090]
181180 -> Avermedia PCI M733A [1461:4155,1461:4255] 181180 -> Avermedia PCI M733A [1461:4155,1461:4255]
182181 -> TechoTrend TT-budget T-3000 [13c2:2804] 182181 -> TechoTrend TT-budget T-3000 [13c2:2804]
183182 -> Kworld PCI SBTVD/ISDB-T Full-Seg Hybrid [17de:b136]
184183 -> Compro VideoMate Vista M1F [185b:c900]
diff --git a/Documentation/video4linux/Makefile b/Documentation/video4linux/Makefile
deleted file mode 100644
index 1ed0e98d057d..000000000000
--- a/Documentation/video4linux/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
1# kbuild trick to avoid linker error. Can be omitted if a module is built.
2obj- := dummy.o
3
4# List of programs to build
5hostprogs-y := v4lgrab
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
diff --git a/Documentation/video4linux/README.cpia b/Documentation/video4linux/README.cpia
deleted file mode 100644
index 8a747fee661f..000000000000
--- a/Documentation/video4linux/README.cpia
+++ /dev/null
@@ -1,191 +0,0 @@
1This is a driver for the CPiA PPC2 driven parallel connected
2Camera. For example the Creative WebcamII is CPiA driven.
3
4 ) [1]Peter Pregler, Linz 2000, published under the [2]GNU GPL
5
6---------------------------------------------------------------------------
7
8USAGE:
9
10General:
11========
12
131) Make sure you have created the video devices (/dev/video*):
14
15- if you have a recent MAKEDEV do a 'cd /dev;./MAKEDEV video'
16- otherwise do a:
17
18cd /dev
19mknod video0 c 81 0
20ln -s video0 video
21
222) Compile the kernel (see below for the list of options to use),
23 configure your parport and reboot.
24
253) If all worked well you should get messages similar
26 to the following (your versions may be different) on the console:
27
28V4L-Driver for Vision CPiA based cameras v0.7.4
29parport0: read2 timeout.
30parport0: Multimedia device, VLSI Vision Ltd PPC2
31Parallel port driver for Vision CPiA based camera
32 CPIA Version: 1.20 (2.0)
33 CPIA PnP-ID: 0553:0002:0100
34 VP-Version: 1.0 0100
35 1 camera(s) found
36
37
38As modules:
39===========
40
41Make sure you have selected the following kernel options (you can
42select all stuff as modules):
43
44The cpia-stuff is in the section 'Character devices -> Video For Linux'.
45
46CONFIG_PARPORT=m
47CONFIG_PARPORT_PC=m
48CONFIG_PARPORT_PC_FIFO=y
49CONFIG_PARPORT_1284=y
50CONFIG_VIDEO_DEV=m
51CONFIG_VIDEO_CPIA=m
52CONFIG_VIDEO_CPIA_PP=m
53
54For autoloading of all those modules you need to tell module-init-tools
55some stuff. Add the following line to your module-init-tools config-file
56(e.g. /etc/modprobe.conf or wherever your distribution does store that
57stuff):
58
59options parport_pc io=0x378 irq=7 dma=3
60alias char-major-81 cpia_pp
61
62The first line tells the dma/irq channels to use. Those _must_ match
63the settings of your BIOS. Do NOT simply use the values above. See
64Documentation/parport.txt for more information about this. The second
65line associates the video-device file with the driver. Of cause you
66can also load the modules once upon boot (usually done in /etc/modules).
67
68Linked into the kernel:
69=======================
70
71Make sure you have selected the following kernel options. Note that
72you cannot compile the parport-stuff as modules and the cpia-driver
73statically (the other way round is okay though).
74
75The cpia-stuff is in the section 'Character devices -> Video For Linux'.
76
77CONFIG_PARPORT=y
78CONFIG_PARPORT_PC=y
79CONFIG_PARPORT_PC_FIFO=y
80CONFIG_PARPORT_1284=y
81CONFIG_VIDEO_DEV=y
82CONFIG_VIDEO_CPIA=y
83CONFIG_VIDEO_CPIA_PP=y
84
85To use DMA/irq you will need to tell the kernel upon boot time the
86hardware configuration of the parport. You can give the boot-parameter
87at the LILO-prompt or specify it in lilo.conf. I use the following
88append-line in lilo.conf:
89
90 append="parport=0x378,7,3"
91
92See Documentation/parport.txt for more information about the
93configuration of the parport and the values given above. Do not simply
94use the values given above.
95
96---------------------------------------------------------------------------
97FEATURES:
98
99- mmap/read v4l-interface (but no overlay)
100- image formats: CIF/QCIF, SIF/QSIF, various others used by isabel;
101 note: all sizes except CIF/QCIF are implemented by clipping, i.e.
102 pixels are not uploaded from the camera
103- palettes: VIDEO_PALETTE_GRAY, VIDEO_PALETTE_RGB565, VIDEO_PALETTE_RGB555,
104 VIDEO_PALETTE_RGB24, VIDEO_PALETTE_RGB32, VIDEO_PALETTE_YUYV,
105 VIDEO_PALETTE_UYVY, VIDEO_PALETTE_YUV422
106- state information (color balance, exposure, ...) is preserved between
107 device opens
108- complete control over camera via proc-interface (_all_ camera settings are
109 supported), there is also a python-gtk application available for this [3]
110- works under SMP (but the driver is completely serialized and synchronous)
111 so you get no benefit from SMP, but at least it does not crash your box
112- might work for non-Intel architecture, let us know about this
113
114---------------------------------------------------------------------------
115TESTED APPLICATIONS:
116
117- a simple test application based on Xt is available at [3]
118- another test-application based on gqcam-0.4 (uses GTK)
119- gqcam-0.6 should work
120- xawtv-3.x (also the webcam software)
121- xawtv-2.46
122- w3cam (cgi-interface and vidcat, e.g. you may try out 'vidcat |xv
123 -maxpect -root -quit +noresetroot -rmode 5 -')
124- vic, the MBONE video conferencing tool (version 2.8ucl4-1)
125- isabel 3R4beta (barely working, but AFAICT all the problems are on
126 their side)
127- camserv-0.40
128
129See [3] for pointers to v4l-applications.
130
131---------------------------------------------------------------------------
132KNOWN PROBLEMS:
133
134- some applications do not handle the image format correctly, you will
135 see strange horizontal stripes instead of a nice picture -> make sure
136 your application does use a supported image size or queries the driver
137 for the actually used size (reason behind this: the camera cannot
138 provide any image format, so if size NxM is requested the driver will
139 use a format to the closest fitting N1xM1, the application should now
140 query for this granted size, most applications do not).
141- all the todo ;)
142- if there is not enough light and the picture is too dark try to
143 adjust the SetSensorFPS setting, automatic frame rate adjustment
144 has its price
145- do not try out isabel 3R4beta (built 135), you will be disappointed
146
147---------------------------------------------------------------------------
148TODO:
149
150- multiple camera support (struct camera or something) - This should work,
151 but hasn't been tested yet.
152- architecture independence?
153- SMP-safe asynchronous mmap interface
154- nibble mode for old parport interfaces
155- streaming capture, this should give a performance gain
156
157---------------------------------------------------------------------------
158IMPLEMENTATION NOTES:
159
160The camera can act in two modes, streaming or grabbing. Right now a
161polling grab-scheme is used. Maybe interrupt driven streaming will be
162used for a asynchronous mmap interface in the next major release of the
163driver. This might give a better frame rate.
164
165---------------------------------------------------------------------------
166THANKS (in no particular order):
167
168- Scott J. Bertin <sbertin@mindspring.com> for cleanups, the proc-filesystem
169 and much more
170- Henry Bruce <whb@vvl.co.uk> for providing developers information about
171 the CPiA chip, I wish all companies would treat Linux as seriously
172- Karoly Erdei <Karoly.Erdei@risc.uni-linz.ac.at> and RISC-Linz for being
173 my boss ;) resp. my employer and for providing me the hardware and
174 allow me to devote some working time to this project
175- Manuel J. Petit de Gabriel <mpetit@dit.upm.es> for providing help
176 with Isabel (http://isabel.dit.upm.es/)
177- Bas Huisman <bhuism@cs.utwente.nl> for writing the initial parport code
178- Jarl Totland <Jarl.Totland@bdc.no> for setting up the mailing list
179 and maintaining the web-server[3]
180- Chris Whiteford <Chris@informinteractive.com> for fixes related to the
181 1.02 firmware
182- special kudos to all the tester whose machines crashed and/or
183 will crash. :)
184
185---------------------------------------------------------------------------
186REFERENCES
187
188 1. http://www.risc.uni-linz.ac.at/
189 mailto:Peter_Pregler@email.com
190 2. see the file COPYING in the top directory of the kernel tree
191 3. http://webcam.sourceforge.net/
diff --git a/Documentation/video4linux/README.ivtv b/Documentation/video4linux/README.ivtv
index 42b06686eb78..2579b5b709ed 100644
--- a/Documentation/video4linux/README.ivtv
+++ b/Documentation/video4linux/README.ivtv
@@ -36,8 +36,7 @@ Additional features for the PVR-350 (CX23415 based):
36 * Provides comprehensive OSD (On Screen Display: ie. graphics overlaying the 36 * Provides comprehensive OSD (On Screen Display: ie. graphics overlaying the
37 video signal) 37 video signal)
38 * Provides a framebuffer (allowing X applications to appear on the video 38 * Provides a framebuffer (allowing X applications to appear on the video
39 device) (this framebuffer is not yet part of the kernel. In the meantime it 39 device)
40 is available from www.ivtvdriver.org).
41 * Supports raw YUV output. 40 * Supports raw YUV output.
42 41
43IMPORTANT: In case of problems first read this page: 42IMPORTANT: In case of problems first read this page:
diff --git a/Documentation/video4linux/README.pvrusb2 b/Documentation/video4linux/README.pvrusb2
index a747200fe67c..2137b589276b 100644
--- a/Documentation/video4linux/README.pvrusb2
+++ b/Documentation/video4linux/README.pvrusb2
@@ -172,7 +172,7 @@ Source file list / functional overview:
172 to provide a streaming API usable by a read() system call style of 172 to provide a streaming API usable by a read() system call style of
173 I/O. Right now this is the only layer on top of pvrusb2-io.[ch], 173 I/O. Right now this is the only layer on top of pvrusb2-io.[ch],
174 however the underlying architecture here was intended to allow for 174 however the underlying architecture here was intended to allow for
175 other styles of I/O to be implemented with additonal modules, like 175 other styles of I/O to be implemented with additional modules, like
176 mmap()'ed buffers or something even more exotic. 176 mmap()'ed buffers or something even more exotic.
177 177
178 pvrusb2-main.c - This is the top level of the driver. Module level 178 pvrusb2-main.c - This is the top level of the driver. Module level
diff --git a/Documentation/video4linux/Zoran b/Documentation/video4linux/Zoran
index 00e3f9267814..9ed629d4874b 100644
--- a/Documentation/video4linux/Zoran
+++ b/Documentation/video4linux/Zoran
@@ -130,7 +130,6 @@ Card number: 4
130 130
131Note: No module for the mse3000 is available yet 131Note: No module for the mse3000 is available yet
132Note: No module for the vpx3224 is available yet 132Note: No module for the vpx3224 is available yet
133Note: use encoder=X or decoder=X for non-default i2c chips (see i2c-id.h)
134 133
135=========================== 134===========================
136 135
@@ -322,76 +321,11 @@ your IRQs and make sure the card has its own interrupts.
322 321
3234. Programming interface 3224. Programming interface
324 323
325This driver conforms to video4linux and video4linux2, both can be used to 324This driver conforms to video4linux2. Support for V4L1 and for the custom
326use the driver. Since video4linux didn't provide adequate calls to fully 325zoran ioctls has been removed in kernel 2.6.38.
327use the cards' features, we've introduced several programming extensions,
328which are currently officially accepted in the 2.4.x branch of the kernel.
329These extensions are known as the v4l/mjpeg extensions. See zoran.h for
330details (structs/ioctls).
331
332Information - video4linux:
333http://linux.bytesex.org/v4l2/API.html
334Documentation/video4linux/API.html
335/usr/include/linux/videodev.h
336
337Information - video4linux/mjpeg extensions:
338./zoran.h
339(also see below)
340
341Information - video4linux2:
342http://linuxtv.org
343http://v4l2spec.bytesex.org/
344/usr/include/linux/videodev2.h
345
346More information on the video4linux/mjpeg extensions, by Serguei
347Miridonovi and Rainer Johanni:
348--
349The ioctls for that interface are as follows:
350
351BUZIOC_G_PARAMS
352BUZIOC_S_PARAMS
353
354Get and set the parameters of the buz. The user should always do a
355BUZIOC_G_PARAMS (with a struct buz_params) to obtain the default
356settings, change what he likes and then make a BUZIOC_S_PARAMS call.
357
358BUZIOC_REQBUFS
359
360Before being able to capture/playback, the user has to request
361the buffers he is wanting to use. Fill the structure
362zoran_requestbuffers with the size (recommended: 256*1024) and
363the number (recommended 32 up to 256). There are no such restrictions
364as for the Video for Linux buffers, you should LEAVE SUFFICIENT
365MEMORY for your system however, else strange things will happen ....
366On return, the zoran_requestbuffers structure contains number and
367size of the actually allocated buffers.
368You should use these numbers for doing a mmap of the buffers
369into the user space.
370The BUZIOC_REQBUFS ioctl also makes it happen, that the next mmap
371maps the MJPEG buffer instead of the V4L buffers.
372
373BUZIOC_QBUF_CAPT
374BUZIOC_QBUF_PLAY
375
376Queue a buffer for capture or playback. The first call also starts
377streaming capture. When streaming capture is going on, you may
378only queue further buffers or issue syncs until streaming
379capture is switched off again with a argument of -1 to
380a BUZIOC_QBUF_CAPT/BUZIOC_QBUF_PLAY ioctl.
381
382BUZIOC_SYNC
383
384Issue this ioctl when all buffers are queued. This ioctl will
385block until the first buffer becomes free for saving its
386data to disk (after BUZIOC_QBUF_CAPT) or for reuse (after BUZIOC_QBUF_PLAY).
387
388BUZIOC_G_STATUS
389
390Get the status of the input lines (video source connected/norm).
391 326
392For programming example, please, look at lavrec.c and lavplay.c code in 327For programming example, please, look at lavrec.c and lavplay.c code in
393lavtools-1.2p2 package (URL: http://www.cicese.mx/) 328the MJPEG-tools (http://mjpeg.sf.net/).
394and the 'examples' directory in the original Buz driver distribution.
395 329
396Additional notes for software developers: 330Additional notes for software developers:
397 331
@@ -402,9 +336,6 @@ Additional notes for software developers:
402 standard is "more constant" for current country than geometry 336 standard is "more constant" for current country than geometry
403 settings of a variety of TV capture cards which may work in ITU or 337 settings of a variety of TV capture cards which may work in ITU or
404 square pixel format. 338 square pixel format.
405--
406Please note that lavplay/lavrec are also included in the MJPEG-tools
407(http://mjpeg.sf.net/).
408 339
409=========================== 340===========================
410 341
diff --git a/Documentation/video4linux/bttv/Cards b/Documentation/video4linux/bttv/Cards
index 12217fc49725..db833ced2cb8 100644
--- a/Documentation/video4linux/bttv/Cards
+++ b/Documentation/video4linux/bttv/Cards
@@ -464,10 +464,6 @@ Siemens
464------- 464-------
465 Multimedia eXtension Board (MXB) (SAA7146, SAA7111) 465 Multimedia eXtension Board (MXB) (SAA7146, SAA7111)
466 466
467Stradis
468-------
469 SDM275,SDM250,SDM026,SDM025 (SAA7146, IBMMPEG2): MPEG2 decoder only
470
471Powercolor 467Powercolor
472---------- 468----------
473 MTV878 469 MTV878
diff --git a/Documentation/video4linux/bttv/Insmod-options b/Documentation/video4linux/bttv/Insmod-options
index bbe3ed667d91..14c065fa23ef 100644
--- a/Documentation/video4linux/bttv/Insmod-options
+++ b/Documentation/video4linux/bttv/Insmod-options
@@ -1,5 +1,5 @@
1 1
2Note: "modinfo <module>" prints various informations about a kernel 2Note: "modinfo <module>" prints various information about a kernel
3module, among them a complete and up-to-date list of insmod options. 3module, among them a complete and up-to-date list of insmod options.
4This list tends to be outdated because it is updated manually ... 4This list tends to be outdated because it is updated manually ...
5 5
diff --git a/Documentation/video4linux/bttv/MAKEDEV b/Documentation/video4linux/bttv/MAKEDEV
index 9d112f7fd5f7..093c0cd18042 100644
--- a/Documentation/video4linux/bttv/MAKEDEV
+++ b/Documentation/video4linux/bttv/MAKEDEV
@@ -19,7 +19,6 @@ function makedev () {
19echo "*** new device names ***" 19echo "*** new device names ***"
20makedev video 0 20makedev video 0
21makedev radio 64 21makedev radio 64
22makedev vtx 192
23makedev vbi 224 22makedev vbi 224
24 23
25#echo "*** old device names (for compatibility only) ***" 24#echo "*** old device names (for compatibility only) ***"
diff --git a/Documentation/video4linux/bttv/README b/Documentation/video4linux/bttv/README
index 3a367cdb664e..7cbf4fb6cf31 100644
--- a/Documentation/video4linux/bttv/README
+++ b/Documentation/video4linux/bttv/README
@@ -70,7 +70,7 @@ If you have trouble with some specific TV card, try to ask there
70instead of mailing me directly. The chance that someone with the 70instead of mailing me directly. The chance that someone with the
71same card listens there is much higher... 71same card listens there is much higher...
72 72
73For problems with sound: There are alot of different systems used 73For problems with sound: There are a lot of different systems used
74for TV sound all over the world. And there are also different chips 74for TV sound all over the world. And there are also different chips
75which decode the audio signal. Reports about sound problems ("stereo 75which decode the audio signal. Reports about sound problems ("stereo
76does'nt work") are pretty useless unless you include some details 76does'nt work") are pretty useless unless you include some details
diff --git a/Documentation/video4linux/bttv/README.freeze b/Documentation/video4linux/bttv/README.freeze
index 4259dccc8287..5eddfa076cfb 100644
--- a/Documentation/video4linux/bttv/README.freeze
+++ b/Documentation/video4linux/bttv/README.freeze
@@ -33,7 +33,7 @@ state is stuck.
33 33
34I've seen reports that bttv 0.7.x crashes whereas 0.8.x works rock solid 34I've seen reports that bttv 0.7.x crashes whereas 0.8.x works rock solid
35for some people. Thus probably a small buglet left somewhere in bttv 35for some people. Thus probably a small buglet left somewhere in bttv
360.7.x. I have no idea where exactly, it works stable for me and alot of 360.7.x. I have no idea where exactly, it works stable for me and a lot of
37other people. But in case you have problems with the 0.7.x versions you 37other people. But in case you have problems with the 0.7.x versions you
38can give 0.8.x a try ... 38can give 0.8.x a try ...
39 39
diff --git a/Documentation/video4linux/bttv/Sound-FAQ b/Documentation/video4linux/bttv/Sound-FAQ
index 1e6328f91083..395f6c6fdd98 100644
--- a/Documentation/video4linux/bttv/Sound-FAQ
+++ b/Documentation/video4linux/bttv/Sound-FAQ
@@ -2,13 +2,13 @@
2bttv and sound mini howto 2bttv and sound mini howto
3========================= 3=========================
4 4
5There are alot of different bt848/849/878/879 based boards available. 5There are a lot of different bt848/849/878/879 based boards available.
6Making video work often is not a big deal, because this is handled 6Making video work often is not a big deal, because this is handled
7completely by the bt8xx chip, which is common on all boards. But 7completely by the bt8xx chip, which is common on all boards. But
8sound is handled in slightly different ways on each board. 8sound is handled in slightly different ways on each board.
9 9
10To handle the grabber boards correctly, there is a array tvcards[] in 10To handle the grabber boards correctly, there is a array tvcards[] in
11bttv-cards.c, which holds the informations required for each board. 11bttv-cards.c, which holds the information required for each board.
12Sound will work only, if the correct entry is used (for video it often 12Sound will work only, if the correct entry is used (for video it often
13makes no difference). The bttv driver prints a line to the kernel 13makes no difference). The bttv driver prints a line to the kernel
14log, telling which card type is used. Like this one: 14log, telling which card type is used. Like this one:
diff --git a/Documentation/video4linux/et61x251.txt b/Documentation/video4linux/et61x251.txt
index 1247566c4de3..e0cdae491858 100644
--- a/Documentation/video4linux/et61x251.txt
+++ b/Documentation/video4linux/et61x251.txt
@@ -191,10 +191,10 @@ Syntax: <n>
191Description: Debugging information level, from 0 to 3: 191Description: Debugging information level, from 0 to 3:
192 0 = none (use carefully) 192 0 = none (use carefully)
193 1 = critical errors 193 1 = critical errors
194 2 = significant informations 194 2 = significant information
195 3 = more verbose messages 195 3 = more verbose messages
196 Level 3 is useful for testing only, when only one device 196 Level 3 is useful for testing only, when only one device
197 is used at the same time. It also shows some more informations 197 is used at the same time. It also shows some more information
198 about the hardware being detected. This module parameter can be 198 about the hardware being detected. This module parameter can be
199 changed at runtime thanks to the /sys filesystem interface. 199 changed at runtime thanks to the /sys filesystem interface.
200Default: 2 200Default: 2
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt
index 56ba7bba7168..5bfa9a777d26 100644
--- a/Documentation/video4linux/gspca.txt
+++ b/Documentation/video4linux/gspca.txt
@@ -103,6 +103,7 @@ spca561 046d:092d Logitech QC Elch2
103spca561 046d:092e Logitech QC Elch2 103spca561 046d:092e Logitech QC Elch2
104spca561 046d:092f Logitech QuickCam Express Plus 104spca561 046d:092f Logitech QuickCam Express Plus
105sunplus 046d:0960 Logitech ClickSmart 420 105sunplus 046d:0960 Logitech ClickSmart 420
106nw80x 046d:d001 Logitech QuickCam Pro (dark focus ring)
106sunplus 0471:0322 Philips DMVC1300K 107sunplus 0471:0322 Philips DMVC1300K
107zc3xx 0471:0325 Philips SPC 200 NC 108zc3xx 0471:0325 Philips SPC 200 NC
108zc3xx 0471:0326 Philips SPC 300 NC 109zc3xx 0471:0326 Philips SPC 300 NC
@@ -150,10 +151,12 @@ sunplus 04fc:5330 Digitrex 2110
150sunplus 04fc:5360 Sunplus Generic 151sunplus 04fc:5360 Sunplus Generic
151spca500 04fc:7333 PalmPixDC85 152spca500 04fc:7333 PalmPixDC85
152sunplus 04fc:ffff Pure DigitalDakota 153sunplus 04fc:ffff Pure DigitalDakota
154nw80x 0502:d001 DVC V6
153spca501 0506:00df 3Com HomeConnect Lite 155spca501 0506:00df 3Com HomeConnect Lite
154sunplus 052b:1507 Megapixel 5 Pretec DC-1007 156sunplus 052b:1507 Megapixel 5 Pretec DC-1007
155sunplus 052b:1513 Megapix V4 157sunplus 052b:1513 Megapix V4
156sunplus 052b:1803 MegaImage VI 158sunplus 052b:1803 MegaImage VI
159nw80x 052b:d001 EZCam Pro p35u
157tv8532 0545:808b Veo Stingray 160tv8532 0545:808b Veo Stingray
158tv8532 0545:8333 Veo Stingray 161tv8532 0545:8333 Veo Stingray
159sunplus 0546:3155 Polaroid PDC3070 162sunplus 0546:3155 Polaroid PDC3070
@@ -177,6 +180,7 @@ sunplus 055f:c530 Mustek Gsmart LCD 3
177sunplus 055f:c540 Gsmart D30 180sunplus 055f:c540 Gsmart D30
178sunplus 055f:c630 Mustek MDC4000 181sunplus 055f:c630 Mustek MDC4000
179sunplus 055f:c650 Mustek MDC5500Z 182sunplus 055f:c650 Mustek MDC5500Z
183nw80x 055f:d001 Mustek Wcam 300 mini
180zc3xx 055f:d003 Mustek WCam300A 184zc3xx 055f:d003 Mustek WCam300A
181zc3xx 055f:d004 Mustek WCam300 AN 185zc3xx 055f:d004 Mustek WCam300 AN
182conex 0572:0041 Creative Notebook cx11646 186conex 0572:0041 Creative Notebook cx11646
@@ -195,14 +199,20 @@ gl860 05e3:0503 Genesys Logic PC Camera
195gl860 05e3:f191 Genesys Logic PC Camera 199gl860 05e3:f191 Genesys Logic PC Camera
196spca561 060b:a001 Maxell Compact Pc PM3 200spca561 060b:a001 Maxell Compact Pc PM3
197zc3xx 0698:2003 CTX M730V built in 201zc3xx 0698:2003 CTX M730V built in
202nw80x 06a5:0000 Typhoon Webcam 100 USB
203nw80x 06a5:d001 Divio based webcams
204nw80x 06a5:d800 Divio Chicony TwinkleCam, Trust SpaceCam
198spca500 06bd:0404 Agfa CL20 205spca500 06bd:0404 Agfa CL20
199spca500 06be:0800 Optimedia 206spca500 06be:0800 Optimedia
207nw80x 06be:d001 EZCam Pro p35u
200sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom 208sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom
201spca506 06e1:a190 ADS Instant VCD 209spca506 06e1:a190 ADS Instant VCD
210ov534 06f8:3002 Hercules Blog Webcam
202ov534_9 06f8:3003 Hercules Dualpix HD Weblog 211ov534_9 06f8:3003 Hercules Dualpix HD Weblog
203sonixj 06f8:3004 Hercules Classic Silver 212sonixj 06f8:3004 Hercules Classic Silver
204sonixj 06f8:3008 Hercules Deluxe Optical Glass 213sonixj 06f8:3008 Hercules Deluxe Optical Glass
205pac7302 06f8:3009 Hercules Classic Link 214pac7302 06f8:3009 Hercules Classic Link
215nw80x 0728:d001 AVerMedia Camguard
206spca508 0733:0110 ViewQuest VQ110 216spca508 0733:0110 ViewQuest VQ110
207spca501 0733:0401 Intel Create and Share 217spca501 0733:0401 Intel Create and Share
208spca501 0733:0402 ViewQuest M318B 218spca501 0733:0402 ViewQuest M318B
@@ -265,6 +275,7 @@ pac7302 093a:2629 Genious iSlim 300
265pac7302 093a:262a Webcam 300k 275pac7302 093a:262a Webcam 300k
266pac7302 093a:262c Philips SPC 230 NC 276pac7302 093a:262c Philips SPC 230 NC
267jeilinj 0979:0280 Sakar 57379 277jeilinj 0979:0280 Sakar 57379
278jeilinj 0979:0280 Sportscam DV15
268zc3xx 0ac8:0302 Z-star Vimicro zc0302 279zc3xx 0ac8:0302 Z-star Vimicro zc0302
269vc032x 0ac8:0321 Vimicro generic vc0321 280vc032x 0ac8:0321 Vimicro generic vc0321
270vc032x 0ac8:0323 Vimicro Vc0323 281vc032x 0ac8:0323 Vimicro Vc0323
@@ -302,12 +313,14 @@ sonixj 0c45:60fb Surfer NoName
302sonixj 0c45:60fc LG-LIC300 313sonixj 0c45:60fc LG-LIC300
303sonixj 0c45:60fe Microdia Audio 314sonixj 0c45:60fe Microdia Audio
304sonixj 0c45:6100 PC Camera (SN9C128) 315sonixj 0c45:6100 PC Camera (SN9C128)
316sonixj 0c45:6102 PC Camera (SN9C128)
305sonixj 0c45:610a PC Camera (SN9C128) 317sonixj 0c45:610a PC Camera (SN9C128)
306sonixj 0c45:610b PC Camera (SN9C128) 318sonixj 0c45:610b PC Camera (SN9C128)
307sonixj 0c45:610c PC Camera (SN9C128) 319sonixj 0c45:610c PC Camera (SN9C128)
308sonixj 0c45:610e PC Camera (SN9C128) 320sonixj 0c45:610e PC Camera (SN9C128)
309sonixj 0c45:6128 Microdia/Sonix SNP325 321sonixj 0c45:6128 Microdia/Sonix SNP325
310sonixj 0c45:612a Avant Camera 322sonixj 0c45:612a Avant Camera
323sonixj 0c45:612b Speed-Link REFLECT2
311sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix 324sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix
312sonixj 0c45:6130 Sonix Pccam 325sonixj 0c45:6130 Sonix Pccam
313sonixj 0c45:6138 Sn9c120 Mo4000 326sonixj 0c45:6138 Sn9c120 Mo4000
@@ -364,6 +377,7 @@ t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops
364vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC 377vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC
365pac207 2001:f115 D-Link DSB-C120 378pac207 2001:f115 D-Link DSB-C120
366sq905c 2770:9050 Disney pix micro (CIF) 379sq905c 2770:9050 Disney pix micro (CIF)
380sq905c 2770:9051 Lego Bionicle
367sq905c 2770:9052 Disney pix micro 2 (VGA) 381sq905c 2770:9052 Disney pix micro 2 (VGA)
368sq905c 2770:905c All 11 known cameras with this ID 382sq905c 2770:905c All 11 known cameras with this ID
369sq905 2770:9120 All 24 known cameras with this ID 383sq905 2770:9120 All 24 known cameras with this ID
diff --git a/Documentation/video4linux/meye.txt b/Documentation/video4linux/meye.txt
index bf3af5fe558f..34e2842c70ae 100644
--- a/Documentation/video4linux/meye.txt
+++ b/Documentation/video4linux/meye.txt
@@ -45,8 +45,6 @@ module argument syntax (<param>=<value> when passing the option to the
45module or meye.<param>=<value> on the kernel boot line when meye is 45module or meye.<param>=<value> on the kernel boot line when meye is
46statically linked into the kernel). Those options are: 46statically linked into the kernel). Those options are:
47 47
48 forcev4l1: force use of V4L1 API instead of V4L2
49
50 gbuffers: number of capture buffers, default is 2 (32 max) 48 gbuffers: number of capture buffers, default is 2 (32 max)
51 49
52 gbufsize: size of each capture buffer, default is 614400 50 gbufsize: size of each capture buffer, default is 614400
@@ -79,9 +77,8 @@ Usage:
79Private API: 77Private API:
80------------ 78------------
81 79
82 The driver supports frame grabbing with the video4linux API 80 The driver supports frame grabbing with the video4linux API,
83 (either v4l1 or v4l2), so all video4linux tools (like xawtv) 81 so all video4linux tools (like xawtv) should work with this driver.
84 should work with this driver.
85 82
86 Besides the video4linux interface, the driver has a private interface 83 Besides the video4linux interface, the driver has a private interface
87 for accessing the Motion Eye extended parameters (camera sharpness, 84 for accessing the Motion Eye extended parameters (camera sharpness,
@@ -123,7 +120,4 @@ Private API:
123Bugs / Todo: 120Bugs / Todo:
124------------ 121------------
125 122
126 - the driver could be much cleaned up by removing the v4l1 support.
127 However, this means all v4l1-only applications will stop working.
128
129 - 'motioneye' still uses the meye private v4l1 API extensions. 123 - 'motioneye' still uses the meye private v4l1 API extensions.
diff --git a/Documentation/video4linux/omap3isp.txt b/Documentation/video4linux/omap3isp.txt
new file mode 100644
index 000000000000..69be2c782b98
--- /dev/null
+++ b/Documentation/video4linux/omap3isp.txt
@@ -0,0 +1,278 @@
1OMAP 3 Image Signal Processor (ISP) driver
2
3Copyright (C) 2010 Nokia Corporation
4Copyright (C) 2009 Texas Instruments, Inc.
5
6Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7 Sakari Ailus <sakari.ailus@iki.fi>
8 David Cohen <dacohen@gmail.com>
9
10
11Introduction
12============
13
14This file documents the Texas Instruments OMAP 3 Image Signal Processor (ISP)
15driver located under drivers/media/video/omap3isp. The original driver was
16written by Texas Instruments but since that it has been rewritten (twice) at
17Nokia.
18
19The driver has been successfully used on the following versions of OMAP 3:
20
21 3430
22 3530
23 3630
24
25The driver implements V4L2, Media controller and v4l2_subdev interfaces.
26Sensor, lens and flash drivers using the v4l2_subdev interface in the kernel
27are supported.
28
29
30Split to subdevs
31================
32
33The OMAP 3 ISP is split into V4L2 subdevs, each of the blocks inside the ISP
34having one subdev to represent it. Each of the subdevs provide a V4L2 subdev
35interface to userspace.
36
37 OMAP3 ISP CCP2
38 OMAP3 ISP CSI2a
39 OMAP3 ISP CCDC
40 OMAP3 ISP preview
41 OMAP3 ISP resizer
42 OMAP3 ISP AEWB
43 OMAP3 ISP AF
44 OMAP3 ISP histogram
45
46Each possible link in the ISP is modelled by a link in the Media controller
47interface. For an example program see [2].
48
49
50Controlling the OMAP 3 ISP
51==========================
52
53In general, the settings given to the OMAP 3 ISP take effect at the beginning
54of the following frame. This is done when the module becomes idle during the
55vertical blanking period on the sensor. In memory-to-memory operation the pipe
56is run one frame at a time. Applying the settings is done between the frames.
57
58All the blocks in the ISP, excluding the CSI-2 and possibly the CCP2 receiver,
59insist on receiving complete frames. Sensors must thus never send the ISP
60partial frames.
61
62Autoidle does have issues with some ISP blocks on the 3430, at least.
63Autoidle is only enabled on 3630 when the omap3isp module parameter autoidle
64is non-zero.
65
66
67Events
68======
69
70The OMAP 3 ISP driver does support the V4L2 event interface on CCDC and
71statistics (AEWB, AF and histogram) subdevs.
72
73The CCDC subdev produces V4L2_EVENT_OMAP3ISP_HS_VS type event on HS_VS
74interrupt which is used to signal frame start. The event is triggered exactly
75when the reception of the first line of the frame starts in the CCDC module.
76The event can be subscribed on the CCDC subdev.
77
78(When using parallel interface one must pay account to correct configuration
79of the VS signal polarity. This is automatically correct when using the serial
80receivers.)
81
82Each of the statistics subdevs is able to produce events. An event is
83generated whenever a statistics buffer can be dequeued by a user space
84application using the VIDIOC_OMAP3ISP_STAT_REQ IOCTL. The events available
85are:
86
87 V4L2_EVENT_OMAP3ISP_AEWB
88 V4L2_EVENT_OMAP3ISP_AF
89 V4L2_EVENT_OMAP3ISP_HIST
90
91The type of the event data is struct omap3isp_stat_event_status for these
92ioctls. If there is an error calculating the statistics, there will be an
93event as usual, but no related statistics buffer. In this case
94omap3isp_stat_event_status.buf_err is set to non-zero.
95
96
97Private IOCTLs
98==============
99
100The OMAP 3 ISP driver supports standard V4L2 IOCTLs and controls where
101possible and practical. Much of the functions provided by the ISP, however,
102does not fall under the standard IOCTLs --- gamma tables and configuration of
103statistics collection are examples of such.
104
105In general, there is a private ioctl for configuring each of the blocks
106containing hardware-dependent functions.
107
108The following private IOCTLs are supported:
109
110 VIDIOC_OMAP3ISP_CCDC_CFG
111 VIDIOC_OMAP3ISP_PRV_CFG
112 VIDIOC_OMAP3ISP_AEWB_CFG
113 VIDIOC_OMAP3ISP_HIST_CFG
114 VIDIOC_OMAP3ISP_AF_CFG
115 VIDIOC_OMAP3ISP_STAT_REQ
116 VIDIOC_OMAP3ISP_STAT_EN
117
118The parameter structures used by these ioctls are described in
119include/linux/omap3isp.h. The detailed functions of the ISP itself related to
120a given ISP block is described in the Technical Reference Manuals (TRMs) ---
121see the end of the document for those.
122
123While it is possible to use the ISP driver without any use of these private
124IOCTLs it is not possible to obtain optimal image quality this way. The AEWB,
125AF and histogram modules cannot be used without configuring them using the
126appropriate private IOCTLs.
127
128
129CCDC and preview block IOCTLs
130=============================
131
132The VIDIOC_OMAP3ISP_CCDC_CFG and VIDIOC_OMAP3ISP_PRV_CFG IOCTLs are used to
133configure, enable and disable functions in the CCDC and preview blocks,
134respectively. Both IOCTLs control several functions in the blocks they
135control. VIDIOC_OMAP3ISP_CCDC_CFG IOCTL accepts a pointer to struct
136omap3isp_ccdc_update_config as its argument. Similarly VIDIOC_OMAP3ISP_PRV_CFG
137accepts a pointer to struct omap3isp_prev_update_config. The definition of
138both structures is available in [1].
139
140The update field in the structures tells whether to update the configuration
141for the specific function and the flag tells whether to enable or disable the
142function.
143
144The update and flag bit masks accept the following values. Each separate
145functions in the CCDC and preview blocks is associated with a flag (either
146disable or enable; part of the flag field in the structure) and a pointer to
147configuration data for the function.
148
149Valid values for the update and flag fields are listed here for
150VIDIOC_OMAP3ISP_CCDC_CFG. Values may be or'ed to configure more than one
151function in the same IOCTL call.
152
153 OMAP3ISP_CCDC_ALAW
154 OMAP3ISP_CCDC_LPF
155 OMAP3ISP_CCDC_BLCLAMP
156 OMAP3ISP_CCDC_BCOMP
157 OMAP3ISP_CCDC_FPC
158 OMAP3ISP_CCDC_CULL
159 OMAP3ISP_CCDC_CONFIG_LSC
160 OMAP3ISP_CCDC_TBL_LSC
161
162The corresponding values for the VIDIOC_OMAP3ISP_PRV_CFG are here:
163
164 OMAP3ISP_PREV_LUMAENH
165 OMAP3ISP_PREV_INVALAW
166 OMAP3ISP_PREV_HRZ_MED
167 OMAP3ISP_PREV_CFA
168 OMAP3ISP_PREV_CHROMA_SUPP
169 OMAP3ISP_PREV_WB
170 OMAP3ISP_PREV_BLKADJ
171 OMAP3ISP_PREV_RGB2RGB
172 OMAP3ISP_PREV_COLOR_CONV
173 OMAP3ISP_PREV_YC_LIMIT
174 OMAP3ISP_PREV_DEFECT_COR
175 OMAP3ISP_PREV_GAMMABYPASS
176 OMAP3ISP_PREV_DRK_FRM_CAPTURE
177 OMAP3ISP_PREV_DRK_FRM_SUBTRACT
178 OMAP3ISP_PREV_LENS_SHADING
179 OMAP3ISP_PREV_NF
180 OMAP3ISP_PREV_GAMMA
181
182The associated configuration pointer for the function may not be NULL when
183enabling the function. When disabling a function the configuration pointer is
184ignored.
185
186
187Statistic blocks IOCTLs
188=======================
189
190The statistics subdevs do offer more dynamic configuration options than the
191other subdevs. They can be enabled, disable and reconfigured when the pipeline
192is in streaming state.
193
194The statistics blocks always get the input image data from the CCDC (as the
195histogram memory read isn't implemented). The statistics are dequeueable by
196the user from the statistics subdev nodes using private IOCTLs.
197
198The private IOCTLs offered by the AEWB, AF and histogram subdevs are heavily
199reflected by the register level interface offered by the ISP hardware. There
200are aspects that are purely related to the driver implementation and these are
201discussed next.
202
203VIDIOC_OMAP3ISP_STAT_EN
204-----------------------
205
206This private IOCTL enables/disables a statistic module. If this request is
207done before streaming, it will take effect as soon as the pipeline starts to
208stream. If the pipeline is already streaming, it will take effect as soon as
209the CCDC becomes idle.
210
211VIDIOC_OMAP3ISP_AEWB_CFG, VIDIOC_OMAP3ISP_HIST_CFG and VIDIOC_OMAP3ISP_AF_CFG
212-----------------------------------------------------------------------------
213
214Those IOCTLs are used to configure the modules. They require user applications
215to have an in-depth knowledge of the hardware. Most of the fields explanation
216can be found on OMAP's TRMs. The two following fields common to all the above
217configure private IOCTLs require explanation for better understanding as they
218are not part of the TRM.
219
220omap3isp_[h3a_af/h3a_aewb/hist]_config.buf_size:
221
222The modules handle their buffers internally. The necessary buffer size for the
223module's data output depends on the requested configuration. Although the
224driver supports reconfiguration while streaming, it does not support a
225reconfiguration which requires bigger buffer size than what is already
226internally allocated if the module is enabled. It will return -EBUSY on this
227case. In order to avoid such condition, either disable/reconfigure/enable the
228module or request the necessary buffer size during the first configuration
229while the module is disabled.
230
231The internal buffer size allocation considers the requested configuration's
232minimum buffer size and the value set on buf_size field. If buf_size field is
233out of [minimum, maximum] buffer size range, it's clamped to fit in there.
234The driver then selects the biggest value. The corrected buf_size value is
235written back to user application.
236
237omap3isp_[h3a_af/h3a_aewb/hist]_config.config_counter:
238
239As the configuration doesn't take effect synchronously to the request, the
240driver must provide a way to track this information to provide more accurate
241data. After a configuration is requested, the config_counter returned to user
242space application will be an unique value associated to that request. When
243user application receives an event for buffer availability or when a new
244buffer is requested, this config_counter is used to match a buffer data and a
245configuration.
246
247VIDIOC_OMAP3ISP_STAT_REQ
248------------------------
249
250Send to user space the oldest data available in the internal buffer queue and
251discards such buffer afterwards. The field omap3isp_stat_data.frame_number
252matches with the video buffer's field_count.
253
254
255Technical reference manuals (TRMs) and other documentation
256==========================================================
257
258OMAP 3430 TRM:
259<URL:http://focus.ti.com/pdfs/wtbu/OMAP34xx_ES3.1.x_PUBLIC_TRM_vZM.zip>
260Referenced 2011-03-05.
261
262OMAP 35xx TRM:
263<URL:http://www.ti.com/litv/pdf/spruf98o> Referenced 2011-03-05.
264
265OMAP 3630 TRM:
266<URL:http://focus.ti.com/pdfs/wtbu/OMAP36xx_ES1.x_PUBLIC_TRM_vQ.zip>
267Referenced 2011-03-05.
268
269DM 3730 TRM:
270<URL:http://www.ti.com/litv/pdf/sprugn4h> Referenced 2011-03-06.
271
272
273References
274==========
275
276[1] include/linux/omap3isp.h
277
278[2] http://git.ideasonboard.org/?p=media-ctl.git;a=summary
diff --git a/Documentation/video4linux/pxa_camera.txt b/Documentation/video4linux/pxa_camera.txt
index 4f6d0ca01956..51ed1578b0e8 100644
--- a/Documentation/video4linux/pxa_camera.txt
+++ b/Documentation/video4linux/pxa_camera.txt
@@ -84,12 +84,12 @@ DMA usage
84 transfer is not started. On "End Of Frame" interrupt, the irq handler 84 transfer is not started. On "End Of Frame" interrupt, the irq handler
85 starts the DMA chain. 85 starts the DMA chain.
86 - capture of one videobuffer 86 - capture of one videobuffer
87 The DMA chain starts transfering data into videobuffer RAM pages. 87 The DMA chain starts transferring data into videobuffer RAM pages.
88 When all pages are transfered, the DMA irq is raised on "ENDINTR" status 88 When all pages are transferred, the DMA irq is raised on "ENDINTR" status
89 - finishing one videobuffer 89 - finishing one videobuffer
90 The DMA irq handler marks the videobuffer as "done", and removes it from 90 The DMA irq handler marks the videobuffer as "done", and removes it from
91 the active running queue 91 the active running queue
92 Meanwhile, the next videobuffer (if there is one), is transfered by DMA 92 Meanwhile, the next videobuffer (if there is one), is transferred by DMA
93 - finishing the last videobuffer 93 - finishing the last videobuffer
94 On the DMA irq of the last videobuffer, the QCI is stopped. 94 On the DMA irq of the last videobuffer, the QCI is stopped.
95 95
@@ -101,7 +101,7 @@ DMA usage
101 101
102 This structure is pointed by dma->sg_cpu. 102 This structure is pointed by dma->sg_cpu.
103 The descriptors are used as follows : 103 The descriptors are used as follows :
104 - desc-sg[i]: i-th descriptor, transfering the i-th sg 104 - desc-sg[i]: i-th descriptor, transferring the i-th sg
105 element to the video buffer scatter gather 105 element to the video buffer scatter gather
106 - finisher: has ddadr=DADDR_STOP, dcmd=ENDIRQEN 106 - finisher: has ddadr=DADDR_STOP, dcmd=ENDIRQEN
107 - linker: has ddadr= desc-sg[0] of next video buffer, dcmd=0 107 - linker: has ddadr= desc-sg[0] of next video buffer, dcmd=0
diff --git a/Documentation/video4linux/sh_mobile_ceu_camera.txt b/Documentation/video4linux/sh_mobile_ceu_camera.txt
index cb47e723af74..1e96ce6e2d2f 100644
--- a/Documentation/video4linux/sh_mobile_ceu_camera.txt
+++ b/Documentation/video4linux/sh_mobile_ceu_camera.txt
@@ -37,7 +37,7 @@ Generic scaling / cropping scheme
37-1'- 37-1'-
38 38
39In the above chart minuses and slashes represent "real" data amounts, points and 39In the above chart minuses and slashes represent "real" data amounts, points and
40accents represent "useful" data, basically, CEU scaled amd cropped output, 40accents represent "useful" data, basically, CEU scaled and cropped output,
41mapped back onto the client's source plane. 41mapped back onto the client's source plane.
42 42
43Such a configuration can be produced by user requests: 43Such a configuration can be produced by user requests:
@@ -65,7 +65,7 @@ Do not touch input rectangle - it is already optimal.
65 65
661. Calculate current sensor scales: 661. Calculate current sensor scales:
67 67
68 scale_s = ((3') - (3)) / ((2') - (2)) 68 scale_s = ((2') - (2)) / ((3') - (3))
69 69
702. Calculate "effective" input crop (sensor subwindow) - CEU crop scaled back at 702. Calculate "effective" input crop (sensor subwindow) - CEU crop scaled back at
71current sensor scales onto input window - this is user S_CROP: 71current sensor scales onto input window - this is user S_CROP:
@@ -80,7 +80,7 @@ window:
804. Calculate sensor output window by applying combined scales to real input 804. Calculate sensor output window by applying combined scales to real input
81window: 81window:
82 82
83 width_s_out = ((2') - (2)) / scale_comb 83 width_s_out = ((7') - (7)) = ((2') - (2)) / scale_comb
84 84
855. Apply iterative sensor S_FMT for sensor output window. 855. Apply iterative sensor S_FMT for sensor output window.
86 86
diff --git a/Documentation/video4linux/sn9c102.txt b/Documentation/video4linux/sn9c102.txt
index 73de4050d637..b4f67040403a 100644
--- a/Documentation/video4linux/sn9c102.txt
+++ b/Documentation/video4linux/sn9c102.txt
@@ -214,10 +214,10 @@ Syntax: <n>
214Description: Debugging information level, from 0 to 3: 214Description: Debugging information level, from 0 to 3:
215 0 = none (use carefully) 215 0 = none (use carefully)
216 1 = critical errors 216 1 = critical errors
217 2 = significant informations 217 2 = significant information
218 3 = more verbose messages 218 3 = more verbose messages
219 Level 3 is useful for testing only. It also shows some more 219 Level 3 is useful for testing only. It also shows some more
220 informations about the hardware being detected. 220 information about the hardware being detected.
221 This parameter can be changed at runtime thanks to the /sys 221 This parameter can be changed at runtime thanks to the /sys
222 filesystem interface. 222 filesystem interface.
223Default: 2 223Default: 2
diff --git a/Documentation/video4linux/uvcvideo.txt b/Documentation/video4linux/uvcvideo.txt
new file mode 100644
index 000000000000..848d620dcc5c
--- /dev/null
+++ b/Documentation/video4linux/uvcvideo.txt
@@ -0,0 +1,239 @@
1Linux USB Video Class (UVC) driver
2==================================
3
4This file documents some driver-specific aspects of the UVC driver, such as
5driver-specific ioctls and implementation notes.
6
7Questions and remarks can be sent to the Linux UVC development mailing list at
8linux-uvc-devel@lists.berlios.de.
9
10
11Extension Unit (XU) support
12---------------------------
13
141. Introduction
15
16The UVC specification allows for vendor-specific extensions through extension
17units (XUs). The Linux UVC driver supports extension unit controls (XU controls)
18through two separate mechanisms:
19
20 - through mappings of XU controls to V4L2 controls
21 - through a driver-specific ioctl interface
22
23The first one allows generic V4L2 applications to use XU controls by mapping
24certain XU controls onto V4L2 controls, which then show up during ordinary
25control enumeration.
26
27The second mechanism requires uvcvideo-specific knowledge for the application to
28access XU controls but exposes the entire UVC XU concept to user space for
29maximum flexibility.
30
31Both mechanisms complement each other and are described in more detail below.
32
33
342. Control mappings
35
36The UVC driver provides an API for user space applications to define so-called
37control mappings at runtime. These allow for individual XU controls or byte
38ranges thereof to be mapped to new V4L2 controls. Such controls appear and
39function exactly like normal V4L2 controls (i.e. the stock controls, such as
40brightness, contrast, etc.). However, reading or writing of such a V4L2 controls
41triggers a read or write of the associated XU control.
42
43The ioctl used to create these control mappings is called UVCIOC_CTRL_MAP.
44Previous driver versions (before 0.2.0) required another ioctl to be used
45beforehand (UVCIOC_CTRL_ADD) to pass XU control information to the UVC driver.
46This is no longer necessary as newer uvcvideo versions query the information
47directly from the device.
48
49For details on the UVCIOC_CTRL_MAP ioctl please refer to the section titled
50"IOCTL reference" below.
51
52
533. Driver specific XU control interface
54
55For applications that need to access XU controls directly, e.g. for testing
56purposes, firmware upload, or accessing binary controls, a second mechanism to
57access XU controls is provided in the form of a driver-specific ioctl, namely
58UVCIOC_CTRL_QUERY.
59
60A call to this ioctl allows applications to send queries to the UVC driver that
61directly map to the low-level UVC control requests.
62
63In order to make such a request the UVC unit ID of the control's extension unit
64and the control selector need to be known. This information either needs to be
65hardcoded in the application or queried using other ways such as by parsing the
66UVC descriptor or, if available, using the media controller API to enumerate a
67device's entities.
68
69Unless the control size is already known it is necessary to first make a
70UVC_GET_LEN requests in order to be able to allocate a sufficiently large buffer
71and set the buffer size to the correct value. Similarly, to find out whether
72UVC_GET_CUR or UVC_SET_CUR are valid requests for a given control, a
73UVC_GET_INFO request should be made. The bits 0 (GET supported) and 1 (SET
74supported) of the resulting byte indicate which requests are valid.
75
76With the addition of the UVCIOC_CTRL_QUERY ioctl the UVCIOC_CTRL_GET and
77UVCIOC_CTRL_SET ioctls have become obsolete since their functionality is a
78subset of the former ioctl. For the time being they are still supported but
79application developers are encouraged to use UVCIOC_CTRL_QUERY instead.
80
81For details on the UVCIOC_CTRL_QUERY ioctl please refer to the section titled
82"IOCTL reference" below.
83
84
854. Security
86
87The API doesn't currently provide a fine-grained access control facility. The
88UVCIOC_CTRL_ADD and UVCIOC_CTRL_MAP ioctls require super user permissions.
89
90Suggestions on how to improve this are welcome.
91
92
935. Debugging
94
95In order to debug problems related to XU controls or controls in general it is
96recommended to enable the UVC_TRACE_CONTROL bit in the module parameter 'trace'.
97This causes extra output to be written into the system log.
98
99
1006. IOCTL reference
101
102---- UVCIOC_CTRL_MAP - Map a UVC control to a V4L2 control ----
103
104Argument: struct uvc_xu_control_mapping
105
106Description:
107 This ioctl creates a mapping between a UVC control or part of a UVC
108 control and a V4L2 control. Once mappings are defined, userspace
109 applications can access vendor-defined UVC control through the V4L2
110 control API.
111
112 To create a mapping, applications fill the uvc_xu_control_mapping
113 structure with information about an existing UVC control defined with
114 UVCIOC_CTRL_ADD and a new V4L2 control.
115
116 A UVC control can be mapped to several V4L2 controls. For instance,
117 a UVC pan/tilt control could be mapped to separate pan and tilt V4L2
118 controls. The UVC control is divided into non overlapping fields using
119 the 'size' and 'offset' fields and are then independantly mapped to
120 V4L2 control.
121
122 For signed integer V4L2 controls the data_type field should be set to
123 UVC_CTRL_DATA_TYPE_SIGNED. Other values are currently ignored.
124
125Return value:
126 On success 0 is returned. On error -1 is returned and errno is set
127 appropriately.
128
129 ENOMEM
130 Not enough memory to perform the operation.
131 EPERM
132 Insufficient privileges (super user privileges are required).
133 EINVAL
134 No such UVC control.
135 EOVERFLOW
136 The requested offset and size would overflow the UVC control.
137 EEXIST
138 Mapping already exists.
139
140Data types:
141 * struct uvc_xu_control_mapping
142
143 __u32 id V4L2 control identifier
144 __u8 name[32] V4L2 control name
145 __u8 entity[16] UVC extension unit GUID
146 __u8 selector UVC control selector
147 __u8 size V4L2 control size (in bits)
148 __u8 offset V4L2 control offset (in bits)
149 enum v4l2_ctrl_type
150 v4l2_type V4L2 control type
151 enum uvc_control_data_type
152 data_type UVC control data type
153 struct uvc_menu_info
154 *menu_info Array of menu entries (for menu controls only)
155 __u32 menu_count Number of menu entries (for menu controls only)
156
157 * struct uvc_menu_info
158
159 __u32 value Menu entry value used by the device
160 __u8 name[32] Menu entry name
161
162
163 * enum uvc_control_data_type
164
165 UVC_CTRL_DATA_TYPE_RAW Raw control (byte array)
166 UVC_CTRL_DATA_TYPE_SIGNED Signed integer
167 UVC_CTRL_DATA_TYPE_UNSIGNED Unsigned integer
168 UVC_CTRL_DATA_TYPE_BOOLEAN Boolean
169 UVC_CTRL_DATA_TYPE_ENUM Enumeration
170 UVC_CTRL_DATA_TYPE_BITMASK Bitmask
171
172
173---- UVCIOC_CTRL_QUERY - Query a UVC XU control ----
174
175Argument: struct uvc_xu_control_query
176
177Description:
178 This ioctl queries a UVC XU control identified by its extension unit ID
179 and control selector.
180
181 There are a number of different queries available that closely
182 correspond to the low-level control requests described in the UVC
183 specification. These requests are:
184
185 UVC_GET_CUR
186 Obtain the current value of the control.
187 UVC_GET_MIN
188 Obtain the minimum value of the control.
189 UVC_GET_MAX
190 Obtain the maximum value of the control.
191 UVC_GET_DEF
192 Obtain the default value of the control.
193 UVC_GET_RES
194 Query the resolution of the control, i.e. the step size of the
195 allowed control values.
196 UVC_GET_LEN
197 Query the size of the control in bytes.
198 UVC_GET_INFO
199 Query the control information bitmap, which indicates whether
200 get/set requests are supported.
201 UVC_SET_CUR
202 Update the value of the control.
203
204 Applications must set the 'size' field to the correct length for the
205 control. Exceptions are the UVC_GET_LEN and UVC_GET_INFO queries, for
206 which the size must be set to 2 and 1, respectively. The 'data' field
207 must point to a valid writable buffer big enough to hold the indicated
208 number of data bytes.
209
210 Data is copied directly from the device without any driver-side
211 processing. Applications are responsible for data buffer formatting,
212 including little-endian/big-endian conversion. This is particularly
213 important for the result of the UVC_GET_LEN requests, which is always
214 returned as a little-endian 16-bit integer by the device.
215
216Return value:
217 On success 0 is returned. On error -1 is returned and errno is set
218 appropriately.
219
220 ENOENT
221 The device does not support the given control or the specified
222 extension unit could not be found.
223 ENOBUFS
224 The specified buffer size is incorrect (too big or too small).
225 EINVAL
226 An invalid request code was passed.
227 EBADRQC
228 The given request is not supported by the given control.
229 EFAULT
230 The data pointer references an inaccessible memory area.
231
232Data types:
233 * struct uvc_xu_control_query
234
235 __u8 unit Extension unit ID
236 __u8 selector Control selector
237 __u8 query Request code to send to the device
238 __u16 size Control data size (in bytes)
239 __u8 *data Control value
diff --git a/Documentation/video4linux/v4l2-controls.txt b/Documentation/video4linux/v4l2-controls.txt
index 8773778d23fc..881e7f44491b 100644
--- a/Documentation/video4linux/v4l2-controls.txt
+++ b/Documentation/video4linux/v4l2-controls.txt
@@ -285,6 +285,9 @@ implement g_volatile_ctrl like this:
285The 'new value' union is not used in g_volatile_ctrl. In general controls 285The 'new value' union is not used in g_volatile_ctrl. In general controls
286that need to implement g_volatile_ctrl are read-only controls. 286that need to implement g_volatile_ctrl are read-only controls.
287 287
288Note that if one or more controls in a control cluster are marked as volatile,
289then all the controls in the cluster are seen as volatile.
290
288To mark a control as volatile you have to set the is_volatile flag: 291To mark a control as volatile you have to set the is_volatile flag:
289 292
290 ctrl = v4l2_ctrl_new_std(&sd->ctrl_handler, ...); 293 ctrl = v4l2_ctrl_new_std(&sd->ctrl_handler, ...);
@@ -462,6 +465,15 @@ pointer to the v4l2_ctrl_ops struct that is used for that cluster.
462Obviously, all controls in the cluster array must be initialized to either 465Obviously, all controls in the cluster array must be initialized to either
463a valid control or to NULL. 466a valid control or to NULL.
464 467
468In rare cases you might want to know which controls of a cluster actually
469were set explicitly by the user. For this you can check the 'is_new' flag of
470each control. For example, in the case of a volume/mute cluster the 'is_new'
471flag of the mute control would be set if the user called VIDIOC_S_CTRL for
472mute only. If the user would call VIDIOC_S_EXT_CTRLS for both mute and volume
473controls, then the 'is_new' flag would be 1 for both controls.
474
475The 'is_new' flag is always 1 when called from v4l2_ctrl_handler_setup().
476
465 477
466VIDIOC_LOG_STATUS Support 478VIDIOC_LOG_STATUS Support
467========================= 479=========================
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt
index e831aaca66f8..cf21f7aae976 100644
--- a/Documentation/video4linux/v4l2-framework.txt
+++ b/Documentation/video4linux/v4l2-framework.txt
@@ -44,8 +44,8 @@ All drivers have the following structure:
44 44
452) A way of initializing and commanding sub-devices (if any). 452) A way of initializing and commanding sub-devices (if any).
46 46
473) Creating V4L2 device nodes (/dev/videoX, /dev/vbiX, /dev/radioX and 473) Creating V4L2 device nodes (/dev/videoX, /dev/vbiX and /dev/radioX)
48 /dev/vtxX) and keeping track of device-node specific data. 48 and keeping track of device-node specific data.
49 49
504) Filehandle-specific structs containing per-filehandle data; 504) Filehandle-specific structs containing per-filehandle data;
51 51
@@ -71,6 +71,10 @@ sub-device instances, the video_device struct stores V4L2 device node data
71and in the future a v4l2_fh struct will keep track of filehandle instances 71and in the future a v4l2_fh struct will keep track of filehandle instances
72(this is not yet implemented). 72(this is not yet implemented).
73 73
74The V4L2 framework also optionally integrates with the media framework. If a
75driver sets the struct v4l2_device mdev field, sub-devices and video nodes
76will automatically appear in the media framework as entities.
77
74 78
75struct v4l2_device 79struct v4l2_device
76------------------ 80------------------
@@ -83,11 +87,20 @@ You must register the device instance:
83 87
84 v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev); 88 v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev);
85 89
86Registration will initialize the v4l2_device struct and link dev->driver_data 90Registration will initialize the v4l2_device struct. If the dev->driver_data
87to v4l2_dev. If v4l2_dev->name is empty then it will be set to a value derived 91field is NULL, it will be linked to v4l2_dev.
88from dev (driver name followed by the bus_id, to be precise). If you set it 92
89up before calling v4l2_device_register then it will be untouched. If dev is 93Drivers that want integration with the media device framework need to set
90NULL, then you *must* setup v4l2_dev->name before calling v4l2_device_register. 94dev->driver_data manually to point to the driver-specific device structure
95that embed the struct v4l2_device instance. This is achieved by a
96dev_set_drvdata() call before registering the V4L2 device instance. They must
97also set the struct v4l2_device mdev field to point to a properly initialized
98and registered media_device instance.
99
100If v4l2_dev->name is empty then it will be set to a value derived from dev
101(driver name followed by the bus_id, to be precise). If you set it up before
102calling v4l2_device_register then it will be untouched. If dev is NULL, then
103you *must* setup v4l2_dev->name before calling v4l2_device_register.
91 104
92You can use v4l2_device_set_name() to set the name based on a driver name and 105You can use v4l2_device_set_name() to set the name based on a driver name and
93a driver-global atomic_t instance. This will generate names like ivtv0, ivtv1, 106a driver-global atomic_t instance. This will generate names like ivtv0, ivtv1,
@@ -108,6 +121,7 @@ You unregister with:
108 121
109 v4l2_device_unregister(struct v4l2_device *v4l2_dev); 122 v4l2_device_unregister(struct v4l2_device *v4l2_dev);
110 123
124If the dev->driver_data field points to v4l2_dev, it will be reset to NULL.
111Unregistering will also automatically unregister all subdevs from the device. 125Unregistering will also automatically unregister all subdevs from the device.
112 126
113If you have a hotpluggable device (e.g. a USB device), then when a disconnect 127If you have a hotpluggable device (e.g. a USB device), then when a disconnect
@@ -167,6 +181,21 @@ static int __devinit drv_probe(struct pci_dev *pdev,
167 state->instance = atomic_inc_return(&drv_instance) - 1; 181 state->instance = atomic_inc_return(&drv_instance) - 1;
168} 182}
169 183
184If you have multiple device nodes then it can be difficult to know when it is
185safe to unregister v4l2_device. For this purpose v4l2_device has refcounting
186support. The refcount is increased whenever video_register_device is called and
187it is decreased whenever that device node is released. When the refcount reaches
188zero, then the v4l2_device release() callback is called. You can do your final
189cleanup there.
190
191If other device nodes (e.g. ALSA) are created, then you can increase and
192decrease the refcount manually as well by calling:
193
194void v4l2_device_get(struct v4l2_device *v4l2_dev);
195
196or:
197
198int v4l2_device_put(struct v4l2_device *v4l2_dev);
170 199
171struct v4l2_subdev 200struct v4l2_subdev
172------------------ 201------------------
@@ -192,6 +221,11 @@ You also need a way to go from the low-level struct to v4l2_subdev. For the
192common i2c_client struct the i2c_set_clientdata() call is used to store a 221common i2c_client struct the i2c_set_clientdata() call is used to store a
193v4l2_subdev pointer, for other busses you may have to use other methods. 222v4l2_subdev pointer, for other busses you may have to use other methods.
194 223
224Bridges might also need to store per-subdev private data, such as a pointer to
225bridge-specific per-subdev private data. The v4l2_subdev structure provides
226host private data for that purpose that can be accessed with
227v4l2_get_subdev_hostdata() and v4l2_set_subdev_hostdata().
228
195From the bridge driver perspective you load the sub-device module and somehow 229From the bridge driver perspective you load the sub-device module and somehow
196obtain the v4l2_subdev pointer. For i2c devices this is easy: you call 230obtain the v4l2_subdev pointer. For i2c devices this is easy: you call
197i2c_get_clientdata(). For other busses something similar needs to be done. 231i2c_get_clientdata(). For other busses something similar needs to be done.
@@ -249,6 +283,26 @@ A sub-device driver initializes the v4l2_subdev struct using:
249Afterwards you need to initialize subdev->name with a unique name and set the 283Afterwards you need to initialize subdev->name with a unique name and set the
250module owner. This is done for you if you use the i2c helper functions. 284module owner. This is done for you if you use the i2c helper functions.
251 285
286If integration with the media framework is needed, you must initialize the
287media_entity struct embedded in the v4l2_subdev struct (entity field) by
288calling media_entity_init():
289
290 struct media_pad *pads = &my_sd->pads;
291 int err;
292
293 err = media_entity_init(&sd->entity, npads, pads, 0);
294
295The pads array must have been previously initialized. There is no need to
296manually set the struct media_entity type and name fields, but the revision
297field must be initialized if needed.
298
299A reference to the entity will be automatically acquired/released when the
300subdev device node (if any) is opened/closed.
301
302Don't forget to cleanup the media entity before the sub-device is destroyed:
303
304 media_entity_cleanup(&sd->entity);
305
252A device (bridge) driver needs to register the v4l2_subdev with the 306A device (bridge) driver needs to register the v4l2_subdev with the
253v4l2_device: 307v4l2_device:
254 308
@@ -258,6 +312,9 @@ This can fail if the subdev module disappeared before it could be registered.
258After this function was called successfully the subdev->dev field points to 312After this function was called successfully the subdev->dev field points to
259the v4l2_device. 313the v4l2_device.
260 314
315If the v4l2_device parent device has a non-NULL mdev field, the sub-device
316entity will be automatically registered with the media device.
317
261You can unregister a sub-device using: 318You can unregister a sub-device using:
262 319
263 v4l2_device_unregister_subdev(sd); 320 v4l2_device_unregister_subdev(sd);
@@ -286,7 +343,7 @@ ignored. If you want to check for errors use this:
286 err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_chip_ident, &chip); 343 err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_chip_ident, &chip);
287 344
288Any error except -ENOIOCTLCMD will exit the loop with that error. If no 345Any error except -ENOIOCTLCMD will exit the loop with that error. If no
289errors (except -ENOIOCTLCMD) occured, then 0 is returned. 346errors (except -ENOIOCTLCMD) occurred, then 0 is returned.
290 347
291The second argument to both calls is a group ID. If 0, then all subdevs are 348The second argument to both calls is a group ID. If 0, then all subdevs are
292called. If non-zero, then only those whose group ID match that value will 349called. If non-zero, then only those whose group ID match that value will
@@ -314,6 +371,61 @@ controlled through GPIO pins. This distinction is only relevant when setting
314up the device, but once the subdev is registered it is completely transparent. 371up the device, but once the subdev is registered it is completely transparent.
315 372
316 373
374V4L2 sub-device userspace API
375-----------------------------
376
377Beside exposing a kernel API through the v4l2_subdev_ops structure, V4L2
378sub-devices can also be controlled directly by userspace applications.
379
380Device nodes named v4l-subdevX can be created in /dev to access sub-devices
381directly. If a sub-device supports direct userspace configuration it must set
382the V4L2_SUBDEV_FL_HAS_DEVNODE flag before being registered.
383
384After registering sub-devices, the v4l2_device driver can create device nodes
385for all registered sub-devices marked with V4L2_SUBDEV_FL_HAS_DEVNODE by calling
386v4l2_device_register_subdev_nodes(). Those device nodes will be automatically
387removed when sub-devices are unregistered.
388
389The device node handles a subset of the V4L2 API.
390
391VIDIOC_QUERYCTRL
392VIDIOC_QUERYMENU
393VIDIOC_G_CTRL
394VIDIOC_S_CTRL
395VIDIOC_G_EXT_CTRLS
396VIDIOC_S_EXT_CTRLS
397VIDIOC_TRY_EXT_CTRLS
398
399 The controls ioctls are identical to the ones defined in V4L2. They
400 behave identically, with the only exception that they deal only with
401 controls implemented in the sub-device. Depending on the driver, those
402 controls can be also be accessed through one (or several) V4L2 device
403 nodes.
404
405VIDIOC_DQEVENT
406VIDIOC_SUBSCRIBE_EVENT
407VIDIOC_UNSUBSCRIBE_EVENT
408
409 The events ioctls are identical to the ones defined in V4L2. They
410 behave identically, with the only exception that they deal only with
411 events generated by the sub-device. Depending on the driver, those
412 events can also be reported by one (or several) V4L2 device nodes.
413
414 Sub-device drivers that want to use events need to set the
415 V4L2_SUBDEV_USES_EVENTS v4l2_subdev::flags and initialize
416 v4l2_subdev::nevents to events queue depth before registering the
417 sub-device. After registration events can be queued as usual on the
418 v4l2_subdev::devnode device node.
419
420 To properly support events, the poll() file operation is also
421 implemented.
422
423Private ioctls
424
425 All ioctls not in the above list are passed directly to the sub-device
426 driver through the core::ioctl operation.
427
428
317I2C sub-device drivers 429I2C sub-device drivers
318---------------------- 430----------------------
319 431
@@ -448,6 +560,14 @@ You should also set these fields:
448- ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance 560- ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance
449 (highly recommended to use this and it might become compulsory in the 561 (highly recommended to use this and it might become compulsory in the
450 future!), then set this to your v4l2_ioctl_ops struct. 562 future!), then set this to your v4l2_ioctl_ops struct.
563- lock: leave to NULL if you want to do all the locking in the driver.
564 Otherwise you give it a pointer to a struct mutex_lock and before any
565 of the v4l2_file_operations is called this lock will be taken by the
566 core and released afterwards.
567- prio: keeps track of the priorities. Used to implement VIDIOC_G/S_PRIORITY.
568 If left to NULL, then it will use the struct v4l2_prio_state in v4l2_device.
569 If you want to have a separate priority state per (group of) device node(s),
570 then you can point it to your own struct v4l2_prio_state.
451- parent: you only set this if v4l2_device was registered with NULL as 571- parent: you only set this if v4l2_device was registered with NULL as
452 the parent device struct. This only happens in cases where one hardware 572 the parent device struct. This only happens in cases where one hardware
453 device has multiple PCI devices that all share the same v4l2_device core. 573 device has multiple PCI devices that all share the same v4l2_device core.
@@ -457,13 +577,50 @@ You should also set these fields:
457 (cx8802). Since the v4l2_device cannot be associated with a particular 577 (cx8802). Since the v4l2_device cannot be associated with a particular
458 PCI device it is setup without a parent device. But when the struct 578 PCI device it is setup without a parent device. But when the struct
459 video_device is setup you do know which parent PCI device to use. 579 video_device is setup you do know which parent PCI device to use.
580- flags: optional. Set to V4L2_FL_USE_FH_PRIO if you want to let the framework
581 handle the VIDIOC_G/S_PRIORITY ioctls. This requires that you use struct
582 v4l2_fh. Eventually this flag will disappear once all drivers use the core
583 priority handling. But for now it has to be set explicitly.
584
585If you use v4l2_ioctl_ops, then you should set .unlocked_ioctl to video_ioctl2
586in your v4l2_file_operations struct.
460 587
461If you use v4l2_ioctl_ops, then you should set either .unlocked_ioctl or 588Do not use .ioctl! This is deprecated and will go away in the future.
462.ioctl to video_ioctl2 in your v4l2_file_operations struct.
463 589
464The v4l2_file_operations struct is a subset of file_operations. The main 590The v4l2_file_operations struct is a subset of file_operations. The main
465difference is that the inode argument is omitted since it is never used. 591difference is that the inode argument is omitted since it is never used.
466 592
593If integration with the media framework is needed, you must initialize the
594media_entity struct embedded in the video_device struct (entity field) by
595calling media_entity_init():
596
597 struct media_pad *pad = &my_vdev->pad;
598 int err;
599
600 err = media_entity_init(&vdev->entity, 1, pad, 0);
601
602The pads array must have been previously initialized. There is no need to
603manually set the struct media_entity type and name fields.
604
605A reference to the entity will be automatically acquired/released when the
606video device is opened/closed.
607
608v4l2_file_operations and locking
609--------------------------------
610
611You can set a pointer to a mutex_lock in struct video_device. Usually this
612will be either a top-level mutex or a mutex per device node. If you want
613finer-grained locking then you have to set it to NULL and do you own locking.
614
615If a lock is specified then all file operations will be serialized on that
616lock. If you use videobuf then you must pass the same lock to the videobuf
617queue initialize function: if videobuf has to wait for a frame to arrive, then
618it will temporarily unlock the lock and relock it afterwards. If your driver
619also waits in the code, then you should do the same to allow other processes
620to access the device node while the first process is waiting for something.
621
622The implementation of a hotplug disconnect should also take the lock before
623calling v4l2_device_disconnect.
467 624
468video_device registration 625video_device registration
469------------------------- 626-------------------------
@@ -477,13 +634,15 @@ for you.
477 return err; 634 return err;
478 } 635 }
479 636
637If the v4l2_device parent device has a non-NULL mdev field, the video device
638entity will be automatically registered with the media device.
639
480Which device is registered depends on the type argument. The following 640Which device is registered depends on the type argument. The following
481types exist: 641types exist:
482 642
483VFL_TYPE_GRABBER: videoX for video input/output devices 643VFL_TYPE_GRABBER: videoX for video input/output devices
484VFL_TYPE_VBI: vbiX for vertical blank data (i.e. closed captions, teletext) 644VFL_TYPE_VBI: vbiX for vertical blank data (i.e. closed captions, teletext)
485VFL_TYPE_RADIO: radioX for radio tuners 645VFL_TYPE_RADIO: radioX for radio tuners
486VFL_TYPE_VTX: vtxX for teletext devices (deprecated, don't use)
487 646
488The last argument gives you a certain amount of control over the device 647The last argument gives you a certain amount of control over the device
489device node number used (i.e. the X in videoX). Normally you will pass -1 648device node number used (i.e. the X in videoX). Normally you will pass -1
@@ -547,13 +706,19 @@ from /dev).
547 706
548After video_unregister_device() returns no new opens can be done. However, 707After video_unregister_device() returns no new opens can be done. However,
549in the case of USB devices some application might still have one of these 708in the case of USB devices some application might still have one of these
550device nodes open. So after the unregister all file operations will return 709device nodes open. So after the unregister all file operations (except
551an error as well, except for the ioctl and unlocked_ioctl file operations: 710release, of course) will return an error as well.
552those will still be passed on since some buffer ioctls may still be needed.
553 711
554When the last user of the video device node exits, then the vdev->release() 712When the last user of the video device node exits, then the vdev->release()
555callback is called and you can do the final cleanup there. 713callback is called and you can do the final cleanup there.
556 714
715Don't forget to cleanup the media entity associated with the video device if
716it has been initialized:
717
718 media_entity_cleanup(&vdev->entity);
719
720This can be done from the release callback.
721
557 722
558video_device helper functions 723video_device helper functions
559----------------------------- 724-----------------------------
@@ -613,39 +778,25 @@ struct v4l2_fh
613-------------- 778--------------
614 779
615struct v4l2_fh provides a way to easily keep file handle specific data 780struct v4l2_fh provides a way to easily keep file handle specific data
616that is used by the V4L2 framework. Using v4l2_fh is optional for 781that is used by the V4L2 framework. New drivers must use struct v4l2_fh
617drivers. 782since it is also used to implement priority handling (VIDIOC_G/S_PRIORITY)
783if the video_device flag V4L2_FL_USE_FH_PRIO is also set.
618 784
619The users of v4l2_fh (in the V4L2 framework, not the driver) know 785The users of v4l2_fh (in the V4L2 framework, not the driver) know
620whether a driver uses v4l2_fh as its file->private_data pointer by 786whether a driver uses v4l2_fh as its file->private_data pointer by
621testing the V4L2_FL_USES_V4L2_FH bit in video_device->flags. 787testing the V4L2_FL_USES_V4L2_FH bit in video_device->flags. This bit is
622 788set whenever v4l2_fh_init() is called.
623Useful functions:
624
625- v4l2_fh_init()
626
627 Initialise the file handle. This *MUST* be performed in the driver's
628 v4l2_file_operations->open() handler.
629
630- v4l2_fh_add()
631
632 Add a v4l2_fh to video_device file handle list. May be called after
633 initialising the file handle.
634
635- v4l2_fh_del()
636
637 Unassociate the file handle from video_device(). The file handle
638 exit function may now be called.
639 789
640- v4l2_fh_exit() 790struct v4l2_fh is allocated as a part of the driver's own file handle
791structure and file->private_data is set to it in the driver's open
792function by the driver.
641 793
642 Uninitialise the file handle. After uninitialisation the v4l2_fh 794In many cases the struct v4l2_fh will be embedded in a larger structure.
643 memory can be freed. 795In that case you should call v4l2_fh_init+v4l2_fh_add in open() and
796v4l2_fh_del+v4l2_fh_exit in release().
644 797
645struct v4l2_fh is allocated as a part of the driver's own file handle 798Drivers can extract their own file handle structure by using the container_of
646structure and is set to file->private_data in the driver's open 799macro. Example:
647function by the driver. Drivers can extract their own file handle
648structure by using the container_of macro. Example:
649 800
650struct my_fh { 801struct my_fh {
651 int blah; 802 int blah;
@@ -662,15 +813,21 @@ int my_open(struct file *file)
662 813
663 ... 814 ...
664 815
816 my_fh = kzalloc(sizeof(*my_fh), GFP_KERNEL);
817
818 ...
819
665 ret = v4l2_fh_init(&my_fh->fh, vfd); 820 ret = v4l2_fh_init(&my_fh->fh, vfd);
666 if (ret) 821 if (ret) {
822 kfree(my_fh);
667 return ret; 823 return ret;
824 }
668 825
669 v4l2_fh_add(&my_fh->fh); 826 ...
670 827
671 file->private_data = &my_fh->fh; 828 file->private_data = &my_fh->fh;
672 829 v4l2_fh_add(&my_fh->fh);
673 ... 830 return 0;
674} 831}
675 832
676int my_release(struct file *file) 833int my_release(struct file *file)
@@ -679,8 +836,65 @@ int my_release(struct file *file)
679 struct my_fh *my_fh = container_of(fh, struct my_fh, fh); 836 struct my_fh *my_fh = container_of(fh, struct my_fh, fh);
680 837
681 ... 838 ...
839 v4l2_fh_del(&my_fh->fh);
840 v4l2_fh_exit(&my_fh->fh);
841 kfree(my_fh);
842 return 0;
682} 843}
683 844
845Below is a short description of the v4l2_fh functions used:
846
847int v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev)
848
849 Initialise the file handle. This *MUST* be performed in the driver's
850 v4l2_file_operations->open() handler.
851
852void v4l2_fh_add(struct v4l2_fh *fh)
853
854 Add a v4l2_fh to video_device file handle list. Must be called once the
855 file handle is completely initialized.
856
857void v4l2_fh_del(struct v4l2_fh *fh)
858
859 Unassociate the file handle from video_device(). The file handle
860 exit function may now be called.
861
862void v4l2_fh_exit(struct v4l2_fh *fh)
863
864 Uninitialise the file handle. After uninitialisation the v4l2_fh
865 memory can be freed.
866
867
868If struct v4l2_fh is not embedded, then you can use these helper functions:
869
870int v4l2_fh_open(struct file *filp)
871
872 This allocates a struct v4l2_fh, initializes it and adds it to the struct
873 video_device associated with the file struct.
874
875int v4l2_fh_release(struct file *filp)
876
877 This deletes it from the struct video_device associated with the file
878 struct, uninitialised the v4l2_fh and frees it.
879
880These two functions can be plugged into the v4l2_file_operation's open() and
881release() ops.
882
883
884Several drivers need to do something when the first file handle is opened and
885when the last file handle closes. Two helper functions were added to check
886whether the v4l2_fh struct is the only open filehandle of the associated
887device node:
888
889int v4l2_fh_is_singular(struct v4l2_fh *fh)
890
891 Returns 1 if the file handle is the only open file handle, else 0.
892
893int v4l2_fh_is_singular_file(struct file *filp)
894
895 Same, but it calls v4l2_fh_is_singular with filp->private_data.
896
897
684V4L2 events 898V4L2 events
685----------- 899-----------
686 900
diff --git a/Documentation/video4linux/v4lgrab.c b/Documentation/video4linux/v4lgrab.c
deleted file mode 100644
index c8ded175796e..000000000000
--- a/Documentation/video4linux/v4lgrab.c
+++ /dev/null
@@ -1,201 +0,0 @@
1/* Simple Video4Linux image grabber. */
2/*
3 * Video4Linux Driver Test/Example Framegrabbing Program
4 *
5 * Compile with:
6 * gcc -s -Wall -Wstrict-prototypes v4lgrab.c -o v4lgrab
7 * Use as:
8 * v4lgrab >image.ppm
9 *
10 * Copyright (C) 1998-05-03, Phil Blundell <philb@gnu.org>
11 * Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c
12 * with minor modifications (Dave Forrest, drf5n@virginia.edu).
13 *
14 *
15 * For some cameras you may need to pre-load libv4l to perform
16 * the necessary decompression, e.g.:
17 *
18 * export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so
19 * ./v4lgrab >image.ppm
20 *
21 * see http://hansdegoede.livejournal.com/3636.html for details.
22 *
23 */
24
25#include <unistd.h>
26#include <sys/types.h>
27#include <sys/stat.h>
28#include <fcntl.h>
29#include <stdio.h>
30#include <sys/ioctl.h>
31#include <stdlib.h>
32
33#include <linux/types.h>
34#include <linux/videodev.h>
35
36#define VIDEO_DEV "/dev/video0"
37
38/* Stole this from tvset.c */
39
40#define READ_VIDEO_PIXEL(buf, format, depth, r, g, b) \
41{ \
42 switch (format) \
43 { \
44 case VIDEO_PALETTE_GREY: \
45 switch (depth) \
46 { \
47 case 4: \
48 case 6: \
49 case 8: \
50 (r) = (g) = (b) = (*buf++ << 8);\
51 break; \
52 \
53 case 16: \
54 (r) = (g) = (b) = \
55 *((unsigned short *) buf); \
56 buf += 2; \
57 break; \
58 } \
59 break; \
60 \
61 \
62 case VIDEO_PALETTE_RGB565: \
63 { \
64 unsigned short tmp = *(unsigned short *)buf; \
65 (r) = tmp&0xF800; \
66 (g) = (tmp<<5)&0xFC00; \
67 (b) = (tmp<<11)&0xF800; \
68 buf += 2; \
69 } \
70 break; \
71 \
72 case VIDEO_PALETTE_RGB555: \
73 (r) = (buf[0]&0xF8)<<8; \
74 (g) = ((buf[0] << 5 | buf[1] >> 3)&0xF8)<<8; \
75 (b) = ((buf[1] << 2 ) & 0xF8)<<8; \
76 buf += 2; \
77 break; \
78 \
79 case VIDEO_PALETTE_RGB24: \
80 (r) = buf[0] << 8; (g) = buf[1] << 8; \
81 (b) = buf[2] << 8; \
82 buf += 3; \
83 break; \
84 \
85 default: \
86 fprintf(stderr, \
87 "Format %d not yet supported\n", \
88 format); \
89 } \
90}
91
92static int get_brightness_adj(unsigned char *image, long size, int *brightness) {
93 long i, tot = 0;
94 for (i=0;i<size*3;i++)
95 tot += image[i];
96 *brightness = (128 - tot/(size*3))/3;
97 return !((tot/(size*3)) >= 126 && (tot/(size*3)) <= 130);
98}
99
100int main(int argc, char ** argv)
101{
102 int fd = open(VIDEO_DEV, O_RDONLY), f;
103 struct video_capability cap;
104 struct video_window win;
105 struct video_picture vpic;
106
107 unsigned char *buffer, *src;
108 int bpp = 24, r = 0, g = 0, b = 0;
109 unsigned int i, src_depth = 16;
110
111 if (fd < 0) {
112 perror(VIDEO_DEV);
113 exit(1);
114 }
115
116 if (ioctl(fd, VIDIOCGCAP, &cap) < 0) {
117 perror("VIDIOGCAP");
118 fprintf(stderr, "(" VIDEO_DEV " not a video4linux device?)\n");
119 close(fd);
120 exit(1);
121 }
122
123 if (ioctl(fd, VIDIOCGWIN, &win) < 0) {
124 perror("VIDIOCGWIN");
125 close(fd);
126 exit(1);
127 }
128
129 if (ioctl(fd, VIDIOCGPICT, &vpic) < 0) {
130 perror("VIDIOCGPICT");
131 close(fd);
132 exit(1);
133 }
134
135 if (cap.type & VID_TYPE_MONOCHROME) {
136 vpic.depth=8;
137 vpic.palette=VIDEO_PALETTE_GREY; /* 8bit grey */
138 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
139 vpic.depth=6;
140 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
141 vpic.depth=4;
142 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
143 fprintf(stderr, "Unable to find a supported capture format.\n");
144 close(fd);
145 exit(1);
146 }
147 }
148 }
149 } else {
150 vpic.depth=24;
151 vpic.palette=VIDEO_PALETTE_RGB24;
152
153 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
154 vpic.palette=VIDEO_PALETTE_RGB565;
155 vpic.depth=16;
156
157 if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
158 vpic.palette=VIDEO_PALETTE_RGB555;
159 vpic.depth=15;
160
161 if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
162 fprintf(stderr, "Unable to find a supported capture format.\n");
163 return -1;
164 }
165 }
166 }
167 }
168
169 buffer = malloc(win.width * win.height * bpp);
170 if (!buffer) {
171 fprintf(stderr, "Out of memory.\n");
172 exit(1);
173 }
174
175 do {
176 int newbright;
177 read(fd, buffer, win.width * win.height * bpp);
178 f = get_brightness_adj(buffer, win.width * win.height, &newbright);
179 if (f) {
180 vpic.brightness += (newbright << 8);
181 if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
182 perror("VIDIOSPICT");
183 break;
184 }
185 }
186 } while (f);
187
188 fprintf(stdout, "P6\n%d %d 255\n", win.width, win.height);
189
190 src = buffer;
191
192 for (i = 0; i < win.width * win.height; i++) {
193 READ_VIDEO_PIXEL(src, vpic.palette, src_depth, r, g, b);
194 fputc(r>>8, stdout);
195 fputc(g>>8, stdout);
196 fputc(b>>8, stdout);
197 }
198
199 close(fd);
200 return 0;
201}
diff --git a/Documentation/video4linux/videobuf b/Documentation/video4linux/videobuf
index 17a1f9abf260..1d00d7f15b8f 100644
--- a/Documentation/video4linux/videobuf
+++ b/Documentation/video4linux/videobuf
@@ -247,8 +247,6 @@ calls. The relevant helper functions are:
247 int nonblocking); 247 int nonblocking);
248 int videobuf_streamon(struct videobuf_queue *q); 248 int videobuf_streamon(struct videobuf_queue *q);
249 int videobuf_streamoff(struct videobuf_queue *q); 249 int videobuf_streamoff(struct videobuf_queue *q);
250 int videobuf_cgmbuf(struct videobuf_queue *q, struct video_mbuf *mbuf,
251 int count);
252 250
253So, for example, a VIDIOC_REQBUFS call turns into a call to the driver's 251So, for example, a VIDIOC_REQBUFS call turns into a call to the driver's
254vidioc_reqbufs() callback which, in turn, usually only needs to locate the 252vidioc_reqbufs() callback which, in turn, usually only needs to locate the
@@ -258,10 +256,7 @@ boilerplate in a lot of V4L2 drivers.
258 256
259The vidioc_streamon() and vidioc_streamoff() functions will be a bit more 257The vidioc_streamon() and vidioc_streamoff() functions will be a bit more
260complex, of course, since they will also need to deal with starting and 258complex, of course, since they will also need to deal with starting and
261stopping the capture engine. videobuf_cgmbuf(), called from the driver's 259stopping the capture engine.
262vidiocgmbuf() function, only exists if the V4L1 compatibility module has
263been selected with CONFIG_VIDEO_V4L1_COMPAT, so its use must be surrounded
264with #ifdef directives.
265 260
266Buffer allocation 261Buffer allocation
267 262
diff --git a/Documentation/video4linux/w9968cf.txt b/Documentation/video4linux/w9968cf.txt
index 05138e8aea07..9649450f3b90 100644
--- a/Documentation/video4linux/w9968cf.txt
+++ b/Documentation/video4linux/w9968cf.txt
@@ -413,7 +413,7 @@ Syntax: <n>
413Description: Debugging information level, from 0 to 6: 413Description: Debugging information level, from 0 to 6:
414 0 = none (use carefully) 414 0 = none (use carefully)
415 1 = critical errors 415 1 = critical errors
416 2 = significant informations 416 2 = significant information
417 3 = configuration or general messages 417 3 = configuration or general messages
418 4 = warnings 418 4 = warnings
419 5 = called functions 419 5 = called functions
diff --git a/Documentation/video4linux/zc0301.txt b/Documentation/video4linux/zc0301.txt
index befdfdacdc5b..b41c83cf09f4 100644
--- a/Documentation/video4linux/zc0301.txt
+++ b/Documentation/video4linux/zc0301.txt
@@ -181,10 +181,10 @@ Syntax: <n>
181Description: Debugging information level, from 0 to 3: 181Description: Debugging information level, from 0 to 3:
182 0 = none (use carefully) 182 0 = none (use carefully)
183 1 = critical errors 183 1 = critical errors
184 2 = significant informations 184 2 = significant information
185 3 = more verbose messages 185 3 = more verbose messages
186 Level 3 is useful for testing only, when only one device 186 Level 3 is useful for testing only, when only one device
187 is used at the same time. It also shows some more informations 187 is used at the same time. It also shows some information
188 about the hardware being detected. This module parameter can be 188 about the hardware being detected. This module parameter can be
189 changed at runtime thanks to the /sys filesystem interface. 189 changed at runtime thanks to the /sys filesystem interface.
190Default: 2 190Default: 2
@@ -261,7 +261,7 @@ the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'.
261 261
26211. Credits 26211. Credits
263=========== 263===========
264- Informations about the chip internals needed to enable the I2C protocol have 264- Information about the chip internals needed to enable the I2C protocol have
265 been taken from the documentation of the ZC030x Video4Linux1 driver written 265 been taken from the documentation of the ZC030x Video4Linux1 driver written
266 by Andrew Birkett <andy@nobugs.org>; 266 by Andrew Birkett <andy@nobugs.org>;
267- The initialization values of the ZC0301 controller connected to the PAS202BCB 267- The initialization values of the ZC0301 controller connected to the PAS202BCB
diff --git a/Documentation/virtual/00-INDEX b/Documentation/virtual/00-INDEX
new file mode 100644
index 000000000000..fe0251c4cfb7
--- /dev/null
+++ b/Documentation/virtual/00-INDEX
@@ -0,0 +1,10 @@
1Virtualization support in the Linux kernel.
2
300-INDEX
4 - this file.
5kvm/
6 - Kernel Virtual Machine. See also http://linux-kvm.org
7lguest/
8 - Extremely simple hypervisor for experimental/educational use.
9uml/
10 - User Mode Linux, builds/runs Linux kernel as a userspace program.
diff --git a/Documentation/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index 5f5b64982b1a..42542eb802ca 100644
--- a/Documentation/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -166,7 +166,7 @@ Returns: 0 on success, -1 on error
166 166
167This ioctl is obsolete and has been removed. 167This ioctl is obsolete and has been removed.
168 168
1694.6 KVM_CREATE_VCPU 1694.7 KVM_CREATE_VCPU
170 170
171Capability: basic 171Capability: basic
172Architectures: all 172Architectures: all
@@ -175,9 +175,12 @@ Parameters: vcpu id (apic id on x86)
175Returns: vcpu fd on success, -1 on error 175Returns: vcpu fd on success, -1 on error
176 176
177This API adds a vcpu to a virtual machine. The vcpu id is a small integer 177This API adds a vcpu to a virtual machine. The vcpu id is a small integer
178in the range [0, max_vcpus). 178in the range [0, max_vcpus). You can use KVM_CAP_NR_VCPUS of the
179KVM_CHECK_EXTENSION ioctl() to determine the value for max_vcpus at run-time.
180If the KVM_CAP_NR_VCPUS does not exist, you should assume that max_vcpus is 4
181cpus max.
179 182
1804.7 KVM_GET_DIRTY_LOG (vm ioctl) 1834.8 KVM_GET_DIRTY_LOG (vm ioctl)
181 184
182Capability: basic 185Capability: basic
183Architectures: x86 186Architectures: x86
@@ -200,7 +203,7 @@ since the last call to this ioctl. Bit 0 is the first page in the
200memory slot. Ensure the entire structure is cleared to avoid padding 203memory slot. Ensure the entire structure is cleared to avoid padding
201issues. 204issues.
202 205
2034.8 KVM_SET_MEMORY_ALIAS 2064.9 KVM_SET_MEMORY_ALIAS
204 207
205Capability: basic 208Capability: basic
206Architectures: x86 209Architectures: x86
@@ -210,7 +213,7 @@ Returns: 0 (success), -1 (error)
210 213
211This ioctl is obsolete and has been removed. 214This ioctl is obsolete and has been removed.
212 215
2134.9 KVM_RUN 2164.10 KVM_RUN
214 217
215Capability: basic 218Capability: basic
216Architectures: all 219Architectures: all
@@ -226,7 +229,7 @@ obtained by mmap()ing the vcpu fd at offset 0, with the size given by
226KVM_GET_VCPU_MMAP_SIZE. The parameter block is formatted as a 'struct 229KVM_GET_VCPU_MMAP_SIZE. The parameter block is formatted as a 'struct
227kvm_run' (see below). 230kvm_run' (see below).
228 231
2294.10 KVM_GET_REGS 2324.11 KVM_GET_REGS
230 233
231Capability: basic 234Capability: basic
232Architectures: all 235Architectures: all
@@ -246,7 +249,7 @@ struct kvm_regs {
246 __u64 rip, rflags; 249 __u64 rip, rflags;
247}; 250};
248 251
2494.11 KVM_SET_REGS 2524.12 KVM_SET_REGS
250 253
251Capability: basic 254Capability: basic
252Architectures: all 255Architectures: all
@@ -258,10 +261,10 @@ Writes the general purpose registers into the vcpu.
258 261
259See KVM_GET_REGS for the data structure. 262See KVM_GET_REGS for the data structure.
260 263
2614.12 KVM_GET_SREGS 2644.13 KVM_GET_SREGS
262 265
263Capability: basic 266Capability: basic
264Architectures: x86 267Architectures: x86, ppc
265Type: vcpu ioctl 268Type: vcpu ioctl
266Parameters: struct kvm_sregs (out) 269Parameters: struct kvm_sregs (out)
267Returns: 0 on success, -1 on error 270Returns: 0 on success, -1 on error
@@ -279,14 +282,16 @@ struct kvm_sregs {
279 __u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64]; 282 __u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64];
280}; 283};
281 284
285/* ppc -- see arch/powerpc/include/asm/kvm.h */
286
282interrupt_bitmap is a bitmap of pending external interrupts. At most 287interrupt_bitmap is a bitmap of pending external interrupts. At most
283one bit may be set. This interrupt has been acknowledged by the APIC 288one bit may be set. This interrupt has been acknowledged by the APIC
284but not yet injected into the cpu core. 289but not yet injected into the cpu core.
285 290
2864.13 KVM_SET_SREGS 2914.14 KVM_SET_SREGS
287 292
288Capability: basic 293Capability: basic
289Architectures: x86 294Architectures: x86, ppc
290Type: vcpu ioctl 295Type: vcpu ioctl
291Parameters: struct kvm_sregs (in) 296Parameters: struct kvm_sregs (in)
292Returns: 0 on success, -1 on error 297Returns: 0 on success, -1 on error
@@ -294,7 +299,7 @@ Returns: 0 on success, -1 on error
294Writes special registers into the vcpu. See KVM_GET_SREGS for the 299Writes special registers into the vcpu. See KVM_GET_SREGS for the
295data structures. 300data structures.
296 301
2974.14 KVM_TRANSLATE 3024.15 KVM_TRANSLATE
298 303
299Capability: basic 304Capability: basic
300Architectures: x86 305Architectures: x86
@@ -317,16 +322,16 @@ struct kvm_translation {
317 __u8 pad[5]; 322 __u8 pad[5];
318}; 323};
319 324
3204.15 KVM_INTERRUPT 3254.16 KVM_INTERRUPT
321 326
322Capability: basic 327Capability: basic
323Architectures: x86 328Architectures: x86, ppc
324Type: vcpu ioctl 329Type: vcpu ioctl
325Parameters: struct kvm_interrupt (in) 330Parameters: struct kvm_interrupt (in)
326Returns: 0 on success, -1 on error 331Returns: 0 on success, -1 on error
327 332
328Queues a hardware interrupt vector to be injected. This is only 333Queues a hardware interrupt vector to be injected. This is only
329useful if in-kernel local APIC is not used. 334useful if in-kernel local APIC or equivalent is not used.
330 335
331/* for KVM_INTERRUPT */ 336/* for KVM_INTERRUPT */
332struct kvm_interrupt { 337struct kvm_interrupt {
@@ -334,9 +339,38 @@ struct kvm_interrupt {
334 __u32 irq; 339 __u32 irq;
335}; 340};
336 341
342X86:
343
337Note 'irq' is an interrupt vector, not an interrupt pin or line. 344Note 'irq' is an interrupt vector, not an interrupt pin or line.
338 345
3394.16 KVM_DEBUG_GUEST 346PPC:
347
348Queues an external interrupt to be injected. This ioctl is overleaded
349with 3 different irq values:
350
351a) KVM_INTERRUPT_SET
352
353 This injects an edge type external interrupt into the guest once it's ready
354 to receive interrupts. When injected, the interrupt is done.
355
356b) KVM_INTERRUPT_UNSET
357
358 This unsets any pending interrupt.
359
360 Only available with KVM_CAP_PPC_UNSET_IRQ.
361
362c) KVM_INTERRUPT_SET_LEVEL
363
364 This injects a level type external interrupt into the guest context. The
365 interrupt stays pending until a specific ioctl with KVM_INTERRUPT_UNSET
366 is triggered.
367
368 Only available with KVM_CAP_PPC_IRQ_LEVEL.
369
370Note that any value for 'irq' other than the ones stated above is invalid
371and incurs unexpected behavior.
372
3734.17 KVM_DEBUG_GUEST
340 374
341Capability: basic 375Capability: basic
342Architectures: none 376Architectures: none
@@ -346,7 +380,7 @@ Returns: -1 on error
346 380
347Support for this has been removed. Use KVM_SET_GUEST_DEBUG instead. 381Support for this has been removed. Use KVM_SET_GUEST_DEBUG instead.
348 382
3494.17 KVM_GET_MSRS 3834.18 KVM_GET_MSRS
350 384
351Capability: basic 385Capability: basic
352Architectures: x86 386Architectures: x86
@@ -374,7 +408,7 @@ Application code should set the 'nmsrs' member (which indicates the
374size of the entries array) and the 'index' member of each array entry. 408size of the entries array) and the 'index' member of each array entry.
375kvm will fill in the 'data' member. 409kvm will fill in the 'data' member.
376 410
3774.18 KVM_SET_MSRS 4114.19 KVM_SET_MSRS
378 412
379Capability: basic 413Capability: basic
380Architectures: x86 414Architectures: x86
@@ -389,7 +423,7 @@ Application code should set the 'nmsrs' member (which indicates the
389size of the entries array), and the 'index' and 'data' members of each 423size of the entries array), and the 'index' and 'data' members of each
390array entry. 424array entry.
391 425
3924.19 KVM_SET_CPUID 4264.20 KVM_SET_CPUID
393 427
394Capability: basic 428Capability: basic
395Architectures: x86 429Architectures: x86
@@ -417,7 +451,7 @@ struct kvm_cpuid {
417 struct kvm_cpuid_entry entries[0]; 451 struct kvm_cpuid_entry entries[0];
418}; 452};
419 453
4204.20 KVM_SET_SIGNAL_MASK 4544.21 KVM_SET_SIGNAL_MASK
421 455
422Capability: basic 456Capability: basic
423Architectures: x86 457Architectures: x86
@@ -439,7 +473,7 @@ struct kvm_signal_mask {
439 __u8 sigset[0]; 473 __u8 sigset[0];
440}; 474};
441 475
4424.21 KVM_GET_FPU 4764.22 KVM_GET_FPU
443 477
444Capability: basic 478Capability: basic
445Architectures: x86 479Architectures: x86
@@ -464,7 +498,7 @@ struct kvm_fpu {
464 __u32 pad2; 498 __u32 pad2;
465}; 499};
466 500
4674.22 KVM_SET_FPU 5014.23 KVM_SET_FPU
468 502
469Capability: basic 503Capability: basic
470Architectures: x86 504Architectures: x86
@@ -489,7 +523,7 @@ struct kvm_fpu {
489 __u32 pad2; 523 __u32 pad2;
490}; 524};
491 525
4924.23 KVM_CREATE_IRQCHIP 5264.24 KVM_CREATE_IRQCHIP
493 527
494Capability: KVM_CAP_IRQCHIP 528Capability: KVM_CAP_IRQCHIP
495Architectures: x86, ia64 529Architectures: x86, ia64
@@ -502,7 +536,7 @@ ioapic, a virtual PIC (two PICs, nested), and sets up future vcpus to have a
502local APIC. IRQ routing for GSIs 0-15 is set to both PIC and IOAPIC; GSI 16-23 536local APIC. IRQ routing for GSIs 0-15 is set to both PIC and IOAPIC; GSI 16-23
503only go to the IOAPIC. On ia64, a IOSAPIC is created. 537only go to the IOAPIC. On ia64, a IOSAPIC is created.
504 538
5054.24 KVM_IRQ_LINE 5394.25 KVM_IRQ_LINE
506 540
507Capability: KVM_CAP_IRQCHIP 541Capability: KVM_CAP_IRQCHIP
508Architectures: x86, ia64 542Architectures: x86, ia64
@@ -523,7 +557,7 @@ struct kvm_irq_level {
523 __u32 level; /* 0 or 1 */ 557 __u32 level; /* 0 or 1 */
524}; 558};
525 559
5264.25 KVM_GET_IRQCHIP 5604.26 KVM_GET_IRQCHIP
527 561
528Capability: KVM_CAP_IRQCHIP 562Capability: KVM_CAP_IRQCHIP
529Architectures: x86, ia64 563Architectures: x86, ia64
@@ -544,7 +578,7 @@ struct kvm_irqchip {
544 } chip; 578 } chip;
545}; 579};
546 580
5474.26 KVM_SET_IRQCHIP 5814.27 KVM_SET_IRQCHIP
548 582
549Capability: KVM_CAP_IRQCHIP 583Capability: KVM_CAP_IRQCHIP
550Architectures: x86, ia64 584Architectures: x86, ia64
@@ -565,7 +599,7 @@ struct kvm_irqchip {
565 } chip; 599 } chip;
566}; 600};
567 601
5684.27 KVM_XEN_HVM_CONFIG 6024.28 KVM_XEN_HVM_CONFIG
569 603
570Capability: KVM_CAP_XEN_HVM 604Capability: KVM_CAP_XEN_HVM
571Architectures: x86 605Architectures: x86
@@ -589,7 +623,7 @@ struct kvm_xen_hvm_config {
589 __u8 pad2[30]; 623 __u8 pad2[30];
590}; 624};
591 625
5924.27 KVM_GET_CLOCK 6264.29 KVM_GET_CLOCK
593 627
594Capability: KVM_CAP_ADJUST_CLOCK 628Capability: KVM_CAP_ADJUST_CLOCK
595Architectures: x86 629Architectures: x86
@@ -607,7 +641,7 @@ struct kvm_clock_data {
607 __u32 pad[9]; 641 __u32 pad[9];
608}; 642};
609 643
6104.28 KVM_SET_CLOCK 6444.30 KVM_SET_CLOCK
611 645
612Capability: KVM_CAP_ADJUST_CLOCK 646Capability: KVM_CAP_ADJUST_CLOCK
613Architectures: x86 647Architectures: x86
@@ -625,7 +659,7 @@ struct kvm_clock_data {
625 __u32 pad[9]; 659 __u32 pad[9];
626}; 660};
627 661
6284.29 KVM_GET_VCPU_EVENTS 6624.31 KVM_GET_VCPU_EVENTS
629 663
630Capability: KVM_CAP_VCPU_EVENTS 664Capability: KVM_CAP_VCPU_EVENTS
631Extended by: KVM_CAP_INTR_SHADOW 665Extended by: KVM_CAP_INTR_SHADOW
@@ -664,7 +698,7 @@ struct kvm_vcpu_events {
664KVM_VCPUEVENT_VALID_SHADOW may be set in the flags field to signal that 698KVM_VCPUEVENT_VALID_SHADOW may be set in the flags field to signal that
665interrupt.shadow contains a valid state. Otherwise, this field is undefined. 699interrupt.shadow contains a valid state. Otherwise, this field is undefined.
666 700
6674.30 KVM_SET_VCPU_EVENTS 7014.32 KVM_SET_VCPU_EVENTS
668 702
669Capability: KVM_CAP_VCPU_EVENTS 703Capability: KVM_CAP_VCPU_EVENTS
670Extended by: KVM_CAP_INTR_SHADOW 704Extended by: KVM_CAP_INTR_SHADOW
@@ -690,7 +724,7 @@ If KVM_CAP_INTR_SHADOW is available, KVM_VCPUEVENT_VALID_SHADOW can be set in
690the flags field to signal that interrupt.shadow contains a valid state and 724the flags field to signal that interrupt.shadow contains a valid state and
691shall be written into the VCPU. 725shall be written into the VCPU.
692 726
6934.32 KVM_GET_DEBUGREGS 7274.33 KVM_GET_DEBUGREGS
694 728
695Capability: KVM_CAP_DEBUGREGS 729Capability: KVM_CAP_DEBUGREGS
696Architectures: x86 730Architectures: x86
@@ -708,7 +742,7 @@ struct kvm_debugregs {
708 __u64 reserved[9]; 742 __u64 reserved[9];
709}; 743};
710 744
7114.33 KVM_SET_DEBUGREGS 7454.34 KVM_SET_DEBUGREGS
712 746
713Capability: KVM_CAP_DEBUGREGS 747Capability: KVM_CAP_DEBUGREGS
714Architectures: x86 748Architectures: x86
@@ -721,7 +755,7 @@ Writes debug registers into the vcpu.
721See KVM_GET_DEBUGREGS for the data structure. The flags field is unused 755See KVM_GET_DEBUGREGS for the data structure. The flags field is unused
722yet and must be cleared on entry. 756yet and must be cleared on entry.
723 757
7244.34 KVM_SET_USER_MEMORY_REGION 7584.35 KVM_SET_USER_MEMORY_REGION
725 759
726Capability: KVM_CAP_USER_MEM 760Capability: KVM_CAP_USER_MEM
727Architectures: all 761Architectures: all
@@ -767,7 +801,7 @@ It is recommended to use this API instead of the KVM_SET_MEMORY_REGION ioctl.
767The KVM_SET_MEMORY_REGION does not allow fine grained control over memory 801The KVM_SET_MEMORY_REGION does not allow fine grained control over memory
768allocation and is deprecated. 802allocation and is deprecated.
769 803
7704.35 KVM_SET_TSS_ADDR 8044.36 KVM_SET_TSS_ADDR
771 805
772Capability: KVM_CAP_SET_TSS_ADDR 806Capability: KVM_CAP_SET_TSS_ADDR
773Architectures: x86 807Architectures: x86
@@ -785,7 +819,7 @@ This ioctl is required on Intel-based hosts. This is needed on Intel hardware
785because of a quirk in the virtualization implementation (see the internals 819because of a quirk in the virtualization implementation (see the internals
786documentation when it pops into existence). 820documentation when it pops into existence).
787 821
7884.36 KVM_ENABLE_CAP 8224.37 KVM_ENABLE_CAP
789 823
790Capability: KVM_CAP_ENABLE_CAP 824Capability: KVM_CAP_ENABLE_CAP
791Architectures: ppc 825Architectures: ppc
@@ -820,7 +854,7 @@ function properly, this is the place to put them.
820 __u8 pad[64]; 854 __u8 pad[64];
821}; 855};
822 856
8234.37 KVM_GET_MP_STATE 8574.38 KVM_GET_MP_STATE
824 858
825Capability: KVM_CAP_MP_STATE 859Capability: KVM_CAP_MP_STATE
826Architectures: x86, ia64 860Architectures: x86, ia64
@@ -845,12 +879,12 @@ Possible values are:
845 - KVM_MP_STATE_HALTED: the vcpu has executed a HLT instruction and 879 - KVM_MP_STATE_HALTED: the vcpu has executed a HLT instruction and
846 is waiting for an interrupt 880 is waiting for an interrupt
847 - KVM_MP_STATE_SIPI_RECEIVED: the vcpu has just received a SIPI (vector 881 - KVM_MP_STATE_SIPI_RECEIVED: the vcpu has just received a SIPI (vector
848 accesible via KVM_GET_VCPU_EVENTS) 882 accessible via KVM_GET_VCPU_EVENTS)
849 883
850This ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel 884This ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel
851irqchip, the multiprocessing state must be maintained by userspace. 885irqchip, the multiprocessing state must be maintained by userspace.
852 886
8534.38 KVM_SET_MP_STATE 8874.39 KVM_SET_MP_STATE
854 888
855Capability: KVM_CAP_MP_STATE 889Capability: KVM_CAP_MP_STATE
856Architectures: x86, ia64 890Architectures: x86, ia64
@@ -864,7 +898,7 @@ arguments.
864This ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel 898This ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel
865irqchip, the multiprocessing state must be maintained by userspace. 899irqchip, the multiprocessing state must be maintained by userspace.
866 900
8674.39 KVM_SET_IDENTITY_MAP_ADDR 9014.40 KVM_SET_IDENTITY_MAP_ADDR
868 902
869Capability: KVM_CAP_SET_IDENTITY_MAP_ADDR 903Capability: KVM_CAP_SET_IDENTITY_MAP_ADDR
870Architectures: x86 904Architectures: x86
@@ -882,7 +916,7 @@ This ioctl is required on Intel-based hosts. This is needed on Intel hardware
882because of a quirk in the virtualization implementation (see the internals 916because of a quirk in the virtualization implementation (see the internals
883documentation when it pops into existence). 917documentation when it pops into existence).
884 918
8854.40 KVM_SET_BOOT_CPU_ID 9194.41 KVM_SET_BOOT_CPU_ID
886 920
887Capability: KVM_CAP_SET_BOOT_CPU_ID 921Capability: KVM_CAP_SET_BOOT_CPU_ID
888Architectures: x86, ia64 922Architectures: x86, ia64
@@ -894,7 +928,7 @@ Define which vcpu is the Bootstrap Processor (BSP). Values are the same
894as the vcpu id in KVM_CREATE_VCPU. If this ioctl is not called, the default 928as the vcpu id in KVM_CREATE_VCPU. If this ioctl is not called, the default
895is vcpu 0. 929is vcpu 0.
896 930
8974.41 KVM_GET_XSAVE 9314.42 KVM_GET_XSAVE
898 932
899Capability: KVM_CAP_XSAVE 933Capability: KVM_CAP_XSAVE
900Architectures: x86 934Architectures: x86
@@ -908,7 +942,7 @@ struct kvm_xsave {
908 942
909This ioctl would copy current vcpu's xsave struct to the userspace. 943This ioctl would copy current vcpu's xsave struct to the userspace.
910 944
9114.42 KVM_SET_XSAVE 9454.43 KVM_SET_XSAVE
912 946
913Capability: KVM_CAP_XSAVE 947Capability: KVM_CAP_XSAVE
914Architectures: x86 948Architectures: x86
@@ -922,7 +956,7 @@ struct kvm_xsave {
922 956
923This ioctl would copy userspace's xsave struct to the kernel. 957This ioctl would copy userspace's xsave struct to the kernel.
924 958
9254.43 KVM_GET_XCRS 9594.44 KVM_GET_XCRS
926 960
927Capability: KVM_CAP_XCRS 961Capability: KVM_CAP_XCRS
928Architectures: x86 962Architectures: x86
@@ -945,7 +979,7 @@ struct kvm_xcrs {
945 979
946This ioctl would copy current vcpu's xcrs to the userspace. 980This ioctl would copy current vcpu's xcrs to the userspace.
947 981
9484.44 KVM_SET_XCRS 9824.45 KVM_SET_XCRS
949 983
950Capability: KVM_CAP_XCRS 984Capability: KVM_CAP_XCRS
951Architectures: x86 985Architectures: x86
@@ -968,7 +1002,7 @@ struct kvm_xcrs {
968 1002
969This ioctl would set vcpu's xcr to the value userspace specified. 1003This ioctl would set vcpu's xcr to the value userspace specified.
970 1004
9714.45 KVM_GET_SUPPORTED_CPUID 10054.46 KVM_GET_SUPPORTED_CPUID
972 1006
973Capability: KVM_CAP_EXT_CPUID 1007Capability: KVM_CAP_EXT_CPUID
974Architectures: x86 1008Architectures: x86
@@ -1013,8 +1047,9 @@ number is just right, the 'nent' field is adjusted to the number of valid
1013entries in the 'entries' array, which is then filled. 1047entries in the 'entries' array, which is then filled.
1014 1048
1015The entries returned are the host cpuid as returned by the cpuid instruction, 1049The entries returned are the host cpuid as returned by the cpuid instruction,
1016with unknown or unsupported features masked out. The fields in each entry 1050with unknown or unsupported features masked out. Some features (for example,
1017are defined as follows: 1051x2apic), may not be present in the host cpu, but are exposed by kvm if it can
1052emulate them efficiently. The fields in each entry are defined as follows:
1018 1053
1019 function: the eax value used to obtain the entry 1054 function: the eax value used to obtain the entry
1020 index: the ecx value used to obtain the entry (for entries that are 1055 index: the ecx value used to obtain the entry (for entries that are
@@ -1032,6 +1067,230 @@ are defined as follows:
1032 eax, ebx, ecx, edx: the values returned by the cpuid instruction for 1067 eax, ebx, ecx, edx: the values returned by the cpuid instruction for
1033 this function/index combination 1068 this function/index combination
1034 1069
10704.47 KVM_PPC_GET_PVINFO
1071
1072Capability: KVM_CAP_PPC_GET_PVINFO
1073Architectures: ppc
1074Type: vm ioctl
1075Parameters: struct kvm_ppc_pvinfo (out)
1076Returns: 0 on success, !0 on error
1077
1078struct kvm_ppc_pvinfo {
1079 __u32 flags;
1080 __u32 hcall[4];
1081 __u8 pad[108];
1082};
1083
1084This ioctl fetches PV specific information that need to be passed to the guest
1085using the device tree or other means from vm context.
1086
1087For now the only implemented piece of information distributed here is an array
1088of 4 instructions that make up a hypercall.
1089
1090If any additional field gets added to this structure later on, a bit for that
1091additional piece of information will be set in the flags bitmap.
1092
10934.48 KVM_ASSIGN_PCI_DEVICE
1094
1095Capability: KVM_CAP_DEVICE_ASSIGNMENT
1096Architectures: x86 ia64
1097Type: vm ioctl
1098Parameters: struct kvm_assigned_pci_dev (in)
1099Returns: 0 on success, -1 on error
1100
1101Assigns a host PCI device to the VM.
1102
1103struct kvm_assigned_pci_dev {
1104 __u32 assigned_dev_id;
1105 __u32 busnr;
1106 __u32 devfn;
1107 __u32 flags;
1108 __u32 segnr;
1109 union {
1110 __u32 reserved[11];
1111 };
1112};
1113
1114The PCI device is specified by the triple segnr, busnr, and devfn.
1115Identification in succeeding service requests is done via assigned_dev_id. The
1116following flags are specified:
1117
1118/* Depends on KVM_CAP_IOMMU */
1119#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
1120
11214.49 KVM_DEASSIGN_PCI_DEVICE
1122
1123Capability: KVM_CAP_DEVICE_DEASSIGNMENT
1124Architectures: x86 ia64
1125Type: vm ioctl
1126Parameters: struct kvm_assigned_pci_dev (in)
1127Returns: 0 on success, -1 on error
1128
1129Ends PCI device assignment, releasing all associated resources.
1130
1131See KVM_CAP_DEVICE_ASSIGNMENT for the data structure. Only assigned_dev_id is
1132used in kvm_assigned_pci_dev to identify the device.
1133
11344.50 KVM_ASSIGN_DEV_IRQ
1135
1136Capability: KVM_CAP_ASSIGN_DEV_IRQ
1137Architectures: x86 ia64
1138Type: vm ioctl
1139Parameters: struct kvm_assigned_irq (in)
1140Returns: 0 on success, -1 on error
1141
1142Assigns an IRQ to a passed-through device.
1143
1144struct kvm_assigned_irq {
1145 __u32 assigned_dev_id;
1146 __u32 host_irq;
1147 __u32 guest_irq;
1148 __u32 flags;
1149 union {
1150 struct {
1151 __u32 addr_lo;
1152 __u32 addr_hi;
1153 __u32 data;
1154 } guest_msi;
1155 __u32 reserved[12];
1156 };
1157};
1158
1159The following flags are defined:
1160
1161#define KVM_DEV_IRQ_HOST_INTX (1 << 0)
1162#define KVM_DEV_IRQ_HOST_MSI (1 << 1)
1163#define KVM_DEV_IRQ_HOST_MSIX (1 << 2)
1164
1165#define KVM_DEV_IRQ_GUEST_INTX (1 << 8)
1166#define KVM_DEV_IRQ_GUEST_MSI (1 << 9)
1167#define KVM_DEV_IRQ_GUEST_MSIX (1 << 10)
1168
1169It is not valid to specify multiple types per host or guest IRQ. However, the
1170IRQ type of host and guest can differ or can even be null.
1171
11724.51 KVM_DEASSIGN_DEV_IRQ
1173
1174Capability: KVM_CAP_ASSIGN_DEV_IRQ
1175Architectures: x86 ia64
1176Type: vm ioctl
1177Parameters: struct kvm_assigned_irq (in)
1178Returns: 0 on success, -1 on error
1179
1180Ends an IRQ assignment to a passed-through device.
1181
1182See KVM_ASSIGN_DEV_IRQ for the data structure. The target device is specified
1183by assigned_dev_id, flags must correspond to the IRQ type specified on
1184KVM_ASSIGN_DEV_IRQ. Partial deassignment of host or guest IRQ is allowed.
1185
11864.52 KVM_SET_GSI_ROUTING
1187
1188Capability: KVM_CAP_IRQ_ROUTING
1189Architectures: x86 ia64
1190Type: vm ioctl
1191Parameters: struct kvm_irq_routing (in)
1192Returns: 0 on success, -1 on error
1193
1194Sets the GSI routing table entries, overwriting any previously set entries.
1195
1196struct kvm_irq_routing {
1197 __u32 nr;
1198 __u32 flags;
1199 struct kvm_irq_routing_entry entries[0];
1200};
1201
1202No flags are specified so far, the corresponding field must be set to zero.
1203
1204struct kvm_irq_routing_entry {
1205 __u32 gsi;
1206 __u32 type;
1207 __u32 flags;
1208 __u32 pad;
1209 union {
1210 struct kvm_irq_routing_irqchip irqchip;
1211 struct kvm_irq_routing_msi msi;
1212 __u32 pad[8];
1213 } u;
1214};
1215
1216/* gsi routing entry types */
1217#define KVM_IRQ_ROUTING_IRQCHIP 1
1218#define KVM_IRQ_ROUTING_MSI 2
1219
1220No flags are specified so far, the corresponding field must be set to zero.
1221
1222struct kvm_irq_routing_irqchip {
1223 __u32 irqchip;
1224 __u32 pin;
1225};
1226
1227struct kvm_irq_routing_msi {
1228 __u32 address_lo;
1229 __u32 address_hi;
1230 __u32 data;
1231 __u32 pad;
1232};
1233
12344.53 KVM_ASSIGN_SET_MSIX_NR
1235
1236Capability: KVM_CAP_DEVICE_MSIX
1237Architectures: x86 ia64
1238Type: vm ioctl
1239Parameters: struct kvm_assigned_msix_nr (in)
1240Returns: 0 on success, -1 on error
1241
1242Set the number of MSI-X interrupts for an assigned device. This service can
1243only be called once in the lifetime of an assigned device.
1244
1245struct kvm_assigned_msix_nr {
1246 __u32 assigned_dev_id;
1247 __u16 entry_nr;
1248 __u16 padding;
1249};
1250
1251#define KVM_MAX_MSIX_PER_DEV 256
1252
12534.54 KVM_ASSIGN_SET_MSIX_ENTRY
1254
1255Capability: KVM_CAP_DEVICE_MSIX
1256Architectures: x86 ia64
1257Type: vm ioctl
1258Parameters: struct kvm_assigned_msix_entry (in)
1259Returns: 0 on success, -1 on error
1260
1261Specifies the routing of an MSI-X assigned device interrupt to a GSI. Setting
1262the GSI vector to zero means disabling the interrupt.
1263
1264struct kvm_assigned_msix_entry {
1265 __u32 assigned_dev_id;
1266 __u32 gsi;
1267 __u16 entry; /* The index of entry in the MSI-X table */
1268 __u16 padding[3];
1269};
1270
12714.54 KVM_SET_TSC_KHZ
1272
1273Capability: KVM_CAP_TSC_CONTROL
1274Architectures: x86
1275Type: vcpu ioctl
1276Parameters: virtual tsc_khz
1277Returns: 0 on success, -1 on error
1278
1279Specifies the tsc frequency for the virtual machine. The unit of the
1280frequency is KHz.
1281
12824.55 KVM_GET_TSC_KHZ
1283
1284Capability: KVM_CAP_GET_TSC_KHZ
1285Architectures: x86
1286Type: vcpu ioctl
1287Parameters: none
1288Returns: virtual tsc-khz on success, negative value on error
1289
1290Returns the tsc frequency of the guest. The unit of the return value is
1291KHz. If the host has unstable tsc this ioctl returns -EIO instead as an
1292error.
1293
10355. The kvm_run structure 12945. The kvm_run structure
1036 1295
1037Application code obtains a pointer to the kvm_run structure by 1296Application code obtains a pointer to the kvm_run structure by
diff --git a/Documentation/kvm/cpuid.txt b/Documentation/virtual/kvm/cpuid.txt
index 14a12ea92b7f..882068538c9c 100644
--- a/Documentation/kvm/cpuid.txt
+++ b/Documentation/virtual/kvm/cpuid.txt
@@ -36,6 +36,9 @@ KVM_FEATURE_MMU_OP || 2 || deprecated.
36KVM_FEATURE_CLOCKSOURCE2 || 3 || kvmclock available at msrs 36KVM_FEATURE_CLOCKSOURCE2 || 3 || kvmclock available at msrs
37 || || 0x4b564d00 and 0x4b564d01 37 || || 0x4b564d00 and 0x4b564d01
38------------------------------------------------------------------------------ 38------------------------------------------------------------------------------
39KVM_FEATURE_ASYNC_PF || 4 || async pf can be enabled by
40 || || writing to msr 0x4b564d02
41------------------------------------------------------------------------------
39KVM_FEATURE_CLOCKSOURCE_STABLE_BIT || 24 || host will warn if no guest-side 42KVM_FEATURE_CLOCKSOURCE_STABLE_BIT || 24 || host will warn if no guest-side
40 || || per-cpu warps are expected in 43 || || per-cpu warps are expected in
41 || || kvmclock. 44 || || kvmclock.
diff --git a/Documentation/virtual/kvm/locking.txt b/Documentation/virtual/kvm/locking.txt
new file mode 100644
index 000000000000..3b4cd3bf5631
--- /dev/null
+++ b/Documentation/virtual/kvm/locking.txt
@@ -0,0 +1,25 @@
1KVM Lock Overview
2=================
3
41. Acquisition Orders
5---------------------
6
7(to be written)
8
92. Reference
10------------
11
12Name: kvm_lock
13Type: raw_spinlock
14Arch: any
15Protects: - vm_list
16 - hardware virtualization enable/disable
17Comment: 'raw' because hardware enabling/disabling must be atomic /wrt
18 migration.
19
20Name: kvm_arch::tsc_write_lock
21Type: raw_spinlock
22Arch: x86
23Protects: - kvm_arch::{last_tsc_write,last_tsc_nsec,last_tsc_offset}
24 - tsc offset in vmcb
25Comment: 'raw' because updating the tsc offsets must not be preempted.
diff --git a/Documentation/kvm/mmu.txt b/Documentation/virtual/kvm/mmu.txt
index 142cc5136650..f46aa58389ca 100644
--- a/Documentation/kvm/mmu.txt
+++ b/Documentation/virtual/kvm/mmu.txt
@@ -23,7 +23,7 @@ The mmu code attempts to satisfy the following requirements:
23 and framebuffer-based displays 23 and framebuffer-based displays
24- footprint: keep the amount of pinned kernel memory low (most memory 24- footprint: keep the amount of pinned kernel memory low (most memory
25 should be shrinkable) 25 should be shrinkable)
26- reliablity: avoid multipage or GFP_ATOMIC allocations 26- reliability: avoid multipage or GFP_ATOMIC allocations
27 27
28Acronyms 28Acronyms
29======== 29========
diff --git a/Documentation/kvm/msr.txt b/Documentation/virtual/kvm/msr.txt
index 8ddcfe84c09a..d079aed27e03 100644
--- a/Documentation/kvm/msr.txt
+++ b/Documentation/virtual/kvm/msr.txt
@@ -3,7 +3,6 @@ Glauber Costa <glommer@redhat.com>, Red Hat Inc, 2010
3===================================================== 3=====================================================
4 4
5KVM makes use of some custom MSRs to service some requests. 5KVM makes use of some custom MSRs to service some requests.
6At present, this facility is only used by kvmclock.
7 6
8Custom MSRs have a range reserved for them, that goes from 7Custom MSRs have a range reserved for them, that goes from
90x4b564d00 to 0x4b564dff. There are MSRs outside this area, 80x4b564d00 to 0x4b564dff. There are MSRs outside this area,
@@ -151,3 +150,38 @@ MSR_KVM_SYSTEM_TIME: 0x12
151 return PRESENT; 150 return PRESENT;
152 } else 151 } else
153 return NON_PRESENT; 152 return NON_PRESENT;
153
154MSR_KVM_ASYNC_PF_EN: 0x4b564d02
155 data: Bits 63-6 hold 64-byte aligned physical address of a
156 64 byte memory area which must be in guest RAM and must be
157 zeroed. Bits 5-2 are reserved and should be zero. Bit 0 is 1
158 when asynchronous page faults are enabled on the vcpu 0 when
159 disabled. Bit 2 is 1 if asynchronous page faults can be injected
160 when vcpu is in cpl == 0.
161
162 First 4 byte of 64 byte memory location will be written to by
163 the hypervisor at the time of asynchronous page fault (APF)
164 injection to indicate type of asynchronous page fault. Value
165 of 1 means that the page referred to by the page fault is not
166 present. Value 2 means that the page is now available. Disabling
167 interrupt inhibits APFs. Guest must not enable interrupt
168 before the reason is read, or it may be overwritten by another
169 APF. Since APF uses the same exception vector as regular page
170 fault guest must reset the reason to 0 before it does
171 something that can generate normal page fault. If during page
172 fault APF reason is 0 it means that this is regular page
173 fault.
174
175 During delivery of type 1 APF cr2 contains a token that will
176 be used to notify a guest when missing page becomes
177 available. When page becomes available type 2 APF is sent with
178 cr2 set to the token associated with the page. There is special
179 kind of token 0xffffffff which tells vcpu that it should wake
180 up all processes waiting for APFs and no individual type 2 APFs
181 will be sent.
182
183 If APF is disabled while there are outstanding APFs, they will
184 not be delivered.
185
186 Currently type 2 APF will be always delivered on the same vcpu as
187 type 1 was, but guest should not rely on that.
diff --git a/Documentation/virtual/kvm/ppc-pv.txt b/Documentation/virtual/kvm/ppc-pv.txt
new file mode 100644
index 000000000000..3ab969c59046
--- /dev/null
+++ b/Documentation/virtual/kvm/ppc-pv.txt
@@ -0,0 +1,196 @@
1The PPC KVM paravirtual interface
2=================================
3
4The basic execution principle by which KVM on PowerPC works is to run all kernel
5space code in PR=1 which is user space. This way we trap all privileged
6instructions and can emulate them accordingly.
7
8Unfortunately that is also the downfall. There are quite some privileged
9instructions that needlessly return us to the hypervisor even though they
10could be handled differently.
11
12This is what the PPC PV interface helps with. It takes privileged instructions
13and transforms them into unprivileged ones with some help from the hypervisor.
14This cuts down virtualization costs by about 50% on some of my benchmarks.
15
16The code for that interface can be found in arch/powerpc/kernel/kvm*
17
18Querying for existence
19======================
20
21To find out if we're running on KVM or not, we leverage the device tree. When
22Linux is running on KVM, a node /hypervisor exists. That node contains a
23compatible property with the value "linux,kvm".
24
25Once you determined you're running under a PV capable KVM, you can now use
26hypercalls as described below.
27
28KVM hypercalls
29==============
30
31Inside the device tree's /hypervisor node there's a property called
32'hypercall-instructions'. This property contains at most 4 opcodes that make
33up the hypercall. To call a hypercall, just call these instructions.
34
35The parameters are as follows:
36
37 Register IN OUT
38
39 r0 - volatile
40 r3 1st parameter Return code
41 r4 2nd parameter 1st output value
42 r5 3rd parameter 2nd output value
43 r6 4th parameter 3rd output value
44 r7 5th parameter 4th output value
45 r8 6th parameter 5th output value
46 r9 7th parameter 6th output value
47 r10 8th parameter 7th output value
48 r11 hypercall number 8th output value
49 r12 - volatile
50
51Hypercall definitions are shared in generic code, so the same hypercall numbers
52apply for x86 and powerpc alike with the exception that each KVM hypercall
53also needs to be ORed with the KVM vendor code which is (42 << 16).
54
55Return codes can be as follows:
56
57 Code Meaning
58
59 0 Success
60 12 Hypercall not implemented
61 <0 Error
62
63The magic page
64==============
65
66To enable communication between the hypervisor and guest there is a new shared
67page that contains parts of supervisor visible register state. The guest can
68map this shared page using the KVM hypercall KVM_HC_PPC_MAP_MAGIC_PAGE.
69
70With this hypercall issued the guest always gets the magic page mapped at the
71desired location in effective and physical address space. For now, we always
72map the page to -4096. This way we can access it using absolute load and store
73functions. The following instruction reads the first field of the magic page:
74
75 ld rX, -4096(0)
76
77The interface is designed to be extensible should there be need later to add
78additional registers to the magic page. If you add fields to the magic page,
79also define a new hypercall feature to indicate that the host can give you more
80registers. Only if the host supports the additional features, make use of them.
81
82The magic page has the following layout as described in
83arch/powerpc/include/asm/kvm_para.h:
84
85struct kvm_vcpu_arch_shared {
86 __u64 scratch1;
87 __u64 scratch2;
88 __u64 scratch3;
89 __u64 critical; /* Guest may not get interrupts if == r1 */
90 __u64 sprg0;
91 __u64 sprg1;
92 __u64 sprg2;
93 __u64 sprg3;
94 __u64 srr0;
95 __u64 srr1;
96 __u64 dar;
97 __u64 msr;
98 __u32 dsisr;
99 __u32 int_pending; /* Tells the guest if we have an interrupt */
100};
101
102Additions to the page must only occur at the end. Struct fields are always 32
103or 64 bit aligned, depending on them being 32 or 64 bit wide respectively.
104
105Magic page features
106===================
107
108When mapping the magic page using the KVM hypercall KVM_HC_PPC_MAP_MAGIC_PAGE,
109a second return value is passed to the guest. This second return value contains
110a bitmap of available features inside the magic page.
111
112The following enhancements to the magic page are currently available:
113
114 KVM_MAGIC_FEAT_SR Maps SR registers r/w in the magic page
115
116For enhanced features in the magic page, please check for the existence of the
117feature before using them!
118
119MSR bits
120========
121
122The MSR contains bits that require hypervisor intervention and bits that do
123not require direct hypervisor intervention because they only get interpreted
124when entering the guest or don't have any impact on the hypervisor's behavior.
125
126The following bits are safe to be set inside the guest:
127
128 MSR_EE
129 MSR_RI
130 MSR_CR
131 MSR_ME
132
133If any other bit changes in the MSR, please still use mtmsr(d).
134
135Patched instructions
136====================
137
138The "ld" and "std" instructions are transormed to "lwz" and "stw" instructions
139respectively on 32 bit systems with an added offset of 4 to accommodate for big
140endianness.
141
142The following is a list of mapping the Linux kernel performs when running as
143guest. Implementing any of those mappings is optional, as the instruction traps
144also act on the shared page. So calling privileged instructions still works as
145before.
146
147From To
148==== ==
149
150mfmsr rX ld rX, magic_page->msr
151mfsprg rX, 0 ld rX, magic_page->sprg0
152mfsprg rX, 1 ld rX, magic_page->sprg1
153mfsprg rX, 2 ld rX, magic_page->sprg2
154mfsprg rX, 3 ld rX, magic_page->sprg3
155mfsrr0 rX ld rX, magic_page->srr0
156mfsrr1 rX ld rX, magic_page->srr1
157mfdar rX ld rX, magic_page->dar
158mfdsisr rX lwz rX, magic_page->dsisr
159
160mtmsr rX std rX, magic_page->msr
161mtsprg 0, rX std rX, magic_page->sprg0
162mtsprg 1, rX std rX, magic_page->sprg1
163mtsprg 2, rX std rX, magic_page->sprg2
164mtsprg 3, rX std rX, magic_page->sprg3
165mtsrr0 rX std rX, magic_page->srr0
166mtsrr1 rX std rX, magic_page->srr1
167mtdar rX std rX, magic_page->dar
168mtdsisr rX stw rX, magic_page->dsisr
169
170tlbsync nop
171
172mtmsrd rX, 0 b <special mtmsr section>
173mtmsr rX b <special mtmsr section>
174
175mtmsrd rX, 1 b <special mtmsrd section>
176
177[Book3S only]
178mtsrin rX, rY b <special mtsrin section>
179
180[BookE only]
181wrteei [0|1] b <special wrteei section>
182
183
184Some instructions require more logic to determine what's going on than a load
185or store instruction can deliver. To enable patching of those, we keep some
186RAM around where we can live translate instructions to. What happens is the
187following:
188
189 1) copy emulation code to memory
190 2) patch that code to fit the emulated instruction
191 3) patch that code to return to the original pc + 4
192 4) patch the original instruction to branch to the new code
193
194That way we can inject an arbitrary amount of code as replacement for a single
195instruction. This allows us to check for pending interrupts when setting EE=1
196for example.
diff --git a/Documentation/kvm/review-checklist.txt b/Documentation/virtual/kvm/review-checklist.txt
index 730475ae1b8d..a850986ed684 100644
--- a/Documentation/kvm/review-checklist.txt
+++ b/Documentation/virtual/kvm/review-checklist.txt
@@ -7,7 +7,7 @@ Review checklist for kvm patches
72. Patches should be against kvm.git master branch. 72. Patches should be against kvm.git master branch.
8 8
93. If the patch introduces or modifies a new userspace API: 93. If the patch introduces or modifies a new userspace API:
10 - the API must be documented in Documentation/kvm/api.txt 10 - the API must be documented in Documentation/virtual/kvm/api.txt
11 - the API must be discoverable using KVM_CHECK_EXTENSION 11 - the API must be discoverable using KVM_CHECK_EXTENSION
12 12
134. New state must include support for save/restore. 134. New state must include support for save/restore.
diff --git a/Documentation/virtual/kvm/timekeeping.txt b/Documentation/virtual/kvm/timekeeping.txt
new file mode 100644
index 000000000000..df8946377cb6
--- /dev/null
+++ b/Documentation/virtual/kvm/timekeeping.txt
@@ -0,0 +1,612 @@
1
2 Timekeeping Virtualization for X86-Based Architectures
3
4 Zachary Amsden <zamsden@redhat.com>
5 Copyright (c) 2010, Red Hat. All rights reserved.
6
71) Overview
82) Timing Devices
93) TSC Hardware
104) Virtualization Problems
11
12=========================================================================
13
141) Overview
15
16One of the most complicated parts of the X86 platform, and specifically,
17the virtualization of this platform is the plethora of timing devices available
18and the complexity of emulating those devices. In addition, virtualization of
19time introduces a new set of challenges because it introduces a multiplexed
20division of time beyond the control of the guest CPU.
21
22First, we will describe the various timekeeping hardware available, then
23present some of the problems which arise and solutions available, giving
24specific recommendations for certain classes of KVM guests.
25
26The purpose of this document is to collect data and information relevant to
27timekeeping which may be difficult to find elsewhere, specifically,
28information relevant to KVM and hardware-based virtualization.
29
30=========================================================================
31
322) Timing Devices
33
34First we discuss the basic hardware devices available. TSC and the related
35KVM clock are special enough to warrant a full exposition and are described in
36the following section.
37
382.1) i8254 - PIT
39
40One of the first timer devices available is the programmable interrupt timer,
41or PIT. The PIT has a fixed frequency 1.193182 MHz base clock and three
42channels which can be programmed to deliver periodic or one-shot interrupts.
43These three channels can be configured in different modes and have individual
44counters. Channel 1 and 2 were not available for general use in the original
45IBM PC, and historically were connected to control RAM refresh and the PC
46speaker. Now the PIT is typically integrated as part of an emulated chipset
47and a separate physical PIT is not used.
48
49The PIT uses I/O ports 0x40 - 0x43. Access to the 16-bit counters is done
50using single or multiple byte access to the I/O ports. There are 6 modes
51available, but not all modes are available to all timers, as only timer 2
52has a connected gate input, required for modes 1 and 5. The gate line is
53controlled by port 61h, bit 0, as illustrated in the following diagram.
54
55 -------------- ----------------
56| | | |
57| 1.1932 MHz |---------->| CLOCK OUT | ---------> IRQ 0
58| Clock | | | |
59 -------------- | +->| GATE TIMER 0 |
60 | ----------------
61 |
62 | ----------------
63 | | |
64 |------>| CLOCK OUT | ---------> 66.3 KHZ DRAM
65 | | | (aka /dev/null)
66 | +->| GATE TIMER 1 |
67 | ----------------
68 |
69 | ----------------
70 | | |
71 |------>| CLOCK OUT | ---------> Port 61h, bit 5
72 | | |
73Port 61h, bit 0 ---------->| GATE TIMER 2 | \_.---- ____
74 ---------------- _| )--|LPF|---Speaker
75 / *---- \___/
76Port 61h, bit 1 -----------------------------------/
77
78The timer modes are now described.
79
80Mode 0: Single Timeout. This is a one-shot software timeout that counts down
81 when the gate is high (always true for timers 0 and 1). When the count
82 reaches zero, the output goes high.
83
84Mode 1: Triggered One-shot. The output is initially set high. When the gate
85 line is set high, a countdown is initiated (which does not stop if the gate is
86 lowered), during which the output is set low. When the count reaches zero,
87 the output goes high.
88
89Mode 2: Rate Generator. The output is initially set high. When the countdown
90 reaches 1, the output goes low for one count and then returns high. The value
91 is reloaded and the countdown automatically resumes. If the gate line goes
92 low, the count is halted. If the output is low when the gate is lowered, the
93 output automatically goes high (this only affects timer 2).
94
95Mode 3: Square Wave. This generates a high / low square wave. The count
96 determines the length of the pulse, which alternates between high and low
97 when zero is reached. The count only proceeds when gate is high and is
98 automatically reloaded on reaching zero. The count is decremented twice at
99 each clock to generate a full high / low cycle at the full periodic rate.
100 If the count is even, the clock remains high for N/2 counts and low for N/2
101 counts; if the clock is odd, the clock is high for (N+1)/2 counts and low
102 for (N-1)/2 counts. Only even values are latched by the counter, so odd
103 values are not observed when reading. This is the intended mode for timer 2,
104 which generates sine-like tones by low-pass filtering the square wave output.
105
106Mode 4: Software Strobe. After programming this mode and loading the counter,
107 the output remains high until the counter reaches zero. Then the output
108 goes low for 1 clock cycle and returns high. The counter is not reloaded.
109 Counting only occurs when gate is high.
110
111Mode 5: Hardware Strobe. After programming and loading the counter, the
112 output remains high. When the gate is raised, a countdown is initiated
113 (which does not stop if the gate is lowered). When the counter reaches zero,
114 the output goes low for 1 clock cycle and then returns high. The counter is
115 not reloaded.
116
117In addition to normal binary counting, the PIT supports BCD counting. The
118command port, 0x43 is used to set the counter and mode for each of the three
119timers.
120
121PIT commands, issued to port 0x43, using the following bit encoding:
122
123Bit 7-4: Command (See table below)
124Bit 3-1: Mode (000 = Mode 0, 101 = Mode 5, 11X = undefined)
125Bit 0 : Binary (0) / BCD (1)
126
127Command table:
128
1290000 - Latch Timer 0 count for port 0x40
130 sample and hold the count to be read in port 0x40;
131 additional commands ignored until counter is read;
132 mode bits ignored.
133
1340001 - Set Timer 0 LSB mode for port 0x40
135 set timer to read LSB only and force MSB to zero;
136 mode bits set timer mode
137
1380010 - Set Timer 0 MSB mode for port 0x40
139 set timer to read MSB only and force LSB to zero;
140 mode bits set timer mode
141
1420011 - Set Timer 0 16-bit mode for port 0x40
143 set timer to read / write LSB first, then MSB;
144 mode bits set timer mode
145
1460100 - Latch Timer 1 count for port 0x41 - as described above
1470101 - Set Timer 1 LSB mode for port 0x41 - as described above
1480110 - Set Timer 1 MSB mode for port 0x41 - as described above
1490111 - Set Timer 1 16-bit mode for port 0x41 - as described above
150
1511000 - Latch Timer 2 count for port 0x42 - as described above
1521001 - Set Timer 2 LSB mode for port 0x42 - as described above
1531010 - Set Timer 2 MSB mode for port 0x42 - as described above
1541011 - Set Timer 2 16-bit mode for port 0x42 as described above
155
1561101 - General counter latch
157 Latch combination of counters into corresponding ports
158 Bit 3 = Counter 2
159 Bit 2 = Counter 1
160 Bit 1 = Counter 0
161 Bit 0 = Unused
162
1631110 - Latch timer status
164 Latch combination of counter mode into corresponding ports
165 Bit 3 = Counter 2
166 Bit 2 = Counter 1
167 Bit 1 = Counter 0
168
169 The output of ports 0x40-0x42 following this command will be:
170
171 Bit 7 = Output pin
172 Bit 6 = Count loaded (0 if timer has expired)
173 Bit 5-4 = Read / Write mode
174 01 = MSB only
175 10 = LSB only
176 11 = LSB / MSB (16-bit)
177 Bit 3-1 = Mode
178 Bit 0 = Binary (0) / BCD mode (1)
179
1802.2) RTC
181
182The second device which was available in the original PC was the MC146818 real
183time clock. The original device is now obsolete, and usually emulated by the
184system chipset, sometimes by an HPET and some frankenstein IRQ routing.
185
186The RTC is accessed through CMOS variables, which uses an index register to
187control which bytes are read. Since there is only one index register, read
188of the CMOS and read of the RTC require lock protection (in addition, it is
189dangerous to allow userspace utilities such as hwclock to have direct RTC
190access, as they could corrupt kernel reads and writes of CMOS memory).
191
192The RTC generates an interrupt which is usually routed to IRQ 8. The interrupt
193can function as a periodic timer, an additional once a day alarm, and can issue
194interrupts after an update of the CMOS registers by the MC146818 is complete.
195The type of interrupt is signalled in the RTC status registers.
196
197The RTC will update the current time fields by battery power even while the
198system is off. The current time fields should not be read while an update is
199in progress, as indicated in the status register.
200
201The clock uses a 32.768kHz crystal, so bits 6-4 of register A should be
202programmed to a 32kHz divider if the RTC is to count seconds.
203
204This is the RAM map originally used for the RTC/CMOS:
205
206Location Size Description
207------------------------------------------
20800h byte Current second (BCD)
20901h byte Seconds alarm (BCD)
21002h byte Current minute (BCD)
21103h byte Minutes alarm (BCD)
21204h byte Current hour (BCD)
21305h byte Hours alarm (BCD)
21406h byte Current day of week (BCD)
21507h byte Current day of month (BCD)
21608h byte Current month (BCD)
21709h byte Current year (BCD)
2180Ah byte Register A
219 bit 7 = Update in progress
220 bit 6-4 = Divider for clock
221 000 = 4.194 MHz
222 001 = 1.049 MHz
223 010 = 32 kHz
224 10X = test modes
225 110 = reset / disable
226 111 = reset / disable
227 bit 3-0 = Rate selection for periodic interrupt
228 000 = periodic timer disabled
229 001 = 3.90625 uS
230 010 = 7.8125 uS
231 011 = .122070 mS
232 100 = .244141 mS
233 ...
234 1101 = 125 mS
235 1110 = 250 mS
236 1111 = 500 mS
2370Bh byte Register B
238 bit 7 = Run (0) / Halt (1)
239 bit 6 = Periodic interrupt enable
240 bit 5 = Alarm interrupt enable
241 bit 4 = Update-ended interrupt enable
242 bit 3 = Square wave interrupt enable
243 bit 2 = BCD calendar (0) / Binary (1)
244 bit 1 = 12-hour mode (0) / 24-hour mode (1)
245 bit 0 = 0 (DST off) / 1 (DST enabled)
246OCh byte Register C (read only)
247 bit 7 = interrupt request flag (IRQF)
248 bit 6 = periodic interrupt flag (PF)
249 bit 5 = alarm interrupt flag (AF)
250 bit 4 = update interrupt flag (UF)
251 bit 3-0 = reserved
252ODh byte Register D (read only)
253 bit 7 = RTC has power
254 bit 6-0 = reserved
25532h byte Current century BCD (*)
256 (*) location vendor specific and now determined from ACPI global tables
257
2582.3) APIC
259
260On Pentium and later processors, an on-board timer is available to each CPU
261as part of the Advanced Programmable Interrupt Controller. The APIC is
262accessed through memory-mapped registers and provides interrupt service to each
263CPU, used for IPIs and local timer interrupts.
264
265Although in theory the APIC is a safe and stable source for local interrupts,
266in practice, many bugs and glitches have occurred due to the special nature of
267the APIC CPU-local memory-mapped hardware. Beware that CPU errata may affect
268the use of the APIC and that workarounds may be required. In addition, some of
269these workarounds pose unique constraints for virtualization - requiring either
270extra overhead incurred from extra reads of memory-mapped I/O or additional
271functionality that may be more computationally expensive to implement.
272
273Since the APIC is documented quite well in the Intel and AMD manuals, we will
274avoid repetition of the detail here. It should be pointed out that the APIC
275timer is programmed through the LVT (local vector timer) register, is capable
276of one-shot or periodic operation, and is based on the bus clock divided down
277by the programmable divider register.
278
2792.4) HPET
280
281HPET is quite complex, and was originally intended to replace the PIT / RTC
282support of the X86 PC. It remains to be seen whether that will be the case, as
283the de facto standard of PC hardware is to emulate these older devices. Some
284systems designated as legacy free may support only the HPET as a hardware timer
285device.
286
287The HPET spec is rather loose and vague, requiring at least 3 hardware timers,
288but allowing implementation freedom to support many more. It also imposes no
289fixed rate on the timer frequency, but does impose some extremal values on
290frequency, error and slew.
291
292In general, the HPET is recommended as a high precision (compared to PIT /RTC)
293time source which is independent of local variation (as there is only one HPET
294in any given system). The HPET is also memory-mapped, and its presence is
295indicated through ACPI tables by the BIOS.
296
297Detailed specification of the HPET is beyond the current scope of this
298document, as it is also very well documented elsewhere.
299
3002.5) Offboard Timers
301
302Several cards, both proprietary (watchdog boards) and commonplace (e1000) have
303timing chips built into the cards which may have registers which are accessible
304to kernel or user drivers. To the author's knowledge, using these to generate
305a clocksource for a Linux or other kernel has not yet been attempted and is in
306general frowned upon as not playing by the agreed rules of the game. Such a
307timer device would require additional support to be virtualized properly and is
308not considered important at this time as no known operating system does this.
309
310=========================================================================
311
3123) TSC Hardware
313
314The TSC or time stamp counter is relatively simple in theory; it counts
315instruction cycles issued by the processor, which can be used as a measure of
316time. In practice, due to a number of problems, it is the most complicated
317timekeeping device to use.
318
319The TSC is represented internally as a 64-bit MSR which can be read with the
320RDMSR, RDTSC, or RDTSCP (when available) instructions. In the past, hardware
321limitations made it possible to write the TSC, but generally on old hardware it
322was only possible to write the low 32-bits of the 64-bit counter, and the upper
32332-bits of the counter were cleared. Now, however, on Intel processors family
3240Fh, for models 3, 4 and 6, and family 06h, models e and f, this restriction
325has been lifted and all 64-bits are writable. On AMD systems, the ability to
326write the TSC MSR is not an architectural guarantee.
327
328The TSC is accessible from CPL-0 and conditionally, for CPL > 0 software by
329means of the CR4.TSD bit, which when enabled, disables CPL > 0 TSC access.
330
331Some vendors have implemented an additional instruction, RDTSCP, which returns
332atomically not just the TSC, but an indicator which corresponds to the
333processor number. This can be used to index into an array of TSC variables to
334determine offset information in SMP systems where TSCs are not synchronized.
335The presence of this instruction must be determined by consulting CPUID feature
336bits.
337
338Both VMX and SVM provide extension fields in the virtualization hardware which
339allows the guest visible TSC to be offset by a constant. Newer implementations
340promise to allow the TSC to additionally be scaled, but this hardware is not
341yet widely available.
342
3433.1) TSC synchronization
344
345The TSC is a CPU-local clock in most implementations. This means, on SMP
346platforms, the TSCs of different CPUs may start at different times depending
347on when the CPUs are powered on. Generally, CPUs on the same die will share
348the same clock, however, this is not always the case.
349
350The BIOS may attempt to resynchronize the TSCs during the poweron process and
351the operating system or other system software may attempt to do this as well.
352Several hardware limitations make the problem worse - if it is not possible to
353write the full 64-bits of the TSC, it may be impossible to match the TSC in
354newly arriving CPUs to that of the rest of the system, resulting in
355unsynchronized TSCs. This may be done by BIOS or system software, but in
356practice, getting a perfectly synchronized TSC will not be possible unless all
357values are read from the same clock, which generally only is possible on single
358socket systems or those with special hardware support.
359
3603.2) TSC and CPU hotplug
361
362As touched on already, CPUs which arrive later than the boot time of the system
363may not have a TSC value that is synchronized with the rest of the system.
364Either system software, BIOS, or SMM code may actually try to establish the TSC
365to a value matching the rest of the system, but a perfect match is usually not
366a guarantee. This can have the effect of bringing a system from a state where
367TSC is synchronized back to a state where TSC synchronization flaws, however
368small, may be exposed to the OS and any virtualization environment.
369
3703.3) TSC and multi-socket / NUMA
371
372Multi-socket systems, especially large multi-socket systems are likely to have
373individual clocksources rather than a single, universally distributed clock.
374Since these clocks are driven by different crystals, they will not have
375perfectly matched frequency, and temperature and electrical variations will
376cause the CPU clocks, and thus the TSCs to drift over time. Depending on the
377exact clock and bus design, the drift may or may not be fixed in absolute
378error, and may accumulate over time.
379
380In addition, very large systems may deliberately slew the clocks of individual
381cores. This technique, known as spread-spectrum clocking, reduces EMI at the
382clock frequency and harmonics of it, which may be required to pass FCC
383standards for telecommunications and computer equipment.
384
385It is recommended not to trust the TSCs to remain synchronized on NUMA or
386multiple socket systems for these reasons.
387
3883.4) TSC and C-states
389
390C-states, or idling states of the processor, especially C1E and deeper sleep
391states may be problematic for TSC as well. The TSC may stop advancing in such
392a state, resulting in a TSC which is behind that of other CPUs when execution
393is resumed. Such CPUs must be detected and flagged by the operating system
394based on CPU and chipset identifications.
395
396The TSC in such a case may be corrected by catching it up to a known external
397clocksource.
398
3993.5) TSC frequency change / P-states
400
401To make things slightly more interesting, some CPUs may change frequency. They
402may or may not run the TSC at the same rate, and because the frequency change
403may be staggered or slewed, at some points in time, the TSC rate may not be
404known other than falling within a range of values. In this case, the TSC will
405not be a stable time source, and must be calibrated against a known, stable,
406external clock to be a usable source of time.
407
408Whether the TSC runs at a constant rate or scales with the P-state is model
409dependent and must be determined by inspecting CPUID, chipset or vendor
410specific MSR fields.
411
412In addition, some vendors have known bugs where the P-state is actually
413compensated for properly during normal operation, but when the processor is
414inactive, the P-state may be raised temporarily to service cache misses from
415other processors. In such cases, the TSC on halted CPUs could advance faster
416than that of non-halted processors. AMD Turion processors are known to have
417this problem.
418
4193.6) TSC and STPCLK / T-states
420
421External signals given to the processor may also have the effect of stopping
422the TSC. This is typically done for thermal emergency power control to prevent
423an overheating condition, and typically, there is no way to detect that this
424condition has happened.
425
4263.7) TSC virtualization - VMX
427
428VMX provides conditional trapping of RDTSC, RDMSR, WRMSR and RDTSCP
429instructions, which is enough for full virtualization of TSC in any manner. In
430addition, VMX allows passing through the host TSC plus an additional TSC_OFFSET
431field specified in the VMCS. Special instructions must be used to read and
432write the VMCS field.
433
4343.8) TSC virtualization - SVM
435
436SVM provides conditional trapping of RDTSC, RDMSR, WRMSR and RDTSCP
437instructions, which is enough for full virtualization of TSC in any manner. In
438addition, SVM allows passing through the host TSC plus an additional offset
439field specified in the SVM control block.
440
4413.9) TSC feature bits in Linux
442
443In summary, there is no way to guarantee the TSC remains in perfect
444synchronization unless it is explicitly guaranteed by the architecture. Even
445if so, the TSCs in multi-sockets or NUMA systems may still run independently
446despite being locally consistent.
447
448The following feature bits are used by Linux to signal various TSC attributes,
449but they can only be taken to be meaningful for UP or single node systems.
450
451X86_FEATURE_TSC : The TSC is available in hardware
452X86_FEATURE_RDTSCP : The RDTSCP instruction is available
453X86_FEATURE_CONSTANT_TSC : The TSC rate is unchanged with P-states
454X86_FEATURE_NONSTOP_TSC : The TSC does not stop in C-states
455X86_FEATURE_TSC_RELIABLE : TSC sync checks are skipped (VMware)
456
4574) Virtualization Problems
458
459Timekeeping is especially problematic for virtualization because a number of
460challenges arise. The most obvious problem is that time is now shared between
461the host and, potentially, a number of virtual machines. Thus the virtual
462operating system does not run with 100% usage of the CPU, despite the fact that
463it may very well make that assumption. It may expect it to remain true to very
464exacting bounds when interrupt sources are disabled, but in reality only its
465virtual interrupt sources are disabled, and the machine may still be preempted
466at any time. This causes problems as the passage of real time, the injection
467of machine interrupts and the associated clock sources are no longer completely
468synchronized with real time.
469
470This same problem can occur on native harware to a degree, as SMM mode may
471steal cycles from the naturally on X86 systems when SMM mode is used by the
472BIOS, but not in such an extreme fashion. However, the fact that SMM mode may
473cause similar problems to virtualization makes it a good justification for
474solving many of these problems on bare metal.
475
4764.1) Interrupt clocking
477
478One of the most immediate problems that occurs with legacy operating systems
479is that the system timekeeping routines are often designed to keep track of
480time by counting periodic interrupts. These interrupts may come from the PIT
481or the RTC, but the problem is the same: the host virtualization engine may not
482be able to deliver the proper number of interrupts per second, and so guest
483time may fall behind. This is especially problematic if a high interrupt rate
484is selected, such as 1000 HZ, which is unfortunately the default for many Linux
485guests.
486
487There are three approaches to solving this problem; first, it may be possible
488to simply ignore it. Guests which have a separate time source for tracking
489'wall clock' or 'real time' may not need any adjustment of their interrupts to
490maintain proper time. If this is not sufficient, it may be necessary to inject
491additional interrupts into the guest in order to increase the effective
492interrupt rate. This approach leads to complications in extreme conditions,
493where host load or guest lag is too much to compensate for, and thus another
494solution to the problem has risen: the guest may need to become aware of lost
495ticks and compensate for them internally. Although promising in theory, the
496implementation of this policy in Linux has been extremely error prone, and a
497number of buggy variants of lost tick compensation are distributed across
498commonly used Linux systems.
499
500Windows uses periodic RTC clocking as a means of keeping time internally, and
501thus requires interrupt slewing to keep proper time. It does use a low enough
502rate (ed: is it 18.2 Hz?) however that it has not yet been a problem in
503practice.
504
5054.2) TSC sampling and serialization
506
507As the highest precision time source available, the cycle counter of the CPU
508has aroused much interest from developers. As explained above, this timer has
509many problems unique to its nature as a local, potentially unstable and
510potentially unsynchronized source. One issue which is not unique to the TSC,
511but is highlighted because of its very precise nature is sampling delay. By
512definition, the counter, once read is already old. However, it is also
513possible for the counter to be read ahead of the actual use of the result.
514This is a consequence of the superscalar execution of the instruction stream,
515which may execute instructions out of order. Such execution is called
516non-serialized. Forcing serialized execution is necessary for precise
517measurement with the TSC, and requires a serializing instruction, such as CPUID
518or an MSR read.
519
520Since CPUID may actually be virtualized by a trap and emulate mechanism, this
521serialization can pose a performance issue for hardware virtualization. An
522accurate time stamp counter reading may therefore not always be available, and
523it may be necessary for an implementation to guard against "backwards" reads of
524the TSC as seen from other CPUs, even in an otherwise perfectly synchronized
525system.
526
5274.3) Timespec aliasing
528
529Additionally, this lack of serialization from the TSC poses another challenge
530when using results of the TSC when measured against another time source. As
531the TSC is much higher precision, many possible values of the TSC may be read
532while another clock is still expressing the same value.
533
534That is, you may read (T,T+10) while external clock C maintains the same value.
535Due to non-serialized reads, you may actually end up with a range which
536fluctuates - from (T-1.. T+10). Thus, any time calculated from a TSC, but
537calibrated against an external value may have a range of valid values.
538Re-calibrating this computation may actually cause time, as computed after the
539calibration, to go backwards, compared with time computed before the
540calibration.
541
542This problem is particularly pronounced with an internal time source in Linux,
543the kernel time, which is expressed in the theoretically high resolution
544timespec - but which advances in much larger granularity intervals, sometimes
545at the rate of jiffies, and possibly in catchup modes, at a much larger step.
546
547This aliasing requires care in the computation and recalibration of kvmclock
548and any other values derived from TSC computation (such as TSC virtualization
549itself).
550
5514.4) Migration
552
553Migration of a virtual machine raises problems for timekeeping in two ways.
554First, the migration itself may take time, during which interrupts cannot be
555delivered, and after which, the guest time may need to be caught up. NTP may
556be able to help to some degree here, as the clock correction required is
557typically small enough to fall in the NTP-correctable window.
558
559An additional concern is that timers based off the TSC (or HPET, if the raw bus
560clock is exposed) may now be running at different rates, requiring compensation
561in some way in the hypervisor by virtualizing these timers. In addition,
562migrating to a faster machine may preclude the use of a passthrough TSC, as a
563faster clock cannot be made visible to a guest without the potential of time
564advancing faster than usual. A slower clock is less of a problem, as it can
565always be caught up to the original rate. KVM clock avoids these problems by
566simply storing multipliers and offsets against the TSC for the guest to convert
567back into nanosecond resolution values.
568
5694.5) Scheduling
570
571Since scheduling may be based on precise timing and firing of interrupts, the
572scheduling algorithms of an operating system may be adversely affected by
573virtualization. In theory, the effect is random and should be universally
574distributed, but in contrived as well as real scenarios (guest device access,
575causes of virtualization exits, possible context switch), this may not always
576be the case. The effect of this has not been well studied.
577
578In an attempt to work around this, several implementations have provided a
579paravirtualized scheduler clock, which reveals the true amount of CPU time for
580which a virtual machine has been running.
581
5824.6) Watchdogs
583
584Watchdog timers, such as the lock detector in Linux may fire accidentally when
585running under hardware virtualization due to timer interrupts being delayed or
586misinterpretation of the passage of real time. Usually, these warnings are
587spurious and can be ignored, but in some circumstances it may be necessary to
588disable such detection.
589
5904.7) Delays and precision timing
591
592Precise timing and delays may not be possible in a virtualized system. This
593can happen if the system is controlling physical hardware, or issues delays to
594compensate for slower I/O to and from devices. The first issue is not solvable
595in general for a virtualized system; hardware control software can't be
596adequately virtualized without a full real-time operating system, which would
597require an RT aware virtualization platform.
598
599The second issue may cause performance problems, but this is unlikely to be a
600significant issue. In many cases these delays may be eliminated through
601configuration or paravirtualization.
602
6034.8) Covert channels and leaks
604
605In addition to the above problems, time information will inevitably leak to the
606guest about the host in anything but a perfect implementation of virtualized
607time. This may allow the guest to infer the presence of a hypervisor (as in a
608red-pill type detection), and it may allow information to leak between guests
609by using CPU utilization itself as a signalling channel. Preventing such
610problems would require completely isolated virtual time which may not track
611real time any longer. This may be useful in certain security or QA contexts,
612but in general isn't recommended for real-world deployment scenarios.
diff --git a/Documentation/lguest/.gitignore b/Documentation/virtual/lguest/.gitignore
index 115587fd5f65..115587fd5f65 100644
--- a/Documentation/lguest/.gitignore
+++ b/Documentation/virtual/lguest/.gitignore
diff --git a/Documentation/lguest/Makefile b/Documentation/virtual/lguest/Makefile
index bebac6b4f332..0ac34206f7a7 100644
--- a/Documentation/lguest/Makefile
+++ b/Documentation/virtual/lguest/Makefile
@@ -1,5 +1,5 @@
1# This creates the demonstration utility "lguest" which runs a Linux guest. 1# This creates the demonstration utility "lguest" which runs a Linux guest.
2# Missing headers? Add "-I../../include -I../../arch/x86/include" 2# Missing headers? Add "-I../../../include -I../../../arch/x86/include"
3CFLAGS:=-m32 -Wall -Wmissing-declarations -Wmissing-prototypes -O3 -U_FORTIFY_SOURCE 3CFLAGS:=-m32 -Wall -Wmissing-declarations -Wmissing-prototypes -O3 -U_FORTIFY_SOURCE
4 4
5all: lguest 5all: lguest
diff --git a/Documentation/lguest/extract b/Documentation/virtual/lguest/extract
index 7730bb6e4b94..7730bb6e4b94 100644
--- a/Documentation/lguest/extract
+++ b/Documentation/virtual/lguest/extract
diff --git a/Documentation/lguest/lguest.c b/Documentation/virtual/lguest/lguest.c
index 8a6a8c6d4980..cd9d6af61d07 100644
--- a/Documentation/lguest/lguest.c
+++ b/Documentation/virtual/lguest/lguest.c
@@ -39,6 +39,9 @@
39#include <limits.h> 39#include <limits.h>
40#include <stddef.h> 40#include <stddef.h>
41#include <signal.h> 41#include <signal.h>
42#include <pwd.h>
43#include <grp.h>
44
42#include <linux/virtio_config.h> 45#include <linux/virtio_config.h>
43#include <linux/virtio_net.h> 46#include <linux/virtio_net.h>
44#include <linux/virtio_blk.h> 47#include <linux/virtio_blk.h>
@@ -46,7 +49,7 @@
46#include <linux/virtio_rng.h> 49#include <linux/virtio_rng.h>
47#include <linux/virtio_ring.h> 50#include <linux/virtio_ring.h>
48#include <asm/bootparam.h> 51#include <asm/bootparam.h>
49#include "../../include/linux/lguest_launcher.h" 52#include "../../../include/linux/lguest_launcher.h"
50/*L:110 53/*L:110
51 * We can ignore the 42 include files we need for this program, but I do want 54 * We can ignore the 42 include files we need for this program, but I do want
52 * to draw attention to the use of kernel-style types. 55 * to draw attention to the use of kernel-style types.
@@ -132,9 +135,6 @@ struct device {
132 /* Is it operational */ 135 /* Is it operational */
133 bool running; 136 bool running;
134 137
135 /* Does Guest want an intrrupt on empty? */
136 bool irq_on_empty;
137
138 /* Device-specific data. */ 138 /* Device-specific data. */
139 void *priv; 139 void *priv;
140}; 140};
@@ -298,20 +298,27 @@ static void *map_zeroed_pages(unsigned int num)
298 298
299 /* 299 /*
300 * We use a private mapping (ie. if we write to the page, it will be 300 * We use a private mapping (ie. if we write to the page, it will be
301 * copied). 301 * copied). We allocate an extra two pages PROT_NONE to act as guard
302 * pages against read/write attempts that exceed allocated space.
302 */ 303 */
303 addr = mmap(NULL, getpagesize() * num, 304 addr = mmap(NULL, getpagesize() * (num+2),
304 PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0); 305 PROT_NONE, MAP_PRIVATE, fd, 0);
306
305 if (addr == MAP_FAILED) 307 if (addr == MAP_FAILED)
306 err(1, "Mmapping %u pages of /dev/zero", num); 308 err(1, "Mmapping %u pages of /dev/zero", num);
307 309
310 if (mprotect(addr + getpagesize(), getpagesize() * num,
311 PROT_READ|PROT_WRITE) == -1)
312 err(1, "mprotect rw %u pages failed", num);
313
308 /* 314 /*
309 * One neat mmap feature is that you can close the fd, and it 315 * One neat mmap feature is that you can close the fd, and it
310 * stays mapped. 316 * stays mapped.
311 */ 317 */
312 close(fd); 318 close(fd);
313 319
314 return addr; 320 /* Return address after PROT_NONE page */
321 return addr + getpagesize();
315} 322}
316 323
317/* Get some more pages for a device. */ 324/* Get some more pages for a device. */
@@ -343,7 +350,7 @@ static void map_at(int fd, void *addr, unsigned long offset, unsigned long len)
343 * done to it. This allows us to share untouched memory between 350 * done to it. This allows us to share untouched memory between
344 * Guests. 351 * Guests.
345 */ 352 */
346 if (mmap(addr, len, PROT_READ|PROT_WRITE|PROT_EXEC, 353 if (mmap(addr, len, PROT_READ|PROT_WRITE,
347 MAP_FIXED|MAP_PRIVATE, fd, offset) != MAP_FAILED) 354 MAP_FIXED|MAP_PRIVATE, fd, offset) != MAP_FAILED)
348 return; 355 return;
349 356
@@ -573,10 +580,10 @@ static void *_check_pointer(unsigned long addr, unsigned int size,
573 unsigned int line) 580 unsigned int line)
574{ 581{
575 /* 582 /*
576 * We have to separately check addr and addr+size, because size could 583 * Check if the requested address and size exceeds the allocated memory,
577 * be huge and addr + size might wrap around. 584 * or addr + size wraps around.
578 */ 585 */
579 if (addr >= guest_limit || addr + size >= guest_limit) 586 if ((addr + size) > guest_limit || (addr + size) < addr)
580 errx(1, "%s:%i: Invalid address %#lx", __FILE__, line, addr); 587 errx(1, "%s:%i: Invalid address %#lx", __FILE__, line, addr);
581 /* 588 /*
582 * We return a pointer for the caller's convenience, now we know it's 589 * We return a pointer for the caller's convenience, now we know it's
@@ -627,10 +634,7 @@ static void trigger_irq(struct virtqueue *vq)
627 634
628 /* If they don't want an interrupt, don't send one... */ 635 /* If they don't want an interrupt, don't send one... */
629 if (vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT) { 636 if (vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT) {
630 /* ... unless they've asked us to force one on empty. */ 637 return;
631 if (!vq->dev->irq_on_empty
632 || lg_last_avail(vq) != vq->vring.avail->idx)
633 return;
634 } 638 }
635 639
636 /* Send the Guest an interrupt tell them we used something up. */ 640 /* Send the Guest an interrupt tell them we used something up. */
@@ -1047,15 +1051,6 @@ static void create_thread(struct virtqueue *vq)
1047 close(vq->eventfd); 1051 close(vq->eventfd);
1048} 1052}
1049 1053
1050static bool accepted_feature(struct device *dev, unsigned int bit)
1051{
1052 const u8 *features = get_feature_bits(dev) + dev->feature_len;
1053
1054 if (dev->feature_len < bit / CHAR_BIT)
1055 return false;
1056 return features[bit / CHAR_BIT] & (1 << (bit % CHAR_BIT));
1057}
1058
1059static void start_device(struct device *dev) 1054static void start_device(struct device *dev)
1060{ 1055{
1061 unsigned int i; 1056 unsigned int i;
@@ -1069,8 +1064,6 @@ static void start_device(struct device *dev)
1069 verbose(" %02x", get_feature_bits(dev) 1064 verbose(" %02x", get_feature_bits(dev)
1070 [dev->feature_len+i]); 1065 [dev->feature_len+i]);
1071 1066
1072 dev->irq_on_empty = accepted_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY);
1073
1074 for (vq = dev->vq; vq; vq = vq->next) { 1067 for (vq = dev->vq; vq; vq = vq->next) {
1075 if (vq->service) 1068 if (vq->service)
1076 create_thread(vq); 1069 create_thread(vq);
@@ -1554,7 +1547,6 @@ static void setup_tun_net(char *arg)
1554 /* Set up the tun device. */ 1547 /* Set up the tun device. */
1555 configure_device(ipfd, tapif, ip); 1548 configure_device(ipfd, tapif, ip);
1556 1549
1557 add_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY);
1558 /* Expect Guest to handle everything except UFO */ 1550 /* Expect Guest to handle everything except UFO */
1559 add_feature(dev, VIRTIO_NET_F_CSUM); 1551 add_feature(dev, VIRTIO_NET_F_CSUM);
1560 add_feature(dev, VIRTIO_NET_F_GUEST_CSUM); 1552 add_feature(dev, VIRTIO_NET_F_GUEST_CSUM);
@@ -1640,15 +1632,6 @@ static void blk_request(struct virtqueue *vq)
1640 off = out->sector * 512; 1632 off = out->sector * 512;
1641 1633
1642 /* 1634 /*
1643 * The block device implements "barriers", where the Guest indicates
1644 * that it wants all previous writes to occur before this write. We
1645 * don't have a way of asking our kernel to do a barrier, so we just
1646 * synchronize all the data in the file. Pretty poor, no?
1647 */
1648 if (out->type & VIRTIO_BLK_T_BARRIER)
1649 fdatasync(vblk->fd);
1650
1651 /*
1652 * In general the virtio block driver is allowed to try SCSI commands. 1635 * In general the virtio block driver is allowed to try SCSI commands.
1653 * It'd be nice if we supported eject, for example, but we don't. 1636 * It'd be nice if we supported eject, for example, but we don't.
1654 */ 1637 */
@@ -1680,6 +1663,13 @@ static void blk_request(struct virtqueue *vq)
1680 /* Die, bad Guest, die. */ 1663 /* Die, bad Guest, die. */
1681 errx(1, "Write past end %llu+%u", off, ret); 1664 errx(1, "Write past end %llu+%u", off, ret);
1682 } 1665 }
1666
1667 wlen = sizeof(*in);
1668 *in = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR);
1669 } else if (out->type & VIRTIO_BLK_T_FLUSH) {
1670 /* Flush */
1671 ret = fdatasync(vblk->fd);
1672 verbose("FLUSH fdatasync: %i\n", ret);
1683 wlen = sizeof(*in); 1673 wlen = sizeof(*in);
1684 *in = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR); 1674 *in = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR);
1685 } else { 1675 } else {
@@ -1703,15 +1693,6 @@ static void blk_request(struct virtqueue *vq)
1703 } 1693 }
1704 } 1694 }
1705 1695
1706 /*
1707 * OK, so we noted that it was pretty poor to use an fdatasync as a
1708 * barrier. But Christoph Hellwig points out that we need a sync
1709 * *afterwards* as well: "Barriers specify no reordering to the front
1710 * or the back." And Jens Axboe confirmed it, so here we are:
1711 */
1712 if (out->type & VIRTIO_BLK_T_BARRIER)
1713 fdatasync(vblk->fd);
1714
1715 /* Finished that request. */ 1696 /* Finished that request. */
1716 add_used(vq, head, wlen); 1697 add_used(vq, head, wlen);
1717} 1698}
@@ -1736,8 +1717,8 @@ static void setup_block_file(const char *filename)
1736 vblk->fd = open_or_die(filename, O_RDWR|O_LARGEFILE); 1717 vblk->fd = open_or_die(filename, O_RDWR|O_LARGEFILE);
1737 vblk->len = lseek64(vblk->fd, 0, SEEK_END); 1718 vblk->len = lseek64(vblk->fd, 0, SEEK_END);
1738 1719
1739 /* We support barriers. */ 1720 /* We support FLUSH. */
1740 add_feature(dev, VIRTIO_BLK_F_BARRIER); 1721 add_feature(dev, VIRTIO_BLK_F_FLUSH);
1741 1722
1742 /* Tell Guest how many sectors this device has. */ 1723 /* Tell Guest how many sectors this device has. */
1743 conf.capacity = cpu_to_le64(vblk->len / 512); 1724 conf.capacity = cpu_to_le64(vblk->len / 512);
@@ -1883,6 +1864,8 @@ static struct option opts[] = {
1883 { "block", 1, NULL, 'b' }, 1864 { "block", 1, NULL, 'b' },
1884 { "rng", 0, NULL, 'r' }, 1865 { "rng", 0, NULL, 'r' },
1885 { "initrd", 1, NULL, 'i' }, 1866 { "initrd", 1, NULL, 'i' },
1867 { "username", 1, NULL, 'u' },
1868 { "chroot", 1, NULL, 'c' },
1886 { NULL }, 1869 { NULL },
1887}; 1870};
1888static void usage(void) 1871static void usage(void)
@@ -1905,6 +1888,12 @@ int main(int argc, char *argv[])
1905 /* If they specify an initrd file to load. */ 1888 /* If they specify an initrd file to load. */
1906 const char *initrd_name = NULL; 1889 const char *initrd_name = NULL;
1907 1890
1891 /* Password structure for initgroups/setres[gu]id */
1892 struct passwd *user_details = NULL;
1893
1894 /* Directory to chroot to */
1895 char *chroot_path = NULL;
1896
1908 /* Save the args: we "reboot" by execing ourselves again. */ 1897 /* Save the args: we "reboot" by execing ourselves again. */
1909 main_args = argv; 1898 main_args = argv;
1910 1899
@@ -1961,6 +1950,14 @@ int main(int argc, char *argv[])
1961 case 'i': 1950 case 'i':
1962 initrd_name = optarg; 1951 initrd_name = optarg;
1963 break; 1952 break;
1953 case 'u':
1954 user_details = getpwnam(optarg);
1955 if (!user_details)
1956 err(1, "getpwnam failed, incorrect username?");
1957 break;
1958 case 'c':
1959 chroot_path = optarg;
1960 break;
1964 default: 1961 default:
1965 warnx("Unknown argument %s", argv[optind]); 1962 warnx("Unknown argument %s", argv[optind]);
1966 usage(); 1963 usage();
@@ -2032,6 +2029,37 @@ int main(int argc, char *argv[])
2032 /* If we exit via err(), this kills all the threads, restores tty. */ 2029 /* If we exit via err(), this kills all the threads, restores tty. */
2033 atexit(cleanup_devices); 2030 atexit(cleanup_devices);
2034 2031
2032 /* If requested, chroot to a directory */
2033 if (chroot_path) {
2034 if (chroot(chroot_path) != 0)
2035 err(1, "chroot(\"%s\") failed", chroot_path);
2036
2037 if (chdir("/") != 0)
2038 err(1, "chdir(\"/\") failed");
2039
2040 verbose("chroot done\n");
2041 }
2042
2043 /* If requested, drop privileges */
2044 if (user_details) {
2045 uid_t u;
2046 gid_t g;
2047
2048 u = user_details->pw_uid;
2049 g = user_details->pw_gid;
2050
2051 if (initgroups(user_details->pw_name, g) != 0)
2052 err(1, "initgroups failed");
2053
2054 if (setresgid(g, g, g) != 0)
2055 err(1, "setresgid failed");
2056
2057 if (setresuid(u, u, u) != 0)
2058 err(1, "setresuid failed");
2059
2060 verbose("Dropping privileges completed\n");
2061 }
2062
2035 /* Finally, run the Guest. This doesn't return. */ 2063 /* Finally, run the Guest. This doesn't return. */
2036 run_guest(); 2064 run_guest();
2037} 2065}
diff --git a/Documentation/lguest/lguest.txt b/Documentation/virtual/lguest/lguest.txt
index efb3a6a045a2..bff0c554485d 100644
--- a/Documentation/lguest/lguest.txt
+++ b/Documentation/virtual/lguest/lguest.txt
@@ -74,7 +74,8 @@ Running Lguest:
74 74
75- Run an lguest as root: 75- Run an lguest as root:
76 76
77 Documentation/lguest/lguest 64 vmlinux --tunnet=192.168.19.1 --block=rootfile root=/dev/vda 77 Documentation/virtual/lguest/lguest 64 vmlinux --tunnet=192.168.19.1 \
78 --block=rootfile root=/dev/vda
78 79
79 Explanation: 80 Explanation:
80 64: the amount of memory to use, in MB. 81 64: the amount of memory to use, in MB.
@@ -111,8 +112,16 @@ Running Lguest:
111 112
112 Then use --tunnet=bridge:lg0 when launching the guest. 113 Then use --tunnet=bridge:lg0 when launching the guest.
113 114
114 See http://linux-net.osdl.org/index.php/Bridge for general information 115 See:
115 on how to get bridging working. 116
117 http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge
118
119 for general information on how to get bridging to work.
120
121- Random number generation. Using the --rng option will provide a
122 /dev/hwrng in the guest that will read from the host's /dev/random.
123 Use this option in conjunction with rng-tools (see ../hw_random.txt)
124 to provide entropy to the guest kernel's /dev/random.
116 125
117There is a helpful mailing list at http://ozlabs.org/mailman/listinfo/lguest 126There is a helpful mailing list at http://ozlabs.org/mailman/listinfo/lguest
118 127
diff --git a/Documentation/uml/UserModeLinux-HOWTO.txt b/Documentation/virtual/uml/UserModeLinux-HOWTO.txt
index 9b7e1904db1c..5d0fc8bfcdb9 100644
--- a/Documentation/uml/UserModeLinux-HOWTO.txt
+++ b/Documentation/virtual/uml/UserModeLinux-HOWTO.txt
@@ -1182,6 +1182,16 @@
1182 forge.net/> and explains these in detail, as well as 1182 forge.net/> and explains these in detail, as well as
1183 some other issues. 1183 some other issues.
1184 1184
1185 There is also a related point-to-point only "ucast" transport.
1186 This is useful when your network does not support multicast, and
1187 all network connections are simple point to point links.
1188
1189 The full set of command line options for this transport are
1190
1191
1192 ethn=ucast,ethernet address,remote address,listen port,remote port
1193
1194
1185 1195
1186 1196
1187 66..66.. TTUUNN//TTAAPP wwiitthh tthhee uummll__nneett hheellppeerr 1197 66..66.. TTUUNN//TTAAPP wwiitthh tthhee uummll__nneett hheellppeerr
diff --git a/Documentation/vm/Makefile b/Documentation/vm/Makefile
index 9dcff328b964..3fa4d0668864 100644
--- a/Documentation/vm/Makefile
+++ b/Documentation/vm/Makefile
@@ -2,7 +2,7 @@
2obj- := dummy.o 2obj- := dummy.o
3 3
4# List of programs to build 4# List of programs to build
5hostprogs-y := slabinfo page-types hugepage-mmap hugepage-shm map_hugetlb 5hostprogs-y := page-types hugepage-mmap hugepage-shm map_hugetlb
6 6
7# Tell kbuild to always build the programs 7# Tell kbuild to always build the programs
8always := $(hostprogs-y) 8always := $(hostprogs-y)
diff --git a/Documentation/vm/active_mm.txt b/Documentation/vm/active_mm.txt
index 4ee1f643d897..dbf45817405f 100644
--- a/Documentation/vm/active_mm.txt
+++ b/Documentation/vm/active_mm.txt
@@ -74,7 +74,7 @@ we have a user context", and is generally done by the page fault handler
74and things like that). 74and things like that).
75 75
76Anyway, I put a pre-patch-2.3.13-1 on ftp.kernel.org just a moment ago, 76Anyway, I put a pre-patch-2.3.13-1 on ftp.kernel.org just a moment ago,
77because it slightly changes the interfaces to accomodate the alpha (who 77because it slightly changes the interfaces to accommodate the alpha (who
78would have thought it, but the alpha actually ends up having one of the 78would have thought it, but the alpha actually ends up having one of the
79ugliest context switch codes - unlike the other architectures where the MM 79ugliest context switch codes - unlike the other architectures where the MM
80and register state is separate, the alpha PALcode joins the two, and you 80and register state is separate, the alpha PALcode joins the two, and you
diff --git a/Documentation/vm/cleancache.txt b/Documentation/vm/cleancache.txt
new file mode 100644
index 000000000000..36c367c73084
--- /dev/null
+++ b/Documentation/vm/cleancache.txt
@@ -0,0 +1,278 @@
1MOTIVATION
2
3Cleancache is a new optional feature provided by the VFS layer that
4potentially dramatically increases page cache effectiveness for
5many workloads in many environments at a negligible cost.
6
7Cleancache can be thought of as a page-granularity victim cache for clean
8pages that the kernel's pageframe replacement algorithm (PFRA) would like
9to keep around, but can't since there isn't enough memory. So when the
10PFRA "evicts" a page, it first attempts to use cleancache code to
11put the data contained in that page into "transcendent memory", memory
12that is not directly accessible or addressable by the kernel and is
13of unknown and possibly time-varying size.
14
15Later, when a cleancache-enabled filesystem wishes to access a page
16in a file on disk, it first checks cleancache to see if it already
17contains it; if it does, the page of data is copied into the kernel
18and a disk access is avoided.
19
20Transcendent memory "drivers" for cleancache are currently implemented
21in Xen (using hypervisor memory) and zcache (using in-kernel compressed
22memory) and other implementations are in development.
23
24FAQs are included below.
25
26IMPLEMENTATION OVERVIEW
27
28A cleancache "backend" that provides transcendent memory registers itself
29to the kernel's cleancache "frontend" by calling cleancache_register_ops,
30passing a pointer to a cleancache_ops structure with funcs set appropriately.
31Note that cleancache_register_ops returns the previous settings so that
32chaining can be performed if desired. The functions provided must conform to
33certain semantics as follows:
34
35Most important, cleancache is "ephemeral". Pages which are copied into
36cleancache have an indefinite lifetime which is completely unknowable
37by the kernel and so may or may not still be in cleancache at any later time.
38Thus, as its name implies, cleancache is not suitable for dirty pages.
39Cleancache has complete discretion over what pages to preserve and what
40pages to discard and when.
41
42Mounting a cleancache-enabled filesystem should call "init_fs" to obtain a
43pool id which, if positive, must be saved in the filesystem's superblock;
44a negative return value indicates failure. A "put_page" will copy a
45(presumably about-to-be-evicted) page into cleancache and associate it with
46the pool id, a file key, and a page index into the file. (The combination
47of a pool id, a file key, and an index is sometimes called a "handle".)
48A "get_page" will copy the page, if found, from cleancache into kernel memory.
49A "flush_page" will ensure the page no longer is present in cleancache;
50a "flush_inode" will flush all pages associated with the specified file;
51and, when a filesystem is unmounted, a "flush_fs" will flush all pages in
52all files specified by the given pool id and also surrender the pool id.
53
54An "init_shared_fs", like init_fs, obtains a pool id but tells cleancache
55to treat the pool as shared using a 128-bit UUID as a key. On systems
56that may run multiple kernels (such as hard partitioned or virtualized
57systems) that may share a clustered filesystem, and where cleancache
58may be shared among those kernels, calls to init_shared_fs that specify the
59same UUID will receive the same pool id, thus allowing the pages to
60be shared. Note that any security requirements must be imposed outside
61of the kernel (e.g. by "tools" that control cleancache). Or a
62cleancache implementation can simply disable shared_init by always
63returning a negative value.
64
65If a get_page is successful on a non-shared pool, the page is flushed (thus
66making cleancache an "exclusive" cache). On a shared pool, the page
67is NOT flushed on a successful get_page so that it remains accessible to
68other sharers. The kernel is responsible for ensuring coherency between
69cleancache (shared or not), the page cache, and the filesystem, using
70cleancache flush operations as required.
71
72Note that cleancache must enforce put-put-get coherency and get-get
73coherency. For the former, if two puts are made to the same handle but
74with different data, say AAA by the first put and BBB by the second, a
75subsequent get can never return the stale data (AAA). For get-get coherency,
76if a get for a given handle fails, subsequent gets for that handle will
77never succeed unless preceded by a successful put with that handle.
78
79Last, cleancache provides no SMP serialization guarantees; if two
80different Linux threads are simultaneously putting and flushing a page
81with the same handle, the results are indeterminate. Callers must
82lock the page to ensure serial behavior.
83
84CLEANCACHE PERFORMANCE METRICS
85
86Cleancache monitoring is done by sysfs files in the
87/sys/kernel/mm/cleancache directory. The effectiveness of cleancache
88can be measured (across all filesystems) with:
89
90succ_gets - number of gets that were successful
91failed_gets - number of gets that failed
92puts - number of puts attempted (all "succeed")
93flushes - number of flushes attempted
94
95A backend implementatation may provide additional metrics.
96
97FAQ
98
991) Where's the value? (Andrew Morton)
100
101Cleancache provides a significant performance benefit to many workloads
102in many environments with negligible overhead by improving the
103effectiveness of the pagecache. Clean pagecache pages are
104saved in transcendent memory (RAM that is otherwise not directly
105addressable to the kernel); fetching those pages later avoids "refaults"
106and thus disk reads.
107
108Cleancache (and its sister code "frontswap") provide interfaces for
109this transcendent memory (aka "tmem"), which conceptually lies between
110fast kernel-directly-addressable RAM and slower DMA/asynchronous devices.
111Disallowing direct kernel or userland reads/writes to tmem
112is ideal when data is transformed to a different form and size (such
113as with compression) or secretly moved (as might be useful for write-
114balancing for some RAM-like devices). Evicted page-cache pages (and
115swap pages) are a great use for this kind of slower-than-RAM-but-much-
116faster-than-disk transcendent memory, and the cleancache (and frontswap)
117"page-object-oriented" specification provides a nice way to read and
118write -- and indirectly "name" -- the pages.
119
120In the virtual case, the whole point of virtualization is to statistically
121multiplex physical resources across the varying demands of multiple
122virtual machines. This is really hard to do with RAM and efforts to
123do it well with no kernel change have essentially failed (except in some
124well-publicized special-case workloads). Cleancache -- and frontswap --
125with a fairly small impact on the kernel, provide a huge amount
126of flexibility for more dynamic, flexible RAM multiplexing.
127Specifically, the Xen Transcendent Memory backend allows otherwise
128"fallow" hypervisor-owned RAM to not only be "time-shared" between multiple
129virtual machines, but the pages can be compressed and deduplicated to
130optimize RAM utilization. And when guest OS's are induced to surrender
131underutilized RAM (e.g. with "self-ballooning"), page cache pages
132are the first to go, and cleancache allows those pages to be
133saved and reclaimed if overall host system memory conditions allow.
134
135And the identical interface used for cleancache can be used in
136physical systems as well. The zcache driver acts as a memory-hungry
137device that stores pages of data in a compressed state. And
138the proposed "RAMster" driver shares RAM across multiple physical
139systems.
140
1412) Why does cleancache have its sticky fingers so deep inside the
142 filesystems and VFS? (Andrew Morton and Christoph Hellwig)
143
144The core hooks for cleancache in VFS are in most cases a single line
145and the minimum set are placed precisely where needed to maintain
146coherency (via cleancache_flush operations) between cleancache,
147the page cache, and disk. All hooks compile into nothingness if
148cleancache is config'ed off and turn into a function-pointer-
149compare-to-NULL if config'ed on but no backend claims the ops
150functions, or to a compare-struct-element-to-negative if a
151backend claims the ops functions but a filesystem doesn't enable
152cleancache.
153
154Some filesystems are built entirely on top of VFS and the hooks
155in VFS are sufficient, so don't require an "init_fs" hook; the
156initial implementation of cleancache didn't provide this hook.
157But for some filesystems (such as btrfs), the VFS hooks are
158incomplete and one or more hooks in fs-specific code are required.
159And for some other filesystems, such as tmpfs, cleancache may
160be counterproductive. So it seemed prudent to require a filesystem
161to "opt in" to use cleancache, which requires adding a hook in
162each filesystem. Not all filesystems are supported by cleancache
163only because they haven't been tested. The existing set should
164be sufficient to validate the concept, the opt-in approach means
165that untested filesystems are not affected, and the hooks in the
166existing filesystems should make it very easy to add more
167filesystems in the future.
168
169The total impact of the hooks to existing fs and mm files is only
170about 40 lines added (not counting comments and blank lines).
171
1723) Why not make cleancache asynchronous and batched so it can
173 more easily interface with real devices with DMA instead
174 of copying each individual page? (Minchan Kim)
175
176The one-page-at-a-time copy semantics simplifies the implementation
177on both the frontend and backend and also allows the backend to
178do fancy things on-the-fly like page compression and
179page deduplication. And since the data is "gone" (copied into/out
180of the pageframe) before the cleancache get/put call returns,
181a great deal of race conditions and potential coherency issues
182are avoided. While the interface seems odd for a "real device"
183or for real kernel-addressable RAM, it makes perfect sense for
184transcendent memory.
185
1864) Why is non-shared cleancache "exclusive"? And where is the
187 page "flushed" after a "get"? (Minchan Kim)
188
189The main reason is to free up space in transcendent memory and
190to avoid unnecessary cleancache_flush calls. If you want inclusive,
191the page can be "put" immediately following the "get". If
192put-after-get for inclusive becomes common, the interface could
193be easily extended to add a "get_no_flush" call.
194
195The flush is done by the cleancache backend implementation.
196
1975) What's the performance impact?
198
199Performance analysis has been presented at OLS'09 and LCA'10.
200Briefly, performance gains can be significant on most workloads,
201especially when memory pressure is high (e.g. when RAM is
202overcommitted in a virtual workload); and because the hooks are
203invoked primarily in place of or in addition to a disk read/write,
204overhead is negligible even in worst case workloads. Basically
205cleancache replaces I/O with memory-copy-CPU-overhead; on older
206single-core systems with slow memory-copy speeds, cleancache
207has little value, but in newer multicore machines, especially
208consolidated/virtualized machines, it has great value.
209
2106) How do I add cleancache support for filesystem X? (Boaz Harrash)
211
212Filesystems that are well-behaved and conform to certain
213restrictions can utilize cleancache simply by making a call to
214cleancache_init_fs at mount time. Unusual, misbehaving, or
215poorly layered filesystems must either add additional hooks
216and/or undergo extensive additional testing... or should just
217not enable the optional cleancache.
218
219Some points for a filesystem to consider:
220
221- The FS should be block-device-based (e.g. a ram-based FS such
222 as tmpfs should not enable cleancache)
223- To ensure coherency/correctness, the FS must ensure that all
224 file removal or truncation operations either go through VFS or
225 add hooks to do the equivalent cleancache "flush" operations
226- To ensure coherency/correctness, either inode numbers must
227 be unique across the lifetime of the on-disk file OR the
228 FS must provide an "encode_fh" function.
229- The FS must call the VFS superblock alloc and deactivate routines
230 or add hooks to do the equivalent cleancache calls done there.
231- To maximize performance, all pages fetched from the FS should
232 go through the do_mpag_readpage routine or the FS should add
233 hooks to do the equivalent (cf. btrfs)
234- Currently, the FS blocksize must be the same as PAGESIZE. This
235 is not an architectural restriction, but no backends currently
236 support anything different.
237- A clustered FS should invoke the "shared_init_fs" cleancache
238 hook to get best performance for some backends.
239
2407) Why not use the KVA of the inode as the key? (Christoph Hellwig)
241
242If cleancache would use the inode virtual address instead of
243inode/filehandle, the pool id could be eliminated. But, this
244won't work because cleancache retains pagecache data pages
245persistently even when the inode has been pruned from the
246inode unused list, and only flushes the data page if the file
247gets removed/truncated. So if cleancache used the inode kva,
248there would be potential coherency issues if/when the inode
249kva is reused for a different file. Alternately, if cleancache
250flushed the pages when the inode kva was freed, much of the value
251of cleancache would be lost because the cache of pages in cleanache
252is potentially much larger than the kernel pagecache and is most
253useful if the pages survive inode cache removal.
254
2558) Why is a global variable required?
256
257The cleancache_enabled flag is checked in all of the frequently-used
258cleancache hooks. The alternative is a function call to check a static
259variable. Since cleancache is enabled dynamically at runtime, systems
260that don't enable cleancache would suffer thousands (possibly
261tens-of-thousands) of unnecessary function calls per second. So the
262global variable allows cleancache to be enabled by default at compile
263time, but have insignificant performance impact when cleancache remains
264disabled at runtime.
265
2669) Does cleanache work with KVM?
267
268The memory model of KVM is sufficiently different that a cleancache
269backend may have less value for KVM. This remains to be tested,
270especially in an overcommitted system.
271
27210) Does cleancache work in userspace? It sounds useful for
273 memory hungry caches like web browsers. (Jamie Lokier)
274
275No plans yet, though we agree it sounds useful, at least for
276apps that bypass the page cache (e.g. O_DIRECT).
277
278Last updated: Dan Magenheimer, April 13 2011
diff --git a/Documentation/vm/highmem.txt b/Documentation/vm/highmem.txt
new file mode 100644
index 000000000000..4324d24ffacd
--- /dev/null
+++ b/Documentation/vm/highmem.txt
@@ -0,0 +1,162 @@
1
2 ====================
3 HIGH MEMORY HANDLING
4 ====================
5
6By: Peter Zijlstra <a.p.zijlstra@chello.nl>
7
8Contents:
9
10 (*) What is high memory?
11
12 (*) Temporary virtual mappings.
13
14 (*) Using kmap_atomic.
15
16 (*) Cost of temporary mappings.
17
18 (*) i386 PAE.
19
20
21====================
22WHAT IS HIGH MEMORY?
23====================
24
25High memory (highmem) is used when the size of physical memory approaches or
26exceeds the maximum size of virtual memory. At that point it becomes
27impossible for the kernel to keep all of the available physical memory mapped
28at all times. This means the kernel needs to start using temporary mappings of
29the pieces of physical memory that it wants to access.
30
31The part of (physical) memory not covered by a permanent mapping is what we
32refer to as 'highmem'. There are various architecture dependent constraints on
33where exactly that border lies.
34
35In the i386 arch, for example, we choose to map the kernel into every process's
36VM space so that we don't have to pay the full TLB invalidation costs for
37kernel entry/exit. This means the available virtual memory space (4GiB on
38i386) has to be divided between user and kernel space.
39
40The traditional split for architectures using this approach is 3:1, 3GiB for
41userspace and the top 1GiB for kernel space:
42
43 +--------+ 0xffffffff
44 | Kernel |
45 +--------+ 0xc0000000
46 | |
47 | User |
48 | |
49 +--------+ 0x00000000
50
51This means that the kernel can at most map 1GiB of physical memory at any one
52time, but because we need virtual address space for other things - including
53temporary maps to access the rest of the physical memory - the actual direct
54map will typically be less (usually around ~896MiB).
55
56Other architectures that have mm context tagged TLBs can have separate kernel
57and user maps. Some hardware (like some ARMs), however, have limited virtual
58space when they use mm context tags.
59
60
61==========================
62TEMPORARY VIRTUAL MAPPINGS
63==========================
64
65The kernel contains several ways of creating temporary mappings:
66
67 (*) vmap(). This can be used to make a long duration mapping of multiple
68 physical pages into a contiguous virtual space. It needs global
69 synchronization to unmap.
70
71 (*) kmap(). This permits a short duration mapping of a single page. It needs
72 global synchronization, but is amortized somewhat. It is also prone to
73 deadlocks when using in a nested fashion, and so it is not recommended for
74 new code.
75
76 (*) kmap_atomic(). This permits a very short duration mapping of a single
77 page. Since the mapping is restricted to the CPU that issued it, it
78 performs well, but the issuing task is therefore required to stay on that
79 CPU until it has finished, lest some other task displace its mappings.
80
81 kmap_atomic() may also be used by interrupt contexts, since it is does not
82 sleep and the caller may not sleep until after kunmap_atomic() is called.
83
84 It may be assumed that k[un]map_atomic() won't fail.
85
86
87=================
88USING KMAP_ATOMIC
89=================
90
91When and where to use kmap_atomic() is straightforward. It is used when code
92wants to access the contents of a page that might be allocated from high memory
93(see __GFP_HIGHMEM), for example a page in the pagecache. The API has two
94functions, and they can be used in a manner similar to the following:
95
96 /* Find the page of interest. */
97 struct page *page = find_get_page(mapping, offset);
98
99 /* Gain access to the contents of that page. */
100 void *vaddr = kmap_atomic(page);
101
102 /* Do something to the contents of that page. */
103 memset(vaddr, 0, PAGE_SIZE);
104
105 /* Unmap that page. */
106 kunmap_atomic(vaddr);
107
108Note that the kunmap_atomic() call takes the result of the kmap_atomic() call
109not the argument.
110
111If you need to map two pages because you want to copy from one page to
112another you need to keep the kmap_atomic calls strictly nested, like:
113
114 vaddr1 = kmap_atomic(page1);
115 vaddr2 = kmap_atomic(page2);
116
117 memcpy(vaddr1, vaddr2, PAGE_SIZE);
118
119 kunmap_atomic(vaddr2);
120 kunmap_atomic(vaddr1);
121
122
123==========================
124COST OF TEMPORARY MAPPINGS
125==========================
126
127The cost of creating temporary mappings can be quite high. The arch has to
128manipulate the kernel's page tables, the data TLB and/or the MMU's registers.
129
130If CONFIG_HIGHMEM is not set, then the kernel will try and create a mapping
131simply with a bit of arithmetic that will convert the page struct address into
132a pointer to the page contents rather than juggling mappings about. In such a
133case, the unmap operation may be a null operation.
134
135If CONFIG_MMU is not set, then there can be no temporary mappings and no
136highmem. In such a case, the arithmetic approach will also be used.
137
138
139========
140i386 PAE
141========
142
143The i386 arch, under some circumstances, will permit you to stick up to 64GiB
144of RAM into your 32-bit machine. This has a number of consequences:
145
146 (*) Linux needs a page-frame structure for each page in the system and the
147 pageframes need to live in the permanent mapping, which means:
148
149 (*) you can have 896M/sizeof(struct page) page-frames at most; with struct
150 page being 32-bytes that would end up being something in the order of 112G
151 worth of pages; the kernel, however, needs to store more than just
152 page-frames in that memory...
153
154 (*) PAE makes your page tables larger - which slows the system down as more
155 data has to be accessed to traverse in TLB fills and the like. One
156 advantage is that PAE has more PTE bits and can provide advanced features
157 like NX and PAT.
158
159The general recommendation is that you don't use more than 8GiB on a 32-bit
160machine - although more might work for you and your workload, you're pretty
161much on your own - don't expect kernel developers to really care much if things
162come apart.
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
index 457634c1e03e..f8551b3879f8 100644
--- a/Documentation/vm/hugetlbpage.txt
+++ b/Documentation/vm/hugetlbpage.txt
@@ -72,7 +72,7 @@ number of huge pages requested. This is the most reliable method of
72allocating huge pages as memory has not yet become fragmented. 72allocating huge pages as memory has not yet become fragmented.
73 73
74Some platforms support multiple huge page sizes. To allocate huge pages 74Some platforms support multiple huge page sizes. To allocate huge pages
75of a specific size, one must preceed the huge pages boot command parameters 75of a specific size, one must precede the huge pages boot command parameters
76with a huge page size selection parameter "hugepagesz=<size>". <size> must 76with a huge page size selection parameter "hugepagesz=<size>". <size> must
77be specified in bytes with optional scale suffix [kKmMgG]. The default huge 77be specified in bytes with optional scale suffix [kKmMgG]. The default huge
78page size may be selected with the "default_hugepagesz=<size>" boot parameter. 78page size may be selected with the "default_hugepagesz=<size>" boot parameter.
diff --git a/Documentation/vm/hwpoison.txt b/Documentation/vm/hwpoison.txt
index 12f9ba20ccb7..550068466605 100644
--- a/Documentation/vm/hwpoison.txt
+++ b/Documentation/vm/hwpoison.txt
@@ -129,12 +129,12 @@ Limit injection to pages owned by memgroup. Specified by inode number
129of the memcg. 129of the memcg.
130 130
131Example: 131Example:
132 mkdir /cgroup/hwpoison 132 mkdir /sys/fs/cgroup/mem/hwpoison
133 133
134 usemem -m 100 -s 1000 & 134 usemem -m 100 -s 1000 &
135 echo `jobs -p` > /cgroup/hwpoison/tasks 135 echo `jobs -p` > /sys/fs/cgroup/mem/hwpoison/tasks
136 136
137 memcg_ino=$(ls -id /cgroup/hwpoison | cut -f1 -d' ') 137 memcg_ino=$(ls -id /sys/fs/cgroup/mem/hwpoison | cut -f1 -d' ')
138 echo $memcg_ino > /debug/hwpoison/corrupt-filter-memcg 138 echo $memcg_ino > /debug/hwpoison/corrupt-filter-memcg
139 139
140 page-types -p `pidof init` --hwpoison # shall do nothing 140 page-types -p `pidof init` --hwpoison # shall do nothing
diff --git a/Documentation/vm/locking b/Documentation/vm/locking
index 25fadb448760..f61228bd6395 100644
--- a/Documentation/vm/locking
+++ b/Documentation/vm/locking
@@ -66,7 +66,7 @@ in some cases it is not really needed. Eg, vm_start is modified by
66expand_stack(), it is hard to come up with a destructive scenario without 66expand_stack(), it is hard to come up with a destructive scenario without
67having the vmlist protection in this case. 67having the vmlist protection in this case.
68 68
69The page_table_lock nests with the inode i_mmap_lock and the kmem cache 69The page_table_lock nests with the inode i_mmap_mutex and the kmem cache
70c_spinlock spinlocks. This is okay, since the kmem code asks for pages after 70c_spinlock spinlocks. This is okay, since the kmem code asks for pages after
71dropping c_spinlock. The page_table_lock also nests with pagecache_lock and 71dropping c_spinlock. The page_table_lock also nests with pagecache_lock and
72pagemap_lru_lock spinlocks, and no code asks for memory with these locks 72pagemap_lru_lock spinlocks, and no code asks for memory with these locks
diff --git a/Documentation/vm/numa_memory_policy.txt b/Documentation/vm/numa_memory_policy.txt
index 6690fc34ef6d..4e7da6543424 100644
--- a/Documentation/vm/numa_memory_policy.txt
+++ b/Documentation/vm/numa_memory_policy.txt
@@ -424,7 +424,7 @@ a command line tool, numactl(8), exists that allows one to:
424 424
425+ set the shared policy for a shared memory segment via mbind(2) 425+ set the shared policy for a shared memory segment via mbind(2)
426 426
427The numactl(8) tool is packages with the run-time version of the library 427The numactl(8) tool is packaged with the run-time version of the library
428containing the memory policy system call wrappers. Some distributions 428containing the memory policy system call wrappers. Some distributions
429package the headers and compile-time libraries in a separate development 429package the headers and compile-time libraries in a separate development
430package. 430package.
diff --git a/Documentation/vm/overcommit-accounting b/Documentation/vm/overcommit-accounting
index 21c7b1f8f32b..706d7ed9d8d2 100644
--- a/Documentation/vm/overcommit-accounting
+++ b/Documentation/vm/overcommit-accounting
@@ -4,7 +4,7 @@ The Linux kernel supports the following overcommit handling modes
4 address space are refused. Used for a typical system. It 4 address space are refused. Used for a typical system. It
5 ensures a seriously wild allocation fails while allowing 5 ensures a seriously wild allocation fails while allowing
6 overcommit to reduce swap usage. root is allowed to 6 overcommit to reduce swap usage. root is allowed to
7 allocate slighly more memory in this mode. This is the 7 allocate slightly more memory in this mode. This is the
8 default. 8 default.
9 9
101 - Always overcommit. Appropriate for some scientific 101 - Always overcommit. Appropriate for some scientific
diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c
index cc96ee2666f2..7445caa26d05 100644
--- a/Documentation/vm/page-types.c
+++ b/Documentation/vm/page-types.c
@@ -32,8 +32,20 @@
32#include <sys/types.h> 32#include <sys/types.h>
33#include <sys/errno.h> 33#include <sys/errno.h>
34#include <sys/fcntl.h> 34#include <sys/fcntl.h>
35#include <sys/mount.h>
36#include <sys/statfs.h>
37#include "../../include/linux/magic.h"
35 38
36 39
40#ifndef MAX_PATH
41# define MAX_PATH 256
42#endif
43
44#ifndef STR
45# define _STR(x) #x
46# define STR(x) _STR(x)
47#endif
48
37/* 49/*
38 * pagemap kernel ABI bits 50 * pagemap kernel ABI bits
39 */ 51 */
@@ -152,6 +164,12 @@ static const char *page_flag_names[] = {
152}; 164};
153 165
154 166
167static const char *debugfs_known_mountpoints[] = {
168 "/sys/kernel/debug",
169 "/debug",
170 0,
171};
172
155/* 173/*
156 * data structures 174 * data structures
157 */ 175 */
@@ -184,7 +202,7 @@ static int kpageflags_fd;
184static int opt_hwpoison; 202static int opt_hwpoison;
185static int opt_unpoison; 203static int opt_unpoison;
186 204
187static const char hwpoison_debug_fs[] = "/debug/hwpoison"; 205static char hwpoison_debug_fs[MAX_PATH+1];
188static int hwpoison_inject_fd; 206static int hwpoison_inject_fd;
189static int hwpoison_forget_fd; 207static int hwpoison_forget_fd;
190 208
@@ -464,21 +482,100 @@ static uint64_t kpageflags_flags(uint64_t flags)
464 return flags; 482 return flags;
465} 483}
466 484
485/* verify that a mountpoint is actually a debugfs instance */
486static int debugfs_valid_mountpoint(const char *debugfs)
487{
488 struct statfs st_fs;
489
490 if (statfs(debugfs, &st_fs) < 0)
491 return -ENOENT;
492 else if (st_fs.f_type != (long) DEBUGFS_MAGIC)
493 return -ENOENT;
494
495 return 0;
496}
497
498/* find the path to the mounted debugfs */
499static const char *debugfs_find_mountpoint(void)
500{
501 const char **ptr;
502 char type[100];
503 FILE *fp;
504
505 ptr = debugfs_known_mountpoints;
506 while (*ptr) {
507 if (debugfs_valid_mountpoint(*ptr) == 0) {
508 strcpy(hwpoison_debug_fs, *ptr);
509 return hwpoison_debug_fs;
510 }
511 ptr++;
512 }
513
514 /* give up and parse /proc/mounts */
515 fp = fopen("/proc/mounts", "r");
516 if (fp == NULL)
517 perror("Can't open /proc/mounts for read");
518
519 while (fscanf(fp, "%*s %"
520 STR(MAX_PATH)
521 "s %99s %*s %*d %*d\n",
522 hwpoison_debug_fs, type) == 2) {
523 if (strcmp(type, "debugfs") == 0)
524 break;
525 }
526 fclose(fp);
527
528 if (strcmp(type, "debugfs") != 0)
529 return NULL;
530
531 return hwpoison_debug_fs;
532}
533
534/* mount the debugfs somewhere if it's not mounted */
535
536static void debugfs_mount(void)
537{
538 const char **ptr;
539
540 /* see if it's already mounted */
541 if (debugfs_find_mountpoint())
542 return;
543
544 ptr = debugfs_known_mountpoints;
545 while (*ptr) {
546 if (mount(NULL, *ptr, "debugfs", 0, NULL) == 0) {
547 /* save the mountpoint */
548 strcpy(hwpoison_debug_fs, *ptr);
549 break;
550 }
551 ptr++;
552 }
553
554 if (*ptr == NULL) {
555 perror("mount debugfs");
556 exit(EXIT_FAILURE);
557 }
558}
559
467/* 560/*
468 * page actions 561 * page actions
469 */ 562 */
470 563
471static void prepare_hwpoison_fd(void) 564static void prepare_hwpoison_fd(void)
472{ 565{
473 char buf[100]; 566 char buf[MAX_PATH + 1];
567
568 debugfs_mount();
474 569
475 if (opt_hwpoison && !hwpoison_inject_fd) { 570 if (opt_hwpoison && !hwpoison_inject_fd) {
476 sprintf(buf, "%s/corrupt-pfn", hwpoison_debug_fs); 571 snprintf(buf, MAX_PATH, "%s/hwpoison/corrupt-pfn",
572 hwpoison_debug_fs);
477 hwpoison_inject_fd = checked_open(buf, O_WRONLY); 573 hwpoison_inject_fd = checked_open(buf, O_WRONLY);
478 } 574 }
479 575
480 if (opt_unpoison && !hwpoison_forget_fd) { 576 if (opt_unpoison && !hwpoison_forget_fd) {
481 sprintf(buf, "%s/unpoison-pfn", hwpoison_debug_fs); 577 snprintf(buf, MAX_PATH, "%s/hwpoison/unpoison-pfn",
578 hwpoison_debug_fs);
482 hwpoison_forget_fd = checked_open(buf, O_WRONLY); 579 hwpoison_forget_fd = checked_open(buf, O_WRONLY);
483 } 580 }
484} 581}
diff --git a/Documentation/vm/slabinfo.c b/Documentation/vm/slabinfo.c
deleted file mode 100644
index 92e729f4b676..000000000000
--- a/Documentation/vm/slabinfo.c
+++ /dev/null
@@ -1,1364 +0,0 @@
1/*
2 * Slabinfo: Tool to get reports about slabs
3 *
4 * (C) 2007 sgi, Christoph Lameter
5 *
6 * Compile by:
7 *
8 * gcc -o slabinfo slabinfo.c
9 */
10#include <stdio.h>
11#include <stdlib.h>
12#include <sys/types.h>
13#include <dirent.h>
14#include <strings.h>
15#include <string.h>
16#include <unistd.h>
17#include <stdarg.h>
18#include <getopt.h>
19#include <regex.h>
20#include <errno.h>
21
22#define MAX_SLABS 500
23#define MAX_ALIASES 500
24#define MAX_NODES 1024
25
26struct slabinfo {
27 char *name;
28 int alias;
29 int refs;
30 int aliases, align, cache_dma, cpu_slabs, destroy_by_rcu;
31 int hwcache_align, object_size, objs_per_slab;
32 int sanity_checks, slab_size, store_user, trace;
33 int order, poison, reclaim_account, red_zone;
34 unsigned long partial, objects, slabs, objects_partial, objects_total;
35 unsigned long alloc_fastpath, alloc_slowpath;
36 unsigned long free_fastpath, free_slowpath;
37 unsigned long free_frozen, free_add_partial, free_remove_partial;
38 unsigned long alloc_from_partial, alloc_slab, free_slab, alloc_refill;
39 unsigned long cpuslab_flush, deactivate_full, deactivate_empty;
40 unsigned long deactivate_to_head, deactivate_to_tail;
41 unsigned long deactivate_remote_frees, order_fallback;
42 int numa[MAX_NODES];
43 int numa_partial[MAX_NODES];
44} slabinfo[MAX_SLABS];
45
46struct aliasinfo {
47 char *name;
48 char *ref;
49 struct slabinfo *slab;
50} aliasinfo[MAX_ALIASES];
51
52int slabs = 0;
53int actual_slabs = 0;
54int aliases = 0;
55int alias_targets = 0;
56int highest_node = 0;
57
58char buffer[4096];
59
60int show_empty = 0;
61int show_report = 0;
62int show_alias = 0;
63int show_slab = 0;
64int skip_zero = 1;
65int show_numa = 0;
66int show_track = 0;
67int show_first_alias = 0;
68int validate = 0;
69int shrink = 0;
70int show_inverted = 0;
71int show_single_ref = 0;
72int show_totals = 0;
73int sort_size = 0;
74int sort_active = 0;
75int set_debug = 0;
76int show_ops = 0;
77int show_activity = 0;
78
79/* Debug options */
80int sanity = 0;
81int redzone = 0;
82int poison = 0;
83int tracking = 0;
84int tracing = 0;
85
86int page_size;
87
88regex_t pattern;
89
90static void fatal(const char *x, ...)
91{
92 va_list ap;
93
94 va_start(ap, x);
95 vfprintf(stderr, x, ap);
96 va_end(ap);
97 exit(EXIT_FAILURE);
98}
99
100static void usage(void)
101{
102 printf("slabinfo 5/7/2007. (c) 2007 sgi.\n\n"
103 "slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]\n"
104 "-a|--aliases Show aliases\n"
105 "-A|--activity Most active slabs first\n"
106 "-d<options>|--debug=<options> Set/Clear Debug options\n"
107 "-D|--display-active Switch line format to activity\n"
108 "-e|--empty Show empty slabs\n"
109 "-f|--first-alias Show first alias\n"
110 "-h|--help Show usage information\n"
111 "-i|--inverted Inverted list\n"
112 "-l|--slabs Show slabs\n"
113 "-n|--numa Show NUMA information\n"
114 "-o|--ops Show kmem_cache_ops\n"
115 "-s|--shrink Shrink slabs\n"
116 "-r|--report Detailed report on single slabs\n"
117 "-S|--Size Sort by size\n"
118 "-t|--tracking Show alloc/free information\n"
119 "-T|--Totals Show summary information\n"
120 "-v|--validate Validate slabs\n"
121 "-z|--zero Include empty slabs\n"
122 "-1|--1ref Single reference\n"
123 "\nValid debug options (FZPUT may be combined)\n"
124 "a / A Switch on all debug options (=FZUP)\n"
125 "- Switch off all debug options\n"
126 "f / F Sanity Checks (SLAB_DEBUG_FREE)\n"
127 "z / Z Redzoning\n"
128 "p / P Poisoning\n"
129 "u / U Tracking\n"
130 "t / T Tracing\n"
131 );
132}
133
134static unsigned long read_obj(const char *name)
135{
136 FILE *f = fopen(name, "r");
137
138 if (!f)
139 buffer[0] = 0;
140 else {
141 if (!fgets(buffer, sizeof(buffer), f))
142 buffer[0] = 0;
143 fclose(f);
144 if (buffer[strlen(buffer)] == '\n')
145 buffer[strlen(buffer)] = 0;
146 }
147 return strlen(buffer);
148}
149
150
151/*
152 * Get the contents of an attribute
153 */
154static unsigned long get_obj(const char *name)
155{
156 if (!read_obj(name))
157 return 0;
158
159 return atol(buffer);
160}
161
162static unsigned long get_obj_and_str(const char *name, char **x)
163{
164 unsigned long result = 0;
165 char *p;
166
167 *x = NULL;
168
169 if (!read_obj(name)) {
170 x = NULL;
171 return 0;
172 }
173 result = strtoul(buffer, &p, 10);
174 while (*p == ' ')
175 p++;
176 if (*p)
177 *x = strdup(p);
178 return result;
179}
180
181static void set_obj(struct slabinfo *s, const char *name, int n)
182{
183 char x[100];
184 FILE *f;
185
186 snprintf(x, 100, "%s/%s", s->name, name);
187 f = fopen(x, "w");
188 if (!f)
189 fatal("Cannot write to %s\n", x);
190
191 fprintf(f, "%d\n", n);
192 fclose(f);
193}
194
195static unsigned long read_slab_obj(struct slabinfo *s, const char *name)
196{
197 char x[100];
198 FILE *f;
199 size_t l;
200
201 snprintf(x, 100, "%s/%s", s->name, name);
202 f = fopen(x, "r");
203 if (!f) {
204 buffer[0] = 0;
205 l = 0;
206 } else {
207 l = fread(buffer, 1, sizeof(buffer), f);
208 buffer[l] = 0;
209 fclose(f);
210 }
211 return l;
212}
213
214
215/*
216 * Put a size string together
217 */
218static int store_size(char *buffer, unsigned long value)
219{
220 unsigned long divisor = 1;
221 char trailer = 0;
222 int n;
223
224 if (value > 1000000000UL) {
225 divisor = 100000000UL;
226 trailer = 'G';
227 } else if (value > 1000000UL) {
228 divisor = 100000UL;
229 trailer = 'M';
230 } else if (value > 1000UL) {
231 divisor = 100;
232 trailer = 'K';
233 }
234
235 value /= divisor;
236 n = sprintf(buffer, "%ld",value);
237 if (trailer) {
238 buffer[n] = trailer;
239 n++;
240 buffer[n] = 0;
241 }
242 if (divisor != 1) {
243 memmove(buffer + n - 2, buffer + n - 3, 4);
244 buffer[n-2] = '.';
245 n++;
246 }
247 return n;
248}
249
250static void decode_numa_list(int *numa, char *t)
251{
252 int node;
253 int nr;
254
255 memset(numa, 0, MAX_NODES * sizeof(int));
256
257 if (!t)
258 return;
259
260 while (*t == 'N') {
261 t++;
262 node = strtoul(t, &t, 10);
263 if (*t == '=') {
264 t++;
265 nr = strtoul(t, &t, 10);
266 numa[node] = nr;
267 if (node > highest_node)
268 highest_node = node;
269 }
270 while (*t == ' ')
271 t++;
272 }
273}
274
275static void slab_validate(struct slabinfo *s)
276{
277 if (strcmp(s->name, "*") == 0)
278 return;
279
280 set_obj(s, "validate", 1);
281}
282
283static void slab_shrink(struct slabinfo *s)
284{
285 if (strcmp(s->name, "*") == 0)
286 return;
287
288 set_obj(s, "shrink", 1);
289}
290
291int line = 0;
292
293static void first_line(void)
294{
295 if (show_activity)
296 printf("Name Objects Alloc Free %%Fast Fallb O\n");
297 else
298 printf("Name Objects Objsize Space "
299 "Slabs/Part/Cpu O/S O %%Fr %%Ef Flg\n");
300}
301
302/*
303 * Find the shortest alias of a slab
304 */
305static struct aliasinfo *find_one_alias(struct slabinfo *find)
306{
307 struct aliasinfo *a;
308 struct aliasinfo *best = NULL;
309
310 for(a = aliasinfo;a < aliasinfo + aliases; a++) {
311 if (a->slab == find &&
312 (!best || strlen(best->name) < strlen(a->name))) {
313 best = a;
314 if (strncmp(a->name,"kmall", 5) == 0)
315 return best;
316 }
317 }
318 return best;
319}
320
321static unsigned long slab_size(struct slabinfo *s)
322{
323 return s->slabs * (page_size << s->order);
324}
325
326static unsigned long slab_activity(struct slabinfo *s)
327{
328 return s->alloc_fastpath + s->free_fastpath +
329 s->alloc_slowpath + s->free_slowpath;
330}
331
332static void slab_numa(struct slabinfo *s, int mode)
333{
334 int node;
335
336 if (strcmp(s->name, "*") == 0)
337 return;
338
339 if (!highest_node) {
340 printf("\n%s: No NUMA information available.\n", s->name);
341 return;
342 }
343
344 if (skip_zero && !s->slabs)
345 return;
346
347 if (!line) {
348 printf("\n%-21s:", mode ? "NUMA nodes" : "Slab");
349 for(node = 0; node <= highest_node; node++)
350 printf(" %4d", node);
351 printf("\n----------------------");
352 for(node = 0; node <= highest_node; node++)
353 printf("-----");
354 printf("\n");
355 }
356 printf("%-21s ", mode ? "All slabs" : s->name);
357 for(node = 0; node <= highest_node; node++) {
358 char b[20];
359
360 store_size(b, s->numa[node]);
361 printf(" %4s", b);
362 }
363 printf("\n");
364 if (mode) {
365 printf("%-21s ", "Partial slabs");
366 for(node = 0; node <= highest_node; node++) {
367 char b[20];
368
369 store_size(b, s->numa_partial[node]);
370 printf(" %4s", b);
371 }
372 printf("\n");
373 }
374 line++;
375}
376
377static void show_tracking(struct slabinfo *s)
378{
379 printf("\n%s: Kernel object allocation\n", s->name);
380 printf("-----------------------------------------------------------------------\n");
381 if (read_slab_obj(s, "alloc_calls"))
382 printf(buffer);
383 else
384 printf("No Data\n");
385
386 printf("\n%s: Kernel object freeing\n", s->name);
387 printf("------------------------------------------------------------------------\n");
388 if (read_slab_obj(s, "free_calls"))
389 printf(buffer);
390 else
391 printf("No Data\n");
392
393}
394
395static void ops(struct slabinfo *s)
396{
397 if (strcmp(s->name, "*") == 0)
398 return;
399
400 if (read_slab_obj(s, "ops")) {
401 printf("\n%s: kmem_cache operations\n", s->name);
402 printf("--------------------------------------------\n");
403 printf(buffer);
404 } else
405 printf("\n%s has no kmem_cache operations\n", s->name);
406}
407
408static const char *onoff(int x)
409{
410 if (x)
411 return "On ";
412 return "Off";
413}
414
415static void slab_stats(struct slabinfo *s)
416{
417 unsigned long total_alloc;
418 unsigned long total_free;
419 unsigned long total;
420
421 if (!s->alloc_slab)
422 return;
423
424 total_alloc = s->alloc_fastpath + s->alloc_slowpath;
425 total_free = s->free_fastpath + s->free_slowpath;
426
427 if (!total_alloc)
428 return;
429
430 printf("\n");
431 printf("Slab Perf Counter Alloc Free %%Al %%Fr\n");
432 printf("--------------------------------------------------\n");
433 printf("Fastpath %8lu %8lu %3lu %3lu\n",
434 s->alloc_fastpath, s->free_fastpath,
435 s->alloc_fastpath * 100 / total_alloc,
436 s->free_fastpath * 100 / total_free);
437 printf("Slowpath %8lu %8lu %3lu %3lu\n",
438 total_alloc - s->alloc_fastpath, s->free_slowpath,
439 (total_alloc - s->alloc_fastpath) * 100 / total_alloc,
440 s->free_slowpath * 100 / total_free);
441 printf("Page Alloc %8lu %8lu %3lu %3lu\n",
442 s->alloc_slab, s->free_slab,
443 s->alloc_slab * 100 / total_alloc,
444 s->free_slab * 100 / total_free);
445 printf("Add partial %8lu %8lu %3lu %3lu\n",
446 s->deactivate_to_head + s->deactivate_to_tail,
447 s->free_add_partial,
448 (s->deactivate_to_head + s->deactivate_to_tail) * 100 / total_alloc,
449 s->free_add_partial * 100 / total_free);
450 printf("Remove partial %8lu %8lu %3lu %3lu\n",
451 s->alloc_from_partial, s->free_remove_partial,
452 s->alloc_from_partial * 100 / total_alloc,
453 s->free_remove_partial * 100 / total_free);
454
455 printf("RemoteObj/SlabFrozen %8lu %8lu %3lu %3lu\n",
456 s->deactivate_remote_frees, s->free_frozen,
457 s->deactivate_remote_frees * 100 / total_alloc,
458 s->free_frozen * 100 / total_free);
459
460 printf("Total %8lu %8lu\n\n", total_alloc, total_free);
461
462 if (s->cpuslab_flush)
463 printf("Flushes %8lu\n", s->cpuslab_flush);
464
465 if (s->alloc_refill)
466 printf("Refill %8lu\n", s->alloc_refill);
467
468 total = s->deactivate_full + s->deactivate_empty +
469 s->deactivate_to_head + s->deactivate_to_tail;
470
471 if (total)
472 printf("Deactivate Full=%lu(%lu%%) Empty=%lu(%lu%%) "
473 "ToHead=%lu(%lu%%) ToTail=%lu(%lu%%)\n",
474 s->deactivate_full, (s->deactivate_full * 100) / total,
475 s->deactivate_empty, (s->deactivate_empty * 100) / total,
476 s->deactivate_to_head, (s->deactivate_to_head * 100) / total,
477 s->deactivate_to_tail, (s->deactivate_to_tail * 100) / total);
478}
479
480static void report(struct slabinfo *s)
481{
482 if (strcmp(s->name, "*") == 0)
483 return;
484
485 printf("\nSlabcache: %-20s Aliases: %2d Order : %2d Objects: %lu\n",
486 s->name, s->aliases, s->order, s->objects);
487 if (s->hwcache_align)
488 printf("** Hardware cacheline aligned\n");
489 if (s->cache_dma)
490 printf("** Memory is allocated in a special DMA zone\n");
491 if (s->destroy_by_rcu)
492 printf("** Slabs are destroyed via RCU\n");
493 if (s->reclaim_account)
494 printf("** Reclaim accounting active\n");
495
496 printf("\nSizes (bytes) Slabs Debug Memory\n");
497 printf("------------------------------------------------------------------------\n");
498 printf("Object : %7d Total : %7ld Sanity Checks : %s Total: %7ld\n",
499 s->object_size, s->slabs, onoff(s->sanity_checks),
500 s->slabs * (page_size << s->order));
501 printf("SlabObj: %7d Full : %7ld Redzoning : %s Used : %7ld\n",
502 s->slab_size, s->slabs - s->partial - s->cpu_slabs,
503 onoff(s->red_zone), s->objects * s->object_size);
504 printf("SlabSiz: %7d Partial: %7ld Poisoning : %s Loss : %7ld\n",
505 page_size << s->order, s->partial, onoff(s->poison),
506 s->slabs * (page_size << s->order) - s->objects * s->object_size);
507 printf("Loss : %7d CpuSlab: %7d Tracking : %s Lalig: %7ld\n",
508 s->slab_size - s->object_size, s->cpu_slabs, onoff(s->store_user),
509 (s->slab_size - s->object_size) * s->objects);
510 printf("Align : %7d Objects: %7d Tracing : %s Lpadd: %7ld\n",
511 s->align, s->objs_per_slab, onoff(s->trace),
512 ((page_size << s->order) - s->objs_per_slab * s->slab_size) *
513 s->slabs);
514
515 ops(s);
516 show_tracking(s);
517 slab_numa(s, 1);
518 slab_stats(s);
519}
520
521static void slabcache(struct slabinfo *s)
522{
523 char size_str[20];
524 char dist_str[40];
525 char flags[20];
526 char *p = flags;
527
528 if (strcmp(s->name, "*") == 0)
529 return;
530
531 if (actual_slabs == 1) {
532 report(s);
533 return;
534 }
535
536 if (skip_zero && !show_empty && !s->slabs)
537 return;
538
539 if (show_empty && s->slabs)
540 return;
541
542 store_size(size_str, slab_size(s));
543 snprintf(dist_str, 40, "%lu/%lu/%d", s->slabs - s->cpu_slabs,
544 s->partial, s->cpu_slabs);
545
546 if (!line++)
547 first_line();
548
549 if (s->aliases)
550 *p++ = '*';
551 if (s->cache_dma)
552 *p++ = 'd';
553 if (s->hwcache_align)
554 *p++ = 'A';
555 if (s->poison)
556 *p++ = 'P';
557 if (s->reclaim_account)
558 *p++ = 'a';
559 if (s->red_zone)
560 *p++ = 'Z';
561 if (s->sanity_checks)
562 *p++ = 'F';
563 if (s->store_user)
564 *p++ = 'U';
565 if (s->trace)
566 *p++ = 'T';
567
568 *p = 0;
569 if (show_activity) {
570 unsigned long total_alloc;
571 unsigned long total_free;
572
573 total_alloc = s->alloc_fastpath + s->alloc_slowpath;
574 total_free = s->free_fastpath + s->free_slowpath;
575
576 printf("%-21s %8ld %10ld %10ld %3ld %3ld %5ld %1d\n",
577 s->name, s->objects,
578 total_alloc, total_free,
579 total_alloc ? (s->alloc_fastpath * 100 / total_alloc) : 0,
580 total_free ? (s->free_fastpath * 100 / total_free) : 0,
581 s->order_fallback, s->order);
582 }
583 else
584 printf("%-21s %8ld %7d %8s %14s %4d %1d %3ld %3ld %s\n",
585 s->name, s->objects, s->object_size, size_str, dist_str,
586 s->objs_per_slab, s->order,
587 s->slabs ? (s->partial * 100) / s->slabs : 100,
588 s->slabs ? (s->objects * s->object_size * 100) /
589 (s->slabs * (page_size << s->order)) : 100,
590 flags);
591}
592
593/*
594 * Analyze debug options. Return false if something is amiss.
595 */
596static int debug_opt_scan(char *opt)
597{
598 if (!opt || !opt[0] || strcmp(opt, "-") == 0)
599 return 1;
600
601 if (strcasecmp(opt, "a") == 0) {
602 sanity = 1;
603 poison = 1;
604 redzone = 1;
605 tracking = 1;
606 return 1;
607 }
608
609 for ( ; *opt; opt++)
610 switch (*opt) {
611 case 'F' : case 'f':
612 if (sanity)
613 return 0;
614 sanity = 1;
615 break;
616 case 'P' : case 'p':
617 if (poison)
618 return 0;
619 poison = 1;
620 break;
621
622 case 'Z' : case 'z':
623 if (redzone)
624 return 0;
625 redzone = 1;
626 break;
627
628 case 'U' : case 'u':
629 if (tracking)
630 return 0;
631 tracking = 1;
632 break;
633
634 case 'T' : case 't':
635 if (tracing)
636 return 0;
637 tracing = 1;
638 break;
639 default:
640 return 0;
641 }
642 return 1;
643}
644
645static int slab_empty(struct slabinfo *s)
646{
647 if (s->objects > 0)
648 return 0;
649
650 /*
651 * We may still have slabs even if there are no objects. Shrinking will
652 * remove them.
653 */
654 if (s->slabs != 0)
655 set_obj(s, "shrink", 1);
656
657 return 1;
658}
659
660static void slab_debug(struct slabinfo *s)
661{
662 if (strcmp(s->name, "*") == 0)
663 return;
664
665 if (sanity && !s->sanity_checks) {
666 set_obj(s, "sanity", 1);
667 }
668 if (!sanity && s->sanity_checks) {
669 if (slab_empty(s))
670 set_obj(s, "sanity", 0);
671 else
672 fprintf(stderr, "%s not empty cannot disable sanity checks\n", s->name);
673 }
674 if (redzone && !s->red_zone) {
675 if (slab_empty(s))
676 set_obj(s, "red_zone", 1);
677 else
678 fprintf(stderr, "%s not empty cannot enable redzoning\n", s->name);
679 }
680 if (!redzone && s->red_zone) {
681 if (slab_empty(s))
682 set_obj(s, "red_zone", 0);
683 else
684 fprintf(stderr, "%s not empty cannot disable redzoning\n", s->name);
685 }
686 if (poison && !s->poison) {
687 if (slab_empty(s))
688 set_obj(s, "poison", 1);
689 else
690 fprintf(stderr, "%s not empty cannot enable poisoning\n", s->name);
691 }
692 if (!poison && s->poison) {
693 if (slab_empty(s))
694 set_obj(s, "poison", 0);
695 else
696 fprintf(stderr, "%s not empty cannot disable poisoning\n", s->name);
697 }
698 if (tracking && !s->store_user) {
699 if (slab_empty(s))
700 set_obj(s, "store_user", 1);
701 else
702 fprintf(stderr, "%s not empty cannot enable tracking\n", s->name);
703 }
704 if (!tracking && s->store_user) {
705 if (slab_empty(s))
706 set_obj(s, "store_user", 0);
707 else
708 fprintf(stderr, "%s not empty cannot disable tracking\n", s->name);
709 }
710 if (tracing && !s->trace) {
711 if (slabs == 1)
712 set_obj(s, "trace", 1);
713 else
714 fprintf(stderr, "%s can only enable trace for one slab at a time\n", s->name);
715 }
716 if (!tracing && s->trace)
717 set_obj(s, "trace", 1);
718}
719
720static void totals(void)
721{
722 struct slabinfo *s;
723
724 int used_slabs = 0;
725 char b1[20], b2[20], b3[20], b4[20];
726 unsigned long long max = 1ULL << 63;
727
728 /* Object size */
729 unsigned long long min_objsize = max, max_objsize = 0, avg_objsize;
730
731 /* Number of partial slabs in a slabcache */
732 unsigned long long min_partial = max, max_partial = 0,
733 avg_partial, total_partial = 0;
734
735 /* Number of slabs in a slab cache */
736 unsigned long long min_slabs = max, max_slabs = 0,
737 avg_slabs, total_slabs = 0;
738
739 /* Size of the whole slab */
740 unsigned long long min_size = max, max_size = 0,
741 avg_size, total_size = 0;
742
743 /* Bytes used for object storage in a slab */
744 unsigned long long min_used = max, max_used = 0,
745 avg_used, total_used = 0;
746
747 /* Waste: Bytes used for alignment and padding */
748 unsigned long long min_waste = max, max_waste = 0,
749 avg_waste, total_waste = 0;
750 /* Number of objects in a slab */
751 unsigned long long min_objects = max, max_objects = 0,
752 avg_objects, total_objects = 0;
753 /* Waste per object */
754 unsigned long long min_objwaste = max,
755 max_objwaste = 0, avg_objwaste,
756 total_objwaste = 0;
757
758 /* Memory per object */
759 unsigned long long min_memobj = max,
760 max_memobj = 0, avg_memobj,
761 total_objsize = 0;
762
763 /* Percentage of partial slabs per slab */
764 unsigned long min_ppart = 100, max_ppart = 0,
765 avg_ppart, total_ppart = 0;
766
767 /* Number of objects in partial slabs */
768 unsigned long min_partobj = max, max_partobj = 0,
769 avg_partobj, total_partobj = 0;
770
771 /* Percentage of partial objects of all objects in a slab */
772 unsigned long min_ppartobj = 100, max_ppartobj = 0,
773 avg_ppartobj, total_ppartobj = 0;
774
775
776 for (s = slabinfo; s < slabinfo + slabs; s++) {
777 unsigned long long size;
778 unsigned long used;
779 unsigned long long wasted;
780 unsigned long long objwaste;
781 unsigned long percentage_partial_slabs;
782 unsigned long percentage_partial_objs;
783
784 if (!s->slabs || !s->objects)
785 continue;
786
787 used_slabs++;
788
789 size = slab_size(s);
790 used = s->objects * s->object_size;
791 wasted = size - used;
792 objwaste = s->slab_size - s->object_size;
793
794 percentage_partial_slabs = s->partial * 100 / s->slabs;
795 if (percentage_partial_slabs > 100)
796 percentage_partial_slabs = 100;
797
798 percentage_partial_objs = s->objects_partial * 100
799 / s->objects;
800
801 if (percentage_partial_objs > 100)
802 percentage_partial_objs = 100;
803
804 if (s->object_size < min_objsize)
805 min_objsize = s->object_size;
806 if (s->partial < min_partial)
807 min_partial = s->partial;
808 if (s->slabs < min_slabs)
809 min_slabs = s->slabs;
810 if (size < min_size)
811 min_size = size;
812 if (wasted < min_waste)
813 min_waste = wasted;
814 if (objwaste < min_objwaste)
815 min_objwaste = objwaste;
816 if (s->objects < min_objects)
817 min_objects = s->objects;
818 if (used < min_used)
819 min_used = used;
820 if (s->objects_partial < min_partobj)
821 min_partobj = s->objects_partial;
822 if (percentage_partial_slabs < min_ppart)
823 min_ppart = percentage_partial_slabs;
824 if (percentage_partial_objs < min_ppartobj)
825 min_ppartobj = percentage_partial_objs;
826 if (s->slab_size < min_memobj)
827 min_memobj = s->slab_size;
828
829 if (s->object_size > max_objsize)
830 max_objsize = s->object_size;
831 if (s->partial > max_partial)
832 max_partial = s->partial;
833 if (s->slabs > max_slabs)
834 max_slabs = s->slabs;
835 if (size > max_size)
836 max_size = size;
837 if (wasted > max_waste)
838 max_waste = wasted;
839 if (objwaste > max_objwaste)
840 max_objwaste = objwaste;
841 if (s->objects > max_objects)
842 max_objects = s->objects;
843 if (used > max_used)
844 max_used = used;
845 if (s->objects_partial > max_partobj)
846 max_partobj = s->objects_partial;
847 if (percentage_partial_slabs > max_ppart)
848 max_ppart = percentage_partial_slabs;
849 if (percentage_partial_objs > max_ppartobj)
850 max_ppartobj = percentage_partial_objs;
851 if (s->slab_size > max_memobj)
852 max_memobj = s->slab_size;
853
854 total_partial += s->partial;
855 total_slabs += s->slabs;
856 total_size += size;
857 total_waste += wasted;
858
859 total_objects += s->objects;
860 total_used += used;
861 total_partobj += s->objects_partial;
862 total_ppart += percentage_partial_slabs;
863 total_ppartobj += percentage_partial_objs;
864
865 total_objwaste += s->objects * objwaste;
866 total_objsize += s->objects * s->slab_size;
867 }
868
869 if (!total_objects) {
870 printf("No objects\n");
871 return;
872 }
873 if (!used_slabs) {
874 printf("No slabs\n");
875 return;
876 }
877
878 /* Per slab averages */
879 avg_partial = total_partial / used_slabs;
880 avg_slabs = total_slabs / used_slabs;
881 avg_size = total_size / used_slabs;
882 avg_waste = total_waste / used_slabs;
883
884 avg_objects = total_objects / used_slabs;
885 avg_used = total_used / used_slabs;
886 avg_partobj = total_partobj / used_slabs;
887 avg_ppart = total_ppart / used_slabs;
888 avg_ppartobj = total_ppartobj / used_slabs;
889
890 /* Per object object sizes */
891 avg_objsize = total_used / total_objects;
892 avg_objwaste = total_objwaste / total_objects;
893 avg_partobj = total_partobj * 100 / total_objects;
894 avg_memobj = total_objsize / total_objects;
895
896 printf("Slabcache Totals\n");
897 printf("----------------\n");
898 printf("Slabcaches : %3d Aliases : %3d->%-3d Active: %3d\n",
899 slabs, aliases, alias_targets, used_slabs);
900
901 store_size(b1, total_size);store_size(b2, total_waste);
902 store_size(b3, total_waste * 100 / total_used);
903 printf("Memory used: %6s # Loss : %6s MRatio:%6s%%\n", b1, b2, b3);
904
905 store_size(b1, total_objects);store_size(b2, total_partobj);
906 store_size(b3, total_partobj * 100 / total_objects);
907 printf("# Objects : %6s # PartObj: %6s ORatio:%6s%%\n", b1, b2, b3);
908
909 printf("\n");
910 printf("Per Cache Average Min Max Total\n");
911 printf("---------------------------------------------------------\n");
912
913 store_size(b1, avg_objects);store_size(b2, min_objects);
914 store_size(b3, max_objects);store_size(b4, total_objects);
915 printf("#Objects %10s %10s %10s %10s\n",
916 b1, b2, b3, b4);
917
918 store_size(b1, avg_slabs);store_size(b2, min_slabs);
919 store_size(b3, max_slabs);store_size(b4, total_slabs);
920 printf("#Slabs %10s %10s %10s %10s\n",
921 b1, b2, b3, b4);
922
923 store_size(b1, avg_partial);store_size(b2, min_partial);
924 store_size(b3, max_partial);store_size(b4, total_partial);
925 printf("#PartSlab %10s %10s %10s %10s\n",
926 b1, b2, b3, b4);
927 store_size(b1, avg_ppart);store_size(b2, min_ppart);
928 store_size(b3, max_ppart);
929 store_size(b4, total_partial * 100 / total_slabs);
930 printf("%%PartSlab%10s%% %10s%% %10s%% %10s%%\n",
931 b1, b2, b3, b4);
932
933 store_size(b1, avg_partobj);store_size(b2, min_partobj);
934 store_size(b3, max_partobj);
935 store_size(b4, total_partobj);
936 printf("PartObjs %10s %10s %10s %10s\n",
937 b1, b2, b3, b4);
938
939 store_size(b1, avg_ppartobj);store_size(b2, min_ppartobj);
940 store_size(b3, max_ppartobj);
941 store_size(b4, total_partobj * 100 / total_objects);
942 printf("%% PartObj%10s%% %10s%% %10s%% %10s%%\n",
943 b1, b2, b3, b4);
944
945 store_size(b1, avg_size);store_size(b2, min_size);
946 store_size(b3, max_size);store_size(b4, total_size);
947 printf("Memory %10s %10s %10s %10s\n",
948 b1, b2, b3, b4);
949
950 store_size(b1, avg_used);store_size(b2, min_used);
951 store_size(b3, max_used);store_size(b4, total_used);
952 printf("Used %10s %10s %10s %10s\n",
953 b1, b2, b3, b4);
954
955 store_size(b1, avg_waste);store_size(b2, min_waste);
956 store_size(b3, max_waste);store_size(b4, total_waste);
957 printf("Loss %10s %10s %10s %10s\n",
958 b1, b2, b3, b4);
959
960 printf("\n");
961 printf("Per Object Average Min Max\n");
962 printf("---------------------------------------------\n");
963
964 store_size(b1, avg_memobj);store_size(b2, min_memobj);
965 store_size(b3, max_memobj);
966 printf("Memory %10s %10s %10s\n",
967 b1, b2, b3);
968 store_size(b1, avg_objsize);store_size(b2, min_objsize);
969 store_size(b3, max_objsize);
970 printf("User %10s %10s %10s\n",
971 b1, b2, b3);
972
973 store_size(b1, avg_objwaste);store_size(b2, min_objwaste);
974 store_size(b3, max_objwaste);
975 printf("Loss %10s %10s %10s\n",
976 b1, b2, b3);
977}
978
979static void sort_slabs(void)
980{
981 struct slabinfo *s1,*s2;
982
983 for (s1 = slabinfo; s1 < slabinfo + slabs; s1++) {
984 for (s2 = s1 + 1; s2 < slabinfo + slabs; s2++) {
985 int result;
986
987 if (sort_size)
988 result = slab_size(s1) < slab_size(s2);
989 else if (sort_active)
990 result = slab_activity(s1) < slab_activity(s2);
991 else
992 result = strcasecmp(s1->name, s2->name);
993
994 if (show_inverted)
995 result = -result;
996
997 if (result > 0) {
998 struct slabinfo t;
999
1000 memcpy(&t, s1, sizeof(struct slabinfo));
1001 memcpy(s1, s2, sizeof(struct slabinfo));
1002 memcpy(s2, &t, sizeof(struct slabinfo));
1003 }
1004 }
1005 }
1006}
1007
1008static void sort_aliases(void)
1009{
1010 struct aliasinfo *a1,*a2;
1011
1012 for (a1 = aliasinfo; a1 < aliasinfo + aliases; a1++) {
1013 for (a2 = a1 + 1; a2 < aliasinfo + aliases; a2++) {
1014 char *n1, *n2;
1015
1016 n1 = a1->name;
1017 n2 = a2->name;
1018 if (show_alias && !show_inverted) {
1019 n1 = a1->ref;
1020 n2 = a2->ref;
1021 }
1022 if (strcasecmp(n1, n2) > 0) {
1023 struct aliasinfo t;
1024
1025 memcpy(&t, a1, sizeof(struct aliasinfo));
1026 memcpy(a1, a2, sizeof(struct aliasinfo));
1027 memcpy(a2, &t, sizeof(struct aliasinfo));
1028 }
1029 }
1030 }
1031}
1032
1033static void link_slabs(void)
1034{
1035 struct aliasinfo *a;
1036 struct slabinfo *s;
1037
1038 for (a = aliasinfo; a < aliasinfo + aliases; a++) {
1039
1040 for (s = slabinfo; s < slabinfo + slabs; s++)
1041 if (strcmp(a->ref, s->name) == 0) {
1042 a->slab = s;
1043 s->refs++;
1044 break;
1045 }
1046 if (s == slabinfo + slabs)
1047 fatal("Unresolved alias %s\n", a->ref);
1048 }
1049}
1050
1051static void alias(void)
1052{
1053 struct aliasinfo *a;
1054 char *active = NULL;
1055
1056 sort_aliases();
1057 link_slabs();
1058
1059 for(a = aliasinfo; a < aliasinfo + aliases; a++) {
1060
1061 if (!show_single_ref && a->slab->refs == 1)
1062 continue;
1063
1064 if (!show_inverted) {
1065 if (active) {
1066 if (strcmp(a->slab->name, active) == 0) {
1067 printf(" %s", a->name);
1068 continue;
1069 }
1070 }
1071 printf("\n%-12s <- %s", a->slab->name, a->name);
1072 active = a->slab->name;
1073 }
1074 else
1075 printf("%-20s -> %s\n", a->name, a->slab->name);
1076 }
1077 if (active)
1078 printf("\n");
1079}
1080
1081
1082static void rename_slabs(void)
1083{
1084 struct slabinfo *s;
1085 struct aliasinfo *a;
1086
1087 for (s = slabinfo; s < slabinfo + slabs; s++) {
1088 if (*s->name != ':')
1089 continue;
1090
1091 if (s->refs > 1 && !show_first_alias)
1092 continue;
1093
1094 a = find_one_alias(s);
1095
1096 if (a)
1097 s->name = a->name;
1098 else {
1099 s->name = "*";
1100 actual_slabs--;
1101 }
1102 }
1103}
1104
1105static int slab_mismatch(char *slab)
1106{
1107 return regexec(&pattern, slab, 0, NULL, 0);
1108}
1109
1110static void read_slab_dir(void)
1111{
1112 DIR *dir;
1113 struct dirent *de;
1114 struct slabinfo *slab = slabinfo;
1115 struct aliasinfo *alias = aliasinfo;
1116 char *p;
1117 char *t;
1118 int count;
1119
1120 if (chdir("/sys/kernel/slab") && chdir("/sys/slab"))
1121 fatal("SYSFS support for SLUB not active\n");
1122
1123 dir = opendir(".");
1124 while ((de = readdir(dir))) {
1125 if (de->d_name[0] == '.' ||
1126 (de->d_name[0] != ':' && slab_mismatch(de->d_name)))
1127 continue;
1128 switch (de->d_type) {
1129 case DT_LNK:
1130 alias->name = strdup(de->d_name);
1131 count = readlink(de->d_name, buffer, sizeof(buffer));
1132
1133 if (count < 0)
1134 fatal("Cannot read symlink %s\n", de->d_name);
1135
1136 buffer[count] = 0;
1137 p = buffer + count;
1138 while (p > buffer && p[-1] != '/')
1139 p--;
1140 alias->ref = strdup(p);
1141 alias++;
1142 break;
1143 case DT_DIR:
1144 if (chdir(de->d_name))
1145 fatal("Unable to access slab %s\n", slab->name);
1146 slab->name = strdup(de->d_name);
1147 slab->alias = 0;
1148 slab->refs = 0;
1149 slab->aliases = get_obj("aliases");
1150 slab->align = get_obj("align");
1151 slab->cache_dma = get_obj("cache_dma");
1152 slab->cpu_slabs = get_obj("cpu_slabs");
1153 slab->destroy_by_rcu = get_obj("destroy_by_rcu");
1154 slab->hwcache_align = get_obj("hwcache_align");
1155 slab->object_size = get_obj("object_size");
1156 slab->objects = get_obj("objects");
1157 slab->objects_partial = get_obj("objects_partial");
1158 slab->objects_total = get_obj("objects_total");
1159 slab->objs_per_slab = get_obj("objs_per_slab");
1160 slab->order = get_obj("order");
1161 slab->partial = get_obj("partial");
1162 slab->partial = get_obj_and_str("partial", &t);
1163 decode_numa_list(slab->numa_partial, t);
1164 free(t);
1165 slab->poison = get_obj("poison");
1166 slab->reclaim_account = get_obj("reclaim_account");
1167 slab->red_zone = get_obj("red_zone");
1168 slab->sanity_checks = get_obj("sanity_checks");
1169 slab->slab_size = get_obj("slab_size");
1170 slab->slabs = get_obj_and_str("slabs", &t);
1171 decode_numa_list(slab->numa, t);
1172 free(t);
1173 slab->store_user = get_obj("store_user");
1174 slab->trace = get_obj("trace");
1175 slab->alloc_fastpath = get_obj("alloc_fastpath");
1176 slab->alloc_slowpath = get_obj("alloc_slowpath");
1177 slab->free_fastpath = get_obj("free_fastpath");
1178 slab->free_slowpath = get_obj("free_slowpath");
1179 slab->free_frozen= get_obj("free_frozen");
1180 slab->free_add_partial = get_obj("free_add_partial");
1181 slab->free_remove_partial = get_obj("free_remove_partial");
1182 slab->alloc_from_partial = get_obj("alloc_from_partial");
1183 slab->alloc_slab = get_obj("alloc_slab");
1184 slab->alloc_refill = get_obj("alloc_refill");
1185 slab->free_slab = get_obj("free_slab");
1186 slab->cpuslab_flush = get_obj("cpuslab_flush");
1187 slab->deactivate_full = get_obj("deactivate_full");
1188 slab->deactivate_empty = get_obj("deactivate_empty");
1189 slab->deactivate_to_head = get_obj("deactivate_to_head");
1190 slab->deactivate_to_tail = get_obj("deactivate_to_tail");
1191 slab->deactivate_remote_frees = get_obj("deactivate_remote_frees");
1192 slab->order_fallback = get_obj("order_fallback");
1193 chdir("..");
1194 if (slab->name[0] == ':')
1195 alias_targets++;
1196 slab++;
1197 break;
1198 default :
1199 fatal("Unknown file type %lx\n", de->d_type);
1200 }
1201 }
1202 closedir(dir);
1203 slabs = slab - slabinfo;
1204 actual_slabs = slabs;
1205 aliases = alias - aliasinfo;
1206 if (slabs > MAX_SLABS)
1207 fatal("Too many slabs\n");
1208 if (aliases > MAX_ALIASES)
1209 fatal("Too many aliases\n");
1210}
1211
1212static void output_slabs(void)
1213{
1214 struct slabinfo *slab;
1215
1216 for (slab = slabinfo; slab < slabinfo + slabs; slab++) {
1217
1218 if (slab->alias)
1219 continue;
1220
1221
1222 if (show_numa)
1223 slab_numa(slab, 0);
1224 else if (show_track)
1225 show_tracking(slab);
1226 else if (validate)
1227 slab_validate(slab);
1228 else if (shrink)
1229 slab_shrink(slab);
1230 else if (set_debug)
1231 slab_debug(slab);
1232 else if (show_ops)
1233 ops(slab);
1234 else if (show_slab)
1235 slabcache(slab);
1236 else if (show_report)
1237 report(slab);
1238 }
1239}
1240
1241struct option opts[] = {
1242 { "aliases", 0, NULL, 'a' },
1243 { "activity", 0, NULL, 'A' },
1244 { "debug", 2, NULL, 'd' },
1245 { "display-activity", 0, NULL, 'D' },
1246 { "empty", 0, NULL, 'e' },
1247 { "first-alias", 0, NULL, 'f' },
1248 { "help", 0, NULL, 'h' },
1249 { "inverted", 0, NULL, 'i'},
1250 { "numa", 0, NULL, 'n' },
1251 { "ops", 0, NULL, 'o' },
1252 { "report", 0, NULL, 'r' },
1253 { "shrink", 0, NULL, 's' },
1254 { "slabs", 0, NULL, 'l' },
1255 { "track", 0, NULL, 't'},
1256 { "validate", 0, NULL, 'v' },
1257 { "zero", 0, NULL, 'z' },
1258 { "1ref", 0, NULL, '1'},
1259 { NULL, 0, NULL, 0 }
1260};
1261
1262int main(int argc, char *argv[])
1263{
1264 int c;
1265 int err;
1266 char *pattern_source;
1267
1268 page_size = getpagesize();
1269
1270 while ((c = getopt_long(argc, argv, "aAd::Defhil1noprstvzTS",
1271 opts, NULL)) != -1)
1272 switch (c) {
1273 case '1':
1274 show_single_ref = 1;
1275 break;
1276 case 'a':
1277 show_alias = 1;
1278 break;
1279 case 'A':
1280 sort_active = 1;
1281 break;
1282 case 'd':
1283 set_debug = 1;
1284 if (!debug_opt_scan(optarg))
1285 fatal("Invalid debug option '%s'\n", optarg);
1286 break;
1287 case 'D':
1288 show_activity = 1;
1289 break;
1290 case 'e':
1291 show_empty = 1;
1292 break;
1293 case 'f':
1294 show_first_alias = 1;
1295 break;
1296 case 'h':
1297 usage();
1298 return 0;
1299 case 'i':
1300 show_inverted = 1;
1301 break;
1302 case 'n':
1303 show_numa = 1;
1304 break;
1305 case 'o':
1306 show_ops = 1;
1307 break;
1308 case 'r':
1309 show_report = 1;
1310 break;
1311 case 's':
1312 shrink = 1;
1313 break;
1314 case 'l':
1315 show_slab = 1;
1316 break;
1317 case 't':
1318 show_track = 1;
1319 break;
1320 case 'v':
1321 validate = 1;
1322 break;
1323 case 'z':
1324 skip_zero = 0;
1325 break;
1326 case 'T':
1327 show_totals = 1;
1328 break;
1329 case 'S':
1330 sort_size = 1;
1331 break;
1332
1333 default:
1334 fatal("%s: Invalid option '%c'\n", argv[0], optopt);
1335
1336 }
1337
1338 if (!show_slab && !show_alias && !show_track && !show_report
1339 && !validate && !shrink && !set_debug && !show_ops)
1340 show_slab = 1;
1341
1342 if (argc > optind)
1343 pattern_source = argv[optind];
1344 else
1345 pattern_source = ".*";
1346
1347 err = regcomp(&pattern, pattern_source, REG_ICASE|REG_NOSUB);
1348 if (err)
1349 fatal("%s: Invalid pattern '%s' code %d\n",
1350 argv[0], pattern_source, err);
1351 read_slab_dir();
1352 if (show_alias)
1353 alias();
1354 else
1355 if (show_totals)
1356 totals();
1357 else {
1358 link_slabs();
1359 rename_slabs();
1360 sort_slabs();
1361 output_slabs();
1362 }
1363 return 0;
1364}
diff --git a/Documentation/vm/transhuge.txt b/Documentation/vm/transhuge.txt
new file mode 100644
index 000000000000..0924aaca3302
--- /dev/null
+++ b/Documentation/vm/transhuge.txt
@@ -0,0 +1,298 @@
1= Transparent Hugepage Support =
2
3== Objective ==
4
5Performance critical computing applications dealing with large memory
6working sets are already running on top of libhugetlbfs and in turn
7hugetlbfs. Transparent Hugepage Support is an alternative means of
8using huge pages for the backing of virtual memory with huge pages
9that supports the automatic promotion and demotion of page sizes and
10without the shortcomings of hugetlbfs.
11
12Currently it only works for anonymous memory mappings but in the
13future it can expand over the pagecache layer starting with tmpfs.
14
15The reason applications are running faster is because of two
16factors. The first factor is almost completely irrelevant and it's not
17of significant interest because it'll also have the downside of
18requiring larger clear-page copy-page in page faults which is a
19potentially negative effect. The first factor consists in taking a
20single page fault for each 2M virtual region touched by userland (so
21reducing the enter/exit kernel frequency by a 512 times factor). This
22only matters the first time the memory is accessed for the lifetime of
23a memory mapping. The second long lasting and much more important
24factor will affect all subsequent accesses to the memory for the whole
25runtime of the application. The second factor consist of two
26components: 1) the TLB miss will run faster (especially with
27virtualization using nested pagetables but almost always also on bare
28metal without virtualization) and 2) a single TLB entry will be
29mapping a much larger amount of virtual memory in turn reducing the
30number of TLB misses. With virtualization and nested pagetables the
31TLB can be mapped of larger size only if both KVM and the Linux guest
32are using hugepages but a significant speedup already happens if only
33one of the two is using hugepages just because of the fact the TLB
34miss is going to run faster.
35
36== Design ==
37
38- "graceful fallback": mm components which don't have transparent
39 hugepage knowledge fall back to breaking a transparent hugepage and
40 working on the regular pages and their respective regular pmd/pte
41 mappings
42
43- if a hugepage allocation fails because of memory fragmentation,
44 regular pages should be gracefully allocated instead and mixed in
45 the same vma without any failure or significant delay and without
46 userland noticing
47
48- if some task quits and more hugepages become available (either
49 immediately in the buddy or through the VM), guest physical memory
50 backed by regular pages should be relocated on hugepages
51 automatically (with khugepaged)
52
53- it doesn't require memory reservation and in turn it uses hugepages
54 whenever possible (the only possible reservation here is kernelcore=
55 to avoid unmovable pages to fragment all the memory but such a tweak
56 is not specific to transparent hugepage support and it's a generic
57 feature that applies to all dynamic high order allocations in the
58 kernel)
59
60- this initial support only offers the feature in the anonymous memory
61 regions but it'd be ideal to move it to tmpfs and the pagecache
62 later
63
64Transparent Hugepage Support maximizes the usefulness of free memory
65if compared to the reservation approach of hugetlbfs by allowing all
66unused memory to be used as cache or other movable (or even unmovable
67entities). It doesn't require reservation to prevent hugepage
68allocation failures to be noticeable from userland. It allows paging
69and all other advanced VM features to be available on the
70hugepages. It requires no modifications for applications to take
71advantage of it.
72
73Applications however can be further optimized to take advantage of
74this feature, like for example they've been optimized before to avoid
75a flood of mmap system calls for every malloc(4k). Optimizing userland
76is by far not mandatory and khugepaged already can take care of long
77lived page allocations even for hugepage unaware applications that
78deals with large amounts of memory.
79
80In certain cases when hugepages are enabled system wide, application
81may end up allocating more memory resources. An application may mmap a
82large region but only touch 1 byte of it, in that case a 2M page might
83be allocated instead of a 4k page for no good. This is why it's
84possible to disable hugepages system-wide and to only have them inside
85MADV_HUGEPAGE madvise regions.
86
87Embedded systems should enable hugepages only inside madvise regions
88to eliminate any risk of wasting any precious byte of memory and to
89only run faster.
90
91Applications that gets a lot of benefit from hugepages and that don't
92risk to lose memory by using hugepages, should use
93madvise(MADV_HUGEPAGE) on their critical mmapped regions.
94
95== sysfs ==
96
97Transparent Hugepage Support can be entirely disabled (mostly for
98debugging purposes) or only enabled inside MADV_HUGEPAGE regions (to
99avoid the risk of consuming more memory resources) or enabled system
100wide. This can be achieved with one of:
101
102echo always >/sys/kernel/mm/transparent_hugepage/enabled
103echo madvise >/sys/kernel/mm/transparent_hugepage/enabled
104echo never >/sys/kernel/mm/transparent_hugepage/enabled
105
106It's also possible to limit defrag efforts in the VM to generate
107hugepages in case they're not immediately free to madvise regions or
108to never try to defrag memory and simply fallback to regular pages
109unless hugepages are immediately available. Clearly if we spend CPU
110time to defrag memory, we would expect to gain even more by the fact
111we use hugepages later instead of regular pages. This isn't always
112guaranteed, but it may be more likely in case the allocation is for a
113MADV_HUGEPAGE region.
114
115echo always >/sys/kernel/mm/transparent_hugepage/defrag
116echo madvise >/sys/kernel/mm/transparent_hugepage/defrag
117echo never >/sys/kernel/mm/transparent_hugepage/defrag
118
119khugepaged will be automatically started when
120transparent_hugepage/enabled is set to "always" or "madvise, and it'll
121be automatically shutdown if it's set to "never".
122
123khugepaged runs usually at low frequency so while one may not want to
124invoke defrag algorithms synchronously during the page faults, it
125should be worth invoking defrag at least in khugepaged. However it's
126also possible to disable defrag in khugepaged:
127
128echo yes >/sys/kernel/mm/transparent_hugepage/khugepaged/defrag
129echo no >/sys/kernel/mm/transparent_hugepage/khugepaged/defrag
130
131You can also control how many pages khugepaged should scan at each
132pass:
133
134/sys/kernel/mm/transparent_hugepage/khugepaged/pages_to_scan
135
136and how many milliseconds to wait in khugepaged between each pass (you
137can set this to 0 to run khugepaged at 100% utilization of one core):
138
139/sys/kernel/mm/transparent_hugepage/khugepaged/scan_sleep_millisecs
140
141and how many milliseconds to wait in khugepaged if there's an hugepage
142allocation failure to throttle the next allocation attempt.
143
144/sys/kernel/mm/transparent_hugepage/khugepaged/alloc_sleep_millisecs
145
146The khugepaged progress can be seen in the number of pages collapsed:
147
148/sys/kernel/mm/transparent_hugepage/khugepaged/pages_collapsed
149
150for each pass:
151
152/sys/kernel/mm/transparent_hugepage/khugepaged/full_scans
153
154== Boot parameter ==
155
156You can change the sysfs boot time defaults of Transparent Hugepage
157Support by passing the parameter "transparent_hugepage=always" or
158"transparent_hugepage=madvise" or "transparent_hugepage=never"
159(without "") to the kernel command line.
160
161== Need of application restart ==
162
163The transparent_hugepage/enabled values only affect future
164behavior. So to make them effective you need to restart any
165application that could have been using hugepages. This also applies to
166the regions registered in khugepaged.
167
168== get_user_pages and follow_page ==
169
170get_user_pages and follow_page if run on a hugepage, will return the
171head or tail pages as usual (exactly as they would do on
172hugetlbfs). Most gup users will only care about the actual physical
173address of the page and its temporary pinning to release after the I/O
174is complete, so they won't ever notice the fact the page is huge. But
175if any driver is going to mangle over the page structure of the tail
176page (like for checking page->mapping or other bits that are relevant
177for the head page and not the tail page), it should be updated to jump
178to check head page instead (while serializing properly against
179split_huge_page() to avoid the head and tail pages to disappear from
180under it, see the futex code to see an example of that, hugetlbfs also
181needed special handling in futex code for similar reasons).
182
183NOTE: these aren't new constraints to the GUP API, and they match the
184same constrains that applies to hugetlbfs too, so any driver capable
185of handling GUP on hugetlbfs will also work fine on transparent
186hugepage backed mappings.
187
188In case you can't handle compound pages if they're returned by
189follow_page, the FOLL_SPLIT bit can be specified as parameter to
190follow_page, so that it will split the hugepages before returning
191them. Migration for example passes FOLL_SPLIT as parameter to
192follow_page because it's not hugepage aware and in fact it can't work
193at all on hugetlbfs (but it instead works fine on transparent
194hugepages thanks to FOLL_SPLIT). migration simply can't deal with
195hugepages being returned (as it's not only checking the pfn of the
196page and pinning it during the copy but it pretends to migrate the
197memory in regular page sizes and with regular pte/pmd mappings).
198
199== Optimizing the applications ==
200
201To be guaranteed that the kernel will map a 2M page immediately in any
202memory region, the mmap region has to be hugepage naturally
203aligned. posix_memalign() can provide that guarantee.
204
205== Hugetlbfs ==
206
207You can use hugetlbfs on a kernel that has transparent hugepage
208support enabled just fine as always. No difference can be noted in
209hugetlbfs other than there will be less overall fragmentation. All
210usual features belonging to hugetlbfs are preserved and
211unaffected. libhugetlbfs will also work fine as usual.
212
213== Graceful fallback ==
214
215Code walking pagetables but unware about huge pmds can simply call
216split_huge_page_pmd(mm, pmd) where the pmd is the one returned by
217pmd_offset. It's trivial to make the code transparent hugepage aware
218by just grepping for "pmd_offset" and adding split_huge_page_pmd where
219missing after pmd_offset returns the pmd. Thanks to the graceful
220fallback design, with a one liner change, you can avoid to write
221hundred if not thousand of lines of complex code to make your code
222hugepage aware.
223
224If you're not walking pagetables but you run into a physical hugepage
225but you can't handle it natively in your code, you can split it by
226calling split_huge_page(page). This is what the Linux VM does before
227it tries to swapout the hugepage for example.
228
229Example to make mremap.c transparent hugepage aware with a one liner
230change:
231
232diff --git a/mm/mremap.c b/mm/mremap.c
233--- a/mm/mremap.c
234+++ b/mm/mremap.c
235@@ -41,6 +41,7 @@ static pmd_t *get_old_pmd(struct mm_stru
236 return NULL;
237
238 pmd = pmd_offset(pud, addr);
239+ split_huge_page_pmd(mm, pmd);
240 if (pmd_none_or_clear_bad(pmd))
241 return NULL;
242
243== Locking in hugepage aware code ==
244
245We want as much code as possible hugepage aware, as calling
246split_huge_page() or split_huge_page_pmd() has a cost.
247
248To make pagetable walks huge pmd aware, all you need to do is to call
249pmd_trans_huge() on the pmd returned by pmd_offset. You must hold the
250mmap_sem in read (or write) mode to be sure an huge pmd cannot be
251created from under you by khugepaged (khugepaged collapse_huge_page
252takes the mmap_sem in write mode in addition to the anon_vma lock). If
253pmd_trans_huge returns false, you just fallback in the old code
254paths. If instead pmd_trans_huge returns true, you have to take the
255mm->page_table_lock and re-run pmd_trans_huge. Taking the
256page_table_lock will prevent the huge pmd to be converted into a
257regular pmd from under you (split_huge_page can run in parallel to the
258pagetable walk). If the second pmd_trans_huge returns false, you
259should just drop the page_table_lock and fallback to the old code as
260before. Otherwise you should run pmd_trans_splitting on the pmd. In
261case pmd_trans_splitting returns true, it means split_huge_page is
262already in the middle of splitting the page. So if pmd_trans_splitting
263returns true it's enough to drop the page_table_lock and call
264wait_split_huge_page and then fallback the old code paths. You are
265guaranteed by the time wait_split_huge_page returns, the pmd isn't
266huge anymore. If pmd_trans_splitting returns false, you can proceed to
267process the huge pmd and the hugepage natively. Once finished you can
268drop the page_table_lock.
269
270== compound_lock, get_user_pages and put_page ==
271
272split_huge_page internally has to distribute the refcounts in the head
273page to the tail pages before clearing all PG_head/tail bits from the
274page structures. It can do that easily for refcounts taken by huge pmd
275mappings. But the GUI API as created by hugetlbfs (that returns head
276and tail pages if running get_user_pages on an address backed by any
277hugepage), requires the refcount to be accounted on the tail pages and
278not only in the head pages, if we want to be able to run
279split_huge_page while there are gup pins established on any tail
280page. Failure to be able to run split_huge_page if there's any gup pin
281on any tail page, would mean having to split all hugepages upfront in
282get_user_pages which is unacceptable as too many gup users are
283performance critical and they must work natively on hugepages like
284they work natively on hugetlbfs already (hugetlbfs is simpler because
285hugetlbfs pages cannot be splitted so there wouldn't be requirement of
286accounting the pins on the tail pages for hugetlbfs). If we wouldn't
287account the gup refcounts on the tail pages during gup, we won't know
288anymore which tail page is pinned by gup and which is not while we run
289split_huge_page. But we still have to add the gup pin to the head page
290too, to know when we can free the compound page in case it's never
291splitted during its lifetime. That requires changing not just
292get_page, but put_page as well so that when put_page runs on a tail
293page (and only on a tail page) it will find its respective head page,
294and then it will decrease the head page refcount in addition to the
295tail page refcount. To obtain a head page reliably and to decrease its
296refcount without race conditions, put_page has to serialize against
297__split_huge_page_refcount using a special per-page lock called
298compound_lock.
diff --git a/Documentation/vm/unevictable-lru.txt b/Documentation/vm/unevictable-lru.txt
index 2d70d0d95108..97bae3c576c2 100644
--- a/Documentation/vm/unevictable-lru.txt
+++ b/Documentation/vm/unevictable-lru.txt
@@ -84,8 +84,7 @@ indicate that the page is being managed on the unevictable list.
84 84
85The PG_unevictable flag is analogous to, and mutually exclusive with, the 85The PG_unevictable flag is analogous to, and mutually exclusive with, the
86PG_active flag in that it indicates on which LRU list a page resides when 86PG_active flag in that it indicates on which LRU list a page resides when
87PG_lru is set. The unevictable list is compile-time configurable based on the 87PG_lru is set.
88UNEVICTABLE_LRU Kconfig option.
89 88
90The Unevictable LRU infrastructure maintains unevictable pages on an additional 89The Unevictable LRU infrastructure maintains unevictable pages on an additional
91LRU list for a few reasons: 90LRU list for a few reasons:
diff --git a/Documentation/w1/slaves/00-INDEX b/Documentation/w1/slaves/00-INDEX
index f8101d6b07b7..75613c9ac4db 100644
--- a/Documentation/w1/slaves/00-INDEX
+++ b/Documentation/w1/slaves/00-INDEX
@@ -2,3 +2,5 @@
2 - This file 2 - This file
3w1_therm 3w1_therm
4 - The Maxim/Dallas Semiconductor ds18*20 temperature sensor. 4 - The Maxim/Dallas Semiconductor ds18*20 temperature sensor.
5w1_ds2423
6 - The Maxim/Dallas Semiconductor ds2423 counter device.
diff --git a/Documentation/w1/slaves/w1_ds2423 b/Documentation/w1/slaves/w1_ds2423
new file mode 100644
index 000000000000..3f98b505a0ee
--- /dev/null
+++ b/Documentation/w1/slaves/w1_ds2423
@@ -0,0 +1,47 @@
1Kernel driver w1_ds2423
2=======================
3
4Supported chips:
5 * Maxim DS2423 based counter devices.
6
7supported family codes:
8 W1_THERM_DS2423 0x1D
9
10Author: Mika Laitio <lamikr@pilppa.org>
11
12Description
13-----------
14
15Support is provided through the sysfs w1_slave file. Each opening and
16read sequence of w1_slave file initiates the read of counters and ram
17available in DS2423 pages 12 - 15.
18
19Result of each page is provided as an ASCII output where each counter
20value and associated ram buffer is outpputed to own line.
21
22Each lines will contain the values of 42 bytes read from the counter and
23memory page along the crc=YES or NO for indicating whether the read operation
24was successful and CRC matched.
25If the operation was successful, there is also in the end of each line
26a counter value expressed as an integer after c=
27
28Meaning of 42 bytes represented is following:
29 - 1 byte from ram page
30 - 4 bytes for the counter value
31 - 4 zero bytes
32 - 2 bytes for crc16 which was calculated from the data read since the previous crc bytes
33 - 31 remaining bytes from the ram page
34 - crc=YES/NO indicating whether read was ok and crc matched
35 - c=<int> current counter value
36
37example from the successful read:
3800 02 00 00 00 00 00 00 00 6d 38 00 ff ff 00 00 fe ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
3900 02 00 00 00 00 00 00 00 e0 1f 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
4000 29 c6 5d 18 00 00 00 00 04 37 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=408798761
4100 05 00 00 00 00 00 00 00 8d 39 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff crc=YES c=5
42
43example from the read with crc errors:
4400 02 00 00 00 00 00 00 00 6d 38 00 ff ff 00 00 fe ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
4500 02 00 00 22 00 00 00 00 e0 1f 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=NO
4600 e1 61 5d 19 00 00 00 00 df 0b 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=NO
4700 05 00 00 20 00 00 00 00 8d 39 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff crc=NO
diff --git a/Documentation/w1/w1.netlink b/Documentation/w1/w1.netlink
index 804445f745ed..f59a31965d50 100644
--- a/Documentation/w1/w1.netlink
+++ b/Documentation/w1/w1.netlink
@@ -81,7 +81,7 @@ which will contain list of all registered master ids in the following
81format: 81format:
82 82
83 cn_msg (CN_W1_IDX.CN_W1_VAL as id, len is equal to sizeof(struct 83 cn_msg (CN_W1_IDX.CN_W1_VAL as id, len is equal to sizeof(struct
84 w1_netlink_msg) plus number of masters multipled by 4) 84 w1_netlink_msg) plus number of masters multiplied by 4)
85 w1_netlink_msg (type: W1_LIST_MASTERS, len is equal to 85 w1_netlink_msg (type: W1_LIST_MASTERS, len is equal to
86 number of masters multiplied by 4 (u32 size)) 86 number of masters multiplied by 4 (u32 size))
87 id0 ... idN 87 id0 ... idN
diff --git a/Documentation/watchdog/hpwdt.txt b/Documentation/watchdog/hpwdt.txt
index 9c24d5ffbb06..9488078900e0 100644
--- a/Documentation/watchdog/hpwdt.txt
+++ b/Documentation/watchdog/hpwdt.txt
@@ -8,7 +8,7 @@ Last reviewed: 06/02/2009
8 The HP iLO2 NMI Watchdog driver is a kernel module that provides basic 8 The HP iLO2 NMI Watchdog driver is a kernel module that provides basic
9 watchdog functionality and the added benefit of NMI sourcing. Both the 9 watchdog functionality and the added benefit of NMI sourcing. Both the
10 watchdog functionality and the NMI sourcing capability need to be enabled 10 watchdog functionality and the NMI sourcing capability need to be enabled
11 by the user. Remember that the two modes are not dependant on one another. 11 by the user. Remember that the two modes are not dependent on one another.
12 A user can have the NMI sourcing without the watchdog timer and vice-versa. 12 A user can have the NMI sourcing without the watchdog timer and vice-versa.
13 13
14 Watchdog functionality is enabled like any other common watchdog driver. That 14 Watchdog functionality is enabled like any other common watchdog driver. That
diff --git a/Documentation/workqueue.txt b/Documentation/workqueue.txt
index e4498a2872c3..a0b577de918f 100644
--- a/Documentation/workqueue.txt
+++ b/Documentation/workqueue.txt
@@ -12,6 +12,7 @@ CONTENTS
124. Application Programming Interface (API) 124. Application Programming Interface (API)
135. Example Execution Scenarios 135. Example Execution Scenarios
146. Guidelines 146. Guidelines
157. Debugging
15 16
16 17
171. Introduction 181. Introduction
@@ -190,17 +191,17 @@ resources, scheduled and executed.
190 * Long running CPU intensive workloads which can be better 191 * Long running CPU intensive workloads which can be better
191 managed by the system scheduler. 192 managed by the system scheduler.
192 193
193 WQ_FREEZEABLE 194 WQ_FREEZABLE
194 195
195 A freezeable wq participates in the freeze phase of the system 196 A freezable wq participates in the freeze phase of the system
196 suspend operations. Work items on the wq are drained and no 197 suspend operations. Work items on the wq are drained and no
197 new work item starts execution until thawed. 198 new work item starts execution until thawed.
198 199
199 WQ_RESCUER 200 WQ_MEM_RECLAIM
200 201
201 All wq which might be used in the memory reclaim paths _MUST_ 202 All wq which might be used in the memory reclaim paths _MUST_
202 have this flag set. This reserves one worker exclusively for 203 have this flag set. The wq is guaranteed to have at least one
203 the execution of this wq under memory pressure. 204 execution context regardless of memory pressure.
204 205
205 WQ_HIGHPRI 206 WQ_HIGHPRI
206 207
@@ -356,11 +357,11 @@ If q1 has WQ_CPU_INTENSIVE set,
356 357
3576. Guidelines 3586. Guidelines
358 359
359* Do not forget to use WQ_RESCUER if a wq may process work items which 360* Do not forget to use WQ_MEM_RECLAIM if a wq may process work items
360 are used during memory reclaim. Each wq with WQ_RESCUER set has one 361 which are used during memory reclaim. Each wq with WQ_MEM_RECLAIM
361 rescuer thread reserved for it. If there is dependency among 362 set has an execution context reserved for it. If there is
362 multiple work items used during memory reclaim, they should be 363 dependency among multiple work items used during memory reclaim,
363 queued to separate wq each with WQ_RESCUER. 364 they should be queued to separate wq each with WQ_MEM_RECLAIM.
364 365
365* Unless strict ordering is required, there is no need to use ST wq. 366* Unless strict ordering is required, there is no need to use ST wq.
366 367
@@ -368,13 +369,53 @@ If q1 has WQ_CPU_INTENSIVE set,
368 recommended. In most use cases, concurrency level usually stays 369 recommended. In most use cases, concurrency level usually stays
369 well under the default limit. 370 well under the default limit.
370 371
371* A wq serves as a domain for forward progress guarantee (WQ_RESCUER), 372* A wq serves as a domain for forward progress guarantee
372 flush and work item attributes. Work items which are not involved 373 (WQ_MEM_RECLAIM, flush and work item attributes. Work items which
373 in memory reclaim and don't need to be flushed as a part of a group 374 are not involved in memory reclaim and don't need to be flushed as a
374 of work items, and don't require any special attribute, can use one 375 part of a group of work items, and don't require any special
375 of the system wq. There is no difference in execution 376 attribute, can use one of the system wq. There is no difference in
376 characteristics between using a dedicated wq and a system wq. 377 execution characteristics between using a dedicated wq and a system
378 wq.
377 379
378* Unless work items are expected to consume a huge amount of CPU 380* Unless work items are expected to consume a huge amount of CPU
379 cycles, using a bound wq is usually beneficial due to the increased 381 cycles, using a bound wq is usually beneficial due to the increased
380 level of locality in wq operations and work item execution. 382 level of locality in wq operations and work item execution.
383
384
3857. Debugging
386
387Because the work functions are executed by generic worker threads
388there are a few tricks needed to shed some light on misbehaving
389workqueue users.
390
391Worker threads show up in the process list as:
392
393root 5671 0.0 0.0 0 0 ? S 12:07 0:00 [kworker/0:1]
394root 5672 0.0 0.0 0 0 ? S 12:07 0:00 [kworker/1:2]
395root 5673 0.0 0.0 0 0 ? S 12:12 0:00 [kworker/0:0]
396root 5674 0.0 0.0 0 0 ? S 12:13 0:00 [kworker/1:0]
397
398If kworkers are going crazy (using too much cpu), there are two types
399of possible problems:
400
401 1. Something beeing scheduled in rapid succession
402 2. A single work item that consumes lots of cpu cycles
403
404The first one can be tracked using tracing:
405
406 $ echo workqueue:workqueue_queue_work > /sys/kernel/debug/tracing/set_event
407 $ cat /sys/kernel/debug/tracing/trace_pipe > out.txt
408 (wait a few secs)
409 ^C
410
411If something is busy looping on work queueing, it would be dominating
412the output and the offender can be determined with the work item
413function.
414
415For the second type of problems it should be possible to just check
416the stack trace of the offending worker thread.
417
418 $ cat /proc/THE_OFFENDING_KWORKER/stack
419
420The work item's function should be trivially visible in the stack
421trace.
diff --git a/Documentation/x86/boot.txt b/Documentation/x86/boot.txt
index 30b43e1b2697..7c3a8801b7ce 100644
--- a/Documentation/x86/boot.txt
+++ b/Documentation/x86/boot.txt
@@ -600,6 +600,7 @@ Protocol: 2.07+
600 0x00000001 lguest 600 0x00000001 lguest
601 0x00000002 Xen 601 0x00000002 Xen
602 0x00000003 Moorestown MID 602 0x00000003 Moorestown MID
603 0x00000004 CE4100 TV Platform
603 604
604Field name: hardware_subarch_data 605Field name: hardware_subarch_data
605Type: write (subarch-dependent) 606Type: write (subarch-dependent)
@@ -621,9 +622,9 @@ Protocol: 2.08+
621 The payload may be compressed. The format of both the compressed and 622 The payload may be compressed. The format of both the compressed and
622 uncompressed data should be determined using the standard magic 623 uncompressed data should be determined using the standard magic
623 numbers. The currently supported compression formats are gzip 624 numbers. The currently supported compression formats are gzip
624 (magic numbers 1F 8B or 1F 9E), bzip2 (magic number 42 5A) and LZMA 625 (magic numbers 1F 8B or 1F 9E), bzip2 (magic number 42 5A), LZMA
625 (magic number 5D 00). The uncompressed payload is currently always ELF 626 (magic number 5D 00), and XZ (magic number FD 37). The uncompressed
626 (magic number 7F 45 4C 46). 627 payload is currently always ELF (magic number 7F 45 4C 46).
627 628
628Field name: payload_length 629Field name: payload_length
629Type: read 630Type: read
@@ -673,7 +674,7 @@ Protocol: 2.10+
673 674
674Field name: init_size 675Field name: init_size
675Type: read 676Type: read
676Offset/size: 0x25c/4 677Offset/size: 0x260/4
677 678
678 This field indicates the amount of linear contiguous memory starting 679 This field indicates the amount of linear contiguous memory starting
679 at the kernel runtime start address that the kernel needs before it 680 at the kernel runtime start address that the kernel needs before it
diff --git a/Documentation/x86/x86_64/boot-options.txt b/Documentation/x86/x86_64/boot-options.txt
index 7fbbaf85f5b7..c54b4f503e2a 100644
--- a/Documentation/x86/x86_64/boot-options.txt
+++ b/Documentation/x86/x86_64/boot-options.txt
@@ -189,13 +189,13 @@ ACPI
189 189
190PCI 190PCI
191 191
192 pci=off Don't use PCI 192 pci=off Don't use PCI
193 pci=conf1 Use conf1 access. 193 pci=conf1 Use conf1 access.
194 pci=conf2 Use conf2 access. 194 pci=conf2 Use conf2 access.
195 pci=rom Assign ROMs. 195 pci=rom Assign ROMs.
196 pci=assign-busses Assign busses 196 pci=assign-busses Assign busses
197 pci=irqmask=MASK Set PCI interrupt mask to MASK 197 pci=irqmask=MASK Set PCI interrupt mask to MASK
198 pci=lastbus=NUMBER Scan upto NUMBER busses, no matter what the mptable says. 198 pci=lastbus=NUMBER Scan up to NUMBER busses, no matter what the mptable says.
199 pci=noacpi Don't use ACPI to set up PCI interrupt routing. 199 pci=noacpi Don't use ACPI to set up PCI interrupt routing.
200 200
201IOMMU (input/output memory management unit) 201IOMMU (input/output memory management unit)
@@ -206,7 +206,7 @@ IOMMU (input/output memory management unit)
206 (e.g. because you have < 3 GB memory). 206 (e.g. because you have < 3 GB memory).
207 Kernel boot message: "PCI-DMA: Disabling IOMMU" 207 Kernel boot message: "PCI-DMA: Disabling IOMMU"
208 208
209 2. <arch/x86_64/kernel/pci-gart.c>: AMD GART based hardware IOMMU. 209 2. <arch/x86/kernel/amd_gart_64.c>: AMD GART based hardware IOMMU.
210 Kernel boot message: "PCI-DMA: using GART IOMMU" 210 Kernel boot message: "PCI-DMA: using GART IOMMU"
211 211
212 3. <arch/x86_64/kernel/pci-swiotlb.c> : Software IOMMU implementation. Used 212 3. <arch/x86_64/kernel/pci-swiotlb.c> : Software IOMMU implementation. Used
@@ -293,11 +293,6 @@ IOMMU (input/output memory management unit)
293 293
294Debugging 294Debugging
295 295
296 oops=panic Always panic on oopses. Default is to just kill the process,
297 but there is a small probability of deadlocking the machine.
298 This will also cause panics on machine check exceptions.
299 Useful together with panic=30 to trigger a reboot.
300
301 kstack=N Print N words from the kernel stack in oops dumps. 296 kstack=N Print N words from the kernel stack in oops dumps.
302 297
303 pagefaulttrace Dump all page faults. Only useful for extreme debugging 298 pagefaulttrace Dump all page faults. Only useful for extreme debugging
diff --git a/Documentation/x86/x86_64/kernel-stacks b/Documentation/x86/x86_64/kernel-stacks
index 5ad65d51fb95..a01eec5d1d0b 100644
--- a/Documentation/x86/x86_64/kernel-stacks
+++ b/Documentation/x86/x86_64/kernel-stacks
@@ -18,9 +18,9 @@ specialized stacks contain no useful data. The main CPU stacks are:
18 Used for external hardware interrupts. If this is the first external 18 Used for external hardware interrupts. If this is the first external
19 hardware interrupt (i.e. not a nested hardware interrupt) then the 19 hardware interrupt (i.e. not a nested hardware interrupt) then the
20 kernel switches from the current task to the interrupt stack. Like 20 kernel switches from the current task to the interrupt stack. Like
21 the split thread and interrupt stacks on i386 (with CONFIG_4KSTACKS), 21 the split thread and interrupt stacks on i386, this gives more room
22 this gives more room for kernel interrupt processing without having 22 for kernel interrupt processing without having to increase the size
23 to increase the size of every per thread stack. 23 of every per thread stack.
24 24
25 The interrupt stack is also used when processing a softirq. 25 The interrupt stack is also used when processing a softirq.
26 26
diff --git a/Documentation/xz.txt b/Documentation/xz.txt
new file mode 100644
index 000000000000..2cf3e2608de3
--- /dev/null
+++ b/Documentation/xz.txt
@@ -0,0 +1,121 @@
1
2XZ data compression in Linux
3============================
4
5Introduction
6
7 XZ is a general purpose data compression format with high compression
8 ratio and relatively fast decompression. The primary compression
9 algorithm (filter) is LZMA2. Additional filters can be used to improve
10 compression ratio even further. E.g. Branch/Call/Jump (BCJ) filters
11 improve compression ratio of executable data.
12
13 The XZ decompressor in Linux is called XZ Embedded. It supports
14 the LZMA2 filter and optionally also BCJ filters. CRC32 is supported
15 for integrity checking. The home page of XZ Embedded is at
16 <http://tukaani.org/xz/embedded.html>, where you can find the
17 latest version and also information about using the code outside
18 the Linux kernel.
19
20 For userspace, XZ Utils provide a zlib-like compression library
21 and a gzip-like command line tool. XZ Utils can be downloaded from
22 <http://tukaani.org/xz/>.
23
24XZ related components in the kernel
25
26 The xz_dec module provides XZ decompressor with single-call (buffer
27 to buffer) and multi-call (stateful) APIs. The usage of the xz_dec
28 module is documented in include/linux/xz.h.
29
30 The xz_dec_test module is for testing xz_dec. xz_dec_test is not
31 useful unless you are hacking the XZ decompressor. xz_dec_test
32 allocates a char device major dynamically to which one can write
33 .xz files from userspace. The decompressed output is thrown away.
34 Keep an eye on dmesg to see diagnostics printed by xz_dec_test.
35 See the xz_dec_test source code for the details.
36
37 For decompressing the kernel image, initramfs, and initrd, there
38 is a wrapper function in lib/decompress_unxz.c. Its API is the
39 same as in other decompress_*.c files, which is defined in
40 include/linux/decompress/generic.h.
41
42 scripts/xz_wrap.sh is a wrapper for the xz command line tool found
43 from XZ Utils. The wrapper sets compression options to values suitable
44 for compressing the kernel image.
45
46 For kernel makefiles, two commands are provided for use with
47 $(call if_needed). The kernel image should be compressed with
48 $(call if_needed,xzkern) which will use a BCJ filter and a big LZMA2
49 dictionary. It will also append a four-byte trailer containing the
50 uncompressed size of the file, which is needed by the boot code.
51 Other things should be compressed with $(call if_needed,xzmisc)
52 which will use no BCJ filter and 1 MiB LZMA2 dictionary.
53
54Notes on compression options
55
56 Since the XZ Embedded supports only streams with no integrity check or
57 CRC32, make sure that you don't use some other integrity check type
58 when encoding files that are supposed to be decoded by the kernel. With
59 liblzma, you need to use either LZMA_CHECK_NONE or LZMA_CHECK_CRC32
60 when encoding. With the xz command line tool, use --check=none or
61 --check=crc32.
62
63 Using CRC32 is strongly recommended unless there is some other layer
64 which will verify the integrity of the uncompressed data anyway.
65 Double checking the integrity would probably be waste of CPU cycles.
66 Note that the headers will always have a CRC32 which will be validated
67 by the decoder; you can only change the integrity check type (or
68 disable it) for the actual uncompressed data.
69
70 In userspace, LZMA2 is typically used with dictionary sizes of several
71 megabytes. The decoder needs to have the dictionary in RAM, thus big
72 dictionaries cannot be used for files that are intended to be decoded
73 by the kernel. 1 MiB is probably the maximum reasonable dictionary
74 size for in-kernel use (maybe more is OK for initramfs). The presets
75 in XZ Utils may not be optimal when creating files for the kernel,
76 so don't hesitate to use custom settings. Example:
77
78 xz --check=crc32 --lzma2=dict=512KiB inputfile
79
80 An exception to above dictionary size limitation is when the decoder
81 is used in single-call mode. Decompressing the kernel itself is an
82 example of this situation. In single-call mode, the memory usage
83 doesn't depend on the dictionary size, and it is perfectly fine to
84 use a big dictionary: for maximum compression, the dictionary should
85 be at least as big as the uncompressed data itself.
86
87Future plans
88
89 Creating a limited XZ encoder may be considered if people think it is
90 useful. LZMA2 is slower to compress than e.g. Deflate or LZO even at
91 the fastest settings, so it isn't clear if LZMA2 encoder is wanted
92 into the kernel.
93
94 Support for limited random-access reading is planned for the
95 decompression code. I don't know if it could have any use in the
96 kernel, but I know that it would be useful in some embedded projects
97 outside the Linux kernel.
98
99Conformance to the .xz file format specification
100
101 There are a couple of corner cases where things have been simplified
102 at expense of detecting errors as early as possible. These should not
103 matter in practice all, since they don't cause security issues. But
104 it is good to know this if testing the code e.g. with the test files
105 from XZ Utils.
106
107Reporting bugs
108
109 Before reporting a bug, please check that it's not fixed already
110 at upstream. See <http://tukaani.org/xz/embedded.html> to get the
111 latest code.
112
113 Report bugs to <lasse.collin@tukaani.org> or visit #tukaani on
114 Freenode and talk to Larhzu. I don't actively read LKML or other
115 kernel-related mailing lists, so if there's something I should know,
116 you should email to me personally or use IRC.
117
118 Don't bother Igor Pavlov with questions about the XZ implementation
119 in the kernel or about XZ Utils. While these two implementations
120 include essential code that is directly based on Igor Pavlov's code,
121 these implementations aren't maintained nor supported by him.
diff --git a/Documentation/zh_CN/HOWTO b/Documentation/zh_CN/HOWTO
index 69160779e432..faf976c0c731 100644
--- a/Documentation/zh_CN/HOWTO
+++ b/Documentation/zh_CN/HOWTO
@@ -347,8 +347,8 @@ bugzilla.kernel.org是Linux内核开发者们用来跟踪内核Bug的网站。
347最新bug的通知,可以订阅bugme-new邮件列表(只有新的bug报告会被寄到这里) 347最新bug的通知,可以订阅bugme-new邮件列表(只有新的bug报告会被寄到这里)
348或者订阅bugme-janitor邮件列表(所有bugzilla的变动都会被寄到这里)。 348或者订阅bugme-janitor邮件列表(所有bugzilla的变动都会被寄到这里)。
349 349
350 http://lists.osdl.org/mailman/listinfo/bugme-new 350 https://lists.linux-foundation.org/mailman/listinfo/bugme-new
351 http://lists.osdl.org/mailman/listinfo/bugme-janitors 351 https://lists.linux-foundation.org/mailman/listinfo/bugme-janitors
352 352
353 353
354邮件列表 354邮件列表
diff --git a/Documentation/zh_CN/SecurityBugs b/Documentation/zh_CN/SecurityBugs
new file mode 100644
index 000000000000..d21eb07fe943
--- /dev/null
+++ b/Documentation/zh_CN/SecurityBugs
@@ -0,0 +1,50 @@
1Chinese translated version of Documentation/SecurityBugs
2
3If you have any comment or update to the content, please contact the
4original document maintainer directly. However, if you have a problem
5communicating in English you can also ask the Chinese maintainer for
6help. Contact the Chinese maintainer if this translation is outdated
7or if there is a problem with the translation.
8
9Chinese maintainer: Harry Wei <harryxiyou@gmail.com>
10---------------------------------------------------------------------
11Documentation/SecurityBugs 的中文翻译
12
13如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
14交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
15译存在问题,请联系中文版维护者。
16
17中文版维护者: 贾威威 Harry Wei <harryxiyou@gmail.com>
18中文版翻译者: 贾威威 Harry Wei <harryxiyou@gmail.com>
19中文版校译者: 贾威威 Harry Wei <harryxiyou@gmail.com>
20
21
22以下为正文
23---------------------------------------------------------------------
24Linux内核开发者认为安全非常重要。因此,我们想要知道当一个有关于
25安全的漏洞被发现的时候,并且它可能会被尽快的修复或者公开。请把这个安全
26漏洞报告给Linux内核安全团队。
27
281) 联系
29
30linux内核安全团队可以通过email<security@kernel.org>来联系。这是
31一组独立的安全工作人员,可以帮助改善漏洞报告并且公布和取消一个修复。安
32全团队有可能会从部分的维护者那里引进额外的帮助来了解并且修复安全漏洞。
33当遇到任何漏洞,所能提供的信息越多就越能诊断和修复。如果你不清楚什么
34是有帮助的信息,那就请重温一下REPORTING-BUGS文件中的概述过程。任
35何攻击性的代码都是非常有用的,未经报告者的同意不会被取消,除非它已经
36被公布于众。
37
382) 公开
39
40Linux内核安全团队的宗旨就是和漏洞提交者一起处理漏洞的解决方案直
41到公开。我们喜欢尽快地完全公开漏洞。当一个漏洞或者修复还没有被完全地理
42解,解决方案没有通过测试或者供应商协调,可以合理地延迟公开。然而,我们
43期望这些延迟尽可能的短些,是可数的几天,而不是几个星期或者几个月。公开
44日期是通过安全团队和漏洞提供者以及供应商洽谈后的结果。公开时间表是从很
45短(特殊的,它已经被公众所知道)到几个星期。作为一个基本的默认政策,我
46们所期望通知公众的日期是7天的安排。
47
483) 保密协议
49
50Linux内核安全团队不是一个正式的团体,因此不能加入任何的保密协议。
diff --git a/Documentation/zh_CN/SubmitChecklist b/Documentation/zh_CN/SubmitChecklist
new file mode 100644
index 000000000000..951415bbab0c
--- /dev/null
+++ b/Documentation/zh_CN/SubmitChecklist
@@ -0,0 +1,109 @@
1Chinese translated version of Documentation/SubmitChecklist
2
3If you have any comment or update to the content, please contact the
4original document maintainer directly. However, if you have a problem
5communicating in English you can also ask the Chinese maintainer for
6help. Contact the Chinese maintainer if this translation is outdated
7or if there is a problem with the translation.
8
9Chinese maintainer: Harry Wei <harryxiyou@gmail.com>
10---------------------------------------------------------------------
11Documentation/SubmitChecklist ķ
12
13ۻ±ĵݣֱϵԭĵάߡʹӢ
14ѵĻҲİά²ʱ߷
15⣬ϵİάߡ
16
17İάߣ Harry Wei <harryxiyou@gmail.com>
18İ淭ߣ Harry Wei <harryxiyou@gmail.com>
19İУߣ Harry Wei <harryxiyou@gmail.com>
20
21
22Ϊ
23---------------------------------------------------------------------
24Linuxںύ嵥
25~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26
27һЩں˿ӦĻ飬뿴Լں˲ύ
28ܵĸ졣
29
30ЩdzDocumentation/SubmittingPatchesĵṩԼ
31ύLinuxں˲˵
32
331ʹһô#include/ǸܵǸļ
34 Ҫ붨/Ǹܵͷļ
35
362û߸CONFIGѡ =y=m=n
37 Ҫб뾯/ ҪӾ/
38
392bͨ allnoconfig, allmodconfig
40
412cʹ 0=builddir ɹع
42
433ͨʹñؽ빤߻һЩڶCPUϹ
44
454ppc64 һܺõļ齻ĿܣΪѡunsigned long
46 64λֵʹá
47
485Documentation/CodingStyleļϸ㲹
49 ʹòΥ(scripts/checkpatch.pl)Աύ
50 Ӧõ㲹еΥ档
51
526κθ»߸ĶCONFIGѡܴò˵
53
547еKconfigѡ¶Ҫ˵֡
55
568ѾܽصKconfigϡǺͨõ--½
57
589мԡ
59
6010ʹ'make checkstack''make namespacecheck'飬Ȼ޸ҵ⡣
61 ע⣺ջ鲻ȷس⣬κεһڶջʹö512ֽ
62 Ҫ׼޸ġ
63
6411kernel-docȫںAPIsļҪ̬ĺǰҲν
65 ʹ'make htmldocs''make mandocs'kernel-docȻ޸κ
66 ֵ⡣
67
6812ѾͨCONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT,
69 CONFIG_DEBUG_SLAB, CONFIG_DEBUG_PAGEALLOC, CONFIG_DEBUG_MUTEXES,
70 CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_SPINLOCK_SLEEPԣͬʱ
71 ʹܡ
72
7313Ѿʹû߲ʹ CONFIG_SMP CONFIG_PREEMPTִʱ䡣
74
7514ӰIO/DiskȵȣѾͨʹû߲ʹ CONFIG_LBDAF ԡ
76
7715еcodepathsѾʹlockdepùܡ
78
7916е/proc¼¶ҪļDocumentation/Ŀ¼¡
80
8117еں¶¼Documentation/kernel-parameters.txtļС
82
8318еģ¶MODULE_PARM_DESC()¼
84
8519еûռӿڸ¶¼Documentation/ABI/鿴Documentation/ABI/README
86 ԻøϢıûռӿڵIJӦñʼ͸linux-api@vger.kernel.org
87
8820DzǶͨ`make headers_check'
89
9021Ѿͨslabpage-allocationʧܼ顣鿴Documentation/fault-injection/
91
9222¼ԴѾͨ`gcc -W'ʹ"make EXTRA_CFLAGS=-W"롣ܶෳգ
93 ǶѰ©洦:"warning: comparison between signed and unsigned"
94
9523ϲ-mmٲԣȷǷ񻹺ͲеһԼVMVFS
96 ϵͳи仯
97
9824еڴ{e.g., barrier(), rmb(), wmb()}ҪԴеһעǶǸʲô
99 Լԭ
100
10125κƵIJӣҲҪDocumentation/ioctl/ioctl-number.txt
102
10326ĸĴʹκεںAPIskconfigйϵĹܣҪ
104 ʹصkconfigŹرգ and/or =mѡṩ[ͬһʱ䲻õĶã
105 ]
106
107 CONFIG_SMP, CONFIG_SYSFS, CONFIG_PROC_FS, CONFIG_INPUT, CONFIG_PCI,
108 CONFIG_BLOCK, CONFIG_PM, CONFIG_HOTPLUG, CONFIG_MAGIC_SYSRQ,
109 CONFIG_NET, CONFIG_INET=n (һʹ CONFIG_NET=y)
diff --git a/Documentation/zh_CN/SubmittingDrivers b/Documentation/zh_CN/SubmittingDrivers
index c27b0f6cdd39..5889f8df6312 100644
--- a/Documentation/zh_CN/SubmittingDrivers
+++ b/Documentation/zh_CN/SubmittingDrivers
@@ -61,7 +61,7 @@ Linux 2.4:
61Linux 2.6: 61Linux 2.6:
62 除了遵循和 2.4 版内核同样的规则外,你还需要在 linux-kernel 邮件 62 除了遵循和 2.4 版内核同样的规则外,你还需要在 linux-kernel 邮件
63 列表上跟踪最新的 API 变化。向 Linux 2.6 内核提交驱动的顶级联系人 63 列表上跟踪最新的 API 变化。向 Linux 2.6 内核提交驱动的顶级联系人
64 是 Andrew Morton <akpm@osdl.org>。 64 是 Andrew Morton <akpm@linux-foundation.org>。
65 65
66决定设备驱动能否被接受的条件 66决定设备驱动能否被接受的条件
67---------------------------- 67----------------------------
diff --git a/Documentation/zh_CN/SubmittingPatches b/Documentation/zh_CN/SubmittingPatches
index 9a1a6e1ed09e..0f4385a62a49 100644
--- a/Documentation/zh_CN/SubmittingPatches
+++ b/Documentation/zh_CN/SubmittingPatches
@@ -100,7 +100,7 @@ http://userweb.kernel.org/~akpm/stuff/patch-scripts.tar.gz
100 100
101将改动拆分,逻辑类似的放到同一个补丁文件里。 101将改动拆分,逻辑类似的放到同一个补丁文件里。
102 102
103例如,如果你的改动里同时有bug修正和性能优化,那么把这些改动分到两个或 103例如,如果你的改动里同时有bug修正和性能优化,那么把这些改动分到两个或
104者更多的补丁文件中。如果你的改动包含对API的修改,并且修改了驱动程序来适 104者更多的补丁文件中。如果你的改动包含对API的修改,并且修改了驱动程序来适
105应这些新的API,那么把这些修改分成两个补丁。 105应这些新的API,那么把这些修改分成两个补丁。
106 106
@@ -230,7 +230,7 @@ pref("mailnews.display.disable_format_flowed_support", true);
230些原因,修正错误,重新提交更新后的改动,是你自己的工作。 230些原因,修正错误,重新提交更新后的改动,是你自己的工作。
231 231
232Linus不给出任何评论就“丢弃”你的补丁是常见的事情。在系统中这样的事情很 232Linus不给出任何评论就“丢弃”你的补丁是常见的事情。在系统中这样的事情很
233平常。如果他没有接受你的补丁,也许是由于以下原 233平常。如果他没有接受你的补丁,也许是由于以下原
234* 你的补丁不能在最新版本的内核上干净的打上。 234* 你的补丁不能在最新版本的内核上干净的打上。
235* 你的补丁在 linux-kernel 邮件列表中没有得到充分的讨论。 235* 你的补丁在 linux-kernel 邮件列表中没有得到充分的讨论。
236* 风格问题(参照第2小节) 236* 风格问题(参照第2小节)
diff --git a/Documentation/zh_CN/email-clients.txt b/Documentation/zh_CN/email-clients.txt
new file mode 100644
index 000000000000..5d65e323d060
--- /dev/null
+++ b/Documentation/zh_CN/email-clients.txt
@@ -0,0 +1,210 @@
1锘?Chinese translated version of Documentation/email-clients.txt
2
3If you have any comment or update to the content, please contact the
4original document maintainer directly. However, if you have a problem
5communicating in English you can also ask the Chinese maintainer for
6help. Contact the Chinese maintainer if this translation is outdated
7or if there is a problem with the translation.
8
9Chinese maintainer: Harry Wei <harryxiyou@gmail.com>
10---------------------------------------------------------------------
11Documentation/email-clients.txt ???涓????缈昏??
12
13濡??????宠??璁烘????存?版???????????瀹癸??璇风?存?ヨ??绯诲?????妗g??缁存?よ?????濡????浣?浣跨?ㄨ?辨??
14浜ゆ???????伴?剧??璇?锛?涔????浠ュ??涓???????缁存?よ??姹???┿??濡???????缈昏????存?颁???????舵?????缈?
15璇?瀛???ㄩ??棰?锛?璇疯??绯讳腑??????缁存?よ?????
16
17涓???????缁存?よ??锛? 璐惧??濞? Harry Wei <harryxiyou@gmail.com>
18涓???????缈昏?????锛? 璐惧??濞? Harry Wei <harryxiyou@gmail.com>
19涓?????????¤?????锛? Yinglin Luan <synmyth@gmail.com>
20 Xiaochen Wang <wangxiaochen0@gmail.com>
21 yaxinsn <yaxinsn@163.com>
22
23浠ヤ??涓烘?f??
24---------------------------------------------------------------------
25
26Linux???浠跺?㈡?风?????缃?淇℃??
27======================================================================
28
29?????????缃?
30----------------------------------------------------------------------
31Linux?????歌ˉ涓???????杩????浠惰?????浜ょ??锛????濂芥??琛ヤ??浣?涓洪??浠朵????????宓?????????????浜?缁存?よ??
32??ユ?堕??浠讹??浣???????浠剁?????瀹规?煎??搴?璇ユ??"text/plain"?????惰??锛????浠朵????????涓?璧???????锛?
33???涓鸿??浼?浣胯ˉ涓????寮???ㄩ?ㄥ????ㄨ??璁鸿??绋?涓???????寰???伴?俱??
34
35??ㄦ?ュ?????Linux?????歌ˉ涓???????浠跺?㈡?风????ㄥ?????琛ヤ????跺??璇ュ??浜?????????????濮???舵?????渚?濡?锛?
36浠?浠?涓???芥?瑰?????????????ゅ?惰〃绗???????绌烘?硷???????虫????ㄦ??涓?琛????寮?澶存?????缁?灏俱??
37
38涓?瑕????杩?"format=flowed"妯″????????琛ヤ?????杩???蜂??寮?璧蜂?????棰????浠ュ?????瀹崇?????琛????
39
40涓?瑕?璁╀????????浠跺?㈡?风??杩?琛??????ㄦ?㈣?????杩???蜂??浼???村??浣????琛ヤ?????
41
42???浠跺?㈡?风??涓???芥?瑰???????????瀛?绗????缂??????瑰?????瑕??????????琛ヤ???????芥??ASCII??????UTF-8缂??????瑰??锛?
43濡????浣?浣跨??UTF-8缂??????瑰???????????浠讹????d??浣?灏?浼???垮??涓?浜??????藉????????瀛?绗???????棰????
44
45???浠跺?㈡?风??搴?璇ュ舰???骞朵??淇???? References: ?????? In-Reply-To: ???棰?锛???d??
46???浠惰??棰?灏变??浼?涓???????
47
48澶???剁??甯?(?????????璐寸??甯?)???甯镐????界?ㄤ??琛ヤ??锛????涓哄?惰〃绗?浼?杞????涓虹┖??笺??浣跨??xclipboard, xclip
49??????xcutsel涔?璁稿??浠ワ??浣???????濂芥??璇?涓?涓?????????垮??浣跨?ㄥ????剁??甯????
50
51涓?瑕???ㄤ娇???PGP/GPG缃插????????浠朵腑??????琛ヤ?????杩???蜂??浣垮??寰?澶???????涓???借?诲??????????ㄤ??浣????琛ヤ?????
52锛?杩?涓????棰?搴?璇ユ?????浠ヤ慨澶????锛?
53
54??ㄧ???????搁??浠跺??琛ㄥ?????琛ヤ??涔????锛?缁????宸卞?????涓?涓?琛ヤ?????涓?涓???????涓绘??锛?淇?瀛???ユ?跺?扮??
55???浠讹??灏?琛ヤ?????'patch'??戒护???涓?锛?濡??????????浜?锛????缁??????搁??浠跺??琛ㄥ????????
56
57
58涓?浜????浠跺?㈡?风?????绀?
59----------------------------------------------------------------------
60杩????缁???轰??浜?璇?缁????MUA???缃????绀猴?????浠ョ?ㄤ??缁?Linux?????稿?????琛ヤ?????杩?浜?骞朵???????虫??
61?????????杞?浠跺?????缃???荤?????
62
63璇存??锛?
64TUI = 浠ユ?????涓哄?虹???????ㄦ?锋?ュ??
65GUI = ??惧舰?????㈢?ㄦ?锋?ュ??
66
67~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68Alpine (TUI)
69
70???缃????椤癸??
71???"Sending Preferences"??ㄥ??锛?
72
73- "Do Not Send Flowed Text"蹇?椤诲?????
74- "Strip Whitespace Before Sending"蹇?椤诲?抽??
75
76褰???????浠舵?讹????????搴?璇ユ?惧?ㄨˉ涓?浼???虹?扮????版?癸????跺?????涓?CTRL-R缁???????锛?浣挎??瀹????
77琛ヤ?????浠跺????ュ?伴??浠朵腑???
78
79~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80Evolution (GUI)
81
82涓?浜?寮????????????????浣跨?ㄥ????????琛ヤ??
83
84褰??????╅??浠堕??椤癸??Preformat
85 浠?Format->Heading->Preformatted (Ctrl-7)??????宸ュ?锋??
86
87??跺??浣跨??锛?
88 Insert->Text File... (Alt-n x)?????ヨˉ涓????浠躲??
89
90浣?杩????浠?"diff -Nru old.c new.c | xclip"锛???????Preformat锛???跺??浣跨?ㄤ腑??撮??杩?琛?绮?甯????
91
92~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93Kmail (GUI)
94
95涓?浜?寮????????????????浣跨?ㄥ????????琛ヤ?????
96
97榛?璁よ?剧疆涓?涓?HTML??煎??????????????锛?涓?瑕??????ㄥ?????
98
99褰?涔????涓?灏????浠剁????跺??锛???ㄩ??椤逛?????涓?瑕??????╄????ㄦ?㈣????????涓????缂虹?瑰氨???浣???ㄩ??浠朵腑杈???ョ??浠讳????????
100??戒??浼?琚??????ㄦ?㈣??锛????姝や??蹇?椤诲?ㄥ?????琛ヤ??涔?????????ㄦ?㈣????????绠?????????规??灏辨???????ㄨ????ㄦ?㈣????ヤ功??????浠讹??
101??跺?????瀹?淇?瀛?涓鸿??绋裤??涓????浣???ㄨ??绋夸腑???娆℃??寮?瀹?锛?瀹?宸茬????ㄩ?ㄨ????ㄦ?㈣??浜?锛???d??浣???????浠惰?界?舵病???
102?????╄????ㄦ?㈣??锛?浣????杩?涓?浼?澶卞?诲凡???????????ㄦ?㈣?????
103
104??ㄩ??浠剁??搴????锛??????ヨˉ涓?涔????锛???句??甯哥?ㄧ??琛ヤ??瀹????绗?锛?涓?涓?杩?瀛????(---)???
105
106??跺?????"Message"????????$??锛??????╂????ユ??浠讹????ョ????????浣????琛ヤ?????浠躲??杩????涓?涓?棰?澶???????椤癸??浣????浠?
107???杩?瀹????缃?浣???????浠跺缓绔?宸ュ?锋????????锛?杩????浠ュ甫涓?"insert file"??炬?????
108
109浣????浠ュ????ㄥ?伴??杩?GPG???璁伴??浠讹??浣???????宓?琛ヤ?????濂戒??瑕?浣跨??GPG???璁板??浠????浣?涓哄??宓??????????绛惧??琛ヤ??锛?
110褰?浠?GPG涓???????7浣?缂??????朵??浣夸??浠?????????村??澶???????
111
112濡????浣????瑕?浠ラ??浠剁??褰㈠????????琛ヤ??锛???d??灏卞?抽????瑰?婚??浠讹????跺?????涓?灞???э??绐????"Suggest automatic
113display"锛?杩???峰??宓????浠舵?村?规??璁╄?昏???????般??
114
115褰?浣?瑕?淇?瀛?灏?瑕?????????????宓???????琛ヤ??锛?浣????浠ヤ??娑???????琛ㄧ????奸????╁?????琛ヤ????????浠讹????跺????冲?婚?????
116"save as"???浣????浠ヤ娇??ㄤ??涓?娌℃????存?圭????????琛ヤ????????浠讹??濡????瀹????浠ユ?g‘???褰㈠??缁???????褰?浣?姝g????ㄥ??
117???宸辩??绐???d??涓?瀵????锛???f?舵病??????椤瑰??浠ヤ??瀛????浠?--宸茬?????涓?涓?杩???风??bug琚?姹???ュ?颁??kmail???bugzilla
118骞朵??甯????杩?灏?浼?琚?澶??????????浠舵??浠ュ?????瀵规??涓???ㄦ?峰??璇诲???????????琚?淇?瀛????锛????浠ュ?????浣???虫?????浠跺????跺?板?朵????版?癸??
119浣?涓?寰?涓????浠?浠????????????逛负缁?????????翠?????璇汇??
120
121~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
122Lotus Notes (GUI)
123
124涓?瑕?浣跨?ㄥ?????
125
126~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
127Mutt (TUI)
128
129寰?澶?Linux寮????浜哄??浣跨??mutt瀹㈡?风??锛????浠ヨ?????瀹????瀹?宸ヤ????????甯告??浜????
130
131Mutt涓????甯?缂?杈????锛????浠ヤ??绠′??浣跨?ㄤ??涔?缂?杈???ㄩ?戒??搴?璇ュ甫????????ㄦ??琛????澶у????扮??杈???ㄩ?藉甫???
132涓?涓?"insert file"???椤癸??瀹????浠ラ??杩?涓???瑰?????浠跺??瀹圭????瑰???????ユ??浠躲??
133
134'vim'浣?涓?mutt???缂?杈????锛?
135 set editor="vi"
136
137 濡????浣跨??xclip锛???插?ヤ互涓???戒护
138 :set paste
139 ???涓????涔??????????shift-insert??????浣跨??
140 :r filename
141
142濡??????宠?????琛ヤ??浣?涓哄??宓??????????
143(a)ttach宸ヤ?????寰?濂斤??涓?甯????"set paste"???
144
145???缃????椤癸??
146瀹?搴?璇ヤ互榛?璁よ?剧疆???褰㈠??宸ヤ?????
147??惰??锛????"send_charset"璁剧疆涓?"us-ascii::utf-8"涔????涓?涓?涓???????涓绘?????
148
149~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
150Pine (TUI)
151
152Pine杩???绘??涓?浜?绌烘?煎????????棰?锛?浣????杩?浜???板?ㄥ??璇ラ?借??淇?澶?浜????
153
154濡???????浠ワ??璇蜂娇???alpine(pine???缁ф?胯??)
155
156???缃????椤癸??
157- ???杩?????????????瑕?娑???ゆ??绋???????
158- "no-strip-whitespace-before-send"???椤逛????????瑕???????
159
160
161~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
162Sylpheed (GUI)
163
164- ???宓??????????浠ュ??濂界??宸ヤ??锛???????浣跨?ㄩ??浠讹?????
165- ???璁镐娇??ㄥ????ㄧ??缂?杈???ㄣ??
166- 瀵逛?????褰?杈?澶???堕??甯告?????
167- 濡???????杩?non-SSL杩???ワ?????娉?浣跨??TLS SMTP?????????
168- ??ㄧ?????绐???d腑???涓?涓?寰??????ㄧ??ruler bar???
169- 缁???板?????涓?娣诲????板??灏变??浼?姝g‘???浜?瑙f?剧ず??????
170
171~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172Thunderbird (GUI)
173
174榛?璁ゆ????典??锛?thunderbird寰?瀹规??????????????锛?浣????杩????涓?浜???规?????浠ュ己??跺?????寰???村ソ???
175
176- ??ㄧ?ㄦ?峰????疯?剧疆???锛?缁???????瀵诲??锛?涓?瑕???????"Compose messages in HTML format"???
177
178- 缂?杈?浣????Thunderbird???缃?璁剧疆??ヤ娇瀹?涓?瑕????琛?浣跨??锛?user_pref("mailnews.wraplength", 0);
179
180- 缂?杈?浣????Thunderbird???缃?璁剧疆锛?浣垮??涓?瑕?浣跨??"format=flowed"??煎??锛?user_pref("mailnews.
181 send_plaintext_flowed", false);
182
183- 浣????瑕?浣?Thunderbird???涓洪???????煎????瑰??锛?
184 濡????榛?璁ゆ????典??浣?涔??????????HTML??煎??锛???d?????寰???俱??浠?浠?浠????棰???????涓????妗?涓???????"Preformat"??煎?????
185 濡????榛?璁ゆ????典??浣?涔??????????????????煎??锛?浣?涓?寰????瀹???逛负HTML??煎??锛?浠?浠?浣?涓轰??娆℃?х??锛???ヤ功?????扮??娑????锛?
186 ??跺??寮哄?朵娇瀹??????版???????煎??锛???????瀹?灏变?????琛????瑕?瀹???板??锛???ㄥ??淇$????炬??涓?浣跨??shift?????ヤ娇瀹????涓?HTML
187 ??煎??锛???跺?????棰???????涓????妗?涓???????"Preformat"??煎?????
188
189- ???璁镐娇??ㄥ????ㄧ??缂?杈????锛?
190 ???瀵?Thunderbird???琛ヤ?????绠?????????规??灏辨??浣跨?ㄤ??涓?"external editor"??╁??锛???跺??浣跨?ㄤ????????娆㈢??
191 $EDITOR??ヨ?诲???????????骞惰ˉ涓???版?????涓????瑕?瀹???板??锛????浠ヤ??杞藉苟涓?瀹?瑁?杩?涓???╁??锛???跺??娣诲??涓?涓?浣跨?ㄥ?????
192 ??????View->Toolbars->Customize...??????褰?浣?涔????淇℃???????跺??浠?浠???瑰?诲??灏卞??浠ヤ?????
193
194~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
195TkRat (GUI)
196
197???浠ヤ娇??ㄥ?????浣跨??"Insert file..."??????澶???ㄧ??缂?杈???ㄣ??
198
199~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
200Gmail (Web GUI)
201
202涓?瑕?浣跨?ㄥ????????琛ヤ?????
203
204Gmail缃?椤靛?㈡?风???????ㄥ?版????惰〃绗?杞????涓虹┖??笺??
205
206??界?跺?惰〃绗?杞????涓虹┖??奸??棰????浠ヨ??澶???ㄧ??杈???ㄨВ??筹???????跺??杩?浼?浣跨?ㄥ??杞???㈣?????姣?琛???????涓?78涓?瀛?绗????
207
208???涓?涓????棰????Gmail杩?浼????浠讳??涓????ASCII???瀛?绗????淇℃????逛负base64缂???????瀹????涓?瑗垮????????娆ф床浜虹?????瀛????
209
210 ###
diff --git a/Documentation/zh_CN/magic-number.txt b/Documentation/zh_CN/magic-number.txt
new file mode 100644
index 000000000000..4c4ce853577b
--- /dev/null
+++ b/Documentation/zh_CN/magic-number.txt
@@ -0,0 +1,167 @@
1Chinese translated version of Documentation/magic-number.txt
2
3If you have any comment or update to the content, please post to LKML directly.
4However, if you have problem communicating in English you can also ask the
5Chinese maintainer for help. Contact the Chinese maintainer, if this
6translation is outdated or there is problem with translation.
7
8Chinese maintainer: Jia Wei Wei <harryxiyou@gmail.com>
9---------------------------------------------------------------------
10Documentation/magic-number.txt的中文翻译
11
12如果想评论或更新本文的内容,请直接发信到LKML。如果你使用英文交流有困难的话,也可
13以向中文版维护者求助。如果本翻译更新不及时或者翻译存在问题,请联系中文版维护者。
14
15中文版维护者: 贾威威 Jia Wei Wei <harryxiyou@gmail.com>
16中文版翻译者: 贾威威 Jia Wei Wei <harryxiyou@gmail.com>
17中文版校译者: 贾威威 Jia Wei Wei <harryxiyou@gmail.com>
18
19以下为正文
20---------------------------------------------------------------------
21这个文件是有关当前使用的魔术值注册表。当你给一个结构添加了一个魔术值,你也应该把这个魔术值添加到这个文件,因为我们最好把用于各种结构的魔术值统一起来。
22
23使用魔术值来保护内核数据结构是一个非常好的主意。这就允许你在运行期检查(a)一个结构是否已经被攻击,或者(b)你已经给一个例行程序通过了一个错误的结构。后一种情况特别地有用---特别是当你通过一个空指针指向结构体的时候。tty源码,例如,经常通过特定驱动使用这种方法并且反复地排列特定方面的结构。
24
25使用魔术值的方法是在结构的开始处声明的,如下:
26
27struct tty_ldisc {
28 int magic;
29 ...
30};
31
32当你以后给内核添加增强功能的时候,请遵守这条规则!这样就会节省数不清的调试时间,特别是一些古怪的情况,例如,数组超出范围并且重新写了超出部分。遵守这个规则,‪这些情况可以被快速地,安全地避免。
33
34 Theodore Ts'o
35 31 Mar 94
36
37给当前的Linux 2.1.55添加魔术表。
38
39 Michael Chastain
40 <mailto:mec@shout.net>
41 22 Sep 1997
42
43现在应该最新的Linux 2.1.112.因为在特性冻结期间,不能在2.2.x前改变任何东西。这些条目被数域所排序。
44
45 Krzysztof G.Baranowski
46 <mailto: kgb@knm.org.pl>
47 29 Jul 1998
48
49更新魔术表到Linux 2.5.45。刚好越过特性冻结,但是有可能还会有一些新的魔术值在2.6.x之前融入到内核中。
50
51 Petr Baudis
52 <pasky@ucw.cz>
53 03 Nov 2002
54
55更新魔术表到Linux 2.5.74。
56
57 Fabian Frederick
58 <ffrederick@users.sourceforge.net>
59 09 Jul 2003
60
61魔术名 地址 结构 所在文件
62===========================================================================
63PG_MAGIC 'P' pg_{read,write}_hdr include/linux/pg.h
64CMAGIC 0x0111 user include/linux/a.out.h
65MKISS_DRIVER_MAGIC 0x04bf mkiss_channel drivers/net/mkiss.h
66RISCOM8_MAGIC 0x0907 riscom_port drivers/char/riscom8.h
67SPECIALIX_MAGIC 0x0907 specialix_port drivers/char/specialix_io8.h
68HDLC_MAGIC 0x239e n_hdlc drivers/char/n_hdlc.c
69APM_BIOS_MAGIC 0x4101 apm_user arch/i386/kernel/apm.c
70CYCLADES_MAGIC 0x4359 cyclades_port include/linux/cyclades.h
71DB_MAGIC 0x4442 fc_info drivers/net/iph5526_novram.c
72DL_MAGIC 0x444d fc_info drivers/net/iph5526_novram.c
73FASYNC_MAGIC 0x4601 fasync_struct include/linux/fs.h
74FF_MAGIC 0x4646 fc_info drivers/net/iph5526_novram.c
75ISICOM_MAGIC 0x4d54 isi_port include/linux/isicom.h
76PTY_MAGIC 0x5001 drivers/char/pty.c
77PPP_MAGIC 0x5002 ppp include/linux/if_pppvar.h
78SERIAL_MAGIC 0x5301 async_struct include/linux/serial.h
79SSTATE_MAGIC 0x5302 serial_state include/linux/serial.h
80SLIP_MAGIC 0x5302 slip drivers/net/slip.h
81STRIP_MAGIC 0x5303 strip drivers/net/strip.c
82X25_ASY_MAGIC 0x5303 x25_asy drivers/net/x25_asy.h
83SIXPACK_MAGIC 0x5304 sixpack drivers/net/hamradio/6pack.h
84AX25_MAGIC 0x5316 ax_disp drivers/net/mkiss.h
85ESP_MAGIC 0x53ee esp_struct drivers/char/esp.h
86TTY_MAGIC 0x5401 tty_struct include/linux/tty.h
87MGSL_MAGIC 0x5401 mgsl_info drivers/char/synclink.c
88TTY_DRIVER_MAGIC 0x5402 tty_driver include/linux/tty_driver.h
89MGSLPC_MAGIC 0x5402 mgslpc_info drivers/char/pcmcia/synclink_cs.c
90TTY_LDISC_MAGIC 0x5403 tty_ldisc include/linux/tty_ldisc.h
91USB_SERIAL_MAGIC 0x6702 usb_serial drivers/usb/serial/usb-serial.h
92FULL_DUPLEX_MAGIC 0x6969 drivers/net/tulip/de2104x.c
93USB_BLUETOOTH_MAGIC 0x6d02 usb_bluetooth drivers/usb/class/bluetty.c
94RFCOMM_TTY_MAGIC 0x6d02 net/bluetooth/rfcomm/tty.c
95USB_SERIAL_PORT_MAGIC 0x7301 usb_serial_port drivers/usb/serial/usb-serial.h
96CG_MAGIC 0x00090255 ufs_cylinder_group include/linux/ufs_fs.h
97A2232_MAGIC 0x000a2232 gs_port drivers/char/ser_a2232.h
98RPORT_MAGIC 0x00525001 r_port drivers/char/rocket_int.h
99LSEMAGIC 0x05091998 lse drivers/fc4/fc.c
100GDTIOCTL_MAGIC 0x06030f07 gdth_iowr_str drivers/scsi/gdth_ioctl.h
101RIEBL_MAGIC 0x09051990 drivers/net/atarilance.c
102RIO_MAGIC 0x12345678 gs_port drivers/char/rio/rio_linux.c
103SX_MAGIC 0x12345678 gs_port drivers/char/sx.h
104NBD_REQUEST_MAGIC 0x12560953 nbd_request include/linux/nbd.h
105RED_MAGIC2 0x170fc2a5 (any) mm/slab.c
106BAYCOM_MAGIC 0x19730510 baycom_state drivers/net/baycom_epp.c
107ISDN_X25IFACE_MAGIC 0x1e75a2b9 isdn_x25iface_proto_data
108 drivers/isdn/isdn_x25iface.h
109ECP_MAGIC 0x21504345 cdkecpsig include/linux/cdk.h
110LSOMAGIC 0x27091997 lso drivers/fc4/fc.c
111LSMAGIC 0x2a3b4d2a ls drivers/fc4/fc.c
112WANPIPE_MAGIC 0x414C4453 sdla_{dump,exec} include/linux/wanpipe.h
113CS_CARD_MAGIC 0x43525553 cs_card sound/oss/cs46xx.c
114LABELCL_MAGIC 0x4857434c labelcl_info_s include/asm/ia64/sn/labelcl.h
115ISDN_ASYNC_MAGIC 0x49344C01 modem_info include/linux/isdn.h
116CTC_ASYNC_MAGIC 0x49344C01 ctc_tty_info drivers/s390/net/ctctty.c
117ISDN_NET_MAGIC 0x49344C02 isdn_net_local_s drivers/isdn/i4l/isdn_net_lib.h
118SAVEKMSG_MAGIC2 0x4B4D5347 savekmsg arch/*/amiga/config.c
119STLI_BOARDMAGIC 0x4bc6c825 stlibrd include/linux/istallion.h
120CS_STATE_MAGIC 0x4c4f4749 cs_state sound/oss/cs46xx.c
121SLAB_C_MAGIC 0x4f17a36d kmem_cache mm/slab.c
122COW_MAGIC 0x4f4f4f4d cow_header_v1 arch/um/drivers/ubd_user.c
123I810_CARD_MAGIC 0x5072696E i810_card sound/oss/i810_audio.c
124TRIDENT_CARD_MAGIC 0x5072696E trident_card sound/oss/trident.c
125ROUTER_MAGIC 0x524d4157 wan_device include/linux/wanrouter.h
126SCC_MAGIC 0x52696368 gs_port drivers/char/scc.h
127SAVEKMSG_MAGIC1 0x53415645 savekmsg arch/*/amiga/config.c
128GDA_MAGIC 0x58464552 gda arch/mips/include/asm/sn/gda.h
129RED_MAGIC1 0x5a2cf071 (any) mm/slab.c
130STL_PORTMAGIC 0x5a7182c9 stlport include/linux/stallion.h
131EEPROM_MAGIC_VALUE 0x5ab478d2 lanai_dev drivers/atm/lanai.c
132HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state include/linux/hdlcdrv.h
133EPCA_MAGIC 0x5c6df104 channel include/linux/epca.h
134PCXX_MAGIC 0x5c6df104 channel drivers/char/pcxx.h
135KV_MAGIC 0x5f4b565f kernel_vars_s arch/mips/include/asm/sn/klkernvars.h
136I810_STATE_MAGIC 0x63657373 i810_state sound/oss/i810_audio.c
137TRIDENT_STATE_MAGIC 0x63657373 trient_state sound/oss/trident.c
138M3_CARD_MAGIC 0x646e6f50 m3_card sound/oss/maestro3.c
139FW_HEADER_MAGIC 0x65726F66 fw_header drivers/atm/fore200e.h
140SLOT_MAGIC 0x67267321 slot drivers/hotplug/cpqphp.h
141SLOT_MAGIC 0x67267322 slot drivers/hotplug/acpiphp.h
142LO_MAGIC 0x68797548 nbd_device include/linux/nbd.h
143OPROFILE_MAGIC 0x6f70726f super_block drivers/oprofile/oprofilefs.h
144M3_STATE_MAGIC 0x734d724d m3_state sound/oss/maestro3.c
145STL_PANELMAGIC 0x7ef621a1 stlpanel include/linux/stallion.h
146VMALLOC_MAGIC 0x87654320 snd_alloc_track sound/core/memory.c
147KMALLOC_MAGIC 0x87654321 snd_alloc_track sound/core/memory.c
148PWC_MAGIC 0x89DC10AB pwc_device drivers/usb/media/pwc.h
149NBD_REPLY_MAGIC 0x96744668 nbd_reply include/linux/nbd.h
150STL_BOARDMAGIC 0xa2267f52 stlbrd include/linux/stallion.h
151ENI155_MAGIC 0xa54b872d midway_eprom drivers/atm/eni.h
152SCI_MAGIC 0xbabeface gs_port drivers/char/sh-sci.h
153CODA_MAGIC 0xC0DAC0DA coda_file_info include/linux/coda_fs_i.h
154DPMEM_MAGIC 0xc0ffee11 gdt_pci_sram drivers/scsi/gdth.h
155STLI_PORTMAGIC 0xe671c7a1 stliport include/linux/istallion.h
156YAM_MAGIC 0xF10A7654 yam_port drivers/net/hamradio/yam.c
157CCB_MAGIC 0xf2691ad2 ccb drivers/scsi/ncr53c8xx.c
158QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry drivers/scsi/arm/queue.c
159QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry drivers/scsi/arm/queue.c
160HTB_CMAGIC 0xFEFAFEF1 htb_class net/sched/sch_htb.c
161NMI_MAGIC 0x48414d4d455201 nmi_s arch/mips/include/asm/sn/nmi.h
162
163请注意,在声音记忆管理中仍然有每一些被定义的驱动魔术值。查看include/sound/sndmagic.h来获取他们完整的列表信息。很多OSS声音驱动拥有自己从声卡PCI ID构建的魔术值-他们也没有被列在这里。
164
165IrDA子系统也使用了大量的自己的魔术值,查看include/net/irda/irda.h来获取他们完整的信息。
166
167HFS是另外一个比较大的使用魔术值的文件系统-你可以在fs/hfs/hfs.h中找到他们。