Jump to content

subordinate_bus - set its default value [solved]


Edd
 Share

Recommended Posts

My wireless connection is now running great, but everytime I boot up linux I have to run the following command:

 

setpci -s 0:14.4 subordinate_bus=03

I have to do this because it keeps defaulting to 02 which stops mandrake recognising my wireless card. Where can I change the default value of the subordinate_bus so that it doesn't change on reboot?

Thanks a lot for all your help so far :)

Link to comment
Share on other sites

What kind of wireless card do you have? Is it a PCI, or PCMCIA for laptop?

 

I found a post, although it mentions the following:

 

The last step to getting the wireless card to work on boot was to insert the following code at the end of /etc/init.d/pcmcia

 

setpci -s 0:a.0 SUBORDINATE_BUS=0A cardctl eject 0 cardctl insert 0

 

If you have a PCMCIA wireless card, you could add your line to the bottom of /etc/init.d/pcmcia, which you quoted above as being:

 

setpci -s 0:14.4 subordinate_bus=03

 

Does that help at all?

Link to comment
Share on other sites

The file says the following:

#!/bin/sh

# rc.pcmcia 1.46 2004/05/07 06:24:58 (David Hinds)
#
# This is designed to work in BSD as well as SysV init setups.  See
# the HOWTO for customization instructions.

# Tags for Red Hat init configuration tools
#
# chkconfig: 2345 04 96
# processname: cardmgr
# pidfile: /var/run/cardmgr.pid
# config: /etc/pcmcia/config
# config: /etc/pcmcia/config.opts
# description: PCMCIA support is usually to support things like ethernet \
#              and modems in laptops.  It won't get started unless \
#              configured so it is safe to have it installed on machines \
#              that don't need it.

# Exit if pcmcia-cs is not installed
test -x /sbin/cardmgr || exit 0

# Save option values passed in through the environment
for N in PCMCIA PCIC PCIC_OPTS CORE_OPTS CARDMGR_OPTS SCHEME; do
   V=`eval echo '$'$N`; if [ "$V" ]; then eval ENV_$N=\"$V\"; fi
done

# Source PCMCIA configuration, if available
if [ -f /etc/pcmcia.conf ]; then
   # Debian startup option file
   . /etc/pcmcia.conf
elif [ -f /etc/sysconfig/pcmcia ]; then
   # Red Hat startup option file
   . /etc/sysconfig/pcmcia
else
   # Slackware startup options go right here:
   # Should be either i82365 or tcic
   PCIC=i82365
   # Put socket driver timing parameters here
   PCIC_OPTS=
   # Put pcmcia_core options here
   CORE_OPTS=
   # Put cardmgr options here
   CARDMGR_OPTS=
   # To set the PCMCIA scheme at startup...
   SCHEME=
fi
for N in PCMCIA PCIC PCIC_OPTS CORE_OPTS CARDMGR_OPTS SCHEME; do
   V=`eval echo '$'ENV_$N`; if [ "$V" ]; then eval $N=\"$V\"; fi
done
if [ "$PCMCIA" -a "$PCMCIA" != "yes" ]; then exit 0; fi

usage()
{
   echo "Usage: $0 {start|stop|status|restart|reload}"
}

cleanup()
{
   while read SN CLASS MOD INST DEV EXTRA; do
if [ "$SN" != "Socket" ]; then
    /etc/pcmcia/$CLASS stop $DEV 2> /dev/null
fi
   done
}

EXITCODE=1
for x in "1"; do

   if [ "$PCIC" = "" ]; then
echo "PCIC module not defined in startup options!"
break
   fi

   if [ $# -lt 1 ]; then usage; break; fi
   action=$1

   case "$action" in

   start)
echo -n "Starting PCMCIA services: "

if [ -d /var/lib/pcmcia ]; then
    SC=/var/lib/pcmcia/scheme
    RUN=/var/lib/pcmcia
else
    SC=/var/run/pcmcia-scheme
    RUN=/var/run
