rmnet_private.h 2.2 KB

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