nfapi_interface.h 118 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
/*
 * Copyright 2017 Cisco Systems, Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


#ifndef _NFAPI_INTERFACE_H_
#define _NFAPI_INTERFACE_H_

#include "stddef.h"

// Constants - update based on implementation
#define NFAPI_MAX_PHY_RF_INSTANCES 2
#define NFAPI_PNF_PARAM_GENERAL_LOCATION_LENGTH 16
#define NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH 3
#define NFAPI_MAX_NUM_RF_BANDS 16

// The following definition control the size of arrays used in the interface.
// These may be changed if desired. They are used in the encoder to make sure 
// that the user has not specified a 'count' larger than the max array, and also
// used by the decoder when decode an array. If the 'count' received is larger
// than the array it is to be stored in the decode fails. 
#define NFAPI_MAX_NUM_ANTENNAS 8
#define NFAPI_MAX_NUM_SUBBANDS 13
#define NFAPI_MAX_BF_VECTORS 8
Cedric Roux's avatar
Cedric Roux committed
37
#define NFAPI_MAX_CC 1
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310
#define NFAPI_MAX_NUM_PHYSICAL_ANTENNAS 8
#define NFAPI_MAX_RSSI 8
#define NFAPI_MAX_PSC_LIST 32
#define NFAPI_MAX_PCI_LIST 32
#define NFAPI_MAX_CARRIER_LIST 32
#define NFAPI_MAX_ARFCN_LIST 128
#define NFAPI_MAX_LTE_CELLS_FOUND 8
#define NFAPI_MAX_UTRAN_CELLS_FOUND 8
#define NFAPI_MAX_GSM_CELLS_FOUND 8
#define NFAPI_MAX_NB_IOT_CELLS_FOUND 8
#define NFAPI_MAX_SI_PERIODICITY 8
#define NFAPI_MAX_SI_INDEX 8
#define NFAPI_MAX_MIB_LENGTH 32
#define NFAPI_MAX_SIB_LENGTH 256
#define NFAPI_MAX_SI_LENGTH 256
#define NFAPI_MAX_OPAQUE_DATA 64
#define NFAPI_MAX_NUM_SCHEDULED_UES 8 // Used in the TPM structure
#define NFAPI_MAX_PNF_PHY 5
#define NFAPI_MAX_PNF_PHY_RF_CONFIG 5
#define NFAPI_MAX_PNF_RF  5
#define NFAPI_MAX_NMM_FREQUENCY_BANDS 32
#define NFAPI_MAX_RECEIVED_INTERFERENCE_POWER_RESULTS 100
#define NFAPI_MAX_UL_DL_CONFIGURATIONS 5
#define NFAPI_MAX_CSI_RS_RESOURCE_CONFIG 4
#define NFAPI_MAX_ANTENNA_PORT_COUNT 8
#define NFAPI_MAX_EPDCCH_PRB 8
#define NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS 8
#define NFAPI_MAX_NUMBER_ACK_NACK_TDD 8
#define NFAPI_MAX_RO_DL 8

#define NFAPI_HEADER_LENGTH 8
#define NFAPI_P7_HEADER_LENGTH 16

#define NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE 0xF000
#define NFAPI_VENDOR_EXTENSION_MAX_TAG_VALUE 0xFFFF

#define NFAPI_VERSION_3_0_11	0x000
#define NFAPI_VERSION_3_0_12    0x001

// The IANA agreed port definition of the P5 SCTP VNF enpoint 
// http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=7701
#define NFAPI_P5_SCTP_PORT		7701

typedef unsigned int	uint32_t;
typedef unsigned short	uint16_t;
typedef unsigned char	uint8_t;
typedef signed int		int32_t;
typedef signed short	int16_t;
typedef signed char		int8_t;

typedef struct {
	uint16_t phy_id;
	uint16_t message_id;
	uint16_t message_length;
	uint16_t spare;
} nfapi_p4_p5_message_header_t;

typedef struct {
	uint16_t phy_id;
	uint16_t message_id;
	uint16_t message_length;
	uint16_t m_segment_sequence; /* This consists of 3 fields - namely, M, Segement & Sequence number*/
	uint32_t checksum;
	uint32_t transmit_timestamp;
} nfapi_p7_message_header_t;

#define NFAPI_PHY_ID_NA 0

//#define NFAPI_P7_GET_MORE(_mss) ( ((_mss) & 0x80) >> 7 )
//#define NFAPI_P7_GET_SEGMENT(_mss) ( ((_mss) & 0x70) >> 4 )
#define NFAPI_P7_GET_MORE(_mss) ( ((_mss) & 0x8000) >> 15 )
#define NFAPI_P7_GET_SEGMENT(_mss) ( ((_mss) & 0x7F00) >> 8 )
#define NFAPI_P7_GET_SEQUENCE(_mss) ( (_mss) & 0x00FF )
#define NFAPI_P7_SET_MSS(_more, _segm, _sequ) ( (((_more) & 0x1) << 7) | (((_segm) & 0x7) << 4) | ((_sequ) & 0xF) )

typedef struct {
	uint16_t tag;
	uint16_t length;
} nfapi_tl_t;
#define NFAPI_TAG_LENGTH_PACKED_LEN 4

// Convenience methods to convert between SFN/SFN formats
#define NFAPI_SFNSF2DEC(_sfnsf) ((((_sfnsf) >> 4) * 10) + ((_sfnsf) & 0xF))
#define NFAPI_SFNSFDEC2SFNSF(_sfnsf_dec) ((((_sfnsf_dec) / 10) << 4) | (((_sfnsf_dec) - (((_sfnsf_dec) / 10) * 10)) & 0xF))

#define NFAPI_SFNSF2SFN(_sfnsf) ((_sfnsf) >> 4)
#define NFAPI_SFNSF2SF(_sfnsf) ((_sfnsf) & 0xF)

#define NFAPI_MAX_SFNSFDEC 10240

typedef nfapi_tl_t* nfapi_vendor_extension_tlv_t;


// nFAPI Message IDs
typedef enum {
	NFAPI_DL_CONFIG_REQUEST = 0x0080,
	NFAPI_UL_CONFIG_REQUEST,
	NFAPI_SUBFRAME_INDICATION,
	NFAPI_HI_DCI0_REQUEST,
	NFAPI_TX_REQUEST,
	NFAPI_HARQ_INDICATION,
	NFAPI_CRC_INDICATION,
	NFAPI_RX_ULSCH_INDICATION,
	NFAPI_RACH_INDICATION,
	NFAPI_SRS_INDICATION,
	NFAPI_RX_SR_INDICATION,
	NFAPI_RX_CQI_INDICATION,
	NFAPI_LBT_DL_CONFIG_REQUEST,
	NFAPI_LBT_DL_INDICATION,
	NFAPI_NB_HARQ_INDICATION,
	NFAPI_NRACH_INDICATION,

	NFAPI_PNF_PARAM_REQUEST = 0x0100,
	NFAPI_PNF_PARAM_RESPONSE,
	NFAPI_PNF_CONFIG_REQUEST,
	NFAPI_PNF_CONFIG_RESPONSE,
	NFAPI_PNF_START_REQUEST,
	NFAPI_PNF_START_RESPONSE,
	NFAPI_PNF_STOP_REQUEST,
	NFAPI_PNF_STOP_RESPONSE,
	NFAPI_PARAM_REQUEST,
	NFAPI_PARAM_RESPONSE,
	NFAPI_CONFIG_REQUEST,
	NFAPI_CONFIG_RESPONSE,
	NFAPI_START_REQUEST,
	NFAPI_START_RESPONSE,
	NFAPI_STOP_REQUEST,
	NFAPI_STOP_RESPONSE,
	NFAPI_MEASUREMENT_REQUEST,
	NFAPI_MEASUREMENT_RESPONSE,

	NFAPI_UL_NODE_SYNC = 0x0180,
	NFAPI_DL_NODE_SYNC,
	NFAPI_TIMING_INFO,


	NFAPI_RSSI_REQUEST = 0x0200,
	NFAPI_RSSI_RESPONSE,
	NFAPI_RSSI_INDICATION,
	NFAPI_CELL_SEARCH_REQUEST,
	NFAPI_CELL_SEARCH_RESPONSE,
	NFAPI_CELL_SEARCH_INDICATION,
	NFAPI_BROADCAST_DETECT_REQUEST,
	NFAPI_BROADCAST_DETECT_RESPONSE,
	NFAPI_BROADCAST_DETECT_INDICATION,
	NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST,
	NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE,
	NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION,
	NFAPI_SYSTEM_INFORMATION_REQUEST,
	NFAPI_SYSTEM_INFORMATION_RESPONSE,
	NFAPI_SYSTEM_INFORMATION_INDICATION,
	NFAPI_NMM_STOP_REQUEST,
	NFAPI_NMM_STOP_RESPONSE,

	NFAPI_VENDOR_EXT_MSG_MIN = 0x0300,
	NFAPI_VENDOR_EXT_MSG_MAX = 0x03FF,


	NFAPI_MAX_MESSAGE_ID,
} nfapi_message_id_e;

// nFAPI Error Codes
typedef enum {
	NFAPI_MSG_OK = 0,
	NFAPI_MSG_INVALID_STATE,
	NFAPI_MSG_INVALID_CONFIG,
	NFAPI_SFN_OUT_OF_SYNC,
	NFAPI_MSG_SUBFRAME_ERR,
	NFAPI_MSG_BCH_MISSING,
	NFAPI_MSG_INVALID_SFN,
	NFAPI_MSG_HI_ERR,
	NFAPI_MSG_TX_ERR,
	
	NFAPI_LBT_NO_PDU_IN_DL_REQ,
	NFAPI_LBT_NO_VALID_CONFIG_REQ_RECEIVED,
	NFAPI_FAPI_E_LBT_SF_SFN_PASSED_END_SF_SFN,
	NFAPI_FAPI_E_LBT_OVERLAP,
	NFAPI_MSG_BCH_PRESENT,
	
	NFAPI_NBIOT_UNEXPECTED_REQ,

	// This is special return code that indicates that a response has
	// been send via P9
	NFAPI_MSG_P9_RESPONSE = 0xAA
} nfapi_error_code_e;


typedef enum {
	NFAPI_P4_MSG_OK = 100,
	NFAPI_P4_MSG_INVALID_STATE = 101,
	NFAPI_P4_MSG_INVALID_CONFIG = 102,
	NFAPI_P4_MSG_RAT_NOT_SUPPORTED = 103,
	NFAPI_P4_MSG_NMM_STOP_OK = 200,
	NFAPI_P4_MSG_NMM_STOP_IGNOREDED = 201,
	NFAPI_P4_MSG_NMM_STOP_INVALID_STATE = 202,
	NFAPI_P4_MSG_PROCEDURE_COMPLETE = 300,
	NFAPI_P4_MSG_PROCEDURE_STOPPED = 301,
	NFAPI_P4_MSG_PARTIAL_RESULTS = 302,
	NFAPI_P4_MSG_TIMEOUT = 303
} nfapi_p4_error_code_e;

// nFAPI enums
typedef enum {
	NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE = 0,
	NFAPI_DL_CONFIG_BCH_PDU_TYPE,
	NFAPI_DL_CONFIG_MCH_PDU_TYPE,
	NFAPI_DL_CONFIG_DLSCH_PDU_TYPE,
	NFAPI_DL_CONFIG_PCH_PDU_TYPE,
	NFAPI_DL_CONFIG_PRS_PDU_TYPE,
	NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE,
	NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE,
	NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE,
	NFAPI_DL_CONFIG_NBCH_PDU_TYPE,
	NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE,
	NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE
} nfapi_dl_config_pdu_type_e;

typedef enum {
	NFAPI_DL_DCI_FORMAT_1 = 0,
	NFAPI_DL_DCI_FORMAT_1A,
	NFAPI_DL_DCI_FORMAT_1B,
	NFAPI_DL_DCI_FORMAT_1C,
	NFAPI_DL_DCI_FORMAT_1D,
	NFAPI_DL_DCI_FORMAT_2,
	NFAPI_DL_DCI_FORMAT_2A,
	NFAPI_DL_DCI_FORMAT_2B,
	NFAPI_DL_DCI_FORMAT_2C
} nfapi_dl_dci_format_e;

typedef enum {
	NFAPI_UL_DCI_FORMAT_0 = 0,
	NFAPI_UL_DCI_FORMAT_3,
	NFAPI_UL_DCI_FORMAT_3A,
	NFAPI_UL_DCI_FORMAT_4
} nfapi_ul_dci_format_e;

