aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--com32/lua/doc/syslinux.asc35
1 files changed, 6 insertions, 29 deletions
diff --git a/com32/lua/doc/syslinux.asc b/com32/lua/doc/syslinux.asc
index dac8cee3..87dbb662 100644
--- a/com32/lua/doc/syslinux.asc
+++ b/com32/lua/doc/syslinux.asc
@@ -199,38 +199,15 @@ _Example_:
......................................................
local pci = require "pci"
--- get nice output
-printf = function(s,...)
- return io.write(s:format(...))
- end
-
--- get device info
-pciinfo = pci.getinfo()
-
--- get plain text device description
pciids = pci.getidlist("/pci.ids")
--- list all pci busses
-for dind,device in pairs(pciinfo) do
-
- -- search for device description
- search = string.format("%04x%04x", device.vendor, device.product)
-
- printf(" %04x:%04x:%04x:%04x = ", device.vendor, device.product,
- device.sub_vendor, device.sub_product)
-
- if ( pciids[search] ) then
- printf("%s\n", pciids[search])
- else
- printf("Unknown\n")
- end
+for dind, device in pairs (pci.getinfo()) do
+ local vendor = string.format ("%04x", device.vendor)
+ local main_id = vendor .. string.format ("%04x", device.product)
+ local sub_id = string.format ("%04x%04x", device.sub_vendor, device.sub_product)
+ io.write (string.format ("%s:%s = %s %s (%s)\n", main_id, sub_id, pciids[vendor],
+ pciids[main_id], pciids[main_id .. sub_id] or "unknown subdevice"))
end
-
--- print(pciids["8086"])
--- print(pciids["10543009"])
--- print(pciids["00700003"])
--- print(pciids["0070e817"])
--- print(pciids["1002437a1002437a"])
......................................................