ath5k.h (a02001086bbfb4da35d1228bebc2f1b442db455f) ath5k.h (0e5d3ab532dd6bd43406d91b1dacb391973f831f)
1/*
2 * Copyright (c) 2004-2007 Reyk Floeter <reyk@openbsd.org>
3 * Copyright (c) 2006-2007 Nick Kossifidis <mickflemm@gmail.com>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *

--- 1633 unchanged lines hidden (view full) ---

1642 return &ah->common;
1643}
1644
1645static inline struct ath_regulatory *ath5k_hw_regulatory(struct ath5k_hw *ah)
1646{
1647 return &(ath5k_hw_common(ah)->regulatory);
1648}
1649
1/*
2 * Copyright (c) 2004-2007 Reyk Floeter <reyk@openbsd.org>
3 * Copyright (c) 2006-2007 Nick Kossifidis <mickflemm@gmail.com>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *

--- 1633 unchanged lines hidden (view full) ---

1642 return &ah->common;
1643}
1644
1645static inline struct ath_regulatory *ath5k_hw_regulatory(struct ath5k_hw *ah)
1646{
1647 return &(ath5k_hw_common(ah)->regulatory);
1648}
1649
1650#ifdef CONFIG_ATHEROS_AR231X
1651#define AR5K_AR2315_PCI_BASE ((void __iomem *)0xb0100000)
1652
1653static inline void __iomem *ath5k_ahb_reg(struct ath5k_hw *ah, u16 reg)
1654{
1655 /* On AR2315 and AR2317 the PCI clock domain registers
1656 * are outside of the WMAC register space */
1657 if (unlikely((reg >= 0x4000) && (reg < 0x5000) &&
1658 (ah->ah_mac_srev >= AR5K_SREV_AR2315_R6)))
1659 return AR5K_AR2315_PCI_BASE + reg;
1660
1661 return ah->iobase + reg;
1662}
1663
1650static inline u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg)
1651{
1664static inline u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg)
1665{
1666 return ioread32(ath5k_ahb_reg(ah, reg));
1667}
1668
1669static inline void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg)
1670{
1671 iowrite32(val, ath5k_ahb_reg(ah, reg));
1672}
1673
1674#else
1675
1676static inline u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg)
1677{
1652 return ioread32(ah->iobase + reg);
1653}
1654
1655static inline void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg)
1656{
1657 iowrite32(val, ah->iobase + reg);
1658}
1659
1678 return ioread32(ah->iobase + reg);
1679}
1680
1681static inline void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg)
1682{
1683 iowrite32(val, ah->iobase + reg);
1684}
1685
1686#endif
1687
1660static inline enum ath_bus_type ath5k_get_bus_type(struct ath5k_hw *ah)
1661{
1662 return ath5k_hw_common(ah)->bus_ops->ath_bus_type;
1663}
1664
1665static inline void ath5k_read_cachesize(struct ath_common *common, int *csz)
1666{
1667 common->bus_ops->read_cachesize(common, csz);

--- 21 unchanged lines hidden ---
1688static inline enum ath_bus_type ath5k_get_bus_type(struct ath5k_hw *ah)
1689{
1690 return ath5k_hw_common(ah)->bus_ops->ath_bus_type;
1691}
1692
1693static inline void ath5k_read_cachesize(struct ath_common *common, int *csz)
1694{
1695 common->bus_ops->read_cachesize(common, csz);

--- 21 unchanged lines hidden ---