rmnet_offload_state.c 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
  2. * Copyright (c) 2022, 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. #include <linux/module.h>
  14. #include <linux/netdevice.h>
  15. #include <linux/rcupdate.h>
  16. #include "rmnet_map.h"
  17. #include "rmnet_private.h"
  18. #include "qmi_rmnet.h"
  19. #include "rmnet_offload_state.h"
  20. #include "rmnet_offload_engine.h"
  21. MODULE_LICENSE("\x47\x50\x4c\x20\x76\x32");
  22. #define DATARMNET1f03ff7987 (0xd2d+202-0xdf7)
  23. static struct DATARMNET70f3b87b5d*DATARMNETe05748b000;static void
  24. DATARMNETac9c8c14b1(void){struct rmnet_port*DATARMNETf0d9de7e2f=
  25. DATARMNETe05748b000->DATARMNET403589239f;struct DATARMNET74bb35b8f2*
  26. DATARMNET87b015f76f;qmi_rmnet_ps_ind_deregister(DATARMNETf0d9de7e2f,&
  27. DATARMNETe05748b000->DATARMNET341393eda2);DATARMNET87b015f76f=&
  28. DATARMNETe05748b000->DATARMNETa9f2b2f677;if(DATARMNET87b015f76f->
  29. DATARMNETc2832b8f85)rmnet_map_dl_ind_deregister(DATARMNETf0d9de7e2f,&
  30. DATARMNET87b015f76f->DATARMNET8633ae8f1e);}static void DATARMNET345f805b34(void)
  31. {LIST_HEAD(DATARMNET6f9bfa17e6);if(!DATARMNETe05748b000)return;
  32. DATARMNETac9c8c14b1();DATARMNETba38823a2f();DATARMNET560e127137();
  33. synchronize_rcu();DATARMNETae70636c90(&DATARMNET6f9bfa17e6);DATARMNETb98b78b8e3(
  34. );kfree(DATARMNETe05748b000);DATARMNETe05748b000=NULL;}static int
  35. DATARMNETd68e3594a7(void){struct rmnet_port*DATARMNETf0d9de7e2f=
  36. DATARMNETe05748b000->DATARMNET403589239f;struct qmi_rmnet_ps_ind*
  37. DATARMNETbc78d7fd3c;struct DATARMNET74bb35b8f2*DATARMNET87b015f76f;struct
  38. rmnet_map_dl_ind*DATARMNET8633ae8f1e;int DATARMNETb14e52a504=DATARMNET0529bb9c4e
  39. ;DATARMNETbc78d7fd3c=&DATARMNETe05748b000->DATARMNET341393eda2;
  40. DATARMNETbc78d7fd3c->ps_on_handler=DATARMNET9292bebdd3;DATARMNETbc78d7fd3c->
  41. ps_off_handler=DATARMNETb7e47d7254;if(qmi_rmnet_ps_ind_register(
  42. DATARMNETf0d9de7e2f,DATARMNETbc78d7fd3c)){DATARMNETb14e52a504=
  43. DATARMNET8e1c5c09f8;pr_warn(
  44. "\x25\x73\x28\x29\x3a\x20\x50\x53\x20\x43\x42\x20\x72\x65\x67\x69\x73\x74\x72\x61\x74\x69\x6f\x6e\x20\x66\x61\x69\x6c\x65\x64" "\n"
  45. ,__func__);}if(DATARMNETf0d9de7e2f->data_format&
  46. RMNET_INGRESS_FORMAT_DL_MARKER_V2){DATARMNET87b015f76f=&DATARMNETe05748b000->
  47. DATARMNETa9f2b2f677;DATARMNET8633ae8f1e=&DATARMNET87b015f76f->
  48. DATARMNET8633ae8f1e;DATARMNET8633ae8f1e->priority=DATARMNET1f03ff7987;
  49. DATARMNET8633ae8f1e->dl_hdr_handler_v2=DATARMNET95e1703026;DATARMNET8633ae8f1e->
  50. dl_trl_handler_v2=DATARMNETc9dd320f49;if(rmnet_map_dl_ind_register(
  51. DATARMNETf0d9de7e2f,DATARMNET8633ae8f1e)){DATARMNETb14e52a504=
  52. DATARMNET8e1c5c09f8;pr_warn(
  53. "\x25\x73\x28\x29\x3a\x20\x44\x4c\x20\x43\x42\x20\x72\x65\x67\x69\x73\x74\x72\x61\x74\x61\x74\x69\x6f\x6e\x20\x66\x61\x69\x6c\x65\x64" "\n"
  54. ,__func__);}else{DATARMNET87b015f76f->DATARMNETc2832b8f85=true;}}
  55. DATARMNETd4230b6bfe();return DATARMNETb14e52a504;}static int DATARMNET9f53d54812
  56. (struct rmnet_port*DATARMNETf0d9de7e2f){int DATARMNETb14e52a504;
  57. DATARMNETe05748b000=kzalloc(sizeof(*DATARMNETe05748b000),GFP_KERNEL);if(!
  58. DATARMNETe05748b000){pr_err(
  59. "\x25\x73\x28\x29\x3a\x20\x52\x65\x73\x6f\x75\x72\x63\x65\x20\x61\x6c\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x20\x66\x61\x69\x6c\x65\x64" "\n"
  60. ,__func__);return DATARMNETb881657565;}DATARMNETe05748b000->DATARMNET403589239f=
  61. DATARMNETf0d9de7e2f;DATARMNETb14e52a504=DATARMNETdbcaf01255();if(
  62. DATARMNETb14e52a504<(0xd2d+202-0xdf7))goto DATARMNET1d7e728ddf;
  63. DATARMNETb14e52a504=DATARMNETd68e3594a7();if(DATARMNETb14e52a504!=
  64. DATARMNET0529bb9c4e){pr_warn(
  65. "\x25\x73\x28\x29\x3a\x20\x43\x61\x6c\x6c\x62\x61\x63\x6b\x20\x72\x65\x67\x69\x73\x74\x72\x61\x74\x69\x6f\x6e\x20\x66\x61\x69\x6c\x65\x64" "\n"
  66. ,__func__);}DATARMNETe05748b000->DATARMNETcb2b3ae8e4=(0xd26+209-0xdf6);
  67. DATARMNET818b960147();return DATARMNETb14e52a504;DATARMNET1d7e728ddf:kfree(
  68. DATARMNETe05748b000);DATARMNETe05748b000=NULL;return DATARMNETb14e52a504;}static
  69. int DATARMNET7dec24813e(struct notifier_block*DATARMNET272c159b3c,unsigned long
  70. DATARMNET4abd997295,void*DATARMNET3f254bae11){struct net_device*
  71. DATARMNET00dcb79bc4=netdev_notifier_info_to_dev(DATARMNET3f254bae11);struct
  72. rmnet_port*DATARMNETf0d9de7e2f;struct rmnet_priv*DATARMNETe823dcf978;int
  73. DATARMNETb14e52a504;(void)DATARMNET272c159b3c;if(!DATARMNET00dcb79bc4||strncmp(
  74. DATARMNET00dcb79bc4->name,"\x72\x6d\x6e\x65\x74\x5f\x64\x61\x74\x61",
  75. (0xd27+224-0xdfd)))goto DATARMNETaabe3a05f8;switch(DATARMNET4abd997295){case
  76. NETDEV_REGISTER:if(DATARMNETe05748b000){DATARMNETe05748b000->DATARMNETcb2b3ae8e4
  77. ++;goto DATARMNETaabe3a05f8;}DATARMNETe823dcf978=netdev_priv(DATARMNET00dcb79bc4
  78. );DATARMNETf0d9de7e2f=rmnet_get_port(DATARMNETe823dcf978->real_dev);if(!
  79. DATARMNETf0d9de7e2f){pr_err(
  80. "\x25\x73\x28\x29\x3a\x20\x49\x6e\x76\x61\x6c\x69\x64\x20\x72\x6d\x6e\x65\x74\x20\x63\x6f\x6e\x66\x69\x67\x75\x72\x61\x74\x69\x6f\x6e\x20\x6f\x6e\x20\x25\x73" "\n"
  81. ,__func__,DATARMNET00dcb79bc4->name);goto DATARMNETaabe3a05f8;}pr_info(
  82. "\x25\x73\x28\x29\x3a\x20\x49\x6e\x69\x74\x69\x61\x6c\x69\x7a\x69\x6e\x67\x20\x6f\x6e\x20\x64\x65\x76\x69\x63\x65\x20\x25\x73" "\n"
  83. ,__func__,DATARMNET00dcb79bc4->name);DATARMNETb14e52a504=DATARMNET9f53d54812(
  84. DATARMNETf0d9de7e2f);if(DATARMNETb14e52a504==DATARMNETb881657565){pr_err(
  85. "\x25\x73\x28\x29\x3a\x20\x49\x6e\x69\x74\x69\x61\x6c\x69\x7a\x61\x74\x69\x6f\x6e\x20\x66\x61\x69\x6c\x65\x64" "\n"
  86. ,__func__);goto DATARMNETaabe3a05f8;}break;case NETDEV_UNREGISTER:if(!
  87. DATARMNETe05748b000)goto DATARMNETaabe3a05f8;if(--DATARMNETe05748b000->
  88. DATARMNETcb2b3ae8e4)goto DATARMNETaabe3a05f8;pr_info(
  89. "\x25\x73\x28\x29\x3a\x20\x55\x6e\x69\x6e\x69\x74\x69\x61\x6c\x69\x7a\x69\x6e\x67\x20\x6f\x6e\x20\x64\x65\x76\x69\x63\x65\x20\x25\x73" "\n"
  90. ,__func__,DATARMNET00dcb79bc4->name);DATARMNET345f805b34();break;}
  91. DATARMNETaabe3a05f8:return NOTIFY_DONE;}static struct notifier_block
  92. DATARMNETcae9c64c41={.notifier_call=DATARMNET7dec24813e,.priority=
  93. (0xd26+209-0xdf6),};static int __init DATARMNETb1c42acd9c(void){pr_info(
  94. "\x25\x73\x28\x29\x3a\x20\x72\x6d\x6e\x65\x74\x5f\x6f\x66\x66\x6c\x6f\x61\x64\x20\x69\x6e\x69\x74\x69\x61\x6c\x69\x7a\x69\x6e\x67" "\n"
  95. ,__func__);return register_netdevice_notifier(&DATARMNETcae9c64c41);}static void
  96. __exit DATARMNET0f6d85e415(void){pr_info(
  97. "\x25\x73\x28\x29\x3a\x20\x72\x6d\x6e\x65\x74\x5f\x6f\x66\x66\x6c\x6f\x61\x64\x20\x65\x78\x69\x74\x69\x6e\x67" "\n"
  98. ,__func__);unregister_netdevice_notifier(&DATARMNETcae9c64c41);}struct
  99. DATARMNET70f3b87b5d*DATARMNETc2a630b113(void){return DATARMNETe05748b000;}
  100. module_init(DATARMNETb1c42acd9c);module_exit(DATARMNET0f6d85e415);