Changeset 41873


Ignore:
Timestamp:
2014-07-29T11:48:07+02:00 (4 years ago)
Author:
jow
Message:

mac80211: support wildcard paths when matching phys

This change introduces support for wildcard patterns in "option path"
of section "wifi-device".

Objective is to allow paths like "*/usb[0-9]/*/*" in order to claim
any usb device using the same backend type, regardless of its bus
address or phy name.

Signed-off-by: Jo-Philipp Wich <jow@…>

Location:
trunk/package/kernel/mac80211/files/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh

    r41557 r41873  
    365365find_phy() { 
    366366        [ -n "$phy" -a -d /sys/class/ieee80211/$phy ] && return 0 
    367         [ -n "$path" -a -d "/sys/devices/$path/ieee80211" ] && { 
    368                 phy="$(ls /sys/devices/$path/ieee80211 | grep -m 1 phy)" 
    369                 [ -n "$phy" ] && return 0 
     367        [ -n "$path" ] && { 
     368                for phy in /sys/devices/$path/ieee80211/phy*; do 
     369                        [ -e "$phy" ] && { 
     370                                phy="${phy##*/}" 
     371                                return 0 
     372                        } 
     373                done 
    370374        } 
    371375        [ -n "$macaddr" ] && { 
  • trunk/package/kernel/mac80211/files/lib/wifi/mac80211.sh

    r40711 r41873  
    99        local devpath 
    1010        config_get devpath "$device" path 
    11         [ -n "$devpath" -a -d "/sys/devices/$devpath/ieee80211" ] && { 
    12                 phy="$(ls /sys/devices/$devpath/ieee80211 | grep -m 1 phy)" 
    13                 [ -n "$phy" ] && return 
     11        [ -n "$devpath" ] && { 
     12                for _phy in /sys/devices/$devpath/ieee80211/phy*; do 
     13                        [ -e "$_phy" ] && { 
     14                                phy="${_phy##*/}" 
     15                                return 
     16                        } 
     17                done 
    1418        } 
    1519 
Note: See TracChangeset for help on using the changeset viewer.