diff options
author | marius <marius@FreeBSD.org> | 2005-11-22 21:34:26 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2005-11-22 21:34:26 +0000 |
commit | 129625a60097f14b92908074f47e0a0ff1a5d673 (patch) | |
tree | 2a4a5b14aba44aa1246e61bdce574cd53c267e5f /sys/sparc64/pci/psychovar.h | |
parent | 75d54c3006163d4f340af814056f5ee9054ef8c7 (diff) | |
download | FreeBSD-src-129625a60097f14b92908074f47e0a0ff1a5d673.zip FreeBSD-src-129625a60097f14b92908074f47e0a0ff1a5d673.tar.gz |
Some clean-up, style changes and changes that will reduce differences
between this driver and other Host-PCI bridge drivers based on this one:
- Make the code fit into 80 columns.
- Make the code adhere style(9) (don't use function calls in initializers,
use uintXX_t instead of u_intXX_t, add missing prototypes, ...).
- Remove unused and superfluous struct declaration, softc member, casts,
includes, etc.
- Use FBSDID.
- Sprinkle const.
- Try to make comments and messages consistent in style throughout the
driver.
- Use convenience macros for the number of interrupts and ranges of the
bridge.
- Use __func__ instead of hardcoded function names in panic strings and
error messages. Some of the hardcoded function names actually were
outdated through moving code around. [1]
- Rename softc members related to the PCI side of the bridge to sc_pci_*
in order to make it clear which side of the bridge they refer to (so
stuff like sc_bushandle vs. sc_bh is less confusing while reading the
code).
PR: 76052 [1]
Diffstat (limited to 'sys/sparc64/pci/psychovar.h')
-rw-r--r-- | sys/sparc64/pci/psychovar.h | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/sys/sparc64/pci/psychovar.h b/sys/sparc64/pci/psychovar.h index 4bd3b69..b2d7d24 100644 --- a/sys/sparc64/pci/psychovar.h +++ b/sys/sparc64/pci/psychovar.h @@ -44,15 +44,14 @@ struct psycho_softc { /* Interrupt Group Number for this device */ int sc_ign; - /* Our tags (from parent). */ + /* Our tags (from parent) */ bus_space_tag_t sc_bustag; bus_space_handle_t sc_bushandle; bus_dma_tag_t sc_dmatag; bus_addr_t sc_pcictl; - int sc_clockfreq; - phandle_t sc_node; /* Firmware node. */ + phandle_t sc_node; /* Firmware node */ int sc_mode; #define PSYCHO_MODE_SABRE 1 #define PSYCHO_MODE_PSYCHO 2 @@ -61,32 +60,32 @@ struct psycho_softc { int sc_half; struct iommu_state *sc_is; - u_int32_t sc_dvmabase; + uint32_t sc_dvmabase; struct resource *sc_mem_res; - struct resource *sc_irq_res[6]; - void *sc_ihand[6]; + struct resource *sc_irq_res[PSYCHO_NINTR]; + void *sc_ihand[PSYCHO_NINTR]; - struct ofw_bus_iinfo sc_iinfo; + struct ofw_bus_iinfo sc_pci_iinfo; struct upa_ranges *sc_range; int sc_nrange; - /* Tags for PCI access. */ - bus_space_tag_t sc_cfgt; - bus_space_tag_t sc_memt; - bus_space_tag_t sc_iot; - bus_dma_tag_t sc_dmat; + /* Tags for PCI access */ + bus_space_tag_t sc_pci_cfgt; + bus_space_tag_t sc_pci_memt; + bus_space_tag_t sc_pci_iot; + bus_dma_tag_t sc_pci_dmat; - bus_space_handle_t sc_bh[4]; + bus_space_handle_t sc_pci_bh[PSYCHO_NRANGE]; - u_int sc_secbus; - u_int sc_subbus; + u_int sc_pci_secbus; + u_int sc_pci_subbus; - struct rman sc_mem_rman; - struct rman sc_io_rman; + struct rman sc_pci_mem_rman; + struct rman sc_pci_io_rman; SLIST_ENTRY(psycho_softc) sc_link; }; -#endif /* _SPARC64_PCI_PSYCHOVAR_H_ */ +#endif /* !_SPARC64_PCI_PSYCHOVAR_H_ */ |