[Soekris] [RFC][PATCH] LED Class support for Soekris net48xx

Michael Smith msmith at cbnco.com
Mon Jul 31 13:10:45 UTC 2006


On Sun, 23 Jul 2006, Chris Boot wrote:

> >> I'd love to find a way of detecting a Soekris net48xx device
> >  > but there is no DMI or any Soekris-specific PCI devices.

There is an old Linux errorled_control module for the net4801. It refuses 
to load if it's not run on a net4801 (or at least, if it's loaded on a 
4501).

This is very handy because it keeps the software and configuration 
identical between the 4801 and 4501. The init scripts first try to load 
errorled_control_4801 and then fall back to errorled_control_4501 if that 
fails. You can swap flash cards between a 4501 and a 4801 without doing 
any work. (Read: build a card for a 4501, realize you gave away your last 
4501 two weeks ago, and use a 4801 instead.)

 * errorled_control.c for the net4801
 * By: Michael Schulze <mike.s at genion.de>
 * Version 1.0
 * Nov 11, 2003
 *
 * This driver is a hack of the original driver (see below) to control
 * the net4801 error led.
 *
 * Original: http://www.blurbco.com/~gork/net4501/
 * errorled_control.c
 * By: John Laur <johnl at blurbco.com>
 * Version 1.2 April 16, 2002

...

int init_module(void)
{
        int retval = 0;

        struct pci_dev *pdev = NULL;

        if( ( pdev= pci_find_device( 0x100b, 0x0510, NULL)) == NULL)
            return -ENODEV;

        sc1100_gpio_base= pci_resource_start( pdev, 0);
        printk(OUR_NAME ": GPIO Base Address = 0x%lx\n", sc1100_gpio_base);

        if( request_region( sc1100_gpio_base, 0x2c, "NatSemi SC1100 GPIO") == 0) {
            printk( KERN_ERR OUR_NAME ": can't allocate I/O space for GPIOs\n");
            return -EBUSY;
        }
...

Mike


More information about the Soekris-tech mailing list