Changeset 2536

Timestamp:
07/03/07 23:56:05 (1 year ago)
Author:
proski
Message:

Update from trunk

Files:
  • branches/dadwifi-openhal/scripts/find-madwifi-modules.sh (modified) (1 diff)
  • branches/dadwifi-openhal/scripts/madwifi-unload.bash (modified) (1 diff)

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dadwifi-openhal/scripts/find-madwifi-modules.sh

    r1623 r2536  
    23 23 fi 
    24 24  
    25   SEARCH="${KDEST}/lib/*/${KVERS}" 
      25 SEARCH="${KDEST}/lib//${KVERS}" 
    26 26  
    27   PATTERN="^.*\/(ath_(hal(|.mod)|pci|rate_(onoe|amrr|sample))\.k?o)|(wlan(_(acl|ccmp|scan_(ap|sta)|tkip|wep|xauth))\.k?o)|((ah_osdep|hal)\.o)$" 
      27 PATTERN="^.*\/(ath_(halo)$" 
    28 28 OLD_MODULES=$(find ${SEARCH} -type f -regex '.*\.k?o' 2>/dev/null | grep -w -E "${PATTERN}") 
    29 29  
  • branches/dadwifi-openhal/scripts/madwifi-unload.bash

    r1621 r2536  
    1 1 #!/bin/bash 
    2 2  
    3   for module in ath{_{pci,rate_{amrr,onoe,sample},hal}} wlan{_{wep,tkip,ccmp,acl,xauth,scan_{sta,ap}},} 
    4   do 
    5            grep -q ^$module /proc/modules && modprobe -r $module 
      3 PATTERN='\(ath_.*\|wlan_.*\|wlan\)$' 
      4  
      5 MAX_TRIES=10 
      6  
      7 fatal() 
      8
      9         echo "FATAL: $1" >&2 
      10         exit 1 
      11
      12  
      13 [ "$UID" = 0 ] || fatal "You must be root to run this script" 
      14 [ -r /proc/modules ] || fatal "Cannot read /proc/modules" 
      15  
      16 tries="$MAX_TRIES" 
      17 while [ "$tries" != "0" ]; do 
      18         skipped=0 
      19         cat /proc/modules | while true; do 
      20                 read -r name size use_count use_name state trailer || \ 
      21                         exit "$skipped" 
      22  
      23                 expr "$name" : "$PATTERN" >/dev/null || continue 
      24  
      25                 # Compatibility for Linux 2.4.x 
      26                 [ "$state" = "" ] && { use_name="-"; state="Live"; } 
      27  
      28                 if [ "$state" != "Live" ] || [ "$use_count" != "0" ] || \ 
      29                    [ "$use_name" != "-" ]; then 
      30                         skipped=1 
      31                         if [ "$tries" = "1" ]; then 
      32                                 echo "Cannot unload \"$name\"" >&2 
      33                         fi 
      34                         continue 
      35                 fi 
      36  
      37                 echo "Unloading \"$name\"" 
      38                 sync    # to be safe 
      39                 /sbin/rmmod "$name" || fatal "cannot unload module \"$name\"" 
      40                 sync    # to be even safer 
      41         done 
      42         skipped="$?" 
      43         [ "$skipped" = "0"  ] && break 
      44         tries=$(($tries - 1)) 
    6 45 done 
      46  
      47  
      48  
      49  
      50  
      51  
      52