rmnet_private.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* Copyright (c) 2013-2014, 2016-2021 The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef _RMNET_PRIVATE_H_
  13. #define _RMNET_PRIVATE_H_
  14. #include <linux/types.h>
  15. #define RMNET_MAX_PACKET_SIZE 16384
  16. #define RMNET_DFLT_PACKET_SIZE 1500
  17. #define RMNET_NEEDED_HEADROOM 16
  18. #define RMNET_TX_QUEUE_LEN 1000
  19. /* Constants */
  20. #define RMNET_EGRESS_FORMAT_AGGREGATION BIT(31)
  21. #define RMNET_INGRESS_FORMAT_DL_MARKER_V1 BIT(30)
  22. #define RMNET_INGRESS_FORMAT_DL_MARKER_V2 BIT(29)
  23. #define RMNET_FLAGS_INGRESS_COALESCE BIT(4)
  24. #define RMNET_PRIV_FLAGS_INGRESS_MAP_CKSUMV5 BIT(5)
  25. #define RMNET_PRIV_FLAGS_EGRESS_MAP_CKSUMV5 BIT(6)
  26. #define RMNET_INGRESS_FORMAT_DL_MARKER (RMNET_INGRESS_FORMAT_DL_MARKER_V1 |\
  27. RMNET_INGRESS_FORMAT_DL_MARKER_V2)
  28. /* UL Packet prioritization */
  29. #define RMNET_EGRESS_FORMAT_PRIORITY BIT(28)
  30. /* Power save feature*/
  31. #define RMNET_INGRESS_FORMAT_PS BIT(27)
  32. #define RMNET_FORMAT_PS_NOTIF BIT(26)
  33. /* UL Aggregation parameters */
  34. #define RMNET_PAGE_RECYCLE BIT(0)
  35. /* Replace skb->dev to a virtual rmnet device and pass up the stack */
  36. #define RMNET_EPMODE_VND (1)
  37. /* Pass the frame directly to another device with dev_queue_xmit() */
  38. #define RMNET_EPMODE_BRIDGE (2)
  39. /* Struct for skb control block use within rmnet driver */
  40. struct rmnet_skb_cb {
  41. /* MUST be the first entries because of legacy reasons */
  42. char flush_shs;
  43. char qmap_steer;
  44. /* coalescing stats */
  45. u32 coal_bytes;
  46. u32 coal_bufsize;
  47. };
  48. #define RMNET_SKB_CB(skb) ((struct rmnet_skb_cb *)(skb)->cb)
  49. #endif /* _RMNET_PRIVATE_H_ */