OpenWrt – Blame information for rev 2

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 #!/bin/sh /etc/rc.common
2  
3 START=99
4  
5 get_irq() {
6 local name="$1"
7 grep -m 1 "$name" /proc/interrupts | cut -d: -f1 | sed 's, *,,'
8 }
9  
10 set_irq_affinity() {
11 local name="$1"
12 local val="$2"
13 local irq="$(get_irq "$name")"
14 [ -n "$irq" ] || return
15 echo "$val" > "/proc/irq/$irq/smp_affinity"
16 }
17  
18 start() {
19 if grep -q 'processor.*: 2' /proc/cpuinfo; then
20 mask1=4
21 mask2=8
22 elif grep -q 'processor.*: 1' /proc/cpuinfo; then
23 mask1=2
24 mask2=2
25 else
26 return
27 fi
28  
29 set_irq_affinity mt76x2e $mask1
30 set_irq_affinity mt7603e $mask2
31 }