mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Indan Zupancic" <indan@nul.nu>
To: "Duncan Sands" <duncan.sands@math.u-psud.fr>
Cc: "mikie" <mikie.pl@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: understanding firmware loader for speedtouch (kernel 2.6.21.5)
Date: Fri, 6 Jul 2007 21:16:40 +0200 (CEST)	[thread overview]
Message-ID: <58019.81.207.0.53.1183749400.squirrel@secure.samage.net> (raw)
In-Reply-To: <200707061620.44348.duncan.sands@math.u-psud.fr>

On Fri, July 6, 2007 16:20, Duncan Sands wrote:
> On Friday 6 July 2007 14:54:18 mikie wrote:
>> Hi,
>>
>> I experience some problems with the speedtch.c module, especially in
>> regards to its firmware loader.
>> I am not quite sure if this module is going to load the firmware
>> itself or does it use some external software to do that ?
>
> It loads it itself, using some external software!

For information, it generates a hotplug event and the kernel calls the
program written at /proc/sys/kernel/hotplug with certain information.
That used to be /sbin/hotplug, became later udev, but today in general
udev reads the uevents generated by the kernel.


>> I have read and checked the firmware.agent script from some hotplug
>> package, and noticed that it makes something like simple file copy of
>> the firmware to the "data" and echoing 1 or 0 to the "loading" file.
>> But what is the location of these data/loading ? Also the firmware is
>> split into 2 parts -- should I upload them one after another? Is that
>> all that should be done to get the firmware loaded?
>
> You need to write the file that was asked for: the modem starts by asking
> for the first file, uploads it, then asks for the second file and uploads it.
> The file is written to the "data" file, but note that the data file is created
> on the fly when the modem requests a firmware load so you can't write to it
> at some random time.

If you really don't want to use udevd, you could use the below script I wrote
(not really tested, it's an bash version of the Udev rules I've have, more or less.)

Echo the script pathname to /proc/sys/kernel/hotplug early at bootup and all
should work, assuming your pppd is setup correctly and the script isn't buggy.

#!/bin/sh
set -e

p()
{
	# For debugging/logging, edit for your needs.
	echo "$*"
	echo "$*" > /dev/vc/1;
	echo "$*" >> /tmp/bla;
}

if [ "$SUBSYSTEM" = "firmware" ]; then
	p "Loading firmware..."
	cd /sys/$DEVPATH
	if [ -f "/lib/firmware/$FIRMWARE" ]; then
		echo 1 > loading
		cat "/lib/firmware/$FIRMWARE" > data
		echo 0 > loading
		p "Done."
	else
		echo -1 > loading
		p "$FIRMWARE not found."
	fi
elif [ "$SUBSYSTEM" = "atm" ]; then
	if [[ "$KERNEL" != speedtch* ]]; then
		exit
	fi
	if [ "$ACTION" = "add" ]; then
		p "Starting pppd."
		pppd call adsl
	elif [ "$ACTION" = "remove" ]; then
		p "Stopping pppd."
		pkill pppd
	fi
fi

Greetings,

Indan



  reply	other threads:[~2007-07-06 19:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-06 12:54 mikie
2007-07-06 14:20 ` Duncan Sands
2007-07-06 19:16   ` Indan Zupancic [this message]
2007-07-09  8:49     ` mikie
2007-07-09 10:42       ` Indan Zupancic
2007-07-09 11:08         ` mikie
2007-07-09 13:59           ` Kay Sievers
2007-07-09 14:40             ` mikie
2007-07-09 15:03               ` Indan Zupancic
2007-07-09 17:00                 ` mikie
     [not found]                   ` <200707091923.38577.duncan.sands@math.u-psud.fr>
2007-07-09 17:41                     ` mikie
2007-07-09 17:51                       ` Duncan Sands
2007-07-10  7:54                     ` mikie
2007-07-10  8:57                       ` Duncan Sands
2007-07-10  9:13                         ` mikie
2007-07-10  9:32                           ` Duncan Sands
2007-07-10 10:32                             ` mikie
2007-07-11 11:22                               ` mikie
2007-07-11 12:33                                 ` Duncan Sands
2007-07-11 12:47                                   ` mikie
2007-07-11 13:07                                     ` Duncan Sands
2007-07-11 16:55                                       ` mikie
2007-07-19 10:24                                         ` mikie
2007-07-24 23:03                                           ` Duncan Sands
2008-11-19 12:25                                             ` mikie
2008-11-19 12:49                                               ` Duncan Sands
2007-07-09 15:08               ` Kay Sievers
2007-07-09 10:50       ` Duncan Sands
2007-07-09 11:06         ` mikie
     [not found]   ` <ca35ce500707061006k74754bd6m8a9d2f1cb2910823@mail.gmail.com>
     [not found]     ` <200707061924.57099.duncan.sands@math.u-psud.fr>
2007-07-06 19:30       ` mikie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58019.81.207.0.53.1183749400.squirrel@secure.samage.net \
    --to=indan@nul.nu \
    --cc=duncan.sands@math.u-psud.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikie.pl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®