-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path51-mist.rules
128 lines (116 loc) · 8.09 KB
/
51-mist.rules
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# mist udev rules for switching supported USB devices into a modem.
# Run after 50-udev-default.rules and before 60-persistent-*.rules.
# TODO(benchan): Generate this file as part of the build process.
# Extract the vendor/product IDs of supported devices from default.conf and
# create corresponding udev rules in this file.
# If MIST_SUPPORTED_DEVICE is set to 1, the device has already been handled once
# due to a prior udev add or change event.
ENV{MIST_SUPPORTED_DEVICE}=="1", GOTO="mist_end"
ACTION!="add|change", GOTO="mist_end"
#-------------------------------------------------------------------------------
# Supported USB devices after switching into a modem
SUBSYSTEM!="usb|tty", GOTO="mist_end"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1001", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1400", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1406", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="140b", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="140c", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1412", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="141b", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1432", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1433", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1436", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14ac", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14cf", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14db", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1506", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="150a", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="150f", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1511", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1576", GOTO="mist_mark_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1c1e", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0015", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0017", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0022", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0104", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0117", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1008", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1010", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1173", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1177", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1181", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1203", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1254", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1525", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1589", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2003", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="900b", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="ffe9", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="fff1", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="fffe", GOTO="mist_mark_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="ffff", GOTO="mist_mark_device"
ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9605", GOTO="mist_mark_device"
ATTRS{idVendor}=="2001", ATTRS{idProduct}=="7d01", GOTO="mist_mark_device"
ATTRS{idVendor}=="2001", ATTRS{idProduct}=="7d0c", GOTO="mist_mark_device"
ATTRS{idVendor}=="2020", ATTRS{idProduct}=="4010", GOTO="mist_mark_device"
# The following devices are Ethernet adapters in "Vendor Mode".
ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="a101", ATTR{bInterfaceClass}=="ff", GOTO="mist_mark_device"
ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="8152", ATTR{bInterfaceClass}=="ff", GOTO="mist_mark_device"
ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="8153", ATTR{bInterfaceClass}=="ff", GOTO="mist_mark_device"
ATTRS{idVendor}=="13b1", ATTRS{idProduct}=="0041", ATTR{bInterfaceClass}=="ff", GOTO="mist_mark_device"
#-------------------------------------------------------------------------------
# Supported USB devices before switching into a modem
SUBSYSTEM!="usb", GOTO="mist_end"
ENV{DEVTYPE}!="usb_device", GOTO="mist_end"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1446", GOTO="mist_switch_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14fe", GOTO="mist_switch_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1505", GOTO="mist_switch_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1526", GOTO="mist_switch_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="15ca", GOTO="mist_switch_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f01", GOTO="mist_switch_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f15", GOTO="mist_switch_device"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f17", GOTO="mist_switch_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0013", GOTO="mist_switch_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0040", GOTO="mist_switch_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0101", GOTO="mist_switch_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0154", GOTO="mist_switch_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1007", GOTO="mist_switch_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1009", GOTO="mist_switch_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1171", GOTO="mist_switch_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1175", GOTO="mist_switch_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1179", GOTO="mist_switch_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1201", GOTO="mist_switch_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1237", GOTO="mist_switch_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1523", GOTO="mist_switch_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1588", GOTO="mist_switch_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2000", GOTO="mist_switch_device"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="fff5", GOTO="mist_switch_device"
ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="f000", GOTO="mist_switch_device"
ATTRS{idVendor}=="2001", ATTRS{idProduct}=="a403", GOTO="mist_switch_device"
ATTRS{idVendor}=="2001", ATTRS{idProduct}=="a706", GOTO="mist_switch_device"
ATTRS{idVendor}=="2020", ATTRS{idProduct}=="0002", GOTO="mist_switch_device"
# The following devices are Ethernet adapters in USB Storage mode.
ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="a100", ATTR{bInterfaceClass}=="08", GOTO="mist_switch_device"
ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="8151", ATTR{bInterfaceClass}=="08", GOTO="mist_switch_device"
ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="8152", ATTR{bInterfaceClass}=="08", GOTO="mist_switch_device"
ATTRS{idVendor}=="13b1", ATTRS{idProduct}=="0040", ATTR{bInterfaceClass}=="08", GOTO="mist_switch_device"
GOTO="mist_end"
#-------------------------------------------------------------------------------
# Invoke mist to switch a supported USB device into a modem. mist needs to run
# as a daemon in order to monitor udev events to determine when the device is
# switched into a modem.
LABEL="mist_switch_device"
RUN+="/usr/bin/mist --daemon switch %S%p"
# Fall through to "mist_mark_device"
#-------------------------------------------------------------------------------
# If this device is a 'usb_device' device, set MIST_SUPPORTED_DEVICE to 1 to
# tell cros-disks to hide it from being auto-mounted. If this device is a 'tty'
# device, set MIST_SUPPORTED_DEVICE to 1 to tell 52-mm-modem-permissions.rules
# to set the right permissions on it.
LABEL="mist_mark_device"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{MIST_SUPPORTED_DEVICE}="1"
SUBSYSTEM=="tty", ENV{MIST_SUPPORTED_DEVICE}="1"
LABEL="mist_end"