summaryrefslogtreecommitdiffstats
path: root/kernel/list_modules.pm
blob: f0ee315ecc05c77bcf5546d78f993f3941db2a63 (plain)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
package list_modules;

use MDK::Common;

our @ISA = qw(Exporter);
our @EXPORT = qw(load_dependencies dependencies_closure category2modules module2category sub_categories);

# the categories have 2 purposes
# - choosing modules to include on stage1's (cf update_kernel and mdk-stage1/pci-resource/update-pci-ids.pl)
# - performing a load_category or probe_category (detect_devices.pm and many files in perl-install)

our %l = (
  ################################################################################
  network => 
  {
    atm => [ qw(eni fore_200e he idt77252 iphase lanai solos-pci) ],
    main => [
        qw(acenic altera_tse amd8111e atl2 atp ax88796c),
        qw(cassini cx82310_eth),
        qw(dmfe ec_bhf enic),
        qw(fm10k funeth genet i40e iavf ice),
        qw(jme nfp mv88e6060),
        qw(r6040),
        qw(sc92031 smsc911x smsc9420),
        qw(tlan uli526x ),
        qw(b44 com20020-pci de2104x),
        qw(defxx), # most unused
        qw(e100 epic100 fealnx hamachi mana mlxsw_pci natsemi),
        qw(ne2k-pci pcnet32 plip qede sis900 skfp starfire stmmac-platform tulip),
        qw(typhoon via-rhine winbond-840 xilinx_emac forcedeth),
        qw(sungem sunhme), # drivers for ultrasparc, but compiled in ix86 kernels...
      qw(3c59x 8139too 8139cp niu sundance), #rtl8139
      # add all phys
      qw(adin adin1100 air_en8811h amd aquantia as21xxx at803x ax88796b bcm54140 bcm7xxx bcm84881 bcm87xx broadcom),
      qw(cicada cortina davicom dp83640 dp83822 dp83848 dp83867 dp83869 dp83tc811 dp83td510 dp83tg720 et1011c),
      qw(fixed_phy icplus intel-xway lxt macb macb_pci marvell marvell10g marvell-88q2xxx marvell-88x2222),
      qw(mdio-bcm-unimac mdio-bitbang mdio-cavium mdio_devres mdio-gpio mdio-i2c mdio-thunder micrel),
      qw(microchip microchip_t1 microchip_t1s motorcomm mscc mtk-ge mxl-86110 mxl-gpy national ncn26000),
      qw(nxp-c45-tja nxp-cbtx nxp-tja11xx phylink phy-bcm-kona-usb2 phy-cpcap-usb phy-exynos-usb2),
      qw(phy-intel-lgm-emmc phy-can-transceiver phy-lgm-usb phy-pxa-28nm-hsic phy-pxa-28nm-usb2),
      qw(phy-qcom-usb-hs phy-qcom-usb-hsic phy-tusb1210 qca808x qca83xx qsemi r8152 r8153_ecm realtek),
      qw(rockchip sfp smsc ste10Xp teranetics uPD60620 vitesse xilinx_gmii2rgmii),
    ],
    firewire => [ ],
    gigabit => [
      qw(amd-xgbe alx atl1 atl1c atl1e atlantic ax88179_178a bcmsysport be2net bna bng_en bnx2 bnx2x bnxt_en),
      qw(cxgb cxgb3 cxgb4 dl2k dwc-xlgmac e1000 e1000e et131x gve hibmcge hinic hinic3 hfi1 igb igc ionic ixgbe),
      qw(lan78xx liquidio liquidio_vf macb mlx4_core mlx4_en mlx5_core mvmdio myri10ge netxen_nic ngbe nicpf nixge),
      qw(ns83820 octeon_ep qla3xxx qlcnic r8169 s2io samsung-sxgbe sfc sfc-falcon sfc-siena sis190 skge sky2 slicoss),
      qw(stmmac tehuti tn40xx tg3 txgbe via-velocity yellowfin),
    ],

    raw => [
      qw(ppp_generic ppp_async ppp_deflate bsd_comp mhi_pci_generic thunderbolt_net),
    ],
    pcmcia => [ 
      qw(3c574_cs 3c589_cs axnet_cs fmvj18x_cs),
      qw(nmclan_cs pcnet_cs smc91c92_cs),
      qw(xirc2ps_cs xircom_cb),
    ],
   #- generic NIC detection for USB seems broken (class, subclass, 
   #- protocol reported are not accurate) so we match network adapters against
   #- known drivers :-(
    usb => [ 
      qw(aqc111 asix catc cdc_ether ch9200 dm9601 huawei_cdc_ncm kaweth mcs7830 pegasus rtl8150 smsc75xx smsc95xx usbnet),
    ],
    wireless => [
      qw(adm8211 ar5523 at76c50x-usb ath10k_pci ath10k_sdio ath10k_usb ath11k_pci ath12k),
      qw(ath5k ath6kl_sdio ath6kl_usb ath9k ath9k_htc ath9k_pci_owl_loader),
      qw(b43 b43legacy bcma brcmsmac brcmfmac carl9170 com20020_cs),
      qw(ipw2100 ipw2200 iwl3945 iwl4965 iwldvm iwlmvm iwlwifi libertas_spi libertas_tf_usb),
      qw(mt76x2e mt76x2u mt7601u mt76x0e mt76x0u mt7603e mt7615e mt7663u mt7915e),
      qw(mt7921e mt7921s mt7921u mt7925e mt7925u mwifiex_pcie mwifiex_sdio mwifiex_usb mwl8k),
      qw(p54pci p54spi p54usb plfxlc qmi_wwan qtnfmac qtnfmac_pcie),
      qw(r8723bs rsi_sdio rsi_usb rt2400pci rt2500pci rt2500usb rt2800pci rt2800usb),
      qw(rt61pci rt73usb rtl8187 rtl8188ee rtl818x_pci rtl8192ce rtl_pci rtl_usb),
      qw(rtw88_8723d rtw88_8723de rtw88_8723du),
      qw(rtw88_8812au rtw88_8814ae rtw88_8814au),
      qw(rtw88_8821au rtw88_8821ce rtw88_8821cs rtw88_8821cu),
      qw(rtw88_8822be rtw88_8822bs rtw88_8822bu rtw88_8822ce rtw88_8822cs rtw88_8822cu rtw88_8723ds),
      qw(rtw89_8851be rtw89_8851bu rtw89_8852ae rtw89_8852be rtw89_8852bte rtw89_8852bu rtw89_8852ce rtw89_8922ae),
      qw(rtl8192cu rtl8192de rtl8192du rtl8192ee rtl8192se rtl8723ae rtl8723be rtl8821ae rtl8xxxu),
      qw(sr9700 sr9800 ssb usb8xxx wcn36xx wfx wil6210 wilc1000-sdio),
      qw(wl wl1251_sdio wl1251_spi wl12xx wl18xx wlcore_sdio zd1211rw),
    ],
    isdn => [
      qw(avmfritz cdc-acm hfcpci hfcmulti hfcsusb mISDNinfineon netjet), # mISDN
    ],
    cellular => [
      qw(cdc_mbim hso nozomi option sierra),
    ],
    modem => [
      qw(mwave),
    ],
    slmodem => [
      qw(snd-ali5451 snd-atiixp-modem snd-intel8x0m snd-via82xx-modem),
    ],
    wan => [ qw(farsync hdlc lapbether pci200syn wanxl) ],
    usb_dsl => [ qw(cxacru speedtch ueagle-atm usbatm xusbatm) ],
    virtual => [ qw(ena hv_netvsc i2c-virtio virtio-iommu virtio_net virtio_pci_modern_dev vmxnet3 xen-netfront) ],
  },

  ################################################################################
  disk => 
  {
    scsi => [
        qw(a100u2w advansys am53c974 atp870u),
        qw(be2iscsi bfa BusLogic dc395x dmx3191d),
        qw(efct fdomain fdomain_pci initio mpt3sas mvsas myrb myrs),
        qw(pm80xx qla1280 qla2xxx),
        qw(snic stex),
        qw(xen-scsiback xen-scsifront),
        qw(aic7xxx aic79xx qlogicfas408 sym53c8xx wd719x lpfc),
    ],
    sata => [
      # note that ata_piix manage RAID devices on ICH6R
      qw(ahci ahci_dwc aic94xx ata_piix pata_pdc2027x pdc_adma),
      qw(sata_dwc_460ex sata_inic162x sata_mv sata_nv sata_promise),
      qw(sata_qstor sata_sil sata_sil24 sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc),
      # new drivers: old ide drivers ported over libata:
      qw(ata_generic pata_ali pata_amd pata_artop pata_atiixp pata_atp867x),
      qw(pata_cmd640 pata_cmd64x),
      qw(pata_cypress pata_efar pata_hpt366),
      qw(pata_hpt37x pata_hpt3x2n pata_hpt3x3),
      qw(pata_it8213 pata_it821x pata_jmicron pata_legacy pata_marvell),
      qw(pata_mpiix pata_netcell pata_ninja32 pata_ns87410),
      qw(pata_ns87415 pata_oldpiix pata_opti pata_optidma),
      qw(pata_pdc2027x pata_pdc202xx_old pata_piccolo),
      qw(pata_radisys pata_rdc pata_rz1000 pata_sch),
      qw(pata_serverworks pata_sil680 pata_sis pata_sl82c105),
      qw(pata_triflex pata_via),
      qw(pata_acpi),
    ],
    hardware_raid => [
        # 3w-xxxx drives ATA-RAID, 3w-9xxx and arcmsr drive SATA-RAID
        qw(3w-9xxx 3w-sas 3w-xxxx aacraid arcmsr),
        qw(csiostor esas2r hpsa hptiop imm ipr ips isci),
        qw(megaraid megaraid_mbox),
        qw(megaraid_sas mptfc mptsas mptscsih mptspi pmcraid ppa),
        qw(qla2xxx qla4xxx smartpqi),
    ],
    virtual => [ qw(hv_storvsc virtio_blk virtio_scsi vmw_pvscsi xen-blkfront) ],
    pcmcia => [ qw(aha152x_cs fdomain_cs qlogic_cs pata_pcmcia sym53c500_cs) ],
    pcie => [ qw(mtip32xx) ],
    raw => [ qw(sd_mod) ],
    usb => [ qw(uas ums-alauda ums-cypress ums-datafab ums-eneub6250 ums-freecom ums-isd200),
	     qw(ums-jumpshot ums-karma ums-onetouch ums-realtek ums-sddr09 ums-sddr55 ums-usbat usb-storage) ],
    firewire => [ qw(firewire-sbp2) ],
    cdrom => [ qw(sr_mod) ],
    card_reader => [ qw(rtsx_pci rtsx_usb sdhci sdhci-pci tifm_sd tifm_7xx1 toshsd ushc via-sdmmc) ],
  },

  ################################################################################

  bus => 
  {
    usb => [ qw(bcma-hcd c67x00 dwc3-haps dwc3 dwc3-pci ehci-hcd ehci-pci ehci-platform
		isp116x-hcd ohci-hcd ohci-pci ohci-platform oxu210hp-hcd
		r8a66597-hcd sl811_cs sl811-hcd ssb-hcd
		uhci-hcd vhci-hcd xen-hcd xhci-hcd xhci-pci xhci-pci-renesas xhci-plat-hcd) ],
    bluetooth => [ qw(ath3k bcm203x bfusb bluecard_cs bpa10x bt3c_cs btintel_pcie btusb dtl1_cs hci_bcm4377) ],
    firewire => [ qw(firewire-ohci) ],
    i2c => [
      qw(i2c-algo-bit i2c-ali1535 i2c-ali1563 i2c-ali15x3 i2c-amd756 i2c-amd8111 i2c-amd-mp2-pci i2c-amd-mp2-plat i2c-i801 i2c-designware-pci i2c-nforce2),
      qw(i2c-piix4 i2c-sis5595 i2c-sis630 i2c-sis96x i2c-smbus i2c-via i2c-viapro),
    ],
    pcmcia => [
      qw(i82092 pd6729 yenta_socket), # cb_enabler
    ],
    hid => [ qw(amd_sfh ff-memless hid hid-a4tech hid-accutouch hid-alps hid-apple hid-appleir hid-appletb-bl
            hid-appletb-kbd hid-asus hid-aureal hid-axff hid-belkin hid-betopff hid-bigbenff hid-cherry hid-chicony
            hid-cmedia hid-corsair hid-corsair-void hid-cougar hid-cp2112 hid-creative-sb0540 hid-cypress hid-dr
            hid-elan hid-elecom hid-elo hid-emsff hid-evision hid-ezkey hid-gaff hid-gembird hid-generic hid-gfrm
            hid-glorious hid-google-hammer hid-google-stadiaff hid-gt683r hid-gyration hid-holtek-kbd hid-holtekff
            hid-holtek-mouse hid-hyperv hid-icade hid-ite hid-jabra hid-kensington hid-keytouch hid-kye hid-kysona
            hid-lcpower hid-led hid-lenovo hid-letsketch hid-lg-g15 hid-logitech hid-logitech-dj hid-logitech-hidpp
            hid-macally hid-magicmouse hid-maltron hid-megaworld hid-mf hid-microsoft hid-monterey hid-multitouch
            hid-nintendo hid-ntrig hid-nvidia-shield hid-ortek hid-penmount hid-petalynx hid-picolcd hid-pl
            hid-plantronics hid-playstation hid-primax hid-prodikeys hid-pxrc hid-razer hid-redragon hid-retrode
            hid-roccat hid-roccat-arvo hid-roccat-common hid-rmi hid-roccat-isku hid-roccat-kone hid-roccat-koneplus
            hid-roccat-konepure hid-roccat-kovaplus hid-roccat-lua hid-roccat-pyra hid-roccat-ryos hid-roccat-savu
            hid-saitek hid-samsung hid-semitek hid-sensor-hub hid-sensor-accel-3d hid-sensor-gyro-3d hid-sensor-trigger
            hid-sigmamicro hid-sjoy hid-sony hid-speedlink hid-steam hid-steelseries hid-sunplus hid-thrustmaster
            hid-tivo hid-tmff hid-topre hid-topseed hid-twinhan hid-u2fzero hid-uclogic hid-udraw-ps3
            hid-universal-pidff hid-viewsonic hid-vivaldi hid-vrc2 hid-waltop hid-wiimote hid-winwing hid-xiaomi
            hid-xinmo hid-zpff hid-zydacron
	    i2c-hid-acpi 
	    intel-ish-ipc intel-ishtp-hid intel-ishtp intel-ishtp-loader intel-quicki2c intel-quickspi
	    surface_hid surface_kbd wacom) ],

   #serial_cs
   #ftl_cs 3c575_cb apa1480_cb epic_cb serial_cb tulip_cb iflash2+_mtd iflash2_mtd
   #cb_enabler
  },

  fs => 
  {
    network => [ qw(af_packet nfs nfsv2 nfsv3 nfsv4) ],
    cdrom => [ qw(isofs) ],
    loopback => [ qw(isofs loop squashfs) ],
    local => [
      qw(btrfs exfat ext4 f2fs jfs nilfs2 ntfs3 vfat xfs),
    ],
    various => [ qw(efivarfs efibc capsule-loader overlay romfs ufs fuse) ],

  },

  ################################################################################
  multimedia => 
  {
    sound => [
          qw(cx88-alsa),
          qw(snd-pci-acp3x snd-ad1889 snd-ali5451 snd-als300),
          qw(snd-als4000 snd-atiixp snd-au8810 snd-au8820 snd-au8830 snd-aw2 snd-azt3328),
          qw(snd-asihpi snd-bcd2000 snd-bebob snd-bt87x snd-ca0106 snd-cmipci),
          qw(snd-cs4281 snd-cs46xx snd-ctxfi),
          qw(snd-darla20 snd-darla24 snd-echo3g snd-emu10k1 snd-emu10k1x),
          qw(snd-ens1370 snd-ens1371 snd-es1938 snd-es1968),
          qw(snd-fireworks snd-fm801 snd-gina20 snd-gina24),
          qw(snd-hda-intel snd-hdsp snd-hdspm snd-ice1712 snd-ice1724),
          qw(snd-indigo snd-indigodj snd-indigodjx snd-indigoio snd-indigoiox snd-intel8x0),
          qw(snd-korg1212 snd-layla20 snd-layla24 snd-lola snd-lx6464es),
          qw(snd-maestro3 snd-mia snd-mixart snd-mona snd-mpu401 snd-nm256),
          qw(snd-oxygen snd-pcxhr snd-pdaudiocf snd-riptide snd-rme32),
          qw(snd-rme96 snd-rme9652 snd-rn-pci-acp3x snd-rpl-pci-acp6x snd-pci-acp5x snd-pci-acp6x),
          qw(snd-soc-avs snd-soc-cs35l56-i2c snd-soc-cs35l56 snd-soc-cs35l56-sdw snd-soc-cs35l56-shared),
          qw(snd-soc-cs35l56-spi snd-soc-cs42l42-sdw snd-soc-idt821034 snd-soc-max98363 snd-soc-rt1318-sdw),
          qw(snd-soc-rt712-sdca-dmic snd-soc-rt712-sdca snd-soc-sma1303 snd-soc-avs-max98927 snd-soc-avs-probe),
          qw(snd-sof-amd-acp63 snd-sof-amd-acp70 snd-sof-amd-rembrandt snd-sof-amd-renoir snd-sof-amd-vangogh),
          qw(snd-sof-acpi-intel-bdw snd-sof-acpi-intel-byt snd-sof-intel-atom snd-sof-intel-hda-mlink),
          qw(snd-sof-pci-intel-apl snd-sof-pci-intel-cnl snd-sof-pci-intel-icl snd-sof-pci-intel-lnl),
          qw(snd-sof-pci-intel-mtl snd-sof-pci-intel-ptl snd-sof-pci-intel-skl snd-sof-pci-intel-tgl),
          qw(snd-sof-pci-intel-tng),
          qw(snd-sonicvibes snd-trident snd-usb-variax snd-via82xx snd-virtuoso snd-vx222 snd-vxpocket),
          qw(snd_xen_front snd-ymfpci soundwire-amd virtio_snd),
  ],
    tv => [ qw(bt878 bttv cx23885 cx25821 cx8800 cx8802 cx88-blackbird),
            qw(em28xx ivtv mxb pvrusb2 saa7134 saa7164) ],
    dvb => [
        qw(b2c2-flexcop-pci b2c2-flexcop-usb budget budget-av),
        qw(budget-ci dvb-usb-cinergyT2 dm1105 dvb-ttpci),
        qw(dvb-ttusb-budget dvb-usb-a800 dvb-usb-af9015 dvb-usb-ce6230),
        qw(dvb-usb-cinergyT2 dvb-usb-cxusb dvb-usb-dib0700),
        qw(dvb-usb-dibusb-mb dvb-usb-dibusb-mc dvb-usb-digitv),
        qw(dvb-usb-dtt200u dvb-usb-dtv5100 dvb-usb-ec168 dvb-usb-gp8psk),
        qw(dvb-usb-nova-t-usb2 dvb-usb-ttusb2 dvb-usb-umt-010),
        qw(dvb-usb-vp702x dvb-usb-vp7045 earth-pt1 firedtv hexium_gemini),
        qw(hexium_orion netup-unidvb pluto2 smsusb ttusb_dec),
    ],
    photo => [ qw(mdc800) ],
    radio => [ qw(radio-keene radio-ma901
	    radio-maxiradio radio-mr800 radio-raremono radio-shark
	    radio-si470x-usb radio-usb-si4713 shark2) ],
    scanner => [ qw(microtek) ],
    firewire => [ qw(snd-dice snd-firewire-digi00x snd-isight snd-oxfw snd-firewire-tascam) ],
    gameport => [ qw(emu10k1-gp fm801-gp) ],
    usb_sound => [ qw(dsbr100 snd-usb-audio snd-usb-6fire snd-usb-caiaq snd-usb-hiface snd-usb-usx2y) ],
    webcam => [
        qw(cafe_ccic cyber2000fb),
        qw(gspca_benq gspca_conex gspca_cpia1 gspca_dtcs033 gspca_etoms
        gspca_finepix gspca_gl860 gspca_jeilinj gspca_jl2005bcd
        gspca_kinect gspca_konica gspca_m5602 gspca_mars
        gspca_mr97310a gspca_nw80x gspca_ov519 gspca_ov534
        gspca_ov534_9 gspca_pac207 gspca_pac7302 gspca_pac7311
        gspca_se401 gspca_sn9c2028 gspca_sn9c20x gspca_sonixb
        gspca_sonixj gspca_spca1528 gspca_spca500 gspca_spca501
        gspca_spca505 gspca_spca506 gspca_spca508 gspca_spca561
        gspca_sq905 gspca_sq905c gspca_sq930x gspca_stk014 gspca_stk1135
        gspca_stv0680 gspca_stv06xx gspca_sunplus gspca_t613
        gspca_topro gspca_touptek gspca_tv8532 gspca_vc032x gspca_vicam
        gspca_xirlink_cit gspca_zc3xx),
        qw(pwc uvcvideo),
    ],
  },

  # USB input stuff get automagically loaded by hotplug and thus
  # magically work through /dev/input/mice multiplexing:
  input => {
      joystick => [
          qw(iforce iforce-serio iforce-usb xpad),
          # there're more drivers in drivers/input/joystick but they support non USB or PCI devices
          # and thus cannot be detected but by slow (and maybe dangerous?) load_category:
          qw(a3d adi analog cobra db9 gamecon gf2k grip grip_mp guillemot interact),
          qw(joydump magellan pxrc qwiic-joystick sidewinder spaceball spaceorb stinger tmdc turbografx warrior)
      ],
      remote => [ qw(ati_remote) ],
      # USB tablets and touchscreens:
      tablet => [ qw(acecad aiptek wacom wacom_serial4 kbtab) ],
      touchscreen => [ qw(ads7846 bu21013_ts bu21029_ts gunze mtouch sur40 usbtouchscreen) ],
  },

  various => 
  # just here for classification, unused categories (nor auto-detect, nor load_thiskind)
  {
    raid => [
      qw(dm-bio-prison dm-bufio dm-cache dm-clone dm-crypt dm-log dm-log-userspace dm-mirror dm-mod dm-multipath dm-persistent-data dm-queue-length dm-raid),
      qw(dm-region-hash dm-snapshot dm-zero linear md-mod md-mod raid0 raid10 raid1 raid456),
      # needed by raid456 and dm-raid 456 target
      qw(async_memcpy async_pq async_raid6_recov async_tx async_xor raid6_pq xor),
    ],
    mouse => [
      qw(cyapatp elan_i2c psmouse pcips2),
      qw(mousedev usbhid synaptics_usb),
    ],
    char => [
      qw(applicom nvram ppdev),
      qw(wdt_pci), #- what are these???
    ],
    crypto => [
      qw(aes_generic aesni-intel cbc ccm cryptd n5pf padlock-aes padlock-sha virtio_crypto xts),
      qw(aria-aesni-avx2-x86_64 aria-gfni-avx512-x86_64 amd-rng intel-rng),
      qw(af_alg algif_aead algif_hash algif_rng algif_skcipher),
      qw(michael_mic),
    ],
    laptop => [
    ],
    serial => [
      qw(8250_pci 8250 jsm moxa mxser),
    ],
    other => [
      qw(loop lp nbd sg st),
      qw(parport_pc parport_serial),
      qw(mmc_block sdhci-acpi), # eMMC
      'ulpi',

      # Virtualization:
      qw(hv_balloon pci-hyperv pci-hyperv-intf),
      qw(mlx5-vfio-pci),
      # Don't include vboxvideo, it doesn't work properly in stage1 or stage2 (mga#23467)
      qw(vboxsf vboxguest vmw_balloon),
      qw(nd_virtio virtio virtiofs virtio_balloon virtio_console virtio_input virtio_pci virtio_pmem virtio_ring vhost_iotlb vhost_scsi vhost_vsock hyperv-keyboard),
      qw(xen-front-pgdir-shbuf),

      'nvme',

      qw(evdev usblp floppy usb-common),
      qw(acpi-cpufreq processor),
      qw(intel-lpss intel-lpss-acpi intel-lpss-pci),
      qw(usbip-host),
      qw(vgem),

      # drivers/platform/x86:
      qw(acerhdf acer-wireless acer-wmi alienware-wmi amilo-rfkill apple-gmux asus-laptop asus-nb-wmi asus-wireless asus-wmi),
      qw(classmate-laptop compal-laptop dcdbas dell-laptop dell-pc  dell-rbtn dell-smbios dell-smo8800),
      qw(dell-wmi-aio dell-wmi-descriptor dell-wmi dell-wmi-ddv dell-wmi-led eeepc-laptop eeepc-wmi fujitsu-laptop),
      qw(fujitsu-tablet gpd-pocket-fan hdaps hp_accel hp-wmi huawei-wmi ibm_rtl ideapad-laptop),
      qw(intel-bxtwc_tmu intel-chtdc_ti_pwrbtn intel-hid intel-int0002_vgpio intel_ips intel-oaktrail),
      qw(intel-punit_ipc intel-rst intel-smartconnect intel-vbtn intel-wmi-thunderbolt lenovo-ymc lg-laptop),
      qw(mlx-platform msi-ec msi-laptop msi-wmi mxm-wmi panasonic-laptop samsung-laptop samsung-q10 sony-laptop),
      qw(surface3_power surface3-wmi surfacepro3_button system76_acpi thinkpad_acpi topstar-laptop),
      qw(toshiba_acpi toshiba_bluetooth toshiba_haps toshiba-wmi wmi-bmof wmi xiaomi-wmi),

      # drivers/platform/chrome:
      qw(chromeos_laptop),

      # drivers/staging/media/atomisp:
      qw(atomisp),

      qw(mei),
    ],
    agpgart => [
        qw(amd64-agp intel-agp),
	qw(sis-agp via-agp),
    ],
  },
);

