Add a new kernel-version independent broadcom binary driver for brcm47xx (contributed...
[openwrt.git] / package / broadcom-wl / files / etc / hotplug.d / net / 20-broadcom_wds
1 include /lib/wifi
2
3 setup_broadcom_wds() {
4 local iface="$1"
5 local remote="$(wlc ifname "$iface" wdsmac)"
6
7 [ -z "$remote" ] && return
8
9 config_cb() {
10 [ -z "$CONFIG_SECTION" ] && return
11
12 config_get type "$CONFIG_SECTION" TYPE
13 [ "$type" = "wifi-iface" ] || return
14
15 config_get network "$CONFIG_SECTION" network
16 [ -z "$network" ] && return
17
18 config_get addr "$CONFIG_SECTION" bssid
19 addr=$(echo "$addr" | tr 'A-F' 'a-f')
20 [ "$addr" = "$remote" ] && {
21 local cfg="$CONFIG_SECTION"
22
23 include /lib/network
24 scan_interfaces
25
26 setup_interface "$iface" "$network"
27
28 config_get encryption "$cfg" encryption
29 config_get key "$cfg" key
30 config_get ssid "$cfg" ssid
31
32 [ "$encryption" != "none" ] && {
33 sleep 5
34 case "$encryption" in
35 psk|PSK)
36 nas4not "$network" "$iface" up auto tkip psk "$key" "$ssid"
37 ;;
38 psk2|PSK2)
39 nas4not "$network" "$iface" up auto aes psk "$key" "$ssid"
40 ;;
41 psk+psk2|psk2+psk|PSK+PSK2|PSK2+PSK)
42 nas4not "$network" "$iface" up auto aes+tkip psk "$key" "$ssid"
43 ;;
44 *)
45 nas4not lan "$iface" up auto aes "$encryption" "$key" "$ssid"
46 ;;
47 esac
48 }
49 }
50 }
51
52 config_load wireless
53 }
54
55 case "$ACTION" in
56 add|register)
57 [ "${INTERFACE%%0.*}" = wds ] && setup_broadcom_wds "$INTERFACE"
58 ;;
59 esac
This page took 0.051098 seconds and 5 git commands to generate.