3a2a57bc1e8e473ad8f7c36cf85f17b54acf765c
[openwrt/staging/yousong.git] / target / linux / cns3xxx / base-files / etc / init.d / netdev-cpu
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 set_irq_affinity gig_switch 2
20 set_irq_affinity gig_stat 2
21 }