typedef enum {
	NFAPI_UL_CONFIG_ULSCH_PDU_TYPE = 0,
	NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE,
	NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE,
	NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE,
	NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE,
	NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE,
	NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE,
	NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE,
	NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE,
	NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE,
	NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE,
	NFAPI_UL_CONFIG_SRS_PDU_TYPE,
	NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE,
	NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE,
	NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE,
	NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE,
	NFAPI_UL_CONFIG_NULSCH_PDU_TYPE,
	NFAPI_UL_CONFIG_NRACH_PDU_TYPE,
} nfapi_ul_config_pdu_type_e;

typedef enum {
	NFAPI_HI_DCI0_HI_PDU_TYPE = 0,
	NFAPI_HI_DCI0_DCI_PDU_TYPE,
	NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE,
	NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE,
	NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE,
} nfapi_hi_dci0_pdu_type_e;

typedef enum {
	NFAPI_HARQ_ACK = 1,
	NFAPI_HARQ_NACK,
	NFAPI_HARQ_ACK_OR_NACK,
	NFAPI_HARQ_DTX,
	NFAPI_HARQ_ACK_OR_DTX,
	NFAPI_HARQ_NACK_OR_DTX,
	NFAPI_HARQ_ACK_OR_NACK_OR_DTX
} nfapi_harq_type_e;

typedef enum {
	NFAPI_CSI_REPORT_TYPE_PERIODIC = 0,
	NFAPI_CSI_REPORT_TYPE_APERIODIC
} nfapi_csi_report_type_e;

typedef enum {
	NFAPI_DL_BW_SUPPORTED_6 = 1,
	NFAPI_DL_BW_SUPPORTED_15 = 2,
	NFAPI_DL_BW_SUPPORTED_25 = 4,
	NFAPI_DL_BW_SUPPORTED_50 = 8,
	NFAPI_DL_BW_SUPPORTED_75 = 16,
	NFAPI_DL_BW_SUPPORTED_100 = 32
} nfapi_dl_bandwith_supported_e;

typedef enum {
	NFAPI_UL_BW_SUPPORTED_6 = 1,
	NFAPI_UL_BW_SUPPORTED_15 = 2,
	NFAPI_UL_BW_SUPPORTED_25 = 4,
	NFAPI_UL_BW_SUPPORTED_50 = 8,
	NFAPI_UL_BW_SUPPORTED_75 = 16,
	NFAPI_UL_BW_SUPPORTED_100 = 32
} nfapi_ul_bandwith_supported_e;

typedef enum {
	NFAPI_3GPP_REL_SUPPORTED_8 = 0,
	NFAPI_3GPP_REL_SUPPORTED_9 = 1,
	NFAPI_3GPP_REL_SUPPORTED_10 = 2,
	NFAPI_3GPP_REL_SUPPORTED_11 = 4,
	NFAPI_3GPP_REL_SUPPORTED_12 = 8
} nfapi_3gpp_release_supported_e;


typedef enum {
	NFAPI_DUPLEXING_MODE_TDD = 0,
	NFAPI_DUPLEXING_MODE_FDD = 1,
	NFAPI_DUPLEXING_MODE_HD_FDD = 2,
} nfapi_duplexing_mode_e;

typedef enum {
	NFAPI_CP_NORMAL = 0,
	NFAPI_CP_EXTENDED = 1
} nfapi_cyclic_prefix_type_e;

typedef enum {
	NFAPI_RAT_TYPE_LTE = 0,
	NFAPI_RAT_TYPE_UTRAN = 1,
	NFAPI_RAT_TYPE_GERAN = 2,
	NFAPI_RAT_TYPE_NB_IOT = 3
} nfapi_rat_type_e;

typedef enum {
	NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING,
	NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING,
	NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING,
	NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION,
	NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3,
	NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_4,
	NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_5
} nfapi_harq_indication_tdd_ack_nackformat_e;


typedef enum {
	NFAPI_LBT_DL_CONFIG_REQUEST_PDSCH_PDU_TYPE = 0,
	NFAPI_LBT_DL_CONFIG_REQUEST_DRS_PDU_TYPE
} nfapi_lbt_dl_config_pdu_type_e;

typedef enum {
	NFAPI_LBT_DL_RSP_PDSCH_PDU_TYPE = 0,
	NFAPI_LBT_DL_RSP_DRS_PDU_TYPE
} nfapi_lbt_dl_rsp_pdu_type_e;

typedef struct {
	nfapi_tl_t tl;
	uint32_t length;
	uint8_t value[NFAPI_MAX_OPAQUE_DATA];
} nfapi_opaqaue_data_t;

// Utility functions to turn enums into char*
const char* nfapi_error_code_to_str(nfapi_error_code_e value);


// P5 Sub Structures
typedef struct {
	nfapi_tl_t tl;
	uint8_t nfapi_sync_mode;
	uint8_t location_mode;
	uint16_t location_coordinates_length;
	uint8_t location_coordinates[NFAPI_PNF_PARAM_GENERAL_LOCATION_LENGTH];
	uint32_t dl_config_timing;
	uint32_t tx_timing;
	uint32_t ul_config_timing;
	uint32_t hi_dci0_timing;
	uint16_t maximum_number_phys;
	uint16_t maximum_total_bandwidth;
	uint8_t maximum_total_number_dl_layers;
	uint8_t maximum_total_number_ul_layers;
	uint8_t shared_bands;
	uint8_t shared_pa;
	int16_t maximum_total_power;
	uint8_t oui[NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH];
} nfapi_pnf_param_general_t;
#define NFAPI_PNF_PARAM_GENERAL_TAG 0x1000





typedef struct {
	uint16_t rf_config_index;
} nfapi_rf_config_info_t;

typedef struct {
	uint16_t phy_config_index;
	uint16_t number_of_rfs;
	nfapi_rf_config_info_t rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG];
	uint16_t number_of_rf_exclusions;
	nfapi_rf_config_info_t excluded_rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG];
	uint16_t downlink_channel_bandwidth_supported;
	uint16_t uplink_channel_bandwidth_supported;
	uint8_t number_of_dl_layers_supported;
	uint8_t number_of_ul_layers_supported;
	uint16_t maximum_3gpp_release_supported;
	uint8_t nmm_modes_supported;
} nfapi_pnf_phy_info_t;


typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_phys;
	nfapi_pnf_phy_info_t phy[NFAPI_MAX_PNF_PHY];
} nfapi_pnf_phy_t;
#define NFAPI_PNF_PHY_TAG 0x1001

typedef struct {
	uint16_t phy_config_index;
	uint16_t transmission_mode_7_supported;
	uint16_t transmission_mode_8_supported;
	uint16_t two_antenna_ports_for_pucch;
	uint16_t transmission_mode_9_supported;
	uint16_t simultaneous_pucch_pusch;
	uint16_t four_layer_tx_with_tm3_and_tm4;
} nfapi_pnf_phy_rel10_info_t;

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_phys;
	nfapi_pnf_phy_rel10_info_t phy[NFAPI_MAX_PNF_PHY];
} nfapi_pnf_phy_rel10_t;
#define NFAPI_PNF_PHY_REL10_TAG 0x100A

typedef struct {
	uint16_t phy_config_index;
	uint16_t edpcch_supported;
	uint16_t multi_ack_csi_reporting;
	uint16_t pucch_tx_diversity;
	uint16_t ul_comp_supported;
	uint16_t transmission_mode_5_supported;
} nfapi_pnf_phy_rel11_info_t;

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_phys;
	nfapi_pnf_phy_rel11_info_t phy[NFAPI_MAX_PNF_PHY];
} nfapi_pnf_phy_rel11_t;
#define NFAPI_PNF_PHY_REL11_TAG 0x100B


typedef struct {
	uint16_t phy_config_index;
	uint16_t csi_subframe_set;
	uint16_t enhanced_4tx_codebook;
	uint16_t drs_supported;
	uint16_t ul_64qam_supported;
	uint16_t transmission_mode_10_supported;
	uint16_t alternative_bts_indices;
} nfapi_pnf_phy_rel12_info_t;

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_phys;
	nfapi_pnf_phy_rel12_info_t phy[NFAPI_MAX_PNF_PHY];
} nfapi_pnf_phy_rel12_t;
#define NFAPI_PNF_PHY_REL12_TAG 0x100C

typedef struct {
	uint16_t phy_config_index;
	uint16_t pucch_format4_supported;
	uint16_t pucch_format5_supported;
	uint16_t more_than_5_ca_support;
	uint16_t laa_supported;
	uint16_t laa_ending_in_dwpts_supported;
	uint16_t laa_starting_in_second_slot_supported;
	uint16_t beamforming_supported;
	uint16_t csi_rs_enhancement_supported;
	uint16_t drms_enhancement_supported;
	uint16_t srs_enhancement_supported;
} nfapi_pnf_phy_rel13_info_t;

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_phys;
	nfapi_pnf_phy_rel13_info_t phy[NFAPI_MAX_PNF_PHY];
} nfapi_pnf_phy_rel13_t;
#define NFAPI_PNF_PHY_REL13_TAG 0x100D

typedef struct {
	uint16_t phy_config_index;
	uint16_t number_of_rfs;
	nfapi_rf_config_info_t rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG];
	uint16_t number_of_rf_exclusions;
	nfapi_rf_config_info_t excluded_rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG];
	uint8_t number_of_dl_layers_supported;
	uint8_t number_of_ul_layers_supported;
	uint16_t maximum_3gpp_release_supported;
	uint8_t nmm_modes_supported;
} nfapi_pnf_phy_rel13_nb_iot_info_t;

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_phys;
	nfapi_pnf_phy_rel13_nb_iot_info_t phy[NFAPI_MAX_PNF_PHY];
} nfapi_pnf_phy_rel13_nb_iot_t;
#define NFAPI_PNF_PHY_REL13_NB_IOT_TAG 0x100E



typedef struct {
	uint16_t rf_config_index;
	uint16_t band;
	int16_t maximum_transmit_power; 
	int16_t minimum_transmit_power;
	uint8_t number_of_antennas_suppported;
	uint32_t minimum_downlink_frequency;
	uint32_t maximum_downlink_frequency;
	uint32_t minimum_uplink_frequency;
	uint32_t maximum_uplink_frequency;
} nfapi_pnf_rf_info_t;

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_rfs;
	nfapi_pnf_rf_info_t rf[NFAPI_MAX_PNF_RF];
} nfapi_pnf_rf_t;
#define NFAPI_PNF_RF_TAG 0x1002

typedef struct {
	uint16_t phy_id;
	uint16_t phy_config_index;
	uint16_t rf_config_index;
} nfapi_phy_rf_config_info_t;

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_phy_rf_config_info;
	nfapi_phy_rf_config_info_t phy_rf_config[NFAPI_MAX_PHY_RF_INSTANCES];
} nfapi_pnf_phy_rf_config_t;
#define NFAPI_PNF_PHY_RF_TAG 0x1003

// Generic strucutre for single tlv value.
typedef struct {
	nfapi_tl_t tl;
	uint16_t value;
} nfapi_uint16_tlv_t;

typedef struct {
	nfapi_tl_t tl;
	int16_t value;
} nfapi_int16_tlv_t;

typedef struct {
	nfapi_tl_t tl;
	uint8_t value;
} nfapi_uint8_tlv_t;

typedef struct {
	nfapi_uint16_tlv_t phy_state;
} nfapi_l1_status;

#define NFAPI_L1_STATUS_PHY_STATE_TAG 0x00FA

typedef struct {
	nfapi_uint16_tlv_t dl_bandwidth_support;
	nfapi_uint16_tlv_t ul_bandwidth_support;
	nfapi_uint16_tlv_t dl_modulation_support;
	nfapi_uint16_tlv_t ul_modulation_support;
	nfapi_uint16_tlv_t phy_antenna_capability;
	nfapi_uint16_tlv_t release_capability;
	nfapi_uint16_tlv_t mbsfn_capability;
} nfapi_phy_capabilities_t;

#define NFAPI_PHY_CAPABILITIES_DL_BANDWIDTH_SUPPORT_TAG 0x00C8
#define NFAPI_PHY_CAPABILITIES_UL_BANDWIDTH_SUPPORT_TAG 0x00C9
#define NFAPI_PHY_CAPABILITIES_DL_MODULATION_SUPPORT_TAG 0x00CA
#define NFAPI_PHY_CAPABILITIES_UL_MODULATION_SUPPORT_TAG 0x00CB
#define NFAPI_PHY_CAPABILITIES_PHY_ANTENNA_CAPABILITY_TAG 0x00CC
#define NFAPI_PHY_CAPABILITIES_RELEASE_CAPABILITY_TAG 0x00CD
#define NFAPI_PHY_CAPABILITIES_MBSFN_CAPABILITY_TAG 0x00CE


