U8, U16, U32 data type changes
[o-du/l2.git] / src / cm / tfu.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18 \f
19
20 /************************************************************************
21  
22      Name:     LTE-MAC layer
23   
24      Type:     C source file
25   
26      Desc:     C source code for pack/unpack of TFU interface primitives. 
27   
28      File:     tfu.c 
29   
30 **********************************************************************/
31
32 /** @file tfu.c
33 @brief This file contains the packing/unpacking code for the TFU interface 
34        primitives.
35 */
36
37 /* header include files (.h) */
38 #include "common_def.h" 
39 #include "tfu.h"           /* RGU Interface defines */
40
41 /* header/extern include files (.x) */
42 #include "tfu.x"           /* RGU Interface includes */
43
44 #include "du_app_mac_inf.h"
45 //#include "mac_sch_interface.h"
46
47 #if (defined(LCTFU))
48
49 \f
50 /***********************************************************
51 *
52 *     Func : cmPkTfuBndReq
53 *
54 *
55 *     Desc : This API is used to send a Bind Request from MAC to PHY.
56  * @param pst Pointer to the post structure.
57  * @param suId SAP ID of the service user.
58  * @param spId SAP ID of the service provider.
59  * @return ROK/RFAILED
60 *
61 *
62 *     Ret  : S16
63 *
64 *     Notes:
65 *
66 *     File  : 
67 *
68 **********************************************************/
69 #ifdef ANSI
70 S16 cmPkTfuBndReq
71 (
72 Pst * pst,
73 SuId suId,
74 SpId spId
75 )
76 #else
77 S16 cmPkTfuBndReq(pst, suId, spId)
78 Pst * pst;
79 SuId suId;
80 SpId spId;
81 #endif
82 {
83    Buffer *mBuf = NULLP;
84
85    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
86 #if (ERRCLASS & ERRCLS_ADD_RES)
87       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
88          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
89          (ErrVal)ETFU001, (ErrVal)0, "Packing failed");
90 #endif
91       return RFAILED;
92    }
93    if (SPkS16(spId, mBuf) != ROK) {
94 #if (ERRCLASS & ERRCLS_ADD_RES)
95       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
96          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
97          (ErrVal)ETFU002, (ErrVal)0, "Packing failed");
98 #endif
99       TFU_FREE_MSG(mBuf);
100       return RFAILED;
101    }
102    if (SPkS16(suId, mBuf) != ROK) {
103 #if (ERRCLASS & ERRCLS_ADD_RES)
104       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
105          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
106          (ErrVal)ETFU003, (ErrVal)0, "Packing failed");
107 #endif
108       TFU_FREE_MSG(mBuf);
109       return RFAILED;
110    }
111    pst->event = (Event) EVTTFUBNDREQ;
112    return (SPstTsk(pst,mBuf));
113 }
114
115 \f
116 /***********************************************************
117 *
118 *     Func : cmUnpkTfuBndReq
119 *
120 *
121 *     Desc : This API is used to send a Bind Request from MAC to PHY.
122  * @param pst Pointer to the post structure.
123  * @param suId SAP ID of the service user.
124  * @param spId SAP ID of the service provider.
125  * @return ROK/RFAILED
126 *
127 *
128 *     Ret  : S16
129 *
130 *     Notes:
131 *
132 *     File  : 
133 *
134 **********************************************************/
135 #ifdef ANSI
136 S16 cmUnpkTfuBndReq
137 (
138 TfuBndReq func,
139 Pst *pst,
140 Buffer *mBuf
141 )
142 #else
143 S16 cmUnpkTfuBndReq(func, pst, mBuf)
144 TfuBndReq func;
145 Pst *pst;
146 Buffer *mBuf;
147 #endif
148 {
149    SuId suId;
150    SpId spId;
151    
152
153    if (SUnpkS16(&suId, mBuf) != ROK) {
154       TFU_FREE_MSG(mBuf);
155 #if (ERRCLASS & ERRCLS_ADD_RES)
156       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
157          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
158          (ErrVal)ETFU004, (ErrVal)0, "Packing failed");
159 #endif
160       return RFAILED;
161    }
162    if (SUnpkS16(&spId, mBuf) != ROK) {
163       TFU_FREE_MSG(mBuf);
164 #if (ERRCLASS & ERRCLS_ADD_RES)
165       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
166          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
167          (ErrVal)ETFU005, (ErrVal)0, "Packing failed");
168 #endif
169       return RFAILED;
170    }
171    TFU_FREE_MSG(mBuf);
172    return ((*func)(pst, suId, spId));
173 }
174
175 \f
176 /***********************************************************
177 *
178 *     Func : cmPkTfuBndCfm
179 *
180 *
181 *     Desc : This API is used to receive a Bind Confirm from PHY to MAC.
182  * @param pst Pointer to the post structure.
183  * @param suId SAP ID of the service user.
184  * @param status Status of the bind request.
185  * @return ROK/RFAILED
186 *
187 *
188 *     Ret  : S16
189 *
190 *     Notes:
191 *
192 *     File  : 
193 *
194 **********************************************************/
195 #ifdef ANSI
196 S16 cmPkTfuBndCfm
197 (
198 Pst * pst,
199 SuId suId,
200 uint8_t status
201 )
202 #else
203 S16 cmPkTfuBndCfm(pst, suId, status)
204 Pst * pst;
205 SuId suId;
206 uint8_t status;
207 #endif
208 {
209    Buffer *mBuf = NULLP;
210
211    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
212 #if (ERRCLASS & ERRCLS_ADD_RES)
213       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
214          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
215          (ErrVal)ETFU006, (ErrVal)0, "Packing failed");
216 #endif
217       return RFAILED;
218    }
219    if (oduUnpackUInt8(status, mBuf) != ROK) {
220 #if (ERRCLASS & ERRCLS_ADD_RES)
221       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
222          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
223          (ErrVal)ETFU007, (ErrVal)0, "Packing failed");
224 #endif
225       TFU_FREE_MSG(mBuf);
226       return RFAILED;
227    }
228    if (SPkS16(suId, mBuf) != ROK) {
229 #if (ERRCLASS & ERRCLS_ADD_RES)
230       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
231          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
232          (ErrVal)ETFU008, (ErrVal)0, "Packing failed");
233 #endif
234       TFU_FREE_MSG(mBuf);
235       return RFAILED;
236    }
237    pst->event = (Event) EVTTFUBNDCFM;
238    return (SPstTsk(pst,mBuf));
239 }
240
241 \f
242 /***********************************************************
243 *
244 *     Func : cmUnpkTfuBndCfm
245 *
246 *
247 *     Desc : This API is used to receive a Bind Confirm from PHY to MAC.
248  * @param pst Pointer to the post structure.
249  * @param suId SAP ID of the service user.
250  * @param status Status of the bind request.
251  * @return ROK/RFAILED
252 *
253 *
254 *     Ret  : S16
255 *
256 *     Notes:
257 *
258 *     File  : 
259 *
260 **********************************************************/
261 #ifdef ANSI
262 S16 cmUnpkTfuBndCfm
263 (
264 TfuBndCfm func,
265 Pst *pst,
266 Buffer *mBuf
267 )
268 #else
269 S16 cmUnpkTfuBndCfm(func, pst, mBuf)
270 TfuBndCfm func;
271 Pst *pst;
272 Buffer *mBuf;
273 #endif
274 {
275    SuId suId;
276    uint8_t status;
277    
278
279    if (SUnpkS16(&suId, mBuf) != ROK) {
280       TFU_FREE_MSG(mBuf);
281 #if (ERRCLASS & ERRCLS_ADD_RES)
282       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
283          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
284          (ErrVal)ETFU009, (ErrVal)0, "Packing failed");
285 #endif
286       return RFAILED;
287    }
288    if (oduPackUInt8(&status, mBuf) != ROK) {
289       TFU_FREE_MSG(mBuf);
290 #if (ERRCLASS & ERRCLS_ADD_RES)
291       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
292          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
293          (ErrVal)ETFU010, (ErrVal)0, "Packing failed");
294 #endif
295       return RFAILED;
296    }
297    TFU_FREE_MSG(mBuf);
298    return ((*func)(pst, suId, status));
299 }
300
301 \f
302 /***********************************************************
303 *
304 *     Func : cmPkTfuUbndReq
305 *
306 *
307 *     Desc : This API is used to send an Unbind Request from MAC to PHY.
308  * @param pst Pointer to the post structure.
309  * @param suId SAP ID of the service provider.
310  * @param reason Reason for Unbind request.
311  * @return ROK/RFAILED
312 *
313 *
314 *     Ret  : S16
315 *
316 *     Notes:
317 *
318 *     File  : 
319 *
320 **********************************************************/
321 #ifdef ANSI
322 S16 cmPkTfuUbndReq
323 (
324 Pst * pst,
325 SpId spId,
326 Reason reason
327 )
328 #else
329 S16 cmPkTfuUbndReq(pst, spId, reason)
330 Pst * pst;
331 SpId spId;
332 Reason reason;
333 #endif
334 {
335    Buffer *mBuf = NULLP;
336
337    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
338 #if (ERRCLASS & ERRCLS_ADD_RES)
339       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
340          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
341          (ErrVal)ETFU011, (ErrVal)0, "Packing failed");
342 #endif
343       return RFAILED;
344    }
345    if (SPkS16(reason, mBuf) != ROK) {
346 #if (ERRCLASS & ERRCLS_ADD_RES)
347       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
348          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
349          (ErrVal)ETFU012, (ErrVal)0, "Packing failed");
350 #endif
351       TFU_FREE_MSG(mBuf);
352       return RFAILED;
353    }
354    if (SPkS16(spId, mBuf) != ROK) {
355 #if (ERRCLASS & ERRCLS_ADD_RES)
356       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
357          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
358          (ErrVal)ETFU013, (ErrVal)0, "Packing failed");
359 #endif
360       TFU_FREE_MSG(mBuf);
361       return RFAILED;
362    }
363    pst->event = (Event) EVTTFUUBNDREQ;
364    return (SPstTsk(pst,mBuf));
365 }
366
367 \f
368 /***********************************************************
369 *
370 *     Func : cmUnpkTfuUbndReq
371 *
372 *
373 *     Desc : This API is used to send an Unbind Request from MAC to PHY.
374  * @param pst Pointer to the post structure.
375  * @param suId SAP ID of the service provider.
376  * @param reason Reason for Unbind request.
377  * @return ROK/RFAILED
378 *
379 *
380 *     Ret  : S16
381 *
382 *     Notes:
383 *
384 *     File  : 
385 *
386 **********************************************************/
387 #ifdef ANSI
388 S16 cmUnpkTfuUbndReq
389 (
390 TfuUbndReq func,
391 Pst *pst,
392 Buffer *mBuf
393 )
394 #else
395 S16 cmUnpkTfuUbndReq(func, pst, mBuf)
396 TfuUbndReq func;
397 Pst *pst;
398 Buffer *mBuf;
399 #endif
400 {
401    SpId spId;
402    Reason reason;
403    
404
405    if (SUnpkS16(&spId, mBuf) != ROK) {
406       TFU_FREE_MSG(mBuf);
407 #if (ERRCLASS & ERRCLS_ADD_RES)
408       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
409          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
410          (ErrVal)ETFU014, (ErrVal)0, "Packing failed");
411 #endif
412       return RFAILED;
413    }
414    if (SUnpkS16(&reason, mBuf) != ROK) {
415       TFU_FREE_MSG(mBuf);
416 #if (ERRCLASS & ERRCLS_ADD_RES)
417       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
418          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
419          (ErrVal)ETFU015, (ErrVal)0, "Packing failed");
420 #endif
421       return RFAILED;
422    }
423    TFU_FREE_MSG(mBuf);
424    return ((*func)(pst, spId, reason));
425 }
426
427 \f
428 /***********************************************************
429 *
430 *     Func : cmPkTfuSchBndReq
431 *
432 *
433 *     Desc : This API is used to send a Bind Request from Scheduler to PHY.
434  * @param pst Pointer to the post structure.
435  * @param suId SAP ID of the service user.
436  * @param spId SAP ID of the service provider.
437  * @return ROK/RFAILED
438 *
439 *
440 *     Ret  : S16
441 *
442 *     Notes:
443 *
444 *     File  : 
445 *
446 **********************************************************/
447 #ifdef ANSI
448 S16 cmPkTfuSchBndReq
449 (
450 Pst * pst,
451 SuId suId,
452 SpId spId
453 )
454 #else
455 S16 cmPkTfuSchBndReq(pst, suId, spId)
456 Pst * pst;
457 SuId suId;
458 SpId spId;
459 #endif
460 {
461    Buffer *mBuf = NULLP;
462
463    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
464 #if (ERRCLASS & ERRCLS_ADD_RES)
465       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
466          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
467          (ErrVal)ETFU016, (ErrVal)0, "Packing failed");
468 #endif
469       return RFAILED;
470    }
471    if (SPkS16(spId, mBuf) != ROK) {
472 #if (ERRCLASS & ERRCLS_ADD_RES)
473       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
474          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
475          (ErrVal)ETFU017, (ErrVal)0, "Packing failed");
476 #endif
477       TFU_FREE_MSG(mBuf);
478       return RFAILED;
479    }
480    if (SPkS16(suId, mBuf) != ROK) {
481 #if (ERRCLASS & ERRCLS_ADD_RES)
482       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
483          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
484          (ErrVal)ETFU018, (ErrVal)0, "Packing failed");
485 #endif
486       TFU_FREE_MSG(mBuf);
487       return RFAILED;
488    }
489    pst->event = (Event) EVTTFUSCHBNDREQ;
490    return (SPstTsk(pst,mBuf));
491 }
492
493 \f
494 /***********************************************************
495 *
496 *     Func : cmUnpkTfuSchBndReq
497 *
498 *
499 *     Desc : This API is used to send a Bind Request from Scheduler to PHY.
500  * @param pst Pointer to the post structure.
501  * @param suId SAP ID of the service user.
502  * @param spId SAP ID of the service provider.
503  * @return ROK/RFAILED
504 *
505 *
506 *     Ret  : S16
507 *
508 *     Notes:
509 *
510 *     File  : 
511 *
512 **********************************************************/
513 #ifdef ANSI
514 S16 cmUnpkTfuSchBndReq
515 (
516 TfuSchBndReq func,
517 Pst *pst,
518 Buffer *mBuf
519 )
520 #else
521 S16 cmUnpkTfuSchBndReq(func, pst, mBuf)
522 TfuSchBndReq func;
523 Pst *pst;
524 Buffer *mBuf;
525 #endif
526 {
527    SuId suId;
528    SpId spId;
529    
530
531    if (SUnpkS16(&suId, mBuf) != ROK) {
532       TFU_FREE_MSG(mBuf);
533 #if (ERRCLASS & ERRCLS_ADD_RES)
534       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
535          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
536          (ErrVal)ETFU019, (ErrVal)0, "Packing failed");
537 #endif
538       return RFAILED;
539    }
540    if (SUnpkS16(&spId, mBuf) != ROK) {
541       TFU_FREE_MSG(mBuf);
542 #if (ERRCLASS & ERRCLS_ADD_RES)
543       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
544          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
545          (ErrVal)ETFU020, (ErrVal)0, "Packing failed");
546 #endif
547       return RFAILED;
548    }
549    TFU_FREE_MSG(mBuf);
550    return ((*func)(pst, suId, spId));
551 }
552
553 \f
554 /***********************************************************
555 *
556 *     Func : cmPkTfuSchBndCfm
557 *
558 *
559 *     Desc : This API is used to receive a Bind Confirm from PHY to Scheduler.
560  * @param pst Pointer to the post structure.
561  * @param suId SAP ID of the service user.
562  * @param status Status of the bind request.
563  * @return ROK/RFAILED
564 *
565 *
566 *     Ret  : S16
567 *
568 *     Notes:
569 *
570 *     File  : 
571 *
572 **********************************************************/
573 #ifdef ANSI
574 S16 cmPkTfuSchBndCfm
575 (
576 Pst * pst,
577 SuId suId,
578 uint8_t status
579 )
580 #else
581 S16 cmPkTfuSchBndCfm(pst, suId, status)
582 Pst * pst;
583 SuId suId;
584 uint8_t status;
585 #endif
586 {
587    Buffer *mBuf = NULLP;
588
589    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
590 #if (ERRCLASS & ERRCLS_ADD_RES)
591       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
592          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
593          (ErrVal)ETFU021, (ErrVal)0, "Packing failed");
594 #endif
595       return RFAILED;
596    }
597    if (oduUnpackUInt8(status, mBuf) != ROK) {
598 #if (ERRCLASS & ERRCLS_ADD_RES)
599       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
600          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
601          (ErrVal)ETFU022, (ErrVal)0, "Packing failed");
602 #endif
603       TFU_FREE_MSG(mBuf);
604       return RFAILED;
605    }
606    if (SPkS16(suId, mBuf) != ROK) {
607 #if (ERRCLASS & ERRCLS_ADD_RES)
608       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
609          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
610          (ErrVal)ETFU023, (ErrVal)0, "Packing failed");
611 #endif
612       TFU_FREE_MSG(mBuf);
613       return RFAILED;
614    }
615    pst->event = (Event) EVTTFUSCHBNDCFM;
616    return (SPstTsk(pst,mBuf));
617 }
618
619 \f
620 /***********************************************************
621 *
622 *     Func : cmUnpkTfuSchBndCfm
623 *
624 *
625 *     Desc : This API is used to receive a Bind Confirm from PHY to Scheduler.
626  * @param pst Pointer to the post structure.
627  * @param suId SAP ID of the service user.
628  * @param status Status of the bind request.
629  * @return ROK/RFAILED
630 *
631 *
632 *     Ret  : S16
633 *
634 *     Notes:
635 *
636 *     File  : 
637 *
638 **********************************************************/
639 #ifdef ANSI
640 S16 cmUnpkTfuSchBndCfm
641 (
642 TfuSchBndCfm func,
643 Pst *pst,
644 Buffer *mBuf
645 )
646 #else
647 S16 cmUnpkTfuSchBndCfm(func, pst, mBuf)
648 TfuSchBndCfm func;
649 Pst *pst;
650 Buffer *mBuf;
651 #endif
652 {
653    SuId suId;
654    uint8_t status;
655    
656
657    if (SUnpkS16(&suId, mBuf) != ROK) {
658       TFU_FREE_MSG(mBuf);
659 #if (ERRCLASS & ERRCLS_ADD_RES)
660       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
661          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
662          (ErrVal)ETFU024, (ErrVal)0, "Packing failed");
663 #endif
664       return RFAILED;
665    }
666    if (oduPackUInt8(&status, mBuf) != ROK) {
667       TFU_FREE_MSG(mBuf);
668 #if (ERRCLASS & ERRCLS_ADD_RES)
669       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
670          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
671          (ErrVal)ETFU025, (ErrVal)0, "Packing failed");
672 #endif
673       return RFAILED;
674    }
675    TFU_FREE_MSG(mBuf);
676    return ((*func)(pst, suId, status));
677 }
678
679 \f
680 /***********************************************************
681 *
682 *     Func : cmPkTfuSchUbndReq
683 *
684 *
685 *     Desc : This API is used to send an Unbind Request from Scheduler to PHY.
686  * @param pst Pointer to the post structure.
687  * @param suId SAP ID of the service provider.
688  * @param reason Reason for Unbind request.
689  * @return ROK/RFAILED
690 *
691 *
692 *     Ret  : S16
693 *
694 *     Notes:
695 *
696 *     File  : 
697 *
698 **********************************************************/
699 #ifdef ANSI
700 S16 cmPkTfuSchUbndReq
701 (
702 Pst * pst,
703 SpId spId,
704 Reason reason
705 )
706 #else
707 S16 cmPkTfuSchUbndReq(pst, spId, reason)
708 Pst * pst;
709 SpId spId;
710 Reason reason;
711 #endif
712 {
713    Buffer *mBuf = NULLP;
714
715    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
716 #if (ERRCLASS & ERRCLS_ADD_RES)
717       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
718          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
719          (ErrVal)ETFU026, (ErrVal)0, "Packing failed");
720 #endif
721       return RFAILED;
722    }
723    if (SPkS16(reason, mBuf) != ROK) {
724 #if (ERRCLASS & ERRCLS_ADD_RES)
725       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
726          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
727          (ErrVal)ETFU027, (ErrVal)0, "Packing failed");
728 #endif
729       TFU_FREE_MSG(mBuf);
730       return RFAILED;
731    }
732    if (SPkS16(spId, mBuf) != ROK) {
733 #if (ERRCLASS & ERRCLS_ADD_RES)
734       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
735          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
736          (ErrVal)ETFU028, (ErrVal)0, "Packing failed");
737 #endif
738       TFU_FREE_MSG(mBuf);
739       return RFAILED;
740    }
741    pst->event = (Event) EVTTFUSCHUBNDREQ;
742    return (SPstTsk(pst,mBuf));
743 }
744
745 \f
746 /***********************************************************
747 *
748 *     Func : cmUnpkTfuSchUbndReq
749 *
750 *
751 *     Desc : This API is used to send an Unbind Request from Scheduler to PHY.
752  * @param pst Pointer to the post structure.
753  * @param suId SAP ID of the service provider.
754  * @param reason Reason for Unbind request.
755  * @return ROK/RFAILED
756 *
757 *
758 *     Ret  : S16
759 *
760 *     Notes:
761 *
762 *     File  : 
763 *
764 **********************************************************/
765 #ifdef ANSI
766 S16 cmUnpkTfuSchUbndReq
767 (
768 TfuSchUbndReq func,
769 Pst *pst,
770 Buffer *mBuf
771 )
772 #else
773 S16 cmUnpkTfuSchUbndReq(func, pst, mBuf)
774 TfuSchUbndReq func;
775 Pst *pst;
776 Buffer *mBuf;
777 #endif
778 {
779    SpId spId;
780    Reason reason;
781    
782
783    if (SUnpkS16(&spId, mBuf) != ROK) {
784       TFU_FREE_MSG(mBuf);
785 #if (ERRCLASS & ERRCLS_ADD_RES)
786       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
787          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
788          (ErrVal)ETFU029, (ErrVal)0, "Packing failed");
789 #endif
790       return RFAILED;
791    }
792    if (SUnpkS16(&reason, mBuf) != ROK) {
793       TFU_FREE_MSG(mBuf);
794 #if (ERRCLASS & ERRCLS_ADD_RES)
795       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
796          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
797          (ErrVal)ETFU030, (ErrVal)0, "Packing failed");
798 #endif
799       return RFAILED;
800    }
801    TFU_FREE_MSG(mBuf);
802    return ((*func)(pst, spId, reason));
803 }
804
805 \f
806 /***********************************************************
807 *
808 *     Func : cmPkTfuRaReqInd
809 *
810 *
811 *     Desc : This API is used to indication Random Access Request reception from
812  * PHY to Scheduler.
813  * @details This primitive is used by physical layer to indicate the reception
814  * of a Random Access Request from a set of UEs. The information passed consists
815  * of the RA-RNTI and the list of preambles received. 
816  * @param pst Pointer to the post structure.
817  * @param suId SAP ID of the service user.
818  * @param raReqInd Pointer to the TfuRaReqIndInfo structure.
819  * @return ROK/RFAILED
820 *
821 *
822 *     Ret  : S16
823 *
824 *     Notes:
825 *
826 *     File  : 
827 *
828 **********************************************************/
829 #ifdef ANSI
830 S16 cmPkTfuRaReqInd
831 (
832 Pst * pst,
833 SuId suId,
834 TfuRaReqIndInfo * raReqInd
835 )
836 #else
837 S16 cmPkTfuRaReqInd(pst, suId, raReqInd)
838 Pst * pst;
839 SuId suId;
840 TfuRaReqIndInfo * raReqInd;
841 #endif
842 {
843    Buffer *mBuf = NULLP;
844
845    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
846 #if (ERRCLASS & ERRCLS_ADD_RES)
847       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
848          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
849          (ErrVal)ETFU031, (ErrVal)0, "Packing failed");
850 #endif
851       TFU_FREE_MEM(raReqInd);
852       return RFAILED;
853    }
854    if (pst->selector == ODU_SELECTOR_LC) {
855       if (cmPkTfuRaReqIndInfo(raReqInd, mBuf) != ROK) {
856 #if (ERRCLASS & ERRCLS_ADD_RES)
857          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
858             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
859             (ErrVal)ETFU032, (ErrVal)0, "Packing failed");
860 #endif
861          TFU_FREE_MEM(raReqInd);
862          TFU_FREE_MSG(mBuf);
863          return RFAILED;
864       }
865    }
866    else if(pst->selector == ODU_SELECTOR_LWLC)
867    {
868       if (oduPackPointer((PTR)raReqInd, mBuf) != ROK)
869       {
870 #if (ERRCLASS & ERRCLS_ADD_RES)
871          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
872             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
873             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
874 #endif
875          TFU_FREE_MEM(raReqInd);
876          TFU_FREE_MSG(mBuf);
877          return RFAILED;
878       }
879    }
880
881    if (SPkS16(suId, mBuf) != ROK) {
882 #if (ERRCLASS & ERRCLS_ADD_RES)
883       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
884          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
885          (ErrVal)ETFU033, (ErrVal)0, "Packing failed");
886 #endif
887       TFU_FREE_MEM(raReqInd);
888       TFU_FREE_MSG(mBuf);
889       return RFAILED;
890    }
891    if (pst->selector != ODU_SELECTOR_LWLC) {
892       TFU_FREE_MEM(raReqInd);
893    }
894
895    pst->event = (Event) EVTTFURAREQIND;
896    return (SPstTsk(pst,mBuf));
897 }
898
899 \f
900 /***********************************************************
901 *
902 *     Func : cmUnpkTfuRaReqInd
903 *
904 *
905 *     Desc : This API is used to indication Random Access Request reception from
906  * PHY to Scheduler.
907  * @details This primitive is used by physical layer to indicate the reception
908  * of a Random Access Request from a set of UEs. The information passed consists
909  * of the RA-RNTI and the list of preambles received. 
910  * @param pst Pointer to the post structure.
911  * @param suId SAP ID of the service user.
912  * @param raReqInd Pointer to the TfuRaReqIndInfo structure.
913  * @return ROK/RFAILED
914 *
915 *
916 *     Ret  : S16
917 *
918 *     Notes:
919 *
920 *     File  : 
921 *
922 **********************************************************/
923 #ifdef ANSI
924 S16 cmUnpkTfuRaReqInd
925 (
926 TfuRaReqInd func,
927 Pst *pst,
928 Buffer *mBuf
929 )
930 #else
931 S16 cmUnpkTfuRaReqInd(func, pst, mBuf)
932 TfuRaReqInd func;
933 Pst *pst;
934 Buffer *mBuf;
935 #endif
936 {
937    SuId suId;
938    TfuRaReqIndInfo *raReqInd;
939    
940
941    if (SUnpkS16(&suId, mBuf) != ROK) {
942       TFU_FREE_MSG(mBuf);
943 #if (ERRCLASS & ERRCLS_ADD_RES)
944       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
945          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
946          (ErrVal)ETFU034, (ErrVal)0, "Packing failed");
947 #endif
948       return RFAILED;
949    }
950    if (pst->selector != ODU_SELECTOR_LWLC) {
951       Mem   sMem;
952       sMem.region = pst->region;
953       sMem.pool = pst->pool;
954       if ((cmAllocEvnt(sizeof(TfuRaReqIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&raReqInd)) != ROK)            {
955 #if (ERRCLASS & ERRCLS_ADD_RES)
956          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
957             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
958             (ErrVal)ETFU035, (ErrVal)0, "Packing failed");
959 #endif
960          TFU_FREE_MSG(mBuf);
961          return RFAILED;
962       }
963    }
964
965
966    if (pst->selector == ODU_SELECTOR_LC) 
967    {
968       if (cmUnpkTfuRaReqIndInfo(raReqInd, mBuf) != ROK) {
969          TFU_FREE_MEM(raReqInd);
970          TFU_FREE_MSG(mBuf);
971 #if (ERRCLASS & ERRCLS_ADD_RES)
972          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
973                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
974                (ErrVal)ETFU036, (ErrVal)0, "Packing failed");
975 #endif
976          return RFAILED;
977       }
978    }
979    else if(pst->selector == ODU_SELECTOR_LWLC)
980    {
981       if (oduUnpackPointer((PTR *)&raReqInd, mBuf) != ROK)
982       {
983 #if (ERRCLASS & ERRCLS_ADD_RES)
984          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
985             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
986             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
987 #endif
988          TFU_FREE_MEM(raReqInd);
989          TFU_FREE_MSG(mBuf);
990          return RFAILED;
991       }
992    }
993    TFU_FREE_MSG(mBuf);
994    return ((*func)(pst, suId, raReqInd));
995 }
996
997 \f
998 /***********************************************************
999 *
1000 *     Func : cmPkTfuRecpReq
1001 *
1002 *
1003 *     Desc : This primitive is sent from Scheduler to PHY.
1004  * @details This primitive provides PHY with all the information required by 
1005  * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
1006  * -# On PUCCH UE can transmit the following
1007  *    -# SR
1008  *    -# HARQ feedback
1009  *    -# CQI report
1010  *    -# HARQ + CQI
1011  *    -# HARQ + SR
1012  * -# On PUSCH UE can transmit the following
1013  *    -# Data
1014  *    -# Data + CQI
1015  *    -# Data + HARQ Feedback
1016  * This primitive carries all the information for the expected subframe for all
1017  * the UEs that have been scheduled to transmit.
1018  * @param pst Pointer to the post structure.
1019  * @param spId SAP ID of the service provider.
1020  * @param recpReq Pointer to the TfuRecpReqInfo structure.
1021  * @return ROK/RFAILED
1022 *
1023 *
1024 *     Ret  : S16
1025 *
1026 *     Notes:
1027 *
1028 *     File  : 
1029 *
1030 **********************************************************/
1031 #ifdef ANSI
1032 S16 cmPkTfuRecpReq
1033 (
1034 Pst * pst,
1035 SpId spId,
1036 TfuRecpReqInfo * recpReq
1037 )
1038 #else
1039 S16 cmPkTfuRecpReq(pst, spId, recpReq)
1040 Pst * pst;
1041 SpId spId;
1042 TfuRecpReqInfo * recpReq;
1043 #endif
1044 {
1045    Buffer *mBuf = NULLP;
1046
1047    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1048 #if (ERRCLASS & ERRCLS_ADD_RES)
1049       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1050          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1051          (ErrVal)ETFU037, (ErrVal)0, "Packing failed");
1052 #endif
1053       TFU_FREE_MEM(recpReq);
1054       return RFAILED;
1055    }
1056    if (pst->selector == ODU_SELECTOR_LC) {
1057       if (cmPkTfuRecpReqInfo(recpReq, mBuf) != ROK) {
1058 #if (ERRCLASS & ERRCLS_ADD_RES)
1059          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1060             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1061             (ErrVal)ETFU038, (ErrVal)0, "Packing failed");
1062 #endif
1063          TFU_FREE_MEM(recpReq);
1064          TFU_FREE_MSG(mBuf);
1065          return RFAILED;
1066       }
1067    }
1068    else if(pst->selector == ODU_SELECTOR_LWLC)
1069    {
1070       if (oduPackPointer((PTR)recpReq, mBuf) != ROK)
1071       {
1072 #if (ERRCLASS & ERRCLS_ADD_RES)
1073          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1074             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1075             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1076 #endif
1077          TFU_FREE_MEM(recpReq);
1078          TFU_FREE_MSG(mBuf);
1079          return RFAILED;
1080       }
1081    }
1082
1083
1084    if (SPkS16(spId, mBuf) != ROK) {
1085 #if (ERRCLASS & ERRCLS_ADD_RES)
1086       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1087          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1088          (ErrVal)ETFU039, (ErrVal)0, "Packing failed");
1089 #endif
1090       TFU_FREE_MEM(recpReq);
1091       TFU_FREE_MSG(mBuf);
1092       return RFAILED;
1093    }
1094    if (pst->selector != ODU_SELECTOR_LWLC) {
1095       TFU_FREE_MEM(recpReq);
1096    }
1097
1098    pst->event = (Event) EVTTFURECPREQ;
1099    return (SPstTsk(pst,mBuf));
1100 }
1101
1102 \f
1103 /***********************************************************
1104 *
1105 *     Func : cmUnpkTfuRecpReq
1106 *
1107 *
1108 *     Desc : This primitive is sent from Scheduler to PHY.
1109  * @details This primitive provides PHY with all the information required by 
1110  * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
1111  * -# On PUCCH UE can transmit the following
1112  *    -# SR
1113  *    -# HARQ feedback
1114  *    -# CQI report
1115  *    -# HARQ + CQI
1116  *    -# HARQ + SR
1117  * -# On PUSCH UE can transmit the following
1118  *    -# Data
1119  *    -# Data + CQI
1120  *    -# Data + HARQ Feedback
1121  * This primitive carries all the information for the expected subframe for all
1122  * the UEs that have been scheduled to transmit.
1123  * @param pst Pointer to the post structure.
1124  * @param spId SAP ID of the service provider.
1125  * @param recpReq Pointer to the TfuRecpReqInfo structure.
1126  * @return ROK/RFAILED
1127 *
1128 *
1129 *     Ret  : S16
1130 *
1131 *     Notes:
1132 *
1133 *     File  : 
1134 *
1135 **********************************************************/
1136 #ifdef ANSI
1137 S16 cmUnpkTfuRecpReq
1138 (
1139 TfuRecpReq func,
1140 Pst *pst,
1141 Buffer *mBuf
1142 )
1143 #else
1144 S16 cmUnpkTfuRecpReq(func, pst, mBuf)
1145 TfuRecpReq func;
1146 Pst *pst;
1147 Buffer *mBuf;
1148 #endif
1149 {
1150    SpId spId;
1151    TfuRecpReqInfo *recpReq;
1152    
1153
1154    if (SUnpkS16(&spId, mBuf) != ROK) {
1155       TFU_FREE_MSG(mBuf);
1156 #if (ERRCLASS & ERRCLS_ADD_RES)
1157       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1158          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1159          (ErrVal)ETFU040, (ErrVal)0, "Packing failed");
1160 #endif
1161       return RFAILED;
1162    }
1163    if (pst->selector != ODU_SELECTOR_LWLC) {
1164       Mem   sMem;
1165       sMem.region = pst->region;
1166       sMem.pool = pst->pool;
1167       if ((cmAllocEvnt(sizeof(TfuRecpReqInfo), TFU_BLKSZ, &sMem, (Ptr *)&recpReq)) != ROK)            {
1168 #if (ERRCLASS & ERRCLS_ADD_RES)
1169          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1170             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1171             (ErrVal)ETFU041, (ErrVal)0, "Packing failed");
1172 #endif
1173          TFU_FREE_MSG(mBuf);
1174          return RFAILED;
1175       }
1176    }
1177    else if(pst->selector == ODU_SELECTOR_LWLC)
1178    {
1179       if (oduUnpackPointer((PTR *)&recpReq, mBuf) != ROK)
1180       {
1181 #if (ERRCLASS & ERRCLS_ADD_RES)
1182          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1183             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1184             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1185 #endif
1186          TFU_FREE_MEM(recpReq);
1187          TFU_FREE_MSG(mBuf);
1188          return RFAILED;
1189       }
1190    }
1191
1192    if (pst->selector == ODU_SELECTOR_LC) 
1193    {
1194       if (cmUnpkTfuRecpReqInfo(recpReq, (Ptr)&recpReq->memCp, mBuf) != ROK) {
1195          TFU_FREE_MEM(recpReq);
1196          TFU_FREE_MSG(mBuf);
1197 #if (ERRCLASS & ERRCLS_ADD_RES)
1198          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1199                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1200                (ErrVal)ETFU042, (ErrVal)0, "Packing failed");
1201 #endif
1202          return RFAILED;
1203       }
1204    }
1205    else if(pst->selector == ODU_SELECTOR_LWLC)
1206    {
1207       if (oduUnpackPointer((PTR*)&recpReq, mBuf) != ROK)
1208       {
1209 #if (ERRCLASS & ERRCLS_ADD_RES)
1210          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1211             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1212             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1213 #endif
1214          TFU_FREE_MEM(recpReq);
1215          TFU_FREE_MSG(mBuf);
1216          return RFAILED;
1217       }
1218    }
1219
1220    TFU_FREE_MSG(mBuf);
1221    return ((*func)(pst, spId, recpReq));
1222 }
1223
1224 \f
1225 /***********************************************************
1226 *
1227 *     Func : cmPkTfuUlCqiInd
1228 *
1229 *
1230 *     Desc : This API is used to indicate CQI reporting from PHY to Scheduler
1231  * @details This primitive carries an estimate of the uplink Channel quality
1232  * index (CQI) for a list of UEs. This is an extimate of the uplink channel
1233  * quality i.e. the transmission from UE as calculated at the Physical layer at
1234  * the eNodeB. 
1235  * It carries a list of subband CQIs for each UE. 
1236  * @param pst Pointer to the post structure.
1237  * @param suId SAP ID of the service user.
1238  * @param ulCqiInd Pointer to the TfuUlCqiIndInfo structure.
1239  * @return ROK/RFAILED
1240 *
1241 *
1242 *     Ret  : S16
1243 *
1244 *     Notes:
1245 *
1246 *     File  : 
1247 *
1248 **********************************************************/
1249 #ifdef ANSI
1250 S16 cmPkTfuUlCqiInd
1251 (
1252 Pst * pst,
1253 SuId suId,
1254 TfuUlCqiIndInfo * ulCqiInd
1255 )
1256 #else
1257 S16 cmPkTfuUlCqiInd(pst, suId, ulCqiInd)
1258 Pst * pst;
1259 SuId suId;
1260 TfuUlCqiIndInfo * ulCqiInd;
1261 #endif
1262 {
1263    Buffer *mBuf = NULLP;
1264
1265    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1266 #if (ERRCLASS & ERRCLS_ADD_RES)
1267       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1268          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1269          (ErrVal)ETFU043, (ErrVal)0, "Packing failed");
1270 #endif
1271       TFU_FREE_MEM(ulCqiInd);
1272       return RFAILED;
1273    }
1274    if (pst->selector == ODU_SELECTOR_LC) {
1275       if (cmPkTfuUlCqiIndInfo(ulCqiInd, mBuf) != ROK) {
1276 #if (ERRCLASS & ERRCLS_ADD_RES)
1277          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1278             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1279             (ErrVal)ETFU044, (ErrVal)0, "Packing failed");
1280 #endif
1281          TFU_FREE_MEM(ulCqiInd);
1282          TFU_FREE_MSG(mBuf);
1283          return RFAILED;
1284       }
1285    }
1286    else if(pst->selector == ODU_SELECTOR_LWLC)
1287    {
1288       if (oduPackPointer((PTR)ulCqiInd, mBuf) != ROK)
1289       {
1290 #if (ERRCLASS & ERRCLS_ADD_RES)
1291          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1292             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1293             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1294 #endif
1295          TFU_FREE_MEM(ulCqiInd);
1296          TFU_FREE_MSG(mBuf);
1297          return RFAILED;
1298       }
1299    }
1300
1301    if (SPkS16(suId, mBuf) != ROK) {
1302 #if (ERRCLASS & ERRCLS_ADD_RES)
1303       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1304          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1305          (ErrVal)ETFU045, (ErrVal)0, "Packing failed");
1306 #endif
1307       TFU_FREE_MEM(ulCqiInd);
1308       TFU_FREE_MSG(mBuf);
1309       return RFAILED;
1310    }
1311    if (pst->selector != ODU_SELECTOR_LWLC) {
1312       TFU_FREE_MEM(ulCqiInd);
1313    }
1314
1315    pst->event = (Event) EVTTFUULCQIIND;
1316    return (SPstTsk(pst,mBuf));
1317 }
1318
1319 \f
1320 /***********************************************************
1321 *
1322 *     Func : cmUnpkTfuUlCqiInd
1323 *
1324 *
1325 *     Desc : This API is used to indicate CQI reporting from PHY to Scheduler
1326  * @details This primitive carries an estimate of the uplink Channel quality
1327  * index (CQI) for a list of UEs. This is an extimate of the uplink channel
1328  * quality i.e. the transmission from UE as calculated at the Physical layer at
1329  * the eNodeB. 
1330  * It carries a list of subband CQIs for each UE. 
1331  * @param pst Pointer to the post structure.
1332  * @param suId SAP ID of the service user.
1333  * @param ulCqiInd Pointer to the TfuUlCqiIndInfo structure.
1334  * @return ROK/RFAILED
1335 *
1336 *
1337 *     Ret  : S16
1338 *
1339 *     Notes:
1340 *
1341 *     File  : 
1342 *
1343 **********************************************************/
1344 #ifdef ANSI
1345 S16 cmUnpkTfuUlCqiInd
1346 (
1347 TfuUlCqiInd func,
1348 Pst *pst,
1349 Buffer *mBuf
1350 )
1351 #else
1352 S16 cmUnpkTfuUlCqiInd(func, pst, mBuf)
1353 TfuUlCqiInd func;
1354 Pst *pst;
1355 Buffer *mBuf;
1356 #endif
1357 {
1358    SuId suId;
1359    TfuUlCqiIndInfo *ulCqiInd;
1360    
1361
1362    if (SUnpkS16(&suId, mBuf) != ROK) {
1363       TFU_FREE_MSG(mBuf);
1364 #if (ERRCLASS & ERRCLS_ADD_RES)
1365       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1366          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1367          (ErrVal)ETFU046, (ErrVal)0, "Packing failed");
1368 #endif
1369       return RFAILED;
1370    }
1371    if (pst->selector != ODU_SELECTOR_LWLC) {
1372       Mem   sMem;
1373       sMem.region = pst->region;
1374       sMem.pool = pst->pool;
1375       if ((cmAllocEvnt(sizeof(TfuUlCqiIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&ulCqiInd)) != ROK)            {
1376 #if (ERRCLASS & ERRCLS_ADD_RES)
1377          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1378             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1379             (ErrVal)ETFU047, (ErrVal)0, "Packing failed");
1380 #endif
1381          TFU_FREE_MSG(mBuf);
1382          return RFAILED;
1383       }
1384    }
1385
1386
1387    if (pst->selector == ODU_SELECTOR_LC) 
1388    {
1389       if (cmUnpkTfuUlCqiIndInfo(ulCqiInd, (Ptr)&ulCqiInd->memCp, mBuf) != ROK) {
1390          TFU_FREE_MEM(ulCqiInd);
1391          TFU_FREE_MSG(mBuf);
1392 #if (ERRCLASS & ERRCLS_ADD_RES)
1393          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1394                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1395                (ErrVal)ETFU048, (ErrVal)0, "Packing failed");
1396 #endif
1397          return RFAILED;
1398       }
1399    }
1400    else if(pst->selector == ODU_SELECTOR_LWLC)
1401    {
1402       if (oduUnpackPointer((PTR *)&ulCqiInd, mBuf) != ROK)
1403       {
1404 #if (ERRCLASS & ERRCLS_ADD_RES)
1405          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1406             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1407             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1408 #endif
1409          TFU_FREE_MEM(ulCqiInd);
1410          TFU_FREE_MSG(mBuf);
1411          return RFAILED;
1412       }
1413    }
1414    TFU_FREE_MSG(mBuf);
1415    return ((*func)(pst, suId, ulCqiInd));
1416 }
1417
1418 \f
1419 /***********************************************************
1420 *
1421 *     Func : cmPkTfuHqInd
1422 *
1423 *
1424 *     Desc : This Primitive carries the HARQ Feedback from PHY to scheduler
1425  * @details HARQ feedback is sent by the UE to the eNodeB, an ACK is sent if UE
1426  * could successfully recieve the data transmitted by the eNodeB, else a NACK is
1427  * sent. This feedback is utilized by MAC for further scheduling, for instance
1428  * it could schedule an adaptive retransmission of the same data. 
1429  * @param pst 
1430  * @param spId
1431  * @param tfuHqInd pointer to TfuHqIndInfo
1432  * @return
1433 *
1434 *
1435 *     Ret  : S16
1436 *
1437 *     Notes:
1438 *
1439 *     File  : 
1440 *
1441 **********************************************************/
1442 #ifdef ANSI
1443 S16 cmPkTfuHqInd
1444 (
1445 Pst * pst,
1446 SpId spId,
1447 TfuHqIndInfo * hqInd
1448 )
1449 #else
1450 S16 cmPkTfuHqInd(pst, spId, hqInd)
1451 Pst * pst;
1452 SpId spId;
1453 TfuHqIndInfo * hqInd;
1454 #endif
1455 {
1456    Buffer *mBuf = NULLP;
1457
1458    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1459 #if (ERRCLASS & ERRCLS_ADD_RES)
1460       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1461          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1462          (ErrVal)ETFU049, (ErrVal)0, "Packing failed");
1463 #endif
1464       TFU_FREE_MEM(hqInd);
1465       return RFAILED;
1466    }
1467    if (pst->selector == ODU_SELECTOR_LC) {
1468       if (cmPkTfuHqIndInfo(hqInd, mBuf) != ROK) {
1469 #if (ERRCLASS & ERRCLS_ADD_RES)
1470          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1471             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1472             (ErrVal)ETFU050, (ErrVal)0, "Packing failed");
1473 #endif
1474          TFU_FREE_MEM(hqInd);
1475          TFU_FREE_MSG(mBuf);
1476          return RFAILED;
1477       }
1478    }
1479    else if(pst->selector == ODU_SELECTOR_LWLC)
1480    {
1481       if (oduPackPointer((PTR)hqInd, mBuf) != ROK)
1482       {
1483 #if (ERRCLASS & ERRCLS_ADD_RES)
1484          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1485             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1486             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1487 #endif
1488          TFU_FREE_MEM(hqInd);
1489          TFU_FREE_MSG(mBuf);
1490          return RFAILED;
1491       }
1492    }
1493
1494    if (SPkS16(spId, mBuf) != ROK) {
1495 #if (ERRCLASS & ERRCLS_ADD_RES)
1496       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1497          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1498          (ErrVal)ETFU051, (ErrVal)0, "Packing failed");
1499 #endif
1500       TFU_FREE_MEM(hqInd);
1501       TFU_FREE_MSG(mBuf);
1502       return RFAILED;
1503    }
1504    if (pst->selector != ODU_SELECTOR_LWLC) {
1505       TFU_FREE_MEM(hqInd);
1506    }
1507
1508    pst->event = (Event) EVTTFUHQIND;
1509    return (SPstTsk(pst,mBuf));
1510 }
1511
1512 \f
1513 /***********************************************************
1514 *
1515 *     Func : cmUnpkTfuHqInd
1516 *
1517 *
1518 *     Desc : This Primitive carries the HARQ Feedback from PHY to scheduler
1519  * @details HARQ feedback is sent by the UE to the eNodeB, an ACK is sent if UE
1520  * could successfully recieve the data transmitted by the eNodeB, else a NACK is
1521  * sent. This feedback is utilized by MAC for further scheduling, for instance
1522  * it could schedule an adaptive retransmission of the same data. 
1523  * @param pst 
1524  * @param spId
1525  * @param tfuHqInd pointer to TfuHqIndInfo
1526  * @return
1527 *
1528 *
1529 *     Ret  : S16
1530 *
1531 *     Notes:
1532 *
1533 *     File  : 
1534 *
1535 **********************************************************/
1536 #ifdef ANSI
1537 S16 cmUnpkTfuHqInd
1538 (
1539 TfuHqInd func,
1540 Pst *pst,
1541 Buffer *mBuf
1542 )
1543 #else
1544 S16 cmUnpkTfuHqInd(func, pst, mBuf)
1545 TfuHqInd func;
1546 Pst *pst;
1547 Buffer *mBuf;
1548 #endif
1549 {
1550    SpId spId;
1551    TfuHqIndInfo *hqInd;
1552    
1553
1554    if (SUnpkS16(&spId, mBuf) != ROK) {
1555       TFU_FREE_MSG(mBuf);
1556 #if (ERRCLASS & ERRCLS_ADD_RES)
1557       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1558          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1559          (ErrVal)ETFU052, (ErrVal)0, "Packing failed");
1560 #endif
1561       return RFAILED;
1562    }
1563    if (pst->selector != ODU_SELECTOR_LWLC) {
1564       Mem   sMem;
1565       sMem.region = pst->region;
1566       sMem.pool = pst->pool;
1567       if ((cmAllocEvnt(sizeof(TfuHqIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&hqInd)) != ROK)            {
1568 #if (ERRCLASS & ERRCLS_ADD_RES)
1569          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1570             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1571             (ErrVal)ETFU053, (ErrVal)0, "Packing failed");
1572 #endif
1573          TFU_FREE_MSG(mBuf);
1574          return RFAILED;
1575       }
1576    }
1577
1578
1579    if (pst->selector == ODU_SELECTOR_LC) 
1580    {
1581       if (cmUnpkTfuHqIndInfo(hqInd, (Ptr)&hqInd->memCp, mBuf) != ROK) {
1582          TFU_FREE_MEM(hqInd);
1583          TFU_FREE_MSG(mBuf);
1584 #if (ERRCLASS & ERRCLS_ADD_RES)
1585          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1586                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1587                (ErrVal)ETFU054, (ErrVal)0, "Packing failed");
1588 #endif
1589          return RFAILED;
1590       }
1591    }
1592    else if(pst->selector == ODU_SELECTOR_LWLC)
1593    {
1594       if (oduUnpackPointer((PTR *)&hqInd, mBuf) != ROK)
1595       {
1596 #if (ERRCLASS & ERRCLS_ADD_RES)
1597          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1598             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1599             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1600 #endif
1601          TFU_FREE_MEM(hqInd);
1602          TFU_FREE_MSG(mBuf);
1603          return RFAILED;
1604       }
1605    }
1606    TFU_FREE_MSG(mBuf);
1607    return ((*func)(pst, spId, hqInd));
1608 }
1609
1610 \f
1611 /***********************************************************
1612 *
1613 *     Func : cmPkTfuSrInd
1614 *
1615 *
1616 *     Desc : This Primitive carries the SR Indication from PHY to scheduler. 
1617  * @details Scheduling Request (SR) is sent by the UE to the eNodeB to request
1618  * for Uplink (UL) grant. This primitive carries a list of SRs for a number of
1619  * UEs received in the indicated subframe. 
1620  * @param pst 
1621  * @param spId
1622  * @param tfqSrInd pointer to TfuSrIndInfo
1623  * @return
1624 *
1625 *
1626 *     Ret  : S16
1627 *
1628 *     Notes:
1629 *
1630 *     File  : 
1631 *
1632 **********************************************************/
1633 #ifdef ANSI
1634 S16 cmPkTfuSrInd
1635 (
1636 Pst * pst,
1637 SpId spId,
1638 TfuSrIndInfo * srInd
1639 )
1640 #else
1641 S16 cmPkTfuSrInd(pst, spId, srInd)
1642 Pst * pst;
1643 SpId spId;
1644 TfuSrIndInfo * srInd;
1645 #endif
1646 {
1647    Buffer *mBuf = NULLP;
1648
1649    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1650 #if (ERRCLASS & ERRCLS_ADD_RES)
1651       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1652          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1653          (ErrVal)ETFU055, (ErrVal)0, "Packing failed");
1654 #endif
1655       TFU_FREE_MEM(srInd);
1656       return RFAILED;
1657    }
1658    if (pst->selector == ODU_SELECTOR_LC) {
1659       if (cmPkTfuSrIndInfo(srInd, mBuf) != ROK) {
1660 #if (ERRCLASS & ERRCLS_ADD_RES)
1661          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1662             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1663             (ErrVal)ETFU056, (ErrVal)0, "Packing failed");
1664 #endif
1665          TFU_FREE_MEM(srInd);
1666          TFU_FREE_MSG(mBuf);
1667          return RFAILED;
1668       }
1669    }
1670    else if(pst->selector == ODU_SELECTOR_LWLC)
1671    {
1672       if (oduPackPointer((PTR)srInd, mBuf) != ROK)
1673       {
1674 #if (ERRCLASS & ERRCLS_ADD_RES)
1675          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1676             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1677             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1678 #endif
1679          TFU_FREE_MEM(srInd);
1680          TFU_FREE_MSG(mBuf);
1681          return RFAILED;
1682       }
1683    }
1684
1685    if (SPkS16(spId, mBuf) != ROK) {
1686 #if (ERRCLASS & ERRCLS_ADD_RES)
1687       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1688          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1689          (ErrVal)ETFU057, (ErrVal)0, "Packing failed");
1690 #endif
1691       TFU_FREE_MEM(srInd);
1692       TFU_FREE_MSG(mBuf);
1693       return RFAILED;
1694    }
1695    if (pst->selector != ODU_SELECTOR_LWLC) {
1696       TFU_FREE_MEM(srInd);
1697    }
1698
1699    pst->event = (Event) EVTTFUSRIND;
1700    return (SPstTsk(pst,mBuf));
1701 }
1702
1703 \f
1704 /***********************************************************
1705 *
1706 *     Func : cmUnpkTfuSrInd
1707 *
1708 *
1709 *     Desc : This Primitive carries the SR Indication from PHY to scheduler. 
1710  * @details Scheduling Request (SR) is sent by the UE to the eNodeB to request
1711  * for Uplink (UL) grant. This primitive carries a list of SRs for a number of
1712  * UEs received in the indicated subframe. 
1713  * @param pst 
1714  * @param spId
1715  * @param tfqSrInd pointer to TfuSrIndInfo
1716  * @return
1717 *
1718 *
1719 *     Ret  : S16
1720 *
1721 *     Notes:
1722 *
1723 *     File  : 
1724 *
1725 **********************************************************/
1726 #ifdef ANSI
1727 S16 cmUnpkTfuSrInd
1728 (
1729 TfuSrInd func,
1730 Pst *pst,
1731 Buffer *mBuf
1732 )
1733 #else
1734 S16 cmUnpkTfuSrInd(func, pst, mBuf)
1735 TfuSrInd func;
1736 Pst *pst;
1737 Buffer *mBuf;
1738 #endif
1739 {
1740    SpId spId;
1741    TfuSrIndInfo *srInd;
1742    
1743
1744    if (SUnpkS16(&spId, mBuf) != ROK) {
1745       TFU_FREE_MSG(mBuf);
1746 #if (ERRCLASS & ERRCLS_ADD_RES)
1747       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1748          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1749          (ErrVal)ETFU058, (ErrVal)0, "Packing failed");
1750 #endif
1751       return RFAILED;
1752    }
1753    if (pst->selector != ODU_SELECTOR_LWLC) {
1754       Mem   sMem;
1755       sMem.region = pst->region;
1756       sMem.pool = pst->pool;
1757       if ((cmAllocEvnt(sizeof(TfuSrIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&srInd)) != ROK)            {
1758 #if (ERRCLASS & ERRCLS_ADD_RES)
1759          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1760             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1761             (ErrVal)ETFU059, (ErrVal)0, "Packing failed");
1762 #endif
1763          TFU_FREE_MSG(mBuf);
1764          return RFAILED;
1765       }
1766    }
1767
1768
1769    if (pst->selector == ODU_SELECTOR_LC) 
1770    {
1771       if (cmUnpkTfuSrIndInfo(srInd, (Ptr)&srInd->memCp, mBuf) != ROK) {
1772          TFU_FREE_MEM(srInd);
1773          TFU_FREE_MSG(mBuf);
1774 #if (ERRCLASS & ERRCLS_ADD_RES)
1775          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1776                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1777                (ErrVal)ETFU060, (ErrVal)0, "Packing failed");
1778 #endif
1779          return RFAILED;
1780       }
1781    }
1782    else if(pst->selector == ODU_SELECTOR_LWLC)
1783    {
1784       if (oduUnpackPointer((PTR *)&srInd, mBuf) != ROK)
1785       {
1786 #if (ERRCLASS & ERRCLS_ADD_RES)
1787          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1788             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1789             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1790 #endif
1791          TFU_FREE_MEM(srInd);
1792          TFU_FREE_MSG(mBuf);
1793          return RFAILED;
1794       }
1795    }
1796    TFU_FREE_MSG(mBuf);
1797    return ((*func)(pst, spId, srInd));
1798 }
1799
1800 \f
1801 /***********************************************************
1802 *
1803 *     Func : cmPkTfuDlCqiInd
1804 *
1805 *
1806 *     Desc : This API is used to indicate the reception of CQI report from PHY to
1807  * Scheduler, also carries the RI.
1808  * @param pst Pointer to the post structure.
1809  * @param suId SAP ID of the service user.
1810  * @param dlCqiInd Pointer to the TfuDlCqiIndInfo structure.
1811  * @return ROK/RFAILED
1812 *
1813 *
1814 *     Ret  : S16
1815 *
1816 *     Notes:
1817 *
1818 *     File  : 
1819 *
1820 **********************************************************/
1821 #ifdef ANSI
1822 S16 cmPkTfuDlCqiInd
1823 (
1824 Pst * pst,
1825 SuId suId,
1826 TfuDlCqiIndInfo * dlCqiInd
1827 )
1828 #else
1829 S16 cmPkTfuDlCqiInd(pst, suId, dlCqiInd)
1830 Pst * pst;
1831 SuId suId;
1832 TfuDlCqiIndInfo * dlCqiInd;
1833 #endif
1834 {
1835    Buffer *mBuf = NULLP;
1836
1837    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1838 #if (ERRCLASS & ERRCLS_ADD_RES)
1839       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1840          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1841          (ErrVal)ETFU061, (ErrVal)0, "Packing failed");
1842 #endif
1843       TFU_FREE_MEM(dlCqiInd);
1844       return RFAILED;
1845    }
1846    if (pst->selector == ODU_SELECTOR_LC) {
1847       if (cmPkTfuDlCqiIndInfo(dlCqiInd, mBuf) != ROK) {
1848 #if (ERRCLASS & ERRCLS_ADD_RES)
1849          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1850             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1851             (ErrVal)ETFU062, (ErrVal)0, "Packing failed");
1852 #endif
1853          TFU_FREE_MEM(dlCqiInd);
1854          TFU_FREE_MSG(mBuf);
1855          return RFAILED;
1856       }
1857    }
1858    else if(pst->selector == ODU_SELECTOR_LWLC)
1859    {
1860       if (oduPackPointer((PTR)dlCqiInd, mBuf) != ROK)
1861       {
1862 #if (ERRCLASS & ERRCLS_ADD_RES)
1863          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1864             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1865             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1866 #endif
1867          TFU_FREE_MEM(dlCqiInd);
1868          TFU_FREE_MSG(mBuf);
1869          return RFAILED;
1870       }
1871    }
1872
1873    if (SPkS16(suId, mBuf) != ROK) {
1874 #if (ERRCLASS & ERRCLS_ADD_RES)
1875       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1876          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1877          (ErrVal)ETFU063, (ErrVal)0, "Packing failed");
1878 #endif
1879       TFU_FREE_MEM(dlCqiInd);
1880       TFU_FREE_MSG(mBuf);
1881       return RFAILED;
1882    }
1883    if (pst->selector != ODU_SELECTOR_LWLC) {
1884       TFU_FREE_MEM(dlCqiInd);
1885    }
1886    pst->event = (Event) EVTTFUDLCQIIND;
1887    return (SPstTsk(pst,mBuf));
1888 }
1889
1890 \f
1891 /***********************************************************
1892 *
1893 *     Func : cmUnpkTfuDlCqiInd
1894 *
1895 *
1896 *     Desc : This API is used to indicate the reception of CQI report from PHY to
1897  * Scheduler, also carries the RI.
1898  * @param pst Pointer to the post structure.
1899  * @param suId SAP ID of the service user.
1900  * @param dlCqiInd Pointer to the TfuDlCqiIndInfo structure.
1901  * @return ROK/RFAILED
1902 *
1903 *
1904 *     Ret  : S16
1905 *
1906 *     Notes:
1907 *
1908 *     File  : 
1909 *
1910 **********************************************************/
1911 #ifdef ANSI
1912 S16 cmUnpkTfuDlCqiInd
1913 (
1914 TfuDlCqiInd func,
1915 Pst *pst,
1916 Buffer *mBuf
1917 )
1918 #else
1919 S16 cmUnpkTfuDlCqiInd(func, pst, mBuf)
1920 TfuDlCqiInd func;
1921 Pst *pst;
1922 Buffer *mBuf;
1923 #endif
1924 {
1925    SuId suId;
1926    TfuDlCqiIndInfo *dlCqiInd;
1927    
1928
1929    if (SUnpkS16(&suId, mBuf) != ROK) {
1930       TFU_FREE_MSG(mBuf);
1931 #if (ERRCLASS & ERRCLS_ADD_RES)
1932       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1933          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1934          (ErrVal)ETFU064, (ErrVal)0, "Packing failed");
1935 #endif
1936       return RFAILED;
1937    }
1938    if (pst->selector != ODU_SELECTOR_LWLC) {
1939       Mem   sMem;
1940       sMem.region = pst->region;
1941       sMem.pool = pst->pool;
1942       if ((cmAllocEvnt(sizeof(TfuDlCqiIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&dlCqiInd)) != ROK)            {
1943 #if (ERRCLASS & ERRCLS_ADD_RES)
1944          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1945             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1946             (ErrVal)ETFU065, (ErrVal)0, "Packing failed");
1947 #endif
1948          TFU_FREE_MSG(mBuf);
1949          return RFAILED;
1950       }
1951    }
1952
1953
1954    if (pst->selector == ODU_SELECTOR_LC) 
1955    {
1956       if (cmUnpkTfuDlCqiIndInfo(dlCqiInd, (Ptr)&dlCqiInd->memCp, mBuf) != ROK) {
1957          TFU_FREE_MEM(dlCqiInd);
1958          TFU_FREE_MSG(mBuf);
1959 #if (ERRCLASS & ERRCLS_ADD_RES)
1960          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1961                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1962                (ErrVal)ETFU066, (ErrVal)0, "Packing failed");
1963 #endif
1964          return RFAILED;
1965       }
1966    }
1967    else if(pst->selector == ODU_SELECTOR_LWLC)
1968    {
1969       if (oduUnpackPointer((PTR *)&dlCqiInd, mBuf) != ROK)
1970       {
1971 #if (ERRCLASS & ERRCLS_ADD_RES)
1972          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1973             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1974             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1975 #endif
1976          TFU_FREE_MEM(dlCqiInd);
1977          TFU_FREE_MSG(mBuf);
1978          return RFAILED;
1979       }
1980    }
1981    TFU_FREE_MSG(mBuf);
1982    return ((*func)(pst, suId, dlCqiInd));
1983 }
1984
1985
1986 #ifdef TFU_UPGRADE
1987
1988 \f
1989 /***********************************************************
1990 *
1991 *     Func : cmPkTfuRawCqiInd
1992 *
1993 *
1994 *     Desc : This Primitive is used to convey the Raw CQI information 
1995  * transmitted by the UE.
1996  * @details Raw CQI report is the actual bits transmitted by the UE when
1997  * reporting CQI/PMI/RI. The interpretation of these bits to CQI/subband CQI
1998  * etc. shall be done by MAC.
1999  * 
2000  * @param pst Pointer to the post structure.
2001  * @param suId SAP ID of the service user.
2002  * @param  cqiInd Pointer to the TfuRawCqiIndInfo structure.
2003  * @return ROK/RFAILED
2004 *
2005 *
2006 *     Ret  : S16
2007 *
2008 *     Notes:
2009 *
2010 *     File  : 
2011 *
2012 **********************************************************/
2013 #ifdef ANSI
2014 S16 cmPkTfuRawCqiInd
2015 (
2016 Pst * pst,
2017 SuId suId,
2018 TfuRawCqiIndInfo * rawCqiInd
2019 )
2020 #else
2021 S16 cmPkTfuRawCqiInd(pst, suId, rawCqiInd)
2022 Pst * pst;
2023 SuId suId;
2024 TfuRawCqiIndInfo * rawCqiInd;
2025 #endif
2026 {
2027    Buffer *mBuf = NULLP;
2028
2029    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2030 #if (ERRCLASS & ERRCLS_ADD_RES)
2031       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2032          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2033          (ErrVal)ETFU067, (ErrVal)0, "Packing failed");
2034 #endif
2035       TFU_FREE_MEM(rawCqiInd);
2036       return RFAILED;
2037    }
2038       cmPkTfuRawCqiIndInfo(rawCqiInd, mBuf);
2039    if (SPkS16(suId, mBuf) != ROK) {
2040 #if (ERRCLASS & ERRCLS_ADD_RES)
2041       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2042          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2043          (ErrVal)ETFU068, (ErrVal)0, "Packing failed");
2044 #endif
2045       TFU_FREE_MEM(rawCqiInd);
2046       TFU_FREE_MSG(mBuf);
2047       return RFAILED;
2048    }
2049    TFU_FREE_MEM(rawCqiInd);
2050    pst->event = (Event) EVTTFURAWCQIIND;
2051    return (SPstTsk(pst,mBuf));
2052 }
2053
2054 \f
2055 /***********************************************************
2056 *
2057 *     Func : cmUnpkTfuRawCqiInd
2058 *
2059 *
2060 *     Desc : This Primitive is used to convey the Raw CQI information 
2061  * transmitted by the UE.
2062  * @details Raw CQI report is the actual bits transmitted by the UE when
2063  * reporting CQI/PMI/RI. The interpretation of these bits to CQI/subband CQI
2064  * etc. shall be done by MAC.
2065  * 
2066  * @param pst Pointer to the post structure.
2067  * @param suId SAP ID of the service user.
2068  * @param  cqiInd Pointer to the TfuRawCqiIndInfo structure.
2069  * @return ROK/RFAILED
2070 *
2071 *
2072 *     Ret  : S16
2073 *
2074 *     Notes:
2075 *
2076 *     File  : 
2077 *
2078 **********************************************************/
2079 #ifdef ANSI
2080 S16 cmUnpkTfuRawCqiInd
2081 (
2082 TfuRawCqiInd func,
2083 Pst *pst,
2084 Buffer *mBuf
2085 )
2086 #else
2087 S16 cmUnpkTfuRawCqiInd(func, pst, mBuf)
2088 TfuRawCqiInd func;
2089 Pst *pst;
2090 Buffer *mBuf;
2091 #endif
2092 {
2093    SuId suId;
2094    TfuRawCqiIndInfo *rawCqiInd;
2095    
2096
2097    if (SUnpkS16(&suId, mBuf) != ROK) {
2098       TFU_FREE_MSG(mBuf);
2099 #if (ERRCLASS & ERRCLS_ADD_RES)
2100       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2101          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2102          (ErrVal)ETFU069, (ErrVal)0, "Packing failed");
2103 #endif
2104       return RFAILED;
2105    }
2106    {
2107       Mem   sMem;
2108       sMem.region = pst->region;
2109       sMem.pool = pst->pool;
2110       if ((cmAllocEvnt(sizeof(TfuRawCqiIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&rawCqiInd)) != ROK)            {
2111 #if (ERRCLASS & ERRCLS_ADD_RES)
2112          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2113             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2114             (ErrVal)ETFU070, (ErrVal)0, "Packing failed");
2115 #endif
2116          TFU_FREE_MSG(mBuf);
2117          return RFAILED;
2118       }
2119    }
2120       cmUnpkTfuRawCqiIndInfo(rawCqiInd, (Ptr)&rawCqiInd->memCp, mBuf);
2121    TFU_FREE_MSG(mBuf);
2122    return ((*func)(pst, suId, rawCqiInd));
2123 }
2124
2125 \f
2126 /***********************************************************
2127 *
2128 *     Func : cmPkTfuSrsInd
2129 *
2130 *
2131 *     Desc : This Primitive is used to convey the information derived by the
2132  * physical layer from the SRS transmission from the UE.
2133  * @details This primitive carries information derived from the SRS transmission
2134  * from the UE. 
2135  * 
2136  * @param pst Pointer to the post structure.
2137  * @param suId SAP ID of the service user.
2138  * @param  srsInd Pointer to the TfuSrIndInfo structure.
2139  * @return ROK/RFAILED
2140 *
2141 *
2142 *     Ret  : S16
2143 *
2144 *     Notes:
2145 *
2146 *     File  : 
2147 *
2148 **********************************************************/
2149 #ifdef ANSI
2150 S16 cmPkTfuSrsInd
2151 (
2152 Pst * pst,
2153 SuId suId,
2154 TfuSrsIndInfo * srsInd
2155 )
2156 #else
2157 S16 cmPkTfuSrsInd(pst, suId, srsInd)
2158 Pst * pst;
2159 SuId suId;
2160 TfuSrsIndInfo * srsInd;
2161 #endif
2162 {
2163    Buffer *mBuf = NULLP;
2164
2165    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2166 #if (ERRCLASS & ERRCLS_ADD_RES)
2167       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2168          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2169          (ErrVal)ETFU071, (ErrVal)0, "Packing failed");
2170 #endif
2171       TFU_FREE_MEM(srsInd);
2172       return RFAILED;
2173    }
2174       cmPkTfuSrsIndInfo(srsInd, mBuf);
2175    if (SPkS16(suId, mBuf) != ROK) {
2176 #if (ERRCLASS & ERRCLS_ADD_RES)
2177       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2178          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2179          (ErrVal)ETFU072, (ErrVal)0, "Packing failed");
2180 #endif
2181       TFU_FREE_MEM(srsInd);
2182       TFU_FREE_MSG(mBuf);
2183       return RFAILED;
2184    }
2185    TFU_FREE_MEM(srsInd);
2186    pst->event = (Event) EVTTFUSRSIND;
2187    return (SPstTsk(pst,mBuf));
2188 }
2189
2190 \f
2191 /***********************************************************
2192 *
2193 *     Func : cmUnpkTfuSrsInd
2194 *
2195 *
2196 *     Desc : This Primitive is used to convey the information derived by the
2197  * physical layer from the SRS transmission from the UE.
2198  * @details This primitive carries information derived from the SRS transmission
2199  * from the UE. 
2200  * 
2201  * @param pst Pointer to the post structure.
2202  * @param suId SAP ID of the service user.
2203  * @param  srsInd Pointer to the TfuSrIndInfo structure.
2204  * @return ROK/RFAILED
2205 *
2206 *
2207 *     Ret  : S16
2208 *
2209 *     Notes:
2210 *
2211 *     File  : 
2212 *
2213 **********************************************************/
2214 #ifdef ANSI
2215 S16 cmUnpkTfuSrsInd
2216 (
2217 TfuSrsInd func,
2218 Pst *pst,
2219 Buffer *mBuf
2220 )
2221 #else
2222 S16 cmUnpkTfuSrsInd(func, pst, mBuf)
2223 TfuSrsInd func;
2224 Pst *pst;
2225 Buffer *mBuf;
2226 #endif
2227 {
2228    SuId suId;
2229    TfuSrsIndInfo *srsInd;
2230    
2231
2232    if (SUnpkS16(&suId, mBuf) != ROK) {
2233       TFU_FREE_MSG(mBuf);
2234 #if (ERRCLASS & ERRCLS_ADD_RES)
2235       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2236          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2237          (ErrVal)ETFU073, (ErrVal)0, "Packing failed");
2238 #endif
2239       return RFAILED;
2240    }
2241    {
2242       Mem   sMem;
2243       sMem.region = pst->region;
2244       sMem.pool = pst->pool;
2245       if ((cmAllocEvnt(sizeof(TfuSrsIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&srsInd)) != ROK)            {
2246 #if (ERRCLASS & ERRCLS_ADD_RES)
2247          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2248             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2249             (ErrVal)ETFU074, (ErrVal)0, "Packing failed");
2250 #endif
2251          TFU_FREE_MSG(mBuf);
2252          return RFAILED;
2253       }
2254    }
2255       cmUnpkTfuSrsIndInfo(srsInd, (Ptr)&srsInd->memCp, mBuf);
2256    TFU_FREE_MSG(mBuf);
2257    return ((*func)(pst, suId, srsInd));
2258 }
2259 #endif
2260
2261
2262 \f
2263 /***********************************************************
2264 *
2265 *     Func : cmPkTfuDatInd
2266 *
2267 *
2268 *     Desc : This Primitive carries the Data PDUs from PHY to MAC.
2269  * @details The uplink Data i.e. the data transmitted by the UEs received by the
2270  * physical layer at the eNodeB in the subframe (indicated by the timingInfo),
2271  * is relayed to MAC using this primitive. 
2272  * @param pst 
2273  * @param spId
2274  * @param tfuDatInd pointer to TfuDatIndInfo
2275  * @return
2276 *
2277 *
2278 *     Ret  : S16
2279 *
2280 *     Notes:
2281 *
2282 *     File  : 
2283 *
2284 **********************************************************/
2285 #ifdef ANSI
2286 S16 cmPkTfuDatInd
2287 (
2288 Pst * pst,
2289 SpId spId,
2290 TfuDatIndInfo * datInd
2291 )
2292 #else
2293 S16 cmPkTfuDatInd(pst, spId, datInd)
2294 Pst * pst;
2295 SpId spId;
2296 TfuDatIndInfo * datInd;
2297 #endif
2298 {
2299    Buffer *mBuf = NULLP;
2300
2301    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2302 #if (ERRCLASS & ERRCLS_ADD_RES)
2303       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2304          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2305          (ErrVal)ETFU075, (ErrVal)0, "Packing failed");
2306 #endif
2307       TFU_FREE_MEM(datInd);
2308       return RFAILED;
2309    }
2310    if (pst->selector == ODU_SELECTOR_LC) {
2311       if (cmPkTfuDatIndInfo(datInd, mBuf) != ROK) {
2312 #if (ERRCLASS & ERRCLS_ADD_RES)
2313          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2314             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2315             (ErrVal)ETFU076, (ErrVal)0, "Packing failed");
2316 #endif
2317          TFU_FREE_MEM(datInd);
2318          TFU_FREE_MSG(mBuf);
2319          return RFAILED;
2320       }
2321    }
2322    else if(pst->selector == ODU_SELECTOR_LWLC)
2323    {
2324       if(oduPackPointer((PTR)datInd, mBuf) != ROK)
2325       {
2326 #if (ERRCLASS & ERRCLS_ADD_RES)
2327          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2328                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2329                (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2330 #endif
2331          TFU_FREE_MEM(datInd);
2332          TFU_FREE_MSG(mBuf);
2333          return RFAILED;
2334       }
2335    }
2336
2337    if (SPkS16(spId, mBuf) != ROK) {
2338 #if (ERRCLASS & ERRCLS_ADD_RES)
2339       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2340          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2341          (ErrVal)ETFU077, (ErrVal)0, "Packing failed");
2342 #endif
2343       TFU_FREE_MEM(datInd);
2344       TFU_FREE_MSG(mBuf);
2345       return RFAILED;
2346    }
2347    if (pst->selector != ODU_SELECTOR_LWLC) {
2348       TFU_FREE_MEM(datInd);
2349    }
2350
2351    pst->event = (Event) EVTTFUDATIND;
2352    return (SPstTsk(pst,mBuf));
2353 }
2354
2355 \f
2356 /***********************************************************
2357 *
2358 *     Func : cmUnpkTfuDatInd
2359 *
2360 *
2361 *     Desc : This Primitive carries the Data PDUs from PHY to MAC.
2362  * @details The uplink Data i.e. the data transmitted by the UEs received by the
2363  * physical layer at the eNodeB in the subframe (indicated by the timingInfo),
2364  * is relayed to MAC using this primitive. 
2365  * @param pst 
2366  * @param spId
2367  * @param tfuDatInd pointer to TfuDatIndInfo
2368  * @return
2369 *
2370 *
2371 *     Ret  : S16
2372 *
2373 *     Notes:
2374 *
2375 *     File  : 
2376 *
2377 **********************************************************/
2378 #ifdef ANSI
2379 S16 cmUnpkTfuDatInd
2380 (
2381 TfuDatInd func,
2382 Pst *pst,
2383 Buffer *mBuf
2384 )
2385 #else
2386 S16 cmUnpkTfuDatInd(func, pst, mBuf)
2387 TfuDatInd func;
2388 Pst *pst;
2389 Buffer *mBuf;
2390 #endif
2391 {
2392    SpId spId;
2393    TfuDatIndInfo *datInd;
2394    
2395
2396    if (SUnpkS16(&spId, mBuf) != ROK) {
2397       TFU_FREE_MSG(mBuf);
2398 #if (ERRCLASS & ERRCLS_ADD_RES)
2399       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2400          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2401          (ErrVal)ETFU078, (ErrVal)0, "Packing failed");
2402 #endif
2403       return RFAILED;
2404    }
2405    if (pst->selector != ODU_SELECTOR_LWLC) {
2406       Mem   sMem;
2407       sMem.region = pst->region;
2408       sMem.pool = pst->pool;
2409       if ((cmAllocEvnt(sizeof(TfuDatIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&datInd)) != ROK)            {
2410 #if (ERRCLASS & ERRCLS_ADD_RES)
2411          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2412             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2413             (ErrVal)ETFU079, (ErrVal)0, "Packing failed");
2414 #endif
2415          TFU_FREE_MSG(mBuf);
2416          return RFAILED;
2417       }
2418    }
2419
2420
2421    if (pst->selector == ODU_SELECTOR_LC) 
2422    {
2423       if (cmUnpkTfuDatIndInfo(datInd, (Ptr)&datInd->memCp, mBuf) != ROK) {
2424          TFU_FREE_MEM(datInd);
2425          TFU_FREE_MSG(mBuf);
2426 #if (ERRCLASS & ERRCLS_ADD_RES)
2427          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2428                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2429                (ErrVal)ETFU080, (ErrVal)0, "Packing failed");
2430 #endif
2431          return RFAILED;
2432       }
2433    }
2434    else if(pst->selector == ODU_SELECTOR_LWLC)
2435    {
2436       if(oduUnpackPointer((PTR *)&datInd, mBuf) != ROK)
2437       {
2438 #if (ERRCLASS & ERRCLS_ADD_RES)
2439          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2440                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2441                (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
2442 #endif
2443          TFU_FREE_MEM(datInd);
2444          TFU_FREE_MSG(mBuf);
2445          return RFAILED;
2446       }
2447    }
2448    TFU_FREE_MSG(mBuf);
2449    return ((*func)(pst, spId, datInd));
2450 }
2451
2452 \f
2453 /***********************************************************
2454 *
2455 *     Func : cmPkTfuCrcInd
2456 *
2457 *
2458 *     Desc : This API is used by the Physical layer to indicate if the CRC Check
2459  * on the PUSCH Data was successful or not.
2460  * @details This primitive carries CRC indication for a list of UEs. This
2461  * is utilized in the scenario where MAC requested the reception of uplink data
2462  * for a particular UE. On reception of the PUSCH data, the CRC check on it
2463  * failed. This CRC failure is indicated to MAC, which would utillize this
2464  * information for further scheduling. 
2465  * Physical layer would indicate failure or success for each PUSCH transmission.
2466  * @param pst Pointer to the post structure.
2467  * @param suId SAP ID of the service user.
2468  * @param crcInd Pointer to the TfuCrcIndInfo.
2469  * @return ROK/RFAILED
2470 *
2471 *
2472 *     Ret  : S16
2473 *
2474 *     Notes:
2475 *
2476 *     File  : 
2477 *
2478 **********************************************************/
2479 #ifdef ANSI
2480 S16 cmPkTfuCrcInd
2481 (
2482 Pst * pst,
2483 SuId suId,
2484 TfuCrcIndInfo * crcIndInfo
2485 )
2486 #else
2487 S16 cmPkTfuCrcInd(pst, suId, crcIndInfo)
2488 Pst * pst;
2489 SuId suId;
2490 TfuCrcIndInfo * crcIndInfo;
2491 #endif
2492 {
2493    Buffer *mBuf = NULLP;
2494
2495    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2496 #if (ERRCLASS & ERRCLS_ADD_RES)
2497       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2498          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2499          (ErrVal)ETFU081, (ErrVal)0, "Packing failed");
2500 #endif
2501       TFU_FREE_MEM(crcIndInfo);
2502       return RFAILED;
2503    }
2504    if (pst->selector == ODU_SELECTOR_LC) {
2505       if (cmPkTfuCrcIndInfo(crcIndInfo, mBuf) != ROK) {
2506 #if (ERRCLASS & ERRCLS_ADD_RES)
2507          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2508             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2509             (ErrVal)ETFU082, (ErrVal)0, "Packing failed");
2510 #endif
2511          TFU_FREE_MEM(crcIndInfo);
2512          TFU_FREE_MSG(mBuf);
2513          return RFAILED;
2514       }
2515    }
2516    else if(pst->selector == ODU_SELECTOR_LWLC)
2517    {
2518       if (oduPackPointer((PTR)crcIndInfo, mBuf) != ROK)
2519       {
2520 #if (ERRCLASS & ERRCLS_ADD_RES)
2521          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2522             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2523             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2524 #endif
2525          TFU_FREE_MEM(crcIndInfo);
2526          TFU_FREE_MSG(mBuf);
2527          return RFAILED;
2528       }
2529    }
2530
2531
2532    if (SPkS16(suId, mBuf) != ROK) {
2533 #if (ERRCLASS & ERRCLS_ADD_RES)
2534       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2535          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2536          (ErrVal)ETFU083, (ErrVal)0, "Packing failed");
2537 #endif
2538       TFU_FREE_MEM(crcIndInfo);
2539       TFU_FREE_MSG(mBuf);
2540       return RFAILED;
2541    }
2542    if (pst->selector != ODU_SELECTOR_LWLC) {
2543       TFU_FREE_MEM(crcIndInfo);
2544    }
2545
2546    pst->event = (Event) EVTTFUCRCIND;
2547    return (SPstTsk(pst,mBuf));
2548 }
2549
2550 \f
2551 /***********************************************************
2552 *
2553 *     Func : cmUnpkTfuCrcInd
2554 *
2555 *
2556 *     Desc : This API is used by the Physical layer to indicate if the CRC Check
2557  * on the PUSCH Data was successful or not.
2558  * @details This primitive carries CRC indication for a list of UEs. This
2559  * is utilized in the scenario where MAC requested the reception of uplink data
2560  * for a particular UE. On reception of the PUSCH data, the CRC check on it
2561  * failed. This CRC failure is indicated to MAC, which would utillize this
2562  * information for further scheduling. 
2563  * Physical layer would indicate failure or success for each PUSCH transmission.
2564  * @param pst Pointer to the post structure.
2565  * @param suId SAP ID of the service user.
2566  * @param crcInd Pointer to the TfuCrcIndInfo.
2567  * @return ROK/RFAILED
2568 *
2569 *
2570 *     Ret  : S16
2571 *
2572 *     Notes:
2573 *
2574 *     File  : 
2575 *
2576 **********************************************************/
2577 #ifdef ANSI
2578 S16 cmUnpkTfuCrcInd
2579 (
2580 TfuCrcInd func,
2581 Pst *pst,
2582 Buffer *mBuf
2583 )
2584 #else
2585 S16 cmUnpkTfuCrcInd(func, pst, mBuf)
2586 TfuCrcInd func;
2587 Pst *pst;
2588 Buffer *mBuf;
2589 #endif
2590 {
2591    SuId suId;
2592    TfuCrcIndInfo *crcIndInfo;
2593    
2594
2595    if (SUnpkS16(&suId, mBuf) != ROK) {
2596       TFU_FREE_MSG(mBuf);
2597 #if (ERRCLASS & ERRCLS_ADD_RES)
2598       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2599          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2600          (ErrVal)ETFU084, (ErrVal)0, "Packing failed");
2601 #endif
2602       return RFAILED;
2603    }
2604    if (pst->selector != ODU_SELECTOR_LWLC) {
2605       Mem   sMem;
2606       sMem.region = pst->region;
2607       sMem.pool = pst->pool;
2608       if ((cmAllocEvnt(sizeof(TfuCrcIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&crcIndInfo)) != ROK)            {
2609 #if (ERRCLASS & ERRCLS_ADD_RES)
2610          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2611             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2612             (ErrVal)ETFU085, (ErrVal)0, "Packing failed");
2613 #endif
2614          TFU_FREE_MSG(mBuf);
2615          return RFAILED;
2616       }
2617    }
2618
2619
2620    if (pst->selector == ODU_SELECTOR_LC) 
2621    {
2622       if (cmUnpkTfuCrcIndInfo(crcIndInfo, (Ptr)&crcIndInfo->memCp, mBuf) != ROK) {
2623          TFU_FREE_MEM(crcIndInfo);
2624          TFU_FREE_MSG(mBuf);
2625 #if (ERRCLASS & ERRCLS_ADD_RES)
2626          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2627                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2628                (ErrVal)ETFU086, (ErrVal)0, "Packing failed");
2629 #endif
2630          return RFAILED;
2631       }
2632    }
2633    else if(pst->selector == ODU_SELECTOR_LWLC)
2634    {
2635       if (oduUnpackPointer((PTR *)&crcIndInfo, mBuf) != ROK)
2636       {
2637 #if (ERRCLASS & ERRCLS_ADD_RES)
2638          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2639             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2640             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
2641 #endif
2642          TFU_FREE_MEM(crcIndInfo);
2643          TFU_FREE_MSG(mBuf);
2644          return RFAILED;
2645       }
2646    }
2647    TFU_FREE_MSG(mBuf);
2648    return ((*func)(pst, suId, crcIndInfo));
2649 }
2650
2651 \f
2652 /***********************************************************
2653 *
2654 *     Func : cmPkTfuTimingAdvInd
2655 *
2656 *
2657 *     Desc : This API is used to indicate a Timing Advance from PHY to Scheduler .
2658  * @details This primitive carries timing advance information for a number of
2659  * UEs that may need timing advance. Timing advance information is an estimate
2660  * of the timing adjustment that a UE would need to apply in order to be
2661  * synchronized in uplink. This estimate is to be calculated by physical layer. 
2662  * @param pst Pointer to the post structure.
2663  * @param suId SAP ID of the service user.
2664  * @param timingAdvInd Pointer to the TfuTimingAdvIndInfo structure.
2665  * @return ROK/RFAILED
2666 *
2667 *
2668 *     Ret  : S16
2669 *
2670 *     Notes:
2671 *
2672 *     File  : 
2673 *
2674 **********************************************************/
2675 #ifdef ANSI
2676 S16 cmPkTfuTimingAdvInd
2677 (
2678 Pst * pst,
2679 SuId suId,
2680 TfuTimingAdvIndInfo * timingAdvInd
2681 )
2682 #else
2683 S16 cmPkTfuTimingAdvInd(pst, suId, timingAdvInd)
2684 Pst * pst;
2685 SuId suId;
2686 TfuTimingAdvIndInfo * timingAdvInd;
2687 #endif
2688 {
2689    Buffer *mBuf = NULLP;
2690
2691    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2692 #if (ERRCLASS & ERRCLS_ADD_RES)
2693       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2694          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2695          (ErrVal)ETFU087, (ErrVal)0, "Packing failed");
2696 #endif
2697       TFU_FREE_MEM(timingAdvInd);
2698       return RFAILED;
2699    }
2700    if (pst->selector == ODU_SELECTOR_LC) {
2701       if (cmPkTfuTimingAdvIndInfo(timingAdvInd, mBuf) != ROK) {
2702 #if (ERRCLASS & ERRCLS_ADD_RES)
2703          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2704             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2705             (ErrVal)ETFU088, (ErrVal)0, "Packing failed");
2706 #endif
2707          TFU_FREE_MEM(timingAdvInd);
2708          TFU_FREE_MSG(mBuf);
2709          return RFAILED;
2710       }
2711    }
2712    else if(pst->selector == ODU_SELECTOR_LWLC)
2713    {
2714       if (oduPackPointer((PTR)timingAdvInd, mBuf) != ROK)
2715       {
2716 #if (ERRCLASS & ERRCLS_ADD_RES)
2717          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2718             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2719             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2720 #endif
2721          TFU_FREE_MEM(timingAdvInd);
2722          TFU_FREE_MSG(mBuf);
2723          return RFAILED;
2724       }
2725    }
2726
2727    if (SPkS16(suId, mBuf) != ROK) {
2728 #if (ERRCLASS & ERRCLS_ADD_RES)
2729       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2730          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2731          (ErrVal)ETFU089, (ErrVal)0, "Packing failed");
2732 #endif
2733       TFU_FREE_MEM(timingAdvInd);
2734       TFU_FREE_MSG(mBuf);
2735       return RFAILED;
2736    }
2737    if (pst->selector != ODU_SELECTOR_LWLC) {
2738       TFU_FREE_MEM(timingAdvInd);
2739    }
2740
2741    pst->event = (Event) EVTTFUTIMINGADVIND;
2742    return (SPstTsk(pst,mBuf));
2743 }
2744
2745 \f
2746 /***********************************************************
2747 *
2748 *     Func : cmUnpkTfuTimingAdvInd
2749 *
2750 *
2751 *     Desc : This API is used to indicate a Timing Advance from PHY to Scheduler .
2752  * @details This primitive carries timing advance information for a number of
2753  * UEs that may need timing advance. Timing advance information is an estimate
2754  * of the timing adjustment that a UE would need to apply in order to be
2755  * synchronized in uplink. This estimate is to be calculated by physical layer. 
2756  * @param pst Pointer to the post structure.
2757  * @param suId SAP ID of the service user.
2758  * @param timingAdvInd Pointer to the TfuTimingAdvIndInfo structure.
2759  * @return ROK/RFAILED
2760 *
2761 *
2762 *     Ret  : S16
2763 *
2764 *     Notes:
2765 *
2766 *     File  : 
2767 *
2768 **********************************************************/
2769 #ifdef ANSI
2770 S16 cmUnpkTfuTimingAdvInd
2771 (
2772 TfuTimingAdvInd func,
2773 Pst *pst,
2774 Buffer *mBuf
2775 )
2776 #else
2777 S16 cmUnpkTfuTimingAdvInd(func, pst, mBuf)
2778 TfuTimingAdvInd func;
2779 Pst *pst;
2780 Buffer *mBuf;
2781 #endif
2782 {
2783    SuId suId;
2784    TfuTimingAdvIndInfo *timingAdvInd;
2785    
2786
2787    if (SUnpkS16(&suId, mBuf) != ROK) {
2788       TFU_FREE_MSG(mBuf);
2789 #if (ERRCLASS & ERRCLS_ADD_RES)
2790       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2791          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2792          (ErrVal)ETFU090, (ErrVal)0, "Packing failed");
2793 #endif
2794       return RFAILED;
2795    }
2796    if (pst->selector != ODU_SELECTOR_LWLC) {
2797       Mem   sMem;
2798       sMem.region = pst->region;
2799       sMem.pool = pst->pool;
2800       if ((cmAllocEvnt(sizeof(TfuTimingAdvIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&timingAdvInd)) != ROK)            {
2801 #if (ERRCLASS & ERRCLS_ADD_RES)
2802          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2803             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2804             (ErrVal)ETFU091, (ErrVal)0, "Packing failed");
2805 #endif
2806          TFU_FREE_MSG(mBuf);
2807          return RFAILED;
2808       }
2809    }
2810
2811
2812    if (pst->selector == ODU_SELECTOR_LC) 
2813    {
2814       if (cmUnpkTfuTimingAdvIndInfo(timingAdvInd, (Ptr)&timingAdvInd->memCp, mBuf) != ROK) {
2815          TFU_FREE_MEM(timingAdvInd);
2816          TFU_FREE_MSG(mBuf);
2817 #if (ERRCLASS & ERRCLS_ADD_RES)
2818          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2819                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2820                (ErrVal)ETFU092, (ErrVal)0, "Packing failed");
2821 #endif
2822          return RFAILED;
2823       }
2824    }
2825    else if(pst->selector == ODU_SELECTOR_LWLC)
2826    {
2827       if (oduUnpackPointer((PTR *)&timingAdvInd, mBuf) != ROK)
2828       {
2829 #if (ERRCLASS & ERRCLS_ADD_RES)
2830          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2831             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2832             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
2833 #endif
2834          TFU_FREE_MEM(timingAdvInd);
2835          TFU_FREE_MSG(mBuf);
2836          return RFAILED;
2837       }
2838    }
2839    TFU_FREE_MSG(mBuf);
2840    return ((*func)(pst, suId, timingAdvInd));
2841 }
2842
2843 \f
2844 /***********************************************************
2845 *
2846 *     Func : cmPkTfuDatReq
2847 *
2848 *
2849 *     Desc : This Primitive carries the Data PDUs from MAC to PHY for
2850   * transmission. 
2851   * @details The data being sent in this primitive is meant to be transmitted on
2852   * the downlink channel PDSCH and PBCH (if present). To facilitate physical
2853   * layer processing, requisite control information is also sent along with the
2854   * data. 
2855   * @sa TfUiTfuCntrlReq
2856   * @param pst 
2857   * @param spId
2858   * @param tfuDatReq pointer to TfuDatReqInfo
2859   * @return
2860 *
2861 *
2862 *     Ret  : S16
2863 *
2864 *     Notes:
2865 *
2866 *     File  : 
2867 *
2868 **********************************************************/
2869 #ifdef ANSI
2870 S16 cmPkTfuDatReq
2871 (
2872 Pst * pst,
2873 SpId spId,
2874 TfuDatReqInfo * datReq
2875 )
2876 #else
2877 S16 cmPkTfuDatReq(pst, spId, datReq)
2878 Pst * pst;
2879 SpId spId;
2880 TfuDatReqInfo * datReq;
2881 #endif
2882 {
2883    Buffer *mBuf = NULLP;
2884
2885    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2886 #if (ERRCLASS & ERRCLS_ADD_RES)
2887       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2888          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2889          (ErrVal)ETFU093, (ErrVal)0, "Packing failed");
2890 #endif
2891       TFU_FREE_MEM(datReq);
2892       return RFAILED;
2893    }
2894    if (pst->selector == ODU_SELECTOR_LC) {
2895       if (cmPkTfuDatReqInfo(datReq, mBuf) != ROK) {
2896 #if (ERRCLASS & ERRCLS_ADD_RES)
2897          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2898             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2899             (ErrVal)ETFU094, (ErrVal)0, "Packing failed");
2900 #endif
2901          TFU_FREE_MEM(datReq);
2902          TFU_FREE_MSG(mBuf);
2903          return RFAILED;
2904       }
2905    }
2906    else if(pst->selector == ODU_SELECTOR_LWLC)
2907    {
2908       if(oduPackPointer((PTR)datReq, mBuf) != ROK)
2909       {
2910 #if (ERRCLASS & ERRCLS_ADD_RES)
2911          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2912             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2913             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2914 #endif
2915          TFU_FREE_MEM(datReq);
2916          TFU_FREE_MSG(mBuf);
2917          return RFAILED;
2918       }
2919    }
2920
2921    if (SPkS16(spId, mBuf) != ROK) {
2922 #if (ERRCLASS & ERRCLS_ADD_RES)
2923       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2924          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2925          (ErrVal)ETFU095, (ErrVal)0, "Packing failed");
2926 #endif
2927       TFU_FREE_MEM(datReq);
2928       TFU_FREE_MSG(mBuf);
2929       return RFAILED;
2930    }
2931    if (pst->selector != ODU_SELECTOR_LWLC) {
2932       TFU_FREE_MEM(datReq);
2933    }
2934
2935    pst->event = (Event) EVTTFUDATREQ;
2936    return (SPstTsk(pst,mBuf));
2937 }
2938
2939 \f
2940 /***********************************************************
2941 *
2942 *     Func : cmUnpkTfuDatReq
2943 *
2944 *
2945 *     Desc : This Primitive carries the Data PDUs from MAC to PHY for
2946   * transmission. 
2947   * @details The data being sent in this primitive is meant to be transmitted on
2948   * the downlink channel PDSCH and PBCH (if present). To facilitate physical
2949   * layer processing, requisite control information is also sent along with the
2950   * data. 
2951   * @sa TfUiTfuCntrlReq
2952   * @param pst 
2953   * @param spId
2954   * @param tfuDatReq pointer to TfuDatReqInfo
2955   * @return
2956 *
2957 *
2958 *     Ret  : S16
2959 *
2960 *     Notes:
2961 *
2962 *     File  : 
2963 *
2964 **********************************************************/
2965 #ifdef ANSI
2966 S16 cmUnpkTfuDatReq
2967 (
2968 TfuDatReq func,
2969 Pst *pst,
2970 Buffer *mBuf
2971 )
2972 #else
2973 S16 cmUnpkTfuDatReq(func, pst, mBuf)
2974 TfuDatReq func;
2975 Pst *pst;
2976 Buffer *mBuf;
2977 #endif
2978 {
2979    SpId spId;
2980    TfuDatReqInfo *datReq;
2981    
2982
2983    if (SUnpkS16(&spId, mBuf) != ROK) {
2984       TFU_FREE_MSG(mBuf);
2985 #if (ERRCLASS & ERRCLS_ADD_RES)
2986       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2987          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2988          (ErrVal)ETFU096, (ErrVal)0, "Packing failed");
2989 #endif
2990       return RFAILED;
2991    }
2992    if (pst->selector != ODU_SELECTOR_LWLC) {
2993       Mem   sMem;
2994       sMem.region = pst->region;
2995       sMem.pool = pst->pool;
2996       if ((cmAllocEvnt(sizeof(TfuDatReqInfo), TFU_BLKSZ, &sMem, (Ptr *)&datReq)) != ROK)            {
2997 #if (ERRCLASS & ERRCLS_ADD_RES)
2998          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2999             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3000             (ErrVal)ETFU097, (ErrVal)0, "Packing failed");
3001 #endif
3002          TFU_FREE_MSG(mBuf);
3003          return RFAILED;
3004       }
3005    }
3006
3007
3008    if (pst->selector == ODU_SELECTOR_LC) 
3009    {
3010       if (cmUnpkTfuDatReqInfo(datReq, (Ptr)&datReq->memCp, mBuf) != ROK) {
3011          TFU_FREE_MEM(datReq);
3012          TFU_FREE_MSG(mBuf);
3013 #if (ERRCLASS & ERRCLS_ADD_RES)
3014          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3015                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3016                (ErrVal)ETFU098, (ErrVal)0, "Unpacking failed");
3017 #endif
3018          return RFAILED;
3019       }
3020    }
3021    else if (pst->selector == ODU_SELECTOR_LWLC)
3022    {
3023       if(oduUnpackPointer((PTR *)&datReq, mBuf) != ROK)
3024       {
3025          TFU_FREE_MEM(datReq);
3026          TFU_FREE_MSG(mBuf);
3027 #if (ERRCLASS & ERRCLS_ADD_RES)
3028          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3029                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3030                (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Un-Packing failed");
3031 #endif
3032          return RFAILED;
3033       }
3034    }
3035    TFU_FREE_MSG(mBuf);
3036    return ((*func)(pst, spId, datReq));
3037 }
3038
3039 \f
3040 /***********************************************************
3041 *
3042 *     Func : cmPkTfuCntrlReq
3043 *
3044 *
3045 *     Desc : This Primitive is sent from Scheduler to PHY. It provides PHY with
3046   * all the control information
3047   * @details This primitive carries the information sent on the following
3048   * channels - 
3049   * -# PDCCH
3050   * -# PHICH
3051   * -# PCFICH
3052   * 
3053   * @param pst
3054   * @param spId
3055   * @param cntrlReq pointer to TfuCntrlReqInfo
3056   * @return ROK/RFAILED
3057 *
3058 *
3059 *     Ret  : S16
3060 *
3061 *     Notes:
3062 *
3063 *     File  : 
3064 *
3065 **********************************************************/
3066 #ifdef ANSI
3067 S16 cmPkTfuCntrlReq
3068 (
3069 Pst * pst,
3070 SpId spId,
3071 TfuCntrlReqInfo * cntrlReq
3072 )
3073 #else
3074 S16 cmPkTfuCntrlReq(pst, spId, cntrlReq)
3075 Pst * pst;
3076 SpId spId;
3077 TfuCntrlReqInfo * cntrlReq;
3078 #endif
3079 {
3080    Buffer *mBuf = NULLP;
3081
3082    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3083 #if (ERRCLASS & ERRCLS_ADD_RES)
3084       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3085          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3086          (ErrVal)ETFU099, (ErrVal)0, "Packing failed");
3087 #endif
3088       TFU_FREE_MEM(cntrlReq);
3089       return RFAILED;
3090    }
3091    if (pst->selector == ODU_SELECTOR_LC) {
3092       if (cmPkTfuCntrlReqInfo(cntrlReq, mBuf) != ROK) {
3093 #if (ERRCLASS & ERRCLS_ADD_RES)
3094          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3095             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3096             (ErrVal)ETFU100, (ErrVal)0, "Packing failed");
3097 #endif
3098          TFU_FREE_MEM(cntrlReq);
3099          TFU_FREE_MSG(mBuf);
3100          return RFAILED;
3101       }
3102    }
3103    else if(pst->selector == ODU_SELECTOR_LWLC)
3104    {
3105       if (oduPackPointer((PTR)cntrlReq, mBuf) != ROK)
3106       {
3107 #if (ERRCLASS & ERRCLS_ADD_RES)
3108          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3109             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3110             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
3111 #endif
3112          TFU_FREE_MEM(cntrlReq);
3113          TFU_FREE_MSG(mBuf);
3114          return RFAILED;
3115       }
3116    }
3117
3118
3119    if (SPkS16(spId, mBuf) != ROK) {
3120 #if (ERRCLASS & ERRCLS_ADD_RES)
3121       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3122          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3123          (ErrVal)ETFU101, (ErrVal)0, "Packing failed");
3124 #endif
3125       TFU_FREE_MEM(cntrlReq);
3126       TFU_FREE_MSG(mBuf);
3127       return RFAILED;
3128    }
3129    if (pst->selector != ODU_SELECTOR_LWLC) {
3130       TFU_FREE_MEM(cntrlReq);
3131    }
3132
3133    pst->event = (Event) EVTTFUCNTRLREQ;
3134    return (SPstTsk(pst,mBuf));
3135 }
3136
3137 \f
3138 /***********************************************************
3139 *
3140 *     Func : cmUnpkTfuCntrlReq
3141 *
3142 *
3143 *     Desc : This Primitive is sent from Scheduler to PHY. It provides PHY with
3144   * all the control information
3145   * @details This primitive carries the information sent on the following
3146   * channels - 
3147   * -# PDCCH
3148   * -# PHICH
3149   * -# PCFICH
3150   * 
3151   * @param pst
3152   * @param spId
3153   * @param cntrlReq pointer to TfuCntrlReqInfo
3154   * @return ROK/RFAILED
3155 *
3156 *
3157 *     Ret  : S16
3158 *
3159 *     Notes:
3160 *
3161 *     File  : 
3162 *
3163 **********************************************************/
3164 #ifdef ANSI
3165 S16 cmUnpkTfuCntrlReq
3166 (
3167 TfuCntrlReq func,
3168 Pst *pst,
3169 Buffer *mBuf
3170 )
3171 #else
3172 S16 cmUnpkTfuCntrlReq(func, pst, mBuf)
3173 TfuCntrlReq func;
3174 Pst *pst;
3175 Buffer *mBuf;
3176 #endif
3177 {
3178    SpId spId;
3179    TfuCntrlReqInfo *cntrlReq;
3180    
3181
3182    if (SUnpkS16(&spId, mBuf) != ROK) {
3183       TFU_FREE_MSG(mBuf);
3184 #if (ERRCLASS & ERRCLS_ADD_RES)
3185       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3186          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3187          (ErrVal)ETFU102, (ErrVal)0, "Packing failed");
3188 #endif
3189       return RFAILED;
3190    }
3191    if (pst->selector != ODU_SELECTOR_LWLC) {
3192       Mem   sMem;
3193       sMem.region = pst->region;
3194       sMem.pool = pst->pool;
3195       if ((cmAllocEvnt(sizeof(TfuCntrlReqInfo), TFU_BLKSZ, &sMem, (Ptr *)&cntrlReq)) != ROK)            {
3196 #if (ERRCLASS & ERRCLS_ADD_RES)
3197          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3198             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3199             (ErrVal)ETFU103, (ErrVal)0, "Packing failed");
3200 #endif
3201          TFU_FREE_MSG(mBuf);
3202          return RFAILED;
3203       }
3204    }
3205
3206
3207    if (pst->selector == ODU_SELECTOR_LC) 
3208    {
3209       if (cmUnpkTfuCntrlReqInfo(cntrlReq, (Ptr)&cntrlReq->memCp, mBuf) != ROK) {
3210          TFU_FREE_MEM(cntrlReq);
3211          TFU_FREE_MSG(mBuf);
3212 #if (ERRCLASS & ERRCLS_ADD_RES)
3213          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3214                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3215                (ErrVal)ETFU104, (ErrVal)0, "Packing failed");
3216 #endif
3217          return RFAILED;
3218       }
3219    }
3220    else if(pst->selector == ODU_SELECTOR_LWLC)
3221    {
3222       if (oduUnpackPointer((PTR *)&cntrlReq, mBuf) != ROK)
3223       {
3224 #if (ERRCLASS & ERRCLS_ADD_RES)
3225          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3226             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3227             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
3228 #endif
3229          TFU_FREE_MEM(cntrlReq);
3230          TFU_FREE_MSG(mBuf);
3231          return RFAILED;
3232       }
3233    }
3234    TFU_FREE_MSG(mBuf);
3235    return ((*func)(pst, spId, cntrlReq));
3236 }
3237
3238
3239 \f
3240 /***********************************************************
3241 *
3242 *     Func : cmPkTfuTtiInd
3243 *
3244 *
3245 *     Desc : This API is the TTI indication from PHY to MAC . 
3246  * @details This primitive provides the timing information (SFN and subframe)
3247  * which is currently running on the physical layer. 
3248  * @param pst Pointer to the post structure.
3249  * @param suId SAP ID of the service user.
3250  * @param ttiInd Pointer to the TfuTtiIndInfo.
3251  * @return ROK/RFAILED
3252 *
3253 *
3254 *     Ret  : S16
3255 *
3256 *     Notes:
3257 *
3258 *     File  : 
3259 *
3260 **********************************************************/
3261 #ifdef ANSI
3262 S16 cmPkTfuTtiInd
3263 (
3264 Pst * pst,
3265 SuId suId,
3266 TfuTtiIndInfo * ttiInd
3267 )
3268 #else
3269 S16 cmPkTfuTtiInd(pst, suId, ttiInd)
3270 Pst * pst;
3271 SuId suId;
3272 TfuTtiIndInfo * ttiInd;
3273 #endif
3274 {
3275    Buffer *mBuf = NULLP;
3276
3277    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3278 #if (ERRCLASS & ERRCLS_ADD_RES)
3279       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3280          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3281          (ErrVal)ETFU105, (ErrVal)0, "Packing failed");
3282 #endif
3283       SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3284       return RFAILED;
3285    }
3286    if (pst->selector == ODU_SELECTOR_LC) {
3287       if (cmPkTfuTtiIndInfo(ttiInd, mBuf) != ROK) {
3288 #if (ERRCLASS & ERRCLS_ADD_RES)
3289          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3290             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3291             (ErrVal)ETFU106, (ErrVal)0, "Packing failed");
3292 #endif
3293          SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3294          TFU_FREE_MSG(mBuf);
3295          return RFAILED;
3296       }
3297    }
3298    else if(pst->selector == ODU_SELECTOR_LWLC)
3299    {
3300       if (oduPackPointer((PTR)ttiInd, mBuf) != ROK)
3301       {
3302 #if (ERRCLASS & ERRCLS_ADD_RES)
3303          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3304             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3305             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
3306 #endif
3307          
3308          /*MS_FIX:71858:Changed to SPutSBuf as being allocated with SGetSBuf*/
3309          SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3310          TFU_FREE_MSG(mBuf);
3311          return RFAILED;
3312       }
3313    }
3314
3315    if (SPkS16(suId, mBuf) != ROK) {
3316 #if (ERRCLASS & ERRCLS_ADD_RES)
3317       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3318          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3319          (ErrVal)ETFU107, (ErrVal)0, "Packing failed");
3320 #endif
3321       SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3322       TFU_FREE_MSG(mBuf);
3323       return RFAILED;
3324    }
3325    if (pst->selector != ODU_SELECTOR_LWLC) {
3326       if (SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo)) != ROK) {
3327 #if (ERRCLASS & ERRCLS_ADD_RES)
3328       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3329          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3330          (ErrVal)ETFU108, (ErrVal)0, "Packing failed");
3331 #endif
3332          TFU_FREE_MSG(mBuf);
3333          return RFAILED;
3334       }
3335    }
3336
3337    //pst->event = (Event) EVENT_SLOT_IND_TO_MAC;
3338    return (SPstTsk(pst,mBuf));
3339 }
3340
3341 #if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
3342 /***********************************************************
3343  *
3344  *     Func : cmPkTfuNonRtInd
3345  *
3346  *
3347  *     Desc : This API is the Non-Rt indication from CL to MAC . 
3348  * @param pst Pointer to the post structure.
3349  * @param suId SAP ID of the service user.
3350  * @return ROK/RFAILED
3351  *
3352  *
3353  *     Ret  : S16
3354  *
3355  *     Notes:
3356  *
3357  *     File  : 
3358  *
3359 **********************************************************/
3360 #ifdef ANSI
3361 S16 cmPkTfuNonRtInd
3362 (
3363 Pst * pst,
3364 SuId suId
3365 )
3366 #else
3367 S16 cmPkTfuNonRtInd(pst, suId)
3368 Pst * pst;
3369 SuId suId;
3370 #endif
3371 {
3372    Buffer *mBuf = NULLP;
3373
3374    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3375 #if (ERRCLASS & ERRCLS_ADD_RES)
3376       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3377          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3378          (ErrVal)ETFU105, (ErrVal)0, "Packing failed");
3379 #endif
3380       return RFAILED;
3381   }
3382   if (SPkS16(suId, mBuf) != ROK) {
3383 #if (ERRCLASS & ERRCLS_ADD_RES)
3384       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3385          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3386          (ErrVal)ETFU107, (ErrVal)0, "Packing failed");
3387 #endif
3388       TFU_FREE_MSG(mBuf);
3389       return RFAILED;
3390   }
3391   pst->event = (Event) EVTTFUNONRTIND;
3392   return (SPstTsk(pst,mBuf));
3393 }
3394
3395 /***********************************************************
3396 *
3397 *     Func : cmUnpkTfuNonRtInd
3398 *
3399 *
3400 *     Desc : This API is the Non Rt indication from PHY to MAC . 
3401 * @param pst Pointer to the post structure.
3402 * @param suId SAP ID of the service user.
3403 * @return ROK/RFAILED
3404 *
3405 *
3406 *     Ret  : S16
3407 *
3408 *     Notes:
3409 *
3410 *     File  : 
3411 *
3412 **********************************************************/
3413 #ifdef ANSI
3414 S16 cmUnpkTfuNonRtInd
3415 (
3416 TfuNonRtInd func,
3417 Pst *pst,
3418 Buffer *mBuf
3419 )
3420 #else
3421 S16 cmUnpkTfuNonRtInd(func, pst, mBuf)
3422 TfuNonRtInd func;
3423 Pst *pst;
3424 Buffer *mBuf;
3425 #endif
3426 {
3427    SuId suId;
3428
3429    if (SUnpkS16(&suId, mBuf) != ROK) {
3430       TFU_FREE_MSG(mBuf);
3431 #if (ERRCLASS & ERRCLS_ADD_RES)
3432       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3433          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3434          (ErrVal)ETFU109, (ErrVal)0, "Packing failed");
3435 #endif
3436       return RFAILED;
3437    }
3438    TFU_FREE_MSG(mBuf);
3439    return ((*func)(pst, suId));
3440 }
3441
3442 #endif
3443
3444 \f
3445 /***********************************************************
3446 *
3447 *     Func : cmPkTfuPucchDeltaPwr
3448 *
3449 *
3450 *     Desc : This Primitive is used to convey PUCCH Delta power calculated by the
3451  * Physical layer.
3452  * This information is utilized by Scheduler for power control. 
3453  * @param pst Pointer to the post structure.
3454  * @param suId SAP ID of the service user.
3455  * @param  Pointer to the TfuPucchDeltaPwrIndInfo structure.
3456  * @return ROK/RFAILED
3457 *
3458 *
3459 *     Ret  : S16
3460 *
3461 *     Notes:
3462 *
3463 *     File  : 
3464 *
3465 **********************************************************/
3466 #ifdef ANSI
3467 S16 cmPkTfuPucchDeltaPwr
3468 (
3469 Pst * pst,
3470 SuId suId,
3471 TfuPucchDeltaPwrIndInfo * pucchDeltaPwr
3472 )
3473 #else
3474 S16 cmPkTfuPucchDeltaPwr(pst, suId, pucchDeltaPwr)
3475 Pst * pst;
3476 SuId suId;
3477 TfuPucchDeltaPwrIndInfo * pucchDeltaPwr;
3478 #endif
3479 {
3480    Buffer *mBuf = NULLP;
3481
3482    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3483 #if (ERRCLASS & ERRCLS_ADD_RES)
3484       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3485          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3486          (ErrVal)ETFU119, (ErrVal)0, "Packing failed");
3487 #endif
3488       SPutSBuf(pst->region, pst->pool, (Data *)pucchDeltaPwr, sizeof(TfuPucchDeltaPwrIndInfo));
3489       return RFAILED;
3490    }
3491    if (pst->selector == ODU_SELECTOR_LC) {
3492       if (cmPkTfuPucchDeltaPwrIndInfo(pucchDeltaPwr, mBuf) != ROK) {
3493 #if (ERRCLASS & ERRCLS_ADD_RES)
3494          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3495             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3496             (ErrVal)ETFU120, (ErrVal)0, "Packing failed");
3497 #endif
3498          TFU_FREE_MEM(pucchDeltaPwr);
3499          TFU_FREE_MSG(mBuf);
3500          return RFAILED;
3501       }
3502    }
3503    else if(pst->selector == ODU_SELECTOR_LWLC)
3504    {
3505       if (oduPackPointer((PTR)pucchDeltaPwr, mBuf) != ROK)
3506       {
3507 #if (ERRCLASS & ERRCLS_ADD_RES)
3508          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3509             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3510             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
3511 #endif
3512          TFU_FREE_MEM(pucchDeltaPwr);
3513          TFU_FREE_MSG(mBuf);
3514          return RFAILED;
3515       }
3516    }
3517
3518    if (SPkS16(suId, mBuf) != ROK) {
3519 #if (ERRCLASS & ERRCLS_ADD_RES)
3520       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3521          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3522          (ErrVal)ETFU121, (ErrVal)0, "Packing failed");
3523 #endif
3524       TFU_FREE_MEM(pucchDeltaPwr);
3525       TFU_FREE_MSG(mBuf);
3526       return RFAILED;
3527    }
3528    if (pst->selector != ODU_SELECTOR_LWLC) {
3529       TFU_FREE_MEM(pucchDeltaPwr);
3530    }
3531    pst->event = (Event) EVTTFUPUCCHDELPWR;
3532    return (SPstTsk(pst,mBuf));
3533 }
3534
3535 \f
3536 /***********************************************************
3537 *
3538 *     Func : cmUnpkTfuPucchDeltaPwr
3539 *
3540 *
3541 *     Desc : This Primitive is used to convey PUCCH Delta power calculated by the
3542  * Physical layer.
3543  * This information is utilized by Scheduler for power control. 
3544  * @param pst Pointer to the post structure.
3545  * @param suId SAP ID of the service user.
3546  * @param  Pointer to the TfuPucchDeltaPwrIndInfo structure.
3547  * @return ROK/RFAILED
3548 *
3549 *
3550 *     Ret  : S16
3551 *
3552 *     Notes:
3553 *
3554 *     File  : 
3555 *
3556 **********************************************************/
3557 #ifdef ANSI
3558 S16 cmUnpkTfuPucchDeltaPwr
3559 (
3560 TfuPucchDeltaPwrInd func,
3561 Pst *pst,
3562 Buffer *mBuf
3563 )
3564 #else
3565 S16 cmUnpkTfuPucchDeltaPwr(func, pst, mBuf)
3566 TfuPucchDeltaPwrInd func;
3567 Pst *pst;
3568 Buffer *mBuf;
3569 #endif
3570 {
3571    SuId suId;
3572    TfuPucchDeltaPwrIndInfo *pucchDeltaPwr;
3573    
3574
3575    if (SUnpkS16(&suId, mBuf) != ROK) {
3576       TFU_FREE_MSG(mBuf);
3577 #if (ERRCLASS & ERRCLS_ADD_RES)
3578       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3579          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3580          (ErrVal)ETFU122, (ErrVal)0, "Packing failed");
3581 #endif
3582       return RFAILED;
3583    }
3584    if (pst->selector != ODU_SELECTOR_LWLC) {
3585       Mem   sMem;
3586       sMem.region = pst->region;
3587       sMem.pool = pst->pool;
3588       if ((cmAllocEvnt(sizeof(TfuPucchDeltaPwrIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&pucchDeltaPwr)) != ROK)            {
3589 #if (ERRCLASS & ERRCLS_ADD_RES)
3590          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3591             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3592             (ErrVal)ETFU123, (ErrVal)0, "Packing failed");
3593 #endif
3594          TFU_FREE_MSG(mBuf);
3595          return RFAILED;
3596       }
3597    }
3598
3599    if (pst->selector == ODU_SELECTOR_LC) 
3600    {
3601       if (cmUnpkTfuPucchDeltaPwrIndInfo(pucchDeltaPwr, (Ptr)&pucchDeltaPwr->memCp, mBuf) != ROK) {
3602          TFU_FREE_MEM(pucchDeltaPwr);
3603          TFU_FREE_MSG(mBuf);
3604 #if (ERRCLASS & ERRCLS_ADD_RES)
3605          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3606                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3607                (ErrVal)ETFU124, (ErrVal)0, "Packing failed");
3608 #endif
3609          return RFAILED;
3610       }
3611    }
3612    else if(pst->selector == ODU_SELECTOR_LWLC)
3613    {
3614       if (oduUnpackPointer((PTR *)&pucchDeltaPwr, mBuf) != ROK)
3615       {
3616 #if (ERRCLASS & ERRCLS_ADD_RES)
3617          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3618             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3619             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
3620 #endif
3621          TFU_FREE_MEM(pucchDeltaPwr);
3622          TFU_FREE_MSG(mBuf);
3623          return RFAILED;
3624       }
3625    }
3626    TFU_FREE_MSG(mBuf);
3627    return ((*func)(pst, suId, pucchDeltaPwr));
3628 }
3629
3630 #ifdef TFU_5GTF
3631 \f
3632 /***********************************************************
3633 *
3634 *     Func : cmPkTfuRbAssignA1Val324
3635 *
3636 *
3637 *     Desc : This structure contains the information needed to convey  RIV value 324.
3638 *
3639 *
3640 *     Ret  : S16
3641 *
3642 *     Notes:
3643 *
3644 *     File  : 
3645 *
3646 **********************************************************/
3647 #ifdef ANSI
3648 S16 cmPkTfuRbAssignA1Val324
3649 (
3650 TfuRbAssignA1Val324 *param,
3651 Buffer *mBuf
3652 )
3653 #else
3654 S16 cmPkTfuRbAssignA1Val324(param, mBuf)
3655 TfuRbAssignA1Val324 *param;
3656 Buffer *mBuf;
3657 #endif
3658 {
3659
3660
3661    CMCHKPK(oduUnpackUInt8, param->ndi, mBuf);
3662    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
3663    CMCHKPK(oduUnpackUInt8, param->hqProcId, mBuf);
3664 #ifdef UL_ADPT_DBG   
3665    printf("cmPkTfuRbAssignA1Val324 param->ndi %d mcs %d param->hqProcId %d \n",param->ndi,param->mcs,param->hqProcId);
3666 #endif   
3667    return ROK;
3668 }
3669
3670 \f
3671 /***********************************************************
3672 *
3673 *     Func : cmPkTfuRbAssignB1Val324
3674 *
3675 *
3676 *     Desc : This structure contains the information needed to convey  RIV value 324.
3677 *
3678 *
3679 *     Ret  : S16
3680 *
3681 *     Notes:
3682 *
3683 *     File  : 
3684 *
3685 **********************************************************/
3686 #ifdef ANSI
3687 S16 cmPkTfuRbAssignB1Val324
3688 (
3689 TfuRbAssignB1Val324 *param,
3690 Buffer *mBuf
3691 )
3692 #else
3693 S16 cmPkTfuRbAssignB1Val324(param, mBuf)
3694 TfuRbAssignB1Val324 *param;
3695 Buffer *mBuf;
3696 #endif
3697 {
3698
3699
3700    CMCHKPK(oduUnpackUInt8, param->bmiHqAckNack, mBuf);
3701    CMCHKPK(oduUnpackUInt8, param->RV, mBuf);
3702    CMCHKPK(oduUnpackUInt8, param->ndi, mBuf);
3703    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
3704    CMCHKPK(oduUnpackUInt8, param->hqProcId, mBuf);
3705    return ROK;
3706 }
3707
3708 \f
3709 /***********************************************************
3710 *
3711 *     Func : cmPkTfuRbAssignVal326
3712 *
3713 *
3714 *     Desc : This structure contains the information needed to convey  RIV value 326.
3715 *
3716 *
3717 *     Ret  : S16
3718 *
3719 *     Notes:
3720 *
3721 *     File  : 
3722 *
3723 **********************************************************/
3724 #ifdef ANSI
3725 S16 cmPkTfuRbAssignVal326
3726 (
3727 TfuRbAssignVal326 *param,
3728 Buffer *mBuf
3729 )
3730 #else
3731 S16 cmPkTfuRbAssignVal326(param, mBuf)
3732 TfuRbAssignVal326 *param;
3733 Buffer *mBuf;
3734 #endif
3735 {
3736
3737
3738    CMCHKPK(oduUnpackUInt8, param->CyclicShiftInd, mBuf);
3739    CMCHKPK(oduUnpackUInt8, param->OCCInd, mBuf);
3740    CMCHKPK(oduUnpackUInt8, param->FreqBandIdx, mBuf);
3741    return ROK;
3742 }
3743
3744 \f
3745 /***********************************************************
3746 *
3747 *     Func : cmUnpkTfuRbAssignA1Val324
3748 *
3749 *
3750 *     Desc : This structure contains the information needed to convey  RIV value 324.
3751 *
3752 *
3753 *     Ret  : S16
3754 *
3755 *     Notes:
3756 *
3757 *     File  : 
3758 *
3759 **********************************************************/
3760 #ifdef ANSI
3761 S16 cmUnpkTfuRbAssignA1Val324
3762 (
3763 TfuRbAssignA1Val324 *param,
3764 Buffer *mBuf
3765 )
3766 #else
3767 S16 cmUnpkTfuRbAssignA1Val324(param, mBuf)
3768 TfuRbAssignA1Val324 *param;
3769 Buffer *mBuf;
3770 #endif
3771 {
3772
3773
3774    CMCHKUNPK(oduPackUInt8, &param->hqProcId, mBuf);
3775    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
3776    CMCHKUNPK(oduPackUInt8, &param->ndi, mBuf);
3777    return ROK;
3778 }
3779
3780 \f
3781 /***********************************************************
3782 *
3783 *     Func : cmUnpkTfuRbAssignB1Val324
3784 *
3785 *
3786 *     Desc : This structure contains the information needed to convey  RIV value 324.
3787 *
3788 *
3789 *     Ret  : S16
3790 *
3791 *     Notes:
3792 *
3793 *     File  : 
3794 *
3795 **********************************************************/
3796 #ifdef ANSI
3797 S16 cmUnpkTfuRbAssignB1Val324
3798 (
3799 TfuRbAssignB1Val324 *param,
3800 Buffer *mBuf
3801 )
3802 #else
3803 S16 cmUnpkTfuRbAssignB1Val324(param, mBuf)
3804 TfuRbAssignB1Val324 *param;
3805 Buffer *mBuf;
3806 #endif
3807 {
3808
3809
3810    CMCHKUNPK(oduPackUInt8, &param->hqProcId, mBuf);
3811    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
3812    CMCHKUNPK(oduPackUInt8, &param->ndi, mBuf);
3813    CMCHKUNPK(oduPackUInt8, &param->RV, mBuf);
3814    CMCHKUNPK(oduPackUInt8, &param->bmiHqAckNack, mBuf);
3815    return ROK;
3816 }
3817
3818 \f
3819 /***********************************************************
3820 *
3821 *     Func : cmUnpkTfuRbAssignVal326
3822 *
3823 *
3824 *     Desc : This structure contains the information needed to convey  RIV value 326.
3825 *
3826 *
3827 *     Ret  : S16
3828 *
3829 *     Notes:
3830 *
3831 *     File  : 
3832 *
3833 **********************************************************/
3834 #ifdef ANSI
3835 S16 cmUnpkTfuRbAssignVal326
3836 (
3837 TfuRbAssignVal326 *param,
3838 Buffer *mBuf
3839 )
3840 #else
3841 S16 cmUnpkTfuRbAssignVal326(param, mBuf)
3842 TfuRbAssignVal326 *param;
3843 Buffer *mBuf;
3844 #endif
3845 {
3846
3847
3848    CMCHKUNPK(oduPackUInt8, &param->FreqBandIdx, mBuf);
3849    CMCHKUNPK(oduPackUInt8, &param->OCCInd, mBuf);
3850    CMCHKUNPK(oduPackUInt8, &param->CyclicShiftInd, mBuf);
3851    return ROK;
3852 }
3853
3854
3855 \f
3856 /***********************************************************
3857 *
3858 *     Func : cmPkTfuDciFormatA1A2Info
3859 *
3860 *
3861 *     Desc : This structure contains the information needed to convey DCI format A1/A2.
3862 *
3863 *
3864 *     Ret  : S16
3865 *
3866 *     Notes:
3867 *
3868 *     File  : 
3869 *
3870 **********************************************************/
3871 #ifdef ANSI
3872 S16 cmPkTfuDciFormatA1A2Info
3873 (
3874 TfuDciFormatA1Info *param,
3875 Buffer *mBuf
3876 )
3877 #else
3878 S16 cmPkTfuDciFormatA1A2Info(param, mBuf)
3879 TfuDciFormatA1Info *param;
3880 Buffer *mBuf;
3881 #endif
3882 {
3883
3884
3885    //printf("5GTF_DBG: cmPkTfuDciFormatA1Info() called by eNB\n");   
3886    CMCHKPK(oduUnpackUInt8, param->tpcCmd, mBuf);
3887    CMCHKPK(oduUnpackUInt8, param->UL_PCRS, mBuf);
3888    CMCHKPK(oduUnpackUInt8, param->PMI, mBuf);
3889    CMCHKPK(oduUnpackUInt8, param->SCID, mBuf);
3890
3891    CMCHKPK(oduUnpackUInt8, param->REMapIdx_DMRS_PCRS_numLayers, mBuf);
3892    CMCHKPK(oduUnpackUInt8, param->SRS_Symbol, mBuf);
3893    CMCHKPK(oduUnpackUInt8, param->SRS_Config, mBuf);
3894    CMCHKPK(oduUnpackUInt8, param->beamSwitch, mBuf);
3895    CMCHKPK(oduUnpackUInt8, param->uciOnxPUSCH, mBuf);
3896
3897    CMCHKPK(oduUnpackUInt8, param->numBSI_Reports, mBuf);
3898    CMCHKPK(oduUnpackUInt8, param->CSIRS_BRRS_ProcInd, mBuf);
3899    CMCHKPK(oduUnpackUInt8, param->CSI_BRRS_Indicator, mBuf);
3900    CMCHKPK(oduUnpackUInt8, param->CSIRS_BRRS_SymbIdx, mBuf);
3901    CMCHKPK(oduUnpackUInt8, param->CSIRS_BRRS_TxTiming, mBuf);
3902    CMCHKPK(oduUnpackUInt8, param->CSI_BSI_BRI_Req, mBuf);
3903
3904    if(param->RBAssign <= TFU_RIV_324)
3905    {
3906       CMCHKPK(cmPkTfuRbAssignA1Val324, &param->u.rbAssignA1Val324, mBuf);
3907    }
3908    else if (param->RBAssign == TFU_RIV_326)
3909    {
3910       CMCHKPK(cmPkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
3911    }
3912
3913    CMCHKPK(oduUnpackUInt8, param->rv, mBuf);
3914    CMCHKPK(oduUnpackUInt8, param->symbIdx, mBuf);
3915    CMCHKPK(oduUnpackUInt8, param->beamIndex, mBuf);
3916    CMCHKPK(oduUnpackUInt16, param->RBAssign, mBuf);
3917    CMCHKPK(oduUnpackUInt8, param->xPUSCH_TxTiming, mBuf);
3918    CMCHKPK(oduUnpackUInt8, param->xPUSCHRange, mBuf);
3919    CMCHKPK(oduUnpackUInt8, param->formatType, mBuf);
3920    return ROK;
3921 }
3922
3923 \f
3924 /***********************************************************
3925 *
3926 *     Func : cmPkTfuDciFormatB1B2Info
3927 *
3928 *
3929 *     Desc : This structure contains the information needed to convey DCI format B1/B2.
3930 *
3931 *
3932 *     Ret  : S16
3933 *
3934 *     Notes:
3935 *
3936 *     File  : 
3937 *
3938 **********************************************************/
3939 #ifdef ANSI
3940 S16 cmPkTfuDciFormatB1B2Info
3941 (
3942 TfuDciFormatB1Info *param,
3943 Buffer *mBuf
3944 )
3945 #else
3946 S16 cmPkTfuDciFormatB1B2Info(param, mBuf)
3947 TfuDciFormatB1Info *param;
3948 Buffer *mBuf;
3949 #endif
3950 {
3951
3952
3953    CMCHKPK(oduUnpackUInt8, param->DL_PCRS, mBuf);
3954    CMCHKPK(oduUnpackUInt8, param->tpcCmd, mBuf);
3955    CMCHKPK(oduUnpackUInt8, param->SCID, mBuf);
3956
3957    CMCHKPK(oduUnpackUInt8, param->AntPorts_numLayers, mBuf);
3958    CMCHKPK(oduUnpackUInt8, param->SRS_Symbol, mBuf);
3959    CMCHKPK(oduUnpackUInt8, param->SRS_Config, mBuf);
3960    CMCHKPK(oduUnpackUInt8, param->beamSwitch, mBuf);
3961    CMCHKPK(oduUnpackUInt8, param->freqResIdx_xPUCCH, mBuf);
3962
3963    CMCHKPK(oduUnpackUInt8, param->xPUCCH_TxTiming, mBuf);
3964
3965    CMCHKPK(oduUnpackUInt8, param->numBSI_Reports, mBuf);
3966    CMCHKPK(oduUnpackUInt8, param->CSIRS_BRRS_ProcInd, mBuf);
3967    CMCHKPK(oduUnpackUInt8, param->CSI_BRRS_Indicator, mBuf);
3968    CMCHKPK(oduUnpackUInt8, param->CSIRS_BRRS_SymbIdx, mBuf);
3969    CMCHKPK(oduUnpackUInt8, param->CSIRS_BRRS_TxTiming, mBuf);
3970    CMCHKPK(oduUnpackUInt8, param->CSI_BSI_BRI_Req, mBuf);
3971
3972    if(param->RBAssign <= TFU_RIV_324)
3973    {
3974       CMCHKPK(cmPkTfuRbAssignB1Val324, &param->u.rbAssignB1Val324, mBuf);
3975    }
3976    else if (param->RBAssign == TFU_RIV_326)
3977    {
3978       CMCHKPK(cmPkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
3979    }
3980   
3981    CMCHKPK(oduUnpackUInt8, param->symbIdx, mBuf);
3982    CMCHKPK(oduUnpackUInt8, param->beamIndex, mBuf);
3983    CMCHKPK(oduUnpackUInt16, param->RBAssign, mBuf);
3984    CMCHKPK(oduUnpackUInt8, param->xPDSCHRange, mBuf);
3985    CMCHKPK(oduUnpackUInt8, param->formatType, mBuf);
3986    return ROK;
3987 }
3988
3989
3990 \f
3991 /***********************************************************
3992 *
3993 *     Func : cmUnpkTfuDciFormatA1A2Info
3994 *
3995 *
3996 *     Desc : This structure contains the information needed to convey DCI format A1/A2.
3997 *
3998 *
3999 *     Ret  : S16
4000 *
4001 *     Notes:
4002 *
4003 *     File  : 
4004 *
4005 **********************************************************/
4006 #ifdef ANSI
4007 S16 cmUnpkTfuDciFormatA1A2Info
4008 (
4009 TfuDciFormatA1Info *param,
4010 Buffer *mBuf
4011 )
4012 #else
4013 S16 cmUnpkTfuDciFormatA1A2Info(param, mBuf)
4014 TfuDciFormatA1Info *param;
4015 Buffer *mBuf;
4016 #endif
4017 {
4018
4019
4020    CMCHKUNPK(oduPackUInt8, &param->formatType, mBuf);
4021    CMCHKUNPK(oduPackUInt8, &param->xPUSCHRange, mBuf);
4022    CMCHKUNPK(oduPackUInt8, &param->xPUSCH_TxTiming, mBuf);
4023    CMCHKUNPK(oduPackUInt16, &param->RBAssign, mBuf);
4024    CMCHKUNPK(oduPackUInt8, &param->beamIndex, mBuf);
4025    CMCHKUNPK(oduPackUInt8, &param->symbIdx, mBuf);
4026    CMCHKUNPK(oduPackUInt8, &param->rv, mBuf);
4027
4028    if(param->RBAssign <= TFU_RIV_324)
4029    {
4030       CMCHKUNPK(cmUnpkTfuRbAssignA1Val324, &param->u.rbAssignA1Val324, mBuf);
4031    }
4032    else if(param->RBAssign == TFU_RIV_326)
4033    {
4034       CMCHKUNPK(cmUnpkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4035    }
4036
4037    CMCHKUNPK(oduPackUInt8, &param->CSI_BSI_BRI_Req, mBuf);
4038    CMCHKUNPK(oduPackUInt8, &param->CSIRS_BRRS_TxTiming, mBuf);
4039    CMCHKUNPK(oduPackUInt8, &param->CSIRS_BRRS_SymbIdx, mBuf);
4040    CMCHKUNPK(oduPackUInt8, &param->CSI_BRRS_Indicator, mBuf);
4041    CMCHKUNPK(oduPackUInt8, &param->CSIRS_BRRS_ProcInd, mBuf);
4042    CMCHKUNPK(oduPackUInt8, &param->numBSI_Reports, mBuf);
4043
4044    CMCHKUNPK(oduPackUInt8, &param->uciOnxPUSCH, mBuf);
4045    CMCHKUNPK(oduPackUInt8, &param->beamSwitch, mBuf);
4046    CMCHKUNPK(oduPackUInt8, &param->SRS_Config, mBuf);
4047    CMCHKUNPK(oduPackUInt8, &param->SRS_Symbol, mBuf);
4048    CMCHKUNPK(oduPackUInt8, &param->REMapIdx_DMRS_PCRS_numLayers, mBuf);
4049
4050    CMCHKUNPK(oduPackUInt8, &param->SCID, mBuf);
4051    CMCHKUNPK(oduPackUInt8, &param->PMI, mBuf);
4052    CMCHKUNPK(oduPackUInt8, &param->UL_PCRS, mBuf);
4053    CMCHKUNPK(oduPackUInt8, &param->tpcCmd, mBuf);
4054
4055    return ROK;
4056 }
4057
4058 \f
4059 /***********************************************************
4060 *
4061 *     Func : cmUnpkTfuDciFormatB1B2Info
4062 *
4063 *
4064 *     Desc : This structure contains the information needed to convey DCI format B1/B2.
4065 *
4066 *
4067 *     Ret  : S16
4068 *
4069 *     Notes:
4070 *
4071 *     File  : 
4072 *
4073 **********************************************************/
4074 #ifdef ANSI
4075 S16 cmUnpkTfuDciFormatB1B2Info
4076 (
4077 TfuDciFormatB1Info *param,
4078 Buffer *mBuf
4079 )
4080 #else
4081 S16 cmUnpkTfuDciFormatB1B2Info(param, mBuf)
4082 TfuDciFormatB1Info *param;
4083 Buffer *mBuf;
4084 #endif
4085 {
4086
4087
4088    CMCHKUNPK(oduPackUInt8, &param->formatType, mBuf);
4089    CMCHKUNPK(oduPackUInt8, &param->xPDSCHRange, mBuf);
4090    CMCHKUNPK(oduPackUInt16, &param->RBAssign, mBuf);
4091    CMCHKUNPK(oduPackUInt8, &param->beamIndex, mBuf);
4092    CMCHKUNPK(oduPackUInt8, &param->symbIdx, mBuf);
4093
4094    if(param->RBAssign <= TFU_RIV_324)
4095    {
4096       CMCHKUNPK(cmUnpkTfuRbAssignB1Val324, &param->u.rbAssignB1Val324, mBuf);
4097    }
4098    else if (param->RBAssign == TFU_RIV_326)
4099    {
4100       CMCHKUNPK(cmUnpkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4101    }
4102
4103    CMCHKUNPK(oduPackUInt8, &param->CSI_BSI_BRI_Req, mBuf);
4104    CMCHKUNPK(oduPackUInt8, &param->CSIRS_BRRS_TxTiming, mBuf);
4105    CMCHKUNPK(oduPackUInt8, &param->CSIRS_BRRS_SymbIdx, mBuf);
4106    CMCHKUNPK(oduPackUInt8, &param->CSI_BRRS_Indicator, mBuf);
4107    CMCHKUNPK(oduPackUInt8, &param->CSIRS_BRRS_ProcInd, mBuf);
4108    CMCHKUNPK(oduPackUInt8, &param->numBSI_Reports, mBuf);
4109
4110    CMCHKUNPK(oduPackUInt8, &param->xPUCCH_TxTiming, mBuf);
4111    CMCHKUNPK(oduPackUInt8, &param->freqResIdx_xPUCCH, mBuf);
4112    CMCHKUNPK(oduPackUInt8, &param->beamSwitch, mBuf);
4113    CMCHKUNPK(oduPackUInt8, &param->SRS_Config, mBuf);
4114    CMCHKUNPK(oduPackUInt8, &param->SRS_Symbol, mBuf);
4115    CMCHKUNPK(oduPackUInt8, &param->AntPorts_numLayers, mBuf);
4116    CMCHKUNPK(oduPackUInt8, &param->SCID, mBuf);
4117    CMCHKUNPK(oduPackUInt8, &param->tpcCmd, mBuf);
4118    CMCHKUNPK(oduPackUInt8, &param->DL_PCRS, mBuf);
4119
4120    return ROK;
4121 }
4122
4123
4124 #endif /* TFU_5GTF */
4125
4126 \f
4127 /***********************************************************
4128 *
4129 *     Func : cmPkTfuDciFormat0Info
4130 *
4131 *
4132 *     Desc : This structure contains the information needed to convey DCI format 0.
4133 *
4134 *
4135 *     Ret  : S16
4136 *
4137 *     Notes:
4138 *
4139 *     File  : 
4140 *
4141 **********************************************************/
4142 #ifdef ANSI
4143 S16 cmPkTfuDciFormat0Info
4144 (
4145 TfuDciFormat0Info *param,
4146 Buffer *mBuf
4147 )
4148 #else
4149 S16 cmPkTfuDciFormat0Info(param, mBuf)
4150 TfuDciFormat0Info *param;
4151 Buffer *mBuf;
4152 #endif
4153 {
4154
4155
4156    /* tfu_c_001.main_3: Adding pack for hqProcId */
4157    CMCHKPK(oduUnpackUInt8, param->hqProcId, mBuf);
4158    CMCHKPK(oduUnpackUInt8, param->txAntenna, mBuf);
4159    CMCHKPK(oduUnpackUInt8, param->numCqiBit, mBuf);
4160    CMCHKPK(oduUnpackUInt8, param->cqiReq, mBuf);
4161    CMCHKPK(oduUnpackUInt8, param->nDmrs, mBuf);
4162
4163 #ifdef TFU_TDD
4164    CMCHKPK(oduUnpackUInt8, param->dai, mBuf);
4165    CMCHKPK(oduUnpackUInt8, param->ulIdx, mBuf);
4166
4167 #endif
4168    CMCHKPK(oduUnpackUInt8, param->tpcCmd, mBuf);
4169    CMCHKPK(oduUnpackUInt8, param->ndi, mBuf);
4170    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
4171    CMCHKPK(oduUnpackUInt8, param->hoppingBits, mBuf);
4172 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
4173 #ifdef TFU_UPGRADE
4174    CMCHKPK(oduUnpackUInt32, param->riv, mBuf);
4175 #endif
4176    CMCHKPK(oduUnpackUInt8, param->numRb, mBuf);
4177    CMCHKPK(oduUnpackUInt8, param->rbStart, mBuf);
4178    CMCHKPK(oduUnpackUInt8, param->hoppingEnbld, mBuf);
4179    return ROK;
4180 }
4181
4182
4183 \f
4184 /***********************************************************
4185 *
4186 *     Func : cmUnpkTfuDciFormat0Info
4187 *
4188 *
4189 *     Desc : This structure contains the information needed to convey DCI format 0.
4190 *
4191 *
4192 *     Ret  : S16
4193 *
4194 *     Notes:
4195 *
4196 *     File  : 
4197 *
4198 **********************************************************/
4199 #ifdef ANSI
4200 S16 cmUnpkTfuDciFormat0Info
4201 (
4202 TfuDciFormat0Info *param,
4203 Buffer *mBuf
4204 )
4205 #else
4206 S16 cmUnpkTfuDciFormat0Info(param, mBuf)
4207 TfuDciFormat0Info *param;
4208 Buffer *mBuf;
4209 #endif
4210 {
4211
4212
4213    CMCHKUNPK(oduPackUInt8, &param->hoppingEnbld, mBuf);
4214    CMCHKUNPK(oduPackUInt8, &param->rbStart, mBuf);
4215    CMCHKUNPK(oduPackUInt8, &param->numRb, mBuf);
4216 #ifdef TFU_UPGRADE
4217    CMCHKUNPK(oduPackUInt32, &param->riv, mBuf);
4218 #endif /* TFU_UPGRADE */
4219    CMCHKUNPK(oduPackUInt8, &param->hoppingBits, mBuf);
4220    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
4221    CMCHKUNPK(oduPackUInt8, &param->ndi, mBuf);
4222    CMCHKUNPK(oduPackUInt8, &param->tpcCmd, mBuf);
4223
4224 #ifdef TFU_TDD
4225    CMCHKUNPK(oduPackUInt8, &param->ulIdx, mBuf);
4226    CMCHKUNPK(oduPackUInt8, &param->dai, mBuf);
4227
4228 #endif
4229    CMCHKUNPK(oduPackUInt8, &param->nDmrs, mBuf);
4230    CMCHKUNPK(oduPackUInt8, &param->cqiReq, mBuf);
4231    CMCHKUNPK(oduPackUInt8, &param->numCqiBit, mBuf);
4232    CMCHKUNPK(oduPackUInt8, &param->txAntenna, mBuf);
4233    /* tfu_c_001.main_3: Adding unpack for hqProcId */
4234    CMCHKUNPK(oduPackUInt8, &param->hqProcId, mBuf);
4235
4236    return ROK;
4237 }
4238
4239
4240 \f
4241 /***********************************************************
4242 *
4243 *     Func : cmPkTfuAllocMapOrRiv
4244 *
4245 *
4246 *     Desc : This Structure could either contain a resource allocation bit map OR a
4247  * RIV Value as defined in 213 - 7.1.6.
4248 *
4249 *
4250 *     Ret  : S16
4251 *
4252 *     Notes:
4253 *
4254 *     File  : 
4255 *
4256 **********************************************************/
4257 #ifdef ANSI
4258 S16 cmPkTfuAllocMapOrRiv
4259 (
4260 TfuAllocMapOrRiv *param,
4261 Buffer *mBuf
4262 )
4263 #else
4264 S16 cmPkTfuAllocMapOrRiv(param, mBuf)
4265 TfuAllocMapOrRiv *param;
4266 Buffer *mBuf;
4267 #endif
4268 {
4269
4270    S32 i;
4271
4272       switch(param->type) {
4273       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4274 #ifdef TFU_RESMAP_CHANGE
4275          case UnKnown:
4276             CMCHKPK(cmPkTfuAllocMap, &param->u.allocMap, mBuf);
4277             break;
4278    
4279 #endif
4280    
4281       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4282 #ifndef TFU_RESMAP_CHANGE
4283          case TFU_ALLOC_TYPE_MAP:
4284             for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4285                CMCHKPK(oduUnpackUInt8, param->u.resAllocMap[i], mBuf);
4286             }
4287             break;
4288    
4289 #endif
4290          case TFU_ALLOC_TYPE_RIV:
4291             CMCHKPK(oduUnpackUInt32, param->u.riv, mBuf);
4292             break;
4293          default :
4294             return RFAILED;
4295       }
4296    CMCHKPK(oduUnpackUInt32, param->type, mBuf);
4297    return ROK;
4298 }
4299
4300
4301 \f
4302 /***********************************************************
4303 *
4304 *     Func : cmUnpkTfuAllocMapOrRiv
4305 *
4306 *
4307 *     Desc : This Structure could either contain a resource allocation bit map OR a
4308  * RIV Value as defined in 213 - 7.1.6.
4309 *
4310 *
4311 *     Ret  : S16
4312 *
4313 *     Notes:
4314 *
4315 *     File  : 
4316 *
4317 **********************************************************/
4318 #ifdef ANSI
4319 S16 cmUnpkTfuAllocMapOrRiv
4320 (
4321 TfuAllocMapOrRiv *param,
4322 Buffer *mBuf
4323 )
4324 #else
4325 S16 cmUnpkTfuAllocMapOrRiv(param, mBuf)
4326 TfuAllocMapOrRiv *param;
4327 Buffer *mBuf;
4328 #endif
4329 {
4330
4331    S32 i;
4332
4333    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->type, mBuf);
4334       switch(param->type) {
4335          case TFU_ALLOC_TYPE_RIV:
4336             CMCHKUNPK(oduPackUInt32, &param->u.riv, mBuf);
4337             break;
4338    
4339       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4340 #ifndef TFU_RESMAP_CHANGE
4341          case TFU_ALLOC_TYPE_MAP:
4342             for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
4343                CMCHKUNPK(oduPackUInt8, &param->u.resAllocMap[i], mBuf);
4344             }
4345             break;
4346    
4347 #endif
4348    
4349       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4350 #ifdef TFU_RESMAP_CHANGE
4351          case UnKnown:
4352             CMCHKUNPK(cmUnpkTfuAllocMap, &param->u.allocMap, mBuf);
4353             break;
4354    
4355 #endif
4356          default :
4357             return RFAILED;
4358       }
4359    return ROK;
4360 }
4361
4362
4363 \f
4364 /***********************************************************
4365 *
4366 *     Func : cmPkTfuDciFormat1AllocInfo
4367 *
4368 *
4369 *     Desc : This structure contains only the allocation information, thats part
4370  * of DCI format 1. 
4371  * @details Allocation information also contains parameters necessary
4372  * for Physical layer to process Downlink Data. This structure accompanies the
4373  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4374  * @sa TfuDciFormat1Info
4375 *
4376 *
4377 *     Ret  : S16
4378 *
4379 *     Notes:
4380 *
4381 *     File  : 
4382 *
4383 **********************************************************/
4384 #ifdef ANSI
4385 S16 cmPkTfuDciFormat1AllocInfo
4386 (
4387 TfuDciFormat1AllocInfo *param,
4388 Buffer *mBuf
4389 )
4390 #else
4391 S16 cmPkTfuDciFormat1AllocInfo(param, mBuf)
4392 TfuDciFormat1AllocInfo *param;
4393 Buffer *mBuf;
4394 #endif
4395 {
4396
4397    S32 i;
4398
4399    CMCHKPK(oduUnpackUInt8, param->rv, mBuf);
4400    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
4401    CMCHKPK(oduUnpackUInt8, param->ndi, mBuf);
4402    CMCHKPK(oduUnpackUInt8, param->harqProcId, mBuf);
4403    for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4404       CMCHKPK(oduUnpackUInt8, param->resAllocMap[i], mBuf);
4405    }
4406    CMCHKPK(oduUnpackUInt8, param->isAllocType0, mBuf);
4407    return ROK;
4408 }
4409
4410
4411 \f
4412 /***********************************************************
4413 *
4414 *     Func : cmUnpkTfuDciFormat1AllocInfo
4415 *
4416 *
4417 *     Desc : This structure contains only the allocation information, thats part
4418  * of DCI format 1. 
4419  * @details Allocation information also contains parameters necessary
4420  * for Physical layer to process Downlink Data. This structure accompanies the
4421  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4422  * @sa TfuDciFormat1Info
4423 *
4424 *
4425 *     Ret  : S16
4426 *
4427 *     Notes:
4428 *
4429 *     File  : 
4430 *
4431 **********************************************************/
4432 #ifdef ANSI
4433 S16 cmUnpkTfuDciFormat1AllocInfo
4434 (
4435 TfuDciFormat1AllocInfo *param,
4436 Buffer *mBuf
4437 )
4438 #else
4439 S16 cmUnpkTfuDciFormat1AllocInfo(param, mBuf)
4440 TfuDciFormat1AllocInfo *param;
4441 Buffer *mBuf;
4442 #endif
4443 {
4444
4445    S32 i;
4446
4447    CMCHKUNPK(oduPackUInt8, &param->isAllocType0, mBuf);
4448    for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
4449       CMCHKUNPK(oduPackUInt8, &param->resAllocMap[i], mBuf);
4450    }
4451    CMCHKUNPK(oduPackUInt8, &param->harqProcId, mBuf);
4452    CMCHKUNPK(oduPackUInt8, &param->ndi, mBuf);
4453    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
4454    CMCHKUNPK(oduPackUInt8, &param->rv, mBuf);
4455    return ROK;
4456 }
4457
4458 \f
4459 /***********************************************************
4460 *
4461 *     Func : cmPkTfuDciFormat1Info
4462 *
4463 *
4464 *     Desc : This structure contains the information needed to convey DCI format 1.
4465  * @details Allocation information is separated from the other control
4466  * information carried in this format. This separation is needed as Data shall
4467  * also carry some control information, essentially allocation information,
4468  * along with it, in order to aid physical layer processing of the data.
4469 *
4470 *
4471 *     Ret  : S16
4472 *
4473 *     Notes:
4474 *
4475 *     File  : 
4476 *
4477 **********************************************************/
4478 #ifdef ANSI
4479 S16 cmPkTfuDciFormat1Info
4480 (
4481 TfuDciFormat1Info *param,
4482 Buffer *mBuf
4483 )
4484 #else
4485 S16 cmPkTfuDciFormat1Info(param, mBuf)
4486 TfuDciFormat1Info *param;
4487 Buffer *mBuf;
4488 #endif
4489 {
4490
4491
4492    CMCHKPK(oduUnpackUInt8, param->tpcCmd, mBuf);
4493
4494 #ifdef TFU_TDD
4495    CMCHKPK(oduUnpackUInt8, param->dai, mBuf);
4496
4497 #endif
4498    CMCHKPK(cmPkTfuDciFormat1AllocInfo, &param->allocInfo, mBuf);
4499    return ROK;
4500 }
4501
4502
4503 \f
4504 /***********************************************************
4505 *
4506 *     Func : cmUnpkTfuDciFormat1Info
4507 *
4508 *
4509 *     Desc : This structure contains the information needed to convey DCI format 1.
4510  * @details Allocation information is separated from the other control
4511  * information carried in this format. This separation is needed as Data shall
4512  * also carry some control information, essentially allocation information,
4513  * along with it, in order to aid physical layer processing of the data.
4514 *
4515 *
4516 *     Ret  : S16
4517 *
4518 *     Notes:
4519 *
4520 *     File  : 
4521 *
4522 **********************************************************/
4523 #ifdef ANSI
4524 S16 cmUnpkTfuDciFormat1Info
4525 (
4526 TfuDciFormat1Info *param,
4527 Buffer *mBuf
4528 )
4529 #else
4530 S16 cmUnpkTfuDciFormat1Info(param, mBuf)
4531 TfuDciFormat1Info *param;
4532 Buffer *mBuf;
4533 #endif
4534 {
4535
4536
4537    CMCHKUNPK(cmUnpkTfuDciFormat1AllocInfo, &param->allocInfo, mBuf);
4538
4539 #ifdef TFU_TDD
4540    CMCHKUNPK(oduPackUInt8, &param->dai, mBuf);
4541
4542 #endif
4543    CMCHKUNPK(oduPackUInt8, &param->tpcCmd, mBuf);
4544    return ROK;
4545 }
4546
4547
4548 \f
4549 /***********************************************************
4550 *
4551 *     Func : cmPkTfuDciFormat2AAllocInfo
4552 *
4553 *
4554 *     Desc : This structure contains only the allocation information, that is part
4555   * of DCI format 2A. 
4556   * @details Allocation information also contains parameters necessary
4557   * for Physical layer to process Downlink data. This structure accompanies the
4558   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4559   * @sa TfuDciFormat2AInfo
4560 *
4561 *
4562 *     Ret  : S16
4563 *
4564 *     Notes:
4565 *
4566 *     File  : 
4567 *
4568 **********************************************************/
4569 #ifdef ANSI
4570 S16 cmPkTfuDciFormat2AAllocInfo
4571 (
4572 TfuDciFormat2AAllocInfo *param,
4573 Buffer *mBuf
4574 )
4575 #else
4576 S16 cmPkTfuDciFormat2AAllocInfo(param, mBuf)
4577 TfuDciFormat2AAllocInfo *param;
4578 Buffer *mBuf;
4579 #endif
4580 {
4581
4582    S32 i;
4583
4584    CMCHKPK(oduUnpackUInt8, param->transSwap, mBuf);
4585    CMCHKPK(oduUnpackUInt8, param->precoding, mBuf);
4586
4587    for (i=1; i >= 0; i--) {
4588       CMCHKPK(cmPkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
4589    }
4590
4591    CMCHKPK(oduUnpackUInt8, param->harqProcId, mBuf);
4592    for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4593       CMCHKPK(oduUnpackUInt8, param->resAllocMap[i], mBuf);
4594    }
4595
4596    CMCHKPK(oduUnpackUInt8, param->isAllocType0, mBuf);
4597
4598    return ROK;
4599 }
4600
4601
4602 \f
4603 /***********************************************************
4604 *
4605 *     Func : cmUnpkTfuDciFormat2AAllocInfo
4606 *
4607 *
4608 *     Desc : This structure contains only the allocation information, that is part
4609   * of DCI format 2A. 
4610   * @details Allocation information also contains parameters necessary
4611   * for Physical layer to process Downlink data. This structure accompanies the
4612   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4613   * @sa TfuDciFormat2AInfo
4614 *
4615 *
4616 *     Ret  : S16
4617 *
4618 *     Notes:
4619 *
4620 *     File  : 
4621 *
4622 **********************************************************/
4623 #ifdef ANSI
4624 S16 cmUnpkTfuDciFormat2AAllocInfo
4625 (
4626 TfuDciFormat2AAllocInfo *param,
4627 Buffer *mBuf
4628 )
4629 #else
4630 S16 cmUnpkTfuDciFormat2AAllocInfo(param, mBuf)
4631 TfuDciFormat2AAllocInfo *param;
4632 Buffer *mBuf;
4633 #endif
4634 {
4635
4636    S32 i;
4637
4638
4639 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4640 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4641    CMCHKUNPK(oduPackUInt8, &param->isAllocType0, mBuf);
4642
4643
4644 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4645 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4646    for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
4647       CMCHKUNPK(oduPackUInt8, &param->resAllocMap[i], mBuf);
4648    }
4649    CMCHKUNPK(oduPackUInt8, &param->harqProcId, mBuf);
4650
4651 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4652 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4653
4654 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4655 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4656    for (i=0; i<=1; i++) {
4657       CMCHKUNPK(cmUnpkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
4658    }
4659
4660    CMCHKUNPK(oduPackUInt8, &param->precoding, mBuf);
4661    CMCHKUNPK(oduPackUInt8, &param->transSwap, mBuf);
4662    return ROK;
4663 }
4664
4665 #ifdef EMTC_ENABLE
4666 /***********************************************************
4667 *
4668 *     Func : cmPkTfuDciFormat6AAllocInfo
4669 *
4670 *
4671 *     Desc : This structure contains only the allocation information, that is part
4672   * of DCI format 6-1A. 
4673   * @details Allocation information also contains parameters necessary
4674   * for Physical layer to process Downlink data. This structure accompanies the
4675   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4676   * @sa TfuDciFormat61aInfo
4677 *
4678 *
4679 *     Ret  : S16
4680 *
4681 *     Notes:
4682 *
4683 *     File  : 
4684 *
4685 **********************************************************/
4686 #ifdef ANSI
4687 S16 cmPkTfuDciFormat6AAllocInfo
4688 (
4689 TfuDciFormat61AllocInfo *param,
4690 Buffer *mBuf
4691 )
4692 #else
4693 S16 cmPkTfuDciFormat6AAllocInfo(param, mBuf)
4694 TfuDciFormat61AllocInfo *param;
4695 Buffer *mBuf;
4696 #endif
4697 {
4698
4699
4700    CMCHKPK(oduUnpackUInt8, param->rv, mBuf);
4701    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
4702    CMCHKPK(oduUnpackUInt8, param->ndi, mBuf);
4703    CMCHKPK(oduUnpackUInt8, param->harqProcId, mBuf);
4704    CMCHKPK(oduUnpackUInt32, param->riv, mBuf);
4705
4706    return ROK;
4707 }
4708
4709
4710 \f
4711 /***********************************************************
4712 *
4713 *     Func : cmUnpkTfuDciFormat6AAllocInfo
4714 *
4715 *
4716 *     Desc : This structure contains only the allocation information, that is part
4717   * of DCI format 6-1A. 
4718   * @details Allocation information also contains parameters necessary
4719   * for Physical layer to process Downlink data. This structure accompanies the
4720   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4721   * @sa TfuDciFormat61aInfo
4722 *
4723 *
4724 *     Ret  : S16
4725 *
4726 *     Notes:
4727 *
4728 *     File  : 
4729 *
4730 **********************************************************/
4731 #ifdef ANSI
4732 S16 cmUnpkTfuDciFormat6AAllocInfo
4733 (
4734 TfuDciFormat61AllocInfo *param,
4735 Buffer *mBuf
4736 )
4737 #else
4738 S16 cmUnpkTfuDciFormat6AAllocInfo(param, mBuf)
4739 TfuDciFormat61AllocInfo *param;
4740 Buffer *mBuf;
4741 #endif
4742 {
4743
4744
4745    CMCHKUNPK(oduPackUInt32, &param->riv, mBuf);
4746    CMCHKUNPK(oduPackUInt8, &param->harqProcId, mBuf);
4747    CMCHKUNPK(oduPackUInt8, &param->ndi, mBuf);
4748    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
4749    CMCHKUNPK(oduPackUInt8, &param->rv, mBuf);
4750    printf("In cmUnpkTfuDciFormat6AAllocInfo :: Passed \n");
4751    return ROK;
4752 }
4753 #endif
4754
4755
4756 \f
4757 /***********************************************************
4758 *
4759 *     Func : cmPkTfuDciFormat2AInfo
4760 *
4761 *
4762 *     Desc : This structure contains the information carried by DCI format 2A. 
4763  * @details It carries the allocation information and other control information.
4764 *
4765 *
4766 *     Ret  : S16
4767 *
4768 *     Notes:
4769 *
4770 *     File  : 
4771 *
4772 **********************************************************/
4773 #ifdef ANSI
4774 S16 cmPkTfuDciFormat2AInfo
4775 (
4776 TfuDciFormat2AInfo *param,
4777 Buffer *mBuf
4778 )
4779 #else
4780 S16 cmPkTfuDciFormat2AInfo(param, mBuf)
4781 TfuDciFormat2AInfo *param;
4782 Buffer *mBuf;
4783 #endif
4784 {
4785
4786
4787    CMCHKPK(oduUnpackUInt8, param->tpcCmd, mBuf);
4788
4789 #ifdef TFU_TDD
4790    CMCHKPK(oduUnpackUInt8, param->dai, mBuf);
4791
4792 #endif
4793    CMCHKPK(cmPkTfuDciFormat2AAllocInfo, &param->allocInfo, mBuf);
4794    return ROK;
4795 }
4796
4797
4798 \f
4799 /***********************************************************
4800 *
4801 *     Func : cmUnpkTfuDciFormat2AInfo
4802 *
4803 *
4804 *     Desc : This structure contains the information carried by DCI format 2A. 
4805  * @details It carries the allocation information and other control information.
4806 *
4807 *
4808 *     Ret  : S16
4809 *
4810 *     Notes:
4811 *
4812 *     File  : 
4813 *
4814 **********************************************************/
4815 #ifdef ANSI
4816 S16 cmUnpkTfuDciFormat2AInfo
4817 (
4818 TfuDciFormat2AInfo *param,
4819 Buffer *mBuf
4820 )
4821 #else
4822 S16 cmUnpkTfuDciFormat2AInfo(param, mBuf)
4823 TfuDciFormat2AInfo *param;
4824 Buffer *mBuf;
4825 #endif
4826 {
4827
4828
4829    CMCHKUNPK(cmUnpkTfuDciFormat2AAllocInfo, &param->allocInfo, mBuf);
4830
4831 #ifdef TFU_TDD
4832    CMCHKUNPK(oduPackUInt8, &param->dai, mBuf);
4833
4834 #endif
4835    CMCHKUNPK(oduPackUInt8, &param->tpcCmd, mBuf);
4836    return ROK;
4837 }
4838
4839
4840 \f
4841 /***********************************************************
4842 *
4843 *     Func : cmPkTfuDciFormat2AllocInfo
4844 *
4845 *
4846 *     Desc : This structure contains only the allocation information, that is part
4847   * of DCI format 2. 
4848   * @details Allocation information also contains parameters necessary
4849   * for Physical layer to process Downlink data. This structure accompanies the
4850   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4851   * @sa TfuDciFormat2Info
4852 *
4853 *
4854 *     Ret  : S16
4855 *
4856 *     Notes:
4857 *
4858 *     File  : 
4859 *
4860 **********************************************************/
4861 #ifdef ANSI
4862 S16 cmPkTfuDciFormat2AllocInfo
4863 (
4864 TfuDciFormat2AllocInfo *param,
4865 Buffer *mBuf
4866 )
4867 #else
4868 S16 cmPkTfuDciFormat2AllocInfo(param, mBuf)
4869 TfuDciFormat2AllocInfo *param;
4870 Buffer *mBuf;
4871 #endif
4872 {
4873
4874    S32 i;
4875
4876
4877 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4878 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4879    for (i=1; i >= 0; i--) {
4880       CMCHKPK(cmPkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
4881    }
4882    CMCHKPK(oduUnpackUInt8, param->harqProcId, mBuf);
4883
4884    CMCHKPK(oduUnpackUInt8, param->precoding, mBuf);
4885    CMCHKPK(oduUnpackUInt8, param->transSwap, mBuf);
4886
4887 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4888 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4889
4890 #ifdef TFU_TDD
4891    CMCHKPK(oduUnpackUInt8, param->dai, mBuf);
4892
4893 #endif
4894    for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4895       CMCHKPK(oduUnpackUInt8, param->resAllocMap[i], mBuf);
4896    }
4897
4898 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4899 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4900
4901 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4902 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4903    CMCHKPK(oduUnpackUInt8, param->isAllocType0, mBuf);
4904
4905    return ROK;
4906 }
4907
4908
4909 \f
4910 /***********************************************************
4911 *
4912 *     Func : cmUnpkTfuDciFormat2AllocInfo
4913 *
4914 *
4915 *     Desc : This structure contains only the allocation information, that is part
4916   * of DCI format 2. 
4917   * @details Allocation information also contains parameters necessary
4918   * for Physical layer to process Downlink data. This structure accompanies the
4919   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4920   * @sa TfuDciFormat2Info
4921 *
4922 *
4923 *     Ret  : S16
4924 *
4925 *     Notes:
4926 *
4927 *     File  : 
4928 *
4929 **********************************************************/
4930 #ifdef ANSI
4931 S16 cmUnpkTfuDciFormat2AllocInfo
4932 (
4933 TfuDciFormat2AllocInfo *param,
4934 Buffer *mBuf
4935 )
4936 #else
4937 S16 cmUnpkTfuDciFormat2AllocInfo(param, mBuf)
4938 TfuDciFormat2AllocInfo *param;
4939 Buffer *mBuf;
4940 #endif
4941 {
4942
4943    S32 i;
4944
4945
4946 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4947 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4948    CMCHKUNPK(oduPackUInt8, &param->isAllocType0, mBuf);
4949
4950
4951 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4952 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4953    for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
4954       CMCHKUNPK(oduPackUInt8, &param->resAllocMap[i], mBuf);
4955    }
4956
4957 #ifdef TFU_TDD
4958    CMCHKUNPK(oduPackUInt8, &param->dai, mBuf);
4959
4960 #endif
4961
4962 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4963 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4964    CMCHKUNPK(oduPackUInt8, &param->transSwap, mBuf);
4965    CMCHKUNPK(oduPackUInt8, &param->precoding, mBuf);
4966
4967 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4968 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4969    CMCHKUNPK(oduPackUInt8, &param->harqProcId, mBuf);
4970    for (i=0; i<=1; i++) {
4971       CMCHKUNPK(cmUnpkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
4972    }
4973
4974    return ROK;
4975 }
4976
4977
4978 \f
4979 /***********************************************************
4980 *
4981 *     Func : cmPkTfuDciFormat2Info
4982 *
4983 *
4984 *     Desc : This structure contains the information carried by DCI format 2.
4985  * @details Allocation information is separated from the other control
4986  * information carried in this format. This separation is needed as Data must
4987  * also carry some control information, essentially, allocation information
4988  * along with it, in order to aid physical layer processing of the data.
4989 *
4990 *
4991 *     Ret  : S16
4992 *
4993 *     Notes:
4994 *
4995 *     File  : 
4996 *
4997 **********************************************************/
4998 #ifdef ANSI
4999 S16 cmPkTfuDciFormat2Info
5000 (
5001 TfuDciFormat2Info *param,
5002 Buffer *mBuf
5003 )
5004 #else
5005 S16 cmPkTfuDciFormat2Info(param, mBuf)
5006 TfuDciFormat2Info *param;
5007 Buffer *mBuf;
5008 #endif
5009 {
5010
5011
5012
5013 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5014 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5015
5016 #ifdef TFU_TDD
5017    CMCHKPK(oduUnpackUInt8, param->dai, mBuf);
5018
5019 #endif
5020
5021    CMCHKPK(oduUnpackUInt8, param->tpcCmd, mBuf);
5022
5023 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5024 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5025    CMCHKPK(cmPkTfuDciFormat2AllocInfo, &param->allocInfo, mBuf);
5026    return ROK;
5027 }
5028
5029
5030 \f
5031 /***********************************************************
5032 *
5033 *     Func : cmUnpkTfuDciFormat2Info
5034 *
5035 *
5036 *     Desc : This structure contains the information carried by DCI format 2.
5037  * @details Allocation information is separated from the other control
5038  * information carried in this format. This separation is needed as Data must
5039  * also carry some control information, essentially, allocation information
5040  * along with it, in order to aid physical layer processing of the data.
5041 *
5042 *
5043 *     Ret  : S16
5044 *
5045 *     Notes:
5046 *
5047 *     File  : 
5048 *
5049 **********************************************************/
5050 #ifdef ANSI
5051 S16 cmUnpkTfuDciFormat2Info
5052 (
5053 TfuDciFormat2Info *param,
5054 Buffer *mBuf
5055 )
5056 #else
5057 S16 cmUnpkTfuDciFormat2Info(param, mBuf)
5058 TfuDciFormat2Info *param;
5059 Buffer *mBuf;
5060 #endif
5061 {
5062
5063
5064    CMCHKUNPK(cmUnpkTfuDciFormat2AllocInfo, &param->allocInfo, mBuf);
5065
5066 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5067 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5068    CMCHKUNPK(oduPackUInt8, &param->tpcCmd, mBuf);
5069
5070 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5071 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5072
5073 #ifdef TFU_TDD
5074    CMCHKUNPK(oduPackUInt8, &param->dai, mBuf);
5075
5076 #endif
5077
5078    return ROK;
5079 }
5080
5081
5082 \f
5083 /***********************************************************
5084 *
5085 *     Func : cmPkTfuDciFormat3Info
5086 *
5087 *
5088 *     Desc : This structure contains the information carried in DCI format 3.
5089 *
5090 *
5091 *     Ret  : S16
5092 *
5093 *     Notes:
5094 *
5095 *     File  : 
5096 *
5097 **********************************************************/
5098 #ifdef ANSI
5099 S16 cmPkTfuDciFormat3Info
5100 (
5101 TfuDciFormat3Info *param,
5102 Buffer *mBuf
5103 )
5104 #else
5105 S16 cmPkTfuDciFormat3Info(param, mBuf)
5106 TfuDciFormat3Info *param;
5107 Buffer *mBuf;
5108 #endif
5109 {
5110
5111    S32 i;
5112
5113    CMCHKPK(oduUnpackUInt8, param->isPucch, mBuf);
5114    for (i=TFU_MAX_2BIT_TPC-1; i >= 0; i--) {
5115       CMCHKPK(oduUnpackUInt8, param->tpcCmd[i], mBuf);
5116    }
5117    return ROK;
5118 }
5119
5120
5121 \f
5122 /***********************************************************
5123 *
5124 *     Func : cmUnpkTfuDciFormat3Info
5125 *
5126 *
5127 *     Desc : This structure contains the information carried in DCI format 3.
5128 *
5129 *
5130 *     Ret  : S16
5131 *
5132 *     Notes:
5133 *
5134 *     File  : 
5135 *
5136 **********************************************************/
5137 #ifdef ANSI
5138 S16 cmUnpkTfuDciFormat3Info
5139 (
5140 TfuDciFormat3Info *param,
5141 Buffer *mBuf
5142 )
5143 #else
5144 S16 cmUnpkTfuDciFormat3Info(param, mBuf)
5145 TfuDciFormat3Info *param;
5146 Buffer *mBuf;
5147 #endif
5148 {
5149
5150    S32 i;
5151
5152    for (i=0; i<TFU_MAX_2BIT_TPC; i++) {
5153       CMCHKUNPK(oduPackUInt8, &param->tpcCmd[i], mBuf);
5154    }
5155    CMCHKUNPK(oduPackUInt8, &param->isPucch, mBuf);
5156    return ROK;
5157 }
5158
5159
5160 \f
5161 /***********************************************************
5162 *
5163 *     Func : cmPkTfuDciFormat3AInfo
5164 *
5165 *
5166 *     Desc : This structure contains the information carried by DCI format 3A.
5167 *
5168 *
5169 *     Ret  : S16
5170 *
5171 *     Notes:
5172 *
5173 *     File  : 
5174 *
5175 **********************************************************/
5176 #ifdef ANSI
5177 S16 cmPkTfuDciFormat3AInfo
5178 (
5179 TfuDciFormat3AInfo *param,
5180 Buffer *mBuf
5181 )
5182 #else
5183 S16 cmPkTfuDciFormat3AInfo(param, mBuf)
5184 TfuDciFormat3AInfo *param;
5185 Buffer *mBuf;
5186 #endif
5187 {
5188
5189    S32 i;
5190    CMCHKPK(oduUnpackUInt8, param->isPucch, mBuf);
5191    for (i=TFU_MAX_2BIT_TPC-1; i >= 0; i--) {
5192       CMCHKPK(oduUnpackUInt8, param->tpcCmd[i], mBuf);
5193    }
5194    return ROK;
5195 }
5196
5197
5198 \f
5199 /***********************************************************
5200 *
5201 *     Func : cmUnpkTfuDciFormat3AInfo
5202 *
5203 *
5204 *     Desc : This structure contains the information carried by DCI format 3A.
5205 *
5206 *
5207 *     Ret  : S16
5208 *
5209 *     Notes:
5210 *
5211 *     File  : 
5212 *
5213 **********************************************************/
5214 #ifdef ANSI
5215 S16 cmUnpkTfuDciFormat3AInfo
5216 (
5217 TfuDciFormat3AInfo *param,
5218 Buffer *mBuf
5219 )
5220 #else
5221 S16 cmUnpkTfuDciFormat3AInfo(param, mBuf)
5222 TfuDciFormat3AInfo *param;
5223 Buffer *mBuf;
5224 #endif
5225 {
5226
5227    S32 i;
5228
5229    for (i=0; i<TFU_MAX_2BIT_TPC; i++) {
5230       CMCHKUNPK(oduPackUInt8, &param->tpcCmd[i], mBuf);
5231    }
5232    CMCHKUNPK(oduPackUInt8, &param->isPucch, mBuf);
5233    return ROK;
5234 }
5235
5236 #ifdef EMTC_ENABLE
5237
5238
5239 /***********************************************************
5240 *
5241 *     Func : cmPkTfuDciFormat60aInfo 
5242 *
5243 *
5244 *     Desc : This structure contains the information that is carried in DCI
5245   * format 6-0A
5246 *
5247 *
5248 *     Ret  : S16
5249 *
5250 *     Notes:
5251 *
5252 *     File  :
5253 *
5254 ************************************************************/
5255
5256 #ifdef ANSI
5257 PRIVATE S16 cmPkTfuDciFormat60aInfo
5258 (
5259 TfuDciFormat60aInfo *param,
5260 Buffer *mBuf
5261 )
5262 #else
5263 PRIVATE S16 cmPkTfuDciFormat60aInfo(param, mBuf)
5264 TfuDciFormat60aInfo *param;
5265 Buffer *mBuf;
5266 #endif
5267 {
5268
5269
5270    CMCHKPK(oduUnpackUInt8, param->dciRep, mBuf);
5271    CMCHKPK(oduUnpackUInt8, param->isSrs, mBuf);
5272    CMCHKPK(oduUnpackUInt8, param->cqiReq, mBuf);
5273 #ifdef TFU_TDD
5274    CMCHKPK(oduUnpackUInt8, param->dai, mBuf);
5275    CMCHKPK(oduUnpackUInt8, param->ulIdx, mBuf);
5276 #endif
5277    CMCHKPK(oduUnpackUInt8, param->tpcCmd, mBuf);
5278    CMCHKPK(oduUnpackUInt8, param->rv, mBuf);
5279    CMCHKPK(oduUnpackUInt8, param->ndi, mBuf);
5280    CMCHKPK(oduUnpackUInt8, param->hqProcId, mBuf);
5281    CMCHKPK(oduUnpackUInt8, param->rep, mBuf);
5282    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
5283    CMCHKPK(oduUnpackUInt32, param->riv, mBuf);
5284    CMCHKPK(oduUnpackUInt8, param->hoppingEnbld, mBuf);
5285    return ROK;
5286 }
5287 /***********************************************************
5288 *
5289 *     Func : cmPkTfuPdcchOrderInfoEmtc
5290 *
5291 *
5292 *     Desc : This structure contains the information that is carried in DCI
5293   * format 6-1A in the case of a PDCCH order.
5294 *
5295 *
5296 *     Ret  : S16
5297 *
5298 *     Notes:
5299 *
5300 *     File  : 
5301 *
5302 **********************************************************/
5303 #ifdef ANSI
5304 PRIVATE S16 cmPkTfuPdcchOrderInfoEmtc
5305 (
5306 TfuPdcchOrderInfoEmtc *param,
5307 Buffer *mBuf
5308 )
5309 #else
5310 PRIVATE S16 cmPkTfuPdcchOrderInfoEmtc(param, mBuf)
5311 TfuPdcchOrderInfoEmtc *param;
5312 Buffer *mBuf;
5313 #endif
5314 {
5315
5316
5317    CMCHKPK(oduUnpackUInt8, param->ceLevel, mBuf);
5318    CMCHKPK(oduUnpackUInt8, param->prachMaskIdx, mBuf);
5319    CMCHKPK(oduUnpackUInt8, param->preambleIdx, mBuf);
5320    CMCHKPK(oduUnpackUInt32, param->riv, mBuf);
5321    return ROK;
5322 }
5323
5324 /***********************************************************
5325 *
5326 *     Func : cmPkTfudciformat61aPdsch
5327 *
5328 *
5329 *     Desc : This structure contains the information carried in DCI format 6-1A
5330   * when it is NOT used for a PDCCH order.
5331 *
5332 *
5333 *     Ret  : S16
5334 *
5335 *     Notes:
5336 *
5337 *     File  : 
5338 *
5339 **********************************************************/
5340 #ifdef ANSI
5341 PRIVATE S16 cmPkTfudciformat61aPdsch
5342 (
5343 Tfudciformat61aPdsch *param,
5344 Buffer *mBuf
5345 )
5346 #else
5347 PRIVATE S16 cmPkTfudciformat61aPdsch(param, mBuf)
5348 Tfudciformat61aPdsch *param;
5349 Buffer *mBuf;
5350 #endif
5351 {
5352
5353
5354    CMCHKPK(oduUnpackUInt8, param->isTBMsg4, mBuf);
5355    CMCHKPK(oduUnpackUInt8, param->dciRep, mBuf);
5356    CMCHKPK(oduUnpackUInt8, param->harqAckOffst, mBuf);
5357    CMCHKPK(oduUnpackUInt8, param->pmiCfm, mBuf);
5358    CMCHKPK(oduUnpackUInt8, param->tPmi, mBuf);
5359    CMCHKPK(oduUnpackUInt8, param->isSrs, mBuf);
5360    CMCHKPK(oduUnpackUInt8, param->antPortAndScrId, mBuf);
5361
5362 #ifdef TFU_TDD
5363    CMCHKPK(oduUnpackUInt8, param->dai, mBuf);
5364 #endif
5365    CMCHKPK(oduUnpackUInt8, param->tpcCmd, mBuf);
5366    CMCHKPK(oduUnpackUInt8, param->rep, mBuf);
5367    CMCHKPK(oduUnpackUInt8, param->hoppingEnbld, mBuf);
5368    CMCHKPK(cmPkTfuDciFormat6AAllocInfo, &param->allocInfo, mBuf);
5369    return ROK;
5370 }
5371
5372
5373 /***********************************************************
5374 *
5375 *     Func : cmPkTfuDciFormat61aInfo
5376 *
5377 *
5378 *     Desc : This structure contains the information needed to convey DCI format 6-1A.
5379  * @details Format can possibly carry PDSCH allocation or information needed for
5380  * a PDCCH order, used to initiate a RACH procedure in cases where UE looses
5381  * sync with eNodeB.
5382 *
5383 *
5384 *     Ret  : S16
5385 *
5386 *     Notes:
5387 *
5388 *     File  : 
5389 *
5390 **********************************************************/
5391 #ifdef ANSI
5392 S16 cmPkTfuDciFormat61aInfo
5393 (
5394 TfuDciFormat61aInfo *param,
5395 Buffer *mBuf
5396 )
5397 #else
5398 S16 cmPkTfuDciFormat61aInfo(param, mBuf)
5399 TfuDciFormat61aInfo *param;
5400 Buffer *mBuf;
5401 #endif
5402 {
5403
5404
5405    switch(param->isPdcchOrder) {
5406       case FALSE:
5407          CMCHKPK(cmPkTfudciformat61aPdsch, &param->t.pdschInfo, mBuf);
5408          break;
5409       case TRUE:
5410          CMCHKPK(cmPkTfuPdcchOrderInfoEmtc, &param->t.pdcchOrder, mBuf);
5411          break;
5412       default :
5413          return RFAILED;
5414       }
5415    CMCHKPK(oduUnpackUInt8, param->isPdcchOrder, mBuf);
5416
5417    return ROK;
5418 }
5419
5420 /***********************************************************
5421 *
5422 *     Func : cmUnpkTfuDciFormat60aInfo
5423 *
5424 *
5425 *     Desc : This structure contains the information that is carried in DCI
5426   * format 6-0A.
5427 *
5428 *
5429 *     Ret  : S16
5430 *
5431 *     Notes:
5432 *
5433 *     File  : 
5434 *
5435 * **********************************************************/
5436
5437 #ifdef ANSI
5438 PRIVATE S16 cmUnpkTfuDciFormat60aInfo 
5439 (
5440 TfuDciFormat60aInfo *param,
5441 Buffer *mBuf
5442 )
5443 #else
5444 PRIVATE S16 cmUnpkTfuDciFormat60aInfo(param, mBuf)
5445 TfuDciFormat60aInfo *param;
5446 Buffer *mBuf;
5447 #endif
5448 {
5449
5450
5451    printf("In cmUnpkTfuDciFormat60aInfo :: Entry \n");
5452    CMCHKUNPK(oduPackUInt8, &param->hoppingEnbld, mBuf);
5453    CMCHKUNPK(oduPackUInt32, &param->riv, mBuf);
5454    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
5455    CMCHKUNPK(oduPackUInt8, &param->rep, mBuf);
5456    CMCHKUNPK(oduPackUInt8, &param->hqProcId, mBuf);
5457    CMCHKUNPK(oduPackUInt8, &param->ndi, mBuf);
5458    CMCHKUNPK(oduPackUInt8, &param->rv, mBuf);
5459    CMCHKUNPK(oduPackUInt8, &param->tpcCmd, mBuf);
5460 #ifdef TFU_TDD
5461    CMCHKUNPK(oduPackUInt8, &param->ulIdx, mBuf);
5462    CMCHKUNPK(oduPackUInt8, &param->dai, mBuf);
5463 #endif
5464    CMCHKUNPK(oduPackUInt8, &param->cqiReq, mBuf);
5465    CMCHKUNPK(oduPackUInt8, &param->isSrs, mBuf);
5466    CMCHKUNPK(oduPackUInt8, &param->dciRep, mBuf);
5467    printf("In cmUnpkTfuDciFormat60aInfo :: Exit \n");
5468    return ROK;
5469 }
5470 /***********************************************************
5471 *
5472 *     Func : cmUnpkTfuPdcchOrderInfoEmtc
5473 *
5474 *
5475 *     Desc : This structure contains the information that is carried in DCI
5476   * format 6-1A in the case of a PDCCH order.
5477 *
5478 *
5479 *     Ret  : S16
5480 *
5481 *     Notes:
5482 *
5483 *     File  : 
5484 *
5485 **********************************************************/
5486 #ifdef ANSI
5487 PRIVATE S16 cmUnpkTfuPdcchOrderInfoEmtc
5488 (
5489 TfuPdcchOrderInfoEmtc *param,
5490 Buffer *mBuf
5491 )
5492 #else
5493 PRIVATE S16 cmUnpkTfuPdcchOrderInfoEmtc(param, mBuf)
5494 TfuPdcchOrderInfoEmtc *param;
5495 Buffer *mBuf;
5496 #endif
5497 {
5498
5499
5500    printf("In cmUnpkTfuPdcchOrderInfoEmtc :: Entry \n");
5501    CMCHKUNPK(oduPackUInt32, &param->riv, mBuf);
5502    CMCHKUNPK(oduPackUInt8, &param->preambleIdx, mBuf);
5503    CMCHKUNPK(oduPackUInt8, &param->prachMaskIdx, mBuf);
5504    CMCHKUNPK(oduPackUInt8, &param->ceLevel, mBuf);
5505    printf("In cmUnpkTfuPdcchOrderInfoEmtc :: Passed \n");
5506    return ROK;
5507 }
5508
5509 /***********************************************************
5510 *
5511 *     Func : cmUnpkTfuDciFormat61aInfo
5512 *
5513 *
5514 *     Desc : This structure contains the information carried by DCI format 6-1A.
5515 *
5516 *
5517 *     Ret  : S16
5518 *
5519 *     Notes:
5520 *
5521 *     File  : 
5522 *
5523 **********************************************************/
5524 #ifdef ANSI
5525 S16 cmUnpkTfuDciFormat61aInfo
5526 (
5527 TfuDciFormat61aInfo *param,
5528 Buffer *mBuf
5529 )
5530 #else
5531 S16 cmUnpkTfuDciFormat61aInfo(param, mBuf)
5532 TfuDciFormat61aInfo *param;
5533 Buffer *mBuf;
5534 #endif
5535 {
5536
5537
5538    CMCHKUNPK(oduPackUInt8, &param->isPdcchOrder, mBuf);
5539    printf("1. cmUnpkTfuDciFormat61aInfo ::  isPdcchOrder %d \n", param->isPdcchOrder); 
5540    switch(param->isPdcchOrder) {
5541       case TRUE:
5542          CMCHKUNPK(cmUnpkTfuPdcchOrderInfoEmtc, &param->t.pdcchOrder, mBuf);
5543          break;
5544       case FALSE:
5545          CMCHKUNPK(cmUnpkTfudciformat61aPdsch, &param->t.pdschInfo, mBuf);
5546          break;
5547       default :
5548          return RFAILED;
5549       }
5550    return ROK;
5551 }
5552 #endif
5553 \f
5554 /***********************************************************
5555 *
5556 *     Func : cmPkTfuDciFormat1dAllocInfo
5557 *
5558 *
5559 *     Desc : This structure contains only the allocation information, thats part
5560   * of DCI format 1D. 
5561   * @details Allocation information also contains parameters necessary
5562   * for Physical layer to process Downlink Data. This structure accompanies the
5563   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5564   * @sa TfuDciFormat1dInfo
5565 *
5566 *
5567 *     Ret  : S16
5568 *
5569 *     Notes:
5570 *
5571 *     File  : 
5572 *
5573 **********************************************************/
5574 #ifdef ANSI
5575 S16 cmPkTfuDciFormat1dAllocInfo
5576 (
5577 TfuDciFormat1dAllocInfo *param,
5578 Buffer *mBuf
5579 )
5580 #else
5581 S16 cmPkTfuDciFormat1dAllocInfo(param, mBuf)
5582 TfuDciFormat1dAllocInfo *param;
5583 Buffer *mBuf;
5584 #endif
5585 {
5586
5587
5588    CMCHKPK(oduUnpackUInt8, param->tPmi, mBuf);
5589    CMCHKPK(oduUnpackUInt8, param->rv, mBuf);
5590    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
5591    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
5592    CMCHKPK(cmPkTknUInt8, &param->nGap2, mBuf);
5593    CMCHKPK(oduUnpackUInt8, param->isLocal, mBuf);
5594    return ROK;
5595 }
5596
5597
5598 \f
5599 /***********************************************************
5600 *
5601 *     Func : cmUnpkTfuDciFormat1dAllocInfo
5602 *
5603 *
5604 *     Desc : This structure contains only the allocation information, thats part
5605   * of DCI format 1D. 
5606   * @details Allocation information also contains parameters necessary
5607   * for Physical layer to process Downlink Data. This structure accompanies the
5608   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5609   * @sa TfuDciFormat1dInfo
5610 *
5611 *
5612 *     Ret  : S16
5613 *
5614 *     Notes:
5615 *
5616 *     File  : 
5617 *
5618 **********************************************************/
5619 #ifdef ANSI
5620 S16 cmUnpkTfuDciFormat1dAllocInfo
5621 (
5622 TfuDciFormat1dAllocInfo *param,
5623 Buffer *mBuf
5624 )
5625 #else
5626 S16 cmUnpkTfuDciFormat1dAllocInfo(param, mBuf)
5627 TfuDciFormat1dAllocInfo *param;
5628 Buffer *mBuf;
5629 #endif
5630 {
5631
5632
5633    CMCHKUNPK(oduPackUInt8, &param->isLocal, mBuf);
5634    CMCHKUNPK(cmUnpkTknUInt8, &param->nGap2, mBuf);
5635    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
5636    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
5637    CMCHKUNPK(oduPackUInt8, &param->rv, mBuf);
5638    CMCHKUNPK(oduPackUInt8, &param->tPmi, mBuf);
5639    return ROK;
5640 }
5641
5642
5643 \f
5644 /***********************************************************
5645 *
5646 *     Func : cmPkTfuDciFormat1dInfo
5647 *
5648 *
5649 *     Desc : This structure contains the information carried by DCI format 1D.
5650  * @details Allocation information is separated from the other control
5651  * information carried in this format. This separation is needed as Data shall
5652  * also carry some control information, essentially allocation information,
5653  * along with it, in order to aid physical layer processing of the data.
5654 *
5655 *
5656 *     Ret  : S16
5657 *
5658 *     Notes:
5659 *
5660 *     File  : 
5661 *
5662 **********************************************************/
5663 #ifdef ANSI
5664 S16 cmPkTfuDciFormat1dInfo
5665 (
5666 TfuDciFormat1dInfo *param,
5667 Buffer *mBuf
5668 )
5669 #else
5670 S16 cmPkTfuDciFormat1dInfo(param, mBuf)
5671 TfuDciFormat1dInfo *param;
5672 Buffer *mBuf;
5673 #endif
5674 {
5675
5676
5677    CMCHKPK(oduUnpackUInt8, param->dlPwrOffset, mBuf);
5678
5679 #ifdef TFU_TDD
5680    CMCHKPK(oduUnpackUInt8, param->dai, mBuf);
5681
5682 #endif
5683    CMCHKPK(oduUnpackUInt8, param->tpcCmd, mBuf);
5684    CMCHKPK(oduUnpackUInt8, param->ndi, mBuf);
5685    CMCHKPK(oduUnpackUInt8, param->harqProcId, mBuf);
5686    CMCHKPK(cmPkTfuDciFormat1dAllocInfo, &param->allocInfo, mBuf);
5687    return ROK;
5688 }
5689
5690
5691 \f
5692 /***********************************************************
5693 *
5694 *     Func : cmUnpkTfuDciFormat1dInfo
5695 *
5696 *
5697 *     Desc : This structure contains the information carried by DCI format 1D.
5698  * @details Allocation information is separated from the other control
5699  * information carried in this format. This separation is needed as Data shall
5700  * also carry some control information, essentially allocation information,
5701  * along with it, in order to aid physical layer processing of the data.
5702 *
5703 *
5704 *     Ret  : S16
5705 *
5706 *     Notes:
5707 *
5708 *     File  : 
5709 *
5710 **********************************************************/
5711 #ifdef ANSI
5712 S16 cmUnpkTfuDciFormat1dInfo
5713 (
5714 TfuDciFormat1dInfo *param,
5715 Buffer *mBuf
5716 )
5717 #else
5718 S16 cmUnpkTfuDciFormat1dInfo(param, mBuf)
5719 TfuDciFormat1dInfo *param;
5720 Buffer *mBuf;
5721 #endif
5722 {
5723
5724
5725    CMCHKUNPK(cmUnpkTfuDciFormat1dAllocInfo, &param->allocInfo, mBuf);
5726    CMCHKUNPK(oduPackUInt8, &param->harqProcId, mBuf);
5727    CMCHKUNPK(oduPackUInt8, &param->ndi, mBuf);
5728    CMCHKUNPK(oduPackUInt8, &param->tpcCmd, mBuf);
5729
5730 #ifdef TFU_TDD
5731    CMCHKUNPK(oduPackUInt8, &param->dai, mBuf);
5732
5733 #endif
5734    CMCHKUNPK(oduPackUInt8, &param->dlPwrOffset, mBuf);
5735    return ROK;
5736 }
5737
5738
5739 \f
5740 /***********************************************************
5741 *
5742 *     Func : cmPkTfuDciFormat1cInfo
5743 *
5744 *
5745 *     Desc : This structure contains only the allocation information, thats part
5746   * of DCI format 1C. 
5747   * @details Allocation information also contains parameters necessary
5748   * for Physical layer to process Downlink Data. This structure accompanies the
5749   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5750   * @sa TfuDciFormat1CInfo
5751 *
5752 *
5753 *     Ret  : S16
5754 *
5755 *     Notes:
5756 *
5757 *     File  : 
5758 *
5759 **********************************************************/
5760 #ifdef ANSI
5761 S16 cmPkTfuDciFormat1cInfo
5762 (
5763 TfuDciFormat1cInfo *param,
5764 Buffer *mBuf
5765 )
5766 #else
5767 S16 cmPkTfuDciFormat1cInfo(param, mBuf)
5768 TfuDciFormat1cInfo *param;
5769 Buffer *mBuf;
5770 #endif
5771 {
5772
5773
5774    CMCHKPK(oduUnpackUInt8, param->iTbs, mBuf);
5775    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
5776    CMCHKPK(cmPkTknUInt8, &param->nGap2, mBuf);
5777    return ROK;
5778 }
5779
5780
5781 \f
5782 /***********************************************************
5783 *
5784 *     Func : cmUnpkTfuDciFormat1cInfo
5785 *
5786 *
5787 *     Desc : This structure contains only the allocation information, thats part
5788   * of DCI format 1C. 
5789   * @details Allocation information also contains parameters necessary
5790   * for Physical layer to process Downlink Data. This structure accompanies the
5791   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5792   * @sa TfuDciFormat1CInfo
5793 *
5794 *
5795 *     Ret  : S16
5796 *
5797 *     Notes:
5798 *
5799 *     File  : 
5800 *
5801 **********************************************************/
5802 #ifdef ANSI
5803 S16 cmUnpkTfuDciFormat1cInfo
5804 (
5805 TfuDciFormat1cInfo *param,
5806 Buffer *mBuf
5807 )
5808 #else
5809 S16 cmUnpkTfuDciFormat1cInfo(param, mBuf)
5810 TfuDciFormat1cInfo *param;
5811 Buffer *mBuf;
5812 #endif
5813 {
5814
5815
5816    CMCHKUNPK(cmUnpkTknUInt8, &param->nGap2, mBuf);
5817    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
5818    CMCHKUNPK(oduPackUInt8, &param->iTbs, mBuf);
5819    return ROK;
5820 }
5821
5822
5823 \f
5824 /***********************************************************
5825 *
5826 *     Func : cmPkTfuDciFormat1bAllocInfo
5827 *
5828 *
5829 *     Desc : This structure contains only the allocation information, thats part
5830   * of DCI format 1 B. 
5831   * @details Allocation information also contains parameters necessary
5832   * for Physical layer to process Downlink Data. This structure accompanies the
5833   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5834   * @sa TfuDciFormat1BInfo
5835 *
5836 *
5837 *     Ret  : S16
5838 *
5839 *     Notes:
5840 *
5841 *     File  : 
5842 *
5843 **********************************************************/
5844 #ifdef ANSI
5845 S16 cmPkTfuDciFormat1bAllocInfo
5846 (
5847 TfuDciFormat1bAllocInfo *param,
5848 Buffer *mBuf
5849 )
5850 #else
5851 S16 cmPkTfuDciFormat1bAllocInfo(param, mBuf)
5852 TfuDciFormat1bAllocInfo *param;
5853 Buffer *mBuf;
5854 #endif
5855 {
5856
5857
5858    CMCHKPK(oduUnpackUInt8, param->pmiCfm, mBuf);
5859    CMCHKPK(oduUnpackUInt8, param->tPmi, mBuf);
5860    CMCHKPK(oduUnpackUInt8, param->ndi, mBuf);
5861    CMCHKPK(oduUnpackUInt8, param->harqProcId, mBuf);
5862    CMCHKPK(oduUnpackUInt8, param->rv, mBuf);
5863    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
5864    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
5865    CMCHKPK(cmPkTknUInt8, &param->nGap2, mBuf);
5866    CMCHKPK(oduUnpackUInt8, param->isLocal, mBuf);
5867    return ROK;
5868 }
5869
5870
5871 \f
5872 /***********************************************************
5873 *
5874 *     Func : cmUnpkTfuDciFormat1bAllocInfo
5875 *
5876 *
5877 *     Desc : This structure contains only the allocation information, thats part
5878   * of DCI format 1 B. 
5879   * @details Allocation information also contains parameters necessary
5880   * for Physical layer to process Downlink Data. This structure accompanies the
5881   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5882   * @sa TfuDciFormat1BInfo
5883 *
5884 *
5885 *     Ret  : S16
5886 *
5887 *     Notes:
5888 *
5889 *     File  : 
5890 *
5891 **********************************************************/
5892 #ifdef ANSI
5893 S16 cmUnpkTfuDciFormat1bAllocInfo
5894 (
5895 TfuDciFormat1bAllocInfo *param,
5896 Buffer *mBuf
5897 )
5898 #else
5899 S16 cmUnpkTfuDciFormat1bAllocInfo(param, mBuf)
5900 TfuDciFormat1bAllocInfo *param;
5901 Buffer *mBuf;
5902 #endif
5903 {
5904
5905
5906    CMCHKUNPK(oduPackUInt8, &param->isLocal, mBuf);
5907    CMCHKUNPK(cmUnpkTknUInt8, &param->nGap2, mBuf);
5908    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
5909    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
5910    CMCHKUNPK(oduPackUInt8, &param->rv, mBuf);
5911    CMCHKUNPK(oduPackUInt8, &param->harqProcId, mBuf);
5912    CMCHKUNPK(oduPackUInt8, &param->ndi, mBuf);
5913    CMCHKUNPK(oduPackUInt8, &param->tPmi, mBuf);
5914    CMCHKUNPK(oduPackUInt8, &param->pmiCfm, mBuf);
5915    return ROK;
5916 }
5917
5918
5919 \f
5920 /***********************************************************
5921 *
5922 *     Func : cmPkTfuPdcchOrderInfo
5923 *
5924 *
5925 *     Desc : This structure contains the information that is carried in DCI
5926   * format 1A in the case of a PDCCH order.
5927 *
5928 *
5929 *     Ret  : S16
5930 *
5931 *     Notes:
5932 *
5933 *     File  : 
5934 *
5935 **********************************************************/
5936 #ifdef ANSI
5937 S16 cmPkTfuPdcchOrderInfo
5938 (
5939 TfuPdcchOrderInfo *param,
5940 Buffer *mBuf
5941 )
5942 #else
5943 S16 cmPkTfuPdcchOrderInfo(param, mBuf)
5944 TfuPdcchOrderInfo *param;
5945 Buffer *mBuf;
5946 #endif
5947 {
5948
5949
5950    CMCHKPK(oduUnpackUInt8, param->prachMaskIdx, mBuf);
5951    CMCHKPK(oduUnpackUInt8, param->preambleIdx, mBuf);
5952    return ROK;
5953 }
5954
5955
5956 \f
5957 /***********************************************************
5958 *
5959 *     Func : cmUnpkTfuPdcchOrderInfo
5960 *
5961 *
5962 *     Desc : This structure contains the information that is carried in DCI
5963   * format 1A in the case of a PDCCH order.
5964 *
5965 *
5966 *     Ret  : S16
5967 *
5968 *     Notes:
5969 *
5970 *     File  : 
5971 *
5972 **********************************************************/
5973 #ifdef ANSI
5974 S16 cmUnpkTfuPdcchOrderInfo
5975 (
5976 TfuPdcchOrderInfo *param,
5977 Buffer *mBuf
5978 )
5979 #else
5980 S16 cmUnpkTfuPdcchOrderInfo(param, mBuf)
5981 TfuPdcchOrderInfo *param;
5982 Buffer *mBuf;
5983 #endif
5984 {
5985
5986
5987    CMCHKUNPK(oduPackUInt8, &param->preambleIdx, mBuf);
5988    CMCHKUNPK(oduPackUInt8, &param->prachMaskIdx, mBuf);
5989    return ROK;
5990 }
5991
5992
5993 \f
5994 /***********************************************************
5995 *
5996 *     Func : cmPkTfuDciFormat1aAllocInfo
5997 *
5998 *
5999 *     Desc : This structure contains only the allocation information, thats part
6000   * of DCI format 1A. 
6001   * @details Allocation information also contains parameters necessary
6002   * for Physical layer to process Downlink Data. This structure accompanies the
6003   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6004   * @sa TfuDciFormat1AInfo
6005 *
6006 *
6007 *     Ret  : S16
6008 *
6009 *     Notes:
6010 *
6011 *     File  : 
6012 *
6013 **********************************************************/
6014 #ifdef ANSI
6015 S16 cmPkTfuDciFormat1aAllocInfo
6016 (
6017 TfuDciFormat1aAllocInfo *param,
6018 Buffer *mBuf
6019 )
6020 #else
6021 S16 cmPkTfuDciFormat1aAllocInfo(param, mBuf)
6022 TfuDciFormat1aAllocInfo *param;
6023 Buffer *mBuf;
6024 #endif
6025 {
6026
6027
6028    CMCHKPK(oduUnpackUInt8, param->ndi, mBuf);
6029    CMCHKPK(cmPkTknUInt8, &param->harqProcId, mBuf);
6030    CMCHKPK(oduUnpackUInt8, param->rv, mBuf);
6031    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
6032    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
6033    CMCHKPK(cmPkTknUInt8, &param->nGap2, mBuf);
6034    CMCHKPK(oduUnpackUInt8, param->isLocal, mBuf);
6035    return ROK;
6036 }
6037
6038
6039 \f
6040 /***********************************************************
6041 *
6042 *     Func : cmUnpkTfuDciFormat1aAllocInfo
6043 *
6044 *
6045 *     Desc : This structure contains only the allocation information, thats part
6046   * of DCI format 1A. 
6047   * @details Allocation information also contains parameters necessary
6048   * for Physical layer to process Downlink Data. This structure accompanies the
6049   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6050   * @sa TfuDciFormat1AInfo
6051 *
6052 *
6053 *     Ret  : S16
6054 *
6055 *     Notes:
6056 *
6057 *     File  : 
6058 *
6059 **********************************************************/
6060 #ifdef ANSI
6061 S16 cmUnpkTfuDciFormat1aAllocInfo
6062 (
6063 TfuDciFormat1aAllocInfo *param,
6064 Buffer *mBuf
6065 )
6066 #else
6067 S16 cmUnpkTfuDciFormat1aAllocInfo(param, mBuf)
6068 TfuDciFormat1aAllocInfo *param;
6069 Buffer *mBuf;
6070 #endif
6071 {
6072
6073
6074    CMCHKUNPK(oduPackUInt8, &param->isLocal, mBuf);
6075    CMCHKUNPK(cmUnpkTknUInt8, &param->nGap2, mBuf);
6076    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
6077    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
6078    CMCHKUNPK(oduPackUInt8, &param->rv, mBuf);
6079    CMCHKUNPK(cmUnpkTknUInt8, &param->harqProcId, mBuf);
6080    CMCHKUNPK(oduPackUInt8, &param->ndi, mBuf);
6081    return ROK;
6082 }
6083
6084
6085 \f
6086 /***********************************************************
6087 *
6088 *     Func : cmPkTfudciformat1aPdsch
6089 *
6090 *
6091 *     Desc : This structure contains the information carried in DCI format 1A
6092   * when it is NOT used for a PDCCH order.
6093 *
6094 *
6095 *     Ret  : S16
6096 *
6097 *     Notes:
6098 *
6099 *     File  : 
6100 *
6101 **********************************************************/
6102 #ifdef ANSI
6103 S16 cmPkTfudciformat1aPdsch
6104 (
6105 Tfudciformat1aPdsch *param,
6106 Buffer *mBuf
6107 )
6108 #else
6109 S16 cmPkTfudciformat1aPdsch(param, mBuf)
6110 Tfudciformat1aPdsch *param;
6111 Buffer *mBuf;
6112 #endif
6113 {
6114
6115
6116    CMCHKPK(oduUnpackUInt8, param->tpcCmd, mBuf);
6117
6118 #ifdef TFU_TDD
6119    CMCHKPK(cmPkTknUInt8, &param->dai, mBuf);
6120
6121 #endif
6122    CMCHKPK(cmPkTfuDciFormat1aAllocInfo, &param->allocInfo, mBuf);
6123    return ROK;
6124 }
6125
6126
6127 \f
6128 /***********************************************************
6129 *
6130 *     Func : cmUnpkTfudciformat1aPdsch
6131 *
6132 *
6133 *     Desc : This structure contains the information carried in DCI format 1A
6134   * when it is NOT used for a PDCCH order.
6135 *
6136 *
6137 *     Ret  : S16
6138 *
6139 *     Notes:
6140 *
6141 *     File  : 
6142 *
6143 **********************************************************/
6144 #ifdef ANSI
6145 S16 cmUnpkTfudciformat1aPdsch
6146 (
6147 Tfudciformat1aPdsch *param,
6148 Buffer *mBuf
6149 )
6150 #else
6151 S16 cmUnpkTfudciformat1aPdsch(param, mBuf)
6152 Tfudciformat1aPdsch *param;
6153 Buffer *mBuf;
6154 #endif
6155 {
6156
6157
6158    CMCHKUNPK(cmUnpkTfuDciFormat1aAllocInfo, &param->allocInfo, mBuf);
6159
6160 #ifdef TFU_TDD
6161    CMCHKUNPK(cmUnpkTknUInt8, &param->dai, mBuf);
6162
6163 #endif
6164    CMCHKUNPK(oduPackUInt8, &param->tpcCmd, mBuf);
6165    return ROK;
6166 }
6167
6168 #ifdef EMTC_ENABLE
6169
6170 \f
6171 /***********************************************************
6172 *
6173 *     Func : cmUnpkTfudciformat61aPdsch
6174 *
6175 *
6176 *     Desc : This structure contains the information carried in DCI format 6-1A
6177   * when it is NOT used for a PDCCH order.
6178 *
6179 *
6180 *     Ret  : S16
6181 *
6182 *     Notes:
6183 *
6184 *     File  : 
6185 *
6186 **********************************************************/
6187 #ifdef ANSI
6188 S16 cmUnpkTfudciformat61aPdsch
6189 (
6190 Tfudciformat61aPdsch *param,
6191 Buffer *mBuf
6192 )
6193 #else
6194 S16 cmUnpkTfudciformat61aPdsch(param, mBuf)
6195 Tfudciformat61aPdsch *param;
6196 Buffer *mBuf;
6197 #endif
6198 {
6199
6200
6201    printf("1. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6202    CMCHKUNPK(cmUnpkTfuDciFormat6AAllocInfo, &param->allocInfo, mBuf);
6203    printf("2. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6204    CMCHKUNPK(oduPackUInt8, &param->hoppingEnbld, mBuf);
6205    printf("3. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6206    CMCHKUNPK(oduPackUInt8, &param->rep, mBuf);
6207    printf("4. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6208    CMCHKUNPK(oduPackUInt8, &param->tpcCmd, mBuf);
6209    printf("5. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6210 #ifdef TFU_TDD
6211    CMCHKUNPK(oduPackUInt8, &param->dai, mBuf);
6212    printf("6. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6213 #endif
6214    CMCHKUNPK(oduPackUInt8, &param->antPortAndScrId, mBuf);
6215    printf("7. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6216    CMCHKUNPK(oduPackUInt8, &param->isSrs, mBuf);
6217    printf("8. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6218    CMCHKUNPK(oduPackUInt8, &param->tPmi, mBuf);
6219    printf("9. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6220    CMCHKUNPK(oduPackUInt8, &param->pmiCfm, mBuf);
6221    printf("10. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6222    CMCHKUNPK(oduPackUInt8, &param->harqAckOffst, mBuf);
6223    printf("11. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6224    CMCHKUNPK(oduPackUInt8, &param->dciRep, mBuf);
6225    printf("12. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6226    CMCHKUNPK(oduPackUInt8, &param->isTBMsg4, mBuf);
6227    printf("1. cmUnpkTfudciformat61aPdsch ::  Passed \n"); 
6228    return ROK;
6229 }
6230 /***********************************************************
6231  *
6232  *     Func : cmUnpkTfuDirectIndication
6233  *
6234  *
6235  *     Desc : This structure contains the information that is carried in DCI
6236  *       format 6-2 in the case of a Direct information indication.
6237  *
6238  *
6239  *     Ret  : S16
6240  *
6241  *     Notes:
6242  *
6243  *     File  : 
6244  *
6245  **********************************************************/
6246 #ifdef ANSI
6247 PRIVATE S16 cmUnpkTfuDirectIndication
6248 (
6249  TfuDirectIndication *param,
6250  Buffer *mBuf
6251  )
6252 #else
6253 PRIVATE S16 cmUnpkTfuDirectIndication(param, mBuf)
6254    TfuDirectIndication *param;
6255    Buffer *mBuf;
6256 #endif
6257 {
6258
6259    CMCHKUNPK(oduPackUInt8, &param->directInd, mBuf);
6260
6261
6262
6263    return ROK;
6264 }
6265 /***********************************************************
6266  *
6267  *     Func : cmUnpkTfuDciFormat62AllocInfo
6268  *
6269  *
6270  *     Desc : This structure contains only the allocation information, that is part
6271  * of DCI format 6-2. 
6272  * @details Allocation information also contains parameters necessary
6273  * for Physical layer to process Downlink data. This structure accompanies the
6274  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6275  * @sa TfuDciFormat62Info
6276  *
6277  *
6278  *     Ret  : S16
6279  *
6280  *     Notes:
6281  *
6282  *     File  : 
6283  *
6284  **********************************************************/
6285 #ifdef ANSI
6286 S16 cmUnpkTfuDciFormat62AllocInfo
6287 (
6288  TfuDciFormat62AllocInfo *param,
6289  Buffer *mBuf
6290  )
6291 #else
6292 S16 cmUnpkTfuDciFormat62AllocInfo(param, mBuf)
6293    TfuDciFormat62AllocInfo *param;
6294    Buffer *mBuf;
6295 #endif
6296 {
6297    CMCHKUNPK(oduPackUInt8, &param->riv, mBuf);
6298    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
6299    CMCHKUNPK(oduPackUInt8, &param->rv, mBuf);
6300
6301    return ROK;
6302 }
6303
6304 /***********************************************************
6305  *
6306  *     Func : cmUnpkTfudciformat62Pdsch
6307  *
6308  *
6309  *     Desc : This structure contains the information carried in DCI format 6-2
6310  *            when It is used for Paging message.
6311  *
6312  *
6313  *     Ret  : S16
6314  *
6315  *     Notes:
6316  *
6317  *     File  : 
6318  *
6319  **********************************************************/
6320 #ifdef ANSI
6321 PRIVATE S16 cmUnpkTfudciformat62Pdsch
6322 (
6323  Tfudciformat62Pdsch *param,
6324  Buffer *mBuf
6325  )
6326 #else
6327 PRIVATE S16 cmUnpkTfudciformat62Pdsch(param, mBuf)
6328    Tfudciformat62Pdsch *param;
6329    Buffer *mBuf;
6330 #endif
6331 {
6332
6333
6334    CMCHKUNPK(cmUnpkTfuDciFormat62AllocInfo, &param->format62AllocInfo, mBuf);
6335    CMCHKUNPK(oduPackUInt8, &param->repNum, mBuf);
6336    CMCHKUNPK(oduPackUInt8, &param->dciSubRepNum, mBuf);
6337    return ROK;
6338 }
6339
6340
6341 /***********************************************************
6342  *
6343  *     Func : cmUnpkTfuDciFormat62Info
6344  *
6345  *
6346  *     Desc : This structure contains the information needed to convey DCI format 6-2.
6347  *     @details Format can possibly carry PDSCH allocation or information needed for
6348  *     a Direct information Indication.
6349  * 
6350  *
6351  *
6352  *     Ret  : S16
6353  *
6354  *     Notes:
6355  *
6356  *     File  : 
6357  *
6358  **********************************************************/
6359 #ifdef ANSI
6360 S16 cmUnpkTfuDciFormat62Info
6361 (
6362  TfuDciFormat62Info *param,
6363  Buffer *mBuf
6364  )
6365 #else
6366 S16 cmUnpkTfuDciFormat62Info(param, mBuf)
6367    TfuDciFormat62Info *param;
6368    Buffer *mBuf;
6369 #endif
6370 {
6371
6372       CMCHKUNPK(oduPackUInt8, &param->isPaging, mBuf);
6373    switch(param->isPaging) {
6374       case FALSE:
6375          CMCHKUNPK(cmUnpkTfuDirectIndication, &param->t.directIndication, mBuf);
6376          break;
6377       case TRUE:
6378          CMCHKUNPK(cmUnpkTfudciformat62Pdsch, &param->t.pdschInfo, mBuf);
6379          break;
6380       default :
6381          return RFAILED;
6382    }
6383
6384
6385    return ROK;
6386 }
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399 /***********************************************************
6400  *
6401  *     Func : cmPkTfuDirectIndication
6402  *
6403  *
6404  *     Desc : This structure contains the information that is carried in DCI
6405  *       format 6-2 in the case of a Direct information indication.
6406  *
6407  *
6408  *     Ret  : S16
6409  *
6410  *     Notes:
6411  *
6412  *     File  : 
6413  *
6414  **********************************************************/
6415 #ifdef ANSI
6416 PRIVATE S16 cmPkTfuDirectIndication
6417 (
6418  TfuDirectIndication *param,
6419  Buffer *mBuf
6420  )
6421 #else
6422 PRIVATE S16 cmPkTfuDirectIndication(param, mBuf)
6423    TfuDirectIndication *param;
6424    Buffer *mBuf;
6425 #endif
6426 {
6427
6428    CMCHKPK(oduUnpackUInt8, param->directInd, mBuf);
6429
6430
6431    return ROK;
6432 }
6433
6434
6435
6436 /***********************************************************
6437  *
6438  *     Func : cmPkTfuDciFormat62AllocInfo
6439  *
6440  *
6441  *     Desc : This structure contains only the allocation information, that is part
6442  * of DCI format 6-2. 
6443  * @details Allocation information also contains parameters necessary
6444  * for Physical layer to process Downlink data. This structure accompanies the
6445  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6446  * @sa TfuDciFormat62Info
6447  *
6448  *
6449  *     Ret  : S16
6450  *
6451  *     Notes:
6452  *
6453  *     File  : 
6454  *
6455  **********************************************************/
6456 #ifdef ANSI
6457 S16 cmPkTfuDciFormat62AllocInfo
6458 (
6459  TfuDciFormat62AllocInfo *param,
6460  Buffer *mBuf
6461  )
6462 #else
6463 S16 cmPkTfuDciFormat62AllocInfo(param, mBuf)
6464    TfuDciFormat62AllocInfo *param;
6465    Buffer *mBuf;
6466 #endif
6467 {
6468
6469    CMCHKPK(oduUnpackUInt8, param->rv, mBuf);
6470    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
6471    CMCHKPK(oduUnpackUInt8, param->riv, mBuf);
6472
6473    return ROK;
6474 }
6475
6476
6477
6478 /***********************************************************
6479  *
6480  *     Func : cmPkTfudciformat62Pdsch
6481  *
6482  *
6483  *     Desc : This structure contains the information carried in DCI format 6-2
6484  *            when It is used for Paging message.
6485  *
6486  *
6487  *     Ret  : S16
6488  *
6489  *     Notes:
6490  *
6491  *     File  : 
6492  *
6493  **********************************************************/
6494 #ifdef ANSI
6495 PRIVATE S16 cmPkTfudciformat62Pdsch
6496 (
6497  Tfudciformat62Pdsch *param,
6498  Buffer *mBuf
6499  )
6500 #else
6501 PRIVATE S16 cmPkTfudciformat62Pdsch(param, mBuf)
6502    Tfudciformat62Pdsch *param;
6503    Buffer *mBuf;
6504 #endif
6505 {
6506
6507    CMCHKPK(oduUnpackUInt8, param->dciSubRepNum, mBuf);
6508    CMCHKPK(oduUnpackUInt8, param->repNum, mBuf);
6509    CMCHKPK(cmPkTfuDciFormat62AllocInfo, &param->format62AllocInfo, mBuf);
6510    return ROK;
6511 }
6512
6513
6514
6515
6516 /***********************************************************
6517  *
6518  *     Func : cmPkTfuDciFormat62Info
6519  *
6520  *
6521  *     Desc : This structure contains the information needed to convey DCI format 6-2.
6522  *      @details Format can possibly carry PDSCH allocation or information needed for
6523  *      a Direct information Indication.
6524  * 
6525  *
6526  *
6527  *     Ret  : S16
6528  *
6529  *     Notes:
6530  *
6531  *     File  : 
6532  *
6533  **********************************************************/
6534 #ifdef ANSI
6535 S16 cmPkTfuDciFormat62Info
6536 (
6537  TfuDciFormat62Info *param,
6538  Buffer *mBuf
6539  )
6540 #else
6541 S16 cmPkTfuDciFormat62Info(param, mBuf)
6542    TfuDciFormat62Info *param;
6543    Buffer *mBuf;
6544 #endif
6545 {
6546
6547       switch(param->isPaging) {
6548          case TRUE:
6549             CMCHKPK(cmPkTfudciformat62Pdsch, &param->t.pdschInfo, mBuf);
6550             break;
6551          case FALSE:
6552             CMCHKPK(cmPkTfuDirectIndication, &param->t.directIndication, mBuf);
6553             break;
6554          default :
6555             return RFAILED;
6556       }
6557    CMCHKPK(oduUnpackUInt8, param->isPaging, mBuf);
6558
6559    return ROK;
6560 }
6561
6562
6563
6564
6565
6566
6567 #endif
6568
6569 \f
6570 /***********************************************************
6571 *
6572 *     Func : cmPkTfuDciFormat1aInfo
6573 *
6574 *
6575 *     Desc : This structure contains the information needed to convey DCI format 1A.
6576  * @details Format can possibly carry PDSCH allocation or information needed for
6577  * a PDCCH order, used to initiate a RACH procedure in cases where UE looses
6578  * sync with eNodeB.
6579 *
6580 *
6581 *     Ret  : S16
6582 *
6583 *     Notes:
6584 *
6585 *     File  : 
6586 *
6587 **********************************************************/
6588 #ifdef ANSI
6589 S16 cmPkTfuDciFormat1aInfo
6590 (
6591 TfuDciFormat1aInfo *param,
6592 Buffer *mBuf
6593 )
6594 #else
6595 S16 cmPkTfuDciFormat1aInfo(param, mBuf)
6596 TfuDciFormat1aInfo *param;
6597 Buffer *mBuf;
6598 #endif
6599 {
6600
6601
6602    switch(param->isPdcchOrder) {
6603       case FALSE:
6604          CMCHKPK(cmPkTfudciformat1aPdsch, &param->t.pdschInfo, mBuf);
6605          break;
6606       case TRUE:
6607          CMCHKPK(cmPkTfuPdcchOrderInfo, &param->t.pdcchOrder, mBuf);
6608          break;
6609       default :
6610          return RFAILED;
6611       }
6612    CMCHKPK(oduUnpackUInt8, param->isPdcchOrder, mBuf);
6613
6614    return ROK;
6615 }
6616
6617
6618 \f
6619 /***********************************************************
6620 *
6621 *     Func : cmUnpkTfuDciFormat1aInfo
6622 *
6623 *
6624 *     Desc : This structure contains the information needed to convey DCI format 1A.
6625  * @details Format can possibly carry PDSCH allocation or information needed for
6626  * a PDCCH order, used to initiate a RACH procedure in cases where UE looses
6627  * sync with eNodeB.
6628 *
6629 *
6630 *     Ret  : S16
6631 *
6632 *     Notes:
6633 *
6634 *     File  : 
6635 *
6636 **********************************************************/
6637 #ifdef ANSI
6638 S16 cmUnpkTfuDciFormat1aInfo
6639 (
6640 TfuDciFormat1aInfo *param,
6641 Buffer *mBuf
6642 )
6643 #else
6644 S16 cmUnpkTfuDciFormat1aInfo(param, mBuf)
6645 TfuDciFormat1aInfo *param;
6646 Buffer *mBuf;
6647 #endif
6648 {
6649
6650
6651    CMCHKUNPK(oduPackUInt8, &param->isPdcchOrder, mBuf);
6652    switch(param->isPdcchOrder) {
6653       case TRUE:
6654          CMCHKUNPK(cmUnpkTfuPdcchOrderInfo, &param->t.pdcchOrder, mBuf);
6655          break;
6656       case FALSE:
6657          CMCHKUNPK(cmUnpkTfudciformat1aPdsch, &param->t.pdschInfo, mBuf);
6658          break;
6659       default :
6660          return RFAILED;
6661       }
6662    return ROK;
6663 }
6664
6665
6666 \f
6667 /***********************************************************
6668 *
6669 *     Func : cmPkTfuDciFormat1bInfo
6670 *
6671 *
6672 *     Desc : This structure contains the information needed to convey DCI format 1A.
6673  * @details Allocation information is separated from the other control
6674  * information carried in this format. This separation is needed as Data shall
6675  * also carry some control information, essentially allocation information,
6676  * along with it, in order to aid physical layer processing of the data.
6677 *
6678 *
6679 *     Ret  : S16
6680 *
6681 *     Notes:
6682 *
6683 *     File  : 
6684 *
6685 **********************************************************/
6686 #ifdef ANSI
6687 S16 cmPkTfuDciFormat1bInfo
6688 (
6689 TfuDciFormat1bInfo *param,
6690 Buffer *mBuf
6691 )
6692 #else
6693 S16 cmPkTfuDciFormat1bInfo(param, mBuf)
6694 TfuDciFormat1bInfo *param;
6695 Buffer *mBuf;
6696 #endif
6697 {
6698
6699
6700    CMCHKPK(oduUnpackUInt8, param->tpcCmd, mBuf);
6701
6702 #ifdef TFU_TDD
6703    CMCHKPK(oduUnpackUInt8, param->dai, mBuf);
6704
6705 #endif
6706    CMCHKPK(cmPkTfuDciFormat1bAllocInfo, &param->allocInfo, mBuf);
6707    return ROK;
6708 }
6709
6710
6711 \f
6712 /***********************************************************
6713 *
6714 *     Func : cmUnpkTfuDciFormat1bInfo
6715 *
6716 *
6717 *     Desc : This structure contains the information needed to convey DCI format 1A.
6718  * @details Allocation information is separated from the other control
6719  * information carried in this format. This separation is needed as Data shall
6720  * also carry some control information, essentially allocation information,
6721  * along with it, in order to aid physical layer processing of the data.
6722 *
6723 *
6724 *     Ret  : S16
6725 *
6726 *     Notes:
6727 *
6728 *     File  : 
6729 *
6730 **********************************************************/
6731 #ifdef ANSI
6732 S16 cmUnpkTfuDciFormat1bInfo
6733 (
6734 TfuDciFormat1bInfo *param,
6735 Buffer *mBuf
6736 )
6737 #else
6738 S16 cmUnpkTfuDciFormat1bInfo(param, mBuf)
6739 TfuDciFormat1bInfo *param;
6740 Buffer *mBuf;
6741 #endif
6742 {
6743
6744
6745    CMCHKUNPK(cmUnpkTfuDciFormat1bAllocInfo, &param->allocInfo, mBuf);
6746
6747 #ifdef TFU_TDD
6748    CMCHKUNPK(oduPackUInt8, &param->dai, mBuf);
6749
6750 #endif
6751    CMCHKUNPK(oduPackUInt8, &param->tpcCmd, mBuf);
6752    return ROK;
6753 }
6754
6755
6756 \f
6757 /***********************************************************
6758 *
6759 *     Func : cmPkTfuDciInfo
6760 *
6761 *
6762 *     Desc : This structure contains the information needed to convey the possible DCI
6763  * formats. The following are the supported formats - 
6764  * -# Format 0    - used for PUSCH scheduling
6765  * -# Format 1    - used for PDSCH scheduling
6766  * -# Format 1A   - used for compact scheduling of PDSCH or RA procedure
6767  *                   intitiated by a PDCCH order.
6768  * -# Format 1B   - used for compact scheduling of PDSCH with precoding
6769  *                   information.
6770  * -# Format 1C   - used for very compact scheduling of PDSCH.
6771  * -# Format 1D   - used for compact scheduling for PDSCH with precoding
6772  *                   information with power offset.
6773  * -# Format 2    - used for PDSCH Scheduling
6774  * -# Format 2A   - used for PDSCH Scheduling
6775  * -# Format 3    - used for power control 
6776  * -# Format 3A   - used for power control
6777 *
6778 *
6779 *     Ret  : S16
6780 *
6781 *     Notes:
6782 *
6783 *     File  : 
6784 *
6785 **********************************************************/
6786 #ifdef ANSI
6787 S16 cmPkTfuDciInfo
6788 (
6789 TfuDciInfo *param,
6790 Buffer *mBuf
6791 )
6792 #else
6793 S16 cmPkTfuDciInfo(param, mBuf)
6794 TfuDciInfo *param;
6795 Buffer *mBuf;
6796 #endif
6797 {
6798
6799
6800       switch(param->dciFormat) {
6801 #ifdef TFU_5GTF
6802          case TFU_DCI_FORMAT_B1:
6803             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
6804             break;
6805          case TFU_DCI_FORMAT_B2:
6806             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
6807             break;
6808          case TFU_DCI_FORMAT_A1:
6809             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
6810             break;
6811          case TFU_DCI_FORMAT_A2:
6812             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
6813             break;
6814 #endif
6815 #ifdef EMTC_ENABLE            
6816          case TFU_DCI_FORMAT_6_2:
6817             CMCHKPK(cmPkTfuDciFormat62Info, &param->u.format62Info, mBuf);
6818             break;
6819          case TFU_DCI_FORMAT_6_1A:
6820             CMCHKPK(cmPkTfuDciFormat61aInfo, &param->u.format61aInfo, mBuf);
6821             break;
6822          case TFU_DCI_FORMAT_6_0A:
6823             CMCHKPK(cmPkTfuDciFormat60aInfo, &param->u.format60aInfo, mBuf);
6824             break;
6825 #endif            
6826          case TFU_DCI_FORMAT_3A:
6827             CMCHKPK(cmPkTfuDciFormat3AInfo, &param->u.format3AInfo, mBuf);
6828             break;
6829          case TFU_DCI_FORMAT_3:
6830             CMCHKPK(cmPkTfuDciFormat3Info, &param->u.format3Info, mBuf);
6831             break;
6832          case TFU_DCI_FORMAT_2A:
6833             CMCHKPK(cmPkTfuDciFormat2AInfo, &param->u.format2AInfo, mBuf);
6834             break;
6835          case TFU_DCI_FORMAT_2:
6836             CMCHKPK(cmPkTfuDciFormat2Info, &param->u.format2Info, mBuf);
6837             break;
6838          case TFU_DCI_FORMAT_1D:
6839             CMCHKPK(cmPkTfuDciFormat1dInfo, &param->u.format1dInfo, mBuf);
6840             break;
6841          case TFU_DCI_FORMAT_1C:
6842             CMCHKPK(cmPkTfuDciFormat1cInfo, &param->u.format1cInfo, mBuf);
6843             break;
6844          case TFU_DCI_FORMAT_1B:
6845             CMCHKPK(cmPkTfuDciFormat1bInfo, &param->u.format1bInfo, mBuf);
6846             break;
6847          case TFU_DCI_FORMAT_1A:
6848             CMCHKPK(cmPkTfuDciFormat1aInfo, &param->u.format1aInfo, mBuf);
6849             break;
6850          case TFU_DCI_FORMAT_1:
6851             CMCHKPK(cmPkTfuDciFormat1Info, &param->u.format1Info, mBuf);
6852             break;
6853          case TFU_DCI_FORMAT_0:
6854             CMCHKPK(cmPkTfuDciFormat0Info, &param->u.format0Info, mBuf);
6855             break;
6856          default :
6857             return RFAILED;
6858       }
6859    CMCHKPK(oduUnpackUInt32, param->dciFormat, mBuf);
6860    return ROK;
6861 }
6862
6863
6864 \f
6865 /***********************************************************
6866 *
6867 *     Func : cmUnpkTfuDciInfo
6868 *
6869 *
6870 *     Desc : This structure contains the information needed to convey the possible DCI
6871  * formats. The following are the supported formats - 
6872  * -# Format 0    - used for PUSCH scheduling
6873  * -# Format 1    - used for PDSCH scheduling
6874  * -# Format 1A   - used for compact scheduling of PDSCH or RA procedure
6875  *                   intitiated by a PDCCH order.
6876  * -# Format 1B   - used for compact scheduling of PDSCH with precoding
6877  *                   information.
6878  * -# Format 1C   - used for very compact scheduling of PDSCH.
6879  * -# Format 1D   - used for compact scheduling for PDSCH with precoding
6880  *                   information with power offset.
6881  * -# Format 2    - used for PDSCH Scheduling
6882  * -# Format 2A   - used for PDSCH Scheduling
6883  * -# Format 3    - used for power control 
6884  * -# Format 3A   - used for power control
6885 *
6886 *
6887 *     Ret  : S16
6888 *
6889 *     Notes:
6890 *
6891 *     File  : 
6892 *
6893 **********************************************************/
6894 #ifdef ANSI
6895 S16 cmUnpkTfuDciInfo
6896 (
6897 TfuDciInfo *param,
6898 Buffer *mBuf
6899 )
6900 #else
6901 S16 cmUnpkTfuDciInfo(param, mBuf)
6902 TfuDciInfo *param;
6903 Buffer *mBuf;
6904 #endif
6905 {
6906
6907
6908
6909    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->dciFormat, mBuf);
6910       switch(param->dciFormat) {
6911          case TFU_DCI_FORMAT_0:
6912             CMCHKUNPK(cmUnpkTfuDciFormat0Info, &param->u.format0Info, mBuf);
6913             break;
6914          case TFU_DCI_FORMAT_1:
6915             CMCHKUNPK(cmUnpkTfuDciFormat1Info, &param->u.format1Info, mBuf);
6916             break;
6917          case TFU_DCI_FORMAT_1A:
6918             CMCHKUNPK(cmUnpkTfuDciFormat1aInfo, &param->u.format1aInfo, mBuf);
6919             break;
6920          case TFU_DCI_FORMAT_1B:
6921             CMCHKUNPK(cmUnpkTfuDciFormat1bInfo, &param->u.format1bInfo, mBuf);
6922             break;
6923          case TFU_DCI_FORMAT_1C:
6924             CMCHKUNPK(cmUnpkTfuDciFormat1cInfo, &param->u.format1cInfo, mBuf);
6925             break;
6926          case TFU_DCI_FORMAT_1D:
6927             CMCHKUNPK(cmUnpkTfuDciFormat1dInfo, &param->u.format1dInfo, mBuf);
6928             break;
6929          case TFU_DCI_FORMAT_2:
6930             CMCHKUNPK(cmUnpkTfuDciFormat2Info, &param->u.format2Info, mBuf);
6931             break;
6932          case TFU_DCI_FORMAT_2A:
6933             CMCHKUNPK(cmUnpkTfuDciFormat2AInfo, &param->u.format2AInfo, mBuf);
6934             break;
6935          case TFU_DCI_FORMAT_3:
6936             CMCHKUNPK(cmUnpkTfuDciFormat3Info, &param->u.format3Info, mBuf);
6937             break;
6938          case TFU_DCI_FORMAT_3A:
6939             CMCHKUNPK(cmUnpkTfuDciFormat3AInfo, &param->u.format3AInfo, mBuf);
6940             break;
6941 #ifdef EMTC_ENABLE            
6942          case TFU_DCI_FORMAT_6_0A:
6943             CMCHKUNPK(cmUnpkTfuDciFormat60aInfo, &param->u.format60aInfo, mBuf);
6944             printf("2. cmUnpkTfuDciInfo ::  dciFormat %d \n", param->dciFormat); 
6945             break;
6946          case TFU_DCI_FORMAT_6_1A:
6947             CMCHKUNPK(cmUnpkTfuDciFormat61aInfo, &param->u.format61aInfo, mBuf);
6948             printf("2. cmUnpkTfuDciInfo ::  dciFormat %d \n", param->dciFormat); 
6949             break;
6950          case TFU_DCI_FORMAT_6_2:
6951             CMCHKUNPK(cmUnpkTfuDciFormat62Info, &param->u.format62Info, mBuf);
6952             break;
6953
6954 #endif            
6955 #ifdef TFU_5GTF
6956          case TFU_DCI_FORMAT_A1:
6957             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
6958             break;
6959                         case TFU_DCI_FORMAT_A2:
6960             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
6961             break;
6962          case TFU_DCI_FORMAT_B1:
6963             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
6964             break;
6965                         case TFU_DCI_FORMAT_B2:
6966             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
6967             break;
6968 #endif
6969          default :
6970             return RFAILED;
6971       }
6972    return ROK;
6973 }
6974
6975
6976 \f
6977 /***********************************************************
6978 *
6979 *     Func : cmPkTfuSubbandInfo
6980 *
6981 *
6982 *     Desc : This structure contains the information needed to convey the start and size
6983  * of the subband in the CQI report.
6984 *
6985 *
6986 *     Ret  : S16
6987 *
6988 *     Notes:
6989 *
6990 *     File  : 
6991 *
6992 **********************************************************/
6993 #ifdef ANSI
6994 S16 cmPkTfuSubbandInfo
6995 (
6996 TfuSubbandInfo *param,
6997 Buffer *mBuf
6998 )
6999 #else
7000 S16 cmPkTfuSubbandInfo(param, mBuf)
7001 TfuSubbandInfo *param;
7002 Buffer *mBuf;
7003 #endif
7004 {
7005
7006
7007    CMCHKPK(oduUnpackUInt8, param->numRb, mBuf);
7008    CMCHKPK(oduUnpackUInt8, param->rbStart, mBuf);
7009    return ROK;
7010 }
7011
7012
7013 \f
7014 /***********************************************************
7015 *
7016 *     Func : cmUnpkTfuSubbandInfo
7017 *
7018 *
7019 *     Desc : This structure contains the information needed to convey the start and size
7020  * of the subband in the CQI report.
7021 *
7022 *
7023 *     Ret  : S16
7024 *
7025 *     Notes:
7026 *
7027 *     File  : 
7028 *
7029 **********************************************************/
7030 #ifdef ANSI
7031 S16 cmUnpkTfuSubbandInfo
7032 (
7033 TfuSubbandInfo *param,
7034 Buffer *mBuf
7035 )
7036 #else
7037 S16 cmUnpkTfuSubbandInfo(param, mBuf)
7038 TfuSubbandInfo *param;
7039 Buffer *mBuf;
7040 #endif
7041 {
7042
7043
7044    CMCHKUNPK(oduPackUInt8, &param->rbStart, mBuf);
7045    CMCHKUNPK(oduPackUInt8, &param->numRb, mBuf);
7046    return ROK;
7047 }
7048
7049
7050
7051 \f
7052 /***********************************************************
7053 *
7054 *     Func : cmPkTfuSubbandCqiInfo
7055 *
7056 *
7057 *     Desc : This structure is used to convey the subbannd CQI reported.
7058 *
7059 *
7060 *     Ret  : S16
7061 *
7062 *     Notes:
7063 *
7064 *     File  : 
7065 *
7066 **********************************************************/
7067 #ifdef ANSI
7068 S16 cmPkTfuSubbandCqiInfo
7069 (
7070 TfuSubbandCqiInfo *param,
7071 Buffer *mBuf
7072 )
7073 #else
7074 S16 cmPkTfuSubbandCqiInfo(param, mBuf)
7075 TfuSubbandCqiInfo *param;
7076 Buffer *mBuf;
7077 #endif
7078 {
7079
7080
7081    CMCHKPK(oduUnpackUInt8, param->cqiIdx, mBuf);
7082    CMCHKPK(cmPkTfuSubbandInfo, &param->subband, mBuf);
7083    return ROK;
7084 }
7085
7086
7087 \f
7088 /***********************************************************
7089 *
7090 *     Func : cmUnpkTfuSubbandCqiInfo
7091 *
7092 *
7093 *     Desc : This structure is used to convey the subbannd CQI reported.
7094 *
7095 *
7096 *     Ret  : S16
7097 *
7098 *     Notes:
7099 *
7100 *     File  : 
7101 *
7102 **********************************************************/
7103 #ifdef ANSI
7104 S16 cmUnpkTfuSubbandCqiInfo
7105 (
7106 TfuSubbandCqiInfo *param,
7107 Buffer *mBuf
7108 )
7109 #else
7110 S16 cmUnpkTfuSubbandCqiInfo(param, mBuf)
7111 TfuSubbandCqiInfo *param;
7112 Buffer *mBuf;
7113 #endif
7114 {
7115
7116
7117    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subband, mBuf);
7118    CMCHKUNPK(oduPackUInt8, &param->cqiIdx, mBuf);
7119    return ROK;
7120 }
7121
7122
7123 \f
7124 /***********************************************************
7125 *
7126 *     Func : cmPkTfuPdcchCceInfo
7127 *
7128 *
7129 *     Desc : This structure conveys the CCE information.
7130 *
7131 *
7132 *     Ret  : S16
7133 *
7134 *     Notes:
7135 *
7136 *     File  : 
7137 *
7138 **********************************************************/
7139 #ifdef ANSI
7140 S16 cmPkTfuPdcchCceInfo
7141 (
7142 TfuPdcchCceInfo *param,
7143 Buffer *mBuf
7144 )
7145 #else
7146 S16 cmPkTfuPdcchCceInfo(param, mBuf)
7147 TfuPdcchCceInfo *param;
7148 Buffer *mBuf;
7149 #endif
7150 {
7151
7152
7153    CMCHKPK(cmPkLteAggrLvl, param->aggrLvl, mBuf);
7154    CMCHKPK(oduUnpackUInt8, param->cceIdx, mBuf);
7155    return ROK;
7156 }
7157
7158
7159 \f
7160 /***********************************************************
7161 *
7162 *     Func : cmUnpkTfuPdcchCceInfo
7163 *
7164 *
7165 *     Desc : This structure conveys the CCE information.
7166 *
7167 *
7168 *     Ret  : S16
7169 *
7170 *     Notes:
7171 *
7172 *     File  : 
7173 *
7174 **********************************************************/
7175 #ifdef ANSI
7176 S16 cmUnpkTfuPdcchCceInfo
7177 (
7178 TfuPdcchCceInfo *param,
7179 Buffer *mBuf
7180 )
7181 #else
7182 S16 cmUnpkTfuPdcchCceInfo(param, mBuf)
7183 TfuPdcchCceInfo *param;
7184 Buffer *mBuf;
7185 #endif
7186 {
7187
7188
7189    CMCHKUNPK(oduPackUInt8, &param->cceIdx, mBuf);
7190    CMCHKUNPK(cmUnpkLteAggrLvl,(uint32_t *)&param->aggrLvl, mBuf);
7191    return ROK;
7192 }
7193
7194
7195 \f
7196 /***********************************************************
7197 *
7198 *     Func : cmPkTfuCqiPucchMode10
7199 *
7200 *
7201 *     Desc : This structure maps to the CQI mode 10. The report could either
7202   * convey a Rank index or a wideband CQI.
7203 *
7204 *
7205 *     Ret  : S16
7206 *
7207 *     Notes:
7208 *
7209 *     File  : 
7210 *
7211 **********************************************************/
7212 #ifdef ANSI
7213 S16 cmPkTfuCqiPucchMode10
7214 (
7215 TfuCqiPucchMode10 *param,
7216 Buffer *mBuf
7217 )
7218 #else
7219 S16 cmPkTfuCqiPucchMode10(param, mBuf)
7220 TfuCqiPucchMode10 *param;
7221 Buffer *mBuf;
7222 #endif
7223 {
7224
7225
7226       switch(param->type) {
7227          case TFU_RPT_CQI:
7228             CMCHKPK(oduUnpackUInt8, param->u.cqi, mBuf);
7229             break;
7230          case TFU_RPT_RI:
7231             CMCHKPK(oduUnpackUInt8, param->u.ri, mBuf);
7232             break;
7233          default :
7234             return RFAILED;
7235       }
7236    CMCHKPK(oduUnpackUInt32, param->type, mBuf);
7237    return ROK;
7238 }
7239
7240
7241 \f
7242 /***********************************************************
7243 *
7244 *     Func : cmUnpkTfuCqiPucchMode10
7245 *
7246 *
7247 *     Desc : This structure maps to the CQI mode 10. The report could either
7248   * convey a Rank index or a wideband CQI.
7249 *
7250 *
7251 *     Ret  : S16
7252 *
7253 *     Notes:
7254 *
7255 *     File  : 
7256 *
7257 **********************************************************/
7258 #ifdef ANSI
7259 S16 cmUnpkTfuCqiPucchMode10
7260 (
7261 TfuCqiPucchMode10 *param,
7262 Buffer *mBuf
7263 )
7264 #else
7265 S16 cmUnpkTfuCqiPucchMode10(param, mBuf)
7266 TfuCqiPucchMode10 *param;
7267 Buffer *mBuf;
7268 #endif
7269 {
7270
7271
7272    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->type, mBuf);
7273       switch(param->type) {
7274          case TFU_RPT_RI:
7275             CMCHKUNPK(oduPackUInt8, &param->u.ri, mBuf);
7276             break;
7277          case TFU_RPT_CQI:
7278             CMCHKUNPK(oduPackUInt8, &param->u.cqi, mBuf);
7279             break;
7280          default :
7281             return RFAILED;
7282       }
7283    return ROK;
7284 }
7285
7286
7287 \f
7288 /***********************************************************
7289 *
7290 *     Func : cmPkTfuCqiMode11Cqi
7291 *
7292 *
7293 *     Desc : This structure contains a wideband CQI, PMI and optionally a
7294   * wideband differential CQI.
7295 *
7296 *
7297 *     Ret  : S16
7298 *
7299 *     Notes:
7300 *
7301 *     File  : 
7302 *
7303 **********************************************************/
7304 #ifdef ANSI
7305 S16 cmPkTfuCqiMode11Cqi
7306 (
7307 TfuCqiMode11Cqi *param,
7308 Buffer *mBuf
7309 )
7310 #else
7311 S16 cmPkTfuCqiMode11Cqi(param, mBuf)
7312 TfuCqiMode11Cqi *param;
7313 Buffer *mBuf;
7314 #endif
7315 {
7316
7317
7318    CMCHKPK(cmPkTknUInt8, &param->wideDiffCqi, mBuf);
7319    CMCHKPK(oduUnpackUInt8, param->pmi, mBuf);
7320    CMCHKPK(oduUnpackUInt8, param->cqi, mBuf);
7321    return ROK;
7322 }
7323
7324
7325 \f
7326 /***********************************************************
7327 *
7328 *     Func : cmUnpkTfuCqiMode11Cqi
7329 *
7330 *
7331 *     Desc : This structure contains a wideband CQI, PMI and optionally a
7332   * wideband differential CQI.
7333 *
7334 *
7335 *     Ret  : S16
7336 *
7337 *     Notes:
7338 *
7339 *     File  : 
7340 *
7341 **********************************************************/
7342 #ifdef ANSI
7343 S16 cmUnpkTfuCqiMode11Cqi
7344 (
7345 TfuCqiMode11Cqi *param,
7346 Buffer *mBuf
7347 )
7348 #else
7349 S16 cmUnpkTfuCqiMode11Cqi(param, mBuf)
7350 TfuCqiMode11Cqi *param;
7351 Buffer *mBuf;
7352 #endif
7353 {
7354
7355
7356    CMCHKUNPK(oduPackUInt8, &param->cqi, mBuf);
7357    CMCHKUNPK(oduPackUInt8, &param->pmi, mBuf);
7358    CMCHKUNPK(cmUnpkTknUInt8, &param->wideDiffCqi, mBuf);
7359    return ROK;
7360 }
7361
7362
7363 \f
7364 /***********************************************************
7365 *
7366 *     Func : cmPkTfuCqiPucchMode11
7367 *
7368 *
7369 *     Desc : This structure maps to the CQI mode 11. The report could either
7370   * convey a Rank index or a CQI report.
7371 *
7372 *
7373 *     Ret  : S16
7374 *
7375 *     Notes:
7376 *
7377 *     File  : 
7378 *
7379 **********************************************************/
7380 #ifdef ANSI
7381 S16 cmPkTfuCqiPucchMode11
7382 (
7383 TfuCqiPucchMode11 *param,
7384 Buffer *mBuf
7385 )
7386 #else
7387 S16 cmPkTfuCqiPucchMode11(param, mBuf)
7388 TfuCqiPucchMode11 *param;
7389 Buffer *mBuf;
7390 #endif
7391 {
7392
7393
7394       switch(param->type) {
7395          case TFU_RPT_CQI:
7396             CMCHKPK(cmPkTfuCqiMode11Cqi, &param->u.cqi, mBuf);
7397             break;
7398          case TFU_RPT_RI:
7399             CMCHKPK(oduUnpackUInt8, param->u.ri, mBuf);
7400             break;
7401          default :
7402             return RFAILED;
7403       }
7404    CMCHKPK(oduUnpackUInt32, param->type, mBuf);
7405    return ROK;
7406 }
7407
7408
7409 \f
7410 /***********************************************************
7411 *
7412 *     Func : cmUnpkTfuCqiPucchMode11
7413 *
7414 *
7415 *     Desc : This structure maps to the CQI mode 11. The report could either
7416   * convey a Rank index or a CQI report.
7417 *
7418 *
7419 *     Ret  : S16
7420 *
7421 *     Notes:
7422 *
7423 *     File  : 
7424 *
7425 **********************************************************/
7426 #ifdef ANSI
7427 S16 cmUnpkTfuCqiPucchMode11
7428 (
7429 TfuCqiPucchMode11 *param,
7430 Buffer *mBuf
7431 )
7432 #else
7433 S16 cmUnpkTfuCqiPucchMode11(param, mBuf)
7434 TfuCqiPucchMode11 *param;
7435 Buffer *mBuf;
7436 #endif
7437 {
7438
7439
7440    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->type, mBuf);
7441       switch(param->type) {
7442          case TFU_RPT_RI:
7443             CMCHKUNPK(oduPackUInt8, &param->u.ri, mBuf);
7444             break;
7445          case TFU_RPT_CQI:
7446             CMCHKUNPK(cmUnpkTfuCqiMode11Cqi, &param->u.cqi, mBuf);
7447             break;
7448          default :
7449             return RFAILED;
7450       }
7451    return ROK;
7452 }
7453
7454
7455 \f
7456 /***********************************************************
7457 *
7458 *     Func : cmPkTfuCqiMode20SubCqi
7459 *
7460 *
7461 *     Desc : This structure contains the SubBand CQI for mode 2-0.
7462 *
7463 *
7464 *     Ret  : S16
7465 *
7466 *     Notes:
7467 *
7468 *     File  : 
7469 *
7470 **********************************************************/
7471 #ifdef ANSI
7472 S16 cmPkTfuCqiMode20SubCqi
7473 (
7474 TfuCqiMode20SubCqi *param,
7475 Buffer *mBuf
7476 )
7477 #else
7478 S16 cmPkTfuCqiMode20SubCqi(param, mBuf)
7479 TfuCqiMode20SubCqi *param;
7480 Buffer *mBuf;
7481 #endif
7482 {
7483
7484
7485    CMCHKPK(oduUnpackUInt8, param->l, mBuf);
7486    CMCHKPK(oduUnpackUInt8, param->cqi, mBuf);
7487    return ROK;
7488 }
7489
7490
7491 \f
7492 /***********************************************************
7493 *
7494 *     Func : cmUnpkTfuCqiMode20SubCqi
7495 *
7496 *
7497 *     Desc : This structure contains the SubBand CQI for mode 2-0.
7498 *
7499 *
7500 *     Ret  : S16
7501 *
7502 *     Notes:
7503 *
7504 *     File  : 
7505 *
7506 **********************************************************/
7507 #ifdef ANSI
7508 S16 cmUnpkTfuCqiMode20SubCqi
7509 (
7510 TfuCqiMode20SubCqi *param,
7511 Buffer *mBuf
7512 )
7513 #else
7514 S16 cmUnpkTfuCqiMode20SubCqi(param, mBuf)
7515 TfuCqiMode20SubCqi *param;
7516 Buffer *mBuf;
7517 #endif
7518 {
7519
7520
7521    CMCHKUNPK(oduPackUInt8, &param->cqi, mBuf);
7522    CMCHKUNPK(oduPackUInt8, &param->l, mBuf);
7523    return ROK;
7524 }
7525
7526
7527 \f
7528 /***********************************************************
7529 *
7530 *     Func : cmPkTfuCqiMode20Cqi
7531 *
7532 *
7533 *     Desc : This structure contains Mode20 CQI report. It could either be a
7534   * wideband CQI or a sub-band CQI.
7535 *
7536 *
7537 *     Ret  : S16
7538 *
7539 *     Notes:
7540 *
7541 *     File  : 
7542 *
7543 **********************************************************/
7544 #ifdef ANSI
7545 S16 cmPkTfuCqiMode20Cqi
7546 (
7547 TfuCqiMode20Cqi *param,
7548 Buffer *mBuf
7549 )
7550 #else
7551 S16 cmPkTfuCqiMode20Cqi(param, mBuf)
7552 TfuCqiMode20Cqi *param;
7553 Buffer *mBuf;
7554 #endif
7555 {
7556
7557
7558       switch(param->isWideband) {
7559          case FALSE:
7560             CMCHKPK(cmPkTfuCqiMode20SubCqi, &param->u.subCqi, mBuf);
7561             break;
7562          case TRUE:
7563             CMCHKPK(oduUnpackUInt8, param->u.wideCqi, mBuf);
7564             break;
7565          default :
7566             return RFAILED;
7567       }
7568    CMCHKPK(oduUnpackUInt8, param->isWideband, mBuf);
7569    return ROK;
7570 }
7571
7572
7573 \f
7574 /***********************************************************
7575 *
7576 *     Func : cmUnpkTfuCqiMode20Cqi
7577 *
7578 *
7579 *     Desc : This structure contains Mode20 CQI report. It could either be a
7580   * wideband CQI or a sub-band CQI.
7581 *
7582 *
7583 *     Ret  : S16
7584 *
7585 *     Notes:
7586 *
7587 *     File  : 
7588 *
7589 **********************************************************/
7590 #ifdef ANSI
7591 S16 cmUnpkTfuCqiMode20Cqi
7592 (
7593 TfuCqiMode20Cqi *param,
7594 Buffer *mBuf
7595 )
7596 #else
7597 S16 cmUnpkTfuCqiMode20Cqi(param, mBuf)
7598 TfuCqiMode20Cqi *param;
7599 Buffer *mBuf;
7600 #endif
7601 {
7602
7603
7604    CMCHKUNPK(oduPackUInt8, &param->isWideband, mBuf);
7605       switch(param->isWideband) {
7606          case TRUE:
7607             CMCHKUNPK(oduPackUInt8, &param->u.wideCqi, mBuf);
7608             break;
7609          case FALSE:
7610             CMCHKUNPK(cmUnpkTfuCqiMode20SubCqi, &param->u.subCqi, mBuf);
7611             break;
7612          default :
7613             return RFAILED;
7614       }
7615    return ROK;
7616 }
7617
7618
7619 \f
7620 /***********************************************************
7621 *
7622 *     Func : cmPkTfuCqiPucchMode20
7623 *
7624 *
7625 *     Desc : This structure maps to CQI mode 20. The report either contains a
7626   * Rank Index or a CQI report.
7627 *
7628 *
7629 *     Ret  : S16
7630 *
7631 *     Notes:
7632 *
7633 *     File  : 
7634 *
7635 **********************************************************/
7636 #ifdef ANSI
7637 S16 cmPkTfuCqiPucchMode20
7638 (
7639 TfuCqiPucchMode20 *param,
7640 Buffer *mBuf
7641 )
7642 #else
7643 S16 cmPkTfuCqiPucchMode20(param, mBuf)
7644 TfuCqiPucchMode20 *param;
7645 Buffer *mBuf;
7646 #endif
7647 {
7648
7649
7650       switch(param->type) {
7651          case TFU_RPT_CQI:
7652             CMCHKPK(cmPkTfuCqiMode20Cqi, &param->u.cqi, mBuf);
7653             break;
7654          case TFU_RPT_RI:
7655             CMCHKPK(oduUnpackUInt8, param->u.ri, mBuf);
7656             break;
7657          default :
7658             return RFAILED;
7659       }
7660    CMCHKPK(oduUnpackUInt32, param->type, mBuf);
7661    return ROK;
7662 }
7663
7664
7665 \f
7666 /***********************************************************
7667 *
7668 *     Func : cmUnpkTfuCqiPucchMode20
7669 *
7670 *
7671 *     Desc : This structure maps to CQI mode 20. The report either contains a
7672   * Rank Index or a CQI report.
7673 *
7674 *
7675 *     Ret  : S16
7676 *
7677 *     Notes:
7678 *
7679 *     File  : 
7680 *
7681 **********************************************************/
7682 #ifdef ANSI
7683 S16 cmUnpkTfuCqiPucchMode20
7684 (
7685 TfuCqiPucchMode20 *param,
7686 Buffer *mBuf
7687 )
7688 #else
7689 S16 cmUnpkTfuCqiPucchMode20(param, mBuf)
7690 TfuCqiPucchMode20 *param;
7691 Buffer *mBuf;
7692 #endif
7693 {
7694
7695
7696    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->type, mBuf);
7697       switch(param->type) {
7698          case TFU_RPT_RI:
7699             CMCHKUNPK(oduPackUInt8, &param->u.ri, mBuf);
7700             break;
7701          case TFU_RPT_CQI:
7702             CMCHKUNPK(cmUnpkTfuCqiMode20Cqi, &param->u.cqi, mBuf);
7703             break;
7704          default :
7705             return RFAILED;
7706       }
7707    return ROK;
7708 }
7709
7710
7711 \f
7712 /***********************************************************
7713 *
7714 *     Func : cmPkTfuCqiMode21SubCqi
7715 *
7716 *
7717 *     Desc : This structure contains the sub-band CQI report for mode 2-1. 
7718   * It carries a CQI, 'L' bit sub-band label, and optionally a differential CQI.
7719 *
7720 *
7721 *     Ret  : S16
7722 *
7723 *     Notes:
7724 *
7725 *     File  : 
7726 *
7727 **********************************************************/
7728 #ifdef ANSI
7729 S16 cmPkTfuCqiMode21SubCqi
7730 (
7731 TfuCqiMode21SubCqi *param,
7732 Buffer *mBuf
7733 )
7734 #else
7735 S16 cmPkTfuCqiMode21SubCqi(param, mBuf)
7736 TfuCqiMode21SubCqi *param;
7737 Buffer *mBuf;
7738 #endif
7739 {
7740
7741
7742    CMCHKPK(cmPkTknUInt8, &param->diffCqi, mBuf);
7743    CMCHKPK(oduUnpackUInt8, param->l, mBuf);
7744    CMCHKPK(oduUnpackUInt8, param->cqi, mBuf);
7745    return ROK;
7746 }
7747
7748
7749 \f
7750 /***********************************************************
7751 *
7752 *     Func : cmUnpkTfuCqiMode21SubCqi
7753 *
7754 *
7755 *     Desc : This structure contains the sub-band CQI report for mode 2-1. 
7756   * It carries a CQI, 'L' bit sub-band label, and optionally a differential CQI.
7757 *
7758 *
7759 *     Ret  : S16
7760 *
7761 *     Notes:
7762 *
7763 *     File  : 
7764 *
7765 **********************************************************/
7766 #ifdef ANSI
7767 S16 cmUnpkTfuCqiMode21SubCqi
7768 (
7769 TfuCqiMode21SubCqi *param,
7770 Buffer *mBuf
7771 )
7772 #else
7773 S16 cmUnpkTfuCqiMode21SubCqi(param, mBuf)
7774 TfuCqiMode21SubCqi *param;
7775 Buffer *mBuf;
7776 #endif
7777 {
7778
7779
7780    CMCHKUNPK(oduPackUInt8, &param->cqi, mBuf);
7781    CMCHKUNPK(oduPackUInt8, &param->l, mBuf);
7782    CMCHKUNPK(cmUnpkTknUInt8, &param->diffCqi, mBuf);
7783    return ROK;
7784 }
7785
7786
7787 \f
7788 /***********************************************************
7789 *
7790 *     Func : cmPkTfuCqiMode21WideCqi
7791 *
7792 *
7793 *     Desc : This structure contains the wideband CQI report for mode 2-1.
7794   * It carries a wideband CQI, PMI and optionally a differential CQI.
7795 *
7796 *
7797 *     Ret  : S16
7798 *
7799 *     Notes:
7800 *
7801 *     File  : 
7802 *
7803 **********************************************************/
7804 #ifdef ANSI
7805 S16 cmPkTfuCqiMode21WideCqi
7806 (
7807 TfuCqiMode21WideCqi *param,
7808 Buffer *mBuf
7809 )
7810 #else
7811 S16 cmPkTfuCqiMode21WideCqi(param, mBuf)
7812 TfuCqiMode21WideCqi *param;
7813 Buffer *mBuf;
7814 #endif
7815 {
7816
7817
7818    CMCHKPK(cmPkTknUInt8, &param->diffCqi, mBuf);
7819    CMCHKPK(oduUnpackUInt8, param->pmi, mBuf);
7820    CMCHKPK(oduUnpackUInt8, param->cqi, mBuf);
7821    return ROK;
7822 }
7823
7824
7825 \f
7826 /***********************************************************
7827 *
7828 *     Func : cmUnpkTfuCqiMode21WideCqi
7829 *
7830 *
7831 *     Desc : This structure contains the wideband CQI report for mode 2-1.
7832   * It carries a wideband CQI, PMI and optionally a differential CQI.
7833 *
7834 *
7835 *     Ret  : S16
7836 *
7837 *     Notes:
7838 *
7839 *     File  : 
7840 *
7841 **********************************************************/
7842 #ifdef ANSI
7843 S16 cmUnpkTfuCqiMode21WideCqi
7844 (
7845 TfuCqiMode21WideCqi *param,
7846 Buffer *mBuf
7847 )
7848 #else
7849 S16 cmUnpkTfuCqiMode21WideCqi(param, mBuf)
7850 TfuCqiMode21WideCqi *param;
7851 Buffer *mBuf;
7852 #endif
7853 {
7854
7855
7856    CMCHKUNPK(oduPackUInt8, &param->cqi, mBuf);
7857    CMCHKUNPK(oduPackUInt8, &param->pmi, mBuf);
7858    CMCHKUNPK(cmUnpkTknUInt8, &param->diffCqi, mBuf);
7859    return ROK;
7860 }
7861
7862
7863 \f
7864 /***********************************************************
7865 *
7866 *     Func : cmPkTfuCqiMode21Cqi
7867 *
7868 *
7869 *     Desc : This structure conveys CQI report for mode 2-1. The reported value
7870   * could either be wideband or sub-band.
7871 *
7872 *
7873 *     Ret  : S16
7874 *
7875 *     Notes:
7876 *
7877 *     File  : 
7878 *
7879 **********************************************************/
7880 #ifdef ANSI
7881 S16 cmPkTfuCqiMode21Cqi
7882 (
7883 TfuCqiMode21Cqi *param,
7884 Buffer *mBuf
7885 )
7886 #else
7887 S16 cmPkTfuCqiMode21Cqi(param, mBuf)
7888 TfuCqiMode21Cqi *param;
7889 Buffer *mBuf;
7890 #endif
7891 {
7892
7893
7894       switch(param->isWideband) {
7895          case FALSE:
7896             CMCHKPK(cmPkTfuCqiMode21SubCqi, &param->u.subCqi, mBuf);
7897             break;
7898          case TRUE:
7899             CMCHKPK(cmPkTfuCqiMode21WideCqi, &param->u.wideCqi, mBuf);
7900             break;
7901          default :
7902             return RFAILED;
7903       }
7904    CMCHKPK(oduUnpackUInt8, param->isWideband, mBuf);
7905    return ROK;
7906 }
7907
7908
7909 \f
7910 /***********************************************************
7911 *
7912 *     Func : cmUnpkTfuCqiMode21Cqi
7913 *
7914 *
7915 *     Desc : This structure conveys CQI report for mode 2-1. The reported value
7916   * could either be wideband or sub-band.
7917 *
7918 *
7919 *     Ret  : S16
7920 *
7921 *     Notes:
7922 *
7923 *     File  : 
7924 *
7925 **********************************************************/
7926 #ifdef ANSI
7927 S16 cmUnpkTfuCqiMode21Cqi
7928 (
7929 TfuCqiMode21Cqi *param,
7930 Buffer *mBuf
7931 )
7932 #else
7933 S16 cmUnpkTfuCqiMode21Cqi(param, mBuf)
7934 TfuCqiMode21Cqi *param;
7935 Buffer *mBuf;
7936 #endif
7937 {
7938
7939
7940    CMCHKUNPK(oduPackUInt8, &param->isWideband, mBuf);
7941       switch(param->isWideband) {
7942          case TRUE:
7943             CMCHKUNPK(cmUnpkTfuCqiMode21WideCqi, &param->u.wideCqi, mBuf);
7944             break;
7945          case FALSE:
7946             CMCHKUNPK(cmUnpkTfuCqiMode21SubCqi, &param->u.subCqi, mBuf);
7947             break;
7948          default :
7949             return RFAILED;
7950       }
7951    return ROK;
7952 }
7953
7954
7955 \f
7956 /***********************************************************
7957 *
7958 *     Func : cmPkTfuCqiPucchMode21
7959 *
7960 *
7961 *     Desc : This structure maps to the CQI reporting mode 2-1. The report either
7962   * conveys a Rank Indicator or a CQI report.
7963 *
7964 *
7965 *     Ret  : S16
7966 *
7967 *     Notes:
7968 *
7969 *     File  : 
7970 *
7971 **********************************************************/
7972 #ifdef ANSI
7973 S16 cmPkTfuCqiPucchMode21
7974 (
7975 TfuCqiPucchMode21 *param,
7976 Buffer *mBuf
7977 )
7978 #else
7979 S16 cmPkTfuCqiPucchMode21(param, mBuf)
7980 TfuCqiPucchMode21 *param;
7981 Buffer *mBuf;
7982 #endif
7983 {
7984
7985
7986       switch(param->type) {
7987          case TFU_RPT_CQI:
7988             CMCHKPK(cmPkTfuCqiMode21Cqi, &param->u.cqi, mBuf);
7989             break;
7990          case TFU_RPT_RI:
7991             CMCHKPK(oduUnpackUInt8, param->u.ri, mBuf);
7992             break;
7993          default :
7994             return RFAILED;
7995       }
7996    CMCHKPK(oduUnpackUInt32, param->type, mBuf);
7997    return ROK;
7998 }
7999
8000
8001 \f
8002 /***********************************************************
8003 *
8004 *     Func : cmUnpkTfuCqiPucchMode21
8005 *
8006 *
8007 *     Desc : This structure maps to the CQI reporting mode 2-1. The report either
8008   * conveys a Rank Indicator or a CQI report.
8009 *
8010 *
8011 *     Ret  : S16
8012 *
8013 *     Notes:
8014 *
8015 *     File  : 
8016 *
8017 **********************************************************/
8018 #ifdef ANSI
8019 S16 cmUnpkTfuCqiPucchMode21
8020 (
8021 TfuCqiPucchMode21 *param,
8022 Buffer *mBuf
8023 )
8024 #else
8025 S16 cmUnpkTfuCqiPucchMode21(param, mBuf)
8026 TfuCqiPucchMode21 *param;
8027 Buffer *mBuf;
8028 #endif
8029 {
8030
8031
8032    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->type, mBuf);
8033       switch(param->type) {
8034          case TFU_RPT_RI:
8035             CMCHKUNPK(oduPackUInt8, &param->u.ri, mBuf);
8036             break;
8037          case TFU_RPT_CQI:
8038             CMCHKUNPK(cmUnpkTfuCqiMode21Cqi, &param->u.cqi, mBuf);
8039             break;
8040          default :
8041             return RFAILED;
8042       }
8043    return ROK;
8044 }
8045
8046
8047 \f
8048 /***********************************************************
8049 *
8050 *     Func : cmPkTfuDlCqiPucch
8051 *
8052 *
8053 *     Desc : This structure conveys the Downlink CQI reported on PUCCH.
8054 *
8055 *
8056 *     Ret  : S16
8057 *
8058 *     Notes:
8059 *
8060 *     File  : 
8061 *
8062 **********************************************************/
8063 #ifdef ANSI
8064 S16 cmPkTfuDlCqiPucch
8065 (
8066 TfuDlCqiPucch *param,
8067 Buffer *mBuf
8068 )
8069 #else
8070 S16 cmPkTfuDlCqiPucch(param, mBuf)
8071 TfuDlCqiPucch *param;
8072 Buffer *mBuf;
8073 #endif
8074 {
8075
8076
8077       switch(param->mode) {
8078          case TFU_PUCCH_CQI_MODE21:
8079             CMCHKPK(cmPkTfuCqiPucchMode21, &param->u.mode21Info, mBuf);
8080             break;
8081          case TFU_PUCCH_CQI_MODE20:
8082             CMCHKPK(cmPkTfuCqiPucchMode20, &param->u.mode20Info, mBuf);
8083             break;
8084          case TFU_PUCCH_CQI_MODE11:
8085             CMCHKPK(cmPkTfuCqiPucchMode11, &param->u.mode11Info, mBuf);
8086             break;
8087          case TFU_PUCCH_CQI_MODE10:
8088             CMCHKPK(cmPkTfuCqiPucchMode10, &param->u.mode10Info, mBuf);
8089             break;
8090          default :
8091             return RFAILED;
8092       }
8093    CMCHKPK(oduUnpackUInt32, param->mode, mBuf);
8094    CMCHKPK(oduUnpackUInt8, param->cellIdx, mBuf);
8095    return ROK;
8096 }
8097
8098
8099 \f
8100 /***********************************************************
8101 *
8102 *     Func : cmUnpkTfuDlCqiPucch
8103 *
8104 *
8105 *     Desc : This structure conveys the Downlink CQI reported on PUCCH.
8106 *
8107 *
8108 *     Ret  : S16
8109 *
8110 *     Notes:
8111 *
8112 *     File  : 
8113 *
8114 **********************************************************/
8115 #ifdef ANSI
8116 S16 cmUnpkTfuDlCqiPucch
8117 (
8118 TfuDlCqiPucch *param,
8119 Buffer *mBuf
8120 )
8121 #else
8122 S16 cmUnpkTfuDlCqiPucch(param, mBuf)
8123 TfuDlCqiPucch *param;
8124 Buffer *mBuf;
8125 #endif
8126 {
8127
8128
8129    CMCHKUNPK(oduPackUInt8, &param->cellIdx, mBuf);
8130    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->mode, mBuf);
8131       switch(param->mode) {
8132          case TFU_PUCCH_CQI_MODE10:
8133             CMCHKUNPK(cmUnpkTfuCqiPucchMode10, &param->u.mode10Info, mBuf);
8134             break;
8135          case TFU_PUCCH_CQI_MODE11:
8136             CMCHKUNPK(cmUnpkTfuCqiPucchMode11, &param->u.mode11Info, mBuf);
8137             break;
8138          case TFU_PUCCH_CQI_MODE20:
8139             CMCHKUNPK(cmUnpkTfuCqiPucchMode20, &param->u.mode20Info, mBuf);
8140             break;
8141          case TFU_PUCCH_CQI_MODE21:
8142             CMCHKUNPK(cmUnpkTfuCqiPucchMode21, &param->u.mode21Info, mBuf);
8143             break;
8144          default :
8145             return RFAILED;
8146       }
8147    return ROK;
8148 }
8149
8150
8151 \f
8152 /***********************************************************
8153 *
8154 *     Func : cmPkTfuSubbandMode12
8155 *
8156 *
8157 *     Desc : This structure carries subband information and PMI, in the CQI
8158   * reporting format 1-2.
8159 *
8160 *
8161 *     Ret  : S16
8162 *
8163 *     Notes:
8164 *
8165 *     File  : 
8166 *
8167 **********************************************************/
8168 #ifdef ANSI
8169 S16 cmPkTfuSubbandMode12
8170 (
8171 TfuSubbandMode12 *param,
8172 Buffer *mBuf
8173 )
8174 #else
8175 S16 cmPkTfuSubbandMode12(param, mBuf)
8176 TfuSubbandMode12 *param;
8177 Buffer *mBuf;
8178 #endif
8179 {
8180
8181
8182    CMCHKPK(cmPkTfuSubbandInfo, &param->subBand, mBuf);
8183    CMCHKPK(oduUnpackUInt8, param->pmi, mBuf);
8184    return ROK;
8185 }
8186
8187
8188 \f
8189 /***********************************************************
8190 *
8191 *     Func : cmUnpkTfuSubbandMode12
8192 *
8193 *
8194 *     Desc : This structure carries subband information and PMI, in the CQI
8195   * reporting format 1-2.
8196 *
8197 *
8198 *     Ret  : S16
8199 *
8200 *     Notes:
8201 *
8202 *     File  : 
8203 *
8204 **********************************************************/
8205 #ifdef ANSI
8206 S16 cmUnpkTfuSubbandMode12
8207 (
8208 TfuSubbandMode12 *param,
8209 Buffer *mBuf
8210 )
8211 #else
8212 S16 cmUnpkTfuSubbandMode12(param, mBuf)
8213 TfuSubbandMode12 *param;
8214 Buffer *mBuf;
8215 #endif
8216 {
8217
8218
8219    CMCHKUNPK(oduPackUInt8, &param->pmi, mBuf);
8220    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subBand, mBuf);
8221    return ROK;
8222 }
8223
8224
8225 \f
8226 /***********************************************************
8227 *
8228 *     Func : cmPkTfuCqiPuschMode12
8229 *
8230 *
8231 *     Desc : This structure conveys information present in CQI reporting mode 1-2 received
8232  * over PUSCH.
8233 *
8234 *
8235 *     Ret  : S16
8236 *
8237 *     Notes:
8238 *
8239 *     File  : 
8240 *
8241 **********************************************************/
8242 #ifdef ANSI
8243 S16 cmPkTfuCqiPuschMode12
8244 (
8245 TfuCqiPuschMode12 *param,
8246 Buffer *mBuf
8247 )
8248 #else
8249 S16 cmPkTfuCqiPuschMode12(param, mBuf)
8250 TfuCqiPuschMode12 *param;
8251 Buffer *mBuf;
8252 #endif
8253 {
8254
8255    S32 i;
8256
8257    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8258       CMCHKPK(cmPkTfuSubbandMode12, &param->subbandArr[i], mBuf);
8259    }
8260    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8261       CMCHKPK(oduUnpackUInt8, param->cqiIdx[i], mBuf);
8262    }
8263    CMCHKPK(oduUnpackUInt8, param->numSubband, mBuf);
8264    return ROK;
8265 }
8266
8267
8268 \f
8269 /***********************************************************
8270 *
8271 *     Func : cmUnpkTfuCqiPuschMode12
8272 *
8273 *
8274 *     Desc : This structure conveys information present in CQI reporting mode 1-2 received
8275  * over PUSCH.
8276 *
8277 *
8278 *     Ret  : S16
8279 *
8280 *     Notes:
8281 *
8282 *     File  : 
8283 *
8284 **********************************************************/
8285 #ifdef ANSI
8286 S16 cmUnpkTfuCqiPuschMode12
8287 (
8288 TfuCqiPuschMode12 *param,
8289 Buffer *mBuf
8290 )
8291 #else
8292 S16 cmUnpkTfuCqiPuschMode12(param, mBuf)
8293 TfuCqiPuschMode12 *param;
8294 Buffer *mBuf;
8295 #endif
8296 {
8297
8298    S32 i;
8299
8300    CMCHKUNPK(oduPackUInt8, &param->numSubband, mBuf);
8301    for (i=0; i<TFU_MAX_TB; i++) {
8302       CMCHKUNPK(oduPackUInt8, &param->cqiIdx[i], mBuf);
8303    }
8304    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8305       CMCHKUNPK(cmUnpkTfuSubbandMode12, &param->subbandArr[i], mBuf);
8306    }
8307    return ROK;
8308 }
8309
8310
8311 \f
8312 /***********************************************************
8313 *
8314 *     Func : cmPkTfuCqiPuschMode20
8315 *
8316 *
8317 *     Desc : This structure conveys information present in CQI reporting mode 2-0 received
8318  * over PUSCH. This mode is for UE selected sub-band feedback.
8319 *
8320 *
8321 *     Ret  : S16
8322 *
8323 *     Notes:
8324 *
8325 *     File  : 
8326 *
8327 **********************************************************/
8328 #ifdef ANSI
8329 S16 cmPkTfuCqiPuschMode20
8330 (
8331 TfuCqiPuschMode20 *param,
8332 Buffer *mBuf
8333 )
8334 #else
8335 S16 cmPkTfuCqiPuschMode20(param, mBuf)
8336 TfuCqiPuschMode20 *param;
8337 Buffer *mBuf;
8338 #endif
8339 {
8340
8341    S32 i;
8342
8343    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8344       CMCHKPK(cmPkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8345    }
8346    CMCHKPK(oduUnpackUInt8, param->numSubband, mBuf);
8347    CMCHKPK(oduUnpackUInt8, param->wideBandCqi, mBuf);
8348    CMCHKPK(oduUnpackUInt8, param->cqiIdx, mBuf);
8349    return ROK;
8350 }
8351
8352
8353 \f
8354 /***********************************************************
8355 *
8356 *     Func : cmUnpkTfuCqiPuschMode20
8357 *
8358 *
8359 *     Desc : This structure conveys information present in CQI reporting mode 2-0 received
8360  * over PUSCH. This mode is for UE selected sub-band feedback.
8361 *
8362 *
8363 *     Ret  : S16
8364 *
8365 *     Notes:
8366 *
8367 *     File  : 
8368 *
8369 **********************************************************/
8370 #ifdef ANSI
8371 S16 cmUnpkTfuCqiPuschMode20
8372 (
8373 TfuCqiPuschMode20 *param,
8374 Buffer *mBuf
8375 )
8376 #else
8377 S16 cmUnpkTfuCqiPuschMode20(param, mBuf)
8378 TfuCqiPuschMode20 *param;
8379 Buffer *mBuf;
8380 #endif
8381 {
8382
8383    S32 i;
8384
8385    CMCHKUNPK(oduPackUInt8, &param->cqiIdx, mBuf);
8386    CMCHKUNPK(oduPackUInt8, &param->wideBandCqi, mBuf);
8387    CMCHKUNPK(oduPackUInt8, &param->numSubband, mBuf);
8388    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8389       CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8390    }
8391    return ROK;
8392 }
8393
8394 \f
8395 /***********************************************************
8396 *
8397 *     Func : cmPkTfuCqiPuschMode22
8398 *
8399 *
8400 *     Desc : This structure conveys information present in CQI reporting mode 2-2 received
8401  * over PUSCH.
8402 *
8403 *
8404 *     Ret  : S16
8405 *
8406 *     Notes:
8407 *
8408 *     File  : 
8409 *
8410 **********************************************************/
8411 #ifdef ANSI
8412 S16 cmPkTfuCqiPuschMode22
8413 (
8414 TfuCqiPuschMode22 *param,
8415 Buffer *mBuf
8416 )
8417 #else
8418 S16 cmPkTfuCqiPuschMode22(param, mBuf)
8419 TfuCqiPuschMode22 *param;
8420 Buffer *mBuf;
8421 #endif
8422 {
8423
8424    S32 i;
8425
8426
8427    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8428       CMCHKPK(cmPkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8429    }
8430
8431    CMCHKPK(oduUnpackUInt8, param->numSubband, mBuf);
8432    CMCHKPK(oduUnpackUInt8, param->wideBandPmi, mBuf);
8433    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8434       CMCHKPK(oduUnpackUInt8, param->wideBandCqi[i], mBuf);
8435    }
8436    CMCHKPK(oduUnpackUInt8, param->pmi, mBuf);
8437    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8438       CMCHKPK(oduUnpackUInt8, param->cqi[i], mBuf);
8439    }
8440    return ROK;
8441 }
8442
8443
8444 \f
8445 /***********************************************************
8446 *
8447 *     Func : cmUnpkTfuCqiPuschMode22
8448 *
8449 *
8450 *     Desc : This structure conveys information present in CQI reporting mode 2-2 received
8451  * over PUSCH.
8452 *
8453 *
8454 *     Ret  : S16
8455 *
8456 *     Notes:
8457 *
8458 *     File  : 
8459 *
8460 **********************************************************/
8461 #ifdef ANSI
8462 S16 cmUnpkTfuCqiPuschMode22
8463 (
8464 TfuCqiPuschMode22 *param,
8465 Buffer *mBuf
8466 )
8467 #else
8468 S16 cmUnpkTfuCqiPuschMode22(param, mBuf)
8469 TfuCqiPuschMode22 *param;
8470 Buffer *mBuf;
8471 #endif
8472 {
8473
8474    S32 i;
8475
8476    for (i=0; i<TFU_MAX_TB; i++) {
8477       CMCHKUNPK(oduPackUInt8, &param->cqi[i], mBuf);
8478    }
8479    CMCHKUNPK(oduPackUInt8, &param->pmi, mBuf);
8480    for (i=0; i<TFU_MAX_TB; i++) {
8481       CMCHKUNPK(oduPackUInt8, &param->wideBandCqi[i], mBuf);
8482    }
8483    CMCHKUNPK(oduPackUInt8, &param->wideBandPmi, mBuf);
8484    CMCHKUNPK(oduPackUInt8, &param->numSubband, mBuf);
8485
8486    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8487       CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8488    }
8489
8490    return ROK;
8491 }
8492
8493
8494 #ifdef ANSI
8495 S16 cmPkTfuSubbandMode30
8496 (
8497 TfuSubbandMode30 *param,
8498 Buffer *mBuf
8499 )
8500 #else
8501 S16 cmPkTfuSubbandMode30(param, mBuf)
8502 TfuSubbandMode30 *param;
8503 Buffer *mBuf;
8504 #endif
8505 {
8506
8507
8508    CMCHKPK(cmPkTfuSubbandInfo, &param->subBand, mBuf);
8509    CMCHKPK(oduUnpackUInt8, param->cqi, mBuf);
8510    return ROK;
8511 }
8512
8513
8514 #ifdef ANSI
8515 S16 cmUnpkTfuSubbandMode30
8516 (
8517 TfuSubbandMode30 *param,
8518 Buffer *mBuf
8519 )
8520 #else
8521 S16 cmUnpkTfuSubbandMode30(param, mBuf)
8522 TfuSubbandMode30 *param;
8523 Buffer *mBuf;
8524 #endif
8525 {
8526
8527
8528    CMCHKUNPK(oduPackUInt8, &param->cqi, mBuf);
8529    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subBand, mBuf);
8530    return ROK;
8531 }
8532
8533
8534 \f
8535 /***********************************************************
8536 *
8537 *     Func : cmPkTfuCqiPuschMode30
8538 *
8539 *
8540 *     Desc : This structure conveys information present in CQI reporting mode 3-0
8541  * received over PUSCH.
8542 *
8543 *
8544 *     Ret  : S16
8545 *
8546 *     Notes:
8547 *
8548 *     File  : 
8549 *
8550 **********************************************************/
8551 #ifdef ANSI
8552 S16 cmPkTfuCqiPuschMode30
8553 (
8554 TfuCqiPuschMode30 *param,
8555 Buffer *mBuf
8556 )
8557 #else
8558 S16 cmPkTfuCqiPuschMode30(param, mBuf)
8559 TfuCqiPuschMode30 *param;
8560 Buffer *mBuf;
8561 #endif
8562 {
8563
8564    S32 i;
8565
8566    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8567       CMCHKPK(cmPkTfuSubbandMode30, &param->subbandArr[i], mBuf);
8568    }
8569    CMCHKPK(oduUnpackUInt8, param->numSubband, mBuf);
8570    CMCHKPK(oduUnpackUInt8, param->wideBandCqi, mBuf);
8571    return ROK;
8572 }
8573
8574
8575 \f
8576 /***********************************************************
8577 *
8578 *     Func : cmUnpkTfuCqiPuschMode30
8579 *
8580 *
8581 *     Desc : This structure conveys information present in CQI reporting mode 3-0
8582  * received over PUSCH.
8583 *
8584 *
8585 *     Ret  : S16
8586 *
8587 *     Notes:
8588 *
8589 *     File  : 
8590 *
8591 **********************************************************/
8592 #ifdef ANSI
8593 S16 cmUnpkTfuCqiPuschMode30
8594 (
8595 TfuCqiPuschMode30 *param,
8596 Buffer *mBuf
8597 )
8598 #else
8599 S16 cmUnpkTfuCqiPuschMode30(param, mBuf)
8600 TfuCqiPuschMode30 *param;
8601 Buffer *mBuf;
8602 #endif
8603 {
8604
8605    S32 i;
8606
8607    CMCHKUNPK(oduPackUInt8, &param->wideBandCqi, mBuf);
8608    CMCHKUNPK(oduPackUInt8, &param->numSubband, mBuf);
8609    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8610       CMCHKUNPK(cmUnpkTfuSubbandMode30, &param->subbandArr[i], mBuf);
8611    }
8612    return ROK;
8613 }
8614
8615
8616 #ifdef ANSI
8617 S16 cmPkTfuSubbandMode31
8618 (
8619 TfuSubbandMode31 *param,
8620 Buffer *mBuf
8621 )
8622 #else
8623 S16 cmPkTfuSubbandMode31(param, mBuf)
8624 TfuSubbandMode31 *param;
8625 Buffer *mBuf;
8626 #endif
8627 {
8628
8629    S32 i;
8630
8631    CMCHKPK(cmPkTfuSubbandInfo, &param->subBand, mBuf);
8632    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8633       CMCHKPK(oduUnpackUInt8, param->cqi[i], mBuf);
8634    }
8635    return ROK;
8636 }
8637
8638
8639 #ifdef ANSI
8640 S16 cmUnpkTfuSubbandMode31
8641 (
8642 TfuSubbandMode31 *param,
8643 Buffer *mBuf
8644 )
8645 #else
8646 S16 cmUnpkTfuSubbandMode31(param, mBuf)
8647 TfuSubbandMode31 *param;
8648 Buffer *mBuf;
8649 #endif
8650 {
8651
8652    S32 i;
8653
8654    for (i=0; i<TFU_MAX_TB; i++) {
8655       CMCHKUNPK(oduPackUInt8, &param->cqi[i], mBuf);
8656    }
8657    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subBand, mBuf);
8658    return ROK;
8659 }
8660
8661
8662 \f
8663 /***********************************************************
8664 *
8665 *     Func : cmPkTfuCqiPuschMode31
8666 *
8667 *
8668 *     Desc : This structure conveys information present in CQI reporting mode 3-1
8669  * received over PUSCH.
8670 *
8671 *
8672 *     Ret  : S16
8673 *
8674 *     Notes:
8675 *
8676 *     File  : 
8677 *
8678 **********************************************************/
8679 #ifdef ANSI
8680 S16 cmPkTfuCqiPuschMode31
8681 (
8682 TfuCqiPuschMode31 *param,
8683 Buffer *mBuf
8684 )
8685 #else
8686 S16 cmPkTfuCqiPuschMode31(param, mBuf)
8687 TfuCqiPuschMode31 *param;
8688 Buffer *mBuf;
8689 #endif
8690 {
8691
8692    S32 i;
8693
8694
8695 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
8696 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
8697
8698 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
8699 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
8700    for (i=param->numSubband-1; i >= 0; i--) {
8701       CMCHKPK(cmPkTfuSubbandDlCqiInfo, &param->subbandCqiArr[i], mBuf);
8702    }
8703
8704    CMCHKPK(oduUnpackUInt8, param->numSubband, mBuf);
8705    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8706       CMCHKPK(oduUnpackUInt8, param->wideBandCqi[i], mBuf);
8707    }
8708    CMCHKPK(oduUnpackUInt8, param->pmi, mBuf);
8709    return ROK;
8710 }
8711
8712
8713 \f
8714 /***********************************************************
8715 *
8716 *     Func : cmUnpkTfuCqiPuschMode31
8717 *
8718 *
8719 *     Desc : This structure conveys information present in CQI reporting mode 3-1
8720  * received over PUSCH.
8721 *
8722 *
8723 *     Ret  : S16
8724 *
8725 *     Notes:
8726 *
8727 *     File  : 
8728 *
8729 **********************************************************/
8730 #ifdef ANSI
8731 S16 cmUnpkTfuCqiPuschMode31
8732 (
8733 TfuCqiPuschMode31 *param,
8734 Buffer *mBuf
8735 )
8736 #else
8737 S16 cmUnpkTfuCqiPuschMode31(param, mBuf)
8738 TfuCqiPuschMode31 *param;
8739 Buffer *mBuf;
8740 #endif
8741 {
8742
8743    S32 i;
8744
8745    CMCHKUNPK(oduPackUInt8, &param->pmi, mBuf);
8746    for (i=0; i<TFU_MAX_TB; i++) {
8747       CMCHKUNPK(oduPackUInt8, &param->wideBandCqi[i], mBuf);
8748    }
8749    CMCHKUNPK(oduPackUInt8, &param->numSubband, mBuf);
8750
8751 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
8752 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
8753    for (i=0; i<param->numSubband; i++) {
8754       CMCHKUNPK(cmUnpkTfuSubbandDlCqiInfo, &param->subbandCqiArr[i], mBuf);
8755    }
8756
8757
8758 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
8759 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
8760
8761    return ROK;
8762 }
8763
8764
8765 \f
8766 /***********************************************************
8767 *
8768 *     Func : cmPkTfuDlCqiPusch
8769 *
8770 *
8771 *     Desc : This structure conveys Downlink CQI information (mode and corresponding
8772  * CQI) received over PUSCH.
8773 *
8774 *
8775 *     Ret  : S16
8776 *
8777 *     Notes:
8778 *
8779 *     File  : 
8780 *
8781 **********************************************************/
8782 #ifdef ANSI
8783 S16 cmPkTfuDlCqiPusch
8784 (
8785 TfuDlCqiPusch *param,
8786 Buffer *mBuf
8787 )
8788 #else
8789 S16 cmPkTfuDlCqiPusch(param, mBuf)
8790 TfuDlCqiPusch *param;
8791 Buffer *mBuf;
8792 #endif
8793 {
8794
8795
8796       switch(param->mode) {
8797          case TFU_PUSCH_CQI_MODE_31:
8798             CMCHKPK(cmPkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
8799             break;
8800          case TFU_PUSCH_CQI_MODE_30:
8801             CMCHKPK(cmPkTfuCqiPuschMode30, &param->u.mode30Info, mBuf);
8802             break;
8803          case TFU_PUSCH_CQI_MODE_22:
8804             CMCHKPK(cmPkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
8805             break;
8806          case TFU_PUSCH_CQI_MODE_20:
8807             CMCHKPK(cmPkTfuCqiPuschMode20, &param->u.mode20Info, mBuf);
8808             break;
8809          case TFU_PUSCH_CQI_MODE_12:
8810             CMCHKPK(cmPkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
8811             break;
8812          default :
8813             return RFAILED;
8814       }
8815
8816    CMCHKPK(cmPkTknUInt8, &param->ri, mBuf);
8817    CMCHKPK(oduUnpackUInt32, param->mode, mBuf);
8818
8819    CMCHKPK(oduUnpackUInt8, param->cellIdx, mBuf);
8820    return ROK;
8821 }
8822
8823
8824 \f
8825 /***********************************************************
8826 *
8827 *     Func : cmUnpkTfuDlCqiPusch
8828 *
8829 *
8830 *     Desc : This structure conveys Downlink CQI information (mode and corresponding
8831  * CQI) received over PUSCH.
8832 *
8833 *
8834 *     Ret  : S16
8835 *
8836 *     Notes:
8837 *
8838 *     File  : 
8839 *
8840 **********************************************************/
8841 #ifdef ANSI
8842 S16 cmUnpkTfuDlCqiPusch
8843 (
8844 TfuDlCqiPusch *param,
8845 Buffer *mBuf
8846 )
8847 #else
8848 S16 cmUnpkTfuDlCqiPusch(param, mBuf)
8849 TfuDlCqiPusch *param;
8850 Buffer *mBuf;
8851 #endif
8852 {
8853
8854
8855    CMCHKUNPK(oduPackUInt8, &param->cellIdx, mBuf);
8856    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->mode, mBuf);
8857    CMCHKUNPK(cmUnpkTknUInt8, &param->ri, mBuf);
8858    switch(param->mode) {
8859       case TFU_PUSCH_CQI_MODE_12:
8860          CMCHKUNPK(cmUnpkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
8861          break;
8862       case TFU_PUSCH_CQI_MODE_20:
8863          CMCHKUNPK(cmUnpkTfuCqiPuschMode20, &param->u.mode20Info, mBuf);
8864          break;
8865       case TFU_PUSCH_CQI_MODE_22:
8866          CMCHKUNPK(cmUnpkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
8867          break;
8868       case TFU_PUSCH_CQI_MODE_30:
8869          CMCHKUNPK(cmUnpkTfuCqiPuschMode30, &param->u.mode30Info, mBuf);
8870          break;
8871       case TFU_PUSCH_CQI_MODE_31:
8872          CMCHKUNPK(cmUnpkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
8873          break;
8874       default :
8875          return RFAILED;
8876    }
8877    return ROK;
8878 }
8879
8880 \f
8881 /***********************************************************
8882 *
8883 *     Func : cmPkTfuDlCqiInfo
8884 *
8885 *
8886 *     Desc : This structure contains CQI information received over PUCCH or PUSCH.
8887 *
8888 *
8889 *     Ret  : S16
8890 *
8891 *     Notes:
8892 *
8893 *     File  : 
8894 *
8895 **********************************************************/
8896 #ifdef ANSI
8897 S16 cmPkTfuDlCqiInfo
8898 (
8899 uint8_t selector,
8900 TfuDlCqiInfo *param,
8901 Buffer *mBuf
8902 )
8903 #else
8904 S16 cmPkTfuDlCqiInfo(selector, param, mBuf)
8905 uint8_t selector;
8906 TfuDlCqiInfo *param;
8907 Buffer *mBuf;
8908 #endif
8909 {
8910    uint32_t idx;
8911
8912
8913    switch(selector) {
8914       case FALSE:
8915          for (idx = 0; idx < param->pusch.numOfCells; idx++)
8916          {
8917             CMCHKPK(cmPkTfuDlCqiPusch, &param->pusch.puschCqi[idx], mBuf);
8918          }
8919          CMCHKPK(oduUnpackUInt8, param->pusch.numOfCells, mBuf);
8920          break;
8921       case TRUE:
8922          CMCHKPK(cmPkTfuDlCqiPucch, &param->pucchCqi, mBuf);
8923          break;
8924       default :
8925          return RFAILED;
8926    }
8927    return ROK;
8928 }
8929
8930
8931 \f
8932 /***********************************************************
8933 *
8934 *     Func : cmUnpkTfuDlCqiInfo
8935 *
8936 *
8937 *     Desc : This structure contains CQI information received over PUCCH or PUSCH.
8938 *
8939 *
8940 *     Ret  : S16
8941 *
8942 *     Notes:
8943 *
8944 *     File  : 
8945 *
8946 **********************************************************/
8947 #ifdef ANSI
8948 S16 cmUnpkTfuDlCqiInfo
8949 (
8950 uint8_t selector,
8951 TfuDlCqiInfo *param,
8952 Buffer *mBuf
8953 )
8954 #else
8955 S16 cmUnpkTfuDlCqiInfo(selector, param, mBuf)
8956 uint8_t selector;
8957 TfuDlCqiInfo *param;
8958 Buffer *mBuf;
8959 #endif
8960 {
8961
8962    uint8_t idx;
8963
8964    switch(selector) {
8965       case TRUE:
8966          CMCHKUNPK(cmUnpkTfuDlCqiPucch, &param->pucchCqi, mBuf);
8967          break;
8968       case FALSE:
8969          CMCHKUNPK(oduPackUInt8, &param->pusch.numOfCells, mBuf);
8970          for (idx = param->pusch.numOfCells; idx > 0; idx--)
8971          {
8972             CMCHKUNPK(cmUnpkTfuDlCqiPusch, &param->pusch.puschCqi[idx-1], mBuf);
8973          }
8974          break;
8975       default :
8976          return RFAILED;
8977    }
8978    return ROK;
8979 }
8980
8981
8982 \f
8983 /***********************************************************
8984 *
8985 *     Func : cmPkTfuRecpReqInfo
8986 *
8987 *
8988 *     Desc : This structure is sent from Scheduler to PHY. This includes params
8989  * needed by PHY to decode the following 
8990  * 1. DATA on PUSCH
8991  * 2. HARQ Feedback on PUCCH
8992  * 3. CQI Report 
8993  * 4. RI Report
8994  * 5. SR Indications.
8995  * This structure carries the reception information for all the scheduled UE.
8996 *
8997 *
8998 *     Ret  : S16
8999 *
9000 *     Notes:
9001 *
9002 *     File  : 
9003 *
9004 **********************************************************/
9005 #ifdef ANSI
9006 S16 cmPkTfuRecpReqInfo
9007 (
9008 TfuRecpReqInfo *param,
9009 Buffer *mBuf
9010 )
9011 #else
9012 S16 cmPkTfuRecpReqInfo(param, mBuf)
9013 TfuRecpReqInfo *param;
9014 Buffer *mBuf;
9015 #endif
9016 {
9017    CmLList *node;
9018    uint32_t count;
9019    TfuUeRecpReqInfo *tfuUeRecpReqInfo;
9020
9021
9022    /*ccpu00116923 - ADD - SRS present support*/
9023    /*tfu_c_001.main_7 - ADD - SRS present field inclusion */
9024 #ifdef TFU_UPGRADE
9025    CMCHKPK(oduUnpackUInt8, param->srsPres, mBuf);
9026 #endif
9027    count = param->ueRecpReqLst.count;
9028    node = param->ueRecpReqLst.last;
9029    while (node) {
9030       tfuUeRecpReqInfo = (TfuUeRecpReqInfo *)node->node;
9031       node=node->prev;
9032       CMCHKPK(cmPkTfuUeRecpReqInfo, tfuUeRecpReqInfo, mBuf);
9033       cmLListDelFrm(&param->ueRecpReqLst, &tfuUeRecpReqInfo->lnk);
9034       tfuUeRecpReqInfo->lnk.node = (PTR)NULLP;
9035    }
9036    CMCHKPK(oduUnpackUInt32, count, mBuf);
9037    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
9038    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
9039    return ROK;
9040 }
9041
9042
9043 \f
9044 /***********************************************************
9045 *
9046 *     Func : cmUnpkTfuRecpReqInfo
9047 *
9048 *
9049 *     Desc : This structure is sent from Scheduler to PHY. This includes params
9050  * needed by PHY to decode the following 
9051  * 1. DATA on PUSCH
9052  * 2. HARQ Feedback on PUCCH
9053  * 3. CQI Report 
9054  * 4. RI Report
9055  * 5. SR Indications.
9056  * This structure carries the reception information for all the scheduled UE.
9057 *
9058 *
9059 *     Ret  : S16
9060 *
9061 *     Notes:
9062 *
9063 *     File  : 
9064 *
9065 **********************************************************/
9066 #ifdef ANSI
9067 S16 cmUnpkTfuRecpReqInfo
9068 (
9069 TfuRecpReqInfo *param,
9070 Ptr memCp,
9071 Buffer *mBuf
9072 )
9073 #else
9074 S16 cmUnpkTfuRecpReqInfo(param, memCp, mBuf)
9075 TfuRecpReqInfo *param;
9076 Ptr memCp;
9077 Buffer *mBuf;
9078 #endif
9079 {
9080
9081    uint32_t count, loopCnt;
9082    TfuUeRecpReqInfo *tfuUeRecpReqInfo;
9083
9084
9085    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
9086    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
9087    cmLListInit(&param->ueRecpReqLst);
9088    CMCHKUNPK(oduPackUInt32, &count, mBuf);
9089    for (loopCnt=0; loopCnt<count; loopCnt++) {
9090       cmGetMem((Ptr)memCp, sizeof(*tfuUeRecpReqInfo), (Ptr *)&tfuUeRecpReqInfo);
9091       CMCHKUNPK(cmUnpkTfuUeRecpReqInfo, tfuUeRecpReqInfo, mBuf);
9092       cmLListAdd2Tail(&param->ueRecpReqLst, &tfuUeRecpReqInfo->lnk);
9093       tfuUeRecpReqInfo->lnk.node = (PTR)tfuUeRecpReqInfo;
9094    }
9095    /*ccpu00116923 - ADD - SRS present support*/
9096    /*tfu_c_001.main_7 - ADD - SRS present field inclusion */
9097 #ifdef TFU_UPGRADE
9098    CMCHKUNPK(oduPackUInt8, &param->srsPres, mBuf);
9099 #endif
9100    return ROK;
9101 }
9102
9103
9104 \f
9105 /***********************************************************
9106 *
9107 *     Func : cmPkTfuPdcchInfo
9108 *
9109 *
9110 *     Desc : This structure contains the PDCCH to be sent on PHY i.e. DCI
9111   * formats. This information is associated with an RNTI.
9112 *
9113 *
9114 *     Ret  : S16
9115 *
9116 *     Notes:
9117 *
9118 *     File  : 
9119 *
9120 **********************************************************/
9121 #ifdef ANSI
9122 S16 cmPkTfuPdcchInfo
9123 (
9124 TfuPdcchInfo *param,
9125 Buffer *mBuf
9126 )
9127 #else
9128 S16 cmPkTfuPdcchInfo(param, mBuf)
9129 TfuPdcchInfo *param;
9130 Buffer *mBuf;
9131 #endif
9132 {
9133
9134 #ifdef TFU_5GTF
9135    CMCHKPK(oduUnpackUInt8, param->grpId, mBuf);
9136    CMCHKPK(oduUnpackUInt8, param->sccIdx, mBuf);
9137    CMCHKPK(oduUnpackUInt8, param->sectorId, mBuf);
9138 #endif /* TFU_5GTF */
9139    CMCHKPK(cmPkTfuDciInfo, &param->dci, mBuf);
9140    CMCHKPK(oduUnpackUInt8, param->dciNumOfBits, mBuf);
9141    CMCHKPK(cmPkLteAggrLvl, param->aggrLvl, mBuf);
9142    CMCHKPK(oduUnpackUInt16, param->nCce, mBuf);
9143 #ifdef LTEMAC_SPS
9144    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
9145    CMCHKPK(oduUnpackUInt8, param->isSpsRnti, mBuf);
9146 #endif
9147    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
9148    return ROK;
9149 }
9150
9151
9152 \f
9153 /***********************************************************
9154 *
9155 *     Func : cmUnpkTfuPdcchInfo
9156 *
9157 *
9158 *     Desc : This structure contains the PDCCH to be sent on PHY i.e. DCI
9159   * formats. This information is associated with an RNTI.
9160 *
9161 *
9162 *     Ret  : S16
9163 *
9164 *     Notes:
9165 *
9166 *     File  : 
9167 *
9168 **********************************************************/
9169 #ifdef ANSI
9170 S16 cmUnpkTfuPdcchInfo
9171 (
9172 TfuPdcchInfo *param,
9173 Buffer *mBuf
9174 )
9175 #else
9176 S16 cmUnpkTfuPdcchInfo(param, mBuf)
9177 TfuPdcchInfo *param;
9178 Buffer *mBuf;
9179 #endif
9180 {
9181
9182
9183    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
9184 #ifdef LTEMAC_SPS
9185    CMCHKUNPK(oduPackUInt8, &param->isSpsRnti, mBuf);
9186    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
9187 #endif
9188    CMCHKUNPK(oduPackUInt16, &param->nCce, mBuf);
9189    CMCHKUNPK(cmUnpkLteAggrLvl, (uint32_t*)&param->aggrLvl, mBuf);
9190    CMCHKUNPK(oduPackUInt8, &param->dciNumOfBits, mBuf);
9191    CMCHKUNPK(cmUnpkTfuDciInfo, &param->dci, mBuf);
9192 #ifdef TFU_5GTF 
9193    CMCHKUNPK(oduPackUInt8, &param->sectorId, mBuf);
9194    CMCHKUNPK(oduPackUInt8, &param->sccIdx, mBuf);
9195    CMCHKUNPK(oduPackUInt8, &param->grpId, mBuf);
9196 #endif /* TFU_5GTF */
9197    return ROK;
9198 }
9199
9200
9201 \f
9202 /***********************************************************
9203 *
9204 *     Func : cmPkTfuPhichInfo
9205 *
9206 *
9207 *     Desc : This structure contains one PHICH information. In order to locate the
9208  * resources to be used for PHICH the following information is provided along
9209  * with the feedback -
9210  * -# rbStart
9211  * -# nDmrs
9212 *
9213 *
9214 *     Ret  : S16
9215 *
9216 *     Notes:
9217 *
9218 *     File  : 
9219 *
9220 **********************************************************/
9221 #ifdef ANSI
9222 S16 cmPkTfuPhichInfo
9223 (
9224 TfuPhichInfo *param,
9225 Buffer *mBuf
9226 )
9227 #else
9228 S16 cmPkTfuPhichInfo(param, mBuf)
9229 TfuPhichInfo *param;
9230 Buffer *mBuf;
9231 #endif
9232 {
9233
9234 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
9235 #ifdef TFU_UPGRADE
9236    CMCHKPK(oduUnpackUInt16, param->txPower, mBuf);
9237 #endif
9238 #ifdef TFU_TDD
9239    CMCHKPK(oduUnpackUInt8, param->iPhich, mBuf);
9240 #endif
9241    CMCHKPK(oduUnpackUInt8, param->isAck, mBuf);
9242    CMCHKPK(oduUnpackUInt8, param->nDmrs, mBuf);
9243    CMCHKPK(oduUnpackUInt8, param->rbStart, mBuf);
9244    return ROK;
9245 }
9246
9247
9248 \f
9249 /***********************************************************
9250 *
9251 *     Func : cmUnpkTfuPhichInfo
9252 *
9253 *
9254 *     Desc : This structure contains one PHICH information. In order to locate the
9255  * resources to be used for PHICH the following information is provided along
9256  * with the feedback -
9257  * -# rbStart
9258  * -# nDmrs
9259 *
9260 *
9261 *     Ret  : S16
9262 *
9263 *     Notes:
9264 *
9265 *     File  : 
9266 *
9267 **********************************************************/
9268 #ifdef ANSI
9269 S16 cmUnpkTfuPhichInfo
9270 (
9271 TfuPhichInfo *param,
9272 Buffer *mBuf
9273 )
9274 #else
9275 S16 cmUnpkTfuPhichInfo(param, mBuf)
9276 TfuPhichInfo *param;
9277 Buffer *mBuf;
9278 #endif
9279 {
9280
9281
9282    CMCHKUNPK(oduPackUInt8, &param->rbStart, mBuf);
9283    CMCHKUNPK(oduPackUInt8, &param->nDmrs, mBuf);
9284    CMCHKUNPK(oduPackUInt8, &param->isAck, mBuf);
9285 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
9286 #ifdef TFU_TDD
9287    CMCHKUNPK(oduPackUInt8, &param->iPhich, mBuf);
9288 #endif
9289 #ifdef TFU_UPGRADE   
9290    CMCHKUNPK(oduPackUInt16, &param->txPower, mBuf);
9291 #endif
9292    return ROK;
9293 }
9294
9295
9296 \f
9297 /***********************************************************
9298 *
9299 *     Func : cmPkTfuCntrlReqInfo
9300 *
9301 *
9302 *     Desc : This structure is sent from Scheduler to PHY. This includes all the
9303  * control information to be sent to the UE. 
9304  * -# PDCCH  Physical Downlink Control Channel
9305  * -# PHICH  Physical HARQ Indicator Channel
9306  * -# PCFICH Physical Control Format Indicator Channel
9307 *
9308 *
9309 *     Ret  : S16
9310 *
9311 *     Notes:
9312 *
9313 *     File  : 
9314 *
9315 **********************************************************/
9316 #ifdef ANSI
9317 S16 cmPkTfuCntrlReqInfo
9318 (
9319 TfuCntrlReqInfo *param,
9320 Buffer *mBuf
9321 )
9322 #else
9323 S16 cmPkTfuCntrlReqInfo(param, mBuf)
9324 TfuCntrlReqInfo *param;
9325 Buffer *mBuf;
9326 #endif
9327 {
9328
9329    TfuPdcchInfo   *tfuPdcchInfo;
9330    TfuPhichInfo *tfuPhichInfo;
9331    CmLList *node;
9332    uint32_t count;
9333
9334 #ifdef EMTC_ENABLE
9335    count = param->dlMpdcchLst.count;
9336    node = param->dlMpdcchLst.last;
9337    while (node) {
9338       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9339       node=node->prev;
9340       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9341       cmLListDelFrm(&param->dlMpdcchLst, &tfuPdcchInfo->lnk);
9342       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9343    }
9344    CMCHKPK(oduUnpackUInt32, count, mBuf);
9345    count = param->ulMpdcchLst.count;
9346    node = param->ulMpdcchLst.last;
9347    while (node) {
9348       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9349       node=node->prev;
9350       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9351       cmLListDelFrm(&param->ulMpdcchLst, &tfuPdcchInfo->lnk);
9352       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9353    }
9354    CMCHKPK(oduUnpackUInt32, count, mBuf);
9355 #endif      
9356 #ifdef LTEMAC_SPS /* SPS_NEW_CHGS */
9357    CMCHKPK(oduPackBool, param->isSPSOcc, mBuf);
9358 #endif
9359    count = param->phichLst.count;
9360    node = param->phichLst.last;
9361    while (node) {
9362       tfuPhichInfo = (TfuPhichInfo *)node->node;
9363       node=node->prev;
9364       CMCHKPK(cmPkTfuPhichInfo, tfuPhichInfo, mBuf);
9365       cmLListDelFrm(&param->phichLst, &tfuPhichInfo->lnk);
9366       tfuPhichInfo->lnk.node = (PTR)NULLP;
9367    }
9368    CMCHKPK(oduUnpackUInt32, count, mBuf);
9369    count = param->dlPdcchLst.count;
9370    node = param->dlPdcchLst.last;
9371    while (node) {
9372       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9373       node=node->prev;
9374       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9375       cmLListDelFrm(&param->dlPdcchLst, &tfuPdcchInfo->lnk);
9376       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9377    }
9378    CMCHKPK(oduUnpackUInt32, count, mBuf);
9379    count = param->ulPdcchLst.count;
9380    node = param->ulPdcchLst.last;
9381    while (node) {
9382       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9383       node=node->prev;
9384 #ifdef UL_ADPT_DBG      
9385       printf("ulPdcchLst count %d  time[ %d %d] \n",count,param->ulTiming.sfn,param->ulTiming.subframe);
9386 #endif
9387       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9388       cmLListDelFrm(&param->ulPdcchLst, &tfuPdcchInfo->lnk);
9389       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9390    }
9391    CMCHKPK(oduUnpackUInt32, count, mBuf);
9392    CMCHKPK(oduUnpackUInt8, param->cfi, mBuf);
9393    CMCHKPK(cmPkLteTimingInfo, &param->dlTiming, mBuf);
9394    CMCHKPK(cmPkLteTimingInfo, &param->ulTiming, mBuf);
9395    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
9396    return ROK;
9397 }
9398
9399
9400 \f
9401 /***********************************************************
9402 *
9403 *     Func : cmUnpkTfuCntrlReqInfo
9404 *
9405 *
9406 *     Desc : This structure is sent from Scheduler to PHY. This includes all the
9407  * control information to be sent to the UE. 
9408  * -# PDCCH  Physical Downlink Control Channel
9409  * -# PHICH  Physical HARQ Indicator Channel
9410  * -# PCFICH Physical Control Format Indicator Channel
9411 *
9412 *
9413 *     Ret  : S16
9414 *
9415 *     Notes:
9416 *
9417 *     File  : 
9418 *
9419 **********************************************************/
9420 #ifdef ANSI
9421 S16 cmUnpkTfuCntrlReqInfo
9422 (
9423 TfuCntrlReqInfo *param,
9424 Ptr memCp,
9425 Buffer *mBuf
9426 )
9427 #else
9428 S16 cmUnpkTfuCntrlReqInfo(param, memCp, mBuf)
9429 TfuCntrlReqInfo *param;
9430 Ptr memCp;
9431 Buffer *mBuf;
9432 #endif
9433 {
9434
9435    TfuPdcchInfo *tfuPdcchInfo;
9436    uint32_t count, loopCnt;
9437    TfuPhichInfo *tfuPhichInfo;
9438
9439
9440    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
9441    CMCHKUNPK(cmUnpkLteTimingInfo, &param->ulTiming, mBuf);
9442    CMCHKUNPK(cmUnpkLteTimingInfo, &param->dlTiming, mBuf);
9443    CMCHKUNPK(oduPackUInt8, &param->cfi, mBuf);
9444    cmLListInit(&param->ulPdcchLst);
9445    CMCHKUNPK(oduPackUInt32, &count, mBuf);
9446    for (loopCnt=0; loopCnt<count; loopCnt++) {
9447       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9448       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9449       cmLListAdd2Tail(&param->ulPdcchLst, &tfuPdcchInfo->lnk);
9450       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9451    }
9452    cmLListInit(&param->dlPdcchLst);
9453    CMCHKUNPK(oduPackUInt32, &count, mBuf);
9454    for (loopCnt=0; loopCnt<count; loopCnt++) {
9455       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9456       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9457       cmLListAdd2Tail(&param->dlPdcchLst, &tfuPdcchInfo->lnk);
9458       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9459    }
9460    cmLListInit(&param->phichLst);
9461    CMCHKUNPK(oduPackUInt32, &count, mBuf);
9462    for (loopCnt=0; loopCnt<count; loopCnt++) {
9463       cmGetMem((Ptr)memCp, sizeof(*tfuPhichInfo), (Ptr *)&tfuPhichInfo);
9464       CMCHKUNPK(cmUnpkTfuPhichInfo, tfuPhichInfo, mBuf);
9465       cmLListAdd2Tail(&param->phichLst, &tfuPhichInfo->lnk);
9466       tfuPhichInfo->lnk.node = (PTR)tfuPhichInfo;
9467    }
9468
9469 #ifdef LTEMAC_SPS /* SPS_NEW_CHGS */
9470    CMCHKUNPK(oduUnpackBool, &param->isSPSOcc, mBuf);
9471 #endif
9472 #ifdef EMTC_ENABLE   
9473    cmLListInit(&param->ulMpdcchLst);
9474    CMCHKUNPK(oduPackUInt32, &count, mBuf);
9475    for (loopCnt=0; loopCnt<count; loopCnt++) {
9476       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9477       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9478       cmLListAdd2Tail(&param->ulMpdcchLst, &tfuPdcchInfo->lnk);
9479       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9480    }
9481    cmLListInit(&param->dlMpdcchLst);
9482    CMCHKUNPK(oduPackUInt32, &count, mBuf);
9483    printf("4. cmUnpkTfuCntrlReqInfo :: count %ld \n", count); 
9484    for (loopCnt=0; loopCnt<count; loopCnt++) {
9485       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9486       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9487       cmLListAdd2Tail(&param->dlMpdcchLst, &tfuPdcchInfo->lnk);
9488       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9489       printf("5. cmUnpkTfuCntrlReqInfo :: Failed \n"); 
9490    }
9491 #endif  
9492    return ROK;
9493 }
9494
9495
9496 \f
9497 /***********************************************************
9498 *
9499 *     Func : cmPkTfuPdschDciInfo
9500 *
9501 *
9502 *     Desc : This structure Carries the control information that would be needed
9503   * by the Physical layer to process the data to be sent on PDSCH.
9504 *
9505 *
9506 *     Ret  : S16
9507 *
9508 *     Notes:
9509 *
9510 *     File  : 
9511 *
9512 **********************************************************/
9513 #ifdef ANSI
9514 S16 cmPkTfuPdschDciInfo
9515 (
9516 TfuPdschDciInfo *param,
9517 Buffer *mBuf
9518 )
9519 #else
9520 S16 cmPkTfuPdschDciInfo(param, mBuf)
9521 TfuPdschDciInfo *param;
9522 Buffer *mBuf;
9523 #endif
9524 {
9525
9526
9527       switch(param->format) {
9528 #ifdef TFU_5GTF
9529          case TFU_DCI_FORMAT_B1:
9530             /* 
9531             if (param->u.formatB1Info.RBAssign <= 324)
9532             {
9533                printf("DCI Format: [B1] RBAssign: [%d] MCS: [%d]", 
9534                      param->u.formatB1Info.RBAssign, 
9535                      param->u.formatB1Info.u.rbAssignB1Val324.mcs);
9536             } 
9537             */
9538             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
9539             break;
9540          case TFU_DCI_FORMAT_B2:
9541             /* 
9542             if (param->u.formatB2Info.RBAssign <= 324)
9543             {
9544                printf("DCI Format: [B2] RBAssign: [%d] MCS: [%d]", 
9545                      param->u.formatB2Info.RBAssign, 
9546                      param->u.formatB2Info.u.rbAssignB1Val324.mcs);
9547             } 
9548             */
9549             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
9550             break;
9551          case TFU_DCI_FORMAT_A1:
9552             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
9553             break;
9554          case TFU_DCI_FORMAT_A2:
9555             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
9556             break;
9557 #endif
9558 #ifdef EMTC_ENABLE            
9559          case TFU_DCI_FORMAT_6_2:
9560              CMCHKPK(cmPkTfuDciFormat62AllocInfo, &param->u.format62AllocInfo, mBuf);
9561          break;
9562          case TFU_DCI_FORMAT_6_1A:
9563             CMCHKPK(cmPkTfuDciFormat6AAllocInfo, &param->u.format61AllocInfo, mBuf);
9564             break;
9565 #endif            
9566          case TFU_DCI_FORMAT_2A:
9567             CMCHKPK(cmPkTfuDciFormat2AAllocInfo, &param->u.format2AAllocInfo, mBuf);
9568             break;
9569          case TFU_DCI_FORMAT_2:
9570             CMCHKPK(cmPkTfuDciFormat2AllocInfo, &param->u.format2AllocInfo, mBuf);
9571             break;
9572          case TFU_DCI_FORMAT_1D:
9573             CMCHKPK(cmPkTfuDciFormat1dAllocInfo, &param->u.format1dAllocInfo, mBuf);
9574             break;
9575          case TFU_DCI_FORMAT_1C:
9576             CMCHKPK(cmPkTfuDciFormat1cInfo, &param->u.format1cAllocInfo, mBuf);
9577             break;
9578          case TFU_DCI_FORMAT_1B:
9579             CMCHKPK(cmPkTfuDciFormat1bAllocInfo, &param->u.format1bAllocInfo, mBuf);
9580             break;
9581          case TFU_DCI_FORMAT_1A:
9582             CMCHKPK(cmPkTfuDciFormat1aAllocInfo, &param->u.format1aAllocInfo, mBuf);
9583             break;
9584          case TFU_DCI_FORMAT_1:
9585             CMCHKPK(cmPkTfuDciFormat1AllocInfo, &param->u.format1AllocInfo, mBuf);
9586             break;
9587          default :
9588             return RFAILED;
9589       }
9590    CMCHKPK(oduUnpackUInt32, param->format, mBuf);
9591    return ROK;
9592 }
9593
9594
9595 \f
9596 /***********************************************************
9597 *
9598 *     Func : cmUnpkTfuPdschDciInfo
9599 *
9600 *
9601 *     Desc : This structure Carries the control information that would be needed
9602   * by the Physical layer to process the data to be sent on PDSCH.
9603 *
9604 *
9605 *     Ret  : S16
9606 *
9607 *     Notes:
9608 *
9609 *     File  : 
9610 *
9611 **********************************************************/
9612 #ifdef ANSI
9613 S16 cmUnpkTfuPdschDciInfo
9614 (
9615 TfuPdschDciInfo *param,
9616 Buffer *mBuf
9617 )
9618 #else
9619 S16 cmUnpkTfuPdschDciInfo(param, mBuf)
9620 TfuPdschDciInfo *param;
9621 Buffer *mBuf;
9622 #endif
9623 {
9624
9625
9626    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->format, mBuf);
9627       switch(param->format) {
9628          case TFU_DCI_FORMAT_1:
9629             CMCHKUNPK(cmUnpkTfuDciFormat1AllocInfo, &param->u.format1AllocInfo, mBuf);
9630             break;
9631          case TFU_DCI_FORMAT_1A:
9632             CMCHKUNPK(cmUnpkTfuDciFormat1aAllocInfo, &param->u.format1aAllocInfo, mBuf);
9633             break;
9634          case TFU_DCI_FORMAT_1B:
9635             CMCHKUNPK(cmUnpkTfuDciFormat1bAllocInfo, &param->u.format1bAllocInfo, mBuf);
9636             break;
9637          case TFU_DCI_FORMAT_1C:
9638             CMCHKUNPK(cmUnpkTfuDciFormat1cInfo, &param->u.format1cAllocInfo, mBuf);
9639             break;
9640          case TFU_DCI_FORMAT_1D:
9641             CMCHKUNPK(cmUnpkTfuDciFormat1dAllocInfo, &param->u.format1dAllocInfo, mBuf);
9642             break;
9643          case TFU_DCI_FORMAT_2:
9644             CMCHKUNPK(cmUnpkTfuDciFormat2AllocInfo, &param->u.format2AllocInfo, mBuf);
9645             break;
9646          case TFU_DCI_FORMAT_2A:
9647             CMCHKUNPK(cmUnpkTfuDciFormat2AAllocInfo, &param->u.format2AAllocInfo, mBuf);
9648             break;
9649 #ifdef EMTC_ENABLE            
9650          case TFU_DCI_FORMAT_6_1A:
9651             CMCHKUNPK(cmUnpkTfuDciFormat6AAllocInfo, &param->u.format61AllocInfo, mBuf);
9652             break;
9653          case TFU_DCI_FORMAT_6_2:
9654             CMCHKUNPK(cmUnpkTfuDciFormat62AllocInfo, &param->u.format62AllocInfo, mBuf);
9655             break;
9656 #endif   
9657 #ifdef TFU_5GTF
9658          case TFU_DCI_FORMAT_A1:
9659             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
9660             break;
9661                         case TFU_DCI_FORMAT_A2:
9662             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
9663             break;
9664          case TFU_DCI_FORMAT_B1:
9665             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
9666             break;
9667                         case TFU_DCI_FORMAT_B2:
9668             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
9669             break;
9670 #endif
9671          default :
9672             return RFAILED;
9673       }
9674    return ROK;
9675 }
9676 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
9677 #ifdef TFU_UPGRADE
9678 /***********************************************************
9679 *
9680 *     Func : cmPkTfuBfVectorInfo
9681 *
9682 *
9683 *     Desc : This structure conveys the BeamForming Vector 
9684 *               Information that hold relevance to Tx Mode 7
9685 *
9686 *
9687 *     Ret  : S16
9688 *
9689 *     Notes:
9690 *
9691 *     File  : 
9692 *
9693 **********************************************************/
9694 #ifdef ANSI
9695 S16 cmPkTfuBfVectorInfo
9696 (
9697 TfuBfVectorInfo *param,
9698 Buffer *mBuf
9699 )
9700 #else
9701 S16 cmPkTfuBfVectorInfo(param, mBuf)
9702 TfuBfVectorInfo *param;
9703 Buffer *mBuf;
9704 #endif
9705 {
9706    S32 idx, idx2;
9707    for(idx=TFU_MAX_DL_SUBBAND-1;idx>=0; idx--)
9708    {
9709       for (idx2=param->numPhyAnt -1; idx2 >= 0; idx2--) {
9710       CMCHKPK(oduUnpackUInt16, param->bfValue[idx2], mBuf);}
9711       CMCHKPK(oduUnpackUInt8, param->numPhyAnt, mBuf);
9712       CMCHKPK(oduUnpackUInt8, param->sbIndex, mBuf);
9713    }
9714    return ROK;
9715 }
9716
9717 /***********************************************************
9718 *
9719 *     Func : cmUnpkTfuBfVectorInfo
9720 *
9721 *
9722 *     Desc : This structure conveys the BeamForming Vector 
9723 *               Information that hold relevance to Tx Mode 7
9724 *
9725 *
9726 *     Ret  : S16
9727 *
9728 *     Notes:
9729 *
9730 *     File  : 
9731 *
9732 **********************************************************/
9733 #ifdef ANSI
9734 S16 cmUnpkTfuBfVectorInfo
9735 (
9736    TfuBfVectorInfo *param,
9737    Buffer *mBuf
9738 )
9739 #else
9740 S16 cmUnpkTfuBfVectorInfo(param, mBuf)
9741  TfuBfVectorInfo *param;
9742  Buffer *mBuf;
9743 #endif
9744 {
9745    S32 idx, idx2;
9746     for(idx=0;idx<TFU_MAX_DL_SUBBAND; idx++)
9747    {
9748       CMCHKUNPK(oduPackUInt8, &param->sbIndex, mBuf);
9749       CMCHKUNPK(oduPackUInt8, &param->numPhyAnt, mBuf);
9750       for (idx2=0; idx2 <param->numPhyAnt; idx2++) {
9751       CMCHKUNPK(oduPackUInt16, &param->bfValue[idx2], mBuf);}
9752    }
9753   
9754    return ROK;
9755 }
9756 #endif 
9757 \f
9758 /***********************************************************
9759 *
9760 *     Func : cmPkTfuDatReqPduInfo
9761 *
9762 *
9763 *     Desc : Pack Function for Tfu Dat Req PDU.
9764 *
9765 *
9766 *     Ret  : S16
9767 *
9768 *     Notes:
9769 *
9770 *     File  : 
9771 *
9772 **********************************************************/
9773 #ifdef ANSI
9774 S16 cmPkTfuDatReqPduInfo
9775 (
9776 TfuDatReqPduInfo *param,
9777 Buffer *mBuf
9778 )
9779 #else
9780 S16 cmPkTfuDatReqPduInfo(param, mBuf)
9781 TfuDatReqPduInfo *param;
9782 Buffer *mBuf;
9783 #endif
9784 {
9785
9786    S32 i;
9787    uint8_t  tbMask = 0;
9788 #ifdef L2_OPTMZ
9789    uint32_t lchIdx, pduIdx;
9790 #endif
9791
9792
9793    /* LTE_ADV_FLAG_REMOVED_START */
9794    CMCHKPK(oduUnpackUInt8, param->isEnbSFR, mBuf);
9795    /* LTE_ADV_FLAG_REMOVED_END */
9796
9797    /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
9798 #ifdef TFU_UPGRADE 
9799    CMCHKPK(oduUnpackUInt16, param->txPwrOffset, mBuf);
9800    if(param->transMode == TFU_UE_TM_7)
9801    {
9802       CMCHKPK(cmPkTfuBfVectorInfo, param->bfVector, mBuf);
9803       CMCHKPK(oduUnpackUInt8, param->numBfVectors, mBuf);
9804       CMCHKPK(oduUnpackUInt8, param->numBfPrbPerSb, mBuf);
9805    }
9806    CMCHKPK(oduUnpackUInt8, param->deltaPowOffIdx, mBuf);
9807    /* LTE_ADV_FLAG_REMOVED_START */
9808    CMCHKPK(oduUnpackUInt8, param->pa, mBuf);
9809    /* LTE_ADV_FLAG_REMOVED_END */
9810    CMCHKPK(oduUnpackUInt8, param->numLayers, mBuf);
9811 #endif
9812    CMCHKPK(oduPackBool, param->isTApres, mBuf);
9813    CMCHKPK(cmPkTknUInt32, &param->doa, mBuf);
9814    CMCHKPK(oduUnpackUInt32, param->transMode, mBuf);
9815    CMCHKPK(cmPkTfuDlCqiPuschInfo, &param->puschPmiInfo, mBuf);
9816    CMCHKPK(oduUnpackUInt8, param->puschRptUsd, mBuf);
9817    for (i = 0; i < TFU_MAX_TB; i++)
9818    {
9819 #ifndef L2_OPTMZ
9820      if (param->mBuf[i] != NULLP)
9821      {
9822         tbMask = tbMask | (1 << i);
9823      }
9824 #else /* L2_OPTMZ */
9825      for(lchIdx = 0; lchIdx < param->tbInfo[i].numLch; lchIdx++)
9826      {
9827         for(pduIdx = 0; pduIdx < param->tbInfo[i].lchInfo[lchIdx].numPdu;
9828               pduIdx++)
9829         {
9830            if (param->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx] != NULLP)
9831            {
9832               tbMask = tbMask | (1 << i);
9833            }
9834         }
9835      }
9836 #endif /* L2_OPTMZ */
9837    }
9838    /* tfu_c_001.main_2: Packing should consider nmbOfTBs.*/
9839    for (i=TFU_MAX_TB - 1; i >= 0; i--) {
9840 #ifndef L2_OPTMZ
9841       if (param->mBuf[i] != NULLP)
9842       {
9843          CMCHKPK(cmPkBuffer, &param->mBuf[i], mBuf);
9844       }
9845 #else
9846      // CMCHKPK(cmPkBuffer, &param->tbInfo[i].macPad, mBuf);
9847       for(lchIdx = 0; lchIdx < param->tbInfo[i].numLch; lchIdx++)
9848       {
9849          for(pduIdx = 0; pduIdx < param->tbInfo[i].lchInfo[lchIdx].numPdu;
9850                pduIdx++)
9851          {
9852             CMCHKPK(cmPkBuffer, &param->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx],
9853                   mBuf);
9854
9855          }
9856          CMCHKPK(oduUnpackUInt32, param->tbInfo[i].lchInfo[lchIdx].numPdu, mBuf);
9857       }
9858       CMCHKPK(oduUnpackUInt32, param->tbInfo[i].numLch, mBuf);
9859       CMCHKPK(oduUnpackUInt32, param->tbInfo[i].padSize, mBuf);
9860       CMCHKPK(cmPkBuffer, &param->tbInfo[i].macCes, mBuf);
9861       CMCHKPK(cmPkBuffer, &param->tbInfo[i].macHdr, mBuf);
9862       CMCHKPK(cmPkMsgLen, param->tbInfo[i].tbSize, mBuf);
9863       CMCHKPK(oduPackBool, param->tbInfo[i].tbPres, mBuf);
9864 #endif
9865    }
9866    CMCHKPK(oduUnpackUInt8, tbMask, mBuf);
9867    CMCHKPK(oduUnpackUInt8, param->nmbOfTBs, mBuf);
9868    CMCHKPK(cmPkTfuPdschDciInfo, &param->dciInfo, mBuf);
9869    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
9870    return ROK;
9871 }
9872
9873
9874 \f
9875 /***********************************************************
9876 *
9877 *     Func : cmUnpkTfuDatReqPduInfo
9878 *
9879 *
9880 *     Desc : UnPack function for Tfu Dat req pdu .
9881 *
9882 *
9883 *     Ret  : S16
9884 *
9885 *     Notes:
9886 *
9887 *     File  : 
9888 *
9889 **********************************************************/
9890 #ifdef ANSI
9891 S16 cmUnpkTfuDatReqPduInfo
9892 (
9893 TfuDatReqPduInfo *param,
9894 Buffer *mBuf
9895 )
9896 #else
9897 S16 cmUnpkTfuDatReqPduInfo(param, mBuf)
9898 TfuDatReqPduInfo *param;
9899 Buffer *mBuf;
9900 #endif
9901 {
9902
9903    uint8_t i;
9904    uint8_t  tbMask = 0;
9905 #ifdef L2_OPTMZ
9906    uint32_t lchIdx, pduIdx;
9907 #endif
9908
9909    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
9910    CMCHKUNPK(cmUnpkTfuPdschDciInfo, &param->dciInfo, mBuf);
9911    CMCHKUNPK(oduPackUInt8, &param->nmbOfTBs, mBuf);
9912
9913    CMCHKUNPK(oduPackUInt8, &tbMask, mBuf);
9914    for (i=0; i<TFU_MAX_TB; i++) {
9915 #ifndef L2_OPTMZ
9916       if (tbMask & (1<<i))
9917       {
9918          CMCHKUNPK(cmUnpkBuffer, &param->mBuf[i], mBuf);
9919       }
9920       else
9921       {
9922          param->mBuf[i] = NULLP;
9923       }
9924 #else /* L2_OPTMZ*/
9925       CMCHKUNPK(oduUnpackBool, &param->tbInfo[i].tbPres, mBuf);
9926       CMCHKUNPK(cmUnpkMsgLen, &param->tbInfo[i].tbSize, mBuf);
9927       CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].macHdr, mBuf);
9928       CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].macCes, mBuf);
9929       CMCHKUNPK(oduPackUInt32, &param->tbInfo[i].padSize, mBuf);
9930       CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->tbInfo[i].numLch, mBuf);
9931       for(lchIdx = 0; lchIdx < param->tbInfo[i].numLch; lchIdx++)
9932       {
9933          CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->tbInfo[i].lchInfo[lchIdx].numPdu,
9934                mBuf);
9935          for(pduIdx = 0; pduIdx < param->tbInfo[i].lchInfo[lchIdx].numPdu;
9936                pduIdx++)
9937          {
9938             if (tbMask & (1<<i))
9939             {
9940                CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].lchInfo[lchIdx].\
9941                      mBuf[pduIdx], mBuf);
9942             }
9943             else
9944             {
9945                param->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx] = NULLP;
9946             }
9947          }
9948       }
9949       //CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].macPad, mBuf);
9950 #endif /* L2_OPTMZ*/
9951    }
9952
9953    CMCHKUNPK(oduPackUInt8, &param->puschRptUsd, mBuf);
9954    CMCHKUNPK(cmUnpkTfuDlCqiPuschInfo, &param->puschPmiInfo, mBuf);
9955    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->transMode, mBuf);
9956    CMCHKUNPK(cmUnpkTknUInt32, &param->doa, mBuf);
9957    CMCHKUNPK(oduUnpackBool, &param->isTApres, mBuf);
9958 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
9959 #ifdef TFU_UPGRADE
9960    CMCHKUNPK(oduPackUInt8, &param->numLayers, mBuf);
9961    /* LTE_ADV_FLAG_REMOVED_START */
9962    CMCHKUNPK(oduPackUInt8, &param->pa, mBuf);
9963    /* LTE_ADV_FLAG_REMOVED_END */
9964    CMCHKUNPK(oduPackUInt8, &param->deltaPowOffIdx, mBuf);
9965    if(param->transMode == TFU_UE_TM_7)
9966    {
9967       CMCHKUNPK(oduPackUInt8, &param->numBfPrbPerSb, mBuf);
9968       CMCHKUNPK(oduPackUInt8, &param->numBfVectors, mBuf);
9969       CMCHKUNPK(cmUnpkTfuBfVectorInfo, param->bfVector, mBuf);
9970    }
9971    CMCHKUNPK(oduPackUInt16, &param->txPwrOffset, mBuf);
9972 #endif
9973
9974    /* LTE_ADV_FLAG_REMOVED_START */
9975    CMCHKUNPK(oduPackUInt8, &param->isEnbSFR, mBuf);
9976    /* LTE_ADV_FLAG_REMOVED_END */
9977
9978    return ROK;
9979 }
9980
9981
9982 \f
9983 /***********************************************************
9984 *
9985 *     Func : cmPkTfuDatReqInfo
9986 *
9987 *
9988 *     Desc : This structure contains the Data PDUs 
9989  * @details This structure contains Data meant to be sent on both PBCH and
9990  * PDSCH. Control information necessary for processing of the data is sent along
9991  * with the Data.
9992 *
9993 *
9994 *     Ret  : S16
9995 *
9996 *     Notes:
9997 *
9998 *     File  : 
9999 *
10000 **********************************************************/
10001 #ifdef ANSI
10002 S16 cmPkTfuDatReqInfo
10003 (
10004 TfuDatReqInfo *param,
10005 Buffer *mBuf
10006 )
10007 #else
10008 S16 cmPkTfuDatReqInfo(param, mBuf)
10009 TfuDatReqInfo *param;
10010 Buffer *mBuf;
10011 #endif
10012 {
10013
10014    CmLList *node;
10015    uint32_t count;
10016    TfuDatReqPduInfo *tfuDatReqPduInfo;
10017
10018
10019    count = param->pdus.count;
10020    node = param->pdus.last;
10021    while (node) {
10022       tfuDatReqPduInfo = (TfuDatReqPduInfo *)node->node;
10023       node=node->prev;
10024       CMCHKPK(cmPkTfuDatReqPduInfo, tfuDatReqPduInfo, mBuf);
10025       cmLListDelFrm(&param->pdus, &tfuDatReqPduInfo->lnk);
10026       tfuDatReqPduInfo->lnk.node = (PTR)NULLP;
10027    }
10028    CMCHKPK(oduUnpackUInt32, count, mBuf);
10029    CMCHKPK(cmPkTknBuf, &param->bchDat, mBuf);
10030    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10031    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10032    return ROK;
10033 }
10034
10035
10036 \f
10037 /***********************************************************
10038 *
10039 *     Func : cmUnpkTfuDatReqInfo
10040 *
10041 *
10042 *     Desc : This structure contains the Data PDUs 
10043  * @details This structure contains Data meant to be sent on both PBCH and
10044  * PDSCH. Control information necessary for processing of the data is sent along
10045  * with the Data.
10046 *
10047 *
10048 *     Ret  : S16
10049 *
10050 *     Notes:
10051 *
10052 *     File  : 
10053 *
10054 **********************************************************/
10055 #ifdef ANSI
10056 S16 cmUnpkTfuDatReqInfo
10057 (
10058 TfuDatReqInfo *param,
10059 Ptr memCp,
10060 Buffer *mBuf
10061 )
10062 #else
10063 S16 cmUnpkTfuDatReqInfo(param, memCp, mBuf)
10064 TfuDatReqInfo *param;
10065 Ptr memCp;
10066 Buffer *mBuf;
10067 #endif
10068 {
10069
10070    uint32_t count, loopCnt;
10071    TfuDatReqPduInfo *tfuDatReqPduInfo;
10072
10073
10074    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10075    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10076    CMCHKUNPK(cmUnpkTknBuf, &param->bchDat, &mBuf);
10077    cmLListInit(&param->pdus);
10078    CMCHKUNPK(oduPackUInt32, &count, mBuf);
10079    for (loopCnt=0; loopCnt<count; loopCnt++) {
10080       cmGetMem((Ptr)memCp, sizeof(*tfuDatReqPduInfo), (Ptr *)&tfuDatReqPduInfo);
10081       CMCHKUNPK(cmUnpkTfuDatReqPduInfo, tfuDatReqPduInfo, mBuf);
10082       cmLListAdd2Tail(&param->pdus, &tfuDatReqPduInfo->lnk);
10083       tfuDatReqPduInfo->lnk.node = (PTR)tfuDatReqPduInfo;
10084    }
10085    return ROK;
10086 }
10087
10088
10089 \f
10090 /***********************************************************
10091 *
10092 *     Func : cmPkTfuDatInfo
10093 *
10094 *
10095 *     Desc : This structure contains the Data PDU and the RNTI of the UE.
10096 *
10097 *
10098 *     Ret  : S16
10099 *
10100 *     Notes:
10101 *
10102 *     File  : 
10103 *
10104 **********************************************************/
10105 #ifdef ANSI
10106 S16 cmPkTfuDatInfo
10107 (
10108 TfuDatInfo *param,
10109 Buffer *mBuf
10110 )
10111 #else
10112 S16 cmPkTfuDatInfo(param, mBuf)
10113 TfuDatInfo *param;
10114 Buffer *mBuf;
10115 #endif
10116 {
10117
10118
10119    CMCHKPK(cmPkBuffer, &param->mBuf, mBuf);
10120    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10121    return ROK;
10122 }
10123
10124
10125 \f
10126 /***********************************************************
10127 *
10128 *     Func : cmUnpkTfuDatInfo
10129 *
10130 *
10131 *     Desc : This structure contains the Data PDU and the RNTI of the UE.
10132 *
10133 *
10134 *     Ret  : S16
10135 *
10136 *     Notes:
10137 *
10138 *     File  : 
10139 *
10140 **********************************************************/
10141 #ifdef ANSI
10142 S16 cmUnpkTfuDatInfo
10143 (
10144 TfuDatInfo *param,
10145 Buffer *mBuf
10146 )
10147 #else
10148 S16 cmUnpkTfuDatInfo(param, mBuf)
10149 TfuDatInfo *param;
10150 Buffer *mBuf;
10151 #endif
10152 {
10153
10154
10155    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10156    CMCHKUNPK(cmUnpkBuffer, &param->mBuf, mBuf);
10157    return ROK;
10158 }
10159
10160
10161 \f
10162 /***********************************************************
10163 *
10164 *     Func : cmPkTfuDatIndInfo
10165 *
10166 *
10167 *     Desc : This structure contains the Data PDUs received at Physical Layer.
10168  * @details All the PDUs received by Physical layer in one subframe are clubbed
10169  * together into a single data structure and sent to MAC for processing.
10170 *
10171 *
10172 *     Ret  : S16
10173 *
10174 *     Notes:
10175 *
10176 *     File  : 
10177 *
10178 **********************************************************/
10179 #ifdef ANSI
10180 S16 cmPkTfuDatIndInfo
10181 (
10182 TfuDatIndInfo *param,
10183 Buffer *mBuf
10184 )
10185 #else
10186 S16 cmPkTfuDatIndInfo(param, mBuf)
10187 TfuDatIndInfo *param;
10188 Buffer *mBuf;
10189 #endif
10190 {
10191
10192    CmLList *node;
10193    uint32_t count;
10194    TfuDatInfo *tfuDatInfo;
10195
10196
10197 #ifdef TFU_5GTF
10198    CMCHKPK(oduUnpackUInt8, param->sccIdx, mBuf);
10199    CMCHKPK(oduUnpackUInt8, param->sectorId, mBuf);
10200 #endif /* TFU_5GTF */
10201    count = param->datIndLst.count;
10202    node = param->datIndLst.last;
10203    while (node) {
10204       tfuDatInfo = (TfuDatInfo *)node->node;
10205       node=node->prev;
10206       CMCHKPK(cmPkTfuDatInfo, tfuDatInfo, mBuf);
10207       cmLListDelFrm(&param->datIndLst, &tfuDatInfo->lnk);
10208       tfuDatInfo->lnk.node = (PTR)NULLP;
10209    }
10210    CMCHKPK(oduUnpackUInt32, count, mBuf);
10211    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10212    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10213    return ROK;
10214 }
10215
10216
10217 \f
10218 /***********************************************************
10219 *
10220 *     Func : cmUnpkTfuDatIndInfo
10221 *
10222 *
10223 *     Desc : This structure contains the Data PDUs received at Physical Layer.
10224  * @details All the PDUs received by Physical layer in one subframe are clubbed
10225  * together into a single data structure and sent to MAC for processing.
10226 *
10227 *
10228 *     Ret  : S16
10229 *
10230 *     Notes:
10231 *
10232 *     File  : 
10233 *
10234 **********************************************************/
10235 #ifdef ANSI
10236 S16 cmUnpkTfuDatIndInfo
10237 (
10238 TfuDatIndInfo *param,
10239 Ptr memCp,
10240 Buffer *mBuf
10241 )
10242 #else
10243 S16 cmUnpkTfuDatIndInfo(param, memCp, mBuf)
10244 TfuDatIndInfo *param;
10245 Ptr memCp;
10246 Buffer *mBuf;
10247 #endif
10248 {
10249
10250    uint32_t count, loopCnt;
10251    TfuDatInfo *tfuDatInfo;
10252
10253
10254    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10255    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10256    cmLListInit(&param->datIndLst);
10257    CMCHKUNPK(oduPackUInt32, &count, mBuf);
10258    for (loopCnt=0; loopCnt<count; loopCnt++) {
10259       cmGetMem((Ptr)memCp, sizeof(*tfuDatInfo), (Ptr *)&tfuDatInfo);
10260       CMCHKUNPK(cmUnpkTfuDatInfo, tfuDatInfo, mBuf);
10261       cmLListAdd2Tail(&param->datIndLst, &tfuDatInfo->lnk);
10262       tfuDatInfo->lnk.node = (PTR)tfuDatInfo;
10263    }
10264 #ifdef TFU_5GTF
10265    CMCHKUNPK(oduPackUInt8, &param->sectorId, mBuf);
10266    CMCHKUNPK(oduPackUInt8, &param->sccIdx, mBuf);
10267 #endif /* TFU_5GTF */
10268    return ROK;
10269 }
10270
10271
10272 \f
10273 /***********************************************************
10274 *
10275 *     Func : cmPkTfuSrInfo
10276 *
10277 *
10278 *     Desc : This structure contains the SR indication for a UE, identified by
10279   * the given RNTI. The structure also contains a PUCCH Delta power, that is
10280   * calculated by the physical layer, and is used by the scheduler for Power
10281   * control of the UE.
10282 *
10283 *
10284 *     Ret  : S16
10285 *
10286 *     Notes:
10287 *
10288 *     File  : 
10289 *
10290 **********************************************************/
10291 #ifdef ANSI
10292 S16 cmPkTfuSrInfo
10293 (
10294 TfuSrInfo *param,
10295 Buffer *mBuf
10296 )
10297 #else
10298 S16 cmPkTfuSrInfo(param, mBuf)
10299 TfuSrInfo *param;
10300 Buffer *mBuf;
10301 #endif
10302 {
10303
10304
10305    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10306    return ROK;
10307 }
10308
10309
10310 \f
10311 /***********************************************************
10312 *
10313 *     Func : cmUnpkTfuSrInfo
10314 *
10315 *
10316 *     Desc : This structure contains the SR indication for a UE, identified by
10317   * the given RNTI. The structure also contains a PUCCH Delta power, that is
10318   * calculated by the physical layer, and is used by the scheduler for Power
10319   * control of the UE.
10320 *
10321 *
10322 *     Ret  : S16
10323 *
10324 *     Notes:
10325 *
10326 *     File  : 
10327 *
10328 **********************************************************/
10329 #ifdef ANSI
10330 S16 cmUnpkTfuSrInfo
10331 (
10332 TfuSrInfo *param,
10333 Buffer *mBuf
10334 )
10335 #else
10336 S16 cmUnpkTfuSrInfo(param, mBuf)
10337 TfuSrInfo *param;
10338 Buffer *mBuf;
10339 #endif
10340 {
10341
10342
10343    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10344    return ROK;
10345 }
10346
10347
10348 \f
10349 /***********************************************************
10350 *
10351 *     Func : cmPkTfuSrIndInfo
10352 *
10353 *
10354 *     Desc : This structure contains all the Scheduling Requests (SR) indications
10355   * received in a subframe.
10356 *
10357 *
10358 *     Ret  : S16
10359 *
10360 *     Notes:
10361 *
10362 *     File  : 
10363 *
10364 **********************************************************/
10365 #ifdef ANSI
10366 S16 cmPkTfuSrIndInfo
10367 (
10368 TfuSrIndInfo *param,
10369 Buffer *mBuf
10370 )
10371 #else
10372 S16 cmPkTfuSrIndInfo(param, mBuf)
10373 TfuSrIndInfo *param;
10374 Buffer *mBuf;
10375 #endif
10376 {
10377
10378    CmLList *node;
10379    uint32_t count;
10380    TfuSrInfo *tfuSrInfo;
10381
10382
10383    count = param->srLst.count;
10384    node = param->srLst.last;
10385    while (node) {
10386       tfuSrInfo = (TfuSrInfo *)node->node;
10387       node=node->prev;
10388       CMCHKPK(cmPkTfuSrInfo, tfuSrInfo, mBuf);
10389       cmLListDelFrm(&param->srLst, &tfuSrInfo->lnk);
10390       tfuSrInfo->lnk.node = (PTR)NULLP;
10391    }
10392    CMCHKPK(oduUnpackUInt32, count, mBuf);
10393    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10394    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10395    return ROK;
10396 }
10397
10398
10399 \f
10400 /***********************************************************
10401 *
10402 *     Func : cmUnpkTfuSrIndInfo
10403 *
10404 *
10405 *     Desc : This structure contains all the Scheduling Requests (SR) indications
10406   * received in a subframe.
10407 *
10408 *
10409 *     Ret  : S16
10410 *
10411 *     Notes:
10412 *
10413 *     File  : 
10414 *
10415 **********************************************************/
10416 #ifdef ANSI
10417 S16 cmUnpkTfuSrIndInfo
10418 (
10419 TfuSrIndInfo *param,
10420 Ptr memCp,
10421 Buffer *mBuf
10422 )
10423 #else
10424 S16 cmUnpkTfuSrIndInfo(param, memCp, mBuf)
10425 TfuSrIndInfo *param;
10426 Ptr memCp;
10427 Buffer *mBuf;
10428 #endif
10429 {
10430
10431    uint32_t count, loopCnt;
10432    TfuSrInfo *tfuSrInfo;
10433
10434
10435    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10436    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10437    cmLListInit(&param->srLst);
10438    CMCHKUNPK(oduPackUInt32, &count, mBuf);
10439    for (loopCnt=0; loopCnt<count; loopCnt++) {
10440       cmGetMem((Ptr)memCp, sizeof(*tfuSrInfo), (Ptr *)&tfuSrInfo);
10441       CMCHKUNPK(cmUnpkTfuSrInfo, tfuSrInfo, mBuf);
10442       cmLListAdd2Tail(&param->srLst, &tfuSrInfo->lnk);
10443       tfuSrInfo->lnk.node = (PTR)tfuSrInfo;
10444    }
10445    return ROK;
10446 }
10447
10448 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10449 /***********************************************************
10450 *
10451 *     Func : cmPkTfuHqInfo
10452 *
10453 *
10454 *     Desc : This structure contains the HARQ feedback for a single UE. 
10455   * @details RNTI is present to identify the UE. 
10456   * For FDD a single feedback is present. 
10457   * For TDD HARQ multiplexing a list of HARQ feedbacks is present.
10458 *
10459 *
10460 *     Ret  : S16
10461 *
10462 *     Notes:
10463 *
10464 *     File  : 
10465 *
10466 **********************************************************/
10467 #ifdef ANSI
10468 S16 cmPkTfuHqInfo
10469 (
10470 TfuHqInfo *param,
10471 Buffer *mBuf
10472 )
10473 #else
10474 S16 cmPkTfuHqInfo(param, mBuf)
10475 TfuHqInfo *param;
10476 Buffer *mBuf;
10477 #endif
10478 {
10479
10480    S32 i;
10481
10482    CMCHKPK(oduUnpackUInt8, param->isPusch, mBuf);
10483    for (i=TFU_MAX_HARQ_FDBKS-1; i >= 0; i--) {
10484       CMCHKPK(oduUnpackUInt32, param->isAck[i], mBuf);
10485    }
10486 #ifdef TFU_TDD        
10487    CMCHKPK(oduUnpackUInt8, param->M, mBuf);
10488 #endif/*TFU_TDD*/
10489    CMCHKPK(oduUnpackUInt8, param->noOfTbs, mBuf);
10490 /* ACC-TDD ccpu00130520 */
10491    CMCHKPK(oduUnpackUInt32, param->hqFdbkMode, mBuf);
10492    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10493    return ROK;
10494 }
10495
10496 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10497 /***********************************************************
10498 *
10499 *     Func : cmUnpkTfuHqInfo
10500 *
10501 *
10502 *     Desc : This structure contains the HARQ feedback for a single UE. 
10503   * @details RNTI is present to identify the UE. 
10504   * For FDD a single feedback is present. 
10505   * For TDD HARQ multiplexing a list of HARQ feedbacks is present.
10506 *
10507 *
10508 *     Ret  : S16
10509 *
10510 *     Notes:
10511 *
10512 *     File  : 
10513 *
10514 **********************************************************/
10515 #ifdef ANSI
10516 S16 cmUnpkTfuHqInfo
10517 (
10518 TfuHqInfo *param,
10519 Buffer *mBuf
10520 )
10521 #else
10522 S16 cmUnpkTfuHqInfo(param, mBuf)
10523 TfuHqInfo *param;
10524 Buffer *mBuf;
10525 #endif
10526 {
10527    S32 i;
10528
10529    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10530 /* ACC-TDD ccpu00130520 */
10531    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->hqFdbkMode, mBuf);
10532    CMCHKUNPK(oduPackUInt8, &param->noOfTbs, mBuf);
10533 #ifdef TFU_TDD
10534    CMCHKUNPK(oduPackUInt8, &param->M, mBuf);
10535 #endif
10536    for (i=0; i<TFU_MAX_HARQ_FDBKS; i++) {
10537       CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->isAck[i], mBuf);
10538    }
10539    CMCHKUNPK(oduPackUInt8, &param->isPusch, mBuf);
10540    return ROK;
10541 }
10542
10543
10544
10545
10546 \f
10547 /***********************************************************
10548 *
10549 *     Func : cmPkTfuHqIndInfo
10550 *
10551 *
10552 *     Desc : This structure contains a list of HARQ feedback for a number of UEs.
10553   * @details All the HARQ feedback received in the subframe are clubbed together
10554   * in this data structure and given to the scheduler for processing.
10555 *
10556 *
10557 *     Ret  : S16
10558 *
10559 *     Notes:
10560 *
10561 *     File  : 
10562 *
10563 **********************************************************/
10564 #ifdef ANSI
10565 S16 cmPkTfuHqIndInfo
10566 (
10567 TfuHqIndInfo *param,
10568 Buffer *mBuf
10569 )
10570 #else
10571 S16 cmPkTfuHqIndInfo(param, mBuf)
10572 TfuHqIndInfo *param;
10573 Buffer *mBuf;
10574 #endif
10575 {
10576
10577    CmLList *node;
10578    uint32_t count;
10579    TfuHqInfo *tfuHqInfo;
10580
10581
10582    count = param->hqIndLst.count;
10583    node = param->hqIndLst.last;
10584    while (node) {
10585       tfuHqInfo = (TfuHqInfo *)node->node;
10586       node=node->prev;
10587       CMCHKPK(cmPkTfuHqInfo, tfuHqInfo, mBuf);
10588       cmLListDelFrm(&param->hqIndLst, &tfuHqInfo->lnk);
10589       tfuHqInfo->lnk.node = (PTR)NULLP;
10590    }
10591    CMCHKPK(oduUnpackUInt32, count, mBuf);
10592    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10593    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10594    return ROK;
10595 }
10596
10597
10598 \f
10599 /***********************************************************
10600 *
10601 *     Func : cmUnpkTfuHqIndInfo
10602 *
10603 *
10604 *     Desc : This structure contains a list of HARQ feedback for a number of UEs.
10605   * @details All the HARQ feedback received in the subframe are clubbed together
10606   * in this data structure and given to the scheduler for processing.
10607 *
10608 *
10609 *     Ret  : S16
10610 *
10611 *     Notes:
10612 *
10613 *     File  : 
10614 *
10615 **********************************************************/
10616 #ifdef ANSI
10617 S16 cmUnpkTfuHqIndInfo
10618 (
10619 TfuHqIndInfo *param,
10620 Ptr memCp,
10621 Buffer *mBuf
10622 )
10623 #else
10624 S16 cmUnpkTfuHqIndInfo(param, memCp, mBuf)
10625 TfuHqIndInfo *param;
10626 Ptr memCp;
10627 Buffer *mBuf;
10628 #endif
10629 {
10630
10631    uint32_t count, loopCnt;
10632    TfuHqInfo *tfuHqInfo;
10633
10634
10635    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10636    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10637    cmLListInit(&param->hqIndLst);
10638    CMCHKUNPK(oduPackUInt32, &count, mBuf);
10639    for (loopCnt=0; loopCnt<count; loopCnt++) {
10640       cmGetMem((Ptr)memCp, sizeof(*tfuHqInfo), (Ptr *)&tfuHqInfo);
10641       CMCHKUNPK(cmUnpkTfuHqInfo, tfuHqInfo, mBuf);
10642       cmLListAdd2Tail(&param->hqIndLst, &tfuHqInfo->lnk);
10643       tfuHqInfo->lnk.node = (PTR)tfuHqInfo;
10644    }
10645    return ROK;
10646 }
10647
10648
10649 \f
10650 /***********************************************************
10651 *
10652 *     Func : cmPkTfuUlCqiInfo
10653 *
10654 *
10655 *     Desc : This structure conveys the Uplink CQI information for a single subband.
10656 *
10657 *
10658 *     Ret  : S16
10659 *
10660 *     Notes:
10661 *
10662 *     File  : 
10663 *
10664 **********************************************************/
10665 #ifdef ANSI
10666 S16 cmPkTfuUlCqiInfo
10667 (
10668 TfuUlCqiInfo *param,
10669 Buffer *mBuf
10670 )
10671 #else
10672 S16 cmPkTfuUlCqiInfo(param, mBuf)
10673 TfuUlCqiInfo *param;
10674 Buffer *mBuf;
10675 #endif
10676 {
10677
10678
10679    CMCHKPK(cmPkTfuSubbandCqiInfo, &param->subbandCqi, mBuf);
10680    return ROK;
10681 }
10682
10683
10684 \f
10685 /***********************************************************
10686 *
10687 *     Func : cmUnpkTfuUlCqiInfo
10688 *
10689 *
10690 *     Desc : This structure conveys the Uplink CQI information for a single subband.
10691 *
10692 *
10693 *     Ret  : S16
10694 *
10695 *     Notes:
10696 *
10697 *     File  : 
10698 *
10699 **********************************************************/
10700 #ifdef ANSI
10701 S16 cmUnpkTfuUlCqiInfo
10702 (
10703 TfuUlCqiInfo *param,
10704 Buffer *mBuf
10705 )
10706 #else
10707 S16 cmUnpkTfuUlCqiInfo(param, mBuf)
10708 TfuUlCqiInfo *param;
10709 Buffer *mBuf;
10710 #endif
10711 {
10712
10713
10714    CMCHKUNPK(cmUnpkTfuSubbandCqiInfo, &param->subbandCqi, mBuf);
10715    return ROK;
10716 }
10717
10718
10719 \f
10720 /***********************************************************
10721 *
10722 *     Func : cmPkTfuUlCqiRpt
10723 *
10724 *
10725 *     Desc : This structure contains the UL CQI estimated by the physical layer. 
10726   * @details The report could be wideband CQI or subBand CQI or both.
10727 *
10728 *
10729 *     Ret  : S16
10730 *
10731 *     Notes:
10732 *
10733 *     File  : 
10734 *
10735 **********************************************************/
10736 #ifdef ANSI
10737 S16 cmPkTfuUlCqiRpt
10738 (
10739 TfuUlCqiRpt *param,
10740 Buffer *mBuf
10741 )
10742 #else
10743 S16 cmPkTfuUlCqiRpt(param, mBuf)
10744 TfuUlCqiRpt *param;
10745 Buffer *mBuf;
10746 #endif
10747 {
10748
10749    S32 i;
10750
10751    for (i=TFU_MAX_UL_SUBBAND-1; i >= 0; i--) {
10752       CMCHKPK(cmPkTfuUlCqiInfo, &param->ulCqiInfoArr[i], mBuf);
10753    }
10754    CMCHKPK(oduUnpackUInt8, param->numSubband, mBuf);
10755    CMCHKPK(oduUnpackUInt8, param->wideCqi, mBuf);
10756    CMCHKPK(oduUnpackUInt8, param->isTxPort0, mBuf);
10757    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10758    return ROK;
10759 }
10760
10761
10762 \f
10763 /***********************************************************
10764 *
10765 *     Func : cmUnpkTfuUlCqiRpt
10766 *
10767 *
10768 *     Desc : This structure contains the UL CQI estimated by the physical layer. 
10769   * @details The report could be wideband CQI or subBand CQI or both.
10770 *
10771 *
10772 *     Ret  : S16
10773 *
10774 *     Notes:
10775 *
10776 *     File  : 
10777 *
10778 **********************************************************/
10779 #ifdef ANSI
10780 S16 cmUnpkTfuUlCqiRpt
10781 (
10782 TfuUlCqiRpt *param,
10783 Buffer *mBuf
10784 )
10785 #else
10786 S16 cmUnpkTfuUlCqiRpt(param, mBuf)
10787 TfuUlCqiRpt *param;
10788 Buffer *mBuf;
10789 #endif
10790 {
10791
10792    S32 i;
10793
10794    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10795    CMCHKUNPK(oduPackUInt8, &param->isTxPort0, mBuf);
10796    CMCHKUNPK(oduPackUInt8, &param->wideCqi, mBuf);
10797    CMCHKUNPK(oduPackUInt8, &param->numSubband, mBuf);
10798    for (i=0; i<TFU_MAX_UL_SUBBAND; i++) {
10799       CMCHKUNPK(cmUnpkTfuUlCqiInfo, &param->ulCqiInfoArr[i], mBuf);
10800    }
10801    return ROK;
10802 }
10803
10804
10805 \f
10806 /***********************************************************
10807 *
10808 *     Func : cmPkTfuUlCqiIndInfo
10809 *
10810 *
10811 *     Desc : This structure conveys the Uplink CQI information.
10812  * @details Uplink CQI is calculated by the physical layer, and is this
10813  * information is provided to the scheduler. 
10814  * This data structure clubs together the UL CQI estimates for all the UEs that
10815  * have been scheduled in the subframe for uplink transmission.
10816 *
10817 *
10818 *     Ret  : S16
10819 *
10820 *     Notes:
10821 *
10822 *     File  : 
10823 *
10824 **********************************************************/
10825 #ifdef ANSI
10826 S16 cmPkTfuUlCqiIndInfo
10827 (
10828 TfuUlCqiIndInfo *param,
10829 Buffer *mBuf
10830 )
10831 #else
10832 S16 cmPkTfuUlCqiIndInfo(param, mBuf)
10833 TfuUlCqiIndInfo *param;
10834 Buffer *mBuf;
10835 #endif
10836 {
10837
10838    CmLList *node;
10839    uint32_t count;
10840    TfuUlCqiRpt *tfuUlCqiRpt;
10841
10842
10843    count = param->ulCqiRpt.count;
10844    node = param->ulCqiRpt.last;
10845    while (node) {
10846       tfuUlCqiRpt = (TfuUlCqiRpt *)node->node;
10847       node=node->prev;
10848       CMCHKPK(cmPkTfuUlCqiRpt, tfuUlCqiRpt, mBuf);
10849       cmLListDelFrm(&param->ulCqiRpt, &tfuUlCqiRpt->lnk);
10850       tfuUlCqiRpt->lnk.node = (PTR)NULLP;
10851    }
10852    CMCHKPK(oduUnpackUInt32, count, mBuf);
10853    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10854    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10855    return ROK;
10856 }
10857
10858
10859 \f
10860 /***********************************************************
10861 *
10862 *     Func : cmUnpkTfuUlCqiIndInfo
10863 *
10864 *
10865 *     Desc : This structure conveys the Uplink CQI information.
10866  * @details Uplink CQI is calculated by the physical layer, and is this
10867  * information is provided to the scheduler. 
10868  * This data structure clubs together the UL CQI estimates for all the UEs that
10869  * have been scheduled in the subframe for uplink transmission.
10870 *
10871 *
10872 *     Ret  : S16
10873 *
10874 *     Notes:
10875 *
10876 *     File  : 
10877 *
10878 **********************************************************/
10879 #ifdef ANSI
10880 S16 cmUnpkTfuUlCqiIndInfo
10881 (
10882 TfuUlCqiIndInfo *param,
10883 Ptr memCp,
10884 Buffer *mBuf
10885 )
10886 #else
10887 S16 cmUnpkTfuUlCqiIndInfo(param, memCp, mBuf)
10888 TfuUlCqiIndInfo *param;
10889 Ptr memCp;
10890 Buffer *mBuf;
10891 #endif
10892 {
10893
10894    uint32_t count, loopCnt;
10895    TfuUlCqiRpt *tfuUlCqiRpt;
10896
10897
10898    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10899    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10900    cmLListInit(&param->ulCqiRpt);
10901    CMCHKUNPK(oduPackUInt32, &count, mBuf);
10902    for (loopCnt=0; loopCnt<count; loopCnt++) {
10903       cmGetMem((Ptr)memCp, sizeof(*tfuUlCqiRpt), (Ptr *)&tfuUlCqiRpt);
10904       CMCHKUNPK(cmUnpkTfuUlCqiRpt, tfuUlCqiRpt, mBuf);
10905       cmLListAdd2Tail(&param->ulCqiRpt, &tfuUlCqiRpt->lnk);
10906       tfuUlCqiRpt->lnk.node = (PTR)tfuUlCqiRpt;
10907    }
10908    return ROK;
10909 }
10910
10911
10912
10913 \f
10914 /***********************************************************
10915 *
10916 *     Func : cmPkTfuDlCqiRpt
10917 *
10918 *
10919 *     Desc : This structure contains the DL CQI report for a single UE. 
10920   * @details The report could either be reported on PUCCH or PUSCH, a flag
10921   * conveys this information.
10922 *
10923 *
10924 *     Ret  : S16
10925 *
10926 *     Notes:
10927 *
10928 *     File  : 
10929 *
10930 **********************************************************/
10931 #ifdef ANSI
10932 S16 cmPkTfuDlCqiRpt
10933 (
10934 TfuDlCqiRpt *param,
10935 Buffer *mBuf
10936 )
10937 #else
10938 S16 cmPkTfuDlCqiRpt(param, mBuf)
10939 TfuDlCqiRpt *param;
10940 Buffer *mBuf;
10941 #endif
10942 {
10943
10944
10945       if (cmPkTfuDlCqiInfo(param->isPucchInfo, &param->dlCqiInfo, mBuf) != ROK)
10946          return RFAILED;
10947    CMCHKPK(oduUnpackUInt8, param->isPucchInfo, mBuf);
10948    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10949    return ROK;
10950 }
10951
10952
10953 \f
10954 /***********************************************************
10955 *
10956 *     Func : cmUnpkTfuDlCqiRpt
10957 *
10958 *
10959 *     Desc : This structure contains the DL CQI report for a single UE. 
10960   * @details The report could either be reported on PUCCH or PUSCH, a flag
10961   * conveys this information.
10962 *
10963 *
10964 *     Ret  : S16
10965 *
10966 *     Notes:
10967 *
10968 *     File  : 
10969 *
10970 **********************************************************/
10971 #ifdef ANSI
10972 S16 cmUnpkTfuDlCqiRpt
10973 (
10974 TfuDlCqiRpt *param,
10975 Buffer *mBuf
10976 )
10977 #else
10978 S16 cmUnpkTfuDlCqiRpt(param, mBuf)
10979 TfuDlCqiRpt *param;
10980 Buffer *mBuf;
10981 #endif
10982 {
10983
10984
10985    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10986    CMCHKUNPK(oduPackUInt8, &param->isPucchInfo, mBuf);
10987    if (cmUnpkTfuDlCqiInfo (param->isPucchInfo, &param->dlCqiInfo, mBuf) != ROK)
10988       return RFAILED;
10989    return ROK;
10990 }
10991
10992
10993 \f
10994 /***********************************************************
10995 *
10996 *     Func : cmPkTfuDlCqiIndInfo
10997 *
10998 *
10999 *     Desc : This structure contains a list of Downlink CQI reports transmitted by
11000  * UEs. 
11001  * @details This structure clubs together DL CQI reports for a number of UEs.
11002 *
11003 *
11004 *     Ret  : S16
11005 *
11006 *     Notes:
11007 *
11008 *     File  : 
11009 *
11010 **********************************************************/
11011 #ifdef ANSI
11012 S16 cmPkTfuDlCqiIndInfo
11013 (
11014 TfuDlCqiIndInfo *param,
11015 Buffer *mBuf
11016 )
11017 #else
11018 S16 cmPkTfuDlCqiIndInfo(param, mBuf)
11019 TfuDlCqiIndInfo *param;
11020 Buffer *mBuf;
11021 #endif
11022 {
11023
11024    CmLList *node;
11025    uint32_t count;
11026    TfuDlCqiRpt *tfuDlCqiRpt;
11027
11028
11029    count = param->dlCqiRptsLst.count;
11030    node = param->dlCqiRptsLst.last;
11031    while (node) {
11032       tfuDlCqiRpt = (TfuDlCqiRpt *)node->node;
11033       node=node->prev;
11034       CMCHKPK(cmPkTfuDlCqiRpt, tfuDlCqiRpt, mBuf);
11035       cmLListDelFrm(&param->dlCqiRptsLst, &tfuDlCqiRpt->lnk);
11036       tfuDlCqiRpt->lnk.node = (PTR)NULLP;
11037    }
11038    CMCHKPK(oduUnpackUInt32, count, mBuf);
11039    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11040    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11041    return ROK;
11042 }
11043
11044
11045 \f
11046 /***********************************************************
11047 *
11048 *     Func : cmUnpkTfuDlCqiIndInfo
11049 *
11050 *
11051 *     Desc : This structure contains a list of Downlink CQI reports transmitted by
11052  * UEs. 
11053  * @details This structure clubs together DL CQI reports for a number of UEs.
11054 *
11055 *
11056 *     Ret  : S16
11057 *
11058 *     Notes:
11059 *
11060 *     File  : 
11061 *
11062 **********************************************************/
11063 #ifdef ANSI
11064 S16 cmUnpkTfuDlCqiIndInfo
11065 (
11066 TfuDlCqiIndInfo *param,
11067 Ptr memCp,
11068 Buffer *mBuf
11069 )
11070 #else
11071 S16 cmUnpkTfuDlCqiIndInfo(param, memCp, mBuf)
11072 TfuDlCqiIndInfo *param;
11073 Ptr memCp;
11074 Buffer *mBuf;
11075 #endif
11076 {
11077
11078    uint32_t count, loopCnt;
11079    TfuDlCqiRpt *tfuDlCqiRpt;
11080
11081
11082    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11083    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11084    cmLListInit(&param->dlCqiRptsLst);
11085    CMCHKUNPK(oduPackUInt32, &count, mBuf);
11086    for (loopCnt=0; loopCnt<count; loopCnt++) {
11087       cmGetMem((Ptr)memCp, sizeof(*tfuDlCqiRpt), (Ptr *)&tfuDlCqiRpt);
11088       CMCHKUNPK(cmUnpkTfuDlCqiRpt, tfuDlCqiRpt, mBuf);
11089       cmLListAdd2Tail(&param->dlCqiRptsLst, &tfuDlCqiRpt->lnk);
11090       tfuDlCqiRpt->lnk.node = (PTR)tfuDlCqiRpt;
11091    }
11092    return ROK;
11093 }
11094
11095
11096 \f
11097 /***********************************************************
11098 *
11099 *     Func : cmPkTfuCrcInfo
11100 *
11101 *
11102 *     Desc : This structure contains the CRC indication for a single
11103   * UE.
11104 *
11105 *
11106 *     Ret  : S16
11107 *
11108 *     Notes:
11109 *
11110 *     File  : 
11111 *
11112 **********************************************************/
11113 #ifdef ANSI
11114 S16 cmPkTfuCrcInfo
11115 (
11116 TfuCrcInfo *param,
11117 Buffer *mBuf
11118 )
11119 #else
11120 S16 cmPkTfuCrcInfo(param, mBuf)
11121 TfuCrcInfo *param;
11122 Buffer *mBuf;
11123 #endif
11124 {
11125
11126
11127    CMCHKPK(cmPkTknUInt8, &param->rv, mBuf);
11128    CMCHKPK(oduUnpackUInt8, param->isFailure, mBuf);
11129    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11130    return ROK;
11131 }
11132
11133
11134 \f
11135 /***********************************************************
11136 *
11137 *     Func : cmUnpkTfuCrcInfo
11138 *
11139 *
11140 *     Desc : This structure contains the CRC indication for a single
11141   * UE.
11142 *
11143 *
11144 *     Ret  : S16
11145 *
11146 *     Notes:
11147 *
11148 *     File  : 
11149 *
11150 **********************************************************/
11151 #ifdef ANSI
11152 S16 cmUnpkTfuCrcInfo
11153 (
11154 TfuCrcInfo *param,
11155 Buffer *mBuf
11156 )
11157 #else
11158 S16 cmUnpkTfuCrcInfo(param, mBuf)
11159 TfuCrcInfo *param;
11160 Buffer *mBuf;
11161 #endif
11162 {
11163
11164
11165    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11166    CMCHKUNPK(oduPackUInt8, &param->isFailure, mBuf);
11167    CMCHKUNPK(cmUnpkTknUInt8, &param->rv, mBuf);
11168    return ROK;
11169 }
11170
11171
11172 \f
11173 /***********************************************************
11174 *
11175 *     Func : cmPkTfuCrcIndInfo
11176 *
11177 *
11178 *     Desc : This structure contains information that is passed as a part of the
11179  * CRC Indication from PHY to MAC.
11180  * @details This structure clubs together all the CRC indications for
11181  * a single subframe and conveys this information to the scheduler.
11182 *
11183 *
11184 *     Ret  : S16
11185 *
11186 *     Notes:
11187 *
11188 *     File  : 
11189 *
11190 **********************************************************/
11191 #ifdef ANSI
11192 S16 cmPkTfuCrcIndInfo
11193 (
11194 TfuCrcIndInfo *param,
11195 Buffer *mBuf
11196 )
11197 #else
11198 S16 cmPkTfuCrcIndInfo(param, mBuf)
11199 TfuCrcIndInfo *param;
11200 Buffer *mBuf;
11201 #endif
11202 {
11203
11204    CmLList *node;
11205    uint32_t count;
11206    TfuCrcInfo *tfuCrcIndInfo;
11207
11208
11209 #ifdef TFU_5GTF
11210    CMCHKPK(oduUnpackUInt8, param->sccIdx, mBuf);
11211    CMCHKPK(oduUnpackUInt8, param->sectorId, mBuf);
11212 #endif /* TFU_5GTF */
11213    count = param->crcLst.count;
11214    node = param->crcLst.last;
11215    while (node) {
11216       tfuCrcIndInfo = (TfuCrcInfo *)node->node;
11217       node=node->prev;
11218       CMCHKPK(cmPkTfuCrcInfo, tfuCrcIndInfo, mBuf);
11219       cmLListDelFrm(&param->crcLst, &tfuCrcIndInfo->lnk);
11220       tfuCrcIndInfo->lnk.node = (PTR)NULLP;
11221    }
11222    CMCHKPK(oduUnpackUInt32, count, mBuf);
11223    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11224    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11225    return ROK;
11226 }
11227
11228
11229 \f
11230 /***********************************************************
11231 *
11232 *     Func : cmUnpkTfuCrcIndInfo
11233 *
11234 *
11235 *     Desc : This structure contains information that is passed as a part of the
11236  * CRC Indication from PHY to MAC.
11237  * @details This structure clubs together all the CRC indications for
11238  * a single subframe and conveys this information to the scheduler.
11239 *
11240 *
11241 *     Ret  : S16
11242 *
11243 *     Notes:
11244 *
11245 *     File  : 
11246 *
11247 **********************************************************/
11248 #ifdef ANSI
11249 S16 cmUnpkTfuCrcIndInfo
11250 (
11251 TfuCrcIndInfo *param,
11252 Ptr memCp,
11253 Buffer *mBuf
11254 )
11255 #else
11256 S16 cmUnpkTfuCrcIndInfo(param, memCp, mBuf)
11257 TfuCrcIndInfo *param;
11258 Ptr memCp;
11259 Buffer *mBuf;
11260 #endif
11261 {
11262
11263    uint32_t count, loopCnt;
11264    TfuCrcInfo *tfuCrcIndInfo;
11265
11266
11267    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11268    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11269    cmLListInit(&param->crcLst);
11270    CMCHKUNPK(oduPackUInt32, &count, mBuf);
11271    for (loopCnt=0; loopCnt<count; loopCnt++) {
11272       cmGetMem((Ptr)memCp, sizeof(*tfuCrcIndInfo), (Ptr *)&tfuCrcIndInfo);
11273       CMCHKUNPK(cmUnpkTfuCrcInfo, tfuCrcIndInfo, mBuf);
11274       cmLListAdd2Tail(&param->crcLst, &tfuCrcIndInfo->lnk);
11275       tfuCrcIndInfo->lnk.node = (PTR)tfuCrcIndInfo;
11276    }
11277 #ifdef TFU_5GTF
11278    CMCHKUNPK(oduPackUInt8, &param->sectorId, mBuf);
11279    CMCHKUNPK(oduPackUInt8, &param->sccIdx, mBuf);
11280 #endif /* TFU_5GTF */
11281    return ROK;
11282 }
11283
11284
11285 \f
11286 /***********************************************************
11287 *
11288 *     Func : cmPkTfuTimingAdvInfo
11289 *
11290 *
11291 *     Desc : This structure contains the timing advance information for a single
11292   * UE.
11293 *
11294 *
11295 *     Ret  : S16
11296 *
11297 *     Notes:
11298 *
11299 *     File  : 
11300 *
11301 **********************************************************/
11302 #ifdef ANSI
11303 S16 cmPkTfuTimingAdvInfo
11304 (
11305 TfuTimingAdvInfo *param,
11306 Buffer *mBuf
11307 )
11308 #else
11309 S16 cmPkTfuTimingAdvInfo(param, mBuf)
11310 TfuTimingAdvInfo *param;
11311 Buffer *mBuf;
11312 #endif
11313 {
11314
11315
11316    CMCHKPK(oduUnpackUInt8, param->timingAdv, mBuf);
11317    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11318    return ROK;
11319 }
11320
11321
11322 \f
11323 /***********************************************************
11324 *
11325 *     Func : cmUnpkTfuTimingAdvInfo
11326 *
11327 *
11328 *     Desc : This structure contains the timing advance information for a single
11329   * UE.
11330 *
11331 *
11332 *     Ret  : S16
11333 *
11334 *     Notes:
11335 *
11336 *     File  : 
11337 *
11338 **********************************************************/
11339 #ifdef ANSI
11340 S16 cmUnpkTfuTimingAdvInfo
11341 (
11342 TfuTimingAdvInfo *param,
11343 Buffer *mBuf
11344 )
11345 #else
11346 S16 cmUnpkTfuTimingAdvInfo(param, mBuf)
11347 TfuTimingAdvInfo *param;
11348 Buffer *mBuf;
11349 #endif
11350 {
11351
11352
11353    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11354    CMCHKUNPK(oduPackUInt8, &param->timingAdv, mBuf);
11355    return ROK;
11356 }
11357
11358
11359 \f
11360 /***********************************************************
11361 *
11362 *     Func : cmPkTfuTimingAdvIndInfo
11363 *
11364 *
11365 *     Desc : This structure contains information that is passed as part of the Timing
11366  * Advance indication from PHY to MAC.
11367  * @details This structure clubs together timing advances for a number of UEs.
11368 *
11369 *
11370 *     Ret  : S16
11371 *
11372 *     Notes:
11373 *
11374 *     File  : 
11375 *
11376 **********************************************************/
11377 #ifdef ANSI
11378 S16 cmPkTfuTimingAdvIndInfo
11379 (
11380 TfuTimingAdvIndInfo *param,
11381 Buffer *mBuf
11382 )
11383 #else
11384 S16 cmPkTfuTimingAdvIndInfo(param, mBuf)
11385 TfuTimingAdvIndInfo *param;
11386 Buffer *mBuf;
11387 #endif
11388 {
11389
11390    CmLList *node;
11391    uint32_t count;
11392    TfuTimingAdvInfo *tfuTimingAdvInfo;
11393
11394
11395    count = param->timingAdvLst.count;
11396    node = param->timingAdvLst.last;
11397    while (node) {
11398       tfuTimingAdvInfo = (TfuTimingAdvInfo *)node->node;
11399       node=node->prev;
11400       CMCHKPK(cmPkTfuTimingAdvInfo, tfuTimingAdvInfo, mBuf);
11401       cmLListDelFrm(&param->timingAdvLst, &tfuTimingAdvInfo->lnk);
11402       tfuTimingAdvInfo->lnk.node = (PTR)NULLP;
11403    }
11404    CMCHKPK(oduUnpackUInt32, count, mBuf);
11405    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11406    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11407    return ROK;
11408 }
11409
11410
11411 \f
11412 /***********************************************************
11413 *
11414 *     Func : cmUnpkTfuTimingAdvIndInfo
11415 *
11416 *
11417 *     Desc : This structure contains information that is passed as part of the Timing
11418  * Advance indication from PHY to MAC.
11419  * @details This structure clubs together timing advances for a number of UEs.
11420 *
11421 *
11422 *     Ret  : S16
11423 *
11424 *     Notes:
11425 *
11426 *     File  : 
11427 *
11428 **********************************************************/
11429 #ifdef ANSI
11430 S16 cmUnpkTfuTimingAdvIndInfo
11431 (
11432 TfuTimingAdvIndInfo *param,
11433 Ptr memCp,
11434 Buffer *mBuf
11435 )
11436 #else
11437 S16 cmUnpkTfuTimingAdvIndInfo(param, memCp, mBuf)
11438 TfuTimingAdvIndInfo *param;
11439 Ptr memCp;
11440 Buffer *mBuf;
11441 #endif
11442 {
11443
11444    uint32_t count, loopCnt;
11445    TfuTimingAdvInfo *tfuTimingAdvInfo;
11446
11447
11448    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11449    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11450    cmLListInit(&param->timingAdvLst);
11451    CMCHKUNPK(oduPackUInt32, &count, mBuf);
11452    for (loopCnt=0; loopCnt<count; loopCnt++) {
11453       cmGetMem((Ptr)memCp, sizeof(*tfuTimingAdvInfo), (Ptr *)&tfuTimingAdvInfo);
11454       CMCHKUNPK(cmUnpkTfuTimingAdvInfo, tfuTimingAdvInfo, mBuf);
11455       cmLListAdd2Tail(&param->timingAdvLst, &tfuTimingAdvInfo->lnk);
11456       tfuTimingAdvInfo->lnk.node = (PTR)tfuTimingAdvInfo;
11457    }
11458    return ROK;
11459 }
11460
11461 /*CA dev Start*/
11462 /***********************************************************
11463 *
11464 *     Func : cmPkTfuTtiCellInfo
11465 *
11466 *
11467 *     Desc : This structure contains information that is 
11468 *     passed as a part of the TTI indication sent 
11469 *     from CL to MAC and SCH
11470 *
11471 *
11472 *     Ret  : S16
11473 *
11474 *     Notes:
11475 *
11476 *     File  : 
11477 *
11478 **********************************************************/
11479 #ifdef ANSI
11480 S16 cmPkTfuTtiCellInfo
11481 (
11482 TfuTtiCellInfo *param,
11483 Buffer *mBuf
11484 )
11485 #else
11486 S16 cmPkTfuTtiCellInfo(param, mBuf)
11487 TfuTtiCellInfo *param;
11488 Buffer *mBuf;
11489 #endif
11490 {
11491
11492
11493    CMCHKPK(oduUnpackUInt8, param->ulBlankSf, mBuf);
11494    CMCHKPK(oduUnpackUInt8, param->dlBlankSf, mBuf);
11495    CMCHKPK(oduUnpackUInt8, param->schTickDelta, mBuf);
11496    CMCHKPK(oduPackBool, param->isDummyTti, mBuf);
11497    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11498    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11499    return ROK;
11500 }
11501 /*CA dev End*/
11502 \f
11503 /***********************************************************
11504 *
11505 *     Func : cmPkTfuTtiIndInfo
11506 *
11507 *
11508 *     Desc : This structure contains information that is passed as a part of the TTI
11509  * indication sent from PHY to MAC.
11510 *
11511 *
11512 *     Ret  : S16
11513 *
11514 *     Notes:
11515 *
11516 *     File  : 
11517 *
11518 **********************************************************/
11519 #ifdef ANSI
11520 S16 cmPkTfuTtiIndInfo
11521 (
11522 TfuTtiIndInfo *param,
11523 Buffer *mBuf
11524 )
11525 #else
11526 S16 cmPkTfuTtiIndInfo(param, mBuf)
11527 TfuTtiIndInfo *param;
11528 Buffer *mBuf;
11529 #endif
11530 {
11531
11532    S32 i;
11533
11534    /*CA dev Start*/
11535    for (i=(param->numCells-1); i >= 0; i--) {
11536          CMCHKPK(cmPkTfuTtiCellInfo, &param->cells[i], mBuf);
11537       }
11538    CMCHKPK(oduUnpackUInt8, param->numCells, mBuf);
11539    /*CA dev End*/
11540    return ROK;
11541 }
11542
11543 /* CA dev Start */
11544 /***********************************************************
11545 *
11546 *     Func : cmUnpkTfuTtiCellInfo
11547 *
11548 *
11549 *     Desc : This structure contains information that is 
11550 *     passed as a part of the TTI indication sent 
11551 *     from CL to MAC and SCH
11552 *
11553 *
11554 *     Ret  : S16
11555 *
11556 *     Notes:
11557 *
11558 *     File  : 
11559 *
11560 **********************************************************/
11561 #ifdef ANSI
11562 S16 cmUnpkTfuTtiCellInfo
11563 (
11564 TfuTtiCellInfo *param,
11565 Buffer *mBuf
11566 )
11567 #else
11568 S16 cmUnpkTfuTtiCellInfo(param, mBuf)
11569 TfuTtiCellInfo *param;
11570 Buffer *mBuf;
11571 #endif
11572 {
11573
11574
11575    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11576    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11577    CMCHKUNPK(oduUnpackBool, &param->isDummyTti, mBuf);
11578    CMCHKUNPK(oduPackUInt8, &param->schTickDelta, mBuf);
11579    CMCHKUNPK(oduPackUInt8, &param->dlBlankSf, mBuf);
11580    CMCHKUNPK(oduPackUInt8, &param->ulBlankSf, mBuf);
11581    return ROK;
11582 }
11583 /* CA dev End */
11584
11585 \f
11586 /***********************************************************
11587 *
11588 *     Func : cmPkTfuRaReqInfo
11589 *
11590 *
11591 *     Desc : This structure contains the information for a single Random Access Request.
11592  * @details The information present in this structure is for a single preamble.
11593  * Associated with each preamble are fields that the physical layer calculates
11594  * based on the reception of the Random Access Request. These are the following
11595  * -# Timing Advance
11596  * -# TPC
11597  * -# CQI (optional).
11598 *
11599 *
11600 *     Ret  : S16
11601 *
11602 *     Notes:
11603 *
11604 *     File  : 
11605 *
11606 **********************************************************/
11607 #ifdef ANSI
11608 S16 cmPkTfuRaReqInfo
11609 (
11610 TfuRaReqInfo *param,
11611 Buffer *mBuf
11612 )
11613 #else
11614 S16 cmPkTfuRaReqInfo(param, mBuf)
11615 TfuRaReqInfo *param;
11616 Buffer *mBuf;
11617 #endif
11618 {
11619
11620
11621    CMCHKPK(oduUnpackUInt8, param->cqiIdx, mBuf);
11622    CMCHKPK(oduUnpackUInt8, param->cqiPres, mBuf);
11623    CMCHKPK(oduUnpackUInt8, param->tpc, mBuf);
11624    CMCHKPK(oduUnpackUInt16, param->ta, mBuf);
11625    CMCHKPK(oduUnpackUInt8, param->rapId, mBuf);
11626    return ROK;
11627 }
11628
11629
11630 \f
11631 /***********************************************************
11632 *
11633 *     Func : cmUnpkTfuRaReqInfo
11634 *
11635 *
11636 *     Desc : This structure contains the information for a single Random Access Request.
11637  * @details The information present in this structure is for a single preamble.
11638  * Associated with each preamble are fields that the physical layer calculates
11639  * based on the reception of the Random Access Request. These are the following
11640  * -# Timing Advance
11641  * -# TPC
11642  * -# CQI (optional).
11643 *
11644 *
11645 *     Ret  : S16
11646 *
11647 *     Notes:
11648 *
11649 *     File  : 
11650 *
11651 **********************************************************/
11652 #ifdef ANSI
11653 S16 cmUnpkTfuRaReqInfo
11654 (
11655 TfuRaReqInfo *param,
11656 Buffer *mBuf
11657 )
11658 #else
11659 S16 cmUnpkTfuRaReqInfo(param, mBuf)
11660 TfuRaReqInfo *param;
11661 Buffer *mBuf;
11662 #endif
11663 {
11664
11665
11666    CMCHKUNPK(oduPackUInt8, &param->rapId, mBuf);
11667    CMCHKUNPK(oduPackUInt16, &param->ta, mBuf);
11668    CMCHKUNPK(oduPackUInt8, &param->tpc, mBuf);
11669    CMCHKUNPK(oduPackUInt8, &param->cqiPres, mBuf);
11670    CMCHKUNPK(oduPackUInt8, &param->cqiIdx, mBuf);
11671    return ROK;
11672 }
11673
11674
11675 \f
11676 /***********************************************************
11677 *
11678 *     Func : cmPkTfuRachInfo
11679 *
11680 *
11681 *     Desc : This structure contains RACH request information for a single
11682   * RA-RNTI.
11683 *
11684 *
11685 *     Ret  : S16
11686 *
11687 *     Notes:
11688 *
11689 *     File  : 
11690 *
11691 **********************************************************/
11692 #ifdef ANSI
11693 S16 cmPkTfuRachInfo
11694 (
11695  CmMemListCp   memCp,
11696 TfuRachInfo *param,
11697 Buffer *mBuf
11698 )
11699 #else
11700 S16 cmPkTfuRachInfo(memCp, param, mBuf)
11701  CmMemListCp   memCp;
11702 TfuRachInfo *param;
11703 Buffer *mBuf;
11704 #endif
11705 {
11706
11707    S32 i;
11708
11709    for (i= (param->numRaReqInfo - 1); i >= 0; i--) {
11710       CMCHKPK(cmPkTfuRaReqInfo, &(param->raReqInfoArr[i]), mBuf);
11711    }
11712 #ifdef PRACH_5GTF 
11713    CMCHKPK(oduUnpackUInt16, param->nPwrFactor, mBuf);
11714    CMCHKPK(oduUnpackUInt8, param->nPRACHSymbIndex, mBuf);
11715    CMCHKPK(oduUnpackUInt8, param->nf1Value, mBuf);
11716    CMCHKPK(oduUnpackUInt8, param->nCyclicShift, mBuf);
11717    CMCHKPK(oduUnpackUInt8, param->nRootSeq, mBuf);
11718    CMCHKPK(oduUnpackUInt8, param->nPRACHConfiguration, mBuf);
11719    CMCHKPK(oduUnpackUInt8, param->nPreambleFormat, mBuf);
11720 #endif
11721    CMCHKPK(oduUnpackUInt8, param->numRaReqInfo, mBuf);
11722    CMCHKPK(cmPkLteRnti, param->raRnti, mBuf);
11723    return ROK;
11724 }
11725
11726
11727 \f
11728 /***********************************************************
11729 *
11730 *     Func : cmUnpkTfuRachInfo
11731 *
11732 *
11733 *     Desc : This structure contains RACH request information for a single
11734   * RA-RNTI.
11735 *
11736 *
11737 *     Ret  : S16
11738 *
11739 *     Notes:
11740 *
11741 *     File  : 
11742 *
11743 **********************************************************/
11744 #ifdef ANSI
11745 S16 cmUnpkTfuRachInfo
11746 (
11747 CmMemListCp   memCp,
11748 TfuRachInfo *param,
11749 Buffer *mBuf
11750 )
11751 #else
11752 S16 cmUnpkTfuRachInfo(memCp, param, mBuf)
11753 CmMemListCp   memCp;
11754 TfuRachInfo *param;
11755 Buffer *mBuf;
11756 #endif
11757 {
11758
11759    S32 i;
11760
11761    CMCHKUNPK(cmUnpkLteRnti, &param->raRnti, mBuf);
11762    CMCHKUNPK(oduPackUInt8, &param->numRaReqInfo, mBuf);
11763 #ifdef PRACH_5GTF 
11764    CMCHKUNPK(oduUnpackUInt8, param->nPreambleFormat, mBuf);
11765    CMCHKUNPK(oduUnpackUInt8, param->nPRACHConfiguration, mBuf);
11766    CMCHKUNPK(oduUnpackUInt8, param->nRootSeq, mBuf);
11767    CMCHKUNPK(oduUnpackUInt8, param->nCyclicShift, mBuf);
11768    CMCHKUNPK(oduUnpackUInt8, param->nf1Value, mBuf);
11769    CMCHKUNPK(oduUnpackUInt8, param->nPRACHSymbIndex, mBuf);
11770    CMCHKUNPK(oduUnpackUInt16, param->nPwrFactor, mBuf);
11771 #endif
11772    if (cmGetMem (&(memCp), (sizeof(TfuRaReqInfo) * param->numRaReqInfo), 
11773             (Ptr *)&param->raReqInfoArr) != ROK)
11774    {
11775       return RFAILED;
11776    }
11777    for (i=0; i<param->numRaReqInfo; i++) {
11778       CMCHKUNPK(cmUnpkTfuRaReqInfo, &param->raReqInfoArr[i], mBuf);
11779    }
11780    return ROK;
11781 }
11782
11783
11784 \f
11785 /***********************************************************
11786 *
11787 *     Func : cmPkTfuRaReqIndInfo
11788 *
11789 *
11790 *     Desc : This structure contains the list of Random Access Requests received in a
11791  * single TTI.
11792  * @details Random Access Request is associated with a RA-RNTI, which remains
11793  * common for all the Random access requests within a subframe. This structure
11794  * thus carries the RA-RNTI and a list of Random Access Request information.
11795  * This information consists of the following 
11796  * -# preamble-id - this corresponds to the Index of the Preamble choosen by the
11797  * UE.
11798  * -# Timing Advance - this corresponds to the timing adjustment that the UE
11799  * needs to be uplink synchronized. This value is calculated by physical layer. 
11800  * -# tpc - this is the power control command that the physical layer calculates
11801  * from the received RA request. This value is transmitted in the RA Response
11802  * sent out by MAC.
11803  * -# CQI - this is the Channel quality index of the UL channel estimated by the
11804  * physical layer. This aids MAC in the scheduling of this UE.
11805 *
11806 *
11807 *     Ret  : S16
11808 *
11809 *     Notes:
11810 *
11811 *     File  : 
11812 *
11813 **********************************************************/
11814 #ifdef ANSI
11815 S16 cmPkTfuRaReqIndInfo
11816 (
11817 TfuRaReqIndInfo *param,
11818 Buffer *mBuf
11819 )
11820 #else
11821 S16 cmPkTfuRaReqIndInfo(param, mBuf)
11822 TfuRaReqIndInfo *param;
11823 Buffer *mBuf;
11824 #endif
11825 {
11826
11827    S32 i;
11828
11829    for (i= (param->nmbOfRaRnti-1); i >= 0; i--) 
11830    {
11831       if (ROK != cmPkTfuRachInfo(param->memCp, 
11832                &(param->rachInfoArr[i]), mBuf))
11833       {
11834          return RFAILED;
11835       }
11836    }
11837    CMCHKPK(oduUnpackUInt8, param->nmbOfRaRnti, mBuf);
11838    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11839    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11840    return ROK;
11841 }
11842
11843
11844 \f
11845 /***********************************************************
11846 *
11847 *     Func : cmUnpkTfuRaReqIndInfo
11848 *
11849 *
11850 *     Desc : This structure contains the list of Random Access Requests received in a
11851  * single TTI.
11852  * @details Random Access Request is associated with a RA-RNTI, which remains
11853  * common for all the Random access requests within a subframe. This structure
11854  * thus carries the RA-RNTI and a list of Random Access Request information.
11855  * This information consists of the following 
11856  * -# preamble-id - this corresponds to the Index of the Preamble choosen by the
11857  * UE.
11858  * -# Timing Advance - this corresponds to the timing adjustment that the UE
11859  * needs to be uplink synchronized. This value is calculated by physical layer. 
11860  * -# tpc - this is the power control command that the physical layer calculates
11861  * from the received RA request. This value is transmitted in the RA Response
11862  * sent out by MAC.
11863  * -# CQI - this is the Channel quality index of the UL channel estimated by the
11864  * physical layer. This aids MAC in the scheduling of this UE.
11865 *
11866 *
11867 *     Ret  : S16
11868 *
11869 *     Notes:
11870 *
11871 *     File  : 
11872 *
11873 **********************************************************/
11874 #ifdef ANSI
11875 S16 cmUnpkTfuRaReqIndInfo
11876 (
11877 TfuRaReqIndInfo *param,
11878 Buffer *mBuf
11879 )
11880 #else
11881 S16 cmUnpkTfuRaReqIndInfo(param, mBuf)
11882 TfuRaReqIndInfo *param;
11883 Buffer *mBuf;
11884 #endif
11885 {
11886
11887    S32 i;
11888
11889    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11890    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11891    CMCHKUNPK(oduPackUInt8, &param->nmbOfRaRnti, mBuf);
11892    if (cmGetMem (&(param->memCp), (sizeof(TfuRachInfo) * param->nmbOfRaRnti), 
11893             (Ptr *)&param->rachInfoArr) != ROK)
11894    {
11895       return RFAILED;
11896    }
11897    for (i=0; i<param->nmbOfRaRnti; i++) 
11898    {
11899       if (ROK != cmUnpkTfuRachInfo(param->memCp, &param->rachInfoArr[i], mBuf))
11900       {
11901          return RFAILED;
11902       }
11903    }
11904    return ROK;
11905 }
11906
11907
11908 \f
11909 /***********************************************************
11910 *
11911 *     Func : cmPkTfuPucchDeltaPwr
11912 *
11913 *
11914 *     Desc : This structure contains PUCCH Delta power for a single UE.
11915 *
11916 *
11917 *     Ret  : S16
11918 *
11919 *     Notes:
11920 *
11921 *     File  : 
11922 *
11923 **********************************************************/
11924 #ifdef ANSI
11925 S16 cmPkTfuPucchDeltaPwrInfo
11926 (
11927 TfuPucchDeltaPwr *param,
11928 Buffer *mBuf
11929 )
11930 #else
11931 S16 cmPkTfuPucchDeltaPwrInfo(param, mBuf)
11932 TfuPucchDeltaPwr *param;
11933 Buffer *mBuf;
11934 #endif
11935 {
11936
11937
11938    CMCHKPK(SPkS8, param->pucchDeltaPwr, mBuf);
11939    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11940    return ROK;
11941 }
11942
11943
11944 \f
11945 /***********************************************************
11946 *
11947 *     Func : cmUnpkTfuPucchDeltaPwr
11948 *
11949 *
11950 *     Desc : This structure contains PUCCH Delta power for a single UE.
11951 *
11952 *
11953 *     Ret  : S16
11954 *
11955 *     Notes:
11956 *
11957 *     File  : 
11958 *
11959 **********************************************************/
11960 #ifdef ANSI
11961 S16 cmUnpkTfuPucchDeltaPwrInfo
11962 (
11963 TfuPucchDeltaPwr *param,
11964 Buffer *mBuf
11965 )
11966 #else
11967 S16 cmUnpkTfuPucchDeltaPwrInfo(param, mBuf)
11968 TfuPucchDeltaPwr *param;
11969 Buffer *mBuf;
11970 #endif
11971 {
11972
11973
11974    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11975    CMCHKUNPK(SUnpkS8, &param->pucchDeltaPwr, mBuf);
11976    return ROK;
11977 }
11978
11979
11980 \f
11981 /***********************************************************
11982 *
11983 *     Func : cmPkTfuPucchDeltaPwrIndInfo
11984 *
11985 *
11986 *     Desc : This structure contains information that is passed as a part of the
11987  * PUCCH Delta power indication from PHY to SCH.
11988  * @details This structure clubs together PUCCH Delta power values for a number
11989  * of UEs.
11990 *
11991 *
11992 *     Ret  : S16
11993 *
11994 *     Notes:
11995 *
11996 *     File  : 
11997 *
11998 **********************************************************/
11999 #ifdef ANSI
12000 S16 cmPkTfuPucchDeltaPwrIndInfo
12001 (
12002 TfuPucchDeltaPwrIndInfo *param,
12003 Buffer *mBuf
12004 )
12005 #else
12006 S16 cmPkTfuPucchDeltaPwrIndInfo(param, mBuf)
12007 TfuPucchDeltaPwrIndInfo *param;
12008 Buffer *mBuf;
12009 #endif
12010 {
12011
12012    CmLList *node;
12013    uint32_t count;
12014    TfuPucchDeltaPwr *tfuPucchDeltaPwr;
12015
12016
12017    count = param->pucchDeltaPwrLst.count;
12018    node = param->pucchDeltaPwrLst.last;
12019    while (node) {
12020       tfuPucchDeltaPwr = (TfuPucchDeltaPwr *)node->node;
12021       node=node->prev;
12022       CMCHKPK(cmPkTfuPucchDeltaPwrInfo, tfuPucchDeltaPwr, mBuf);
12023       cmLListDelFrm(&param->pucchDeltaPwrLst, &tfuPucchDeltaPwr->lnk);
12024       tfuPucchDeltaPwr->lnk.node = (PTR)NULLP;
12025    }
12026    CMCHKPK(oduUnpackUInt32, count, mBuf);
12027    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
12028    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
12029    return ROK;
12030 }
12031
12032
12033 \f
12034 /***********************************************************
12035 *
12036 *     Func : cmUnpkTfuPucchDeltaPwrIndInfo
12037 *
12038 *
12039 *     Desc : This structure contains information that is passed as a part of the
12040  * PUCCH Delta power indication from PHY to SCH.
12041  * @details This structure clubs together PUCCH Delta power values for a number
12042  * of UEs.
12043 *
12044 *
12045 *     Ret  : S16
12046 *
12047 *     Notes:
12048 *
12049 *     File  : 
12050 *
12051 **********************************************************/
12052 #ifdef ANSI
12053 S16 cmUnpkTfuPucchDeltaPwrIndInfo
12054 (
12055 TfuPucchDeltaPwrIndInfo *param,
12056 Ptr memCp,
12057 Buffer *mBuf
12058 )
12059 #else
12060 S16 cmUnpkTfuPucchDeltaPwrIndInfo(param, memCp, mBuf)
12061 TfuPucchDeltaPwrIndInfo *param;
12062 Ptr memCp;
12063 Buffer *mBuf;
12064 #endif
12065 {
12066
12067    uint32_t count, loopCnt;
12068    TfuPucchDeltaPwr *tfuPucchDeltaPwr;
12069
12070
12071    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
12072    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
12073    cmLListInit(&param->pucchDeltaPwrLst);
12074    CMCHKUNPK(oduPackUInt32, &count, mBuf);
12075    for (loopCnt=0; loopCnt<count; loopCnt++) {
12076       cmGetMem((Ptr)memCp, sizeof(*tfuPucchDeltaPwr), (Ptr *)&tfuPucchDeltaPwr);
12077       CMCHKUNPK(cmUnpkTfuPucchDeltaPwrInfo, tfuPucchDeltaPwr, mBuf);
12078       cmLListAdd2Tail(&param->pucchDeltaPwrLst, &tfuPucchDeltaPwr->lnk);
12079       tfuPucchDeltaPwr->lnk.node = (PTR)tfuPucchDeltaPwr;
12080    }
12081    return ROK;
12082 }
12083
12084 #ifdef ANSI
12085 S16 cmPkBuffer
12086 (
12087 Buffer **param,
12088 Buffer *mBuf
12089 )
12090 #else
12091 S16 cmPkBuffer(param, mBuf)
12092 Buffer **param;
12093 Buffer *mBuf;
12094 #endif
12095 {
12096    MsgLen msgLen=0;
12097    if (SFndLenMsg(*param, &msgLen) != ROK)
12098       return RFAILED;
12099    if (SCatMsg(mBuf, *param, M1M2) != ROK)
12100       return RFAILED;
12101    TFU_FREE_MSG(*param);
12102    *param = NULLP;
12103    CMCHKPK(cmPkMsgLen, msgLen, mBuf);
12104    return ROK;
12105 }
12106 #ifdef ANSI
12107 S16 cmUnpkBuffer
12108 (
12109 Buffer **param,
12110 Buffer *mBuf
12111 )
12112 #else
12113 S16 cmUnpkBuffer(param, mBuf)
12114 Buffer **param;
12115 Buffer *mBuf;
12116 #endif
12117 {
12118    MsgLen msgLen=0, totalMsgLen=0;
12119    CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
12120    if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
12121       return RFAILED;
12122    if (SSegMsg(mBuf, totalMsgLen-msgLen, param) != ROK)
12123       return RFAILED;
12124    return ROK;
12125 }
12126
12127
12128 /***********************************************************
12129 *
12130 *     Func : cmPkTfuDoaInd
12131 *
12132 *
12133 *     Desc : This API is used to indicate DOA(Direction Of Arrival)
12134  * identifier for one or more UEs.
12135  * It carries a DOA for each UE. 
12136  * @param pst Pointer to the post structure.
12137  * @param suId SAP ID of the service user.
12138  * @param doaInd Pointer to the TfuDoaIndInfo structure.
12139  * @return ROK/RFAILED
12140 *
12141 *
12142 *     Ret  : S16
12143 *
12144 *     Notes:
12145 *
12146 *     File  : 
12147 *
12148 **********************************************************/
12149 #ifdef ANSI
12150 S16 cmPkTfuDoaInd
12151 (
12152 Pst * pst,
12153 SuId suId,
12154 TfuDoaIndInfo * doaInd
12155 )
12156 #else
12157 S16 cmPkTfuDoaInd(pst, suId, doaInd)
12158 Pst * pst;
12159 SuId suId;
12160 TfuDoaIndInfo * doaInd;
12161 #endif
12162 {
12163    Buffer *mBuf = NULLP;
12164
12165    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
12166 #if (ERRCLASS & ERRCLS_ADD_RES)
12167       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12168          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12169          (ErrVal)ETFU125, (ErrVal)0, "Packing failed");
12170 #endif
12171       SPutSBuf(pst->region, pst->pool, (Data *)doaInd, sizeof(TfuDoaIndInfo));
12172       return RFAILED;
12173    }
12174       cmPkTfuDoaIndInfo(doaInd, mBuf);
12175    if (SPkS16(suId, mBuf) != ROK) {
12176 #if (ERRCLASS & ERRCLS_ADD_RES)
12177       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12178          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12179          (ErrVal)ETFU126, (ErrVal)0, "Packing failed");
12180 #endif
12181       TFU_FREE_MEM(doaInd);
12182       TFU_FREE_MSG(mBuf);
12183       return RFAILED;
12184    }
12185    TFU_FREE_MEM(doaInd);
12186    pst->event = (Event) EVTTFUDOAIND;
12187    return (SPstTsk(pst,mBuf));
12188 }
12189
12190 \f
12191 /***********************************************************
12192 *
12193 *     Func : cmUnpkTfuDoaInd
12194 *
12195 *
12196 *     Desc : This API is used to indicate DOA(Direction Of Arrival)
12197  * identifier for one or more UEs.
12198  * It carries a DOA for each UE. 
12199  * @param pst Pointer to the post structure.
12200  * @param suId SAP ID of the service user.
12201  * @param doaInd Pointer to the TfuDoaIndInfo structure.
12202  * @return ROK/RFAILED
12203 *
12204 *
12205 *     Ret  : S16
12206 *
12207 *     Notes:
12208 *
12209 *     File  : 
12210 *
12211 **********************************************************/
12212 #ifdef ANSI
12213 S16 cmUnpkTfuDoaInd
12214 (
12215 TfuDoaInd func,
12216 Pst *pst,
12217 Buffer *mBuf
12218 )
12219 #else
12220 S16 cmUnpkTfuDoaInd(func, pst, mBuf)
12221 TfuDoaInd func;
12222 Pst *pst;
12223 Buffer *mBuf;
12224 #endif
12225 {
12226    SuId suId;
12227    TfuDoaIndInfo *doaInd;
12228    
12229
12230    if (SUnpkS16(&suId, mBuf) != ROK) {
12231       TFU_FREE_MSG(mBuf);
12232 #if (ERRCLASS & ERRCLS_ADD_RES)
12233       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12234          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12235          (ErrVal)ETFU127, (ErrVal)0, "Packing failed");
12236 #endif
12237       return RFAILED;
12238    }
12239    {
12240       Mem   sMem;
12241       sMem.region = pst->region;
12242       sMem.pool = pst->pool;
12243       if ((cmAllocEvnt(sizeof(TfuDoaIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&doaInd)) != ROK)            {
12244 #if (ERRCLASS & ERRCLS_ADD_RES)
12245          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12246             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12247             (ErrVal)ETFU128, (ErrVal)0, "Packing failed");
12248 #endif
12249          TFU_FREE_MSG(mBuf);
12250          return RFAILED;
12251       }
12252    }
12253    
12254       cmUnpkTfuDoaIndInfo(doaInd, (Ptr)&doaInd->memCp, mBuf);
12255    TFU_FREE_MSG(mBuf);
12256    return ((*func)(pst, suId, doaInd));
12257 }
12258
12259
12260 \f
12261 /***********************************************************
12262 *
12263 *     Func : cmPkTfuDciFormatTbInfo
12264 *
12265 *
12266 *     Desc : This structure contains the TB level DCI signalling
12267   * parameters in case of DCI formats 2 and 2A
12268 *
12269 *
12270 *     Ret  : S16
12271 *
12272 *     Notes:
12273 *
12274 *     File  : 
12275 *
12276 **********************************************************/
12277 #ifdef ANSI
12278 S16 cmPkTfuDciFormatTbInfo
12279 (
12280 TfuDciFormatTbInfo *param,
12281 Buffer *mBuf
12282 )
12283 #else
12284 S16 cmPkTfuDciFormatTbInfo(param, mBuf)
12285 TfuDciFormatTbInfo *param;
12286 Buffer *mBuf;
12287 #endif
12288 {
12289
12290
12291    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
12292    CMCHKPK(oduUnpackUInt8, param->rv, mBuf);
12293    CMCHKPK(oduUnpackUInt8, param->ndi, mBuf);
12294    return ROK;
12295 }
12296
12297
12298 \f
12299 /***********************************************************
12300 *
12301 *     Func : cmUnpkTfuDciFormatTbInfo
12302 *
12303 *
12304 *     Desc : This structure contains the TB level DCI signalling
12305   * parameters in case of DCI formats 2 and 2A
12306 *
12307 *
12308 *     Ret  : S16
12309 *
12310 *     Notes:
12311 *
12312 *     File  : 
12313 *
12314 **********************************************************/
12315 #ifdef ANSI
12316 S16 cmUnpkTfuDciFormatTbInfo
12317 (
12318 TfuDciFormatTbInfo *param,
12319 Buffer *mBuf
12320 )
12321 #else
12322 S16 cmUnpkTfuDciFormatTbInfo(param, mBuf)
12323 TfuDciFormatTbInfo *param;
12324 Buffer *mBuf;
12325 #endif
12326 {
12327
12328
12329    CMCHKUNPK(oduPackUInt8, &param->ndi, mBuf);
12330    CMCHKUNPK(oduPackUInt8, &param->rv, mBuf);
12331    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
12332    return ROK;
12333 }
12334
12335
12336 \f
12337 /***********************************************************
12338 *
12339 *     Func : cmPkTfuSubbandDlCqiInfo
12340 *
12341 *
12342 *     Desc : This structure is used to convey the subbannd CQI reported.
12343 *
12344 *
12345 *     Ret  : S16
12346 *
12347 *     Notes:
12348 *
12349 *     File  : 
12350 *
12351 **********************************************************/
12352 #ifdef ANSI
12353 S16 cmPkTfuSubbandDlCqiInfo
12354 (
12355 TfuSubbandDlCqiInfo *param,
12356 Buffer *mBuf
12357 )
12358 #else
12359 S16 cmPkTfuSubbandDlCqiInfo(param, mBuf)
12360 TfuSubbandDlCqiInfo *param;
12361 Buffer *mBuf;
12362 #endif
12363 {
12364
12365    S32 i;
12366
12367    for (i=TFU_MAX_TB-1; i >= 0; i--) {
12368       CMCHKPK(oduUnpackUInt8, param->cqiIdx[i], mBuf);
12369    }
12370    CMCHKPK(cmPkTfuSubbandInfo, &param->subband, mBuf);
12371    return ROK;
12372 }
12373
12374
12375 \f
12376 /***********************************************************
12377 *
12378 *     Func : cmUnpkTfuSubbandDlCqiInfo
12379 *
12380 *
12381 *     Desc : This structure is used to convey the subbannd CQI reported.
12382 *
12383 *
12384 *     Ret  : S16
12385 *
12386 *     Notes:
12387 *
12388 *     File  : 
12389 *
12390 **********************************************************/
12391 #ifdef ANSI
12392 S16 cmUnpkTfuSubbandDlCqiInfo
12393 (
12394 TfuSubbandDlCqiInfo *param,
12395 Buffer *mBuf
12396 )
12397 #else
12398 S16 cmUnpkTfuSubbandDlCqiInfo(param, mBuf)
12399 TfuSubbandDlCqiInfo *param;
12400 Buffer *mBuf;
12401 #endif
12402 {
12403
12404    S32 i;
12405
12406    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subband, mBuf);
12407    for (i=0; i<TFU_MAX_TB; i++) {
12408       CMCHKUNPK(oduPackUInt8, &param->cqiIdx[i], mBuf);
12409    }
12410    return ROK;
12411 }
12412
12413 /***********************************************************
12414 *
12415 *     Func : cmPkTfuDlCqiPuschInfo
12416 *
12417 *
12418 *     Desc : This structure conveys explicitly the PMI information in case
12419  *  of PUSCH feedback usage in scheduling. Applicable for TM 4,5,6.
12420 *
12421 *
12422 *     Ret  : S16
12423 *
12424 *     Notes:
12425 *
12426 *     File  : 
12427 *
12428 **********************************************************/
12429 #ifdef ANSI
12430 S16 cmPkTfuDlCqiPuschInfo
12431 (
12432 TfuDlCqiPuschInfo *param,
12433 Buffer *mBuf
12434 )
12435 #else
12436 S16 cmPkTfuDlCqiPuschInfo(param, mBuf)
12437 TfuDlCqiPuschInfo *param;
12438 Buffer *mBuf;
12439 #endif
12440 {
12441
12442
12443       switch(param->mode) {
12444          case TFU_PUSCH_CQI_MODE_31:
12445             CMCHKPK(cmPkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
12446             break;
12447          case TFU_PUSCH_CQI_MODE_22:
12448             CMCHKPK(cmPkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
12449             break;
12450          case TFU_PUSCH_CQI_MODE_12:
12451             CMCHKPK(cmPkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
12452             break;
12453          default :
12454             return RFAILED;
12455       }
12456    CMCHKPK(oduUnpackUInt32, param->mode, mBuf);
12457    return ROK;
12458 }
12459
12460
12461 \f
12462 /***********************************************************
12463 *
12464 *     Func : cmUnpkTfuDlCqiPuschInfo
12465 *
12466 *
12467 *     Desc : This structure conveys explicitly the PMI information in case
12468  *  of PUSCH feedback usage in scheduling. Applicable for TM 4,5,6.
12469 *
12470 *
12471 *     Ret  : S16
12472 *
12473 *     Notes:
12474 *
12475 *     File  : 
12476 *
12477 **********************************************************/
12478 #ifdef ANSI
12479 S16 cmUnpkTfuDlCqiPuschInfo
12480 (
12481 TfuDlCqiPuschInfo *param,
12482 Buffer *mBuf
12483 )
12484 #else
12485 S16 cmUnpkTfuDlCqiPuschInfo(param, mBuf)
12486 TfuDlCqiPuschInfo *param;
12487 Buffer *mBuf;
12488 #endif
12489 {
12490
12491
12492    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->mode, mBuf);
12493       switch(param->mode) {
12494          case TFU_PUSCH_CQI_MODE_12:
12495             CMCHKUNPK(cmUnpkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
12496             break;
12497          case TFU_PUSCH_CQI_MODE_22:
12498             CMCHKUNPK(cmUnpkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
12499             break;
12500          case TFU_PUSCH_CQI_MODE_31:
12501             CMCHKUNPK(cmUnpkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
12502             break;
12503          default :
12504             return RFAILED;
12505       }
12506    return ROK;
12507 }
12508 \f
12509 /***********************************************************
12510 *
12511 *     Func : cmPkTfuDoaRpt
12512 *
12513 *
12514 *     Desc : This structure contains the DOA estimated by the physical layer. 
12515   * @details DOA for a given UE.
12516 *
12517 *
12518 *     Ret  : S16
12519 *
12520 *     Notes:
12521 *
12522 *     File  : 
12523 *
12524 **********************************************************/
12525 #ifdef ANSI
12526 S16 cmPkTfuDoaRpt
12527 (
12528 TfuDoaRpt *param,
12529 Buffer *mBuf
12530 )
12531 #else
12532 S16 cmPkTfuDoaRpt(param, mBuf)
12533 TfuDoaRpt *param;
12534 Buffer *mBuf;
12535 #endif
12536 {
12537
12538
12539    CMCHKPK(oduUnpackUInt32, param->doa, mBuf);
12540    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
12541    return ROK;
12542 }
12543
12544
12545 \f
12546 /***********************************************************
12547 *
12548 *     Func : cmUnpkTfuDoaRpt
12549 *
12550 *
12551 *     Desc : This structure contains the DOA estimated by the physical layer. 
12552   * @details DOA for a given UE.
12553 *
12554 *
12555 *     Ret  : S16
12556 *
12557 *     Notes:
12558 *
12559 *     File  : 
12560 *
12561 **********************************************************/
12562 #ifdef ANSI
12563 S16 cmUnpkTfuDoaRpt
12564 (
12565 TfuDoaRpt *param,
12566 Buffer *mBuf
12567 )
12568 #else
12569 S16 cmUnpkTfuDoaRpt(param, mBuf)
12570 TfuDoaRpt *param;
12571 Buffer *mBuf;
12572 #endif
12573 {
12574
12575
12576    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
12577    CMCHKUNPK(oduPackUInt32, &param->doa, mBuf);
12578    return ROK;
12579 }
12580
12581
12582 \f
12583 /***********************************************************
12584 *
12585 *     Func : cmPkTfuDoaIndInfo
12586 *
12587 *
12588 *     Desc : This structure conveys the DOA(Direction Of Arrival) indicator.
12589  * @details DOA is calculated by the physical layer, and this
12590  * information is provided to the scheduler. 
12591  * This data structure clubs together the DOAs for all the UEs
12592  * calculated by PHY in this subframe.
12593 *
12594 *
12595 *     Ret  : S16
12596 *
12597 *     Notes:
12598 *
12599 *     File  : 
12600 *
12601 **********************************************************/
12602 #ifdef ANSI
12603 S16 cmPkTfuDoaIndInfo
12604 (
12605 TfuDoaIndInfo *param,
12606 Buffer *mBuf
12607 )
12608 #else
12609 S16 cmPkTfuDoaIndInfo(param, mBuf)
12610 TfuDoaIndInfo *param;
12611 Buffer *mBuf;
12612 #endif
12613 {
12614
12615    CmLList *node;
12616    uint32_t count;
12617    TfuDoaRpt *tfuDoaRpt;
12618
12619    count = param->doaRpt.count;
12620    node = param->doaRpt.last;
12621    while (node) {
12622       tfuDoaRpt = (TfuDoaRpt *)node->node;
12623       node=node->prev;
12624       CMCHKPK(cmPkTfuDoaRpt, tfuDoaRpt, mBuf);
12625       cmLListDelFrm(&param->doaRpt, &tfuDoaRpt->lnk);
12626       tfuDoaRpt->lnk.node = (PTR)NULLP;
12627    }
12628    CMCHKPK(oduUnpackUInt32, count, mBuf);
12629    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
12630    return ROK;
12631 }
12632
12633
12634 \f
12635 /***********************************************************
12636 *
12637 *     Func : cmUnpkTfuDoaIndInfo
12638 *
12639 *
12640 *     Desc : This structure conveys the DOA(Direction Of Arrival) indicator.
12641  * @details DOA is calculated by the physical layer, and this
12642  * information is provided to the scheduler. 
12643  * This data structure clubs together the DOAs for all the UEs
12644  * calculated by PHY in this subframe.
12645 *
12646 *
12647 *     Ret  : S16
12648 *
12649 *     Notes:
12650 *
12651 *     File  : 
12652 *
12653 **********************************************************/
12654 #ifdef ANSI
12655 S16 cmUnpkTfuDoaIndInfo
12656 (
12657 TfuDoaIndInfo *param,
12658 Ptr memCp,
12659 Buffer *mBuf
12660 )
12661 #else
12662 S16 cmUnpkTfuDoaIndInfo(param, memCp, mBuf)
12663 TfuDoaIndInfo *param;
12664 Ptr memCp;
12665 Buffer *mBuf;
12666 #endif
12667 {
12668
12669    uint32_t count, loopCnt;
12670    TfuDoaRpt *tfuDoaRpt;
12671
12672    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
12673    cmLListInit(&param->doaRpt);
12674    CMCHKUNPK(oduPackUInt32, &count, mBuf);
12675    for (loopCnt=0; loopCnt<count; loopCnt++) {
12676       cmGetMem((Ptr)memCp, sizeof(*tfuDoaRpt), (Ptr *)&tfuDoaRpt);
12677       CMCHKUNPK(cmUnpkTfuDoaRpt, tfuDoaRpt, mBuf);
12678       cmLListAdd2Tail(&param->doaRpt, &tfuDoaRpt->lnk);
12679       tfuDoaRpt->lnk.node = (PTR)tfuDoaRpt;
12680    }
12681    return ROK;
12682 }
12683
12684
12685 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
12686 #ifdef TFU_UPGRADE
12687
12688 \f
12689 /***********************************************************
12690 *
12691 *     Func : cmPkTfuSrsRpt
12692 *
12693 *
12694 *     Desc : This structure conveys the Uplink SRS indication of a UE.
12695  * @details Uplink SRS from each UE is received by the physical layer, and this
12696  * information is provided to the scheduler.
12697 *
12698 *
12699 *     Ret  : S16
12700 *
12701 *     Notes:
12702 *
12703 *     File  : 
12704 *
12705 **********************************************************/
12706 #ifdef ANSI
12707 S16 cmPkTfuSrsRpt
12708 (
12709 TfuSrsRpt *param,
12710 Buffer *mBuf
12711 )
12712 #else
12713 S16 cmPkTfuSrsRpt(param, mBuf)
12714 TfuSrsRpt *param;
12715 Buffer *mBuf;
12716 #endif
12717 {
12718
12719    S32 i;
12720
12721    CMCHKPK(oduUnpackUInt8, param->wideCqi, mBuf);
12722    CMCHKPK(oduUnpackUInt8, param->wideCqiPres, mBuf);
12723    for (i=TFU_MAX_UL_RB-1; i >= 0; i--) {
12724       CMCHKPK(oduUnpackUInt8, param->snr[i], mBuf);
12725    }
12726    CMCHKPK(oduUnpackUInt8, param->rbStart, mBuf);
12727    CMCHKPK(oduUnpackUInt8, param->numRbs, mBuf);
12728    CMCHKPK(oduUnpackUInt16, param->ta, mBuf);
12729    CMCHKPK(oduUnpackUInt16, param->dopEst, mBuf);
12730    CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
12731    return ROK;
12732 }
12733
12734
12735 \f
12736 /***********************************************************
12737 *
12738 *     Func : cmUnpkTfuSrsRpt
12739 *
12740 *
12741 *     Desc : This structure conveys the Uplink SRS indication of a UE.
12742  * @details Uplink SRS from each UE is received by the physical layer, and this
12743  * information is provided to the scheduler.
12744 *
12745 *
12746 *     Ret  : S16
12747 *
12748 *     Notes:
12749 *
12750 *     File  : 
12751 *
12752 **********************************************************/
12753 #ifdef ANSI
12754 S16 cmUnpkTfuSrsRpt
12755 (
12756 TfuSrsRpt *param,
12757 Buffer *mBuf
12758 )
12759 #else
12760 S16 cmUnpkTfuSrsRpt(param, mBuf)
12761 TfuSrsRpt *param;
12762 Buffer *mBuf;
12763 #endif
12764 {
12765
12766    S32 i;
12767
12768    CMCHKUNPK(cmUnpkLteRnti, &param->ueId, mBuf);
12769    CMCHKUNPK(oduPackUInt16, &param->dopEst, mBuf);
12770    CMCHKUNPK(oduPackUInt16, &param->ta, mBuf);
12771    CMCHKUNPK(oduPackUInt8, &param->numRbs, mBuf);
12772    CMCHKUNPK(oduPackUInt8, &param->rbStart, mBuf);
12773    for (i=0; i<TFU_MAX_UL_RB; i++) {
12774       CMCHKUNPK(oduPackUInt8, &param->snr[i], mBuf);
12775    }
12776    CMCHKUNPK(oduPackUInt8, &param->wideCqiPres, mBuf);
12777    CMCHKUNPK(oduPackUInt8, &param->wideCqi, mBuf);
12778    return ROK;
12779 }
12780
12781
12782 \f
12783 /***********************************************************
12784 *
12785 *     Func : cmPkTfuSrsIndInfo
12786 *
12787 *
12788 *     Desc : This structure conveys the Uplink SRS indication.
12789  * @details Uplink SRS is received by the physical layer, and this
12790  * information is provided to the scheduler. 
12791  * This data structure clubs together the UL SRS indications of all the UEs 
12792  * in the subframe.
12793 *
12794 *
12795 *     Ret  : S16
12796 *
12797 *     Notes:
12798 *
12799 *     File  : 
12800 *
12801 **********************************************************/
12802 #ifdef ANSI
12803 S16 cmPkTfuSrsIndInfo
12804 (
12805 TfuSrsIndInfo *param,
12806 Buffer *mBuf
12807 )
12808 #else
12809 S16 cmPkTfuSrsIndInfo(param, mBuf)
12810 TfuSrsIndInfo *param;
12811 Buffer *mBuf;
12812 #endif
12813 {
12814
12815    CmLList *node;
12816    uint32_t count;
12817    TfuSrsRpt *tfuSrsRpt;
12818
12819
12820    count = param->srsRpt.count;
12821    node = param->srsRpt.last;
12822    while (node) {
12823       tfuSrsRpt = (TfuSrsRpt *)node->node;
12824       node=node->prev;
12825       CMCHKPK(cmPkTfuSrsRpt, tfuSrsRpt, mBuf);
12826       cmLListDelFrm(&param->srsRpt, &tfuSrsRpt->lnk);
12827       tfuSrsRpt->lnk.node = (PTR)NULLP;
12828    }
12829    CMCHKPK(oduUnpackUInt32, count, mBuf);
12830    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
12831    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
12832    return ROK;
12833 }
12834
12835
12836 \f
12837 /***********************************************************
12838 *
12839 *     Func : cmUnpkTfuSrsIndInfo
12840 *
12841 *
12842 *     Desc : This structure conveys the Uplink SRS indication.
12843  * @details Uplink SRS is received by the physical layer, and this
12844  * information is provided to the scheduler. 
12845  * This data structure clubs together the UL SRS indications of all the UEs 
12846  * in the subframe.
12847 *
12848 *
12849 *     Ret  : S16
12850 *
12851 *     Notes:
12852 *
12853 *     File  : 
12854 *
12855 **********************************************************/
12856 #ifdef ANSI
12857 S16 cmUnpkTfuSrsIndInfo
12858 (
12859 TfuSrsIndInfo *param,
12860 Ptr memCp,
12861 Buffer *mBuf
12862 )
12863 #else
12864 S16 cmUnpkTfuSrsIndInfo(param, memCp, mBuf)
12865 TfuSrsIndInfo *param;
12866 Ptr memCp;
12867 Buffer *mBuf;
12868 #endif
12869 {
12870
12871    uint32_t count, loopCnt;
12872    TfuSrsRpt *tfuSrsRpt;
12873
12874
12875    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
12876    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
12877    cmLListInit(&param->srsRpt);
12878    CMCHKUNPK(oduPackUInt32, &count, mBuf);
12879    for (loopCnt=0; loopCnt<count; loopCnt++) {
12880       cmGetMem((Ptr)memCp, sizeof(*tfuSrsRpt), (Ptr *)&tfuSrsRpt);
12881       CMCHKUNPK(cmUnpkTfuSrsRpt, tfuSrsRpt, mBuf);
12882       cmLListAdd2Tail(&param->srsRpt, &tfuSrsRpt->lnk);
12883       tfuSrsRpt->lnk.node = (PTR)tfuSrsRpt;
12884    }
12885    return ROK;
12886 }
12887
12888
12889 \f
12890 /***********************************************************
12891 *
12892 *     Func : cmPkTfuRawCqiRpt
12893 *
12894 *
12895 *     Desc : This structure contains the Raw CQI information i.e. the CQI report
12896  * as transmitted by the UE. 
12897  * @details These bits shall be interpretted by MAC to derive the following 
12898  * -# Wideband CQI
12899  * -# Subband CQI
12900  * -# PMI
12901  * -# RI
12902 *
12903 *
12904 *     Ret  : S16
12905 *
12906 *     Notes:
12907 *
12908 *     File  : 
12909 *
12910 **********************************************************/
12911 #ifdef ANSI
12912 S16 cmPkTfuRawCqiRpt
12913 (
12914 TfuRawCqiRpt *param,
12915 Buffer *mBuf
12916 )
12917 #else
12918 S16 cmPkTfuRawCqiRpt(param, mBuf)
12919 TfuRawCqiRpt *param;
12920 Buffer *mBuf;
12921 #endif
12922 {
12923
12924 #ifdef TFU_5GTF
12925    CMCHKPK(oduUnpackUInt32, param->uciPayload, mBuf);
12926 #else
12927    S32 i;
12928    for (i=CM_LTE_MAX_CELLS-1; i >= 0; i--) {
12929       CMCHKPK(oduUnpackUInt8, param->ri[i], mBuf);
12930    }
12931    for (i=TFU_MAX_CQI_BYTES-1; i >= 0; i--) {
12932       CMCHKPK(oduUnpackUInt8, param->cqiBits[i], mBuf);
12933    }
12934 #endif
12935    CMCHKPK(oduUnpackUInt8, param->numBits, mBuf);
12936    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
12937    return ROK;
12938 }
12939
12940
12941 \f
12942 /***********************************************************
12943 *
12944 *     Func : cmUnpkTfuRawCqiRpt
12945 *
12946 *
12947 *     Desc : This structure contains the Raw CQI information i.e. the CQI report
12948  * as transmitted by the UE. 
12949  * @details These bits shall be interpretted by MAC to derive the following 
12950  * -# Wideband CQI
12951  * -# Subband CQI
12952  * -# PMI
12953  * -# RI
12954 *
12955 *
12956 *     Ret  : S16
12957 *
12958 *     Notes:
12959 *
12960 *     File  : 
12961 *
12962 **********************************************************/
12963 #ifdef ANSI
12964 S16 cmUnpkTfuRawCqiRpt
12965 (
12966 TfuRawCqiRpt *param,
12967 Buffer *mBuf
12968 )
12969 #else
12970 S16 cmUnpkTfuRawCqiRpt(param, mBuf)
12971 TfuRawCqiRpt *param;
12972 Buffer *mBuf;
12973 #endif
12974 {
12975
12976
12977    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
12978    CMCHKUNPK(oduPackUInt8, &param->numBits, mBuf);
12979 #ifndef TFU_5GTF
12980    S32 i;
12981    for (i=0; i<TFU_MAX_CQI_BYTES; i++) {
12982       CMCHKUNPK(oduPackUInt8, &param->cqiBits[i], mBuf);
12983    }
12984    for (i=0; i<CM_LTE_MAX_CELLS; i++) {
12985       CMCHKUNPK(oduPackUInt8, &param->ri[i], mBuf);
12986    }
12987 #else
12988       CMCHKUNPK(oduPackUInt32, &param->uciPayload, mBuf);
12989 #endif
12990    return ROK;
12991 }
12992
12993
12994 \f
12995 /***********************************************************
12996 *
12997 *     Func : cmPkTfuRawCqiIndInfo
12998 *
12999 *
13000 *     Desc : This structure contains the Raw CQI reports received for the
13001  * transmitting UEs in a single subframe. 
13002  * @details Raw CQI corresponds to the actual bits transmitted by the UE, whose
13003  * interpretation is upto the MAC layer.
13004 *
13005 *
13006 *     Ret  : S16
13007 *
13008 *     Notes:
13009 *
13010 *     File  : 
13011 *
13012 **********************************************************/
13013 #ifdef ANSI
13014 S16 cmPkTfuRawCqiIndInfo
13015 (
13016 TfuRawCqiIndInfo *param,
13017 Buffer *mBuf
13018 )
13019 #else
13020 S16 cmPkTfuRawCqiIndInfo(param, mBuf)
13021 TfuRawCqiIndInfo *param;
13022 Buffer *mBuf;
13023 #endif
13024 {
13025
13026    uint32_t count;
13027    TfuRawCqiRpt *tfuRawCqiRpt;
13028    CmLList *node;
13029
13030
13031    count = param->rawCqiRpt.count;
13032    node = param->rawCqiRpt.last;
13033    while (node) {
13034       tfuRawCqiRpt = (TfuRawCqiRpt *)node->node;
13035       node=node->prev;
13036       CMCHKPK(cmPkTfuRawCqiRpt, tfuRawCqiRpt, mBuf);
13037       cmLListDelFrm(&param->rawCqiRpt, &tfuRawCqiRpt->lnk);
13038       tfuRawCqiRpt->lnk.node = (PTR)NULLP;
13039    }
13040    CMCHKPK(oduUnpackUInt32, count, mBuf);
13041    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
13042    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
13043    return ROK;
13044 }
13045
13046
13047 \f
13048 /***********************************************************
13049 *
13050 *     Func : cmUnpkTfuRawCqiIndInfo
13051 *
13052 *
13053 *     Desc : This structure contains the Raw CQI reports received for the
13054  * transmitting UEs in a single subframe. 
13055  * @details Raw CQI corresponds to the actual bits transmitted by the UE, whose
13056  * interpretation is upto the MAC layer.
13057 *
13058 *
13059 *     Ret  : S16
13060 *
13061 *     Notes:
13062 *
13063 *     File  : 
13064 *
13065 **********************************************************/
13066 #ifdef ANSI
13067 S16 cmUnpkTfuRawCqiIndInfo
13068 (
13069 TfuRawCqiIndInfo *param,
13070 Ptr memCp,
13071 Buffer *mBuf
13072 )
13073 #else
13074 S16 cmUnpkTfuRawCqiIndInfo(param, memCp, mBuf)
13075 TfuRawCqiIndInfo *param;
13076 Ptr memCp;
13077 Buffer *mBuf;
13078 #endif
13079 {
13080
13081    uint32_t count, loopCnt;
13082    TfuRawCqiRpt *tfuRawCqiRpt;
13083
13084
13085    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
13086    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
13087    cmLListInit(&param->rawCqiRpt);
13088    CMCHKUNPK(oduPackUInt32, &count, mBuf);
13089    for (loopCnt=0; loopCnt<count; loopCnt++) {
13090       cmGetMem((Ptr)memCp, sizeof(*tfuRawCqiRpt), (Ptr *)&tfuRawCqiRpt);
13091       CMCHKUNPK(cmUnpkTfuRawCqiRpt, tfuRawCqiRpt, mBuf);
13092       cmLListAdd2Tail(&param->rawCqiRpt, &tfuRawCqiRpt->lnk);
13093       tfuRawCqiRpt->lnk.node = (PTR)tfuRawCqiRpt;
13094    }
13095    return ROK;
13096 }
13097
13098
13099 #ifdef TFU_TDD
13100
13101 #ifdef TFU_TDD
13102
13103 \f
13104 /***********************************************************
13105 *
13106 *     Func : cmPkTfuUePucchHqRecpInfo
13107 *
13108 *
13109 *     Desc : This structure is sent from scheduler to PHY in order to request the
13110  * reception of harq information on PUCCH.
13111 *
13112 *
13113 *     Ret  : S16
13114 *
13115 *     Notes:
13116 *
13117 *     File  : 
13118 *
13119 **********************************************************/
13120 #ifdef ANSI
13121 S16 cmPkTfuUePucchHqRecpInfo
13122 (
13123 TfuUePucchHqRecpInfo *param,
13124 Buffer *mBuf
13125 )
13126 #else
13127 S16 cmPkTfuUePucchHqRecpInfo(param, mBuf)
13128 TfuUePucchHqRecpInfo *param;
13129 Buffer *mBuf;
13130 #endif
13131 {
13132
13133    S32 i;
13134
13135    CMCHKPK(oduUnpackUInt8, param->a, mBuf);
13136    for (i=TFU_MAX_HQ_RES-1; i >= 0; i--) {
13137       CMCHKPK(oduUnpackUInt16, param->hqRes[i], mBuf);
13138    }
13139    CMCHKPK(oduUnpackUInt8, param->pucchResCnt, mBuf);
13140    CMCHKPK(oduUnpackUInt8, param->hqSz, mBuf);
13141    CMCHKPK(oduUnpackUInt32, param->hqFdbkMode, mBuf);
13142    return ROK;
13143 }
13144
13145
13146 \f
13147 /***********************************************************
13148 *
13149 *     Func : cmUnpkTfuUePucchHqRecpInfo
13150 *
13151 *
13152 *     Desc : This structure is sent from scheduler to PHY in order to request the
13153  * reception of harq information on PUCCH.
13154 *
13155 *
13156 *     Ret  : S16
13157 *
13158 *     Notes:
13159 *
13160 *     File  : 
13161 *
13162 **********************************************************/
13163 #ifdef ANSI
13164 S16 cmUnpkTfuUePucchHqRecpInfo
13165 (
13166 TfuUePucchHqRecpInfo *param,
13167 Buffer *mBuf
13168 )
13169 #else
13170 S16 cmUnpkTfuUePucchHqRecpInfo(param, mBuf)
13171 TfuUePucchHqRecpInfo *param;
13172 Buffer *mBuf;
13173 #endif
13174 {
13175
13176    S32 i;
13177
13178    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->hqFdbkMode, mBuf);
13179    CMCHKUNPK(oduPackUInt8, &param->hqSz, mBuf);
13180    CMCHKUNPK(oduPackUInt8, &param->pucchResCnt, mBuf);
13181    for (i=0; i<TFU_MAX_HQ_RES; i++) {
13182       CMCHKUNPK(oduPackUInt16, &param->hqRes[i], mBuf);
13183    }
13184    CMCHKUNPK(oduPackUInt8, &param->a, mBuf);
13185    return ROK;
13186 }
13187
13188
13189 #endif
13190
13191 #endif
13192
13193 #ifndef TFU_TDD  /* else of TFU_TDD */
13194
13195 #ifndef TFU_TDD  /* else of TFU_TDD */
13196
13197 \f
13198 /***********************************************************
13199 *
13200 *     Func : cmPkTfuUePucchHqRecpInfo
13201 *
13202 *
13203 *     Desc : This structure is sent from scheduler to PHY in order to request the
13204  * reception of harq information on PUCCH.
13205 *
13206 *
13207 *     Ret  : S16
13208 *
13209 *     Notes:
13210 *
13211 *     File  : 
13212 *
13213 **********************************************************/
13214 #ifdef ANSI
13215 S16 cmPkTfuUePucchHqRecpInfo
13216 (
13217 TfuUePucchHqRecpInfo *param,
13218 Buffer *mBuf
13219 )
13220 #else
13221 S16 cmPkTfuUePucchHqRecpInfo(param, mBuf)
13222 TfuUePucchHqRecpInfo *param;
13223 Buffer *mBuf;
13224 #endif
13225 {
13226
13227 #ifdef LTE_ADV
13228    S32 idx;
13229    for (idx=(TFU_MAX_HQ_RES-1); idx >= 0; idx--) {
13230       CMCHKPK(oduUnpackUInt16, param->hqRes[idx], mBuf);
13231    }
13232 #else
13233    CMCHKPK(oduUnpackUInt16, param->hqRes[0], mBuf);
13234 #endif
13235    CMCHKPK(oduUnpackUInt8, param->pucchResCnt, mBuf);
13236    CMCHKPK(oduUnpackUInt8, param->hqSz, mBuf);
13237    CMCHKPK(oduUnpackUInt32, param->hqFdbkMode, mBuf);
13238
13239    return ROK;
13240 }
13241
13242
13243 \f
13244 /***********************************************************
13245 *
13246 *     Func : cmUnpkTfuUePucchHqRecpInfo
13247 *
13248 *
13249 *     Desc : This structure is sent from scheduler to PHY in order to request the
13250  * reception of harq information on PUCCH.
13251 *
13252 *
13253 *     Ret  : S16
13254 *
13255 *     Notes:
13256 *
13257 *     File  : 
13258 *
13259 **********************************************************/
13260 #ifdef ANSI
13261 S16 cmUnpkTfuUePucchHqRecpInfo
13262 (
13263 TfuUePucchHqRecpInfo *param,
13264 Buffer *mBuf
13265 )
13266 #else
13267 S16 cmUnpkTfuUePucchHqRecpInfo(param, mBuf)
13268 TfuUePucchHqRecpInfo *param;
13269 Buffer *mBuf;
13270 #endif
13271 {
13272
13273    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->hqFdbkMode, mBuf);
13274    CMCHKUNPK(oduPackUInt8, &param->hqSz, mBuf);
13275    CMCHKUNPK(oduPackUInt8, &param->pucchResCnt, mBuf);
13276 #ifdef LTE_ADV
13277    S32 idx;
13278    for (idx=0; idx<TFU_MAX_HQ_RES; idx++) {
13279       CMCHKUNPK(oduPackUInt16, &param->hqRes[idx], mBuf);
13280    }
13281 #else
13282    CMCHKUNPK(oduPackUInt16, &param->hqRes[0], mBuf);
13283 #endif
13284
13285    return ROK;
13286 }
13287
13288
13289 #endif
13290
13291 #endif
13292
13293 \f
13294 /***********************************************************
13295 *
13296 *     Func : cmPkTfuUePucchSrRecpInfo
13297 *
13298 *
13299 *     Desc : This structure is sent from scheduler to PHY in order to request the
13300  * reception of SR information on PUCCH.
13301 *
13302 *
13303 *     Ret  : S16
13304 *
13305 *     Notes:
13306 *
13307 *     File  : 
13308 *
13309 **********************************************************/
13310 #ifdef ANSI
13311 S16 cmPkTfuUePucchSrRecpInfo
13312 (
13313 TfuUePucchSrRecpInfo *param,
13314 Buffer *mBuf
13315 )
13316 #else
13317 S16 cmPkTfuUePucchSrRecpInfo(param, mBuf)
13318 TfuUePucchSrRecpInfo *param;
13319 Buffer *mBuf;
13320 #endif
13321 {
13322
13323
13324    CMCHKPK(oduUnpackUInt16, param->n1PucchIdx, mBuf);
13325    return ROK;
13326 }
13327
13328
13329 \f
13330 /***********************************************************
13331 *
13332 *     Func : cmUnpkTfuUePucchSrRecpInfo
13333 *
13334 *
13335 *     Desc : This structure is sent from scheduler to PHY in order to request the
13336  * reception of SR information on PUCCH.
13337 *
13338 *
13339 *     Ret  : S16
13340 *
13341 *     Notes:
13342 *
13343 *     File  : 
13344 *
13345 **********************************************************/
13346 #ifdef ANSI
13347 S16 cmUnpkTfuUePucchSrRecpInfo
13348 (
13349 TfuUePucchSrRecpInfo *param,
13350 Buffer *mBuf
13351 )
13352 #else
13353 S16 cmUnpkTfuUePucchSrRecpInfo(param, mBuf)
13354 TfuUePucchSrRecpInfo *param;
13355 Buffer *mBuf;
13356 #endif
13357 {
13358
13359
13360    CMCHKUNPK(oduPackUInt16, &param->n1PucchIdx, mBuf);
13361    return ROK;
13362 }
13363
13364
13365 \f
13366 /***********************************************************
13367 *
13368 *     Func : cmPkTfuUePucchCqiRecpInfo
13369 *
13370 *
13371 *     Desc : This structure is sent from scheduler to PHY in order to request the
13372  * reception of CQI information on PUCCH.
13373 *
13374 *
13375 *     Ret  : S16
13376 *
13377 *     Notes:
13378 *
13379 *     File  : 
13380 *
13381 **********************************************************/
13382 #ifdef ANSI
13383 S16 cmPkTfuUePucchCqiRecpInfo
13384 (
13385 TfuUePucchCqiRecpInfo *param,
13386 Buffer *mBuf
13387 )
13388 #else
13389 S16 cmPkTfuUePucchCqiRecpInfo(param, mBuf)
13390 TfuUePucchCqiRecpInfo *param;
13391 Buffer *mBuf;
13392 #endif
13393 {
13394
13395
13396    CMCHKPK(oduUnpackUInt8, param->cqiPmiSz, mBuf);
13397    CMCHKPK(oduUnpackUInt16, param->n2PucchIdx, mBuf);
13398    return ROK;
13399 }
13400
13401
13402 \f
13403 /***********************************************************
13404 *
13405 *     Func : cmUnpkTfuUePucchCqiRecpInfo
13406 *
13407 *
13408 *     Desc : This structure is sent from scheduler to PHY in order to request the
13409  * reception of CQI information on PUCCH.
13410 *
13411 *
13412 *     Ret  : S16
13413 *
13414 *     Notes:
13415 *
13416 *     File  : 
13417 *
13418 **********************************************************/
13419 #ifdef ANSI
13420 S16 cmUnpkTfuUePucchCqiRecpInfo
13421 (
13422 TfuUePucchCqiRecpInfo *param,
13423 Buffer *mBuf
13424 )
13425 #else
13426 S16 cmUnpkTfuUePucchCqiRecpInfo(param, mBuf)
13427 TfuUePucchCqiRecpInfo *param;
13428 Buffer *mBuf;
13429 #endif
13430 {
13431
13432
13433    CMCHKUNPK(oduPackUInt16, &param->n2PucchIdx, mBuf);
13434    CMCHKUNPK(oduPackUInt8, &param->cqiPmiSz, mBuf);
13435    return ROK;
13436 }
13437
13438
13439 \f
13440 /***********************************************************
13441 *
13442 *     Func : cmPkTfuUePucchSrsRecpInfo
13443 *
13444 *
13445 *     Desc : This structure is sent from scheduler to PHY in order to request the
13446  * reception of SRS information on PUCCH.
13447 *
13448 *
13449 *     Ret  : S16
13450 *
13451 *     Notes:
13452 *
13453 *     File  : 
13454 *
13455 **********************************************************/
13456 #ifdef ANSI
13457 S16 cmPkTfuUePucchSrsRecpInfo
13458 (
13459 TfuUePucchSrsRecpInfo *param,
13460 Buffer *mBuf
13461 )
13462 #else
13463 S16 cmPkTfuUePucchSrsRecpInfo(param, mBuf)
13464 TfuUePucchSrsRecpInfo *param;
13465 Buffer *mBuf;
13466 #endif
13467 {
13468
13469
13470    CMCHKPK(oduUnpackUInt32, param->srsCyclicShft, mBuf);
13471    CMCHKPK(oduUnpackUInt16, param->srsCfgIdx, mBuf);
13472    CMCHKPK(oduUnpackUInt8, param->transComb, mBuf);
13473    CMCHKPK(oduUnpackUInt32, param->srsHopBw, mBuf);
13474    CMCHKPK(oduUnpackUInt8, param->nRrc, mBuf);
13475    CMCHKPK(oduUnpackUInt32, param->srsBw, mBuf);
13476    return ROK;
13477 }
13478
13479 #ifdef TFU_5GTF
13480 #ifdef ANSI
13481 S16 cmPkTfuUePucchUciRecpInfo
13482 (
13483 TfuUePucchUciRecpInfo *param,
13484 Buffer *mBuf
13485 )
13486 #else
13487 S16 cmPkTfuUePucchUciRecpInfo(param, mBuf)
13488 TfuUePucchUciRecpInfo *param;
13489 Buffer *mBuf;
13490 #endif
13491 {
13492
13493
13494    CMCHKPK(oduUnpackUInt8, param->SCID, mBuf);
13495    CMCHKPK(oduUnpackUInt8, param->pucchIndex, mBuf);
13496    CMCHKPK(oduUnpackUInt8, param->numBits, mBuf);
13497    return ROK;
13498 }
13499 #endif
13500
13501 \f
13502 /***********************************************************
13503 *
13504 *     Func : cmUnpkTfuUePucchSrsRecpInfo
13505 *
13506 *
13507 *     Desc : This structure is sent from scheduler to PHY in order to request the
13508  * reception of SRS information on PUCCH.
13509 *
13510 *
13511 *     Ret  : S16
13512 *
13513 *     Notes:
13514 *
13515 *     File  : 
13516 *
13517 **********************************************************/
13518 #ifdef ANSI
13519 S16 cmUnpkTfuUePucchSrsRecpInfo
13520 (
13521 TfuUePucchSrsRecpInfo *param,
13522 Buffer *mBuf
13523 )
13524 #else
13525 S16 cmUnpkTfuUePucchSrsRecpInfo(param, mBuf)
13526 TfuUePucchSrsRecpInfo *param;
13527 Buffer *mBuf;
13528 #endif
13529 {
13530
13531
13532    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->srsBw, mBuf);
13533    CMCHKUNPK(oduPackUInt8, &param->nRrc, mBuf);
13534    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->srsHopBw, mBuf);
13535    CMCHKUNPK(oduPackUInt8, &param->transComb, mBuf);
13536    CMCHKUNPK(oduPackUInt16, &param->srsCfgIdx, mBuf);
13537    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->srsCyclicShft, mBuf);
13538    return ROK;
13539 }
13540
13541 #ifdef TFU_5GTF 
13542 /***********************************************************
13543 *
13544 *     Func : cmPkTfuUePucchBsiBriRecpInfo
13545 *
13546 *
13547 *     Desc : This structure is sent from scheduler to PHY in order to request the
13548  * reception of BSI_BRI information on PUCCH.
13549 *
13550 *
13551 *     Ret  : S16
13552 *
13553 *     Notes:
13554 *
13555 *     File  : 
13556 *
13557 **********************************************************/
13558 #ifdef ANSI
13559 S16 cmPkTfuUePucchBsiBriRecpInfo
13560 (
13561 TfuUePucchBsiBriRecpInfo *param,
13562 Buffer *mBuf
13563 )
13564 #else
13565 S16 cmPkTfuUePucchBsiBriRecpInfo(param, mBuf)
13566 TfuUePucchBsiBriRecpInfo *param;
13567 Buffer *mBuf;
13568 #endif
13569 {
13570
13571
13572    CMCHKPK(oduUnpackUInt8, param->briRpt, mBuf);
13573    CMCHKPK(oduUnpackUInt8, param->bsiRpt, mBuf);
13574    CMCHKPK(oduUnpackUInt8, param->SCID, mBuf);
13575    CMCHKPK(oduUnpackUInt8, param->pucchIndex, mBuf);
13576    CMCHKPK(oduUnpackUInt8, param->puschFlag, mBuf);
13577    return ROK;
13578 }
13579
13580 /***********************************************************
13581 *
13582 *     Func : cmUnpkTfuUePucchBsiBriRecpInfo
13583 *
13584 *
13585 *     Desc : This structure is sent from scheduler to PHY in order to request the
13586  * reception of BSI_BRI information on PUCCH.
13587 *
13588 *
13589 *     Ret  : S16
13590 *
13591 *     Notes:
13592 *
13593 *     File  : 
13594 *
13595 **********************************************************/
13596 #ifdef ANSI
13597 S16 cmUnpkTfuUePucchBsiBriRecpInfo
13598 (
13599 TfuUePucchBsiBriRecpInfo *param,
13600 Buffer *mBuf
13601 )
13602 #else
13603 S16 cmUnpkTfuUePucchBsiBriRecpInfo(param, mBuf)
13604 TfuUePucchBsiBriRecpInfo *param;
13605 Buffer *mBuf;
13606 #endif
13607 {
13608
13609
13610    CMCHKUNPK(oduPackUInt8, &param->puschFlag, mBuf);
13611    CMCHKUNPK(oduPackUInt8, &param->pucchIndex, mBuf);
13612    CMCHKUNPK(oduPackUInt8, &param->SCID, mBuf);
13613    CMCHKUNPK(oduPackUInt8, &param->bsiRpt, mBuf);
13614    CMCHKUNPK(oduPackUInt8, &param->briRpt, mBuf);
13615    return ROK;
13616 }
13617 #endif
13618
13619 #ifdef TFU_5GTF
13620 #ifdef ANSI
13621 S16 cmUnpkTfuUePucchUciRecpInfo
13622 (
13623 TfuUePucchUciRecpInfo *param,
13624 Buffer *mBuf
13625 )
13626 #else
13627 S16 cmUnpkTfuUePucchUciRecpInfo(param, mBuf)
13628 TfuUePucchUciRecpInfo *param;
13629 Buffer *mBuf;
13630 #endif
13631 {
13632
13633
13634    CMCHKUNPK(oduPackUInt8, &param->numBits, mBuf);
13635    CMCHKUNPK(oduPackUInt8, &param->pucchIndex, mBuf);
13636    CMCHKUNPK(oduPackUInt8, &param->SCID, mBuf);
13637
13638    return ROK;
13639 }
13640 #endif
13641
13642 \f
13643 /***********************************************************
13644 *
13645 *     Func : cmPkTfuUePucchRecpReq
13646 *
13647 *
13648 *     Desc : This structure is sent from scheduler to PHY in order to request the
13649   * reception of UCI on PUCCH. This may contain the following:
13650   * -# HARQ
13651   * -# SR
13652   * -# SRS
13653   * -# CQI
13654   * -# HARQ+SR
13655   * -# HARQ+SRS
13656   * -# HARQ+CQI
13657   * -# HARQ+SR+SRS
13658   * -# HARQ+SR+CQI
13659   * -# SR+SRS
13660   * -# SR+CQI
13661 *
13662 *
13663 *     Ret  : S16
13664 *
13665 *     Notes:
13666 *
13667 *     File  : 
13668 *
13669 **********************************************************/
13670 #ifdef ANSI
13671 S16 cmPkTfuUePucchRecpReq
13672 (
13673 TfuUePucchRecpReq *param,
13674 Buffer *mBuf
13675 )
13676 #else
13677 S16 cmPkTfuUePucchRecpReq(param, mBuf)
13678 TfuUePucchRecpReq *param;
13679 Buffer *mBuf;
13680 #endif
13681 {
13682
13683
13684 #ifdef TFU_5GTF
13685    CMCHKPK(cmPkTfuUePucchBsiBriRecpInfo, &param->bsiBriInfo, mBuf);
13686    CMCHKPK(cmPkTfuUePucchUciRecpInfo, &param->uciPduInfo, mBuf);
13687 #endif /* TFU_5GTF */
13688    CMCHKPK(cmPkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
13689    CMCHKPK(cmPkTfuUePucchHqRecpInfo, &param->hqInfo, mBuf);
13690    CMCHKPK(cmPkTfuUePucchSrRecpInfo, &param->srInfo, mBuf);
13691    CMCHKPK(cmPkTfuUePucchCqiRecpInfo, &param->cqiInfo, mBuf);
13692    CMCHKPK(oduUnpackUInt32, param->uciInfo, mBuf);
13693    return ROK;
13694 }
13695
13696
13697 \f
13698 /***********************************************************
13699 *
13700 *     Func : cmUnpkTfuUePucchRecpReq
13701 *
13702 *
13703 *     Desc : This structure is sent from scheduler to PHY in order to request the
13704   * reception of UCI on PUCCH. This may contain the following:
13705   * -# HARQ
13706   * -# SR
13707   * -# SRS
13708   * -# CQI
13709   * -# HARQ+SR
13710   * -# HARQ+SRS
13711   * -# HARQ+CQI
13712   * -# HARQ+SR+SRS
13713   * -# HARQ+SR+CQI
13714   * -# SR+SRS
13715   * -# SR+CQI
13716 *
13717 *
13718 *     Ret  : S16
13719 *
13720 *     Notes:
13721 *
13722 *     File  : 
13723 *
13724 **********************************************************/
13725 #ifdef ANSI
13726 S16 cmUnpkTfuUePucchRecpReq
13727 (
13728 TfuUePucchRecpReq *param,
13729 Buffer *mBuf
13730 )
13731 #else
13732 S16 cmUnpkTfuUePucchRecpReq(param, mBuf)
13733 TfuUePucchRecpReq *param;
13734 Buffer *mBuf;
13735 #endif
13736 {
13737
13738
13739    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->uciInfo, mBuf);
13740    CMCHKUNPK(cmUnpkTfuUePucchCqiRecpInfo, &param->cqiInfo, mBuf);
13741    CMCHKUNPK(cmUnpkTfuUePucchSrRecpInfo, &param->srInfo, mBuf);
13742    CMCHKUNPK(cmUnpkTfuUePucchHqRecpInfo, &param->hqInfo, mBuf);
13743    CMCHKUNPK(cmUnpkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
13744 #ifdef TFU_5GTF
13745    CMCHKUNPK(cmUnpkTfuUePucchUciRecpInfo, &param->uciPduInfo, mBuf);
13746    CMCHKUNPK(cmUnpkTfuUePucchBsiBriRecpInfo, &param->bsiBriInfo, mBuf);
13747 #endif /* TFU_5GTF */
13748    return ROK;
13749 }
13750
13751
13752 \f
13753 /***********************************************************
13754 *
13755 *     Func : cmPkTfuUeUlSchRecpInfo
13756 *
13757 *
13758 *     Desc : This structure is sent from scheduler to PHY in order to request the
13759   * reception of UEs data on ULSCH.
13760 *
13761 *
13762 *     Ret  : S16
13763 *
13764 *     Notes:
13765 *
13766 *     File  : 
13767 *
13768 **********************************************************/
13769 #ifdef ANSI
13770 S16 cmPkTfuUeUlSchRecpInfo
13771 (
13772 TfuUeUlSchRecpInfo *param,
13773 Buffer *mBuf
13774 )
13775 #else
13776 S16 cmPkTfuUeUlSchRecpInfo(param, mBuf)
13777 TfuUeUlSchRecpInfo *param;
13778 Buffer *mBuf;
13779 #endif
13780 {
13781
13782 #ifdef TFU_5GTF
13783    CMCHKPK(oduUnpackUInt8, param->beamIndex, mBuf);
13784    CMCHKPK(oduUnpackUInt8, param->uciWoTBFlag, mBuf);
13785    CMCHKPK(oduUnpackUInt8, param->PMI, mBuf);
13786    CMCHKPK(oduUnpackUInt8, param->SCID, mBuf);
13787    CMCHKPK(oduUnpackUInt8, param->nAntPortLayer, mBuf);
13788    CMCHKPK(oduUnpackUInt8, param->xPUSCHRange, mBuf);
13789    CMCHKPK(oduUnpackUInt8, param->numRbg, mBuf);
13790    CMCHKPK(oduUnpackUInt8, param->rbgStart, mBuf);
13791 #endif
13792    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
13793    CMCHKPK(oduUnpackUInt8, param->nSrs, mBuf);
13794    CMCHKPK(oduUnpackUInt8, param->crntTxNb, mBuf);
13795    CMCHKPK(oduUnpackUInt8, param->txMode, mBuf);
13796    CMCHKPK(oduUnpackUInt8, param->harqProcId, mBuf);
13797    CMCHKPK(oduUnpackUInt8, param->rv, mBuf);
13798    CMCHKPK(oduUnpackUInt8, param->ndi, mBuf);
13799    CMCHKPK(oduUnpackUInt8, param->isRtx, mBuf);
13800    CMCHKPK(oduUnpackUInt8, param->hoppingBits, mBuf);
13801    CMCHKPK(oduUnpackUInt8, param->hoppingEnbld, mBuf);
13802    CMCHKPK(oduUnpackUInt8, param->nDmrs, mBuf);
13803    CMCHKPK(oduUnpackUInt32, param->modType, mBuf);
13804    CMCHKPK(oduUnpackUInt8, param->numRb, mBuf);
13805    CMCHKPK(oduUnpackUInt8, param->rbStart, mBuf);
13806    CMCHKPK(oduUnpackUInt16, param->size, mBuf);
13807
13808    return ROK;
13809 }
13810
13811
13812 \f
13813 /***********************************************************
13814 *
13815 *     Func : cmUnpkTfuUeUlSchRecpInfo
13816 *
13817 *
13818 *     Desc : This structure is sent from scheduler to PHY in order to request the
13819   * reception of UEs data on ULSCH.
13820 *
13821 *
13822 *     Ret  : S16
13823 *
13824 *     Notes:
13825 *
13826 *     File  : 
13827 *
13828 **********************************************************/
13829 #ifdef ANSI
13830 S16 cmUnpkTfuUeUlSchRecpInfo
13831 (
13832 TfuUeUlSchRecpInfo *param,
13833 Buffer *mBuf
13834 )
13835 #else
13836 S16 cmUnpkTfuUeUlSchRecpInfo(param, mBuf)
13837 TfuUeUlSchRecpInfo *param;
13838 Buffer *mBuf;
13839 #endif
13840 {
13841
13842
13843    CMCHKUNPK(oduPackUInt16, &param->size, mBuf);
13844    CMCHKUNPK(oduPackUInt8, &param->rbStart, mBuf);
13845    CMCHKUNPK(oduPackUInt8, &param->numRb, mBuf);
13846    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->modType, mBuf);
13847    CMCHKUNPK(oduPackUInt8, &param->nDmrs, mBuf);
13848    CMCHKUNPK(oduPackUInt8, &param->hoppingEnbld, mBuf);
13849    CMCHKUNPK(oduPackUInt8, &param->hoppingBits, mBuf);
13850    CMCHKUNPK(oduPackUInt8, &param->isRtx, mBuf);
13851    CMCHKUNPK(oduPackUInt8, &param->ndi, mBuf);
13852    CMCHKUNPK(oduPackUInt8, &param->rv, mBuf);
13853    CMCHKUNPK(oduPackUInt8, &param->harqProcId, mBuf);
13854    CMCHKUNPK(oduPackUInt8, &param->txMode, mBuf);
13855    CMCHKUNPK(oduPackUInt8, &param->crntTxNb, mBuf);
13856    CMCHKUNPK(oduPackUInt8, &param->nSrs, mBuf);
13857    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
13858 #ifdef TFU_5GTF 
13859    CMCHKUNPK(oduPackUInt8, &param->rbgStart, mBuf);
13860    CMCHKUNPK(oduPackUInt8, &param->numRbg, mBuf);
13861    CMCHKUNPK(oduPackUInt8, &param->xPUSCHRange, mBuf);
13862    CMCHKUNPK(oduPackUInt8, &param->nAntPortLayer, mBuf);
13863    CMCHKUNPK(oduPackUInt8, &param->SCID, mBuf);
13864    CMCHKUNPK(oduPackUInt8, &param->PMI, mBuf);
13865    CMCHKUNPK(oduPackUInt8, &param->uciWoTBFlag, mBuf);
13866    CMCHKUNPK(oduPackUInt8, &param->beamIndex, mBuf);
13867 #endif
13868    return ROK;
13869 }
13870
13871
13872 \f
13873 /***********************************************************
13874 *
13875 *     Func : cmPkTfuUePuschCqiRecpInfo
13876 *
13877 *
13878 *     Desc : This structure is sent from scheduler to PHY in order to request the
13879   * reception of CQI_RI info on PUSCH.
13880 *
13881 *
13882 *     Ret  : S16
13883 *
13884 *     Notes:
13885 *
13886 *     File  : 
13887 *
13888 **********************************************************/
13889 #ifdef ANSI
13890 S16 cmPkTfuUePuschCqiRecpInfo
13891 (
13892 TfuUePuschCqiRecpInfo *param,
13893 Buffer *mBuf
13894 )
13895 #else
13896 S16 cmPkTfuUePuschCqiRecpInfo(param, mBuf)
13897 TfuUePuschCqiRecpInfo *param;
13898 Buffer *mBuf;
13899 #endif
13900 {
13901
13902    uint32_t idx = 0;
13903
13904    CMCHKPK(oduUnpackUInt8, param->riBetaOff, mBuf);
13905    CMCHKPK(oduUnpackUInt8, param->cqiBetaOff, mBuf);
13906    for (idx = 0; idx < param->cCNum; idx++)
13907    {
13908       CMCHKPK(cmPkTknUInt8, &param->riSz[idx], mBuf);
13909       CMCHKPK(oduUnpackUInt8, param->cqiPmiSzRn1[idx], mBuf);
13910       CMCHKPK(oduUnpackUInt8, param->cqiPmiSzR1[idx], mBuf);
13911    }
13912    CMCHKPK(oduUnpackUInt8, param->cCNum, mBuf);
13913    CMCHKPK(oduUnpackUInt8, param->reportType, mBuf);
13914    return ROK;
13915 }
13916
13917
13918 \f
13919 /***********************************************************
13920 *
13921 *     Func : cmUnpkTfuUePuschCqiRecpInfo
13922 *
13923 *
13924 *     Desc : This structure is sent from scheduler to PHY in order to request the
13925   * reception of CQI_RI info on PUSCH.
13926 *
13927 *
13928 *     Ret  : S16
13929 *
13930 *     Notes:
13931 *
13932 *     File  : 
13933 *
13934 **********************************************************/
13935 #ifdef ANSI
13936 S16 cmUnpkTfuUePuschCqiRecpInfo
13937 (
13938 TfuUePuschCqiRecpInfo *param,
13939 Buffer *mBuf
13940 )
13941 #else
13942 S16 cmUnpkTfuUePuschCqiRecpInfo(param, mBuf)
13943 TfuUePuschCqiRecpInfo *param;
13944 Buffer *mBuf;
13945 #endif
13946 {
13947
13948    uint32_t idx;
13949
13950    CMCHKUNPK(oduPackUInt8, &param->reportType, mBuf);
13951    CMCHKUNPK(oduPackUInt8, &param->cCNum, mBuf);
13952    for (idx = param->cCNum; idx > 0; idx--)
13953    {
13954       CMCHKUNPK(oduPackUInt8, &param->cqiPmiSzR1[idx-1], mBuf);
13955       CMCHKUNPK(oduPackUInt8, &param->cqiPmiSzRn1[idx-1], mBuf);
13956       CMCHKUNPK(cmUnpkTknUInt8, &param->riSz[idx-1], mBuf);
13957    }
13958    CMCHKUNPK(oduPackUInt8, &param->cqiBetaOff, mBuf);
13959    CMCHKUNPK(oduPackUInt8, &param->riBetaOff, mBuf);
13960    return ROK;
13961 }
13962
13963
13964 \f
13965 /***********************************************************
13966 *
13967 *     Func : cmPkTfuUePuschHqRecpInfo
13968 *
13969 *
13970 *     Desc : This structure is sent from scheduler to PHY in order to request the
13971   * reception of Harq info on PUSCH.
13972 *
13973 *
13974 *     Ret  : S16
13975 *
13976 *     Notes:
13977 *
13978 *     File  : 
13979 *
13980 **********************************************************/
13981 #ifdef ANSI
13982 S16 cmPkTfuUePuschHqRecpInfo
13983 (
13984 TfuUePuschHqRecpInfo *param,
13985 Buffer *mBuf
13986 )
13987 #else
13988 S16 cmPkTfuUePuschHqRecpInfo(param, mBuf)
13989 TfuUePuschHqRecpInfo *param;
13990 Buffer *mBuf;
13991 #endif
13992 {
13993
13994
13995
13996 #ifdef TFU_TDD
13997    CMCHKPK(oduUnpackUInt8, param->ulDai, mBuf);
13998    CMCHKPK(oduUnpackUInt8, param->nBundled, mBuf);
13999    CMCHKPK(oduUnpackUInt32, param->hqFdbkMode, mBuf);
14000 #endif
14001    CMCHKPK(oduUnpackUInt8, param->hqBetaOff, mBuf);
14002    CMCHKPK(oduUnpackUInt8, param->hqSz, mBuf);
14003    return ROK;
14004 }
14005
14006
14007 \f
14008 /***********************************************************
14009 *
14010 *     Func : cmUnpkTfuUePuschHqRecpInfo
14011 *
14012 *
14013 *     Desc : This structure is sent from scheduler to PHY in order to request the
14014   * reception of Harq info on PUSCH.
14015 *
14016 *
14017 *     Ret  : S16
14018 *
14019 *     Notes:
14020 *
14021 *     File  : 
14022 *
14023 **********************************************************/
14024 #ifdef ANSI
14025 S16 cmUnpkTfuUePuschHqRecpInfo
14026 (
14027 TfuUePuschHqRecpInfo *param,
14028 Buffer *mBuf
14029 )
14030 #else
14031 S16 cmUnpkTfuUePuschHqRecpInfo(param, mBuf)
14032 TfuUePuschHqRecpInfo *param;
14033 Buffer *mBuf;
14034 #endif
14035 {
14036
14037
14038    CMCHKUNPK(oduPackUInt8, &param->hqSz, mBuf);
14039    CMCHKUNPK(oduPackUInt8, &param->hqBetaOff, mBuf);
14040
14041 #ifdef TFU_TDD
14042    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->hqFdbkMode, mBuf);
14043    CMCHKUNPK(oduPackUInt8, &param->nBundled, mBuf);
14044    CMCHKUNPK(oduPackUInt8, &param->ulDai, mBuf);
14045 #endif
14046    return ROK;
14047 }
14048
14049
14050 \f
14051 /***********************************************************
14052 *
14053 *     Func : cmPkTfuUePuschRecpReq
14054 *
14055 *
14056 *     Desc : This structure is sent from scheduler to PHY in order to request the
14057   * reception of UEs data on PUSCH. This may contain the following: 
14058   * -# Data
14059   * -# Data + SRS
14060   * -# Data + HARQ
14061   * -# Data + HARQ + SRS
14062   * -# Data + CQI/RI
14063   * -# Data + CQI/RI + SRS
14064   * -# Data + CQI/RI + HARQ
14065   * -# Data + CQI/RI + HARQ + SRS
14066 *
14067 *
14068 *     Ret  : S16
14069 *
14070 *     Notes:
14071 *
14072 *     File  : 
14073 *
14074 **********************************************************/
14075 #ifdef ANSI
14076 S16 cmPkTfuUePuschRecpReq
14077 (
14078 TfuUePuschRecpReq *param,
14079 Buffer *mBuf
14080 )
14081 #else
14082 S16 cmPkTfuUePuschRecpReq(param, mBuf)
14083 TfuUePuschRecpReq *param;
14084 Buffer *mBuf;
14085 #endif
14086 {
14087
14088
14089    CMCHKPK(cmPkTknUInt8, &param->initialNumRbs, mBuf);
14090    CMCHKPK(cmPkTknUInt8, &param->initialNSrs, mBuf);
14091    CMCHKPK(cmPkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14092    CMCHKPK(cmPkTfuUePuschHqRecpInfo, &param->hqInfo, mBuf);
14093    CMCHKPK(cmPkTfuUePuschCqiRecpInfo, &param->cqiRiInfo, mBuf);
14094    CMCHKPK(cmPkTfuUeUlSchRecpInfo, &param->ulSchInfo, mBuf);
14095    CMCHKPK(oduUnpackUInt32, param->rcpInfo, mBuf);
14096    return ROK;
14097 }
14098
14099
14100 \f
14101 /***********************************************************
14102 *
14103 *     Func : cmUnpkTfuUePuschRecpReq
14104 *
14105 *
14106 *     Desc : This structure is sent from scheduler to PHY in order to request the
14107   * reception of UEs data on PUSCH. This may contain the following: 
14108   * -# Data
14109   * -# Data + SRS
14110   * -# Data + HARQ
14111   * -# Data + HARQ + SRS
14112   * -# Data + CQI/RI
14113   * -# Data + CQI/RI + SRS
14114   * -# Data + CQI/RI + HARQ
14115   * -# Data + CQI/RI + HARQ + SRS
14116 *
14117 *
14118 *     Ret  : S16
14119 *
14120 *     Notes:
14121 *
14122 *     File  : 
14123 *
14124 **********************************************************/
14125 #ifdef ANSI
14126 S16 cmUnpkTfuUePuschRecpReq
14127 (
14128 TfuUePuschRecpReq *param,
14129 Buffer *mBuf
14130 )
14131 #else
14132 S16 cmUnpkTfuUePuschRecpReq(param, mBuf)
14133 TfuUePuschRecpReq *param;
14134 Buffer *mBuf;
14135 #endif
14136 {
14137
14138
14139    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->rcpInfo, mBuf);
14140    CMCHKUNPK(cmUnpkTfuUeUlSchRecpInfo, &param->ulSchInfo, mBuf);
14141    CMCHKUNPK(cmUnpkTfuUePuschCqiRecpInfo, &param->cqiRiInfo, mBuf);
14142    CMCHKUNPK(cmUnpkTfuUePuschHqRecpInfo, &param->hqInfo, mBuf);
14143    CMCHKUNPK(cmUnpkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14144    CMCHKUNPK(cmUnpkTknUInt8, &param->initialNSrs, mBuf);
14145    CMCHKUNPK(cmUnpkTknUInt8, &param->initialNumRbs, mBuf);
14146    return ROK;
14147 }
14148
14149
14150 \f
14151 /***********************************************************
14152 *
14153 *     Func : cmPkTfuUeRecpReqInfo
14154 *
14155 *
14156 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
14157  * data. This contains information needed by PHY to decode the data sent by the
14158  * UE.
14159 *
14160 *
14161 *     Ret  : S16
14162 *
14163 *     Notes:
14164 *
14165 *     File  : 
14166 *
14167 **********************************************************/
14168 #ifdef ANSI
14169 S16 cmPkTfuUeRecpReqInfo
14170 (
14171 TfuUeRecpReqInfo *param,
14172 Buffer *mBuf
14173 )
14174 #else
14175 S16 cmPkTfuUeRecpReqInfo(param, mBuf)
14176 TfuUeRecpReqInfo *param;
14177 Buffer *mBuf;
14178 #endif
14179 {
14180
14181
14182       switch(param->type) {
14183          case TFU_RECP_REQ_PUSCH:
14184             CMCHKPK(cmPkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
14185             break;
14186          case TFU_RECP_REQ_PUCCH:
14187             CMCHKPK(cmPkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
14188             break;
14189          default :
14190             return RFAILED;
14191       }
14192    CMCHKPK(oduUnpackUInt32, param->type, mBuf);
14193 #ifdef TFU_5GTF
14194    CMCHKPK(oduUnpackUInt8, param->groupId, mBuf);
14195 #endif /* TFU_5GTF */
14196    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
14197    return ROK;
14198 }
14199
14200
14201 \f
14202 /***********************************************************
14203 *
14204 *     Func : cmUnpkTfuUeRecpReqInfo
14205 *
14206 *
14207 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
14208  * data. This contains information needed by PHY to decode the data sent by the
14209  * UE.
14210 *
14211 *
14212 *     Ret  : S16
14213 *
14214 *     Notes:
14215 *
14216 *     File  : 
14217 *
14218 **********************************************************/
14219 #ifdef ANSI
14220 S16 cmUnpkTfuUeRecpReqInfo
14221 (
14222 TfuUeRecpReqInfo *param,
14223 Buffer *mBuf
14224 )
14225 #else
14226 S16 cmUnpkTfuUeRecpReqInfo(param, mBuf)
14227 TfuUeRecpReqInfo *param;
14228 Buffer *mBuf;
14229 #endif
14230 {
14231
14232
14233    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
14234 #ifdef TFU_5GTF
14235    CMCHKUNPK(oduPackUInt8, &param->groupId, mBuf);
14236 #endif /* TFU_5GTF */
14237    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->type, mBuf);
14238       switch(param->type) {
14239          case TFU_RECP_REQ_PUCCH:
14240             CMCHKUNPK(cmUnpkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
14241             break;
14242          case TFU_RECP_REQ_PUSCH:
14243             CMCHKUNPK(cmUnpkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
14244             break;
14245          default :
14246             return RFAILED;
14247       }
14248    return ROK;
14249 }
14250 #endif /* TFU_UPGRADE */
14251 #ifndef TFU_UPGRADE  /* TFU_UPGRADE */
14252 /***********************************************************
14253 *
14254 *     Func : cmPkTfuUePucchRecpReq
14255 *
14256 *
14257 *     Desc : This structure is sent from Scheduler to PHY in order to request the
14258   * reception of an UEs data on PUCCH. This may contain the following: 
14259   * -# HARQ-ACK 
14260   * -# Scheduling Request (SR)
14261   * -# HARQ-ACK and SR
14262   * -# CQI
14263   * -# CQI and HARQ-ACK
14264 *
14265 *
14266 *     Ret  : S16
14267 *
14268 *     Notes:
14269 *
14270 *     File  : 
14271 *
14272 **********************************************************/
14273 #ifdef ANSI
14274 S16 cmPkTfuUePucchRecpReq
14275 (
14276 TfuUePucchRecpReq *param,
14277 Buffer *mBuf
14278 )
14279 #else
14280 S16 cmPkTfuUePucchRecpReq(param, mBuf)
14281 TfuUePucchRecpReq *param;
14282 Buffer *mBuf;
14283 #endif
14284 {
14285
14286 #ifdef TFU_TDD
14287    S32 i;
14288 #endif
14289
14290
14291 #ifdef TFU_TDD
14292    for (i=TFU_MAX_M-1; i >= 0; i--) {
14293       CMCHKPK(oduUnpackUInt8, param->p[i], mBuf);
14294    }
14295    for (i=TFU_MAX_M-1; i >= 0; i--) {
14296       CMCHKPK(oduUnpackUInt8, param->m[i], mBuf);
14297    }
14298    CMCHKPK(oduUnpackUInt8, param->M, mBuf);
14299    CMCHKPK(oduUnpackUInt8, param->multCnt, mBuf);
14300
14301 #endif
14302    CMCHKPK(oduUnpackUInt32, param->type, mBuf);
14303       switch(param->hqType) {
14304          case TFU_HQ_RECP_REQ_N1PUCCH:
14305             CMCHKPK(oduUnpackUInt16, param->t.n1Pucch, mBuf);
14306             break;
14307    
14308 #ifdef TFU_TDD
14309          case TFU_HQ_RECP_REQ_NORMAL:
14310             for (i=TFU_MAX_M-1; i >= 0; i--) {
14311                CMCHKPK(oduUnpackUInt16, param->t.nCce[i], mBuf);
14312             }
14313             break;
14314    
14315 #endif
14316    
14317 #ifndef TFU_TDD
14318          case TFU_HQ_RECP_REQ_NORMAL:
14319             CMCHKPK(oduUnpackUInt16, param->t.nCce, mBuf);
14320             break;
14321    
14322 #endif
14323          default :
14324             return RFAILED;
14325       }
14326    CMCHKPK(oduUnpackUInt32, param->hqType, mBuf);
14327    return ROK;
14328 }
14329
14330
14331 \f
14332 /***********************************************************
14333 *
14334 *     Func : cmUnpkTfuUePucchRecpReq
14335 *
14336 *
14337 *     Desc : This structure is sent from Scheduler to PHY in order to request the
14338   * reception of an UEs data on PUCCH. This may contain the following: 
14339   * -# HARQ-ACK 
14340   * -# Scheduling Request (SR)
14341   * -# HARQ-ACK and SR
14342   * -# CQI
14343   * -# CQI and HARQ-ACK
14344 *
14345 *
14346 *     Ret  : S16
14347 *
14348 *     Notes:
14349 *
14350 *     File  : 
14351 *
14352 **********************************************************/
14353 #ifdef ANSI
14354 S16 cmUnpkTfuUePucchRecpReq
14355 (
14356 TfuUePucchRecpReq *param,
14357 Buffer *mBuf
14358 )
14359 #else
14360 S16 cmUnpkTfuUePucchRecpReq(param, mBuf)
14361 TfuUePucchRecpReq *param;
14362 Buffer *mBuf;
14363 #endif
14364 {
14365
14366 #ifdef TFU_TDD
14367    S32 i;
14368 #endif
14369
14370    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->hqType, mBuf);
14371       switch(param->hqType) {
14372    
14373 #ifndef TFU_TDD
14374          case TFU_HQ_RECP_REQ_NORMAL:
14375             CMCHKUNPK(oduPackUInt16, &param->t.nCce, mBuf);
14376             break;
14377    
14378 #endif
14379    
14380 #ifdef TFU_TDD
14381          case TFU_HQ_RECP_REQ_NORMAL:
14382             for (i=0; i<TFU_MAX_M; i++) {
14383                CMCHKUNPK(oduPackUInt16, &param->t.nCce[i], mBuf);
14384             }
14385             break;
14386    
14387 #endif
14388          case TFU_HQ_RECP_REQ_N1PUCCH:
14389             CMCHKUNPK(oduPackUInt16, &param->t.n1Pucch, mBuf);
14390             break;
14391          default :
14392             return RFAILED;
14393       }
14394    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->type, mBuf);
14395
14396 #ifdef TFU_TDD
14397    CMCHKUNPK(oduPackUInt8, &param->multCnt, mBuf);
14398    CMCHKUNPK(oduPackUInt8, &param->M, mBuf);
14399    for (i=0; i<TFU_MAX_M; i++) {
14400       CMCHKUNPK(oduPackUInt8, &param->m[i], mBuf);
14401    }
14402    for (i=0; i<TFU_MAX_M; i++) {
14403       CMCHKUNPK(oduPackUInt8, &param->p[i], mBuf);
14404    }
14405
14406 #endif
14407    return ROK;
14408 }
14409
14410
14411 \f
14412 /***********************************************************
14413 *
14414 *     Func : cmPkTfuUeMsg3RecpReq
14415 *
14416 *
14417 *     Desc : This structure is sent from scheduler to PHY in order to request the
14418   * reception of UEs data sent as MSG3 for Random access.
14419 *
14420 *
14421 *     Ret  : S16
14422 *
14423 *     Notes:
14424 *
14425 *     File  : 
14426 *
14427 **********************************************************/
14428 #ifdef ANSI
14429 S16 cmPkTfuUeMsg3RecpReq
14430 (
14431 TfuUeMsg3RecpReq *param,
14432 Buffer *mBuf
14433 )
14434 #else
14435 S16 cmPkTfuUeMsg3RecpReq(param, mBuf)
14436 TfuUeMsg3RecpReq *param;
14437 Buffer *mBuf;
14438 #endif
14439 {
14440
14441
14442    CMCHKPK(oduUnpackUInt32, param->modType, mBuf);
14443    CMCHKPK(oduUnpackUInt16, param->size, mBuf);
14444    /*ccpu00128993 - ADD - fix for msg3 softcombining bug*/
14445    CMCHKPK(oduUnpackUInt8, param->nDmrs, mBuf);
14446    CMCHKPK(oduUnpackUInt8, param->rv, mBuf);
14447    CMCHKPK(oduUnpackUInt8, param->ndi, mBuf);
14448    CMCHKPK(oduUnpackUInt8, param->harqProcId, mBuf);
14449    CMCHKPK(oduUnpackUInt8, param->isRtx, mBuf);
14450    CMCHKPK(oduUnpackUInt8, param->ulDelay, mBuf);
14451    CMCHKPK(oduUnpackUInt8, param->expCqi, mBuf);
14452    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
14453    CMCHKPK(oduUnpackUInt8, param->numRb, mBuf);
14454    CMCHKPK(oduUnpackUInt8, param->rbStart, mBuf);
14455    CMCHKPK(oduUnpackUInt8, param->hoppingEnbld, mBuf);
14456    return ROK;
14457 }
14458
14459
14460 \f
14461 /***********************************************************
14462 *
14463 *     Func : cmUnpkTfuUeMsg3RecpReq
14464 *
14465 *
14466 *     Desc : This structure is sent from scheduler to PHY in order to request the
14467   * reception of UEs data sent as MSG3 for Random access.
14468 *
14469 *
14470 *     Ret  : S16
14471 *
14472 *     Notes:
14473 *
14474 *     File  : 
14475 *
14476 **********************************************************/
14477 #ifdef ANSI
14478 S16 cmUnpkTfuUeMsg3RecpReq
14479 (
14480 TfuUeMsg3RecpReq *param,
14481 Buffer *mBuf
14482 )
14483 #else
14484 S16 cmUnpkTfuUeMsg3RecpReq(param, mBuf)
14485 TfuUeMsg3RecpReq *param;
14486 Buffer *mBuf;
14487 #endif
14488 {
14489
14490
14491    CMCHKUNPK(oduPackUInt8, &param->hoppingEnbld, mBuf);
14492    CMCHKUNPK(oduPackUInt8, &param->rbStart, mBuf);
14493    CMCHKUNPK(oduPackUInt8, &param->numRb, mBuf);
14494    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
14495    CMCHKUNPK(oduPackUInt8, &param->expCqi, mBuf);
14496    CMCHKUNPK(oduPackUInt8, &param->ulDelay, mBuf);
14497    CMCHKUNPK(oduPackUInt8, &param->isRtx, mBuf);
14498    /*ccpu00128993 - ADD - fix for msg3 softcombining bug*/
14499    CMCHKUNPK(oduPackUInt8, &param->harqProcId, mBuf);
14500    CMCHKUNPK(oduPackUInt8, &param->ndi, mBuf);
14501    CMCHKUNPK(oduPackUInt8, &param->rv, mBuf);
14502    CMCHKUNPK(oduPackUInt8, &param->nDmrs, mBuf);
14503    CMCHKUNPK(oduPackUInt16, &param->size, mBuf);
14504    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->modType, mBuf);
14505    return ROK;
14506 }
14507
14508
14509 \f
14510 /***********************************************************
14511 *
14512 *     Func : cmPkTfuUePuschRecpReq
14513 *
14514 *
14515 *     Desc : This structure is sent from scheduler to PHY in order to request the
14516   * reception of UEs data on PUSCH. This may contain the following: 
14517   * -# Data
14518   * -# Data + CQI and RI
14519   * -# Data + CQI and HARQ
14520 *
14521 *
14522 *     Ret  : S16
14523 *
14524 *     Notes:
14525 *
14526 *     File  : 
14527 *
14528 **********************************************************/
14529 #ifdef ANSI
14530 S16 cmPkTfuUePuschRecpReq
14531 (
14532 TfuUePuschRecpReq *param,
14533 Buffer *mBuf
14534 )
14535 #else
14536 S16 cmPkTfuUePuschRecpReq(param, mBuf)
14537 TfuUePuschRecpReq *param;
14538 Buffer *mBuf;
14539 #endif
14540 {
14541
14542
14543    CMCHKPK(oduUnpackUInt32, param->modType, mBuf);
14544    CMCHKPK(oduUnpackUInt16, param->size, mBuf);
14545    CMCHKPK(oduUnpackUInt32, param->mode, mBuf);
14546    CMCHKPK(oduUnpackUInt8, param->expHarq, mBuf);
14547    CMCHKPK(oduUnpackUInt8, param->expCqi, mBuf);
14548    CMCHKPK(oduUnpackUInt8, param->nDmrs, mBuf);
14549    CMCHKPK(oduUnpackUInt8, param->rv, mBuf);
14550    CMCHKPK(oduUnpackUInt8, param->isRtx, mBuf);
14551    CMCHKPK(oduUnpackUInt8, param->ndi, mBuf);
14552    CMCHKPK(oduUnpackUInt8, param->harqProcId, mBuf);
14553    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
14554    CMCHKPK(oduUnpackUInt8, param->numRb, mBuf);
14555    CMCHKPK(oduUnpackUInt8, param->rbStart, mBuf);
14556    CMCHKPK(oduUnpackUInt8, param->hoppingBits, mBuf);
14557    CMCHKPK(oduUnpackUInt8, param->hoppingEnbld, mBuf);
14558    return ROK;
14559 }
14560
14561
14562 \f
14563 /***********************************************************
14564 *
14565 *     Func : cmUnpkTfuUePuschRecpReq
14566 *
14567 *
14568 *     Desc : This structure is sent from scheduler to PHY in order to request the
14569   * reception of UEs data on PUSCH. This may contain the following: 
14570   * -# Data
14571   * -# Data + CQI and RI
14572   * -# Data + CQI and HARQ
14573 *
14574 *
14575 *     Ret  : S16
14576 *
14577 *     Notes:
14578 *
14579 *     File  : 
14580 *
14581 **********************************************************/
14582 #ifdef ANSI
14583 S16 cmUnpkTfuUePuschRecpReq
14584 (
14585 TfuUePuschRecpReq *param,
14586 Buffer *mBuf
14587 )
14588 #else
14589 S16 cmUnpkTfuUePuschRecpReq(param, mBuf)
14590 TfuUePuschRecpReq *param;
14591 Buffer *mBuf;
14592 #endif
14593 {
14594
14595
14596    CMCHKUNPK(oduPackUInt8, &param->hoppingEnbld, mBuf);
14597    CMCHKUNPK(oduPackUInt8, &param->hoppingBits, mBuf);
14598    CMCHKUNPK(oduPackUInt8, &param->rbStart, mBuf);
14599    CMCHKUNPK(oduPackUInt8, &param->numRb, mBuf);
14600    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
14601    CMCHKUNPK(oduPackUInt8, &param->harqProcId, mBuf);
14602    CMCHKUNPK(oduPackUInt8, &param->ndi, mBuf);
14603    CMCHKUNPK(oduPackUInt8, &param->isRtx, mBuf);
14604    CMCHKUNPK(oduPackUInt8, &param->rv, mBuf);
14605    CMCHKUNPK(oduPackUInt8, &param->nDmrs, mBuf);
14606    CMCHKUNPK(oduPackUInt8, &param->expCqi, mBuf);
14607    CMCHKUNPK(oduPackUInt8, &param->expHarq, mBuf);
14608    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->mode, mBuf);
14609    CMCHKUNPK(oduPackUInt16, &param->size, mBuf);
14610    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->modType, mBuf);
14611    return ROK;
14612 }
14613
14614
14615 \f
14616 /***********************************************************
14617 *
14618 *     Func : cmPkTfuUeRecpReqInfo
14619 *
14620 *
14621 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
14622  * data. This contains information needed by PHY to decode the data sent by the
14623  * UE.
14624 *
14625 *
14626 *     Ret  : S16
14627 *
14628 *     Notes:
14629 *
14630 *     File  : 
14631 *
14632 **********************************************************/
14633 #ifdef ANSI
14634 S16 cmPkTfuUeRecpReqInfo
14635 (
14636 TfuUeRecpReqInfo *param,
14637 Buffer *mBuf
14638 )
14639 #else
14640 S16 cmPkTfuUeRecpReqInfo(param, mBuf)
14641 TfuUeRecpReqInfo *param;
14642 Buffer *mBuf;
14643 #endif
14644 {
14645
14646
14647       switch(param->type) {
14648          case TFU_RECP_REQ_PUSCH:
14649             CMCHKPK(cmPkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
14650             break;
14651          case TFU_RECP_REQ_MSG3:
14652             CMCHKPK(cmPkTfuUeMsg3RecpReq, &param->t.msg3RecpReq, mBuf);
14653             break;
14654          case TFU_RECP_REQ_PUCCH:
14655             CMCHKPK(cmPkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
14656             break;
14657          default :
14658             return RFAILED;
14659       }
14660    CMCHKPK(oduUnpackUInt32, param->type, mBuf);
14661    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
14662    return ROK;
14663 }
14664
14665
14666 \f
14667 /***********************************************************
14668 *
14669 *     Func : cmUnpkTfuUeRecpReqInfo
14670 *
14671 *
14672 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
14673  * data. This contains information needed by PHY to decode the data sent by the
14674  * UE.
14675 *
14676 *
14677 *     Ret  : S16
14678 *
14679 *     Notes:
14680 *
14681 *     File  : 
14682 *
14683 **********************************************************/
14684 #ifdef ANSI
14685 S16 cmUnpkTfuUeRecpReqInfo
14686 (
14687 TfuUeRecpReqInfo *param,
14688 Buffer *mBuf
14689 )
14690 #else
14691 S16 cmUnpkTfuUeRecpReqInfo(param, mBuf)
14692 TfuUeRecpReqInfo *param;
14693 Buffer *mBuf;
14694 #endif
14695 {
14696
14697
14698    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
14699    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->type, mBuf);
14700       switch(param->type) {
14701          case TFU_RECP_REQ_PUCCH:
14702             CMCHKUNPK(cmUnpkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
14703             break;
14704          case TFU_RECP_REQ_MSG3:
14705             CMCHKUNPK(cmUnpkTfuUeMsg3RecpReq, &param->t.msg3RecpReq, mBuf);
14706             break;
14707          case TFU_RECP_REQ_PUSCH:
14708             CMCHKUNPK(cmUnpkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
14709             break;
14710          default :
14711             return RFAILED;
14712       }
14713    return ROK;
14714 }
14715
14716
14717 #endif /* ifndef TFU_UPGRADE */
14718 /*LAA: Packing and Unpacking*/
14719
14720 /***********************************************************
14721 *
14722 *     Func : cmPkTfuErrIndInfo
14723 *
14724 *
14725 *     Desc : This structure contains information that is passed as a part of
14726 *     the ERR indication sent from PHY to MAC.
14727 *
14728 *
14729 *     Ret  : S16
14730 *
14731 *     Notes:
14732 *
14733 *     File  : 
14734 *
14735 **********************************************************/
14736 #ifdef ANSI
14737 PRIVATE S16 cmPkTfuErrIndInfo
14738 (
14739 TfuErrIndInfo *param,
14740 Buffer *mBuf
14741 )
14742 #else
14743 PRIVATE S16 cmPkTfuErrIndInfo(param, mBuf)
14744 TfuErrIndInfo *param;
14745 Buffer *mBuf;
14746 #endif
14747 {
14748
14749
14750    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
14751    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
14752    return ROK;
14753 }
14754 /***********************************************************
14755 *
14756 *     Func : cmUnpkTfuErrIndInfo
14757 *
14758 *
14759 *     Desc : This structure contains information that is passed as a part of the ERR
14760  * indication sent from PHY to MAC.
14761 *
14762 *
14763 *     Ret  : S16
14764 *
14765 *     Notes:
14766 *
14767 *     File  : 
14768 *
14769 **********************************************************/
14770 #ifdef ANSI
14771 PRIVATE S16 cmUnpkTfuErrIndInfo
14772 (
14773 TfuErrIndInfo *param,
14774 Buffer *mBuf
14775 )
14776 #else
14777 PRIVATE S16 cmUnpkTfuErrIndInfo(param, mBuf)
14778 TfuErrIndInfo *param;
14779 Buffer *mBuf;
14780 #endif
14781 {
14782
14783
14784    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
14785    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
14786    return ROK;
14787 }
14788
14789 /***********************************************************
14790 *
14791 *     Func : cmPkTfuErrInd
14792 *
14793 *
14794  *      This API is invoked by PHY to send ERROR INDICATION to scheduler 
14795  *      Currently invoked in the cases when the Unlicensed SCell transmission
14796  *      fails.
14797  *      This API contains the Cell and subframe information for which the
14798  *      transmission failed. 
14799  *           
14800  *  @param[in]  Pst                *pst
14801  *  @param[in]  SuId               suId 
14802  *  @param[in]  TfuErrIndInfo      *errIndInfo 
14803  *  @return  S16
14804  *      -# ROK 
14805  *      -# RFAILED 
14806 *
14807 *
14808 *     Ret  : S16
14809 *
14810 *     Notes:
14811 *
14812 *     File  : 
14813 *
14814 **********************************************************/
14815 #ifdef ANSI
14816 S16 cmPkTfuErrInd
14817 (
14818 Pst * pst,
14819 SuId suId,
14820 TfuErrIndInfo * errInd
14821 )
14822 #else
14823 S16 cmPkTfuErrInd(pst, suId, errInd)
14824 Pst * pst;
14825 SuId suId;
14826 TfuErrIndInfo * errInd;
14827 #endif
14828 {
14829    Buffer *mBuf = NULLP;
14830
14831    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
14832 #if (ERRCLASS & ERRCLS_ADD_RES)
14833       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
14834          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
14835          (ErrVal)ETFU105, (ErrVal)0, "Packing failed");
14836 #endif
14837       SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
14838       return RFAILED;
14839    }
14840    if (pst->selector == ODU_SELECTOR_LC) {
14841       if (cmPkTfuErrIndInfo(errInd, mBuf) != ROK) {
14842 #if (ERRCLASS & ERRCLS_ADD_RES)
14843          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
14844             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
14845             (ErrVal)ETFU106, (ErrVal)0, "Packing failed");
14846 #endif
14847          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
14848          TFU_FREE_MSG(mBuf);
14849          return RFAILED;
14850       }
14851    }
14852    else if(pst->selector == ODU_SELECTOR_LWLC)
14853    {
14854       if (oduPackPointer((PTR)errInd, mBuf) != ROK)
14855       {
14856 #if (ERRCLASS & ERRCLS_ADD_RES)
14857          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
14858             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
14859             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
14860 #endif
14861          
14862          /*MS_FIX:71858:Changed to SPutSBuf as being allocated with SGetSBuf*/
14863          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
14864          TFU_FREE_MSG(mBuf);
14865          return RFAILED;
14866       }
14867    }
14868
14869    if (SPkS16(suId, mBuf) != ROK) {
14870 #if (ERRCLASS & ERRCLS_ADD_RES)
14871       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
14872          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
14873          (ErrVal)ETFU107, (ErrVal)0, "Packing failed");
14874 #endif
14875       SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
14876       TFU_FREE_MSG(mBuf);
14877       return RFAILED;
14878    }
14879    if (pst->selector != ODU_SELECTOR_LWLC) {
14880       if (SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo)) != ROK) {
14881 #if (ERRCLASS & ERRCLS_ADD_RES)
14882       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
14883          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
14884          (ErrVal)ETFU108, (ErrVal)0, "Packing failed");
14885 #endif
14886          TFU_FREE_MSG(mBuf);
14887          return RFAILED;
14888       }
14889    }
14890
14891    pst->event = (Event) EVTTFUERRIND;
14892    return (SPstTsk(pst,mBuf));
14893 }
14894
14895 \f
14896 /***********************************************************
14897 *
14898 *     Func : cmUnpkTfuErrInd
14899 *
14900 *
14901  *      This API is invoked by PHY to send ERROR INDICATION to scheduler 
14902  *      Currently invoked in the cases when the Unlicensed SCell transmission
14903  *      fails.
14904  *      This API contains the Cell and subframe information for which the
14905  *      transmission failed. 
14906  * @param pst Pointer to the post structure.
14907  * @param suId SAP ID of the service user.
14908  * @param errInd Pointer to the TfuErrIndInfo.
14909  * @return ROK/RFAILED
14910 *
14911 *
14912 *     Ret  : S16
14913 *
14914 *     Notes:
14915 *
14916 *     File  : 
14917 *
14918 **********************************************************/
14919 #ifdef ANSI
14920 S16 cmUnpkTfuErrInd
14921 (
14922 TfuErrInd func,
14923 Pst *pst,
14924 Buffer *mBuf
14925 )
14926 #else
14927 S16 cmUnpkTfuErrInd(func, pst, mBuf)
14928 TfuErrInd func;
14929 Pst *pst;
14930 Buffer *mBuf;
14931 #endif
14932 {
14933    SuId suId;
14934    TfuErrIndInfo *errInd;
14935    
14936
14937    if (SUnpkS16(&suId, mBuf) != ROK) {
14938       TFU_FREE_MSG(mBuf);
14939 #if (ERRCLASS & ERRCLS_ADD_RES)
14940       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
14941          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
14942          (ErrVal)ETFU109, (ErrVal)0, "Packing failed");
14943 #endif
14944       return RFAILED;
14945    }
14946    if (pst->selector != ODU_SELECTOR_LWLC) {
14947       if ((SGetSBuf(pst->region, pst->pool, (Data **)&errInd, sizeof(TfuErrIndInfo))) != ROK) {
14948 #if (ERRCLASS & ERRCLS_ADD_RES)
14949          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
14950             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
14951             (ErrVal)ETFU110, (ErrVal)0, "Packing failed");
14952 #endif
14953          TFU_FREE_MSG(mBuf);
14954          return RFAILED;
14955       }
14956    }
14957
14958    if (pst->selector == ODU_SELECTOR_LC) 
14959    {
14960       if (cmUnpkTfuErrIndInfo(errInd, mBuf) != ROK) {
14961          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
14962          TFU_FREE_MSG(mBuf);
14963 #if (ERRCLASS & ERRCLS_ADD_RES)
14964          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
14965                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
14966                (ErrVal)ETFU111, (ErrVal)0, "Packing failed");
14967 #endif
14968          return RFAILED;
14969       }
14970    }
14971    else if(pst->selector == ODU_SELECTOR_LWLC)
14972    {
14973       if (oduUnpackPointer((PTR *)&errInd, mBuf) != ROK)
14974       {
14975 #if (ERRCLASS & ERRCLS_ADD_RES)
14976          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
14977             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
14978             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
14979 #endif
14980          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
14981          TFU_FREE_MSG(mBuf);
14982          return RFAILED;
14983       }
14984    }
14985    TFU_FREE_MSG(mBuf);
14986    /* [ccpu00141698]-MOD- MAC/SCH does not free the TTI ind anymore */
14987    (*func)(pst, suId, errInd);
14988    SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
14989    return ROK;
14990
14991 }
14992 #endif /* if defined(LCTFU) */
14993
14994 /**********************************************************************
14995          End of file
14996  **********************************************************************/