Hello! > This turns out to be moderately hard since you have to use lspci to find > the capability location, then look up the capability offset in the PCI > spec, do the arithmetic and so on. > > One way we could make this easier is to allow symbolic names to > refer to offsets from the starts of capabilities. [...] > First things first, though, > is this an interesting feature to add? An ability to address capabilities would be very welcome. On the other hand, I think that it should not be limited to capabilities hard-wired in setpci. Here is a sketch of a possible syntax: <reg> = <base>[+<number>][.(B|W|L)] <-- can specify an offset <base> = <number> <-- absolute position | <named-register> <-- can be a part of a capability, too | CAP_<name> <-- named capability | ECAP_<name> <-- named PCIe capability | CAP<number> <-- capability specified by its number | ECAP<number> <-- the same for PCIe (Offset addressing is not limited to capabilities intentionally, so that it is for example possible to access a part of a named register. Also, I have lifted the restriction that the explicit width must match the known width of a named register.) Does it make sense? Have a nice fortnight -- Martin `MJ' Mares <mj@xxxxxx> http://mj.ucw.cz/ Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth return(ENOTOBACCO); /* Read on an empty pipe */ -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html