OpenWrt – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | #!/bin/sh |
2 | |||
3 | # For AR9220 and AR9223, GPIO JTAG must explicit be disabled |
||
4 | # before LEDs start working. Do this when wifi device is |
||
5 | # detected. |
||
6 | |||
7 | # |
||
8 | # $DEVPATH is not valid for some boards (including WZR-HP-AG300H). |
||
9 | # Manipulate the $DEVPATH to reach the corresponding phyN. |
||
10 | # |
||
11 | |||
12 | devdir=$(dirname $DEVPATH) |
||
13 | devdir=$(dirname $devdir) |
||
14 | phydir=/sys$devdir/ieee80211 |
||
15 | phyname=$(cat $phydir/phy*/name) |
||
16 | |||
17 | [ -z $phyname -o $ACTION != "add" ] && exit 0 |
||
18 | |||
19 | # |
||
20 | # ar922x_disable_gpio_jtag(): |
||
21 | # |
||
22 | # Emulate |
||
23 | # REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE); |
||
24 | # for AR9220 and AR9223. |
||
25 | # |
||
26 | |||
27 | ar922x_disable_gpio_jtag() { |
||
28 | local regidx=0x4054 |
||
29 | |||
30 | [ -f /sys/kernel/debug/ieee80211/$1/ath9k/regidx ] || return |
||
31 | |||
32 | echo $regidx > /sys/kernel/debug/ieee80211/$1/ath9k/regidx |
||
33 | regval=$(cat /sys/kernel/debug/ieee80211/$1/ath9k/regval) |
||
34 | regval=$((regval | 0x20000)) |
||
35 | echo regval $regval |
||
36 | echo $regval > /sys/kernel/debug/ieee80211/$1/ath9k/regval |
||
37 | } |
||
38 | |||
39 | [ $phyname -a $ACTION = "add" ] && { |
||
40 | . /lib/functions.sh |
||
41 | |||
42 | case $(board_name) in |
||
43 | wzr-hp-ag300h) |
||
44 | ar922x_disable_gpio_jtag $phyname |
||
45 | ;; |
||
46 | esac; |
||
47 | } |
||
48 | |||
49 | exit 0 |