typedef struct {
	nfapi_uint16_tlv_t data_report_mode;
	nfapi_uint16_tlv_t sfnsf;
} nfapi_l23_config_t;


#define NFAPI_L23_CONFIG_DATA_REPORT_MODE_TAG 0x00F0
#define NFAPI_L23_CONFIG_SFNSF_TAG 0x00F1

typedef struct {
	nfapi_uint16_tlv_t duplex_mode;
	nfapi_uint16_tlv_t pcfich_power_offset;
	nfapi_uint16_tlv_t pb;
	nfapi_uint16_tlv_t dl_cyclic_prefix_type;
	nfapi_uint16_tlv_t ul_cyclic_prefix_type;
} nfapi_subframe_config_t;

#define NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG 0x0001
#define NFAPI_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG 0x0002
#define NFAPI_SUBFRAME_CONFIG_PB_TAG 0x0003
#define NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG 0x0004
#define NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG 0x0005

typedef struct {
	nfapi_uint16_tlv_t dl_channel_bandwidth;
	nfapi_uint16_tlv_t ul_channel_bandwidth;
	nfapi_uint16_tlv_t reference_signal_power;
	nfapi_uint16_tlv_t tx_antenna_ports;
	nfapi_uint16_tlv_t rx_antenna_ports;
} nfapi_rf_config_t;

#define NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG 0x000A
#define NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG 0x000B
#define NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG 0x000C
#define NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG 0x000D
#define NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG 0x000E

typedef struct {
	nfapi_uint16_tlv_t phich_resource;
	nfapi_uint16_tlv_t phich_duration;
	nfapi_uint16_tlv_t phich_power_offset;
} nfapi_phich_config_t;

#define NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG 0x0014
#define NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG 0x0015
#define NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG 0x0016

typedef struct {
	nfapi_uint16_tlv_t primary_synchronization_signal_epre_eprers;
	nfapi_uint16_tlv_t secondary_synchronization_signal_epre_eprers;
	nfapi_uint16_tlv_t physical_cell_id;
} nfapi_sch_config_t;

#define NFAPI_SCH_CONFIG_PRIMARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG 0x001E
#define NFAPI_SCH_CONFIG_SECONDARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG 0x001F
#define NFAPI_SCH_CONFIG_PHYSICAL_CELL_ID_TAG 0x0020

typedef struct {
	nfapi_uint16_tlv_t configuration_index;
	nfapi_uint16_tlv_t root_sequence_index;
	nfapi_uint16_tlv_t zero_correlation_zone_configuration;
	nfapi_uint16_tlv_t high_speed_flag;
	nfapi_uint16_tlv_t frequency_offset;
} nfapi_prach_config_t;

#define NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG 0x0028
#define NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG 0x0029
#define NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG 0x002A
#define NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG 0x002B
#define NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG 0x002C

typedef struct {
	nfapi_uint16_tlv_t hopping_mode;
	nfapi_uint16_tlv_t hopping_offset;
	nfapi_uint16_tlv_t number_of_subbands;
} nfapi_pusch_config_t;

#define NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG 0x0032
#define NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG 0x0033
#define NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG 0x0034

typedef struct {
	nfapi_uint16_tlv_t delta_pucch_shift;
	nfapi_uint16_tlv_t n_cqi_rb;
	nfapi_uint16_tlv_t n_an_cs;
	nfapi_uint16_tlv_t n1_pucch_an;
} nfapi_pucch_config_t;

#define NFAPI_PUCCH_CONFIG_DELTA_PUCCH_SHIFT_TAG 0x003C
#define NFAPI_PUCCH_CONFIG_N_CQI_RB_TAG 0x003D
#define NFAPI_PUCCH_CONFIG_N_AN_CS_TAG 0x003E
#define NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG 0x003F

typedef struct {
	nfapi_uint16_tlv_t bandwidth_configuration;
	nfapi_uint16_tlv_t max_up_pts;
	nfapi_uint16_tlv_t srs_subframe_configuration;
	nfapi_uint16_tlv_t srs_acknack_srs_simultaneous_transmission;
} nfapi_srs_config_t;

#define NFAPI_SRS_CONFIG_BANDWIDTH_CONFIGURATION_TAG 0x0046
#define NFAPI_SRS_CONFIG_MAX_UP_PTS_TAG 0x0047
#define NFAPI_SRS_CONFIG_SRS_SUBFRAME_CONFIGURATION_TAG 0x0048
#define NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG 0x0049

typedef struct {
	nfapi_uint16_tlv_t uplink_rs_hopping;
	nfapi_uint16_tlv_t group_assignment;
	nfapi_uint16_tlv_t cyclic_shift_1_for_drms;
} nfapi_uplink_reference_signal_config_t;

#define NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG 0x0050
#define NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG 0x0051
#define NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG 0x0052


typedef struct {
	nfapi_uint16_tlv_t ed_threshold_lbt_pdsch;
	nfapi_uint16_tlv_t ed_threshold_lbt_drs;
	nfapi_uint16_tlv_t pd_threshold;
	nfapi_uint16_tlv_t multi_carrier_type;
	nfapi_uint16_tlv_t multi_carrier_tx;
	nfapi_uint16_tlv_t multi_carrier_freeze;
	nfapi_uint16_tlv_t tx_antenna_ports_drs;
	nfapi_uint16_tlv_t tx_power_drs;
} nfapi_laa_config_t;

#define NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_PDSCH_TAG 0x0064
#define NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_DRS_TAG 0x0065
#define NFAPI_LAA_CONFIG_PD_THRESHOLD_TAG 0x0066
#define NFAPI_LAA_CONFIG_MULTI_CARRIER_TYPE_TAG 0x0067
#define NFAPI_LAA_CONFIG_MULTI_CARRIER_TX_TAG 0x0068
#define NFAPI_LAA_CONFIG_MULTI_CARRIER_FREEZE_TAG 0x0069
#define NFAPI_LAA_CONFIG_TX_ANTENNA_PORTS_FOR_DRS_TAG 0x006A
#define NFAPI_LAA_CONFIG_TRANSMISSION_POWER_FOR_DRS_TAG 0x006B

typedef struct {

	nfapi_uint16_tlv_t pbch_repetitions_enable_r13;
	nfapi_uint16_tlv_t prach_catm_root_sequence_index;
	nfapi_uint16_tlv_t prach_catm_zero_correlation_zone_configuration;
	nfapi_uint16_tlv_t prach_catm_high_speed_flag;
	nfapi_uint16_tlv_t prach_ce_level_0_enable;
	nfapi_uint16_tlv_t prach_ce_level_0_configuration_index;
	nfapi_uint16_tlv_t prach_ce_level_0_frequency_offset;
	nfapi_uint16_tlv_t prach_ce_level_0_number_of_repetitions_per_attempt;
	nfapi_uint16_tlv_t prach_ce_level_0_starting_subframe_periodicity;
	nfapi_uint16_tlv_t prach_ce_level_0_hopping_enable;
	nfapi_uint16_tlv_t prach_ce_level_0_hopping_offset;
	nfapi_uint16_tlv_t prach_ce_level_1_enable;
	nfapi_uint16_tlv_t prach_ce_level_1_configuration_index;
	nfapi_uint16_tlv_t prach_ce_level_1_frequency_offset;
	nfapi_uint16_tlv_t prach_ce_level_1_number_of_repetitions_per_attempt;
	nfapi_uint16_tlv_t prach_ce_level_1_starting_subframe_periodicity;
	nfapi_uint16_tlv_t prach_ce_level_1_hopping_enable;
	nfapi_uint16_tlv_t prach_ce_level_1_hopping_offset;
	nfapi_uint16_tlv_t prach_ce_level_2_enable;
	nfapi_uint16_tlv_t prach_ce_level_2_configuration_index;
	nfapi_uint16_tlv_t prach_ce_level_2_frequency_offset;
	nfapi_uint16_tlv_t prach_ce_level_2_number_of_repetitions_per_attempt;
	nfapi_uint16_tlv_t prach_ce_level_2_starting_subframe_periodicity;
	nfapi_uint16_tlv_t prach_ce_level_2_hopping_enable;
	nfapi_uint16_tlv_t prach_ce_level_2_hopping_offset;
	nfapi_uint16_tlv_t prach_ce_level_3_enable;
	nfapi_uint16_tlv_t prach_ce_level_3_configuration_index;
	nfapi_uint16_tlv_t prach_ce_level_3_frequency_offset;
	nfapi_uint16_tlv_t prach_ce_level_3_number_of_repetitions_per_attempt;
	nfapi_uint16_tlv_t prach_ce_level_3_starting_subframe_periodicity;
	nfapi_uint16_tlv_t prach_ce_level_3_hopping_enable;
	nfapi_uint16_tlv_t prach_ce_level_3_hopping_offset;
	nfapi_uint16_tlv_t pucch_interval_ulhoppingconfigcommonmodea;
	nfapi_uint16_tlv_t pucch_interval_ulhoppingconfigcommonmodeb;
} nfapi_emtc_config_t;

#define NFAPI_EMTC_CONFIG_PBCH_REPETITIONS_ENABLE_R13_TAG 0x0078
#define NFAPI_EMTC_CONFIG_PRACH_CATM_ROOT_SEQUENCE_INDEX_TAG 0x0079
#define NFAPI_EMTC_CONFIG_PRACH_CATM_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG 0x007A
#define NFAPI_EMTC_CONFIG_PRACH_CATM_HIGH_SPEED_FLAG 0x007B
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_ENABLE_TAG 0x007C
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_CONFIGURATION_INDEX_TAG 0x007D
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_FREQUENCY_OFFSET_TAG 0x007E
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x007F
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_STARTING_SUBFRAME_PERIODICITY_TAG 0x0080
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_ENABLE_TAG 0x0081
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_OFFSET_TAG 0x0082
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_ENABLE_TAG 0x0083
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_CONFIGURATION_INDEX_TAG 0x0084
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_FREQUENCY_OFFSET_TAG 0x0085
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x0086
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_STARTING_SUBFRAME_PERIODICITY_TAG 0x0087
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_ENABLE_TAG 0x0088
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_OFFSET_TAG 0x0089
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_ENABLE_TAG 0x008A
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_CONFIGURATION_INDEX_TAG 0x008B
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_FREQUENCY_OFFSET_TAG 0x008C
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x008D
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_STARTING_SUBFRAME_PERIODICITY_TAG 0x008E
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_ENABLE_TAG 0x008F
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_OFFSET_TAG 0x0090
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_ENABLE_TAG 0x0091
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_CONFIGURATION_INDEX_TAG 0x0092
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_FREQUENCY_OFFSET_TAG 0x0093
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x0094
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_STARTING_SUBFRAME_PERIODICITY_TAG 0x0095
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_ENABLE_TAG 0x0096
#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_OFFSET_TAG 0x0097
#define NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEA_TAG 0x0098
#define NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEB_TAG 0x0099

typedef struct {
	nfapi_uint16_tlv_t operating_mode;
	nfapi_uint16_tlv_t anchor;
	nfapi_uint16_tlv_t prb_index;
	nfapi_uint16_tlv_t control_region_size;
	nfapi_uint16_tlv_t assumed_crs_aps;
	nfapi_uint16_tlv_t nprach_config_0_enabled;
	nfapi_uint16_tlv_t nprach_config_0_sf_periodicity;
	nfapi_uint16_tlv_t nprach_config_0_start_time;
	nfapi_uint16_tlv_t nprach_config_0_subcarrier_offset;
	nfapi_uint16_tlv_t nprach_config_0_number_of_subcarriers;
	nfapi_uint16_tlv_t nprach_config_0_cp_length;
	nfapi_uint16_tlv_t nprach_config_0_number_of_repetitions_per_attempt;
	nfapi_uint16_tlv_t nprach_config_1_enabled;
	nfapi_uint16_tlv_t nprach_config_1_sf_periodicity;
	nfapi_uint16_tlv_t nprach_config_1_start_time;
	nfapi_uint16_tlv_t nprach_config_1_subcarrier_offset;
	nfapi_uint16_tlv_t nprach_config_1_number_of_subcarriers;
	nfapi_uint16_tlv_t nprach_config_1_cp_length;
	nfapi_uint16_tlv_t nprach_config_1_number_of_repetitions_per_attempt;
	nfapi_uint16_tlv_t nprach_config_2_enabled;
	nfapi_uint16_tlv_t nprach_config_2_sf_periodicity;
	nfapi_uint16_tlv_t nprach_config_2_start_time;
	nfapi_uint16_tlv_t nprach_config_2_subcarrier_offset;
	nfapi_uint16_tlv_t nprach_config_2_number_of_subcarriers;
	nfapi_uint16_tlv_t nprach_config_2_cp_length;
	nfapi_uint16_tlv_t nprach_config_2_number_of_repetitions_per_attempt;
	nfapi_uint16_tlv_t three_tone_base_sequence;
	nfapi_uint16_tlv_t six_tone_base_sequence;
	nfapi_uint16_tlv_t twelve_tone_base_sequence;
	nfapi_uint16_tlv_t three_tone_cyclic_shift;
	nfapi_uint16_tlv_t six_tone_cyclic_shift;
	nfapi_uint16_tlv_t dl_gap_config_enable;
	nfapi_uint16_tlv_t dl_gap_threshold;
	nfapi_uint16_tlv_t dl_gap_periodicity;
	nfapi_uint16_tlv_t dl_gap_duration_coefficient;
} nfapi_nb_iot_config_t;

