Skip to content

Commit

Permalink
Add nvme flag and audio flag
Browse files Browse the repository at this point in the history
  • Loading branch information
HikariKnight committed Jan 7, 2024
1 parent 899ed0c commit be8b46b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ func main() {
iommu.PrintOutput(output, pArg)
os.Exit(0)

} else if pArg.Flag["nvme"] {
// Get all Ethernet controllers
output := iommu.MatchSubclass(`Non-Volatile memory controller`, pArg)

// Print the output and exit
iommu.PrintOutput(output, pArg)
os.Exit(0)

} else if pArg.Flag["audio"] {
// Get all Ethernet controllers
output := iommu.MatchSubclass(`Audio device`, pArg)

// Print the output and exit
iommu.PrintOutput(output, pArg)
os.Exit(0)

} else if len(pArg.IntList["iommu_group"]) > 0 {
// Get all devices in specified IOMMU groups and append it to the output
output := iommu.GetDevicesFromGroups(pArg.IntList["iommu_group"], pArg.FlagCounter["related"], pArg)
Expand Down
12 changes: 12 additions & 0 deletions pkg/params/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ func NewParams() *Params {
Help: "List all SATA controllers. (use -i # to only display results from specified IOMMU group)",
})

nvme := parser.Flag("", "nvme", &argparse.Options{
Required: false,
Help: "List all NVM controllers. (use -i # to only display results from specified IOMMU group)",
})

audio := parser.Flag("", "audio", &argparse.Options{
Required: false,
Help: "List all Audio devices. (use -i # to only display results from specified IOMMU group)",
})

iommu_group := parser.IntList("i", "group", &argparse.Options{
Required: false,
Help: "List everything in the IOMMU groups given. Supply argument multiple times to list additional groups.",
Expand Down Expand Up @@ -139,6 +149,8 @@ func NewParams() *Params {
pArg.addFlag("usb", *usb)
pArg.addFlag("nic", *nic)
pArg.addFlag("sata", *sata)
pArg.addFlag("nvme", *nvme)
pArg.addFlag("audio", *audio)
pArg.addFlagCounter("related", *related)
pArg.addStringList("ignore", *ignore)
pArg.addIntList("iommu_group", *iommu_group)
Expand Down

0 comments on commit be8b46b

Please sign in to comment.