1. 13 1月, 2012 1 次提交
  2. 22 11月, 2011 1 次提交
    • D
      ARM: amba: Auto-generate AMBA driver module aliases during modpost · 523817bd
      Dave Martin 提交于
      This patch adds the necessary support in file2alias.c to define
      suitable aliases based on the amba_id table in AMBA driver modules.
      
      This should be sufficient to allow such modules to be auto-loaded
      via udev.  The AMBA bus driver's uevent hotplug code is also
      modified to pass an approriate MODALIAS string in the event.
      
      For simplicity, the AMBA ID is treated an an opaque 32-bit numeber.
      Module alises use patterns as appropriate to describe the value-
      mask pairs described in the driver's amba_id list.
      
      The proposed alias format is (extended regex):
      
          ^amba:d(HEX){8}$
      
      Where HEX is a single upper-case HEX digit or a pattern (? or []
      expression) matching a single upper-case HEX digit, as expected by
      udev.
      
      "d" is short for "device", following existing alias naming
      conventions for other device types.  This adds some flexibility for
      unambiguously extending the alias format in the future by adding
      additional leading and trailing fields, if this turns out to be
      necessary.
      Signed-off-by: NDave Martin <dave.martin@linaro.org>
      Acked-by: NPawel Moll <pawel.moll@arm.com>
      523817bd
  3. 26 8月, 2011 2 次提交
  4. 11 5月, 2011 1 次提交
    • R
      bcma: add Broadcom specific AMBA bus driver · 8369ae33
      Rafał Miłecki 提交于
      Broadcom has released cards based on a new AMBA-based bus type. From a
      programming point of view, this new bus type differs from AMBA and does
      not use AMBA common registers. It also differs enough from SSB. We
      decided that a new bus driver is needed to keep the code clean.
      
      In its current form, the driver detects devices present on the bus and
      registers them in the system. It allows registering BCMA drivers for
      specified bus devices and provides them basic operations. The bus driver
      itself includes two important bus managing drivers: ChipCommon core
      driver and PCI(c) core driver. They are early used to allow correct
      initialization.
      
      Currently code is limited to supporting buses on PCI(e) devices, however
      the driver is designed to be used also on other hosts. The host
      abstraction layer is implemented and already used for PCI(e).
      
      Support for PCI(e) hosts is working and seems to be stable (access to
      80211 core was tested successfully on a few devices). We can still
      optimize it by using some fixed windows, but this can be done later
      without affecting any external code. Windows are just ranges in MMIO
      used for accessing cores on the bus.
      
      Cc: Greg KH <greg@kroah.com>
      Cc: Michael Büsch <mb@bu3sch.de>
      Cc: Larry Finger <Larry.Finger@lwfinger.net>
      Cc: George Kashperko <george@znau.edu.ua>
      Cc: Arend van Spriel <arend@broadcom.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Andy Botting <andy@andybotting.com>
      Cc: linuxdriverproject <devel@linuxdriverproject.org>
      Cc: linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>
      Signed-off-by: NRafał Miłecki <zajec5@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      8369ae33
  5. 03 8月, 2010 1 次提交
  6. 19 5月, 2010 1 次提交
    • O
      MODULE_DEVICE_TABLE(isapnp, ...) does nothing · fedb3d27
      Ondrej Zary 提交于
      On Monday 23 November 2009 04:29:53 Rusty Russell wrote:
      > On Mon, 23 Nov 2009 07:31:57 am Ondrej Zary wrote:
      > > The problem is that
      > > scripts/mod/file2alias.c simply ignores isapnp.
      >
      > AFAICT it always has, and noone has complained until now.  Perhaps
      > something was still reading /lib/modules/`uname -r`/modules.isapnpmap?
      
      The patch below works fine (at least with Debian). It needs your first
      patch that moves the definitions to mod_devicetable.h. Verified that
      aliases for these modules are generated correctly:
      
      drivers/media/radio/radio-sf16fmi.c
      drivers/net/ne.c
      drivers/net/3c515.c
      drivers/net/smc-ultra.c
      drivers/pcmcia/i82365.c
      drivers/scsi/aha1542.c
      drivers/scsi/aha152x.c
      drivers/scsi/sym53c416.c
      drivers/scsi/g_NCR5380.c
      
      Tested with RTL8019AS (ne), AVA-1505AE (aha152x) and dtc436e (g_NCR5380)
      cards - they now work automatically.
      
      Generate pnp:d aliases for isapnp_device_tables. This allows udev to load
      these modules automatically.
      Signed-off-by: NOndrej Zary <linux@rainbow-software.org>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      fedb3d27
  7. 18 5月, 2010 1 次提交
  8. 03 4月, 2010 1 次提交
  9. 18 1月, 2010 1 次提交
    • M
      modpost: fix segfault in sym_is() with prefixed arches · 3a5dd791
      Mike Frysinger 提交于
      The sym_is() compares a symbol in an attempt to automatically skip symbol
      prefixes.  It does this first by searching the real symbol with the normal
      unprefixed symbol.  But then it uses the length of the original symbol to
      check the end of the substring instead of the length of the symbol it is
      looking for.  On non-prefixed arches, this is effectively the same thing,
      so there is no problem.  On prefixed-arches, since this is exceeds by just
      one byte, a crash is rare and it is usually a NUL byte anyways.  But every
      once in a blue moon, you get the right page alignment and it segfaults.
      
      For example, on the Blackfin arch, sym_is() will be called with the real
      symbol "___mod_usb_device_table" as "symbol" when looking for the normal
      symbol "__mod_usb_device_table" as "name".  The substring will thus return
      one byte into "symbol" and store it into "match".  But then "match" will
      be indexed with the length of "symbol" instead of "name" and so we will
      exceed the storage.  i.e. the code ends up doing:
      	char foo[] = "abc"; return foo[strlen(foo)+1] == '\0';
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3a5dd791
  10. 12 12月, 2009 2 次提交
    • N
      USB: handle bcd incrementation in usb modalias generation · 55f49f26
      Nathaniel McCallum 提交于
      This patch fixes a bug when incrementing/decrementing on a BCD formatted
      integer (i.e. 0x09++ should be 0x10 not 0x0A).  It just adds a function
      for incrementing/decrementing BCD integers by converting to decimal,
      doing the increment/decrement and then converting back to BCD.
      Signed-off-by: NNathaniel McCallum <nathaniel@natemccallum.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      55f49f26
    • N
      USB: add hex/bcd detection to usb modalias generation · afe2dab4
      Nathaniel McCallum 提交于
      The current code to generate usb modaliases from usb_device_id assumes
      that the device's bcdDevice descriptor will actually be in BCD format.
      While this should be a sane assumption, some devices don't follow spec
      and just use plain old hex.  This causes drivers for these devices to
      generate invalid modalias lines which will never actually match for the
      hardware.
      
      The following patch adds hex support for bcdDevice in file2alias.c by
      detecting when a driver uses a hex formatted bcdDevice_(lo|hi) and
      adjusts the output to hex format accordingly.
      
      Drivers for devices which have bcdDevice conforming to BCD will have no
      change in modalias output.  Drivers for devices which don't conform
      (i.e. ibmcam) should now generate valid modaliases.
      
      EXAMPLE OUTPUT (ibmcam; space added to highlight change)
          Old: usb:v0545p800D d030[10-9] dc*dsc*dp*ic*isc*ip*
          New: usb:v0545p800D d030a      dc*dsc*dp*ic*isc*ip*
      Signed-off-by: NNathaniel McCallum <nathaniel@natemccallum.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      afe2dab4
  11. 23 9月, 2009 2 次提交
    • A
      spi: prefix modalias with "spi:" · e0626e38
      Anton Vorontsov 提交于
      This makes it consistent with other buses (platform, i2c, vio, ...).  I'm
      not sure why we use the prefixes, but there must be a reason.
      
      This was easy enough to do it, and I did it.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Dmitry Torokhov <dtor@mail.ru>
      Cc: Samuel Ortiz <sameo@openedhand.com>
      Cc: "John W. Linville" <linville@tuxdriver.com>
      Acked-by: NMike Frysinger <vapier.adi@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e0626e38
    • A
      spi: add support for device table matching · 75368bf6
      Anton Vorontsov 提交于
      With this patch spi drivers can use standard spi_driver.id_table and
      MODULE_DEVICE_TABLE() mechanisms to bind against the devices.  Just like
      we do with I2C drivers.
      
      This is useful when a single driver supports several variants of devices
      but it is not possible to detect them in run-time (like non-JEDEC chips
      probing in drivers/mtd/devices/m25p80.c), and when platform_data usage is
      overkill.
      
      This patch also makes life a lot easier on OpenFirmware platforms, since
      with OF we extensively use proper device IDs in modaliases.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      75368bf6
  12. 12 6月, 2009 1 次提交
  13. 25 3月, 2009 1 次提交
    • E
      platform: introduce module id table for platform devices · 57fee4a5
      Eric Miao 提交于
      Now platform_device is being widely used on SoC processors where the
      peripherals are attached to the system bus, which is simple enough.
      
      However, silicon IPs for these SoCs are usually shared heavily across
      a family of processors, even products from different companies.  This
      makes the original simple driver name based matching insufficient, or
      simply not straight-forward.
      
      Introduce a module id table for platform devices, and makes it clear
      that a platform driver is able to support some shared IP and handle
      slight differences across different platforms (by 'driver_data').
      Module alias is handled automatically when a MODULE_DEVICE_TABLE()
      is defined.
      
      To not disturb the current platform drivers too much, the matched id
      entry is recorded and can be retrieved by platform_get_device_id().
      Signed-off-by: NEric Miao <eric.miao@marvell.com>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      57fee4a5
  14. 17 2月, 2009 1 次提交
  15. 21 1月, 2009 1 次提交
  16. 15 10月, 2008 1 次提交
  17. 13 10月, 2008 1 次提交
    • D
      Automatic MODULE_ALIAS() for DMI match tables. · d945b697
      David Woodhouse 提交于
      This makes modpost handle MODULE_DEVICE_TABLE(dmi, xxxx).
      
      I had to change the string pointers in the match table to char arrays,
      and picked a size of 79 bytes almost at random -- do we need to make it
      bigger than that? I was a bit concerned about the 'bloat' this
      introduces into the match tables, but they should all be __initdata so
      it shouldn't matter too much.
      
      (Actually, modpost does go through the relocations and look at most of
      them; it wouldn't be impossible to make it handle string pointers -- but
      doesn't seem to be worth the effort, since they're __initdata).
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      d945b697
  18. 22 8月, 2008 1 次提交
  19. 25 7月, 2008 1 次提交
  20. 22 7月, 2008 1 次提交
  21. 14 7月, 2008 1 次提交
  22. 04 5月, 2008 1 次提交
    • J
      modpost: i2c aliases need no trailing wildcard · ac551828
      Jean Delvare 提交于
      Not all device types need a wildcard at the end of their module
      aliases. In particular, for i2c module aliases, the trailing wildcard
      is not only unneeded, it could also cause the wrong driver to be
      loaded.
      
      As I2C devices have no IDs, i2c module aliases are simple, arbitrary
      device names. For example:
      
      $ /sbin/modinfo lm90
      filename:       /lib/modules/2.6.25-git18/kernel/drivers/hwmon/lm90.ko
      author:         Jean Delvare <khali@linux-fr.org>
      description:    LM90/ADM1032 driver
      license:        GPL
      vermagic:       2.6.25-git18 mod_unload
      depends:        hwmon
      alias:          i2c:lm90*
      alias:          i2c:adm1032*
      alias:          i2c:lm99*
      alias:          i2c:lm86*
      alias:          i2c:max6657*
      alias:          i2c:adt7461*
      alias:          i2c:max6680*
      $
      
      This would cause trouble if one I2C chip name matches the beginning of
      another I2C chip name and both chips are supported by different
      drivers. For example, an i2c device named lm9042 would cause the lm90
      driver to be loaded, while it doesn't support that device. This case
      has yet to be seen in practice, but still, I'd like to fix it now. The
      cleanest fix is to remove the trailing wildcard from i2c module aliases.
      
      Here's a patch doing this.
      
      Not all device type aliases need a trailing wildcard, in particular
      the i2c aliases don't. Don't add a wildcard by default in do_table(),
      instead let each device type handler add it if needed.
      
      I have tested types acpi, dmi, eisa, i2c, ide, ieee1394, input, pci,
      pcmcia, platform, pnp, scsi, serio, ssb and usb. Other types (ccw, of,
      vio, parisc, sdio and virtio) are untested.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Acked-by: NJochen Friedrich <jochen@scram.de>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      ac551828
  23. 30 4月, 2008 1 次提交
    • J
      i2c: Add support for device alias names · d2653e92
      Jean Delvare 提交于
      Based on earlier work by Jon Smirl and Jochen Friedrich.
      
      This patch allows new-style i2c chip drivers to have alias names using
      the official kernel aliasing system and MODULE_DEVICE_TABLE(). At this
      point, the old i2c driver binding scheme (driver_name/type) is still
      supported.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: Jochen Friedrich <jochen@scram.de>
      Cc: Jon Smirl <jonsmirl@gmail.com>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      d2653e92
  24. 20 4月, 2008 1 次提交
    • K
      PNP: add all PNP card device id's as individual aliases · 0c81eed4
      Kay Sievers 提交于
      The current PNP combined card + devices module aliase can
      never ever match anything, because these values are not available
      all at the same time to request a module.
      
      Instead of adding the combined alias, we add the device id's
      all as individual aliases. Device id's are exported by the PNP
      bus and can now properly used to request the loading of a
      matching module.
      
      The module snd-sbawe currently exports aliases, which can never
      match anything:
        alias: pnp:cCTLXXXXdCTL0045dCTL0022*
        alias: pnp:cCTLXXXXdCTL0044dCTL0023*
        alias: pnp:cCTLXXXXdCTL0042dCTL0022*
        alias: pnp:cCTLXXXXdCTL0041dCTL0021*
        alias: pnp:cCTLXXXXdCTL0031dCTL0021*
        alias: pnp:cCTL00eddCTL0041dCTL0070*
        alias: pnp:cCTL00e9dCTL0045dCTL0022*
        alias: pnp:cCTL00e4dCTL0045dCTL0022*
        alias: pnp:cCTL00c7dCTL0045dCTL0022*
        alias: pnp:cCTL00c5dCTL0045dCTL0022*
        alias: pnp:cCTL00c3dCTL0045dCTL0022*
        alias: pnp:cCTL00c1dCTL0042dCTL0022*
        alias: pnp:cCTL00b2dCTL0044dCTL0023*
        alias: pnp:cCTL009edCTL0044dCTL0023*
        alias: pnp:cCTL009ddCTL0042dCTL0022*
        alias: pnp:cCTL009fdCTL0041dCTL0021*
        alias: pnp:cCTL009cdCTL0041dCTL0021*
        alias: pnp:cCTL009adCTL0041dCTL0021*
        alias: pnp:cCTL0054dCTL0031dCTL0021*
        alias: pnp:cCTL0048dCTL0031dCTL0021*
        alias: pnp:cCTL0047dCTL0031dCTL0021*
        alias: pnp:cCTL0046dCTL0031dCTL0021*
        alias: pnp:cCTL0045dCTL0031dCTL0021*
        alias: pnp:cCTL0044dCTL0031dCTL0021*
        alias: pnp:cCTL0043dCTL0031dCTL0021*
        alias: pnp:cCTL0042dCTL0031dCTL0021*
        alias: pnp:cCTL0039dCTL0031dCTL0021*
        alias: pnp:cCTL0035dCTL0031dCTL0021*
      
      With this patch it exports only the device id's, as properly
      matchable aliases:
        alias: pnp:dCTL0070*
        alias: pnp:dCTL0045*
        alias: pnp:dCTL0023*
        alias: pnp:dCTL0044*
        alias: pnp:dCTL0022*
        alias: pnp:dCTL0042*
        alias: pnp:dCTL0041*
        alias: pnp:dCTL0021*
        alias: pnp:dCTL0031*
      
      Now, the exported value of the PNP bus can be used to autoload
      a matching module:
        $ modprobe --first-time -n -v pnp:dCTL0045
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/core/snd-rawmidi.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/drivers/mpu401/snd-mpu401-uart.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/core/snd-hwdep.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sb-common.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sb16-csp.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sb16-dsp.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/drivers/opl3/snd-opl3-lib.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sbawe.ko
      
        $ grep CTL0045 /sys/bus/pnp/devices/*/id
        /sys/bus/pnp/devices/01:01.00/id:CTL0045
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0c81eed4
  25. 24 3月, 2008 1 次提交
  26. 02 2月, 2008 1 次提交
    • G
      USB: handle idVendor of 0x0000 · de6f92b9
      Greg Kroah-Hartman 提交于
      Some crazy devices in the wild have a vendor id of 0x0000.  If we try to
      add a module alias with this id, we just can't do it due to a check in
      the file2alias.c file.  Change the test to verify that both the vendor
      and product ids are 0x0000 to show a real "blank" module alias.
      
      Note, the module-init-tools package also needs to be changed to properly
      generate the depmod tables.
      
      Cc: Janusz <janumix@poczta.fm>
      Cc: stable <stable@kernel.org>
      Cc: Jon Masters <jcm@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      de6f92b9
  27. 23 10月, 2007 1 次提交
  28. 14 10月, 2007 1 次提交
    • J
      i2c: Kill struct i2c_device_id · cee37ae4
      Jean Delvare 提交于
      I2C devices do not have any form of ID as PCI or USB devices have.
      No driver uses "MODULE_DEVICE_TABLE(i2c, ...)" because it doesn't
      make sense. So we can get rid of struct i2c_device_id and the
      associated support code.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: Greg KH <greg@kroah.com>
      cee37ae4
  29. 13 10月, 2007 1 次提交
  30. 11 10月, 2007 1 次提交
  31. 24 9月, 2007 1 次提交
  32. 24 7月, 2007 1 次提交
  33. 19 5月, 2007 1 次提交
  34. 03 5月, 2007 1 次提交
    • S
      kbuild: remove dependency on input.h from file2alias · dc24f0e7
      Sam Ravnborg 提交于
      Almost all definitions used by file2alias was already
      present in mod_devicetable.h.
      Added the last definition and killed the input.h usage.
      
      The errornous include was pointed out
      by: Jan Engelhardt <jengelh@linux01.gwdg.de>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Jan Engelhardt <jengelh@linux01.gwdg.de>
      Cc: Deepak Saxena <dsaxena@plexity.net>
      dc24f0e7
  35. 17 2月, 2007 2 次提交
  36. 27 9月, 2006 1 次提交
    • M
      [PATCH] EISA bus MODALIAS attributes support · 07563c71
      Michael Tokarev 提交于
      Add modalias attribute support for the almost forgotten now EISA bus and
      (at least some) EISA-aware modules.
      
      The modalias entry looks like (for an 3c509 NIC):
      
       eisa:sTCM5093
      
      and the in-module alias like:
      
       eisa:sTCM5093*
      
      The patch moves struct eisa_device_id declaration from include/linux/eisa.h
      to include/linux/mod_devicetable.h (so that the former now #includes the
      latter), adds proper MODULE_DEVICE_TABLE(eisa, ...) statements for all
      drivers with EISA IDs I found (some drivers already have that DEVICE_TABLE
      declared), and adds recognision of __mod_eisa_device_table to
      scripts/mod/file2alias.c so that proper modules.alias will be generated.
      
      There's no support for /lib/modules/$kver/modules.eisamap, as it's not used
      by any existing tools, and because with in-kernel modalias mechanism those
      maps are obsolete anyway.
      
      The rationale for this patch is:
      
       a) to make EISA bus to act as other busses with modalias
          support, to unify driver loading
      
       b) to foget about EISA finally - with this patch, kernel
          (who still supports EISA) will be the only one who knows
          how to choose the necessary drivers for this bus ;)
      
      [akpm@osdl.org: fix the kbuild bit]
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Randy Dunlap <rdunlap@xenotime.net>
      Acked-the-net-bits-by: NJeff Garzik <jeff@garzik.org>
      Acked-the-tulip-bit-by: NValerie Henson <val_henson@linux.intel.com>
      Cc: James Bottomley <James.Bottomley@steeleye.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      07563c71