#define NFAPI_NB_IOT_CONFIG_OPERATING_MODE_TAG 0x00A5
#define NFAPI_NB_IOT_CONFIG_ANCHOR_TAG 0x00A6
#define NFAPI_NB_IOT_CONFIG_PRB_INDEX_TAG 0x00A7
#define NFAPI_NB_IOT_CONFIG_CONTROL_REGION_SIZE_TAG 0x00A8
#define NFAPI_NB_IOT_CONFIG_ASSUMED_CRS_APS_TAG 0x00A9
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_ENABLED_TAG 0x00AA
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_SF_PERIODICITY_TAG 0x00AB
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_START_TIME_TAG 0x00AC
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_SUBCARRIER_OFFSET_TAG 0x00AD
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_NUMBER_OF_SUBCARRIERS_TAG 0x00AE
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_CP_LENGTH_TAG 0x00AF
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x00B0
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_ENABLED_TAG 0x00B1
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_SF_PERIODICITY_TAG 0x00B2
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_START_TIME_TAG 0x00B3
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_SUBCARRIER_OFFSET_TAG 0x00B4
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_NUMBER_OF_SUBCARRIERS_TAG 0x00B5
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_CP_LENGTH_TAG 0x00B6
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x00B7
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_ENABLED_TAG 0x00B8
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_SF_PERIODICITY_TAG 0x00B9
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_START_TIME_TAG 0x00BA
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_SUBCARRIER_OFFSET_TAG 0x00BB
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_NUMBER_OF_SUBCARRIERS_TAG 0x00BC
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_CP_LENGTH_TAG 0x00BD
#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x00BE
#define NFAPI_NB_IOT_CONFIG_THREE_TONE_BASE_SEQUENCE_TAG 0x00BF
#define NFAPI_NB_IOT_CONFIG_SIX_TONE_BASE_SEQUENCE_TAG 0x00C0
#define NFAPI_NB_IOT_CONFIG_TWELVE_TONE_BASE_SEQUENCE_TAG 0x00C1
#define NFAPI_NB_IOT_CONFIG_THREE_TONE_CYCLIC_SHIFT_TAG 0x00C2
#define NFAPI_NB_IOT_CONFIG_SIX_TONE_CYCLIC_SHIFT_TAG 0x00C3
#define NFAPI_NB_IOT_CONFIG_DL_GAP_CONFIG_ENABLE_TAG 0x00C4
#define NFAPI_NB_IOT_CONFIG_DL_GAP_THRESHOLD_TAG 0x00C5
#define NFAPI_NB_IOT_CONFIG_DL_GAP_PERIODICITY_TAG 0x00C6
#define NFAPI_NB_IOT_CONFIG_DL_GAP_DURATION_COEFFICIENT_TAG 0x00C7

typedef struct {
	nfapi_uint16_tlv_t laa_support;
	nfapi_uint16_tlv_t pd_sensing_lbt_support;
	nfapi_uint16_tlv_t multi_carrier_lbt_support;
	nfapi_uint16_tlv_t partial_sf_support;
} nfapi_laa_capability_t;

#define NFAPI_LAA_CAPABILITY_LAA_SUPPORT_TAG 0x00D1
#define NFAPI_LAA_CAPABILITY_PD_SENSING_LBT_SUPPORT_TAG 0x00D2
#define NFAPI_LAA_CAPABILITY_MULTI_CARRIER_LBT_SUPPORT_TAG 0x00D3
#define NFAPI_LAA_CAPABILITY_PARTIAL_SF_SUPPORT_TAG 0x00D4

typedef struct {
	nfapi_uint16_tlv_t nb_iot_support;
	nfapi_uint16_tlv_t nb_iot_operating_mode_capability;
} nfapi_nb_iot_capability_t;

#define NFAPI_LAA_CAPABILITY_NB_IOT_SUPPORT_TAG 0x00D5
#define NFAPI_LAA_CAPABILITY_NB_IOT_OPERATING_MODE_CAPABILITY_TAG 0x00D6

typedef struct {
	nfapi_uint16_tlv_t subframe_assignment;
	nfapi_uint16_tlv_t special_subframe_patterns;
} nfapi_tdd_frame_structure_t;

#define NFAPI_TDD_FRAME_STRUCTURE_SUBFRAME_ASSIGNMENT_TAG 0x005A
#define NFAPI_TDD_FRAME_STRUCTURE_SPECIAL_SUBFRAME_PATTERNS_TAG 0x005B

typedef struct {
	nfapi_tl_t tl;
	uint16_t number_rf_bands;
	uint16_t rf_band[NFAPI_MAX_NUM_RF_BANDS];
} nfapi_rf_bands_t;
#define NFAPI_PHY_RF_BANDS_TAG 0x0114

#define NFAPI_IPV4_ADDRESS_LENGTH 4
#define NFAPI_IPV6_ADDRESS_LENGTH 16

// Convience enum to allow the ip addres type to be distinguished
typedef enum {
	NFAPI_IP_ADDRESS_IPV4 = 0,
	NFAPI_IP_ADDRESS_IPV6
} nfapi_ip_address_type_e;

// The type could be infered from the length, but it is clearer in 
// code to have a type variable set
typedef struct {
	nfapi_tl_t tl;
	uint8_t type;
	union {
		uint8_t ipv4_address[NFAPI_IPV4_ADDRESS_LENGTH];
		uint8_t ipv6_address[NFAPI_IPV6_ADDRESS_LENGTH];
	} u;
} nfapi_ip_address_t;

typedef struct {
	nfapi_tl_t tl;
	uint8_t address[NFAPI_IPV4_ADDRESS_LENGTH];
} nfapi_ipv4_address_t;

typedef struct {
	nfapi_tl_t tl;
	uint8_t address[NFAPI_IPV6_ADDRESS_LENGTH];
} nfapi_ipv6_address_t;



typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_rf_bands;
	uint16_t bands[NFAPI_MAX_NMM_FREQUENCY_BANDS];
} nfapi_nmm_frequency_bands_t;

//These TLVs are used exclusively by nFAPI
typedef struct
{
	// These TLVs are used to setup the transport connection between VNF and PNF
	nfapi_ipv4_address_t p7_vnf_address_ipv4;
	nfapi_ipv6_address_t p7_vnf_address_ipv6;
	nfapi_uint16_tlv_t p7_vnf_port;

	nfapi_ipv4_address_t p7_pnf_address_ipv4;
	nfapi_ipv6_address_t p7_pnf_address_ipv6;
	nfapi_uint16_tlv_t p7_pnf_port;
	
	// These TLVs are used to setup the transport connection between VNF and PNF
	nfapi_uint8_tlv_t dl_ue_per_sf;
	nfapi_uint8_tlv_t ul_ue_per_sf;

	// These TLVs are used by PNF to report its RF capabilities to the VNF software
	nfapi_rf_bands_t rf_bands;

	// These TLVs are used by the VNF to configure the synchronization with the PNF.
	nfapi_uint8_tlv_t timing_window;
	nfapi_uint8_tlv_t timing_info_mode;
	nfapi_uint8_tlv_t timing_info_period;

	// These TLVs are used by the VNF to configure the RF in the PNF
	nfapi_uint16_tlv_t max_transmit_power;
	nfapi_uint16_tlv_t earfcn;

	nfapi_nmm_frequency_bands_t nmm_gsm_frequency_bands;
	nfapi_nmm_frequency_bands_t nmm_umts_frequency_bands;
	nfapi_nmm_frequency_bands_t nmm_lte_frequency_bands;
	nfapi_uint8_tlv_t nmm_uplink_rssi_supported;

} nfapi_nfapi_t;

#define NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG 0x0100
#define NFAPI_NFAPI_P7_VNF_ADDRESS_IPV6_TAG 0x0101
#define NFAPI_NFAPI_P7_VNF_PORT_TAG 0x0102
#define NFAPI_NFAPI_P7_PNF_ADDRESS_IPV4_TAG 0x0103
#define NFAPI_NFAPI_P7_PNF_ADDRESS_IPV6_TAG 0x0104
#define NFAPI_NFAPI_P7_PNF_PORT_TAG 0x0105

#define NFAPI_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG 0x010A
#define NFAPI_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG 0x010B
#define NFAPI_NFAPI_RF_BANDS_TAG 0x0114
#define NFAPI_NFAPI_TIMING_WINDOW_TAG 0x011E
#define NFAPI_NFAPI_TIMING_INFO_MODE_TAG 0x011F
#define NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG 0x0120
#define NFAPI_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG 0x0128
#define NFAPI_NFAPI_EARFCN_TAG 0x0129
#define NFAPI_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG 0x0130
#define NFAPI_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG 0x0131
#define NFAPI_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG 0x0132
#define NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG 0x0133


