From: Ondrej Zary <linux@rainbow-software.org>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Stephen Hemminger <shemminger@vyatta.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Udev coldplugging loads 8139too driver instead of 8139cp
Date: Tue, 29 Jan 2008 17:53:16 +0100 [thread overview]
Message-ID: <200801291753.18578.linux@rainbow-software.org> (raw)
In-Reply-To: <479F0369.3080309@msgid.tls.msk.ru>
On Tuesday 29 January 2008 11:43:53 Michael Tokarev wrote:
> Stephen Hemminger wrote:
> > On Tue, 29 Jan 2008 03:46:08 +0300
> > Michael Tokarev <mjt@tls.msk.ru> wrote:
>
> []
>
> >> There are 2 drivers for 8139-based NICs. For really different two kinds
> >> of hardware, which both uses the same PCI identifiers. Both drivers
> >> "claims" to work with all NICs with those PCI ids, because "externally"
> >> (by means of udev for example) it's impossible to distinguish the two
> >> kinds of hardware, it becomes clean only when the driver (either of the
> >> two) loads and actually checks which hardware we have here.
> >
> > Is there any chance of using subdevice or subversion to tell them apart?
> > That worked for other vendors like DLINK who slapped same ID on different
> > cards.
>
> If it were that simple... ;)
>
> No. The difference is in PCI revision number (byte #8 in PCI config
> space). If it's >= 0x40 - it's 8139too, < 0x40 - 8139cp. Or 0x20 - I
> forgot.
Perhaps a module could be created that will claim this device ID and then use
the correct driver.
> Here's a code snippet from a shell script I used ages ago to automatically
> load modules (similar to what udev does nowadays):
>
> # special hack for 8139{too,cp} stuff
> case "$modalias" in
> *v000010ECd00008139*)
> rev="$(dd if="$1/config" bs=1 skip=8 count=1 2>/dev/null)"
> if [ -n "$rev" ]; then
> list=
> for module in $modlist; do
> case "$module" in
> 8139cp)
> if [ ".$rev" \< ". " ]; then
> $vecho1 "$TAG: not loading $module for this device"
> continue
> fi
> ;;
> 8139too)
> if [ ".$rev" \> ". " ]; then
> $vecho1 "$TAG: not loading $module for this device"
> continue
> fi
> ;;
> esac
> list="$list $module"
> done
> modlist="$list"
> fi
> ;;
> esac
>
> /mjt
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Ondrej Zary
next prev parent reply other threads:[~2008-01-29 16:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-28 21:16 Udev coldplugging loads 8139too driver instead of 8139cp Frederik Himpe
2008-01-29 0:46 ` Michael Tokarev
2008-01-29 1:08 ` Stephen Hemminger
2008-01-29 10:43 ` Michael Tokarev
2008-01-29 16:53 ` Ondrej Zary [this message]
2008-01-29 18:18 ` Andrey Borzenkov
2008-01-29 23:34 ` Jon Masters
2008-01-29 23:37 ` Jan Engelhardt
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=200801291753.18578.linux@rainbow-software.org \
--to=linux@rainbow-software.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjt@tls.msk.ru \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.