1 // SPDX-License-Identifier: GPL-2.0 2 3 /* Copyright (c) 2018, The Linux Foundation. All rights reserved. 4 * Copyright (C) 2018-2020 Linaro Ltd. 5 */ 6 #include <linux/stddef.h> 7 #include <linux/soc/qcom/qmi.h> 8 9 #include "ipa_qmi_msg.h" 10 11 /* QMI message structure definition for struct ipa_indication_register_req */ 12 struct qmi_elem_info ipa_indication_register_req_ei[] = { 13 { 14 .data_type = QMI_OPT_FLAG, 15 .elem_len = 1, 16 .elem_size = 17 sizeof_field(struct ipa_indication_register_req, 18 master_driver_init_complete_valid), 19 .tlv_type = 0x10, 20 .offset = offsetof(struct ipa_indication_register_req, 21 master_driver_init_complete_valid), 22 }, 23 { 24 .data_type = QMI_UNSIGNED_1_BYTE, 25 .elem_len = 1, 26 .elem_size = 27 sizeof_field(struct ipa_indication_register_req, 28 master_driver_init_complete), 29 .tlv_type = 0x10, 30 .offset = offsetof(struct ipa_indication_register_req, 31 master_driver_init_complete), 32 }, 33 { 34 .data_type = QMI_OPT_FLAG, 35 .elem_len = 1, 36 .elem_size = 37 sizeof_field(struct ipa_indication_register_req, 38 data_usage_quota_reached_valid), 39 .tlv_type = 0x11, 40 .offset = offsetof(struct ipa_indication_register_req, 41 data_usage_quota_reached_valid), 42 }, 43 { 44 .data_type = QMI_UNSIGNED_1_BYTE, 45 .elem_len = 1, 46 .elem_size = 47 sizeof_field(struct ipa_indication_register_req, 48 data_usage_quota_reached), 49 .tlv_type = 0x11, 50 .offset = offsetof(struct ipa_indication_register_req, 51 data_usage_quota_reached), 52 }, 53 { 54 .data_type = QMI_OPT_FLAG, 55 .elem_len = 1, 56 .elem_size = 57 sizeof_field(struct ipa_indication_register_req, 58 ipa_mhi_ready_ind_valid), 59 .tlv_type = 0x12, 60 .offset = offsetof(struct ipa_indication_register_req, 61 ipa_mhi_ready_ind_valid), 62 }, 63 { 64 .data_type = QMI_UNSIGNED_1_BYTE, 65 .elem_len = 1, 66 .elem_size = 67 sizeof_field(struct ipa_indication_register_req, 68 ipa_mhi_ready_ind), 69 .tlv_type = 0x12, 70 .offset = offsetof(struct ipa_indication_register_req, 71 ipa_mhi_ready_ind), 72 }, 73 { 74 .data_type = QMI_EOTI, 75 }, 76 }; 77 78 /* QMI message structure definition for struct ipa_indication_register_rsp */ 79 struct qmi_elem_info ipa_indication_register_rsp_ei[] = { 80 { 81 .data_type = QMI_STRUCT, 82 .elem_len = 1, 83 .elem_size = 84 sizeof_field(struct ipa_indication_register_rsp, 85 rsp), 86 .tlv_type = 0x02, 87 .offset = offsetof(struct ipa_indication_register_rsp, 88 rsp), 89 .ei_array = qmi_response_type_v01_ei, 90 }, 91 { 92 .data_type = QMI_EOTI, 93 }, 94 }; 95 96 /* QMI message structure definition for struct ipa_driver_init_complete_req */ 97 struct qmi_elem_info ipa_driver_init_complete_req_ei[] = { 98 { 99 .data_type = QMI_UNSIGNED_1_BYTE, 100 .elem_len = 1, 101 .elem_size = 102 sizeof_field(struct ipa_driver_init_complete_req, 103 status), 104 .tlv_type = 0x01, 105 .offset = offsetof(struct ipa_driver_init_complete_req, 106 status), 107 }, 108 { 109 .data_type = QMI_EOTI, 110 }, 111 }; 112 113 /* QMI message structure definition for struct ipa_driver_init_complete_rsp */ 114 struct qmi_elem_info ipa_driver_init_complete_rsp_ei[] = { 115 { 116 .data_type = QMI_STRUCT, 117 .elem_len = 1, 118 .elem_size = 119 sizeof_field(struct ipa_driver_init_complete_rsp, 120 rsp), 121 .tlv_type = 0x02, 122 .offset = offsetof(struct ipa_driver_init_complete_rsp, 123 rsp), 124 .ei_array = qmi_response_type_v01_ei, 125 }, 126 { 127 .data_type = QMI_EOTI, 128 }, 129 }; 130 131 /* QMI message structure definition for struct ipa_init_complete_ind */ 132 struct qmi_elem_info ipa_init_complete_ind_ei[] = { 133 { 134 .data_type = QMI_STRUCT, 135 .elem_len = 1, 136 .elem_size = 137 sizeof_field(struct ipa_init_complete_ind, 138 status), 139 .tlv_type = 0x02, 140 .offset = offsetof(struct ipa_init_complete_ind, 141 status), 142 .ei_array = qmi_response_type_v01_ei, 143 }, 144 { 145 .data_type = QMI_EOTI, 146 }, 147 }; 148 149 /* QMI message structure definition for struct ipa_mem_bounds */ 150 struct qmi_elem_info ipa_mem_bounds_ei[] = { 151 { 152 .data_type = QMI_UNSIGNED_4_BYTE, 153 .elem_len = 1, 154 .elem_size = 155 sizeof_field(struct ipa_mem_bounds, start), 156 .offset = offsetof(struct ipa_mem_bounds, start), 157 }, 158 { 159 .data_type = QMI_UNSIGNED_4_BYTE, 160 .elem_len = 1, 161 .elem_size = 162 sizeof_field(struct ipa_mem_bounds, end), 163 .offset = offsetof(struct ipa_mem_bounds, end), 164 }, 165 { 166 .data_type = QMI_EOTI, 167 }, 168 }; 169 170 /* QMI message structure definition for struct ipa_mem_array */ 171 struct qmi_elem_info ipa_mem_array_ei[] = { 172 { 173 .data_type = QMI_UNSIGNED_4_BYTE, 174 .elem_len = 1, 175 .elem_size = 176 sizeof_field(struct ipa_mem_array, start), 177 .offset = offsetof(struct ipa_mem_array, start), 178 }, 179 { 180 .data_type = QMI_UNSIGNED_4_BYTE, 181 .elem_len = 1, 182 .elem_size = 183 sizeof_field(struct ipa_mem_array, count), 184 .offset = offsetof(struct ipa_mem_array, count), 185 }, 186 { 187 .data_type = QMI_EOTI, 188 }, 189 }; 190 191 /* QMI message structure definition for struct ipa_mem_range */ 192 struct qmi_elem_info ipa_mem_range_ei[] = { 193 { 194 .data_type = QMI_UNSIGNED_4_BYTE, 195 .elem_len = 1, 196 .elem_size = 197 sizeof_field(struct ipa_mem_range, start), 198 .offset = offsetof(struct ipa_mem_range, start), 199 }, 200 { 201 .data_type = QMI_UNSIGNED_4_BYTE, 202 .elem_len = 1, 203 .elem_size = 204 sizeof_field(struct ipa_mem_range, size), 205 .offset = offsetof(struct ipa_mem_range, size), 206 }, 207 { 208 .data_type = QMI_EOTI, 209 }, 210 }; 211 212 /* QMI message structure definition for struct ipa_init_modem_driver_req */ 213 struct qmi_elem_info ipa_init_modem_driver_req_ei[] = { 214 { 215 .data_type = QMI_OPT_FLAG, 216 .elem_len = 1, 217 .elem_size = 218 sizeof_field(struct ipa_init_modem_driver_req, 219 platform_type_valid), 220 .tlv_type = 0x10, 221 .offset = offsetof(struct ipa_init_modem_driver_req, 222 platform_type_valid), 223 }, 224 { 225 .data_type = QMI_SIGNED_4_BYTE_ENUM, 226 .elem_len = 1, 227 .elem_size = 228 sizeof_field(struct ipa_init_modem_driver_req, 229 platform_type), 230 .tlv_type = 0x10, 231 .offset = offsetof(struct ipa_init_modem_driver_req, 232 platform_type), 233 }, 234 { 235 .data_type = QMI_OPT_FLAG, 236 .elem_len = 1, 237 .elem_size = 238 sizeof_field(struct ipa_init_modem_driver_req, 239 hdr_tbl_info_valid), 240 .tlv_type = 0x11, 241 .offset = offsetof(struct ipa_init_modem_driver_req, 242 hdr_tbl_info_valid), 243 }, 244 { 245 .data_type = QMI_STRUCT, 246 .elem_len = 1, 247 .elem_size = 248 sizeof_field(struct ipa_init_modem_driver_req, 249 hdr_tbl_info), 250 .tlv_type = 0x11, 251 .offset = offsetof(struct ipa_init_modem_driver_req, 252 hdr_tbl_info), 253 .ei_array = ipa_mem_bounds_ei, 254 }, 255 { 256 .data_type = QMI_OPT_FLAG, 257 .elem_len = 1, 258 .elem_size = 259 sizeof_field(struct ipa_init_modem_driver_req, 260 v4_route_tbl_info_valid), 261 .tlv_type = 0x12, 262 .offset = offsetof(struct ipa_init_modem_driver_req, 263 v4_route_tbl_info_valid), 264 }, 265 { 266 .data_type = QMI_STRUCT, 267 .elem_len = 1, 268 .elem_size = 269 sizeof_field(struct ipa_init_modem_driver_req, 270 v4_route_tbl_info), 271 .tlv_type = 0x12, 272 .offset = offsetof(struct ipa_init_modem_driver_req, 273 v4_route_tbl_info), 274 .ei_array = ipa_mem_array_ei, 275 }, 276 { 277 .data_type = QMI_OPT_FLAG, 278 .elem_len = 1, 279 .elem_size = 280 sizeof_field(struct ipa_init_modem_driver_req, 281 v6_route_tbl_info_valid), 282 .tlv_type = 0x13, 283 .offset = offsetof(struct ipa_init_modem_driver_req, 284 v6_route_tbl_info_valid), 285 }, 286 { 287 .data_type = QMI_STRUCT, 288 .elem_len = 1, 289 .elem_size = 290 sizeof_field(struct ipa_init_modem_driver_req, 291 v6_route_tbl_info), 292 .tlv_type = 0x13, 293 .offset = offsetof(struct ipa_init_modem_driver_req, 294 v6_route_tbl_info), 295 .ei_array = ipa_mem_array_ei, 296 }, 297 { 298 .data_type = QMI_OPT_FLAG, 299 .elem_len = 1, 300 .elem_size = 301 sizeof_field(struct ipa_init_modem_driver_req, 302 v4_filter_tbl_start_valid), 303 .tlv_type = 0x14, 304 .offset = offsetof(struct ipa_init_modem_driver_req, 305 v4_filter_tbl_start_valid), 306 }, 307 { 308 .data_type = QMI_UNSIGNED_4_BYTE, 309 .elem_len = 1, 310 .elem_size = 311 sizeof_field(struct ipa_init_modem_driver_req, 312 v4_filter_tbl_start), 313 .tlv_type = 0x14, 314 .offset = offsetof(struct ipa_init_modem_driver_req, 315 v4_filter_tbl_start), 316 }, 317 { 318 .data_type = QMI_OPT_FLAG, 319 .elem_len = 1, 320 .elem_size = 321 sizeof_field(struct ipa_init_modem_driver_req, 322 v6_filter_tbl_start_valid), 323 .tlv_type = 0x15, 324 .offset = offsetof(struct ipa_init_modem_driver_req, 325 v6_filter_tbl_start_valid), 326 }, 327 { 328 .data_type = QMI_UNSIGNED_4_BYTE, 329 .elem_len = 1, 330 .elem_size = 331 sizeof_field(struct ipa_init_modem_driver_req, 332 v6_filter_tbl_start), 333 .tlv_type = 0x15, 334 .offset = offsetof(struct ipa_init_modem_driver_req, 335 v6_filter_tbl_start), 336 }, 337 { 338 .data_type = QMI_OPT_FLAG, 339 .elem_len = 1, 340 .elem_size = 341 sizeof_field(struct ipa_init_modem_driver_req, 342 modem_mem_info_valid), 343 .tlv_type = 0x16, 344 .offset = offsetof(struct ipa_init_modem_driver_req, 345 modem_mem_info_valid), 346 }, 347 { 348 .data_type = QMI_STRUCT, 349 .elem_len = 1, 350 .elem_size = 351 sizeof_field(struct ipa_init_modem_driver_req, 352 modem_mem_info), 353 .tlv_type = 0x16, 354 .offset = offsetof(struct ipa_init_modem_driver_req, 355 modem_mem_info), 356 .ei_array = ipa_mem_range_ei, 357 }, 358 { 359 .data_type = QMI_OPT_FLAG, 360 .elem_len = 1, 361 .elem_size = 362 sizeof_field(struct ipa_init_modem_driver_req, 363 ctrl_comm_dest_end_pt_valid), 364 .tlv_type = 0x17, 365 .offset = offsetof(struct ipa_init_modem_driver_req, 366 ctrl_comm_dest_end_pt_valid), 367 }, 368 { 369 .data_type = QMI_UNSIGNED_4_BYTE, 370 .elem_len = 1, 371 .elem_size = 372 sizeof_field(struct ipa_init_modem_driver_req, 373 ctrl_comm_dest_end_pt), 374 .tlv_type = 0x17, 375 .offset = offsetof(struct ipa_init_modem_driver_req, 376 ctrl_comm_dest_end_pt), 377 }, 378 { 379 .data_type = QMI_OPT_FLAG, 380 .elem_len = 1, 381 .elem_size = 382 sizeof_field(struct ipa_init_modem_driver_req, 383 skip_uc_load_valid), 384 .tlv_type = 0x18, 385 .offset = offsetof(struct ipa_init_modem_driver_req, 386 skip_uc_load_valid), 387 }, 388 { 389 .data_type = QMI_UNSIGNED_1_BYTE, 390 .elem_len = 1, 391 .elem_size = 392 sizeof_field(struct ipa_init_modem_driver_req, 393 skip_uc_load), 394 .tlv_type = 0x18, 395 .offset = offsetof(struct ipa_init_modem_driver_req, 396 skip_uc_load), 397 }, 398 { 399 .data_type = QMI_OPT_FLAG, 400 .elem_len = 1, 401 .elem_size = 402 sizeof_field(struct ipa_init_modem_driver_req, 403 hdr_proc_ctx_tbl_info_valid), 404 .tlv_type = 0x19, 405 .offset = offsetof(struct ipa_init_modem_driver_req, 406 hdr_proc_ctx_tbl_info_valid), 407 }, 408 { 409 .data_type = QMI_STRUCT, 410 .elem_len = 1, 411 .elem_size = 412 sizeof_field(struct ipa_init_modem_driver_req, 413 hdr_proc_ctx_tbl_info), 414 .tlv_type = 0x19, 415 .offset = offsetof(struct ipa_init_modem_driver_req, 416 hdr_proc_ctx_tbl_info), 417 .ei_array = ipa_mem_bounds_ei, 418 }, 419 { 420 .data_type = QMI_OPT_FLAG, 421 .elem_len = 1, 422 .elem_size = 423 sizeof_field(struct ipa_init_modem_driver_req, 424 zip_tbl_info_valid), 425 .tlv_type = 0x1a, 426 .offset = offsetof(struct ipa_init_modem_driver_req, 427 zip_tbl_info_valid), 428 }, 429 { 430 .data_type = QMI_STRUCT, 431 .elem_len = 1, 432 .elem_size = 433 sizeof_field(struct ipa_init_modem_driver_req, 434 zip_tbl_info), 435 .tlv_type = 0x1a, 436 .offset = offsetof(struct ipa_init_modem_driver_req, 437 zip_tbl_info), 438 .ei_array = ipa_mem_bounds_ei, 439 }, 440 { 441 .data_type = QMI_OPT_FLAG, 442 .elem_len = 1, 443 .elem_size = 444 sizeof_field(struct ipa_init_modem_driver_req, 445 v4_hash_route_tbl_info_valid), 446 .tlv_type = 0x1b, 447 .offset = offsetof(struct ipa_init_modem_driver_req, 448 v4_hash_route_tbl_info_valid), 449 }, 450 { 451 .data_type = QMI_STRUCT, 452 .elem_len = 1, 453 .elem_size = 454 sizeof_field(struct ipa_init_modem_driver_req, 455 v4_hash_route_tbl_info), 456 .tlv_type = 0x1b, 457 .offset = offsetof(struct ipa_init_modem_driver_req, 458 v4_hash_route_tbl_info), 459 .ei_array = ipa_mem_array_ei, 460 }, 461 { 462 .data_type = QMI_OPT_FLAG, 463 .elem_len = 1, 464 .elem_size = 465 sizeof_field(struct ipa_init_modem_driver_req, 466 v6_hash_route_tbl_info_valid), 467 .tlv_type = 0x1c, 468 .offset = offsetof(struct ipa_init_modem_driver_req, 469 v6_hash_route_tbl_info_valid), 470 }, 471 { 472 .data_type = QMI_STRUCT, 473 .elem_len = 1, 474 .elem_size = 475 sizeof_field(struct ipa_init_modem_driver_req, 476 v6_hash_route_tbl_info), 477 .tlv_type = 0x1c, 478 .offset = offsetof(struct ipa_init_modem_driver_req, 479 v6_hash_route_tbl_info), 480 .ei_array = ipa_mem_array_ei, 481 }, 482 { 483 .data_type = QMI_OPT_FLAG, 484 .elem_len = 1, 485 .elem_size = 486 sizeof_field(struct ipa_init_modem_driver_req, 487 v4_hash_filter_tbl_start_valid), 488 .tlv_type = 0x1d, 489 .offset = offsetof(struct ipa_init_modem_driver_req, 490 v4_hash_filter_tbl_start_valid), 491 }, 492 { 493 .data_type = QMI_UNSIGNED_4_BYTE, 494 .elem_len = 1, 495 .elem_size = 496 sizeof_field(struct ipa_init_modem_driver_req, 497 v4_hash_filter_tbl_start), 498 .tlv_type = 0x1d, 499 .offset = offsetof(struct ipa_init_modem_driver_req, 500 v4_hash_filter_tbl_start), 501 }, 502 { 503 .data_type = QMI_OPT_FLAG, 504 .elem_len = 1, 505 .elem_size = 506 sizeof_field(struct ipa_init_modem_driver_req, 507 v6_hash_filter_tbl_start_valid), 508 .tlv_type = 0x1e, 509 .offset = offsetof(struct ipa_init_modem_driver_req, 510 v6_hash_filter_tbl_start_valid), 511 }, 512 { 513 .data_type = QMI_UNSIGNED_4_BYTE, 514 .elem_len = 1, 515 .elem_size = 516 sizeof_field(struct ipa_init_modem_driver_req, 517 v6_hash_filter_tbl_start), 518 .tlv_type = 0x1e, 519 .offset = offsetof(struct ipa_init_modem_driver_req, 520 v6_hash_filter_tbl_start), 521 }, 522 { 523 .data_type = QMI_OPT_FLAG, 524 .elem_len = 1, 525 .elem_size = 526 sizeof_field(struct ipa_init_modem_driver_req, 527 hw_stats_quota_base_addr_valid), 528 .tlv_type = 0x1f, 529 .offset = offsetof(struct ipa_init_modem_driver_req, 530 hw_stats_quota_base_addr_valid), 531 }, 532 { 533 .data_type = QMI_SIGNED_4_BYTE_ENUM, 534 .elem_len = 1, 535 .elem_size = 536 sizeof_field(struct ipa_init_modem_driver_req, 537 hw_stats_quota_base_addr), 538 .tlv_type = 0x1f, 539 .offset = offsetof(struct ipa_init_modem_driver_req, 540 hw_stats_quota_base_addr), 541 }, 542 { 543 .data_type = QMI_OPT_FLAG, 544 .elem_len = 1, 545 .elem_size = 546 sizeof_field(struct ipa_init_modem_driver_req, 547 hw_stats_quota_size_valid), 548 .tlv_type = 0x1f, 549 .offset = offsetof(struct ipa_init_modem_driver_req, 550 hw_stats_quota_size_valid), 551 }, 552 { 553 .data_type = QMI_SIGNED_4_BYTE_ENUM, 554 .elem_len = 1, 555 .elem_size = 556 sizeof_field(struct ipa_init_modem_driver_req, 557 hw_stats_quota_size), 558 .tlv_type = 0x1f, 559 .offset = offsetof(struct ipa_init_modem_driver_req, 560 hw_stats_quota_size), 561 }, 562 { 563 .data_type = QMI_OPT_FLAG, 564 .elem_len = 1, 565 .elem_size = 566 sizeof_field(struct ipa_init_modem_driver_req, 567 hw_stats_drop_size_valid), 568 .tlv_type = 0x1f, 569 .offset = offsetof(struct ipa_init_modem_driver_req, 570 hw_stats_drop_size_valid), 571 }, 572 { 573 .data_type = QMI_SIGNED_4_BYTE_ENUM, 574 .elem_len = 1, 575 .elem_size = 576 sizeof_field(struct ipa_init_modem_driver_req, 577 hw_stats_drop_size), 578 .tlv_type = 0x1f, 579 .offset = offsetof(struct ipa_init_modem_driver_req, 580 hw_stats_drop_size), 581 }, 582 { 583 .data_type = QMI_EOTI, 584 }, 585 }; 586 587 /* QMI message structure definition for struct ipa_init_modem_driver_rsp */ 588 struct qmi_elem_info ipa_init_modem_driver_rsp_ei[] = { 589 { 590 .data_type = QMI_STRUCT, 591 .elem_len = 1, 592 .elem_size = 593 sizeof_field(struct ipa_init_modem_driver_rsp, 594 rsp), 595 .tlv_type = 0x02, 596 .offset = offsetof(struct ipa_init_modem_driver_rsp, 597 rsp), 598 .ei_array = qmi_response_type_v01_ei, 599 }, 600 { 601 .data_type = QMI_OPT_FLAG, 602 .elem_len = 1, 603 .elem_size = 604 sizeof_field(struct ipa_init_modem_driver_rsp, 605 ctrl_comm_dest_end_pt_valid), 606 .tlv_type = 0x10, 607 .offset = offsetof(struct ipa_init_modem_driver_rsp, 608 ctrl_comm_dest_end_pt_valid), 609 }, 610 { 611 .data_type = QMI_UNSIGNED_4_BYTE, 612 .elem_len = 1, 613 .elem_size = 614 sizeof_field(struct ipa_init_modem_driver_rsp, 615 ctrl_comm_dest_end_pt), 616 .tlv_type = 0x10, 617 .offset = offsetof(struct ipa_init_modem_driver_rsp, 618 ctrl_comm_dest_end_pt), 619 }, 620 { 621 .data_type = QMI_OPT_FLAG, 622 .elem_len = 1, 623 .elem_size = 624 sizeof_field(struct ipa_init_modem_driver_rsp, 625 default_end_pt_valid), 626 .tlv_type = 0x11, 627 .offset = offsetof(struct ipa_init_modem_driver_rsp, 628 default_end_pt_valid), 629 }, 630 { 631 .data_type = QMI_UNSIGNED_4_BYTE, 632 .elem_len = 1, 633 .elem_size = 634 sizeof_field(struct ipa_init_modem_driver_rsp, 635 default_end_pt), 636 .tlv_type = 0x11, 637 .offset = offsetof(struct ipa_init_modem_driver_rsp, 638 default_end_pt), 639 }, 640 { 641 .data_type = QMI_OPT_FLAG, 642 .elem_len = 1, 643 .elem_size = 644 sizeof_field(struct ipa_init_modem_driver_rsp, 645 modem_driver_init_pending_valid), 646 .tlv_type = 0x12, 647 .offset = offsetof(struct ipa_init_modem_driver_rsp, 648 modem_driver_init_pending_valid), 649 }, 650 { 651 .data_type = QMI_UNSIGNED_1_BYTE, 652 .elem_len = 1, 653 .elem_size = 654 sizeof_field(struct ipa_init_modem_driver_rsp, 655 modem_driver_init_pending), 656 .tlv_type = 0x12, 657 .offset = offsetof(struct ipa_init_modem_driver_rsp, 658 modem_driver_init_pending), 659 }, 660 { 661 .data_type = QMI_EOTI, 662 }, 663 }; 664