fi
if [ -L $SC -o ! -O $SC ]; then rm -f $SC; fi
if [ ! -f $SC ]; then umask 022; touch $SC; fi
if [ "$SCHEME" ]; then umask 022; echo $SCHEME > $SC; fi
    
if ! grep -q pcmcia /proc/devices; then
    if [ -d /lib/modules/preferred ]; then
 PC=/lib/modules/preferred/pcmcia
    else
 PC=/lib/modules/`uname -r`/pcmcia
    fi
    KD=/lib/modules/`uname -r`/kernel/drivers/pcmcia
    if [ -x /sbin/modprobe ]; then
 /sbin/modprobe pcmcia_core $CORE_OPTS || break
 /sbin/modprobe $PCIC $PCIC_OPTS >/dev/null 2>&1 ||
   (/sbin/modprobe yenta_socket >/dev/null 2>&1 &&
    echo "using yenta_socket instead of $PCIC") ||
   /sbin/modprobe $PCIC $PCIC_OPTS || break
 /sbin/modprobe ds || break
    elif [ -d $PC ]; then
 /sbin/insmod $PC/pcmcia_core.o $CORE_OPTS
 /sbin/insmod $PC/$PCIC.o $PCIC_OPTS
 /sbin/insmod $PC/ds.o
    else
 echo "module directory $PC not found."
 break
    fi
fi

if [ -s /var/run/cardmgr.pid ] && \
    kill -0 `cat /var/run/cardmgr.pid` 2>/dev/null; then
    echo "cardmgr is already running."
else
    if [ -r $RUN/stab ]; then
 cat $RUN/stab | cleanup
    fi
    /sbin/cardmgr $CARDMGR_OPTS
fi

echo "done."
touch /var/lock/subsys/pcmcia 2>/dev/null
EXITCODE=0
;;

   stop)
echo -n "Shutting down PCMCIA services: "
if [ -s /var/run/cardmgr.pid ]; then
    PID=`cat /var/run/cardmgr.pid`
    kill $PID
    # Give cardmgr a few seconds to handle the signal
    for N in 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5; do
 kill -0 $PID 2>/dev/null || break
 sleep 2
    done
fi
killall -q "CardBus Watcher"
if grep -q "^ds " /proc/modules; then
    /sbin/rmmod ds
    /sbin/rmmod $PCIC 2>/dev/null || \
 /sbin/rmmod yenta_socket 2>/dev/null
    /sbin/rmmod pcmcia_core
fi
echo "done."
rm -f /var/lock/subsys/pcmcia
EXITCODE=0
;;

   status)
pid=`/sbin/pidof cardmgr`
if [ "$pid" != "" ]; then
    echo "cardmgr (pid $pid) is running..."
    EXITCODE=0
else
    echo "cardmgr is stopped"
    EXITCODE=3
fi
;;

   restart|reload)
$0 stop
$0 start
EXITCODE=$?
;;

   *)
usage
;;

   esac

done

# Only exit if we're in our own subshell
case $0 in *rc.pcmcia) exit $EXITCODE;; esac

 

I tried pasting the code right at the very bottom but nothing. I tried near the bottom but in difference places but still nothing. Can you see an "obvious" place to put it? Thanks :)

Link to comment
Share on other sites

From the search I did, the text that I copied over, mentioned pasting to the end of the file.

 

I've just found another post, and I think you would need to put it in /etc/rc.local

 

Sorry for the incorrect information before! Hope it works this time :P

Link to comment
Share on other sites

