From: "Eric O. Angell" <eoa@cs.hmc.edu>
To: linux-hotplug@vger.kernel.org
Subject: pci.agent remove
Date: Tue, 10 Dec 2002 11:24:19 +0000 [thread overview]
Message-ID: <marc-linux-hotplug-103951971717701@msgid-missing> (raw)
Disclaimer: I didn't really bother to poke through the stuff on
Sourceforge or look at the latest version, so I don't know if this has
already been covered. I'm running RedHat 7.3 on a Dell Inspiron 3500,
and /etc/hotplug/pci.agent contains this line:
# $Id: pci.agent,v 1.11 2001/09/07 15:57:39 dbrownell Exp $
Anyway, I just got an Edimax EP-4103DL PCMCIA Ethernet card,
which uses the Realtek 8139 driver (8139too.o). I've gleaned that
since this is a PCI driver, hotplug handles it rather than PC card
services. However, since I'm used to the way cardmgr handles my
wireless card (namely, it unloads the required modules when the card
is ejected), I wanted similar behavior with this card.
After poking at some of the neighboring files, I added a remove case
to the action section, and I thought I'd give it to you guys in case
it proved useful to anyone.
No diff since I don't want it to be particularly easy to add the code
to your file - someone who has more than an hour of familiarity with
the hotplug code should look at it first. It's also not structured
like the rest of the code, since I wanted to keep my modifications
contained within one file. Anyway, stick this in the section that
begins as "case $ACTION in" to replicate what I've got now:
# EOA 2002/12/09, not originally supposed to be robust, just supposed to make
# my Edimax EP-4301 play nicely. However, I ended up writing it in such a
# fashion that it might actually prove moderately robust. I'll leave that up
# to someone else to decide and revise, so use at your own risk. Works well
# enough for me for now. (This code largely ripped from this file,
# /etc/hotplug/hotplug.functions, and /etc/hotplug/pci.rc):
remove)
pci_convert_vars
LABEL="PCI slot $PCI_SLOT_NAME"
DRIVERS=""
LISTER=`type -p pcimodules`
if [ "$LISTER" != "" ]; then
mesg "pcimodules is scanning more than $PCI_SLOT ..."
DRIVERS=`$LISTER`
fi
if [ -r $MAP_CURRENT ]; then
if [ "$LISTER" = "" ]; then
pci_map_modules < $MAP_CURRENT
fi
if [ "$DRIVERS" = "" ]; then
return
fi
debug_mesg Unsetup $DRIVERS for $DESCRIPTION
UNMODPROBE="/sbin/modprobe -s -r"
for MODULE in $DRIVERS
do
if lsmod | grep -q "^$MODULE "; then
if grep -q "^$MODULE\$" $HOTPLUG_DIR/blacklist \
>/dev/null 2>&1; then
mesg "... not unloading blacklisted module: $MODULE"
continue
fi
$UNMODPROBE $MODULE >/dev/null 2>&1
fi
done
fi
;;
Hope it's of some use to somebody.
-E
---
Eric O. Angell
Harvey Mudd College c/o 2004
Computer Scientist, Mathematician, Reverse Engineer
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next reply other threads:[~2002-12-10 11:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-10 11:24 Eric O. Angell [this message]
2002-12-10 17:43 ` pci.agent remove Stephen Williams
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=marc-linux-hotplug-103951971717701@msgid-missing \
--to=eoa@cs.hmc.edu \
--cc=linux-hotplug@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).