dcbnl.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2008, Intel Corporation.
  4. *
  5. * Author: Lucy Liu <[email protected]>
  6. */
  7. #ifndef __NET_DCBNL_H__
  8. #define __NET_DCBNL_H__
  9. #include <linux/dcbnl.h>
  10. struct net_device;
  11. struct dcb_app_type {
  12. int ifindex;
  13. struct dcb_app app;
  14. struct list_head list;
  15. u8 dcbx;
  16. };
  17. int dcb_setapp(struct net_device *, struct dcb_app *);
  18. u8 dcb_getapp(struct net_device *, struct dcb_app *);
  19. int dcb_ieee_setapp(struct net_device *, struct dcb_app *);
  20. int dcb_ieee_delapp(struct net_device *, struct dcb_app *);
  21. u8 dcb_ieee_getapp_mask(struct net_device *, struct dcb_app *);
  22. struct dcb_ieee_app_prio_map {
  23. u64 map[IEEE_8021QAZ_MAX_TCS];
  24. };
  25. void dcb_ieee_getapp_prio_dscp_mask_map(const struct net_device *dev,
  26. struct dcb_ieee_app_prio_map *p_map);
  27. struct dcb_ieee_app_dscp_map {
  28. u8 map[64];
  29. };
  30. void dcb_ieee_getapp_dscp_prio_mask_map(const struct net_device *dev,
  31. struct dcb_ieee_app_dscp_map *p_map);
  32. u8 dcb_ieee_getapp_default_prio_mask(const struct net_device *dev);
  33. int dcbnl_ieee_notify(struct net_device *dev, int event, int cmd,
  34. u32 seq, u32 pid);
  35. int dcbnl_cee_notify(struct net_device *dev, int event, int cmd,
  36. u32 seq, u32 pid);
  37. /*
  38. * Ops struct for the netlink callbacks. Used by DCB-enabled drivers through
  39. * the netdevice struct.
  40. */
  41. struct dcbnl_rtnl_ops {
  42. /* IEEE 802.1Qaz std */
  43. int (*ieee_getets) (struct net_device *, struct ieee_ets *);
  44. int (*ieee_setets) (struct net_device *, struct ieee_ets *);
  45. int (*ieee_getmaxrate) (struct net_device *, struct ieee_maxrate *);
  46. int (*ieee_setmaxrate) (struct net_device *, struct ieee_maxrate *);
  47. int (*ieee_getqcn) (struct net_device *, struct ieee_qcn *);
  48. int (*ieee_setqcn) (struct net_device *, struct ieee_qcn *);
  49. int (*ieee_getqcnstats) (struct net_device *, struct ieee_qcn_stats *);
  50. int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *);
  51. int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *);
  52. int (*ieee_getapp) (struct net_device *, struct dcb_app *);
  53. int (*ieee_setapp) (struct net_device *, struct dcb_app *);
  54. int (*ieee_delapp) (struct net_device *, struct dcb_app *);
  55. int (*ieee_peer_getets) (struct net_device *, struct ieee_ets *);
  56. int (*ieee_peer_getpfc) (struct net_device *, struct ieee_pfc *);
  57. /* CEE std */
  58. u8 (*getstate)(struct net_device *);
  59. u8 (*setstate)(struct net_device *, u8);
  60. void (*getpermhwaddr)(struct net_device *, u8 *);
  61. void (*setpgtccfgtx)(struct net_device *, int, u8, u8, u8, u8);
  62. void (*setpgbwgcfgtx)(struct net_device *, int, u8);
  63. void (*setpgtccfgrx)(struct net_device *, int, u8, u8, u8, u8);
  64. void (*setpgbwgcfgrx)(struct net_device *, int, u8);
  65. void (*getpgtccfgtx)(struct net_device *, int, u8 *, u8 *, u8 *, u8 *);
  66. void (*getpgbwgcfgtx)(struct net_device *, int, u8 *);
  67. void (*getpgtccfgrx)(struct net_device *, int, u8 *, u8 *, u8 *, u8 *);
  68. void (*getpgbwgcfgrx)(struct net_device *, int, u8 *);
  69. void (*setpfccfg)(struct net_device *, int, u8);
  70. void (*getpfccfg)(struct net_device *, int, u8 *);
  71. u8 (*setall)(struct net_device *);
  72. u8 (*getcap)(struct net_device *, int, u8 *);
  73. int (*getnumtcs)(struct net_device *, int, u8 *);
  74. int (*setnumtcs)(struct net_device *, int, u8);
  75. u8 (*getpfcstate)(struct net_device *);
  76. void (*setpfcstate)(struct net_device *, u8);
  77. void (*getbcncfg)(struct net_device *, int, u32 *);
  78. void (*setbcncfg)(struct net_device *, int, u32);
  79. void (*getbcnrp)(struct net_device *, int, u8 *);
  80. void (*setbcnrp)(struct net_device *, int, u8);
  81. int (*setapp)(struct net_device *, u8, u16, u8);
  82. int (*getapp)(struct net_device *, u8, u16);
  83. u8 (*getfeatcfg)(struct net_device *, int, u8 *);
  84. u8 (*setfeatcfg)(struct net_device *, int, u8);
  85. /* DCBX configuration */
  86. u8 (*getdcbx)(struct net_device *);
  87. u8 (*setdcbx)(struct net_device *, u8);
  88. /* peer apps */
  89. int (*peer_getappinfo)(struct net_device *, struct dcb_peer_app_info *,
  90. u16 *);
  91. int (*peer_getapptable)(struct net_device *, struct dcb_app *);
  92. /* CEE peer */
  93. int (*cee_peer_getpg) (struct net_device *, struct cee_pg *);
  94. int (*cee_peer_getpfc) (struct net_device *, struct cee_pfc *);
  95. /* buffer settings */
  96. int (*dcbnl_getbuffer)(struct net_device *, struct dcbnl_buffer *);
  97. int (*dcbnl_setbuffer)(struct net_device *, struct dcbnl_buffer *);
  98. };
  99. #endif /* __NET_DCBNL_H__ */