Well I tried putting it in the other file you mentioned. but still nothing :( Here is the contents of rc.local:

 

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

[ -f /etc/sysconfig/system ] && source /etc/sysconfig/system
[ -f /etc/sysconfig/msec ] && source /etc/sysconfig/msec
[ -z "$SECURE_LEVEL" ] && SECURE_LEVEL=3
[ -f /etc/sysconfig/init ] && source /etc/sysconfig/init
if [ $SECURE_LEVEL -lt 4 ]; then
   [ -z "$REWRITEISSUE" ] && REWRITEISSUE=rewrite
   if [ $SECURE_LEVEL -lt 3 ]; then
[ -z "$REWRITEISSUENET" ] && REWRITEISSUENET=rewrite
   fi
fi

SYSTEM=${SYSTEM=Mandrakelinux}

# Source functions
. /etc/init.d/functions

if [ "$REWRITEISSUE" = "rewrite" -a -f /etc/mandrake-release ]; then
   R=$(cat /etc/mandrake-release)

   arch=$(uname -m)
   a="a"
   case "_$arch" in
    _a*) a="an";;
    _i*) a="an";;
   esac
   
   NUMPROC=`egrep -c "^cpu[0-9]+" /proc/stat`
   if [ "$NUMPROC" -gt "1" ]; then
       SMP="$NUMPROC-processor "
[ "$NUMPROC" = "2" ] && \
SMP="Dual-processor "
       if [ "$NUMPROC" = "8" -o "$NUMPROC" = "11" ]; then
           a="an"
else
    a="a"
       fi
   fi

   # This will overwrite /etc/issue at every boot.  So, make any changes you
   # want to make to /etc/issue here or you will lose them when you reboot.

   if [ -x /usr/bin/linux_logo ]; then
/usr/bin/linux_logo -n -f | sed -e 's|\\|\\\\|g' > /etc/issue
echo "" >> /etc/issue
   else
> /etc/issue
   fi
   echo "$R" >> /etc/issue
   echo "Kernel $(uname -r) on $a $SMP$(uname -m) / \l" >> /etc/issue
   
   if [ "$REWRITEISSUENET" = "rewrite" ]; then
echo "Welcome to ${HOST}" > /etc/issue.net
echo "$R" >> /etc/issue.net
echo "Kernel $(uname -r) on $a $SMP$(uname -m)" >> /etc/issue.net
   else
NAME="$SYSTEM"
gprintf "Welcome to %s\n" "$NAME" > /etc/issue.net
echo "-------------------------" >> /etc/issue.net
   fi
else
   if [ -f /etc/security/msec/issue.$SECURE_LEVEL ]; then
cat /etc/security/msec/issue.$SECURE_LEVEL > /etc/issue
   elif [ -f /etc/security/msec/issue ]; then
cat /etc/security/msec/issue > /etc/issue
   else
rm -f /etc/issue
   fi
   if [ -f /etc/security/msec/issue.net.$SECURE_LEVEL ]; then
cat /etc/security/msec/issue.net.$SECURE_LEVEL > /etc/issue.net
   elif [ -f /etc/security/msec/issue.net ]; then
cat /etc/security/msec/issue.net > /etc/issue.net
   else
rm -f /etc/issue.net
   fi
fi
I've tried it here ---->setpci -s 0:14.4 subordinate_bus=03
touch /var/lock/subsys/local
and here ---->setpci -s 0:14.4 subordinate_bus=03

 

Notice where I have tried it at the bottom. I can't see anywhere else to put it, I'm worried if I get too click happy I'll stop it working, so do you know where abouts would be a good place to put the line? Thanks for all your help so far :)

Link to comment
Share on other sites

I'm honestly not sure where else that I could think of to put it. You could try a google on "subordinate_bus" and see what results come back.

 

I'm sure there is a file somewhere you can add this too, and it'd work. I've just no idea what the startup files are for making such settings! A brief search I did threw up the results I posted so far.

Link to comment
Share on other sites

I had a look on google as you said (god knows why I never before). I found some information, it wasn't quite right, I combined it with what you said and i have the solution! So, to set the subordinate_bus default, do the following:

 

Add these lines of code to the top of /etc/init.d/pcmcia/

setpci -s 0:a.0 SUBORDINATE_BUS=0A
cardctl eject 0
cardctl insert 0

 

If the setpci line isn't as you want, just change the settings, I had to change mine to "setpci -s 0:14.4 SUBORDINATE_BUS=03"

 

Thanks for your help Ian :) Maybe this would be worth documenting somewhere?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...