rmnet_offload_state.c 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* Copyright (c) 2018-2020, 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. #include <linux/module.h>
  13. #include <linux/netdevice.h>
  14. #include "rmnet_map.h"
  15. #include "rmnet_private.h"
  16. #include "qmi_rmnet.h"
  17. #include "rmnet_offload_state.h"
  18. #include "rmnet_offload_engine.h"
  19. MODULE_LICENSE("\x47\x50\x4c\x20\x76\x32");
  20. #define DATARMNET47b52951b8 (0x68d+4280-0x1745)
  21. static struct DATARMNET8357daf015*DATARMNETf7e8f6395c;static void
  22. DATARMNET39b47bda29(void){struct rmnet_port*DATARMNETe8a5f322f0=
  23. DATARMNETf7e8f6395c->DATARMNET547651077b;struct DATARMNET92f4d48c56*
  24. DATARMNET18063ff0ab;qmi_rmnet_ps_ind_deregister(DATARMNETe8a5f322f0,&
  25. DATARMNETf7e8f6395c->DATARMNETa0db7ef12a);DATARMNET18063ff0ab=&
  26. DATARMNETf7e8f6395c->DATARMNETfe5583a585;if(DATARMNET18063ff0ab->
  27. DATARMNETf82a9c29ed)rmnet_map_dl_ind_deregister(DATARMNETe8a5f322f0,&
  28. DATARMNET18063ff0ab->DATARMNET524c210c13);}static void DATARMNET296eb47249(void)
  29. {if(!DATARMNETf7e8f6395c)return;DATARMNET39b47bda29();DATARMNET848914898b();
  30. DATARMNET28dfa538f2();DATARMNET54fd6bf483();DATARMNETde815547a0();kfree(
  31. DATARMNETf7e8f6395c);DATARMNETf7e8f6395c=NULL;}static int DATARMNETd813fadf76(
  32. void){struct rmnet_port*DATARMNETe8a5f322f0=DATARMNETf7e8f6395c->
  33. DATARMNET547651077b;struct qmi_rmnet_ps_ind*DATARMNET83359ae71d;struct
  34. DATARMNET92f4d48c56*DATARMNET18063ff0ab;struct rmnet_map_dl_ind*
  35. DATARMNET524c210c13;int DATARMNET094475d445=DATARMNET6e89887168;
  36. DATARMNET83359ae71d=&DATARMNETf7e8f6395c->DATARMNETa0db7ef12a;
  37. DATARMNET83359ae71d->ps_on_handler=DATARMNETfaa320a86a;DATARMNET83359ae71d->
  38. ps_off_handler=DATARMNET6b57fa3471;if(qmi_rmnet_ps_ind_register(
  39. DATARMNETe8a5f322f0,DATARMNET83359ae71d)){DATARMNET094475d445=
  40. DATARMNETee330d5a81;pr_warn(
  41. "\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"
  42. ,__func__);}if(DATARMNETe8a5f322f0->data_format&
  43. RMNET_INGRESS_FORMAT_DL_MARKER_V2){DATARMNET18063ff0ab=&DATARMNETf7e8f6395c->
  44. DATARMNETfe5583a585;DATARMNET524c210c13=&DATARMNET18063ff0ab->
  45. DATARMNET524c210c13;DATARMNET524c210c13->priority=DATARMNET47b52951b8;
  46. DATARMNET524c210c13->dl_hdr_handler_v2=DATARMNET4aefca6d3c;DATARMNET524c210c13->
  47. dl_trl_handler_v2=DATARMNET94edfae28d;if(rmnet_map_dl_ind_register(
  48. DATARMNETe8a5f322f0,DATARMNET524c210c13)){DATARMNETafcdd1146f();
  49. DATARMNET094475d445=DATARMNETee330d5a81;pr_warn(
  50. "\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"
  51. ,__func__);}else{DATARMNET18063ff0ab->DATARMNETf82a9c29ed=true;}}else{
  52. DATARMNETafcdd1146f();DATARMNET094475d445=DATARMNETee330d5a81;pr_warn(
  53. "\x25\x73\x28\x29\x3a\x20\x44\x4c\x20\x6e\x6f\x74\x20\x65\x6e\x61\x62\x6c\x65\x64" "\n"
  54. ,__func__);}return DATARMNET094475d445;}static int DATARMNETbe48169564(struct
  55. rmnet_port*DATARMNETe8a5f322f0){int DATARMNET094475d445;DATARMNETf7e8f6395c=
  56. kzalloc(sizeof(*DATARMNETf7e8f6395c),GFP_KERNEL);if(!DATARMNETf7e8f6395c){pr_err
  57. (
  58. "\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"
  59. ,__func__);return DATARMNETc50a12ee59;}DATARMNETf7e8f6395c->DATARMNET547651077b=
  60. DATARMNETe8a5f322f0;DATARMNET094475d445=DATARMNETcce014cb1d();if(
  61. DATARMNET094475d445<(0x15bb+934-0x1961))goto DATARMNET77e7361053;
  62. DATARMNET094475d445=DATARMNETd813fadf76();if(DATARMNET094475d445!=
  63. DATARMNET6e89887168){pr_warn(
  64. "\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"
  65. ,__func__);}DATARMNETd9ec5f4e65();return DATARMNET094475d445;DATARMNET77e7361053
  66. :kfree(DATARMNETf7e8f6395c);DATARMNETf7e8f6395c=NULL;return DATARMNET094475d445;
  67. }static int DATARMNETe4f68c17d0(struct notifier_block*DATARMNET9e976b309a,
  68. unsigned long DATARMNET081daa57e7,void*DATARMNET71ffe74cda){struct net_device*
  69. DATARMNET6db6ebb1e7=netdev_notifier_info_to_dev(DATARMNET71ffe74cda);struct
  70. rmnet_port*DATARMNETe8a5f322f0;struct rmnet_priv*DATARMNET64e0e8cc28;int
  71. DATARMNET094475d445;(void)DATARMNET9e976b309a;if(!DATARMNET6db6ebb1e7)goto
  72. DATARMNET02a8afcd23;switch(DATARMNET081daa57e7){case NETDEV_REGISTER:if(
  73. DATARMNETf7e8f6395c||DATARMNET4e490d9d37()||strncmp(DATARMNET6db6ebb1e7->name,
  74. "\x72\x6d\x6e\x65\x74\x5f\x64\x61\x74\x61",(0xeab+5835-0x256c)))goto
  75. DATARMNET02a8afcd23;DATARMNET64e0e8cc28=netdev_priv(DATARMNET6db6ebb1e7);
  76. DATARMNETe8a5f322f0=rmnet_get_port(DATARMNET64e0e8cc28->real_dev);if(!
  77. DATARMNETe8a5f322f0){pr_err(
  78. "\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"
  79. ,__func__,DATARMNET6db6ebb1e7->name);goto DATARMNET02a8afcd23;}pr_info(
  80. "\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"
  81. ,__func__,DATARMNET6db6ebb1e7->name);DATARMNET094475d445=DATARMNETbe48169564(
  82. DATARMNETe8a5f322f0);if(DATARMNET094475d445==DATARMNETc50a12ee59){pr_err(
  83. "\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"
  84. ,__func__);goto DATARMNET02a8afcd23;}break;case NETDEV_UNREGISTER:if(!
  85. DATARMNETf7e8f6395c||!DATARMNET4e490d9d37()||strncmp(DATARMNET6db6ebb1e7->name,
  86. DATARMNETf7e8f6395c->DATARMNET547651077b->dev->name,IFNAMSIZ))goto
  87. DATARMNET02a8afcd23;pr_info(
  88. "\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"
  89. ,__func__,DATARMNET6db6ebb1e7->name);DATARMNET296eb47249();break;}
  90. DATARMNET02a8afcd23:return NOTIFY_DONE;}static struct notifier_block
  91. DATARMNET4dff0c2c8a={.notifier_call=DATARMNETe4f68c17d0,.priority=
  92. (0xc93+6150-0x2498),};static int __init DATARMNET99216255df(void){pr_info(
  93. "\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"
  94. ,__func__);return register_netdevice_notifier(&DATARMNET4dff0c2c8a);}static void
  95. __exit DATARMNET16134ceac1(void){pr_info(
  96. "\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"
  97. ,__func__);unregister_netdevice_notifier(&DATARMNET4dff0c2c8a);}struct
  98. DATARMNET8357daf015*DATARMNETccc25794e0(void){return DATARMNETf7e8f6395c;}
  99. module_init(DATARMNET99216255df);module_exit(DATARMNET16134ceac1);