rmnet_config.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* Copyright (c) 2016, 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. * RMNET Data config definition
  13. */
  14. #ifndef _RMNET_CONFIG_H_
  15. #define _RMNET_CONFIG_H_
  16. #include <linux/skbuff.h>
  17. struct rmnet_phys_ep_conf_s {
  18. void (*recycle)(struct sk_buff *); /* Destruct function */
  19. void *config;
  20. };
  21. struct rmnet_map_header_s {
  22. #ifndef RMNET_USE_BIG_ENDIAN_STRUCTS
  23. uint8_t pad_len:6;
  24. uint8_t reserved_bit:1;
  25. uint8_t cd_bit:1;
  26. #else
  27. uint8_t cd_bit:1;
  28. uint8_t reserved_bit:1;
  29. uint8_t pad_len:6;
  30. #endif /* RMNET_USE_BIG_ENDIAN_STRUCTS */
  31. uint8_t mux_id;
  32. uint16_t pkt_len;
  33. } __aligned(1);
  34. #define RMNET_MAP_GET_MUX_ID(Y) (((struct rmnet_map_header_s *)Y->data)->mux_id)
  35. #define RMNET_MAP_GET_CD_BIT(Y) (((struct rmnet_map_header_s *)Y->data)->cd_bit)
  36. #define RMNET_MAP_GET_PAD(Y) (((struct rmnet_map_header_s *)Y->data)->pad_len)
  37. #define RMNET_MAP_GET_CMD_START(Y) ((struct rmnet_map_control_command_s *) \
  38. (Y->data + sizeof(struct rmnet_map_header_s)))
  39. #define RMNET_MAP_GET_LENGTH(Y) (ntohs( \
  40. ((struct rmnet_map_header_s *)Y->data)->pkt_len))
  41. #endif /* _RMNET_CONFIG_H_ */