// P5 Message Structures
typedef struct {
	nfapi_p4_p5_message_header_t header;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_pnf_param_request_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	uint32_t error_code;
	nfapi_pnf_param_general_t pnf_param_general;
	nfapi_pnf_phy_t pnf_phy;
	nfapi_pnf_rf_t pnf_rf;
	nfapi_pnf_phy_rel10_t pnf_phy_rel10;
	nfapi_pnf_phy_rel11_t pnf_phy_rel11;
	nfapi_pnf_phy_rel12_t pnf_phy_rel12;
	nfapi_pnf_phy_rel13_t pnf_phy_rel13;
	nfapi_pnf_phy_rel13_nb_iot_t pnf_phy_rel13_nb_iot;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_pnf_param_response_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	nfapi_pnf_phy_rf_config_t pnf_phy_rf_config;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_pnf_config_request_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	uint32_t error_code;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_pnf_config_response_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_pnf_start_request_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	uint32_t error_code;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_pnf_start_response_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_pnf_stop_request_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	uint32_t error_code;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_pnf_stop_response_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_param_request_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	uint8_t error_code;
	uint8_t num_tlv;
	// fdd or tdd in idle or configured tlvs
	nfapi_l1_status l1_status;
	nfapi_phy_capabilities_t phy_capabilities;
	nfapi_laa_capability_t laa_capability;
	nfapi_nb_iot_capability_t nb_iot_capability;
	
	nfapi_subframe_config_t subframe_config;
	nfapi_rf_config_t rf_config;
	nfapi_phich_config_t phich_config;
	nfapi_sch_config_t sch_config;
	nfapi_prach_config_t prach_config;
	nfapi_pusch_config_t pusch_config;
	nfapi_pucch_config_t pucch_config;
	nfapi_srs_config_t srs_config;
	nfapi_uplink_reference_signal_config_t uplink_reference_signal_config;
	nfapi_tdd_frame_structure_t tdd_frame_structure_config;
	nfapi_l23_config_t l23_config;
	nfapi_nb_iot_config_t nb_iot_config;

	// addition nfapi tlvs as per table 2-16 in idle or configure
	nfapi_nfapi_t nfapi_config;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_param_response_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	uint8_t num_tlv;
	nfapi_subframe_config_t subframe_config;
	nfapi_rf_config_t rf_config;
	nfapi_phich_config_t phich_config;
	nfapi_sch_config_t sch_config;
	nfapi_prach_config_t prach_config;
	nfapi_pusch_config_t pusch_config;
	nfapi_pucch_config_t pucch_config;
	nfapi_srs_config_t srs_config;
	nfapi_uplink_reference_signal_config_t uplink_reference_signal_config;
	nfapi_laa_config_t laa_config;
	nfapi_emtc_config_t emtc_config;
	nfapi_tdd_frame_structure_t tdd_frame_structure_config;
	nfapi_l23_config_t l23_config;
	nfapi_nb_iot_config_t nb_iot_config;
	
	// addition nfapi tlvs as per table 2-16 in idle or configure
	nfapi_nfapi_t nfapi_config;

	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_config_request_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	uint32_t error_code;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_config_response_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_start_request_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	uint32_t error_code;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_start_response_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_stop_request_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	uint32_t error_code;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_stop_response_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	nfapi_uint16_tlv_t dl_rs_tx_power;
	nfapi_uint16_tlv_t received_interference_power;
	nfapi_uint16_tlv_t thermal_noise_power;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_measurement_request_t;

#define NFAPI_MEASUREMENT_REQUEST_DL_RS_XTX_POWER_TAG 0x1004
#define NFAPI_MEASUREMENT_REQUEST_RECEIVED_INTERFERENCE_POWER_TAG 0x1005
#define NFAPI_MEASUREMENT_REQUEST_THERMAL_NOISE_POWER_TAG 0x1006



typedef struct {
	nfapi_tl_t tl;
	uint16_t number_of_resource_blocks;
	int16_t received_interference_power[NFAPI_MAX_RECEIVED_INTERFERENCE_POWER_RESULTS];
} nfapi_received_interference_power_measurement_t;

typedef struct {
	nfapi_p4_p5_message_header_t header;
	uint32_t error_code;
	nfapi_int16_tlv_t dl_rs_tx_power_measurement;
	nfapi_received_interference_power_measurement_t received_interference_power_measurement;
	nfapi_int16_tlv_t thermal_noise_power_measurement;
	nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_measurement_response_t;

#define NFAPI_MEASUREMENT_RESPONSE_DL_RS_POWER_MEASUREMENT_TAG 0x1007
#define NFAPI_MEASUREMENT_RESPONSE_RECEIVED_INTERFERENCE_POWER_MEASUREMENT_TAG 0x1008
#define NFAPI_MEASUREMENT_RESPONSE_THERMAL_NOISE_MEASUREMENT_TAG 0x1009

// P7 Sub Structures
typedef struct {
	nfapi_tl_t tl;
	uint8_t dci_format;
	uint8_t cce_idx;
	uint8_t aggregation_level;
	uint16_t rnti;
	uint8_t resource_allocation_type;
	uint8_t virtual_resource_block_assignment_flag;
	uint32_t resource_block_coding;
	uint8_t mcs_1;
	uint8_t redundancy_version_1;
	uint8_t new_data_indicator_1;
	uint8_t transport_block_to_codeword_swap_flag;
	uint8_t mcs_2;
	uint8_t redundancy_version_2;
	uint8_t new_data_indicator_2;
	uint8_t harq_process;
	uint8_t tpmi;
	uint8_t pmi;
	uint8_t precoding_information;
	uint8_t tpc;
	uint8_t downlink_assignment_index;
	uint8_t ngap;
	uint8_t transport_block_size_index;
	uint8_t downlink_power_offset;
	uint8_t allocate_prach_flag;
	uint8_t preamble_index;
	uint8_t prach_mask_index;
	uint8_t rnti_type;
	uint16_t transmission_power;
} nfapi_dl_config_dci_dl_pdu_rel8_t;
#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG 0x2001

typedef struct {
	nfapi_tl_t tl;
	uint8_t mcch_flag;
	uint8_t mcch_change_notification;
	uint8_t scrambling_identity;
} nfapi_dl_config_dci_dl_pdu_rel9_t;
#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL9_TAG 0x2002

typedef struct {
	nfapi_tl_t tl;
	uint8_t cross_carrier_scheduling_flag;
	uint8_t carrier_indicator;
	uint8_t srs_flag;
	uint8_t srs_request;
	uint8_t antenna_ports_scrambling_and_layers;
	uint8_t total_dci_length_including_padding;
	uint8_t n_dl_rb;
} nfapi_dl_config_dci_dl_pdu_rel10_t;
#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL10_TAG 0x2003


typedef struct {
	nfapi_tl_t tl;
	uint8_t harq_ack_resource_offset;
	uint8_t pdsch_re_mapping_quasi_co_location_indicator;
} nfapi_dl_config_dci_dl_pdu_rel11_t;

#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL11_TAG 0x2039



typedef struct {
	nfapi_tl_t tl;
	uint8_t primary_cell_type;
	uint8_t ul_dl_configuration_flag;
	uint8_t number_ul_dl_configurations;
	uint8_t ul_dl_configuration_indication[NFAPI_MAX_UL_DL_CONFIGURATIONS];
} nfapi_dl_config_dci_dl_pdu_rel12_t;

#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL12_TAG 0x203a



typedef struct {
	uint8_t subband_index;
	uint8_t scheduled_ues;
	uint16_t precoding_value[NFAPI_MAX_NUM_PHYSICAL_ANTENNAS][NFAPI_MAX_NUM_SCHEDULED_UES];
} nfapi_dl_config_dci_dl_tpm_subband_info_t;

typedef struct {
	uint8_t num_prb_per_subband;
	uint8_t number_of_subbands;
	uint8_t num_antennas;
	nfapi_dl_config_dci_dl_tpm_subband_info_t subband_info[NFAPI_MAX_NUM_SUBBANDS];
} nfapi_dl_config_dci_dl_tpm_t;

typedef struct {
	nfapi_tl_t tl;
	uint8_t laa_end_partial_sf_flag;
	uint8_t laa_end_partial_sf_configuration;
	uint8_t initial_lbt_sf;
	uint8_t codebook_size_determination;
	uint8_t drms_table_flag;
	uint8_t tpm_struct_flag;
	nfapi_dl_config_dci_dl_tpm_t tpm;
} nfapi_dl_config_dci_dl_pdu_rel13_t;

#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL13_TAG 0x203b

typedef struct {
	nfapi_dl_config_dci_dl_pdu_rel8_t dci_dl_pdu_rel8;
	nfapi_dl_config_dci_dl_pdu_rel9_t dci_dl_pdu_rel9;
	nfapi_dl_config_dci_dl_pdu_rel10_t dci_dl_pdu_rel10;
	nfapi_dl_config_dci_dl_pdu_rel11_t dci_dl_pdu_rel11;
	nfapi_dl_config_dci_dl_pdu_rel12_t dci_dl_pdu_rel12;
	nfapi_dl_config_dci_dl_pdu_rel13_t dci_dl_pdu_rel13;
} nfapi_dl_config_dci_dl_pdu;

typedef struct {
	nfapi_tl_t tl;
	uint16_t length;
1311
	int16_t pdu_index;
1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322
	uint16_t transmission_power;
} nfapi_dl_config_bch_pdu_rel8_t;
#define NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG 0x2004

typedef struct {
	nfapi_dl_config_bch_pdu_rel8_t bch_pdu_rel8;
} nfapi_dl_config_bch_pdu;

typedef struct {
	nfapi_tl_t tl;
	uint16_t length;
1323
	int16_t pdu_index;
1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346
	uint16_t rnti;
	uint8_t resource_allocation_type;
	uint32_t resource_block_coding;
	uint8_t modulation;
	uint16_t transmission_power;
	uint16_t mbsfn_area_id;
} nfapi_dl_config_mch_pdu_rel8_t;
#define NFAPI_DL_CONFIG_REQUEST_MCH_PDU_REL8_TAG 0x2005

typedef struct {
	nfapi_dl_config_mch_pdu_rel8_t mch_pdu_rel8;
} nfapi_dl_config_mch_pdu;


typedef struct {
	uint8_t subband_index;
	uint8_t num_antennas;
	uint16_t bf_value[NFAPI_MAX_NUM_ANTENNAS];
} nfapi_bf_vector_t;

typedef struct {
	nfapi_tl_t tl;
	uint16_t length;
1347
	int16_t pdu_index;
1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431
	uint16_t rnti;
	uint8_t resource_allocation_type;
	uint8_t virtual_resource_block_assignment_flag;
	uint32_t resource_block_coding;
	uint8_t modulation;
	uint8_t redundancy_version;
	uint8_t transport_blocks;
	uint8_t transport_block_to_codeword_swap_flag;
	uint8_t transmission_scheme;
	uint8_t number_of_layers;
	uint8_t number_of_subbands;
	uint8_t codebook_index[NFAPI_MAX_NUM_SUBBANDS];
	uint8_t ue_category_capacity;
	uint8_t pa;
	uint8_t delta_power_offset_index;
	uint8_t ngap;
	uint8_t nprb;
	uint8_t transmission_mode;
	uint8_t num_bf_prb_per_subband;
	uint8_t num_bf_vector;
	nfapi_bf_vector_t bf_vector[NFAPI_MAX_BF_VECTORS];
} nfapi_dl_config_dlsch_pdu_rel8_t;
#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG 0x2006

typedef struct {
	nfapi_tl_t tl;
	uint8_t nscid;
} nfapi_dl_config_dlsch_pdu_rel9_t;
#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL9_TAG 0x2007

typedef struct {
	nfapi_tl_t tl;
	uint8_t csi_rs_flag;
	uint8_t csi_rs_resource_config_r10;
	uint16_t csi_rs_zero_tx_power_resource_config_bitmap_r10;
	uint8_t csi_rs_number_nzp_configuration;
	uint8_t csi_rs_resource_config[NFAPI_MAX_CSI_RS_RESOURCE_CONFIG];
	uint8_t pdsch_start;
} nfapi_dl_config_dlsch_pdu_rel10_t;
#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG 0x2008

typedef struct {
	nfapi_tl_t tl;
	uint8_t drms_config_flag;
	uint16_t drms_scrambling;
	uint8_t csi_config_flag;
	uint16_t csi_scrambling;
	uint8_t pdsch_re_mapping_flag;
	uint8_t pdsch_re_mapping_atenna_ports;
	uint8_t pdsch_re_mapping_freq_shift;
} nfapi_dl_config_dlsch_pdu_rel11_t;
#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL11_TAG 0x203C

typedef struct {
	nfapi_tl_t tl;
	uint8_t altcqi_table_r12;
	uint8_t maxlayers;
	uint8_t n_dl_harq;
} nfapi_dl_config_dlsch_pdu_rel12_t;
#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL12_TAG 0x203D

typedef struct {
	nfapi_tl_t tl;
	uint8_t dwpts_symbols;
	uint8_t initial_lbt_sf;
	uint8_t ue_type;
	uint8_t pdsch_payload_type;
	uint16_t initial_transmission_sf_io;
	uint8_t drms_table_flag;
} nfapi_dl_config_dlsch_pdu_rel13_t;
#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG 0x203E

typedef struct {
	nfapi_dl_config_dlsch_pdu_rel8_t dlsch_pdu_rel8;
	nfapi_dl_config_dlsch_pdu_rel9_t dlsch_pdu_rel9;
	nfapi_dl_config_dlsch_pdu_rel10_t dlsch_pdu_rel10;
	nfapi_dl_config_dlsch_pdu_rel11_t dlsch_pdu_rel11;
	nfapi_dl_config_dlsch_pdu_rel12_t dlsch_pdu_rel12;
	nfapi_dl_config_dlsch_pdu_rel13_t dlsch_pdu_rel13;
} nfapi_dl_config_dlsch_pdu;

typedef struct {
	nfapi_tl_t tl;
	uint16_t length;
1432
	int16_t pdu_index;
1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597
	uint16_t p_rnti;
	uint8_t resource_allocation_type;
	uint8_t virtual_resource_block_assignment_flag;
	uint32_t resource_block_coding;
	uint8_t mcs;
	uint8_t redundancy_version;
	uint8_t number_of_transport_blocks;
	uint8_t transport_block_to_codeword_swap_flag;
	uint8_t transmission_scheme;
	uint8_t number_of_layers;
	uint8_t codebook_index;
	uint8_t ue_category_capacity;
	uint8_t pa;
	uint16_t transmission_power;
	uint8_t nprb;
	uint8_t ngap;
} nfapi_dl_config_pch_pdu_rel8_t;
#define NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL8_TAG 0x2009

typedef struct {
	nfapi_tl_t tl;
	uint8_t ue_mode;
	uint16_t initial_transmission_sf_io;
} nfapi_dl_config_pch_pdu_rel13_t;
#define NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL13_TAG 0x203F

typedef struct {
	nfapi_dl_config_pch_pdu_rel8_t pch_pdu_rel8;
	nfapi_dl_config_pch_pdu_rel13_t pch_pdu_rel13;
} nfapi_dl_config_pch_pdu;

typedef struct {
	nfapi_tl_t tl;
	uint16_t transmission_power;
	uint8_t prs_bandwidth;
	uint8_t prs_cyclic_prefix_type;
	uint8_t prs_muting;
} nfapi_dl_config_prs_pdu_rel9_t;
#define NFAPI_DL_CONFIG_REQUEST_PRS_PDU_REL9_TAG 0x200A

typedef struct {
	nfapi_dl_config_prs_pdu_rel9_t prs_pdu_rel9;
} nfapi_dl_config_prs_pdu;

typedef struct {
	nfapi_tl_t tl;
	uint8_t csi_rs_antenna_port_count_r10;
	uint8_t csi_rs_resource_config_r10;
	uint16_t transmission_power;
	uint16_t csi_rs_zero_tx_power_resource_config_bitmap_r10;
	uint8_t csi_rs_number_of_nzp_configuration;
	uint8_t csi_rs_resource_config[NFAPI_MAX_CSI_RS_RESOURCE_CONFIG];
} nfapi_dl_config_csi_rs_pdu_rel10_t;
#define NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL10_TAG 0x200B

typedef struct {
	nfapi_tl_t tl;
	uint8_t csi_rs_class;
	uint8_t cdm_type;
	uint8_t num_bf_vector;
	struct {
		uint8_t csi_rs_resource_index;
		uint16_t bf_value[NFAPI_MAX_ANTENNA_PORT_COUNT];
	} bf_vector[NFAPI_MAX_BF_VECTORS];

}nfapi_dl_config_csi_rs_pdu_rel13_t;
#define NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL13_TAG 0x2040

typedef struct {
	nfapi_dl_config_csi_rs_pdu_rel10_t csi_rs_pdu_rel10;
	nfapi_dl_config_csi_rs_pdu_rel13_t csi_rs_pdu_rel13;
} nfapi_dl_config_csi_rs_pdu;

#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL8_TAG 0x2001
#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL9_TAG 0x2002
#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL10_TAG 0x2003
#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL11_TAG 0x2039
#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL12_TAG 0x203a
#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL13_TAG 0x203b

typedef struct {
	nfapi_tl_t tl;
	uint8_t epdcch_resource_assignment_flag;
	uint16_t epdcch_id;
	uint8_t epdcch_start_symbol;
	uint8_t epdcch_num_prb;
	uint8_t epdcch_prb_index[NFAPI_MAX_EPDCCH_PRB];
	nfapi_bf_vector_t bf_vector;
} nfapi_dl_config_epdcch_parameters_rel11_t;
#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL11_TAG 0x2041

typedef struct {
	nfapi_tl_t tl;
	uint8_t dwpts_symbols;
	uint8_t initial_lbt_sf;
} nfapi_dl_config_epdcch_parameters_rel13_t;
#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL13_TAG 0x2042

typedef struct {
	nfapi_dl_config_dci_dl_pdu_rel8_t			epdcch_pdu_rel8;
	nfapi_dl_config_dci_dl_pdu_rel9_t			epdcch_pdu_rel9;
	nfapi_dl_config_dci_dl_pdu_rel10_t			epdcch_pdu_rel10;
	nfapi_dl_config_dci_dl_pdu_rel11_t			epdcch_pdu_rel11;
	nfapi_dl_config_dci_dl_pdu_rel12_t			epdcch_pdu_rel12;
	nfapi_dl_config_dci_dl_pdu_rel13_t			epdcch_pdu_rel13;
	nfapi_dl_config_epdcch_parameters_rel11_t	epdcch_params_rel11;
	nfapi_dl_config_epdcch_parameters_rel13_t	epdcch_params_rel13;
} nfapi_dl_config_epdcch_pdu;


typedef struct {
	nfapi_tl_t tl;
	uint8_t mpdcch_narrow_band;
	uint8_t number_of_prb_pairs;
	uint8_t resource_block_assignment;
	uint8_t mpdcch_tansmission_type;
	uint8_t start_symbol;
	uint8_t ecce_index;
	uint8_t aggregation_level;
	uint8_t rnti_type;
	uint16_t rnti;
	uint8_t ce_mode;
	uint16_t drms_scrambling_init;
	uint16_t initial_transmission_sf_io;
	uint16_t transmission_power;
	uint8_t dci_format;
	uint16_t resource_block_coding;
	uint8_t mcs;
	uint8_t pdsch_reptition_levels;
	uint8_t redundancy_version;
	uint8_t new_data_indicator;
	uint8_t harq_process;
	uint8_t tpmi_length;
	uint8_t tpmi;
	uint8_t pmi_flag;
	uint8_t pmi;
	uint8_t harq_resource_offset;
	uint8_t dci_subframe_repetition_number;
	uint8_t tpc;
	uint8_t downlink_assignment_index_length;
	uint8_t downlink_assignment_index;
	uint8_t allocate_prach_flag;
	uint8_t preamble_index;
	uint8_t prach_mask_index;
	uint8_t starting_ce_level;
	uint8_t srs_request;
	uint8_t antenna_ports_and_scrambling_identity_flag;
	uint8_t antenna_ports_and_scrambling_identity;
	uint8_t frequency_hopping_enabled_flag;
	uint8_t paging_direct_indication_differentiation_flag;
	uint8_t direct_indication;
	uint8_t total_dci_length_including_padding;
	uint8_t number_of_tx_antenna_ports;
	uint16_t precoding_value[NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS];
} nfapi_dl_config_mpdcch_pdu_rel13_t;
#define NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG 0x205B


typedef struct {
	nfapi_dl_config_mpdcch_pdu_rel13_t mpdcch_pdu_rel13;
} nfapi_dl_config_mpdcch_pdu;

typedef struct {
	nfapi_tl_t tl;
	uint16_t length;
1598
	int16_t pdu_index;
1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611
	uint16_t transmission_power;
	uint16_t hyper_sfn_2_lsbs;
} nfapi_dl_config_nbch_pdu_rel13_t;

#define NFAPI_DL_CONFIG_REQUEST_NBCH_PDU_REL13_TAG 0x205C

typedef struct {
	nfapi_dl_config_nbch_pdu_rel13_t nbch_pdu_rel13;
} nfapi_dl_config_nbch_pdu;

typedef struct {
	nfapi_tl_t tl;
	uint16_t length;
1612
	int16_t pdu_index;
1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644
	uint8_t ncce_index;
	uint8_t aggregation_level;
	uint8_t start_symbol;
	uint8_t rnti_type;
	uint16_t rnti;
	uint8_t scrambling_reinitialization_batch_index;
	uint8_t nrs_antenna_ports_assumed_by_the_ue;
	uint8_t dci_format;
	uint8_t scheduling_delay;
	uint8_t resource_assignment;
	uint8_t repetition_number;
	uint8_t mcs;
	uint8_t new_data_indicator;
	uint8_t harq_ack_resource;
	uint8_t npdcch_order_indication;
	uint8_t starting_number_of_nprach_repetitions;
	uint8_t subcarrier_indication_of_nprach;
	uint8_t paging_direct_indication_differentation_flag;
	uint8_t direct_indication;
	uint8_t dci_subframe_repetition_number;
	uint8_t total_dci_length_including_padding;
} nfapi_dl_config_npdcch_pdu_rel13_t;

#define NFAPI_DL_CONFIG_REQUEST_NPDCCH_PDU_REL13_TAG 0x205D

typedef struct {
	nfapi_dl_config_npdcch_pdu_rel13_t npdcch_pdu_rel13;
} nfapi_dl_config_npdcch_pdu;

typedef struct {
	nfapi_tl_t tl;
	uint16_t length;
1645
	int16_t pdu_index;
1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691
	uint8_t start_symbol;
	uint8_t rnti_type;
	uint16_t rnti;
	uint16_t resource_assignment;
	uint16_t repetition_number;
	uint8_t modulation;
	uint8_t number_of_subframes_for_resource_assignment;
	uint8_t scrambling_sequence_initialization_cinit;
	uint16_t sf_idx;
	uint8_t nrs_antenna_ports_assumed_by_the_ue;
} nfapi_dl_config_ndlsch_pdu_rel13_t;

#define NFAPI_DL_CONFIG_REQUEST_NDLSCH_PDU_REL13_TAG 0x205E

typedef struct {
	nfapi_dl_config_ndlsch_pdu_rel13_t ndlsch_pdu_rel13;
} nfapi_dl_config_ndlsch_pdu;


typedef struct {
	uint8_t pdu_type;
	uint8_t pdu_size;
	union {
		nfapi_dl_config_dci_dl_pdu	dci_dl_pdu;
		nfapi_dl_config_bch_pdu		bch_pdu;
		nfapi_dl_config_mch_pdu		mch_pdu;
		nfapi_dl_config_dlsch_pdu	dlsch_pdu;
		nfapi_dl_config_pch_pdu		pch_pdu;
		nfapi_dl_config_prs_pdu		prs_pdu;
		nfapi_dl_config_csi_rs_pdu	csi_rs_pdu;
		nfapi_dl_config_epdcch_pdu	epdcch_pdu;
		nfapi_dl_config_mpdcch_pdu	mpdcch_pdu;
		nfapi_dl_config_nbch_pdu	nbch_pdu;
		nfapi_dl_config_npdcch_pdu	npdcch_pdu;
		nfapi_dl_config_ndlsch_pdu	ndlsch_pdu;
	};
} nfapi_dl_config_request_pdu_t;

#define NFAPI_DL_CONFIG_MAX_PDU 100
typedef struct {
	nfapi_tl_t tl;
	uint8_t number_pdcch_ofdm_symbols;
	uint8_t number_dci;
	uint16_t number_pdu;
	uint8_t number_pdsch_rnti;
	uint16_t transmission_power_pcfich;
Cedric Roux's avatar
Cedric Roux committed
1692
	nfapi_dl_config_request_pdu_t* dl_config_pdu_list;
1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964
} nfapi_dl_config_request_body_t;
#define NFAPI_DL_CONFIG_REQUEST_BODY_TAG 0x2000

typedef struct {
	nfapi_tl_t tl;
	uint32_t handle;
	uint16_t size;
	uint16_t rnti;
	uint8_t resource_block_start;
	uint8_t number_of_resource_blocks;
	uint8_t modulation_type;
	uint8_t cyclic_shift_2_for_drms;
	uint8_t frequency_hopping_enabled_flag;
	uint8_t frequency_hopping_bits;
	uint8_t new_data_indication;
	uint8_t redundancy_version;
	uint8_t harq_process_number;
	uint8_t ul_tx_mode;
	uint8_t current_tx_nb;
	uint8_t n_srs;
} nfapi_ul_config_ulsch_pdu_rel8_t;
#define NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG 0x200D

typedef struct {
	nfapi_tl_t tl;
	uint8_t resource_allocation_type;
	uint32_t resource_block_coding;
	uint8_t transport_blocks;
	uint8_t transmission_scheme;
	uint8_t number_of_layers;
	uint8_t codebook_index;
	uint8_t disable_sequence_hopping_flag;
} nfapi_ul_config_ulsch_pdu_rel10_t;
#define NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL10_TAG 0x200E


typedef struct {
	nfapi_tl_t tl;
	uint8_t virtual_cell_id_enabled_flag;
	uint16_t npusch_identity;
	uint8_t dmrs_config_flag;
	uint16_t ndmrs_csh_identity;
} nfapi_ul_config_ulsch_pdu_rel11_t;

#define NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL11_TAG 0x2043

typedef struct {
	nfapi_tl_t tl;
	uint8_t  ue_type;
	uint16_t total_number_of_repetitions;
	uint16_t repetition_number;
	uint16_t initial_transmission_sf_io;
	uint8_t  empty_symbols_due_to_re_tunning;
} nfapi_ul_config_ulsch_pdu_rel13_t;
#define NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG 0x2044

typedef struct {
	nfapi_ul_config_ulsch_pdu_rel8_t ulsch_pdu_rel8;
	nfapi_ul_config_ulsch_pdu_rel10_t ulsch_pdu_rel10;
	nfapi_ul_config_ulsch_pdu_rel11_t ulsch_pdu_rel11;
	nfapi_ul_config_ulsch_pdu_rel13_t ulsch_pdu_rel13;
} nfapi_ul_config_ulsch_pdu;

typedef struct {
	nfapi_tl_t tl;
	uint8_t dl_cqi_pmi_size_rank_1;
	uint8_t dl_cqi_pmi_size_rank_greater_1;
	uint8_t ri_size;
	uint8_t delta_offset_cqi;
	uint8_t delta_offset_ri;
} nfapi_ul_config_cqi_ri_information_rel8_t;
#define NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL8_TAG 0x2010

typedef struct {
	uint8_t dl_cqi_pmi_ri_size;
	uint8_t control_type;
} nfapi_ul_config_periodic_cqi_pmi_ri_report_t;

typedef struct {
	uint8_t number_of_cc;
	struct {
		uint8_t ri_size;
		uint8_t dl_cqi_pmi_size[8];
	} cc[NFAPI_MAX_CC];
} nfapi_ul_config_aperiodic_cqi_pmi_ri_report_t;

typedef struct {
	nfapi_tl_t tl;
	uint8_t report_type;
	uint8_t delta_offset_cqi;
	uint8_t delta_offset_ri;
	union {
		nfapi_ul_config_periodic_cqi_pmi_ri_report_t periodic_cqi_pmi_ri_report;
		nfapi_ul_config_aperiodic_cqi_pmi_ri_report_t aperiodic_cqi_pmi_ri_report;
	};
} nfapi_ul_config_cqi_ri_information_rel9_t;
#define NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG 0x2011

typedef struct {
	uint16_t dl_cqi_pmi_ri_size_2;
} nfapi_ul_config_periodic_cqi_pmi_ri_report_re13_t;

typedef struct {
} nfapi_ul_config_aperiodic_cqi_pmi_ri_report_re13_t;

typedef struct {
	nfapi_tl_t tl;
	uint8_t report_type; // Convience parameter, not sent on the wire
	union {
		nfapi_ul_config_periodic_cqi_pmi_ri_report_re13_t periodic_cqi_pmi_ri_report;
		nfapi_ul_config_aperiodic_cqi_pmi_ri_report_re13_t aperiodic_cqi_pmi_ri_report;
	};
} nfapi_ul_config_cqi_ri_information_rel13_t;
#define NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL13_TAG 0x2045

typedef struct {
	nfapi_ul_config_cqi_ri_information_rel8_t cqi_ri_information_rel8;
	nfapi_ul_config_cqi_ri_information_rel9_t cqi_ri_information_rel9;
	nfapi_ul_config_cqi_ri_information_rel13_t cqi_ri_information_rel13;
} nfapi_ul_config_cqi_ri_information;

typedef struct {
	nfapi_tl_t tl;
	uint8_t harq_size;
	uint8_t delta_offset_harq;
	uint8_t ack_nack_mode;
} nfapi_ul_config_ulsch_harq_information_rel10_t;
#define NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL10_TAG 0x2012

typedef struct {
	nfapi_tl_t tl;
	uint16_t harq_size_2;
	uint8_t delta_offset_harq_2;
} nfapi_ul_config_ulsch_harq_information_rel13_t;
#define NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL13_TAG 0x2046

typedef struct {
	nfapi_ul_config_ulsch_harq_information_rel10_t harq_information_rel10;
	nfapi_ul_config_ulsch_harq_information_rel13_t harq_information_rel13;
} nfapi_ul_config_ulsch_harq_information;

typedef struct {
	nfapi_tl_t tl;
	uint8_t n_srs_initial;
	uint8_t initial_number_of_resource_blocks;
} nfapi_ul_config_initial_transmission_parameters_rel8_t;
#define NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG 0x200F

typedef struct {
	nfapi_ul_config_initial_transmission_parameters_rel8_t initial_transmission_parameters_rel8;
} nfapi_ul_config_initial_transmission_parameters;

typedef struct {
	nfapi_ul_config_ulsch_pdu ulsch_pdu;
	nfapi_ul_config_cqi_ri_information cqi_ri_information;
	nfapi_ul_config_initial_transmission_parameters initial_transmission_parameters;
} nfapi_ul_config_ulsch_cqi_ri_pdu;

typedef struct {
	nfapi_ul_config_ulsch_pdu ulsch_pdu;
	nfapi_ul_config_ulsch_harq_information harq_information;
	nfapi_ul_config_initial_transmission_parameters initial_transmission_parameters;
} nfapi_ul_config_ulsch_harq_pdu;

typedef struct {
	nfapi_ul_config_ulsch_pdu ulsch_pdu;
	nfapi_ul_config_cqi_ri_information cqi_ri_information;
	nfapi_ul_config_ulsch_harq_information harq_information;
	nfapi_ul_config_initial_transmission_parameters initial_transmission_parameters;
} nfapi_ul_config_ulsch_cqi_harq_ri_pdu;


typedef struct {
	nfapi_tl_t tl;
	uint32_t handle;
	uint16_t rnti;
} nfapi_ul_config_ue_information_rel8_t;
#define NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG 0x2013

typedef struct {
	nfapi_tl_t tl;
	uint8_t virtual_cell_id_enabled_flag;
	uint16_t npusch_identity;
} nfapi_ul_config_ue_information_rel11_t;

#define NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG 0x2047

typedef struct {
	nfapi_tl_t tl;
	uint8_t  ue_type;
	uint8_t  empty_symbols;
	uint16_t total_number_of_repetitions;
	uint16_t repetition_number;
} nfapi_ul_config_ue_information_rel13_t;

#define NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG 0x2048

typedef struct {
	nfapi_ul_config_ue_information_rel8_t ue_information_rel8;
	nfapi_ul_config_ue_information_rel11_t ue_information_rel11;
	nfapi_ul_config_ue_information_rel13_t ue_information_rel13;
} nfapi_ul_config_ue_information;

typedef struct {
	nfapi_tl_t tl;
	uint16_t pucch_index;
	uint8_t dl_cqi_pmi_size;
} nfapi_ul_config_cqi_information_rel8_t;
#define NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG 0x2014

typedef struct {
	nfapi_tl_t tl;
	uint8_t number_of_pucch_resource;
	uint16_t pucch_index_p1;
} nfapi_ul_config_cqi_information_rel10_t;
#define NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL10_TAG 0x2015

typedef struct {
	nfapi_tl_t tl;
	uint8_t csi_mode;
	uint16_t dl_cqi_pmi_size_2;
	uint8_t starting_prb;
	uint8_t n_prb;
	uint8_t cdm_index;
	uint8_t n_srs;
} nfapi_ul_config_cqi_information_rel13_t;
#define NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL13_TAG 0x2049

typedef struct {
	nfapi_ul_config_cqi_information_rel8_t cqi_information_rel8;
	nfapi_ul_config_cqi_information_rel10_t cqi_information_rel10;
	nfapi_ul_config_cqi_information_rel13_t cqi_information_rel13;
} nfapi_ul_config_cqi_information;

typedef struct {
	nfapi_tl_t tl;
	uint16_t pucch_index;
} nfapi_ul_config_sr_information_rel8_t;
#define NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG 0x2016

typedef struct {
	nfapi_tl_t tl;
	uint8_t number_of_pucch_resources;
	uint16_t pucch_index_p1;
} nfapi_ul_config_sr_information_rel10_t;
#define NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG 0x2017

typedef struct { 
	nfapi_ul_config_sr_information_rel8_t sr_information_rel8;
	nfapi_ul_config_sr_information_rel10_t sr_information_rel10;
} nfapi_ul_config_sr_information;

typedef struct { 
	nfapi_tl_t tl;
	uint8_t harq_size;
	uint8_t ack_nack_mode;
	uint8_t number_of_pucch_resources;
	uint16_t n_pucch_1_0;
	uint16_t n_pucch_1_1;
	uint16_t n_pucch_1_2;
	uint16_t n_pucch_1_3;
} nfapi_ul_config_harq_information_rel10_tdd_t;
#define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG 0x2018


typedef struct { 
	nfapi_tl_t tl;
	uint16_t n_pucch_1_0;
	uint8_t harq_size;
} nfapi_ul_config_harq_information_rel8_fdd_t;
#define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG 0x2019

Cedric Roux's avatar
Cedric Roux committed
1965
typedef struct { 
1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220
	nfapi_tl_t tl;
	uint8_t harq_size;
	uint8_t ack_nack_mode;
	uint8_t number_of_pucch_resources;
	uint16_t n_pucch_1_0;
	uint16_t n_pucch_1_1;
	uint16_t n_pucch_1_2;
	uint16_t n_pucch_1_3;
} nfapi_ul_config_harq_information_rel9_fdd_t;
#define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG 0x201a

typedef struct { 
	nfapi_tl_t tl;
	uint8_t  num_ant_ports;
	uint16_t n_pucch_2_0;
	uint16_t n_pucch_2_1;
	uint16_t n_pucch_2_2;
	uint16_t n_pucch_2_3;	
} nfapi_ul_config_harq_information_rel11_t;
#define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG 0x204A

typedef struct { 
	nfapi_tl_t tl;
	uint16_t  harq_size_2;
	uint8_t starting_prb;
	uint8_t n_prb;
	uint8_t cdm_index;
	uint8_t n_srs;
} nfapi_ul_config_harq_information_rel13_t;
#define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL13_TAG 0x204B

typedef struct {
	nfapi_ul_config_harq_information_rel10_tdd_t harq_information_rel10_tdd;
	nfapi_ul_config_harq_information_rel8_fdd_t harq_information_rel8_fdd;
	nfapi_ul_config_harq_information_rel9_fdd_t harq_information_rel9_fdd;
	nfapi_ul_config_harq_information_rel11_t harq_information_rel11;
	nfapi_ul_config_harq_information_rel13_t harq_information_rel13;
} nfapi_ul_config_harq_information;

typedef struct { 
	nfapi_tl_t tl;
	uint32_t handle;
	uint16_t size;
	uint16_t rnti;
	uint8_t srs_bandwidth;
	uint8_t frequency_domain_position;
	uint8_t srs_hopping_bandwidth;
	uint8_t transmission_comb;
	uint16_t i_srs;
	uint8_t sounding_reference_cyclic_shift;
} nfapi_ul_config_srs_pdu_rel8_t;
#define NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG 0x201b

typedef struct { 
	nfapi_tl_t tl;
	uint8_t antenna_port;
} nfapi_ul_config_srs_pdu_rel10_t;
#define NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL10_TAG 0x201c

typedef struct { 
	nfapi_tl_t tl;
	uint8_t number_of_combs;
} nfapi_ul_config_srs_pdu_rel13_t;
#define NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL13_TAG 0x204c

typedef struct {
	nfapi_ul_config_srs_pdu_rel8_t srs_pdu_rel8;
	nfapi_ul_config_srs_pdu_rel10_t srs_pdu_rel10;
	nfapi_ul_config_srs_pdu_rel13_t srs_pdu_rel13;
} nfapi_ul_config_srs_pdu;

typedef struct {
	nfapi_ul_config_ue_information ue_information;
	nfapi_ul_config_cqi_information cqi_information;
} nfapi_ul_config_uci_cqi_pdu;

typedef struct {
	nfapi_ul_config_ue_information ue_information;
	nfapi_ul_config_sr_information sr_information;
} nfapi_ul_config_uci_sr_pdu;

typedef struct {
	nfapi_ul_config_ue_information ue_information;
	nfapi_ul_config_harq_information harq_information;
} nfapi_ul_config_uci_harq_pdu;

typedef struct {
	nfapi_ul_config_ue_information ue_information;
	nfapi_ul_config_sr_information sr_information;
	nfapi_ul_config_harq_information harq_information;
} nfapi_ul_config_uci_sr_harq_pdu;

typedef struct {
	nfapi_ul_config_ue_information ue_information;
	nfapi_ul_config_cqi_information cqi_information;
	nfapi_ul_config_harq_information harq_information;
} nfapi_ul_config_uci_cqi_harq_pdu;

typedef struct {
	nfapi_ul_config_ue_information ue_information;
	nfapi_ul_config_cqi_information cqi_information;
	nfapi_ul_config_sr_information sr_information;
} nfapi_ul_config_uci_cqi_sr_pdu;

typedef struct {
	nfapi_ul_config_ue_information ue_information;
	nfapi_ul_config_cqi_information cqi_information;
	nfapi_ul_config_sr_information sr_information;
	nfapi_ul_config_harq_information harq_information;
} nfapi_ul_config_uci_cqi_sr_harq_pdu;

typedef struct {
	nfapi_ul_config_ue_information ue_information;
} nfapi_ul_config_harq_buffer_pdu;

typedef struct {
	nfapi_ul_config_ulsch_pdu ulsch_pdu;
	nfapi_ul_config_cqi_information csi_information;
} nfapi_ul_config_ulsch_uci_csi_pdu;

typedef struct {
	nfapi_ul_config_ulsch_pdu ulsch_pdu;
	nfapi_ul_config_harq_information harq_information;
} nfapi_ul_config_ulsch_uci_harq_pdu;

typedef struct {
	nfapi_ul_config_ulsch_pdu ulsch_pdu;
	nfapi_ul_config_cqi_information csi_information;
	nfapi_ul_config_harq_information harq_information;
} nfapi_ul_config_ulsch_csi_uci_harq_pdu;

typedef struct {
	nfapi_tl_t tl;
	uint8_t harq_ack_resource;
} nfapi_ul_config_nb_harq_information_rel13_fdd_t;
#define NFAPI_UL_CONFIG_REQUEST_NB_HARQ_INFORMATION_REL13_FDD_TAG 0x2061

typedef struct {
	nfapi_ul_config_nb_harq_information_rel13_fdd_t nb_harq_information_rel13_fdd;
} nfapi_ul_config_nb_harq_information;

typedef struct {
	nfapi_tl_t tl;	
	uint8_t nulsch_format;
	uint32_t handle;
	uint16_t size;
	uint16_t rnti;
	uint8_t subcarrier_indication;
	uint8_t resource_assignment;
	uint8_t mcs;
	uint8_t redudancy_version;
	uint8_t repetition_number;
	uint8_t new_data_indication;
	uint8_t n_srs;
	uint16_t scrambling_sequence_initialization_cinit;
	uint16_t sf_idx;
	nfapi_ul_config_ue_information ue_information;
	nfapi_ul_config_nb_harq_information nb_harq_information;
} nfapi_ul_config_nulsch_pdu_rel13_t;
#define NFAPI_UL_CONFIG_REQUEST_NULSCH_PDU_REL13_TAG 0x205F

typedef struct {
	nfapi_ul_config_nulsch_pdu_rel13_t nulsch_pdu_rel13;
} nfapi_ul_config_nulsch_pdu;


typedef struct {
	nfapi_tl_t tl;
	uint8_t nprach_config_0;
	uint8_t nprach_config_1;
	uint8_t nprach_config_2;
} nfapi_ul_config_nrach_pdu_rel13_t;
#define NFAPI_UL_CONFIG_REQUEST_NRACH_PDU_REL13_TAG 0x2067

typedef struct {
	nfapi_ul_config_nrach_pdu_rel13_t nrach_pdu_rel13;
} nfapi_ul_config_nrach_pdu;

typedef struct {
	uint8_t pdu_type;
	uint8_t pdu_size;
	union {
		nfapi_ul_config_ulsch_pdu				ulsch_pdu;
		nfapi_ul_config_ulsch_cqi_ri_pdu		ulsch_cqi_ri_pdu;
		nfapi_ul_config_ulsch_harq_pdu			ulsch_harq_pdu;
		nfapi_ul_config_ulsch_cqi_harq_ri_pdu	ulsch_cqi_harq_ri_pdu;
		nfapi_ul_config_uci_cqi_pdu				uci_cqi_pdu;
		nfapi_ul_config_uci_sr_pdu				uci_sr_pdu;
		nfapi_ul_config_uci_harq_pdu			uci_harq_pdu;
		nfapi_ul_config_uci_sr_harq_pdu			uci_sr_harq_pdu;
		nfapi_ul_config_uci_cqi_harq_pdu		uci_cqi_harq_pdu;
		nfapi_ul_config_uci_cqi_sr_pdu			uci_cqi_sr_pdu;
		nfapi_ul_config_uci_cqi_sr_harq_pdu		uci_cqi_sr_harq_pdu;
		nfapi_ul_config_srs_pdu					srs_pdu;
		nfapi_ul_config_harq_buffer_pdu			harq_buffer_pdu;
		nfapi_ul_config_ulsch_uci_csi_pdu		ulsch_uci_csi_pdu;
		nfapi_ul_config_ulsch_uci_harq_pdu		ulsch_uci_harq_pdu;
		nfapi_ul_config_ulsch_csi_uci_harq_pdu	ulsch_csi_uci_harq_pdu;
		nfapi_ul_config_nulsch_pdu				nulsch_pdu;
		nfapi_ul_config_nrach_pdu				nrach_pdu;
	};
} nfapi_ul_config_request_pdu_t;

#define NFAPI_UL_CONFIG_MAX_PDU 100
typedef struct {
	nfapi_tl_t tl;
	uint8_t number_of_pdus;
	uint8_t rach_prach_frequency_resources;
	uint8_t srs_present;
	nfapi_ul_config_request_pdu_t* ul_config_pdu_list;
} nfapi_ul_config_request_body_t;
#define NFAPI_UL_CONFIG_REQUEST_BODY_TAG 0x200C

typedef struct {
	nfapi_tl_t tl;
	uint8_t resource_block_start;
	uint8_t cyclic_shift_2_for_drms;
	uint8_t hi_value;
	uint8_t i_phich;
	uint16_t transmission_power;
} nfapi_hi_dci0_hi_pdu_rel8_t;
#define NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG 0x201e

typedef struct {
	nfapi_tl_t tl;
	uint8_t flag_tb2;
	uint8_t hi_value_2;
} nfapi_hi_dci0_hi_pdu_rel10_t;
#define NFAPI_HI_DCI0_REQUEST_HI_PDU_REL10_TAG 0x201f

typedef struct {
	nfapi_hi_dci0_hi_pdu_rel8_t		hi_pdu_rel8;
	nfapi_hi_dci0_hi_pdu_rel10_t	hi_pdu_rel10;
} nfapi_hi_dci0_hi_pdu;

typedef struct {
	nfapi_tl_t tl;
	uint8_t dci_format;
	uint8_t cce_index;
	uint8_t aggregation_level;
	uint16_t rnti;
	uint8_t resource_block_start;
	uint8_t number_of_resource_block;
	uint8_t mcs_1;
	uint8_t cyclic_shift_2_for_drms;
	uint8_t frequency_hopping_enabled_flag;
	uint8_t frequency_hopping_bits;
	uint8_t new_data_indication_1;
	uint8_t ue_tx_antenna_seleciton;
	uint8_t tpc;
	uint8_t cqi_csi_request;
	uint8_t ul_index;
	uint8_t dl_assignment_index;
	uint32_t tpc_bitmap;
	uint16_t transmission_power;
2221
	uint8_t harq_pid;
2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364
} nfapi_hi_dci0_dci_pdu_rel8_t;
#define NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG 0x2020

typedef struct {
	nfapi_tl_t tl;
	uint8_t cross_carrier_scheduling_flag;
	uint8_t carrier_indicator;
	uint8_t size_of_cqi_csi_feild;
	uint8_t srs_flag;
	uint8_t srs_request;
	uint8_t resource_allocation_flag;
	uint8_t resource_allocation_type;
	uint32_t resource_block_coding;
	uint8_t mcs_2;
	uint8_t new_data_indication_2;
	uint8_t number_of_antenna_ports;
	uint8_t tpmi;
	uint8_t total_dci_length_including_padding;
	uint8_t n_ul_rb;
} nfapi_hi_dci0_dci_pdu_rel10_t;
#define NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL10_TAG 0x2021

typedef struct {
	nfapi_tl_t tl;
	uint8_t pscch_resource;
	uint8_t time_resource_pattern;
} nfapi_hi_dci0_dci_pdu_rel12_t;

#define NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL12_TAG 0x204D

typedef struct {
	nfapi_hi_dci0_dci_pdu_rel8_t	dci_pdu_rel8;
	nfapi_hi_dci0_dci_pdu_rel10_t	dci_pdu_rel10;
	nfapi_hi_dci0_dci_pdu_rel12_t	dci_pdu_rel12;
} nfapi_hi_dci0_dci_pdu;

typedef nfapi_hi_dci0_dci_pdu_rel8_t nfapi_hi_dci0_epdcch_dci_pdu_rel8_t;
#define NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL8_TAG 0x2020

typedef nfapi_hi_dci0_dci_pdu_rel10_t nfapi_hi_dci0_epdcch_dci_pdu_rel10_t;
#define NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL10_TAG 0x2021

typedef nfapi_dl_config_epdcch_parameters_rel11_t nfapi_hi_dci0_epdcch_parameters_rel11_t;
#define NFAPI_HI_DCI0_REQUEST_EPDCCH_PARAMETERS_REL11_TAG 0x2041

typedef struct {
	nfapi_hi_dci0_epdcch_dci_pdu_rel8_t		epdcch_dci_pdu_rel8;
	nfapi_hi_dci0_epdcch_dci_pdu_rel10_t	epdcch_dci_pdu_rel10;
	nfapi_hi_dci0_epdcch_parameters_rel11_t	epdcch_parameters_rel11;
} nfapi_hi_dci0_epdcch_dci_pdu;


typedef struct {
	nfapi_tl_t tl;
	uint8_t mpdcch_narrowband;
	uint8_t number_of_prb_pairs;
	uint8_t resource_block_assignment;
	uint8_t mpdcch_transmission_type;
	uint8_t start_symbol;
	uint8_t ecce_index;
	uint8_t aggreagation_level;
	uint8_t rnti_type;
	uint16_t rnti;
	uint8_t ce_mode;
	uint16_t drms_scrambling_init;
	uint16_t initial_transmission_sf_io;
	uint16_t transmission_power;
	uint8_t dci_format;
	uint8_t resource_block_start;
	uint8_t number_of_resource_blocks;
	uint8_t mcs;
	uint8_t pusch_repetition_levels;
	uint8_t frequency_hopping_flag;
	uint8_t new_data_indication;
	uint8_t harq_process;
	uint8_t redudency_version;
	uint8_t tpc;
	uint8_t csi_request;
	uint8_t ul_inex;
	uint8_t dai_presence_flag;
	uint8_t dl_assignment_index;
	uint8_t srs_request;
	uint8_t dci_subframe_repetition_number;
	uint32_t tcp_bitmap;
	uint8_t total_dci_length_include_padding;
	uint8_t number_of_tx_antenna_ports;
	uint16_t precoding_value[NFAPI_MAX_ANTENNA_PORT_COUNT];
} nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t;
#define NFAPI_HI_DCI0_REQUEST_MPDCCH_DCI_PDU_REL13_TAG 0x204E

typedef struct {
	nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t	mpdcch_dci_pdu_rel13;
} nfapi_hi_dci0_mpdcch_dci_pdu;

typedef struct {
	nfapi_tl_t tl;
	uint8_t ncce_index;
	uint8_t aggregation_level;
	uint8_t start_symbol;
	uint16_t rnti;
	uint8_t scrambling_reinitialization_batch_index;
	uint8_t nrs_antenna_ports_assumed_by_the_ue;
	uint8_t subcarrier_indication;
	uint8_t resource_assignment;
	uint8_t scheduling_delay;
	uint8_t mcs;
	uint8_t redudancy_version;
	uint8_t repetition_number;
	uint8_t new_data_indicator;
	uint8_t dci_subframe_repetition_number;
} nfapi_hi_dci0_npdcch_dci_pdu_rel13_t;

#define NFAPI_HI_DCI0_REQUEST_NPDCCH_DCI_PDU_REL13_TAG 0x2062

typedef struct {
	nfapi_hi_dci0_npdcch_dci_pdu_rel13_t	npdcch_dci_pdu_rel13;
} nfapi_hi_dci0_npdcch_dci_pdu;

typedef struct {
	uint8_t pdu_type;
	uint8_t pdu_size;
	union {
		nfapi_hi_dci0_hi_pdu			hi_pdu;
		nfapi_hi_dci0_dci_pdu			dci_pdu;
		nfapi_hi_dci0_epdcch_dci_pdu	epdcch_dci_pdu;
		nfapi_hi_dci0_mpdcch_dci_pdu	mpdcch_dci_pdu;
		nfapi_hi_dci0_npdcch_dci_pdu	npdcch_dci_pdu;
	};
} nfapi_hi_dci0_request_pdu_t;

#define NFAPI_HI_DCI0_MAX_PDU 100
typedef struct {
	nfapi_tl_t tl;
	uint16_t sfnsf;
	uint8_t number_of_dci;
	uint8_t number_of_hi;
	nfapi_hi_dci0_request_pdu_t* hi_dci0_pdu_list;
} nfapi_hi_dci0_request_body_t;
#define NFAPI_HI_DCI0_REQUEST_BODY_TAG 0x201D

#define NFAPI_TX_MAX_SEGMENTS 32
typedef struct {
	uint16_t pdu_length;
2365
	int16_t pdu_index;
2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594