-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwifi.rc
101 lines (89 loc) · 5.58 KB
/
wifi.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# These are needed for migration of data to wifi apex directory.
on post-fs-data
restorecon_recursive /data/misc/apexdata/com.android.wifi
on property:sys.user.0.ce_available=true
restorecon_recursive /data/misc_ce/0/apexdata/com.android.wifi
# Below are for kernel tracing related stuff.
on fs
setprop sys.wifitracing.started 0
on property:sys.boot_completed=1 && property:sys.wifitracing.started=0
# Create trace buffer, and set basic configuration.
mkdir /sys/kernel/debug/tracing/instances/wifi 711
restorecon_recursive /sys/kernel/debug/tracing/instances/wifi
write /sys/kernel/debug/tracing/instances/wifi/tracing_on 0
write /sys/kernel/debug/tracing/instances/wifi/buffer_size_kb 1
write /sys/kernel/debug/tracing/instances/wifi/trace_options disable_on_free
mkdir /sys/kernel/tracing/instances/wifi 711
restorecon_recursive /sys/kernel/tracing/instances/wifi
write /sys/kernel/tracing/instances/wifi/tracing_on 0
write /sys/kernel/tracing/instances/wifi/buffer_size_kb 1
write /sys/kernel/tracing/instances/wifi/trace_options disable_on_free
# Enable cfg80211 events for connection and key management events.
# - Events are not actually logged until WifiService writes "1" to
# /sys/kernel/debug/tracing/instances/wifi/tracing_on.
# - WifiService is responsible for turning tracing off and on.
write /sys/kernel/debug/tracing/instances/wifi/events/cfg80211/cfg80211_gtk_rekey_notify/enable 1
write /sys/kernel/debug/tracing/instances/wifi/events/cfg80211/rdev_add_key/enable 1
write /sys/kernel/debug/tracing/instances/wifi/events/cfg80211/rdev_assoc/enable 1
write /sys/kernel/debug/tracing/instances/wifi/events/cfg80211/rdev_auth/enable 1
write /sys/kernel/debug/tracing/instances/wifi/events/cfg80211/rdev_connect/enable 1
write /sys/kernel/debug/tracing/instances/wifi/events/cfg80211/rdev_set_default_key/enable 1
write /sys/kernel/debug/tracing/instances/wifi/events/cfg80211/rdev_set_default_mgmt_key/enable 1
write /sys/kernel/debug/tracing/instances/wifi/events/cfg80211/rdev_set_rekey_data/enable 1
write /sys/kernel/tracing/instances/wifi/events/cfg80211/cfg80211_gtk_rekey_notify/enable 1
write /sys/kernel/tracing/instances/wifi/events/cfg80211/rdev_add_key/enable 1
write /sys/kernel/tracing/instances/wifi/events/cfg80211/rdev_assoc/enable 1
write /sys/kernel/tracing/instances/wifi/events/cfg80211/rdev_auth/enable 1
write /sys/kernel/tracing/instances/wifi/events/cfg80211/rdev_connect/enable 1
write /sys/kernel/tracing/instances/wifi/events/cfg80211/rdev_set_default_key/enable 1
write /sys/kernel/tracing/instances/wifi/events/cfg80211/rdev_set_default_mgmt_key/enable 1
write /sys/kernel/tracing/instances/wifi/events/cfg80211/rdev_set_rekey_data/enable 1
# Enable datapath events for Wifi.
# - Events are not actually logged until WifiService writes "1" to
# /sys/kernel/debug/tracing/instances/wifi/tracing_on.
# - WifiService will ensure that tracing is turned back off,
# when a connection attempt ends (whether in success or failure)
write /sys/kernel/debug/tracing/instances/wifi/events/net/filter name==${wifi.interface:-wlan0}
write /sys/kernel/debug/tracing/instances/wifi/events/net/net_dev_queue/enable 1
write /sys/kernel/debug/tracing/instances/wifi/events/net/net_dev_xmit/enable 1
write /sys/kernel/debug/tracing/instances/wifi/events/net/netif_rx/enable 1
write /sys/kernel/debug/tracing/instances/wifi/events/net/netif_receive_skb/enable 1
write /sys/kernel/tracing/instances/wifi/events/net/filter name==${wifi.interface:-wlan0}
write /sys/kernel/tracing/instances/wifi/events/net/net_dev_queue/enable 1
write /sys/kernel/tracing/instances/wifi/events/net/net_dev_xmit/enable 1
write /sys/kernel/tracing/instances/wifi/events/net/netif_rx/enable 1
write /sys/kernel/tracing/instances/wifi/events/net/netif_receive_skb/enable 1
# Set DAC to allow system to enable/disable, and read wifi trace
# events.
chown system /sys/kernel/debug/tracing/instances/wifi/tracing_on
chown system /sys/kernel/debug/tracing/instances/wifi/free_buffer
chown system /sys/kernel/debug/tracing/instances/wifi/trace
chmod 200 /sys/kernel/debug/tracing/instances/wifi/tracing_on
chmod 400 /sys/kernel/debug/tracing/instances/wifi/free_buffer
chmod 600 /sys/kernel/debug/tracing/instances/wifi/trace
chown system /sys/kernel/tracing/instances/wifi/tracing_on
chown system /sys/kernel/tracing/instances/wifi/free_buffer
chown system /sys/kernel/tracing/instances/wifi/trace
chmod 200 /sys/kernel/tracing/instances/wifi/tracing_on
chmod 400 /sys/kernel/tracing/instances/wifi/free_buffer
chmod 600 /sys/kernel/tracing/instances/wifi/trace
setprop sys.wifitracing.started 1
on property:sys.boot_completed=1 && property:wifi.interface=* && property:sys.wifitracing.started=1
# Override default value.
write /sys/kernel/debug/tracing/instances/wifi/events/net/filter name==${wifi.interface}
write /sys/kernel/tracing/instances/wifi/events/net/filter name==${wifi.interface}