65
65
# Change the bus from 'acpi' to 'pnp' for some devices
66
66
if PNP_RE.match(self._environment.get("MODALIAS", "")) \
67
67
and self.path.endswith(":00"):
70
70
# Change the bus from 'block' to parent
71
71
if self._environment.get("DEVTYPE") == "disk" and self._stack:
96
96
if class_id == Pci.BASE_CLASS_NETWORK:
97
97
if subclass_id == Pci.CLASS_NETWORK_WIRELESS:
102
102
if class_id == Pci.BASE_CLASS_DISPLAY:
103
103
if subclass_id == Pci.CLASS_DISPLAY_VGA:
108
108
if class_id == Pci.BASE_CLASS_SERIAL \
109
109
and subclass_id == Pci.CLASS_SERIAL_USB:
112
112
if class_id == Pci.BASE_CLASS_STORAGE:
113
113
if subclass_id == Pci.CLASS_STORAGE_SCSI:
116
116
if subclass_id == Pci.CLASS_STORAGE_IDE:
119
119
if subclass_id == Pci.CLASS_STORAGE_FLOPPY:
122
122
if subclass_id == Pci.CLASS_STORAGE_RAID:
125
125
if class_id == Pci.BASE_CLASS_COMMUNICATION \
126
126
and subclass_id == Pci.CLASS_COMMUNICATION_MODEM:
129
129
if class_id == Pci.BASE_CLASS_INPUT \
130
130
and subclass_id == Pci.CLASS_INPUT_SCANNER:
133
133
if class_id == Pci.BASE_CLASS_MULTIMEDIA:
134
134
if subclass_id == Pci.CLASS_MULTIMEDIA_VIDEO:
137
137
if subclass_id == Pci.CLASS_MULTIMEDIA_AUDIO \
138
138
or subclass_id == Pci.CLASS_MULTIMEDIA_AUDIO_DEVICE:
141
141
if class_id == Pci.BASE_CLASS_SERIAL \
142
142
and subclass_id == Pci.CLASS_SERIAL_FIREWIRE:
145
145
if class_id == Pci.BASE_CLASS_BRIDGE \
146
146
and (subclass_id == Pci.CLASS_BRIDGE_PCMCIA \
147
147
or subclass_id == Pci.CLASS_BRIDGE_CARDBUS):
150
150
if "TYPE" in self._environment and "INTERFACE" in self._environment:
151
151
interface_class, interface_subclass, interface_protocol = (
152
152
int(i) for i in self._environment["INTERFACE"].split("/"))
154
154
if interface_class == Usb.BASE_CLASS_AUDIO:
157
157
if interface_class == Usb.BASE_CLASS_PRINTER:
160
160
if interface_class == Usb.BASE_CLASS_STORAGE:
161
161
if interface_subclass == Usb.CLASS_STORAGE_FLOPPY:
164
164
if interface_subclass == Usb.CLASS_STORAGE_SCSI:
167
167
if interface_class == Usb.BASE_CLASS_VIDEO:
170
170
if interface_class == Usb.BASE_CLASS_WIRELESS:
171
171
if interface_protocol == Usb.PROTOCOL_BLUETOOTH:
176
176
if "KEY" in self._environment:
177
177
key = self._environment["KEY"].strip("=")
181
181
if not test_bit(i, bitmask, self._bits):
186
186
if test_bit(Input.BTN_TOUCH, bitmask, self._bits):
189
189
if test_bit(Input.BTN_MOUSE, bitmask, self._bits):
192
192
if "ID_TYPE" in self._environment:
193
193
id_type = self._environment["ID_TYPE"]
195
195
if id_type == "cd":
198
198
if id_type == "disk":
201
201
if id_type == "video":
204
204
if "DEVTYPE" in self._environment:
205
205
devtype = self._environment["DEVTYPE"]
206
206
if devtype == "disk":
207
207
if "ID_CDROM" in self._environment:
210
210
if "ID_DRIVE_FLOPPY" in self._environment:
213
213
if devtype == "scsi_device":
214
214
match = SCSI_RE.match(self._environment.get("MODALIAS", ""))
217
217
# Check FLASH drives, see /lib/udev/rules.d/80-udisks.rules
218
218
if type in (0, 7, 14) \
219
219
and not any(d.driver == "rts_pstor" for d in self._stack):
228
228
if type in (4, 5):
237
237
if "DRIVER" in self._environment:
238
238
if self._environment["DRIVER"] == "floppy":