1. 23 10月, 2010 1 次提交
  2. 25 3月, 2009 1 次提交
    • H
      UIO: Add name attributes for mappings and port regions · 82057791
      Hans J. Koch 提交于
      If a UIO device has several memory mappings, it can be difficult for userspace
      to find the right one. The situation becomes even worse if the UIO driver can
      handle different versions of a card that have different numbers of mappings.
      Benedikt Spranger has such cards and pointed this out to me. Thanks, Bene!
      
      To address this problem, this patch adds "name" sysfs attributes for each
      mapping. Userspace can use these to clearly identify each mapping. The name
      string is optional. If a driver doesn't set it, an empty string will be
      returned, so this patch won't break existing drivers.
      
      The same problem exists for port region information, so a "name" attribute is
      added there, too.
      Signed-off-by: NHans J. Koch <hjk@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      82057791
  3. 07 1月, 2009 2 次提交
    • S
      uio: make uio_info's name and version const · b8ac9fc0
      Stephen Rothwell 提交于
      These are only ever assigned constant strings and never modified.
      
      This was noticed because Wolfram Sang needed to cast the result of
      of_get_property() in order to assign it to the name field of a struct
      uio_info.
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NHans J. Koch <hjk@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b8ac9fc0
    • H
      UIO: Pass information about ioports to userspace (V2) · e70c412e
      Hans J. Koch 提交于
      Devices sometimes have memory where all or parts of it can not be mapped to
      userspace. But it might still be possible to access this memory from
      userspace by other means. An example are PCI cards that advertise not only
      mappable memory but also ioport ranges. On x86 architectures, these can be
      accessed with ioperm, iopl, inb, outb, and friends. Mike Frysinger (CCed)
      reported a similar problem on Blackfin arch where it doesn't seem to be easy
      to mmap non-cached memory but it can still be accessed from userspace.
      
      This patch allows kernel drivers to pass information about such ports to
      userspace. Similar to the existing mem[] array, it adds a port[] array to
      struct uio_info. Each port range is described by start, size, and porttype.
      
      If a driver fills in at least one such port range, the UIO core will simply
      pass this information to userspace by creating a new directory "portio"
      underneath /sys/class/uio/uioN/. Similar to the "mem" directory, it will
      contain a subdirectory (portX) for each port range given.
      
      Note that UIO simply passes this information to userspace, it performs no
      action whatsoever with this data. It's userspace's responsibility to obtain
      access to these ports and to solve arch dependent issues. The "porttype"
      attribute tells userspace what kind of port it is dealing with.
      
      This mechanism could also be used to give userspace information about GPIOs
      related to a device. You frequently find such hardware in embedded devices,
      so I added a UIO_PORT_GPIO definition. I'm not really sure if this is a good
      idea since there are other solutions to this problem, but it won't hurt much
      anyway.
      Signed-off-by: NHans J. Koch <hjk@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e70c412e
  4. 22 7月, 2008 2 次提交
  5. 25 1月, 2008 1 次提交
  6. 19 7月, 2007 1 次提交
    • H
      UIO: Add the User IO core code · beafc54c
      Hans J. Koch 提交于
      This interface allows the ability to write the majority of a driver in
      userspace with only a very small shell of a driver in the kernel itself.
      It uses a char device and sysfs to interact with a userspace process to
      process interrupts and control memory accesses.
      
      See the docbook documentation for more details on how to use this
      interface.
      
      From: Hans J. Koch <hjk@linutronix.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Benedikt Spranger <b.spranger@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      beafc54c