diff options
author | Grygorii Strashko <grygorii.strashko@ti.com> | 2016-12-06 18:00:35 -0600 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-07 11:13:46 -0500 |
commit | b63ba58ee9957261b39209f3031ff06714cf13cb (patch) | |
tree | 9d16b88e5fbdf3bf338d433de18a9d94a7e6508a /drivers/net/ethernet/ti/cpts.h | |
parent | c8395d4e1d4ffbc9d8aa61f534c82e8deed72cfd (diff) |
net: ethernet: ti: cpsw: minimize direct access to struct cpts
This will provide more flexibility in changing CPTS internals and also
required for further changes.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/cpts.h')
-rw-r--r-- | drivers/net/ethernet/ti/cpts.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/cpts.h b/drivers/net/ethernet/ti/cpts.h index 416ba2c0d99a..29a1e80c6a2b 100644 --- a/drivers/net/ethernet/ti/cpts.h +++ b/drivers/net/ethernet/ti/cpts.h @@ -132,6 +132,27 @@ void cpts_rx_timestamp(struct cpts *cpts, struct sk_buff *skb); void cpts_tx_timestamp(struct cpts *cpts, struct sk_buff *skb); int cpts_register(struct device *dev, struct cpts *cpts, u32 mult, u32 shift); void cpts_unregister(struct cpts *cpts); + +static inline void cpts_rx_enable(struct cpts *cpts, int enable) +{ + cpts->rx_enable = enable; +} + +static inline bool cpts_is_rx_enabled(struct cpts *cpts) +{ + return !!cpts->rx_enable; +} + +static inline void cpts_tx_enable(struct cpts *cpts, int enable) +{ + cpts->tx_enable = enable; +} + +static inline bool cpts_is_tx_enabled(struct cpts *cpts) +{ + return !!cpts->tx_enable; +} + #else static inline void cpts_rx_timestamp(struct cpts *cpts, struct sk_buff *skb) { @@ -149,6 +170,24 @@ cpts_register(struct device *dev, struct cpts *cpts, u32 mult, u32 shift) static inline void cpts_unregister(struct cpts *cpts) { } + +static inline void cpts_rx_enable(struct cpts *cpts, int enable) +{ +} + +static inline bool cpts_is_rx_enabled(struct cpts *cpts) +{ + return false; +} + +static inline void cpts_tx_enable(struct cpts *cpts, int enable) +{ +} + +static inline bool cpts_is_tx_enabled(struct cpts *cpts) +{ + return false; +} #endif |