my %moddeps;

sub load_dependencies {
    my ($file, $o_root) = @_;

    %moddeps = ();
    foreach (cat_($o_root . $file)) {
	my ($m, $d) = split ':';
	my $path = $m;
	my ($filename, @fdeps) = map {
	    s![^ ]*/!!g;
	    s!\.ko!!g;
	    s!\.[gx]z!!g;
	    $_;
	} $m, split(' ', $d);

	my ($modname, @deps) = map { filename2modname($_) } $filename, @fdeps;
	$moddeps{$modname}{deps} = \@deps;
	$moddeps{$modname}{filename} = $filename;
	if (!begins_with($path, "/")) {
		#- with newer module-init-tools, modules.dep can contain
		#- relative paths
		$path = dirname($file) . '/' . $path;
	}
 	$moddeps{$modname}{path} = $path;
    }
}

sub dependencies_closure {
    my @l = map { dependencies_closure($_) } @{exists $moddeps{$_[0]} && $moddeps{$_[0]}{deps} || []};
    (@l, $_[0]);
}

sub filename2modname {
    my ($modname) = @_;
    $modname =~ s/-/_/g;
    $modname;
}

sub load_default_moddeps() {
    require c;
    load_dependencies('/lib/modules/' . c::kernel_version() . '/modules.dep');
}

sub modname2filename {
    load_default_moddeps() if !%moddeps;
    $moddeps{$_[0]}{filename};
}

sub modname2path {
    load_default_moddeps() if !%moddeps;
    $moddeps{$_[0]}{path};
}

sub category2modules {
    map {
	my ($t1, $t2s) = m|(.*)/(.*)|;
	my @sub = $t2s eq '*' ? keys %{$l{$t1}} : split('\|', $t2s);
	map {
	    my $l = $l{$t1}{$_} or die "bad category $t1/$_\n" . backtrace();
	    map { filename2modname($_) } @$l;
	} @sub;
    } split(' ', $_[0]);
}

sub all_modules() {
    map { @$_ } map { values %$_ } values %l;
}

sub module2category {
    my ($module) = @_;
    $module = filename2modname($module);
    foreach my $t1 (keys %l) {
	my $h = $l{$t1};
	foreach my $t2 (keys %$h) {
	  $module eq filename2modname($_) and return "$t1/$t2" foreach @{$h->{$t2}};
      }
    }
    return;
}

sub ethernet_categories() {
    'network/main|gigabit|pcmcia|usb|wireless|firewire';
}

sub sub_categories {
    my ($t1) = @_;
    keys %{$l{$t1}};
}

1;