mdio.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM mdio
  4. #if !defined(_TRACE_MDIO_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_MDIO_H
  6. #include <linux/tracepoint.h>
  7. TRACE_EVENT_CONDITION(mdio_access,
  8. TP_PROTO(struct mii_bus *bus, char read,
  9. u8 addr, unsigned regnum, u16 val, int err),
  10. TP_ARGS(bus, read, addr, regnum, val, err),
  11. TP_CONDITION(err >= 0),
  12. TP_STRUCT__entry(
  13. __array(char, busid, MII_BUS_ID_SIZE)
  14. __field(char, read)
  15. __field(u8, addr)
  16. __field(u16, val)
  17. __field(unsigned, regnum)
  18. ),
  19. TP_fast_assign(
  20. strncpy(__entry->busid, bus->id, MII_BUS_ID_SIZE);
  21. __entry->read = read;
  22. __entry->addr = addr;
  23. __entry->regnum = regnum;
  24. __entry->val = val;
  25. ),
  26. TP_printk("%s %-5s phy:0x%02hhx reg:0x%02x val:0x%04hx",
  27. __entry->busid, __entry->read ? "read" : "write",
  28. __entry->addr, __entry->regnum, __entry->val)
  29. );
  30. #endif /* if !defined(_TRACE_MDIO_H) || defined(TRACE_HEADER_MULTI_READ) */
  31. /* This part must be outside protection */
  32. #include <trace/define_trace.h>